wj-elements 0.2.0-alpha.9 → 0.3.0-alpha.1

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 (217) hide show
  1. package/dist/dark.css +15 -1
  2. package/dist/{form-associated-element-o0UjvdUp.js → form-associated-element-DEQ4y-jn.js} +1 -2
  3. package/dist/form-associated-element-DEQ4y-jn.js.map +1 -0
  4. package/dist/{icon-DY5AZ6xM.js → icon-DVyMc4Wv.js} +36 -2
  5. package/dist/{icon-DY5AZ6xM.js.map → icon-DVyMc4Wv.js.map} +1 -1
  6. package/dist/light.css +7 -2
  7. package/dist/localize.js +8 -5
  8. package/dist/localize.js.map +1 -1
  9. package/dist/packages/internals/form-associated-element.d.ts +0 -1
  10. package/dist/packages/utils/utils.d.ts +16 -0
  11. package/dist/packages/wje-accordion-item/accordion-item.element.d.ts +3 -0
  12. package/dist/packages/wje-avatar/avatar.element.d.ts +5 -0
  13. package/dist/packages/wje-breadcrumb/breadcrumb.element.d.ts +1 -0
  14. package/dist/packages/wje-button/button.element.d.ts +5 -1
  15. package/dist/packages/wje-button-group/button-group.element.d.ts +4 -0
  16. package/dist/packages/wje-card/card.element.d.ts +15 -6
  17. package/dist/packages/wje-carousel/carousel.element.d.ts +4 -0
  18. package/dist/packages/wje-checkbox/checkbox.element.d.ts +14 -0
  19. package/dist/packages/wje-chip/chip.element.d.ts +6 -0
  20. package/dist/packages/wje-color-picker/color-picker.element.d.ts +43 -1
  21. package/dist/packages/wje-copy-button/copy-button.element.d.ts +4 -0
  22. package/dist/packages/wje-dialog/dialog.element.d.ts +2 -0
  23. package/dist/packages/wje-dropdown/dropdown.element.d.ts +7 -0
  24. package/dist/packages/wje-element/element.d.ts +55 -24
  25. package/dist/packages/wje-file-upload/file-upload.element.d.ts +17 -6
  26. package/dist/packages/wje-file-upload/service/service.d.ts +0 -23
  27. package/dist/packages/wje-file-upload-item/file-upload-item.element.d.ts +5 -0
  28. package/dist/packages/wje-format-digital/format-digital.element.d.ts +2 -0
  29. package/dist/packages/wje-icon/icon.element.d.ts +11 -0
  30. package/dist/packages/wje-icon-picker/icon-picker.element.d.ts +4 -0
  31. package/dist/packages/wje-img/img.element.d.ts +1 -0
  32. package/dist/packages/wje-infinite-scroll/infinite-scroll.element.d.ts +4 -0
  33. package/dist/packages/wje-input/input.element.d.ts +9 -1
  34. package/dist/packages/wje-item/item.element.d.ts +8 -0
  35. package/dist/packages/wje-kanban/kanban.element.d.ts +4 -0
  36. package/dist/packages/wje-level-indicator/level-indicator.element.d.ts +17 -0
  37. package/dist/packages/wje-list/list.element.d.ts +4 -0
  38. package/dist/packages/wje-menu-item/menu-item.element.d.ts +4 -0
  39. package/dist/packages/wje-option/option.element.d.ts +4 -0
  40. package/dist/packages/wje-options/options.element.d.ts +4 -0
  41. package/dist/packages/wje-orgchart/orgchart.element.d.ts +4 -0
  42. package/dist/packages/wje-progress-bar/progress-bar.element.d.ts +11 -0
  43. package/dist/packages/wje-qr-code/qr-code.element.d.ts +63 -0
  44. package/dist/packages/wje-radio/radio.element.d.ts +5 -0
  45. package/dist/packages/wje-radio-group/radio-group.element.d.ts +16 -1
  46. package/dist/packages/wje-rate/rate.element.d.ts +4 -0
  47. package/dist/packages/wje-relative-time/relative-time.element.d.ts +2 -0
  48. package/dist/packages/wje-reorder/reorder.element.d.ts +4 -0
  49. package/dist/packages/wje-reorder-handle/reorder-handle.element.d.ts +4 -0
  50. package/dist/packages/wje-select/select.element.d.ts +7 -0
  51. package/dist/packages/wje-slider/slider.element.d.ts +5 -0
  52. package/dist/packages/wje-sliding-container/sliding-container.element.d.ts +4 -0
  53. package/dist/packages/wje-split-view/split-view.element.d.ts +1 -0
  54. package/dist/packages/wje-stepper/stepper.element.d.ts +1 -0
  55. package/dist/packages/wje-tab/tab.element.d.ts +10 -0
  56. package/dist/packages/wje-tab-group/tab-group.element.d.ts +11 -0
  57. package/dist/packages/wje-textarea/textarea.element.d.ts +20 -1
  58. package/dist/packages/wje-thumbnail/thumbnail.element.d.ts +4 -0
  59. package/dist/packages/wje-timeline/timeline.element.d.ts +4 -0
  60. package/dist/packages/wje-toggle/toggle.element.d.ts +4 -0
  61. package/dist/packages/wje-toolbar/toolbar.element.d.ts +4 -0
  62. package/dist/packages/wje-tooltip/tooltip.element.d.ts +3 -0
  63. package/dist/packages/wje-tree/tree.element.d.ts +4 -0
  64. package/dist/packages/wje-tree-item/tree-item.element.d.ts +5 -0
  65. package/dist/{popup.element-DeajFyOQ.js → popup.element-Cl6QeG8M.js} +2 -2
  66. package/dist/{popup.element-DeajFyOQ.js.map → popup.element-Cl6QeG8M.js.map} +1 -1
  67. package/dist/skeleton.css +197 -0
  68. package/dist/utils.js +18 -1
  69. package/dist/utils.js.map +1 -1
  70. package/dist/wje-accordion-item.js +26 -4
  71. package/dist/wje-accordion-item.js.map +1 -1
  72. package/dist/wje-accordion.js +1 -0
  73. package/dist/wje-accordion.js.map +1 -1
  74. package/dist/wje-animation.js +1 -0
  75. package/dist/wje-animation.js.map +1 -1
  76. package/dist/wje-avatar.js +18 -0
  77. package/dist/wje-avatar.js.map +1 -1
  78. package/dist/wje-badge.js +1 -0
  79. package/dist/wje-badge.js.map +1 -1
  80. package/dist/wje-breadcrumb.js +13 -1
  81. package/dist/wje-breadcrumb.js.map +1 -1
  82. package/dist/wje-breadcrumbs.js +1 -0
  83. package/dist/wje-breadcrumbs.js.map +1 -1
  84. package/dist/wje-button-group.js +10 -0
  85. package/dist/wje-button-group.js.map +1 -1
  86. package/dist/wje-button.js +29 -5
  87. package/dist/wje-button.js.map +1 -1
  88. package/dist/wje-card.js +37 -0
  89. package/dist/wje-card.js.map +1 -1
  90. package/dist/wje-carousel.js +38 -4
  91. package/dist/wje-carousel.js.map +1 -1
  92. package/dist/wje-checkbox.js +48 -3
  93. package/dist/wje-checkbox.js.map +1 -1
  94. package/dist/wje-chip.js +22 -0
  95. package/dist/wje-chip.js.map +1 -1
  96. package/dist/wje-color-picker.js +143 -29
  97. package/dist/wje-color-picker.js.map +1 -1
  98. package/dist/wje-copy-button.js +21 -0
  99. package/dist/wje-copy-button.js.map +1 -1
  100. package/dist/wje-dialog.js +35 -2
  101. package/dist/wje-dialog.js.map +1 -1
  102. package/dist/wje-dropdown.js +27 -3
  103. package/dist/wje-dropdown.js.map +1 -1
  104. package/dist/wje-element.js +87 -242
  105. package/dist/wje-element.js.map +1 -1
  106. package/dist/wje-file-upload-item.js +23 -1
  107. package/dist/wje-file-upload-item.js.map +1 -1
  108. package/dist/wje-file-upload.js +100 -77
  109. package/dist/wje-file-upload.js.map +1 -1
  110. package/dist/wje-format-digital.js +9 -0
  111. package/dist/wje-format-digital.js.map +1 -1
  112. package/dist/wje-icon-picker.js +15 -0
  113. package/dist/wje-icon-picker.js.map +1 -1
  114. package/dist/wje-icon.js +1 -1
  115. package/dist/wje-img-comparer.js +5 -1
  116. package/dist/wje-img-comparer.js.map +1 -1
  117. package/dist/wje-img.js +16 -1
  118. package/dist/wje-img.js.map +1 -1
  119. package/dist/wje-infinite-scroll.js +10 -0
  120. package/dist/wje-infinite-scroll.js.map +1 -1
  121. package/dist/wje-input-file.js +2 -0
  122. package/dist/wje-input-file.js.map +1 -1
  123. package/dist/wje-input.js +59 -4
  124. package/dist/wje-input.js.map +1 -1
  125. package/dist/wje-item.js +14 -0
  126. package/dist/wje-item.js.map +1 -1
  127. package/dist/wje-kanban.js +14 -0
  128. package/dist/wje-kanban.js.map +1 -1
  129. package/dist/wje-level-indicator.js +36 -0
  130. package/dist/wje-level-indicator.js.map +1 -1
  131. package/dist/wje-list.js +10 -0
  132. package/dist/wje-list.js.map +1 -1
  133. package/dist/wje-master.js +11 -2
  134. package/dist/wje-master.js.map +1 -1
  135. package/dist/wje-menu-button.js +1 -0
  136. package/dist/wje-menu-button.js.map +1 -1
  137. package/dist/wje-menu-item.js +24 -0
  138. package/dist/wje-menu-item.js.map +1 -1
  139. package/dist/wje-menu.js +4 -1
  140. package/dist/wje-menu.js.map +1 -1
  141. package/dist/wje-option.js +14 -1
  142. package/dist/wje-option.js.map +1 -1
  143. package/dist/wje-options.js +13 -0
  144. package/dist/wje-options.js.map +1 -1
  145. package/dist/wje-orgchart.js +9 -0
  146. package/dist/wje-orgchart.js.map +1 -1
  147. package/dist/wje-pagination.js +18 -9
  148. package/dist/wje-pagination.js.map +1 -1
  149. package/dist/wje-popup.js +1 -1
  150. package/dist/wje-progress-bar.js +26 -0
  151. package/dist/wje-progress-bar.js.map +1 -1
  152. package/dist/wje-qr-code.js +159 -17
  153. package/dist/wje-qr-code.js.map +1 -1
  154. package/dist/wje-radio-group.js +49 -2
  155. package/dist/wje-radio-group.js.map +1 -1
  156. package/dist/wje-radio.js +27 -1
  157. package/dist/wje-radio.js.map +1 -1
  158. package/dist/wje-rate.js +23 -1
  159. package/dist/wje-rate.js.map +1 -1
  160. package/dist/wje-relative-time.js +14 -1
  161. package/dist/wje-relative-time.js.map +1 -1
  162. package/dist/wje-reorder-handle.js +21 -0
  163. package/dist/wje-reorder-handle.js.map +1 -1
  164. package/dist/wje-reorder.js +10 -0
  165. package/dist/wje-reorder.js.map +1 -1
  166. package/dist/wje-select.js +35 -5
  167. package/dist/wje-select.js.map +1 -1
  168. package/dist/wje-slider.js +51 -1
  169. package/dist/wje-slider.js.map +1 -1
  170. package/dist/wje-sliding-container.js +18 -0
  171. package/dist/wje-sliding-container.js.map +1 -1
  172. package/dist/wje-split-view.js +9 -0
  173. package/dist/wje-split-view.js.map +1 -1
  174. package/dist/wje-status.js +1 -0
  175. package/dist/wje-status.js.map +1 -1
  176. package/dist/wje-stepper.js +24 -1
  177. package/dist/wje-stepper.js.map +1 -1
  178. package/dist/wje-tab-group.js +59 -2
  179. package/dist/wje-tab-group.js.map +1 -1
  180. package/dist/wje-tab.js +30 -0
  181. package/dist/wje-tab.js.map +1 -1
  182. package/dist/wje-textarea.js +96 -14
  183. package/dist/wje-textarea.js.map +1 -1
  184. package/dist/wje-thumbnail.js +19 -0
  185. package/dist/wje-thumbnail.js.map +1 -1
  186. package/dist/wje-toast.js +4 -0
  187. package/dist/wje-toast.js.map +1 -1
  188. package/dist/wje-toggle.js +17 -1
  189. package/dist/wje-toggle.js.map +1 -1
  190. package/dist/wje-toolbar.js +14 -0
  191. package/dist/wje-toolbar.js.map +1 -1
  192. package/dist/wje-tooltip.js +31 -7
  193. package/dist/wje-tooltip.js.map +1 -1
  194. package/dist/wje-tree-item.js +41 -5
  195. package/dist/wje-tree-item.js.map +1 -1
  196. package/dist/wje-tree.js +12 -1
  197. package/dist/wje-tree.js.map +1 -1
  198. package/package.json +21 -2
  199. package/dist/form-associated-element-o0UjvdUp.js.map +0 -1
  200. package/dist/packages/wje-accordion/accordion.test.d.ts +0 -0
  201. package/dist/packages/wje-animation/animation.test.d.ts +0 -1
  202. package/dist/packages/wje-avatar/avatar.test.d.ts +0 -1
  203. package/dist/packages/wje-badge/badge.test.d.ts +0 -1
  204. package/dist/packages/wje-breadcrumbs/breadcrumbs.test.d.ts +0 -1
  205. package/dist/packages/wje-button/button.test.d.ts +0 -1
  206. package/dist/packages/wje-chip/chip.test.d.ts +0 -1
  207. package/dist/packages/wje-color-picker/color-picker.test.d.ts +0 -1
  208. package/dist/packages/wje-file-upload/file-upload.test.d.ts +0 -1
  209. package/dist/packages/wje-format-digital/format-digital.test.d.ts +0 -1
  210. package/dist/packages/wje-pagination/pagination.test.d.ts +0 -1
  211. package/dist/packages/wje-relative-time/relative-time.test.d.ts +0 -1
  212. package/dist/packages/wje-select/select.test.d.ts +0 -1
  213. package/dist/packages/wje-tab-group/tab-group.test.d.ts +0 -1
  214. package/dist/packages/wje-toast/toast.test.d.ts +0 -1
  215. package/dist/packages/wje-toggle/toggle.test.d.ts +0 -1
  216. package/dist/packages/wje-tree/tree.test.d.ts +0 -1
  217. package/dist/packages/wje-tree-item/tree-item.test.d.ts +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"wje-reorder.js","sources":["../packages/wje-reorder/reorder.element.js","../packages/wje-reorder/reorder.js"],"sourcesContent":["import { default as WJElement } from '../wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * `Reorder` is a custom web component that represents a reorder.\n * It extends from `WJElement`.\n * @summary This element represents a reorder.\n * @documentation https://elements.webjet.sk/components/reorder\n * @status stable\n * @augments WJElement\n * @csspart native - The native part of the reorder.\n * @slot - The default slot for the reorder.\n * // @fires wje-reorder:change - Event fired when the reorder is changed.\n * @tag wje-reorder\n */\n\nexport default class Reorder extends WJElement {\n /**\n * Creates an instance of Select.\n * @class\n */\n constructor() {\n super();\n this.dragEl = null;\n this.items = [];\n this.originalIndex = null;\n this.isDragging = false;\n this.offsetX = 0;\n this.offsetY = 0;\n this.cloneEl = null;\n }\n\n /**\n * The class name for the component.\n * @type {string}\n */\n className = 'Select';\n\n /**\n * Returns the CSS styles for the component.\n * @static\n * @returns {CSSStyleSheet}\n */\n static get cssStyleSheet() {\n return styles;\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 [];\n }\n\n /**\n * Sets up the attributes for the component.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n }\n\n /**\n * Draws the component after it is connected to the DOM.\n * @returns {DocumentFragment}\n */\n draw() {\n const fragment = document.createDocumentFragment();\n\n const container = document.createElement('div');\n container.classList.add('container');\n container.setAttribute('part', 'native');\n\n const slot = document.createElement('slot');\n slot.classList.add('reorder-items');\n\n container.appendChild(slot);\n\n fragment.appendChild(container);\n\n this.container = container;\n\n return fragment;\n }\n\n /**\n * Adds event listeners after the component is drawn.\n */\n afterDraw() {\n const items = this.querySelectorAll('wje-reorder-item');\n const dropZones = this.querySelectorAll('wje-reorder-dropzone');\n this.container.classList.add(this.hasAttribute('reverse') ? 'reversed' : 'basic');\n\n if (dropZones) {\n dropZones.forEach((dropZone) => {\n this.container.classList.remove('container');\n this.container.classList.add('container-w-dropzones');\n });\n }\n\n if (items) {\n items.forEach((item) => {\n const handles = item.querySelectorAll('[slot=handle]');\n const draggableElement = handles.length > 0 ? handles : [item];\n\n draggableElement.forEach((element) => {\n this.attachEventListeners(element);\n });\n });\n }\n }\n\n /**\n * Attaches event listeners to the element.\n * @param element\n */\n attachEventListeners(element) {\n element.addEventListener('mousedown', this.mouseDown.bind(this), false);\n element.addEventListener('touchstart', this.touchStart.bind(this), false);\n element.addEventListener('dragstart', this.dragStart.bind(this), false);\n }\n\n /**\n * Handles the mouse down event.\n * @param {object} e\n */\n mouseDown(e) {\n this.startDragging(e.clientX, e.clientY, e.currentTarget);\n document.addEventListener('mousemove', this.mouseMove.bind(this), false);\n document.addEventListener('mouseup', this.mouseUp.bind(this), false);\n document.body.style.userSelect = 'none';\n }\n\n /**\n * Handles the touch start event.\n * @param e\n */\n touchStart(e) {\n const touch = e.touches[0];\n this.startDragging(touch.clientX, touch.clientY, e.currentTarget);\n document.addEventListener('touchmove', this.touchMove.bind(this), false);\n document.addEventListener('touchend', this.touchEnd.bind(this), false);\n document.body.style.userSelect = 'none';\n }\n\n /**\n * Initializes the dragging process for a reorderable item.\n * @param {number} clientX The x-coordinate of the mouse pointer when the drag starts.\n * @param {number} clientY The y-coordinate of the mouse pointer when the drag starts.\n * @param {HTMLElement} target The target element where the drag event originated.\n */\n startDragging(clientX, clientY, target) {\n if (this.hasAttribute('disabled')) {\n return;\n }\n\n this.isDragging = true;\n this.dragEl = target.closest('wje-reorder-item');\n\n this.createClone();\n\n this.dragEl.style.opacity = '0.3';\n\n const rect = this.dragEl.getBoundingClientRect();\n this.offsetX = clientX - rect.left;\n this.offsetY = clientY - rect.top;\n\n this.dragEl.classList.add('dragging');\n\n this.originalIndex = [...this.dragEl.parentNode.children].indexOf(this.dragEl);\n this.originalParent = this.dragEl.parentNode;\n }\n\n /**\n * Handles the mouse move event.\n * @param e\n */\n mouseMove(e) {\n if (!this.isDragging) return;\n this.moveElement(e.pageX, e.pageY);\n\n if (this.cloneEl) {\n this.cloneEl.style.left = `${e.pageX - this.offsetX}px`;\n this.cloneEl.style.top = `${e.pageY - this.offsetY}px`;\n }\n }\n\n /**\n * Handles the `touchmove` event and updates the position of the dragged element.\n * @param {TouchEvent} e The touch event containing touch position data.\n */\n touchMove(e) {\n if (!this.isDragging) return;\n const touch = e.touches[0];\n this.moveElement(touch.pageX, touch.pageY);\n }\n\n /**\n * Updates the position of the dragged element and handles reordering logic based on the mouse position.\n * @param {number} pageX The x-coordinate of the mouse pointer relative to the viewport during the move event.\n * @param {number} pageY The y-coordinate of the mouse pointer relative to the viewport during the move event.\n */\n moveElement(pageX, pageY) {\n const scrollX = window.scrollX || document.documentElement.scrollLeft;\n const scrollY = window.scrollY || document.documentElement.scrollTop;\n const adjustedPageX = pageX - scrollX;\n const adjustedPageY = pageY - scrollY;\n\n this.dragEl.style.left = `${adjustedPageX}px`;\n this.dragEl.style.top = `${adjustedPageY}px`;\n\n if (this.cloneEl) {\n this.cloneEl.style.left = `${adjustedPageX}px`;\n this.cloneEl.style.top = `${adjustedPageY}px`;\n }\n\n const items = this.querySelectorAll('wje-reorder-item');\n items.forEach((item) => {\n if (item === this.dragEl) return;\n\n const boundingBox = item.getBoundingClientRect();\n const mouseY = adjustedPageY - boundingBox.top;\n const mouseYPercent = (mouseY / boundingBox.height) * 100;\n\n if (mouseYPercent > 30 && this.isMovingDown(item)) {\n item.parentNode.insertBefore(this.dragEl, item.nextSibling);\n } else if (mouseYPercent < 30 && !this.isMovingDown(item)) {\n item.parentNode.insertBefore(this.dragEl, item);\n }\n });\n }\n\n /**\n * Handles the mouse up event.\n */\n mouseUp() {\n this.stopDragging();\n document.removeEventListener('mousemove', this.mouseMove.bind(this), false);\n document.removeEventListener('mouseup', this.mouseUp.bind(this), false);\n\n if (this.cloneEl) {\n this.cloneEl.remove();\n this.cloneEl = null;\n }\n\n if (this.dragEl) {\n this.dragEl.style.opacity = '1';\n }\n }\n\n /**\n * Handles the touch end event.\n */\n touchEnd() {\n this.stopDragging();\n document.removeEventListener('touchmove', this.touchMove.bind(this), false);\n document.removeEventListener('touchend', this.touchEnd.bind(this), false);\n }\n\n /**\n * Stops dragging the element.\n */\n stopDragging() {\n if (!this.isDragging) return;\n\n this.isDragging = false;\n this.dragEl.classList.remove('dragging');\n this.dragEl.style.left = '';\n this.dragEl.style.top = '';\n\n const parent = this.dragEl.parentNode;\n const newIndex = Array.from(parent.children).indexOf(this.dragEl);\n\n const newOrderElements = Array.from(parent.children).map((el) => {\n const clonedNode = el.cloneNode(true);\n const handle = clonedNode.querySelector('.handle');\n if (handle) {\n handle.remove();\n }\n return clonedNode;\n });\n\n const newOrder = newOrderElements.map(el => el.innerText.trim());\n\n this.dispatchChange(this.originalIndex, newIndex, newOrder, newOrderElements);\n\n document.body.style.userSelect = '';\n }\n\n /**\n * Prevents the default behavior of the `dragstart` event.\n * @param {DragEvent} e The drag event triggered when a drag operation starts.\n */\n dragStart(e) {\n e.preventDefault();\n }\n\n /**\n * Creates a clone of the element.\n */\n createClone() {\n this.cloneEl = this.dragEl.cloneNode(true);\n this.cloneEl.style.position = 'absolute';\n this.cloneEl.style.pointerEvents = 'none';\n this.cloneEl.style.visibility = 'visible';\n\n document.body.appendChild(this.cloneEl);\n }\n\n /**\n * Checks if the dragged element is moving down.\n * @param droppedElement\n * @returns {boolean}\n */\n isMovingDown(droppedElement) {\n const parent = droppedElement.parentNode;\n const dragIndex = Array.from(parent.children).indexOf(this.dragEl);\n const dropIndex = Array.from(parent.children).indexOf(droppedElement);\n\n return dragIndex < dropIndex;\n }\n\n /**\n * Dispatches a custom event to signal that a reordering operation has occurred.\n * @param {number} from The original index of the dragged item.\n * @param {number} to The new index of the dragged item after reordering.\n * @param {Array<number>} order The updated order of items after the reordering.\n * // @fires wje-reorder:change - Dispatched when the reordering is completed.\n * The event includes details about the initial position, the new position, and the new order.\n */\n dispatchChange(from, to, order, orderElements) {\n this.dispatchEvent(\n new CustomEvent('wje-reorder:change', {\n detail: { from, to, order, orderElements },\n })\n );\n }\n}\n","import Reorder from './reorder.element.js';\n\nexport default Reorder;\n\nReorder.define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}
1
+ {"version":3,"file":"wje-reorder.js","sources":["../packages/wje-reorder/reorder.element.js","../packages/wje-reorder/reorder.js"],"sourcesContent":["import { default as WJElement } from '../wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * `Reorder` is a custom web component that represents a reorder.\n * It extends from `WJElement`.\n * @summary This element represents a reorder.\n * @documentation https://elements.webjet.sk/components/reorder\n * @status stable\n * @augments WJElement\n * @csspart native - The native part of the reorder.\n * @slot - The default slot for the reorder.\n * // @fires wje-reorder:change - Event fired when the reorder is changed.\n * @tag wje-reorder\n */\n\nexport default class Reorder extends WJElement {\n /**\n * Creates an instance of Select.\n * @class\n */\n constructor() {\n super();\n this.dragEl = null;\n this.items = [];\n this.originalIndex = null;\n this.isDragging = false;\n this.offsetX = 0;\n this.offsetY = 0;\n this.cloneEl = null;\n }\n\n /**\n * The class name for the component.\n * @type {string}\n */\n className = 'Select';\n\n /**\n * Returns the CSS styles for the component.\n * @static\n * @returns {CSSStyleSheet}\n */\n static get cssStyleSheet() {\n return styles;\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 [];\n }\n\n /**\n * Sets up the attributes for the component.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n this.syncAria();\n }\n\n /**\n * Draws the component after it is connected to the DOM.\n * @returns {DocumentFragment}\n */\n draw() {\n const fragment = document.createDocumentFragment();\n\n const container = document.createElement('div');\n container.classList.add('container');\n container.setAttribute('part', 'native');\n\n const slot = document.createElement('slot');\n slot.classList.add('reorder-items');\n\n container.appendChild(slot);\n\n fragment.appendChild(container);\n\n this.container = container;\n\n return fragment;\n }\n\n /**\n * Adds event listeners after the component is drawn.\n */\n afterDraw() {\n this.syncAria();\n const items = this.querySelectorAll('wje-reorder-item');\n const dropZones = this.querySelectorAll('wje-reorder-dropzone');\n this.container.classList.add(this.hasAttribute('reverse') ? 'reversed' : 'basic');\n\n if (dropZones) {\n dropZones.forEach((dropZone) => {\n this.container.classList.remove('container');\n this.container.classList.add('container-w-dropzones');\n });\n }\n\n if (items) {\n items.forEach((item) => {\n const handles = item.querySelectorAll('[slot=handle]');\n const draggableElement = handles.length > 0 ? handles : [item];\n\n draggableElement.forEach((element) => {\n this.attachEventListeners(element);\n });\n });\n }\n }\n\n /**\n * Sync ARIA attributes on host.\n */\n syncAria() {\n if (!this.hasAttribute('role')) {\n this.setAriaState({ role: 'list' });\n }\n }\n\n /**\n * Attaches event listeners to the element.\n * @param element\n */\n attachEventListeners(element) {\n element.addEventListener('mousedown', this.mouseDown.bind(this), false);\n element.addEventListener('touchstart', this.touchStart.bind(this), false);\n element.addEventListener('dragstart', this.dragStart.bind(this), false);\n }\n\n /**\n * Handles the mouse down event.\n * @param {object} e\n */\n mouseDown(e) {\n this.startDragging(e.clientX, e.clientY, e.currentTarget);\n document.addEventListener('mousemove', this.mouseMove.bind(this), false);\n document.addEventListener('mouseup', this.mouseUp.bind(this), false);\n document.body.style.userSelect = 'none';\n }\n\n /**\n * Handles the touch start event.\n * @param e\n */\n touchStart(e) {\n const touch = e.touches[0];\n this.startDragging(touch.clientX, touch.clientY, e.currentTarget);\n document.addEventListener('touchmove', this.touchMove.bind(this), false);\n document.addEventListener('touchend', this.touchEnd.bind(this), false);\n document.body.style.userSelect = 'none';\n }\n\n /**\n * Initializes the dragging process for a reorderable item.\n * @param {number} clientX The x-coordinate of the mouse pointer when the drag starts.\n * @param {number} clientY The y-coordinate of the mouse pointer when the drag starts.\n * @param {HTMLElement} target The target element where the drag event originated.\n */\n startDragging(clientX, clientY, target) {\n if (this.hasAttribute('disabled')) {\n return;\n }\n\n this.isDragging = true;\n this.dragEl = target.closest('wje-reorder-item');\n\n this.createClone();\n\n this.dragEl.style.opacity = '0.3';\n\n const rect = this.dragEl.getBoundingClientRect();\n this.offsetX = clientX - rect.left;\n this.offsetY = clientY - rect.top;\n\n this.dragEl.classList.add('dragging');\n\n this.originalIndex = [...this.dragEl.parentNode.children].indexOf(this.dragEl);\n this.originalParent = this.dragEl.parentNode;\n }\n\n /**\n * Handles the mouse move event.\n * @param e\n */\n mouseMove(e) {\n if (!this.isDragging) return;\n this.moveElement(e.pageX, e.pageY);\n\n if (this.cloneEl) {\n this.cloneEl.style.left = `${e.pageX - this.offsetX}px`;\n this.cloneEl.style.top = `${e.pageY - this.offsetY}px`;\n }\n }\n\n /**\n * Handles the `touchmove` event and updates the position of the dragged element.\n * @param {TouchEvent} e The touch event containing touch position data.\n */\n touchMove(e) {\n if (!this.isDragging) return;\n const touch = e.touches[0];\n this.moveElement(touch.pageX, touch.pageY);\n }\n\n /**\n * Updates the position of the dragged element and handles reordering logic based on the mouse position.\n * @param {number} pageX The x-coordinate of the mouse pointer relative to the viewport during the move event.\n * @param {number} pageY The y-coordinate of the mouse pointer relative to the viewport during the move event.\n */\n moveElement(pageX, pageY) {\n const scrollX = window.scrollX || document.documentElement.scrollLeft;\n const scrollY = window.scrollY || document.documentElement.scrollTop;\n const adjustedPageX = pageX - scrollX;\n const adjustedPageY = pageY - scrollY;\n\n this.dragEl.style.left = `${adjustedPageX}px`;\n this.dragEl.style.top = `${adjustedPageY}px`;\n\n if (this.cloneEl) {\n this.cloneEl.style.left = `${adjustedPageX}px`;\n this.cloneEl.style.top = `${adjustedPageY}px`;\n }\n\n const items = this.querySelectorAll('wje-reorder-item');\n items.forEach((item) => {\n if (item === this.dragEl) return;\n\n const boundingBox = item.getBoundingClientRect();\n const mouseY = adjustedPageY - boundingBox.top;\n const mouseYPercent = (mouseY / boundingBox.height) * 100;\n\n if (mouseYPercent > 30 && this.isMovingDown(item)) {\n item.parentNode.insertBefore(this.dragEl, item.nextSibling);\n } else if (mouseYPercent < 30 && !this.isMovingDown(item)) {\n item.parentNode.insertBefore(this.dragEl, item);\n }\n });\n }\n\n /**\n * Handles the mouse up event.\n */\n mouseUp() {\n this.stopDragging();\n document.removeEventListener('mousemove', this.mouseMove.bind(this), false);\n document.removeEventListener('mouseup', this.mouseUp.bind(this), false);\n\n if (this.cloneEl) {\n this.cloneEl.remove();\n this.cloneEl = null;\n }\n\n if (this.dragEl) {\n this.dragEl.style.opacity = '1';\n }\n }\n\n /**\n * Handles the touch end event.\n */\n touchEnd() {\n this.stopDragging();\n document.removeEventListener('touchmove', this.touchMove.bind(this), false);\n document.removeEventListener('touchend', this.touchEnd.bind(this), false);\n }\n\n /**\n * Stops dragging the element.\n */\n stopDragging() {\n if (!this.isDragging) return;\n\n this.isDragging = false;\n this.dragEl.classList.remove('dragging');\n this.dragEl.style.left = '';\n this.dragEl.style.top = '';\n\n const parent = this.dragEl.parentNode;\n const newIndex = Array.from(parent.children).indexOf(this.dragEl);\n\n const newOrderElements = Array.from(parent.children).map((el) => {\n const clonedNode = el.cloneNode(true);\n const handle = clonedNode.querySelector('.handle');\n if (handle) {\n handle.remove();\n }\n return clonedNode;\n });\n\n const newOrder = newOrderElements.map(el => el.innerText.trim());\n\n this.dispatchChange(this.originalIndex, newIndex, newOrder, newOrderElements);\n\n document.body.style.userSelect = '';\n }\n\n /**\n * Prevents the default behavior of the `dragstart` event.\n * @param {DragEvent} e The drag event triggered when a drag operation starts.\n */\n dragStart(e) {\n e.preventDefault();\n }\n\n /**\n * Creates a clone of the element.\n */\n createClone() {\n this.cloneEl = this.dragEl.cloneNode(true);\n this.cloneEl.style.position = 'absolute';\n this.cloneEl.style.pointerEvents = 'none';\n this.cloneEl.style.visibility = 'visible';\n\n document.body.appendChild(this.cloneEl);\n }\n\n /**\n * Checks if the dragged element is moving down.\n * @param droppedElement\n * @returns {boolean}\n */\n isMovingDown(droppedElement) {\n const parent = droppedElement.parentNode;\n const dragIndex = Array.from(parent.children).indexOf(this.dragEl);\n const dropIndex = Array.from(parent.children).indexOf(droppedElement);\n\n return dragIndex < dropIndex;\n }\n\n /**\n * Dispatches a custom event to signal that a reordering operation has occurred.\n * @param {number} from The original index of the dragged item.\n * @param {number} to The new index of the dragged item after reordering.\n * @param {Array<number>} order The updated order of items after the reordering.\n * // @fires wje-reorder:change - Dispatched when the reordering is completed.\n * The event includes details about the initial position, the new position, and the new order.\n */\n dispatchChange(from, to, order, orderElements) {\n this.dispatchEvent(\n new CustomEvent('wje-reorder:change', {\n detail: { from, to, order, orderElements },\n })\n );\n }\n}\n","import Reorder from './reorder.element.js';\n\nexport default Reorder;\n\nReorder.define('wje-reorder', Reorder);\n"],"names":[],"mappings":";;;;;AAgBe,MAAM,gBAAgB,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,EAK3C,cAAc;AACV,UAAO;AAcX;AAAA;AAAA;AAAA;AAAA,qCAAY;AAbR,SAAK,SAAS;AACd,SAAK,QAAQ,CAAE;AACf,SAAK,gBAAgB;AACrB,SAAK,aAAa;AAClB,SAAK,UAAU;AACf,SAAK,UAAU;AACf,SAAK,UAAU;AAAA,EACvB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaI,WAAW,gBAAgB;AACvB,WAAO;AAAA,EACf;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOI,WAAW,qBAAqB;AAC5B,WAAO,CAAE;AAAA,EACjB;AAAA;AAAA;AAAA;AAAA,EAKI,kBAAkB;AACd,SAAK,eAAe;AACpB,SAAK,SAAU;AAAA,EACvB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,OAAO;AACH,UAAM,WAAW,SAAS,uBAAwB;AAElD,UAAM,YAAY,SAAS,cAAc,KAAK;AAC9C,cAAU,UAAU,IAAI,WAAW;AACnC,cAAU,aAAa,QAAQ,QAAQ;AAEvC,UAAM,OAAO,SAAS,cAAc,MAAM;AAC1C,SAAK,UAAU,IAAI,eAAe;AAElC,cAAU,YAAY,IAAI;AAE1B,aAAS,YAAY,SAAS;AAE9B,SAAK,YAAY;AAEjB,WAAO;AAAA,EACf;AAAA;AAAA;AAAA;AAAA,EAKI,YAAY;AACR,SAAK,SAAU;AACf,UAAM,QAAQ,KAAK,iBAAiB,kBAAkB;AACtD,UAAM,YAAY,KAAK,iBAAiB,sBAAsB;AAC9D,SAAK,UA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KAAK,MAAM;AACjE,UAAM,YAAY,MAAM,KAAK,OAAO,QAAQ,EAAE,QAAQ,cAAc;AAEpE,WAAO,YAAY;AAAA,EAC3B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUI,eAAe,MAAM,IAAI,OAAO,eAAe;AAC3C,SAAK;AAAA,MACD,IAAI,YAAY,sBAAsB;AAAA,QAClC,QAAQ,EAAE,MAAM,IAAI,OAAO,cAAe;AAAA,MAC7C,CAAA;AAAA,IACJ;AAAA,EACT;AACA;ACzVA,QAAQ,OAAO,eAAe,OAAO;"}
@@ -10,20 +10,20 @@ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot
10
10
  var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
11
11
  var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
12
12
  var _addedOptions, _htmlOptions, _Select_instances, htmlSelectedItem_fn, getSelectedOptions_fn, _applySearchFilter, _onMenuItemClickCapture, syncOptionCheckbox_fn;
13
- import { F as FormAssociatedElement } from "./form-associated-element-o0UjvdUp.js";
13
+ import { F as FormAssociatedElement } from "./form-associated-element-DEQ4y-jn.js";
14
14
  import { event } from "./event.js";
15
15
  import Button from "./wje-button.js";
16
16
  import "./wje-popup.js";
17
- import { I as Icon } from "./icon-DY5AZ6xM.js";
17
+ import { I as Icon } from "./icon-DVyMc4Wv.js";
18
18
  import Label from "./wje-label.js";
19
19
  import Chip from "./wje-chip.js";
20
20
  import Input from "./wje-input.js";
21
21
  import Option from "./wje-option.js";
22
22
  import Options from "./wje-options.js";
23
23
  import Checkbox from "./wje-checkbox.js";
24
- import { P as Popup } from "./popup.element-DeajFyOQ.js";
24
+ import { P as Popup } from "./popup.element-Cl6QeG8M.js";
25
25
  const styles = "/*\n[ WJ Select ]\n*/\n\n:host {\n margin-bottom: var(--wje-select-margin-bottom);\n width: 100%;\n display: block;\n [slot='arrow'] {\n transform: rotate(0deg);\n transition: all 0.2s ease-in;\n }\n label {\n margin: var(--wje-select-label-margin);\n padding: var(--wje-select-label-padding);\n display: var(--wje-select-label-display);\n opacity: 1;\n cursor: text;\n transition: opacity 0.2s ease;\n line-height: var(--wje-select-label-line-height);\n font-size: var(--wje-select-label-font-size);\n }\n}\n\n.native-select {\n position: relative;\n &.default {\n .wrapper {\n display: block;\n background-color: var(--wje-select-background);\n border-width: var(--wje-select-border-width);\n border-style: var(--wje-select-border-style);\n border-color: var(--wje-select-border-color);\n border-radius: var(--wje-select-border-radius);\n padding-inline: 0.5rem;\n padding-top: 0.125rem;\n padding-bottom: 0.125rem;\n }\n .input-wrapper {\n padding: 0;\n min-height: 28px;\n margin-top: -4px;\n }\n &.focused {\n wje-label {\n opacity: 0.67;\n font-size: 12px;\n letter-spacing: normal;\n }\n }\n label {\n &.fade {\n opacity: 0.5;\n font-size: 12px;\n letter-spacing: normal;\n }\n }\n }\n &.standard {\n .wrapper {\n height: var(--wje-select-height);\n box-sizing: border-box;\n background-color: var(--wje-select-background);\n border-width: var(--wje-select-border-width);\n border-style: var(--wje-select-border-style);\n border-color: var(--wje-select-border-color);\n border-radius: var(--wje-select-border-radius);\n }\n .input-wrapper {\n background: transparent;\n width: 100%;\n }\n slot[name='error'] {\n position: static;\n\n background: transparent;\n padding: 0.25rem 0;\n left: auto;\n transform: none;\n color: var(--wje-input-color-invalid);\n font-size: 12px;\n line-height: normal;\n }\n }\n}\n\n.wrapper {\n display: flex;\n width: 100%;\n}\n\n.input-wrapper {\n display: grid;\n grid-template-columns: auto 1fr auto auto auto;\n align-items: center;\n background-color: var(--wje-select-background);\n /*min-height: 28px;*/\n color: var(--wje-select-color);\n line-height: var(--wje-select-line-height);\n appearance: none;\n padding: 2px 0.5rem;\n font-size: 14px !important;\n font-weight: normal;\n vertical-align: middle;\n input[readonly] {\n pointer-events: none;\n caret-color: transparent;\n }\n}\n\ninput {\n color: var(--wje-select-color);\n line-height: var(--wje-select-line-height);\n font-size: 14px !important;\n font-weight: 400;\n letter-spacing: 0.01em;\n border: medium;\n height: 25px;\n min-height: 25px;\n padding: 0;\n background: none;\n box-shadow: none;\n width: 100%;\n outline: 0;\n font-size: 14px !important;\n}\n\n::placeholder {\n opacity: 1;\n}\n\n:host [active] {\n .wrapper {\n border-radius: var(--wje-select-border-radius);\n }\n [slot='arrow'] {\n transform: rotate(180deg);\n transition: all 0.2s ease-in;\n }\n}\n\n.options-wrapper {\n border-width: var(--wje-select-options-border-width);\n border-style: var(--wje-select-options-border-style);\n border-color: var(--wje-select-options-border-color);\n border-radius: var(--wje-select-options-border-radius);\n margin-top: calc(0px - var(--wje-select-border-width));\n background-color: var(--wje-select-options-background-color);\n overflow: hidden;\n}\n\n.find {\n margin-block: var(--wje-select-find-margin-block);\n margin-inline: var(--wje-select-find-margin-inline);\n width: var(--wje-select-find-width);\n}\n\n.list {\n overflow: auto;\n height: 100%;\n}\n\n.options-wrapper:has(.find) .list {\n height: calc(100% - 32px - 2 * var(--wje-select-find-margin-block));\n}\n\n:host([multiple]) input {\n position: absolute;\n z-index: -1;\n top: 0;\n left: 0;\n width: 0;\n height: 0;\n opacity: 0;\n}\n\n:host([multiple]) .chips {\n display: flex;\n flex: 1;\n align-items: center;\n flex-wrap: wrap;\n gap: var(--wje-spacing-3x-small);\n}\n\n:host([disabled]) .input-wrapper {\n opacity: 0.5;\n pointer-events: none;\n cursor: not-allowed;\n}\n\n.counter {\n padding-inline: 0.5rem;\n}\n\nwje-chip {\n --wje-chip-margin: 0 0.25rem 0 0;\n}\n\nwje-button {\n --wje-padding-top: 0.25rem;\n --wje-padding-start: 0.25rem;\n --wje-padding-end: 0.25rem;\n --wje-padding-bottom: 0.25rem;\n --wje-button-margin-inline: 0 0.25rem;\n}\n\n.slot-start,\n.slot-end {\n &:not(:empty) {\n margin-right: 0.5rem;\n }\n}\n\nslot[name='error'] {\n display: none;\n}\n\n:host([invalid]) slot[name='error'] {\n display: block;\n}\n\nslot[name='error'] {\n display: none;\n position: absolute;\n max-width: 100%;\n min-width: auto;\n border-radius: 50px;\n background: black;\n padding: 0.25rem 0.5rem;\n top: 0;\n left: 50%;\n transform: translate(-50%, -50%);\n color: white;\n font-size: var(--wje-font-size-small);\n width: max-content;\n line-height: normal;\n}\n\n.input-hidden{\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n padding: 0;\n margin: 0;\n opacity: 0;\n z-index: -1;\n}\n\n:host([required]) .wrapper::after {\n color: var(--wje-input-color-invalid);\n content: var(--wje-input-required-symbol);\n font-size: 24px;\n position: absolute;\n right: 12px;\n top: 0;\n}\n\n:host([required]) .standard .input-wrapper::after {\n right: 13px;\n top: -20px;\n}";
26
- class Select extends FormAssociatedElement {
26
+ const _Select = class _Select extends FormAssociatedElement {
27
27
  constructor() {
28
28
  super();
29
29
  __privateAdd(this, _Select_instances);
@@ -109,6 +109,7 @@ class Select extends FormAssociatedElement {
109
109
  const isSelected = option.hasAttribute("selected");
110
110
  option.selected = !isSelected;
111
111
  this.selectedOptions = __privateMethod(this, _Select_instances, getSelectedOptions_fn).call(this);
112
+ this.syncAria();
112
113
  });
113
114
  /**
114
115
  * Handles the removal of a chip element from the DOM and updates the related state.
@@ -173,6 +174,7 @@ class Select extends FormAssociatedElement {
173
174
  this.list = null;
174
175
  this._value = [];
175
176
  this._selectedOptions = [];
177
+ this._instanceId = ++_Select._instanceId;
176
178
  }
177
179
  /**
178
180
  * Sets the value for the form field. Converts the input value into a FormData object
@@ -453,6 +455,7 @@ class Select extends FormAssociatedElement {
453
455
  */
454
456
  setupAttributes() {
455
457
  this.isShadowRoot = "open";
458
+ this.syncAria();
456
459
  }
457
460
  beforeDraw() {
458
461
  if (this.hasAttribute("value")) {
@@ -522,6 +525,10 @@ class Select extends FormAssociatedElement {
522
525
  optionsWrapper.style.setProperty("height", this.maxHeight);
523
526
  let list = document.createElement("div");
524
527
  list.classList.add("list");
528
+ this._ariaListId = this.id ? `${this.id}-listbox` : `wje-select-${this._instanceId}-listbox`;
529
+ list.id = this._ariaListId;
530
+ list.setAttribute("role", "listbox");
531
+ if (this.hasAttribute("multiple")) list.setAttribute("aria-multiselectable", "true");
525
532
  let slot = document.createElement("slot");
526
533
  let clear = document.createElement("wje-button");
527
534
  clear.setAttribute("fill", "link");
@@ -596,6 +603,7 @@ class Select extends FormAssociatedElement {
596
603
  this.clear = clear;
597
604
  this.list = list;
598
605
  this.slotFooter = slotFooter;
606
+ this.syncAria();
599
607
  return fragment;
600
608
  }
601
609
  /**
@@ -611,6 +619,7 @@ class Select extends FormAssociatedElement {
611
619
  if (this.hasAttribute("invalid")) {
612
620
  this.showInvalidMessage();
613
621
  }
622
+ this.syncAria();
614
623
  (_a = this.getAllOptions()) == null ? void 0 : _a.forEach((option) => {
615
624
  this.optionCheckSlot(option);
616
625
  });
@@ -662,6 +671,8 @@ class Select extends FormAssociatedElement {
662
671
  this.propagateValidation();
663
672
  });
664
673
  this.addEventListener("wje-option:change", this.optionChange);
674
+ event.addListener(this.popup, "wje-popup:show", null, () => this.syncAria());
675
+ event.addListener(this.popup, "wje-popup:hide", null, () => this.syncAria());
665
676
  this.addEventListener("invalid", (e) => {
666
677
  this.invalid = true;
667
678
  this.pristine = false;
@@ -752,6 +763,7 @@ class Select extends FormAssociatedElement {
752
763
  }
753
764
  }
754
765
  }
766
+ this.syncAria();
755
767
  }
756
768
  /**
757
769
  * Handles the logic for updating selections based on the current selected options,
@@ -966,7 +978,23 @@ class Select extends FormAssociatedElement {
966
978
  disconnectedCallback() {
967
979
  document.removeEventListener("mousedown", __privateGet(this, _onMenuItemClickCapture), true);
968
980
  }
969
- }
981
+ /**
982
+ * Syncs ARIA attributes on the host element.
983
+ */
984
+ syncAria() {
985
+ var _a;
986
+ const expanded = ((_a = this.popup) == null ? void 0 : _a.hasAttribute("active")) || this.classList.contains("active");
987
+ this.setAriaState({
988
+ role: "combobox",
989
+ haspopup: "listbox",
990
+ expanded,
991
+ controls: this._ariaListId,
992
+ disabled: this.disabled,
993
+ required: this.required,
994
+ invalid: this.invalid || this.hasAttribute("invalid")
995
+ });
996
+ }
997
+ };
970
998
  _addedOptions = new WeakMap();
971
999
  _htmlOptions = new WeakMap();
972
1000
  _Select_instances = new WeakSet();
@@ -1002,6 +1030,8 @@ syncOptionCheckbox_fn = function(option) {
1002
1030
  checkbox.removeAttribute("checked");
1003
1031
  }
1004
1032
  };
1033
+ __publicField(_Select, "_instanceId", 0);
1034
+ let Select = _Select;
1005
1035
  Select.define("wje-select", Select);
1006
1036
  export {
1007
1037
  Select as default
@@ -1 +1 @@
1
- {"version":3,"file":"wje-select.js","sources":["../packages/wje-select/select.element.js","../packages/wje-select/select.js"],"sourcesContent":["import { FormAssociatedElement } from '../internals/form-associated-element.js';\nimport { event } from '../utils/event.js';\nimport Button from '../wje-button/button.js';\nimport Popup from '../wje-popup/popup.js';\nimport Icon from '../wje-icon/icon.js';\nimport Label from '../wje-label/label.js';\nimport Chip from '../wje-chip/chip.js';\nimport Input from '../wje-input/input.js';\nimport Option from '../wje-option/option.js';\nimport Options from '../wje-options/options.js';\nimport Checkbox from '../wje-checkbox/checkbox.js';\nimport styles from './styles/styles.css?inline';\n\nexport class Select extends FormAssociatedElement {\n\t#addedOptions = [];\n\t#htmlOptions = [];\n\n\tconstructor() {\n\t\tsuper();\n\t\t/**\n\t\t * @type {HTMLElement|null}\n\t\t * @description A reference to the counter element, initially null.\n\t\t * @private\n\t\t */\n\t\tthis.counterEl = null;\n\n\t\t/**\n\t\t * @type {boolean}\n\t\t * @description Tracks whether the select element was previously opened, initially false.\n\t\t * @private\n\t\t * @default {boolean} false\n\t\t */\n\t\tthis._wasOppened = false;\n\n\t\t/**\n\t\t * @type {HTMLElement|null}\n\t\t * @description A reference to the native select element, initially null.\n\t\t */\n\t\tthis.native = null;\n\n\t\t/**\n\t\t * @type {HTMLElement|null}\n\t\t * @description A reference to the popup element, initially null.\n\t\t */\n\t\tthis.popup = null;\n\n\t\t/**\n\t\t * @type {HTMLElement|null}\n\t\t * @description A reference to the label element, initially null.\n\t\t */\n\t\tthis.labelElement = null;\n\n\t\t/**\n\t\t * @type {HTMLElement|null}\n\t\t * @description A reference to the slot start element, initially null.\n\t\t */\n\t\tthis.slotStart = null;\n\n\t\t/**\n\t\t * @type {HTMLElement|null}\n\t\t * @description A reference to the slot end element, initially null.\n\t\t */\n\t\tthis.slotEnd = null;\n\n\t\t/**\n\t\t * @type {HTMLElement|null}\n\t\t * @description A reference to the input element, initially null.\n\t\t */\n\t\tthis.input = null;\n\n\t\t/**\n\t\t * @type {HTMLElement|null}\n\t\t * @description A reference to the chips element, initially null.\n\t\t */\n\t\tthis.chips = null;\n\n\t\t/**\n\t\t * @type {HTMLElement|null}\n\t\t * @description A reference to the clear button element, initially null.\n\t\t */\n\t\tthis.clear = null;\n\n\t\t/**\n\t\t * @type {HTMLElement|null}\n\t\t * @description A reference to the list element, initially null.\n\t\t */\n\t\tthis.list = null;\n\n\t\tthis._value = [];\n\t\tthis._selectedOptions = [];\n\t}\n\n\t/**\n\t * An object representing component dependencies with their respective classes.\n\t * Each property in the object maps a custom component name (as a string key)\n\t * to its corresponding class or constructor.\n\t * @typedef {{[key: string]: Function}} Dependencies\n\t * @property {Function} 'wje-button' Represents the Button component class.\n\t * @property {Function} 'wje-popup' Represents the Popup component class.\n\t * @property {Function} 'wje-icon' Represents the Icon component class.\n\t * @property {Function} 'wje-label' Represents the Label component class.\n\t * @property {Function} 'wje-chip' Represents the Chip component class.\n\t * @property {Function} 'wje-input' Represents the Input component class.\n\t * @property {Function} 'wje-option' Represents the Option component class.\n\t * @property {Function} 'wje-checkbox' Represents the Checkbox component class.\n\t */\n\tdependencies = {\n\t\t'wje-button': Button,\n\t\t'wje-popup': Popup,\n\t\t'wje-icon': Icon,\n\t\t'wje-label': Label,\n\t\t'wje-chip': Chip,\n\t\t'wje-input': Input,\n\t\t'wje-option': Option,\n\t\t'wje-options': Options,\n\t\t'wje-checkbox': Checkbox,\n\t};\n\n\t/**\n\t * Sets the value for the form field. Converts the input value into a FormData object\n\t * if it is not already an array, splitting by spaces if necessary, and sets the\n\t * internal form value as well as the selected values.\n\t * @param {string|Array} value The value to be set. Can be a string (which will be\n\t * split into an array by spaces) or an array of values.\n\t */\n\tset value(value) {\n\t\tconst originalValue = value;\n\t\tconst formData = new FormData();\n\n\t\tif (value) {\n\t\t\tlet data = value;\n\t\t\tlet dataString = value;\n\n\t\t\tif (!Array.isArray(data)) {\n\t\t\t\tdata = data.split(' ');\n\t\t\t} else {\n\t\t\t\tdataString = data.join(' ');\n\t\t\t}\n\n\t\t\tdata.forEach(v => {\n\t\t\t\tformData.append(this.name, v)\n\t\t\t});\n\n\t\t\tvalue = formData;\n\n\t\t\tthis._value = data;\n\n\t\t\tthis.setAttribute('value', dataString);\n\t\t} else {\n\t\t\tformData.delete(this.name);\n\t\t\tvalue = formData;\n\t\t\tthis._value = [];\n\t\t\tthis.removeAttribute('value');\n\t\t}\n\t\tthis.internals.setFormValue(value);\n\t}\n\n\t/**\n\t * Retrieves the current value.\n\t * @returns {any} The value of the `_value` property.\n\t */\n\tget value() {\n\t\treturn this._value;\n\t}\n\n\t/**\n\t * Sets the maximum number of options allowed.\n\t * @param { number | object} value The value to set as the maximum number of options.\n\t * If null, the 'max-options' attribute will be removed.\n\t */\n\tset maxOptions(value) {\n\t\tif (value) {\n\t\t\tthis.setAttribute('max-options', value);\n\t\t} else {\n\t\t\tthis.removeAttribute('max-options');\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves the maximum number of options allowed.\n\t * Parses the value of the 'max-options' attribute from the element and converts it to a number.\n\t * If the attribute is not present or cannot be converted to a valid number, defaults to 1.\n\t * @returns {number} The maximum number of options, or 0 if the attribute is not set or invalid.\n\t */\n\tget maxOptions() {\n\t\treturn +this.getAttribute('max-options') || 1;\n\t}\n\n\t/**\n\t * @summary Setter for the defaultValue attribute.\n\t * This method sets the 'value' attribute of the custom input element to the provided value.\n\t * The 'value' attribute represents the default value of the input element.\n\t * @param {string} value The value to set as the default value.\n\t */\n\tset defaultValue(value) {\n\t\tthis.setAttribute('value', value);\n\t}\n\n\t/**\n\t * @summary Getter for the defaultValue attribute.\n\t * This method retrieves the 'value' attribute of the custom input element.\n\t * The 'value' attribute represents the default value of the input element.\n\t * If the 'value' attribute is not set, it returns an empty string.\n\t * @returns {string} The default value of the input element.\n\t */\n\tget defaultValue() {\n\t\treturn this.getAttribute('value') ?? '';\n\t}\n\n\t/**\n\t * Sets the trigger value.\n\t * @param {string} value The trigger value to set.\n\t */\n\tset trigger(value) {\n\t\tthis.setAttribute('trigger', value);\n\t}\n\n\t/**\n\t * Returns the trigger value.\n\t * @returns {string} The trigger value.\n\t */\n\tget trigger() {\n\t\treturn this.getAttribute('trigger') || 'click';\n\t}\n\n\t/**\n\t * Sets or removes the disabled state for the associated elements.\n\t * @param {boolean} value A boolean indicating whether the elements should be disabled.\n\t * If true, the disabled attribute is added to the elements. If false, the disabled attribute is removed.\n\t */\n\tset disabled(value) {\n\t\tif (value) {\n\t\t\tthis.setAttribute('disabled', '');\n\n\t\t\tthis.input?.setAttribute('disabled', '');\n\t\t\tthis.displayInput?.setAttribute('disabled', '');\n\n\t\t\tthis.popup?.setAttribute('disabled', '');\n\t\t} else {\n\t\t\tthis.removeAttribute('disabled');\n\n\t\t\tthis.input?.removeAttribute('disabled');\n\t\t\tthis.displayInput?.removeAttribute('disabled');\n\n\t\t\tthis.popup?.removeAttribute('disabled');\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves the current state of the 'disabled' attribute.\n\t * @returns {boolean} Returns true if the 'disabled' attribute is present, otherwise false.\n\t */\n\tget disabled() {\n\t\treturn this.hasAttribute('disabled');\n\t}\n\n\t/**\n\t * Sets the readonly state of the element. When set to true,\n\t * the element and its associated inputs are marked as readonly or disabled.\n\t * When set to false, the readonly and disabled attributes are removed,\n\t * allowing user interaction.\n\t * @param {boolean} value A boolean value indicating whether to set the\n\t * element and its associated inputs to readonly (true) or not (false).\n\t */\n\tset readonly(value) {\n\t\tif (value) {\n\t\t\tthis.setAttribute('readonly', '');\n\n\t\t\t// inputs nemusia existovať ešte pred draw()\n\t\t\tthis.input?.setAttribute('readonly', '');\n\t\t\tthis.displayInput?.setAttribute('readonly', '');\n\n\t\t\t// popup môže existovať, ak to toggle-uješ po renderi\n\t\t\tthis.popup?.setAttribute('disabled', '');\n\t\t} else {\n\t\t\tthis.removeAttribute('readonly');\n\n\t\t\tthis.input?.removeAttribute('readonly');\n\t\t\tthis.displayInput?.removeAttribute('readonly');\n\n\t\t\tthis.popup?.removeAttribute('disabled');\n\t\t}\n\t}\n\n\t/**\n\t * Checks if the 'readonly' attribute is present on the element.\n\t * @returns {boolean} Returns true if the 'readonly' attribute is set, otherwise false.\n\t */\n\tget readonly() {\n\t\treturn this.hasAttribute('readonly');\n\t}\n\n\t/**\n\t * Sets the maximum height value for the element.\n\t * If a value is provided, it sets the 'max-height' attribute on the element.\n\t * If no value is provided, it removes the 'max-height' attribute from the element.\n\t * @param {string|null} value The maximum height to be set. If null or undefined, the attribute is removed.\n\t */\n\tset maxHeight(value) {\n\t\tif (value) {\n\t\t\tthis.setAttribute('max-height', value);\n\t\t} else {\n\t\t\tthis.removeAttribute('max-height');\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves the maximum height value, which is determined by the 'max-height' attribute.\n\t * If the attribute is not set, a default value of '200px' is returned.\n\t * @returns {string} The maximum height value as a string.\n\t */\n\tget maxHeight() {\n\t\treturn this.getAttribute('max-height') || 'auto';\n\t}\n\n\t/**\n\t * Sets the offset attribute for the element.\n\t * @param {string} value The value to assign to the offset attribute.\n\t */\n\tset offset(value) {\n\t\tthis.setAttribute('offset', value);\n\t}\n\n\t/**\n\t * Gets the value of the offset attribute of the current element.\n\t * If the offset attribute is not present, returns a default value of '0'.\n\t * @returns {string} The value of the offset attribute or the default value '0'.\n\t */\n\tget offset() {\n\t\treturn this.getAttribute('offset') || '5';\n\t}\n\n\t/**\n\t * Sets the selected options for the object.\n\t * @param {Array|object} value The new value for the selected options. It can be an array or object containing the selected options.\n\t */\n\tset selectedOptions(value) {\n\t\tthis._selectedOptions = value;\n\t}\n\n\t/**\n\t * Retrieves the selected options.\n\t * @returns {Array} An array containing the currently selected options. If no options are selected, an empty array is returned.\n\t */\n\tget selectedOptions() {\n\t\treturn this._selectedOptions || [];\n\t}\n\n\t/**\n\t * Sets the `lazy` attribute on the element. If the provided value is truthy, the `lazy` attribute is added. If the value is falsy, the `lazy` attribute is removed.\n\t * @param {boolean} value A boolean value indicating whether to add or remove the `lazy` attribute. If `true`, the attribute is added; if `false`, it is removed.\n\t */\n\tset lazy(value) {\n\t\tif (value) {\n\t\t\tthis.setAttribute('lazy', '');\n\t\t} else {\n\t\t\tthis.removeAttribute('lazy');\n\t\t}\n\t}\n\n\t/**\n\t * Getter for the 'lazy' property.\n\t * @returns {boolean} Returns true if the 'lazy' attribute is present on the element, otherwise false.\n\t */\n\tget lazy() {\n\t\treturn this.hasAttribute('lazy');\n\t}\n\n\t/**\n\t * Sets or removes the 'no-size' attribute on an element.\n\t * @param {boolean} value A boolean indicating whether to add or remove the 'no-size' attribute. If true, the attribute is added; if false, the attribute is removed.\n\t */\n\tset noSize(value) {\n\t\tif (value) {\n\t\t\tthis.setAttribute('no-size', '');\n\t\t} else {\n\t\t\tthis.removeAttribute('no-size');\n\t\t}\n\t}\n\n\t/**\n\t * Gets the value of the 'no-size' attribute for the element.\n\t * @returns {boolean} True if the 'no-size' attribute is present, otherwise false.\n\t */\n\tget noSize() {\n\t\treturn this.hasAttribute('no-size');\n\t}\n\n\t/**\n\t * Getter for the customErrorDisplay attribute.\n\t * @returns {boolean} Whether the attribute is present.\n\t */\n\tget customErrorDisplay() {\n\t\treturn this.hasAttribute('custom-error-display');\n\t}\n\n\t/**\n\t * Retrieves the complete list of options available for the component.\n\t * The options are determined by combining elements from various sources, including loaded options, added options, and HTML-sourced options.\n\t * If a `wje-options` element is present within the component, its loaded options are included in the merged list.\n\t * In the absence of a `wje-options` element, duplicates among the added and HTML options are removed, retaining their order.\n\t * @returns {Array<object>} An array containing all the available options, combining the loaded, added, and HTML-based options, with duplicates removed where applicable.\n\t */\n\tget options() {\n\t\tif (this.querySelector('wje-options')) {\n\t\t\tconst allOptions = [...this.querySelector('wje-options').loadedOptions, ...this.#addedOptions, ...this.#htmlOptions]\n\n\t\t\treturn allOptions\n\t\t} else {\n\t\t\tconst allOptions = [...this.#addedOptions, ...this.#htmlOptions]\n\n\t\t\treturn Array.from(\n\t\t\t\tnew Map(allOptions.reverse().map(obj => [obj.value, obj])).values()\n\t\t\t).reverse();\n\t\t}\n\t}\n\n\tclassName = 'Select';\n\n\t/**\n\t * Returns the CSS styles for the component.\n\t * @static\n\t * @returns {CSSStyleSheet}\n\t */\n\tstatic get cssStyleSheet() {\n\t\treturn styles;\n\t}\n\n\t/**\n\t * Returns the list of attributes to observe for changes.\n\t * @static\n\t * @returns {Array<string>}\n\t */\n\tstatic get observedAttributes() {\n\t\treturn ['active', 'disabled', 'readonly'];\n\t}\n\n\t/**\n\t * Sets up the attributes for the component.\n\t */\n\tsetupAttributes() {\n\t\tthis.isShadowRoot = 'open';\n\t}\n\n\tbeforeDraw() {\n\t\tif (this.hasAttribute('value')) {\n\t\t\t// If a value attribute is explicitly provided, respect it.\n\t\t\tthis.value = this.getAttribute('value');\n\t\t} else {\n\t\t\t// No explicit value – derive initial value from currently selected options.\n\t\t\tconst selectedOptions = this.#getSelectedOptions();\n\n\t\t\tif (selectedOptions.length > 0) {\n\t\t\t\tconst values = selectedOptions.map((opt) => opt.value);\n\t\t\t\tthis.value = this.hasAttribute('multiple') ? values : values[0];\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Draws the component for the select.\n\t * @returns {DocumentFragment}\n\t */\n\tdraw() {\n\t\tlet fragment = document.createDocumentFragment();\n\n\t\tthis.classList.add('wje-placement', this.placement ? 'wje-' + this.placement : 'wje-start');\n\n\t\t// zakladny obalovac\n\t\tlet native = document.createElement('div');\n\t\tnative.setAttribute('part', 'native');\n\t\tnative.classList.add('native-select', this.variant || 'default');\n\n\t\t// wrapper pre label a inputWrapper\n\t\tlet wrapper = document.createElement('div');\n\t\twrapper.classList.add('wrapper');\n\t\twrapper.setAttribute('slot', 'anchor');\n\n\t\t// label\n\t\tlet label = document.createElement('label');\n\t\tlabel.setAttribute('part', 'label');\n\t\tlabel.innerText = this.label || '';\n\n\t\t// obalovac pre input\n\t\tlet inputWrapper = document.createElement('div');\n\t\tinputWrapper.setAttribute('part', 'input-wrapper');\n\t\tinputWrapper.classList.add('input-wrapper');\n\n\t\tlet slotStart = document.createElement('div');\n\t\tslotStart.classList.add('slot-start');\n\n\t\tlet input = document.createElement('input');\n\t\tinput.setAttribute('type', 'text');\n\t\tinput.value = this.value.join(' ').trim();\n\t\tinput.classList.add('input-hidden');\n\n\t\tlet display = document.createElement('input');\n\t\tdisplay.setAttribute('type', 'text');\n\t\tdisplay.setAttribute('part', 'input');\n\t\tdisplay.setAttribute('autocomplete', 'off');\n\t\tdisplay.setAttribute('readonly', '');\n\t\tdisplay.setAttribute('placeholder', this.placeholder || '');\n\n\t\tif (this.required) {\n\t\t\tinput.setAttribute('required', '');\n\t\t\tdisplay.setAttribute('required', '');\n\t\t}\n\n\t\t// Apply initial disabled/readonly state during first render\n\t\tif (this.disabled) {\n\t\t\tinput.setAttribute('disabled', '');\n\t\t\tdisplay.setAttribute('disabled', '');\n\t\t}\n\n\t\tif (this.readonly) {\n\t\t\tinput.setAttribute('readonly', '');\n\t\t\tdisplay.setAttribute('readonly', '');\n\t\t}\n\n\t\tlet slotEnd = document.createElement('div');\n\t\tslotEnd.classList.add('slot-end');\n\n\t\tlet arrow = document.createElement('wje-icon');\n\t\tarrow.setAttribute('name', 'chevron-down');\n\t\tarrow.setAttribute('slot', 'arrow');\n\n\t\tlet chips = document.createElement('div');\n\t\tchips.classList.add('chips');\n\t\tchips.innerText = this.placeholder || '';\n\n\t\t// obalovac pre option a find\n\t\tlet optionsWrapper = document.createElement('div');\n\t\toptionsWrapper.setAttribute('part', 'options-wrapper');\n\t\toptionsWrapper.classList.add('options-wrapper');\n\t\toptionsWrapper.style.setProperty('height', this.maxHeight);\n\n\t\tlet list = document.createElement('div');\n\t\tlist.classList.add('list');\n\n\t\tlet slot = document.createElement('slot');\n\n\t\tlet clear = document.createElement('wje-button');\n\t\tclear.setAttribute('fill', 'link');\n\t\tclear.setAttribute('part', 'clear');\n\t\tclear.setAttribute('stop-propagation', '');\n\n\t\tlet clearIcon = document.createElement('wje-icon');\n\t\tclearIcon.setAttribute('name', 'x');\n\n\t\tlet error = document.createElement('div');\n\t\terror.setAttribute('slot', 'error');\n\n\t\tlet errorSlot = document.createElement('slot');\n\t\terrorSlot.setAttribute('name', 'error');\n\n\t\t// vytvorime popup\n\t\tlet popup = document.createElement('wje-popup');\n\t\tpopup.setAttribute('placement', 'bottom-start');\n\t\tif (!this.noSize)\n\t\t\tpopup.setAttribute('size', '');\n\t\tpopup.setAttribute('part', 'popup');\n\t\tpopup.setAttribute('offset', this.offset);\n\n\t\tif ((this.lazy || this.querySelector('wje-options')) && !this._wasOppened) {\n\t\t\tpopup.setAttribute('loader', '');\n\t\t} else {\n\t\t\tpopup.removeAttribute('loader');\n\t\t}\n\n\t\tif (this.disabled) {\n\t\t\tpopup.setAttribute('disabled', '');\n\t\t} else {\n\t\t\tpopup.removeAttribute('disabled');\n\t\t}\n\n\t\tif (this.variant === 'standard') {\n\t\t\tif (this.hasAttribute('label')) native.appendChild(label);\n\t\t} else {\n\t\t\twrapper.appendChild(label);\n\t\t}\n\n\t\tinputWrapper.append(slotStart);\n\t\tinputWrapper.append(display);\n\t\tinputWrapper.append(input);\n\n\t\tclear.append(clearIcon);\n\n\t\tif (this.hasAttribute('multiple')) inputWrapper.append(chips);\n\n\t\tif (this.hasAttribute('clearable')) inputWrapper.append(clear);\n\n\t\tinputWrapper.appendChild(slotEnd);\n\t\tinputWrapper.appendChild(arrow);\n\n\t\tlist.appendChild(slot);\n\n\t\tif (this.hasAttribute('find')) {\n\t\t\tlet find = document.createElement('wje-input');\n\t\t\tfind.setAttribute('variant', 'standard');\n\t\t\tfind.setAttribute('placeholder', 'Hľadať');\n\t\t\tfind.setAttribute('part', 'find');\n\t\t\tfind.clearable = true;\n\t\t\tfind.classList.add('find');\n\n\t\t\toptionsWrapper.appendChild(find);\n\n\t\t\tthis.findEl = find;\n\t\t}\n\n\t\tlet slotFooter = document.createElement('slot');\n\t\tslotFooter.setAttribute('name', 'footer');\n\n\t\t// APPEND\n\t\toptionsWrapper.append(list);\n\t\toptionsWrapper.append(slotFooter);\n\n\t\twrapper.append(inputWrapper);\n\n\t\tpopup.append(wrapper);\n\t\tpopup.append(optionsWrapper);\n\n\t\tif (this.trigger === 'click') popup.setAttribute('manual', '');\n\n\t\tthis.append(error);\n\n\t\tnative.append(popup);\n\t\tnative.append(errorSlot);\n\n\t\tfragment.appendChild(native);\n\n\t\tthis.native = native;\n\t\tthis.popup = popup;\n\t\tthis.labelElement = label;\n\t\tthis.slotStart = slotStart;\n\t\tthis.slotEnd = slotEnd;\n\t\tthis.input = input;\n\t\tthis.displayInput = display;\n\t\tthis.chips = chips;\n\t\tthis.clear = clear;\n\t\tthis.list = list;\n\t\tthis.slotFooter = slotFooter;\n\n\t\treturn fragment;\n\t}\n\n\t/**\n\t * Executes post-render logic for the custom element.\n\t * This includes validation, event listener registration, managing custom attributes, and\n\t * handling options initialization for the component.\n\t * @returns {void} This method does not return any value.\n\t */\n\tafterDraw() {\n\t\tdocument.addEventListener('mousedown', this.#onMenuItemClickCapture, true);\n\n\t\tthis.validate();\n\n\t\tif (this.hasAttribute('invalid')) {\n\t\t\tthis.showInvalidMessage();\n\t\t}\n\n\t\tthis.getAllOptions()?.forEach((option) => {\n\t\t\tthis.optionCheckSlot(option);\n\t\t});\n\n\t\tthis.selectedOptions = this.#getSelectedOptions();\n\t\tthis.selectOptions(this.value, true);\n\n\t\tif (this.lazy) {\n\t\t\tevent.addListener(this.popup, 'wje-popup:show', null, (e) => {\n\t\t\t\tif (this._wasOppened) return;\n\t\t\t\tthis._wasOppened = true;\n\n\t\t\t\tconst optionsElement = this.querySelector('wje-options');\n\t\t\t\toptionsElement.setAttribute('lazy', '');\n\t\t\t\toptionsElement.setAttribute('attached', '');\n\t\t\t});\n\t\t}\n\n\t\tevent.addListener(this.popup, 'wje-popup:aftershow', null, () => {\n\t\t\tconst assignedElements = this.slotFooter.assignedElements();\n\n\t\t\tif (assignedElements.length > 0) {\n\t\t\t\tconst el = assignedElements[0];\n\t\t\t\tconst rect = el.getBoundingClientRect();\n\t\t\t\tlet totalHeight = 0;\n\n\t\t\t\tif(this.hasAttribute('find')) {\n\t\t\t\t\tlet style = getComputedStyle(this.findEl);\n\n\t\t\t\t\tlet height = this.findEl.offsetHeight;\n\t\t\t\t\tlet marginTop = parseFloat(style.marginTop);\n\t\t\t\t\tlet marginBottom = parseFloat(style.marginBottom);\n\n\t\t\t\t\ttotalHeight = height + marginTop + marginBottom;\n\t\t\t\t}\n\n\t\t\t\tlet subtractHeight = rect.height + totalHeight;\n\n\t\t\t\tthis.list.style.height = `calc(100% - ${subtractHeight}px)`;\n\t\t\t}\n\t\t});\n\n\t\tthis.#htmlOptions = Array.from(this.querySelectorAll(':scope > wje-option')).map((option) => {\n\t\t\treturn {\n\t\t\t\tvalue: option.value,\n\t\t\t\ttext: option.textContent.trim(),\n\t\t\t};\n\t\t})\n\n\t\tthis.input.addEventListener('focus', (e) => {\n\t\t\tthis.labelElement?.classList.add('fade');\n\t\t\tthis.native.classList.add('focused');\n\t\t});\n\n\t\tthis.input.addEventListener('blur', (e) => {\n\t\t\tthis.native.classList.remove('focused');\n\t\t\tif (!e.target.value) this.labelElement?.classList.remove('fade');\n\t\t});\n\n\t\tthis.input.addEventListener('input', (e) => {\n\t\t\tthis.propagateValidation();\n\t\t});\n\n\t\tthis.addEventListener('wje-option:change', this.optionChange);\n\n\t\tthis.addEventListener('invalid', (e) => {\n\t\t\tthis.invalid = true;\n\t\t\tthis.pristine = false;\n\n\t\t\tthis.showInvalidMessage();\n\n\t\t\tif (this.customErrorDisplay) {\n\t\t\t\te.preventDefault();\n\t\t\t}\n\t\t});\n\n\t\tthis.clear?.addEventListener('wje-button:click', (e) => {\n\t\t\tif (this.readonly || this.disabled) return;\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\tthis.clearSelections();\n\t\t});\n\n\t\tthis.list.addEventListener('wje-options:load', (e) => {\n\t\t\tthis.selectedOptions.forEach((option) => {\n\t\t\t\tthis.getAllOptions().forEach((el) => {\n\t\t\t\t\tif (el.value === option.value) {\n\t\t\t\t\t\tel.selected = true;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\n\t\t\t// Ensure values from the value attribute are (re)selected after lazy-loaded pages\n\t\t\tconst attrValue = this.getAttribute('value')?.split(' ') || [];\n\n\t\t\tattrValue.forEach(val => {\n\t\t\t\tconst existingOption = Array.from(this.getAllOptions()).find(el => el.value === val);\n\t\t\t\tif (existingOption) {\n\t\t\t\t\texistingOption.selected = true;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis.selectedOptions = this.#getSelectedOptions();\n\t\t\tthis.selections(true);\n\n\t\t\tthis.list.scrollTo(0, 0);\n\t\t\tevent.dispatchCustomEvent(this.popup, 'wje-popup:content-ready'); // Notify that the content is ready\n\t\t});\n\n\t\t// skontrolujeme ci ma select atribut find\n\t\tif (this.hasAttribute('find') && this.findEl instanceof HTMLElement) {\n\t\t\tevent.addListener(this.findEl, 'keyup', '', this.#applySearchFilter);\n\t\t\tevent.addListener(this.findEl, 'wje-input:clear', '', this.#applySearchFilter);\n\t\t}\n\t}\n\n\t/**\n\t * Handles the change event for an option element within a select-like component.\n\t * This method processes user interactions with options and updates the state of the component,\n\t * including selection management, validation, and UI updates. Behavior differs based on\n\t * whether the component supports multiple selections.\n\t * Key functionality:\n\t * - Prevents the default behavior, event propagation, and immediate propagation of the event.\n\t * - Retrieves all options within the component.\n\t * - If the component doesn't support multiple selection:\n\t * - Marks only the clicked option as selected and deselects others.\n\t * - Hides the option popup.\n\t * - If the component supports multiple selection:\n\t * - Processes the clicked option without deselecting others.\n\t * - Updates the selected options and triggers validation.\n\t * - Marks the form state as non-pristine.\n\t * - Propagates the validation state to other relevant parts of the component or system.\n\t * @param {Event} e The event object representing the option change interaction.\n\t */\n\toptionChange = (e) => {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t\te.stopImmediatePropagation();\n\n\t\tif (this.readonly || this.disabled) return;\n\n\t\tlet allOptions = this.getAllOptions();\n\n\t\tif (!this.hasAttribute('multiple')) {\n\t\t\tallOptions.forEach((option) => {\n\t\t\t\tif (option.value === e.target.value) {\n\t\t\t\t\tthis.processClickedOption(option);\n\t\t\t\t} else {\n\t\t\t\t\toption.selected = false;\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.popup.hide(false);\n\t\t} else {\n\t\t\tthis.processClickedOption(e.target, true);\n\t\t}\n\n\t\tthis.selections();\n\n\t\tthis.validate(this.selectedOptions);\n\n\t\tthis.pristine = false;\n\t\tthis.propagateValidation();\n\t}\n\n\t/**\n\t * Handles the logic for processing the selection state of a clicked option element.\n\t * @function processClickedOption\n\t * @param {Element} option The option element that is clicked.\n\t * @param {boolean} [multiple] A Boolean indicating whether multiple options can be selected. Defaults to false.\n\t * Changes the selected state of the passed option and updates the selected options list.\n\t * Checks if the option already has a \"selected\" attribute, toggles its state,\n\t * and updates the internal selected options.\n\t */\n\tprocessClickedOption = (option, multiple = false) => {\n\t\tconst isSelected = option.hasAttribute('selected');\n\t\toption.selected = !isSelected;\n\n\t\tthis.selectedOptions = this.#getSelectedOptions();\n\t}\n\n\t/**\n\t * Returns all the options as HTML.\n\t * @returns {NodeList} The options as HTML.\n\t */\n\tgetAllOptions() {\n\t\treturn this.querySelectorAll('wje-option');\n\t}\n\n\t/**\n\t * Handles changes in the selection for a component, updating internal values, input fields,\n\t * and visual presentation (like chips or slots) as per the given selection options.\n\t * @param {Array|null} options The collection of selected option elements. If null, no options are selected.\n\t * @param {number} length The total number of selected options.\n\t * @returns {void}\n\t */\n\tselectionChanged(options = null, length = 0) {\n\t\tif (this.hasAttribute('multiple')) {\n\t\t\tthis.value = options.map((el) => el.value).reverse();\n\t\t\tthis.input.value = this.value.map(a => a).join(\" \").trim();\n\n\t\t\tif (this.placeholder && length === 0) {\n\t\t\t\tthis.chips.innerHTML = this.placeholder;\n\t\t\t} else {\n\t\t\t\tif (options !== null) Array.from(options).slice(0, +this.maxOptions).forEach(option => this.chips.appendChild(this.getChip(option)));\n\t\t\t\tif (this.counterEl instanceof HTMLElement || !this.maxOptions || length > +this.maxOptions) {\n\t\t\t\t\tthis.counter();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.getAllOptions().forEach((o) => this.#syncOptionCheckbox(o));\n\t\t} else {\n\t\t\tconst option = options?.at(0);\n\n\t\t\tthis.value = options?.map((el) => el.value)?.at(0) || '';\n\t\t\tthis.input.value = this.value[0] || '';\n\t\t\tthis.displayInput.value = options[0]?.textContent?.trim() || '';\n\n\t\t\tthis.slotStart.innerHTML = '';\n\t\t\tthis.slotEnd.innerHTML = '';\n\n\t\t\tif (option && option instanceof HTMLElement) {\n\t\t\t\tlet optionSlotStart = option?.querySelector('wje-option > [slot=start]');\n\t\t\t\tif (optionSlotStart) {\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tthis.slotStart.append(optionSlotStart.cloneNode(true));\n\t\t\t\t\t},0)\n\t\t\t\t}\n\n\t\t\t\tlet optionSlotEnd = option?.querySelector('wje-option > [slot=end]');\n\n\t\t\t\tif (optionSlotEnd && optionSlotEnd instanceof HTMLElement && optionSlotEnd.tagName !== 'WJE-DROPDOWN' && optionSlotEnd.tagName !== 'WJE-BUTTON') {\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tthis.slotEnd.append(optionSlotEnd.cloneNode(true));\n\t\t\t\t\t},0)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Handles the logic for updating selections based on the current selected options,\n\t * updating chips content, and dispatching change events if necessary.\n\t * @param {boolean} [silence] If true, suppresses the dispatch of a custom change event.\n\t * @returns {void} This method does not return a value.\n\t */\n\tselections(silence = false) {\n\t\tif (this.selectedOptions.length >= +this.maxOptions) {\n\t\t\tthis.counterEl = null;\n\t\t}\n\n\t\tif (this.chips) {\n\t\t\tthis.chips.innerHTML = '';\n\t\t}\n\n\t\tif (this.selectedOptions.length > 0) {\n\t\t\tthis.selectionChanged(this.selectedOptions, this.selectedOptions.length);\n\t\t} else {\n\t\t\tthis.selectionChanged(this.selectedOptions);\n\t\t}\n\n\t\tif (silence) return;\n\t\tevent.dispatchCustomEvent(this, 'wje-select:change');\n\t}\n\n\t/**\n\t * Updates the counter element to reflect the current state of selected values relative to the maximum allowed options.\n\t * If the maximum options are selected, the counter element is removed. If it does not already exist and needs to be displayed, it is created.\n\t * @returns {void} Does not return a value.\n\t */\n\tcounter() {\n\t\t// zmazanie counter (span)\n\t\tif (this.counterEl && this.value.length === +this.maxOptions) {\n\t\t\tthis.counterEl.remove();\n\t\t\tthis.counterEl = null;\n\t\t\treturn;\n\t\t}\n\n\t\t// ak counter nie je, tak ho vytvorime\n\t\tif (!this.counterEl) {\n\t\t\tthis.counterEl = document.createElement('span');\n\t\t\tthis.counterEl.classList.add('counter');\n\n\t\t\tthis.chips.appendChild(this.counterEl);\n\t\t}\n\n\t\t// nastavime hodnotu counter\n\t\tthis.counterEl.innerText = `+${this.value.length - +this.maxOptions}`;\n\t}\n\n\t/**\n\t * Creates and returns a chip element with specified properties and a label.\n\t * @param {object} option The configuration object for the chip. Typically includes properties such as value and textContent to set up the chip's label and data.\n\t * @returns {HTMLElement} The newly created chip element with a label and default properties.\n\t */\n\tgetChip(option) {\n\t\tlet chip = document.createElement('wje-chip');\n\t\tchip.size = 'small';\n\t\tchip.removable = !this.readonly;\n\t\tchip.round = true;\n\t\tchip.addEventListener('wje:chip-remove', this.removeChip);\n\t\tchip.option = option;\n\n\t\tlet label = document.createElement('wje-label');\n\t\tlabel.innerText = this.#htmlSelectedItem(option.value) // option.textContent.trim();\n\n\t\tchip.appendChild(label);\n\n\t\treturn chip;\n\t}\n\n\t/**\n\t * Handles the removal of a chip element from the DOM and updates the related state.\n\t * @param {Event} e The event object triggered by the chip removal action.\n\t * The target of the event is expected to be the chip element itself.\n\t */\n\tremoveChip = (e) => {\n\t\te.target.parentNode.removeChild(e.target);\n\t\tthis.processClickedOption(e.target.option, true);\n\t\tthis.selections();\n\t};\n\n\t/**\n\t * Generates an HTML option element based on the provided item and mapping.\n\t * @param {object} item The item to generate the option for.\n\t * @param {object} [map] The mapping object that specifies the properties of the item to use for the option's value and text.\n\t * @param {string} [map.value] The property of the item to use for the option's value.\n\t * @param {string} [map.text] The property of the item to use for the option's text.\n\t * @returns {HTMLElement} The generated HTML option element.\n\t */\n\thtmlOption(item, map = { value: 'value', text: 'text' }) {\n\t\tlet option = document.createElement('wje-option');\n\n\t\tif (item[map.value] === null) {\n\t\t\tconsole.warn(`The item ${JSON.stringify(item)} does not have the property ${map.value}`);\n\t\t}\n\n\t\tif (item[map.text] === null) {\n\t\t\tconsole.warn(`The item ${JSON.stringify(item)} does not have the property ${map.text}`);\n\t\t}\n\n\t\toption.setAttribute('value', item[map.value] ?? '');\n\t\toption.innerText = item[map.text] ?? '';\n\n\t\tthis.#addedOptions.push({ [map.value]: item[map.value], [map.text]: item[map.text] });\n\t\treturn option;\n\t}\n\n\t/**\n\t * Returns the provided item.\n\t * @param {any} item The item to be returned.\n\t * @returns {any} The same item that was passed as input.\n\t */\n\thtmlSelectedItem(item) {\n\t\treturn item;\n\t}\n\n\t/**\n\t * Adds a new option to the component.\n\t * @param {object} optionData The data used to create the new option.\n\t * @param {boolean} [silent] Whether the addition should trigger events or not.\n\t * @param {object} [map] Mapping of keys to identify value and text in the optionData.\n\t * @param {string} [map.value] The key in optionData that represents the value of the option.\n\t * @param {string} [map.text] The key in optionData that represents the text of the option.\n\t * @returns {void}\n\t */\n\taddOption(optionData, silent = false, map = { value: 'value', text: 'text' }) {\n\t\tif (!optionData) return;\n\n\t\tconst optionsElement = this.querySelector('wje-options');\n\t\tif (optionsElement) {\n\t\t\toptionsElement.addOption(optionData, silent, map);\n\t\t\treturn;\n\t\t}\n\t\tlet option = this.htmlOption(optionData, map);\n\t\tthis.appendChild(option);\n\t}\n\n\t/**\n\t * Adds one or more options to a collection. If the input is an array, it adds each option within the array.\n\t * Otherwise, it adds a single option.\n\t * @param {Array | object} optionsData The data representing the options to be added. It can be a single object or an array of objects.\n\t * @param {boolean} [silent] Optional flag to determine if events or notifications should be suppressed while adding options.\n\t * @param {object} [map] An optional mapping object specifying how to map data properties to value and text for the options.\n\t * @param {string} [map.value] The property in the optionsData that represents the value of the option.\n\t * @param {string} [map.text] The property in the optionsData that represents the text of the option.\n\t * @returns {void}\n\t */\n\taddOptions(optionsData, silent = false, map = { value: 'value', text: 'text' }) {\n\t\tif (!Array.isArray(optionsData)) {\n\t\t\tthis.addOption(optionsData, silent, map);\n\t\t} else {\n\t\t\toptionsData.forEach((item) => {\n\t\t\t\tthis.addOption(item, silent, map);\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Selects an option from the available options within the component.\n\t * @param {string} value The value of the option to be selected.\n\t * @param {boolean} [silent] Determines whether the selection should trigger notification or updates. Defaults to false.\n\t * @returns {void} Does not return a value.\n\t */\n\tselectOption(value, silent = false) {\n\t\tif (!value) return;\n\n\t\tconst option = this.querySelector(`wje-option[value=\"${value}\"]`);\n\t\tif (!option) return;\n\n\t\tif (silent) {\n\t\t\tif (!option.hasAttribute('selected')) {\n\t\t\t\toption.selected = true;\n\t\t\t}\n\t\t\tthis.selectedOptions = this.#getSelectedOptions();\n\t\t} else {\n\t\t\tthis.processClickedOption(option, this.hasAttribute('multiple'));\n\t\t}\n\n\t\tif (this.drawingStatus > this.drawingStatuses.START) {\n\t\t\tthis.selections(silent);\n\t\t}\n\t}\n\n\t/**\n\t * Selects multiple options based on the provided values. If a single value is provided, it selects that option.\n\t * If an array of values is provided, it iterates through the array and selects each option.\n\t * @param {any|any[]} values A single value or an array of values to be selected.\n\t * @param {boolean} [silent] Determines whether the selection action should occur silently without triggering other side effects or events.\n\t * @returns {void} This method does not return a value.\n\t */\n\tselectOptions(values, silent = false) {\n\t\tif (!Array.isArray(values)) {\n\t\t\tthis.selectOption(values, silent);\n\t\t} else {\n\t\t\tvalues.forEach((value) => {\n\t\t\t\tthis.selectOption(value, silent);\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Clones and appends an icon with the \"check\" slot to the specified option element.\n\t * If the option already contains a custom element with slot=\"check\" (e.g. <wje-status slot=\"check\">),\n\t * it is left untouched and no template icon is added.\n\t * @param {HTMLElement} option The target HTML element to which the cloned \"check\" icon will be appended.\n\t * @returns {void} This method does not return a value, but it modifies the DOM by appending a cloned \"check\" icon to the provided option element.\n\t */\n\toptionCheckSlot(option) {\n\t\tlet existingCheckSlot = option.querySelector('[slot=\"check\"]');\n\n\t\tif (existingCheckSlot && existingCheckSlot.tagName !== 'WJE-CHECKBOX') {\n\t\t\treturn;\n\t\t}\n\n\t\tif (existingCheckSlot && existingCheckSlot.tagName === 'WJE-CHECKBOX') {\n\t\t\tconst isSelectedExisting = option.hasAttribute('selected');\n\n\t\t\t// zosúladenie stavu\n\t\t\texistingCheckSlot.checked = isSelectedExisting;\n\t\t\tif (isSelectedExisting) {\n\t\t\t\texistingCheckSlot.setAttribute('checked', '');\n\t\t\t} else {\n\t\t\t\texistingCheckSlot.removeAttribute('checked');\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tlet icon = this.querySelector('template')?.content.querySelector('[slot=\"check\"]');\n\t\tif (!icon) {\n\t\t\tconsole.warn('Icon with slot \"check\" was not found.');\n\t\t\treturn;\n\t\t}\n\n\t\tlet iconClone = icon.cloneNode(true);\n\n\t\toption.append(iconClone);\n\t}\n\n\t/**\n\t * Clears all selected options and resets selections.\n\t * The method ensures that all options are deselected, updates the internal state, validates the selections,\n\t * propagates the validation status, and indicates invalid state if necessary.\n\t * @returns {void} No value is returned by this method.\n\t */\n\tclearSelections() {\n\t\tthis.selectedOptions = [];\n\n\t\tthis.getAllOptions().forEach((option) => {\n\t\t\toption.selected = false;\n\t\t});\n\t\tthis.selections();\n\n\t\tthis.validate();\n\t\tthis.propagateValidation();\n\n\t\tif (this.hasAttribute('invalid')) {\n\t\t\tthis.showInvalidMessage();\n\t\t}\n\t}\n\n\t/**\n\t * Processes the given item and retrieves the corresponding value from the selected options.\n\t * @param {string} item The key to search for in the selected options.\n\t * @returns {string} The text content associated with the selected item, or an empty string if not found.\n\t */\n\t#htmlSelectedItem(item) {\n\t\tconst keyValue = \"value\"\n\t\tconst textValue = \"textContent\";\n\n\t\tconst value = this.selectedOptions.find((option) => option[keyValue] === item)?.[textValue] ?? \"\";\n\n\t\treturn this.htmlSelectedItem(value);\n\t}\n\n\t/**\n\t * Retrieves the list of selected options within the component.\n\t * @returns {Array<Element>} An array of elements representing the options that are currently selected.\n\t */\n\t#getSelectedOptions() {\n\t\treturn Array.from(this.querySelectorAll('wje-option[selected]'));\n\t}\n\n\t/**\n\t * Filters option elements based on the search input value.\n\t * This function applies a search filter to a list of options. If a `wj-options` element exists and has\n\t * the `lazy` attribute, the search value is passed to the `wj-options` element, enabling infinite scroll\n\t * functionality to handle the filtering. If the `lazy` attribute is not present, it performs a local\n\t * search to show or hide options depending on whether their text content matches the search input.\n\t * @param {Event} e The input event containing the search input value from the user.\n\t */\n\t#applySearchFilter = (e) => {\n\t\t// contains wj-options element with options\n\t\tconst optionsElement = this.querySelector('wje-options');\n\n\t\tif (optionsElement && optionsElement.hasAttribute('lazy')) {\n\t\t\t// pass search value to wj-options element and infinite scroll will handle the rest\n\t\t\toptionsElement.setAttribute('search', e.target.value);\n\t\t} else {\n\t\t\tlet value = e.target.value.trim().toLowerCase();\n\n\t\t\tthis.getAllOptions().forEach((option) => {\n\t\t\t\tif (option.textContent.trim().toLowerCase().includes(value)) {\n\t\t\t\t\toption.style.display = 'block';\n\t\t\t\t} else {\n\t\t\t\t\toption.style.display = 'none';\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tdisconnectedCallback() {\n\t\tdocument.removeEventListener('mousedown', this.#onMenuItemClickCapture, true);\n\t}\n\n\t/**\n\t * Prevent closing the parent <wje-select>'s popup when a nested <wje-dropdown>\n\t * menu item is clicked. Closes only the dropdown that owns the clicked item.\n\t * This captures the event at the document level (useCapture=true) so it can\n\t * stop the global outside-click logic that would otherwise hide the select's popup.\n\t */\n\t#onMenuItemClickCapture = (e) => {\n\t\tconst target = (e.target);\n\t\tif (!target || !target.closest) return;\n\n\t\tconst menuItem = target.closest('wje-menu-item');\n\t\tif (!menuItem) return;\n\n\t\tconst dropdown = target.closest('wje-dropdown');\n\t\tif (dropdown && typeof dropdown.hide === 'function') {\n\t\t\tdropdown.hide();\n\t\t}\n\n\t\te.stopPropagation();\n\t}\n\n\t#syncOptionCheckbox(option) {\n\t\tconst checkbox = option.querySelector('wje-checkbox[slot=\"check\"]');\n\t\tif (!checkbox) return;\n\n\t\tconst isSelected = option.hasAttribute('selected');\n\t\tcheckbox.checked = isSelected;\n\t\tif (isSelected) {\n\t\t\tcheckbox.setAttribute('checked', '');\n\t\t} else {\n\t\t\tcheckbox.removeAttribute('checked');\n\t\t}\n\t}\n}","import { Select } from \"./select.element.js\";\n\nexport default Select;\n\nSelect.define('wje-select', Select);\n"],"names":["_a"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAaO,MAAM,eAAe,sBAAsB;AAAA,EAIjD,cAAc;AACb,UAAO;AALF;AACN,sCAAgB,CAAE;AAClB,qCAAe,CAAE;AA2FjB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wCAAe;AAAA,MACd,cAAc;AAAA,MACd,aAAa;AAAA,MACb,YAAY;AAAA,MACZ,aAAa;AAAA,MACb,YAAY;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AAS,oBAAoB,aAAa,mBAAK,0BAAyB,IAAI;AAAA,EAC9E;AAmCA;AAltCC;AACA;AAFM;AAAA;AAAA;AAAA;AAAA;AAAA;AAioCN,sBAAiB,SAAC,MAAM;;AACvB,QAAM,WAAW;AACjB,QAAM,YAAY;AAElB,QAAM,UAAQ,UAAK,gBAAgB,KAAK,CAAC,WAAW,OAAO,QAAQ,MAAM,IAAI,MAA/D,mBAAmE,eAAc;AAE/F,SAAO,KAAK,iBAAiB,KAAK;AACpC;AAAA;AAAA;AAAA;AAAA;AAMC,wBAAmB,WAAG;AACrB,SAAO,MAAM,KAAK,KAAK,iBAAiB,sBAAsB,CAAC;AACjE;AAUC;AA8BA;AAeA,wBAAmB,SAAC,QAAQ;AAC3B,QAAM,WAAW,OAAO,cAAc,4BAA4B;AAClE,MAAI,CAAC,SAAU;AAEf,QAAM,aAAa,OAAO,aAAa,UAAU;AACjD,WAAS,UAAU;AACnB,MAAI,YAAY;AACf,aAAS,aAAa,WAAW,EAAE;AAAA,EACtC,OAAS;AACN,aAAS,gBAAgB,SAAS;AAAA,EACrC;AACA;AC3tCA,OAAO,OAAO,cAAc,MAAM;"}
1
+ {"version":3,"file":"wje-select.js","sources":["../packages/wje-select/select.element.js","../packages/wje-select/select.js"],"sourcesContent":["import { FormAssociatedElement } from '../internals/form-associated-element.js';\nimport { event } from '../utils/event.js';\nimport Button from '../wje-button/button.js';\nimport Popup from '../wje-popup/popup.js';\nimport Icon from '../wje-icon/icon.js';\nimport Label from '../wje-label/label.js';\nimport Chip from '../wje-chip/chip.js';\nimport Input from '../wje-input/input.js';\nimport Option from '../wje-option/option.js';\nimport Options from '../wje-options/options.js';\nimport Checkbox from '../wje-checkbox/checkbox.js';\nimport styles from './styles/styles.css?inline';\n\nexport class Select extends FormAssociatedElement {\n\tstatic _instanceId = 0;\n\t#addedOptions = [];\n\t#htmlOptions = [];\n\n\tconstructor() {\n\t\tsuper();\n\t\t/**\n\t\t * @type {HTMLElement|null}\n\t\t * @description A reference to the counter element, initially null.\n\t\t * @private\n\t\t */\n\t\tthis.counterEl = null;\n\n\t\t/**\n\t\t * @type {boolean}\n\t\t * @description Tracks whether the select element was previously opened, initially false.\n\t\t * @private\n\t\t * @default {boolean} false\n\t\t */\n\t\tthis._wasOppened = false;\n\n\t\t/**\n\t\t * @type {HTMLElement|null}\n\t\t * @description A reference to the native select element, initially null.\n\t\t */\n\t\tthis.native = null;\n\n\t\t/**\n\t\t * @type {HTMLElement|null}\n\t\t * @description A reference to the popup element, initially null.\n\t\t */\n\t\tthis.popup = null;\n\n\t\t/**\n\t\t * @type {HTMLElement|null}\n\t\t * @description A reference to the label element, initially null.\n\t\t */\n\t\tthis.labelElement = null;\n\n\t\t/**\n\t\t * @type {HTMLElement|null}\n\t\t * @description A reference to the slot start element, initially null.\n\t\t */\n\t\tthis.slotStart = null;\n\n\t\t/**\n\t\t * @type {HTMLElement|null}\n\t\t * @description A reference to the slot end element, initially null.\n\t\t */\n\t\tthis.slotEnd = null;\n\n\t\t/**\n\t\t * @type {HTMLElement|null}\n\t\t * @description A reference to the input element, initially null.\n\t\t */\n\t\tthis.input = null;\n\n\t\t/**\n\t\t * @type {HTMLElement|null}\n\t\t * @description A reference to the chips element, initially null.\n\t\t */\n\t\tthis.chips = null;\n\n\t\t/**\n\t\t * @type {HTMLElement|null}\n\t\t * @description A reference to the clear button element, initially null.\n\t\t */\n\t\tthis.clear = null;\n\n\t\t/**\n\t\t * @type {HTMLElement|null}\n\t\t * @description A reference to the list element, initially null.\n\t\t */\n\t\tthis.list = null;\n\n\t\tthis._value = [];\n\t\tthis._selectedOptions = [];\n\t\tthis._instanceId = ++Select._instanceId;\n\t}\n\n\t/**\n\t * An object representing component dependencies with their respective classes.\n\t * Each property in the object maps a custom component name (as a string key)\n\t * to its corresponding class or constructor.\n\t * @typedef {{[key: string]: Function}} Dependencies\n\t * @property {Function} 'wje-button' Represents the Button component class.\n\t * @property {Function} 'wje-popup' Represents the Popup component class.\n\t * @property {Function} 'wje-icon' Represents the Icon component class.\n\t * @property {Function} 'wje-label' Represents the Label component class.\n\t * @property {Function} 'wje-chip' Represents the Chip component class.\n\t * @property {Function} 'wje-input' Represents the Input component class.\n\t * @property {Function} 'wje-option' Represents the Option component class.\n\t * @property {Function} 'wje-checkbox' Represents the Checkbox component class.\n\t */\n\tdependencies = {\n\t\t'wje-button': Button,\n\t\t'wje-popup': Popup,\n\t\t'wje-icon': Icon,\n\t\t'wje-label': Label,\n\t\t'wje-chip': Chip,\n\t\t'wje-input': Input,\n\t\t'wje-option': Option,\n\t\t'wje-options': Options,\n\t\t'wje-checkbox': Checkbox,\n\t};\n\n\t/**\n\t * Sets the value for the form field. Converts the input value into a FormData object\n\t * if it is not already an array, splitting by spaces if necessary, and sets the\n\t * internal form value as well as the selected values.\n\t * @param {string|Array} value The value to be set. Can be a string (which will be\n\t * split into an array by spaces) or an array of values.\n\t */\n\tset value(value) {\n\t\tconst originalValue = value;\n\t\tconst formData = new FormData();\n\n\t\tif (value) {\n\t\t\tlet data = value;\n\t\t\tlet dataString = value;\n\n\t\t\tif (!Array.isArray(data)) {\n\t\t\t\tdata = data.split(' ');\n\t\t\t} else {\n\t\t\t\tdataString = data.join(' ');\n\t\t\t}\n\n\t\t\tdata.forEach(v => {\n\t\t\t\tformData.append(this.name, v)\n\t\t\t});\n\n\t\t\tvalue = formData;\n\n\t\t\tthis._value = data;\n\n\t\t\tthis.setAttribute('value', dataString);\n\t\t} else {\n\t\t\tformData.delete(this.name);\n\t\t\tvalue = formData;\n\t\t\tthis._value = [];\n\t\t\tthis.removeAttribute('value');\n\t\t}\n\t\tthis.internals.setFormValue(value);\n\t}\n\n\t/**\n\t * Retrieves the current value.\n\t * @returns {any} The value of the `_value` property.\n\t */\n\tget value() {\n\t\treturn this._value;\n\t}\n\n\t/**\n\t * Sets the maximum number of options allowed.\n\t * @param { number | object} value The value to set as the maximum number of options.\n\t * If null, the 'max-options' attribute will be removed.\n\t */\n\tset maxOptions(value) {\n\t\tif (value) {\n\t\t\tthis.setAttribute('max-options', value);\n\t\t} else {\n\t\t\tthis.removeAttribute('max-options');\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves the maximum number of options allowed.\n\t * Parses the value of the 'max-options' attribute from the element and converts it to a number.\n\t * If the attribute is not present or cannot be converted to a valid number, defaults to 1.\n\t * @returns {number} The maximum number of options, or 0 if the attribute is not set or invalid.\n\t */\n\tget maxOptions() {\n\t\treturn +this.getAttribute('max-options') || 1;\n\t}\n\n\t/**\n\t * @summary Setter for the defaultValue attribute.\n\t * This method sets the 'value' attribute of the custom input element to the provided value.\n\t * The 'value' attribute represents the default value of the input element.\n\t * @param {string} value The value to set as the default value.\n\t */\n\tset defaultValue(value) {\n\t\tthis.setAttribute('value', value);\n\t}\n\n\t/**\n\t * @summary Getter for the defaultValue attribute.\n\t * This method retrieves the 'value' attribute of the custom input element.\n\t * The 'value' attribute represents the default value of the input element.\n\t * If the 'value' attribute is not set, it returns an empty string.\n\t * @returns {string} The default value of the input element.\n\t */\n\tget defaultValue() {\n\t\treturn this.getAttribute('value') ?? '';\n\t}\n\n\t/**\n\t * Sets the trigger value.\n\t * @param {string} value The trigger value to set.\n\t */\n\tset trigger(value) {\n\t\tthis.setAttribute('trigger', value);\n\t}\n\n\t/**\n\t * Returns the trigger value.\n\t * @returns {string} The trigger value.\n\t */\n\tget trigger() {\n\t\treturn this.getAttribute('trigger') || 'click';\n\t}\n\n\t/**\n\t * Sets or removes the disabled state for the associated elements.\n\t * @param {boolean} value A boolean indicating whether the elements should be disabled.\n\t * If true, the disabled attribute is added to the elements. If false, the disabled attribute is removed.\n\t */\n\tset disabled(value) {\n\t\tif (value) {\n\t\t\tthis.setAttribute('disabled', '');\n\n\t\t\tthis.input?.setAttribute('disabled', '');\n\t\t\tthis.displayInput?.setAttribute('disabled', '');\n\n\t\t\tthis.popup?.setAttribute('disabled', '');\n\t\t} else {\n\t\t\tthis.removeAttribute('disabled');\n\n\t\t\tthis.input?.removeAttribute('disabled');\n\t\t\tthis.displayInput?.removeAttribute('disabled');\n\n\t\t\tthis.popup?.removeAttribute('disabled');\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves the current state of the 'disabled' attribute.\n\t * @returns {boolean} Returns true if the 'disabled' attribute is present, otherwise false.\n\t */\n\tget disabled() {\n\t\treturn this.hasAttribute('disabled');\n\t}\n\n\t/**\n\t * Sets the readonly state of the element. When set to true,\n\t * the element and its associated inputs are marked as readonly or disabled.\n\t * When set to false, the readonly and disabled attributes are removed,\n\t * allowing user interaction.\n\t * @param {boolean} value A boolean value indicating whether to set the\n\t * element and its associated inputs to readonly (true) or not (false).\n\t */\n\tset readonly(value) {\n\t\tif (value) {\n\t\t\tthis.setAttribute('readonly', '');\n\n\t\t\t// inputs nemusia existovať ešte pred draw()\n\t\t\tthis.input?.setAttribute('readonly', '');\n\t\t\tthis.displayInput?.setAttribute('readonly', '');\n\n\t\t\t// popup môže existovať, ak to toggle-uješ po renderi\n\t\t\tthis.popup?.setAttribute('disabled', '');\n\t\t} else {\n\t\t\tthis.removeAttribute('readonly');\n\n\t\t\tthis.input?.removeAttribute('readonly');\n\t\t\tthis.displayInput?.removeAttribute('readonly');\n\n\t\t\tthis.popup?.removeAttribute('disabled');\n\t\t}\n\t}\n\n\t/**\n\t * Checks if the 'readonly' attribute is present on the element.\n\t * @returns {boolean} Returns true if the 'readonly' attribute is set, otherwise false.\n\t */\n\tget readonly() {\n\t\treturn this.hasAttribute('readonly');\n\t}\n\n\t/**\n\t * Sets the maximum height value for the element.\n\t * If a value is provided, it sets the 'max-height' attribute on the element.\n\t * If no value is provided, it removes the 'max-height' attribute from the element.\n\t * @param {string|null} value The maximum height to be set. If null or undefined, the attribute is removed.\n\t */\n\tset maxHeight(value) {\n\t\tif (value) {\n\t\t\tthis.setAttribute('max-height', value);\n\t\t} else {\n\t\t\tthis.removeAttribute('max-height');\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves the maximum height value, which is determined by the 'max-height' attribute.\n\t * If the attribute is not set, a default value of '200px' is returned.\n\t * @returns {string} The maximum height value as a string.\n\t */\n\tget maxHeight() {\n\t\treturn this.getAttribute('max-height') || 'auto';\n\t}\n\n\t/**\n\t * Sets the offset attribute for the element.\n\t * @param {string} value The value to assign to the offset attribute.\n\t */\n\tset offset(value) {\n\t\tthis.setAttribute('offset', value);\n\t}\n\n\t/**\n\t * Gets the value of the offset attribute of the current element.\n\t * If the offset attribute is not present, returns a default value of '0'.\n\t * @returns {string} The value of the offset attribute or the default value '0'.\n\t */\n\tget offset() {\n\t\treturn this.getAttribute('offset') || '5';\n\t}\n\n\t/**\n\t * Sets the selected options for the object.\n\t * @param {Array|object} value The new value for the selected options. It can be an array or object containing the selected options.\n\t */\n\tset selectedOptions(value) {\n\t\tthis._selectedOptions = value;\n\t}\n\n\t/**\n\t * Retrieves the selected options.\n\t * @returns {Array} An array containing the currently selected options. If no options are selected, an empty array is returned.\n\t */\n\tget selectedOptions() {\n\t\treturn this._selectedOptions || [];\n\t}\n\n\t/**\n\t * Sets the `lazy` attribute on the element. If the provided value is truthy, the `lazy` attribute is added. If the value is falsy, the `lazy` attribute is removed.\n\t * @param {boolean} value A boolean value indicating whether to add or remove the `lazy` attribute. If `true`, the attribute is added; if `false`, it is removed.\n\t */\n\tset lazy(value) {\n\t\tif (value) {\n\t\t\tthis.setAttribute('lazy', '');\n\t\t} else {\n\t\t\tthis.removeAttribute('lazy');\n\t\t}\n\t}\n\n\t/**\n\t * Getter for the 'lazy' property.\n\t * @returns {boolean} Returns true if the 'lazy' attribute is present on the element, otherwise false.\n\t */\n\tget lazy() {\n\t\treturn this.hasAttribute('lazy');\n\t}\n\n\t/**\n\t * Sets or removes the 'no-size' attribute on an element.\n\t * @param {boolean} value A boolean indicating whether to add or remove the 'no-size' attribute. If true, the attribute is added; if false, the attribute is removed.\n\t */\n\tset noSize(value) {\n\t\tif (value) {\n\t\t\tthis.setAttribute('no-size', '');\n\t\t} else {\n\t\t\tthis.removeAttribute('no-size');\n\t\t}\n\t}\n\n\t/**\n\t * Gets the value of the 'no-size' attribute for the element.\n\t * @returns {boolean} True if the 'no-size' attribute is present, otherwise false.\n\t */\n\tget noSize() {\n\t\treturn this.hasAttribute('no-size');\n\t}\n\n\t/**\n\t * Getter for the customErrorDisplay attribute.\n\t * @returns {boolean} Whether the attribute is present.\n\t */\n\tget customErrorDisplay() {\n\t\treturn this.hasAttribute('custom-error-display');\n\t}\n\n\t/**\n\t * Retrieves the complete list of options available for the component.\n\t * The options are determined by combining elements from various sources, including loaded options, added options, and HTML-sourced options.\n\t * If a `wje-options` element is present within the component, its loaded options are included in the merged list.\n\t * In the absence of a `wje-options` element, duplicates among the added and HTML options are removed, retaining their order.\n\t * @returns {Array<object>} An array containing all the available options, combining the loaded, added, and HTML-based options, with duplicates removed where applicable.\n\t */\n\tget options() {\n\t\tif (this.querySelector('wje-options')) {\n\t\t\tconst allOptions = [...this.querySelector('wje-options').loadedOptions, ...this.#addedOptions, ...this.#htmlOptions]\n\n\t\t\treturn allOptions\n\t\t} else {\n\t\t\tconst allOptions = [...this.#addedOptions, ...this.#htmlOptions]\n\n\t\t\treturn Array.from(\n\t\t\t\tnew Map(allOptions.reverse().map(obj => [obj.value, obj])).values()\n\t\t\t).reverse();\n\t\t}\n\t}\n\n\tclassName = 'Select';\n\n\t/**\n\t * Returns the CSS styles for the component.\n\t * @static\n\t * @returns {CSSStyleSheet}\n\t */\n\tstatic get cssStyleSheet() {\n\t\treturn styles;\n\t}\n\n\t/**\n\t * Returns the list of attributes to observe for changes.\n\t * @static\n\t * @returns {Array<string>}\n\t */\n\tstatic get observedAttributes() {\n\t\treturn ['active', 'disabled', 'readonly'];\n\t}\n\n\t/**\n\t * Sets up the attributes for the component.\n\t */\n\tsetupAttributes() {\n\t\tthis.isShadowRoot = 'open';\n\t\tthis.syncAria();\n\t}\n\n\tbeforeDraw() {\n\t\tif (this.hasAttribute('value')) {\n\t\t\t// If a value attribute is explicitly provided, respect it.\n\t\t\tthis.value = this.getAttribute('value');\n\t\t} else {\n\t\t\t// No explicit value – derive initial value from currently selected options.\n\t\t\tconst selectedOptions = this.#getSelectedOptions();\n\n\t\t\tif (selectedOptions.length > 0) {\n\t\t\t\tconst values = selectedOptions.map((opt) => opt.value);\n\t\t\t\tthis.value = this.hasAttribute('multiple') ? values : values[0];\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Draws the component for the select.\n\t * @returns {DocumentFragment}\n\t */\n\tdraw() {\n\t\tlet fragment = document.createDocumentFragment();\n\n\t\tthis.classList.add('wje-placement', this.placement ? 'wje-' + this.placement : 'wje-start');\n\n\t\t// zakladny obalovac\n\t\tlet native = document.createElement('div');\n\t\tnative.setAttribute('part', 'native');\n\t\tnative.classList.add('native-select', this.variant || 'default');\n\n\t\t// wrapper pre label a inputWrapper\n\t\tlet wrapper = document.createElement('div');\n\t\twrapper.classList.add('wrapper');\n\t\twrapper.setAttribute('slot', 'anchor');\n\n\t\t// label\n\t\tlet label = document.createElement('label');\n\t\tlabel.setAttribute('part', 'label');\n\t\tlabel.innerText = this.label || '';\n\n\t\t// obalovac pre input\n\t\tlet inputWrapper = document.createElement('div');\n\t\tinputWrapper.setAttribute('part', 'input-wrapper');\n\t\tinputWrapper.classList.add('input-wrapper');\n\n\t\tlet slotStart = document.createElement('div');\n\t\tslotStart.classList.add('slot-start');\n\n\t\tlet input = document.createElement('input');\n\t\tinput.setAttribute('type', 'text');\n\t\tinput.value = this.value.join(' ').trim();\n\t\tinput.classList.add('input-hidden');\n\n\t\tlet display = document.createElement('input');\n\t\tdisplay.setAttribute('type', 'text');\n\t\tdisplay.setAttribute('part', 'input');\n\t\tdisplay.setAttribute('autocomplete', 'off');\n\t\tdisplay.setAttribute('readonly', '');\n\t\tdisplay.setAttribute('placeholder', this.placeholder || '');\n\n\t\tif (this.required) {\n\t\t\tinput.setAttribute('required', '');\n\t\t\tdisplay.setAttribute('required', '');\n\t\t}\n\n\t\t// Apply initial disabled/readonly state during first render\n\t\tif (this.disabled) {\n\t\t\tinput.setAttribute('disabled', '');\n\t\t\tdisplay.setAttribute('disabled', '');\n\t\t}\n\n\t\tif (this.readonly) {\n\t\t\tinput.setAttribute('readonly', '');\n\t\t\tdisplay.setAttribute('readonly', '');\n\t\t}\n\n\t\tlet slotEnd = document.createElement('div');\n\t\tslotEnd.classList.add('slot-end');\n\n\t\tlet arrow = document.createElement('wje-icon');\n\t\tarrow.setAttribute('name', 'chevron-down');\n\t\tarrow.setAttribute('slot', 'arrow');\n\n\t\tlet chips = document.createElement('div');\n\t\tchips.classList.add('chips');\n\t\tchips.innerText = this.placeholder || '';\n\n\t\t// obalovac pre option a find\n\t\tlet optionsWrapper = document.createElement('div');\n\t\toptionsWrapper.setAttribute('part', 'options-wrapper');\n\t\toptionsWrapper.classList.add('options-wrapper');\n\t\toptionsWrapper.style.setProperty('height', this.maxHeight);\n\n\t\tlet list = document.createElement('div');\n\t\tlist.classList.add('list');\n\t\tthis._ariaListId = this.id ? `${this.id}-listbox` : `wje-select-${this._instanceId}-listbox`;\n\t\tlist.id = this._ariaListId;\n\t\tlist.setAttribute('role', 'listbox');\n\t\tif (this.hasAttribute('multiple')) list.setAttribute('aria-multiselectable', 'true');\n\n\t\tlet slot = document.createElement('slot');\n\n\t\tlet clear = document.createElement('wje-button');\n\t\tclear.setAttribute('fill', 'link');\n\t\tclear.setAttribute('part', 'clear');\n\t\tclear.setAttribute('stop-propagation', '');\n\n\t\tlet clearIcon = document.createElement('wje-icon');\n\t\tclearIcon.setAttribute('name', 'x');\n\n\t\tlet error = document.createElement('div');\n\t\terror.setAttribute('slot', 'error');\n\n\t\tlet errorSlot = document.createElement('slot');\n\t\terrorSlot.setAttribute('name', 'error');\n\n\t\t// vytvorime popup\n\t\tlet popup = document.createElement('wje-popup');\n\t\tpopup.setAttribute('placement', 'bottom-start');\n\t\tif (!this.noSize)\n\t\t\tpopup.setAttribute('size', '');\n\t\tpopup.setAttribute('part', 'popup');\n\t\tpopup.setAttribute('offset', this.offset);\n\n\t\tif ((this.lazy || this.querySelector('wje-options')) && !this._wasOppened) {\n\t\t\tpopup.setAttribute('loader', '');\n\t\t} else {\n\t\t\tpopup.removeAttribute('loader');\n\t\t}\n\n\t\tif (this.disabled) {\n\t\t\tpopup.setAttribute('disabled', '');\n\t\t} else {\n\t\t\tpopup.removeAttribute('disabled');\n\t\t}\n\n\t\tif (this.variant === 'standard') {\n\t\t\tif (this.hasAttribute('label')) native.appendChild(label);\n\t\t} else {\n\t\t\twrapper.appendChild(label);\n\t\t}\n\n\t\tinputWrapper.append(slotStart);\n\t\tinputWrapper.append(display);\n\t\tinputWrapper.append(input);\n\n\t\tclear.append(clearIcon);\n\n\t\tif (this.hasAttribute('multiple')) inputWrapper.append(chips);\n\n\t\tif (this.hasAttribute('clearable')) inputWrapper.append(clear);\n\n\t\tinputWrapper.appendChild(slotEnd);\n\t\tinputWrapper.appendChild(arrow);\n\n\t\tlist.appendChild(slot);\n\n\t\tif (this.hasAttribute('find')) {\n\t\t\tlet find = document.createElement('wje-input');\n\t\t\tfind.setAttribute('variant', 'standard');\n\t\t\tfind.setAttribute('placeholder', 'Hľadať');\n\t\t\tfind.setAttribute('part', 'find');\n\t\t\tfind.clearable = true;\n\t\t\tfind.classList.add('find');\n\n\t\t\toptionsWrapper.appendChild(find);\n\n\t\t\tthis.findEl = find;\n\t\t}\n\n\t\tlet slotFooter = document.createElement('slot');\n\t\tslotFooter.setAttribute('name', 'footer');\n\n\t\t// APPEND\n\t\toptionsWrapper.append(list);\n\t\toptionsWrapper.append(slotFooter);\n\n\t\twrapper.append(inputWrapper);\n\n\t\tpopup.append(wrapper);\n\t\tpopup.append(optionsWrapper);\n\n\t\tif (this.trigger === 'click') popup.setAttribute('manual', '');\n\n\t\tthis.append(error);\n\n\t\tnative.append(popup);\n\t\tnative.append(errorSlot);\n\n\t\tfragment.appendChild(native);\n\n\t\tthis.native = native;\n\t\tthis.popup = popup;\n\t\tthis.labelElement = label;\n\t\tthis.slotStart = slotStart;\n\t\tthis.slotEnd = slotEnd;\n\t\tthis.input = input;\n\t\tthis.displayInput = display;\n\t\tthis.chips = chips;\n\t\tthis.clear = clear;\n\t\tthis.list = list;\n\t\tthis.slotFooter = slotFooter;\n\n\t\tthis.syncAria();\n\t\treturn fragment;\n\t}\n\n\t/**\n\t * Executes post-render logic for the custom element.\n\t * This includes validation, event listener registration, managing custom attributes, and\n\t * handling options initialization for the component.\n\t * @returns {void} This method does not return any value.\n\t */\n\tafterDraw() {\n\t\tdocument.addEventListener('mousedown', this.#onMenuItemClickCapture, true);\n\n\t\tthis.validate();\n\n\t\tif (this.hasAttribute('invalid')) {\n\t\t\tthis.showInvalidMessage();\n\t\t}\n\t\tthis.syncAria();\n\n\t\tthis.getAllOptions()?.forEach((option) => {\n\t\t\tthis.optionCheckSlot(option);\n\t\t});\n\n\t\tthis.selectedOptions = this.#getSelectedOptions();\n\t\tthis.selectOptions(this.value, true);\n\n\t\tif (this.lazy) {\n\t\t\tevent.addListener(this.popup, 'wje-popup:show', null, (e) => {\n\t\t\t\tif (this._wasOppened) return;\n\t\t\t\tthis._wasOppened = true;\n\n\t\t\t\tconst optionsElement = this.querySelector('wje-options');\n\t\t\t\toptionsElement.setAttribute('lazy', '');\n\t\t\t\toptionsElement.setAttribute('attached', '');\n\t\t\t});\n\t\t}\n\n\t\tevent.addListener(this.popup, 'wje-popup:aftershow', null, () => {\n\t\t\tconst assignedElements = this.slotFooter.assignedElements();\n\n\t\t\tif (assignedElements.length > 0) {\n\t\t\t\tconst el = assignedElements[0];\n\t\t\t\tconst rect = el.getBoundingClientRect();\n\t\t\t\tlet totalHeight = 0;\n\n\t\t\t\tif(this.hasAttribute('find')) {\n\t\t\t\t\tlet style = getComputedStyle(this.findEl);\n\n\t\t\t\t\tlet height = this.findEl.offsetHeight;\n\t\t\t\t\tlet marginTop = parseFloat(style.marginTop);\n\t\t\t\t\tlet marginBottom = parseFloat(style.marginBottom);\n\n\t\t\t\t\ttotalHeight = height + marginTop + marginBottom;\n\t\t\t\t}\n\n\t\t\t\tlet subtractHeight = rect.height + totalHeight;\n\n\t\t\t\tthis.list.style.height = `calc(100% - ${subtractHeight}px)`;\n\t\t\t}\n\t\t});\n\n\t\tthis.#htmlOptions = Array.from(this.querySelectorAll(':scope > wje-option')).map((option) => {\n\t\t\treturn {\n\t\t\t\tvalue: option.value,\n\t\t\t\ttext: option.textContent.trim(),\n\t\t\t};\n\t\t})\n\n\t\tthis.input.addEventListener('focus', (e) => {\n\t\t\tthis.labelElement?.classList.add('fade');\n\t\t\tthis.native.classList.add('focused');\n\t\t});\n\n\t\tthis.input.addEventListener('blur', (e) => {\n\t\t\tthis.native.classList.remove('focused');\n\t\t\tif (!e.target.value) this.labelElement?.classList.remove('fade');\n\t\t});\n\n\t\tthis.input.addEventListener('input', (e) => {\n\t\t\tthis.propagateValidation();\n\t\t});\n\n\t\tthis.addEventListener('wje-option:change', this.optionChange);\n\t\tevent.addListener(this.popup, 'wje-popup:show', null, () => this.syncAria());\n\t\tevent.addListener(this.popup, 'wje-popup:hide', null, () => this.syncAria());\n\n\t\tthis.addEventListener('invalid', (e) => {\n\t\t\tthis.invalid = true;\n\t\t\tthis.pristine = false;\n\n\t\t\tthis.showInvalidMessage();\n\n\t\t\tif (this.customErrorDisplay) {\n\t\t\t\te.preventDefault();\n\t\t\t}\n\t\t});\n\n\t\tthis.clear?.addEventListener('wje-button:click', (e) => {\n\t\t\tif (this.readonly || this.disabled) return;\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\tthis.clearSelections();\n\t\t});\n\n\t\tthis.list.addEventListener('wje-options:load', (e) => {\n\t\t\tthis.selectedOptions.forEach((option) => {\n\t\t\t\tthis.getAllOptions().forEach((el) => {\n\t\t\t\t\tif (el.value === option.value) {\n\t\t\t\t\t\tel.selected = true;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\n\t\t\t// Ensure values from the value attribute are (re)selected after lazy-loaded pages\n\t\t\tconst attrValue = this.getAttribute('value')?.split(' ') || [];\n\n\t\t\tattrValue.forEach(val => {\n\t\t\t\tconst existingOption = Array.from(this.getAllOptions()).find(el => el.value === val);\n\t\t\t\tif (existingOption) {\n\t\t\t\t\texistingOption.selected = true;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis.selectedOptions = this.#getSelectedOptions();\n\t\t\tthis.selections(true);\n\n\t\t\tthis.list.scrollTo(0, 0);\n\t\t\tevent.dispatchCustomEvent(this.popup, 'wje-popup:content-ready'); // Notify that the content is ready\n\t\t});\n\n\t\t// skontrolujeme ci ma select atribut find\n\t\tif (this.hasAttribute('find') && this.findEl instanceof HTMLElement) {\n\t\t\tevent.addListener(this.findEl, 'keyup', '', this.#applySearchFilter);\n\t\t\tevent.addListener(this.findEl, 'wje-input:clear', '', this.#applySearchFilter);\n\t\t}\n\t}\n\n\t/**\n\t * Handles the change event for an option element within a select-like component.\n\t * This method processes user interactions with options and updates the state of the component,\n\t * including selection management, validation, and UI updates. Behavior differs based on\n\t * whether the component supports multiple selections.\n\t * Key functionality:\n\t * - Prevents the default behavior, event propagation, and immediate propagation of the event.\n\t * - Retrieves all options within the component.\n\t * - If the component doesn't support multiple selection:\n\t * - Marks only the clicked option as selected and deselects others.\n\t * - Hides the option popup.\n\t * - If the component supports multiple selection:\n\t * - Processes the clicked option without deselecting others.\n\t * - Updates the selected options and triggers validation.\n\t * - Marks the form state as non-pristine.\n\t * - Propagates the validation state to other relevant parts of the component or system.\n\t * @param {Event} e The event object representing the option change interaction.\n\t */\n\toptionChange = (e) => {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t\te.stopImmediatePropagation();\n\n\t\tif (this.readonly || this.disabled) return;\n\n\t\tlet allOptions = this.getAllOptions();\n\n\t\tif (!this.hasAttribute('multiple')) {\n\t\t\tallOptions.forEach((option) => {\n\t\t\t\tif (option.value === e.target.value) {\n\t\t\t\t\tthis.processClickedOption(option);\n\t\t\t\t} else {\n\t\t\t\t\toption.selected = false;\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.popup.hide(false);\n\t\t} else {\n\t\t\tthis.processClickedOption(e.target, true);\n\t\t}\n\n\t\tthis.selections();\n\n\t\tthis.validate(this.selectedOptions);\n\n\t\tthis.pristine = false;\n\t\tthis.propagateValidation();\n\t}\n\n\t/**\n\t * Handles the logic for processing the selection state of a clicked option element.\n\t * @function processClickedOption\n\t * @param {Element} option The option element that is clicked.\n\t * @param {boolean} [multiple] A Boolean indicating whether multiple options can be selected. Defaults to false.\n\t * Changes the selected state of the passed option and updates the selected options list.\n\t * Checks if the option already has a \"selected\" attribute, toggles its state,\n\t * and updates the internal selected options.\n\t */\n\tprocessClickedOption = (option, multiple = false) => {\n\t\tconst isSelected = option.hasAttribute('selected');\n\t\toption.selected = !isSelected;\n\n\t\tthis.selectedOptions = this.#getSelectedOptions();\n\t\tthis.syncAria();\n\t}\n\n\t/**\n\t * Returns all the options as HTML.\n\t * @returns {NodeList} The options as HTML.\n\t */\n\tgetAllOptions() {\n\t\treturn this.querySelectorAll('wje-option');\n\t}\n\n\t/**\n\t * Handles changes in the selection for a component, updating internal values, input fields,\n\t * and visual presentation (like chips or slots) as per the given selection options.\n\t * @param {Array|null} options The collection of selected option elements. If null, no options are selected.\n\t * @param {number} length The total number of selected options.\n\t * @returns {void}\n\t */\n\tselectionChanged(options = null, length = 0) {\n\t\tif (this.hasAttribute('multiple')) {\n\t\t\tthis.value = options.map((el) => el.value).reverse();\n\t\t\tthis.input.value = this.value.map(a => a).join(\" \").trim();\n\n\t\t\tif (this.placeholder && length === 0) {\n\t\t\t\tthis.chips.innerHTML = this.placeholder;\n\t\t\t} else {\n\t\t\t\tif (options !== null) Array.from(options).slice(0, +this.maxOptions).forEach(option => this.chips.appendChild(this.getChip(option)));\n\t\t\t\tif (this.counterEl instanceof HTMLElement || !this.maxOptions || length > +this.maxOptions) {\n\t\t\t\t\tthis.counter();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.getAllOptions().forEach((o) => this.#syncOptionCheckbox(o));\n\t\t} else {\n\t\t\tconst option = options?.at(0);\n\n\t\t\tthis.value = options?.map((el) => el.value)?.at(0) || '';\n\t\t\tthis.input.value = this.value[0] || '';\n\t\t\tthis.displayInput.value = options[0]?.textContent?.trim() || '';\n\n\t\t\tthis.slotStart.innerHTML = '';\n\t\t\tthis.slotEnd.innerHTML = '';\n\n\t\t\tif (option && option instanceof HTMLElement) {\n\t\t\t\tlet optionSlotStart = option?.querySelector('wje-option > [slot=start]');\n\t\t\t\tif (optionSlotStart) {\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tthis.slotStart.append(optionSlotStart.cloneNode(true));\n\t\t\t\t\t},0)\n\t\t\t\t}\n\n\t\t\t\tlet optionSlotEnd = option?.querySelector('wje-option > [slot=end]');\n\n\t\t\t\tif (optionSlotEnd && optionSlotEnd instanceof HTMLElement && optionSlotEnd.tagName !== 'WJE-DROPDOWN' && optionSlotEnd.tagName !== 'WJE-BUTTON') {\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tthis.slotEnd.append(optionSlotEnd.cloneNode(true));\n\t\t\t\t\t},0)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis.syncAria();\n\t}\n\n\t/**\n\t * Handles the logic for updating selections based on the current selected options,\n\t * updating chips content, and dispatching change events if necessary.\n\t * @param {boolean} [silence] If true, suppresses the dispatch of a custom change event.\n\t * @returns {void} This method does not return a value.\n\t */\n\tselections(silence = false) {\n\t\tif (this.selectedOptions.length >= +this.maxOptions) {\n\t\t\tthis.counterEl = null;\n\t\t}\n\n\t\tif (this.chips) {\n\t\t\tthis.chips.innerHTML = '';\n\t\t}\n\n\t\tif (this.selectedOptions.length > 0) {\n\t\t\tthis.selectionChanged(this.selectedOptions, this.selectedOptions.length);\n\t\t} else {\n\t\t\tthis.selectionChanged(this.selectedOptions);\n\t\t}\n\n\t\tif (silence) return;\n\t\tevent.dispatchCustomEvent(this, 'wje-select:change');\n\t}\n\n\t/**\n\t * Updates the counter element to reflect the current state of selected values relative to the maximum allowed options.\n\t * If the maximum options are selected, the counter element is removed. If it does not already exist and needs to be displayed, it is created.\n\t * @returns {void} Does not return a value.\n\t */\n\tcounter() {\n\t\t// zmazanie counter (span)\n\t\tif (this.counterEl && this.value.length === +this.maxOptions) {\n\t\t\tthis.counterEl.remove();\n\t\t\tthis.counterEl = null;\n\t\t\treturn;\n\t\t}\n\n\t\t// ak counter nie je, tak ho vytvorime\n\t\tif (!this.counterEl) {\n\t\t\tthis.counterEl = document.createElement('span');\n\t\t\tthis.counterEl.classList.add('counter');\n\n\t\t\tthis.chips.appendChild(this.counterEl);\n\t\t}\n\n\t\t// nastavime hodnotu counter\n\t\tthis.counterEl.innerText = `+${this.value.length - +this.maxOptions}`;\n\t}\n\n\t/**\n\t * Creates and returns a chip element with specified properties and a label.\n\t * @param {object} option The configuration object for the chip. Typically includes properties such as value and textContent to set up the chip's label and data.\n\t * @returns {HTMLElement} The newly created chip element with a label and default properties.\n\t */\n\tgetChip(option) {\n\t\tlet chip = document.createElement('wje-chip');\n\t\tchip.size = 'small';\n\t\tchip.removable = !this.readonly;\n\t\tchip.round = true;\n\t\tchip.addEventListener('wje:chip-remove', this.removeChip);\n\t\tchip.option = option;\n\n\t\tlet label = document.createElement('wje-label');\n\t\tlabel.innerText = this.#htmlSelectedItem(option.value) // option.textContent.trim();\n\n\t\tchip.appendChild(label);\n\n\t\treturn chip;\n\t}\n\n\t/**\n\t * Handles the removal of a chip element from the DOM and updates the related state.\n\t * @param {Event} e The event object triggered by the chip removal action.\n\t * The target of the event is expected to be the chip element itself.\n\t */\n\tremoveChip = (e) => {\n\t\te.target.parentNode.removeChild(e.target);\n\t\tthis.processClickedOption(e.target.option, true);\n\t\tthis.selections();\n\t};\n\n\t/**\n\t * Generates an HTML option element based on the provided item and mapping.\n\t * @param {object} item The item to generate the option for.\n\t * @param {object} [map] The mapping object that specifies the properties of the item to use for the option's value and text.\n\t * @param {string} [map.value] The property of the item to use for the option's value.\n\t * @param {string} [map.text] The property of the item to use for the option's text.\n\t * @returns {HTMLElement} The generated HTML option element.\n\t */\n\thtmlOption(item, map = { value: 'value', text: 'text' }) {\n\t\tlet option = document.createElement('wje-option');\n\n\t\tif (item[map.value] === null) {\n\t\t\tconsole.warn(`The item ${JSON.stringify(item)} does not have the property ${map.value}`);\n\t\t}\n\n\t\tif (item[map.text] === null) {\n\t\t\tconsole.warn(`The item ${JSON.stringify(item)} does not have the property ${map.text}`);\n\t\t}\n\n\t\toption.setAttribute('value', item[map.value] ?? '');\n\t\toption.innerText = item[map.text] ?? '';\n\n\t\tthis.#addedOptions.push({ [map.value]: item[map.value], [map.text]: item[map.text] });\n\t\treturn option;\n\t}\n\n\t/**\n\t * Returns the provided item.\n\t * @param {any} item The item to be returned.\n\t * @returns {any} The same item that was passed as input.\n\t */\n\thtmlSelectedItem(item) {\n\t\treturn item;\n\t}\n\n\t/**\n\t * Adds a new option to the component.\n\t * @param {object} optionData The data used to create the new option.\n\t * @param {boolean} [silent] Whether the addition should trigger events or not.\n\t * @param {object} [map] Mapping of keys to identify value and text in the optionData.\n\t * @param {string} [map.value] The key in optionData that represents the value of the option.\n\t * @param {string} [map.text] The key in optionData that represents the text of the option.\n\t * @returns {void}\n\t */\n\taddOption(optionData, silent = false, map = { value: 'value', text: 'text' }) {\n\t\tif (!optionData) return;\n\n\t\tconst optionsElement = this.querySelector('wje-options');\n\t\tif (optionsElement) {\n\t\t\toptionsElement.addOption(optionData, silent, map);\n\t\t\treturn;\n\t\t}\n\t\tlet option = this.htmlOption(optionData, map);\n\t\tthis.appendChild(option);\n\t}\n\n\t/**\n\t * Adds one or more options to a collection. If the input is an array, it adds each option within the array.\n\t * Otherwise, it adds a single option.\n\t * @param {Array | object} optionsData The data representing the options to be added. It can be a single object or an array of objects.\n\t * @param {boolean} [silent] Optional flag to determine if events or notifications should be suppressed while adding options.\n\t * @param {object} [map] An optional mapping object specifying how to map data properties to value and text for the options.\n\t * @param {string} [map.value] The property in the optionsData that represents the value of the option.\n\t * @param {string} [map.text] The property in the optionsData that represents the text of the option.\n\t * @returns {void}\n\t */\n\taddOptions(optionsData, silent = false, map = { value: 'value', text: 'text' }) {\n\t\tif (!Array.isArray(optionsData)) {\n\t\t\tthis.addOption(optionsData, silent, map);\n\t\t} else {\n\t\t\toptionsData.forEach((item) => {\n\t\t\t\tthis.addOption(item, silent, map);\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Selects an option from the available options within the component.\n\t * @param {string} value The value of the option to be selected.\n\t * @param {boolean} [silent] Determines whether the selection should trigger notification or updates. Defaults to false.\n\t * @returns {void} Does not return a value.\n\t */\n\tselectOption(value, silent = false) {\n\t\tif (!value) return;\n\n\t\tconst option = this.querySelector(`wje-option[value=\"${value}\"]`);\n\t\tif (!option) return;\n\n\t\tif (silent) {\n\t\t\tif (!option.hasAttribute('selected')) {\n\t\t\t\toption.selected = true;\n\t\t\t}\n\t\t\tthis.selectedOptions = this.#getSelectedOptions();\n\t\t} else {\n\t\t\tthis.processClickedOption(option, this.hasAttribute('multiple'));\n\t\t}\n\n\t\tif (this.drawingStatus > this.drawingStatuses.START) {\n\t\t\tthis.selections(silent);\n\t\t}\n\t}\n\n\t/**\n\t * Selects multiple options based on the provided values. If a single value is provided, it selects that option.\n\t * If an array of values is provided, it iterates through the array and selects each option.\n\t * @param {any|any[]} values A single value or an array of values to be selected.\n\t * @param {boolean} [silent] Determines whether the selection action should occur silently without triggering other side effects or events.\n\t * @returns {void} This method does not return a value.\n\t */\n\tselectOptions(values, silent = false) {\n\t\tif (!Array.isArray(values)) {\n\t\t\tthis.selectOption(values, silent);\n\t\t} else {\n\t\t\tvalues.forEach((value) => {\n\t\t\t\tthis.selectOption(value, silent);\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Clones and appends an icon with the \"check\" slot to the specified option element.\n\t * If the option already contains a custom element with slot=\"check\" (e.g. <wje-status slot=\"check\">),\n\t * it is left untouched and no template icon is added.\n\t * @param {HTMLElement} option The target HTML element to which the cloned \"check\" icon will be appended.\n\t * @returns {void} This method does not return a value, but it modifies the DOM by appending a cloned \"check\" icon to the provided option element.\n\t */\n\toptionCheckSlot(option) {\n\t\tlet existingCheckSlot = option.querySelector('[slot=\"check\"]');\n\n\t\tif (existingCheckSlot && existingCheckSlot.tagName !== 'WJE-CHECKBOX') {\n\t\t\treturn;\n\t\t}\n\n\t\tif (existingCheckSlot && existingCheckSlot.tagName === 'WJE-CHECKBOX') {\n\t\t\tconst isSelectedExisting = option.hasAttribute('selected');\n\n\t\t\t// zosúladenie stavu\n\t\t\texistingCheckSlot.checked = isSelectedExisting;\n\t\t\tif (isSelectedExisting) {\n\t\t\t\texistingCheckSlot.setAttribute('checked', '');\n\t\t\t} else {\n\t\t\t\texistingCheckSlot.removeAttribute('checked');\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tlet icon = this.querySelector('template')?.content.querySelector('[slot=\"check\"]');\n\t\tif (!icon) {\n\t\t\tconsole.warn('Icon with slot \"check\" was not found.');\n\t\t\treturn;\n\t\t}\n\n\t\tlet iconClone = icon.cloneNode(true);\n\n\t\toption.append(iconClone);\n\t}\n\n\t/**\n\t * Clears all selected options and resets selections.\n\t * The method ensures that all options are deselected, updates the internal state, validates the selections,\n\t * propagates the validation status, and indicates invalid state if necessary.\n\t * @returns {void} No value is returned by this method.\n\t */\n\tclearSelections() {\n\t\tthis.selectedOptions = [];\n\n\t\tthis.getAllOptions().forEach((option) => {\n\t\t\toption.selected = false;\n\t\t});\n\t\tthis.selections();\n\n\t\tthis.validate();\n\t\tthis.propagateValidation();\n\n\t\tif (this.hasAttribute('invalid')) {\n\t\t\tthis.showInvalidMessage();\n\t\t}\n\t}\n\n\t/**\n\t * Processes the given item and retrieves the corresponding value from the selected options.\n\t * @param {string} item The key to search for in the selected options.\n\t * @returns {string} The text content associated with the selected item, or an empty string if not found.\n\t */\n\t#htmlSelectedItem(item) {\n\t\tconst keyValue = \"value\"\n\t\tconst textValue = \"textContent\";\n\n\t\tconst value = this.selectedOptions.find((option) => option[keyValue] === item)?.[textValue] ?? \"\";\n\n\t\treturn this.htmlSelectedItem(value);\n\t}\n\n\t/**\n\t * Retrieves the list of selected options within the component.\n\t * @returns {Array<Element>} An array of elements representing the options that are currently selected.\n\t */\n\t#getSelectedOptions() {\n\t\treturn Array.from(this.querySelectorAll('wje-option[selected]'));\n\t}\n\n\t/**\n\t * Filters option elements based on the search input value.\n\t * This function applies a search filter to a list of options. If a `wj-options` element exists and has\n\t * the `lazy` attribute, the search value is passed to the `wj-options` element, enabling infinite scroll\n\t * functionality to handle the filtering. If the `lazy` attribute is not present, it performs a local\n\t * search to show or hide options depending on whether their text content matches the search input.\n\t * @param {Event} e The input event containing the search input value from the user.\n\t */\n\t#applySearchFilter = (e) => {\n\t\t// contains wj-options element with options\n\t\tconst optionsElement = this.querySelector('wje-options');\n\n\t\tif (optionsElement && optionsElement.hasAttribute('lazy')) {\n\t\t\t// pass search value to wj-options element and infinite scroll will handle the rest\n\t\t\toptionsElement.setAttribute('search', e.target.value);\n\t\t} else {\n\t\t\tlet value = e.target.value.trim().toLowerCase();\n\n\t\t\tthis.getAllOptions().forEach((option) => {\n\t\t\t\tif (option.textContent.trim().toLowerCase().includes(value)) {\n\t\t\t\t\toption.style.display = 'block';\n\t\t\t\t} else {\n\t\t\t\t\toption.style.display = 'none';\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tdisconnectedCallback() {\n\t\tdocument.removeEventListener('mousedown', this.#onMenuItemClickCapture, true);\n\t}\n\n\t/**\n\t * Syncs ARIA attributes on the host element.\n\t */\n\tsyncAria() {\n\t\tconst expanded = this.popup?.hasAttribute('active') || this.classList.contains('active');\n\t\tthis.setAriaState({\n\t\t\trole: 'combobox',\n\t\t\thaspopup: 'listbox',\n\t\t\texpanded,\n\t\t\tcontrols: this._ariaListId,\n\t\t\tdisabled: this.disabled,\n\t\t\trequired: this.required,\n\t\t\tinvalid: this.invalid || this.hasAttribute('invalid'),\n\t\t});\n\t}\n\n\t/**\n\t * Prevent closing the parent <wje-select>'s popup when a nested <wje-dropdown>\n\t * menu item is clicked. Closes only the dropdown that owns the clicked item.\n\t * This captures the event at the document level (useCapture=true) so it can\n\t * stop the global outside-click logic that would otherwise hide the select's popup.\n\t */\n\t#onMenuItemClickCapture = (e) => {\n\t\tconst target = (e.target);\n\t\tif (!target || !target.closest) return;\n\n\t\tconst menuItem = target.closest('wje-menu-item');\n\t\tif (!menuItem) return;\n\n\t\tconst dropdown = target.closest('wje-dropdown');\n\t\tif (dropdown && typeof dropdown.hide === 'function') {\n\t\t\tdropdown.hide();\n\t\t}\n\n\t\te.stopPropagation();\n\t}\n\n\t#syncOptionCheckbox(option) {\n\t\tconst checkbox = option.querySelector('wje-checkbox[slot=\"check\"]');\n\t\tif (!checkbox) return;\n\n\t\tconst isSelected = option.hasAttribute('selected');\n\t\tcheckbox.checked = isSelected;\n\t\tif (isSelected) {\n\t\t\tcheckbox.setAttribute('checked', '');\n\t\t} else {\n\t\t\tcheckbox.removeAttribute('checked');\n\t\t}\n\t}\n}\n","import { Select } from \"./select.element.js\";\n\nexport default Select;\n\nSelect.define('wje-select', Select);\n"],"names":["_a"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAaO,MAAM,UAAN,MAAM,gBAAe,sBAAsB;AAAA,EAKjD,cAAc;AACb,UAAO;AANF;AAEN,sCAAgB,CAAE;AAClB,qCAAe,CAAE;AA4FjB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wCAAe;AAAA,MACd,cAAc;AAAA,MACd,aAAa;AAAA,MACb,YAAY;AAAA,MACZ,aAAa;AAAA,MACb,YAAY;AAAA,MACZ,aAAa;AAAA,MACb,cAAc;AAAA,MACd,eAAe;AAAA,MACf,gBAAgB;AAAA,IAChB;AA6SD,qCAAY;AAkYZ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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