{
	"name": "form/nc/nc-define/nc-database-editor/nc-database-editor.json",
	"layout": {
		"component": "nc-form",
		"attribute": {
			"id": "nc-database-editor"
		},
		"element": [
			{
				"component": "nc-row",
				"attribute": {
					"class": ["nc-end-h", "nc-move-down"]
				},
				"element": [
					{
						"component": "nc-col",
						"attribute": {
							"width": "25em"
						},
						"element": [
							{
								"component": "nc-label-dropdown",
								"text": "Connection",
								"attribute": {
									":horizontal": "true",
									"hdr": "hdr.nc_database_editor.connection",
									"model": "rec.connection",
									"v-on:change": "dropdown('connection')"
								}
							}
						]
					}
				]
			},
			{
				"component": "nc-row",
				"element": [
					{
						"component": "nc-tab",
						"attribute": {
							"model": "rec.tab",
							"v-on:change": "changeTab()"
						}
					}
				]
			},
			{
				"component": "nc-row",
				"attribute": {
					"height": "2.5em",
					"class": ["nc-margin-top"]
				},
				"element": [
					{
						"component": "nc-col",
						"attribute": {
							"width": "auto",
							"class": ["nc-center-v"]
						},
						"element": [
							{
								"component": "nc-col",
								"attribute": {
									"width": "auto"
								},
								"element": [
									{
										"component": "nc-label-input",
										"text": "Local database",
										"attribute": {
											"v-if": "rec.tab === 'database'",
											":horizontal": "true",
											"disabled": "disabled",
											"model": "rec.local_organization_id",
											"hdr": "hdr.nc_database_editor.local_database"
										}
									},
									{
										"component": "nc-label-dropdown",
										"text": "Local table",
										"attribute": {
											"v-if": "rec.tab === 'table'",
											":horizontal": "true",
											"hdr": "hdr.nc_database_editor.local_table",
											"model": "rec.local_table",
											"v-on:change": "dropdown('local table')"
										}
									}
								]
							},
							{
								"component": "nc-col",
								"attribute": {
									"class": ["nc-end-h"],
									"width": "21em"
								},
								"element": [
									{
										"component": "nc-button",
										"attribute": {
											"class": ["nc-button-wide", "nc-margin-right"],
											"v-on:click": "matchField(1)"
										},
										"element": [
											{
												"component": "nc-icon",
												"attribute": {
													"icon": "arrows-h"
												}
											},
											{
												"component": "nc-translate",
												"text": "Match",
												"attribute": {
													"model": "hdr.nc_database_editor.match"
												}
											}
										]
									},
									{
										"component": "nc-button",
										"attribute": {
											"class": ["nc-button-wide", "disabled"],
											"v-if": "rec.tab === 'table'",
											"v-on:click": "matchField(2)"
										},
										"element": [
											{
												"component": "nc-icon",
												"attribute": {
													"icon": "arrows-h"
												}
											},
											{
												"component": "nc-translate",
												"text": "Match 2",
												"attribute": {
													"model": "hdr.nc_database_editor.match2"
												}
											}
										]
									}
								]
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"width": "1em"
						}
					},
					{
						"component": "nc-col",
						"attribute": {
							"width": "auto",
							"class": ["nc-center-v"]
						},
						"element": [
							{
								"component": "nc-col",
								"attribute": {
									"width": "auto"
								},
								"element": [
									{
										"component": "nc-label-input",
										"text": "External database",
										"attribute": {
											"v-if": "rec.tab === 'database'",
											":horizontal": "true",
											"disabled": "disabled",
											"model": "rec.connection",
											"hdr": "hdr.nc_database_editor.external_database"
										}
									},
									{
										"component": "nc-label-dropdown",
										"text": "External table",
										"attribute": {
											"v-if": "rec.tab === 'table'",
											":horizontal": "true",
											"hdr": "hdr.nc_database_editor.external_table",
											"model": "rec.external_table",
											"v-on:change": "dropdown('external table')"
										}
									}
								]
							},
							{
								"component": "nc-col",
								"attribute": {
									"class": ["nc-end-h"],
									"width": "18em"
								},
								"element": [
									{
										"component": "nc-button",
										"attribute": {
											"class": ["nc-button-wide"],
											"v-on:click": "dropdown('revert')"
										},
										"element": [
											{
												"component": "nc-icon",
												"attribute": {
													"icon": "undo"
												}
											},
											{
												"component": "nc-translate",
												"text": "Revert",
												"attribute": {
													"model": "hdr.nc_database_editor.revert"
												}
											}
										]
									},
									{
										"component": "nc-button",
										"attribute": {
											"class": ["nc-button-wide"],
											"style": "margin-right: 0px",
											"v-on:click": "save"
										},
										"element": [
											{
												"component": "nc-icon",
												"attribute": {
													"icon": "save"
												}
											},
											{
												"component": "nc-translate",
												"text": "Save",
												"attribute": {
													"model": "hdr.nc_database_editor.save"
												}
											}
										]
									}
								]
							}
						]
					}
				]
			},
			{
				"component": "nc-row",
				"attribute": {
					"class": ["nc-margin-top"]
				},
				"element": [
					{
						"component": "nc-col",
						"attribute": {
							"width": "auto"
						},
						"element": [
							{
								"component": "nc-label",
								"text": "Local field",
								"attribute": {
									"model": "hdr.nc_database_editor.local_label"
								}
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"width": "1em"
						}
					},
					{
						"component": "nc-col",
						"attribute": {
							"width": "auto"
						},
						"element": [
							{
								"component": "nc-col",
								"attribute": {
									"width": "auto"
								},
								"element": [
									{
										"component": "nc-label",
										"text": "External field",
										"attribute": {
											"model": "hdr.nc_database_editor.external_label"
										}
									}
								]
							},
							{
								"component": "nc-col",
								"attribute": {
									"class": ["nc-end-h"],
									"width": "auto"
								},
								"element": [
									{
										"component": "nc-checkbox",
										"text": "Default field",
										"attribute": {
											"hdr": "hdr.nc_database_editor.external_default_field",
											"model": "rec.external_default_field",
											"v-on:change": "dropdown('external table')"
										}
									}
								]
							},
							{
								"component": "nc-col",
								"attribute": {
									"class": ["nc-end-h"],
									"width": "auto"
								},
								"element": [
									{
										"component": "nc-checkbox",
										"text": "Update database",
										"attribute": {
											"hdr": "hdr.nc_database_editor.update_external_database",
											"model": "rec.update_external_database"
										}
									}
								]
							}
						]
					}
				]
			},
			{
				"component": "nc-row",
				"element": [
					{
						"component": "nc-col",
						"attribute": {
							"width": "auto"
						},
						"element": [
							{
								"component": "nc-grid",
								"attribute": {
									"id": "local_field",
									"height": "calc(60vh - 5em)",
									"model": "grid.local_field",
									"v-on:grid-cell-value-changed": "gridCellValueChanged",
									"v-on:grid-context-menu": "gridContextMenu",
									"v-on:grid-row-clicked": "gridRowClicked",
									"v-on:grid-row-double-clicked": "gridRowDoubleClicked"
								}
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"width": "1em"
						}
					},
					{
						"component": "nc-col",
						"attribute": {
							"width": "auto"
						},
						"element": [
							{
								"component": "nc-grid",
								"attribute": {
									"id": "external_field",
									"height": "calc(60vh - 5em)",
									"model": "grid.external_field",
									"v-on:grid-cell-value-changed": "gridCellValueChanged",
									"v-on:grid-context-menu": "gridContextMenu",
									"v-on:grid-row-clicked": "gridRowClicked",
									"v-on:grid-row-double-clicked": "gridRowDoubleClicked"
								}
							}
						]
					}
				]
			},
			{
				"component": "nc-row",
				"element": [
					{
						"component": "nc-col",
						"attribute": {
							"width": "auto"
						},
						"element": [
							{
								"component": "nc-row",
								"element": [
									{
										"component": "nc-label",
										"text": "Local data",
										"attribute": {
											"model": "hdr.nc_database_editor.local_data"
										}
									}
								]
							},
							{
								"component": "nc-row",
								"element": [
									{
										"component": "nc-grid",
										"attribute": {
											"id": "local_data",
											"height": "calc(40vh - 11.5em)",
											"model": "grid.local_data",
											"v-on:grid-context-menu": "gridContextMenu",
											"v-on:grid-row-clicked": "gridRowClicked",
											"v-on:grid-row-double-clicked": "gridRowDoubleClicked"
										}
									}
								]
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"width": "1em"
						}
					},
					{
						"component": "nc-col",
						"attribute": {
							"width": "auto"
						},
						"element": [
							{
								"component": "nc-row",
								"element": [
									{
										"component": "nc-label",
										"text": "External data",
										"attribute": {
											"model": "hdr.nc_database_editor.external_data"
										}
									}
								]
							},
							{
								"component": "nc-row",
								"element": [
									{
										"component": "nc-grid",
										"attribute": {
											"id": "external_data",
											"height": "calc(40vh - 11.5em)",
											"model": "grid.external_data",
											"v-on:grid-context-menu": "gridContextMenu",
											"v-on:grid-row-clicked": "gridRowClicked",
											"v-on:grid-row-double-clicked": "gridRowDoubleClicked"
										}
									}
								]
							}
						]
					}
				]
			}
		]
	}
}
