@genexus/genexus-ide-ui 0.0.85 → 0.0.87
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/ch-action-group-render.cjs.entry.js +112 -0
- package/dist/cjs/ch-checkbox_3.cjs.entry.js +21 -10
- package/dist/cjs/ch-dropdown-item.cjs.entry.js +1 -1
- package/dist/cjs/ch-dropdown-render.cjs.entry.js +73 -0
- package/dist/cjs/ch-shortcuts_2.cjs.entry.js +99 -20
- package/dist/cjs/ch-tree-view-render_2.cjs.entry.js +49 -92
- package/dist/cjs/genexus-ide-ui.cjs.js +1 -1
- package/dist/cjs/genexus-implementation-664b13f0.js +76 -0
- package/dist/cjs/gx-ide-kb-manager-import.cjs.entry.js +2 -5
- package/dist/cjs/gx-ide-new-environment.cjs.entry.js +16 -9
- package/dist/cjs/gx-ide-new-kb.cjs.entry.js +15 -4
- package/dist/cjs/gx-ide-new-object.cjs.entry.js +21 -3
- package/dist/cjs/gx-ide-object-selector.cjs.entry.js +87 -59
- package/dist/cjs/gx-ide-recent-news.cjs.entry.js +2 -3
- package/dist/cjs/gx-ide-references.cjs.entry.js +2 -7
- package/dist/cjs/gxg-combo-box_2.cjs.entry.js +2 -8
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/kb-manager-import/kb-manager-import.js +2 -5
- package/dist/collection/components/new-environment/new-environment.js +39 -9
- package/dist/collection/components/new-kb/gx-ide-assets/new-kb/shortcuts.json +1 -4
- package/dist/collection/components/new-kb/new-kb.css +1 -9
- package/dist/collection/components/new-kb/new-kb.js +37 -3
- package/dist/collection/components/new-object/gx-ide-assets/new-object/shortcuts.json +1 -4
- package/dist/collection/components/new-object/new-object.js +44 -3
- package/dist/collection/components/object-selector/gx-ide-assets/object-selector/langs/object-selector.lang.en.json +4 -0
- package/dist/collection/components/object-selector/object-selector.css +4 -0
- package/dist/collection/components/object-selector/object-selector.js +123 -58
- package/dist/collection/components/references/references.js +3 -10
- package/dist/collection/components/start-page/recent-news.js +2 -3
- package/dist/components/ch-action-group-render.js +175 -0
- package/dist/components/ch-dropdown-item-separator.js +28 -1
- package/dist/components/ch-dropdown-render.js +121 -0
- package/dist/components/ch-shortcuts2.js +97 -19
- package/dist/components/combo-box.js +2 -9
- package/dist/components/dropdown-item.js +1 -1
- package/dist/components/genexus-implementation.js +74 -0
- package/dist/components/gx-ide-kb-manager-import.js +2 -5
- package/dist/components/gx-ide-new-environment.js +18 -10
- package/dist/components/gx-ide-new-kb.js +17 -5
- package/dist/components/gx-ide-new-object.js +24 -5
- package/dist/components/gx-ide-object-selector.js +140 -104
- package/dist/components/gx-ide-references.js +3 -10
- package/dist/components/index.js +2 -2
- package/dist/components/recent-news.js +2 -3
- package/dist/components/shortcuts.js +4 -1
- package/dist/components/tree-view-item.js +21 -10
- package/dist/components/tree-view-render.js +49 -91
- package/dist/esm/ch-action-group-render.entry.js +108 -0
- package/dist/esm/ch-checkbox_3.entry.js +21 -10
- package/dist/esm/ch-dropdown-item.entry.js +1 -1
- package/dist/esm/ch-dropdown-render.entry.js +69 -0
- package/dist/esm/ch-shortcuts_2.entry.js +99 -20
- package/dist/esm/ch-tree-view-render_2.entry.js +48 -91
- package/dist/esm/genexus-ide-ui.js +1 -1
- package/dist/esm/genexus-implementation-3b347d88.js +74 -0
- package/dist/esm/gx-ide-kb-manager-import.entry.js +2 -5
- package/dist/esm/gx-ide-new-environment.entry.js +16 -9
- package/dist/esm/gx-ide-new-kb.entry.js +15 -4
- package/dist/esm/gx-ide-new-object.entry.js +21 -3
- package/dist/esm/gx-ide-object-selector.entry.js +87 -59
- package/dist/esm/gx-ide-recent-news.entry.js +2 -3
- package/dist/esm/gx-ide-references.entry.js +2 -7
- package/dist/esm/gxg-combo-box_2.entry.js +2 -8
- 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/new-kb/shortcuts.json +1 -4
- package/dist/genexus-ide-ui/gx-ide-assets/new-object/shortcuts.json +1 -4
- package/dist/genexus-ide-ui/gx-ide-assets/object-selector/langs/object-selector.lang.en.json +4 -0
- package/dist/genexus-ide-ui/p-021e21a0.entry.js +1 -0
- package/dist/genexus-ide-ui/p-068b6b8d.entry.js +1 -0
- package/dist/genexus-ide-ui/p-06d9d6ff.entry.js +1 -0
- package/dist/genexus-ide-ui/p-1cf2d35f.entry.js +1 -0
- package/dist/genexus-ide-ui/p-356ee19a.js +1 -0
- package/dist/genexus-ide-ui/p-49333316.entry.js +1 -0
- package/dist/genexus-ide-ui/p-4bd7c59a.entry.js +1 -0
- package/dist/genexus-ide-ui/p-54b5628c.entry.js +1 -0
- package/dist/genexus-ide-ui/p-65b5622e.entry.js +1 -0
- package/dist/genexus-ide-ui/p-8a18798d.entry.js +1 -0
- package/dist/genexus-ide-ui/p-8f022c0e.entry.js +1 -0
- package/dist/genexus-ide-ui/p-c224911a.entry.js +1 -0
- package/dist/genexus-ide-ui/p-cadcd655.entry.js +1 -0
- package/dist/genexus-ide-ui/p-cfbd5a0e.entry.js +1 -0
- package/dist/genexus-ide-ui/{p-005970ac.entry.js → p-eaae6676.entry.js} +1 -1
- package/dist/node_modules/@genexus/chameleon-controls-library/dist/collection/components/renders/action-group/action-group-render.css +3 -0
- package/dist/node_modules/@genexus/chameleon-controls-library/dist/collection/components/renders/dropdown/dropdown-render.css +3 -0
- package/dist/types/components/new-environment/new-environment.d.ts +5 -1
- package/dist/types/components/new-kb/new-kb.d.ts +5 -0
- package/dist/types/components/new-object/new-object.d.ts +6 -0
- package/dist/types/components/object-selector/object-selector.d.ts +14 -3
- package/dist/types/components/references/references.d.ts +0 -9
- package/dist/types/components/start-page/recent-news.d.ts +1 -1
- package/dist/types/components.d.ts +24 -0
- package/package.json +3 -3
- package/dist/cjs/ch-test-action-group.cjs.entry.js +0 -79
- package/dist/cjs/ch-test-dropdown.cjs.entry.js +0 -54
- package/dist/components/ch-test-action-group.js +0 -137
- package/dist/components/ch-test-dropdown.js +0 -104
- package/dist/components/dropdown-item-separator.js +0 -30
- package/dist/esm/ch-test-action-group.entry.js +0 -75
- package/dist/esm/ch-test-dropdown.entry.js +0 -50
- package/dist/genexus-ide-ui/p-20fab805.entry.js +0 -1
- package/dist/genexus-ide-ui/p-2d77e2a3.entry.js +0 -1
- package/dist/genexus-ide-ui/p-5757e203.entry.js +0 -1
- package/dist/genexus-ide-ui/p-7a03aa05.entry.js +0 -1
- package/dist/genexus-ide-ui/p-7ae11b35.entry.js +0 -1
- package/dist/genexus-ide-ui/p-85b78e25.entry.js +0 -1
- package/dist/genexus-ide-ui/p-9f08b2a4.entry.js +0 -1
- package/dist/genexus-ide-ui/p-a2c7dc8a.entry.js +0 -1
- package/dist/genexus-ide-ui/p-a69aaabc.entry.js +0 -1
- package/dist/genexus-ide-ui/p-c00aa636.entry.js +0 -1
- package/dist/genexus-ide-ui/p-d3428456.entry.js +0 -1
- package/dist/genexus-ide-ui/p-d9910218.entry.js +0 -1
- package/dist/genexus-ide-ui/p-da8ad725.entry.js +0 -1
- package/dist/node_modules/@genexus/chameleon-controls-library/dist/collection/components/test/test-action-group/test-action-group.css +0 -52
- package/dist/node_modules/@genexus/chameleon-controls-library/dist/collection/components/test/test-dropdown/test-dropdown.css +0 -36
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, forceUpdate, h } from '@stencil/core/internal/client';
|
|
2
|
+
import { f as fromGxImageToURL } from './genexus-implementation.js';
|
|
2
3
|
import { d as defineCustomElement$3 } from './checkbox.js';
|
|
3
4
|
import { d as defineCustomElement$2 } from './tree-view.js';
|
|
4
5
|
import { d as defineCustomElement$1 } from './tree-view-item.js';
|
|
@@ -22,7 +23,7 @@ const filterDictionary = {
|
|
|
22
23
|
!item.indeterminate &&
|
|
23
24
|
((_b = item.checked) !== null && _b !== void 0 ? _b : filterInfo.defaultChecked);
|
|
24
25
|
},
|
|
25
|
-
|
|
26
|
+
list: (item, filterInfo) => filterInfo.filterSet.has(item.id),
|
|
26
27
|
metadata: (item, filterInfo) => {
|
|
27
28
|
var _a;
|
|
28
29
|
return filterInfo.filter
|
|
@@ -37,78 +38,11 @@ const filterDictionary = {
|
|
|
37
38
|
!((_b = item.checked) !== null && _b !== void 0 ? _b : filterInfo.defaultChecked);
|
|
38
39
|
}
|
|
39
40
|
};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
uri = `data:image/svg+xml;base64,${btoa(uri.slice(24).replace(/\\"/g, '"'))}`;
|
|
46
|
-
}
|
|
47
|
-
uri = uri.replace(/\\/g, "");
|
|
48
|
-
uri = uri.replace(/\s/g, "%20");
|
|
49
|
-
return uri;
|
|
50
|
-
}
|
|
51
|
-
function getImage(name, gxImageConstructor) {
|
|
52
|
-
if (!computedStyle) {
|
|
53
|
-
computedStyle = getComputedStyle(document.documentElement);
|
|
54
|
-
}
|
|
55
|
-
let value = computedStyle.getPropertyValue(`--gx-image_${name}`);
|
|
56
|
-
if (value) {
|
|
57
|
-
let matches;
|
|
58
|
-
const gximage = gxImageConstructor(name);
|
|
59
|
-
while ((matches = value.match(URL_REGEX))) {
|
|
60
|
-
gximage.densitySet.push({
|
|
61
|
-
uri: normalizeUri(matches[1] ? matches[2].slice(0, -1) : matches[2]),
|
|
62
|
-
density: matches[3] ? parseFloat(matches[3]) : 1
|
|
63
|
-
});
|
|
64
|
-
value = value.slice(matches[0].length);
|
|
65
|
-
}
|
|
66
|
-
if (gximage.densitySet.length > 0) {
|
|
67
|
-
gximage.uri = gximage.densitySet.reduce((previousValue, currentValue) => {
|
|
68
|
-
return previousValue.density === 1 ||
|
|
69
|
-
previousValue.density < currentValue.density
|
|
70
|
-
? previousValue
|
|
71
|
-
: currentValue;
|
|
72
|
-
}).uri;
|
|
73
|
-
}
|
|
74
|
-
return gximage;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
const fromGxImageToURL = (gxImage, Settings, gxImageConstructor) => {
|
|
78
|
-
if (!gxImage) {
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
let url = "";
|
|
82
|
-
if (gxImage.id) {
|
|
83
|
-
url = getImage(gxImage.id, gxImageConstructor).uri;
|
|
84
|
-
}
|
|
85
|
-
else {
|
|
86
|
-
url = gxImage.uri;
|
|
87
|
-
}
|
|
88
|
-
if (!url) {
|
|
89
|
-
return "";
|
|
90
|
-
}
|
|
91
|
-
const baseUrl = Settings.WEBAPP_BASE;
|
|
92
|
-
const urlLower = url.toLowerCase();
|
|
93
|
-
if (urlLower.startsWith("assets/")) {
|
|
94
|
-
// Relative URL to local assets
|
|
95
|
-
return url;
|
|
96
|
-
}
|
|
97
|
-
else if (urlLower.startsWith("http://") ||
|
|
98
|
-
urlLower.startsWith("https://") ||
|
|
99
|
-
urlLower.startsWith("blob:") ||
|
|
100
|
-
urlLower.startsWith("file:") ||
|
|
101
|
-
urlLower.startsWith("data:")) {
|
|
102
|
-
// Absolute URL
|
|
103
|
-
return url;
|
|
104
|
-
}
|
|
105
|
-
else if (urlLower.startsWith(Settings.BASE_PATH.toLowerCase())) {
|
|
106
|
-
// Host relative URL
|
|
107
|
-
return baseUrl + url.substring(Settings.BASE_PATH.length);
|
|
108
|
-
}
|
|
109
|
-
else {
|
|
110
|
-
return baseUrl + url;
|
|
111
|
-
}
|
|
41
|
+
const computeFilter = (filterType, item, filterInfo) => {
|
|
42
|
+
var _a;
|
|
43
|
+
return ((_a = filterInfo.filterOptions) === null || _a === void 0 ? void 0 : _a.hideMatchesAndShowNonMatches) === true
|
|
44
|
+
? !filterDictionary[filterType](item, filterInfo)
|
|
45
|
+
: filterDictionary[filterType](item, filterInfo);
|
|
112
46
|
};
|
|
113
47
|
|
|
114
48
|
const treeViewRenderCss = "ch-tree-view-render{display:contents}";
|
|
@@ -122,6 +56,11 @@ const DEFAULT_INDETERMINATE_VALUE = false;
|
|
|
122
56
|
const DEFAULT_LAZY_VALUE = false;
|
|
123
57
|
const DEFAULT_ORDER_VALUE = 0;
|
|
124
58
|
const DEFAULT_SELECTED_VALUE = false;
|
|
59
|
+
// There are a filter applied and, if the type is "caption" or
|
|
60
|
+
// "metadata", the filter property must be set
|
|
61
|
+
const treeViewHasFilters = (filterType, filter) => filterType !== "none" &&
|
|
62
|
+
((filterType !== "caption" && filterType !== "metadata") ||
|
|
63
|
+
(filter != null && filter.trim() !== ""));
|
|
125
64
|
const defaultRenderItem = (itemModel, treeState, treeHasFilter, lastItem, level) => {
|
|
126
65
|
var _a, _b, _c, _d, _e, _f;
|
|
127
66
|
return (treeState.filterType === "none" || itemModel.render !== false) && (h("ch-tree-view-item", { id: itemModel.id, caption: itemModel.caption, checkbox: (_a = itemModel.checkbox) !== null && _a !== void 0 ? _a : treeState.checkbox, checked: (_b = itemModel.checked) !== null && _b !== void 0 ? _b : treeState.checked, class: itemModel.class, disabled: itemModel.disabled, downloading: itemModel.downloading, dragDisabled: (_c = itemModel.dragDisabled) !== null && _c !== void 0 ? _c : treeState.dragDisabled, dropDisabled: (_d = itemModel.dropDisabled) !== null && _d !== void 0 ? _d : treeState.dropDisabled, editable: (_e = itemModel.editable) !== null && _e !== void 0 ? _e : treeState.editableItems, expanded: itemModel.expanded, indeterminate: itemModel.indeterminate, lastItem: lastItem, lazyLoad: itemModel.lazy, leaf: itemModel.leaf, leftImgSrc: itemModel.leftImgSrc, level: level, metadata: itemModel.metadata, rightImgSrc: itemModel.rightImgSrc, selected: itemModel.selected, showExpandableButton: itemModel.showExpandableButton, showLines: treeState.showLines, toggleCheckboxes: (_f = itemModel.toggleCheckboxes) !== null && _f !== void 0 ? _f : treeState.toggleCheckboxes }, !itemModel.leaf &&
|
|
@@ -129,13 +68,13 @@ const defaultRenderItem = (itemModel, treeState, treeHasFilter, lastItem, level)
|
|
|
129
68
|
itemModel.items.map((subModel, index) => defaultRenderItem(subModel, treeState, treeHasFilter, treeState.showLines !== "none" &&
|
|
130
69
|
// If there is a filter applied in the current list, use the
|
|
131
70
|
// lastItemId value to calculate the last item
|
|
132
|
-
(treeHasFilter && itemModel.lastItemId !==
|
|
71
|
+
(treeHasFilter && itemModel.lastItemId !== undefined
|
|
133
72
|
? subModel.id === itemModel.lastItemId
|
|
134
73
|
: index === itemModel.items.length - 1), level + 1))));
|
|
135
74
|
};
|
|
136
75
|
const GXRenderItem = (itemModel, treeState, treeHasFilter, lastItem, level) => {
|
|
137
76
|
var _a, _b, _c, _d;
|
|
138
|
-
return (treeState.filterType === "none" || itemModel.render !== false) && (h("ch-tree-view-item", { id: itemModel.id, caption: itemModel.caption, checkbox: (_a = itemModel.checkbox) !== null && _a !== void 0 ? _a : treeState.checkbox, checked: (_b = itemModel.checked) !== null && _b !== void 0 ? _b : treeState.checked, class: itemModel.class, downloading: itemModel.downloading, dragDisabled: itemModel.dragEnabled != null
|
|
77
|
+
return (treeState.filterType === "none" || itemModel.render !== false) && (h("ch-tree-view-item", { key: itemModel.id, id: itemModel.id, caption: itemModel.caption, checkbox: (_a = itemModel.checkbox) !== null && _a !== void 0 ? _a : treeState.checkbox, checked: (_b = itemModel.checked) !== null && _b !== void 0 ? _b : treeState.checked, class: itemModel.class, downloading: itemModel.downloading, dragDisabled: itemModel.dragEnabled != null
|
|
139
78
|
? !itemModel.dragEnabled
|
|
140
79
|
: treeState.dragDisabled, dropDisabled: itemModel.dropEnabled != null
|
|
141
80
|
? !itemModel.dropEnabled
|
|
@@ -144,7 +83,7 @@ const GXRenderItem = (itemModel, treeState, treeHasFilter, lastItem, level) => {
|
|
|
144
83
|
itemModel.items.map((subModel, index) => GXRenderItem(subModel, treeState, treeHasFilter, treeState.showLines !== "none" &&
|
|
145
84
|
// If there is a filter applied in the current list, use the
|
|
146
85
|
// lastItemId value to calculate the last item
|
|
147
|
-
(treeHasFilter && itemModel.lastItemId !==
|
|
86
|
+
(treeHasFilter && itemModel.lastItemId !== undefined
|
|
148
87
|
? subModel.id === itemModel.lastItemId
|
|
149
88
|
: index === itemModel.items.length - 1), level + 1))));
|
|
150
89
|
};
|
|
@@ -217,13 +156,12 @@ const ChTreeViewRender = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
217
156
|
this.filterDebounce = 250;
|
|
218
157
|
/**
|
|
219
158
|
* This property lets you determine the list of items that will be filtered.
|
|
220
|
-
* Only works if `filterType = "
|
|
159
|
+
* Only works if `filterType = "list"`.
|
|
221
160
|
*/
|
|
222
161
|
this.filterList = [];
|
|
223
162
|
/**
|
|
224
163
|
* This property lets you determine the options that will be applied to the
|
|
225
164
|
* filter.
|
|
226
|
-
* Only works if `filterType = "caption" | "metadata"`.
|
|
227
165
|
*/
|
|
228
166
|
this.filterOptions = {};
|
|
229
167
|
/**
|
|
@@ -236,7 +174,7 @@ const ChTreeViewRender = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
236
174
|
* | `unchecked` | Show only the items that have a checkbox and are not checked. |
|
|
237
175
|
* | `caption` | Show only the items whose `caption` satisfies the regex determinate by the `filter` property. |
|
|
238
176
|
* | `metadata` | Show only the items whose `metadata` satisfies the regex determinate by the `filter` property. |
|
|
239
|
-
* | `
|
|
177
|
+
* | `list` | Show only the items that are contained in the array determinate by the `filterList` property. |
|
|
240
178
|
* | `none` | Show all items. |
|
|
241
179
|
*/
|
|
242
180
|
this.filterType = "none";
|
|
@@ -310,7 +248,8 @@ const ChTreeViewRender = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
310
248
|
newSelectedItem.expanded = newSelectedItemInfo.expanded;
|
|
311
249
|
this.selectedItems.add(itemId);
|
|
312
250
|
});
|
|
313
|
-
this.
|
|
251
|
+
const selectedItemsInfo = this._getItemsInfo([...event.detail.keys()]);
|
|
252
|
+
this.selectedItemsChange.emit(selectedItemsInfo);
|
|
314
253
|
};
|
|
315
254
|
this.handleExpandedItemChange = (event) => {
|
|
316
255
|
const detail = event.detail;
|
|
@@ -391,14 +330,14 @@ const ChTreeViewRender = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
391
330
|
}
|
|
392
331
|
}
|
|
393
332
|
handleFilterListChange() {
|
|
394
|
-
|
|
333
|
+
// Use a Set to efficiently check for ids
|
|
334
|
+
this.filterListAsSet = new Set(this.filterList);
|
|
335
|
+
if (this.filterType === "list") {
|
|
395
336
|
this.processFilters();
|
|
396
337
|
}
|
|
397
338
|
}
|
|
398
339
|
handleFilterOptionsChange() {
|
|
399
|
-
|
|
400
|
-
this.processFilters();
|
|
401
|
-
}
|
|
340
|
+
this.processFilters();
|
|
402
341
|
}
|
|
403
342
|
handleFilterTypeChange() {
|
|
404
343
|
this.processFilters();
|
|
@@ -447,6 +386,23 @@ const ChTreeViewRender = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
447
386
|
// Force re-render
|
|
448
387
|
forceUpdate(this);
|
|
449
388
|
}
|
|
389
|
+
/**
|
|
390
|
+
* Given a list of ids, it returns an array of the items that exists in the
|
|
391
|
+
* given list.
|
|
392
|
+
*/
|
|
393
|
+
async getItemsInfo(itemsId) {
|
|
394
|
+
return this._getItemsInfo(itemsId);
|
|
395
|
+
}
|
|
396
|
+
_getItemsInfo(itemsId) {
|
|
397
|
+
const treeViewItemsInfo = [];
|
|
398
|
+
itemsId.forEach(itemId => {
|
|
399
|
+
const itemUIModel = this.flattenedTreeModel.get(itemId);
|
|
400
|
+
if (itemUIModel) {
|
|
401
|
+
treeViewItemsInfo.push(itemUIModel);
|
|
402
|
+
}
|
|
403
|
+
});
|
|
404
|
+
return treeViewItemsInfo;
|
|
405
|
+
}
|
|
450
406
|
/**
|
|
451
407
|
* Given an item id, an array of items to add, the download status and the
|
|
452
408
|
* lazy state, updates the item's UI Model.
|
|
@@ -568,7 +524,9 @@ const ChTreeViewRender = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
568
524
|
}
|
|
569
525
|
const itemInfo = itemUIModel.item;
|
|
570
526
|
Object.keys(properties).forEach(propertyName => {
|
|
571
|
-
|
|
527
|
+
if (properties[propertyName] !== undefined) {
|
|
528
|
+
itemInfo[propertyName] = properties[propertyName];
|
|
529
|
+
}
|
|
572
530
|
});
|
|
573
531
|
}
|
|
574
532
|
updateCheckboxValue(event) {
|
|
@@ -675,7 +633,7 @@ const ChTreeViewRender = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
675
633
|
let aSubItemIsRendered = false;
|
|
676
634
|
// Check if a subitem is rendered
|
|
677
635
|
if (item.leaf !== true && item.items != null) {
|
|
678
|
-
let lastItemId =
|
|
636
|
+
let lastItemId = undefined;
|
|
679
637
|
item.items.forEach(subItem => {
|
|
680
638
|
const itemSatisfiesFilter = this.filterSubModel(subItem, filterInfo);
|
|
681
639
|
aSubItemIsRendered || (aSubItemIsRendered = itemSatisfiesFilter);
|
|
@@ -687,7 +645,7 @@ const ChTreeViewRender = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
687
645
|
}
|
|
688
646
|
// The current item is rendered if it satisfies the filter condition or a
|
|
689
647
|
// subitem exists that needs to be rendered
|
|
690
|
-
const satisfiesFilter =
|
|
648
|
+
const satisfiesFilter = aSubItemIsRendered || computeFilter(this.filterType, item, filterInfo);
|
|
691
649
|
item.render = satisfiesFilter; // Update item render
|
|
692
650
|
return satisfiesFilter;
|
|
693
651
|
}
|
|
@@ -724,8 +682,8 @@ const ChTreeViewRender = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
724
682
|
defaultCheckbox: this.checkbox,
|
|
725
683
|
defaultChecked: this.checked,
|
|
726
684
|
filter: this.filter,
|
|
727
|
-
|
|
728
|
-
|
|
685
|
+
filterOptions: this.filterOptions,
|
|
686
|
+
filterSet: this.filterListAsSet
|
|
729
687
|
});
|
|
730
688
|
// Check if should filter with debounce
|
|
731
689
|
if (processWithDebounce) {
|
|
@@ -757,8 +715,7 @@ const ChTreeViewRender = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
757
715
|
}
|
|
758
716
|
}
|
|
759
717
|
render() {
|
|
760
|
-
return (h("ch-tree-view", { class: this.cssClass || null, multiSelection: this.multiSelection, waitDropProcessing: this.waitDropProcessing, onDroppableZoneEnter: this.handleDroppableZoneEnter, onExpandedItemChange: this.handleExpandedItemChange, onItemContextmenu: this.handleItemContextmenu, onItemsDropped: this.handleItemsDropped, onSelectedItemsChange: this.handleSelectedItemsChange, ref: el => (this.treeRef = el) }, this.treeModel.map((itemModel, index) => this.renderItem(itemModel, this, (this.filterType
|
|
761
|
-
this.filter != null, this.showLines !== "none" && index === this.treeModel.length - 1, 0))));
|
|
718
|
+
return (h("ch-tree-view", { class: this.cssClass || null, multiSelection: this.multiSelection, waitDropProcessing: this.waitDropProcessing, onDroppableZoneEnter: this.handleDroppableZoneEnter, onExpandedItemChange: this.handleExpandedItemChange, onItemContextmenu: this.handleItemContextmenu, onItemsDropped: this.handleItemsDropped, onSelectedItemsChange: this.handleSelectedItemsChange, ref: el => (this.treeRef = el) }, this.treeModel.map((itemModel, index) => this.renderItem(itemModel, this, treeViewHasFilters(this.filterType, this.filter), this.showLines !== "none" && index === this.treeModel.length - 1, 0))));
|
|
762
719
|
}
|
|
763
720
|
static get watchers() { return {
|
|
764
721
|
"filter": ["handleFilterChange"],
|
|
@@ -796,6 +753,7 @@ const ChTreeViewRender = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
796
753
|
"useGxRender": [4, "use-gx-render"],
|
|
797
754
|
"waitDropProcessing": [32],
|
|
798
755
|
"dropItems": [64],
|
|
756
|
+
"getItemsInfo": [64],
|
|
799
757
|
"loadLazyContent": [64],
|
|
800
758
|
"scrollIntoVisible": [64],
|
|
801
759
|
"toggleItems": [64],
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { r as registerInstance, h } from './index-0aa3977d.js';
|
|
2
|
+
import { f as fromGxImageToURL } from './genexus-implementation-3b347d88.js';
|
|
3
|
+
|
|
4
|
+
const actionGroupRenderCss = "ch-action-group-render{display:contents}";
|
|
5
|
+
|
|
6
|
+
const DEFAULT_ACTION_CLASS = "action-group-item";
|
|
7
|
+
const DEFAULT_SUB_ACTION_CLASS = "dropdown-item";
|
|
8
|
+
const ChActionGroupRender = class {
|
|
9
|
+
constructor(hostRef) {
|
|
10
|
+
registerInstance(this, hostRef);
|
|
11
|
+
this.displayedItemsCount = -1;
|
|
12
|
+
/**
|
|
13
|
+
* This attribute lets you specify the label for the expandable button.
|
|
14
|
+
* Important for accessibility.
|
|
15
|
+
*/
|
|
16
|
+
this.buttonLabel = "Show options";
|
|
17
|
+
/**
|
|
18
|
+
* A CSS class to set as the `ch-action-group` element class.
|
|
19
|
+
*/
|
|
20
|
+
this.cssClass = "action-group";
|
|
21
|
+
/**
|
|
22
|
+
* Determine which actions on the expandable button display the dropdown
|
|
23
|
+
* section.
|
|
24
|
+
*/
|
|
25
|
+
this.expandBehavior = "ClickOrHover";
|
|
26
|
+
/**
|
|
27
|
+
* This attribute determines how items behave when the content of the ActionGroup overflows horizontal. This property is needed
|
|
28
|
+
* to make the control responsive to changes in the Width of the container of ActionGroup.
|
|
29
|
+
*
|
|
30
|
+
* | Value | Details |
|
|
31
|
+
* | --------------------- | ------------------------------------------------------------------------------------------------ |
|
|
32
|
+
* | `Add Scroll` | The items of the ActionGroup that overflow horizontally are shown by means of a scroll. |
|
|
33
|
+
* | `Multiline` | The ActionGroup items that overflow horizontally are shown in a second line of the control. |
|
|
34
|
+
* | `Responsive Collapse` | The Action Group items, when they start to overflow the control, are placed in the More Actions. |
|
|
35
|
+
*/
|
|
36
|
+
this.itemsOverflowBehavior = "ResponsiveCollapse";
|
|
37
|
+
/**
|
|
38
|
+
* Determine if the dropdown section should be opened when the expandable
|
|
39
|
+
* button of the control is focused.
|
|
40
|
+
*/
|
|
41
|
+
this.openOnFocus = false;
|
|
42
|
+
/**
|
|
43
|
+
* Specifies the position of the dropdown section that is placed relative to
|
|
44
|
+
* the more actions button.
|
|
45
|
+
*/
|
|
46
|
+
this.moreActionsDropdownPosition = "InsideStart_OutsideEnd";
|
|
47
|
+
/**
|
|
48
|
+
* Specifies the separation (in pixels) between the expandable button and the
|
|
49
|
+
* dropdown section of the control.
|
|
50
|
+
*/
|
|
51
|
+
this.separation = 0;
|
|
52
|
+
/**
|
|
53
|
+
* This property is a WA to implement the Tree View as a UC 2.0 in GeneXus.
|
|
54
|
+
*/
|
|
55
|
+
this.useGxRender = false;
|
|
56
|
+
// /**
|
|
57
|
+
// * Fired when the visibility of the dropdown section is changed
|
|
58
|
+
// */
|
|
59
|
+
// @Event() expandedChange: EventEmitter<boolean>;
|
|
60
|
+
this.handleItemClick = (target, itemId) => (event) => {
|
|
61
|
+
this.itemClickCallback(event, target, itemId);
|
|
62
|
+
};
|
|
63
|
+
this.renderImg = (img) => this.useGxRender
|
|
64
|
+
? fromGxImageToURL(img, this.gxSettings, this.gxImageConstructor)
|
|
65
|
+
: img;
|
|
66
|
+
this.renderItem = (responsiveCollapse) => (item, index) => {
|
|
67
|
+
var _a, _b;
|
|
68
|
+
return (h("ch-dropdown-item", { slot: "items", key: item.id || item.caption || index, id: item.id, class: item.subActionClass || DEFAULT_SUB_ACTION_CLASS, expandBehavior: this.expandBehavior, href: (_a = item.link) === null || _a === void 0 ? void 0 : _a.url, leftImgSrc: this.renderImg(item.startImage), openOnFocus: this.openOnFocus, position: (responsiveCollapse
|
|
69
|
+
? item.itemsResponsiveCollapsePosition
|
|
70
|
+
: item.itemsPosition) || "OutsideEnd_InsideStart", rightImgSrc: this.renderImg(item.endImage), onClick: this.handleItemClick((_b = item.link) === null || _b === void 0 ? void 0 : _b.url, item.id) }, item.caption, item.items != null &&
|
|
71
|
+
item.items.map(this.renderItem(responsiveCollapse))));
|
|
72
|
+
};
|
|
73
|
+
this.firstLevelRenderItem = (item, index) => {
|
|
74
|
+
var _a, _b;
|
|
75
|
+
return (h("ch-dropdown-item", { key: item.id || item.caption || index, id: item.id, class: item.actionClass || DEFAULT_ACTION_CLASS, expandBehavior: this.expandBehavior, forceContainingBlock: false, href: (_a = item.link) === null || _a === void 0 ? void 0 : _a.url, leftImgSrc: this.renderImg(item.startImage), openOnFocus: this.openOnFocus, position: item.itemsPosition || "Center_OutsideEnd", rightImgSrc: this.renderImg(item.endImage), onClick: this.handleItemClick((_b = item.link) === null || _b === void 0 ? void 0 : _b.url, item.id) }, item.caption, this.itemsOverflowBehavior === "ResponsiveCollapse" &&
|
|
76
|
+
(this.displayedItemsCount === -1 || index < this.displayedItemsCount) &&
|
|
77
|
+
item.items != null &&
|
|
78
|
+
item.items.map(this.renderItem(false)),
|
|
79
|
+
// Dummy dropdown item to avoid issues when removing all items from the
|
|
80
|
+
// first level. E. g., if the first level adds a chevron when the item is
|
|
81
|
+
// a dropdown, by removing all items the chevron won't be displayed
|
|
82
|
+
this.itemsOverflowBehavior === "ResponsiveCollapse" &&
|
|
83
|
+
this.displayedItemsCount !== -1 &&
|
|
84
|
+
index >= this.displayedItemsCount &&
|
|
85
|
+
item.items != null &&
|
|
86
|
+
item.items.length !== 0 && h("ch-dropdown-item", null)));
|
|
87
|
+
};
|
|
88
|
+
this.firstLevelRenderCollapsedItem = (item, index) => {
|
|
89
|
+
var _a, _b;
|
|
90
|
+
return (h("ch-dropdown-item", { slot: "more-items", key: item.id || item.caption || index, id: item.id, class: item.subActionClass || DEFAULT_SUB_ACTION_CLASS, expandBehavior: this.expandBehavior, href: (_a = item.link) === null || _a === void 0 ? void 0 : _a.url, leftImgSrc: this.renderImg(item.startImage), openOnFocus: this.openOnFocus, position: item.itemsResponsiveCollapsePosition || "OutsideEnd_InsideStart", rightImgSrc: this.renderImg(item.endImage), onClick: this.handleItemClick((_b = item.link) === null || _b === void 0 ? void 0 : _b.url, item.id) }, item.caption, item.items != null && item.items.map(this.renderItem(true))));
|
|
91
|
+
};
|
|
92
|
+
this.handleDisplayedItemsCountChange = (event) => {
|
|
93
|
+
this.displayedItemsCount = event.detail;
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
render() {
|
|
97
|
+
return (h("ch-action-group", { buttonLabel: this.buttonLabel, class: this.cssClass || null, expandBehavior: this.expandBehavior, itemsOverflowBehavior: this.itemsOverflowBehavior, moreActionsDropdownPosition: this.moreActionsDropdownPosition, openOnFocus: this.openOnFocus, onDisplayedItemsCountChange: this.handleDisplayedItemsCountChange }, this.model != null &&
|
|
98
|
+
this.model.map((item, index) => (h("ch-action-group-item", { slot: "items", key: item.id || item.caption || index }, this.firstLevelRenderItem(item, index)))), this.itemsOverflowBehavior === "ResponsiveCollapse" &&
|
|
99
|
+
this.model != null &&
|
|
100
|
+
this.model
|
|
101
|
+
.filter((_, index) => this.displayedItemsCount !== -1 &&
|
|
102
|
+
index >= this.displayedItemsCount)
|
|
103
|
+
.map(this.firstLevelRenderCollapsedItem)));
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
ChActionGroupRender.style = actionGroupRenderCss;
|
|
107
|
+
|
|
108
|
+
export { ChActionGroupRender as ch_action_group_render };
|
|
@@ -746,15 +746,18 @@ const ChTreeViewItem = class {
|
|
|
746
746
|
this.selected = true;
|
|
747
747
|
this.selectedItemChange.emit(this.getSelectedInfo(mouseEventModifierKey(event), true));
|
|
748
748
|
};
|
|
749
|
-
this.getSelectedInfo = (ctrlKeyPressed, selected) =>
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
749
|
+
this.getSelectedInfo = (ctrlKeyPressed, selected) => {
|
|
750
|
+
var _a;
|
|
751
|
+
return ({
|
|
752
|
+
ctrlKeyPressed: ctrlKeyPressed,
|
|
753
|
+
expanded: this.expanded,
|
|
754
|
+
id: this.el.id,
|
|
755
|
+
itemRef: this.el,
|
|
756
|
+
metadata: this.metadata,
|
|
757
|
+
parentId: (_a = this.el.parentElement) === null || _a === void 0 ? void 0 : _a.id,
|
|
758
|
+
selected: selected
|
|
759
|
+
});
|
|
760
|
+
};
|
|
758
761
|
this.handleActionDblClick = (event) => {
|
|
759
762
|
event.stopPropagation();
|
|
760
763
|
if (mouseEventModifierKey(event)) {
|
|
@@ -866,7 +869,11 @@ const ChTreeViewItem = class {
|
|
|
866
869
|
});
|
|
867
870
|
}
|
|
868
871
|
handleExpandedChange(isExpanded) {
|
|
869
|
-
|
|
872
|
+
// Wait until all properties are updated before lazy loading. Otherwise, the
|
|
873
|
+
// lazyLoad property could be updated just after the executing of the function
|
|
874
|
+
setTimeout(() => {
|
|
875
|
+
this.lazyLoadItems(isExpanded);
|
|
876
|
+
});
|
|
870
877
|
}
|
|
871
878
|
handleLasItemChange(isLastItem) {
|
|
872
879
|
if (isLastItem && this.showLines) {
|
|
@@ -1096,6 +1103,10 @@ const ChTreeViewItem = class {
|
|
|
1096
1103
|
if (this.editing) {
|
|
1097
1104
|
this.removeEditMode(false);
|
|
1098
1105
|
}
|
|
1106
|
+
// Sync selected state with the main tree
|
|
1107
|
+
if (this.selected) {
|
|
1108
|
+
this.selectedItemChange.emit(this.getSelectedInfo(true, false));
|
|
1109
|
+
}
|
|
1099
1110
|
this.disconnectObserver();
|
|
1100
1111
|
}
|
|
1101
1112
|
render() {
|
|
@@ -38,7 +38,7 @@ const ChDropDownItem = class {
|
|
|
38
38
|
this.checkItems = () => {
|
|
39
39
|
this.hasItems = !!this.el.querySelector(`:scope>${DROPDOWN_ITEM}`);
|
|
40
40
|
};
|
|
41
|
-
this.noItemsRender = () => this.href ? (h("a", { class: "action", part: "action
|
|
41
|
+
this.noItemsRender = () => this.href ? (h("a", { class: "action", part: "action link", href: this.href, onClick: this.handleActionClick, onFocus: this.handleFocus, ref: el => (this.mainElement = el) }, this.dropDownItemContent(), h("slot", { name: "items", onSlotchange: this.checkItems }))) : (h("button", { class: "action", part: "action button", type: "button", onClick: this.handleActionClick, onFocus: this.handleFocus, ref: el => (this.mainElement = el) }, this.dropDownItemContent(), h("slot", { name: "items", onSlotchange: this.checkItems })));
|
|
42
42
|
this.itemsRender = () => (h("ch-dropdown", { class: "action", exportparts: "expandable-button:action,expandable-button:button,expandable-button:expandable-action,separation,list,section,mask,header,footer,window", expandBehavior: this.expandBehavior, nestedDropdown: true, openOnFocus: this.openOnFocus, position: this.position }, this.dropDownItemContent(), h("slot", { name: "items", slot: "items", onSlotchange: this.checkItems })));
|
|
43
43
|
this.handleActionClick = () => {
|
|
44
44
|
this.actionClick.emit(this.el.id);
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { r as registerInstance, h, g as getElement } from './index-0aa3977d.js';
|
|
2
|
+
import { f as fromGxImageToURL } from './genexus-implementation-3b347d88.js';
|
|
3
|
+
|
|
4
|
+
const dropdownRenderCss = "ch-dropdown-render{display:contents}";
|
|
5
|
+
|
|
6
|
+
const DEFAULT_DROPDOWN_ITEM_CLASS = "dropdown-item";
|
|
7
|
+
const ChDropdownRender = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
registerInstance(this, hostRef);
|
|
10
|
+
this.showHeader = false;
|
|
11
|
+
this.showFooter = false;
|
|
12
|
+
/**
|
|
13
|
+
* This attribute lets you specify the label for the expandable button.
|
|
14
|
+
* Important for accessibility.
|
|
15
|
+
*/
|
|
16
|
+
this.buttonLabel = "Show options";
|
|
17
|
+
/**
|
|
18
|
+
* A CSS class to set as the `ch-dropdown` element class.
|
|
19
|
+
*/
|
|
20
|
+
this.cssClass = "dropdown";
|
|
21
|
+
/**
|
|
22
|
+
* Determine which actions on the expandable button display the dropdown
|
|
23
|
+
* section.
|
|
24
|
+
*/
|
|
25
|
+
this.expandBehavior = "ClickOrHover";
|
|
26
|
+
/**
|
|
27
|
+
* Determine if the dropdown section should be opened when the expandable
|
|
28
|
+
* button of the control is focused.
|
|
29
|
+
*/
|
|
30
|
+
this.openOnFocus = false;
|
|
31
|
+
/**
|
|
32
|
+
* Specifies the position of the dropdown section that is placed relative to
|
|
33
|
+
* the expandable button.
|
|
34
|
+
*/
|
|
35
|
+
this.position = "Center_OutsideEnd";
|
|
36
|
+
/**
|
|
37
|
+
* This property is a WA to implement the Tree View as a UC 2.0 in GeneXus.
|
|
38
|
+
*/
|
|
39
|
+
this.useGxRender = false;
|
|
40
|
+
// /**
|
|
41
|
+
// * Fired when the visibility of the dropdown section is changed
|
|
42
|
+
// */
|
|
43
|
+
// @Event() expandedChange: EventEmitter<boolean>;
|
|
44
|
+
this.handleItemClick = (target, itemId) => (event) => {
|
|
45
|
+
this.itemClickCallback(event, target, itemId);
|
|
46
|
+
};
|
|
47
|
+
this.renderItem = (item) => {
|
|
48
|
+
var _a, _b;
|
|
49
|
+
return [
|
|
50
|
+
h("ch-dropdown-item", { slot: "items", id: item.id, class: item.class || DEFAULT_DROPDOWN_ITEM_CLASS, expandBehavior: this.expandBehavior, href: (_a = item.link) === null || _a === void 0 ? void 0 : _a.url, leftImgSrc: this.useGxRender
|
|
51
|
+
? fromGxImageToURL(item.startImage, this.gxSettings, this.gxImageConstructor)
|
|
52
|
+
: item.startImage, openOnFocus: this.openOnFocus, position: item.itemsPosition || "OutsideEnd_InsideStart", rightImgSrc: this.useGxRender
|
|
53
|
+
? fromGxImageToURL(item.endImage, this.gxSettings, this.gxImageConstructor)
|
|
54
|
+
: item.endImage, onClick: this.handleItemClick((_b = item.link) === null || _b === void 0 ? void 0 : _b.url, item.id) }, item.caption, item.items != null && item.items.map(this.renderItem))
|
|
55
|
+
];
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
componentWillLoad() {
|
|
59
|
+
this.showHeader = !!this.el.querySelector(':scope>[slot="header"]');
|
|
60
|
+
this.showFooter = !!this.el.querySelector(':scope>[slot="footer"]');
|
|
61
|
+
}
|
|
62
|
+
render() {
|
|
63
|
+
return (h("ch-dropdown", { buttonLabel: this.buttonLabel, class: this.cssClass || null, expandBehavior: this.expandBehavior, openOnFocus: this.openOnFocus, position: this.position }, h("slot", { name: "action", slot: "action" }), this.showHeader && h("slot", { name: "header", slot: "header" }), this.model != null && this.model.map(this.renderItem), this.showFooter && h("slot", { name: "footer", slot: "footer" })));
|
|
64
|
+
}
|
|
65
|
+
get el() { return getElement(this); }
|
|
66
|
+
};
|
|
67
|
+
ChDropdownRender.style = dropdownRenderCss;
|
|
68
|
+
|
|
69
|
+
export { ChDropdownRender as ch_dropdown_render };
|