wj-elements 0.7.6 → 0.8.0

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 (234) hide show
  1. package/dist/animations.js +28 -51
  2. package/dist/animations.js.map +1 -1
  3. package/dist/base-path.js +19 -31
  4. package/dist/base-path.js.map +1 -1
  5. package/dist/custom-elements.json +9053 -9048
  6. package/dist/dark.css +1 -302
  7. package/dist/date.js +16 -36
  8. package/dist/date.js.map +1 -1
  9. package/dist/element-utils.js +20 -81
  10. package/dist/element-utils.js.map +1 -1
  11. package/dist/event.js +49 -165
  12. package/dist/event.js.map +1 -1
  13. package/dist/form-associated-element-BjeJn7j8.js +101 -0
  14. package/dist/{form-associated-element-DEQ4y-jn.js.map → form-associated-element-BjeJn7j8.js.map} +1 -1
  15. package/dist/icon-DmsqtDpL.js +102 -0
  16. package/dist/{icon-CReYMzAK.js.map → icon-DmsqtDpL.js.map} +1 -1
  17. package/dist/light.css +1 -731
  18. package/dist/localize.js +36 -111
  19. package/dist/localize.js.map +1 -1
  20. package/dist/packages/wje-accordion-item/accordion-item.element.d.ts +3 -2
  21. package/dist/packages/wje-img/img.element.d.ts +4 -4
  22. package/dist/permissions.js +14 -41
  23. package/dist/permissions.js.map +1 -1
  24. package/dist/popup.element-CbkhthPP.js +806 -0
  25. package/dist/{popup.element-CwXvVFK7.js.map → popup.element-CbkhthPP.js.map} +1 -1
  26. package/dist/router-links-CNsJ-elb.js +105 -0
  27. package/dist/{router-links-wjqCnncc.js.map → router-links-CNsJ-elb.js.map} +1 -1
  28. package/dist/skeleton.css +1 -197
  29. package/dist/styles.css +1 -866
  30. package/dist/universal-service.js +48 -109
  31. package/dist/universal-service.js.map +1 -1
  32. package/dist/utils.js +11 -18
  33. package/dist/utils.js.map +1 -1
  34. package/dist/web-types.json +698 -698
  35. package/dist/wje-accordion-item.js +33 -106
  36. package/dist/wje-accordion-item.js.map +1 -1
  37. package/dist/wje-accordion.js +19 -84
  38. package/dist/wje-accordion.js.map +1 -1
  39. package/dist/wje-animation.js +37 -4258
  40. package/dist/wje-animation.js.map +1 -1
  41. package/dist/wje-aside.js +9 -34
  42. package/dist/wje-aside.js.map +1 -1
  43. package/dist/wje-avatar.js +36 -126
  44. package/dist/wje-avatar.js.map +1 -1
  45. package/dist/wje-badge.js +10 -52
  46. package/dist/wje-badge.js.map +1 -1
  47. package/dist/wje-breadcrumb.js +205 -668
  48. package/dist/wje-breadcrumb.js.map +1 -1
  49. package/dist/wje-breadcrumbs.js +177 -633
  50. package/dist/wje-breadcrumbs.js.map +1 -1
  51. package/dist/wje-button-group.js +48 -153
  52. package/dist/wje-button-group.js.map +1 -1
  53. package/dist/wje-button.js +92 -413
  54. package/dist/wje-button.js.map +1 -1
  55. package/dist/wje-card-content.js +7 -30
  56. package/dist/wje-card-content.js.map +1 -1
  57. package/dist/wje-card-controls.js +7 -30
  58. package/dist/wje-card-controls.js.map +1 -1
  59. package/dist/wje-card-header.js +7 -30
  60. package/dist/wje-card-header.js.map +1 -1
  61. package/dist/wje-card-subtitle.js +7 -34
  62. package/dist/wje-card-subtitle.js.map +1 -1
  63. package/dist/wje-card-title.js +7 -34
  64. package/dist/wje-card-title.js.map +1 -1
  65. package/dist/wje-card.js +15 -71
  66. package/dist/wje-card.js.map +1 -1
  67. package/dist/wje-carousel-item.js +12 -56
  68. package/dist/wje-carousel-item.js.map +1 -1
  69. package/dist/wje-carousel.js +154 -509
  70. package/dist/wje-carousel.js.map +1 -1
  71. package/dist/wje-checkbox.js +50 -227
  72. package/dist/wje-checkbox.js.map +1 -1
  73. package/dist/wje-chip.js +43 -160
  74. package/dist/wje-chip.js.map +1 -1
  75. package/dist/wje-col.js +7 -20
  76. package/dist/wje-col.js.map +1 -1
  77. package/dist/wje-color-picker.js +445 -1464
  78. package/dist/wje-color-picker.js.map +1 -1
  79. package/dist/wje-container.js +9 -35
  80. package/dist/wje-container.js.map +1 -1
  81. package/dist/wje-copy-button.js +64 -204
  82. package/dist/wje-copy-button.js.map +1 -1
  83. package/dist/wje-dialog.js +85 -553
  84. package/dist/wje-dialog.js.map +1 -1
  85. package/dist/wje-divider.js +7 -34
  86. package/dist/wje-divider.js.map +1 -1
  87. package/dist/wje-dropdown.js +78 -305
  88. package/dist/wje-dropdown.js.map +1 -1
  89. package/dist/wje-element.js +191 -700
  90. package/dist/wje-element.js.map +1 -1
  91. package/dist/wje-file-upload-item.js +51 -156
  92. package/dist/wje-file-upload-item.js.map +1 -1
  93. package/dist/wje-file-upload.js +181 -619
  94. package/dist/wje-file-upload.js.map +1 -1
  95. package/dist/wje-footer.js +7 -31
  96. package/dist/wje-footer.js.map +1 -1
  97. package/dist/wje-form.js +7 -32
  98. package/dist/wje-form.js.map +1 -1
  99. package/dist/wje-format-digital.js +26 -118
  100. package/dist/wje-format-digital.js.map +1 -1
  101. package/dist/wje-grid.js +7 -33
  102. package/dist/wje-grid.js.map +1 -1
  103. package/dist/wje-header.js +9 -35
  104. package/dist/wje-header.js.map +1 -1
  105. package/dist/wje-icon-library.js +12 -18
  106. package/dist/wje-icon-library.js.map +1 -1
  107. package/dist/wje-icon-picker.js +65 -320
  108. package/dist/wje-icon-picker.js.map +1 -1
  109. package/dist/wje-icon.js +1 -1
  110. package/dist/wje-img-comparer.js +37 -114
  111. package/dist/wje-img-comparer.js.map +1 -1
  112. package/dist/wje-img.js +50 -197
  113. package/dist/wje-img.js.map +1 -1
  114. package/dist/wje-infinite-scroll.js +94 -346
  115. package/dist/wje-infinite-scroll.js.map +1 -1
  116. package/dist/wje-input-file.js +23 -84
  117. package/dist/wje-input-file.js.map +1 -1
  118. package/dist/wje-input.js +78 -392
  119. package/dist/wje-input.js.map +1 -1
  120. package/dist/wje-item.js +11 -64
  121. package/dist/wje-item.js.map +1 -1
  122. package/dist/wje-kanban.js +124 -401
  123. package/dist/wje-kanban.js.map +1 -1
  124. package/dist/wje-label.js +9 -32
  125. package/dist/wje-label.js.map +1 -1
  126. package/dist/wje-level-indicator.js +38 -157
  127. package/dist/wje-level-indicator.js.map +1 -1
  128. package/dist/wje-list.js +10 -40
  129. package/dist/wje-list.js.map +1 -1
  130. package/dist/wje-main.js +7 -31
  131. package/dist/wje-main.js.map +1 -1
  132. package/dist/wje-masonry.js +66 -211
  133. package/dist/wje-masonry.js.map +1 -1
  134. package/dist/wje-master.js +45 -161
  135. package/dist/wje-master.js.map +1 -1
  136. package/dist/wje-menu-button.js +10 -38
  137. package/dist/wje-menu-button.js.map +1 -1
  138. package/dist/wje-menu-item.js +127 -577
  139. package/dist/wje-menu-item.js.map +1 -1
  140. package/dist/wje-menu-label.js +9 -35
  141. package/dist/wje-menu-label.js.map +1 -1
  142. package/dist/wje-menu.js +14 -49
  143. package/dist/wje-menu.js.map +1 -1
  144. package/dist/wje-option.js +48 -279
  145. package/dist/wje-option.js.map +1 -1
  146. package/dist/wje-options.js +130 -384
  147. package/dist/wje-options.js.map +1 -1
  148. package/dist/wje-orgchart-group.js +16 -52
  149. package/dist/wje-orgchart-group.js.map +1 -1
  150. package/dist/wje-orgchart-item.js +24 -93
  151. package/dist/wje-orgchart-item.js.map +1 -1
  152. package/dist/wje-orgchart.js +18 -68
  153. package/dist/wje-orgchart.js.map +1 -1
  154. package/dist/wje-pagination.js +113 -397
  155. package/dist/wje-pagination.js.map +1 -1
  156. package/dist/wje-popup.js +3 -3
  157. package/dist/wje-popup.js.map +1 -1
  158. package/dist/wje-progress-bar.js +53 -205
  159. package/dist/wje-progress-bar.js.map +1 -1
  160. package/dist/wje-qr-code.js +398 -2980
  161. package/dist/wje-qr-code.js.map +1 -1
  162. package/dist/wje-radio-group.js +52 -190
  163. package/dist/wje-radio-group.js.map +1 -1
  164. package/dist/wje-radio.js +24 -118
  165. package/dist/wje-radio.js.map +1 -1
  166. package/dist/wje-rate.js +62 -266
  167. package/dist/wje-rate.js.map +1 -1
  168. package/dist/wje-relative-time.js +24 -99
  169. package/dist/wje-relative-time.js.map +1 -1
  170. package/dist/wje-reorder-dropzone.js +9 -31
  171. package/dist/wje-reorder-dropzone.js.map +1 -1
  172. package/dist/wje-reorder-handle.js +67 -204
  173. package/dist/wje-reorder-handle.js.map +1 -1
  174. package/dist/wje-reorder-item.js +14 -44
  175. package/dist/wje-reorder-item.js.map +1 -1
  176. package/dist/wje-reorder.js +61 -246
  177. package/dist/wje-reorder.js.map +1 -1
  178. package/dist/wje-route.js +6 -24
  179. package/dist/wje-route.js.map +1 -1
  180. package/dist/wje-router-link.js +11 -39
  181. package/dist/wje-router-link.js.map +1 -1
  182. package/dist/wje-router-outlet.js +76 -172
  183. package/dist/wje-router-outlet.js.map +1 -1
  184. package/dist/wje-routerx.js +537 -1331
  185. package/dist/wje-routerx.js.map +1 -1
  186. package/dist/wje-row.js +9 -31
  187. package/dist/wje-row.js.map +1 -1
  188. package/dist/wje-select.js +326 -1152
  189. package/dist/wje-select.js.map +1 -1
  190. package/dist/wje-slider.js +44 -225
  191. package/dist/wje-slider.js.map +1 -1
  192. package/dist/wje-sliding-container.js +295 -1319
  193. package/dist/wje-sliding-container.js.map +1 -1
  194. package/dist/wje-split-view.js +35 -121
  195. package/dist/wje-split-view.js.map +1 -1
  196. package/dist/wje-status.js +14 -45
  197. package/dist/wje-status.js.map +1 -1
  198. package/dist/wje-step.js +9 -32
  199. package/dist/wje-step.js.map +1 -1
  200. package/dist/wje-stepper.js +109 -357
  201. package/dist/wje-stepper.js.map +1 -1
  202. package/dist/wje-store.js +67 -360
  203. package/dist/wje-store.js.map +1 -1
  204. package/dist/wje-tab-group.js +85 -314
  205. package/dist/wje-tab-group.js.map +1 -1
  206. package/dist/wje-tab-panel.js +7 -28
  207. package/dist/wje-tab-panel.js.map +1 -1
  208. package/dist/wje-tab.js +21 -198
  209. package/dist/wje-tab.js.map +1 -1
  210. package/dist/wje-textarea.js +64 -264
  211. package/dist/wje-textarea.js.map +1 -1
  212. package/dist/wje-thumbnail.js +10 -51
  213. package/dist/wje-thumbnail.js.map +1 -1
  214. package/dist/wje-toast.js +127 -632
  215. package/dist/wje-toast.js.map +1 -1
  216. package/dist/wje-toggle.js +52 -177
  217. package/dist/wje-toggle.js.map +1 -1
  218. package/dist/wje-toolbar-action.js +128 -456
  219. package/dist/wje-toolbar-action.js.map +1 -1
  220. package/dist/wje-toolbar.js +75 -270
  221. package/dist/wje-toolbar.js.map +1 -1
  222. package/dist/wje-tooltip.js +50 -161
  223. package/dist/wje-tooltip.js.map +1 -1
  224. package/dist/wje-tree-item.js +70 -301
  225. package/dist/wje-tree-item.js.map +1 -1
  226. package/dist/wje-tree.js +145 -489
  227. package/dist/wje-tree.js.map +1 -1
  228. package/dist/wje-visually-hidden.js +7 -34
  229. package/dist/wje-visually-hidden.js.map +1 -1
  230. package/package.json +4 -2
  231. package/dist/form-associated-element-DEQ4y-jn.js +0 -245
  232. package/dist/icon-CReYMzAK.js +0 -245
  233. package/dist/popup.element-CwXvVFK7.js +0 -2133
  234. package/dist/router-links-wjqCnncc.js +0 -156
@@ -1,369 +1,138 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
- import WJElement from "./wje-element.js";
5
- const styles = "/*\n[ WJ Tree Item ]\n*/\n\n:host {\n .native-tree-item {\n position: relative;\n display: flex;\n align-items: stretch;\n flex-direction: column;\n &.multiple {\n .item {\n border-radius: 0 !important;\n }\n }\n .item {\n position: relative;\n display: flex;\n align-items: center;\n padding-inline: var(--wje-tree-item-padding-inline);\n padding-block: var(--wje-tree-item-padding-block);\n border-radius: var(--wje-tree-item-border-radius);\n border-width: var(--wje-tree-item-border-width);\n border-style: var(--wje-tree-item-border-style);\n border-color: var(--wje-tree-item-border-color);\n background-color: var(--wje-tree-item-background);\n color: var(--wje-tree-item-color);\n\n &::before,\n &::after {\n content: '';\n position: absolute;\n box-sizing: border-box;\n pointer-events: none;\n opacity: 0;\n z-index: 2;\n }\n\n &:hover {\n border-color: var(--wje-tree-item-border-color-hover);\n background-color: var(--wje-tree-item-background-hover);\n color: var(--wje-tree-item-color-hover);\n }\n\n .indent {\n display: block;\n width: calc(var(--wje-tree-item-indent) * var(--wje-tree-item-depth));\n flex-shrink: 0;\n }\n\n .toggle {\n font-size: var(--wje-tree-item-font-size);\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: content-box;\n width: var(--wje-tree-item-indent);\n height: var(--wje-tree-item-indent);\n flex-shrink: 0;\n }\n\n wje-checkbox {\n font-size: var(--wje-tree-item-font-size);\n margin: 0;\n }\n\n .content {\n font-size: var(--wje-tree-item-font-size);\n }\n\n slot {\n display: flex;\n align-items: center;\n }\n\n slot:not([name])::slotted(wje-icon) {\n margin-right: var(--wje-spacing-2x-small);\n }\n\n slot[name='end'] {\n margin-inline-start: auto;\n }\n\n slot[name='start']::slotted(.wje-tree-drag-handle) {\n cursor: grab;\n }\n }\n .children {\n display: none;\n &.open {\n font-size: var(--wje-tree-item-font-size);\n display: block;\n\n ::before {\n content: '';\n position: absolute;\n top: var(--wje-tree-item-indent);\n bottom: 5px;\n left: calc(\n (var(--wje-tree-item-indent) * var(--wje-tree-item-depth)) +\n 1em -\n (var(--wje-spacing-3x-small) * 2) -\n (var(--wje-tree-item-indent-guid-width) / 2)\n );\n border-inline-end-width: var(--wje-tree-item-indent-guid-width);\n border-inline-end-style: var(--wje-tree-item-indent-guid-style);\n border-inline-end-color: var(--wje-tree-item-indent-guid-color);\n z-index: 1;\n }\n }\n }\n }\n\n .native-tree-item.expanded .item slot[name='expand'],\n .native-tree-item:not(.expanded) slot[name='collapse'] {\n display: none;\n }\n}\n\n:host([selected]) {\n .item {\n border-color: var(--wje-tree-item-border-color-selected);\n background-color: var(--wje-tree-item-background-selected);\n color: var(--wje-tree-item-color-selected);\n }\n}\n\n:host(.wje-tree-dragging) {\n opacity: 0.35;\n\n .item {\n slot[name='start']::slotted(.wje-tree-drag-handle) {\n cursor: grabbing;\n }\n }\n}\n\n:host(.wje-tree-drop-before) {\n .item {\n &::before {\n inset-inline: 0;\n top: -1px;\n height: var(--wje-tree-item-drop-line-width);\n background-color: var(--wje-tree-item-drop-color);\n border-radius: var(--wje-tree-item-drop-line-border-radius);\n opacity: 1;\n }\n }\n}\n\n:host(.wje-tree-drop-after) {\n .item {\n &::after {\n inset-inline: 0;\n bottom: -1px;\n height: var(--wje-tree-item-drop-line-width);\n background-color: var(--wje-tree-item-drop-color);\n border-radius: var(--wje-tree-item-drop-line-border-radius);\n opacity: 1;\n }\n }\n}\n\n:host(.wje-tree-drop-inside) {\n .item {\n &::before {\n inset: 0;\n border-width: var(--wje-tree-item-drop-border-width);\n border-style: var(--wje-tree-item-drop-border-style);\n border-color: var(--wje-tree-item-drop-border-color);\n border-radius: var(--wje-tree-item-drop-border-radius);\n opacity: 1;\n }\n }\n}\n\n:host([slot-hover-visible]) {\n .item {\n &:hover {\n slot[name='start'], slot[name='end'] {\n visibility: visible;\n }\n }\n slot[name='start'], slot[name='end'] {\n visibility: hidden;\n }\n }\n}\n";
6
- class TreeItem extends WJElement {
7
- /**
8
- * Creates an instance of TreeItem.
9
- */
4
+ import e from "./wje-element.js";
5
+ class t extends e {
10
6
  constructor() {
11
7
  super();
12
- /**
13
- * The class name for the component.
14
- * @type {string}
15
- */
16
8
  __publicField(this, "className", "TreeItem");
17
9
  this._selection = "single";
18
10
  }
19
- /**
20
- * Sets the expanded state of the element. When set to a truthy value,
21
- * the 'expanded' attribute will be added to the element. When set to a falsy
22
- * value, the 'expanded' attribute will be removed.
23
- * @param {boolean} value A boolean value indicating whether the
24
- * element should be expanded (true) or collapsed (false).
25
- */
26
- set expanded(value) {
27
- if (value) {
28
- this.setAttribute("expanded", "");
29
- } else {
30
- this.removeAttribute("expanded");
31
- }
11
+ set expanded(e2) {
12
+ e2 ? this.setAttribute("expanded", "") : this.removeAttribute("expanded");
32
13
  }
33
- /**
34
- * Retrieves the value of the 'expanded' state for the current element.
35
- * This getter checks whether the 'expanded' attribute is present on the element.
36
- * If the attribute exists, it returns true, representing that the element is expanded.
37
- * Otherwise, it returns false, indicating that the element is not expanded.
38
- * @returns {boolean} True if the 'expanded' attribute is present, false otherwise.
39
- */
40
14
  get expanded() {
41
15
  return this.hasAttribute("expanded");
42
16
  }
43
- /**
44
- * Sets the 'selected' attribute of the element. Removes the attribute if the provided value is falsy; otherwise, sets it.
45
- * @param {boolean} value The value indicating whether the element should have the 'selected' attribute.
46
- */
47
- set selected(value) {
48
- this.removeAttribute("selected");
49
- if (value) this.setAttribute("selected", "");
17
+ set selected(e2) {
18
+ this.removeAttribute("selected"), e2 && this.setAttribute("selected", "");
50
19
  }
51
- /**
52
- * Getter method for determining if the 'selected' attribute is present on the element.
53
- * @returns {boolean} Returns true if the 'selected' attribute is present, otherwise false.
54
- */
55
20
  get selected() {
56
21
  return this.hasAttribute("selected");
57
22
  }
58
- /**
59
- * Sets the selection mode for the component.
60
- * @param {string} value The selection mode to apply. Defaults to 'single'
61
- * if no value is provided. Possible options may be
62
- * specific to the implementation of the component
63
- * (e.g., 'single', 'multiple').
64
- */
65
- set selection(value) {
66
- this._selection = value || "single";
23
+ set selection(e2) {
24
+ this._selection = e2 || "single";
67
25
  }
68
- /**
69
- * Retrieves the current selection.
70
- * @returns {*} The value of the current selection.
71
- */
72
26
  get selection() {
73
27
  return this._selection;
74
28
  }
75
- /**
76
- * Sets or removes the 'indeterminate' attribute based on the provided value.
77
- * This can be used to visually indicate an indeterminate state for elements like checkboxes.
78
- * @param {boolean} value A boolean indicating whether to set the element to an indeterminate state.
79
- * If true, the 'indeterminate' attribute is added to the element; if false, the attribute is removed.
80
- */
81
- set indeterminate(value) {
82
- this.removeAttribute("indeterminate");
83
- if (value) this.setAttribute("indeterminate", "");
29
+ set indeterminate(e2) {
30
+ this.removeAttribute("indeterminate"), e2 && this.setAttribute("indeterminate", "");
84
31
  }
85
- /**
86
- * Retrieves the state of the indeterminate attribute.
87
- * @returns {boolean} True if the indeterminate attribute is present, otherwise false.
88
- */
89
32
  get indeterminate() {
90
33
  return this.hasAttribute("indeterminate");
91
34
  }
92
- /**
93
- * Returns the CSS stylesheet for the component.
94
- * @static
95
- * @returns {CSSStyleSheet} The CSS stylesheet
96
- */
97
35
  static get cssStyleSheet() {
98
- return styles;
36
+ return ':host .native-tree-item{position:relative;display:flex;align-items:stretch;flex-direction:column}:host .native-tree-item.multiple .item{border-radius:0!important}:host .native-tree-item .item{position:relative;display:flex;align-items:center;padding-inline:var(--wje-tree-item-padding-inline);padding-block:var(--wje-tree-item-padding-block);border-radius:var(--wje-tree-item-border-radius);border-width:var(--wje-tree-item-border-width);border-style:var(--wje-tree-item-border-style);border-color:var(--wje-tree-item-border-color);background-color:var(--wje-tree-item-background);color:var(--wje-tree-item-color)}:host .native-tree-item .item:before,:host .native-tree-item .item:after{content:"";position:absolute;box-sizing:border-box;pointer-events:none;opacity:0;z-index:2}:host .native-tree-item .item:hover{border-color:var(--wje-tree-item-border-color-hover);background-color:var(--wje-tree-item-background-hover);color:var(--wje-tree-item-color-hover)}:host .native-tree-item .item .indent{display:block;width:calc(var(--wje-tree-item-indent) * var(--wje-tree-item-depth));flex-shrink:0}:host .native-tree-item .item .toggle{font-size:var(--wje-tree-item-font-size);display:flex;align-items:center;justify-content:center;box-sizing:content-box;width:var(--wje-tree-item-indent);height:var(--wje-tree-item-indent);flex-shrink:0}:host .native-tree-item .item wje-checkbox{font-size:var(--wje-tree-item-font-size);margin:0}:host .native-tree-item .item .content{font-size:var(--wje-tree-item-font-size)}:host .native-tree-item .item slot{display:flex;align-items:center}:host .native-tree-item .item slot:not([name])::slotted(wje-icon){margin-right:var(--wje-spacing-2x-small)}:host .native-tree-item .item slot[name=end]{margin-inline-start:auto}:host .native-tree-item .item slot[name=start]::slotted(.wje-tree-drag-handle){cursor:grab}:host .native-tree-item .children{display:none}:host .native-tree-item .children.open{font-size:var(--wje-tree-item-font-size);display:block}:host .native-tree-item .children.open :before{content:"";position:absolute;top:var(--wje-tree-item-indent);bottom:5px;left:calc((var(--wje-tree-item-indent) * var(--wje-tree-item-depth)) + 1em - (var(--wje-spacing-3x-small) * 2) - (var(--wje-tree-item-indent-guid-width) / 2));border-inline-end-width:var(--wje-tree-item-indent-guid-width);border-inline-end-style:var(--wje-tree-item-indent-guid-style);border-inline-end-color:var(--wje-tree-item-indent-guid-color);z-index:1}:host .native-tree-item.expanded .item slot[name=expand],:host .native-tree-item:not(.expanded) slot[name=collapse]{display:none}:host([selected]) .item{border-color:var(--wje-tree-item-border-color-selected);background-color:var(--wje-tree-item-background-selected);color:var(--wje-tree-item-color-selected)}:host(.wje-tree-dragging){opacity:.35}:host(.wje-tree-dragging) .item slot[name=start]::slotted(.wje-tree-drag-handle){cursor:grabbing}:host(.wje-tree-drop-before) .item:before{inset-inline:0;top:-1px;height:var(--wje-tree-item-drop-line-width);background-color:var(--wje-tree-item-drop-color);border-radius:var(--wje-tree-item-drop-line-border-radius);opacity:1}:host(.wje-tree-drop-after) .item:after{inset-inline:0;bottom:-1px;height:var(--wje-tree-item-drop-line-width);background-color:var(--wje-tree-item-drop-color);border-radius:var(--wje-tree-item-drop-line-border-radius);opacity:1}:host(.wje-tree-drop-inside) .item:before{top:0;right:0;bottom:0;left:0;border-width:var(--wje-tree-item-drop-border-width);border-style:var(--wje-tree-item-drop-border-style);border-color:var(--wje-tree-item-drop-border-color);border-radius:var(--wje-tree-item-drop-border-radius);opacity:1}:host([slot-hover-visible]) .item:hover slot[name=start],:host([slot-hover-visible]) .item:hover slot[name=end]{visibility:visible}:host([slot-hover-visible]) .item slot[name=start],:host([slot-hover-visible]) .item slot[name=end]{visibility:hidden}';
99
37
  }
100
- /**
101
- * Setup attributes for the Button element.
102
- */
103
38
  setupAttributes() {
104
- this.isShadowRoot = "open";
105
- this.syncAria();
39
+ this.isShadowRoot = "open", this.syncAria();
106
40
  }
107
41
  connectedCallback() {
108
42
  var _a;
109
- (_a = super.connectedCallback) == null ? void 0 : _a.call(this);
110
- this.syncNestingState();
43
+ (_a = super.connectedCallback) == null ? void 0 : _a.call(this), this.syncNestingState();
111
44
  }
112
- /**
113
- * Returns the list of attributes to observe for changes.
114
- * @static
115
- * @returns {Array<string>}
116
- */
117
45
  static get observedAttributes() {
118
46
  return ["selected", "indeterminate", "expanded"];
119
47
  }
120
- /**
121
- * Handles updates when observed attributes of the element are changed.
122
- * Updates the checkbox state based on changes to the "selected" or "indeterminate" attributes.
123
- * @param {string} name The name of the attribute that was changed.
124
- * @param {string|null} oldValue The previous value of the attribute before the change.
125
- * @param {string|null} newValue The new value of the attribute after the change.
126
- * @returns {void}
127
- */
128
- attributeChangedCallback(name, oldValue, newValue) {
129
- if (name === "expanded") {
130
- this.setChildrenExpanded(this.expanded, { syncAttribute: false });
131
- return;
132
- }
133
- if (!this.checkbox) {
134
- this.syncAria();
135
- return;
136
- }
137
- if (name === "selected") {
138
- if (this.selected) {
139
- this.checkbox.checked = true;
140
- } else {
141
- this.checkbox.checked = false;
142
- }
143
- }
144
- if (name === "indeterminate" && !this.selected) {
145
- this.checkbox.removeAttribute("indeterminate");
146
- this.checkbox.removeAttribute("checked");
147
- if (this.indeterminate) this.checkbox.setAttribute("indeterminate", "");
148
- }
149
- this.syncAria();
48
+ attributeChangedCallback(e2, t2, i) {
49
+ "expanded" !== e2 ? this.checkbox ? ("selected" === e2 && (this.selected ? this.checkbox.checked = true : this.checkbox.checked = false), "indeterminate" !== e2 || this.selected || (this.checkbox.removeAttribute("indeterminate"), this.checkbox.removeAttribute("checked"), this.indeterminate && this.checkbox.setAttribute("indeterminate", "")), this.syncAria()) : this.syncAria() : this.setChildrenExpanded(this.expanded, { syncAttribute: false });
150
50
  }
151
- /**
152
- * Custom logic executed before the draw process begins.
153
- * Determines and sets the appropriate slot if the current item is nested.
154
- * @returns {void} No return value.
155
- */
156
51
  beforeDraw() {
157
52
  var _a;
158
- this.syncNestingState();
159
- if ((_a = this.closest("wje-tree")) == null ? void 0 : _a.hasAttribute("slot-hover-visible"))
160
- this.setAttribute("slot-hover-visible", "");
53
+ this.syncNestingState(), ((_a = this.closest("wje-tree")) == null ? void 0 : _a.hasAttribute("slot-hover-visible")) && this.setAttribute("slot-hover-visible", "");
161
54
  }
162
- /**
163
- * Synchronizes the nesting-related state on the host element.
164
- * Sets the "slot" to children for nested items and updates
165
- * the nesting depth used to compute visual indentation.
166
- * @returns {void}
167
- */
168
55
  syncNestingState() {
169
- const depth = this.getNestingDepth();
170
- this.style.setProperty("--wje-tree-item-depth", String(depth));
171
- if (depth > 0) {
172
- this.slot = "children";
173
- } else if (this.getAttribute("slot") === "children") {
174
- this.removeAttribute("slot");
175
- }
56
+ const e2 = this.getNestingDepth();
57
+ this.style.setProperty("--wje-tree-item-depth", String(e2)), e2 > 0 ? this.slot = "children" : "children" === this.getAttribute("slot") && this.removeAttribute("slot");
176
58
  }
177
- /**
178
- * Creates and returns a document fragment representing the structure of a tree item component.
179
- * The method constructs the DOM elements including the native container, indentation, toggle button,
180
- * selection checkbox, label, and children container, along with their respective slots and attributes.
181
- * It dynamically handles the creation of expand and collapse icons, as well as appending slots for
182
- * child components.
183
- * @returns {DocumentFragment} A fragment containing the complete tree item structure to be rendered.
184
- */
185
59
  draw() {
186
- let fragment = document.createDocumentFragment();
187
- let native = document.createElement("div");
188
- native.setAttribute("part", "native");
189
- native.classList.add("native-tree-item", this.selection === "multiple" ? "multiple" : "single");
190
- let slotStart = document.createElement("slot");
191
- slotStart.setAttribute("name", "start");
192
- let item = document.createElement("div");
193
- item.setAttribute("part", "item");
194
- item.classList.add("item");
195
- let indent = document.createElement("div");
196
- indent.classList.add("indent");
197
- let button = document.createElement("div");
198
- button.classList.add("toggle");
199
- let checkbox = document.createElement("wje-checkbox");
200
- if (this.selected) checkbox.setAttribute("checked", "");
201
- let label = document.createElement("div");
202
- label.setAttribute("part", "label");
203
- label.classList.add("content");
204
- let slotElement = document.createElement("slot");
205
- let children = document.createElement("div");
206
- children.classList.add("children");
207
- let slot = document.createElement("slot");
208
- slot.setAttribute("name", "children");
209
- children.appendChild(slot);
210
- let slotEnd = document.createElement("slot");
211
- slotEnd.setAttribute("name", "end");
212
- item.appendChild(slotStart);
213
- item.appendChild(indent);
214
- if (this.querySelectorAll(":scope > wje-tree-item").length > 0) {
60
+ let e2 = document.createDocumentFragment(), t2 = document.createElement("div");
61
+ t2.setAttribute("part", "native"), t2.classList.add("native-tree-item", "multiple" === this.selection ? "multiple" : "single");
62
+ let i = document.createElement("slot");
63
+ i.setAttribute("name", "start");
64
+ let r = document.createElement("div");
65
+ r.setAttribute("part", "item"), r.classList.add("item");
66
+ let n = document.createElement("div");
67
+ n.classList.add("indent");
68
+ let s = document.createElement("div");
69
+ s.classList.add("toggle");
70
+ let o = document.createElement("wje-checkbox");
71
+ this.selected && o.setAttribute("checked", "");
72
+ let l = document.createElement("div");
73
+ l.setAttribute("part", "label"), l.classList.add("content");
74
+ let d = document.createElement("slot"), a = document.createElement("div");
75
+ a.classList.add("children");
76
+ let c = document.createElement("slot");
77
+ c.setAttribute("name", "children"), a.appendChild(c);
78
+ let h = document.createElement("slot");
79
+ if (h.setAttribute("name", "end"), r.appendChild(i), r.appendChild(n), this.querySelectorAll(":scope > wje-tree-item").length > 0) {
215
80
  if (this.querySelectorAll('[slot="expand"]').length < 1) {
216
- let expandIcon = document.createElement("wje-icon");
217
- expandIcon.setAttribute("name", "chevron-right");
218
- expandIcon.setAttribute("slot", "expand");
219
- this.appendChild(expandIcon);
81
+ let e4 = document.createElement("wje-icon");
82
+ e4.setAttribute("name", "chevron-right"), e4.setAttribute("slot", "expand"), this.appendChild(e4);
220
83
  }
221
84
  if (this.querySelectorAll('[slot="collapse"]').length < 1) {
222
- let collapseIcon = document.createElement("wje-icon");
223
- collapseIcon.setAttribute("name", "chevron-down");
224
- collapseIcon.setAttribute("slot", "collapse");
225
- this.appendChild(collapseIcon);
85
+ let e4 = document.createElement("wje-icon");
86
+ e4.setAttribute("name", "chevron-down"), e4.setAttribute("slot", "collapse"), this.appendChild(e4);
226
87
  }
227
- let expandSlot = document.createElement("slot");
228
- expandSlot.setAttribute("name", "expand");
229
- let collapseSlot = document.createElement("slot");
230
- collapseSlot.setAttribute("name", "collapse");
231
- button.appendChild(expandSlot);
232
- button.appendChild(collapseSlot);
88
+ let e3 = document.createElement("slot");
89
+ e3.setAttribute("name", "expand");
90
+ let t3 = document.createElement("slot");
91
+ t3.setAttribute("name", "collapse"), s.appendChild(e3), s.appendChild(t3);
233
92
  }
234
- item.appendChild(button);
235
- if (this.selection === "multiple") item.appendChild(checkbox);
236
- label.appendChild(slotElement);
237
- item.appendChild(label);
238
- item.appendChild(slotEnd);
239
- native.appendChild(item);
240
- native.appendChild(children);
241
- fragment.appendChild(native);
242
- this.checkbox = checkbox;
243
- this.native = native;
244
- this.button = button;
245
- this.childrenElement = children;
246
- this.childrenSlot = slot;
247
- return fragment;
93
+ return r.appendChild(s), "multiple" === this.selection && r.appendChild(o), l.appendChild(d), r.appendChild(l), r.appendChild(h), t2.appendChild(r), t2.appendChild(a), e2.appendChild(t2), this.checkbox = o, this.native = t2, this.button = s, this.childrenElement = a, this.childrenSlot = c, e2;
248
94
  }
249
- /**
250
- * Executes operations to be performed after the draw action is completed.
251
- * If the state indicates it is expanded, toggles its children.
252
- * Additionally, sets up an event listener on the button element to handle toggling children upon click.
253
- * @returns {void} Does not return a value.
254
- */
255
95
  afterDraw() {
256
- this.setChildrenExpanded(this.expanded, { syncAttribute: false });
257
- this.button.addEventListener("click", this.toggleChildren.bind(this));
258
- this.setAttribute("tabindex", "0");
259
- this.syncAria();
96
+ this.setChildrenExpanded(this.expanded, { syncAttribute: false }), this.button.addEventListener("click", this.toggleChildren.bind(this)), this.setAttribute("tabindex", "0"), this.syncAria();
260
97
  }
261
- /**
262
- * Determines if the current item is a nested item within a tree structure.
263
- * Checks if the item's parent element exists and is also a tree item.
264
- * @returns {boolean} Returns true if the current item is a nested tree item; otherwise, false.
265
- */
266
98
  isNestedItem() {
267
- const parent = this.parentElement;
268
- return !!parent && this.isTreeItem(parent);
99
+ const e2 = this.parentElement;
100
+ return !!e2 && this.isTreeItem(e2);
269
101
  }
270
- /**
271
- * Calculates nesting depth based on ancestor tree items.
272
- * Root items have depth 0, direct children depth 1, etc.
273
- * @returns {number}
274
- */
275
102
  getNestingDepth() {
276
- let depth = 0;
277
- let current = this.parentElement;
278
- while (current) {
279
- if (this.isTreeItem(current)) depth += 1;
280
- current = current.parentElement;
281
- }
282
- return depth;
103
+ let e2 = 0, t2 = this.parentElement;
104
+ for (; t2; ) this.isTreeItem(t2) && (e2 += 1), t2 = t2.parentElement;
105
+ return e2;
283
106
  }
284
- /**
285
- * Checks whether the given node is a tree item.
286
- * @param {object} node The node to check.
287
- * @returns {boolean} Returns true when the node is a tree item element.
288
- */
289
- isTreeItem(node) {
290
- return node instanceof Element && node.localName === "wje-tree-item";
107
+ isTreeItem(e2) {
108
+ return e2 instanceof Element && "wje-tree-item" === e2.localName;
291
109
  }
292
- /**
293
- * Toggles the visibility state of the children element and updates the class of the parent element.
294
- * The method toggles the 'open' class on the children elements and the 'expanded' class on the parent element,
295
- * effectively showing or hiding the children and indicating the expanded state.
296
- * @returns {void} Does not return a value.
297
- */
298
110
  toggleChildren() {
299
111
  this.setChildrenExpanded(!this.childrenElement.classList.contains("open"));
300
112
  }
301
- /**
302
- * Sets the rendered children visibility and optionally mirrors it to the expanded attribute.
303
- * @param {boolean} expanded Whether child items should be visible.
304
- * @param {object} [options] Configuration for attribute syncing.
305
- * @param {boolean} [options.syncAttribute] Mirrors the visual state to the host attribute when true.
306
- * @returns {void}
307
- */
308
- setChildrenExpanded(expanded, options = {}) {
113
+ setChildrenExpanded(e2, t2 = {}) {
309
114
  var _a, _b;
310
- const syncAttribute = options.syncAttribute ?? true;
311
- (_a = this.childrenElement) == null ? void 0 : _a.classList.toggle("open", expanded);
312
- (_b = this.native) == null ? void 0 : _b.classList.toggle("expanded", expanded);
313
- if (syncAttribute) {
314
- if (expanded) this.setAttribute("expanded", "");
315
- else this.removeAttribute("expanded");
316
- }
317
- this.syncAria();
115
+ const i = t2.syncAttribute ?? true;
116
+ (_a = this.childrenElement) == null ? void 0 : _a.classList.toggle("open", e2), (_b = this.native) == null ? void 0 : _b.classList.toggle("expanded", e2), i && (e2 ? this.setAttribute("expanded", "") : this.removeAttribute("expanded")), this.syncAria();
318
117
  }
319
- /**
320
- * Syncs ARIA attributes on the host element.
321
- */
322
118
  syncAria() {
323
119
  var _a, _b;
324
- const hasChildren = this.querySelectorAll(":scope > wje-tree-item").length > 0;
325
- const expanded = hasChildren ? (_b = (_a = this.native) == null ? void 0 : _a.classList) == null ? void 0 : _b.contains("expanded") : void 0;
326
- if (this.selection === "multiple") {
327
- const checked = this.indeterminate ? "mixed" : this.selected ? "true" : "false";
328
- this.setAriaState({
329
- role: "treeitem",
330
- checked,
331
- expanded
332
- });
333
- } else {
334
- this.setAriaState({
335
- role: "treeitem",
336
- selected: this.selected,
337
- expanded
338
- });
339
- }
120
+ const e2 = this.querySelectorAll(":scope > wje-tree-item").length > 0 ? (_b = (_a = this.native) == null ? void 0 : _a.classList) == null ? void 0 : _b.contains("expanded") : void 0;
121
+ if ("multiple" === this.selection) {
122
+ const t2 = this.indeterminate ? "mixed" : this.selected ? "true" : "false";
123
+ this.setAriaState({ role: "treeitem", checked: t2, expanded: e2 });
124
+ } else this.setAriaState({ role: "treeitem", selected: this.selected, expanded: e2 });
340
125
  }
341
- /**
342
- * Retrieves the child items from the `childrenSlot` that match specific criteria.
343
- * @param {object} [options] Configuration options.
344
- * @param {boolean} [options.includeDisabled] Determines whether disabled items should be included in the result. Defaults to true.
345
- * @returns {Array} An array of child items that are valid tree items and meet the criteria specified in the options.
346
- */
347
- getChildrenItems(options = {}) {
348
- const includeDisabled = options.includeDisabled ?? true;
349
- const assigned = this.childrenSlot ? this.childrenSlot.assignedElements({ flatten: true }) : [];
350
- const direct = assigned.length ? assigned : Array.from(this.querySelectorAll(":scope > wje-tree-item"));
351
- return direct.filter(
352
- (item) => this.isTreeItem(item) && (includeDisabled || !item.disabled)
353
- );
126
+ getChildrenItems(e2 = {}) {
127
+ const t2 = e2.includeDisabled ?? true, i = this.childrenSlot ? this.childrenSlot.assignedElements({ flatten: true }) : [];
128
+ return (i.length ? i : Array.from(this.querySelectorAll(":scope > wje-tree-item"))).filter((e3) => this.isTreeItem(e3) && (t2 || !e3.disabled));
354
129
  }
355
- /**
356
- * Retrieves all descendant children of the current object in a flattened array structure.
357
- * @param {object} [options] An optional object specifying filters or configurations for retrieving children.
358
- * @returns {Array} An array containing all children and their descendants in a flat structure.
359
- */
360
- getAllChildrenFlat(options = {}) {
361
- const directChildren = this.getChildrenItems(options);
362
- return directChildren.flatMap((child) => [child, ...child.getAllChildrenFlat(options)]);
130
+ getAllChildrenFlat(e2 = {}) {
131
+ return this.getChildrenItems(e2).flatMap((t2) => [t2, ...t2.getAllChildrenFlat(e2)]);
363
132
  }
364
133
  }
365
- TreeItem.define("wje-tree-item", TreeItem);
134
+ t.define("wje-tree-item", t);
366
135
  export {
367
- TreeItem as default
136
+ t as default
368
137
  };
369
138
  //# sourceMappingURL=wje-tree-item.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"wje-tree-item.js","sources":["../packages/wje-tree-item/tree-item.element.js","../packages/wje-tree-item/tree-item.js"],"sourcesContent":["import { default as WJElement, WjElementUtils, event } from '../wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * `wje-tree-item` is a custom web component used as a child of the `wje-tree`.\n * It represents a node within a tree structure, capable of nesting other items.\n * @summary Represents a single item in a tree structure.\n * @documentation https://elements.webjet.sk/components/tree-item\n * @status stable\n * @augments {HTMLElement}\n * @slot - Default slot for rendering the tree item's content (e.g., text or custom elements).\n * @csspart native - The native container of the tree item.\n * @cssproperty [--wje-tree-item-indent=var(--wje-spacing-large)] - Defines the indentation for nested tree items.\n * @cssproperty [--wje-tree-item-indent-guid-width=0px] - Specifies the width of the guide element shown next to a tree item.\n * @cssproperty [--wje-tree-item-indent-guid-style=solid] - Defines the guide border style for nested tree items.\n * @cssproperty [--wje-tree-item-indent-guid-color=var(--wje-border-color)] - Defines the guide border color for nested tree items.\n * @cssproperty [--wje-tree-item-border-radius=var(--wje-border-radius-medium)] - Sets the border radius of the tree item's container.\n * @cssproperty [--wje-tree-item-border-width=0px] - Sets the border width of the tree item row.\n * @cssproperty [--wje-tree-item-border-style=solid] - Sets the border style of the tree item row.\n * @cssproperty [--wje-tree-item-border-color=transparent] - Sets the border color of the tree item row.\n * @cssproperty [--wje-tree-item-border-color-hover=transparent] - Sets the border color of the hovered tree item row.\n * @cssproperty [--wje-tree-item-border-color-selected=transparent] - Sets the border color of the selected tree item row.\n * @cssproperty [--wje-tree-item-drop-color=var(--wje-color-primary)] - Sets the color of reorder drop indicators.\n * @cssproperty [--wje-tree-item-drop-line-width=2px] - Sets the thickness of before/after reorder drop indicators.\n * @cssproperty [--wje-tree-item-drop-line-border-radius=var(--wje-border-radius-pill)] - Sets the radius of before/after reorder drop indicators.\n * @cssproperty [--wje-tree-item-drop-border-width=1px] - Sets the width of the inside reorder drop border.\n * @cssproperty [--wje-tree-item-drop-border-style=solid] - Sets the style of the inside reorder drop border.\n * @cssproperty [--wje-tree-item-drop-border-color=var(--wje-tree-item-drop-color)] - Sets the color of the inside reorder drop border.\n * @cssproperty [--wje-tree-item-drop-border-radius=inherit] - Sets the radius of the inside reorder drop border.\n * @tag wje-tree-item\n */\n\nexport default class TreeItem extends WJElement {\n /**\n * Creates an instance of TreeItem.\n */\n constructor() {\n super();\n\n this._selection = 'single';\n }\n\n /**\n * Sets the expanded state of the element. When set to a truthy value,\n * the 'expanded' attribute will be added to the element. When set to a falsy\n * value, the 'expanded' attribute will be removed.\n * @param {boolean} value A boolean value indicating whether the\n * element should be expanded (true) or collapsed (false).\n */\n set expanded(value) {\n if (value) {\n this.setAttribute('expanded', '');\n } else {\n this.removeAttribute('expanded');\n }\n }\n\n /**\n * Retrieves the value of the 'expanded' state for the current element.\n * This getter checks whether the 'expanded' attribute is present on the element.\n * If the attribute exists, it returns true, representing that the element is expanded.\n * Otherwise, it returns false, indicating that the element is not expanded.\n * @returns {boolean} True if the 'expanded' attribute is present, false otherwise.\n */\n get expanded() {\n return this.hasAttribute('expanded');\n }\n\n /**\n * Sets the 'selected' attribute of the element. Removes the attribute if the provided value is falsy; otherwise, sets it.\n * @param {boolean} value The value indicating whether the element should have the 'selected' attribute.\n */\n set selected(value) {\n this.removeAttribute('selected');\n\n if (value) this.setAttribute('selected', '');\n }\n\n /**\n * Getter method for determining if the 'selected' attribute is present on the element.\n * @returns {boolean} Returns true if the 'selected' attribute is present, otherwise false.\n */\n get selected() {\n return this.hasAttribute('selected');\n }\n\n /**\n * Sets the selection mode for the component.\n * @param {string} value The selection mode to apply. Defaults to 'single'\n * if no value is provided. Possible options may be\n * specific to the implementation of the component\n * (e.g., 'single', 'multiple').\n */\n set selection(value) {\n this._selection = value || 'single';\n }\n\n /**\n * Retrieves the current selection.\n * @returns {*} The value of the current selection.\n */\n get selection() {\n return this._selection;\n }\n\n /**\n * Sets or removes the 'indeterminate' attribute based on the provided value.\n * This can be used to visually indicate an indeterminate state for elements like checkboxes.\n * @param {boolean} value A boolean indicating whether to set the element to an indeterminate state.\n * If true, the 'indeterminate' attribute is added to the element; if false, the attribute is removed.\n */\n set indeterminate(value) {\n this.removeAttribute('indeterminate');\n\n if (value) this.setAttribute('indeterminate', '');\n }\n\n /**\n * Retrieves the state of the indeterminate attribute.\n * @returns {boolean} True if the indeterminate attribute is present, otherwise false.\n */\n get indeterminate() {\n return this.hasAttribute('indeterminate');\n }\n\n /**\n * The class name for the component.\n * @type {string}\n */\n className = 'TreeItem';\n\n /**\n * Returns the CSS stylesheet for the component.\n * @static\n * @returns {CSSStyleSheet} The CSS stylesheet\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Setup attributes for the Button element.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n this.syncAria();\n }\n\n connectedCallback() {\n super.connectedCallback?.();\n this.syncNestingState();\n }\n\n /**\n * Returns the list of attributes to observe for changes.\n * @static\n * @returns {Array<string>}\n */\n static get observedAttributes() {\n return ['selected', 'indeterminate', 'expanded'];\n }\n\n /**\n * Handles updates when observed attributes of the element are changed.\n * Updates the checkbox state based on changes to the \"selected\" or \"indeterminate\" attributes.\n * @param {string} name The name of the attribute that was changed.\n * @param {string|null} oldValue The previous value of the attribute before the change.\n * @param {string|null} newValue The new value of the attribute after the change.\n * @returns {void}\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'expanded') {\n this.setChildrenExpanded(this.expanded, { syncAttribute: false });\n return;\n }\n\n if (!this.checkbox) {\n this.syncAria();\n return;\n }\n if (name === 'selected') {\n // this.checkbox.removeAttribute('indeterminate');\n if (this.selected) {\n this.checkbox.checked = true;\n } else {\n this.checkbox.checked = false;\n }\n }\n\n if (name === 'indeterminate' && !this.selected) {\n this.checkbox.removeAttribute('indeterminate');\n this.checkbox.removeAttribute('checked');\n\n if (this.indeterminate) this.checkbox.setAttribute('indeterminate', '');\n }\n this.syncAria();\n }\n\n /**\n * Custom logic executed before the draw process begins.\n * Determines and sets the appropriate slot if the current item is nested.\n * @returns {void} No return value.\n */\n beforeDraw() {\n this.syncNestingState();\n\n if (this.closest('wje-tree')?.hasAttribute('slot-hover-visible'))\n this.setAttribute('slot-hover-visible', '');\n }\n\n /**\n * Synchronizes the nesting-related state on the host element.\n * Sets the \"slot\" to children for nested items and updates\n * the nesting depth used to compute visual indentation.\n * @returns {void}\n */\n syncNestingState() {\n const depth = this.getNestingDepth();\n this.style.setProperty('--wje-tree-item-depth', String(depth));\n\n if (depth > 0) {\n this.slot = 'children';\n } else if (this.getAttribute('slot') === 'children') {\n this.removeAttribute('slot');\n }\n }\n\n /**\n * Creates and returns a document fragment representing the structure of a tree item component.\n * The method constructs the DOM elements including the native container, indentation, toggle button,\n * selection checkbox, label, and children container, along with their respective slots and attributes.\n * It dynamically handles the creation of expand and collapse icons, as well as appending slots for\n * child components.\n * @returns {DocumentFragment} A fragment containing the complete tree item structure to be rendered.\n */\n draw() {\n let fragment = document.createDocumentFragment();\n\n let native = document.createElement('div');\n native.setAttribute('part', 'native');\n native.classList.add('native-tree-item', this.selection === 'multiple' ? 'multiple' : 'single');\n\n let slotStart = document.createElement('slot');\n slotStart.setAttribute('name', 'start');\n\n let item = document.createElement('div');\n item.setAttribute('part', 'item');\n item.classList.add('item');\n\n let indent = document.createElement('div');\n indent.classList.add('indent');\n\n let button = document.createElement('div');\n button.classList.add('toggle');\n\n let checkbox = document.createElement('wje-checkbox');\n if (this.selected) checkbox.setAttribute('checked', '');\n\n let label = document.createElement('div');\n label.setAttribute('part', 'label');\n label.classList.add('content');\n\n let slotElement = document.createElement('slot');\n\n let children = document.createElement('div');\n children.classList.add('children');\n\n let slot = document.createElement('slot');\n slot.setAttribute('name', 'children');\n children.appendChild(slot);\n\n let slotEnd = document.createElement('slot');\n slotEnd.setAttribute('name', 'end');\n\n item.appendChild(slotStart);\n item.appendChild(indent);\n\n if (this.querySelectorAll(':scope > wje-tree-item').length > 0) {\n if (this.querySelectorAll('[slot=\"expand\"]').length < 1) {\n let expandIcon = document.createElement('wje-icon');\n expandIcon.setAttribute('name', 'chevron-right');\n expandIcon.setAttribute('slot', 'expand');\n\n this.appendChild(expandIcon);\n }\n\n if (this.querySelectorAll('[slot=\"collapse\"]').length < 1) {\n let collapseIcon = document.createElement('wje-icon');\n collapseIcon.setAttribute('name', 'chevron-down');\n collapseIcon.setAttribute('slot', 'collapse');\n\n this.appendChild(collapseIcon);\n }\n\n let expandSlot = document.createElement('slot');\n expandSlot.setAttribute('name', 'expand');\n\n let collapseSlot = document.createElement('slot');\n collapseSlot.setAttribute('name', 'collapse');\n\n button.appendChild(expandSlot);\n button.appendChild(collapseSlot);\n }\n\n item.appendChild(button);\n\n if (this.selection === 'multiple') item.appendChild(checkbox);\n\n label.appendChild(slotElement);\n item.appendChild(label);\n item.appendChild(slotEnd);\n\n native.appendChild(item);\n native.appendChild(children);\n\n fragment.appendChild(native);\n\n this.checkbox = checkbox;\n this.native = native;\n this.button = button;\n this.childrenElement = children;\n this.childrenSlot = slot;\n\n return fragment;\n }\n\n /**\n * Executes operations to be performed after the draw action is completed.\n * If the state indicates it is expanded, toggles its children.\n * Additionally, sets up an event listener on the button element to handle toggling children upon click.\n * @returns {void} Does not return a value.\n */\n afterDraw() {\n this.setChildrenExpanded(this.expanded, { syncAttribute: false });\n\n this.button.addEventListener('click', this.toggleChildren.bind(this));\n this.setAttribute('tabindex', '0');\n this.syncAria();\n }\n\n /**\n * Determines if the current item is a nested item within a tree structure.\n * Checks if the item's parent element exists and is also a tree item.\n * @returns {boolean} Returns true if the current item is a nested tree item; otherwise, false.\n */\n isNestedItem() {\n const parent = this.parentElement;\n return !!parent && this.isTreeItem(parent);\n }\n\n /**\n * Calculates nesting depth based on ancestor tree items.\n * Root items have depth 0, direct children depth 1, etc.\n * @returns {number}\n */\n getNestingDepth() {\n let depth = 0;\n let current = this.parentElement;\n\n while (current) {\n if (this.isTreeItem(current)) depth += 1;\n current = current.parentElement;\n }\n\n return depth;\n }\n\n /**\n * Checks whether the given node is a tree item.\n * @param {object} node The node to check.\n * @returns {boolean} Returns true when the node is a tree item element.\n */\n isTreeItem(node) {\n return node instanceof Element && node.localName === 'wje-tree-item';\n }\n\n /**\n * Toggles the visibility state of the children element and updates the class of the parent element.\n * The method toggles the 'open' class on the children elements and the 'expanded' class on the parent element,\n * effectively showing or hiding the children and indicating the expanded state.\n * @returns {void} Does not return a value.\n */\n toggleChildren() {\n this.setChildrenExpanded(!this.childrenElement.classList.contains('open'));\n }\n\n /**\n * Sets the rendered children visibility and optionally mirrors it to the expanded attribute.\n * @param {boolean} expanded Whether child items should be visible.\n * @param {object} [options] Configuration for attribute syncing.\n * @param {boolean} [options.syncAttribute] Mirrors the visual state to the host attribute when true.\n * @returns {void}\n */\n setChildrenExpanded(expanded, options = {}) {\n const syncAttribute = options.syncAttribute ?? true;\n\n this.childrenElement?.classList.toggle('open', expanded);\n this.native?.classList.toggle('expanded', expanded);\n\n if (syncAttribute) {\n if (expanded) this.setAttribute('expanded', '');\n else this.removeAttribute('expanded');\n }\n\n this.syncAria();\n }\n\n /**\n * Syncs ARIA attributes on the host element.\n */\n syncAria() {\n const hasChildren = this.querySelectorAll(':scope > wje-tree-item').length > 0;\n const expanded = hasChildren ? this.native?.classList?.contains('expanded') : undefined;\n if (this.selection === 'multiple') {\n const checked = this.indeterminate ? 'mixed' : (this.selected ? 'true' : 'false');\n this.setAriaState({\n role: 'treeitem',\n checked,\n expanded,\n });\n } else {\n this.setAriaState({\n role: 'treeitem',\n selected: this.selected,\n expanded,\n });\n }\n }\n\n /**\n * Retrieves the child items from the `childrenSlot` that match specific criteria.\n * @param {object} [options] Configuration options.\n * @param {boolean} [options.includeDisabled] Determines whether disabled items should be included in the result. Defaults to true.\n * @returns {Array} An array of child items that are valid tree items and meet the criteria specified in the options.\n */\n getChildrenItems(options = {}) {\n const includeDisabled = options.includeDisabled ?? true;\n\n const assigned = this.childrenSlot\n ? this.childrenSlot.assignedElements({ flatten: true })\n : [];\n const direct = assigned.length\n ? assigned\n : Array.from(this.querySelectorAll(':scope > wje-tree-item'));\n\n return direct.filter(\n (item) => this.isTreeItem(item) && (includeDisabled || !item.disabled)\n );\n }\n\n /**\n * Retrieves all descendant children of the current object in a flattened array structure.\n * @param {object} [options] An optional object specifying filters or configurations for retrieving children.\n * @returns {Array} An array containing all children and their descendants in a flat structure.\n */\n getAllChildrenFlat(options = {}) {\n const directChildren = this.getChildrenItems(options);\n return directChildren.flatMap((child) => [child, ...child.getAllChildrenFlat(options)]);\n }\n}\n","import TreeItem from './tree-item.element.js';\n\nexport default TreeItem;\n\nTreeItem.define('wje-tree-item', TreeItem);\n"],"names":[],"mappings":";;;;;AAgCe,MAAM,iBAAiB,UAAU;AAAA;AAAA;AAAA;AAAA,EAI5C,cAAc;AACV,UAAK;AA4FT;AAAA;AAAA;AAAA;AAAA,qCAAY;AA1F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,KAAI,CAAE,IACpD,CAAA;AACN,UAAM,SAAS,SAAS,SAClB,WACA,MAAM,KAAK,KAAK,iBAAiB,wBAAwB,CAAC;AAEhE,WAAO,OAAO;AAAA,MACV,CAAC,SAAS,KAAK,WAAW,IAAI,MAAM,mBAAmB,CAAC,KAAK;AAAA,IACzE;AAAA,EACI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,mBAAmB,UAAU,IAAI;AAC7B,UAAM,iBAAiB,KAAK,iBAAiB,OAAO;AACpD,WAAO,eAAe,QAAQ,CAAC,UAAU,CAAC,OAAO,GAAG,MAAM,mBAAmB,OAAO,CAAC,CAAC;AAAA,EAC1F;AACJ;ACvcA,SAAS,OAAO,iBAAiB,QAAQ;"}
1
+ {"version":3,"file":"wje-tree-item.js","sources":["../packages/wje-tree-item/tree-item.element.js","../packages/wje-tree-item/tree-item.js"],"sourcesContent":["import { default as WJElement, WjElementUtils, event } from '../wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * `wje-tree-item` is a custom web component used as a child of the `wje-tree`.\n * It represents a node within a tree structure, capable of nesting other items.\n * @summary Represents a single item in a tree structure.\n * @documentation https://elements.webjet.sk/components/tree-item\n * @status stable\n * @augments {HTMLElement}\n * @slot - Default slot for rendering the tree item's content (e.g., text or custom elements).\n * @csspart native - The native container of the tree item.\n * @cssproperty [--wje-tree-item-indent=var(--wje-spacing-large)] - Defines the indentation for nested tree items.\n * @cssproperty [--wje-tree-item-indent-guid-width=0px] - Specifies the width of the guide element shown next to a tree item.\n * @cssproperty [--wje-tree-item-indent-guid-style=solid] - Defines the guide border style for nested tree items.\n * @cssproperty [--wje-tree-item-indent-guid-color=var(--wje-border-color)] - Defines the guide border color for nested tree items.\n * @cssproperty [--wje-tree-item-border-radius=var(--wje-border-radius-medium)] - Sets the border radius of the tree item's container.\n * @cssproperty [--wje-tree-item-border-width=0px] - Sets the border width of the tree item row.\n * @cssproperty [--wje-tree-item-border-style=solid] - Sets the border style of the tree item row.\n * @cssproperty [--wje-tree-item-border-color=transparent] - Sets the border color of the tree item row.\n * @cssproperty [--wje-tree-item-border-color-hover=transparent] - Sets the border color of the hovered tree item row.\n * @cssproperty [--wje-tree-item-border-color-selected=transparent] - Sets the border color of the selected tree item row.\n * @cssproperty [--wje-tree-item-drop-color=var(--wje-color-primary)] - Sets the color of reorder drop indicators.\n * @cssproperty [--wje-tree-item-drop-line-width=2px] - Sets the thickness of before/after reorder drop indicators.\n * @cssproperty [--wje-tree-item-drop-line-border-radius=var(--wje-border-radius-pill)] - Sets the radius of before/after reorder drop indicators.\n * @cssproperty [--wje-tree-item-drop-border-width=1px] - Sets the width of the inside reorder drop border.\n * @cssproperty [--wje-tree-item-drop-border-style=solid] - Sets the style of the inside reorder drop border.\n * @cssproperty [--wje-tree-item-drop-border-color=var(--wje-tree-item-drop-color)] - Sets the color of the inside reorder drop border.\n * @cssproperty [--wje-tree-item-drop-border-radius=inherit] - Sets the radius of the inside reorder drop border.\n * @tag wje-tree-item\n */\n\nexport default class TreeItem extends WJElement {\n /**\n * Creates an instance of TreeItem.\n */\n constructor() {\n super();\n\n this._selection = 'single';\n }\n\n /**\n * Sets the expanded state of the element. When set to a truthy value,\n * the 'expanded' attribute will be added to the element. When set to a falsy\n * value, the 'expanded' attribute will be removed.\n * @param {boolean} value A boolean value indicating whether the\n * element should be expanded (true) or collapsed (false).\n */\n set expanded(value) {\n if (value) {\n this.setAttribute('expanded', '');\n } else {\n this.removeAttribute('expanded');\n }\n }\n\n /**\n * Retrieves the value of the 'expanded' state for the current element.\n * This getter checks whether the 'expanded' attribute is present on the element.\n * If the attribute exists, it returns true, representing that the element is expanded.\n * Otherwise, it returns false, indicating that the element is not expanded.\n * @returns {boolean} True if the 'expanded' attribute is present, false otherwise.\n */\n get expanded() {\n return this.hasAttribute('expanded');\n }\n\n /**\n * Sets the 'selected' attribute of the element. Removes the attribute if the provided value is falsy; otherwise, sets it.\n * @param {boolean} value The value indicating whether the element should have the 'selected' attribute.\n */\n set selected(value) {\n this.removeAttribute('selected');\n\n if (value) this.setAttribute('selected', '');\n }\n\n /**\n * Getter method for determining if the 'selected' attribute is present on the element.\n * @returns {boolean} Returns true if the 'selected' attribute is present, otherwise false.\n */\n get selected() {\n return this.hasAttribute('selected');\n }\n\n /**\n * Sets the selection mode for the component.\n * @param {string} value The selection mode to apply. Defaults to 'single'\n * if no value is provided. Possible options may be\n * specific to the implementation of the component\n * (e.g., 'single', 'multiple').\n */\n set selection(value) {\n this._selection = value || 'single';\n }\n\n /**\n * Retrieves the current selection.\n * @returns {*} The value of the current selection.\n */\n get selection() {\n return this._selection;\n }\n\n /**\n * Sets or removes the 'indeterminate' attribute based on the provided value.\n * This can be used to visually indicate an indeterminate state for elements like checkboxes.\n * @param {boolean} value A boolean indicating whether to set the element to an indeterminate state.\n * If true, the 'indeterminate' attribute is added to the element; if false, the attribute is removed.\n */\n set indeterminate(value) {\n this.removeAttribute('indeterminate');\n\n if (value) this.setAttribute('indeterminate', '');\n }\n\n /**\n * Retrieves the state of the indeterminate attribute.\n * @returns {boolean} True if the indeterminate attribute is present, otherwise false.\n */\n get indeterminate() {\n return this.hasAttribute('indeterminate');\n }\n\n /**\n * The class name for the component.\n * @type {string}\n */\n className = 'TreeItem';\n\n /**\n * Returns the CSS stylesheet for the component.\n * @static\n * @returns {CSSStyleSheet} The CSS stylesheet\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Setup attributes for the Button element.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n this.syncAria();\n }\n\n connectedCallback() {\n super.connectedCallback?.();\n this.syncNestingState();\n }\n\n /**\n * Returns the list of attributes to observe for changes.\n * @static\n * @returns {Array<string>}\n */\n static get observedAttributes() {\n return ['selected', 'indeterminate', 'expanded'];\n }\n\n /**\n * Handles updates when observed attributes of the element are changed.\n * Updates the checkbox state based on changes to the \"selected\" or \"indeterminate\" attributes.\n * @param {string} name The name of the attribute that was changed.\n * @param {string|null} oldValue The previous value of the attribute before the change.\n * @param {string|null} newValue The new value of the attribute after the change.\n * @returns {void}\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'expanded') {\n this.setChildrenExpanded(this.expanded, { syncAttribute: false });\n return;\n }\n\n if (!this.checkbox) {\n this.syncAria();\n return;\n }\n if (name === 'selected') {\n // this.checkbox.removeAttribute('indeterminate');\n if (this.selected) {\n this.checkbox.checked = true;\n } else {\n this.checkbox.checked = false;\n }\n }\n\n if (name === 'indeterminate' && !this.selected) {\n this.checkbox.removeAttribute('indeterminate');\n this.checkbox.removeAttribute('checked');\n\n if (this.indeterminate) this.checkbox.setAttribute('indeterminate', '');\n }\n this.syncAria();\n }\n\n /**\n * Custom logic executed before the draw process begins.\n * Determines and sets the appropriate slot if the current item is nested.\n * @returns {void} No return value.\n */\n beforeDraw() {\n this.syncNestingState();\n\n if (this.closest('wje-tree')?.hasAttribute('slot-hover-visible'))\n this.setAttribute('slot-hover-visible', '');\n }\n\n /**\n * Synchronizes the nesting-related state on the host element.\n * Sets the \"slot\" to children for nested items and updates\n * the nesting depth used to compute visual indentation.\n * @returns {void}\n */\n syncNestingState() {\n const depth = this.getNestingDepth();\n this.style.setProperty('--wje-tree-item-depth', String(depth));\n\n if (depth > 0) {\n this.slot = 'children';\n } else if (this.getAttribute('slot') === 'children') {\n this.removeAttribute('slot');\n }\n }\n\n /**\n * Creates and returns a document fragment representing the structure of a tree item component.\n * The method constructs the DOM elements including the native container, indentation, toggle button,\n * selection checkbox, label, and children container, along with their respective slots and attributes.\n * It dynamically handles the creation of expand and collapse icons, as well as appending slots for\n * child components.\n * @returns {DocumentFragment} A fragment containing the complete tree item structure to be rendered.\n */\n draw() {\n let fragment = document.createDocumentFragment();\n\n let native = document.createElement('div');\n native.setAttribute('part', 'native');\n native.classList.add('native-tree-item', this.selection === 'multiple' ? 'multiple' : 'single');\n\n let slotStart = document.createElement('slot');\n slotStart.setAttribute('name', 'start');\n\n let item = document.createElement('div');\n item.setAttribute('part', 'item');\n item.classList.add('item');\n\n let indent = document.createElement('div');\n indent.classList.add('indent');\n\n let button = document.createElement('div');\n button.classList.add('toggle');\n\n let checkbox = document.createElement('wje-checkbox');\n if (this.selected) checkbox.setAttribute('checked', '');\n\n let label = document.createElement('div');\n label.setAttribute('part', 'label');\n label.classList.add('content');\n\n let slotElement = document.createElement('slot');\n\n let children = document.createElement('div');\n children.classList.add('children');\n\n let slot = document.createElement('slot');\n slot.setAttribute('name', 'children');\n children.appendChild(slot);\n\n let slotEnd = document.createElement('slot');\n slotEnd.setAttribute('name', 'end');\n\n item.appendChild(slotStart);\n item.appendChild(indent);\n\n if (this.querySelectorAll(':scope > wje-tree-item').length > 0) {\n if (this.querySelectorAll('[slot=\"expand\"]').length < 1) {\n let expandIcon = document.createElement('wje-icon');\n expandIcon.setAttribute('name', 'chevron-right');\n expandIcon.setAttribute('slot', 'expand');\n\n this.appendChild(expandIcon);\n }\n\n if (this.querySelectorAll('[slot=\"collapse\"]').length < 1) {\n let collapseIcon = document.createElement('wje-icon');\n collapseIcon.setAttribute('name', 'chevron-down');\n collapseIcon.setAttribute('slot', 'collapse');\n\n this.appendChild(collapseIcon);\n }\n\n let expandSlot = document.createElement('slot');\n expandSlot.setAttribute('name', 'expand');\n\n let collapseSlot = document.createElement('slot');\n collapseSlot.setAttribute('name', 'collapse');\n\n button.appendChild(expandSlot);\n button.appendChild(collapseSlot);\n }\n\n item.appendChild(button);\n\n if (this.selection === 'multiple') item.appendChild(checkbox);\n\n label.appendChild(slotElement);\n item.appendChild(label);\n item.appendChild(slotEnd);\n\n native.appendChild(item);\n native.appendChild(children);\n\n fragment.appendChild(native);\n\n this.checkbox = checkbox;\n this.native = native;\n this.button = button;\n this.childrenElement = children;\n this.childrenSlot = slot;\n\n return fragment;\n }\n\n /**\n * Executes operations to be performed after the draw action is completed.\n * If the state indicates it is expanded, toggles its children.\n * Additionally, sets up an event listener on the button element to handle toggling children upon click.\n * @returns {void} Does not return a value.\n */\n afterDraw() {\n this.setChildrenExpanded(this.expanded, { syncAttribute: false });\n\n this.button.addEventListener('click', this.toggleChildren.bind(this));\n this.setAttribute('tabindex', '0');\n this.syncAria();\n }\n\n /**\n * Determines if the current item is a nested item within a tree structure.\n * Checks if the item's parent element exists and is also a tree item.\n * @returns {boolean} Returns true if the current item is a nested tree item; otherwise, false.\n */\n isNestedItem() {\n const parent = this.parentElement;\n return !!parent && this.isTreeItem(parent);\n }\n\n /**\n * Calculates nesting depth based on ancestor tree items.\n * Root items have depth 0, direct children depth 1, etc.\n * @returns {number}\n */\n getNestingDepth() {\n let depth = 0;\n let current = this.parentElement;\n\n while (current) {\n if (this.isTreeItem(current)) depth += 1;\n current = current.parentElement;\n }\n\n return depth;\n }\n\n /**\n * Checks whether the given node is a tree item.\n * @param {object} node The node to check.\n * @returns {boolean} Returns true when the node is a tree item element.\n */\n isTreeItem(node) {\n return node instanceof Element && node.localName === 'wje-tree-item';\n }\n\n /**\n * Toggles the visibility state of the children element and updates the class of the parent element.\n * The method toggles the 'open' class on the children elements and the 'expanded' class on the parent element,\n * effectively showing or hiding the children and indicating the expanded state.\n * @returns {void} Does not return a value.\n */\n toggleChildren() {\n this.setChildrenExpanded(!this.childrenElement.classList.contains('open'));\n }\n\n /**\n * Sets the rendered children visibility and optionally mirrors it to the expanded attribute.\n * @param {boolean} expanded Whether child items should be visible.\n * @param {object} [options] Configuration for attribute syncing.\n * @param {boolean} [options.syncAttribute] Mirrors the visual state to the host attribute when true.\n * @returns {void}\n */\n setChildrenExpanded(expanded, options = {}) {\n const syncAttribute = options.syncAttribute ?? true;\n\n this.childrenElement?.classList.toggle('open', expanded);\n this.native?.classList.toggle('expanded', expanded);\n\n if (syncAttribute) {\n if (expanded) this.setAttribute('expanded', '');\n else this.removeAttribute('expanded');\n }\n\n this.syncAria();\n }\n\n /**\n * Syncs ARIA attributes on the host element.\n */\n syncAria() {\n const hasChildren = this.querySelectorAll(':scope > wje-tree-item').length > 0;\n const expanded = hasChildren ? this.native?.classList?.contains('expanded') : undefined;\n if (this.selection === 'multiple') {\n const checked = this.indeterminate ? 'mixed' : (this.selected ? 'true' : 'false');\n this.setAriaState({\n role: 'treeitem',\n checked,\n expanded,\n });\n } else {\n this.setAriaState({\n role: 'treeitem',\n selected: this.selected,\n expanded,\n });\n }\n }\n\n /**\n * Retrieves the child items from the `childrenSlot` that match specific criteria.\n * @param {object} [options] Configuration options.\n * @param {boolean} [options.includeDisabled] Determines whether disabled items should be included in the result. Defaults to true.\n * @returns {Array} An array of child items that are valid tree items and meet the criteria specified in the options.\n */\n getChildrenItems(options = {}) {\n const includeDisabled = options.includeDisabled ?? true;\n\n const assigned = this.childrenSlot\n ? this.childrenSlot.assignedElements({ flatten: true })\n : [];\n const direct = assigned.length\n ? assigned\n : Array.from(this.querySelectorAll(':scope > wje-tree-item'));\n\n return direct.filter(\n (item) => this.isTreeItem(item) && (includeDisabled || !item.disabled)\n );\n }\n\n /**\n * Retrieves all descendant children of the current object in a flattened array structure.\n * @param {object} [options] An optional object specifying filters or configurations for retrieving children.\n * @returns {Array} An array containing all children and their descendants in a flat structure.\n */\n getAllChildrenFlat(options = {}) {\n const directChildren = this.getChildrenItems(options);\n return directChildren.flatMap((child) => [child, ...child.getAllChildrenFlat(options)]);\n }\n}\n","import TreeItem from './tree-item.element.js';\n\nexport default TreeItem;\n\nTreeItem.define('wje-tree-item', TreeItem);\n"],"names":["TreeItem","WJElement","super","className","this","_selection","value","setAttribute","removeAttribute","expanded","hasAttribute","selected","cssStyleSheet","setupAttributes","isShadowRoot","syncAria","connectedCallback","syncNestingState","name","oldValue","newValue","checkbox","checked","indeterminate","setChildrenExpanded","syncAttribute","beforeDraw","closest","depth","getNestingDepth","style","setProperty","String","slot","getAttribute","draw","fragment","document","createDocumentFragment","native","createElement","classList","add","selection","slotStart","item","indent","button","label","slotElement","children","appendChild","slotEnd","querySelectorAll","length","expandIcon","collapseIcon","expandSlot","collapseSlot","childrenElement","childrenSlot","addEventListener","toggleChildren","bind","parent","parentElement","isTreeItem","current","node","Element","localName","contains","options","toggle","setAriaState","role","includeDisabled","assigned","assignedElements","flatten","Array","from","filter","disabled","getChildrenItems","flatMap","child","getAllChildrenFlat","define"],"mappings":";;;;AAgCe,MAAMA,UAAiBC,EAAAA;AAAAA,EAIlC;AACIC,UAAAA;AA4FJC,qCAAY;AA1FRC,SAAKC,aAAa;AAAA,EACtB;AAAA,EASA,IAAA,SAAaC;AACLA,IAAAA,KACAF,KAAKG,aAAa,YAAY,EAAA,IAE9BH,KAAKI,gBAAgB;EAE7B;AAAA,EASA,IAAA,WAAIC;AACA,WAAOL,KAAKM,aAAa,UAAA;AAAA,EAC7B;AAAA,EAMA,IAAA,SAAaJ,IAAAA;AACTF,SAAKI,gBAAgB,UAAA,GAEjBF,MAAOF,KAAKG,aAAa,YAAY,EAAA;AAAA,EAC7C;AAAA,EAMA,eAAII;AACA,WAAOP,KAAKM,aAAa;EAC7B;AAAA,EASA,IAAA,UAAcJ,IAAAA;AACVF,SAAKC,aAAaC,MAAS;AAAA,EAC/B;AAAA,EAMA,IAAA;AACI,WAAOF,KAAKC;AAAAA,EAChB;AAAA,EAQA,kBAAkBC,IAAAA;AACdF,SAAKI,gBAAgB,kBAEjBF,MAAOF,KAAKG,aAAa,iBAAiB;EAClD;AAAA,EAMA,IAAA;AACI,WAAOH,KAAKM,aAAa,eAAA;AAAA,EAC7B;AAAA,EAaA,2BAAWE;AACP;EACJ;AAAA,EAKA,kBAAAC;AACIT,SAAKU,eAAe,QACpBV,KAAKW,SAAAA;AAAAA,EACT;AAAA,EAEA,oBAAAC;;AACId,gBAAMc,sBAANd,+BACAE,KAAKa,iBAAAA;AAAAA,EACT;AAAA,EAOA,WAAA;AACI,WAAO,CAAC,YAAY,iBAAiB;EACzC;AAAA,EAUA,yBAAyBC,IAAMC,IAAUC,GAAAA;AACxB,mBAATF,KAKCd,KAAKiB,YAIG,eAATH,OAEId,KAAKO,WACLP,KAAKiB,SAASC,UAAAA,OAEdlB,KAAKiB,SAASC,kBAIT,oBAATJ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