@genexus/genexus-ide-ui 0.0.40 → 0.0.41
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-create-kb-from-server.cjs.entry.js +136 -0
- package/dist/cjs/gx-ide-new-kb.cjs.entry.js +1 -1
- package/dist/cjs/gxg-combo-box_6.cjs.entry.js +0 -1
- package/dist/cjs/gxg-form-checkbox-group.cjs.entry.js +91 -0
- package/dist/cjs/{gxg-form-checkbox-group_2.cjs.entry.js → gxg-form-radio.cjs.entry.js} +0 -85
- package/dist/cjs/gxg-list-box_2.cjs.entry.js +1 -6
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/create-kb-from-server/create-kb-from-server.css +162 -0
- package/dist/collection/components/create-kb-from-server/create-kb-from-server.js +302 -0
- package/dist/collection/components/create-kb-from-server/gx-ide-assets/create-kb-from-server/langs/create-kb-from-server.lang.en.json +17 -0
- package/dist/collection/components/create-kb-from-server/gx-ide-assets/create-kb-from-server/langs/create-kb-from-server.lang.ja.json +3 -0
- package/dist/collection/components/create-kb-from-server/gx-ide-assets/create-kb-from-server/langs/create-kb-from-server.lang.zh.json +3 -0
- package/dist/collection/components/new-kb/new-kb.js +1 -1
- package/dist/components/combo-box.js +0 -1
- package/dist/components/gx-ide-create-kb-from-server.d.ts +11 -0
- package/dist/components/gx-ide-create-kb-from-server.js +245 -0
- package/dist/components/gx-ide-new-kb.js +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/list-box-item.js +0 -1
- package/dist/components/list-box.js +1 -5
- package/dist/esm/genexus-ide-ui.js +1 -1
- package/dist/esm/gx-ide-create-kb-from-server.entry.js +132 -0
- package/dist/esm/gx-ide-new-kb.entry.js +1 -1
- package/dist/esm/gxg-combo-box_6.entry.js +0 -1
- package/dist/esm/gxg-form-checkbox-group.entry.js +87 -0
- package/dist/esm/{gxg-form-checkbox-group_2.entry.js → gxg-form-radio.entry.js} +1 -85
- package/dist/esm/gxg-list-box_2.entry.js +1 -6
- package/dist/esm/loader.js +1 -1
- package/dist/genexus-ide-ui/genexus-ide-ui.esm.js +1 -1
- package/dist/genexus-ide-ui/gx-ide-assets/create-kb-from-server/langs/create-kb-from-server.lang.en.json +17 -0
- package/dist/genexus-ide-ui/gx-ide-assets/create-kb-from-server/langs/create-kb-from-server.lang.ja.json +3 -0
- package/dist/genexus-ide-ui/gx-ide-assets/create-kb-from-server/langs/create-kb-from-server.lang.zh.json +3 -0
- package/dist/genexus-ide-ui/p-c6ad49cc.entry.js +1 -0
- package/dist/genexus-ide-ui/p-cf41f154.entry.js +1 -0
- package/dist/genexus-ide-ui/p-f305e4d3.entry.js +1 -0
- package/dist/genexus-ide-ui/p-f3a1dc7c.entry.js +1 -0
- package/dist/genexus-ide-ui/p-f9731b7c.entry.js +1 -0
- package/dist/types/components/create-kb-from-server/create-kb-from-server.d.ts +90 -0
- package/dist/types/components.d.ts +87 -1
- package/package.json +3 -3
- package/dist/genexus-ide-ui/p-5884a014.entry.js +0 -1
- package/dist/genexus-ide-ui/p-7285d245.entry.js +0 -1
- package/dist/genexus-ide-ui/p-ad03b1e0.entry.js +0 -1
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
/* STENCIL IMPORTS */
|
|
2
|
+
import { Host, h } from "@stencil/core";
|
|
3
|
+
import { Locale } from "../../common/locale";
|
|
4
|
+
import { renderFormItems } from "../../common/common";
|
|
5
|
+
import { formSubmitValidation } from "../../common/form-validation";
|
|
6
|
+
export class GxIdeCreateKbFromServer {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.kbIdSelected = null;
|
|
9
|
+
this.authenticationTypes = [];
|
|
10
|
+
// 7.LISTENERS //
|
|
11
|
+
// 8.PUBLIC METHODS API //
|
|
12
|
+
// 9.LOCAL METHODS //
|
|
13
|
+
this.setAuthenticationTypes = () => {
|
|
14
|
+
this.authenticationTypes = [
|
|
15
|
+
{
|
|
16
|
+
id: "genexus",
|
|
17
|
+
value: "genexus",
|
|
18
|
+
label: this._componentLocale.authenticationTypes.genexusAccount
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
id: "local",
|
|
22
|
+
value: "local",
|
|
23
|
+
label: this._componentLocale.authenticationTypes.local
|
|
24
|
+
}
|
|
25
|
+
];
|
|
26
|
+
};
|
|
27
|
+
this.addEventListeners = () => {
|
|
28
|
+
this.serverUrlsEl.addEventListener("valueChanged", () => {
|
|
29
|
+
this.reset();
|
|
30
|
+
});
|
|
31
|
+
this.searchKBEl.addEventListener("valueChanged", (e) => {
|
|
32
|
+
this.kbNameEl.value = "";
|
|
33
|
+
this.kbIdSelected = null;
|
|
34
|
+
this.kbSearchText = e.detail;
|
|
35
|
+
});
|
|
36
|
+
this.listBoxEl.addEventListener("selectionChanged", (ev) => {
|
|
37
|
+
const selectedItems = ev.detail.items;
|
|
38
|
+
let selectedItem;
|
|
39
|
+
if (selectedItems.length > 0) {
|
|
40
|
+
selectedItem = ev.detail.items[0];
|
|
41
|
+
}
|
|
42
|
+
if (selectedItem) {
|
|
43
|
+
this.kbIdSelected = selectedItem.value;
|
|
44
|
+
const kbSelected = this.kbs.find(kb => kb.id === this.kbIdSelected);
|
|
45
|
+
if (kbSelected) {
|
|
46
|
+
this.kbNameEl.value = kbSelected.name;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
this.createKbHandler = () => {
|
|
52
|
+
if (this.createKBCallback) {
|
|
53
|
+
const createKBCallbackPromise = this.createKBCallback({
|
|
54
|
+
id: this.kbIdSelected,
|
|
55
|
+
name: this.kbNameEl.value
|
|
56
|
+
});
|
|
57
|
+
createKBCallbackPromise.then((formSubmitResult) => {
|
|
58
|
+
formSubmitValidation(formSubmitResult, this);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
this.connectCallbackHandler = () => {
|
|
63
|
+
var _a, _b;
|
|
64
|
+
if (this.connectCallback) {
|
|
65
|
+
const connectCallbackPromise = this.connectCallback({
|
|
66
|
+
serverUrl: this.serverUrlsEl.value,
|
|
67
|
+
authenticationType: this.authenticationTypeEl.value,
|
|
68
|
+
user: (_a = this.userNameEl) === null || _a === void 0 ? void 0 : _a.value,
|
|
69
|
+
password: (_b = this.passwordEl) === null || _b === void 0 ? void 0 : _b.value
|
|
70
|
+
});
|
|
71
|
+
connectCallbackPromise.then((connectionResultData) => {
|
|
72
|
+
formSubmitValidation(connectionResultData.formResult, this);
|
|
73
|
+
if (connectionResultData.formResult.success &&
|
|
74
|
+
connectionResultData.kbs) {
|
|
75
|
+
this.kbs = connectionResultData.kbs;
|
|
76
|
+
this.selectionKbDisabled = false;
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
this.selectionKbDisabled = true;
|
|
82
|
+
this.kbs = [];
|
|
83
|
+
this.kbSearchText = "";
|
|
84
|
+
this.connectCallback = undefined;
|
|
85
|
+
this.createKBCallback = undefined;
|
|
86
|
+
this.enableCustomServer = false;
|
|
87
|
+
this.kbName = undefined;
|
|
88
|
+
this.password = undefined;
|
|
89
|
+
this.serverUrls = undefined;
|
|
90
|
+
this.userName = undefined;
|
|
91
|
+
}
|
|
92
|
+
// 6.METHODS //
|
|
93
|
+
async componentWillLoad() {
|
|
94
|
+
this._componentLocale = await Locale.getComponentStrings(this.el);
|
|
95
|
+
// this.setInitialValues();
|
|
96
|
+
this.setAuthenticationTypes();
|
|
97
|
+
}
|
|
98
|
+
componentDidLoad() {
|
|
99
|
+
this.serverUrlsEl.focus();
|
|
100
|
+
this.addEventListeners();
|
|
101
|
+
}
|
|
102
|
+
reset() {
|
|
103
|
+
this.kbs = [];
|
|
104
|
+
this.kbIdSelected = null;
|
|
105
|
+
this.selectionKbDisabled = true;
|
|
106
|
+
this.searchKBEl.value = "";
|
|
107
|
+
this.kbSearchText = "";
|
|
108
|
+
}
|
|
109
|
+
// 10.RENDER() FUNCTION //
|
|
110
|
+
// 11.RENDER() FUNCTION //
|
|
111
|
+
render() {
|
|
112
|
+
return (h(Host, { class: { "gx-ide-component": true } }, h("div", { class: `main-wrapper` }, h("gxg-container", null, h("div", { class: "flex" }, h("gxg-label", { labelPosition: "start", class: "kb-label" }, this._componentLocale.label.serverUrl), h("gxg-combo-box", { disableFilter: !this.enableCustomServer, ref: (el) => (this.serverUrlsEl = el), class: "server-urls-combo-box", part: "server-urls" }, this.serverUrls
|
|
113
|
+
? renderFormItems("gxg-combo-box-item", this.serverUrls.map(sUrl => ({
|
|
114
|
+
id: sUrl,
|
|
115
|
+
label: sUrl,
|
|
116
|
+
value: sUrl
|
|
117
|
+
})), "server-urls")
|
|
118
|
+
: null)), h("div", { class: "grid grid-data" }, h("div", null, h("div", { class: "grid grid-data-account" }, h("gxg-combo-box", { disableFilter: true, value: this.authenticationTypes[0].id, ref: (el) => (this.authenticationTypeEl = el), class: "authentication-type", part: "authentication-type", onValueChanged: this.evaluateAuthenticationType }, renderFormItems("gxg-combo-box-item", this.authenticationTypes, "authentication-type")), h("gxg-label", { labelPosition: "start", class: "kb-label" }, `${this._componentLocale.label.userName}:`), h("gxg-form-text", { ref: (el) => (this.userNameEl = el), value: this.userName, class: "user-name", part: "user-name" }), h("gxg-label", { labelPosition: "start", class: "kb-label" }, `${this._componentLocale.label.password}:`), h("gxg-form-text", { password: true, ref: (el) => (this.passwordEl = el), value: this.password, class: "password", part: "password" }), h("div", null, h("gxg-button", { id: "button-connect", type: "primary-text-only", onClick: this.connectCallbackHandler, part: "button-connect" }, this._componentLocale.btn.btnConnect)))), h("div", { class: "grid" }, h("div", { class: "grid-data-kbs" }, h("div", { class: "search-kbs" }, h("gxg-form-text", { ref: (el) => (this.searchKBEl = el), class: "search-kb-input", part: "search-kb", disabled: this.selectionKbDisabled, placeholder: this._componentLocale.label.searchKbs })), h("div", { class: "box-kbs" }, h("gxg-list-box", { id: "max-height", height: "100%", "min-height": "50%", "no-border": true, "single-selection": true, disabled: this.selectionKbDisabled, ref: (el) => (this.listBoxEl = el), part: "kbs", onSelectionChanged: this.kbsOnSelectionChangedHander }, this.kbs
|
|
119
|
+
.filter(kb => kb.name
|
|
120
|
+
.toLowerCase()
|
|
121
|
+
.includes(this.kbSearchText.toLowerCase()))
|
|
122
|
+
.map(kb => (h("gxg-list-box-item", { value: kb.id, key: kb.id }, kb.name)))))), h("div", { class: "grid grid-data-kbs-footer" }, h("gxg-form-text", { ref: (el) => (this.kbNameEl = el), value: this.kbName, class: "kb-name", part: "kb-name", disabled: this.selectionKbDisabled }), h("div", null, h("gxg-button", { id: "button-create", type: "primary-text-only", onClick: this.createKbHandler, part: "button-create", disabled: this.selectionKbDisabled }, this._componentLocale.btn.btnCreate)))))))));
|
|
123
|
+
}
|
|
124
|
+
static get is() { return "gx-ide-create-kb-from-server"; }
|
|
125
|
+
static get encapsulation() { return "shadow"; }
|
|
126
|
+
static get originalStyleUrls() {
|
|
127
|
+
return {
|
|
128
|
+
"$": ["create-kb-from-server.scss"]
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
static get styleUrls() {
|
|
132
|
+
return {
|
|
133
|
+
"$": ["create-kb-from-server.css"]
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
static get assetsDirs() { return ["gx-ide-assets/create-kb-from-server"]; }
|
|
137
|
+
static get properties() {
|
|
138
|
+
return {
|
|
139
|
+
"connectCallback": {
|
|
140
|
+
"type": "unknown",
|
|
141
|
+
"mutable": false,
|
|
142
|
+
"complexType": {
|
|
143
|
+
"original": "(\n data: GXServerConnectionData\n ) => Promise<ConnectionResultData>",
|
|
144
|
+
"resolved": "(data: GXServerConnectionData) => Promise<ConnectionResultData>",
|
|
145
|
+
"references": {
|
|
146
|
+
"GXServerConnectionData": {
|
|
147
|
+
"location": "local"
|
|
148
|
+
},
|
|
149
|
+
"Promise": {
|
|
150
|
+
"location": "global"
|
|
151
|
+
},
|
|
152
|
+
"ConnectionResultData": {
|
|
153
|
+
"location": "local"
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
"required": false,
|
|
158
|
+
"optional": false,
|
|
159
|
+
"docs": {
|
|
160
|
+
"tags": [],
|
|
161
|
+
"text": "Callback that will be invoked when the user connect to the kb server (\u2018Connect\u2019 button)"
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
"createKBCallback": {
|
|
165
|
+
"type": "unknown",
|
|
166
|
+
"mutable": false,
|
|
167
|
+
"complexType": {
|
|
168
|
+
"original": "(\n data: CreateKBData\n ) => Promise<FormSubmitResult>",
|
|
169
|
+
"resolved": "(data: CreateKBData) => Promise<FormSubmitResult>",
|
|
170
|
+
"references": {
|
|
171
|
+
"CreateKBData": {
|
|
172
|
+
"location": "local"
|
|
173
|
+
},
|
|
174
|
+
"Promise": {
|
|
175
|
+
"location": "global"
|
|
176
|
+
},
|
|
177
|
+
"FormSubmitResult": {
|
|
178
|
+
"location": "import",
|
|
179
|
+
"path": "../../common/types"
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
"required": false,
|
|
184
|
+
"optional": false,
|
|
185
|
+
"docs": {
|
|
186
|
+
"tags": [],
|
|
187
|
+
"text": "Callback that will be invoked when the user confirms KB creation (\u2018Create\u2019 button)"
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
"enableCustomServer": {
|
|
191
|
+
"type": "boolean",
|
|
192
|
+
"mutable": false,
|
|
193
|
+
"complexType": {
|
|
194
|
+
"original": "boolean",
|
|
195
|
+
"resolved": "boolean",
|
|
196
|
+
"references": {}
|
|
197
|
+
},
|
|
198
|
+
"required": false,
|
|
199
|
+
"optional": false,
|
|
200
|
+
"docs": {
|
|
201
|
+
"tags": [],
|
|
202
|
+
"text": "If is true then the user can specify a server url that don't be in the combo box of server urls."
|
|
203
|
+
},
|
|
204
|
+
"attribute": "enable-custom-server",
|
|
205
|
+
"reflect": false,
|
|
206
|
+
"defaultValue": "false"
|
|
207
|
+
},
|
|
208
|
+
"kbName": {
|
|
209
|
+
"type": "string",
|
|
210
|
+
"mutable": false,
|
|
211
|
+
"complexType": {
|
|
212
|
+
"original": "string",
|
|
213
|
+
"resolved": "string",
|
|
214
|
+
"references": {}
|
|
215
|
+
},
|
|
216
|
+
"required": false,
|
|
217
|
+
"optional": false,
|
|
218
|
+
"docs": {
|
|
219
|
+
"tags": [],
|
|
220
|
+
"text": "The knowledge base default suggested name"
|
|
221
|
+
},
|
|
222
|
+
"attribute": "kb-name",
|
|
223
|
+
"reflect": false
|
|
224
|
+
},
|
|
225
|
+
"password": {
|
|
226
|
+
"type": "string",
|
|
227
|
+
"mutable": false,
|
|
228
|
+
"complexType": {
|
|
229
|
+
"original": "string",
|
|
230
|
+
"resolved": "string",
|
|
231
|
+
"references": {}
|
|
232
|
+
},
|
|
233
|
+
"required": false,
|
|
234
|
+
"optional": false,
|
|
235
|
+
"docs": {
|
|
236
|
+
"tags": [],
|
|
237
|
+
"text": "Password for the database connection."
|
|
238
|
+
},
|
|
239
|
+
"attribute": "password",
|
|
240
|
+
"reflect": false
|
|
241
|
+
},
|
|
242
|
+
"serverUrls": {
|
|
243
|
+
"type": "unknown",
|
|
244
|
+
"mutable": false,
|
|
245
|
+
"complexType": {
|
|
246
|
+
"original": "string[]",
|
|
247
|
+
"resolved": "string[]",
|
|
248
|
+
"references": {}
|
|
249
|
+
},
|
|
250
|
+
"required": true,
|
|
251
|
+
"optional": false,
|
|
252
|
+
"docs": {
|
|
253
|
+
"tags": [],
|
|
254
|
+
"text": "Array of URLs of cataloged servers to be displayed in the combo"
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
"userName": {
|
|
258
|
+
"type": "string",
|
|
259
|
+
"mutable": false,
|
|
260
|
+
"complexType": {
|
|
261
|
+
"original": "string",
|
|
262
|
+
"resolved": "string",
|
|
263
|
+
"references": {}
|
|
264
|
+
},
|
|
265
|
+
"required": false,
|
|
266
|
+
"optional": false,
|
|
267
|
+
"docs": {
|
|
268
|
+
"tags": [],
|
|
269
|
+
"text": "Username for the database connection."
|
|
270
|
+
},
|
|
271
|
+
"attribute": "user-name",
|
|
272
|
+
"reflect": false
|
|
273
|
+
}
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
static get states() {
|
|
277
|
+
return {
|
|
278
|
+
"selectionKbDisabled": {},
|
|
279
|
+
"kbs": {},
|
|
280
|
+
"kbSearchText": {}
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
static get events() {
|
|
284
|
+
return [{
|
|
285
|
+
"method": "componentDidLoadEvent",
|
|
286
|
+
"name": "componentDidLoadEvent",
|
|
287
|
+
"bubbles": true,
|
|
288
|
+
"cancelable": true,
|
|
289
|
+
"composed": true,
|
|
290
|
+
"docs": {
|
|
291
|
+
"tags": [],
|
|
292
|
+
"text": "This event is emitted once just after the component is fully loaded and the first render() occurs"
|
|
293
|
+
},
|
|
294
|
+
"complexType": {
|
|
295
|
+
"original": "boolean",
|
|
296
|
+
"resolved": "boolean",
|
|
297
|
+
"references": {}
|
|
298
|
+
}
|
|
299
|
+
}];
|
|
300
|
+
}
|
|
301
|
+
static get elementRef() { return "el"; }
|
|
302
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"label": {
|
|
3
|
+
"serverUrl": "GXServer URL",
|
|
4
|
+
"authenticationType": "Authentication Type",
|
|
5
|
+
"userName": "User Name",
|
|
6
|
+
"password": "Password",
|
|
7
|
+
"searchKbs": "Search KBs"
|
|
8
|
+
},
|
|
9
|
+
"authenticationTypes": {
|
|
10
|
+
"genexusAccount": "GeneXus Account",
|
|
11
|
+
"local": "Local"
|
|
12
|
+
},
|
|
13
|
+
"btn": {
|
|
14
|
+
"btnCreate": "Create",
|
|
15
|
+
"btnConnect": "Connect >>"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -124,7 +124,7 @@ export class GxIdeNewKb {
|
|
|
124
124
|
password: (_o = this.passwordEl) === null || _o === void 0 ? void 0 : _o.value,
|
|
125
125
|
savePassword: (_p = this.savePasswordEl) === null || _p === void 0 ? void 0 : _p.checked
|
|
126
126
|
});
|
|
127
|
-
createCallbackPromise.then(formSubmitResult => {
|
|
127
|
+
createCallbackPromise.then((formSubmitResult) => {
|
|
128
128
|
formSubmitValidation(formSubmitResult, this);
|
|
129
129
|
});
|
|
130
130
|
}
|
|
@@ -137,7 +137,6 @@ const GxgComboBox = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
137
137
|
HANDLERS
|
|
138
138
|
*********************************/
|
|
139
139
|
this.inputHandler = (e) => {
|
|
140
|
-
console.log("e", e.detail);
|
|
141
140
|
this.userTyped = true;
|
|
142
141
|
const value = this.sanitizeString(e.detail);
|
|
143
142
|
const filteredItems = this.filterList(value);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface GxIdeCreateKbFromServer extends Components.GxIdeCreateKbFromServer, HTMLElement {}
|
|
4
|
+
export const GxIdeCreateKbFromServer: {
|
|
5
|
+
prototype: GxIdeCreateKbFromServer;
|
|
6
|
+
new (): GxIdeCreateKbFromServer;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { L as Locale } from './locale.js';
|
|
3
|
+
import { f as formSubmitValidation, r as renderFormItems } from './form-validation.js';
|
|
4
|
+
import { d as defineCustomElement$f } from './icon.js';
|
|
5
|
+
import { d as defineCustomElement$e } from './button.js';
|
|
6
|
+
import { d as defineCustomElement$d } from './combo-box.js';
|
|
7
|
+
import { d as defineCustomElement$c } from './combo-box-item.js';
|
|
8
|
+
import { d as defineCustomElement$b } from './container2.js';
|
|
9
|
+
import { d as defineCustomElement$a } from './form-checkbox.js';
|
|
10
|
+
import { d as defineCustomElement$9 } from './form-radio.js';
|
|
11
|
+
import { d as defineCustomElement$8 } from './form-text.js';
|
|
12
|
+
import { d as defineCustomElement$7 } from './icon2.js';
|
|
13
|
+
import { d as defineCustomElement$6 } from './gxg-label2.js';
|
|
14
|
+
import { d as defineCustomElement$5 } from './list-box.js';
|
|
15
|
+
import { d as defineCustomElement$4 } from './list-box-item.js';
|
|
16
|
+
import { d as defineCustomElement$3 } from './title.js';
|
|
17
|
+
import { d as defineCustomElement$2 } from './tooltip.js';
|
|
18
|
+
|
|
19
|
+
const createKbFromServerCss = ".gxi-hidden{display:none !important}.gxi-full-height{height:100%}.align-start{display:flex;align-items:start}.align-center{display:flex;align-items:center}.align-end{display:flex;align-items:end}.grid{display:grid;grid-row-gap:var(--gx-ide-grid-row-gap);grid-column-gap:var(--gx-ide-grid-column-gap);grid-template-rows:auto}ch-grid-cell{display:flex}:host(.gx-ide-component){box-shadow:var(--box-shadow-01) !important;height:100% !important;display:flex !important;flex-direction:column !important}:host(:focus-within) gx-ide-top-bar::part(wrapper){background-color:var(--color-secondary-enabled)}.gx-ide-main-wrapper{color:var(--gx-ide-component-text-color);font-weight:var(--font-weight-regular);font-size:var(--font-size-lg);line-height:1.6em;height:100%;background-color:var(--gx-ide-component-background-color);display:flex;flex-direction:column;flex-grow:1}.gx-ide-main{flex-grow:1;overflow-y:auto;}.gx-ide-main::-webkit-scrollbar{width:6px;height:6px}.gx-ide-main::-webkit-scrollbar-track{background-color:var(--gray-02);border-radius:10px}.gx-ide-main::-webkit-scrollbar-thumb{background:var(--gray-05);border-radius:10px}.gx-ide-main::-webkit-scrollbar-thumb:hover{background:var(--gray-04);cursor:pointer}.gx-ide-main .gxg-scroll{display:block;overflow-y:auto;padding-inline-end:2px}.gx-ide-overflow{overflow-y:auto;}.gx-ide-overflow::-webkit-scrollbar{width:6px;height:6px}.gx-ide-overflow::-webkit-scrollbar-track{background-color:var(--gray-02);border-radius:10px}.gx-ide-overflow::-webkit-scrollbar-thumb{background:var(--gray-05);border-radius:10px}.gx-ide-overflow::-webkit-scrollbar-thumb:hover{background:var(--gray-04);cursor:pointer}.gx-ide-overflow .gxg-scroll{display:block;overflow-y:auto;padding-inline-end:2px}:host{display:block;border:1px solid var(--gxg-border-color--regular);background-color:var(--color-background)}.grid-data{grid-template-columns:repeat(2, 1fr)}.grid-data-account{grid-template-columns:auto 1fr}.grid-data-account>:nth-child(1){grid-area:1/1/2/3}.grid-data-account>:nth-child(6){grid-area:4/2/5/3}.grid-data-kbs .search-kbs{width:100%;display:flex}.grid-data-kbs .box-kbs{height:150px}.grid-data-kbs-footer{grid-template-columns:repeat(2, auto)}.flex{display:flex}.flex>:nth-child(2){flex:1}";
|
|
20
|
+
|
|
21
|
+
const GxIdeCreateKbFromServer$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
22
|
+
constructor() {
|
|
23
|
+
super();
|
|
24
|
+
this.__registerHost();
|
|
25
|
+
this.__attachShadow();
|
|
26
|
+
this.componentDidLoadEvent = createEvent(this, "componentDidLoadEvent", 7);
|
|
27
|
+
this.kbIdSelected = null;
|
|
28
|
+
this.authenticationTypes = [];
|
|
29
|
+
// 7.LISTENERS //
|
|
30
|
+
// 8.PUBLIC METHODS API //
|
|
31
|
+
// 9.LOCAL METHODS //
|
|
32
|
+
this.setAuthenticationTypes = () => {
|
|
33
|
+
this.authenticationTypes = [
|
|
34
|
+
{
|
|
35
|
+
id: "genexus",
|
|
36
|
+
value: "genexus",
|
|
37
|
+
label: this._componentLocale.authenticationTypes.genexusAccount
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: "local",
|
|
41
|
+
value: "local",
|
|
42
|
+
label: this._componentLocale.authenticationTypes.local
|
|
43
|
+
}
|
|
44
|
+
];
|
|
45
|
+
};
|
|
46
|
+
this.addEventListeners = () => {
|
|
47
|
+
this.serverUrlsEl.addEventListener("valueChanged", () => {
|
|
48
|
+
this.reset();
|
|
49
|
+
});
|
|
50
|
+
this.searchKBEl.addEventListener("valueChanged", (e) => {
|
|
51
|
+
this.kbNameEl.value = "";
|
|
52
|
+
this.kbIdSelected = null;
|
|
53
|
+
this.kbSearchText = e.detail;
|
|
54
|
+
});
|
|
55
|
+
this.listBoxEl.addEventListener("selectionChanged", (ev) => {
|
|
56
|
+
const selectedItems = ev.detail.items;
|
|
57
|
+
let selectedItem;
|
|
58
|
+
if (selectedItems.length > 0) {
|
|
59
|
+
selectedItem = ev.detail.items[0];
|
|
60
|
+
}
|
|
61
|
+
if (selectedItem) {
|
|
62
|
+
this.kbIdSelected = selectedItem.value;
|
|
63
|
+
const kbSelected = this.kbs.find(kb => kb.id === this.kbIdSelected);
|
|
64
|
+
if (kbSelected) {
|
|
65
|
+
this.kbNameEl.value = kbSelected.name;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
this.createKbHandler = () => {
|
|
71
|
+
if (this.createKBCallback) {
|
|
72
|
+
const createKBCallbackPromise = this.createKBCallback({
|
|
73
|
+
id: this.kbIdSelected,
|
|
74
|
+
name: this.kbNameEl.value
|
|
75
|
+
});
|
|
76
|
+
createKBCallbackPromise.then((formSubmitResult) => {
|
|
77
|
+
formSubmitValidation(formSubmitResult, this);
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
this.connectCallbackHandler = () => {
|
|
82
|
+
var _a, _b;
|
|
83
|
+
if (this.connectCallback) {
|
|
84
|
+
const connectCallbackPromise = this.connectCallback({
|
|
85
|
+
serverUrl: this.serverUrlsEl.value,
|
|
86
|
+
authenticationType: this.authenticationTypeEl.value,
|
|
87
|
+
user: (_a = this.userNameEl) === null || _a === void 0 ? void 0 : _a.value,
|
|
88
|
+
password: (_b = this.passwordEl) === null || _b === void 0 ? void 0 : _b.value
|
|
89
|
+
});
|
|
90
|
+
connectCallbackPromise.then((connectionResultData) => {
|
|
91
|
+
formSubmitValidation(connectionResultData.formResult, this);
|
|
92
|
+
if (connectionResultData.formResult.success &&
|
|
93
|
+
connectionResultData.kbs) {
|
|
94
|
+
this.kbs = connectionResultData.kbs;
|
|
95
|
+
this.selectionKbDisabled = false;
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
this.selectionKbDisabled = true;
|
|
101
|
+
this.kbs = [];
|
|
102
|
+
this.kbSearchText = "";
|
|
103
|
+
this.connectCallback = undefined;
|
|
104
|
+
this.createKBCallback = undefined;
|
|
105
|
+
this.enableCustomServer = false;
|
|
106
|
+
this.kbName = undefined;
|
|
107
|
+
this.password = undefined;
|
|
108
|
+
this.serverUrls = undefined;
|
|
109
|
+
this.userName = undefined;
|
|
110
|
+
}
|
|
111
|
+
// 6.METHODS //
|
|
112
|
+
async componentWillLoad() {
|
|
113
|
+
this._componentLocale = await Locale.getComponentStrings(this.el);
|
|
114
|
+
// this.setInitialValues();
|
|
115
|
+
this.setAuthenticationTypes();
|
|
116
|
+
}
|
|
117
|
+
componentDidLoad() {
|
|
118
|
+
this.serverUrlsEl.focus();
|
|
119
|
+
this.addEventListeners();
|
|
120
|
+
}
|
|
121
|
+
reset() {
|
|
122
|
+
this.kbs = [];
|
|
123
|
+
this.kbIdSelected = null;
|
|
124
|
+
this.selectionKbDisabled = true;
|
|
125
|
+
this.searchKBEl.value = "";
|
|
126
|
+
this.kbSearchText = "";
|
|
127
|
+
}
|
|
128
|
+
// 10.RENDER() FUNCTION //
|
|
129
|
+
// 11.RENDER() FUNCTION //
|
|
130
|
+
render() {
|
|
131
|
+
return (h(Host, { class: { "gx-ide-component": true } }, h("div", { class: `main-wrapper` }, h("gxg-container", null, h("div", { class: "flex" }, h("gxg-label", { labelPosition: "start", class: "kb-label" }, this._componentLocale.label.serverUrl), h("gxg-combo-box", { disableFilter: !this.enableCustomServer, ref: (el) => (this.serverUrlsEl = el), class: "server-urls-combo-box", part: "server-urls" }, this.serverUrls
|
|
132
|
+
? renderFormItems("gxg-combo-box-item", this.serverUrls.map(sUrl => ({
|
|
133
|
+
id: sUrl,
|
|
134
|
+
label: sUrl,
|
|
135
|
+
value: sUrl
|
|
136
|
+
})), "server-urls")
|
|
137
|
+
: null)), h("div", { class: "grid grid-data" }, h("div", null, h("div", { class: "grid grid-data-account" }, h("gxg-combo-box", { disableFilter: true, value: this.authenticationTypes[0].id, ref: (el) => (this.authenticationTypeEl = el), class: "authentication-type", part: "authentication-type", onValueChanged: this.evaluateAuthenticationType }, renderFormItems("gxg-combo-box-item", this.authenticationTypes, "authentication-type")), h("gxg-label", { labelPosition: "start", class: "kb-label" }, `${this._componentLocale.label.userName}:`), h("gxg-form-text", { ref: (el) => (this.userNameEl = el), value: this.userName, class: "user-name", part: "user-name" }), h("gxg-label", { labelPosition: "start", class: "kb-label" }, `${this._componentLocale.label.password}:`), h("gxg-form-text", { password: true, ref: (el) => (this.passwordEl = el), value: this.password, class: "password", part: "password" }), h("div", null, h("gxg-button", { id: "button-connect", type: "primary-text-only", onClick: this.connectCallbackHandler, part: "button-connect" }, this._componentLocale.btn.btnConnect)))), h("div", { class: "grid" }, h("div", { class: "grid-data-kbs" }, h("div", { class: "search-kbs" }, h("gxg-form-text", { ref: (el) => (this.searchKBEl = el), class: "search-kb-input", part: "search-kb", disabled: this.selectionKbDisabled, placeholder: this._componentLocale.label.searchKbs })), h("div", { class: "box-kbs" }, h("gxg-list-box", { id: "max-height", height: "100%", "min-height": "50%", "no-border": true, "single-selection": true, disabled: this.selectionKbDisabled, ref: (el) => (this.listBoxEl = el), part: "kbs", onSelectionChanged: this.kbsOnSelectionChangedHander }, this.kbs
|
|
138
|
+
.filter(kb => kb.name
|
|
139
|
+
.toLowerCase()
|
|
140
|
+
.includes(this.kbSearchText.toLowerCase()))
|
|
141
|
+
.map(kb => (h("gxg-list-box-item", { value: kb.id, key: kb.id }, kb.name)))))), h("div", { class: "grid grid-data-kbs-footer" }, h("gxg-form-text", { ref: (el) => (this.kbNameEl = el), value: this.kbName, class: "kb-name", part: "kb-name", disabled: this.selectionKbDisabled }), h("div", null, h("gxg-button", { id: "button-create", type: "primary-text-only", onClick: this.createKbHandler, part: "button-create", disabled: this.selectionKbDisabled }, this._componentLocale.btn.btnCreate)))))))));
|
|
142
|
+
}
|
|
143
|
+
static get assetsDirs() { return ["gx-ide-assets/create-kb-from-server"]; }
|
|
144
|
+
get el() { return this; }
|
|
145
|
+
static get style() { return createKbFromServerCss; }
|
|
146
|
+
}, [1, "gx-ide-create-kb-from-server", {
|
|
147
|
+
"connectCallback": [16],
|
|
148
|
+
"createKBCallback": [16],
|
|
149
|
+
"enableCustomServer": [4, "enable-custom-server"],
|
|
150
|
+
"kbName": [1, "kb-name"],
|
|
151
|
+
"password": [1],
|
|
152
|
+
"serverUrls": [16],
|
|
153
|
+
"userName": [1, "user-name"],
|
|
154
|
+
"selectionKbDisabled": [32],
|
|
155
|
+
"kbs": [32],
|
|
156
|
+
"kbSearchText": [32]
|
|
157
|
+
}]);
|
|
158
|
+
function defineCustomElement$1() {
|
|
159
|
+
if (typeof customElements === "undefined") {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
const components = ["gx-ide-create-kb-from-server", "ch-icon", "gxg-button", "gxg-combo-box", "gxg-combo-box-item", "gxg-container", "gxg-form-checkbox", "gxg-form-radio", "gxg-form-text", "gxg-icon", "gxg-label", "gxg-list-box", "gxg-list-box-item", "gxg-title", "gxg-tooltip"];
|
|
163
|
+
components.forEach(tagName => { switch (tagName) {
|
|
164
|
+
case "gx-ide-create-kb-from-server":
|
|
165
|
+
if (!customElements.get(tagName)) {
|
|
166
|
+
customElements.define(tagName, GxIdeCreateKbFromServer$1);
|
|
167
|
+
}
|
|
168
|
+
break;
|
|
169
|
+
case "ch-icon":
|
|
170
|
+
if (!customElements.get(tagName)) {
|
|
171
|
+
defineCustomElement$f();
|
|
172
|
+
}
|
|
173
|
+
break;
|
|
174
|
+
case "gxg-button":
|
|
175
|
+
if (!customElements.get(tagName)) {
|
|
176
|
+
defineCustomElement$e();
|
|
177
|
+
}
|
|
178
|
+
break;
|
|
179
|
+
case "gxg-combo-box":
|
|
180
|
+
if (!customElements.get(tagName)) {
|
|
181
|
+
defineCustomElement$d();
|
|
182
|
+
}
|
|
183
|
+
break;
|
|
184
|
+
case "gxg-combo-box-item":
|
|
185
|
+
if (!customElements.get(tagName)) {
|
|
186
|
+
defineCustomElement$c();
|
|
187
|
+
}
|
|
188
|
+
break;
|
|
189
|
+
case "gxg-container":
|
|
190
|
+
if (!customElements.get(tagName)) {
|
|
191
|
+
defineCustomElement$b();
|
|
192
|
+
}
|
|
193
|
+
break;
|
|
194
|
+
case "gxg-form-checkbox":
|
|
195
|
+
if (!customElements.get(tagName)) {
|
|
196
|
+
defineCustomElement$a();
|
|
197
|
+
}
|
|
198
|
+
break;
|
|
199
|
+
case "gxg-form-radio":
|
|
200
|
+
if (!customElements.get(tagName)) {
|
|
201
|
+
defineCustomElement$9();
|
|
202
|
+
}
|
|
203
|
+
break;
|
|
204
|
+
case "gxg-form-text":
|
|
205
|
+
if (!customElements.get(tagName)) {
|
|
206
|
+
defineCustomElement$8();
|
|
207
|
+
}
|
|
208
|
+
break;
|
|
209
|
+
case "gxg-icon":
|
|
210
|
+
if (!customElements.get(tagName)) {
|
|
211
|
+
defineCustomElement$7();
|
|
212
|
+
}
|
|
213
|
+
break;
|
|
214
|
+
case "gxg-label":
|
|
215
|
+
if (!customElements.get(tagName)) {
|
|
216
|
+
defineCustomElement$6();
|
|
217
|
+
}
|
|
218
|
+
break;
|
|
219
|
+
case "gxg-list-box":
|
|
220
|
+
if (!customElements.get(tagName)) {
|
|
221
|
+
defineCustomElement$5();
|
|
222
|
+
}
|
|
223
|
+
break;
|
|
224
|
+
case "gxg-list-box-item":
|
|
225
|
+
if (!customElements.get(tagName)) {
|
|
226
|
+
defineCustomElement$4();
|
|
227
|
+
}
|
|
228
|
+
break;
|
|
229
|
+
case "gxg-title":
|
|
230
|
+
if (!customElements.get(tagName)) {
|
|
231
|
+
defineCustomElement$3();
|
|
232
|
+
}
|
|
233
|
+
break;
|
|
234
|
+
case "gxg-tooltip":
|
|
235
|
+
if (!customElements.get(tagName)) {
|
|
236
|
+
defineCustomElement$2();
|
|
237
|
+
}
|
|
238
|
+
break;
|
|
239
|
+
} });
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
const GxIdeCreateKbFromServer = GxIdeCreateKbFromServer$1;
|
|
243
|
+
const defineCustomElement = defineCustomElement$1;
|
|
244
|
+
|
|
245
|
+
export { GxIdeCreateKbFromServer, defineCustomElement };
|
|
@@ -142,7 +142,7 @@ const GxIdeNewKb$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
142
142
|
password: (_o = this.passwordEl) === null || _o === void 0 ? void 0 : _o.value,
|
|
143
143
|
savePassword: (_p = this.savePasswordEl) === null || _p === void 0 ? void 0 : _p.checked
|
|
144
144
|
});
|
|
145
|
-
createCallbackPromise.then(formSubmitResult => {
|
|
145
|
+
createCallbackPromise.then((formSubmitResult) => {
|
|
146
146
|
formSubmitValidation(formSubmitResult, this);
|
|
147
147
|
});
|
|
148
148
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* GenexusIdeUi custom elements */
|
|
2
2
|
export { GxIdeContainer as GxIdeContainer } from '../types/components/container/container';
|
|
3
|
+
export { GxIdeCreateKbFromServer as GxIdeCreateKbFromServer } from '../types/components/create-kb-from-server/create-kb-from-server';
|
|
3
4
|
export { GxIdeDirectorySelector as GxIdeDirectorySelector } from '../types/components/directory-selector/directory-selector';
|
|
4
5
|
export { GxIdeEntitySelector as GxIdeEntitySelector } from '../types/components/entity-selector/entity-selector';
|
|
5
6
|
export { GxIdeListSelector as GxIdeListSelector } from '../types/components/list-selector/list-selector';
|
package/dist/components/index.js
CHANGED
|
@@ -61,6 +61,7 @@ export { ChWindowClose, defineCustomElement as defineCustomElementChWindowClose
|
|
|
61
61
|
export { GxGridChameleon, defineCustomElement as defineCustomElementGxGridChameleon } from './gx-grid-chameleon.js';
|
|
62
62
|
export { GxGridChameleonColumnFilter, defineCustomElement as defineCustomElementGxGridChameleonColumnFilter } from './gx-grid-chameleon-column-filter.js';
|
|
63
63
|
export { GxIdeContainer, defineCustomElement as defineCustomElementGxIdeContainer } from './gx-ide-container.js';
|
|
64
|
+
export { GxIdeCreateKbFromServer, defineCustomElement as defineCustomElementGxIdeCreateKbFromServer } from './gx-ide-create-kb-from-server.js';
|
|
64
65
|
export { GxIdeDirectorySelector, defineCustomElement as defineCustomElementGxIdeDirectorySelector } from './gx-ide-directory-selector.js';
|
|
65
66
|
export { GxIdeEntitySelector, defineCustomElement as defineCustomElementGxIdeEntitySelector } from './gx-ide-entity-selector.js';
|
|
66
67
|
export { GxIdeListSelector, defineCustomElement as defineCustomElementGxIdeListSelector } from './gx-ide-list-selector.js';
|
|
@@ -112,7 +112,6 @@ const GxgListboxItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
112
112
|
}
|
|
113
113
|
itemClickedFunc(e) {
|
|
114
114
|
const index = this.getIndex();
|
|
115
|
-
//console.log("index", index);
|
|
116
115
|
this.itemClicked.emit({
|
|
117
116
|
clickedItem: this.el,
|
|
118
117
|
ctrlKey: e.ctrlKey,
|
|
@@ -79,7 +79,6 @@ const GxgListBox = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
79
79
|
*/
|
|
80
80
|
this.userUsedKeyboard = false;
|
|
81
81
|
this.headerHeight = 0;
|
|
82
|
-
this.firstChange = true;
|
|
83
82
|
/*********************************
|
|
84
83
|
PROPERTIES FOR VALIDATION
|
|
85
84
|
*********************************/
|
|
@@ -363,10 +362,7 @@ const GxgListBox = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
363
362
|
this.setActiveItem(clickedItem);
|
|
364
363
|
}
|
|
365
364
|
selectedItemsHandler(newArray) {
|
|
366
|
-
|
|
367
|
-
this.selectionChanged.emit({ items: newArray });
|
|
368
|
-
}
|
|
369
|
-
this.firstChange = false;
|
|
365
|
+
this.selectionChanged.emit({ items: newArray });
|
|
370
366
|
}
|
|
371
367
|
checkedItemsHandler(newArray) {
|
|
372
368
|
this.checkedChanged.emit(newArray);
|