@genexus/genexus-ide-ui 0.0.30 → 0.0.32
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_2.cjs.entry.js +2 -9
- package/dist/cjs/ch-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/ch-dropdown-item.cjs.entry.js +8 -8
- package/dist/cjs/ch-dropdown.cjs.entry.js +11 -10
- package/dist/cjs/ch-suggest_4.cjs.entry.js +1 -0
- package/dist/cjs/ch-test-action-group.cjs.entry.js +2 -2
- package/dist/cjs/ch-test-tree-x.cjs.entry.js +150 -80
- package/dist/cjs/ch-tree-x_3.cjs.entry.js +211 -132
- package/dist/cjs/ch-window_2.cjs.entry.js +28 -12
- package/dist/cjs/genexus-ide-ui.cjs.js +1 -1
- package/dist/cjs/gx-ide-team-dev-commit.cjs.entry.js +3 -3
- package/dist/cjs/gx-ide-team-dev-update-partial-selection.cjs.entry.js +17 -32
- package/dist/cjs/gx-ide-team-dev-update-to-revision.cjs.entry.js +16 -1
- package/dist/cjs/gx-ide-team-dev-update.cjs.entry.js +33 -31
- package/dist/cjs/gxg-combo-box_6.cjs.entry.js +10 -4
- package/dist/cjs/gxg-date-picker.cjs.entry.js +4 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/team-dev-commit/team-dev-commit.js +12 -18
- package/dist/collection/components/team-dev-update/team-dev-update.js +75 -35
- package/dist/collection/components/team-dev-update-partial-selection/gx-ide-assets/team-dev-update-partial-selection/langs/team-dev-update-partial-selection.lang.en.json +4 -2
- package/dist/collection/components/team-dev-update-partial-selection/team-dev-update-partial-selection.css +1 -0
- package/dist/collection/components/team-dev-update-partial-selection/team-dev-update-partial-selection.js +22 -46
- package/dist/collection/components/team-dev-update-to-revision/gx-ide-assets/team-dev-update-to-revision/langs/team-dev-update-to-revision.lang.en.json +1 -1
- package/dist/collection/components/team-dev-update-to-revision/team-dev-update-to-revision.js +33 -1
- package/dist/components/action-group-item.js +1 -9
- package/dist/components/action-group.js +1 -1
- package/dist/components/ch-suggest2.js +1 -0
- package/dist/components/ch-test-action-group.js +2 -2
- package/dist/components/ch-test-tree-x.js +157 -83
- package/dist/components/ch-window2.js +31 -13
- package/dist/components/checkbox.js +1 -1
- package/dist/components/combo-box-item.js +2 -2
- package/dist/components/combo-box.js +8 -2
- package/dist/components/dropdown-item.js +8 -8
- package/dist/components/dropdown.js +11 -10
- package/dist/components/gx-ide-team-dev-commit.js +4 -4
- package/dist/components/gx-ide-team-dev-update-partial-selection.js +18 -33
- package/dist/components/gx-ide-team-dev-update-to-revision.js +17 -1
- package/dist/components/gx-ide-team-dev-update.js +36 -32
- package/dist/components/gxg-date-picker.js +4 -4
- package/dist/components/tree-x-list-item.js +31 -17
- package/dist/components/tree-x-list.js +9 -4
- package/dist/components/tree-x.js +182 -117
- package/dist/esm/ch-action-group_2.entry.js +2 -9
- package/dist/esm/ch-checkbox.entry.js +1 -1
- package/dist/esm/ch-dropdown-item.entry.js +8 -8
- package/dist/esm/ch-dropdown.entry.js +11 -10
- package/dist/esm/ch-suggest_4.entry.js +1 -0
- package/dist/esm/ch-test-action-group.entry.js +2 -2
- package/dist/esm/ch-test-tree-x.entry.js +150 -80
- package/dist/esm/ch-tree-x_3.entry.js +211 -132
- package/dist/esm/ch-window_2.entry.js +28 -12
- package/dist/esm/genexus-ide-ui.js +1 -1
- package/dist/esm/gx-ide-team-dev-commit.entry.js +3 -3
- package/dist/esm/gx-ide-team-dev-update-partial-selection.entry.js +17 -32
- package/dist/esm/gx-ide-team-dev-update-to-revision.entry.js +16 -1
- package/dist/esm/gx-ide-team-dev-update.entry.js +33 -31
- package/dist/esm/gxg-combo-box_6.entry.js +10 -4
- package/dist/esm/gxg-date-picker.entry.js +4 -4
- package/dist/esm/loader.js +1 -1
- package/dist/genexus-ide-ui/genexus-ide-ui.css +1 -1
- package/dist/genexus-ide-ui/genexus-ide-ui.esm.js +1 -1
- package/dist/genexus-ide-ui/gx-ide-assets/team-dev-update-partial-selection/langs/team-dev-update-partial-selection.lang.en.json +4 -2
- package/dist/genexus-ide-ui/gx-ide-assets/team-dev-update-to-revision/langs/team-dev-update-to-revision.lang.en.json +1 -1
- package/dist/genexus-ide-ui/p-1b6b11e1.entry.js +1 -0
- package/dist/genexus-ide-ui/p-1fe05a05.entry.js +1 -0
- package/dist/genexus-ide-ui/p-24f47ee2.entry.js +1 -0
- package/dist/genexus-ide-ui/{p-54bab171.entry.js → p-28d0afda.entry.js} +1 -1
- package/dist/genexus-ide-ui/{p-6050cdba.entry.js → p-48412811.entry.js} +1 -1
- package/dist/genexus-ide-ui/p-714bd8ea.entry.js +1 -0
- package/dist/genexus-ide-ui/p-8592f072.entry.js +1 -0
- package/dist/genexus-ide-ui/p-8c2ab053.entry.js +1 -0
- package/dist/genexus-ide-ui/p-976e8118.entry.js +1 -0
- package/dist/genexus-ide-ui/p-a5463fc9.entry.js +1 -0
- package/dist/genexus-ide-ui/p-b2923298.entry.js +1 -0
- package/dist/genexus-ide-ui/p-bb1809cb.entry.js +1 -0
- package/dist/genexus-ide-ui/p-cf41f154.entry.js +1 -0
- package/dist/genexus-ide-ui/p-e8a21ed7.entry.js +1 -0
- package/dist/genexus-ide-ui/p-f794dc13.entry.js +1 -0
- package/dist/node_modules/@genexus/chameleon-controls-library/dist/collection/components/action-group-item/action-group-item.css +0 -1
- package/dist/node_modules/@genexus/chameleon-controls-library/dist/collection/components/checkbox/checkbox.css +5 -3
- package/dist/node_modules/@genexus/chameleon-controls-library/dist/collection/components/dropdown/dropdown.css +15 -33
- package/dist/node_modules/@genexus/chameleon-controls-library/dist/collection/components/dropdown-item/dropdown-item.css +0 -4
- package/dist/node_modules/@genexus/chameleon-controls-library/dist/collection/components/test/test-tree-x.css +0 -10
- package/dist/node_modules/@genexus/chameleon-controls-library/dist/collection/components/tree-x/tree-x.css +20 -3
- package/dist/node_modules/@genexus/chameleon-controls-library/dist/collection/components/tree-x-list-item/tree-x-list-item.css +25 -8
- package/dist/node_modules/@genexus/chameleon-controls-library/dist/collection/components/window/ch-window.css +51 -2
- package/dist/node_modules/@genexus/gemini/dist/collection/components/combo-box-item/combo-box-item.css +1 -1
- package/dist/types/common/types.d.ts +9 -0
- package/dist/types/components/team-dev-commit/team-dev-commit.d.ts +8 -15
- package/dist/types/components/team-dev-update/team-dev-update.d.ts +16 -13
- package/dist/types/components/team-dev-update-partial-selection/team-dev-update-partial-selection.d.ts +11 -14
- package/dist/types/components/team-dev-update-to-revision/team-dev-update-to-revision.d.ts +8 -0
- package/dist/types/components.d.ts +39 -19
- package/package.json +3 -3
- package/dist/genexus-ide-ui/p-097a3eeb.entry.js +0 -1
- package/dist/genexus-ide-ui/p-32b8abf6.entry.js +0 -1
- package/dist/genexus-ide-ui/p-3d9a4ede.entry.js +0 -1
- package/dist/genexus-ide-ui/p-4bbe1c18.entry.js +0 -1
- package/dist/genexus-ide-ui/p-53d36ef7.entry.js +0 -1
- package/dist/genexus-ide-ui/p-5c64c57f.entry.js +0 -1
- package/dist/genexus-ide-ui/p-5ff04ebe.entry.js +0 -1
- package/dist/genexus-ide-ui/p-6e80380b.entry.js +0 -1
- package/dist/genexus-ide-ui/p-757f8567.entry.js +0 -1
- package/dist/genexus-ide-ui/p-8d46f8d8.entry.js +0 -1
- package/dist/genexus-ide-ui/p-a0e85c2a.entry.js +0 -1
- package/dist/genexus-ide-ui/p-cda1623a.entry.js +0 -1
- package/dist/genexus-ide-ui/p-f8561da6.entry.js +0 -1
|
@@ -126,7 +126,7 @@ const ChActionGroup = class {
|
|
|
126
126
|
}
|
|
127
127
|
connectActionsContainerObserver() {
|
|
128
128
|
this.actionsContainerWatcher = new ResizeObserver(this.updateDisplayedActionInFrame);
|
|
129
|
-
this.actionsContainerWatcher.observe(this.
|
|
129
|
+
this.actionsContainerWatcher.observe(this.actionsContainer);
|
|
130
130
|
}
|
|
131
131
|
disconnectActionsObserver() {
|
|
132
132
|
if (this.actionsWatcher) {
|
|
@@ -173,15 +173,11 @@ const ChActionGroup = class {
|
|
|
173
173
|
};
|
|
174
174
|
ChActionGroup.style = actionGroupCss;
|
|
175
175
|
|
|
176
|
-
const actionGroupItemCss = "ch-action-group-item[floating]{
|
|
176
|
+
const actionGroupItemCss = "ch-action-group-item[floating]{visibility:hidden}";
|
|
177
177
|
|
|
178
178
|
const ChActionGroupItem = class {
|
|
179
179
|
constructor(hostRef) {
|
|
180
180
|
index.registerInstance(this, hostRef);
|
|
181
|
-
/**
|
|
182
|
-
* `true` to ignore the floating property value.
|
|
183
|
-
*/
|
|
184
|
-
this.avoidFloating = false;
|
|
185
181
|
/**
|
|
186
182
|
* `true` if the control is floating. Useful to implement the
|
|
187
183
|
* `"ResponsiveCollapse"` value for the `itemsOverflowBehavior` property of
|
|
@@ -190,9 +186,6 @@ const ChActionGroupItem = class {
|
|
|
190
186
|
this.floating = false;
|
|
191
187
|
}
|
|
192
188
|
componentWillLoad() {
|
|
193
|
-
if (this.avoidFloating) {
|
|
194
|
-
return;
|
|
195
|
-
}
|
|
196
189
|
const parentAction = this.el.closest("ch-action-group");
|
|
197
190
|
// Hide items at the start to improve CLS
|
|
198
191
|
if (parentAction) {
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-5a32426a.js');
|
|
6
6
|
const reserverdNames = require('./reserverd-names-1b00889a.js');
|
|
7
7
|
|
|
8
|
-
const checkboxCss = "*,::before,::after{box-sizing:border-box}:host{display:flex;align-items:center;align-self:stretch;outline:unset;touch-action:manipulation;user-select:none}:host(.ch-checkbox--actionable) :is(.input,.label){cursor:pointer}.container{position:relative;width:min(1em, 20px);height:min(1em, 20px);border:1px solid var(--option-border-color, #000);border-radius:18.75%}.container--checked{background-color:var(--option-checked-color, #ffffff00)}.container:focus-within{box-shadow:0 0 1px 1px #00000040}.input{display:flex;width:100%;height:100%;opacity:0;margin:0;padding:0}.option{position:absolute;
|
|
8
|
+
const checkboxCss = "*,::before,::after{box-sizing:border-box}:host{display:flex;align-items:center;align-self:stretch;outline:unset;touch-action:manipulation;user-select:none}:host(.ch-checkbox--actionable) :is(.input,.label){cursor:pointer}.container{position:relative;width:min(1em, 20px);height:min(1em, 20px);border:1px solid var(--option-border-color, #000);border-radius:18.75%}.container--checked{background-color:var(--option-checked-color, #ffffff00)}.container:focus-within{box-shadow:0 0 1px 1px #00000040}.input{display:flex;width:100%;height:100%;opacity:0;margin:0;padding:0}.option{position:absolute;left:50%;top:50%;transform:translate(-50%, -50%);width:50%;height:50%;background-color:#000;opacity:0;pointer-events:none}.option--checked{opacity:1;-webkit-mask:url(\"data:image/svg+xml, %3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' %3E%3Cpath fill='currentColor' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26l2.974 2.99L8 2.193z' /%3E%3C/svg%3E\")}.option--indeterminate{opacity:1}.label{margin-inline-start:min(0.35em, 7px)}";
|
|
9
9
|
|
|
10
10
|
const CHECKBOX_ID = "checkbox";
|
|
11
11
|
const PARTS = (checked, indeterminate) => `${checked ? " checked" : ""}${indeterminate ? " indeterminate" : ""}`;
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-5a32426a.js');
|
|
6
6
|
|
|
7
|
-
const dropdownItemCss = ":where(a,button){all:unset}*,::before,::after{box-sizing:border-box}:host{display:flex;width:100%;height:100%}:host([force-containing-block]){transform:translateX(0);--ch-window-relative-position:true}.action{display:flex;align-items:center;width:100%;height:100%;cursor:pointer;text-align:start}.left-img,.right-img{display:block;width:24px;height:24px;min-width:24px}.content{width:100%}
|
|
7
|
+
const dropdownItemCss = ":where(a,button){all:unset}*,::before,::after{box-sizing:border-box}:host{display:flex;width:100%;height:100%}:host([force-containing-block]){transform:translateX(0);--ch-window-relative-position:true}.action{display:flex;align-items:center;width:100%;height:100%;cursor:pointer;text-align:start}.left-img,.right-img{display:block;width:24px;height:24px;min-width:24px}.content{width:100%}";
|
|
8
8
|
|
|
9
9
|
const DROPDOWN_ITEM = "ch-dropdown-item";
|
|
10
10
|
const ChDropDownItem = class {
|
|
@@ -35,17 +35,17 @@ const ChDropDownItem = class {
|
|
|
35
35
|
*/
|
|
36
36
|
this.position = "Center_OutsideEnd";
|
|
37
37
|
this.dropDownItemContent = () => [
|
|
38
|
-
!!this.leftImgSrc && (index.h("img", { "aria-hidden": "true", class: "left-img", part: "left-img", alt: "", src: this.leftImgSrc, loading: "lazy" })),
|
|
39
|
-
index.h("span", { class: "content", part: "content" }, index.h("slot", null)),
|
|
40
|
-
!!this.rightImgSrc && (index.h("img", { "aria-hidden": "true", class: "right-img", part: "right-img", alt: "", src: this.rightImgSrc, loading: "lazy" }))
|
|
38
|
+
!!this.leftImgSrc && (index.h("img", { slot: "action", "aria-hidden": "true", class: "left-img", part: "left-img", alt: "", src: this.leftImgSrc, loading: "lazy" })),
|
|
39
|
+
index.h("span", { slot: "action", class: "content", part: "content" }, index.h("slot", null)),
|
|
40
|
+
!!this.rightImgSrc && (index.h("img", { slot: "action", "aria-hidden": "true", class: "right-img", part: "right-img", alt: "", src: this.rightImgSrc, loading: "lazy" }))
|
|
41
41
|
];
|
|
42
42
|
this.checkItems = () => {
|
|
43
|
-
this.hasItems = !!this.
|
|
43
|
+
this.hasItems = !!this.el.querySelector(`:scope>${DROPDOWN_ITEM}`);
|
|
44
44
|
};
|
|
45
45
|
this.noItemsRender = () => this.href ? (index.h("a", { class: "action", part: "action target", href: this.href, onClick: this.handleActionClick, onFocus: this.handleFocus, ref: el => (this.mainElement = el) }, this.dropDownItemContent(), index.h("slot", { name: "items", onSlotchange: this.checkItems }))) : (index.h("button", { class: "action", part: "action button", type: "button", onClick: this.handleActionClick, onFocus: this.handleFocus, ref: el => (this.mainElement = el) }, this.dropDownItemContent(), index.h("slot", { name: "items", onSlotchange: this.checkItems })));
|
|
46
|
-
this.itemsRender = () => (index.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 },
|
|
46
|
+
this.itemsRender = () => (index.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(), index.h("slot", { name: "items", slot: "items", onSlotchange: this.checkItems })));
|
|
47
47
|
this.handleActionClick = () => {
|
|
48
|
-
this.actionClick.emit(this.
|
|
48
|
+
this.actionClick.emit(this.el.id);
|
|
49
49
|
};
|
|
50
50
|
this.handleFocus = () => {
|
|
51
51
|
this.focusChange.emit();
|
|
@@ -63,7 +63,7 @@ const ChDropDownItem = class {
|
|
|
63
63
|
render() {
|
|
64
64
|
return (index.h(index.Host, { role: "listitem" }, this.hasItems ? this.itemsRender() : this.noItemsRender()));
|
|
65
65
|
}
|
|
66
|
-
get
|
|
66
|
+
get el() { return index.getElement(this); }
|
|
67
67
|
};
|
|
68
68
|
ChDropDownItem.style = dropdownItemCss;
|
|
69
69
|
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-5a32426a.js');
|
|
6
6
|
|
|
7
|
-
const dropdownCss = ":where(button){all:unset}*,::before,::after{box-sizing:border-box}:host{--separation:0px;--separation-x:var(--separation);--separation-y:var(--separation);display:flex;position:relative;width:100%;height:100%}.expandable-button{display:flex;align-items:center;justify-content:center;position:relative;width:100%;height:100%;cursor:pointer;z-index:108}.expandable-button:focus-within{transition:box-shadow 250ms}::slotted([slot=action]){pointer-events:none}
|
|
7
|
+
const dropdownCss = ":where(button){all:unset}*,::before,::after{box-sizing:border-box}:host{--separation:0px;--separation-x:var(--separation);--separation-y:var(--separation);display:flex;position:relative;width:100%;height:100%}.expandable-button{display:flex;align-items:center;justify-content:center;position:relative;width:100%;height:100%;cursor:pointer;z-index:108}.expandable-button:focus-within{transition:box-shadow 250ms}::slotted([slot=action]){pointer-events:none}ch-window[y-align=outside-start]{--ch-window-separation:var(--separation-y);--ch-window-separation-y:calc(var(--separation-y) * -1)}ch-window[y-align=outside-end]{--ch-window-separation:var(--separation-y);--ch-window-separation-y:var(--separation-y)}ch-window[x-align=outside-start]{--ch-window-separation:var(--separation-x);--ch-window-separation-x:calc(var(--separation-x) * -1)}ch-window[x-align=outside-end]{--ch-window-separation:var(--separation-x);--ch-window-separation-x:var(--separation-x)}.list{display:flex;flex-direction:column}";
|
|
8
8
|
|
|
9
9
|
const mapDropdownAlignToChWindowAlign = {
|
|
10
10
|
OutsideStart: "outside-start",
|
|
@@ -55,6 +55,7 @@ const ChDropDown = class {
|
|
|
55
55
|
};
|
|
56
56
|
this.showHeader = false;
|
|
57
57
|
this.showFooter = false;
|
|
58
|
+
this.firstExpanded = false;
|
|
58
59
|
this.expanded = false;
|
|
59
60
|
this.expandedWithHover = false;
|
|
60
61
|
/**
|
|
@@ -236,22 +237,22 @@ const ChDropDown = class {
|
|
|
236
237
|
const aligns = this.position.split("_");
|
|
237
238
|
const alignX = aligns[0];
|
|
238
239
|
const alignY = aligns[1];
|
|
239
|
-
const hasVerticalPosition = alignY === "OutsideStart" || alignY === "OutsideEnd";
|
|
240
240
|
const xAlignMapping = mapDropdownAlignToChWindowAlign[alignX];
|
|
241
241
|
const yAlignMapping = mapDropdownAlignToChWindowAlign[alignY];
|
|
242
242
|
const isExpanded = this.expanded || this.expandedWithHover;
|
|
243
|
+
this.firstExpanded || (this.firstExpanded = isExpanded);
|
|
243
244
|
return (index.h(index.Host, { onMouseLeave: this.expandBehavior === "ClickOrHover"
|
|
244
245
|
? this.handleMouseLeave
|
|
245
246
|
: undefined }, index.h("button", { id: EXPANDABLE_BUTTON_ID, "aria-controls": SECTION_ID, "aria-expanded": this.expanded.toString(), "aria-haspopup": "true", "aria-label": this.buttonLabel, class: "expandable-button", part: "expandable-button", type: "button", onClick: this.handleButtonClick, onFocus: this.openOnFocus ? this.handleButtonFocus : undefined, onMouseEnter: this.expandBehavior === "ClickOrHover"
|
|
246
247
|
? this.handleMouseEnter
|
|
247
|
-
: undefined, ref: el => (this.expandableButton = el) }, index.h("slot", { name: "action" })),
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
248
|
+
: undefined, ref: el => (this.expandableButton = el) }, index.h("slot", { name: "action" })), index.h("ch-window", { part: "window", exportparts: "window:section,mask,header,footer,separation", container: this.expandableButton, closeOnEscape: true, hidden: !isExpanded, modal: false, showFooter: this.showFooter, showHeader: this.showHeader, showMain: false,
|
|
249
|
+
// Necessary since the separation between the button and the section
|
|
250
|
+
// triggers the onMouseLeave event
|
|
251
|
+
showSeparation: this.expandBehavior === "ClickOrHover", xAlign: xAlignMapping, yAlign: yAlignMapping }, this.firstExpanded && [
|
|
252
|
+
this.showHeader && index.h("slot", { name: "header", slot: "header" }),
|
|
253
|
+
index.h("div", { role: "list", class: "list", part: "list" }, index.h("slot", { name: "items" })),
|
|
254
|
+
this.showFooter && index.h("slot", { name: "footer", slot: "footer" })
|
|
255
|
+
])));
|
|
255
256
|
}
|
|
256
257
|
get el() { return index.getElement(this); }
|
|
257
258
|
static get watchers() { return {
|
|
@@ -55,7 +55,7 @@ const ChTestActionGroup = class {
|
|
|
55
55
|
(this.displayedItemsCount === -1 || index$1 < this.displayedItemsCount) &&
|
|
56
56
|
item.items != null &&
|
|
57
57
|
item.items.map(this.renderItem)));
|
|
58
|
-
this.firstLevelRenderCollapsedItem = (item) => (index.h("ch-dropdown-item", { id: item.id, class: item.class, expandBehavior: this.expandBehavior, href: item.target, leftImgSrc: item.leftIcon, openOnFocus: this.openOnFocus, position: item.responsiveCollapsePosition || "OutsideEnd_InsideStart", rightImgSrc: item.rightIcon }, item.title, item.items != null && item.items.map(this.renderItem)));
|
|
58
|
+
this.firstLevelRenderCollapsedItem = (item) => (index.h("ch-dropdown-item", { slot: "more-items", id: item.id, class: item.class, expandBehavior: this.expandBehavior, href: item.target, leftImgSrc: item.leftIcon, openOnFocus: this.openOnFocus, position: item.responsiveCollapsePosition || "OutsideEnd_InsideStart", rightImgSrc: item.rightIcon }, item.title, item.items != null && item.items.map(this.renderItem)));
|
|
59
59
|
this.handleDisplayedItemsCountChange = (event) => {
|
|
60
60
|
this.displayedItemsCount = event.detail;
|
|
61
61
|
};
|
|
@@ -71,7 +71,7 @@ const ChTestActionGroup = class {
|
|
|
71
71
|
this.itemsModel
|
|
72
72
|
.filter((_, index) => this.displayedItemsCount !== -1 &&
|
|
73
73
|
index >= this.displayedItemsCount)
|
|
74
|
-
.map(
|
|
74
|
+
.map(this.firstLevelRenderCollapsedItem))));
|
|
75
75
|
}
|
|
76
76
|
};
|
|
77
77
|
ChTestActionGroup.style = testActionGroupCss;
|
|
@@ -4,9 +4,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-5a32426a.js');
|
|
6
6
|
|
|
7
|
-
const testTreeXCss = "ch-test-tree-x{display:grid;grid-template-columns:350px max-content;grid-template-rows:1fr;height:100%}
|
|
7
|
+
const testTreeXCss = "ch-test-tree-x{display:grid;grid-template-columns:350px max-content;grid-template-rows:1fr;height:100%}.tree-buttons{display:grid;grid-auto-rows:max-content;row-gap:8px}:not(.ch-tree-x-dragging-item) ch-tree-x-list-item:not([selected])::part(header):hover{background-color:#e8e8e9}.ch-tree-x-list-item--drag-enter{background-color:#eee;box-shadow:inset 0 0 1px 0px black}.ch-tree-x-list-item--drag-enter[selected]::part(header){background-color:#eee}ch-tree-x-list-item::part(header){border:1px solid transparent}ch-tree-x-list-item[selected]::part(header){background-color:#cfdee6;border-color:#0266a0}ch-tree-x-list-item.ch-tree-x-list-item--editing::part(header){background-color:rgba(207, 222, 230, 0.5);border-color:transparent}ch-tree-x-list-item:not(.ch-tree-x-list-item--editing)::part(header):focus-visible{border-color:black;z-index:1}.ch-tree-x-drag-info{padding-inline:6px;padding-block:2px;background-color:#cfdee6;border:1px solid #0266a0;border-radius:10px;font-size:8px}";
|
|
8
8
|
|
|
9
9
|
const DEFAULT_EXPANDED_VALUE = false;
|
|
10
|
+
const DEFAULT_INDETERMINATE_VALUE = false;
|
|
10
11
|
const DEFAULT_LAZY_VALUE = false;
|
|
11
12
|
const DEFAULT_SELECTED_VALUE = false;
|
|
12
13
|
const ChTestTreeX = class {
|
|
@@ -30,18 +31,20 @@ const ChTestTreeX = class {
|
|
|
30
31
|
*/
|
|
31
32
|
this.multiSelection = false;
|
|
32
33
|
/**
|
|
33
|
-
*
|
|
34
|
+
* `true` to display the relation between tree items and tree lists using
|
|
34
35
|
* lines.
|
|
35
36
|
*/
|
|
36
|
-
this.showLines =
|
|
37
|
-
this.
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
37
|
+
this.showLines = "none";
|
|
38
|
+
this.handleDroppableZoneEnter = (event) => {
|
|
39
|
+
const dropInformation = event.detail;
|
|
40
|
+
if (!this.checkDroppableZoneCallback) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const requestTimestamp = new Date().getTime();
|
|
44
|
+
const promise = this.checkDroppableZoneCallback(dropInformation);
|
|
45
|
+
promise.then(validDrop => {
|
|
46
|
+
this.treeRef.updateValidDroppableZone(requestTimestamp, dropInformation.newContainer.id, dropInformation.draggedItems, validDrop);
|
|
47
|
+
});
|
|
45
48
|
};
|
|
46
49
|
this.handleSelectedItemsChange = (event) => {
|
|
47
50
|
const itemsToProcess = new Map(event.detail);
|
|
@@ -68,22 +71,87 @@ const ChTestTreeX = class {
|
|
|
68
71
|
this.selectedItems.add(itemId);
|
|
69
72
|
});
|
|
70
73
|
};
|
|
71
|
-
this.
|
|
72
|
-
|
|
74
|
+
this.handleExpandedItemChange = (event) => {
|
|
75
|
+
const detail = event.detail;
|
|
76
|
+
const itemInfo = this.flattenedTreeModel.get(detail.id).item;
|
|
77
|
+
itemInfo.expanded = detail.expanded;
|
|
78
|
+
};
|
|
79
|
+
this.handleItemsDropped = (event) => {
|
|
80
|
+
const dataTransferInfo = event.detail;
|
|
81
|
+
const newContainer = dataTransferInfo.newContainer;
|
|
82
|
+
const newParentId = newContainer.id;
|
|
83
|
+
// Check if the parent exists in the UI Model
|
|
84
|
+
if (!this.flattenedTreeModel.get(newParentId)) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const draggedItems = dataTransferInfo.draggedItems;
|
|
88
|
+
if (draggedItems.length === 0 || !this.dropItemsCallback) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
const promise = this.dropItemsCallback(dataTransferInfo);
|
|
92
|
+
this.waitDropProcessing = true;
|
|
93
|
+
promise.then(response => {
|
|
94
|
+
this.waitDropProcessing = false;
|
|
95
|
+
if (!response.acceptDrop) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
const newParentUIModel = this.flattenedTreeModel.get(newParentId).item;
|
|
99
|
+
// Only move the items to the new parent, keeping the state
|
|
100
|
+
if (dataTransferInfo.dropInTheSameTree) {
|
|
101
|
+
// Add the UI models to the new container and remove the UI models from
|
|
102
|
+
// the old containers
|
|
103
|
+
draggedItems.forEach(this.moveItemToNewParent(newParentUIModel));
|
|
104
|
+
}
|
|
105
|
+
// Add the new items
|
|
106
|
+
else {
|
|
107
|
+
if (response.items == null) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
// Add new items to the parent
|
|
111
|
+
newParentUIModel.items.push(...response.items);
|
|
112
|
+
// Flatten the new UI models
|
|
113
|
+
response.items.forEach(this.flattenItemUIModel(newParentUIModel));
|
|
114
|
+
}
|
|
115
|
+
this.sortItems(newParentUIModel.items);
|
|
116
|
+
// Open the item to visualize the new subitems
|
|
117
|
+
newParentUIModel.expanded = true;
|
|
118
|
+
// There is no need to force and update, since the waitDropProcessing
|
|
119
|
+
// prop was modified
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
this.moveItemToNewParent = (newParentUIModel) => (dataTransferInfo) => {
|
|
123
|
+
const itemUIModelExtended = this.flattenedTreeModel.get(dataTransferInfo.id);
|
|
124
|
+
const item = itemUIModelExtended.item;
|
|
125
|
+
const oldParentItem = itemUIModelExtended.parentItem;
|
|
126
|
+
// Remove the UI model from the previous parent
|
|
127
|
+
oldParentItem.items.splice(oldParentItem.items.indexOf(item), 1);
|
|
128
|
+
// Add the UI Model to the new parent
|
|
129
|
+
newParentUIModel.items.push(item);
|
|
130
|
+
// Reference the new parent in the item
|
|
131
|
+
itemUIModelExtended.parentItem = newParentUIModel;
|
|
73
132
|
};
|
|
74
|
-
|
|
75
|
-
// this.treeItemsModel = [];
|
|
76
|
-
// };
|
|
77
|
-
this.renderSubModel = (treeSubModel) => (index.h("ch-tree-x-list-item", { id: treeSubModel.id, caption: treeSubModel.caption, checkbox: treeSubModel.checkbox, checked: treeSubModel.checked, class: treeSubModel.class, disabled: treeSubModel.disabled, expanded: treeSubModel.expanded, lazyLoad: treeSubModel.lazy, leaf: treeSubModel.leaf, leftImgSrc: treeSubModel.leftImgSrc, rightImgSrc: treeSubModel.rightImgSrc, selected: treeSubModel.selected, showExpandableButton: treeSubModel.showExpandableButton, toggleCheckboxes: treeSubModel.toggleCheckboxes }, !treeSubModel.leaf &&
|
|
133
|
+
this.renderSubModel = (treeSubModel) => (index.h("ch-tree-x-list-item", { id: treeSubModel.id, caption: treeSubModel.caption, checkbox: treeSubModel.checkbox, checked: treeSubModel.checked, class: treeSubModel.class, disabled: treeSubModel.disabled, expanded: treeSubModel.expanded, indeterminate: treeSubModel.indeterminate, lazyLoad: treeSubModel.lazy, leaf: treeSubModel.leaf, leftImgSrc: treeSubModel.leftImgSrc, metadata: treeSubModel.metadata, rightImgSrc: treeSubModel.rightImgSrc, selected: treeSubModel.selected, showExpandableButton: treeSubModel.showExpandableButton, toggleCheckboxes: treeSubModel.toggleCheckboxes }, !treeSubModel.leaf &&
|
|
78
134
|
treeSubModel.items != null &&
|
|
79
135
|
treeSubModel.items.length !== 0 && (index.h("ch-tree-x-list", { slot: "tree" }, treeSubModel.items.map(this.renderSubModel)))));
|
|
80
|
-
this.
|
|
81
|
-
|
|
82
|
-
this.
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
136
|
+
this.flattenItemUIModel = (parentModel) => (item) => {
|
|
137
|
+
var _a, _b, _c, _d;
|
|
138
|
+
this.flattenedTreeModel.set(item.id, {
|
|
139
|
+
parentItem: parentModel,
|
|
140
|
+
item: item
|
|
141
|
+
});
|
|
142
|
+
// Make sure the properties are with their default values to avoid issues
|
|
143
|
+
// when reusing DOM nodes
|
|
144
|
+
(_a = item.expanded) !== null && _a !== void 0 ? _a : (item.expanded = DEFAULT_EXPANDED_VALUE);
|
|
145
|
+
(_b = item.indeterminate) !== null && _b !== void 0 ? _b : (item.indeterminate = DEFAULT_INDETERMINATE_VALUE);
|
|
146
|
+
(_c = item.lazy) !== null && _c !== void 0 ? _c : (item.lazy = DEFAULT_LAZY_VALUE);
|
|
147
|
+
(_d = item.selected) !== null && _d !== void 0 ? _d : (item.selected = DEFAULT_SELECTED_VALUE);
|
|
148
|
+
if (item.lazy) {
|
|
149
|
+
this.flattenedLazyTreeModel.set(item.id, item);
|
|
150
|
+
}
|
|
151
|
+
if (item.selected) {
|
|
152
|
+
this.selectedItems.add(item.id);
|
|
153
|
+
}
|
|
154
|
+
this.flattenSubModel(item);
|
|
87
155
|
};
|
|
88
156
|
}
|
|
89
157
|
handleTreeModelChange() {
|
|
@@ -112,45 +180,65 @@ const ChTestTreeX = class {
|
|
|
112
180
|
// expand the items, we have to delegate the responsibility to the tree-x
|
|
113
181
|
this.treeRef.scrollIntoVisible(treeItemId);
|
|
114
182
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
183
|
+
/**
|
|
184
|
+
* This method is used to toggle a tree item by the tree item id/ids.
|
|
185
|
+
*
|
|
186
|
+
* @param treeItemIds An array id the tree items to be toggled.
|
|
187
|
+
* @param expand A boolean indicating that the tree item should be expanded or collapsed. (optional)
|
|
188
|
+
* @returns The modified items after the method was called.
|
|
189
|
+
*/
|
|
190
|
+
async toggleItems(treeItemIds, expand) {
|
|
191
|
+
if (!treeItemIds) {
|
|
192
|
+
return [];
|
|
122
193
|
}
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
-
|
|
194
|
+
const modifiedTreeItems = [];
|
|
195
|
+
treeItemIds.forEach(treeItemId => {
|
|
196
|
+
const itemInfo = this.flattenedTreeModel.get(treeItemId).item;
|
|
197
|
+
if (itemInfo) {
|
|
198
|
+
itemInfo.expanded = expand !== null && expand !== void 0 ? expand : !itemInfo.expanded;
|
|
199
|
+
modifiedTreeItems.push({
|
|
200
|
+
id: itemInfo.id,
|
|
201
|
+
expanded: itemInfo.expanded
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
// Force re-render
|
|
206
|
+
index.forceUpdate(this);
|
|
207
|
+
return modifiedTreeItems;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Given a subset of item's properties, it updates all item UI models.
|
|
211
|
+
*/
|
|
212
|
+
async updateAllItemsProperties(properties) {
|
|
213
|
+
[...this.flattenedTreeModel.values()].forEach(itemUIModel => {
|
|
214
|
+
if (properties.expanded != null) {
|
|
215
|
+
itemUIModel.item.expanded = properties.expanded;
|
|
216
|
+
}
|
|
217
|
+
if (properties.checked != null) {
|
|
218
|
+
itemUIModel.item.checked = properties.checked;
|
|
219
|
+
itemUIModel.item.indeterminate = false;
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
index.forceUpdate(this);
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Given a item list and the properties to update, it updates the properties
|
|
226
|
+
* of the items in the list.
|
|
227
|
+
*/
|
|
228
|
+
async updateItemsProperties(items, properties) {
|
|
229
|
+
items.forEach(item => {
|
|
230
|
+
const itemUIModel = this.flattenedTreeModel.get(item);
|
|
231
|
+
this.updateItemProperty(itemUIModel, properties);
|
|
232
|
+
});
|
|
233
|
+
index.forceUpdate(this);
|
|
234
|
+
}
|
|
235
|
+
updateItemProperty(itemUIModel, properties) {
|
|
236
|
+
if (!itemUIModel) {
|
|
126
237
|
return;
|
|
127
238
|
}
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
this.waitDropProcessing = false;
|
|
132
|
-
if (!acceptDrop) {
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
|
-
const newParentItem = this.flattenedTreeModel.get(dropItemId).item;
|
|
136
|
-
// Add the UI models to the new container and remove the UI models from
|
|
137
|
-
// the old containers
|
|
138
|
-
draggedIds.forEach(itemId => {
|
|
139
|
-
const itemUIModelExtended = this.flattenedTreeModel.get(itemId);
|
|
140
|
-
const item = itemUIModelExtended.item;
|
|
141
|
-
const oldParentItem = itemUIModelExtended.parentItem;
|
|
142
|
-
// Remove the UI model from the previous parent
|
|
143
|
-
oldParentItem.items.splice(oldParentItem.items.indexOf(item), 1);
|
|
144
|
-
// Add the UI Model to the new parent
|
|
145
|
-
newParentItem.items.push(item);
|
|
146
|
-
// Reference the new parent in the item
|
|
147
|
-
itemUIModelExtended.parentItem = newParentItem;
|
|
148
|
-
});
|
|
149
|
-
this.sortItems(newParentItem.items);
|
|
150
|
-
// Open the item to visualize the new subitems
|
|
151
|
-
newParentItem.expanded = true;
|
|
152
|
-
// There is no need to force and update, since the waitDropProcessing
|
|
153
|
-
// prop was modified
|
|
239
|
+
const itemInfo = itemUIModel.item;
|
|
240
|
+
Object.keys(properties).forEach(propertyName => {
|
|
241
|
+
itemInfo[propertyName] = properties[propertyName];
|
|
154
242
|
});
|
|
155
243
|
}
|
|
156
244
|
loadLazyChildrenHandler(event) {
|
|
@@ -220,25 +308,7 @@ const ChTestTreeX = class {
|
|
|
220
308
|
return;
|
|
221
309
|
}
|
|
222
310
|
this.sortItems(items);
|
|
223
|
-
items.forEach(
|
|
224
|
-
var _a, _b, _c;
|
|
225
|
-
this.flattenedTreeModel.set(item.id, {
|
|
226
|
-
parentItem: model,
|
|
227
|
-
item: item
|
|
228
|
-
});
|
|
229
|
-
// Make sure the properties are with their default values to avoid issues
|
|
230
|
-
// when reusing DOM nodes
|
|
231
|
-
(_a = item.expanded) !== null && _a !== void 0 ? _a : (item.expanded = DEFAULT_EXPANDED_VALUE);
|
|
232
|
-
(_b = item.lazy) !== null && _b !== void 0 ? _b : (item.lazy = DEFAULT_LAZY_VALUE);
|
|
233
|
-
(_c = item.selected) !== null && _c !== void 0 ? _c : (item.selected = DEFAULT_SELECTED_VALUE);
|
|
234
|
-
if (item.lazy) {
|
|
235
|
-
this.flattenedLazyTreeModel.set(item.id, item);
|
|
236
|
-
}
|
|
237
|
-
if (item.selected) {
|
|
238
|
-
this.selectedItems.add(item.id);
|
|
239
|
-
}
|
|
240
|
-
this.flattenSubModel(item);
|
|
241
|
-
});
|
|
311
|
+
items.forEach(this.flattenItemUIModel(model));
|
|
242
312
|
}
|
|
243
313
|
sortItems(items) {
|
|
244
314
|
// Ensure that items are sorted
|
|
@@ -255,7 +325,7 @@ const ChTestTreeX = class {
|
|
|
255
325
|
this.flattenModel();
|
|
256
326
|
}
|
|
257
327
|
render() {
|
|
258
|
-
return (index.h(index.Host, null, index.h("
|
|
328
|
+
return (index.h(index.Host, null, index.h("ch-tree-x", { multiSelection: this.multiSelection, showLines: this.showLines, waitDropProcessing: this.waitDropProcessing, onDroppableZoneEnter: this.handleDroppableZoneEnter, onExpandedItemChange: this.handleExpandedItemChange, onItemsDropped: this.handleItemsDropped, onSelectedItemsChange: this.handleSelectedItemsChange, ref: el => (this.treeRef = el) }, index.h("ch-tree-x-list", null, this.treeModel.items.map(this.renderSubModel))), index.h("div", { class: "tree-buttons" })));
|
|
259
329
|
}
|
|
260
330
|
static get watchers() { return {
|
|
261
331
|
"treeModel": ["handleTreeModelChange"]
|