@genexus/genexus-ide-ui 0.0.16 → 0.0.18

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.
Files changed (81) hide show
  1. package/dist/cjs/ch-grid_7.cjs.entry.js +73 -27
  2. package/dist/cjs/genexus-ide-ui.cjs.js +1 -1
  3. package/dist/cjs/{gx-ide-container_2.cjs.entry.js → gx-ide-container.cjs.entry.js} +0 -31
  4. package/dist/cjs/gx-ide-new-kb.cjs.entry.js +16 -17
  5. package/dist/cjs/gx-ide-references.cjs.entry.js +115 -90
  6. package/dist/cjs/gx-ide-template.cjs.entry.js +2 -2
  7. package/dist/cjs/gx-ide-test.cjs.entry.js +40 -3
  8. package/dist/cjs/{gxg-form-radio-group.cjs.entry.js → gx-ide-top-bar_2.cjs.entry.js} +31 -0
  9. package/dist/cjs/gxg-combo-box_8.cjs.entry.js +3 -8
  10. package/dist/cjs/gxg-menu.cjs.entry.js +2 -2
  11. package/dist/cjs/gxg-test.cjs.entry.js +4 -23
  12. package/dist/cjs/gxg-tree_2.cjs.entry.js +381 -295
  13. package/dist/cjs/loader.cjs.js +1 -1
  14. package/dist/cjs/update-tree-model-445c63a8.js +53 -0
  15. package/dist/collection/common/render-tree.js +1 -1
  16. package/dist/collection/common/update-tree-model.js +22 -0
  17. package/dist/collection/components/_template/template.js +9 -10
  18. package/dist/collection/components/_test/test.js +129 -2
  19. package/dist/collection/components/new-kb/new-kb.js +16 -35
  20. package/dist/collection/components/references/references.js +119 -113
  21. package/dist/collection/pages/assets/common.js +105 -95
  22. package/dist/components/ch-grid2.js +74 -28
  23. package/dist/components/combo-box.js +4 -3
  24. package/dist/components/form-radio.js +0 -5
  25. package/dist/components/gx-ide-new-kb.js +20 -28
  26. package/dist/components/gx-ide-references.js +131 -111
  27. package/dist/components/gx-ide-template.js +7 -13
  28. package/dist/components/gx-ide-test.js +45 -4
  29. package/dist/components/gxg-menu.js +2 -2
  30. package/dist/components/gxg-test.js +4 -23
  31. package/dist/components/gxg-tree-item2.js +326 -284
  32. package/dist/components/gxg-tree2.js +60 -15
  33. package/dist/components/update-tree-model.js +50 -0
  34. package/dist/esm/ch-grid_7.entry.js +73 -27
  35. package/dist/esm/genexus-ide-ui.js +1 -1
  36. package/dist/esm/{gx-ide-container_2.entry.js → gx-ide-container.entry.js} +1 -31
  37. package/dist/esm/gx-ide-new-kb.entry.js +16 -17
  38. package/dist/esm/gx-ide-references.entry.js +115 -90
  39. package/dist/esm/gx-ide-template.entry.js +2 -2
  40. package/dist/esm/gx-ide-test.entry.js +40 -3
  41. package/dist/esm/{gxg-form-radio-group.entry.js → gx-ide-top-bar_2.entry.js} +32 -2
  42. package/dist/esm/gxg-combo-box_8.entry.js +3 -8
  43. package/dist/esm/gxg-menu.entry.js +2 -2
  44. package/dist/esm/gxg-test.entry.js +4 -23
  45. package/dist/esm/gxg-tree_2.entry.js +382 -296
  46. package/dist/esm/loader.js +1 -1
  47. package/dist/esm/update-tree-model-80419058.js +50 -0
  48. package/dist/genexus-ide-ui/genexus-ide-ui.css +1 -1
  49. package/dist/genexus-ide-ui/genexus-ide-ui.esm.js +1 -1
  50. package/dist/genexus-ide-ui/p-1042318d.entry.js +1 -0
  51. package/dist/genexus-ide-ui/p-1d4cf2ae.entry.js +1 -0
  52. package/dist/genexus-ide-ui/p-254f9ce7.entry.js +1 -0
  53. package/dist/genexus-ide-ui/p-49433b58.entry.js +1 -0
  54. package/dist/genexus-ide-ui/p-67cf60f5.js +1 -0
  55. package/dist/genexus-ide-ui/p-7007965c.entry.js +1 -0
  56. package/dist/genexus-ide-ui/p-78a90113.entry.js +1 -0
  57. package/dist/genexus-ide-ui/p-79cf24a3.entry.js +1 -0
  58. package/dist/genexus-ide-ui/p-b66a4121.entry.js +1 -0
  59. package/dist/genexus-ide-ui/p-cd503583.entry.js +1 -0
  60. package/dist/genexus-ide-ui/{p-1e412d88.entry.js → p-fcc98e20.entry.js} +1 -1
  61. package/dist/node_modules/@genexus/gemini/dist/collection/components/tree-item/gxg-tree-item.css +2 -2
  62. package/dist/types/common/update-tree-model.d.ts +2 -0
  63. package/dist/types/components/_template/template.d.ts +2 -2
  64. package/dist/types/components/_test/test.d.ts +19 -1
  65. package/dist/types/components/new-kb/new-kb.d.ts +0 -4
  66. package/dist/types/components/references/references.d.ts +28 -24
  67. package/dist/types/components.d.ts +41 -21
  68. package/package.json +3 -3
  69. package/dist/cjs/render-tree-25d5b8a1.js +0 -29
  70. package/dist/components/render-tree.js +0 -27
  71. package/dist/esm/render-tree-fc8636a3.js +0 -27
  72. package/dist/genexus-ide-ui/p-0f5d0ccc.entry.js +0 -1
  73. package/dist/genexus-ide-ui/p-2761a056.entry.js +0 -1
  74. package/dist/genexus-ide-ui/p-62814082.entry.js +0 -1
  75. package/dist/genexus-ide-ui/p-97430828.entry.js +0 -1
  76. package/dist/genexus-ide-ui/p-9e32e006.entry.js +0 -1
  77. package/dist/genexus-ide-ui/p-a5fee36d.entry.js +0 -1
  78. package/dist/genexus-ide-ui/p-abee8c7b.js +0 -1
  79. package/dist/genexus-ide-ui/p-be9406e7.entry.js +0 -1
  80. package/dist/genexus-ide-ui/p-eb8e9655.entry.js +0 -1
  81. package/dist/genexus-ide-ui/p-f6536bbc.entry.js +0 -1
@@ -6,23 +6,40 @@ 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() {
13
13
  super();
14
14
  this.__registerHost();
15
15
  this.__attachShadow();
16
- this.toggleIconClicked = createEvent(this, "toggleIconClicked", 7);
17
- this.selectionChanged = createEvent(this, "selectionChanged", 7);
18
- this.doubleClicked = createEvent(this, "doubleClicked", 7);
19
16
  this.checkboxToggled = createEvent(this, "checkboxToggled", 7);
17
+ this.doubleClicked = createEvent(this, "doubleClicked", 7);
18
+ this.lazyChanged = createEvent(this, "lazyChanged", 7);
19
+ this.selectionChanged = createEvent(this, "selectionChanged", 7);
20
+ this.toggleIconClicked = createEvent(this, "toggleIconClicked", 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
- //PROPS
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
- //STATE
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,350 @@ const GxgTreeItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
185
168
  this.leftPadding = `${value}px`;
186
169
  this.horizontalLineStartPosition = `${horizontalLineStartPosition}px`;
187
170
  };
188
- this.checkboxClickedHandler = () => {
189
- if (this.checkbox) {
190
- this.checked = !this.checked;
191
- if (!this.leaf) {
192
- this.toggleChildrenCheckboxes(this.checked);
193
- }
194
- this.checkboxToggled.emit({
195
- id: this.el.id,
196
- label: this.el.label,
197
- checked: this.checked,
198
- selected: this.selected,
199
- });
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) {
177
+ this.selected = !this.selected;
200
178
  }
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;
179
+ else {
180
+ this.selected = true;
221
181
  }
222
- }
223
- if (!this.el.nextElementSibling) {
224
- this.lastItem = true;
225
- }
226
- this.evaluateId();
227
- this.evaluateLazy();
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({
269
- id: this.id,
270
- label: this.label,
271
- checked: this.checked,
272
- selected: !this.selected,
273
- ctrlKey: e.ctrlKey,
274
- });
275
- }
276
- if (e.ctrlKey) {
277
- this.selected = !this.selected;
278
- }
279
- else if (!this.selected) {
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;
182
+ this.selectionChanged.emit(this.getItemData(e.ctrlKey));
183
+ };
184
+ this.liTextDoubleClicked = () => {
185
+ this.doubleClicked.emit(this.getItemData(false));
186
+ !this.leaf && this.toggleClickedHandler();
187
+ };
188
+ this.liTextKeyDownPressed = (e) => {
189
+ if (e.key === "ArrowDown" || e.key === "ArrowUp") {
190
+ e.preventDefault(); //prevents scrolling
303
191
  }
304
- else {
305
- const childTree = this.el.querySelector("gxg-tree");
306
- const childTreeFirstChildren = childTree.querySelector("gxg-tree-item");
307
- const childTreeFirstChildrenLiText = childTreeFirstChildren.shadowRoot.querySelector(".li-text");
308
- childTreeFirstChildrenLiText.focus();
192
+ //ENTER
193
+ if (e.key === "Enter") {
194
+ //Enter should check/uncheck the checkbox (if present)
195
+ this.checkboxClickedHandler();
309
196
  }
310
- this.toggleIconClicked.emit({ id: this.id }); //this recalculates the vertical line height
311
- }
312
- if (e.key === "ArrowLeft") {
313
- let hasParent = false;
314
- const parentGxgTreeItem = this.el.parentElement.parentElement;
315
- let parentGxgTreeItemLiText = null;
316
- if (parentGxgTreeItem.tagName === "GXG-TREE-ITEM") {
317
- hasParent = true;
318
- parentGxgTreeItemLiText = parentGxgTreeItem.shadowRoot.querySelector(".li-text");
319
- }
320
- if (this.leaf) {
321
- if (hasParent) {
322
- parentGxgTreeItemLiText.focus();
197
+ //LEFT/RIGHT NAVIGATION
198
+ if (e.key === "ArrowRight" && !this.leaf) {
199
+ //Toggle the tree
200
+ if (!this.opened) {
201
+ this.opened = true;
202
+ }
203
+ else {
204
+ const childTree = this.el.querySelector("gxg-tree");
205
+ const childTreeFirstChildren = childTree.querySelector("gxg-tree-item");
206
+ const childTreeFirstChildrenLiText = childTreeFirstChildren.shadowRoot.querySelector(".li-text");
207
+ childTreeFirstChildrenLiText.focus();
323
208
  }
324
209
  }
325
- else {
326
- const li = this.el.shadowRoot.querySelector("li");
327
- if (li.classList.contains("tree-open")) {
328
- this.opened = false;
210
+ if (e.key === "ArrowLeft") {
211
+ let hasParent = false;
212
+ const parentGxgTreeItem = this.el.parentElement.parentElement;
213
+ let parentGxgTreeItemLiText = null;
214
+ if (parentGxgTreeItem.tagName === "GXG-TREE-ITEM") {
215
+ hasParent = true;
216
+ parentGxgTreeItemLiText = parentGxgTreeItem.shadowRoot.querySelector(".li-text");
329
217
  }
330
- else {
218
+ if (this.leaf) {
331
219
  if (hasParent) {
332
220
  parentGxgTreeItemLiText.focus();
333
221
  }
334
222
  }
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
223
  else {
353
- if (prevElementSibling === null) {
354
- const parentItem = this.el.parentElement;
355
- const parentParentItem = parentItem.parentElement;
356
- prevItem = parentParentItem.shadowRoot.querySelector("li .li-text");
224
+ const li = this.el.shadowRoot.querySelector("li");
225
+ if (li.classList.contains("tree-open")) {
226
+ this.opened = false;
357
227
  }
358
228
  else {
359
- prevItem = prevElementSibling.shadowRoot.querySelector("li .li-text");
229
+ if (hasParent) {
230
+ parentGxgTreeItemLiText.focus();
231
+ }
232
+ }
233
+ }
234
+ }
235
+ // UP/DOWN NAVIGATION
236
+ if (e.key === "ArrowUp" || (e.key === "Tab" && e.shiftKey)) {
237
+ e.preventDefault();
238
+ if (!this.firstItem) {
239
+ //Is not the first element of the parent
240
+ //Set focus on the prev item
241
+ let prevItem;
242
+ const prevElementSibling = this.el.previousElementSibling;
243
+ if (e.shiftKey && e.key !== "Tab") {
244
+ //if shift key was pressed, navigate to the previous sibling
360
245
  if (prevElementSibling !== null) {
361
- //If the preceding tree-item has tree inside...
362
- const prevElementSiblingHasChildTree = prevElementSibling
363
- .hasChildTree;
364
- if (prevElementSiblingHasChildTree) {
365
- const prevElementSiblingHasOpenTree = prevElementSibling
366
- .opened;
367
- if (prevElementSiblingHasOpenTree) {
368
- //If preceding tree-item tree is opened, then the prev item is the last item of that tree
369
- const prevElemSiblingTreeItem = this.el
370
- .previousElementSibling;
371
- const prevElemSiblingTreeItemTree = prevElemSiblingTreeItem.querySelector("gxg-tree");
372
- //
373
- if (prevElemSiblingTreeItemTree.lastElementChild
374
- .hasChildTree) {
375
- if (prevElemSiblingTreeItemTree.lastElementChild.shadowRoot
376
- .querySelector("li")
377
- .classList.contains("tree-open")) {
378
- prevItem = prevElemSiblingTreeItemTree.lastElementChild
379
- .querySelector("gxg-tree")
380
- .lastElementChild.shadowRoot.querySelector("li .li-text");
246
+ prevItem = prevElementSibling.shadowRoot.querySelector("li .li-text");
247
+ }
248
+ }
249
+ else {
250
+ if (prevElementSibling === null) {
251
+ const parentItem = this.el.parentElement;
252
+ const parentParentItem = parentItem.parentElement;
253
+ prevItem = parentParentItem.shadowRoot.querySelector("li .li-text");
254
+ }
255
+ else {
256
+ prevItem = prevElementSibling.shadowRoot.querySelector("li .li-text");
257
+ if (prevElementSibling !== null) {
258
+ //If the preceding tree-item has tree inside...
259
+ const prevElementSiblingHasChildTree = prevElementSibling
260
+ .hasChildTree;
261
+ if (prevElementSiblingHasChildTree) {
262
+ const prevElementSiblingHasOpenTree = prevElementSibling
263
+ .opened;
264
+ if (prevElementSiblingHasOpenTree) {
265
+ //If preceding tree-item tree is opened, then the prev item is the last item of that tree
266
+ const prevElemSiblingTreeItem = this.el
267
+ .previousElementSibling;
268
+ const prevElemSiblingTreeItemTree = prevElemSiblingTreeItem.querySelector("gxg-tree");
269
+ //
270
+ if (prevElemSiblingTreeItemTree.lastElementChild
271
+ .hasChildTree) {
272
+ if (prevElemSiblingTreeItemTree.lastElementChild.shadowRoot
273
+ .querySelector("li")
274
+ .classList.contains("tree-open")) {
275
+ prevItem = prevElemSiblingTreeItemTree.lastElementChild
276
+ .querySelector("gxg-tree")
277
+ .lastElementChild.shadowRoot.querySelector("li .li-text");
278
+ }
279
+ else {
280
+ prevItem = prevElemSiblingTreeItemTree.lastElementChild.shadowRoot.querySelector("li .li-text");
281
+ }
381
282
  }
382
283
  else {
383
284
  prevItem = prevElemSiblingTreeItemTree.lastElementChild.shadowRoot.querySelector("li .li-text");
384
285
  }
286
+ //
385
287
  }
386
288
  else {
387
- prevItem = prevElemSiblingTreeItemTree.lastElementChild.shadowRoot.querySelector("li .li-text");
289
+ //The preciding item has a tree, but it is closed
290
+ prevItem = this.el.previousElementSibling.shadowRoot.querySelector("li .li-text");
388
291
  }
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
292
  }
395
293
  }
396
294
  }
397
295
  }
398
- }
399
- if (prevItem !== null && prevItem !== undefined) {
400
- prevItem.focus();
296
+ if (prevItem !== null && prevItem !== undefined) {
297
+ prevItem.focus();
298
+ }
401
299
  }
402
300
  }
403
- }
404
- if (e.key === "ArrowDown" || (e.key === "Tab" && !e.shiftKey)) {
405
- e.preventDefault();
406
- if (!this.lastTreeItemOfParentTree) {
407
- //Set focus on the next item
408
- let nextItem;
409
- if (e.shiftKey) {
410
- //if shift key was pressed, navigate to the next sibling
411
- if (this.el.nextElementSibling !== null) {
412
- nextItem = this.el.nextElementSibling.shadowRoot.querySelector("li .li-text");
301
+ if (e.key === "ArrowDown" || (e.key === "Tab" && !e.shiftKey)) {
302
+ e.preventDefault();
303
+ if (!this.lastTreeItemOfParentTree) {
304
+ //Set focus on the next item
305
+ let nextItem;
306
+ if (e.shiftKey) {
307
+ //if shift key was pressed, navigate to the next sibling
308
+ if (this.el.nextElementSibling !== null) {
309
+ nextItem = this.el.nextElementSibling.shadowRoot.querySelector("li .li-text");
310
+ }
413
311
  }
414
- }
415
- else {
416
- if (this.lastTreeItem) {
417
- if (this.hasChildTree && this.opened) {
418
- nextItem = this.el.firstElementChild.firstElementChild.shadowRoot.querySelector(".li-text");
312
+ else {
313
+ if (this.lastTreeItem) {
314
+ if (this.hasChildTree && this.opened) {
315
+ nextItem = this.el.firstElementChild.firstElementChild.shadowRoot.querySelector(".li-text");
316
+ }
317
+ else {
318
+ const thisTree = this.el.parentElement;
319
+ const thisTreeParent = thisTree.parentElement;
320
+ const thisTreeParentNextTree = thisTreeParent.nextElementSibling;
321
+ if (thisTreeParentNextTree === null) {
322
+ if (thisTreeParent.parentElement.parentElement
323
+ .nextElementSibling !== null) {
324
+ nextItem = thisTreeParent.parentElement.parentElement.nextElementSibling.shadowRoot.querySelector(".li-text");
325
+ }
326
+ }
327
+ else {
328
+ nextItem = thisTreeParentNextTree.shadowRoot.querySelector(".li-text");
329
+ }
330
+ }
419
331
  }
420
332
  else {
421
- const thisTree = this.el.parentElement;
422
- const thisTreeParent = thisTree.parentElement;
423
- const thisTreeParentNextTree = thisTreeParent.nextElementSibling;
424
- if (thisTreeParentNextTree === null) {
425
- if (thisTreeParent.parentElement.parentElement
426
- .nextElementSibling !== null) {
427
- nextItem = thisTreeParent.parentElement.parentElement.nextElementSibling.shadowRoot.querySelector(".li-text");
428
- }
333
+ if (this.hasChildTree && this.opened) {
334
+ nextItem = this.el
335
+ .querySelector("gxg-tree gxg-tree-item")
336
+ .shadowRoot.querySelector("li .li-text");
429
337
  }
430
338
  else {
431
- nextItem = thisTreeParentNextTree.shadowRoot.querySelector(".li-text");
339
+ nextItem = this.el.nextElementSibling.shadowRoot.querySelector(".li-text");
432
340
  }
433
341
  }
434
342
  }
435
- else {
436
- if (this.hasChildTree && this.opened) {
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
- }
343
+ if (nextItem !== null && nextItem !== undefined) {
344
+ nextItem.focus();
444
345
  }
445
346
  }
446
- if (nextItem !== null && nextItem !== undefined) {
447
- nextItem.focus();
347
+ else {
348
+ //Last element of parent tree
349
+ if (!this.leaf && this.opened) {
350
+ const childTreeFirstTreeItem = this.el.firstElementChild.firstElementChild.shadowRoot.querySelector("li .li-text");
351
+ childTreeFirstTreeItem.focus();
352
+ }
448
353
  }
449
354
  }
355
+ };
356
+ this.returnToggleIconType = () => {
357
+ //Returns the type of icon : expand or collapse
358
+ if (!this.opened || this.lazy) {
359
+ return "gemini-tools/add";
360
+ }
450
361
  else {
451
- //Last element of parent tree
452
- if (!this.leaf && this.opened) {
453
- const childTreeFirstTreeItem = this.el.firstElementChild.firstElementChild.shadowRoot.querySelector("li .li-text");
454
- childTreeFirstTreeItem.focus();
362
+ return "gemini-tools/minus";
363
+ }
364
+ };
365
+ /**
366
+ * When a checkbox is clicked, it state changes and so it's children, and parent items do.
367
+ * First evaluate the children, and then the parent items.
368
+ */
369
+ this.checkboxClickedHandler = () => {
370
+ if (this.checkbox) {
371
+ this.checked = !this.checked;
372
+ if (!this.leaf) {
373
+ this.toggleChildrenCheckboxes(this.checked);
455
374
  }
375
+ const parentItems = this.getParentItems();
376
+ parentItems.forEach((parentItem) => {
377
+ parentItem.evaluateCheckboxStatus();
378
+ });
456
379
  }
380
+ };
381
+ this.toggleChildrenCheckboxes = (checked) => {
382
+ this.indeterminate = false;
383
+ const allChildren = this.el.querySelectorAll("gxg-tree-item");
384
+ if (allChildren === null || allChildren === void 0 ? void 0 : allChildren.length) {
385
+ Array.from(allChildren).forEach((item) => {
386
+ item.indeterminate = false;
387
+ item.checked = checked;
388
+ });
389
+ }
390
+ };
391
+ this.getParentItems = () => {
392
+ var _a;
393
+ const parentItems = [];
394
+ let parentItem = this.el.parentElement.parentElement;
395
+ while ((parentItem === null || parentItem === void 0 ? void 0 : parentItem.nodeName) === "GXG-TREE-ITEM") {
396
+ parentItems.push(parentItem);
397
+ parentItem = (_a = parentItem.parentElement) === null || _a === void 0 ? void 0 : _a.parentElement;
398
+ }
399
+ return parentItems;
400
+ };
401
+ this.getParentsNumber = () => {
402
+ var _a;
403
+ let count = 0;
404
+ let parentElement = this.el.parentElement;
405
+ while ((parentElement === null || parentElement === void 0 ? void 0 : parentElement.nodeName) === "GXG-TREE") {
406
+ count++;
407
+ parentElement = (_a = parentElement.parentElement) === null || _a === void 0 ? void 0 : _a.parentElement;
408
+ }
409
+ return count;
410
+ };
411
+ this.getChildrenNumber = () => {
412
+ if (this.numberOfChildren === 0) {
413
+ //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.
414
+ return this.el.querySelectorAll("gxg-tree-item").length;
415
+ }
416
+ };
417
+ this.toggleClickedHandler = () => {
418
+ if (this.lazy && !this.opened) {
419
+ this.downloading = true;
420
+ this.toggleIconClicked.emit(this.getItemData());
421
+ }
422
+ if (!this.lazy) {
423
+ this.opened = !this.opened;
424
+ }
425
+ };
426
+ this.getItemData = (ctrl = false) => {
427
+ return {
428
+ ref: this.el,
429
+ checkbox: this.checkbox,
430
+ checked: this.checked,
431
+ ctrl: ctrl,
432
+ description: this.description,
433
+ disabled: this.disabled,
434
+ icon: this.icon,
435
+ id: this.id,
436
+ indeterminate: this.indeterminate,
437
+ label: this.label,
438
+ lazy: this.lazy,
439
+ leaf: this.leaf,
440
+ opened: this.opened,
441
+ selected: this.selected,
442
+ };
443
+ };
444
+ }
445
+ checkedHandler(newValue, oldValue) {
446
+ if (oldValue !== undefined) {
447
+ this.checkboxToggled.emit(this.getItemData(false));
448
+ }
449
+ }
450
+ openedHandler(newValue, oldValue) {
451
+ if (oldValue !== undefined) {
452
+ this.toggleIconClicked.emit(this.getItemData(false));
457
453
  }
458
454
  }
459
- returnToggleIconType() {
460
- //Returns the type of icon : expand or collapse
461
- if (!this.opened || this.lazy) {
462
- return "gemini-tools/add";
455
+ // 6.COMPONENT LIFECYCLE METHODS //
456
+ componentWillLoad() {
457
+ //Count number of parent trees in order to set the appropriate padding-left
458
+ this.numberOfParentTrees = this.getParentsNumber();
459
+ this.numberOfChildren = this.getChildrenNumber();
460
+ //If is last item of tree
461
+ const nextItem = this.el.nextElementSibling;
462
+ if (nextItem === null) {
463
+ this.lastTreeItem = true;
464
+ }
465
+ if (this.numberOfParentTrees === 1) {
466
+ this.parentTreeIsMasterTree = true;
467
+ const prevItem = this.el.previousElementSibling;
468
+ if (prevItem === null) {
469
+ //If is first item of parent tree...
470
+ this.firstItem = true;
471
+ }
463
472
  }
464
- else {
465
- return "gemini-tools/minus";
473
+ if (!this.el.nextElementSibling) {
474
+ this.lastItem = true;
466
475
  }
476
+ this.evaluateId();
477
+ this.evaluateLazy();
478
+ this.defineLineHeight();
479
+ this.defineStartPosition();
480
+ this.cascadeConfig();
481
+ this.attachExportParts();
482
+ this.initiateMutationObserver();
467
483
  }
468
- toggleChildrenCheckboxes(checked) {
469
- this.indeterminate = false;
484
+ // 7.LISTENERS //
485
+ // 8.PUBLIC METHODS API //
486
+ async reRender() {
487
+ this.defineLineHeight();
488
+ }
489
+ evaluateCheckboxStatus() {
470
490
  const allChildren = this.el.querySelectorAll("gxg-tree-item");
491
+ let checked = 0;
471
492
  if (allChildren === null || allChildren === void 0 ? void 0 : allChildren.length) {
472
493
  Array.from(allChildren).forEach((item) => {
473
- item.indeterminate = false;
474
- item.checked = checked;
494
+ if (item.checked) {
495
+ checked++;
496
+ }
475
497
  });
498
+ if (allChildren.length === checked) {
499
+ //all checked
500
+ this.checked = true;
501
+ this.indeterminate = false;
502
+ }
503
+ else if (checked === 0) {
504
+ //all unchecked
505
+ this.checked = false;
506
+ this.indeterminate = false;
507
+ }
508
+ else {
509
+ //indeterminate
510
+ this.indeterminate = true;
511
+ }
476
512
  }
477
513
  }
514
+ // 10.RENDER() FUNCTION //
478
515
  render() {
479
516
  return (h(Host, { class: { leaf: this.leaf, "not-leaf": !this.leaf }, exportParts: this.exportparts ? this.exportparts : null }, h("li", { class: {
480
517
  "tree-open": this.opened,
@@ -506,6 +543,10 @@ const GxgTreeItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
506
543
  }
507
544
  static get assetsDirs() { return ["tree-item-assets"]; }
508
545
  get el() { return this; }
546
+ static get watchers() { return {
547
+ "checked": ["checkedHandler"],
548
+ "opened": ["openedHandler"]
549
+ }; }
509
550
  static get style() { return gxgTreeItemCss; }
510
551
  }, [1, "gxg-tree-item", {
511
552
  "checkbox": [1028],
@@ -530,8 +571,9 @@ const GxgTreeItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
530
571
  "time": [32],
531
572
  "lineHeight": [32],
532
573
  "downloading": [32],
533
- "reRender": [64]
534
- }, [[0, "checkboxToggled", "checkboxToggledHandler"]]]);
574
+ "reRender": [64],
575
+ "evaluateCheckboxStatus": [64]
576
+ }]);
535
577
  function defineCustomElement() {
536
578
  if (typeof customElements === "undefined") {
537
579
  return;