@genexus/genexus-ide-ui 0.0.15 → 0.0.17
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-grid_7.cjs.entry.js +73 -27
- package/dist/cjs/genexus-ide-ui.cjs.js +1 -1
- package/dist/cjs/{gx-ide-container_2.cjs.entry.js → gx-ide-container.cjs.entry.js} +0 -31
- package/dist/cjs/gx-ide-directory-selector.cjs.entry.js +0 -1
- package/dist/cjs/gx-ide-entity-selector.cjs.entry.js +12 -2
- package/dist/cjs/gx-ide-new-kb.cjs.entry.js +16 -17
- package/dist/cjs/gx-ide-template.cjs.entry.js +2 -2
- package/dist/cjs/gx-ide-top-bar.cjs.entry.js +37 -0
- package/dist/cjs/gxg-combo-box_8.cjs.entry.js +3 -8
- package/dist/cjs/gxg-menu.cjs.entry.js +2 -2
- package/dist/cjs/gxg-test.cjs.entry.js +4 -23
- package/dist/cjs/gxg-tree_2.cjs.entry.js +386 -281
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/_template/template.js +9 -10
- package/dist/collection/components/directory-selector/directory-selector.js +0 -1
- package/dist/collection/components/entity-selector/entity-selector.js +39 -2
- package/dist/collection/components/new-kb/new-kb.js +16 -35
- package/dist/components/ch-grid2.js +74 -28
- package/dist/components/combo-box.js +4 -3
- package/dist/components/form-radio.js +0 -5
- package/dist/components/gx-ide-directory-selector.js +0 -1
- package/dist/components/gx-ide-entity-selector.js +13 -3
- package/dist/components/gx-ide-new-kb.js +20 -28
- package/dist/components/gx-ide-template.js +7 -13
- package/dist/components/gxg-menu.js +2 -2
- package/dist/components/gxg-test.js +4 -23
- package/dist/components/gxg-tree-item2.js +344 -277
- package/dist/components/gxg-tree2.js +47 -8
- package/dist/esm/ch-grid_7.entry.js +73 -27
- package/dist/esm/genexus-ide-ui.js +1 -1
- package/dist/esm/{gx-ide-container_2.entry.js → gx-ide-container.entry.js} +1 -31
- package/dist/esm/gx-ide-directory-selector.entry.js +0 -1
- package/dist/esm/gx-ide-entity-selector.entry.js +13 -3
- package/dist/esm/gx-ide-new-kb.entry.js +16 -17
- package/dist/esm/gx-ide-template.entry.js +2 -2
- package/dist/esm/gx-ide-top-bar.entry.js +33 -0
- package/dist/esm/gxg-combo-box_8.entry.js +3 -8
- package/dist/esm/gxg-menu.entry.js +2 -2
- package/dist/esm/gxg-test.entry.js +4 -23
- package/dist/esm/gxg-tree_2.entry.js +387 -282
- 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/p-1042318d.entry.js +1 -0
- package/dist/genexus-ide-ui/p-1d4cf2ae.entry.js +1 -0
- package/dist/genexus-ide-ui/p-48482e25.entry.js +1 -0
- package/dist/genexus-ide-ui/p-49433b58.entry.js +1 -0
- package/dist/genexus-ide-ui/p-79cf24a3.entry.js +1 -0
- package/dist/genexus-ide-ui/p-b196d91d.entry.js +1 -0
- package/dist/genexus-ide-ui/p-c5c6e102.entry.js +1 -0
- package/dist/genexus-ide-ui/p-cd503583.entry.js +1 -0
- package/dist/genexus-ide-ui/p-e4ee28c7.entry.js +1 -0
- package/dist/genexus-ide-ui/{p-1e412d88.entry.js → p-fcc98e20.entry.js} +1 -1
- package/dist/node_modules/@genexus/gemini/dist/collection/components/tree-item/gxg-tree-item.css +2 -2
- package/dist/types/components/_template/template.d.ts +2 -2
- package/dist/types/components/entity-selector/entity-selector.d.ts +10 -0
- package/dist/types/components/new-kb/new-kb.d.ts +0 -4
- package/dist/types/components.d.ts +12 -12
- package/package.json +3 -3
- package/dist/genexus-ide-ui/p-0f5d0ccc.entry.js +0 -1
- package/dist/genexus-ide-ui/p-18936375.entry.js +0 -1
- package/dist/genexus-ide-ui/p-2761a056.entry.js +0 -1
- package/dist/genexus-ide-ui/p-62814082.entry.js +0 -1
- package/dist/genexus-ide-ui/p-97430828.entry.js +0 -1
- package/dist/genexus-ide-ui/p-9e32e006.entry.js +0 -1
- package/dist/genexus-ide-ui/p-eb8e9655.entry.js +0 -1
- package/dist/genexus-ide-ui/p-f58b607d.entry.js +0 -1
|
@@ -6,7 +6,7 @@ import { d as defineCustomElement$3 } from './icon2.js';
|
|
|
6
6
|
import { d as defineCustomElement$2 } from './gxg-label2.js';
|
|
7
7
|
import { d as defineCustomElement$1 } from './tooltip.js';
|
|
8
8
|
|
|
9
|
-
const gxgTreeItemCss = "/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0;}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px;}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}: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}:host{--text-color:var(--color-on-background);--font-family:\"Source Sans Pro\", sans-serif;--font-weight:normal;--font-size:12px;--guide-color:var(--gray-06);--item-hover-color:var(--gray-01);--item-active-color:var(--silverGray);color:var(--color-on-background);width:100%;display:block}:host li{list-style:none;font-family:var(--font-family);font-size:var(--font-size);font-weight:var(--font-weight);color:var(--text-color);overflow:hidden}:host li>::slotted(gxg-tree){display:none}:host li.tree-open>::slotted(gxg-tree){display:block}:host li.tree-closed .vertical-line{display:none}:host li .li-text{min-height:24px;cursor:pointer;display:flex;align-items:center;position:relative;padding-inline-end:var(--spacing-comp-01)}:host li .li-text:hover{background-color:var(--item-hover-color)}:host li .li-text:active{background-color:var(--gxg-color-selected)}:host li .li-text:focus{outline-style:solid;outline-color:var(--color-primary-active);outline-width:var(--border-width-md);outline-offset:-2px}:host li .li-text--selected{background-color:var(--gxg-color-selected)}:host li .li-text>*{flex-shrink:0}:host li .vertical-line{position:absolute;width:1px;height:0;top:23px;left:15px;z-index:1;background-image:linear-gradient(var(--guide-color) 28%, rgba(255, 255, 255, 0) 0%);background-position:right;background-size:1px 4px;background-repeat:repeat-y}:host li .horizontal-line{position:absolute;height:1px;top:11px;z-index:1;background-image:linear-gradient(to right, var(--guide-color) 33%, rgba(255, 255, 255, 0) 0%);background-position:bottom;background-size:3px 1px;background-repeat:repeat-x}:host li .horizontal-line.display-none{display:none}:host li .closed-opened-icons{position:relative;display:flex;margin-left:-2px}:host li .toggle-icon{position:relative;z-index:2;transform:scale(0.75, 0.75);margin-inline-end:var(--spacing-comp-00);transition-property:opacity;transition-duration:0.5s;transition-timing-function:ease;background-color:var(--color-hover)}:host li .toggle-icon:hover{background-color:var(--color-background)}:host .checkbox{margin-inline-end:var(--spacing-comp-01)}:host .icon--left{margin:0 var(--spacing-comp-01) 0 var(--spacing-comp-00)}:host .right-icon{margin-inline-start:auto;position:relative;top:0;transition-property:top;transition-duration:0.5s;transition-timing-function:ease}:host .loading{opacity:1;display:inline;z-index:1;margin-inline-end:var(--spacing-comp-01);border-radius:50%;width:8px;height:8px;border:0.18rem solid var(--gray-04);border-top-color:var(--gray-01);animation:spin 1s infinite linear}:host .loading--double{border-style:double;border-width:0.5rem}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}:host([disabled]) li .text{color:var(--darkGray)}:host([disabled]) .toggle-icon{pointer-events:none}";
|
|
9
|
+
const gxgTreeItemCss = "/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0;}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px;}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}: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}:host{--text-color:var(--color-on-background);--font-family:\"Source Sans Pro\", sans-serif;--font-weight:normal;--font-size:12px;--guide-color:var(--gray-06);--item-hover-color:var(--gray-01);--item-active-color:var(--silverGray);color:var(--color-on-background);width:100%;display:block}:host li{list-style:none;font-family:var(--font-family);font-size:var(--font-size);font-weight:var(--font-weight);color:var(--text-color);overflow:hidden}:host li>::slotted(gxg-tree){display:none}:host li.tree-open>::slotted(gxg-tree){display:block}:host li.tree-closed .vertical-line{display:none}:host li .li-text{min-height:24px;cursor:pointer;display:flex;align-items:center;position:relative;padding-inline-end:var(--spacing-comp-01)}:host li .li-text:hover{background-color:var(--item-hover-color)}:host li .li-text:active{background-color:var(--gxg-background-color-item-selected)}:host li .li-text:focus{outline-style:solid;outline-color:var(--color-primary-active);outline-width:var(--border-width-md);outline-offset:-2px}:host li .li-text--selected{background-color:var(--gxg-background-color-item-selected)}:host li .li-text>*{flex-shrink:0}:host li .vertical-line{position:absolute;width:1px;height:0;top:23px;left:15px;z-index:1;background-image:linear-gradient(var(--guide-color) 28%, rgba(255, 255, 255, 0) 0%);background-position:right;background-size:1px 4px;background-repeat:repeat-y}:host li .horizontal-line{position:absolute;height:1px;top:11px;z-index:1;background-image:linear-gradient(to right, var(--guide-color) 33%, rgba(255, 255, 255, 0) 0%);background-position:bottom;background-size:3px 1px;background-repeat:repeat-x}:host li .horizontal-line.display-none{display:none}:host li .closed-opened-icons{position:relative;display:flex;margin-left:-2px}:host li .toggle-icon{position:relative;z-index:2;transform:scale(0.75, 0.75);margin-inline-end:var(--spacing-comp-00);transition-property:opacity;transition-duration:0.5s;transition-timing-function:ease;background-color:var(--color-hover)}:host li .toggle-icon:hover{background-color:var(--color-background)}:host .checkbox{margin-inline-end:var(--spacing-comp-01)}:host .icon--left{margin:0 var(--spacing-comp-01) 0 var(--spacing-comp-00)}:host .right-icon{margin-inline-start:auto;position:relative;top:0;transition-property:top;transition-duration:0.5s;transition-timing-function:ease}:host .loading{opacity:1;display:inline;z-index:1;margin-inline-end:var(--spacing-comp-01);border-radius:50%;width:8px;height:8px;border:0.18rem solid var(--gray-04);border-top-color:var(--gray-01);animation:spin 1s infinite linear}:host .loading--double{border-style:double;border-width:0.5rem}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}:host([disabled]) li .text{color:var(--darkGray)}:host([disabled]) .toggle-icon{pointer-events:none}";
|
|
10
10
|
|
|
11
11
|
const GxgTreeItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
12
12
|
constructor() {
|
|
@@ -17,12 +17,29 @@ const GxgTreeItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
17
17
|
this.selectionChanged = createEvent(this, "selectionChanged", 7);
|
|
18
18
|
this.doubleClicked = createEvent(this, "doubleClicked", 7);
|
|
19
19
|
this.checkboxToggled = createEvent(this, "checkboxToggled", 7);
|
|
20
|
+
this.lazyChanged = createEvent(this, "lazyChanged", 7);
|
|
21
|
+
this.lazy = false; //True if not leaf but no children.
|
|
22
|
+
this.parentTreeIsMasterTree = false;
|
|
23
|
+
this.numberOfParentTrees = 1;
|
|
24
|
+
this.firstItem = false;
|
|
25
|
+
this.lastItem = false;
|
|
26
|
+
this.leftPadding = "0px";
|
|
27
|
+
this.verticalLineStartPosition = "0px";
|
|
28
|
+
this.horizontalLineWidth = "24px";
|
|
29
|
+
this.horizontalLineStartPosition = "0px";
|
|
20
30
|
this.parts = {
|
|
21
31
|
item: "item",
|
|
22
32
|
checkbox: "checkbox",
|
|
23
33
|
toggleButton: "toggle-button",
|
|
24
34
|
};
|
|
25
|
-
//
|
|
35
|
+
// 3.STATE() VARIABLES //
|
|
36
|
+
this.horizontalLinePaddingLeft = 0;
|
|
37
|
+
this.lastTreeItem = false;
|
|
38
|
+
this.lastTreeItemOfParentTree = false;
|
|
39
|
+
this.numberOfVisibleDescendantItems = 0;
|
|
40
|
+
this.time = 0;
|
|
41
|
+
this.downloading = false;
|
|
42
|
+
// 4.PUBLIC PROPERTY API | WATCH'S //
|
|
26
43
|
/**
|
|
27
44
|
* Set this attribute if you want this item to display a checkbox. This attribute is affected by the parent tree-item checkbox attribute, unless it is set in this item.
|
|
28
45
|
*/
|
|
@@ -55,24 +72,15 @@ const GxgTreeItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
55
72
|
* This property is for internal use, when using the treeModel.
|
|
56
73
|
*/
|
|
57
74
|
this.numberOfChildren = 0;
|
|
75
|
+
/**
|
|
76
|
+
* This property is for internal use. It indicates that the item has children.
|
|
77
|
+
*/
|
|
58
78
|
this.hasChildTree = false;
|
|
79
|
+
/**
|
|
80
|
+
* This property is for internal use. It indicates that the checkbox has an indeterminate state.
|
|
81
|
+
*/
|
|
59
82
|
this.indeterminate = false;
|
|
60
|
-
//
|
|
61
|
-
this.horizontalLinePaddingLeft = 0;
|
|
62
|
-
this.lastTreeItem = false;
|
|
63
|
-
this.lastTreeItemOfParentTree = false;
|
|
64
|
-
this.numberOfVisibleDescendantItems = 0;
|
|
65
|
-
this.time = 0;
|
|
66
|
-
this.downloading = false;
|
|
67
|
-
this.lazy = false; //True if not leaf but no children.
|
|
68
|
-
this.parentTreeIsMasterTree = false;
|
|
69
|
-
this.numberOfParentTrees = 1;
|
|
70
|
-
this.firstItem = false;
|
|
71
|
-
this.lastItem = false;
|
|
72
|
-
this.leftPadding = "0px";
|
|
73
|
-
this.verticalLineStartPosition = "0px";
|
|
74
|
-
this.horizontalLineWidth = "24px";
|
|
75
|
-
this.horizontalLineStartPosition = "0px";
|
|
83
|
+
// 9.LOCAL METHODS //
|
|
76
84
|
this.evaluateId = () => {
|
|
77
85
|
if (!this.id) {
|
|
78
86
|
this.id = this.el.getAttribute("id");
|
|
@@ -96,31 +104,6 @@ const GxgTreeItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
96
104
|
this.initiateMutationObserver = () => {
|
|
97
105
|
this.observer.observe(this.el, { childList: true, subtree: true });
|
|
98
106
|
};
|
|
99
|
-
this.evaluateCheckboxStatus = () => {
|
|
100
|
-
const allChildren = this.el.querySelectorAll("gxg-tree-item");
|
|
101
|
-
let checked = 0;
|
|
102
|
-
if (allChildren === null || allChildren === void 0 ? void 0 : allChildren.length) {
|
|
103
|
-
Array.from(allChildren).forEach((item) => {
|
|
104
|
-
if (item.checked) {
|
|
105
|
-
checked++;
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
if (allChildren.length === checked) {
|
|
109
|
-
//all checked
|
|
110
|
-
this.checked = true;
|
|
111
|
-
this.indeterminate = false;
|
|
112
|
-
}
|
|
113
|
-
else if (checked === 0) {
|
|
114
|
-
//all unchecked
|
|
115
|
-
this.checked = false;
|
|
116
|
-
this.indeterminate = false;
|
|
117
|
-
}
|
|
118
|
-
else {
|
|
119
|
-
//indeterminate
|
|
120
|
-
this.indeterminate = true;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
107
|
/**
|
|
125
108
|
* @description Set some properties based on the parent tree configuration, unless this item has this properties already set.
|
|
126
109
|
*/
|
|
@@ -185,296 +168,375 @@ const GxgTreeItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
185
168
|
this.leftPadding = `${value}px`;
|
|
186
169
|
this.horizontalLineStartPosition = `${horizontalLineStartPosition}px`;
|
|
187
170
|
};
|
|
188
|
-
this.
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
this.
|
|
195
|
-
id: this.
|
|
196
|
-
label: this.
|
|
171
|
+
this.liTextClickedHandler = (e) => {
|
|
172
|
+
const toggleWasClicked = e.target.classList.contains("toggle-icon");
|
|
173
|
+
const checkboxClicked = e.target.nodeName === "GXG-FORM-CHECKBOX";
|
|
174
|
+
if (toggleWasClicked || checkboxClicked)
|
|
175
|
+
return;
|
|
176
|
+
if (e.ctrlKey || !this.selected) {
|
|
177
|
+
this.selectionChanged.emit({
|
|
178
|
+
id: this.id,
|
|
179
|
+
label: this.label,
|
|
197
180
|
checked: this.checked,
|
|
198
|
-
selected: this.selected,
|
|
181
|
+
selected: !this.selected,
|
|
182
|
+
ctrlKey: e.ctrlKey,
|
|
199
183
|
});
|
|
200
184
|
}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
checkboxToggledHandler() {
|
|
204
|
-
this.evaluateCheckboxStatus();
|
|
205
|
-
}
|
|
206
|
-
componentWillLoad() {
|
|
207
|
-
//Count number of parent trees in order to set the appropriate padding-left
|
|
208
|
-
this.numberOfParentTrees = this.getParentsNumber();
|
|
209
|
-
this.numberOfChildren = this.getChildrenNumber();
|
|
210
|
-
//If is last item of tree
|
|
211
|
-
const nextItem = this.el.nextElementSibling;
|
|
212
|
-
if (nextItem === null) {
|
|
213
|
-
this.lastTreeItem = true;
|
|
214
|
-
}
|
|
215
|
-
if (this.numberOfParentTrees === 1) {
|
|
216
|
-
this.parentTreeIsMasterTree = true;
|
|
217
|
-
const prevItem = this.el.previousElementSibling;
|
|
218
|
-
if (prevItem === null) {
|
|
219
|
-
//If is first item of parent tree...
|
|
220
|
-
this.firstItem = true;
|
|
185
|
+
if (e.ctrlKey) {
|
|
186
|
+
this.selected = !this.selected;
|
|
221
187
|
}
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
}
|
|
226
|
-
this.
|
|
227
|
-
|
|
228
|
-
this.defineLineHeight();
|
|
229
|
-
this.defineStartPosition();
|
|
230
|
-
this.cascadeConfig();
|
|
231
|
-
this.attachExportParts();
|
|
232
|
-
this.initiateMutationObserver();
|
|
233
|
-
}
|
|
234
|
-
getParentsNumber() {
|
|
235
|
-
var _a;
|
|
236
|
-
let count = 0;
|
|
237
|
-
let parentElement = this.el.parentElement;
|
|
238
|
-
while ((parentElement === null || parentElement === void 0 ? void 0 : parentElement.nodeName) === "GXG-TREE") {
|
|
239
|
-
count++;
|
|
240
|
-
parentElement = (_a = parentElement.parentElement) === null || _a === void 0 ? void 0 : _a.parentElement;
|
|
241
|
-
}
|
|
242
|
-
return count;
|
|
243
|
-
}
|
|
244
|
-
getChildrenNumber() {
|
|
245
|
-
if (this.numberOfChildren === 0) {
|
|
246
|
-
//If this.numberOfChildren === 0 it might be because the whole tree was created with markup, and not by passing a model. In that case, count the children with querySelectorAll.
|
|
247
|
-
return this.el.querySelectorAll("gxg-tree-item").length;
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
toggleClickedHandler(e) {
|
|
251
|
-
this.toggleIconClicked.emit({ id: this.id, lazy: this.lazy });
|
|
252
|
-
if (this.lazy && !this.opened) {
|
|
253
|
-
this.downloading = true;
|
|
254
|
-
}
|
|
255
|
-
if (!this.lazy) {
|
|
256
|
-
this.opened = !this.opened;
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
async reRender() {
|
|
260
|
-
this.defineLineHeight();
|
|
261
|
-
}
|
|
262
|
-
liTextClickedHandler(e) {
|
|
263
|
-
const toggleWasClicked = e.target.classList.contains("toggle-icon");
|
|
264
|
-
const checkboxClicked = e.target.nodeName === "GXG-FORM-CHECKBOX";
|
|
265
|
-
if (toggleWasClicked || checkboxClicked)
|
|
266
|
-
return;
|
|
267
|
-
if (e.ctrlKey || !this.selected) {
|
|
268
|
-
this.selectionChanged.emit({
|
|
188
|
+
else if (!this.selected) {
|
|
189
|
+
this.selected = true;
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
this.liTextDoubleClicked = () => {
|
|
193
|
+
this.doubleClicked.emit({
|
|
269
194
|
id: this.id,
|
|
270
|
-
label: this.label,
|
|
271
|
-
checked: this.checked,
|
|
272
|
-
selected: !this.selected,
|
|
273
|
-
ctrlKey: e.ctrlKey,
|
|
274
195
|
});
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
this.selected = true;
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
liTextDoubleClicked(e) {
|
|
284
|
-
this.doubleClicked.emit({
|
|
285
|
-
id: this.id,
|
|
286
|
-
});
|
|
287
|
-
!this.leaf && this.toggleClickedHandler(e);
|
|
288
|
-
}
|
|
289
|
-
liTextKeyDownPressed(e) {
|
|
290
|
-
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
291
|
-
e.preventDefault(); //prevents scrolling
|
|
292
|
-
}
|
|
293
|
-
//ENTER
|
|
294
|
-
if (e.key === "Enter") {
|
|
295
|
-
//Enter should check/uncheck the checkbox (if present)
|
|
296
|
-
this.checkboxClickedHandler();
|
|
297
|
-
}
|
|
298
|
-
//LEFT/RIGHT NAVIGATION
|
|
299
|
-
if (e.key === "ArrowRight" && !this.leaf) {
|
|
300
|
-
//Toggle the tree
|
|
301
|
-
if (!this.opened) {
|
|
302
|
-
this.opened = true;
|
|
196
|
+
!this.leaf && this.toggleClickedHandler();
|
|
197
|
+
};
|
|
198
|
+
this.liTextKeyDownPressed = (e) => {
|
|
199
|
+
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
200
|
+
e.preventDefault(); //prevents scrolling
|
|
303
201
|
}
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
childTreeFirstChildrenLiText.focus();
|
|
202
|
+
//ENTER
|
|
203
|
+
if (e.key === "Enter") {
|
|
204
|
+
//Enter should check/uncheck the checkbox (if present)
|
|
205
|
+
this.checkboxClickedHandler();
|
|
309
206
|
}
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
if (hasParent) {
|
|
322
|
-
parentGxgTreeItemLiText.focus();
|
|
207
|
+
//LEFT/RIGHT NAVIGATION
|
|
208
|
+
if (e.key === "ArrowRight" && !this.leaf) {
|
|
209
|
+
//Toggle the tree
|
|
210
|
+
if (!this.opened) {
|
|
211
|
+
this.opened = true;
|
|
212
|
+
}
|
|
213
|
+
else {
|
|
214
|
+
const childTree = this.el.querySelector("gxg-tree");
|
|
215
|
+
const childTreeFirstChildren = childTree.querySelector("gxg-tree-item");
|
|
216
|
+
const childTreeFirstChildrenLiText = childTreeFirstChildren.shadowRoot.querySelector(".li-text");
|
|
217
|
+
childTreeFirstChildrenLiText.focus();
|
|
323
218
|
}
|
|
324
219
|
}
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
220
|
+
if (e.key === "ArrowLeft") {
|
|
221
|
+
let hasParent = false;
|
|
222
|
+
const parentGxgTreeItem = this.el.parentElement.parentElement;
|
|
223
|
+
let parentGxgTreeItemLiText = null;
|
|
224
|
+
if (parentGxgTreeItem.tagName === "GXG-TREE-ITEM") {
|
|
225
|
+
hasParent = true;
|
|
226
|
+
parentGxgTreeItemLiText = parentGxgTreeItem.shadowRoot.querySelector(".li-text");
|
|
329
227
|
}
|
|
330
|
-
|
|
228
|
+
if (this.leaf) {
|
|
331
229
|
if (hasParent) {
|
|
332
230
|
parentGxgTreeItemLiText.focus();
|
|
333
231
|
}
|
|
334
232
|
}
|
|
335
|
-
}
|
|
336
|
-
this.toggleIconClicked.emit({ id: this.id }); //this recalculates the vertical line height
|
|
337
|
-
}
|
|
338
|
-
// UP/DOWN NAVIGATION
|
|
339
|
-
if (e.key === "ArrowUp" || (e.key === "Tab" && e.shiftKey)) {
|
|
340
|
-
e.preventDefault();
|
|
341
|
-
if (!this.firstItem) {
|
|
342
|
-
//Is not the first element of the parent
|
|
343
|
-
//Set focus on the prev item
|
|
344
|
-
let prevItem;
|
|
345
|
-
const prevElementSibling = this.el.previousElementSibling;
|
|
346
|
-
if (e.shiftKey && e.key !== "Tab") {
|
|
347
|
-
//if shift key was pressed, navigate to the previous sibling
|
|
348
|
-
if (prevElementSibling !== null) {
|
|
349
|
-
prevItem = prevElementSibling.shadowRoot.querySelector("li .li-text");
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
233
|
else {
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
prevItem = parentParentItem.shadowRoot.querySelector("li .li-text");
|
|
234
|
+
const li = this.el.shadowRoot.querySelector("li");
|
|
235
|
+
if (li.classList.contains("tree-open")) {
|
|
236
|
+
this.opened = false;
|
|
357
237
|
}
|
|
358
238
|
else {
|
|
359
|
-
|
|
239
|
+
if (hasParent) {
|
|
240
|
+
parentGxgTreeItemLiText.focus();
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
// UP/DOWN NAVIGATION
|
|
246
|
+
if (e.key === "ArrowUp" || (e.key === "Tab" && e.shiftKey)) {
|
|
247
|
+
e.preventDefault();
|
|
248
|
+
if (!this.firstItem) {
|
|
249
|
+
//Is not the first element of the parent
|
|
250
|
+
//Set focus on the prev item
|
|
251
|
+
let prevItem;
|
|
252
|
+
const prevElementSibling = this.el.previousElementSibling;
|
|
253
|
+
if (e.shiftKey && e.key !== "Tab") {
|
|
254
|
+
//if shift key was pressed, navigate to the previous sibling
|
|
360
255
|
if (prevElementSibling !== null) {
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
256
|
+
prevItem = prevElementSibling.shadowRoot.querySelector("li .li-text");
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
else {
|
|
260
|
+
if (prevElementSibling === null) {
|
|
261
|
+
const parentItem = this.el.parentElement;
|
|
262
|
+
const parentParentItem = parentItem.parentElement;
|
|
263
|
+
prevItem = parentParentItem.shadowRoot.querySelector("li .li-text");
|
|
264
|
+
}
|
|
265
|
+
else {
|
|
266
|
+
prevItem = prevElementSibling.shadowRoot.querySelector("li .li-text");
|
|
267
|
+
if (prevElementSibling !== null) {
|
|
268
|
+
//If the preceding tree-item has tree inside...
|
|
269
|
+
const prevElementSiblingHasChildTree = prevElementSibling
|
|
270
|
+
.hasChildTree;
|
|
271
|
+
if (prevElementSiblingHasChildTree) {
|
|
272
|
+
const prevElementSiblingHasOpenTree = prevElementSibling
|
|
273
|
+
.opened;
|
|
274
|
+
if (prevElementSiblingHasOpenTree) {
|
|
275
|
+
//If preceding tree-item tree is opened, then the prev item is the last item of that tree
|
|
276
|
+
const prevElemSiblingTreeItem = this.el
|
|
277
|
+
.previousElementSibling;
|
|
278
|
+
const prevElemSiblingTreeItemTree = prevElemSiblingTreeItem.querySelector("gxg-tree");
|
|
279
|
+
//
|
|
280
|
+
if (prevElemSiblingTreeItemTree.lastElementChild
|
|
281
|
+
.hasChildTree) {
|
|
282
|
+
if (prevElemSiblingTreeItemTree.lastElementChild.shadowRoot
|
|
283
|
+
.querySelector("li")
|
|
284
|
+
.classList.contains("tree-open")) {
|
|
285
|
+
prevItem = prevElemSiblingTreeItemTree.lastElementChild
|
|
286
|
+
.querySelector("gxg-tree")
|
|
287
|
+
.lastElementChild.shadowRoot.querySelector("li .li-text");
|
|
288
|
+
}
|
|
289
|
+
else {
|
|
290
|
+
prevItem = prevElemSiblingTreeItemTree.lastElementChild.shadowRoot.querySelector("li .li-text");
|
|
291
|
+
}
|
|
381
292
|
}
|
|
382
293
|
else {
|
|
383
294
|
prevItem = prevElemSiblingTreeItemTree.lastElementChild.shadowRoot.querySelector("li .li-text");
|
|
384
295
|
}
|
|
296
|
+
//
|
|
385
297
|
}
|
|
386
298
|
else {
|
|
387
|
-
|
|
299
|
+
//The preciding item has a tree, but it is closed
|
|
300
|
+
prevItem = this.el.previousElementSibling.shadowRoot.querySelector("li .li-text");
|
|
388
301
|
}
|
|
389
|
-
//
|
|
390
|
-
}
|
|
391
|
-
else {
|
|
392
|
-
//The preciding item has a tree, but it is closed
|
|
393
|
-
prevItem = this.el.previousElementSibling.shadowRoot.querySelector("li .li-text");
|
|
394
302
|
}
|
|
395
303
|
}
|
|
396
304
|
}
|
|
397
305
|
}
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
306
|
+
if (prevItem !== null && prevItem !== undefined) {
|
|
307
|
+
prevItem.focus();
|
|
308
|
+
}
|
|
401
309
|
}
|
|
402
310
|
}
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
311
|
+
if (e.key === "ArrowDown" || (e.key === "Tab" && !e.shiftKey)) {
|
|
312
|
+
e.preventDefault();
|
|
313
|
+
if (!this.lastTreeItemOfParentTree) {
|
|
314
|
+
//Set focus on the next item
|
|
315
|
+
let nextItem;
|
|
316
|
+
if (e.shiftKey) {
|
|
317
|
+
//if shift key was pressed, navigate to the next sibling
|
|
318
|
+
if (this.el.nextElementSibling !== null) {
|
|
319
|
+
nextItem = this.el.nextElementSibling.shadowRoot.querySelector("li .li-text");
|
|
320
|
+
}
|
|
413
321
|
}
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
322
|
+
else {
|
|
323
|
+
if (this.lastTreeItem) {
|
|
324
|
+
if (this.hasChildTree && this.opened) {
|
|
325
|
+
nextItem = this.el.firstElementChild.firstElementChild.shadowRoot.querySelector(".li-text");
|
|
326
|
+
}
|
|
327
|
+
else {
|
|
328
|
+
const thisTree = this.el.parentElement;
|
|
329
|
+
const thisTreeParent = thisTree.parentElement;
|
|
330
|
+
const thisTreeParentNextTree = thisTreeParent.nextElementSibling;
|
|
331
|
+
if (thisTreeParentNextTree === null) {
|
|
332
|
+
if (thisTreeParent.parentElement.parentElement
|
|
333
|
+
.nextElementSibling !== null) {
|
|
334
|
+
nextItem = thisTreeParent.parentElement.parentElement.nextElementSibling.shadowRoot.querySelector(".li-text");
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
else {
|
|
338
|
+
nextItem = thisTreeParentNextTree.shadowRoot.querySelector(".li-text");
|
|
339
|
+
}
|
|
340
|
+
}
|
|
419
341
|
}
|
|
420
342
|
else {
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
if (thisTreeParent.parentElement.parentElement
|
|
426
|
-
.nextElementSibling !== null) {
|
|
427
|
-
nextItem = thisTreeParent.parentElement.parentElement.nextElementSibling.shadowRoot.querySelector(".li-text");
|
|
428
|
-
}
|
|
343
|
+
if (this.hasChildTree && this.opened) {
|
|
344
|
+
nextItem = this.el
|
|
345
|
+
.querySelector("gxg-tree gxg-tree-item")
|
|
346
|
+
.shadowRoot.querySelector("li .li-text");
|
|
429
347
|
}
|
|
430
348
|
else {
|
|
431
|
-
nextItem =
|
|
349
|
+
nextItem = this.el.nextElementSibling.shadowRoot.querySelector(".li-text");
|
|
432
350
|
}
|
|
433
351
|
}
|
|
434
352
|
}
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
nextItem = this.el
|
|
438
|
-
.querySelector("gxg-tree gxg-tree-item")
|
|
439
|
-
.shadowRoot.querySelector("li .li-text");
|
|
440
|
-
}
|
|
441
|
-
else {
|
|
442
|
-
nextItem = this.el.nextElementSibling.shadowRoot.querySelector(".li-text");
|
|
443
|
-
}
|
|
353
|
+
if (nextItem !== null && nextItem !== undefined) {
|
|
354
|
+
nextItem.focus();
|
|
444
355
|
}
|
|
445
356
|
}
|
|
446
|
-
|
|
447
|
-
|
|
357
|
+
else {
|
|
358
|
+
//Last element of parent tree
|
|
359
|
+
if (!this.leaf && this.opened) {
|
|
360
|
+
const childTreeFirstTreeItem = this.el.firstElementChild.firstElementChild.shadowRoot.querySelector("li .li-text");
|
|
361
|
+
childTreeFirstTreeItem.focus();
|
|
362
|
+
}
|
|
448
363
|
}
|
|
449
364
|
}
|
|
365
|
+
};
|
|
366
|
+
this.returnToggleIconType = () => {
|
|
367
|
+
//Returns the type of icon : expand or collapse
|
|
368
|
+
if (!this.opened || this.lazy) {
|
|
369
|
+
return "gemini-tools/add";
|
|
370
|
+
}
|
|
450
371
|
else {
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
372
|
+
return "gemini-tools/minus";
|
|
373
|
+
}
|
|
374
|
+
};
|
|
375
|
+
/**
|
|
376
|
+
* When a checkbox is clicked, it state changes and so it's children, and parent items do.
|
|
377
|
+
* First evaluate the children, and then the parent items.
|
|
378
|
+
*/
|
|
379
|
+
this.checkboxClickedHandler = () => {
|
|
380
|
+
if (this.checkbox) {
|
|
381
|
+
this.checked = !this.checked;
|
|
382
|
+
if (!this.leaf) {
|
|
383
|
+
this.toggleChildrenCheckboxes(this.checked);
|
|
455
384
|
}
|
|
385
|
+
const parentItems = this.getParentItems();
|
|
386
|
+
parentItems.forEach((parentItem) => {
|
|
387
|
+
parentItem.evaluateCheckboxStatus();
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
};
|
|
391
|
+
this.toggleChildrenCheckboxes = (checked) => {
|
|
392
|
+
this.indeterminate = false;
|
|
393
|
+
const allChildren = this.el.querySelectorAll("gxg-tree-item");
|
|
394
|
+
if (allChildren === null || allChildren === void 0 ? void 0 : allChildren.length) {
|
|
395
|
+
Array.from(allChildren).forEach((item) => {
|
|
396
|
+
item.indeterminate = false;
|
|
397
|
+
item.checked = checked;
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
};
|
|
401
|
+
this.getParentItems = () => {
|
|
402
|
+
var _a;
|
|
403
|
+
const parentItems = [];
|
|
404
|
+
let parentItem = this.el.parentElement.parentElement;
|
|
405
|
+
while ((parentItem === null || parentItem === void 0 ? void 0 : parentItem.nodeName) === "GXG-TREE-ITEM") {
|
|
406
|
+
parentItems.push(parentItem);
|
|
407
|
+
parentItem = (_a = parentItem.parentElement) === null || _a === void 0 ? void 0 : _a.parentElement;
|
|
456
408
|
}
|
|
409
|
+
return parentItems;
|
|
410
|
+
};
|
|
411
|
+
this.getParentsNumber = () => {
|
|
412
|
+
var _a;
|
|
413
|
+
let count = 0;
|
|
414
|
+
let parentElement = this.el.parentElement;
|
|
415
|
+
while ((parentElement === null || parentElement === void 0 ? void 0 : parentElement.nodeName) === "GXG-TREE") {
|
|
416
|
+
count++;
|
|
417
|
+
parentElement = (_a = parentElement.parentElement) === null || _a === void 0 ? void 0 : _a.parentElement;
|
|
418
|
+
}
|
|
419
|
+
return count;
|
|
420
|
+
};
|
|
421
|
+
this.getChildrenNumber = () => {
|
|
422
|
+
if (this.numberOfChildren === 0) {
|
|
423
|
+
//If this.numberOfChildren === 0 it might be because the whole tree was created with markup, and not by passing a model. In that case, count the children with querySelectorAll.
|
|
424
|
+
return this.el.querySelectorAll("gxg-tree-item").length;
|
|
425
|
+
}
|
|
426
|
+
};
|
|
427
|
+
this.toggleClickedHandler = () => {
|
|
428
|
+
if (this.lazy && !this.opened) {
|
|
429
|
+
this.downloading = true;
|
|
430
|
+
this.toggleIconClicked.emit({
|
|
431
|
+
checked: this.checked,
|
|
432
|
+
description: this.description,
|
|
433
|
+
icon: this.icon,
|
|
434
|
+
id: this.id,
|
|
435
|
+
indeterminate: this.indeterminate,
|
|
436
|
+
label: this.label,
|
|
437
|
+
lazy: this.lazy,
|
|
438
|
+
leaf: this.leaf,
|
|
439
|
+
opened: this.opened,
|
|
440
|
+
selected: this.selected,
|
|
441
|
+
});
|
|
442
|
+
}
|
|
443
|
+
if (!this.lazy) {
|
|
444
|
+
this.opened = !this.opened;
|
|
445
|
+
}
|
|
446
|
+
};
|
|
447
|
+
}
|
|
448
|
+
checkedHandler(newValue, oldValue) {
|
|
449
|
+
if (oldValue !== undefined) {
|
|
450
|
+
this.checkboxToggled.emit({
|
|
451
|
+
checked: newValue,
|
|
452
|
+
description: this.description,
|
|
453
|
+
icon: this.icon,
|
|
454
|
+
id: this.id,
|
|
455
|
+
indeterminate: this.indeterminate,
|
|
456
|
+
label: this.label,
|
|
457
|
+
lazy: this.lazy,
|
|
458
|
+
leaf: this.leaf,
|
|
459
|
+
opened: this.opened,
|
|
460
|
+
selected: this.selected,
|
|
461
|
+
});
|
|
457
462
|
}
|
|
458
463
|
}
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
464
|
+
openedHandler(newValue, oldValue) {
|
|
465
|
+
if (oldValue !== undefined) {
|
|
466
|
+
this.toggleIconClicked.emit({
|
|
467
|
+
checked: this.checked,
|
|
468
|
+
description: this.description,
|
|
469
|
+
icon: this.icon,
|
|
470
|
+
id: this.id,
|
|
471
|
+
indeterminate: this.indeterminate,
|
|
472
|
+
label: this.label,
|
|
473
|
+
lazy: this.lazy,
|
|
474
|
+
leaf: this.leaf,
|
|
475
|
+
opened: newValue,
|
|
476
|
+
selected: this.selected,
|
|
477
|
+
});
|
|
463
478
|
}
|
|
464
|
-
|
|
465
|
-
|
|
479
|
+
}
|
|
480
|
+
// 6.COMPONENT LIFECYCLE METHODS //
|
|
481
|
+
componentWillLoad() {
|
|
482
|
+
//Count number of parent trees in order to set the appropriate padding-left
|
|
483
|
+
this.numberOfParentTrees = this.getParentsNumber();
|
|
484
|
+
this.numberOfChildren = this.getChildrenNumber();
|
|
485
|
+
//If is last item of tree
|
|
486
|
+
const nextItem = this.el.nextElementSibling;
|
|
487
|
+
if (nextItem === null) {
|
|
488
|
+
this.lastTreeItem = true;
|
|
466
489
|
}
|
|
490
|
+
if (this.numberOfParentTrees === 1) {
|
|
491
|
+
this.parentTreeIsMasterTree = true;
|
|
492
|
+
const prevItem = this.el.previousElementSibling;
|
|
493
|
+
if (prevItem === null) {
|
|
494
|
+
//If is first item of parent tree...
|
|
495
|
+
this.firstItem = true;
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
if (!this.el.nextElementSibling) {
|
|
499
|
+
this.lastItem = true;
|
|
500
|
+
}
|
|
501
|
+
this.evaluateId();
|
|
502
|
+
this.evaluateLazy();
|
|
503
|
+
this.defineLineHeight();
|
|
504
|
+
this.defineStartPosition();
|
|
505
|
+
this.cascadeConfig();
|
|
506
|
+
this.attachExportParts();
|
|
507
|
+
this.initiateMutationObserver();
|
|
467
508
|
}
|
|
468
|
-
|
|
469
|
-
|
|
509
|
+
// 7.LISTENERS //
|
|
510
|
+
// 8.PUBLIC METHODS API //
|
|
511
|
+
async reRender() {
|
|
512
|
+
this.defineLineHeight();
|
|
513
|
+
}
|
|
514
|
+
evaluateCheckboxStatus() {
|
|
470
515
|
const allChildren = this.el.querySelectorAll("gxg-tree-item");
|
|
516
|
+
let checked = 0;
|
|
471
517
|
if (allChildren === null || allChildren === void 0 ? void 0 : allChildren.length) {
|
|
472
518
|
Array.from(allChildren).forEach((item) => {
|
|
473
|
-
item.
|
|
474
|
-
|
|
519
|
+
if (item.checked) {
|
|
520
|
+
checked++;
|
|
521
|
+
}
|
|
475
522
|
});
|
|
523
|
+
if (allChildren.length === checked) {
|
|
524
|
+
//all checked
|
|
525
|
+
this.checked = true;
|
|
526
|
+
this.indeterminate = false;
|
|
527
|
+
}
|
|
528
|
+
else if (checked === 0) {
|
|
529
|
+
//all unchecked
|
|
530
|
+
this.checked = false;
|
|
531
|
+
this.indeterminate = false;
|
|
532
|
+
}
|
|
533
|
+
else {
|
|
534
|
+
//indeterminate
|
|
535
|
+
this.indeterminate = true;
|
|
536
|
+
}
|
|
476
537
|
}
|
|
477
538
|
}
|
|
539
|
+
// 10.RENDER() FUNCTION //
|
|
478
540
|
render() {
|
|
479
541
|
return (h(Host, { class: { leaf: this.leaf, "not-leaf": !this.leaf }, exportParts: this.exportparts ? this.exportparts : null }, h("li", { class: {
|
|
480
542
|
"tree-open": this.opened,
|
|
@@ -506,6 +568,10 @@ const GxgTreeItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
506
568
|
}
|
|
507
569
|
static get assetsDirs() { return ["tree-item-assets"]; }
|
|
508
570
|
get el() { return this; }
|
|
571
|
+
static get watchers() { return {
|
|
572
|
+
"checked": ["checkedHandler"],
|
|
573
|
+
"opened": ["openedHandler"]
|
|
574
|
+
}; }
|
|
509
575
|
static get style() { return gxgTreeItemCss; }
|
|
510
576
|
}, [1, "gxg-tree-item", {
|
|
511
577
|
"checkbox": [1028],
|
|
@@ -530,8 +596,9 @@ const GxgTreeItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
530
596
|
"time": [32],
|
|
531
597
|
"lineHeight": [32],
|
|
532
598
|
"downloading": [32],
|
|
533
|
-
"reRender": [64]
|
|
534
|
-
|
|
599
|
+
"reRender": [64],
|
|
600
|
+
"evaluateCheckboxStatus": [64]
|
|
601
|
+
}]);
|
|
535
602
|
function defineCustomElement() {
|
|
536
603
|
if (typeof customElements === "undefined") {
|
|
537
604
|
return;
|