@genexus/genexus-ide-ui 0.0.62 → 0.0.63
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-tree-x_3.cjs.entry.js → ch-checkbox_4.cjs.entry.js} +277 -71
- package/dist/cjs/ch-next-data-modeling-render.cjs.entry.js +242 -0
- package/dist/cjs/{ch-next-data-modeling-item.cjs.entry.js → ch-next-data-modeling_2.cjs.entry.js} +20 -1
- package/dist/cjs/ch-tree-view-render-wrapper.cjs.entry.js +160 -0
- package/dist/cjs/genexus-ide-ui.cjs.js +1 -1
- package/dist/cjs/gx-ide-kb-manager-export.cjs.entry.js +41 -39
- package/dist/cjs/gx-ide-kb-manager-import.cjs.entry.js +23 -11
- package/dist/cjs/gx-ide-test.cjs.entry.js +107 -122
- package/dist/cjs/gxg-color-picker.cjs.entry.js +2 -2
- package/dist/cjs/gxg-title-editable.cjs.entry.js +11 -4
- package/dist/cjs/{gxg-tree_2.cjs.entry.js → gxg-tree-item.cjs.entry.js} +0 -212
- package/dist/cjs/gxg-tree-view.cjs.entry.js +165 -0
- package/dist/cjs/gxg-tree.cjs.entry.js +218 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +5 -3
- package/dist/collection/components/_test/test.css +5 -0
- package/dist/collection/components/_test/test.js +109 -220
- package/dist/collection/components/kb-manager-export/helpers.js +7 -23
- package/dist/collection/components/kb-manager-export/kb-manager-export.css +20 -0
- package/dist/collection/components/kb-manager-export/kb-manager-export.js +42 -22
- package/dist/collection/components/kb-manager-import/gx-ide-assets/kb-manager-import/langs/kb-manager-import.lang.en.json +1 -0
- package/dist/collection/components/kb-manager-import/kb-manager-import.js +23 -11
- package/dist/components/ch-next-data-modeling-item.js +1 -457
- package/dist/components/ch-next-data-modeling-render.js +295 -0
- package/dist/components/ch-next-data-modeling.js +1 -27
- package/dist/components/ch-tree-view-item.js +6 -0
- package/dist/components/ch-tree-view-render-wrapper.js +224 -0
- package/dist/components/ch-tree-view-render.js +6 -0
- package/dist/components/ch-tree-view.js +6 -0
- package/dist/components/gx-ide-kb-manager-export.js +75 -73
- package/dist/components/gx-ide-kb-manager-import.js +38 -20
- package/dist/components/gx-ide-references.js +21 -15
- package/dist/components/gx-ide-test.js +120 -160
- package/dist/components/gxg-color-picker.js +2 -2
- package/dist/components/gxg-title-editable.js +12 -4
- package/dist/components/gxg-tree-item.js +614 -1
- package/dist/components/gxg-tree-view.js +2 -2
- package/dist/components/gxg-tree.js +236 -1
- package/dist/components/index.js +5 -3
- package/dist/components/next-data-modeling-item.js +466 -0
- package/dist/{esm/ch-next-data-modeling.entry.js → components/next-data-modeling.js} +21 -7
- package/dist/components/{tree-x-list-item.js → tree-view-item.js} +9 -9
- package/dist/components/{ch-test-tree-x.js → tree-view-render.js} +168 -28
- package/dist/components/tree-view.js +410 -435
- package/dist/components/tree-view2.js +226 -0
- package/dist/esm/{ch-tree-x_3.entry.js → ch-checkbox_4.entry.js} +275 -70
- package/dist/esm/ch-next-data-modeling-render.entry.js +238 -0
- package/dist/esm/{ch-next-data-modeling-item.entry.js → ch-next-data-modeling_2.entry.js} +21 -3
- package/dist/esm/ch-tree-view-render-wrapper.entry.js +156 -0
- package/dist/esm/genexus-ide-ui.js +1 -1
- package/dist/esm/gx-ide-kb-manager-export.entry.js +41 -39
- package/dist/esm/gx-ide-kb-manager-import.entry.js +23 -11
- package/dist/esm/gx-ide-test.entry.js +108 -123
- package/dist/esm/gxg-color-picker.entry.js +2 -2
- package/dist/esm/gxg-title-editable.entry.js +11 -4
- package/dist/{components/gxg-tree-item2.js → esm/gxg-tree-item.entry.js} +9 -79
- package/dist/esm/gxg-tree-view.entry.js +161 -0
- package/dist/{components/gxg-tree2.js → esm/gxg-tree.entry.js} +8 -32
- 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/kb-manager-import/langs/kb-manager-import.lang.en.json +1 -0
- package/dist/genexus-ide-ui/p-13177896.entry.js +1 -0
- package/dist/genexus-ide-ui/p-19fef562.entry.js +1 -0
- package/dist/genexus-ide-ui/p-2781b92a.entry.js +1 -0
- package/dist/genexus-ide-ui/p-2c17e71d.entry.js +1 -0
- package/dist/genexus-ide-ui/p-40a57a36.entry.js +1 -0
- package/dist/genexus-ide-ui/p-636d02fa.entry.js +1 -0
- package/dist/genexus-ide-ui/p-7b63be93.entry.js +1 -0
- package/dist/genexus-ide-ui/p-8a7c4561.entry.js +1 -0
- package/dist/genexus-ide-ui/p-a2cb0e6b.entry.js +1 -0
- package/dist/genexus-ide-ui/p-a9c8b373.entry.js +1 -0
- package/dist/genexus-ide-ui/p-b819706e.entry.js +1 -0
- package/dist/genexus-ide-ui/p-bacd879c.entry.js +1 -0
- package/dist/node_modules/@genexus/chameleon-controls-library/dist/collection/components/next/data-modeling-render/next-data-modeling-render.css +3 -0
- package/dist/node_modules/@genexus/chameleon-controls-library/dist/collection/components/renders/tree-view/tree-view-render.css +3 -0
- package/dist/node_modules/@genexus/chameleon-controls-library/dist/collection/components/test/test-tree-view/tree-view-render-wrapper.css +0 -0
- package/dist/node_modules/@genexus/chameleon-controls-library/dist/collection/components/tree-view/tree-view/tree-view.css +45 -0
- package/dist/node_modules/@genexus/gemini/dist/collection/components/title-editable/title-editable.css +17 -3
- package/dist/node_modules/@genexus/gemini/dist/collection/components/tree-view/tree-view.css +5 -2
- package/dist/types/common/helpers.d.ts +2 -2
- package/dist/types/components/_test/test.d.ts +3 -35
- package/dist/types/components/kb-manager-export/helpers.d.ts +4 -4
- package/dist/types/components/kb-manager-export/kb-manager-export.d.ts +10 -5
- package/dist/types/components/kb-manager-import/helpers.d.ts +3 -3
- package/dist/types/components/kb-manager-import/kb-manager-import.d.ts +7 -6
- package/dist/types/components/references/helpers.d.ts +2 -2
- package/dist/types/components/references/references.d.ts +3 -3
- package/dist/types/components.d.ts +3 -60
- package/package.json +3 -3
- package/dist/cjs/ch-checkbox.cjs.entry.js +0 -93
- package/dist/cjs/ch-next-data-modeling.cjs.entry.js +0 -19
- package/dist/cjs/ch-test-tree-x.cjs.entry.js +0 -458
- package/dist/components/ch-tree-x-list-item.js +0 -6
- package/dist/components/ch-tree-x.js +0 -6
- package/dist/components/tree-x.js +0 -504
- package/dist/esm/ch-checkbox.entry.js +0 -89
- package/dist/esm/ch-test-tree-x.entry.js +0 -454
- package/dist/esm/gxg-tree_2.entry.js +0 -757
- package/dist/genexus-ide-ui/p-092ccacd.entry.js +0 -1
- package/dist/genexus-ide-ui/p-1ad68b23.entry.js +0 -3
- package/dist/genexus-ide-ui/p-3442d19a.entry.js +0 -1
- package/dist/genexus-ide-ui/p-39968306.entry.js +0 -1
- package/dist/genexus-ide-ui/p-5755f985.entry.js +0 -1
- package/dist/genexus-ide-ui/p-85597097.entry.js +0 -1
- package/dist/genexus-ide-ui/p-9e530c7d.entry.js +0 -1
- package/dist/genexus-ide-ui/p-ad5040e4.entry.js +0 -1
- package/dist/genexus-ide-ui/p-aeb3b032.entry.js +0 -1
- package/dist/genexus-ide-ui/p-c53522c9.entry.js +0 -1
- package/dist/genexus-ide-ui/p-d104f9a4.entry.js +0 -1
- package/dist/node_modules/@genexus/chameleon-controls-library/dist/collection/components/test/test-tree-x.css +0 -3
- package/dist/node_modules/@genexus/chameleon-controls-library/dist/collection/components/tree-view/tree-x/tree-x.css +0 -45
- /package/dist/node_modules/@genexus/chameleon-controls-library/dist/collection/components/tree-view/{tree-x-list-item/tree-x-list-item.css → tree-view-item/tree-view-item.css} +0 -0
|
@@ -1,343 +1,293 @@
|
|
|
1
|
-
import { proxyCustomElement, HTMLElement, createEvent,
|
|
2
|
-
import {
|
|
3
|
-
import { d as defineCustomElement$2 } from './tree-x.js';
|
|
4
|
-
import { d as defineCustomElement$1 } from './tree-x-list-item.js';
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { f as focusComposedPath, m as mouseEventModifierKey } from './helpers.js';
|
|
5
3
|
|
|
6
|
-
const
|
|
4
|
+
const scrollToEdge = (event, container, scrollSpeed, scrollThreshold) => {
|
|
5
|
+
const mousePositionY = event.clientY - container.getBoundingClientRect().top;
|
|
6
|
+
const containerHeight = container.clientHeight;
|
|
7
|
+
const mouseAtTheTop = mousePositionY <= scrollThreshold;
|
|
8
|
+
const mouseAtTheBottom = mousePositionY > containerHeight - scrollThreshold;
|
|
9
|
+
if (mouseAtTheTop || mouseAtTheBottom) {
|
|
10
|
+
const scrollAmount = mouseAtTheTop
|
|
11
|
+
? mousePositionY - scrollThreshold
|
|
12
|
+
: mousePositionY - (containerHeight - scrollThreshold);
|
|
13
|
+
// Adjust container scroll position
|
|
14
|
+
container.scrollTop += scrollAmount / scrollSpeed;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
7
17
|
|
|
8
|
-
const treeViewCss = ":root{--ui-animaton-speed:0.2s}.gxg-title-01{font-family:var(--font-family-primary);font-weight:var(--font-weight-bold);font-size:var(--font-size-md);letter-spacing:var(--letter-spacing-md);color:var(--color-on-background);text-align:start;line-height:1.455em}.gxg-title-01--negative{font-family:var(--font-family-primary);font-weight:var(--font-weight-bold);font-size:var(--font-size-md);letter-spacing:var(--letter-spacing-md);color:var(--color-on-background);text-align:start;line-height:1.455em;color:var(--color-on-primary)}.gxg-title-02{font-family:var(--font-family-primary);font-weight:var(--font-weight-bold);font-size:var(--font-size-sm);letter-spacing:var(--letter-spacing-sm);color:var(--color-on-background);text-align:start;text-transform:uppercase;line-height:1.556em}.gxg-title-02--negative{font-family:var(--font-family-primary);font-weight:var(--font-weight-bold);font-size:var(--font-size-sm);letter-spacing:var(--letter-spacing-sm);color:var(--color-on-background);text-align:start;text-transform:uppercase;line-height:1.556em;color:var(--color-on-primary)}.gxg-title-03{font-family:var(--font-family-primary);font-weight:var(--font-weight-regular);font-size:var(--font-size-xs);letter-spacing:var(--letter-spacing-sm);color:var(--color-on-background);text-align:start;text-transform:uppercase;line-height:1.556em}.gxg-title-03--negative{font-family:var(--font-family-primary);font-weight:var(--font-weight-regular);font-size:var(--font-size-xs);letter-spacing:var(--letter-spacing-sm);color:var(--color-on-background);text-align:start;text-transform:uppercase;line-height:1.556em;color:var(--color-on-primary)}.gxg-title-04{font-family:var(--font-family-primary);font-weight:var(--font-weight-semibold);font-size:var(--font-size-md);letter-spacing:var(--letter-spacing-md);color:var(--color-on-background);text-align:start;line-height:1.455em}.gxg-title-04--negative{font-family:var(--font-family-primary);font-weight:var(--font-weight-semibold);font-size:var(--font-size-md);letter-spacing:var(--letter-spacing-md);color:var(--color-on-background);text-align:start;line-height:1.455em;color:var(--color-on-primary)}.gxg-title-05{font-family:var(--font-family-primary);font-weight:var(--font-weight-semibold);font-size:var(--font-size-sm);letter-spacing:var(--letter-spacing-sm);color:var(--color-on-background);text-align:start;line-height:1.556em}.gxg-title-05--negative{font-family:var(--font-family-primary);font-weight:var(--font-weight-semibold);font-size:var(--font-size-sm);letter-spacing:var(--letter-spacing-sm);color:var(--color-on-background);text-align:start;line-height:1.556em;color:var(--color-on-primary)}.gxg-text{font-family:var(--font-family-primary);font-weight:var(--font-weight-regular);font-size:var(--font-size-sm);letter-spacing:var(--letter-spacing-xs);color:var(--color-on-background);text-align:start;line-height:1.455em}.gxg-text--negative{font-family:var(--font-family-primary);font-weight:var(--font-weight-regular);font-size:var(--font-size-sm);letter-spacing:var(--letter-spacing-xs);color:var(--color-on-background);text-align:start;line-height:1.455em;color:var(--color-on-primary)}.gxg-text--gray{font-family:var(--font-family-primary);font-weight:var(--font-weight-regular);font-size:var(--font-size-sm);letter-spacing:var(--letter-spacing-xs);color:var(--color-on-background);text-align:start;line-height:1.455em;color:var(--gray-05)}.gxg-quote{font-family:var(--font-family-primary);font-weight:var(--font-weight-regular);font-size:var(--font-size-sm);letter-spacing:var(--letter-spacing-xs);color:var(--color-on-background);text-align:start;line-height:1.455em;font-style:italic}.gxg-quote--negative{color:var(--color-on-primary)}.gxg-link{font-family:var(--font-family-primary);font-weight:var(--font-weight-regular);font-size:var(--font-size-sm);letter-spacing:var(--letter-spacing-xs);color:var(--color-on-background);text-align:start;line-height:1.455em;color:var(--color-primary);text-decoration:underline;cursor:pointer;display:inline-block}.gxg-link:hover{color:var(--color-primary-hover)}.gxg-link:active{color:var(--color-primary-active)}.gxg-link-gray{font-family:var(--font-family-primary);font-weight:var(--font-weight-regular);font-size:var(--font-size-sm);letter-spacing:var(--letter-spacing-xs);color:var(--color-on-background);text-align:start;line-height:1.455em;color:var(--color-primary);text-decoration:underline;cursor:pointer;display:inline-block;color:var(--gray-04)}.gxg-link-gray:hover{font-family:var(--font-family-primary);font-weight:var(--font-weight-regular);font-size:var(--font-size-sm);letter-spacing:var(--letter-spacing-xs);color:var(--color-on-background);text-align:start;line-height:1.455em;color:var(--color-primary);text-decoration:underline;cursor:pointer;display:inline-block;color:var(--gray-04);color:var(--gray-06)}.gxg-alert-error{font-family:var(--font-family-primary);font-weight:var(--font-weight-regular);font-size:var(--font-size-sm);letter-spacing:var(--letter-spacing-xs);color:var(--color-on-background);text-align:start;line-height:1.455em;color:var(--color-error-dark);display:inline-block}.gxg-alert-warning{font-family:var(--font-family-primary);font-weight:var(--font-weight-regular);font-size:var(--font-size-sm);letter-spacing:var(--letter-spacing-xs);color:var(--color-on-background);text-align:start;line-height:1.455em;color:var(--color-warning-dark);display:inline-block}.gxg-alert-success{font-family:var(--font-family-primary);font-weight:var(--font-weight-regular);font-size:var(--font-size-sm);letter-spacing:var(--letter-spacing-xs);color:var(--color-on-background);text-align:start;line-height:1.455em;color:var(--color-success-dark);display:inline-block}.gxg-tab--disabled{color:var(--color-primary-disabled);pointer-events:none}.gxg-tab--disabled[disabled]{color:var(--color-primary-disabled);pointer-events:none}.gxg-label{font-family:var(--font-family-primary) !important;font-weight:var(--font-weight-semibold);font-size:var(--font-size-sm) !important;letter-spacing:var(--letter-spacing-xs);color:var(--color-primary-enabled);text-align:center;line-height:1.455em}.gxg-label:hover{color:var(--color-primary-hover)}.gxg-label:focus{color:var(--color-primary-active)}.gxg-label:active{color:var(--color-primary-active)}.gxg-label[disabled]{color:var(--color-primary-disabled)}.gxg-label--negative{color:var(--color-on-primary)}.gxg-label--negative[disabled]{color:var(--color-on-disabled)}.gxg-button-styles{font-family:var(--font-family-primary) !important;font-weight:var(--font-weight-semibold);font-size:var(--font-size-sm) !important;letter-spacing:var(--letter-spacing-xs);color:var(--color-primary-enabled);text-align:center;line-height:1.455em}.gxg-scrollbar{}.gxg-scrollbar::-webkit-scrollbar{width:var(--gxg-scrollbar-width, 6px)}.gxg-scrollbar::-webkit-scrollbar-track{background-color:var(--gxg-scrollbar-track-background, --gray-02);border-radius:var(--gxg-scrollbar-track-border-radius, 10px)}.gxg-scrollbar::-webkit-scrollbar-thumb{background:var(--gxg-scrollbar-track-thumb-background, --gray-05);border-radius:var(--gxg-scrollbar-track-thumb-radius, 10px)}.gxg-scrollbar::-webkit-scrollbar-thumb:hover{background:var(--gxg-scrollbar-track-thumb-hover-background, --gray-04);cursor:pointer}gxg-tree-view{font-family:var(--font-family-primary);font-size:var(--font-size-lg);font-weight:var(--font-weight-regular);color:var(--color-on-background);display:contents}.tree-view{}.tree-view::-webkit-scrollbar{width:var(--gxg-scrollbar-width, 6px)}.tree-view::-webkit-scrollbar-track{background-color:var(--gxg-scrollbar-track-background, --gray-02);border-radius:var(--gxg-scrollbar-track-border-radius, 10px)}.tree-view::-webkit-scrollbar-thumb{background:var(--gxg-scrollbar-track-thumb-background, --gray-05);border-radius:var(--gxg-scrollbar-track-thumb-radius, 10px)}.tree-view::-webkit-scrollbar-thumb:hover{background:var(--gxg-scrollbar-track-thumb-hover-background, --gray-04);cursor:pointer}.tree-view-item{--checkbox-size:var(--gxg-checkbox-size);--expandable-button-width:var(--spacing-comp-04);}.tree-view-item::part(dashed-line){border-color:var(--gray-02)}.tree-view-item::part(header){padding-inline-end:calc(var(--spacing-comp-02) * 0.65);height:var(--spacing-comp-05);display:flex;gap:5px}.tree-view-item::part(header):first-child{margin-inline-start:var(--spacing-comp-01)}.tree-view-item::part(header):before{content:\"\";display:block}.tree-view-item::part(header):hover{background-color:var(--gxg-background-color--hover);color:var(--gxg-color--hover)}.tree-view-item::part(header):focus{outline:var(--border-width-md) solid var(--gxg-border-color--focused);outline-offset:-2px}.tree-view-item[selected]::part(header){background-color:var(--gxg-background-color--selected)}.tree-view-item[selected]::part(header):hover{background-color:var(--gxg-background-color--selected-hover)}.tree-view-item::part(expandable-button){background-color:var(--gray-00);margin-inline-end:0}.tree-view-item::part(expandable-button)::before{background-color:var(--gray-04);-webkit-mask-position:center;-webkit-mask-repeat:no-repeat}.tree-view-item::part(expandable-button):hover{background-color:var(--color-background)}.tree-view-item::part(expandable-button):focus{outline:var(--border-width-md) solid var(--gxg-border-color--focused);outline-offset:0}.tree-view-item::part(action){text-transform:capitalize;display:flex;gap:var(--spacing-comp-01)}.tree-view-item::part(left-img){width:var(--spacing-comp-04);height:var(--spacing-comp-04);margin-inline-end:0}.tree-view-item::part(downloading){width:var(--spacing-comp-03);height:var(--spacing-comp-03);border:var(--border-width-md) solid var(--color-primary-enabled);border-inline-start-color:transparent}.tree-view-item::part(checkbox__container){border-color:var(--gray-04);background-color:var(--color-background)}.tree-view-item::part(checkbox__container):after{content:\"\";position:absolute;display:block;border:solid;border-color:transparent;z-index:0}.tree-view-item::part(checkbox__container):focus-within{box-shadow:none;outline:var(--border-width-md) solid var(--gxg-border-color--focused);outline-offset:-2px}.tree-view-item::part(checkbox){margin-inline-end:0}.tree-view-item::part(checkbox__option){display:none}.tree-view-item::part(checkbox__container checkbox__checked):after{left:5.5px;top:3px;width:4px;height:7px;border-width:0 2px 2px 0;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);border-color:var(--color-primary-active);transition-property:border-color;transition-duration:var(--ui-animaton-speed);transition-timing-function:ease}.tree-view-item::part(checkbox__container checkbox__indeterminate):after{left:50%;top:50%;width:8px;height:1.5px;border:0;background-color:var(--color-primary-active);-webkit-transform:rotate(0) translateY(-50%) translateX(-50%);-ms-transform:rotate(0) translateY(-50%) translateX(-50%);transform:rotate(0) translateY(-50%) translateX(-50%)}.tree-view-item::part(checkbox__input){position:relative;z-index:1}.tree-view-item--folder::part(action)::before,.tree-view-item--module::part(action)::before{grid-area:left-img;content:\"\";width:14px;height:14px;margin-inline-end:4px;background-repeat:no-repeat}.tree-view-item--folder::part(action)::before{background-image:url(\"/build/icon-assets/objects/folder.svg\")}.tree-view-item--folder::part(action expanded)::before{background-image:url(\"/build/icon-assets/objects/folder-open.svg\")}.tree-view-item--module::part(action)::before{background-image:url(\"/build/icon-assets/objects/module.svg\")}.tree-view-item--module::part(action expanded)::before{background-image:url(\"/build/icon-assets/objects/module-open.svg\")}.tree-view-item--pending-commit::part(action)::before{content:\"\";position:relative;z-index:1;grid-area:left-img;width:5px;height:5px;align-self:end;margin-block-end:3px;margin-inline-start:1px;background-color:var(--color-primary-enabled);border-radius:50%}.ch-tree-x-list-item--editing::part(header){border:2px solid transparent}.ch-tree-x-list-item .ch-tree-x-drag-info{padding-inline:6px;padding-block:2px;background-color:#cfdee6;border:1px solid #0266a0;border-radius:10px;font-size:8px}";
|
|
18
|
+
const treeViewCss = "ch-tree-view{display:flex;position:relative;width:100%;overflow:auto}ch-tree-view>.ch-tree-view-container{position:absolute;inset:0}ch-tree-view.ch-tree-view-dragging-item ch-tree-view-item{pointer-events:var(--ch-tree-view-pointer-events, all)}ch-tree-view.ch-tree-view-dragging-item .ch-tree-view-list-item--deny-drop{pointer-events:none}ch-tree-view.ch-tree-view--dragging-selected-items ch-tree-view-item[selected]{--ch-tree-view-pointer-events:none}ch-tree-view.ch-tree-view-waiting-drop-processing{cursor:wait}ch-tree-view.ch-tree-view-waiting-drop-processing>.ch-tree-view-container{pointer-events:none}.ch-tree-view-drag-info{--rtl-offset:16px;position:fixed;left:0;top:0;transform:translate(calc(var(--ch-tree-view-dragging-item-x) + var(--rtl-offset)), calc(var(--ch-tree-view-dragging-item-y) + 8px));pointer-events:none;z-index:1;animation:ch-tree-view-drag-info-fade-in 10ms}@keyframes ch-tree-view-drag-info-fade-in{0%,100%{opacity:0}}html[dir=rtl] .ch-tree-view-drag-info{--rtl-offset:-100%}";
|
|
9
19
|
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
+
const TREE_ITEM_TAG_NAME = "ch-tree-view-item";
|
|
21
|
+
const TREE_TAG_NAME = "ch-tree-view";
|
|
22
|
+
// Selectors
|
|
23
|
+
// const CHECKED_ITEMS = `${TREE_ITEM_TAG_NAME}[checked]`;
|
|
24
|
+
const TEXT_FORMAT = "text/plain";
|
|
25
|
+
const ARROW_DOWN_KEY = "ArrowDown";
|
|
26
|
+
const ARROW_UP_KEY = "ArrowUp";
|
|
27
|
+
const EDIT_KEY = "F2";
|
|
28
|
+
const isTreeItem = (element) => element.tagName.toLowerCase() === TREE_ITEM_TAG_NAME;
|
|
29
|
+
const getFocusedTreeItem = () => focusComposedPath().find(isTreeItem);
|
|
30
|
+
const canMoveTreeItemFocus = (treeItem) => treeItem && !treeItem.editing;
|
|
31
|
+
const getDroppableZoneKey = (newContainerId, draggedItems) => `"newContainerId":"${newContainerId}","metadata":"${JSON.stringify(draggedItems)}"`;
|
|
32
|
+
const POSITION_X_DRAG_CUSTOM_VAR = "--ch-tree-view-dragging-item-x";
|
|
33
|
+
const POSITION_Y_DRAG_CUSTOM_VAR = "--ch-tree-view-dragging-item-y";
|
|
34
|
+
const ChTreeView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
20
35
|
constructor() {
|
|
21
36
|
super();
|
|
22
37
|
this.__registerHost();
|
|
23
|
-
this.
|
|
38
|
+
this.droppableZoneEnter = createEvent(this, "droppableZoneEnter", 7);
|
|
39
|
+
this.expandedItemChange = createEvent(this, "expandedItemChange", 7);
|
|
24
40
|
this.itemContextmenu = createEvent(this, "itemContextmenu", 7);
|
|
25
|
-
this.
|
|
41
|
+
this.itemsDropped = createEvent(this, "itemsDropped", 7);
|
|
26
42
|
this.selectedItemsChange = createEvent(this, "selectedItemsChange", 7);
|
|
27
|
-
//
|
|
28
|
-
this.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
this.
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
* items by default. If `true`, the items can't be dragged.
|
|
58
|
-
*/
|
|
59
|
-
this.dragDisabled = DEFAULT_DRAG_DISABLED_VALUE;
|
|
60
|
-
/**
|
|
61
|
-
* This attribute lets you specify if the drop operation is disabled in all
|
|
62
|
-
* items by default. If `true`, the items won't accept any drops.
|
|
63
|
-
*/
|
|
64
|
-
this.dropDisabled = DEFAULT_DROP_DISABLED_VALUE;
|
|
43
|
+
// @todo TODO: Check if key codes works in Safari
|
|
44
|
+
this.keyDownEvents = {
|
|
45
|
+
[ARROW_DOWN_KEY]: event => {
|
|
46
|
+
const treeItem = getFocusedTreeItem();
|
|
47
|
+
if (!canMoveTreeItemFocus(treeItem)) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
event.preventDefault();
|
|
51
|
+
treeItem.focusNextItem(mouseEventModifierKey(event));
|
|
52
|
+
},
|
|
53
|
+
[ARROW_UP_KEY]: event => {
|
|
54
|
+
const treeItem = getFocusedTreeItem();
|
|
55
|
+
if (!canMoveTreeItemFocus(treeItem)) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
event.preventDefault();
|
|
59
|
+
treeItem.focusPreviousItem(mouseEventModifierKey(event));
|
|
60
|
+
},
|
|
61
|
+
[EDIT_KEY]: event => {
|
|
62
|
+
const treeItem = getFocusedTreeItem();
|
|
63
|
+
if (!treeItem || !treeItem.editable) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
event.preventDefault();
|
|
67
|
+
treeItem.editing = true;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
this.draggingSelectedItems = false;
|
|
71
|
+
this.needForRAF = true; // To prevent redundant RAF (request animation frame) calls
|
|
72
|
+
this.selectedItemsInfo = new Map();
|
|
65
73
|
/**
|
|
66
|
-
*
|
|
67
|
-
*
|
|
74
|
+
* Cache to avoid duplicate requests when checking the droppable zone in the
|
|
75
|
+
* same drag event.
|
|
68
76
|
*/
|
|
69
|
-
this.
|
|
77
|
+
this.validDroppableZoneCache = new Map();
|
|
78
|
+
this.draggedIds = [];
|
|
79
|
+
this.draggedParentIds = [];
|
|
80
|
+
this.draggingInTheDocument = false;
|
|
81
|
+
this.draggingInTree = false;
|
|
70
82
|
/**
|
|
71
83
|
* Set this attribute if you want to allow multi selection of the items.
|
|
72
84
|
*/
|
|
73
85
|
this.multiSelection = false;
|
|
74
86
|
/**
|
|
75
|
-
*
|
|
76
|
-
*
|
|
87
|
+
* This property lets you specify the time (in ms) that the mouse must be
|
|
88
|
+
* over in a subtree to open it when dragging.
|
|
77
89
|
*/
|
|
78
|
-
this.
|
|
90
|
+
this.openSubTreeCountdown = 750;
|
|
79
91
|
/**
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
* the parent item checkbox is unchecked.
|
|
83
|
-
* This attribute will be used in all items by default.
|
|
92
|
+
* `true` to scroll in the tree when dragging an item near the edges of the
|
|
93
|
+
* tree.
|
|
84
94
|
*/
|
|
85
|
-
this.
|
|
95
|
+
this.scrollToEdgeOnDrag = true;
|
|
86
96
|
/**
|
|
87
|
-
* This property lets you
|
|
97
|
+
* This property lets you specify if the tree is waiting to process the drop
|
|
98
|
+
* of items.
|
|
88
99
|
*/
|
|
89
|
-
this.
|
|
90
|
-
this.
|
|
91
|
-
|
|
100
|
+
this.waitDropProcessing = false;
|
|
101
|
+
this.trackItemDrag = (event) => {
|
|
102
|
+
event.preventDefault();
|
|
103
|
+
this.lastDragEvent = event;
|
|
104
|
+
this.updateDropEffect(event);
|
|
105
|
+
if (!this.needForRAF) {
|
|
92
106
|
return;
|
|
93
107
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
promise.then((validDrop) => {
|
|
100
|
-
this.updateValidDropZone(requestTimestamp, dropInformation.newContainer.id, dropInformation.draggedItems, validDrop);
|
|
108
|
+
this.needForRAF = false; // No need to call RAF up until next frame
|
|
109
|
+
requestAnimationFrame(() => {
|
|
110
|
+
this.needForRAF = true; // RAF now consumes the movement instruction so a new one can come
|
|
111
|
+
this.el.style.setProperty(POSITION_X_DRAG_CUSTOM_VAR, `${this.lastDragEvent.pageX}px`);
|
|
112
|
+
this.el.style.setProperty(POSITION_Y_DRAG_CUSTOM_VAR, `${this.lastDragEvent.pageY}px`);
|
|
101
113
|
});
|
|
102
114
|
};
|
|
103
|
-
this.
|
|
104
|
-
|
|
105
|
-
const itemsToProcess = new Map(event.detail);
|
|
106
|
-
// Remove no longer selected items
|
|
107
|
-
this.selectedItems.forEach((selectedItemId) => {
|
|
108
|
-
const itemUIModel = this.flattenedTreeModel.get(selectedItemId).item;
|
|
109
|
-
const itemIsStillSelected = itemsToProcess.get(selectedItemId);
|
|
110
|
-
// The item does not need to be added. Remove it from the processed list
|
|
111
|
-
if (itemIsStillSelected) {
|
|
112
|
-
itemUIModel.expanded = itemIsStillSelected.expanded; // Update expanded state
|
|
113
|
-
itemsToProcess.delete(selectedItemId);
|
|
114
|
-
}
|
|
115
|
-
// The item must be un-selected in the UI Model
|
|
116
|
-
else {
|
|
117
|
-
itemUIModel.selected = false;
|
|
118
|
-
this.selectedItems.delete(selectedItemId);
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
// Add new selected items
|
|
122
|
-
itemsToProcess.forEach((newSelectedItemInfo, itemId) => {
|
|
123
|
-
const newSelectedItem = this.flattenedTreeModel.get(itemId).item;
|
|
124
|
-
newSelectedItem.selected = true;
|
|
125
|
-
newSelectedItem.expanded = newSelectedItemInfo.expanded;
|
|
126
|
-
this.selectedItems.add(itemId);
|
|
127
|
-
});
|
|
128
|
-
this.selectedItemsChange.emit(event.detail);
|
|
129
|
-
};
|
|
130
|
-
this.handleExpandedItemChange = (event) => {
|
|
131
|
-
const detail = event.detail;
|
|
132
|
-
const itemInfo = this.flattenedTreeModel.get(detail.id).item;
|
|
133
|
-
itemInfo.expanded = detail.expanded;
|
|
134
|
-
};
|
|
135
|
-
this.handleItemContextmenu = (event) => {
|
|
136
|
-
event.stopPropagation();
|
|
137
|
-
this.itemContextmenu.emit(event.detail);
|
|
138
|
-
};
|
|
139
|
-
this.handleItemsDropped = (event) => {
|
|
140
|
-
if (!this.dropItemsCallback) {
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
event.stopPropagation();
|
|
144
|
-
const dataTransferInfo = event.detail;
|
|
145
|
-
const newContainer = dataTransferInfo.newContainer;
|
|
146
|
-
const newParentId = newContainer.id;
|
|
147
|
-
// Check if the parent exists in the UI Model
|
|
148
|
-
if (!this.flattenedTreeModel.get(newParentId)) {
|
|
149
|
-
return;
|
|
150
|
-
}
|
|
151
|
-
const draggedItems = dataTransferInfo.draggedItems;
|
|
152
|
-
if (draggedItems.length === 0) {
|
|
115
|
+
this.fixScrollPositionOnDrag = () => {
|
|
116
|
+
if (!this.draggingInTree || !this.lastDragEvent) {
|
|
153
117
|
return;
|
|
154
118
|
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
this.waitDropProcessing = false;
|
|
159
|
-
if (!response.acceptDrop) {
|
|
160
|
-
return;
|
|
161
|
-
}
|
|
162
|
-
const newParentUIModel = this.flattenedTreeModel.get(newParentId).item;
|
|
163
|
-
// Only move the items to the new parent, keeping the state
|
|
164
|
-
if (dataTransferInfo.dropInTheSameTree) {
|
|
165
|
-
// Add the UI models to the new container and remove the UI models from
|
|
166
|
-
// the old containers
|
|
167
|
-
draggedItems.forEach(this.moveItemToNewParent(newParentUIModel));
|
|
168
|
-
// When the selected items are moved, the tree must remove its internal
|
|
169
|
-
// state to not have undefined references
|
|
170
|
-
if (dataTransferInfo.draggingSelectedItems) {
|
|
171
|
-
await this.treeRef.clearSelectedItemsInfo();
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
// Add the new items
|
|
175
|
-
else {
|
|
176
|
-
if (response.items == null) {
|
|
177
|
-
return;
|
|
178
|
-
}
|
|
179
|
-
// Add new items to the parent
|
|
180
|
-
newParentUIModel.items.push(...response.items);
|
|
181
|
-
// Flatten the new UI models
|
|
182
|
-
response.items.forEach(this.flattenItemUIModel(newParentUIModel));
|
|
183
|
-
}
|
|
184
|
-
this.sortItems(newParentUIModel.items);
|
|
185
|
-
// Open the item to visualize the new subitems
|
|
186
|
-
newParentUIModel.expanded = true;
|
|
187
|
-
// There is no need to force and update, since the waitDropProcessing
|
|
188
|
-
// prop was modified
|
|
189
|
-
});
|
|
190
|
-
};
|
|
191
|
-
this.moveItemToNewParent = (newParentUIModel) => (dataTransferInfo) => {
|
|
192
|
-
const itemUIModelExtended = this.flattenedTreeModel.get(dataTransferInfo.id);
|
|
193
|
-
const item = itemUIModelExtended.item;
|
|
194
|
-
const oldParentItem = itemUIModelExtended.parentItem;
|
|
195
|
-
// Remove the UI model from the previous parent
|
|
196
|
-
oldParentItem.items.splice(oldParentItem.items.indexOf(item), 1);
|
|
197
|
-
// Add the UI Model to the new parent
|
|
198
|
-
newParentUIModel.items.push(item);
|
|
199
|
-
// Reference the new parent in the item
|
|
200
|
-
itemUIModelExtended.parentItem = newParentUIModel;
|
|
201
|
-
};
|
|
202
|
-
this.renderSubModel = (treeSubModel, lastItem, level) => {
|
|
203
|
-
var _a, _b, _c, _d, _e, _f;
|
|
204
|
-
return (h("ch-tree-x-list-item", { id: treeSubModel.id, caption: treeSubModel.caption, checkbox: (_a = treeSubModel.checkbox) !== null && _a !== void 0 ? _a : this.checkbox, checked: (_b = treeSubModel.checked) !== null && _b !== void 0 ? _b : this.checked, class: treeSubModel.class, disabled: treeSubModel.disabled, downloading: treeSubModel.downloading, dragDisabled: (_c = treeSubModel.dragDisabled) !== null && _c !== void 0 ? _c : this.dragDisabled, dropDisabled: (_d = treeSubModel.dropDisabled) !== null && _d !== void 0 ? _d : this.dropDisabled, editable: (_e = treeSubModel.editable) !== null && _e !== void 0 ? _e : this.editableItems, expanded: treeSubModel.expanded, indeterminate: treeSubModel.indeterminate, lastItem: lastItem, lazyLoad: treeSubModel.lazy, leaf: treeSubModel.leaf, leftImgSrc: treeSubModel.leftImgSrc
|
|
205
|
-
? resolveImgPath(this.iconAssetsPath, treeSubModel.leftImgSrc)
|
|
206
|
-
: null, level: level, metadata: treeSubModel.metadata, rightImgSrc: treeSubModel.rightImgSrc, selected: treeSubModel.selected, showExpandableButton: treeSubModel.showExpandableButton, showLines: this.showLines, toggleCheckboxes: (_f = treeSubModel.toggleCheckboxes) !== null && _f !== void 0 ? _f : this.toggleCheckboxes }, !treeSubModel.leaf &&
|
|
207
|
-
treeSubModel.items != null &&
|
|
208
|
-
treeSubModel.items.map((subModel, index) => this.renderSubModel(subModel, this.showLines && index === treeSubModel.items.length - 1, level + 1))));
|
|
209
|
-
};
|
|
210
|
-
this.flattenItemUIModel = (parentModel) => (item) => {
|
|
211
|
-
var _a;
|
|
212
|
-
this.flattenedTreeModel.set(item.id, {
|
|
213
|
-
parentItem: parentModel,
|
|
214
|
-
item: item,
|
|
119
|
+
requestAnimationFrame(() => {
|
|
120
|
+
scrollToEdge(this.lastDragEvent, this.el, 10, 30);
|
|
121
|
+
requestAnimationFrame(this.fixScrollPositionOnDrag);
|
|
215
122
|
});
|
|
216
|
-
// Add the items that have a checkbox in a separate Map
|
|
217
|
-
if ((_a = item.checkbox) !== null && _a !== void 0 ? _a : this.checkbox) {
|
|
218
|
-
this.flattenedCheckboxTreeModel.set(item.id, {
|
|
219
|
-
parentItem: parentModel,
|
|
220
|
-
item: item,
|
|
221
|
-
});
|
|
222
|
-
}
|
|
223
|
-
// Make sure the properties are with their default values to avoid issues
|
|
224
|
-
// when reusing DOM nodes
|
|
225
|
-
item.class = item.class == null ? DEFAULT_CLASS_VALUE : item.class;
|
|
226
|
-
item.expanded =
|
|
227
|
-
item.expanded == null ? DEFAULT_EXPANDED_VALUE : item.expanded;
|
|
228
|
-
item.indeterminate =
|
|
229
|
-
item.indeterminate == null
|
|
230
|
-
? DEFAULT_INDETERMINATE_VALUE
|
|
231
|
-
: item.indeterminate;
|
|
232
|
-
item.lazy = item.lazy == null ? DEFAULT_LAZY_VALUE : item.lazy;
|
|
233
|
-
item.order = item.order == null ? DEFAULT_ORDER_VALUE : item.order;
|
|
234
|
-
item.selected =
|
|
235
|
-
item.selected == null ? DEFAULT_SELECTED_VALUE : item.selected;
|
|
236
|
-
if (item.selected) {
|
|
237
|
-
this.selectedItems.add(item.id);
|
|
238
|
-
}
|
|
239
|
-
this.flattenSubModel(item);
|
|
240
123
|
};
|
|
241
124
|
}
|
|
242
|
-
|
|
243
|
-
|
|
125
|
+
// /**
|
|
126
|
+
// * Returns an array of the selected tree items, providing the id, caption and
|
|
127
|
+
// * selected status.
|
|
128
|
+
// */
|
|
129
|
+
// @Method()
|
|
130
|
+
// async getCheckedItems(): Promise<CheckedTreeItemInfo[]> {
|
|
131
|
+
// const checkedItems = Array.from(
|
|
132
|
+
// this.el.querySelectorAll(CHECKED_ITEMS)
|
|
133
|
+
// ) as HTMLChTreeViewItemElement[];
|
|
134
|
+
// return checkedItems.map(item => ({
|
|
135
|
+
// id: item.id,
|
|
136
|
+
// caption: item.caption,
|
|
137
|
+
// selected: item.selected
|
|
138
|
+
// }));
|
|
139
|
+
// }
|
|
140
|
+
handleContextMenuEvent(event) {
|
|
141
|
+
const treeItem = event.target.closest(TREE_ITEM_TAG_NAME);
|
|
142
|
+
if (!treeItem) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
event.preventDefault();
|
|
146
|
+
this.itemContextmenu.emit({
|
|
147
|
+
id: treeItem.id,
|
|
148
|
+
itemRef: treeItem,
|
|
149
|
+
metadata: treeItem.metadata,
|
|
150
|
+
contextmenuEvent: event
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
// Set edit mode in items
|
|
154
|
+
handleKeyDownEvents(event) {
|
|
155
|
+
const keyHandler = this.keyDownEvents[event.key];
|
|
156
|
+
if (keyHandler) {
|
|
157
|
+
keyHandler(event);
|
|
158
|
+
}
|
|
244
159
|
}
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
160
|
+
// We can't use capture, because the dataTransfer info would not be defined
|
|
161
|
+
// Also, we cant use capture and setTimeout with 0 seconds, because the
|
|
162
|
+
// getData method can only be accessed during the dragstart and drop event
|
|
163
|
+
handleDragStart(event) {
|
|
164
|
+
// Reset the validity of the droppable zones with each new drag start
|
|
165
|
+
this.validDroppableZoneCache.clear();
|
|
166
|
+
this.draggingInTheDocument = true;
|
|
167
|
+
this.dragStartTimestamp = new Date().getTime();
|
|
168
|
+
this.draggedItems = JSON.parse(event.dataTransfer.getData(TEXT_FORMAT));
|
|
169
|
+
}
|
|
170
|
+
handleDragEnd() {
|
|
171
|
+
this.draggingInTheDocument = false;
|
|
172
|
+
}
|
|
173
|
+
handleDragEnter(event) {
|
|
174
|
+
this.cancelSubTreeOpening(null, true);
|
|
175
|
+
event.stopPropagation();
|
|
176
|
+
const containerTarget = event.target;
|
|
177
|
+
// Check if it is a valid item
|
|
178
|
+
if (containerTarget.tagName.toLowerCase() !== TREE_ITEM_TAG_NAME) {
|
|
256
179
|
return;
|
|
257
180
|
}
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
this.
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
this.emitCheckedItemsChange();
|
|
264
|
-
// Force re-render
|
|
265
|
-
forceUpdate(this);
|
|
181
|
+
this.lastOpenSubTreeItem = containerTarget;
|
|
182
|
+
this.openSubTreeAfterCountdown(containerTarget);
|
|
183
|
+
if (this.validDroppableZone(event) === "valid") {
|
|
184
|
+
containerTarget.dragState = "enter";
|
|
185
|
+
}
|
|
266
186
|
}
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
async scrollIntoVisible(treeItemId) {
|
|
271
|
-
const itemUIModel = this.flattenedTreeModel.get(treeItemId);
|
|
272
|
-
if (!itemUIModel) {
|
|
273
|
-
// @todo Check if the item is on the server?
|
|
187
|
+
handleDragLeave(event) {
|
|
188
|
+
const currentTarget = event.target;
|
|
189
|
+
if (currentTarget.tagName.toLowerCase() !== TREE_ITEM_TAG_NAME) {
|
|
274
190
|
return;
|
|
275
191
|
}
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
192
|
+
const treeItem = currentTarget;
|
|
193
|
+
treeItem.dragState = "none";
|
|
194
|
+
this.cancelSubTreeOpening(treeItem);
|
|
195
|
+
}
|
|
196
|
+
cancelSubTreeOpening(treeItem, forceClear = false) {
|
|
197
|
+
if (this.lastOpenSubTreeItem === treeItem || forceClear) {
|
|
198
|
+
clearTimeout(this.openSubTreeTimeout);
|
|
199
|
+
this.lastOpenSubTreeItem = null;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
handleItemDrop(event) {
|
|
203
|
+
event.stopPropagation();
|
|
204
|
+
this.cancelSubTreeOpening(null, true);
|
|
205
|
+
const newContainer = event.target;
|
|
206
|
+
const draggedItems = JSON.parse(event.dataTransfer.getData(TEXT_FORMAT));
|
|
207
|
+
// The droppable zone must be checked, even if it was marked as not valid
|
|
208
|
+
// @todo Try to drop an item with high delays in droppable zone checking
|
|
209
|
+
if (this.validDroppableZone(event) !== "valid") {
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
this.itemsDropped.emit({
|
|
213
|
+
newContainer: { id: newContainer.id, metadata: newContainer.metadata },
|
|
214
|
+
draggingSelectedItems: this.draggingSelectedItems,
|
|
215
|
+
draggedItems: draggedItems,
|
|
216
|
+
dropInTheSameTree: this.draggingInTree
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
handleItemDragStart(event) {
|
|
220
|
+
document.body.addEventListener("dragover", this.trackItemDrag, {
|
|
221
|
+
capture: true
|
|
222
|
+
});
|
|
223
|
+
this.currentDraggedItem = event.target;
|
|
224
|
+
const allItemsCanBeDragged = this.checkDragValidityAndUpdateDragInfo(event.detail);
|
|
225
|
+
if (!allItemsCanBeDragged) {
|
|
226
|
+
// This effect disables drop interactions in all page elements, so there
|
|
227
|
+
// is no need to capture and prevent the drop event in the window
|
|
228
|
+
event.detail.dragEvent.dataTransfer.effectAllowed = "none";
|
|
229
|
+
return;
|
|
283
230
|
}
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
231
|
+
this.draggingInTree = true;
|
|
232
|
+
if (this.scrollToEdgeOnDrag) {
|
|
233
|
+
this.fixScrollPositionOnDrag();
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
handleItemDragEnd() {
|
|
237
|
+
this.draggingInTree = false;
|
|
238
|
+
document.body.removeEventListener("dragover", this.trackItemDrag, {
|
|
239
|
+
capture: true
|
|
240
|
+
});
|
|
241
|
+
// Reset not allowed droppable ids
|
|
242
|
+
this.resetVariables();
|
|
289
243
|
}
|
|
290
244
|
/**
|
|
291
|
-
*
|
|
292
|
-
*
|
|
293
|
-
* @param treeItemIds An array id the tree items to be toggled.
|
|
294
|
-
* @param expand A boolean indicating that the tree item should be expanded or collapsed. (optional)
|
|
295
|
-
* @returns The modified items after the method was called.
|
|
245
|
+
* Only sync the info about the selected items. It does not update the state
|
|
246
|
+
* of the previous selected items.
|
|
296
247
|
*/
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
248
|
+
handleSelectedItemSync(event) {
|
|
249
|
+
event.stopPropagation();
|
|
250
|
+
const selectedItemInfo = event.detail;
|
|
251
|
+
// If the item is selected, add it to list
|
|
252
|
+
if (selectedItemInfo.selected) {
|
|
253
|
+
this.selectedItemsInfo.set(selectedItemInfo.id, selectedItemInfo);
|
|
300
254
|
}
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
}
|
|
311
|
-
});
|
|
312
|
-
// Force re-render
|
|
313
|
-
forceUpdate(this);
|
|
314
|
-
return modifiedTreeItems;
|
|
255
|
+
else {
|
|
256
|
+
this.selectedItemsInfo.delete(selectedItemInfo.id);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
handleSelectedItemChange(event) {
|
|
260
|
+
event.stopPropagation();
|
|
261
|
+
const selectedItemInfo = event.detail;
|
|
262
|
+
const selectedItemEl = event.target;
|
|
263
|
+
this.handleItemSelection(selectedItemEl, selectedItemInfo);
|
|
315
264
|
}
|
|
316
265
|
/**
|
|
317
|
-
*
|
|
266
|
+
* Clear all information about the selected items. This method is intended to
|
|
267
|
+
* be used when selected items are reordered and the selected references will
|
|
268
|
+
* no longer be useful.
|
|
318
269
|
*/
|
|
319
|
-
async
|
|
320
|
-
|
|
321
|
-
if (properties.expanded != null) {
|
|
322
|
-
itemUIModel.item.expanded = properties.expanded;
|
|
323
|
-
}
|
|
324
|
-
if (properties.checked != null) {
|
|
325
|
-
itemUIModel.item.checked = properties.checked;
|
|
326
|
-
itemUIModel.item.indeterminate = false;
|
|
327
|
-
}
|
|
328
|
-
});
|
|
329
|
-
forceUpdate(this);
|
|
270
|
+
async clearSelectedItemsInfo() {
|
|
271
|
+
this.clearSelectedItems();
|
|
330
272
|
}
|
|
331
273
|
/**
|
|
332
|
-
* Given
|
|
333
|
-
* of the items in the list.
|
|
274
|
+
* Given an item id, it displays and scrolls into the item view.
|
|
334
275
|
*/
|
|
335
|
-
async
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
276
|
+
async scrollIntoVisible(treeItemId) {
|
|
277
|
+
const itemRef = this.el.querySelector(`${TREE_ITEM_TAG_NAME}#${treeItemId}`);
|
|
278
|
+
if (!itemRef) {
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
let parentItem = itemRef.parentElement;
|
|
282
|
+
// Expand all parents
|
|
283
|
+
while (parentItem.tagName.toLowerCase() === TREE_ITEM_TAG_NAME) {
|
|
284
|
+
parentItem.expanded = true;
|
|
285
|
+
parentItem = parentItem.parentElement;
|
|
286
|
+
}
|
|
287
|
+
// Wait until the parents are expanded
|
|
288
|
+
requestAnimationFrame(() => {
|
|
289
|
+
itemRef.scrollIntoView();
|
|
339
290
|
});
|
|
340
|
-
forceUpdate(this);
|
|
341
291
|
}
|
|
342
292
|
/**
|
|
343
293
|
* Update the information about the valid droppable zones.
|
|
@@ -347,183 +297,208 @@ const GxgTreeView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
347
297
|
* @param validDrop Current state of the droppable zone.
|
|
348
298
|
*/
|
|
349
299
|
async updateValidDropZone(requestTimestamp, newContainerId, draggedItems, validDrop) {
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
if (!itemUIModel) {
|
|
300
|
+
var _a;
|
|
301
|
+
if (!this.draggingInTheDocument ||
|
|
302
|
+
requestTimestamp <= this.dragStartTimestamp) {
|
|
354
303
|
return;
|
|
355
304
|
}
|
|
356
|
-
const
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
305
|
+
const droppableZoneKey = getDroppableZoneKey(newContainerId, draggedItems);
|
|
306
|
+
this.validDroppableZoneCache.set(droppableZoneKey, validDrop ? "valid" : "invalid");
|
|
307
|
+
const shouldUpdateDragEnterInCurrentContainer = ((_a = this.lastOpenSubTreeItem) === null || _a === void 0 ? void 0 : _a.id) === newContainerId;
|
|
308
|
+
if (shouldUpdateDragEnterInCurrentContainer) {
|
|
309
|
+
this.lastOpenSubTreeItem.dragState = "enter";
|
|
310
|
+
}
|
|
360
311
|
}
|
|
361
|
-
|
|
362
|
-
event.
|
|
363
|
-
const
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
312
|
+
validDroppableZone(event) {
|
|
313
|
+
const containerTarget = event.target;
|
|
314
|
+
const cacheKey = getDroppableZoneKey(containerTarget.id, this.draggedItems);
|
|
315
|
+
let droppableZoneState = this.validDroppableZoneCache.get(cacheKey);
|
|
316
|
+
// Invalidate the cache, because the item is no longer waiting for its content to be downloaded
|
|
317
|
+
if (droppableZoneState === "temporal-invalid" &&
|
|
318
|
+
!containerTarget.lazyLoad &&
|
|
319
|
+
!containerTarget.downloading) {
|
|
320
|
+
droppableZoneState = null;
|
|
370
321
|
}
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
322
|
+
if (droppableZoneState != null) {
|
|
323
|
+
return droppableZoneState;
|
|
324
|
+
}
|
|
325
|
+
// Do not show drop zones if:
|
|
326
|
+
// - The effect does not allow it.
|
|
327
|
+
// - The drop is disabled in the container target.
|
|
328
|
+
// - When dragging in the same tree, don't mark droppable zones if they are
|
|
329
|
+
// the dragged items or their direct parents.
|
|
330
|
+
if (event.dataTransfer.effectAllowed === "none" ||
|
|
331
|
+
containerTarget.dropDisabled ||
|
|
332
|
+
(this.draggingInTree &&
|
|
333
|
+
(this.draggedIds.includes(containerTarget.id) ||
|
|
334
|
+
this.draggedParentIds.includes(containerTarget.id)))) {
|
|
335
|
+
this.validDroppableZoneCache.set(cacheKey, "invalid");
|
|
336
|
+
return "invalid";
|
|
337
|
+
}
|
|
338
|
+
// Disable drops when items need to lazy load their content first
|
|
339
|
+
if (containerTarget.lazyLoad || containerTarget.downloading) {
|
|
340
|
+
this.validDroppableZoneCache.set(cacheKey, "temporal-invalid");
|
|
341
|
+
return "temporal-invalid";
|
|
342
|
+
}
|
|
343
|
+
this.validDroppableZoneCache.set(cacheKey, "checking");
|
|
344
|
+
this.droppableZoneEnter.emit({
|
|
345
|
+
newContainer: {
|
|
346
|
+
id: containerTarget.id,
|
|
347
|
+
metadata: containerTarget.metadata
|
|
348
|
+
},
|
|
349
|
+
draggedItems: this.draggedItems
|
|
350
|
+
});
|
|
351
|
+
return "checking";
|
|
375
352
|
}
|
|
376
|
-
|
|
377
|
-
if (
|
|
353
|
+
openSubTreeAfterCountdown(currentTarget) {
|
|
354
|
+
if (currentTarget.leaf || currentTarget.expanded) {
|
|
378
355
|
return;
|
|
379
356
|
}
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
promise.then((result) => {
|
|
385
|
-
this.loadLazyContent(treeItemId, result);
|
|
386
|
-
});
|
|
357
|
+
this.openSubTreeTimeout = setTimeout(() => {
|
|
358
|
+
currentTarget.expanded = true;
|
|
359
|
+
this.expandedItemChange.emit({ id: currentTarget.id, expanded: true });
|
|
360
|
+
}, this.openSubTreeCountdown);
|
|
387
361
|
}
|
|
388
|
-
|
|
389
|
-
|
|
362
|
+
updateDropEffect(event) {
|
|
363
|
+
const itemTarget = event.target;
|
|
364
|
+
// Check if it is a valid item
|
|
365
|
+
if (itemTarget.tagName.toLowerCase() !== TREE_ITEM_TAG_NAME ||
|
|
366
|
+
itemTarget.closest(TREE_TAG_NAME) !== this.el) {
|
|
390
367
|
return;
|
|
391
368
|
}
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
const newCaption = event.detail.caption;
|
|
398
|
-
const oldCaption = itemInfo.caption;
|
|
399
|
-
// Optimistic UI: Update the caption in the UI Model before the change is
|
|
400
|
-
// completed in the server
|
|
401
|
-
itemInfo.caption = newCaption;
|
|
402
|
-
// Due to performance reasons, we don't make a shallow copy of the
|
|
403
|
-
// treeModel to force a re-render
|
|
404
|
-
itemRef.caption = newCaption;
|
|
405
|
-
const promise = this.modifyItemCaptionCallback(itemId, newCaption);
|
|
406
|
-
promise.then((status) => {
|
|
407
|
-
if (status.success) {
|
|
408
|
-
this.sortItems(itemUIModel.parentItem.items);
|
|
409
|
-
// Force re-render
|
|
410
|
-
forceUpdate(this);
|
|
411
|
-
}
|
|
412
|
-
else {
|
|
413
|
-
itemRef.caption = oldCaption;
|
|
414
|
-
itemInfo.caption = oldCaption;
|
|
415
|
-
// Do something with the error message
|
|
416
|
-
}
|
|
417
|
-
});
|
|
369
|
+
const droppableZoneState = this.validDroppableZone(event);
|
|
370
|
+
if (droppableZoneState === "invalid" ||
|
|
371
|
+
droppableZoneState === "temporal-invalid") {
|
|
372
|
+
event.dataTransfer.dropEffect = "none";
|
|
373
|
+
}
|
|
418
374
|
}
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
this.
|
|
375
|
+
resetVariables() {
|
|
376
|
+
this.draggedIds = [];
|
|
377
|
+
this.draggedParentIds = [];
|
|
422
378
|
}
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
this.
|
|
379
|
+
/**
|
|
380
|
+
* First, it check if all items can be dragged. If so, it updates the
|
|
381
|
+
* dataTransfer in the drag event to store the ids and metadata of the
|
|
382
|
+
* dragged items. Also it updates the visual information of the dragged
|
|
383
|
+
* items.
|
|
384
|
+
* @returns If all selected items can be dragged.
|
|
385
|
+
*/
|
|
386
|
+
checkDragValidityAndUpdateDragInfo(dragInfo) {
|
|
387
|
+
const draggedElement = dragInfo.elem;
|
|
388
|
+
const isDraggingSelectedItems = this.selectedItemsInfo.has(draggedElement.id);
|
|
389
|
+
this.draggingSelectedItems = isDraggingSelectedItems;
|
|
390
|
+
let dataTransferInfo = [];
|
|
391
|
+
let dragIsEnabledForAllItems;
|
|
392
|
+
if (isDraggingSelectedItems) {
|
|
393
|
+
const selectedItemKeys = [...this.selectedItemsInfo.keys()];
|
|
394
|
+
const selectedItemValues = [...this.selectedItemsInfo.values()];
|
|
395
|
+
const selectedItemCount = selectedItemKeys.length;
|
|
396
|
+
dragIsEnabledForAllItems = selectedItemValues.every(el => !el.itemRef.dragDisabled);
|
|
397
|
+
this.draggedIds = selectedItemKeys;
|
|
398
|
+
dataTransferInfo = selectedItemValues.map(el => ({
|
|
399
|
+
id: el.id,
|
|
400
|
+
metadata: el.metadata
|
|
401
|
+
}));
|
|
402
|
+
this.dragInfo =
|
|
403
|
+
selectedItemCount === 1
|
|
404
|
+
? draggedElement.caption
|
|
405
|
+
: selectedItemCount.toString();
|
|
406
|
+
}
|
|
407
|
+
else {
|
|
408
|
+
dragIsEnabledForAllItems = !draggedElement.dragDisabled;
|
|
409
|
+
dataTransferInfo = [
|
|
410
|
+
{ id: draggedElement.id, metadata: draggedElement.metadata }
|
|
411
|
+
];
|
|
412
|
+
this.draggedIds = [draggedElement.id];
|
|
413
|
+
this.dragInfo = draggedElement.caption;
|
|
414
|
+
}
|
|
415
|
+
this.getDirectParentsOfDraggableItems(isDraggingSelectedItems);
|
|
416
|
+
// Update drag event info
|
|
417
|
+
const data = JSON.stringify(dataTransferInfo);
|
|
418
|
+
dragInfo.dragEvent.dataTransfer.setData(TEXT_FORMAT, data);
|
|
419
|
+
// We must keep the data binding and processing even if there is an item
|
|
420
|
+
// that can't be dragged, otherwise, other trees or element might behave
|
|
421
|
+
// unexpected when a dragstart event comes
|
|
422
|
+
return dragIsEnabledForAllItems;
|
|
433
423
|
}
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
model.items = [];
|
|
424
|
+
getDirectParentsOfDraggableItems(draggingSelectedItems) {
|
|
425
|
+
if (!draggingSelectedItems) {
|
|
426
|
+
const parentTreeItemElem = this.currentDraggedItem.parentElement;
|
|
427
|
+
if (parentTreeItemElem.tagName.toLowerCase() === TREE_ITEM_TAG_NAME) {
|
|
428
|
+
this.draggedParentIds.push(parentTreeItemElem.id);
|
|
440
429
|
}
|
|
441
430
|
return;
|
|
442
431
|
}
|
|
443
|
-
|
|
444
|
-
|
|
432
|
+
// Dragging selected items
|
|
433
|
+
this.selectedItemsInfo.forEach(selectedItem => {
|
|
434
|
+
const parentId = selectedItem.parentId;
|
|
435
|
+
// parentId === "" when the item is in the first level of the tree
|
|
436
|
+
if (parentId !== "") {
|
|
437
|
+
this.draggedParentIds.push(parentId);
|
|
438
|
+
}
|
|
439
|
+
});
|
|
445
440
|
}
|
|
446
|
-
|
|
447
|
-
//
|
|
448
|
-
|
|
449
|
-
|
|
441
|
+
handleItemSelection(selectedItemEl, selectedItemInfo) {
|
|
442
|
+
// If the Control key was not pressed or multi selection is disabled,
|
|
443
|
+
// remove all selected items
|
|
444
|
+
if (!selectedItemInfo.ctrlKeyPressed || !this.multiSelection) {
|
|
445
|
+
// Don't update the state of the selected item if no needed
|
|
446
|
+
this.selectedItemsInfo.delete(selectedItemInfo.id);
|
|
447
|
+
this.selectedItemsInfo.forEach(treeItem => {
|
|
448
|
+
treeItem.itemRef.selected = false;
|
|
449
|
+
});
|
|
450
|
+
this.clearSelectedItems();
|
|
451
|
+
// Re-select the item
|
|
452
|
+
selectedItemEl.selected = selectedItemInfo.selected;
|
|
450
453
|
}
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
this.flattenedCheckboxTreeModel.clear();
|
|
455
|
-
this.selectedItems.clear();
|
|
456
|
-
// The model was updated at runtime, so we need to clear the references
|
|
457
|
-
if (this.treeRef) {
|
|
458
|
-
this.treeRef.clearSelectedItemsInfo();
|
|
454
|
+
// If the item is selected, add it to list
|
|
455
|
+
if (selectedItemInfo.selected) {
|
|
456
|
+
this.selectedItemsInfo.set(selectedItemInfo.id, selectedItemInfo);
|
|
459
457
|
}
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
this.emitCheckedItemsChange();
|
|
458
|
+
// Sync with UI model
|
|
459
|
+
this.selectedItemsChange.emit(this.selectedItemsInfo);
|
|
463
460
|
}
|
|
464
|
-
|
|
465
|
-
this.
|
|
461
|
+
clearSelectedItems() {
|
|
462
|
+
this.selectedItemsInfo.clear();
|
|
463
|
+
}
|
|
464
|
+
disconnectedCallback() {
|
|
465
|
+
this.resetVariables();
|
|
466
|
+
// Remove dragover body event
|
|
467
|
+
this.handleItemDragEnd();
|
|
466
468
|
}
|
|
467
469
|
render() {
|
|
468
|
-
return (h(
|
|
470
|
+
return (h(Host, { class: {
|
|
471
|
+
"ch-tree-view-dragging-item": this.draggingInTheDocument,
|
|
472
|
+
"ch-tree-view-not-dragging-item": !this.draggingInTheDocument,
|
|
473
|
+
"ch-tree-view--dragging-selected-items": this.draggingInTree && this.draggingSelectedItems,
|
|
474
|
+
"ch-tree-view-waiting-drop-processing": this.waitDropProcessing
|
|
475
|
+
} }, h("div", { role: "tree", part: "tree-x-container", "aria-multiselectable": this.multiSelection.toString(), class: "ch-tree-view-container" }, h("slot", null)), this.draggingInTree && (h("span", { "aria-hidden": "true", class: "ch-tree-view-drag-info" }, this.dragInfo))));
|
|
469
476
|
}
|
|
470
|
-
|
|
471
|
-
static get watchers() { return {
|
|
472
|
-
"treeModel": ["handleTreeModelChange"]
|
|
473
|
-
}; }
|
|
477
|
+
get el() { return this; }
|
|
474
478
|
static get style() { return treeViewCss; }
|
|
475
|
-
}, [
|
|
476
|
-
"noPadding": [516, "no-padding"],
|
|
477
|
-
"checkbox": [4],
|
|
478
|
-
"checked": [4],
|
|
479
|
-
"checkDroppableZoneCallback": [16],
|
|
480
|
-
"cssClass": [1, "css-class"],
|
|
481
|
-
"dragDisabled": [4, "drag-disabled"],
|
|
482
|
-
"dropDisabled": [4, "drop-disabled"],
|
|
483
|
-
"dropItemsCallback": [16],
|
|
484
|
-
"editableItems": [4, "editable-items"],
|
|
485
|
-
"lazyLoadTreeItemsCallback": [16],
|
|
486
|
-
"modifyItemCaptionCallback": [16],
|
|
479
|
+
}, [4, "ch-tree-view", {
|
|
487
480
|
"multiSelection": [4, "multi-selection"],
|
|
488
|
-
"
|
|
489
|
-
"
|
|
490
|
-
"
|
|
491
|
-
"
|
|
492
|
-
"
|
|
493
|
-
"
|
|
481
|
+
"openSubTreeCountdown": [2, "open-sub-tree-countdown"],
|
|
482
|
+
"scrollToEdgeOnDrag": [4, "scroll-to-edge-on-drag"],
|
|
483
|
+
"waitDropProcessing": [4, "wait-drop-processing"],
|
|
484
|
+
"draggingInTheDocument": [32],
|
|
485
|
+
"draggingInTree": [32],
|
|
486
|
+
"clearSelectedItemsInfo": [64],
|
|
494
487
|
"scrollIntoVisible": [64],
|
|
495
|
-
"toggleItems": [64],
|
|
496
|
-
"updateAllItemsProperties": [64],
|
|
497
|
-
"updateItemsProperties": [64],
|
|
498
488
|
"updateValidDropZone": [64]
|
|
499
|
-
}, [[
|
|
489
|
+
}, [[2, "contextmenu", "handleContextMenuEvent"], [2, "keydown", "handleKeyDownEvents"], [9, "dragstart", "handleDragStart"], [11, "dragend", "handleDragEnd"], [3, "dragenter", "handleDragEnter"], [3, "dragleave", "handleDragLeave"], [1, "drop", "handleItemDrop"], [0, "itemDragStart", "handleItemDragStart"], [0, "itemDragEnd", "handleItemDragEnd"], [0, "selectedItemSync", "handleSelectedItemSync"], [0, "selectedItemChange", "handleSelectedItemChange"]]]);
|
|
500
490
|
function defineCustomElement() {
|
|
501
491
|
if (typeof customElements === "undefined") {
|
|
502
492
|
return;
|
|
503
493
|
}
|
|
504
|
-
const components = ["
|
|
494
|
+
const components = ["ch-tree-view"];
|
|
505
495
|
components.forEach(tagName => { switch (tagName) {
|
|
506
|
-
case "
|
|
507
|
-
if (!customElements.get(tagName)) {
|
|
508
|
-
customElements.define(tagName, GxgTreeView);
|
|
509
|
-
}
|
|
510
|
-
break;
|
|
511
|
-
case "ch-checkbox":
|
|
512
|
-
if (!customElements.get(tagName)) {
|
|
513
|
-
defineCustomElement$3();
|
|
514
|
-
}
|
|
515
|
-
break;
|
|
516
|
-
case "ch-tree-x":
|
|
517
|
-
if (!customElements.get(tagName)) {
|
|
518
|
-
defineCustomElement$2();
|
|
519
|
-
}
|
|
520
|
-
break;
|
|
521
|
-
case "ch-tree-x-list-item":
|
|
496
|
+
case "ch-tree-view":
|
|
522
497
|
if (!customElements.get(tagName)) {
|
|
523
|
-
|
|
498
|
+
customElements.define(tagName, ChTreeView);
|
|
524
499
|
}
|
|
525
500
|
break;
|
|
526
501
|
} });
|
|
527
502
|
}
|
|
528
503
|
|
|
529
|
-
export {
|
|
504
|
+
export { ChTreeView as C, defineCustomElement as d };
|