{
	"name": "form/nc/convert/convert-define.html/layout.json",
	"layout": {
		"component": "nc-root",
		"comment": "convert_define.pug\nCreated by PKo on 22.12.14.\n\n\nuse pug include here instead of nc-include - for speed",
		"attribute": {
			"id": "convert_define"
		},
		"element": [
			{
				"component": "nc-include",
				"attribute": {
					"src": "'plugin/convert/convert_header.html'"
				}
			},
			{
				"component": "nc-form",
				"element": [
					{
						"component": "nc-row",
						"element": [
							{
								"component": "nc-col",
								"attribute": {
									"width": "2/12"
								},
								"element": [
									{
										"component": "nc-label",
										"text": "Name",
										"attribute": {
											"model": "hdr.convert_name"
										}
									}
								]
							},
							{
								"component": "nc-col",
								"attribute": {
									"width": "4/12"
								},
								"element": [
									{
										"component": "nc-input",
										"attribute": {
											"type": "text",
											"model": "rec.convert_name",
											"placeholder": "Lisää nimi"
										}
									}
								]
							},
							{
								"component": "nc-col",
								"attribute": {
									"width": "4/12"
								},
								"element": [
									{
										"component": "nc-dropdown",
										"attribute": {
											"model": "rec.convert_name",
											"v-on:change.native": "rec.action='select'; nc.formcallServer($scope,'convert_define', rec)"
										}
									}
								]
							},
							{
								"component": "nc-col",
								"attribute": {
									"width": "1/12"
								},
								"element": [
									{
										"component": "nc-button",
										"text": "Delete",
										"attribute": {
											"name": "Delete",
											"v-on:click": "rec.action='delete'; nc.formcallServer($scope,'convert_define', rec)"
										}
									}
								]
							},
							{
								"component": "nc-col",
								"attribute": {
									"width": "1/12"
								},
								"element": [
									{
										"component": "nc-button",
										"text": "Save",
										"attribute": {
											"name": "Save",
											"v-on:click": "rec.action='save'; nc.formcallServer($scope,'convert_define', rec)"
										}
									}
								]
							}
						]
					},
					{
						"component": "nc-row",
						"element": [
							{
								"component": "nc-col",
								"attribute": {
									"width": "2/12"
								},
								"element": [
									{
										"component": "nc-label",
										"text": "Convert type",
										"attribute": {
											"model": "hdr.convert_type"
										}
									}
								]
							},
							{
								"component": "nc-col",
								"attribute": {
									"width": "4/12"
								},
								"element": [
									{
										"component": "nc-dropdown",
										"attribute": {
											"model": "rec.convert_type"
										}
									}
								]
							}
						]
					},
					{
						"component": "nc-row",
						"element": [
							{
								"component": "nc-col",
								"attribute": {
									"width": "2/12"
								},
								"element": [
									{
										"component": "nc-label",
										"text": "Convert Direction",
										"attribute": {
											"model": "hdr.convert_direction"
										}
									}
								]
							},
							{
								"component": "nc-col",
								"attribute": {
									"width": "2/12"
								},
								"element": [
									{
										"component": "nc-radio",
										"attribute": {
											"value": "normal",
											"model": "rec.convert_direction"
										},
										"element": [
											{
												"component": "nc-translate",
												"text": "Normal",
												"attribute": {
													"model": "rec.convert_direction"
												}
											}
										]
									}
								]
							},
							{
								"component": "nc-col",
								"attribute": {
									"width": "2/12"
								},
								"element": [
									{
										"component": "nc-radio",
										"attribute": {
											"value": "reverse",
											"model": "rec.convert_direction"
										},
										"element": [
											{
												"component": "nc-translate",
												"text": "Reverse",
												"attribute": {
													"model": "rec.convert_direction"
												}
											}
										]
									}
								]
							},
							{
								"component": "nc-col",
								"attribute": {
									"width": "2/12"
								},
								"element": [
									{
										"component": "nc-input",
										"attribute": {
											"type": "text",
											"model": "rec.convert_direction"
										}
									}
								]
							}
						]
					},
					{
						"component": "nc-row",
						"element": [
							{
								"component": "nc-col",
								"attribute": {
									"width": "2/12"
								},
								"element": [
									{
										"component": "nc-label",
										"text": "Show field",
										"attribute": {
											"model": "hdr.show_field"
										}
									}
								]
							},
							{
								"component": "nc-col",
								"attribute": {
									"width": "4/12"
								},
								"element": [
									{
										"component": "nc-checkbox",
										"attribute": {
											"model": "rec.show_field"
										},
										"element": [
											{
												"component": "nc-translate",
												"text": "Row number",
												"attribute": {
													"model": "rec.show_field"
												}
											}
										]
									}
								]
							},
							{
								"component": "nc-col",
								"attribute": {
									"width": "4/12"
								},
								"element": [
									{
										"component": "nc-input",
										"attribute": {
											"type": "text",
											"model": "rec.show_field"
										}
									}
								]
							}
						]
					},
					{
						"component": "nc-row",
						"element": [
							{
								"component": "nc-row",
								"text": "{{popup.definition_field}}",
								"attribute": {
									"width": "1/1"
								}
							}
						]
					},
					{
						"component": "nc-row",
						"element": [
							{
								"component": "nc-row",
								"attribute": {
									"width": "1/1"
								},
								"element": [
									{
										"component": "h2",
										"text": "Import JSON File"
									},
									{
										"component": "input",
										"attribute": {
											"type": "checkbox",
											"model": "newCode"
										}
									},
									{
										"component": "span",
										"text": "New Code"
									},
									{
										"component": "button",
										"text": "Export the whole convert List",
										"attribute": {
											"v-on:click": "makeExport()"
										}
									},
									{
										"component": "button",
										"text": "Export what we want",
										"attribute": {
											"v-on:click": "makeExport1()"
										}
									},
									{
										"component": "a",
										"text": "Download",
										"attribute": {
											"id": "downloadlink",
											"download": "info.json",
											"style": ["display:none"]
										}
									},
									{
										"component": "br"
									},
									{
										"component": "br"
									},
									{
										"component": "nc-row",
										"element": [
											{
												"component": "nc-col",
												"attribute": {
													"width": "4/12"
												},
												"element": [
													{
														"component": "div",
														"text": "{{fromDroppedFiles}}",
														"attribute": {
															"id": "from_dropped_files"
														}
													}
												]
											},
											{
												"component": "nc-col",
												"attribute": {
													"width": "4/12"
												},
												"element": [
													{
														"component": "div",
														"text": "{{toDroppedFiles}}",
														"attribute": {
															"id": "to_dropped_files"
														}
													}
												]
											},
											{
												"component": "nc-col",
												"attribute": {
													"width": "4/12"
												},
												"element": [
													{
														"component": "div",
														"text": "{{convertDroppedFiles}}",
														"attribute": {
															"id": "main_dropped_files"
														}
													}
												]
											}
										]
									},
									{
										"component": "nc-row",
										"element": [
											{
												"component": "nc-col",
												"attribute": {
													"width": "4/12"
												},
												"element": [
													{
														"component": "div",
														"text": "Drop From file here",
														"attribute": {
															"id": "from_drop_zone",
															"class": ["drop_zone"]
														}
													}
												]
											},
											{
												"component": "nc-col",
												"attribute": {
													"width": "4/12"
												},
												"element": [
													{
														"component": "div",
														"text": "Drop To file here",
														"attribute": {
															"id": "to_drop_zone",
															"class": ["drop_zone"]
														}
													}
												]
											},
											{
												"component": "nc-col",
												"attribute": {
													"width": "4/12"
												},
												"element": [
													{
														"component": "div",
														"text": "Drop Main file here",
														"attribute": {
															"id": "main_drop_zone",
															"class": ["drop_zone"]
														}
													}
												]
											}
										]
									},
									{
										"component": "nc-row",
										"element": [
											{
												"component": "nc-col",
												"attribute": {
													"width": "4/12"
												},
												"element": [
													{
														"component": "nc-row",
														"element": [
															{
																"component": "input",
																"attribute": {
																	"type": "text",
																	"": "searchFromText='delivery_d'",
																	"class": ["form-control"],
																	"model": "searchFromText",
																	"placeholder": "Search"
																}
															},
															{
																"component": "div",
																"element": [
																	{
																		"component": "input",
																		"attribute": {
																			"type": "checkbox",
																			"model": "checkboxModel.from",
																			"v-on:click": "order('from', '')"
																		}
																	},
																	{
																		"component": "span",
																		"text": "Sort"
																	}
																]
															},
															{
																"component": "nc-col",
																"text": "Toggle Sort",
																"attribute": {
																	"class": ["btn", "btn-warning", "btn-sm"],
																	"v-on:click": "order('from', 'from')",
																	"v-show": "checkboxModel.from",
																	"width": "6/12"
																}
															},
															{
																"component": "div",
																"attribute": {
																	"class": ["from-control"],
																	"v-show": "convertList.length"
																},
																"element": [
																	{
																		"component": "nc-col",
																		"text": "Toggle Grey Element",
																		"attribute": {
																			"class": ["btn", "btn-warning", "btn-sm"],
																			"v-on:click": "toggleGreyELement('from')",
																			"width": "6/12"
																		}
																	}
																]
															}
														]
													},
													{
														"component": "br"
													},
													{
														"component": "nc-row",
														"attribute": {
															"class": ["btn", "btn-droppable", "thumbnail"],
															"data-drop": "true",
															"jqyoui-droppable": "{beforeDrop: 'onDrop(arrayFromIndex($index), true)'}",
															"model": "fromList",
															"ng-hide": "list.hide",
															"tooltip": "{{list[description]}}",
															"v-for": "list in (sort.from.orderProp ? (fromList | orderBy:sort.from.orderProp:sort.from.direction) : fromList) | filter:filterFnFrom",
															"v-on:click": "copyText('from', arrayFromIndex($index))",
															"width": "1/1"
														},
														"element": [
															{
																"component": "nc-row",
																"text": "{{list[from] | limitTo:50}}\n {{list[description] | limitTo:50 }}",
																"attribute": {
																	":class": "{grey: (list[classCounter]) > 0}",
																	"class": ["btn", "btn-primary", "btn-draggable"],
																	"data-drag": "true",
																	"data-jqyoui-options": "{revert: 'invalid'}",
																	"data-type": "from",
																	"jqyoui-draggable": "{index: {{arrayFromIndex($index)}}}",
																	"width": "1/1"
																},
																"element": [
																	{
																		"component": "br"
																	}
																]
															}
														]
													}
												]
											},
											{
												"component": "nc-col",
												"attribute": {
													"width": "4/12"
												},
												"element": [
													{
														"component": "nc-row",
														"comment": "<div v-show=\"toList.length\" class=\"form-group\">",
														"element": [
															{
																"component": "input",
																"attribute": {
																	"type": "text",
																	"": "searchToText='delivery_c'",
																	"class": ["form-control"],
																	"model": "searchToText",
																	"placeholder": "Search"
																}
															},
															{
																"component": "div",
																"element": [
																	{
																		"component": "input",
																		"attribute": {
																			"type": "checkbox",
																			"model": "checkboxModel.to",
																			"v-on:click": "order('to', '')"
																		}
																	},
																	{
																		"component": "span",
																		"text": "Sort"
																	}
																]
															},
															{
																"component": "nc-col",
																"text": "Toggle Sort",
																"attribute": {
																	"class": ["btn", "btn-warning", "btn-sm"],
																	"v-on:click": "order('to', 'to')",
																	"v-show": "checkboxModel.to",
																	"width": "6/12"
																}
															},
															{
																"component": "div",
																"attribute": {
																	"class": ["from-control"],
																	"v-show": "convertList.length"
																},
																"element": [
																	{
																		"component": "nc-col",
																		"text": "Toggle Grey Element",
																		"attribute": {
																			"class": ["btn", "btn-warning", "btn-sm"],
																			"v-on:click": "toggleGreyELement('to')",
																			"width": "6/12"
																		}
																	}
																]
															}
														]
													},
													{
														"component": "br"
													},
													{
														"component": "nc-row",
														"attribute": {
															"class": ["btn", "btn-droppable", "thumbnail"],
															"data-drop": "true",
															"jqyoui-droppable": "{beforeDrop: 'onDrop(arrayToIndex($index), false)'}",
															"model": "toList",
															"ng-hide": "list.hide",
															"tooltip": "{{list[description]}}",
															"v-for": "list in (sort.to.orderProp ? (toList | orderBy:sort.to.orderProp:sort.to.direction) : toList) | filter:filterFnTo",
															"v-on:click": "copyText('to', arrayToIndex($index))",
															"width": "1/1"
														},
														"element": [
															{
																"component": "nc-row",
																"text": "{{list[to] | limitTo:50}}\n {{list[description] | limitTo:50 }}",
																"attribute": {
																	":class": "{grey: (list[classCounter]) > 0}",
																	"class": ["btn", "btn-default", "btn-draggable"],
																	"data-drag": "true",
																	"data-jqyoui-options": "{revert: 'invalid'}",
																	"data-type": "to",
																	"jqyoui-draggable": "{index: {{arrayToIndex($index)}}}",
																	"width": "1/1"
																},
																"element": [
																	{
																		"component": "br"
																	}
																]
															}
														]
													}
												]
											},
											{
												"component": "nc-col",
												"attribute": {
													"width": "4/12"
												},
												"element": [
													{
														"component": "nc-row",
														"element": [
															{
																"component": "input",
																"attribute": {
																	"type": "text",
																	"class": ["form-control"],
																	"model": "searchConvertText",
																	"placeholder": "Search"
																}
															},
															{
																"component": "div",
																"element": [
																	{
																		"component": "input",
																		"attribute": {
																			"type": "checkbox",
																			"model": "checkboxModel.convert",
																			"v-on:click": "order1('convert', '')"
																		}
																	},
																	{
																		"component": "span",
																		"text": "Sort"
																	}
																]
															},
															{
																"component": "nc-row",
																"text": "Toggle Sort",
																"attribute": {
																	"class": ["btn", "btn-warning", "btn-sm"],
																	"v-on:click": "order1('convert', 'from')",
																	"v-show": "checkboxModel.convert",
																	"width": "1/1"
																}
															}
														]
													},
													{
														"component": "br"
													},
													{
														"component": "div",
														"attribute": {
															"model": "convertList",
															"v-for": "list in (sort.convert.orderProp ? (convertList | orderBy:sort.convert.orderProp:sort.convert.direction) : convertList) | filter:filterFnConvert"
														},
														"element": [
															{
																"component": "nc-row",
																"element": [
																	{
																		"component": "nc-col",
																		"attribute": {
																			"width": "1/12"
																		},
																		"element": [
																			{
																				"component": "div",
																				"attribute": {
																					"v-on:click": "isCollapsed = !isCollapsed"
																				},
																				"element": [
																					{
																						"component": "span",
																						"attribute": {
																							":class": "isCollapsed ? 'glyphicon-plus' : 'glyphicon-minus'",
																							"class": ["glyphicon"]
																						}
																					}
																				]
																			}
																		]
																	},
																	{
																		"component": "nc-col",
																		"attribute": {
																			"width": "11/12"
																		},
																		"element": [
																			{
																				"component": "nc-row",
																				"attribute": {
																					"class": ["btn", "btn-success", "btn-result"],
																					"collapse": "isCollapsed",
																					"width": "1/1"
																				},
																				"element": [
																					{
																						"component": "nc-row",
																						"text": "{{list.hasOwnProperty(from) ? from : ( list.hasOwnProperty(fromStatic) ? fromStatic : fromFunction )}}: {{list.hasOwnProperty(from) ? list[from] : ( list.hasOwnProperty(fromStatic) ? list[fromStatic] : list[fromFunction] ) | limitTo:40}}\n to: {{list[to] | limitTo:40}}",
																						"attribute": {
																							"class": ["text-left"],
																							"v-on:click": "copyText('convert', arrayConvertIndex($index))",
																							"width": "1/1"
																						},
																						"element": [
																							{
																								"component": "br"
																							}
																						]
																					},
																					{
																						"component": "div",
																						"attribute": {
																							"class": ["btn", "btn-default", "btn-sm"],
																							"v-on:click": "resetList(arrayConvertIndex($index), list)"
																						},
																						"element": [
																							{
																								"component": "span",
																								"attribute": {
																									"class": ["i", "far", "fa-minus"]
																								}
																							}
																						]
																					}
																				]
																			}
																		]
																	}
																]
															}
														]
													}
												]
											}
										]
									},
									{
										"component": "nc-row",
										"element": [
											{
												"component": "nc-col",
												"attribute": {
													"width": "4/12"
												},
												"element": [
													{
														"component": "pre",
														"text": "fromList - {{fromList.length}}: {{convertListOutput(fromList) | json}}"
													}
												]
											},
											{
												"component": "nc-col",
												"attribute": {
													"width": "4/12"
												},
												"element": [
													{
														"component": "pre",
														"text": "toList - {{toList.length}}: {{convertListOutput(toList) | json}}"
													}
												]
											},
											{
												"component": "nc-col",
												"comment": "<pre>convertList: {{convertListOutput() | json}}</pre>",
												"attribute": {
													"width": "4/12"
												},
												"element": [
													{
														"component": "pre",
														"text": "convertList - {{convertList.length}}: {{convertListOutput(convertList) | json}}"
													}
												]
											}
										]
									}
								]
							}
						]
					}
				]
			}
		]
	}
}
