{
	"name": "form/nc/nc-stock/material-need/material-need.json",
	"layout": {
		"component": "nc-form",
		"attribute": {
			"id": "material-need"
		},
		"element": [
			{
				"component": "nc-row",
				"element": [
					{
						"component": "nc-col",
						"attribute": {
							"width": "20em"
						},
						"element": [
							{
								"component": "nc-header",
								"text": "Stock",
								"attribute": {
									"model": "hdr.stock.stock",
									"size": "medium"
								}
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"class": ["nc-end-h"],
							"width": "8em"
						},
						"element": [
							{
								"component": "nc-label",
								"text": "Find product",
								"attribute": {
									"model": "hdr.stock.find_product"
								}
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"width": "15em"
						},
						"element": [
							{
								"component": "nc-input",
								"text": "",
								"attribute": {
									"model": "rec.find_product",
									"v-on:change": "rec.find_work = ''",
									"width": "100%"
								}
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"class": ["nc-end-h", "nc-center-v"],
							"width": "auto"
						},
						"element": [
							{
								"component": "nc-checkbox",
								"attribute": {
									"class": ["nc-margin-right"],
									"model": "rec.save_result"
								},
								"element": [
									{
										"component": "nc-translate",
										"text": "Save result",
										"attribute": {
											"model": "hdr.stock.save_result"
										}
									}
								]
							},
							{
								"component": "nc-col",
								"attribute": {
									"width": "1em"
								}
							},
							{
								"component": "nc-button",
								"attribute": {
									"style": "margin-right: 0px",
									"v-on:click": "update()"
								},
								"element": [
									{
										"component": "nc-icon",
										"attribute": {
											"icon": "search"
										}
									},
									{
										"component": "nc-translate",
										"text": "Update",
										"attribute": {
											"model": "hdr.stock.update"
										}
									}
								]
							}
						]
					}
				]
			},
			{
				"component": "nc-row",
				"element": [
					{
						"component": "nc-col",
						"attribute": {
							"width": "3/4"
						},
						"element": [
							{
								"component": "nc-label",
								"text": "Product with reservations",
								"attribute": {
									"model": "hdr.stock.product_with_reservations"
								}
							},
							{
								"component": "nc-span",
								"text": ": {{ selectedProductCount + ' / ' + productCount }}"
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"width": "auto"
						},
						"element": [
							{
								"component": "nc-label",
								"text": "Stock map",
								"attribute": {
									"model": "hdr.stock.stock_map"
								}
							}
						]
					}
				]
			},
			{
				"component": "nc-row",
				"element": [
					{
						"component": "nc-col",
						"attribute": {
							"width": "3/4"
						},
						"element": [
							{
								"component": "nc-row",
								"element": [
									{
										"component": "nc-grid",
										"attribute": {
											"id": "product",
											":doesExternalFilterPass": "doesExternalFilterPassProduct",
											":isExternalFilterPresent": "() => true",
											"height": "23vh",
											"model": "grid.product",
											"v-on:grid-row-clicked": "gridRowClicked"
										}
									}
								]
							},
							{
								"component": "nc-row",
								"element": [
									{
										"component": "nc-col",
										"attribute": {
											"width": "auto"
										},
										"element": [
											{
												"component": "nc-label",
												"text": "Open work materials",
												"attribute": {
													"model": "hdr.stock.open_work_material"
												}
											},
											{
												"component": "nc-span",
												"text": ": {{ selectedMaterialCount + ' / ' + materialCount }}"
											}
										]
									}
								]
							},
							{
								"component": "nc-row",
								"element": [
									{
										"component": "nc-grid",
										"attribute": {
											"id": "product_material",
											":doesExternalFilterPass": "doesExternalFilterPassProductMaterial",
											":isExternalFilterPresent": "() => true",
											"height": "23vh",
											"model": "grid.product_material",
											"v-on:grid-row-clicked": "gridRowClicked"
										}
									}
								]
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"height": "48vh",
							"width": "auto"
						},
						"element": [
							{
								"component": "nc-rect",
								"attribute": {
									"style": ["margin: 1px"]
								},
								"element": [
									{
										"component": "nc-svg-map",
										"attribute": {
											":highlight": "mapSelected",
											"style": "margin-top: -1.5em;",
											"svg": "img/stock-map.svg",
											"v-model:hover": "mapHover",
											"v-on:click": "mapToggleSelected($event)",
											"v-on:dblclick": "mapDoubleClick($event)"
										}
									}
								]
							}
						]
					}
				]
			},
			{
				"component": "nc-row",
				"element": [
					{
						"component": "nc-col",
						"attribute": {
							"width": "auto"
						},
						"element": [
							{
								"component": "nc-label",
								"text": "Open work phases",
								"attribute": {
									"model": "hdr.stock.open_work_phase"
								}
							},
							{
								"component": "nc-span",
								"text": ": {{ selectedWorkCount + ' / ' + workCount }}"
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"class": ["nc-end-h"],
							"width": "6em"
						},
						"element": [
							{
								"component": "nc-label",
								"text": "Find work",
								"attribute": {
									"model": "hdr.stock.find_work"
								}
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"width": "15em"
						},
						"element": [
							{
								"component": "nc-input",
								"text": "",
								"attribute": {
									"model": "rec.find_work",
									"v-on:change": "rec.find_product = ''",
									"width": "100%"
								}
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"width": "auto"
						},
						"element": [
							{
								"component": "nc-checkbox",
								"attribute": {
									"model": "rec.only_material_phases",
									"v-on:click": "checkboxClicked('only_material_phases')"
								},
								"element": [
									{
										"component": "nc-translate",
										"text": "Only material phases",
										"attribute": {
											"model": "hdr.stock.only_material_phases"
										}
									}
								]
							}
						]
					}
				]
			},
			{
				"component": "nc-row",
				"element": [
					{
						"component": "nc-grid",
						"attribute": {
							"id": "product_work",
							":doesExternalFilterPass": "doesExternalFilterPassProductWork",
							":isExternalFilterPresent": "() => true",
							"height": "calc(54vh - 15em)",
							"model": "grid.product_work",
							"v-on:grid-row-clicked": "gridRowClicked"
						}
					}
				]
			}
		]
	}
}
