@genexus/genexus-ide-ui 3.2.9 → 3.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/genexus-ide-ui.cjs.js +1 -1
- package/dist/cjs/gx-ide-db-instance-selector.cjs.entry.js +147 -0
- package/dist/cjs/gx-ide-db-instance-selector.cjs.entry.js.map +1 -0
- package/dist/cjs/gx-ide-new-kb.cjs.entry.js +261 -138
- package/dist/cjs/gx-ide-new-kb.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/db-instance-selector/db-instance-selector.css +20 -0
- package/dist/collection/components/db-instance-selector/db-instance-selector.js +262 -0
- package/dist/collection/components/db-instance-selector/db-instance-selector.js.map +1 -0
- package/dist/collection/components/db-instance-selector/gx-ide-assets/db-instance-selector/langs/db-instance-selector.lang.en.json +14 -0
- package/dist/collection/components/db-instance-selector/gx-ide-assets/db-instance-selector/langs/db-instance-selector.lang.ja.json +14 -0
- package/dist/collection/components/db-instance-selector/gx-ide-assets/db-instance-selector/langs/db-instance-selector.lang.zh.json +14 -0
- package/dist/collection/components/db-instance-selector/gx-ide-assets/db-instance-selector/shortcuts.json +15 -0
- package/dist/collection/components/new-kb/gx-ide-assets/new-kb/langs/new-kb.lang.en.json +17 -4
- package/dist/collection/components/new-kb/gx-ide-assets/new-kb/langs/new-kb.lang.ja.json +17 -4
- package/dist/collection/components/new-kb/gx-ide-assets/new-kb/langs/new-kb.lang.zh.json +17 -4
- package/dist/collection/components/new-kb/new-kb.css +122 -17
- package/dist/collection/components/new-kb/new-kb.js +320 -193
- package/dist/collection/components/new-kb/new-kb.js.map +1 -1
- package/dist/collection/components/new-kb/tests/new-kb.e2e.js +48 -60
- package/dist/collection/components/new-kb/tests/new-kb.e2e.js.map +1 -1
- package/dist/collection/testing/locale.e2e.js +1 -0
- package/dist/collection/testing/locale.e2e.js.map +1 -1
- package/dist/components/gx-ide-db-instance-selector.d.ts +11 -0
- package/dist/components/gx-ide-db-instance-selector.js +168 -0
- package/dist/components/gx-ide-db-instance-selector.js.map +1 -0
- package/dist/components/gx-ide-new-kb.js +281 -152
- package/dist/components/gx-ide-new-kb.js.map +1 -1
- package/dist/esm/genexus-ide-ui.js +1 -1
- package/dist/esm/gx-ide-db-instance-selector.entry.js +143 -0
- package/dist/esm/gx-ide-db-instance-selector.entry.js.map +1 -0
- package/dist/esm/gx-ide-new-kb.entry.js +261 -138
- package/dist/esm/gx-ide-new-kb.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/genexus-ide-ui/genexus-ide-ui.esm.js +1 -1
- package/dist/genexus-ide-ui/genexus-ide-ui.esm.js.map +1 -1
- package/dist/genexus-ide-ui/gx-ide-assets/db-instance-selector/langs/db-instance-selector.lang.en.json +14 -0
- package/dist/genexus-ide-ui/gx-ide-assets/db-instance-selector/langs/db-instance-selector.lang.ja.json +14 -0
- package/dist/genexus-ide-ui/gx-ide-assets/db-instance-selector/langs/db-instance-selector.lang.zh.json +14 -0
- package/dist/genexus-ide-ui/gx-ide-assets/db-instance-selector/shortcuts.json +15 -0
- package/dist/genexus-ide-ui/gx-ide-assets/new-kb/langs/new-kb.lang.en.json +17 -4
- package/dist/genexus-ide-ui/gx-ide-assets/new-kb/langs/new-kb.lang.ja.json +17 -4
- package/dist/genexus-ide-ui/gx-ide-assets/new-kb/langs/new-kb.lang.zh.json +17 -4
- package/dist/genexus-ide-ui/p-c1db7f38.entry.js +182 -0
- package/dist/genexus-ide-ui/p-c1db7f38.entry.js.map +1 -0
- package/dist/genexus-ide-ui/p-eeae9dd5.entry.js +1020 -0
- package/dist/genexus-ide-ui/p-eeae9dd5.entry.js.map +1 -0
- package/dist/types/components/db-instance-selector/db-instance-selector.d.ts +39 -0
- package/dist/types/components/new-kb/new-kb.d.ts +51 -23
- package/dist/types/components.d.ts +135 -84
- package/package.json +1 -1
- package/dist/genexus-ide-ui/p-76e1c357.entry.js +0 -802
- package/dist/genexus-ide-ui/p-76e1c357.entry.js.map +0 -1
|
@@ -39,20 +39,28 @@
|
|
|
39
39
|
"tabAdvanced": {
|
|
40
40
|
"tabLabel": "Advanced",
|
|
41
41
|
"tabTitle": "Knowledge Base Storage",
|
|
42
|
+
"tabSubtitle": "Where this KB's metadata and objects will live",
|
|
43
|
+
"connectionGroup": "Connection",
|
|
44
|
+
"authenticationGroup": "Authentication",
|
|
45
|
+
"databaseHint": "Will be created if it doesn't exist.",
|
|
46
|
+
"windowsAuthCalloutTitle": "Using current Windows credentials",
|
|
47
|
+
"windowsAuthCalloutDescription": "Your domain account will be used to connect. No username or password is required.",
|
|
42
48
|
"serverName": {
|
|
43
49
|
"label": "Server Name",
|
|
44
50
|
"placeholder": null,
|
|
45
|
-
"disabledPlaceholder": "There are no server names to display"
|
|
51
|
+
"disabledPlaceholder": "There are no server names to display",
|
|
52
|
+
"browseForMore": "Browse for more..."
|
|
46
53
|
},
|
|
47
54
|
"databaseName": {
|
|
48
|
-
"label": "Database",
|
|
55
|
+
"label": "Database Name",
|
|
49
56
|
"placeholder": null,
|
|
50
57
|
"disabledPlaceholder": null
|
|
51
58
|
},
|
|
52
59
|
"collation": {
|
|
53
60
|
"label": "Collation",
|
|
54
61
|
"placeholder": null,
|
|
55
|
-
"disabledPlaceholder": "There are no collations to display"
|
|
62
|
+
"disabledPlaceholder": "There are no collations to display",
|
|
63
|
+
"loadingPlaceholder": "Loading collations..."
|
|
56
64
|
},
|
|
57
65
|
"createDataFilesInKbFolder": "Create Data in Knowledge Base Folder",
|
|
58
66
|
"authenticationType": {
|
|
@@ -74,6 +82,11 @@
|
|
|
74
82
|
},
|
|
75
83
|
"footer": {
|
|
76
84
|
"btnCreate": "Create",
|
|
77
|
-
"btnCancel": "Cancel"
|
|
85
|
+
"btnCancel": "Cancel",
|
|
86
|
+
"connectionStatus": {
|
|
87
|
+
"connecting": "Connecting...",
|
|
88
|
+
"success": "Connection success",
|
|
89
|
+
"failed": "Connection failed"
|
|
90
|
+
}
|
|
78
91
|
}
|
|
79
92
|
}
|
|
@@ -39,20 +39,28 @@
|
|
|
39
39
|
"tabAdvanced": {
|
|
40
40
|
"tabLabel": "詳細",
|
|
41
41
|
"tabTitle": "ナレッジベースのストレージ",
|
|
42
|
+
"tabSubtitle": "この KB のメタデータとオブジェクトの保存先",
|
|
43
|
+
"connectionGroup": "接続",
|
|
44
|
+
"authenticationGroup": "認証",
|
|
45
|
+
"databaseHint": "存在しない場合は作成されます。",
|
|
46
|
+
"windowsAuthCalloutTitle": "現在の Windows 認証情報を使用",
|
|
47
|
+
"windowsAuthCalloutDescription": "ドメインアカウントを使用して接続します。ユーザー名とパスワードは必要ありません。",
|
|
42
48
|
"serverName": {
|
|
43
49
|
"label": "サーバー名",
|
|
44
50
|
"placeholder": null,
|
|
45
|
-
"disabledPlaceholder": "表示するサーバー名がありません"
|
|
51
|
+
"disabledPlaceholder": "表示するサーバー名がありません",
|
|
52
|
+
"browseForMore": "さらに参照..."
|
|
46
53
|
},
|
|
47
54
|
"databaseName": {
|
|
48
|
-
"label": "
|
|
55
|
+
"label": "データベース名",
|
|
49
56
|
"placeholder": null,
|
|
50
57
|
"disabledPlaceholder": null
|
|
51
58
|
},
|
|
52
59
|
"collation": {
|
|
53
60
|
"label": "照合順序",
|
|
54
61
|
"placeholder": null,
|
|
55
|
-
"disabledPlaceholder": "表示する照合順序がありません"
|
|
62
|
+
"disabledPlaceholder": "表示する照合順序がありません",
|
|
63
|
+
"loadingPlaceholder": "照合順序を読み込み中..."
|
|
56
64
|
},
|
|
57
65
|
"createDataFilesInKbFolder": "ナレッジベースのフォルダ内にデータを作成",
|
|
58
66
|
"authenticationType": {
|
|
@@ -74,6 +82,11 @@
|
|
|
74
82
|
},
|
|
75
83
|
"footer": {
|
|
76
84
|
"btnCreate": "作成",
|
|
77
|
-
"btnCancel": "キャンセル"
|
|
85
|
+
"btnCancel": "キャンセル",
|
|
86
|
+
"connectionStatus": {
|
|
87
|
+
"connecting": "接続中...",
|
|
88
|
+
"success": "接続に成功しました",
|
|
89
|
+
"failed": "接続に失敗しました"
|
|
90
|
+
}
|
|
78
91
|
}
|
|
79
92
|
}
|
|
@@ -39,20 +39,28 @@
|
|
|
39
39
|
"tabAdvanced": {
|
|
40
40
|
"tabLabel": "Advanced",
|
|
41
41
|
"tabTitle": "Knowledge Base Storage",
|
|
42
|
+
"tabSubtitle": "Where this KB's metadata and objects will live",
|
|
43
|
+
"connectionGroup": "Connection",
|
|
44
|
+
"authenticationGroup": "Authentication",
|
|
45
|
+
"databaseHint": "Will be created if it doesn't exist.",
|
|
46
|
+
"windowsAuthCalloutTitle": "Using current Windows credentials",
|
|
47
|
+
"windowsAuthCalloutDescription": "Your domain account will be used to connect. No username or password is required.",
|
|
42
48
|
"serverName": {
|
|
43
49
|
"label": "Server Name",
|
|
44
50
|
"placeholder": null,
|
|
45
|
-
"disabledPlaceholder": "There are no server names to display"
|
|
51
|
+
"disabledPlaceholder": "There are no server names to display",
|
|
52
|
+
"browseForMore": "Browse for more..."
|
|
46
53
|
},
|
|
47
54
|
"databaseName": {
|
|
48
|
-
"label": "Database",
|
|
55
|
+
"label": "Database Name",
|
|
49
56
|
"placeholder": null,
|
|
50
57
|
"disabledPlaceholder": null
|
|
51
58
|
},
|
|
52
59
|
"collation": {
|
|
53
60
|
"label": "Collation",
|
|
54
61
|
"placeholder": null,
|
|
55
|
-
"disabledPlaceholder": "There are no collations to display"
|
|
62
|
+
"disabledPlaceholder": "There are no collations to display",
|
|
63
|
+
"loadingPlaceholder": "加载排序规则中..."
|
|
56
64
|
},
|
|
57
65
|
"createDataFilesInKbFolder": "Create Data in Knowledge Base Folder",
|
|
58
66
|
"authenticationType": {
|
|
@@ -74,6 +82,11 @@
|
|
|
74
82
|
},
|
|
75
83
|
"footer": {
|
|
76
84
|
"btnCreate": "Create",
|
|
77
|
-
"btnCancel": "Cancel"
|
|
85
|
+
"btnCancel": "Cancel",
|
|
86
|
+
"connectionStatus": {
|
|
87
|
+
"connecting": "Connecting...",
|
|
88
|
+
"success": "Connection success",
|
|
89
|
+
"failed": "Connection failed"
|
|
90
|
+
}
|
|
78
91
|
}
|
|
79
92
|
}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { r as e, g as t, h as s, H as i, a } from "./p-9b9ccd0c.js";
|
|
2
|
+
|
|
3
|
+
import { g as o } from "./p-d42e842b.js";
|
|
4
|
+
|
|
5
|
+
import "./p-6534555e.js";
|
|
6
|
+
|
|
7
|
+
import "lit";
|
|
8
|
+
|
|
9
|
+
import "lit/directives/when.js";
|
|
10
|
+
|
|
11
|
+
import "lit/directives/if-defined.js";
|
|
12
|
+
|
|
13
|
+
import { L as n } from "./p-311eedf3.js";
|
|
14
|
+
|
|
15
|
+
const r = ":host{display:grid;block-size:100%;overflow:auto;grid-template-rows:max-content 1fr max-content}.section{display:contents}.main{overflow:auto}.tree-view{display:block;block-size:100%;overflow:hidden}";
|
|
16
|
+
|
|
17
|
+
var d = undefined && undefined.__classPrivateFieldSet || function(e, t, s, i, a) {
|
|
18
|
+
if (i === "m") throw new TypeError("Private method is not writable");
|
|
19
|
+
if (i === "a" && !a) throw new TypeError("Private accessor was defined without a setter");
|
|
20
|
+
if (typeof t === "function" ? e !== t || !a : !t.has(e)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
21
|
+
return i === "a" ? a.call(e, s) : a ? a.value = s : t.set(e, s), s;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
var c = undefined && undefined.__classPrivateFieldGet || function(e, t, s, i) {
|
|
25
|
+
if (s === "a" && !i) throw new TypeError("Private accessor was defined without a getter");
|
|
26
|
+
if (typeof t === "function" ? e !== t || !i : !t.has(e)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
27
|
+
return s === "m" ? i : s === "a" ? i.call(e) : i ? i.value : t.get(e);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
var l, h, f, u, p, m, w, v;
|
|
31
|
+
|
|
32
|
+
const b = [ "resets/box-sizing", "components/tree-view", "utils/form--full", "utils/layout", "utils/typography", "utils/spacing", "chameleon/scrollbar" ];
|
|
33
|
+
|
|
34
|
+
const y = o({
|
|
35
|
+
category: "system",
|
|
36
|
+
name: "computer",
|
|
37
|
+
colorType: "primary"
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const g = o({
|
|
41
|
+
category: "system",
|
|
42
|
+
name: "database",
|
|
43
|
+
colorType: "success"
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
const k = "local-servers";
|
|
47
|
+
|
|
48
|
+
const j = "network-servers";
|
|
49
|
+
|
|
50
|
+
const x = class {
|
|
51
|
+
constructor(s) {
|
|
52
|
+
e(this, s);
|
|
53
|
+
// eslint-disable-next-line @stencil-community/own-props-must-be-private
|
|
54
|
+
l.set(this, void 0);
|
|
55
|
+
h.set(this, void 0);
|
|
56
|
+
f.set(this, t(`./gx-ide-assets/db-instance-selector/shortcuts.json`));
|
|
57
|
+
u.set(this, void 0);
|
|
58
|
+
p.set(this, (async e => {
|
|
59
|
+
var t, s, i, a;
|
|
60
|
+
let o = [];
|
|
61
|
+
if (e === k) {
|
|
62
|
+
o = (s = await ((t = this.getLocalServersCallback) === null || t === void 0 ? void 0 : t.call(this))) !== null && s !== void 0 ? s : [];
|
|
63
|
+
} else if (e === j) {
|
|
64
|
+
o = (a = await ((i = this.getNetworkServersCallback) === null || i === void 0 ? void 0 : i.call(this))) !== null && a !== void 0 ? a : [];
|
|
65
|
+
}
|
|
66
|
+
return o.map((t => ({
|
|
67
|
+
id: `${e}__${t.id}`,
|
|
68
|
+
caption: t.name,
|
|
69
|
+
startImgSrc: g,
|
|
70
|
+
leaf: true,
|
|
71
|
+
metadata: t.name
|
|
72
|
+
})));
|
|
73
|
+
}));
|
|
74
|
+
m.set(this, (e => {
|
|
75
|
+
var t;
|
|
76
|
+
const s = e.detail.find((e => e.item.leaf));
|
|
77
|
+
if (s) {
|
|
78
|
+
this.selectedInstanceId = s.item.id;
|
|
79
|
+
d(this, u, (t = s.item.metadata) !== null && t !== void 0 ? t : s.item.caption, "f");
|
|
80
|
+
} else {
|
|
81
|
+
this.selectedInstanceId = undefined;
|
|
82
|
+
d(this, u, undefined, "f");
|
|
83
|
+
}
|
|
84
|
+
}));
|
|
85
|
+
w.set(this, (() => {
|
|
86
|
+
var e;
|
|
87
|
+
(e = this.cancelCallback) === null || e === void 0 ? void 0 : e.call(this);
|
|
88
|
+
}));
|
|
89
|
+
v.set(this, (() => {
|
|
90
|
+
var e;
|
|
91
|
+
if (c(this, u, "f")) {
|
|
92
|
+
(e = this.confirmCallback) === null || e === void 0 ? void 0 : e.call(this, c(this, u, "f"));
|
|
93
|
+
}
|
|
94
|
+
}));
|
|
95
|
+
this.treeModel = [];
|
|
96
|
+
this.selectedInstanceId = undefined;
|
|
97
|
+
this.getLocalServersCallback = undefined;
|
|
98
|
+
this.getNetworkServersCallback = undefined;
|
|
99
|
+
this.cancelCallback = undefined;
|
|
100
|
+
this.confirmCallback = undefined;
|
|
101
|
+
}
|
|
102
|
+
async componentWillLoad() {
|
|
103
|
+
d(this, l, await n.getComponentStrings(this.el), "f");
|
|
104
|
+
this.treeModel = [ {
|
|
105
|
+
id: k,
|
|
106
|
+
caption: c(this, l, "f").tree.localServers,
|
|
107
|
+
startImgSrc: y,
|
|
108
|
+
leaf: false,
|
|
109
|
+
lazy: true,
|
|
110
|
+
expanded: false,
|
|
111
|
+
items: []
|
|
112
|
+
}, {
|
|
113
|
+
id: j,
|
|
114
|
+
caption: c(this, l, "f").tree.networkServers,
|
|
115
|
+
startImgSrc: y,
|
|
116
|
+
leaf: false,
|
|
117
|
+
lazy: true,
|
|
118
|
+
expanded: false,
|
|
119
|
+
items: []
|
|
120
|
+
} ];
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Suspends or reactivates the shortcuts.
|
|
124
|
+
*/ async suspendShortcuts(e) {
|
|
125
|
+
c(this, h, "f").suspend = e;
|
|
126
|
+
}
|
|
127
|
+
render() {
|
|
128
|
+
return s(i, {
|
|
129
|
+
class: "widget"
|
|
130
|
+
}, s("ch-theme", {
|
|
131
|
+
model: b
|
|
132
|
+
}), s("ch-shortcuts", {
|
|
133
|
+
src: c(this, f, "f"),
|
|
134
|
+
ref: e => d(this, h, e, "f")
|
|
135
|
+
}), s("section", {
|
|
136
|
+
class: "section"
|
|
137
|
+
}, s("header", {
|
|
138
|
+
class: "dialog-header spacing-body dialog-header"
|
|
139
|
+
}, s("h1", {
|
|
140
|
+
class: "label"
|
|
141
|
+
}, c(this, l, "f").header.title)), s("div", {
|
|
142
|
+
class: "main"
|
|
143
|
+
}, s("ch-tree-view-render", {
|
|
144
|
+
class: "tree-view",
|
|
145
|
+
model: this.treeModel,
|
|
146
|
+
dragDisabled: true,
|
|
147
|
+
dropDisabled: true,
|
|
148
|
+
showLines: "all",
|
|
149
|
+
lazyLoadTreeItemsCallback: c(this, p, "f"),
|
|
150
|
+
onSelectedItemsChange: c(this, m, "f")
|
|
151
|
+
})), s("footer", {
|
|
152
|
+
class: "dialog-footer dialog-footer-with-border spacing-body-block-end spacing-body-inline"
|
|
153
|
+
}, s("div", {
|
|
154
|
+
class: "buttons-spacer"
|
|
155
|
+
}, s("button", {
|
|
156
|
+
class: "button-secondary",
|
|
157
|
+
id: "button-cancel",
|
|
158
|
+
onClick: c(this, w, "f"),
|
|
159
|
+
part: "button-cancel"
|
|
160
|
+
}, c(this, l, "f").footer.btnCancel), s("button", {
|
|
161
|
+
class: "button-primary",
|
|
162
|
+
id: "button-confirm",
|
|
163
|
+
onClick: c(this, v, "f"),
|
|
164
|
+
disabled: !this.selectedInstanceId,
|
|
165
|
+
part: "button-confirm"
|
|
166
|
+
}, c(this, l, "f").footer.btnConfirm)))));
|
|
167
|
+
}
|
|
168
|
+
static get assetsDirs() {
|
|
169
|
+
return [ "gx-ide-assets/db-instance-selector" ];
|
|
170
|
+
}
|
|
171
|
+
get el() {
|
|
172
|
+
return a(this);
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
l = new WeakMap, h = new WeakMap, f = new WeakMap, u = new WeakMap, p = new WeakMap,
|
|
177
|
+
m = new WeakMap, w = new WeakMap, v = new WeakMap;
|
|
178
|
+
|
|
179
|
+
x.style = r;
|
|
180
|
+
|
|
181
|
+
export { x as gx_ide_db_instance_selector };
|
|
182
|
+
//# sourceMappingURL=p-c1db7f38.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["dbInstanceSelectorCss","CSS_BUNDLES","SERVER_ICON","getIconPath","category","name","colorType","DATABASE_ICON","LOCAL_SERVERS_NODE_ID","NETWORK_SERVERS_NODE_ID","GxIdeDbInstanceSelector","_GxIdeDbInstanceSelector_componentLocale","set","this","_GxIdeDbInstanceSelector_chShortcutsEl","_GxIdeDbInstanceSelector_shortcutsSrc","getAssetPath","_GxIdeDbInstanceSelector_selectedInstanceName","_GxIdeDbInstanceSelector_lazyLoadTreeItems","async","treeItemId","servers","_b","_a","getLocalServersCallback","call","_d","_c","getNetworkServersCallback","map","server","id","caption","startImgSrc","leaf","metadata","_GxIdeDbInstanceSelector_selectedItemsChangeHandler","event","selected","detail","find","node","item","selectedInstanceId","__classPrivateFieldSet","undefined","_GxIdeDbInstanceSelector_cancelButtonClickedHandler","cancelCallback","_GxIdeDbInstanceSelector_confirmButtonClickedHandler","__classPrivateFieldGet","confirmCallback","componentWillLoad","Locale","getComponentStrings","el","treeModel","tree","localServers","lazy","expanded","items","networkServers","suspendShortcuts","suspend","render","h","Host","class","model","src","ref","header","title","dragDisabled","dropDisabled","showLines","lazyLoadTreeItemsCallback","onSelectedItemsChange","onClick","part","footer","btnCancel","disabled","btnConfirm"],"sources":["src/components/db-instance-selector/db-instance-selector.scss?tag=gx-ide-db-instance-selector&encapsulation=shadow","src/components/db-instance-selector/db-instance-selector.tsx"],"sourcesContent":[":host {\n display: grid;\n block-size: 100%;\n overflow: auto;\n grid-template-rows: max-content 1fr max-content;\n}\n\n.section {\n display: contents;\n}\n\n.main {\n overflow: auto;\n}\n\n.tree-view {\n display: block;\n block-size: 100%;\n overflow: hidden;\n}\n","import {\n Component,\n Host,\n Prop,\n Element,\n State,\n getAssetPath,\n Method,\n h\n} from \"@stencil/core\";\n\nimport { MercuryBundles, getIconPath } from \"@genexus/mercury\";\nimport {\n TreeViewItemModel,\n TreeViewItemModelExtended\n} from \"@genexus/chameleon-controls-library\";\n\nimport { Locale } from \"../../common/locale\";\n\nconst CSS_BUNDLES: MercuryBundles = [\n \"resets/box-sizing\",\n \"components/tree-view\",\n \"utils/form--full\",\n \"utils/layout\",\n \"utils/typography\",\n \"utils/spacing\",\n \"chameleon/scrollbar\"\n];\n\nconst SERVER_ICON = getIconPath({\n category: \"system\",\n name: \"computer\",\n colorType: \"primary\"\n});\n\nconst DATABASE_ICON = getIconPath({\n category: \"system\",\n name: \"database\",\n colorType: \"success\"\n});\n\nconst LOCAL_SERVERS_NODE_ID = \"local-servers\";\nconst NETWORK_SERVERS_NODE_ID = \"network-servers\";\n\n@Component({\n tag: \"gx-ide-db-instance-selector\",\n styleUrl: \"db-instance-selector.scss\",\n shadow: true,\n assetsDirs: [\"gx-ide-assets/db-instance-selector\"]\n})\nexport class GxIdeDbInstanceSelector {\n // eslint-disable-next-line @stencil-community/own-props-must-be-private\n #componentLocale: any;\n\n #chShortcutsEl: HTMLChShortcutsElement;\n #shortcutsSrc = getAssetPath(\n `./gx-ide-assets/db-instance-selector/shortcuts.json`\n );\n\n #selectedInstanceName: string | undefined;\n\n @Element() el: HTMLGxIdeDbInstanceSelectorElement;\n\n @State() treeModel: TreeViewItemModel[] = [];\n @State() selectedInstanceId: string | undefined;\n\n /**\n * Callback invoked to load the available local server instances.\n * Should return the list of database instances available on local servers.\n */\n @Prop() readonly getLocalServersCallback!: GetServersCallback;\n\n /**\n * Callback invoked to load the available network server instances.\n * Should return the list of database instances available on network servers.\n */\n @Prop() readonly getNetworkServersCallback!: GetServersCallback;\n\n /**\n * Callback invoked when the user cancels the selection.\n */\n @Prop() readonly cancelCallback!: CancelCallback;\n\n /**\n * Callback invoked when the user confirms the selection. Receives the name\n * of the selected database instance.\n */\n @Prop() readonly confirmCallback!: ConfirmCallback;\n\n async componentWillLoad() {\n this.#componentLocale = await Locale.getComponentStrings(this.el);\n this.treeModel = [\n {\n id: LOCAL_SERVERS_NODE_ID,\n caption: this.#componentLocale.tree.localServers,\n startImgSrc: SERVER_ICON,\n leaf: false,\n lazy: true,\n expanded: false,\n items: []\n },\n {\n id: NETWORK_SERVERS_NODE_ID,\n caption: this.#componentLocale.tree.networkServers,\n startImgSrc: SERVER_ICON,\n leaf: false,\n lazy: true,\n expanded: false,\n items: []\n }\n ];\n }\n\n /**\n * Suspends or reactivates the shortcuts.\n */\n @Method()\n async suspendShortcuts(suspendShortcuts: boolean) {\n this.#chShortcutsEl.suspend = suspendShortcuts;\n }\n\n #lazyLoadTreeItems = async (\n treeItemId: string\n ): Promise<TreeViewItemModel[]> => {\n let servers: DbServerInstance[] = [];\n\n if (treeItemId === LOCAL_SERVERS_NODE_ID) {\n servers = (await this.getLocalServersCallback?.()) ?? [];\n } else if (treeItemId === NETWORK_SERVERS_NODE_ID) {\n servers = (await this.getNetworkServersCallback?.()) ?? [];\n }\n\n return servers.map(server => ({\n id: `${treeItemId}__${server.id}`,\n caption: server.name,\n startImgSrc: DATABASE_ICON,\n leaf: true,\n metadata: server.name\n }));\n };\n\n #selectedItemsChangeHandler = (\n event: CustomEvent<TreeViewItemModelExtended[]>\n ) => {\n const selected = event.detail.find(node => node.item.leaf);\n if (selected) {\n this.selectedInstanceId = selected.item.id;\n this.#selectedInstanceName =\n (selected.item.metadata as string) ?? selected.item.caption;\n } else {\n this.selectedInstanceId = undefined;\n this.#selectedInstanceName = undefined;\n }\n };\n\n #cancelButtonClickedHandler = () => {\n this.cancelCallback?.();\n };\n\n #confirmButtonClickedHandler = () => {\n if (this.#selectedInstanceName) {\n this.confirmCallback?.(this.#selectedInstanceName);\n }\n };\n\n render() {\n return (\n <Host class=\"widget\">\n <ch-theme model={CSS_BUNDLES}></ch-theme>\n <ch-shortcuts\n src={this.#shortcutsSrc}\n ref={(el: HTMLChShortcutsElement) =>\n (this.#chShortcutsEl = el as HTMLChShortcutsElement)\n }\n ></ch-shortcuts>\n <section class=\"section\">\n <header class=\"dialog-header spacing-body dialog-header\">\n <h1 class=\"label\">{this.#componentLocale.header.title}</h1>\n </header>\n\n <div class=\"main\">\n <ch-tree-view-render\n class=\"tree-view\"\n model={this.treeModel}\n dragDisabled={true}\n dropDisabled={true}\n showLines=\"all\"\n lazyLoadTreeItemsCallback={this.#lazyLoadTreeItems}\n onSelectedItemsChange={this.#selectedItemsChangeHandler}\n ></ch-tree-view-render>\n </div>\n\n <footer class=\"dialog-footer dialog-footer-with-border spacing-body-block-end spacing-body-inline\">\n <div class=\"buttons-spacer\">\n <button\n class=\"button-secondary\"\n id=\"button-cancel\"\n onClick={this.#cancelButtonClickedHandler}\n part=\"button-cancel\"\n >\n {this.#componentLocale.footer.btnCancel}\n </button>\n <button\n class=\"button-primary\"\n id=\"button-confirm\"\n onClick={this.#confirmButtonClickedHandler}\n disabled={!this.selectedInstanceId}\n part=\"button-confirm\"\n >\n {this.#componentLocale.footer.btnConfirm}\n </button>\n </div>\n </footer>\n </section>\n </Host>\n );\n }\n}\n\nexport type DbServerInstance = {\n id: string;\n name: string;\n};\n\nexport type GetServersCallback = () =>\n | Promise<DbServerInstance[]>\n | DbServerInstance[];\n\nexport type CancelCallback = () => void | Promise<void>;\n\nexport type ConfirmCallback = (\n selectedInstanceName: string\n) => void | Promise<void>;\n"],"mappings":";;;;;;;;;;;;;;AAAA,MAAMA,IAAwB;;;;;;;;;;;;;;;;;ACmB9B,MAAMC,IAA8B,EAClC,qBACA,wBACA,oBACA,gBACA,oBACA,iBACA;;AAGF,MAAMC,IAAcC,EAAY;EAC9BC,UAAU;EACVC,MAAM;EACNC,WAAW;;;AAGb,MAAMC,IAAg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