@genexus/genexus-ide-ui 3.2.4 → 3.2.5
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-kb-manager-import.cjs.entry.js +37 -11
- package/dist/cjs/gx-ide-kb-manager-import.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/kb-manager-import/kb-manager-import.js +39 -12
- package/dist/collection/components/kb-manager-import/kb-manager-import.js.map +1 -1
- package/dist/components/gx-ide-kb-manager-import.js +38 -11
- package/dist/components/gx-ide-kb-manager-import.js.map +1 -1
- package/dist/esm/genexus-ide-ui.js +1 -1
- package/dist/esm/gx-ide-kb-manager-import.entry.js +37 -11
- package/dist/esm/gx-ide-kb-manager-import.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/{p-06c31f23.entry.js → p-22aa1d86.entry.js} +58 -32
- package/dist/genexus-ide-ui/p-22aa1d86.entry.js.map +1 -0
- package/dist/types/components/kb-manager-import/kb-manager-import.d.ts +17 -1
- package/package.json +1 -1
- package/dist/genexus-ide-ui/p-06c31f23.entry.js.map +0 -1
|
@@ -16,9 +16,9 @@ const r = 30;
|
|
|
16
16
|
|
|
17
17
|
/* objects in file metadata*/ const c = "object";
|
|
18
18
|
|
|
19
|
-
const
|
|
19
|
+
const h = "category";
|
|
20
20
|
|
|
21
|
-
const
|
|
21
|
+
const l = "status";
|
|
22
22
|
|
|
23
23
|
// - - - - - - - - - - - - - - - - -
|
|
24
24
|
// Objects In File Tree Model
|
|
@@ -51,7 +51,7 @@ const convertImportCategoryDataToTreeView = t => {
|
|
|
51
51
|
lazy: t.items.length > r,
|
|
52
52
|
leaf: false,
|
|
53
53
|
startImgSrc: t.icon,
|
|
54
|
-
metadata:
|
|
54
|
+
metadata: h,
|
|
55
55
|
items: t.items.length <= r ? convertImportCategoryItemToTreeItem(t.icon, t.items) : []
|
|
56
56
|
};
|
|
57
57
|
e.push(i);
|
|
@@ -71,7 +71,7 @@ const createImportResultDataMessages = (t, e, i) => {
|
|
|
71
71
|
startImgSrc: "gemini-tools/list-view/on-surface",
|
|
72
72
|
leaf: true,
|
|
73
73
|
metadata: JSON.stringify({
|
|
74
|
-
[
|
|
74
|
+
[l]: i
|
|
75
75
|
})
|
|
76
76
|
});
|
|
77
77
|
}));
|
|
@@ -88,7 +88,7 @@ const createImportResultItem = (t, e) => {
|
|
|
88
88
|
expanded: true,
|
|
89
89
|
leaf: e.messages.length === 0,
|
|
90
90
|
metadata: JSON.stringify({
|
|
91
|
-
[
|
|
91
|
+
[l]: e.status
|
|
92
92
|
}),
|
|
93
93
|
items: createImportResultDataMessages(i, e.messages, e.status)
|
|
94
94
|
};
|
|
@@ -118,8 +118,8 @@ const addImportItemResultDataItem = (t, e, i, s) => {
|
|
|
118
118
|
const c = createImportResultItem(o, t);
|
|
119
119
|
a[r].items = [ ...a[r].items, c ];
|
|
120
120
|
// update category caption length
|
|
121
|
-
const
|
|
122
|
-
a[r].caption = `${o.name} (${
|
|
121
|
+
const h = a[r].items.length;
|
|
122
|
+
a[r].caption = `${o.name} (${h})`;
|
|
123
123
|
return a;
|
|
124
124
|
};
|
|
125
125
|
|
|
@@ -138,7 +138,7 @@ var p = undefined && undefined.__classPrivateFieldSet || function(t, e, i, s, a)
|
|
|
138
138
|
return s === "a" ? a.call(t, i) : a ? a.value = i : e.set(t, i), i;
|
|
139
139
|
};
|
|
140
140
|
|
|
141
|
-
var m, u, b, g, w, k, y, v, _, x, M, W, j, C, T, S, I, $, E, D, L, z, F,
|
|
141
|
+
var m, u, b, g, w, k, y, v, _, x, M, W, j, C, T, S, I, $, E, D, L, z, F, O, A, H, R, N;
|
|
142
142
|
|
|
143
143
|
const P = [ "resets/box-sizing", "components/button", "components/checkbox", "components/edit", "components/icon", "components/tree-view", "utils/form", "utils/layout", "utils/typography", "utils/spacing" ];
|
|
144
144
|
|
|
@@ -223,22 +223,39 @@ const B = class {
|
|
|
223
223
|
This avoids forcing users to expand nodes just to select objects.
|
|
224
224
|
Large categories are not expanded by default to improve performance, which is crucial
|
|
225
225
|
for very large imports (1000+ objects).
|
|
226
|
-
*/ const e =
|
|
227
|
-
for (
|
|
226
|
+
*/ const e = new Set;
|
|
227
|
+
for (const i of f(this, w, "f").model) {
|
|
228
228
|
if (((t = i.items) === null || t === void 0 ? void 0 : t.length) > 0) {
|
|
229
|
-
for (
|
|
230
|
-
if (t.checked)
|
|
229
|
+
for (const t of i.items) {
|
|
230
|
+
if (t.checked) {
|
|
231
|
+
e.add(t.id);
|
|
232
|
+
}
|
|
231
233
|
}
|
|
232
234
|
} else if (i.lazy && i.checked) {
|
|
233
235
|
const t = f(this, M, "f").find((t => t.id == i.id));
|
|
234
|
-
for (
|
|
235
|
-
e.
|
|
236
|
+
for (const i of t.items) {
|
|
237
|
+
e.add(i.id);
|
|
236
238
|
}
|
|
237
239
|
}
|
|
238
240
|
}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
241
|
+
// Compute excluded ids against the full file contents so the server's importAll branch can be used without re-reading the tree.
|
|
242
|
+
const i = [];
|
|
243
|
+
for (const t of f(this, M, "f")) {
|
|
244
|
+
for (const s of t.items) {
|
|
245
|
+
if (!e.has(s.id)) {
|
|
246
|
+
i.push(s.id);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
const s = Array.from(e);
|
|
251
|
+
const a = i.length <= s.length;
|
|
252
|
+
const n = {
|
|
253
|
+
importAll: a,
|
|
254
|
+
objectIds: a ? [] : s,
|
|
255
|
+
excludedObjectIds: a ? i : []
|
|
256
|
+
};
|
|
257
|
+
await this.importCallback(n);
|
|
258
|
+
this.importingIsInProcess = false;
|
|
242
259
|
}));
|
|
243
260
|
I.set(this, (async t => {
|
|
244
261
|
p(this, M, await this.loadCallback(t), "f");
|
|
@@ -255,6 +272,9 @@ const B = class {
|
|
|
255
272
|
}));
|
|
256
273
|
const e = convertImportCategoryDataToTreeView(f(this, M, "f"));
|
|
257
274
|
this.objectsTreeModel = e;
|
|
275
|
+
// Tree-view renders with `checked={true}` by default, so a freshly
|
|
276
|
+
// loaded file starts with everything selected.
|
|
277
|
+
this.hasSelection = e.length > 0;
|
|
258
278
|
}));
|
|
259
279
|
$.set(this, (async t => {
|
|
260
280
|
const e = f(this, M, "f").find((e => e.id === t));
|
|
@@ -286,6 +306,7 @@ const B = class {
|
|
|
286
306
|
} else {
|
|
287
307
|
this.selectAllCheckboxIndeterminate = true;
|
|
288
308
|
}
|
|
309
|
+
this.hasSelection = i.length > 0;
|
|
289
310
|
}));
|
|
290
311
|
D.set(this, (t => {
|
|
291
312
|
if (t.detail.metadata === c) {
|
|
@@ -309,17 +330,17 @@ const B = class {
|
|
|
309
330
|
this.selectedFile = null;
|
|
310
331
|
f(this, g, "f").value = null;
|
|
311
332
|
}));
|
|
312
|
-
|
|
333
|
+
O.set(this, (() => {
|
|
313
334
|
f(this, g, "f").click();
|
|
314
335
|
}));
|
|
315
|
-
|
|
336
|
+
A.set(this, (t => {
|
|
316
337
|
var e;
|
|
317
338
|
const i = t.target;
|
|
318
339
|
if (((e = i.files) === null || e === void 0 ? void 0 : e.length) > 0) {
|
|
319
340
|
this.selectedFile = i.files[0];
|
|
320
341
|
}
|
|
321
342
|
}));
|
|
322
|
-
|
|
343
|
+
H.set(this, (t => {
|
|
323
344
|
const e = t.detail;
|
|
324
345
|
const i = [];
|
|
325
346
|
const s = e.findIndex((t => t.itemId === "errors"));
|
|
@@ -334,10 +355,10 @@ const B = class {
|
|
|
334
355
|
if (n !== -1) {
|
|
335
356
|
i.push("success");
|
|
336
357
|
}
|
|
337
|
-
let o = `"${
|
|
358
|
+
let o = `"${l}":""`;
|
|
338
359
|
if (i.length) {
|
|
339
360
|
const t = i.join("|");
|
|
340
|
-
o = `"${
|
|
361
|
+
o = `"${l}":"(${t})"`;
|
|
341
362
|
}
|
|
342
363
|
this.importedTreeFilterRegExp = new RegExp(o, "i");
|
|
343
364
|
// Update statusInfo for the status-buttons
|
|
@@ -357,12 +378,16 @@ const B = class {
|
|
|
357
378
|
};
|
|
358
379
|
f(this, T, "f").call(this);
|
|
359
380
|
}));
|
|
360
|
-
|
|
381
|
+
R.set(this, (t => {
|
|
361
382
|
if (f(this, w, "f")) {
|
|
362
383
|
const e = t.detail === Y;
|
|
363
384
|
f(this, w, "f").updateAllItemsProperties({
|
|
364
385
|
checked: e
|
|
365
386
|
});
|
|
387
|
+
// updateAllItemsProperties does not fire onCheckedItemsChange, so we
|
|
388
|
+
// mirror the new selection state explicitly to keep the Import button
|
|
389
|
+
// disabled when the user unchecks everything via this toggle.
|
|
390
|
+
this.hasSelection = e && this.objectsTreeModel.length > 0;
|
|
366
391
|
}
|
|
367
392
|
}));
|
|
368
393
|
N.set(this, (() => {
|
|
@@ -386,6 +411,7 @@ const B = class {
|
|
|
386
411
|
}));
|
|
387
412
|
this.selectAllCheckboxValue = undefined;
|
|
388
413
|
this.selectAllCheckboxIndeterminate = false;
|
|
414
|
+
this.hasSelection = false;
|
|
389
415
|
this.importStatusMessage = undefined;
|
|
390
416
|
this.importTreeState = [];
|
|
391
417
|
this.importedTreeFilterRegExp = undefined;
|
|
@@ -489,7 +515,7 @@ const B = class {
|
|
|
489
515
|
hidden: true,
|
|
490
516
|
type: "file",
|
|
491
517
|
accept: ".xpz, .xml",
|
|
492
|
-
onChange: f(this,
|
|
518
|
+
onChange: f(this, A, "f"),
|
|
493
519
|
ref: t => p(this, g, t, "f")
|
|
494
520
|
})), i("div", {
|
|
495
521
|
class: "buttons-spacer"
|
|
@@ -508,7 +534,7 @@ const B = class {
|
|
|
508
534
|
id: "select-file-load-button",
|
|
509
535
|
class: "button-primary",
|
|
510
536
|
part: "select-file-load-button",
|
|
511
|
-
onClick: f(this,
|
|
537
|
+
onClick: f(this, O, "f"),
|
|
512
538
|
disabled: this.importingIsInProcess
|
|
513
539
|
}, f(this, m, "f").header.selectFileButton))), i("section", {
|
|
514
540
|
// objects in file
|
|
@@ -539,7 +565,7 @@ const B = class {
|
|
|
539
565
|
}, i("button", {
|
|
540
566
|
// begin by selecting a file
|
|
541
567
|
class: "button-secondary",
|
|
542
|
-
onClick: f(this,
|
|
568
|
+
onClick: f(this, O, "f")
|
|
543
569
|
}, f(this, m, "f").main.objectsInFile.selectFile)), i("footer", {
|
|
544
570
|
class: "field-group objects-in-file__footer spacing-body-inline"
|
|
545
571
|
}, i("ch-checkbox", {
|
|
@@ -550,7 +576,7 @@ const B = class {
|
|
|
550
576
|
unCheckedValue: q,
|
|
551
577
|
caption: f(this, m, "f").main.objectsInFile.selectUnselect,
|
|
552
578
|
value: this.selectAllCheckboxValue,
|
|
553
|
-
onInput: f(this,
|
|
579
|
+
onInput: f(this, R, "f"),
|
|
554
580
|
disabled: this.importingIsInProcess || this.objectsTreeModel.length === 0,
|
|
555
581
|
part: "select-all-checkbox"
|
|
556
582
|
}), i("div", {
|
|
@@ -560,7 +586,7 @@ const B = class {
|
|
|
560
586
|
id: "import-btn",
|
|
561
587
|
class: "button-primary ",
|
|
562
588
|
onClick: f(this, S, "f"),
|
|
563
|
-
disabled: ((e = this.objectsTreeModel) === null || e === void 0 ? void 0 : e.length) === 0 || this.importingIsInProcess
|
|
589
|
+
disabled: ((e = this.objectsTreeModel) === null || e === void 0 ? void 0 : e.length) === 0 || this.importingIsInProcess || !this.hasSelection
|
|
564
590
|
}, f(this, m, "f").main.objectsInFile.importButton), i("button", {
|
|
565
591
|
// cancel-import button
|
|
566
592
|
id: "cancel-import-btn",
|
|
@@ -619,7 +645,7 @@ const B = class {
|
|
|
619
645
|
hideMessage: true,
|
|
620
646
|
compact: true,
|
|
621
647
|
minimal: this.statusMinimal,
|
|
622
|
-
onSelectionChanged: f(this,
|
|
648
|
+
onSelectionChanged: f(this, H, "f")
|
|
623
649
|
}))));
|
|
624
650
|
}
|
|
625
651
|
static get assetsDirs() {
|
|
@@ -641,10 +667,10 @@ m = new WeakMap, u = new WeakMap, b = new WeakMap, g = new WeakMap, w = new Weak
|
|
|
641
667
|
k = new WeakMap, y = new WeakMap, v = new WeakMap, _ = new WeakMap, x = new WeakMap,
|
|
642
668
|
M = new WeakMap, W = new WeakMap, j = new WeakMap, C = new WeakMap, T = new WeakMap,
|
|
643
669
|
S = new WeakMap, I = new WeakMap, $ = new WeakMap, E = new WeakMap, D = new WeakMap,
|
|
644
|
-
L = new WeakMap, z = new WeakMap, F = new WeakMap,
|
|
645
|
-
|
|
670
|
+
L = new WeakMap, z = new WeakMap, F = new WeakMap, O = new WeakMap, A = new WeakMap,
|
|
671
|
+
H = new WeakMap, R = new WeakMap, N = new WeakMap;
|
|
646
672
|
|
|
647
673
|
B.style = d;
|
|
648
674
|
|
|
649
675
|
export { B as gx_ide_kb_manager_import };
|
|
650
|
-
//# sourceMappingURL=p-
|
|
676
|
+
//# sourceMappingURL=p-22aa1d86.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["MAX_CATEGORY_ITEMS_FIRST_RENDER","KB_OBJECT","KB_CATEGORY","STATUS_REGEXP_KEY","convertImportCategoryItemToTreeItem","importCatIcon","importItems","importTreeItems","forEach","importItem","push","id","caption","name","expanded","leaf","startImgSrc","metadata","convertImportCategoryDataToTreeView","importCategoryData","treeData","importCategory","importCategoryTreeItem","items","length","lazy","icon","createImportResultDataMessages","importItemId","messagesArray","status","messages","message","i","JSON","stringify","createImportResultItem","categoryData","importItemResultData","resultItemId","importResultItem","parts","addImportItemResultDataItem","categoryItemMap","objectCategoryItemMap","importTreeActualState","updatedImportTreeModel","objectCategoryId","get","categoryIndex","findIndex","treeItem","category","resultItem","newItemsLength","kbManagerImportCss","CSS_BUNDLES","NOTICE_ICON","getIconPath","colorType","FILE_ICON","GEMINI_TOOLS_SETTINGS","MENU_DELETE","CHECKBOX_ALL_CHECKED_VALUE","CHECKBOX_ALL_UNCHECKED_VALUE","GxIdeKbManagerImport","_GxIdeKbManagerImport_componentLocale","set","this","_GxIdeKbManagerImport_selectedObjectsInFileIds","_GxIdeKbManagerImport_fileInputEl","_GxIdeKbManagerImport_fileInputHiddenEl","_GxIdeKbManagerImport_objectsTreeEl","_GxIdeKbManagerImport_successItemsIds","Set","_GxIdeKbManagerImport_warningItemsIds","_GxIdeKbManagerImport_errorItemsIds","_GxIdeKbManagerImport_categoryItemMap","Map","_GxIdeKbManagerImport_objectCategoryItemMap","_GxIdeKbManagerImport_importedCategoryData","_GxIdeKbManagerImport_cancelImportHandler","cancelCallback","_GxIdeKbManagerImport_clearStatusHandler","importTreeState","statusInfo","error","number","warning","success","_GxIdeKbManagerImport_evaluateImport","noImport","_a","_GxIdeKbManagerImport_evaluateImportStatusMessage","someStatusVisible","display","_GxIdeKbManagerImport_importObjectsHandler","async","__classPrivateFieldGet","call","importingIsInProcess","checkedSet","model","obj","checked","add","find","cat","excludedObjectIds","has","objectIds","Array","from","importAll","importOptions","importCallback","_GxIdeKbManagerImport_loadFileHandler","file","__classPrivateFieldSet","loadCallback","clear","object","importCategoryTreeData","objectsTreeModel","hasSelection","_GxIdeKbManagerImport_lazyLoadTreeItems","treeItemId","_GxIdeKbManagerImport_objectsTreeCheckedItemsChangedHandler","event","allItems","detail","checkedItemIds","pendingCheckedItemIds","item","pendingCheckedItemId","size","selectAllCheckboxValue","selectAllCheckboxIndeterminate","_GxIdeKbManagerImport_objectsTreeContextMenuHandler","objectContextMenuCallback","selection","clientX","contextmenuEvent","screenX","clientY","screenY","_GxIdeKbManagerImport_objectsTreeSelectedItemsChangedHandler","map","_GxIdeKbManagerImport_optionsHandler","optionsCallback","_GxIdeKbManagerImport_removeFileSelection","selectedFile","value","_GxIdeKbManagerImport_selectFileInputHandler","click","_GxIdeKbManagerImport_selectFileInputChangedHandler","target","files","_GxIdeKbManagerImport_statusButtonsSelectionChangedHandler","activeStates","statuses","errorIndex","state","itemId","warningIndex","successIndex","pattern","statusOptions","join","importedTreeFilterRegExp","RegExp","_GxIdeKbManagerImport_toggleSelectionClickHandler","updateAllItemsProperties","_GxIdeKbManagerImport_updateStatusItemsState","child","importTreeStateChanged","watchImportTreeStateHandler","importStatusMessage","main","importStatus","noImportedFiles","importedButHidden","watchObjectsTreeModelHandler","newState","noObjects","selectedFileChanged","newFile","componentDidLoad","focus","componentDidRender","componentWillLoad","Locale","getComponentStrings","el","componentDidLoadEvent","emit","addResultItem","render","h","Host","class","slot","htmlFor","header","fileNameLabel","autoFocus","part","type","readonly","placeholder","fileNamePlaceholder","ref","hidden","accept","onChange","removeFileSelection","title","onClick","src","disabled","selectFileButton","objectsInFile","showLines","dragDisabled","dropDisabled","toggleCheckboxes","checkbox","lazyLoadTreeItemsCallback","onCheckedItemsChange","onSelectedItemsChange","onItemContextmenu","isAnimated","stateTitle","key","selectFile","checkedValue","unCheckedValue","selectUnselect","onInput","_b","importButton","cancelButton","filter","filterType","filterOptions","autoExpand","hideMatchesAndShowNonMatches","stateIconSrc","clearButton","errors","warnings","successes","hideMessage","compact","minimal","statusMinimal","onSelectionChanged"],"sources":["src/components/kb-manager-import/helpers.ts","src/components/kb-manager-import/kb-manager-import.scss?tag=gx-ide-kb-manager-import&encapsulation=shadow","src/components/kb-manager-import/kb-manager-import.tsx"],"sourcesContent":["/* Tree View */\nimport {\n TreeViewItemModel,\n TreeViewModel\n} from \"@genexus/chameleon-controls-library\";\n\n/* Kb Manager Import Types*/\nimport {\n ImportItemData,\n CategoryItemMap,\n CategoryItemMapValue,\n ObjectCategoryItemMap,\n Status\n} from \"./kb-manager-import\";\nimport { ImportCategoryData, ImportItemResultData } from \"../../common/types\";\n\nconst MAX_CATEGORY_ITEMS_FIRST_RENDER = 30;\n\n/* objects in file metadata*/\nexport const KB_OBJECT = \"object\";\nexport const KB_CATEGORY = \"category\";\n\nexport const STATUS_REGEXP_KEY = \"status\";\n\n// - - - - - - - - - - - - - - - - -\n// Objects In File Tree Model\n// - - - - - - - - - - - - - - - - -\n\nexport const convertImportCategoryItemToTreeItem = (\n importCatIcon: string,\n importItems: ImportItemData[]\n) => {\n const importTreeItems: TreeViewItemModel[] = [];\n importItems.forEach(importItem => {\n importTreeItems.push({\n id: importItem.id,\n caption: importItem.name,\n expanded: true,\n leaf: true,\n startImgSrc: importCatIcon,\n metadata: KB_OBJECT\n });\n });\n return importTreeItems;\n};\n\nexport const convertImportCategoryDataToTreeView = (\n importCategoryData: ImportCategoryData[]\n): TreeViewModel => {\n const treeData: TreeViewModel = [];\n if (!importCategoryData) {\n return treeData;\n }\n importCategoryData.forEach(importCategory => {\n const importCategoryTreeItem: TreeViewItemModel = {\n id: importCategory.id,\n caption: `${importCategory.name} (${importCategory.items.length})`,\n expanded: importCategory.items.length <= MAX_CATEGORY_ITEMS_FIRST_RENDER,\n lazy: importCategory.items.length > MAX_CATEGORY_ITEMS_FIRST_RENDER,\n leaf: false,\n startImgSrc: importCategory.icon,\n metadata: KB_CATEGORY,\n items: importCategory.items.length <= MAX_CATEGORY_ITEMS_FIRST_RENDER ? \n convertImportCategoryItemToTreeItem(\n importCategory.icon,\n importCategory.items\n ) : []\n };\n treeData.push(importCategoryTreeItem);\n });\n return treeData;\n};\n\n// - - - - - - - - - - - - - - - - -\n// Import Status Tree Model\n// - - - - - - - - - - - - - - - - -\n\nconst createImportResultDataMessages = (\n importItemId: string,\n messagesArray: string[],\n status: Status\n): TreeViewItemModel[] => {\n const messages: TreeViewItemModel[] = [];\n messagesArray.forEach((message, i) => {\n messages.push({\n id: `${importItemId}-message-${i}`,\n caption: message,\n startImgSrc: \"gemini-tools/list-view/on-surface\",\n leaf: true,\n metadata: JSON.stringify({\n [STATUS_REGEXP_KEY]: status\n })\n });\n });\n return messages;\n};\n\nconst createImportResultItem = (\n categoryData: CategoryItemMapValue,\n importItemResultData: ImportItemResultData\n): TreeViewItemModel => {\n const resultItemId = `${importItemResultData.id}-${importItemResultData.name}`;\n const importResultItem: TreeViewItemModel = {\n id: resultItemId,\n startImgSrc: categoryData.icon,\n caption: importItemResultData.name,\n parts: `tree-view-item tree-view-item--status tree-view-item--${importItemResultData.status}`,\n expanded: true,\n leaf: importItemResultData.messages.length === 0,\n metadata: JSON.stringify({\n [STATUS_REGEXP_KEY]: importItemResultData.status\n }),\n items: createImportResultDataMessages(\n resultItemId,\n importItemResultData.messages,\n importItemResultData.status\n )\n };\n return importResultItem;\n};\n\n// This functions updates the \"Import Status\" model, by adding a new result item.\nexport const addImportItemResultDataItem = (\n importItemResultData: ImportItemResultData,\n categoryItemMap: CategoryItemMap,\n objectCategoryItemMap: ObjectCategoryItemMap,\n importTreeActualState: TreeViewItemModel[]\n) => {\n const updatedImportTreeModel: TreeViewModel = [...importTreeActualState];\n\n // Use the resultItem.id to find the corresponding category in the categoryMap\n const objectCategoryId = objectCategoryItemMap.get(importItemResultData.id);\n const categoryData = categoryItemMap.get(objectCategoryId);\n\n const categoryIndex: number = updatedImportTreeModel.findIndex(\n treeItem => treeItem.id === objectCategoryId\n );\n\n if (categoryIndex === -1) {\n // category does not exists yet.\n const category: TreeViewItemModel = {\n id: objectCategoryId,\n caption: `${categoryData.name} (1)`,\n startImgSrc: `${categoryData.icon}`,\n expanded: true,\n items: [createImportResultItem(categoryData, importItemResultData)]\n };\n\n updatedImportTreeModel.push(category);\n return updatedImportTreeModel;\n }\n\n // else category already exists. Just insert the result item in the category.\n const resultItem: TreeViewItemModel = createImportResultItem(\n categoryData,\n importItemResultData\n );\n updatedImportTreeModel[categoryIndex].items = [\n ...updatedImportTreeModel[categoryIndex].items,\n resultItem\n ];\n\n // update category caption length\n const newItemsLength = updatedImportTreeModel[categoryIndex].items.length;\n updatedImportTreeModel[\n categoryIndex\n ].caption = `${categoryData.name} (${newItemsLength})`;\n\n return updatedImportTreeModel;\n};\n","@import \"../../global/gx-ide-mixins.scss\";\n@import \"../../global/temporary-mercury-overrides/_button.scss\";\n\n:host {\n display: grid;\n block-size: 100%;\n grid-template:\n \"header header\" max-content\n \"objects-in-file import-status\" 1fr\n \"footer footer\" max-content;\n grid-template-columns: 1fr 1fr;\n}\n\n.section {\n display: contents;\n}\n\n// header\n.header {\n grid-template-columns: 1fr max-content;\n grid-area: header;\n}\n\n// objects in file\n.objects-in-file__section {\n grid-area: objects-in-file;\n}\n.objects-in-file__main {\n border-inline-end: var(--section-common-border);\n grid-template-rows: 1fr max-content;\n}\n.objects-in-file__footer {\n display: grid;\n}\n\n// import status\n.import-status__section {\n grid-area: import-status;\n}\n.import-status__main {\n grid-template-rows: 1fr max-content;\n}\n.import-status__footer {\n display: flex;\n}\n.import-clear-status-btn {\n margin-inline-start: auto;\n}\n\n// objects in file & import status\n.objects-in-file__section,\n.import-status__section {\n display: grid;\n grid-template-rows: max-content 1fr;\n}\n.dialog-header__objects-in-file,\n.dialog-header__import-status {\n padding-block-start: 16px;\n}\n.objects-in-file__main,\n.import-status__main {\n grid-auto-rows: max-content;\n padding-block: 12px;\n overflow: auto;\n}\n\n// footer\n.footer {\n display: flex;\n grid-area: footer;\n border-block-start: var(--section-common-border);\n}\n\n// WA / TODO: Add a helper class in Mercury to justify text.\n.text-align-center {\n text-align: center; // should be resolved on mercury\n}\n\n.tree-view::part(item__action tree-view-item--status) {\n grid-template: \"first-img left-img text right-img\" / max-content max-content 1fr max-content;\n &::before {\n grid-area: first-img;\n content: \"\";\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background-color: var(--gray-03);\n margin-inline-end: 2px;\n }\n}\n\n.tree-view::part(item__action tree-view-item--success) {\n @include tree-item-status(\"success\");\n}\n.tree-view::part(item__action tree-view-item--warning) {\n @include tree-item-status(\"warning\");\n}\n.tree-view::part(item__action tree-view-item--error) {\n @include tree-item-status(\"error\");\n}\n\n// WA: prevent crashes when the items collection contains too many elements\n.tree-view-import::part(item) {\n content-visibility: auto;\n contain-intrinsic-size: auto 22px;\n // TODO: Check if 22px can be calculated. Not \"secure\" since font-size\n // (body-regular-s) defines the total height. If the typographic style\n // changes, this calculation will break. Ideally, tree item font-size\n // should use a variable like \"--tree-item-font-size\".\n}\n","import {\n Component,\n Element,\n Event,\n EventEmitter,\n Host,\n h,\n Method,\n Prop,\n State,\n Watch\n} from \"@stencil/core\";\n\nimport {\n ChCheckboxCustomEvent,\n // ChEditCustomEvent,\n TreeViewItemContextMenu\n} from \"@genexus/chameleon-controls-library\";\nimport { TreeViewItemModel } from \"@genexus/chameleon-controls-library\";\nimport { TreeViewItemModelExtended } from \"@genexus/chameleon-controls-library\";\nimport { getIconPath, MercuryBundles } from \"@genexus/mercury\";\n\nimport { Locale } from \"../../common/locale\";\n\nimport {\n ImportCategoryData,\n ImportItemResultData,\n ContextMenuInfo\n} from \"../../common/types\";\nimport {\n convertImportCategoryDataToTreeView,\n addImportItemResultDataItem,\n convertImportCategoryItemToTreeItem\n} from \"./helpers\";\nimport { CheckedItemsInfo } from \"../_helpers/list-selector/list-selector\";\n\nimport { KB_OBJECT, STATUS_REGEXP_KEY } from \"./helpers\";\n\nconst CSS_BUNDLES: MercuryBundles = [\n \"resets/box-sizing\",\n \"components/button\",\n \"components/checkbox\",\n \"components/edit\",\n \"components/icon\",\n \"components/tree-view\",\n \"utils/form\",\n \"utils/layout\",\n \"utils/typography\",\n \"utils/spacing\"\n];\n\nconst NOTICE_ICON = getIconPath({\n category: \"gemini-tools\",\n name: \"notice\",\n colorType: \"on-surface\"\n});\n\nconst FILE_ICON = getIconPath({\n category: \"gemini-tools\",\n name: \"file\",\n colorType: \"primary\"\n});\n\nconst GEMINI_TOOLS_SETTINGS = getIconPath({\n category: \"gemini-tools\",\n name: \"settings\",\n colorType: \"primary\"\n});\n\nconst MENU_DELETE = getIconPath({\n category: \"menus\",\n name: \"delete\",\n colorType: \"primary\"\n});\n\nconst CHECKBOX_ALL_CHECKED_VALUE = \"allChecked\";\nconst CHECKBOX_ALL_UNCHECKED_VALUE = \"allUnchecked\";\n\n@Component({\n tag: \"gx-ide-kb-manager-import\",\n styleUrl: \"kb-manager-import.scss\",\n shadow: true,\n assetsDirs: [\"gx-ide-assets/kb-manager-import\"]\n})\nexport class GxIdeKbManagerImport {\n /**\n * The component hard-coded strings translations.\n */\n // eslint-disable-next-line @stencil-community/own-props-must-be-private\n #componentLocale: any;\n\n #selectedObjectsInFileIds: string[] = [];\n\n @Element() el: HTMLGxIdeKbManagerImportElement;\n\n #fileInputEl!: HTMLChEditElement;\n #fileInputHiddenEl!: HTMLInputElement;\n #objectsTreeEl!: HTMLChTreeViewRenderElement;\n #successItemsIds: Set<string> = new Set();\n #warningItemsIds: Set<string> = new Set();\n #errorItemsIds: Set<string> = new Set();\n // #categoryItemMap maps a category id, with the name and icon.\n // required for the \"import status\" tree.\n #categoryItemMap: CategoryItemMap = new Map();\n #objectCategoryItemMap: ObjectCategoryItemMap = new Map();\n #importedCategoryData: ImportCategoryData[];\n\n @State() selectAllCheckboxValue: string;\n @State() selectAllCheckboxIndeterminate: boolean = false;\n @State() hasSelection: boolean = false;\n @State() importStatusMessage: string;\n @State() importTreeState: TreeViewItemModel[] = [];\n @State() importedTreeFilterRegExp: RegExp;\n @Watch(\"importTreeState\")\n importTreeStateChanged() {\n // this.#filterImportedHandler();\n }\n @State() importingIsInProcess = false;\n @State() importTreeFilterList: string[] = [];\n @State() noImport: boolean;\n @State() noObjects: boolean = true;\n @State() objectsTreeModel: TreeViewItemModel[] = [];\n @State() showHiddenImportsMessage = false;\n @State() someStatusVisible: boolean;\n @State() statusInfo: StatusInfo = {\n error: {\n display: true,\n number: 0\n },\n warning: {\n display: true,\n number: 0\n },\n success: {\n display: true,\n number: 0\n }\n };\n\n @Watch(\"importTreeState\")\n watchImportTreeStateHandler() {\n this.#evaluateImport();\n if (this.noImport) {\n this.importStatusMessage =\n this.#componentLocale.main.importStatus.noImportedFiles;\n } else {\n this.importStatusMessage =\n this.#componentLocale.main.importStatus.importedButHidden;\n }\n }\n @Watch(\"objectsTreeModel\")\n watchObjectsTreeModelHandler(newState: TreeViewItemModel[]) {\n this.noObjects = !newState || newState.length === 0;\n }\n\n /**\n * Callback invoked when user wants to cancel the export process.\n */\n @Prop() readonly cancelCallback!: CancelCallback;\n\n /**\n * Callback invoked when user wants to initiate the import process.\n */\n @Prop() readonly importCallback!: ImportCallback;\n\n /**\n * Callback invoked when user wants to load the xpz information\n */\n @Prop() readonly loadCallback!: LoadCallback;\n\n /**\n * Displays status buttons (errors, warning, succeeded) with minimal UI (no captions)\n */\n @Prop() readonly objectContextMenuCallback!: ObjectContextMenuCallback;\n\n /**\n * Callback invoked when user wants to access the export options.\n */\n @Prop() readonly optionsCallback!: OptionsCallback;\n\n /**\n * Imported xml or xps file name\n */\n @Prop({ mutable: true }) selectedFile: File;\n @Watch(\"selectedFile\")\n selectedFileChanged(newFile: File) {\n if (newFile) {\n this.#loadFileHandler(newFile);\n }\n }\n\n /**\n * Displays status buttons (error, warning, success) with minimal UI (no captions).\n */\n @Prop() readonly statusMinimal = false;\n\n /**\n * Emitted once just after the component is fully loaded.\n */\n @Event() componentDidLoadEvent: EventEmitter<boolean>;\n\n /**\n * Emitted once just after the component is fully loaded and the first render() occurs\n */\n @Event() componentDidRenderFirstTime: EventEmitter<boolean>;\n\n componentDidLoad() {\n this.#fileInputEl.focus();\n }\n\n componentDidRender() {}\n\n async componentWillLoad() {\n this.#componentLocale = await Locale.getComponentStrings(this.el);\n this.componentDidLoadEvent.emit(true);\n // this.#evaluateObjects();\n this.#evaluateImport();\n this.importStatusMessage =\n this.#componentLocale.main.importStatus.noImportedFiles;\n this.#evaluateImportStatusMessage();\n }\n\n /**\n * Add the result of importing an item\n */\n @Method()\n async addResultItem(item: ImportItemResultData) {\n this.importTreeState = addImportItemResultDataItem(\n item,\n this.#categoryItemMap,\n this.#objectCategoryItemMap,\n this.importTreeState\n );\n this.statusInfo[item.status].number++;\n this.#updateStatusItemsState();\n }\n\n #cancelImportHandler = () => {\n this.cancelCallback();\n };\n\n #clearStatusHandler = () => {\n this.importTreeState = [];\n this.statusInfo.error.number = 0;\n this.statusInfo.warning.number = 0;\n this.statusInfo.success.number = 0;\n };\n\n #evaluateImport = () => {\n this.noImport = !!(\n this.importTreeState?.length === 0 || !this.importTreeState\n );\n };\n\n #evaluateImportStatusMessage = () => {\n this.someStatusVisible =\n this.statusInfo.error.display ||\n this.statusInfo.warning.display ||\n this.statusInfo.success.display;\n };\n\n #importObjectsHandler = async () => {\n /* first clear imported objects (this clears errors/warnings/success counts as well)*/\n this.#clearStatusHandler();\n /* then do the import*/\n this.importingIsInProcess = true;\n\n /*\n Process checked objects manually, considering lazy loading.\n Example:\n 1. The \"Attributes\" category is lazy-loaded and marked as checked.\n 2. The user runs the import without expanding the node.\n 3. No attribute objects appear as checked, since lazy load was not triggered.\n 4. Still, all attribute objects must be included, because the category itself is checked.\n\n This avoids forcing users to expand nodes just to select objects.\n Large categories are not expanded by default to improve performance, which is crucial\n for very large imports (1000+ objects).\n */\n const checkedSet = new Set<string>();\n for (const category of this.#objectsTreeEl.model) {\n if (category.items?.length > 0) {\n for (const obj of category.items) {\n if (obj.checked) {\n checkedSet.add(obj.id);\n }\n }\n } else if (category.lazy && category.checked) {\n const categoryData = this.#importedCategoryData.find(\n cat => cat.id == category.id\n );\n for (const obj of categoryData.items) {\n checkedSet.add(obj.id);\n }\n }\n }\n\n // Compute excluded ids against the full file contents so the server's importAll branch can be used without re-reading the tree.\n const excludedObjectIds: string[] = [];\n for (const category of this.#importedCategoryData) {\n for (const obj of category.items) {\n if (!checkedSet.has(obj.id)) {\n excludedObjectIds.push(obj.id);\n }\n }\n }\n\n const objectIds = Array.from(checkedSet);\n const importAll = excludedObjectIds.length <= objectIds.length;\n const importOptions: ImportOptions = {\n importAll,\n objectIds: importAll ? [] : objectIds,\n excludedObjectIds: importAll ? excludedObjectIds : []\n };\n\n await this.importCallback(importOptions);\n this.importingIsInProcess = false;\n };\n\n #loadFileHandler = async (file: File) => {\n this.#importedCategoryData = await this.loadCallback(file);\n this.#categoryItemMap.clear();\n this.#objectCategoryItemMap.clear();\n\n this.#importedCategoryData.forEach(category => {\n this.#categoryItemMap.set(category.id, {\n name: category.name,\n icon: category.icon\n });\n category.items.forEach(object => {\n this.#objectCategoryItemMap.set(object.id, category.id);\n });\n });\n\n const importCategoryTreeData = convertImportCategoryDataToTreeView(\n this.#importedCategoryData\n );\n this.objectsTreeModel = importCategoryTreeData;\n // Tree-view renders with `checked={true}` by default, so a freshly\n // loaded file starts with everything selected.\n this.hasSelection = importCategoryTreeData.length > 0;\n };\n\n #lazyLoadTreeItems = async (treeItemId: string) => {\n const category = this.#importedCategoryData.find(\n cat => cat.id === treeItemId\n );\n return category && category.items.length > 0\n ? convertImportCategoryItemToTreeItem(category.icon, category.items)\n : [];\n };\n\n #objectsTreeCheckedItemsChangedHandler = (\n event: CustomEvent<Map<string, TreeViewItemModelExtended>>\n ) => {\n const allItems = event.detail;\n const checkedItemIds: string[] = [];\n const pendingCheckedItemIds: string[] = [];\n const checkedObjectsIds: string[] = [];\n allItems.forEach(item => {\n if (item.item.checked) {\n checkedItemIds.push(item.item.id);\n if (item.item.lazy && !item.item.items)\n pendingCheckedItemIds.push(item.item.id);\n }\n if (item.item.checked && item.item.metadata === KB_OBJECT) {\n checkedObjectsIds.push(item.item.id);\n }\n });\n\n for (let pendingCheckedItemId of pendingCheckedItemIds) {\n const category = this.#importedCategoryData.find(\n cat => cat.id === pendingCheckedItemId\n );\n if (category) {\n for (let item of category.items) {\n if (checkedObjectsIds.indexOf(item.id) < 0)\n checkedObjectsIds.push(item.id);\n }\n }\n }\n\n // Evaluate \"Select All / Unselect All\" checkbox state\n if (allItems.size === checkedItemIds.length) {\n this.selectAllCheckboxValue = CHECKBOX_ALL_CHECKED_VALUE;\n this.selectAllCheckboxIndeterminate = false;\n } else if (checkedItemIds.length === 0) {\n this.selectAllCheckboxValue = CHECKBOX_ALL_UNCHECKED_VALUE;\n this.selectAllCheckboxIndeterminate = false;\n } else {\n this.selectAllCheckboxIndeterminate = true;\n }\n\n this.hasSelection = checkedItemIds.length > 0;\n };\n\n #objectsTreeContextMenuHandler = (\n event: CustomEvent<TreeViewItemContextMenu>\n ) => {\n if (event.detail.metadata === KB_OBJECT) {\n this.objectContextMenuCallback(\"imported\", {\n selection: this.#selectedObjectsInFileIds,\n clientX: event.detail.contextmenuEvent.screenX,\n clientY: event.detail.contextmenuEvent.screenY\n });\n }\n };\n\n #objectsTreeSelectedItemsChangedHandler = (\n event: CustomEvent<TreeViewItemModelExtended[]>\n ) => {\n this.#selectedObjectsInFileIds = event.detail.map(item => item.item.id);\n };\n\n #optionsHandler = () => {\n if (this.optionsCallback) {\n this.optionsCallback();\n // returns boolean\n }\n };\n\n #removeFileSelection = () => {\n this.selectedFile = null;\n this.#fileInputHiddenEl.value = null;\n };\n\n #selectFileInputHandler = () => {\n this.#fileInputHiddenEl.click();\n };\n\n #selectFileInputChangedHandler = (event: InputEvent) => {\n const target = event.target as HTMLInputElement;\n if (target.files?.length > 0) {\n this.selectedFile = target.files[0];\n }\n };\n\n #statusButtonsSelectionChangedHandler = (\n event: CustomEvent<CheckedItemsInfo>\n ) => {\n const activeStates = event.detail;\n const statuses: Status[] = [];\n\n const errorIndex = activeStates.findIndex(\n state => state.itemId === \"errors\"\n );\n const warningIndex = activeStates.findIndex(\n state => state.itemId === \"warnings\"\n );\n const successIndex = activeStates.findIndex(\n state => state.itemId === \"successes\"\n );\n\n if (errorIndex !== -1) {\n statuses.push(\"error\");\n }\n if (warningIndex !== -1) {\n statuses.push(\"warning\");\n }\n if (successIndex !== -1) {\n statuses.push(\"success\");\n }\n\n let pattern = `\"${STATUS_REGEXP_KEY}\":\"\"`;\n if (statuses.length) {\n const statusOptions = statuses.join(\"|\");\n pattern = `\"${STATUS_REGEXP_KEY}\":\"(${statusOptions})\"`;\n }\n this.importedTreeFilterRegExp = new RegExp(pattern, \"i\");\n\n // Update statusInfo for the status-buttons\n this.statusInfo = {\n error: {\n display: errorIndex !== -1,\n number: this.statusInfo.error.number\n },\n warning: {\n display: warningIndex !== -1,\n number: this.statusInfo.warning.number\n },\n success: {\n display: successIndex !== -1,\n number: this.statusInfo.success.number\n }\n };\n\n this.#evaluateImportStatusMessage();\n };\n\n #toggleSelectionClickHandler = (\n event: ChCheckboxCustomEvent<any> | InputEvent\n ) => {\n if (this.#objectsTreeEl) {\n const checked = event.detail === CHECKBOX_ALL_CHECKED_VALUE;\n this.#objectsTreeEl.updateAllItemsProperties({ checked: checked });\n // updateAllItemsProperties does not fire onCheckedItemsChange, so we\n // mirror the new selection state explicitly to keep the Import button\n // disabled when the user unchecks everything via this toggle.\n this.hasSelection = checked && this.objectsTreeModel.length > 0;\n }\n };\n\n #updateStatusItemsState = () => {\n this.#errorItemsIds.clear();\n this.#warningItemsIds.clear();\n this.#successItemsIds.clear();\n this.importTreeState.forEach(item => {\n const items = item.items;\n items.forEach(child => {\n if (child.metadata === \"error\") {\n this.#errorItemsIds.add(child.id);\n }\n if (child.metadata === \"warning\") {\n this.#warningItemsIds.add(child.id);\n }\n if (child.metadata === \"success\") {\n this.#successItemsIds.add(child.id);\n }\n });\n });\n };\n\n render(): void {\n return (\n <Host class=\"widget\">\n <ch-theme model={CSS_BUNDLES}></ch-theme>\n\n <section class=\"section\">\n <header\n // header\n class=\"field-group dialog-header-with-border header header-two-cols spacing-body-block-start spacing-body-inline\"\n slot=\"header\"\n >\n <div\n // select a file\n class=\"field field-inline\"\n >\n <label class=\"label\" htmlFor=\"file-name\">\n {this.#componentLocale.header.fileNameLabel}\n </label>\n <ch-edit\n autoFocus\n id=\"file-name\"\n class=\"input\"\n part=\"file-name\"\n type=\"text\"\n readonly\n value={this.selectedFile?.name}\n placeholder={this.#componentLocale.header.fileNamePlaceholder}\n startImgSrc={FILE_ICON}\n ref={(el: HTMLChEditElement) =>\n (this.#fileInputEl = el as HTMLChEditElement)\n }\n ></ch-edit>\n <input\n hidden\n type=\"file\"\n accept=\".xpz, .xml\"\n onChange={this.#selectFileInputChangedHandler}\n ref={(el: HTMLInputElement) =>\n (this.#fileInputHiddenEl = el as HTMLInputElement)\n }\n />\n </div>\n\n <div class=\"buttons-spacer\">\n <button\n // remove file selection\n aria-label={this.#componentLocale.header.removeFileSelection}\n title={this.#componentLocale.header.removeFileSelection}\n id=\"reset-all-button\"\n class=\"button-tertiary button-icon-only\"\n part=\"reset-all-button\"\n onClick={this.#removeFileSelection}\n >\n <ch-image class=\"icon-m\" src={MENU_DELETE}></ch-image>\n </button>\n\n <button\n // select file\n id=\"select-file-load-button\"\n class=\"button-primary\"\n part=\"select-file-load-button\"\n onClick={this.#selectFileInputHandler}\n disabled={this.importingIsInProcess}\n >\n {this.#componentLocale.header.selectFileButton}\n </button>\n </div>\n </header>\n\n <section\n // objects in file\n class=\"objects-in-file__section\"\n >\n <h2 class=\"dialog-header dialog-header-with-border dialog-header__objects-in-file subtitle-regular-xs\t text-align-center spacing-body-inline\">\n {this.#componentLocale.main.objectsInFile.title}\n </h2>\n\n <div class=\"field-group objects-in-file__main\">\n {!this.noObjects ? (\n <ch-tree-view-render\n // objects in file tree\n showLines=\"last\"\n class=\"tree-view tree-view-import\"\n model={this.objectsTreeModel}\n dragDisabled={true}\n dropDisabled={true}\n toggleCheckboxes={true}\n checkbox={true}\n checked={true}\n lazyLoadTreeItemsCallback={this.#lazyLoadTreeItems}\n onCheckedItemsChange={\n this.#objectsTreeCheckedItemsChangedHandler\n }\n onSelectedItemsChange={\n this.#objectsTreeSelectedItemsChangedHandler\n }\n onItemContextmenu={this.#objectsTreeContextMenuHandler}\n ref={(el: HTMLChTreeViewRenderElement) =>\n (this.#objectsTreeEl = el as HTMLChTreeViewRenderElement)\n }\n ></ch-tree-view-render>\n ) : (\n <gx-ide-empty-state\n isAnimated={false}\n stateTitle={\n this.#componentLocale.main.objectsInFile.noObjects\n }\n key=\"no-objects-empty-state\"\n >\n <button\n // begin by selecting a file\n class=\"button-secondary\"\n onClick={this.#selectFileInputHandler}\n >\n {this.#componentLocale.main.objectsInFile.selectFile}\n </button>\n </gx-ide-empty-state>\n )}\n\n <footer class=\"field-group objects-in-file__footer spacing-body-inline\">\n <ch-checkbox\n // select all / unselect all checkbox\n id=\"select-all-checkbox\"\n class=\"checkbox create-data-in-kb\"\n checkedValue={CHECKBOX_ALL_CHECKED_VALUE}\n unCheckedValue={CHECKBOX_ALL_UNCHECKED_VALUE}\n caption={\n this.#componentLocale.main.objectsInFile.selectUnselect\n }\n value={this.selectAllCheckboxValue}\n onInput={this.#toggleSelectionClickHandler}\n disabled={\n this.importingIsInProcess ||\n this.objectsTreeModel.length === 0\n }\n part=\"select-all-checkbox\"\n ></ch-checkbox>\n\n <div class=\"buttons-spacer\">\n <button\n // import objects button\n id=\"import-btn\"\n class=\"button-primary \"\n onClick={this.#importObjectsHandler}\n disabled={\n this.objectsTreeModel?.length === 0 ||\n this.importingIsInProcess ||\n !this.hasSelection\n }\n >\n {this.#componentLocale.main.objectsInFile.importButton}\n </button>\n\n <button\n // cancel-import button\n id=\"cancel-import-btn\"\n class=\"button-secondary \"\n onClick={this.#cancelImportHandler}\n disabled={!this.importingIsInProcess}\n part=\"cancel-import-button\"\n >\n {this.#componentLocale.main.objectsInFile.cancelButton}\n </button>\n\n <button\n // settings/options button\n id=\"select-kb-btn\"\n class=\"button-tertiary button-icon-only\"\n part=\"select-kb-btn\"\n onClick={this.#optionsHandler}\n >\n <ch-image\n class=\"icon-m\"\n src={GEMINI_TOOLS_SETTINGS}\n ></ch-image>\n </button>\n </div>\n </footer>\n </div>\n </section>\n\n <section\n // import status\n class=\"import-status__section\"\n >\n <h2 class=\"dialog-header dialog-header-with-border dialog-header__import-status subtitle-regular-xs\t text-align-center spacing-body-inline\">\n {this.#componentLocale.main.importStatus.title}\n </h2>\n\n <div class=\"field-group import-status__main\">\n {!this.noImport && this.someStatusVisible ? (\n <ch-tree-view-render\n // import status tree\n model={this.importTreeState}\n toggleCheckboxes={true}\n showLines=\"last\"\n class=\"tree-view tree-view-import\"\n filter={this.importedTreeFilterRegExp}\n filterType=\"metadata\"\n filterOptions={{\n autoExpand: true,\n hideMatchesAndShowNonMatches: false\n }}\n ></ch-tree-view-render>\n ) : (\n <gx-ide-empty-state\n isAnimated={false}\n stateIconSrc={NOTICE_ICON}\n stateTitle={this.importStatusMessage}\n key=\"no-objects-empty-state\"\n ></gx-ide-empty-state>\n )}\n\n <footer class=\"import-status__footer spacing-body-inline\">\n <button\n // clear status button\n class=\"button-secondary import-clear-status-btn\"\n onClick={this.#clearStatusHandler}\n disabled={this.noImport || this.importingIsInProcess}\n part=\"clear-status-btn\"\n >\n {this.#componentLocale.main.importStatus.clearButton}\n </button>\n </footer>\n </div>\n </section>\n\n <footer\n // footer\n class=\"footer\"\n >\n <gx-ide-status-buttons\n errors={this.statusInfo.error.number}\n warnings={this.statusInfo.warning.number}\n successes={this.statusInfo.success.number}\n hideMessage\n compact\n minimal={this.statusMinimal}\n onSelectionChanged={this.#statusButtonsSelectionChangedHandler}\n ></gx-ide-status-buttons>\n </footer>\n </section>\n </Host>\n );\n }\n}\nexport type CancelCallback = () => Promise<boolean>;\n\n/**\n * Payload passed to `importCallback` describing the user's selection.\n *\n * - When `importAll` is `true`, the server imports every object in the file\n * except those listed in `excludedObjectIds` (`objectIds` is `[]`).\n * - When `importAll` is `false`, the server imports only `objectIds`\n * (`excludedObjectIds` is `[]`) — the legacy explicit-selection mode.\n *\n * The component picks the variant with the smaller list to minimize body size.\n */\nexport type ImportOptions = {\n importAll: boolean;\n objectIds: string[];\n excludedObjectIds: string[];\n};\n\nexport type ImportCallback = (importOptions: ImportOptions) => Promise<boolean>;\n\nexport type ImportItemData = {\n id: string;\n name: string;\n};\n\nexport type LoadCallback = (file: File) => Promise<ImportCategoryData[]>;\n\nexport type ObjectContextMenuCallback = (\n tree: ObjectsSourceType,\n contextMenuInfo: ContextMenuInfo\n) => Promise<void>;\n\nexport type ObjectsSourceType = \"in-file\" | \"imported\";\n\nexport type OptionsCallback = () => Promise<void>;\n\nexport interface SelectedObject {\n itemId: string;\n subItemsIds: string[];\n}\n\nexport type StatusItemsState = {\n error: string[];\n warning: string[];\n success: string[];\n};\n\ntype StatusInfo = {\n error: {\n display: boolean;\n number: number;\n };\n warning: {\n display: boolean;\n number: number;\n };\n success: {\n display: boolean;\n number: number;\n };\n};\n\nexport type CategoryItemMap = Map<string, CategoryItemMapValue>;\nexport type CategoryItemMapValue = { name: string; icon: string };\nexport type ObjectCategoryItemMap = Map<string, string>;\nexport type Status = \"success\" | \"error\" | \"warning\";\n"],"mappings":";;;;;;;;;;;;;;AAgBA,MAAMA,IAAkC;;6BAGjC,OAAMC,IAAY;;AAClB,MAAMC,IAAc;;AAEpB,MAAMC,IAAoB;;;;oCAM1B;MAAMC,sCAAsC,CACjDC,GACAC;EAEA,MAAMC,IAAuC;EAC7CD,EAAYE,SAAQC;IAClBF,EAAgBG,KAAK;MACnBC,IAAIF,EAAWE;MACfC,SAASH,EAAWI;MACpBC,UAAU;MACVC,MAAM;MACNC,aAAaX;MACbY,UAAUhB;;AACV;EAEJ,OAAOM;AAAe;;AAGjB,MAAMW,sCACXC;EAEA,MAAMC,IAA0B;EAChC,KAAKD,GAAoB;IACvB,OAAOC;;EAETD,EAAmBX,SAAQa;IACzB,MAAMC,IAA4C;MAChDX,IAAIU,EAAeV;MACnBC,SAAS,GAAGS,EAAeR,SAASQ,EAAeE,MAAMC;MACzDV,UAAUO,EAAeE,MAAMC,UAAUxB;MACzCyB,MAAMJ,EAAeE,MAAMC,SAASxB;MACpCe,MAAM;MACNC,aAAaK,EAAeK;MAC5BT,UAAUf;MACVqB,OAAOF,EAAeE,MAAMC,UAAUxB,IACpCI,oCACEiB,EAAeK,MACfL,EAAeE,SACb;;IAERH,EAASV,KAAKY;AAAuB;EAEvC,OAAOF;AAAQ;;;;oCAOjB;MAAMO,iCAAiC,CACrCC,GACAC,GACAC;EAEA,MAAMC,IAAgC;EACtCF,EAAcrB,SAAQ,CAACwB,GAASC;IAC9BF,EAASrB,KAAK;MACZC,IAAI,GAAGiB,aAAwBK;MAC/BrB,SAASoB;MACThB,aAA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K,WAAWvL,KAAKiB,WAAWI,QAAQF;MACnCqK,aAAW;MACXC,SAAO;MACPC,SAAS1L,KAAK2L;MACdC,oBAAoB9J,EAAA9B,MAAI0F,GAAA"}
|
|
@@ -6,6 +6,7 @@ export declare class GxIdeKbManagerImport {
|
|
|
6
6
|
el: HTMLGxIdeKbManagerImportElement;
|
|
7
7
|
selectAllCheckboxValue: string;
|
|
8
8
|
selectAllCheckboxIndeterminate: boolean;
|
|
9
|
+
hasSelection: boolean;
|
|
9
10
|
importStatusMessage: string;
|
|
10
11
|
importTreeState: TreeViewItemModel[];
|
|
11
12
|
importedTreeFilterRegExp: RegExp;
|
|
@@ -67,7 +68,22 @@ export declare class GxIdeKbManagerImport {
|
|
|
67
68
|
render(): void;
|
|
68
69
|
}
|
|
69
70
|
export type CancelCallback = () => Promise<boolean>;
|
|
70
|
-
|
|
71
|
+
/**
|
|
72
|
+
* Payload passed to `importCallback` describing the user's selection.
|
|
73
|
+
*
|
|
74
|
+
* - When `importAll` is `true`, the server imports every object in the file
|
|
75
|
+
* except those listed in `excludedObjectIds` (`objectIds` is `[]`).
|
|
76
|
+
* - When `importAll` is `false`, the server imports only `objectIds`
|
|
77
|
+
* (`excludedObjectIds` is `[]`) — the legacy explicit-selection mode.
|
|
78
|
+
*
|
|
79
|
+
* The component picks the variant with the smaller list to minimize body size.
|
|
80
|
+
*/
|
|
81
|
+
export type ImportOptions = {
|
|
82
|
+
importAll: boolean;
|
|
83
|
+
objectIds: string[];
|
|
84
|
+
excludedObjectIds: string[];
|
|
85
|
+
};
|
|
86
|
+
export type ImportCallback = (importOptions: ImportOptions) => Promise<boolean>;
|
|
71
87
|
export type ImportItemData = {
|
|
72
88
|
id: string;
|
|
73
89
|
name: string;
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["MAX_CATEGORY_ITEMS_FIRST_RENDER","KB_OBJECT","KB_CATEGORY","STATUS_REGEXP_KEY","convertImportCategoryItemToTreeItem","importCatIcon","importItems","importTreeItems","forEach","importItem","push","id","caption","name","expanded","leaf","startImgSrc","metadata","convertImportCategoryDataToTreeView","importCategoryData","treeData","importCategory","importCategoryTreeItem","items","length","lazy","icon","createImportResultDataMessages","importItemId","messagesArray","status","messages","message","i","JSON","stringify","createImportResultItem","categoryData","importItemResultData","resultItemId","importResultItem","parts","addImportItemResultDataItem","categoryItemMap","objectCategoryItemMap","importTreeActualState","updatedImportTreeModel","objectCategoryId","get","categoryIndex","findIndex","treeItem","category","resultItem","newItemsLength","kbManagerImportCss","CSS_BUNDLES","NOTICE_ICON","getIconPath","colorType","FILE_ICON","GEMINI_TOOLS_SETTINGS","MENU_DELETE","CHECKBOX_ALL_CHECKED_VALUE","CHECKBOX_ALL_UNCHECKED_VALUE","GxIdeKbManagerImport","_GxIdeKbManagerImport_componentLocale","set","this","_GxIdeKbManagerImport_selectedObjectsInFileIds","_GxIdeKbManagerImport_fileInputEl","_GxIdeKbManagerImport_fileInputHiddenEl","_GxIdeKbManagerImport_objectsTreeEl","_GxIdeKbManagerImport_successItemsIds","Set","_GxIdeKbManagerImport_warningItemsIds","_GxIdeKbManagerImport_errorItemsIds","_GxIdeKbManagerImport_categoryItemMap","Map","_GxIdeKbManagerImport_objectCategoryItemMap","_GxIdeKbManagerImport_importedCategoryData","_GxIdeKbManagerImport_cancelImportHandler","cancelCallback","_GxIdeKbManagerImport_clearStatusHandler","importTreeState","statusInfo","error","number","warning","success","_GxIdeKbManagerImport_evaluateImport","noImport","_a","_GxIdeKbManagerImport_evaluateImportStatusMessage","someStatusVisible","display","_GxIdeKbManagerImport_importObjectsHandler","async","__classPrivateFieldGet","call","importingIsInProcess","checkedObjectsIds","model","obj","checked","find","cat","importCallback","then","_GxIdeKbManagerImport_loadFileHandler","file","__classPrivateFieldSet","loadCallback","clear","object","importCategoryTreeData","objectsTreeModel","_GxIdeKbManagerImport_lazyLoadTreeItems","treeItemId","_GxIdeKbManagerImport_objectsTreeCheckedItemsChangedHandler","event","allItems","detail","checkedItemIds","pendingCheckedItemIds","item","pendingCheckedItemId","size","selectAllCheckboxValue","selectAllCheckboxIndeterminate","_GxIdeKbManagerImport_objectsTreeContextMenuHandler","objectContextMenuCallback","selection","clientX","contextmenuEvent","screenX","clientY","screenY","_GxIdeKbManagerImport_objectsTreeSelectedItemsChangedHandler","map","_GxIdeKbManagerImport_optionsHandler","optionsCallback","_GxIdeKbManagerImport_removeFileSelection","selectedFile","value","_GxIdeKbManagerImport_selectFileInputHandler","click","_GxIdeKbManagerImport_selectFileInputChangedHandler","target","files","_GxIdeKbManagerImport_statusButtonsSelectionChangedHandler","activeStates","statuses","errorIndex","state","itemId","warningIndex","successIndex","pattern","statusOptions","join","importedTreeFilterRegExp","RegExp","_GxIdeKbManagerImport_toggleSelectionClickHandler","updateAllItemsProperties","_GxIdeKbManagerImport_updateStatusItemsState","child","add","importTreeStateChanged","watchImportTreeStateHandler","importStatusMessage","main","importStatus","noImportedFiles","importedButHidden","watchObjectsTreeModelHandler","newState","noObjects","selectedFileChanged","newFile","componentDidLoad","focus","componentDidRender","componentWillLoad","Locale","getComponentStrings","el","componentDidLoadEvent","emit","addResultItem","render","h","Host","class","slot","htmlFor","header","fileNameLabel","autoFocus","part","type","readonly","placeholder","fileNamePlaceholder","ref","hidden","accept","onChange","removeFileSelection","title","onClick","src","disabled","selectFileButton","objectsInFile","showLines","dragDisabled","dropDisabled","toggleCheckboxes","checkbox","lazyLoadTreeItemsCallback","onCheckedItemsChange","onSelectedItemsChange","onItemContextmenu","isAnimated","stateTitle","key","selectFile","checkedValue","unCheckedValue","selectUnselect","onInput","_b","importButton","cancelButton","filter","filterType","filterOptions","autoExpand","hideMatchesAndShowNonMatches","stateIconSrc","clearButton","errors","warnings","successes","hideMessage","compact","minimal","statusMinimal","onSelectionChanged"],"sources":["src/components/kb-manager-import/helpers.ts","src/components/kb-manager-import/kb-manager-import.scss?tag=gx-ide-kb-manager-import&encapsulation=shadow","src/components/kb-manager-import/kb-manager-import.tsx"],"sourcesContent":["/* Tree View */\nimport {\n TreeViewItemModel,\n TreeViewModel\n} from \"@genexus/chameleon-controls-library\";\n\n/* Kb Manager Import Types*/\nimport {\n ImportItemData,\n CategoryItemMap,\n CategoryItemMapValue,\n ObjectCategoryItemMap,\n Status\n} from \"./kb-manager-import\";\nimport { ImportCategoryData, ImportItemResultData } from \"../../common/types\";\n\nconst MAX_CATEGORY_ITEMS_FIRST_RENDER = 30;\n\n/* objects in file metadata*/\nexport const KB_OBJECT = \"object\";\nexport const KB_CATEGORY = \"category\";\n\nexport const STATUS_REGEXP_KEY = \"status\";\n\n// - - - - - - - - - - - - - - - - -\n// Objects In File Tree Model\n// - - - - - - - - - - - - - - - - -\n\nexport const convertImportCategoryItemToTreeItem = (\n importCatIcon: string,\n importItems: ImportItemData[]\n) => {\n const importTreeItems: TreeViewItemModel[] = [];\n importItems.forEach(importItem => {\n importTreeItems.push({\n id: importItem.id,\n caption: importItem.name,\n expanded: true,\n leaf: true,\n startImgSrc: importCatIcon,\n metadata: KB_OBJECT\n });\n });\n return importTreeItems;\n};\n\nexport const convertImportCategoryDataToTreeView = (\n importCategoryData: ImportCategoryData[]\n): TreeViewModel => {\n const treeData: TreeViewModel = [];\n if (!importCategoryData) {\n return treeData;\n }\n importCategoryData.forEach(importCategory => {\n const importCategoryTreeItem: TreeViewItemModel = {\n id: importCategory.id,\n caption: `${importCategory.name} (${importCategory.items.length})`,\n expanded: importCategory.items.length <= MAX_CATEGORY_ITEMS_FIRST_RENDER,\n lazy: importCategory.items.length > MAX_CATEGORY_ITEMS_FIRST_RENDER,\n leaf: false,\n startImgSrc: importCategory.icon,\n metadata: KB_CATEGORY,\n items: importCategory.items.length <= MAX_CATEGORY_ITEMS_FIRST_RENDER ? \n convertImportCategoryItemToTreeItem(\n importCategory.icon,\n importCategory.items\n ) : []\n };\n treeData.push(importCategoryTreeItem);\n });\n return treeData;\n};\n\n// - - - - - - - - - - - - - - - - -\n// Import Status Tree Model\n// - - - - - - - - - - - - - - - - -\n\nconst createImportResultDataMessages = (\n importItemId: string,\n messagesArray: string[],\n status: Status\n): TreeViewItemModel[] => {\n const messages: TreeViewItemModel[] = [];\n messagesArray.forEach((message, i) => {\n messages.push({\n id: `${importItemId}-message-${i}`,\n caption: message,\n startImgSrc: \"gemini-tools/list-view/on-surface\",\n leaf: true,\n metadata: JSON.stringify({\n [STATUS_REGEXP_KEY]: status\n })\n });\n });\n return messages;\n};\n\nconst createImportResultItem = (\n categoryData: CategoryItemMapValue,\n importItemResultData: ImportItemResultData\n): TreeViewItemModel => {\n const resultItemId = `${importItemResultData.id}-${importItemResultData.name}`;\n const importResultItem: TreeViewItemModel = {\n id: resultItemId,\n startImgSrc: categoryData.icon,\n caption: importItemResultData.name,\n parts: `tree-view-item tree-view-item--status tree-view-item--${importItemResultData.status}`,\n expanded: true,\n leaf: importItemResultData.messages.length === 0,\n metadata: JSON.stringify({\n [STATUS_REGEXP_KEY]: importItemResultData.status\n }),\n items: createImportResultDataMessages(\n resultItemId,\n importItemResultData.messages,\n importItemResultData.status\n )\n };\n return importResultItem;\n};\n\n// This functions updates the \"Import Status\" model, by adding a new result item.\nexport const addImportItemResultDataItem = (\n importItemResultData: ImportItemResultData,\n categoryItemMap: CategoryItemMap,\n objectCategoryItemMap: ObjectCategoryItemMap,\n importTreeActualState: TreeViewItemModel[]\n) => {\n const updatedImportTreeModel: TreeViewModel = [...importTreeActualState];\n\n // Use the resultItem.id to find the corresponding category in the categoryMap\n const objectCategoryId = objectCategoryItemMap.get(importItemResultData.id);\n const categoryData = categoryItemMap.get(objectCategoryId);\n\n const categoryIndex: number = updatedImportTreeModel.findIndex(\n treeItem => treeItem.id === objectCategoryId\n );\n\n if (categoryIndex === -1) {\n // category does not exists yet.\n const category: TreeViewItemModel = {\n id: objectCategoryId,\n caption: `${categoryData.name} (1)`,\n startImgSrc: `${categoryData.icon}`,\n expanded: true,\n items: [createImportResultItem(categoryData, importItemResultData)]\n };\n\n updatedImportTreeModel.push(category);\n return updatedImportTreeModel;\n }\n\n // else category already exists. Just insert the result item in the category.\n const resultItem: TreeViewItemModel = createImportResultItem(\n categoryData,\n importItemResultData\n );\n updatedImportTreeModel[categoryIndex].items = [\n ...updatedImportTreeModel[categoryIndex].items,\n resultItem\n ];\n\n // update category caption length\n const newItemsLength = updatedImportTreeModel[categoryIndex].items.length;\n updatedImportTreeModel[\n categoryIndex\n ].caption = `${categoryData.name} (${newItemsLength})`;\n\n return updatedImportTreeModel;\n};\n","@import \"../../global/gx-ide-mixins.scss\";\n@import \"../../global/temporary-mercury-overrides/_button.scss\";\n\n:host {\n display: grid;\n block-size: 100%;\n grid-template:\n \"header header\" max-content\n \"objects-in-file import-status\" 1fr\n \"footer footer\" max-content;\n grid-template-columns: 1fr 1fr;\n}\n\n.section {\n display: contents;\n}\n\n// header\n.header {\n grid-template-columns: 1fr max-content;\n grid-area: header;\n}\n\n// objects in file\n.objects-in-file__section {\n grid-area: objects-in-file;\n}\n.objects-in-file__main {\n border-inline-end: var(--section-common-border);\n grid-template-rows: 1fr max-content;\n}\n.objects-in-file__footer {\n display: grid;\n}\n\n// import status\n.import-status__section {\n grid-area: import-status;\n}\n.import-status__main {\n grid-template-rows: 1fr max-content;\n}\n.import-status__footer {\n display: flex;\n}\n.import-clear-status-btn {\n margin-inline-start: auto;\n}\n\n// objects in file & import status\n.objects-in-file__section,\n.import-status__section {\n display: grid;\n grid-template-rows: max-content 1fr;\n}\n.dialog-header__objects-in-file,\n.dialog-header__import-status {\n padding-block-start: 16px;\n}\n.objects-in-file__main,\n.import-status__main {\n grid-auto-rows: max-content;\n padding-block: 12px;\n overflow: auto;\n}\n\n// footer\n.footer {\n display: flex;\n grid-area: footer;\n border-block-start: var(--section-common-border);\n}\n\n// WA / TODO: Add a helper class in Mercury to justify text.\n.text-align-center {\n text-align: center; // should be resolved on mercury\n}\n\n.tree-view::part(item__action tree-view-item--status) {\n grid-template: \"first-img left-img text right-img\" / max-content max-content 1fr max-content;\n &::before {\n grid-area: first-img;\n content: \"\";\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background-color: var(--gray-03);\n margin-inline-end: 2px;\n }\n}\n\n.tree-view::part(item__action tree-view-item--success) {\n @include tree-item-status(\"success\");\n}\n.tree-view::part(item__action tree-view-item--warning) {\n @include tree-item-status(\"warning\");\n}\n.tree-view::part(item__action tree-view-item--error) {\n @include tree-item-status(\"error\");\n}\n\n// WA: prevent crashes when the items collection contains too many elements\n.tree-view-import::part(item) {\n content-visibility: auto;\n contain-intrinsic-size: auto 22px;\n // TODO: Check if 22px can be calculated. Not \"secure\" since font-size\n // (body-regular-s) defines the total height. If the typographic style\n // changes, this calculation will break. Ideally, tree item font-size\n // should use a variable like \"--tree-item-font-size\".\n}\n","import {\n Component,\n Element,\n Event,\n EventEmitter,\n Host,\n h,\n Method,\n Prop,\n State,\n Watch\n} from \"@stencil/core\";\n\nimport {\n ChCheckboxCustomEvent,\n // ChEditCustomEvent,\n TreeViewItemContextMenu\n} from \"@genexus/chameleon-controls-library\";\nimport { TreeViewItemModel } from \"@genexus/chameleon-controls-library\";\nimport { TreeViewItemModelExtended } from \"@genexus/chameleon-controls-library\";\nimport { getIconPath, MercuryBundles } from \"@genexus/mercury\";\n\nimport { Locale } from \"../../common/locale\";\n\nimport {\n ImportCategoryData,\n ImportItemResultData,\n ContextMenuInfo\n} from \"../../common/types\";\nimport {\n convertImportCategoryDataToTreeView,\n addImportItemResultDataItem,\n convertImportCategoryItemToTreeItem\n} from \"./helpers\";\nimport { CheckedItemsInfo } from \"../_helpers/list-selector/list-selector\";\n\nimport { KB_OBJECT, STATUS_REGEXP_KEY } from \"./helpers\";\n\nconst CSS_BUNDLES: MercuryBundles = [\n \"resets/box-sizing\",\n \"components/button\",\n \"components/checkbox\",\n \"components/edit\",\n \"components/icon\",\n \"components/tree-view\",\n \"utils/form\",\n \"utils/layout\",\n \"utils/typography\",\n \"utils/spacing\"\n];\n\nconst NOTICE_ICON = getIconPath({\n category: \"gemini-tools\",\n name: \"notice\",\n colorType: \"on-surface\"\n});\n\nconst FILE_ICON = getIconPath({\n category: \"gemini-tools\",\n name: \"file\",\n colorType: \"primary\"\n});\n\nconst GEMINI_TOOLS_SETTINGS = getIconPath({\n category: \"gemini-tools\",\n name: \"settings\",\n colorType: \"primary\"\n});\n\nconst MENU_DELETE = getIconPath({\n category: \"menus\",\n name: \"delete\",\n colorType: \"primary\"\n});\n\nconst CHECKBOX_ALL_CHECKED_VALUE = \"allChecked\";\nconst CHECKBOX_ALL_UNCHECKED_VALUE = \"allUnchecked\";\n\n@Component({\n tag: \"gx-ide-kb-manager-import\",\n styleUrl: \"kb-manager-import.scss\",\n shadow: true,\n assetsDirs: [\"gx-ide-assets/kb-manager-import\"]\n})\nexport class GxIdeKbManagerImport {\n /**\n * The component hard-coded strings translations.\n */\n // eslint-disable-next-line @stencil-community/own-props-must-be-private\n #componentLocale: any;\n\n #selectedObjectsInFileIds: string[] = [];\n\n @Element() el: HTMLGxIdeKbManagerImportElement;\n\n #fileInputEl!: HTMLChEditElement;\n #fileInputHiddenEl!: HTMLInputElement;\n #objectsTreeEl!: HTMLChTreeViewRenderElement;\n #successItemsIds: Set<string> = new Set();\n #warningItemsIds: Set<string> = new Set();\n #errorItemsIds: Set<string> = new Set();\n // #categoryItemMap maps a category id, with the name and icon.\n // required for the \"import status\" tree.\n #categoryItemMap: CategoryItemMap = new Map();\n #objectCategoryItemMap: ObjectCategoryItemMap = new Map();\n #importedCategoryData: ImportCategoryData[];\n\n @State() selectAllCheckboxValue: string;\n @State() selectAllCheckboxIndeterminate: boolean = false;\n @State() importStatusMessage: string;\n @State() importTreeState: TreeViewItemModel[] = [];\n @State() importedTreeFilterRegExp: RegExp;\n @Watch(\"importTreeState\")\n importTreeStateChanged() {\n // this.#filterImportedHandler();\n }\n @State() importingIsInProcess = false;\n @State() importTreeFilterList: string[] = [];\n @State() noImport: boolean;\n @State() noObjects: boolean = true;\n @State() objectsTreeModel: TreeViewItemModel[] = [];\n @State() showHiddenImportsMessage = false;\n @State() someStatusVisible: boolean;\n @State() statusInfo: StatusInfo = {\n error: {\n display: true,\n number: 0\n },\n warning: {\n display: true,\n number: 0\n },\n success: {\n display: true,\n number: 0\n }\n };\n\n @Watch(\"importTreeState\")\n watchImportTreeStateHandler() {\n this.#evaluateImport();\n if (this.noImport) {\n this.importStatusMessage =\n this.#componentLocale.main.importStatus.noImportedFiles;\n } else {\n this.importStatusMessage =\n this.#componentLocale.main.importStatus.importedButHidden;\n }\n }\n @Watch(\"objectsTreeModel\")\n watchObjectsTreeModelHandler(newState: TreeViewItemModel[]) {\n this.noObjects = !newState || newState.length === 0;\n }\n\n /**\n * Callback invoked when user wants to cancel the export process.\n */\n @Prop() readonly cancelCallback!: CancelCallback;\n\n /**\n * Callback invoked when user wants to initiate the import process.\n */\n @Prop() readonly importCallback!: ImportCallback;\n\n /**\n * Callback invoked when user wants to load the xpz information\n */\n @Prop() readonly loadCallback!: LoadCallback;\n\n /**\n * Displays status buttons (errors, warning, succeeded) with minimal UI (no captions)\n */\n @Prop() readonly objectContextMenuCallback!: ObjectContextMenuCallback;\n\n /**\n * Callback invoked when user wants to access the export options.\n */\n @Prop() readonly optionsCallback!: OptionsCallback;\n\n /**\n * Imported xml or xps file name\n */\n @Prop({ mutable: true }) selectedFile: File;\n @Watch(\"selectedFile\")\n selectedFileChanged(newFile: File) {\n if (newFile) {\n this.#loadFileHandler(newFile);\n }\n }\n\n /**\n * Displays status buttons (error, warning, success) with minimal UI (no captions).\n */\n @Prop() readonly statusMinimal = false;\n\n /**\n * Emitted once just after the component is fully loaded.\n */\n @Event() componentDidLoadEvent: EventEmitter<boolean>;\n\n /**\n * Emitted once just after the component is fully loaded and the first render() occurs\n */\n @Event() componentDidRenderFirstTime: EventEmitter<boolean>;\n\n componentDidLoad() {\n this.#fileInputEl.focus();\n }\n\n componentDidRender() {}\n\n async componentWillLoad() {\n this.#componentLocale = await Locale.getComponentStrings(this.el);\n this.componentDidLoadEvent.emit(true);\n // this.#evaluateObjects();\n this.#evaluateImport();\n this.importStatusMessage =\n this.#componentLocale.main.importStatus.noImportedFiles;\n this.#evaluateImportStatusMessage();\n }\n\n /**\n * Add the result of importing an item\n */\n @Method()\n async addResultItem(item: ImportItemResultData) {\n this.importTreeState = addImportItemResultDataItem(\n item,\n this.#categoryItemMap,\n this.#objectCategoryItemMap,\n this.importTreeState\n );\n this.statusInfo[item.status].number++;\n this.#updateStatusItemsState();\n }\n\n #cancelImportHandler = () => {\n this.cancelCallback();\n };\n\n #clearStatusHandler = () => {\n this.importTreeState = [];\n this.statusInfo.error.number = 0;\n this.statusInfo.warning.number = 0;\n this.statusInfo.success.number = 0;\n };\n\n #evaluateImport = () => {\n this.noImport = !!(\n this.importTreeState?.length === 0 || !this.importTreeState\n );\n };\n\n #evaluateImportStatusMessage = () => {\n this.someStatusVisible =\n this.statusInfo.error.display ||\n this.statusInfo.warning.display ||\n this.statusInfo.success.display;\n };\n\n #importObjectsHandler = async () => {\n /* first clear imported objects (this clears errors/warnings/success counts as well)*/\n this.#clearStatusHandler();\n /* then do the import*/\n this.importingIsInProcess = true;\n\n /*\n Process checked objects manually, considering lazy loading. \n Example: \n 1. The \"Attributes\" category is lazy-loaded and marked as checked. \n 2. The user runs the import without expanding the node. \n 3. No attribute objects appear as checked, since lazy load was not triggered. \n 4. Still, all attribute objects must be included, because the category itself is checked. \n\n This avoids forcing users to expand nodes just to select objects. \n Large categories are not expanded by default to improve performance, which is crucial \n for very large imports (1000+ objects). \n */\n const checkedObjectsIds: string[] = [];\n for (let category of this.#objectsTreeEl.model) {\n if (category.items?.length > 0) {\n for (let obj of category.items) {\n if (obj.checked) checkedObjectsIds.push(obj.id);\n }\n } else if (category.lazy && category.checked) {\n const categoryData = this.#importedCategoryData.find(\n cat => cat.id == category.id\n );\n for (let obj of categoryData.items) {\n checkedObjectsIds.push(obj.id);\n }\n }\n }\n this.importCallback(checkedObjectsIds).then(() => {\n this.importingIsInProcess = false;\n });\n };\n\n #loadFileHandler = async (file: File) => {\n this.#importedCategoryData = await this.loadCallback(file);\n this.#categoryItemMap.clear();\n this.#objectCategoryItemMap.clear();\n\n this.#importedCategoryData.forEach(category => {\n this.#categoryItemMap.set(category.id, {\n name: category.name,\n icon: category.icon\n });\n category.items.forEach(object => {\n this.#objectCategoryItemMap.set(object.id, category.id);\n });\n });\n\n const importCategoryTreeData = convertImportCategoryDataToTreeView(\n this.#importedCategoryData\n );\n this.objectsTreeModel = importCategoryTreeData;\n };\n\n #lazyLoadTreeItems = async (treeItemId: string) => {\n const category = this.#importedCategoryData.find(\n cat => cat.id === treeItemId\n );\n return category && category.items.length > 0\n ? convertImportCategoryItemToTreeItem(category.icon, category.items)\n : [];\n };\n\n #objectsTreeCheckedItemsChangedHandler = (\n event: CustomEvent<Map<string, TreeViewItemModelExtended>>\n ) => {\n const allItems = event.detail;\n const checkedItemIds: string[] = [];\n const pendingCheckedItemIds: string[] = [];\n const checkedObjectsIds: string[] = [];\n allItems.forEach(item => {\n if (item.item.checked) {\n checkedItemIds.push(item.item.id);\n if (item.item.lazy && !item.item.items)\n pendingCheckedItemIds.push(item.item.id);\n }\n if (item.item.checked && item.item.metadata === KB_OBJECT) {\n checkedObjectsIds.push(item.item.id);\n }\n });\n\n for (let pendingCheckedItemId of pendingCheckedItemIds) {\n const category = this.#importedCategoryData.find(\n cat => cat.id === pendingCheckedItemId\n );\n if (category) {\n for (let item of category.items) {\n if (checkedObjectsIds.indexOf(item.id) < 0)\n checkedObjectsIds.push(item.id);\n }\n }\n }\n\n // Evaluate \"Select All / Unselect All\" checkbox state\n if (allItems.size === checkedItemIds.length) {\n this.selectAllCheckboxValue = CHECKBOX_ALL_CHECKED_VALUE;\n this.selectAllCheckboxIndeterminate = false;\n } else if (checkedItemIds.length === 0) {\n this.selectAllCheckboxValue = CHECKBOX_ALL_UNCHECKED_VALUE;\n this.selectAllCheckboxIndeterminate = false;\n } else {\n this.selectAllCheckboxIndeterminate = true;\n }\n };\n\n #objectsTreeContextMenuHandler = (\n event: CustomEvent<TreeViewItemContextMenu>\n ) => {\n if (event.detail.metadata === KB_OBJECT) {\n this.objectContextMenuCallback(\"imported\", {\n selection: this.#selectedObjectsInFileIds,\n clientX: event.detail.contextmenuEvent.screenX,\n clientY: event.detail.contextmenuEvent.screenY\n });\n }\n };\n\n #objectsTreeSelectedItemsChangedHandler = (\n event: CustomEvent<TreeViewItemModelExtended[]>\n ) => {\n this.#selectedObjectsInFileIds = event.detail.map(item => item.item.id);\n };\n\n #optionsHandler = () => {\n if (this.optionsCallback) {\n this.optionsCallback();\n // returns boolean\n }\n };\n\n #removeFileSelection = () => {\n this.selectedFile = null;\n this.#fileInputHiddenEl.value = null;\n };\n\n #selectFileInputHandler = () => {\n this.#fileInputHiddenEl.click();\n };\n\n #selectFileInputChangedHandler = (event: InputEvent) => {\n const target = event.target as HTMLInputElement;\n if (target.files?.length > 0) {\n this.selectedFile = target.files[0];\n }\n };\n\n #statusButtonsSelectionChangedHandler = (\n event: CustomEvent<CheckedItemsInfo>\n ) => {\n const activeStates = event.detail;\n const statuses: Status[] = [];\n\n const errorIndex = activeStates.findIndex(\n state => state.itemId === \"errors\"\n );\n const warningIndex = activeStates.findIndex(\n state => state.itemId === \"warnings\"\n );\n const successIndex = activeStates.findIndex(\n state => state.itemId === \"successes\"\n );\n\n if (errorIndex !== -1) {\n statuses.push(\"error\");\n }\n if (warningIndex !== -1) {\n statuses.push(\"warning\");\n }\n if (successIndex !== -1) {\n statuses.push(\"success\");\n }\n\n let pattern = `\"${STATUS_REGEXP_KEY}\":\"\"`;\n if (statuses.length) {\n const statusOptions = statuses.join(\"|\");\n pattern = `\"${STATUS_REGEXP_KEY}\":\"(${statusOptions})\"`;\n }\n this.importedTreeFilterRegExp = new RegExp(pattern, \"i\");\n\n // Update statusInfo for the status-buttons\n this.statusInfo = {\n error: {\n display: errorIndex !== -1,\n number: this.statusInfo.error.number\n },\n warning: {\n display: warningIndex !== -1,\n number: this.statusInfo.warning.number\n },\n success: {\n display: successIndex !== -1,\n number: this.statusInfo.success.number\n }\n };\n\n this.#evaluateImportStatusMessage();\n };\n\n #toggleSelectionClickHandler = (\n event: ChCheckboxCustomEvent<any> | InputEvent\n ) => {\n if (this.#objectsTreeEl) {\n const checked = event.detail === CHECKBOX_ALL_CHECKED_VALUE;\n this.#objectsTreeEl.updateAllItemsProperties({ checked: checked });\n }\n };\n\n #updateStatusItemsState = () => {\n this.#errorItemsIds.clear();\n this.#warningItemsIds.clear();\n this.#successItemsIds.clear();\n this.importTreeState.forEach(item => {\n const items = item.items;\n items.forEach(child => {\n if (child.metadata === \"error\") {\n this.#errorItemsIds.add(child.id);\n }\n if (child.metadata === \"warning\") {\n this.#warningItemsIds.add(child.id);\n }\n if (child.metadata === \"success\") {\n this.#successItemsIds.add(child.id);\n }\n });\n });\n };\n\n render(): void {\n return (\n <Host class=\"widget\">\n <ch-theme model={CSS_BUNDLES}></ch-theme>\n\n <section class=\"section\">\n <header\n // header\n class=\"field-group dialog-header-with-border header header-two-cols spacing-body-block-start spacing-body-inline\"\n slot=\"header\"\n >\n <div\n // select a file\n class=\"field field-inline\"\n >\n <label class=\"label\" htmlFor=\"file-name\">\n {this.#componentLocale.header.fileNameLabel}\n </label>\n <ch-edit\n autoFocus\n id=\"file-name\"\n class=\"input\"\n part=\"file-name\"\n type=\"text\"\n readonly\n value={this.selectedFile?.name}\n placeholder={this.#componentLocale.header.fileNamePlaceholder}\n startImgSrc={FILE_ICON}\n ref={(el: HTMLChEditElement) =>\n (this.#fileInputEl = el as HTMLChEditElement)\n }\n ></ch-edit>\n <input\n hidden\n type=\"file\"\n accept=\".xpz, .xml\"\n onChange={this.#selectFileInputChangedHandler}\n ref={(el: HTMLInputElement) =>\n (this.#fileInputHiddenEl = el as HTMLInputElement)\n }\n />\n </div>\n\n <div class=\"buttons-spacer\">\n <button\n // remove file selection\n aria-label={this.#componentLocale.header.removeFileSelection}\n title={this.#componentLocale.header.removeFileSelection}\n id=\"reset-all-button\"\n class=\"button-tertiary button-icon-only\"\n part=\"reset-all-button\"\n onClick={this.#removeFileSelection}\n >\n <ch-image class=\"icon-m\" src={MENU_DELETE}></ch-image>\n </button>\n\n <button\n // select file\n id=\"select-file-load-button\"\n class=\"button-primary\"\n part=\"select-file-load-button\"\n onClick={this.#selectFileInputHandler}\n disabled={this.importingIsInProcess}\n >\n {this.#componentLocale.header.selectFileButton}\n </button>\n </div>\n </header>\n\n <section\n // objects in file\n class=\"objects-in-file__section\"\n >\n <h2 class=\"dialog-header dialog-header-with-border dialog-header__objects-in-file subtitle-regular-xs\t text-align-center spacing-body-inline\">\n {this.#componentLocale.main.objectsInFile.title}\n </h2>\n\n <div class=\"field-group objects-in-file__main\">\n {!this.noObjects ? (\n <ch-tree-view-render\n // objects in file tree\n showLines=\"last\"\n class=\"tree-view tree-view-import\"\n model={this.objectsTreeModel}\n dragDisabled={true}\n dropDisabled={true}\n toggleCheckboxes={true}\n checkbox={true}\n checked={true}\n lazyLoadTreeItemsCallback={this.#lazyLoadTreeItems}\n onCheckedItemsChange={\n this.#objectsTreeCheckedItemsChangedHandler\n }\n onSelectedItemsChange={\n this.#objectsTreeSelectedItemsChangedHandler\n }\n onItemContextmenu={this.#objectsTreeContextMenuHandler}\n ref={(el: HTMLChTreeViewRenderElement) =>\n (this.#objectsTreeEl = el as HTMLChTreeViewRenderElement)\n }\n ></ch-tree-view-render>\n ) : (\n <gx-ide-empty-state\n isAnimated={false}\n stateTitle={\n this.#componentLocale.main.objectsInFile.noObjects\n }\n key=\"no-objects-empty-state\"\n >\n <button\n // begin by selecting a file\n class=\"button-secondary\"\n onClick={this.#selectFileInputHandler}\n >\n {this.#componentLocale.main.objectsInFile.selectFile}\n </button>\n </gx-ide-empty-state>\n )}\n\n <footer class=\"field-group objects-in-file__footer spacing-body-inline\">\n <ch-checkbox\n // select all / unselect all checkbox\n id=\"select-all-checkbox\"\n class=\"checkbox create-data-in-kb\"\n checkedValue={CHECKBOX_ALL_CHECKED_VALUE}\n unCheckedValue={CHECKBOX_ALL_UNCHECKED_VALUE}\n caption={\n this.#componentLocale.main.objectsInFile.selectUnselect\n }\n value={this.selectAllCheckboxValue}\n onInput={this.#toggleSelectionClickHandler}\n disabled={\n this.importingIsInProcess ||\n this.objectsTreeModel.length === 0\n }\n part=\"select-all-checkbox\"\n ></ch-checkbox>\n\n <div class=\"buttons-spacer\">\n <button\n // import objects button\n id=\"import-btn\"\n class=\"button-primary \"\n onClick={this.#importObjectsHandler}\n disabled={\n this.objectsTreeModel?.length === 0 ||\n this.importingIsInProcess\n }\n >\n {this.#componentLocale.main.objectsInFile.importButton}\n </button>\n\n <button\n // cancel-import button\n id=\"cancel-import-btn\"\n class=\"button-secondary \"\n onClick={this.#cancelImportHandler}\n disabled={!this.importingIsInProcess}\n part=\"cancel-import-button\"\n >\n {this.#componentLocale.main.objectsInFile.cancelButton}\n </button>\n\n <button\n // settings/options button\n id=\"select-kb-btn\"\n class=\"button-tertiary button-icon-only\"\n part=\"select-kb-btn\"\n onClick={this.#optionsHandler}\n >\n <ch-image\n class=\"icon-m\"\n src={GEMINI_TOOLS_SETTINGS}\n ></ch-image>\n </button>\n </div>\n </footer>\n </div>\n </section>\n\n <section\n // import status\n class=\"import-status__section\"\n >\n <h2 class=\"dialog-header dialog-header-with-border dialog-header__import-status subtitle-regular-xs\t text-align-center spacing-body-inline\">\n {this.#componentLocale.main.importStatus.title}\n </h2>\n\n <div class=\"field-group import-status__main\">\n {!this.noImport && this.someStatusVisible ? (\n <ch-tree-view-render\n // import status tree\n model={this.importTreeState}\n toggleCheckboxes={true}\n showLines=\"last\"\n class=\"tree-view tree-view-import\"\n filter={this.importedTreeFilterRegExp}\n filterType=\"metadata\"\n filterOptions={{\n autoExpand: true,\n hideMatchesAndShowNonMatches: false\n }}\n ></ch-tree-view-render>\n ) : (\n <gx-ide-empty-state\n isAnimated={false}\n stateIconSrc={NOTICE_ICON}\n stateTitle={this.importStatusMessage}\n key=\"no-objects-empty-state\"\n ></gx-ide-empty-state>\n )}\n\n <footer class=\"import-status__footer spacing-body-inline\">\n <button\n // clear status button\n class=\"button-secondary import-clear-status-btn\"\n onClick={this.#clearStatusHandler}\n disabled={this.noImport || this.importingIsInProcess}\n part=\"clear-status-btn\"\n >\n {this.#componentLocale.main.importStatus.clearButton}\n </button>\n </footer>\n </div>\n </section>\n\n <footer\n // footer\n class=\"footer\"\n >\n <gx-ide-status-buttons\n errors={this.statusInfo.error.number}\n warnings={this.statusInfo.warning.number}\n successes={this.statusInfo.success.number}\n hideMessage\n compact\n minimal={this.statusMinimal}\n onSelectionChanged={this.#statusButtonsSelectionChangedHandler}\n ></gx-ide-status-buttons>\n </footer>\n </section>\n </Host>\n );\n }\n}\nexport type CancelCallback = () => Promise<boolean>;\n\nexport type ImportCallback = (itemIds: string[]) => Promise<boolean>;\n\nexport type ImportItemData = {\n id: string;\n name: string;\n};\n\nexport type LoadCallback = (file: File) => Promise<ImportCategoryData[]>;\n\nexport type ObjectContextMenuCallback = (\n tree: ObjectsSourceType,\n contextMenuInfo: ContextMenuInfo\n) => Promise<void>;\n\nexport type ObjectsSourceType = \"in-file\" | \"imported\";\n\nexport type OptionsCallback = () => Promise<void>;\n\nexport interface SelectedObject {\n itemId: string;\n subItemsIds: string[];\n}\n\nexport type StatusItemsState = {\n error: string[];\n warning: string[];\n success: string[];\n};\n\ntype StatusInfo = {\n error: {\n display: boolean;\n number: number;\n };\n warning: {\n display: boolean;\n number: number;\n };\n success: {\n display: boolean;\n number: number;\n };\n};\n\nexport type CategoryItemMap = Map<string, CategoryItemMapValue>;\nexport type CategoryItemMapValue = { name: string; icon: string };\nexport type ObjectCategoryItemMap = Map<string, string>;\nexport type Status = \"success\" | \"error\" | \"warning\";\n"],"mappings":";;;;;;;;;;;;;;AAgBA,MAAMA,IAAkC;;6BAGjC,OAAMC,IAAY;;AAClB,MAAMC,IAAc;;AAEpB,MAAMC,IAAoB;;;;oCAM1B;MAAMC,sCAAsC,CACjDC,GACAC;EAEA,MAAMC,IAAuC;EAC7CD,E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