@public-ui/components 3.0.4-ed0f3af88ca201e0c6c949626c9aeee66f80f44e.0 → 3.0.4-fa8bcfa66607a9847a1359c0ca7d77fe673660d7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (318) hide show
  1. package/custom-elements.json +1 -1
  2. package/dist/cjs/{Alert-CwuuXtSY.js → Alert-Ne0hhoYW.js} +1 -1
  3. package/dist/cjs/{Alert-CwuuXtSY.js.map → Alert-Ne0hhoYW.js.map} +1 -1
  4. package/dist/cjs/{Collapsible-BUK_Xmkd.js → Collapsible-BMwd6dUu.js} +1 -1
  5. package/dist/cjs/{Collapsible-BUK_Xmkd.js.map → Collapsible-BMwd6dUu.js.map} +1 -1
  6. package/dist/cjs/{CustomSuggestionsToggle-BT8xOvEp.js → CustomSuggestionsToggle-BpgASM5h.js} +1 -1
  7. package/dist/cjs/{CustomSuggestionsToggle-BT8xOvEp.js.map → CustomSuggestionsToggle-BpgASM5h.js.map} +1 -1
  8. package/dist/cjs/{FieldControlStateWrapper-BNSG4aXe.js → FieldControlStateWrapper-BMgv-K8f.js} +1 -1
  9. package/dist/cjs/{FieldControlStateWrapper-BNSG4aXe.js.map → FieldControlStateWrapper-BMgv-K8f.js.map} +1 -1
  10. package/dist/cjs/{FormFieldStateWrapper-BEGBlx4c.js → FormFieldStateWrapper-B6GbGskA.js} +1 -1
  11. package/dist/cjs/{FormFieldStateWrapper-BEGBlx4c.js.map → FormFieldStateWrapper-B6GbGskA.js.map} +1 -1
  12. package/dist/cjs/{Heading-DlbiB1eP.js → Heading-CaL-5c7e.js} +1 -1
  13. package/dist/cjs/{Heading-DlbiB1eP.js.map → Heading-CaL-5c7e.js.map} +1 -1
  14. package/dist/cjs/{Icon-BXx6hmOf.js → Icon-DVhYTvJw.js} +1 -1
  15. package/dist/cjs/{Icon-BXx6hmOf.js.map → Icon-DVhYTvJw.js.map} +1 -1
  16. package/dist/cjs/{Input-D76rkMwb.js → Input-CUgTQQjf.js} +1 -1
  17. package/dist/cjs/{Input-D76rkMwb.js.map → Input-CUgTQQjf.js.map} +1 -1
  18. package/dist/cjs/{InputStateWrapper-GSsOojZH.js → InputStateWrapper-9ecUhBjl.js} +1 -1
  19. package/dist/cjs/{InputStateWrapper-GSsOojZH.js.map → InputStateWrapper-9ecUhBjl.js.map} +1 -1
  20. package/dist/cjs/{InternalUnderlinedBadgeText-BktIt7Dv.js → InternalUnderlinedBadgeText-R6vQac1e.js} +1 -1
  21. package/dist/cjs/{InternalUnderlinedBadgeText-BktIt7Dv.js.map → InternalUnderlinedBadgeText-R6vQac1e.js.map} +1 -1
  22. package/dist/cjs/Span-jB6WmgmH.js +4 -0
  23. package/dist/cjs/{Span-R1KVY7GP.js.map → Span-jB6WmgmH.js.map} +1 -1
  24. package/dist/cjs/{app-globals-D2El5i3Z.js → app-globals-DLlhs8Wk.js} +1 -1
  25. package/dist/cjs/{app-globals-D2El5i3Z.js.map → app-globals-DLlhs8Wk.js.map} +1 -1
  26. package/dist/cjs/{controller-LUPyLjfe.js → controller--vy2gxMN.js} +1 -1
  27. package/dist/cjs/{controller-LUPyLjfe.js.map → controller--vy2gxMN.js.map} +1 -1
  28. package/dist/cjs/{controller-Dwu6WB8X.js → controller-BYcNQ3Kn.js} +1 -1
  29. package/dist/cjs/{controller-Dwu6WB8X.js.map → controller-BYcNQ3Kn.js.map} +1 -1
  30. package/dist/cjs/{controller-DBt3tIW4.js → controller-Cy9PpTeE.js} +1 -1
  31. package/dist/cjs/{controller-DBt3tIW4.js.map → controller-Cy9PpTeE.js.map} +1 -1
  32. package/dist/cjs/{controller-icon-BoPE_IMC.js → controller-icon-BRCkFh8y.js} +1 -1
  33. package/dist/cjs/{controller-icon-BoPE_IMC.js.map → controller-icon-BRCkFh8y.js.map} +1 -1
  34. package/dist/cjs/{dev.utils-qFfdScN_.js → dev.utils-D2C1_sCv.js} +1 -1
  35. package/dist/cjs/{dev.utils-qFfdScN_.js.map → dev.utils-D2C1_sCv.js.map} +1 -1
  36. package/dist/cjs/{devtools-C4AfIMLp.js → devtools-Cav0M-vn.js} +1 -1
  37. package/dist/cjs/{devtools-C4AfIMLp.js.map → devtools-Cav0M-vn.js.map} +1 -1
  38. package/dist/cjs/{index-BHqiFoBU.js → index-z9o5XG-U.js} +1 -1
  39. package/dist/cjs/{index-BHqiFoBU.js.map → index-z9o5XG-U.js.map} +1 -1
  40. package/dist/cjs/kol-abbr.cjs.entry.js +1 -1
  41. package/dist/cjs/kol-accordion.cjs.entry.js +1 -1
  42. package/dist/cjs/kol-alert-wc.cjs.entry.js +1 -1
  43. package/dist/cjs/kol-alert.cjs.entry.js +1 -1
  44. package/dist/cjs/kol-avatar-wc.cjs.entry.js +1 -1
  45. package/dist/cjs/kol-avatar.cjs.entry.js +1 -1
  46. package/dist/cjs/kol-badge.cjs.entry.js +1 -1
  47. package/dist/cjs/kol-breadcrumb.cjs.entry.js +1 -1
  48. package/dist/cjs/kol-button-link.cjs.entry.js +1 -1
  49. package/dist/cjs/kol-button-wc.cjs.entry.js +1 -1
  50. package/dist/cjs/kol-button.cjs.entry.js +1 -1
  51. package/dist/cjs/kol-card-wc.cjs.entry.js +1 -1
  52. package/dist/cjs/kol-card.cjs.entry.js +1 -1
  53. package/dist/cjs/kol-combobox.cjs.entry.js +1 -1
  54. package/dist/cjs/kol-details.cjs.entry.js +1 -1
  55. package/dist/cjs/kol-drawer.cjs.entry.js +1 -1
  56. package/dist/cjs/kol-form.cjs.entry.js +1 -1
  57. package/dist/cjs/kol-heading.cjs.entry.js +1 -1
  58. package/dist/cjs/kol-icon.cjs.entry.js +1 -1
  59. package/dist/cjs/kol-image.cjs.entry.js +1 -1
  60. package/dist/cjs/kol-input-checkbox.cjs.entry.js +1 -1
  61. package/dist/cjs/kol-input-color.cjs.entry.js +1 -1
  62. package/dist/cjs/kol-input-date.cjs.entry.js +1 -1
  63. package/dist/cjs/kol-input-email.cjs.entry.js +1 -1
  64. package/dist/cjs/kol-input-file.cjs.entry.js +1 -1
  65. package/dist/cjs/kol-input-number.cjs.entry.js +1 -1
  66. package/dist/cjs/kol-input-password.cjs.entry.js +1 -1
  67. package/dist/cjs/kol-input-radio.cjs.entry.js +1 -1
  68. package/dist/cjs/kol-input-range.cjs.entry.js +1 -1
  69. package/dist/cjs/kol-input-text.cjs.entry.js +1 -1
  70. package/dist/cjs/kol-kolibri.cjs.entry.js +1 -1
  71. package/dist/cjs/kol-link-button.cjs.entry.js +1 -1
  72. package/dist/cjs/kol-link-wc.cjs.entry.js +1 -1
  73. package/dist/cjs/kol-link.cjs.entry.js +1 -1
  74. package/dist/cjs/kol-modal.cjs.entry.js +1 -1
  75. package/dist/cjs/kol-nav.cjs.entry.js +1 -1
  76. package/dist/cjs/kol-pagination-wc.cjs.entry.js +1 -1
  77. package/dist/cjs/kol-pagination.cjs.entry.js +1 -1
  78. package/dist/cjs/kol-popover-button-wc.cjs.entry.js +1 -1
  79. package/dist/cjs/kol-popover-button.cjs.entry.js +1 -1
  80. package/dist/cjs/kol-popover-wc.cjs.entry.js +1 -1
  81. package/dist/cjs/kol-progress.cjs.entry.js +1 -1
  82. package/dist/cjs/kol-quote.cjs.entry.js +1 -1
  83. package/dist/cjs/kol-select.cjs.entry.js +1 -1
  84. package/dist/cjs/kol-single-select.cjs.entry.js +1 -1
  85. package/dist/cjs/kol-skip-nav.cjs.entry.js +1 -1
  86. package/dist/cjs/kol-spin.cjs.entry.js +1 -1
  87. package/dist/cjs/kol-split-button.cjs.entry.js +1 -1
  88. package/dist/cjs/kol-table-settings-wc.cjs.entry.js +1 -1
  89. package/dist/cjs/kol-table-stateful.cjs.entry.js +1 -1
  90. package/dist/cjs/kol-table-stateless-wc.cjs.entry.js +1 -1
  91. package/dist/cjs/kol-table-stateless.cjs.entry.js +1 -1
  92. package/dist/cjs/kol-tabs.cjs.entry.js +1 -1
  93. package/dist/cjs/kol-textarea.cjs.entry.js +1 -1
  94. package/dist/cjs/kol-toast-container.cjs.entry.js +1 -1
  95. package/dist/cjs/kol-toolbar.cjs.entry.js +1 -1
  96. package/dist/cjs/kol-tooltip-wc.cjs.entry.js +1 -1
  97. package/dist/cjs/kol-tree-item-wc.cjs.entry.js +1 -1
  98. package/dist/cjs/kol-tree-item.cjs.entry.js +1 -1
  99. package/dist/cjs/kol-tree-wc.cjs.entry.js +1 -1
  100. package/dist/cjs/kol-tree.cjs.entry.js +1 -1
  101. package/dist/cjs/kol-version.cjs.entry.js +1 -1
  102. package/dist/cjs/kolibri.cjs.js +1 -1
  103. package/dist/cjs/loader.cjs.js +1 -1
  104. package/dist/cjs/test-component.cjs.entry.js +1 -1
  105. package/dist/esm/{Alert-CTk_PNsB.js → Alert-Bbh--qXI.js} +1 -1
  106. package/dist/{kolibri/Alert-CTk_PNsB.js.map → esm/Alert-Bbh--qXI.js.map} +1 -1
  107. package/dist/esm/{Collapsible-C17ZrcR4.js → Collapsible-DOVY8in5.js} +1 -1
  108. package/dist/esm/{Collapsible-C17ZrcR4.js.map → Collapsible-DOVY8in5.js.map} +1 -1
  109. package/dist/esm/{CustomSuggestionsToggle-DlW7BYA_.js → CustomSuggestionsToggle-CI52XOED.js} +1 -1
  110. package/dist/{kolibri/CustomSuggestionsToggle-DlW7BYA_.js.map → esm/CustomSuggestionsToggle-CI52XOED.js.map} +1 -1
  111. package/dist/esm/{FieldControlStateWrapper-Bvn5yK_i.js → FieldControlStateWrapper-CwL_BkST.js} +1 -1
  112. package/dist/{kolibri/FieldControlStateWrapper-Bvn5yK_i.js.map → esm/FieldControlStateWrapper-CwL_BkST.js.map} +1 -1
  113. package/dist/esm/{FormFieldStateWrapper-j7e0a3Oe.js → FormFieldStateWrapper-CCkAqaaL.js} +1 -1
  114. package/dist/esm/{FormFieldStateWrapper-j7e0a3Oe.js.map → FormFieldStateWrapper-CCkAqaaL.js.map} +1 -1
  115. package/dist/esm/{Heading-CdL171uD.js → Heading-BYeuylXc.js} +1 -1
  116. package/dist/{kolibri/Heading-CdL171uD.js.map → esm/Heading-BYeuylXc.js.map} +1 -1
  117. package/dist/esm/{Icon-BFZ6Qv6o.js → Icon-BttEGYV4.js} +1 -1
  118. package/dist/esm/{Icon-BFZ6Qv6o.js.map → Icon-BttEGYV4.js.map} +1 -1
  119. package/dist/esm/{Input-DnQOLdqt.js → Input-By5qTQCO.js} +1 -1
  120. package/dist/{kolibri/Input-DnQOLdqt.js.map → esm/Input-By5qTQCO.js.map} +1 -1
  121. package/dist/esm/{InputStateWrapper-uyLppe6O.js → InputStateWrapper-DuA_SJ6D.js} +1 -1
  122. package/dist/{kolibri/InputStateWrapper-uyLppe6O.js.map → esm/InputStateWrapper-DuA_SJ6D.js.map} +1 -1
  123. package/dist/esm/{InternalUnderlinedBadgeText-BTlxPf6n.js → InternalUnderlinedBadgeText-CRfceIpy.js} +1 -1
  124. package/dist/esm/{InternalUnderlinedBadgeText-BTlxPf6n.js.map → InternalUnderlinedBadgeText-CRfceIpy.js.map} +1 -1
  125. package/dist/esm/Span-Bgdwx7W2.js +4 -0
  126. package/dist/{kolibri/Span-CLrfUTlO.js.map → esm/Span-Bgdwx7W2.js.map} +1 -1
  127. package/dist/esm/{app-globals-Bb7SxAXn.js → app-globals-BDBwpueJ.js} +1 -1
  128. package/dist/esm/{app-globals-Bb7SxAXn.js.map → app-globals-BDBwpueJ.js.map} +1 -1
  129. package/dist/esm/{controller-DwYQijEB.js → controller-Bir1vcn8.js} +1 -1
  130. package/dist/{kolibri/controller-DwYQijEB.js.map → esm/controller-Bir1vcn8.js.map} +1 -1
  131. package/dist/esm/{controller-DiV1ch6R.js → controller-C95620Yo.js} +1 -1
  132. package/dist/esm/{controller-DiV1ch6R.js.map → controller-C95620Yo.js.map} +1 -1
  133. package/dist/esm/{controller-Cz0hl43b.js → controller-Cdvx9cUf.js} +1 -1
  134. package/dist/esm/{controller-Cz0hl43b.js.map → controller-Cdvx9cUf.js.map} +1 -1
  135. package/dist/esm/{controller-icon-D8NyK7bc.js → controller-icon-LXybyI6W.js} +1 -1
  136. package/dist/esm/{controller-icon-D8NyK7bc.js.map → controller-icon-LXybyI6W.js.map} +1 -1
  137. package/dist/esm/{dev.utils-B25txGhq.js → dev.utils-vAdYjvGq.js} +1 -1
  138. package/dist/{kolibri/dev.utils-B25txGhq.js.map → esm/dev.utils-vAdYjvGq.js.map} +1 -1
  139. package/dist/esm/{devtools-DiehHGXn.js → devtools-d011w8ez.js} +1 -1
  140. package/dist/{kolibri/devtools-DiehHGXn.js.map → esm/devtools-d011w8ez.js.map} +1 -1
  141. package/dist/esm/{index-BwHVuv1c.js → index-DTM8XbOu.js} +1 -1
  142. package/dist/esm/{index-BwHVuv1c.js.map → index-DTM8XbOu.js.map} +1 -1
  143. package/dist/esm/kol-abbr.entry.js +1 -1
  144. package/dist/esm/kol-accordion.entry.js +1 -1
  145. package/dist/esm/kol-alert-wc.entry.js +1 -1
  146. package/dist/esm/kol-alert.entry.js +1 -1
  147. package/dist/esm/kol-avatar-wc.entry.js +1 -1
  148. package/dist/esm/kol-avatar.entry.js +1 -1
  149. package/dist/esm/kol-badge.entry.js +1 -1
  150. package/dist/esm/kol-breadcrumb.entry.js +1 -1
  151. package/dist/esm/kol-button-link.entry.js +1 -1
  152. package/dist/esm/kol-button-wc.entry.js +1 -1
  153. package/dist/esm/kol-button.entry.js +1 -1
  154. package/dist/esm/kol-card-wc.entry.js +1 -1
  155. package/dist/esm/kol-card.entry.js +1 -1
  156. package/dist/esm/kol-combobox.entry.js +1 -1
  157. package/dist/esm/kol-details.entry.js +1 -1
  158. package/dist/esm/kol-drawer.entry.js +1 -1
  159. package/dist/esm/kol-form.entry.js +1 -1
  160. package/dist/esm/kol-heading.entry.js +1 -1
  161. package/dist/esm/kol-icon.entry.js +1 -1
  162. package/dist/esm/kol-image.entry.js +1 -1
  163. package/dist/esm/kol-input-checkbox.entry.js +1 -1
  164. package/dist/esm/kol-input-color.entry.js +1 -1
  165. package/dist/esm/kol-input-date.entry.js +1 -1
  166. package/dist/esm/kol-input-email.entry.js +1 -1
  167. package/dist/esm/kol-input-file.entry.js +1 -1
  168. package/dist/esm/kol-input-number.entry.js +1 -1
  169. package/dist/esm/kol-input-password.entry.js +1 -1
  170. package/dist/esm/kol-input-radio.entry.js +1 -1
  171. package/dist/esm/kol-input-range.entry.js +1 -1
  172. package/dist/esm/kol-input-text.entry.js +1 -1
  173. package/dist/esm/kol-kolibri.entry.js +1 -1
  174. package/dist/esm/kol-link-button.entry.js +1 -1
  175. package/dist/esm/kol-link-wc.entry.js +1 -1
  176. package/dist/esm/kol-link.entry.js +1 -1
  177. package/dist/esm/kol-modal.entry.js +1 -1
  178. package/dist/esm/kol-nav.entry.js +1 -1
  179. package/dist/esm/kol-pagination-wc.entry.js +1 -1
  180. package/dist/esm/kol-pagination.entry.js +1 -1
  181. package/dist/esm/kol-popover-button-wc.entry.js +1 -1
  182. package/dist/esm/kol-popover-button.entry.js +1 -1
  183. package/dist/esm/kol-popover-wc.entry.js +1 -1
  184. package/dist/esm/kol-progress.entry.js +1 -1
  185. package/dist/esm/kol-quote.entry.js +1 -1
  186. package/dist/esm/kol-select.entry.js +1 -1
  187. package/dist/esm/kol-single-select.entry.js +1 -1
  188. package/dist/esm/kol-skip-nav.entry.js +1 -1
  189. package/dist/esm/kol-spin.entry.js +1 -1
  190. package/dist/esm/kol-split-button.entry.js +1 -1
  191. package/dist/esm/kol-table-settings-wc.entry.js +1 -1
  192. package/dist/esm/kol-table-stateful.entry.js +1 -1
  193. package/dist/esm/kol-table-stateless-wc.entry.js +1 -1
  194. package/dist/esm/kol-table-stateless.entry.js +1 -1
  195. package/dist/esm/kol-tabs.entry.js +1 -1
  196. package/dist/esm/kol-textarea.entry.js +1 -1
  197. package/dist/esm/kol-toast-container.entry.js +1 -1
  198. package/dist/esm/kol-toolbar.entry.js +1 -1
  199. package/dist/esm/kol-tooltip-wc.entry.js +1 -1
  200. package/dist/esm/kol-tree-item-wc.entry.js +1 -1
  201. package/dist/esm/kol-tree-item.entry.js +1 -1
  202. package/dist/esm/kol-tree-wc.entry.js +1 -1
  203. package/dist/esm/kol-tree.entry.js +1 -1
  204. package/dist/esm/kol-version.entry.js +1 -1
  205. package/dist/esm/kolibri.js +1 -1
  206. package/dist/esm/loader.js +1 -1
  207. package/dist/esm/test-component.entry.js +1 -1
  208. package/dist/kolibri/{Alert-CTk_PNsB.js → Alert-Bbh--qXI.js} +1 -1
  209. package/dist/{esm/Alert-CTk_PNsB.js.map → kolibri/Alert-Bbh--qXI.js.map} +1 -1
  210. package/dist/kolibri/Collapsible-DOVY8in5.js +4 -0
  211. package/dist/kolibri/{Collapsible-C17ZrcR4.js.map → Collapsible-DOVY8in5.js.map} +1 -1
  212. package/dist/kolibri/{CustomSuggestionsToggle-DlW7BYA_.js → CustomSuggestionsToggle-CI52XOED.js} +1 -1
  213. package/dist/{esm/CustomSuggestionsToggle-DlW7BYA_.js.map → kolibri/CustomSuggestionsToggle-CI52XOED.js.map} +1 -1
  214. package/dist/kolibri/{FieldControlStateWrapper-Bvn5yK_i.js → FieldControlStateWrapper-CwL_BkST.js} +1 -1
  215. package/dist/{esm/FieldControlStateWrapper-Bvn5yK_i.js.map → kolibri/FieldControlStateWrapper-CwL_BkST.js.map} +1 -1
  216. package/dist/kolibri/{FormFieldStateWrapper-j7e0a3Oe.js → FormFieldStateWrapper-CCkAqaaL.js} +1 -1
  217. package/dist/kolibri/{FormFieldStateWrapper-j7e0a3Oe.js.map → FormFieldStateWrapper-CCkAqaaL.js.map} +1 -1
  218. package/dist/kolibri/{Heading-CdL171uD.js → Heading-BYeuylXc.js} +1 -1
  219. package/dist/{esm/Heading-CdL171uD.js.map → kolibri/Heading-BYeuylXc.js.map} +1 -1
  220. package/dist/kolibri/Icon-BttEGYV4.js +4 -0
  221. package/dist/kolibri/{Icon-BFZ6Qv6o.js.map → Icon-BttEGYV4.js.map} +1 -1
  222. package/dist/kolibri/Input-By5qTQCO.js +4 -0
  223. package/dist/{esm/Input-DnQOLdqt.js.map → kolibri/Input-By5qTQCO.js.map} +1 -1
  224. package/dist/kolibri/{InputStateWrapper-uyLppe6O.js → InputStateWrapper-DuA_SJ6D.js} +1 -1
  225. package/dist/{esm/InputStateWrapper-uyLppe6O.js.map → kolibri/InputStateWrapper-DuA_SJ6D.js.map} +1 -1
  226. package/dist/kolibri/{InternalUnderlinedBadgeText-BTlxPf6n.js → InternalUnderlinedBadgeText-CRfceIpy.js} +1 -1
  227. package/dist/kolibri/{InternalUnderlinedBadgeText-BTlxPf6n.js.map → InternalUnderlinedBadgeText-CRfceIpy.js.map} +1 -1
  228. package/dist/kolibri/Span-Bgdwx7W2.js +4 -0
  229. package/dist/{esm/Span-CLrfUTlO.js.map → kolibri/Span-Bgdwx7W2.js.map} +1 -1
  230. package/dist/kolibri/app-globals-BDBwpueJ.js +4 -0
  231. package/dist/kolibri/{app-globals-Bb7SxAXn.js.map → app-globals-BDBwpueJ.js.map} +1 -1
  232. package/dist/kolibri/{controller-DwYQijEB.js → controller-Bir1vcn8.js} +1 -1
  233. package/dist/{esm/controller-DwYQijEB.js.map → kolibri/controller-Bir1vcn8.js.map} +1 -1
  234. package/dist/kolibri/{controller-DiV1ch6R.js → controller-C95620Yo.js} +1 -1
  235. package/dist/kolibri/{controller-DiV1ch6R.js.map → controller-C95620Yo.js.map} +1 -1
  236. package/dist/kolibri/{controller-Cz0hl43b.js → controller-Cdvx9cUf.js} +1 -1
  237. package/dist/kolibri/{controller-Cz0hl43b.js.map → controller-Cdvx9cUf.js.map} +1 -1
  238. package/dist/kolibri/{controller-icon-D8NyK7bc.js → controller-icon-LXybyI6W.js} +1 -1
  239. package/dist/kolibri/{controller-icon-D8NyK7bc.js.map → controller-icon-LXybyI6W.js.map} +1 -1
  240. package/dist/kolibri/{dev.utils-B25txGhq.js → dev.utils-vAdYjvGq.js} +1 -1
  241. package/dist/{esm/dev.utils-B25txGhq.js.map → kolibri/dev.utils-vAdYjvGq.js.map} +1 -1
  242. package/dist/kolibri/{devtools-DiehHGXn.js → devtools-d011w8ez.js} +1 -1
  243. package/dist/{esm/devtools-DiehHGXn.js.map → kolibri/devtools-d011w8ez.js.map} +1 -1
  244. package/dist/kolibri/{index-BwHVuv1c.js → index-DTM8XbOu.js} +2 -2
  245. package/dist/kolibri/{index-BwHVuv1c.js.map → index-DTM8XbOu.js.map} +1 -1
  246. package/dist/kolibri/kol-abbr.entry.js +1 -1
  247. package/dist/kolibri/kol-accordion.entry.js +1 -1
  248. package/dist/kolibri/kol-alert-wc.entry.js +1 -1
  249. package/dist/kolibri/kol-alert.entry.js +1 -1
  250. package/dist/kolibri/kol-avatar-wc.entry.js +1 -1
  251. package/dist/kolibri/kol-avatar.entry.js +1 -1
  252. package/dist/kolibri/kol-badge.entry.js +1 -1
  253. package/dist/kolibri/kol-breadcrumb.entry.js +1 -1
  254. package/dist/kolibri/kol-button-link.entry.js +1 -1
  255. package/dist/kolibri/kol-button-wc.entry.js +1 -1
  256. package/dist/kolibri/kol-button.entry.js +1 -1
  257. package/dist/kolibri/kol-card-wc.entry.js +1 -1
  258. package/dist/kolibri/kol-card.entry.js +1 -1
  259. package/dist/kolibri/kol-combobox.entry.js +1 -1
  260. package/dist/kolibri/kol-details.entry.js +1 -1
  261. package/dist/kolibri/kol-drawer.entry.js +1 -1
  262. package/dist/kolibri/kol-form.entry.js +1 -1
  263. package/dist/kolibri/kol-heading.entry.js +1 -1
  264. package/dist/kolibri/kol-icon.entry.js +1 -1
  265. package/dist/kolibri/kol-image.entry.js +1 -1
  266. package/dist/kolibri/kol-input-checkbox.entry.js +1 -1
  267. package/dist/kolibri/kol-input-color.entry.js +1 -1
  268. package/dist/kolibri/kol-input-date.entry.js +1 -1
  269. package/dist/kolibri/kol-input-email.entry.js +1 -1
  270. package/dist/kolibri/kol-input-file.entry.js +1 -1
  271. package/dist/kolibri/kol-input-number.entry.js +1 -1
  272. package/dist/kolibri/kol-input-password.entry.js +1 -1
  273. package/dist/kolibri/kol-input-radio.entry.js +1 -1
  274. package/dist/kolibri/kol-input-range.entry.js +1 -1
  275. package/dist/kolibri/kol-input-text.entry.js +1 -1
  276. package/dist/kolibri/kol-kolibri.entry.js +1 -1
  277. package/dist/kolibri/kol-link-button.entry.js +1 -1
  278. package/dist/kolibri/kol-link-wc.entry.js +1 -1
  279. package/dist/kolibri/kol-link-wc.entry.js.map +1 -1
  280. package/dist/kolibri/kol-link.entry.js +1 -1
  281. package/dist/kolibri/kol-modal.entry.js +1 -1
  282. package/dist/kolibri/kol-nav.entry.js +1 -1
  283. package/dist/kolibri/kol-pagination-wc.entry.js +1 -1
  284. package/dist/kolibri/kol-pagination.entry.js +1 -1
  285. package/dist/kolibri/kol-popover-button-wc.entry.js +1 -1
  286. package/dist/kolibri/kol-popover-button.entry.js +1 -1
  287. package/dist/kolibri/kol-popover-wc.entry.js +1 -1
  288. package/dist/kolibri/kol-progress.entry.js +1 -1
  289. package/dist/kolibri/kol-quote.entry.js +1 -1
  290. package/dist/kolibri/kol-select.entry.js +1 -1
  291. package/dist/kolibri/kol-single-select.entry.js +1 -1
  292. package/dist/kolibri/kol-skip-nav.entry.js +1 -1
  293. package/dist/kolibri/kol-spin.entry.js +1 -1
  294. package/dist/kolibri/kol-split-button.entry.js +1 -1
  295. package/dist/kolibri/kol-table-settings-wc.entry.js +1 -1
  296. package/dist/kolibri/kol-table-stateful.entry.js +1 -1
  297. package/dist/kolibri/kol-table-stateless-wc.entry.js +1 -1
  298. package/dist/kolibri/kol-table-stateless.entry.js +1 -1
  299. package/dist/kolibri/kol-tabs.entry.js +1 -1
  300. package/dist/kolibri/kol-textarea.entry.js +1 -1
  301. package/dist/kolibri/kol-toast-container.entry.js +1 -1
  302. package/dist/kolibri/kol-toolbar.entry.js +1 -1
  303. package/dist/kolibri/kol-tooltip-wc.entry.js +1 -1
  304. package/dist/kolibri/kol-tree-item-wc.entry.js +1 -1
  305. package/dist/kolibri/kol-tree-item.entry.js +1 -1
  306. package/dist/kolibri/kol-tree-wc.entry.js +1 -1
  307. package/dist/kolibri/kol-tree.entry.js +1 -1
  308. package/dist/kolibri/kol-version.entry.js +1 -1
  309. package/dist/kolibri/kolibri.esm.js +1 -1
  310. package/dist/kolibri/test-component.entry.js +1 -1
  311. package/package.json +1 -1
  312. package/dist/cjs/Span-R1KVY7GP.js +0 -4
  313. package/dist/esm/Span-CLrfUTlO.js +0 -4
  314. package/dist/kolibri/Collapsible-C17ZrcR4.js +0 -4
  315. package/dist/kolibri/Icon-BFZ6Qv6o.js +0 -4
  316. package/dist/kolibri/Input-DnQOLdqt.js +0 -4
  317. package/dist/kolibri/Span-CLrfUTlO.js +0 -4
  318. package/dist/kolibri/app-globals-Bb7SxAXn.js +0 -4
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * KoliBri - The accessible HTML-Standard
3
3
  */
4
- import{r as registerInstance,h,F as Fragment,g as getElement}from"./index-BwHVuv1c.js";import{c as clsx}from"./clsx-eK3rPvPS.js";import{e as KolIconTag,a as KolTooltipWcTag,d as KolButtonWcTag,w as KolTableSettingsWcTag}from"./component-names-CkE54Ym7.js";import{t as translate}from"./i18n-yBVLeHdv.js";import{O as emptyStringByArrayHandler,o as objectObjectHandler,p as parseJson,w as watchValidator,s as setState}from"./common-7RW_NFNf.js";import{v as validateLabel}from"./label-DAfXJvJZ.js";import{v as validateTableData,a as validateTableDataFoot,e as validateTableCallbacks,b as validateTableSelection,d as validateTableSettings}from"./table-settings-CC1LSsqS.js";import{C as Callback}from"./keyboard-D6PoWr38.js";import{n as nonce}from"./dev.utils-B25txGhq.js";import{d as dispatchDomEvent,K as KolEvent}from"./events-CoPFQEiC.js";import{i as isObject,c as baseGetTag,r as root,a as isObjectLike,f as freeGlobal,b as isArray,S as Symbol}from"./isObject-DvSELytj.js";import"./i18n-CjhRejiw.js";const validateTableHeaderCells=(e,t)=>{emptyStringByArrayHandler(t,(()=>{objectObjectHandler(t,(()=>{try{t=parseJson(t)}catch(e){}watchValidator(e,"_headerCells",(e=>"object"==typeof e&&null!==e&&(void 0===e.horizontal||Array.isArray(e.horizontal)&&void 0===e.horizontal.find((e=>!Array.isArray(e))))&&(void 0===e.vertical||Array.isArray(e.vertical)&&void 0===e.vertical.find((e=>!Array.isArray(e))))&&!0),new Set(["TableHeaderCellsPropType"]),t)}))}))};var asyncTag="[object AsyncFunction]",funcTag$1="[object Function]",genTag="[object GeneratorFunction]",proxyTag="[object Proxy]";function isFunction(e){if(!isObject(e))return!1;var t=baseGetTag(e);return t==funcTag$1||t==genTag||t==asyncTag||t==proxyTag}var coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var e=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function isMasked(e){return!!maskSrcKey&&maskSrcKey in e}var funcProto$1=Function.prototype,funcToString$1=funcProto$1.toString;function toSource(e){if(null!=e){try{return funcToString$1.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reIsHostCtor=/^\[object .+?Constructor\]$/,funcProto=Function.prototype,objectProto$9=Object.prototype,funcToString=funcProto.toString,hasOwnProperty$7=objectProto$9.hasOwnProperty,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty$7).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function baseIsNative(e){return!(!isObject(e)||isMasked(e))&&(isFunction(e)?reIsNative:reIsHostCtor).test(toSource(e))}function getValue(e,t){return null==e?void 0:e[t]}function getNative(e,t){var a=getValue(e,t);return baseIsNative(a)?a:void 0}var WeakMap=getNative(root,"WeakMap"),MAX_SAFE_INTEGER$1=9007199254740991,reIsUint=/^(?:0|[1-9]\d*)$/;function isIndex(e,t){var a=typeof e;return!!(t=null==t?MAX_SAFE_INTEGER$1:t)&&("number"==a||"symbol"!=a&&reIsUint.test(e))&&e>-1&&e%1==0&&e<t}function eq(e,t){return e===t||e!=e&&t!=t}var MAX_SAFE_INTEGER=9007199254740991;function isLength(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=MAX_SAFE_INTEGER}function isArrayLike(e){return null!=e&&isLength(e.length)&&!isFunction(e)}var objectProto$8=Object.prototype;function isPrototype(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||objectProto$8)}function baseTimes(e,t){for(var a=-1,r=Array(e);++a<e;)r[a]=t(a);return r}var argsTag$2="[object Arguments]";function baseIsArguments(e){return isObjectLike(e)&&baseGetTag(e)==argsTag$2}var objectProto$7=Object.prototype,hasOwnProperty$6=objectProto$7.hasOwnProperty,propertyIsEnumerable$1=objectProto$7.propertyIsEnumerable,isArguments=baseIsArguments(function(){return arguments}())?baseIsArguments:function(e){return isObjectLike(e)&&hasOwnProperty$6.call(e,"callee")&&!propertyIsEnumerable$1.call(e,"callee")};function stubFalse(){return!1}var freeExports$1="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule$1=freeExports$1&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports$1=freeModule$1&&freeModule$1.exports===freeExports$1,Buffer=moduleExports$1?root.Buffer:void 0,nativeIsBuffer=Buffer?Buffer.isBuffer:void 0,isBuffer=nativeIsBuffer||stubFalse,argsTag$1="[object Arguments]",arrayTag$1="[object Array]",boolTag$1="[object Boolean]",dateTag$1="[object Date]",errorTag$1="[object Error]",funcTag="[object Function]",mapTag$2="[object Map]",numberTag$1="[object Number]",objectTag$2="[object Object]",regexpTag$1="[object RegExp]",setTag$2="[object Set]",stringTag$1="[object String]",weakMapTag$1="[object WeakMap]",arrayBufferTag$1="[object ArrayBuffer]",dataViewTag$2="[object DataView]",float32Tag="[object Float32Array]",float64Tag="[object Float64Array]",int8Tag="[object Int8Array]",int16Tag="[object Int16Array]",int32Tag="[object Int32Array]",uint8Tag="[object Uint8Array]",uint8ClampedTag="[object Uint8ClampedArray]",uint16Tag="[object Uint16Array]",uint32Tag="[object Uint32Array]",typedArrayTags={};function baseIsTypedArray(e){return isObjectLike(e)&&isLength(e.length)&&!!typedArrayTags[baseGetTag(e)]}function baseUnary(e){return function(t){return e(t)}}typedArrayTags[float32Tag]=typedArrayTags[float64Tag]=typedArrayTags[int8Tag]=typedArrayTags[int16Tag]=typedArrayTags[int32Tag]=typedArrayTags[uint8Tag]=typedArrayTags[uint8ClampedTag]=typedArrayTags[uint16Tag]=typedArrayTags[uint32Tag]=!0,typedArrayTags[argsTag$1]=typedArrayTags[arrayTag$1]=typedArrayTags[arrayBufferTag$1]=typedArrayTags[boolTag$1]=typedArrayTags[dataViewTag$2]=typedArrayTags[dateTag$1]=typedArrayTags[errorTag$1]=typedArrayTags[funcTag]=typedArrayTags[mapTag$2]=typedArrayTags[numberTag$1]=typedArrayTags[objectTag$2]=typedArrayTags[regexpTag$1]=typedArrayTags[setTag$2]=typedArrayTags[stringTag$1]=typedArrayTags[weakMapTag$1]=!1;var freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{var e=freeModule&&freeModule.require&&freeModule.require("util").types;return e||freeProcess&&freeProcess.binding&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,isTypedArray=nodeIsTypedArray?baseUnary(nodeIsTypedArray):baseIsTypedArray,objectProto$6=Object.prototype,hasOwnProperty$5=objectProto$6.hasOwnProperty;function arrayLikeKeys(e,t){var a=isArray(e),r=!a&&isArguments(e),o=!a&&!r&&isBuffer(e),s=!a&&!r&&!o&&isTypedArray(e),i=a||r||o||s,n=i?baseTimes(e.length,String):[],l=n.length;for(var c in e)!hasOwnProperty$5.call(e,c)||i&&("length"==c||o&&("offset"==c||"parent"==c)||s&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||isIndex(c,l))||n.push(c);return n}function overArg(e,t){return function(a){return e(t(a))}}var nativeKeys=overArg(Object.keys,Object),objectProto$5=Object.prototype,hasOwnProperty$4=objectProto$5.hasOwnProperty;function baseKeys(e){if(!isPrototype(e))return nativeKeys(e);var t=[];for(var a in Object(e))hasOwnProperty$4.call(e,a)&&"constructor"!=a&&t.push(a);return t}function keys(e){return isArrayLike(e)?arrayLikeKeys(e):baseKeys(e)}var nativeCreate=getNative(Object,"create");function hashClear(){this.__data__=nativeCreate?nativeCreate(null):{},this.size=0}function hashDelete(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var HASH_UNDEFINED$2="__lodash_hash_undefined__",objectProto$4=Object.prototype,hasOwnProperty$3=objectProto$4.hasOwnProperty;function hashGet(e){var t=this.__data__;if(nativeCreate){var a=t[e];return a===HASH_UNDEFINED$2?void 0:a}return hasOwnProperty$3.call(t,e)?t[e]:void 0}var objectProto$3=Object.prototype,hasOwnProperty$2=objectProto$3.hasOwnProperty;function hashHas(e){var t=this.__data__;return nativeCreate?void 0!==t[e]:hasOwnProperty$2.call(t,e)}var HASH_UNDEFINED$1="__lodash_hash_undefined__";function hashSet(e,t){var a=this.__data__;return this.size+=this.has(e)?0:1,a[e]=nativeCreate&&void 0===t?HASH_UNDEFINED$1:t,this}function Hash(e){var t=-1,a=null==e?0:e.length;for(this.clear();++t<a;){var r=e[t];this.set(r[0],r[1])}}function listCacheClear(){this.__data__=[],this.size=0}function assocIndexOf(e,t){for(var a=e.length;a--;)if(eq(e[a][0],t))return a;return-1}Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet;var arrayProto=Array.prototype,splice=arrayProto.splice;function listCacheDelete(e){var t=this.__data__,a=assocIndexOf(t,e);return!(a<0)&&(a==t.length-1?t.pop():splice.call(t,a,1),--this.size,!0)}function listCacheGet(e){var t=this.__data__,a=assocIndexOf(t,e);return a<0?void 0:t[a][1]}function listCacheHas(e){return assocIndexOf(this.__data__,e)>-1}function listCacheSet(e,t){var a=this.__data__,r=assocIndexOf(a,e);return r<0?(++this.size,a.push([e,t])):a[r][1]=t,this}function ListCache(e){var t=-1,a=null==e?0:e.length;for(this.clear();++t<a;){var r=e[t];this.set(r[0],r[1])}}ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet;var Map$1=getNative(root,"Map");function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new(Map$1||ListCache),string:new Hash}}function isKeyable(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}function getMapData(e,t){var a=e.__data__;return isKeyable(t)?a["string"==typeof t?"string":"hash"]:a.map}function mapCacheDelete(e){var t=getMapData(this,e).delete(e);return this.size-=t?1:0,t}function mapCacheGet(e){return getMapData(this,e).get(e)}function mapCacheHas(e){return getMapData(this,e).has(e)}function mapCacheSet(e,t){var a=getMapData(this,e),r=a.size;return a.set(e,t),this.size+=a.size==r?0:1,this}function MapCache(e){var t=-1,a=null==e?0:e.length;for(this.clear();++t<a;){var r=e[t];this.set(r[0],r[1])}}function arrayPush(e,t){for(var a=-1,r=t.length,o=e.length;++a<r;)e[o+a]=t[a];return e}function stackClear(){this.__data__=new ListCache,this.size=0}function stackDelete(e){var t=this.__data__,a=t.delete(e);return this.size=t.size,a}function stackGet(e){return this.__data__.get(e)}function stackHas(e){return this.__data__.has(e)}MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet;var LARGE_ARRAY_SIZE=200;function stackSet(e,t){var a=this.__data__;if(a instanceof ListCache){var r=a.__data__;if(!Map$1||r.length<LARGE_ARRAY_SIZE-1)return r.push([e,t]),this.size=++a.size,this;a=this.__data__=new MapCache(r)}return a.set(e,t),this.size=a.size,this}function Stack(e){var t=this.__data__=new ListCache(e);this.size=t.size}function arrayFilter(e,t){for(var a=-1,r=null==e?0:e.length,o=0,s=[];++a<r;){var i=e[a];t(i,a,e)&&(s[o++]=i)}return s}function stubArray(){return[]}Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var objectProto$2=Object.prototype,propertyIsEnumerable=objectProto$2.propertyIsEnumerable,nativeGetSymbols=Object.getOwnPropertySymbols,getSymbols=nativeGetSymbols?function(e){return null==e?[]:(e=Object(e),arrayFilter(nativeGetSymbols(e),(function(t){return propertyIsEnumerable.call(e,t)})))}:stubArray;function baseGetAllKeys(e,t,a){var r=t(e);return isArray(e)?r:arrayPush(r,a(e))}function getAllKeys(e){return baseGetAllKeys(e,keys,getSymbols)}var DataView=getNative(root,"DataView"),Promise$1=getNative(root,"Promise"),Set$1=getNative(root,"Set"),mapTag$1="[object Map]",objectTag$1="[object Object]",promiseTag="[object Promise]",setTag$1="[object Set]",weakMapTag="[object WeakMap]",dataViewTag$1="[object DataView]",dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map$1),promiseCtorString=toSource(Promise$1),setCtorString=toSource(Set$1),weakMapCtorString=toSource(WeakMap),getTag=baseGetTag;(DataView&&getTag(new DataView(new ArrayBuffer(1)))!=dataViewTag$1||Map$1&&getTag(new Map$1)!=mapTag$1||Promise$1&&getTag(Promise$1.resolve())!=promiseTag||Set$1&&getTag(new Set$1)!=setTag$1||WeakMap&&getTag(new WeakMap)!=weakMapTag)&&(getTag=function(e){var t=baseGetTag(e),a=t==objectTag$1?e.constructor:void 0,r=a?toSource(a):"";if(r)switch(r){case dataViewCtorString:return dataViewTag$1;case mapCtorString:return mapTag$1;case promiseCtorString:return promiseTag;case setCtorString:return setTag$1;case weakMapCtorString:return weakMapTag}return t});var Uint8Array=root.Uint8Array,HASH_UNDEFINED="__lodash_hash_undefined__";function setCacheAdd(e){return this.__data__.set(e,HASH_UNDEFINED),this}function setCacheHas(e){return this.__data__.has(e)}function SetCache(e){var t=-1,a=null==e?0:e.length;for(this.__data__=new MapCache;++t<a;)this.add(e[t])}function arraySome(e,t){for(var a=-1,r=null==e?0:e.length;++a<r;)if(t(e[a],a,e))return!0;return!1}function cacheHas(e,t){return e.has(t)}SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas;var COMPARE_PARTIAL_FLAG$3=1,COMPARE_UNORDERED_FLAG$1=2;function equalArrays(e,t,a,r,o,s){var i=a&COMPARE_PARTIAL_FLAG$3,n=e.length,l=t.length;if(n!=l&&!(i&&l>n))return!1;var c=s.get(e),h=s.get(t);if(c&&h)return c==t&&h==e;var d=-1,u=!0,b=a&COMPARE_UNORDERED_FLAG$1?new SetCache:void 0;for(s.set(e,t),s.set(t,e);++d<n;){var p=e[d],y=t[d];if(r)var g=i?r(y,p,d,t,e,s):r(p,y,d,e,t,s);if(void 0!==g){if(g)continue;u=!1;break}if(b){if(!arraySome(t,(function(e,t){if(!cacheHas(b,t)&&(p===e||o(p,e,a,r,s)))return b.push(t)}))){u=!1;break}}else if(p!==y&&!o(p,y,a,r,s)){u=!1;break}}return s.delete(e),s.delete(t),u}function mapToArray(e){var t=-1,a=Array(e.size);return e.forEach((function(e,r){a[++t]=[r,e]})),a}function setToArray(e){var t=-1,a=Array(e.size);return e.forEach((function(e){a[++t]=e})),a}var COMPARE_PARTIAL_FLAG$2=1,COMPARE_UNORDERED_FLAG=2,boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",mapTag="[object Map]",numberTag="[object Number]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0;function equalByTag(e,t,a,r,o,s,i){switch(a){case dataViewTag:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case arrayBufferTag:return!(e.byteLength!=t.byteLength||!s(new Uint8Array(e),new Uint8Array(t)));case boolTag:case dateTag:case numberTag:return eq(+e,+t);case errorTag:return e.name==t.name&&e.message==t.message;case regexpTag:case stringTag:return e==t+"";case mapTag:var n=mapToArray;case setTag:var l=r&COMPARE_PARTIAL_FLAG$2;if(n||(n=setToArray),e.size!=t.size&&!l)return!1;var c=i.get(e);if(c)return c==t;r|=COMPARE_UNORDERED_FLAG,i.set(e,t);var h=equalArrays(n(e),n(t),r,o,s,i);return i.delete(e),h;case symbolTag:if(symbolValueOf)return symbolValueOf.call(e)==symbolValueOf.call(t)}return!1}var COMPARE_PARTIAL_FLAG$1=1,objectProto$1=Object.prototype,hasOwnProperty$1=objectProto$1.hasOwnProperty;function equalObjects(e,t,a,r,o,s){var i=a&COMPARE_PARTIAL_FLAG$1,n=getAllKeys(e),l=n.length;if(l!=getAllKeys(t).length&&!i)return!1;for(var c=l;c--;){var h=n[c];if(!(i?h in t:hasOwnProperty$1.call(t,h)))return!1}var d=s.get(e),u=s.get(t);if(d&&u)return d==t&&u==e;var b=!0;s.set(e,t),s.set(t,e);for(var p=i;++c<l;){var y=e[h=n[c]],g=t[h];if(r)var f=i?r(g,y,h,t,e,s):r(y,g,h,e,t,s);if(!(void 0===f?y===g||o(y,g,a,r,s):f)){b=!1;break}p||(p="constructor"==h)}if(b&&!p){var v=e.constructor,_=t.constructor;v==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof v&&v instanceof v&&"function"==typeof _&&_ instanceof _||(b=!1)}return s.delete(e),s.delete(t),b}var COMPARE_PARTIAL_FLAG=1,argsTag="[object Arguments]",arrayTag="[object Array]",objectTag="[object Object]",objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty;function baseIsEqualDeep(e,t,a,r,o,s){var i=isArray(e),n=isArray(t),l=i?arrayTag:getTag(e),c=n?arrayTag:getTag(t),h=(l=l==argsTag?objectTag:l)==objectTag,d=(c=c==argsTag?objectTag:c)==objectTag,u=l==c;if(u&&isBuffer(e)){if(!isBuffer(t))return!1;i=!0,h=!1}if(u&&!h)return s||(s=new Stack),i||isTypedArray(e)?equalArrays(e,t,a,r,o,s):equalByTag(e,t,l,a,r,o,s);if(!(a&COMPARE_PARTIAL_FLAG)){var b=h&&hasOwnProperty.call(e,"__wrapped__"),p=d&&hasOwnProperty.call(t,"__wrapped__");if(b||p){var y=b?e.value():e,g=p?t.value():t;return s||(s=new Stack),o(y,g,a,r,s)}}return!!u&&(s||(s=new Stack),equalObjects(e,t,a,r,o,s))}function baseIsEqual(e,t,a,r,o){return e===t||(null==e||null==t||!isObjectLike(e)&&!isObjectLike(t)?e!=e&&t!=t:baseIsEqualDeep(e,t,a,r,baseIsEqual,o))}function isEqual(e,t){return baseIsEqual(e,t)}const HEADER_CELL_WIDTH_VALIDATOR=/^\d+(\.\d+)?([a-z]+|%)?$/,validateMinWidth=(e,t,a)=>{watchValidator(e,"_minWidth",(e=>"string"==typeof e&&HEADER_CELL_WIDTH_VALIDATOR.test(e)),new Set(["String","/^\\d+(\\.\\d+)?([a-z]+|%)?$/"]),t,a)},KolTableStateless=class{constructor(e){registerInstance(this,e),this.translateNoEntries=translate("kol-no-entries"),this.state={_data:[],_headerCells:{horizontal:[],vertical:[]},_label:"",_minWidth:"auto"},this.horizontal=!0,this.cellsToRenderTimeouts=new Map,this.dataToKeyMap=new Map,this.checkboxRefs=[],this.translateSort=translate("kol-sort"),this.tableDivElementHasScrollbar=!1,this.renderTableRow=(e,t,a,r=!1)=>{var o,s;let i=String(t);return this.horizontal&&(null===(o=e[0])||void 0===o?void 0:o.data)&&(i=null!==(s=this.getDataKey(e[0].data))&&void 0!==s?s:i),h("tr",{class:clsx("kol-table__row",{"kol-table__row--body":!r,"kol-table__row--footer":r}),key:`row-${i}`},this.renderSelectionCell(e,t),e.map(((e,r)=>this.renderTableCell(e,t,r,a))))},this.renderTableCell=(e,t,a,r)=>{const o=this.getColumnSettings(e);if(o&&!o.visible)return"";let s=`${t}-${a}-${e.label}`;if(e.data){const r=this.getDataKey(e.data);s=r?`${r}-${this.horizontal?a:t}`:s}return e.headerCell?this.renderHeadingCell(e,t,a,r):h("td",{key:`cell-${s}`,class:clsx("kol-table__cell kol-table__cell--body",{[`kol-table__cell--align-${e.textAlign}`]:e.textAlign}),colSpan:e.colSpan,rowSpan:e.rowSpan,style:{textAlign:e.textAlign,width:(null==o?void 0:o.width)?`${o.width}ch`:e.width},ref:"function"==typeof e.render?t=>{this.cellRender(e,t)}:void 0},"function"!=typeof e.render?e.label:"")}}validateData(e){validateTableData(this,e,{beforePatch:e=>{this.updateDataToKeyMap(e)}})}validateDataFoot(e){validateTableDataFoot(this,e)}validateHeaderCells(e){validateTableHeaderCells(this,e),isEqual(this.previousHeaderCells,this.state._headerCells)||this.initializeTableSettings(),this.previousHeaderCells=this.state._headerCells}validateLabel(e){validateLabel(this,e,{required:!0})}validateMinWidth(e){validateMinWidth(this,e)}validateOn(e){validateTableCallbacks(this,e)}validateSelection(e){validateTableSelection(this,e)}validateTableSettings(e){validateTableSettings(this,e)}handleKeyDown(e){var t;if("ArrowUp"===e.key||"ArrowDown"===e.key){const a=null===(t=this.tableDivElement)||void 0===t?void 0:t.querySelector(":focus");let r=this.checkboxRefs.indexOf(a);r>-1&&(e.preventDefault(),"ArrowDown"===e.key?(r=(r+1)%this.checkboxRefs.length,this.checkboxRefs[r].focus()):"ArrowUp"===e.key&&(e.preventDefault(),r=(r+this.checkboxRefs.length-1)%this.checkboxRefs.length,this.checkboxRefs[r].focus()))}}componentDidRender(){this.checkDivElementScrollbar()}componentDidLoad(){this.tableDivElement&&ResizeObserver&&(this.tableDivElementResizeObserver=new ResizeObserver(this.checkDivElementScrollbar.bind(this)),this.tableDivElementResizeObserver.observe(this.tableDivElement))}handleSettingsChange(e){setState(this,"_tableSettings",e.detail)}disconnectedCallback(){var e;null===(e=this.tableDivElementResizeObserver)||void 0===e||e.disconnect()}checkDivElementScrollbar(){this.tableDivElement&&(this.tableDivElementHasScrollbar=this.tableDivElement.scrollWidth>this.tableDivElement.clientWidth)}updateDataToKeyMap(e){e.forEach((e=>{this.dataToKeyMap.has(e)||this.dataToKeyMap.set(e,nonce())})),this.dataToKeyMap.forEach(((t,a)=>{e.includes(a)||this.dataToKeyMap.delete(a)}))}getDataKey(e){return this.dataToKeyMap.get(e)}cellRender(e,t){t&&(clearTimeout(this.cellsToRenderTimeouts.get(t)),this.cellsToRenderTimeouts.set(t,setTimeout((()=>{if("function"==typeof e.render){const a=e.render(t,e,e.data,this.state._data);"string"==typeof a&&(t.textContent=a)}}))))}getNumberOfCols(e,t){let a=0;return e.forEach((e=>{let t=0;Array.isArray(e)&&e.forEach((e=>{var a;return t+=null!==(a=e.colSpan)&&void 0!==a?a:1})),a<t&&(a=t)})),0===a&&(a=t.length),a}getNumberOfRows(e,t){var a;let r=0;return e.forEach((e=>{let t=0;Array.isArray(e)&&e.forEach((e=>{var a;return t+=null!==(a=e.rowSpan)&&void 0!==a?a:1})),r<t&&(r=t)})),0===r?r=t.length:r-=(null===(a=this.state._dataFoot)||void 0===a?void 0:a.length)||0,r}getThePrimaryHeadersWithKeyOrRenderFunction(e){const t=[];return e.forEach((e=>{e.forEach((e=>{"string"!=typeof e.key&&"function"!=typeof e.render||t.push(e)}))})),t}getPrimaryHeaders(e){var t,a;let r=this.getThePrimaryHeadersWithKeyOrRenderFunction(null!==(t=e.horizontal)&&void 0!==t?t:[]);return this.horizontal=!0,0===r.length&&(r=this.getThePrimaryHeadersWithKeyOrRenderFunction(null!==(a=e.vertical)&&void 0!==a?a:[]),r.length>0&&(this.horizontal=!1)),r}getColumnPositionMap(){var e;const t=new Map;return null===(e=this.state._tableSettings)||void 0===e||e.columns.forEach((e=>{t.set(e.key,e.position)})),t}sortByColumnPosition(e){const t=this.getColumnPositionMap();return[...e].sort(((e,a)=>{var r,o,s,i;return(null!==(o=t.get(null!==(r=e.key)&&void 0!==r?r:""))&&void 0!==o?o:Number.MAX_SAFE_INTEGER)-(null!==(i=t.get(null!==(s=a.key)&&void 0!==s?s:""))&&void 0!==i?i:Number.MAX_SAFE_INTEGER)}))}createDataField(e,t,a){var r;t.horizontal=Array.isArray(null==t?void 0:t.horizontal)?t.horizontal:[],t.vertical=Array.isArray(null==t?void 0:t.vertical)?t.vertical:[];const o=this.getPrimaryHeaders(t),s=this.getNumberOfCols(t.horizontal,e);let i=this.getNumberOfRows(t.vertical,e),n=0;a&&(n=i,i+=(null===(r=this.state._dataFoot)||void 0===r?void 0:r.length)||0);const l=[],c=[],h=[];t.vertical.forEach(((e,t)=>{c[t]=0,h[t]=[]}));const d=this.sortByColumnPosition(o);for(let r=n;r<i;r++){const o=[];t.vertical.forEach(((e,t)=>{let a=0;if(h[t].forEach((e=>a+=e)),a<=r){const s=e[r-a+c[t]];if("object"==typeof s){o.push(Object.assign(Object.assign({},s),{headerCell:!0,data:{}}));let e=1;if("number"==typeof s.rowSpan&&s.rowSpan>1&&(e=s.rowSpan),h[t].push(e),"number"==typeof s.colSpan&&s.colSpan>1)for(let a=1;a<s.colSpan;a++)h[t+a].push(e);c[t]++}}}));for(let t=0;t<s;t++)if(!0===this.horizontal){const s=a&&this.state._dataFoot?this.state._dataFoot[r-n]:e[r];"object"!=typeof d[t]||null===d[t]||"object"!=typeof s||null===s||"string"!=typeof d[t].key&&"function"!=typeof d[t].render||o.push(Object.assign(Object.assign({},d[t]),{colSpan:void 0,data:s,label:s[d[t].key],rowSpan:void 0}))}else"object"!=typeof d[r]||null===d[r]||"object"!=typeof e[t]||null===e[t]||"string"!=typeof d[r].key&&"function"!=typeof d[r].render||o.push(Object.assign(Object.assign({},d[r]),{colSpan:void 0,data:e[t],label:e[t][d[r].key],rowSpan:void 0}));l.push(o)}if(0===e.length){let e=0,a=0;Array.isArray(t.horizontal)&&t.horizontal.length>0&&t.horizontal[0].forEach((t=>{e+=t.colSpan||1})),Array.isArray(t.vertical)&&t.vertical.length>0&&(e-=t.vertical.length,t.vertical[0].forEach((e=>{a+=e.rowSpan||1})));const r={colSpan:e,label:this.translateNoEntries,render:void 0,rowSpan:Math.max(a,1)};0===l.length?l.push([r]):l[0].push(r)}return l}handleSelectionChangeCallbackAndEvent(e,t){var a;"function"==typeof(null===(a=this.state._on)||void 0===a?void 0:a[Callback.onSelectionChange])&&this.state._on[Callback.onSelectionChange](e,t),this.host&&dispatchDomEvent(this.host,KolEvent.selectionChange,t)}initializeTableSettings(){if(this._tableSettings)return;const e=this.getPrimaryHeaders(this.state._headerCells);this.state._tableSettings||(this.state._tableSettings={columns:[]}),this.state._tableSettings.columns=e.filter((e=>e.key)).map(((e,t)=>{var a;return{key:null!==(a=e.key)&&void 0!==a?a:nonce(),label:e.label,position:t,visible:!0}}))}componentWillLoad(){this.validateData(this._data),this.validateDataFoot(this._dataFoot),this.validateHeaderCells(this._headerCells),this.validateLabel(this._label),this.validateMinWidth(this._minWidth),this.validateOn(this._on),this.validateSelection(this._selection),this.validateTableSettings(this._tableSettings)}renderSelectionCell(e,t){var a,r,o;const s=this.state._selection;if(!s)return"";const i=this.getSelectionKeyPropertyName(),n=null===(a=e[0])||void 0===a?void 0:a.data;if(!n)return"";const l=n[i],c=s.multiple||void 0===s.multiple,d=null===(r=null==s?void 0:s.selectedKeys)||void 0===r?void 0:r.includes(l),u=null===(o=null==s?void 0:s.disabledKeys)||void 0===o?void 0:o.includes(l),b=s.label(n),p={name:"selection",checked:d,disabled:u,id:l,"aria-label":b};return h("td",{key:`tbody-${t}-selection`,class:"kol-table__cell kol-table__cell--selection"},h("div",{class:clsx("kol-table__selection",{"kol-table__selection--checked":d})},c?h("label",{class:clsx("kol-table__selection-label",{"kol-table__selection-label--disabled":u})},h(KolIconTag,{class:"kol-table__selection-icon",_icons:"codicon "+(d?"codicon-check":""),_label:""}),h("input",Object.assign({class:clsx("kol-table__selection-input kol-table__selection-input--checkbox"),ref:e=>e&&this.checkboxRefs.push(e)},p,{type:"checkbox",onInput:e=>{var t,a;const r=d?null===(a=null==s?void 0:s.selectedKeys)||void 0===a?void 0:a.filter((e=>e!==l)):[...null!==(t=null==s?void 0:s.selectedKeys)&&void 0!==t?t:[],l];this.handleSelectionChangeCallbackAndEvent(e,null!=r?r:[])}}))):h("label",{class:"kol-table__selection-label"},h("input",Object.assign({class:clsx("kol-table__selection-input kol-table__selection-input--radio")},p,{type:"radio",onInput:e=>{this.handleSelectionChangeCallbackAndEvent(e,l)}}))),h(KolTooltipWcTag,{"aria-hidden":"true",class:"kol-table__selection-input-tooltip",_align:"right",_id:`${l}-label`,_label:b})))}getColumnSettings(e){var t;return null===(t=this.state._tableSettings)||void 0===t?void 0:t.columns.find((t=>t.key===e.key))}getSelectionKeyPropertyName(){var e,t;return null!==(t=null===(e=this.state._selection)||void 0===e?void 0:e.keyPropertyName)&&void 0!==t?t:"id"}getDataWithSelectionEnabled(){const e=this.getSelectionKeyPropertyName();return this.state._data.filter((t=>{var a,r;return!(null===(r=null===(a=this.state._selection)||void 0===a?void 0:a.disabledKeys)||void 0===r?void 0:r.includes(t[e]))}))}getSelectedKeysWithoutDisabledKeys(){var e,t;return null===(t=null===(e=this.state._selection)||void 0===e?void 0:e.selectedKeys)||void 0===t?void 0:t.filter((e=>{var t,a;return!(null===(a=null===(t=this.state._selection)||void 0===t?void 0:t.disabledKeys)||void 0===a?void 0:a.includes(e))}))}getSelectedKeysWithDisabledKeysOnly(){var e,t;return null===(t=null===(e=this.state._selection)||void 0===e?void 0:e.selectedKeys)||void 0===t?void 0:t.filter((e=>{var t,a;return null===(a=null===(t=this.state._selection)||void 0===t?void 0:t.disabledKeys)||void 0===a?void 0:a.includes(e)}))}getRevertedSelection(e){var t;const a=this.getSelectionKeyPropertyName(),r=null!==(t=this.getSelectedKeysWithDisabledKeysOnly())&&void 0!==t?t:[];return e&&r.push(...this.getDataWithSelectionEnabled().map((e=>null==e?void 0:e[a]))),r}getTableMinWidth(){var e,t;const a=null!==(t=null===(e=this.state._tableSettings)||void 0===e?void 0:e.columns.filter((e=>e.visible)).reduce(((e,t)=>{var a;return e+(null!==(a=t.width)&&void 0!==a?a:0)}),0))&&void 0!==t?t:0;return"auto"===this.state._minWidth?`${a}ch`:`max(${this.state._minWidth}, ${a}ch)`}renderHeadingSelectionCell(){var e,t;const a=this.state._selection;if(!a||!a.multiple&&void 0!==a.multiple)return h("th",{class:"kol-table__cell kol-table__cell--header",key:"thead-0"});const r=null!==(t=null===(e=this.getSelectedKeysWithoutDisabledKeys())||void 0===e?void 0:e.length)&&void 0!==t?t:0,o=r===this.getDataWithSelectionEnabled().length,s=0!==r&&!o;let i="kol-table-selection-indeterminate";o&&!s&&(i="kol-table-selection-none"),0===r&&(i="kol-table-selection-all");const n=translate(i);return h("th",{key:"thead-0-selection",class:"kol-table__cell kol-table__cell--header"},h("div",{class:clsx("kol-table__selection",{"kol-table__selection--indeterminate":s,"kol-table__selection--checked":o})},h("label",{class:"kol-table__selection-label"},h(KolIconTag,{class:"kol-table__selection-icon",_icons:"codicon "+(s?"codicon-remove":o?"codicon-check":""),_label:""}),h("input",{class:clsx("kol-table__selection-input kol-table__selection-input--checkbox"),"data-testid":"selection-checkbox-all",ref:e=>e&&this.checkboxRefs.push(e),name:"selection",checked:o&&!s,indeterminate:s,"aria-label":n,type:"checkbox",onInput:e=>{this.handleSelectionChangeCallbackAndEvent(e,this.getRevertedSelection(!o))}})),h(KolTooltipWcTag,{"aria-hidden":"true",class:"kol-table__selection-input-tooltip",_align:"right",_id:`${i}-label`,_label:n})))}renderHeaderTdCell(){return h(Fragment,null,Array.isArray(this.state._headerCells.horizontal)&&this.state._headerCells.horizontal.length>0&&Array.isArray(this.state._headerCells.vertical)&&this.state._headerCells.vertical.length>0&&Array.isArray(this.state._headerCells.horizontal)&&h("td",{"aria-hidden":"true",colSpan:this.state._headerCells.vertical.length,rowSpan:this.state._headerCells.horizontal.length}))}renderHeadingCell(e,t,a,r){const o=this.getColumnSettings(e);if(o&&!o.visible)return"";let s="none",i="codicon codicon-fold";if(e.sortDirection)switch(e.sortDirection){case"ASC":i="codicon codicon-chevron-up",s="ascending";break;case"DESC":i="codicon codicon-chevron-down",s="descending";break;default:s="none"}const n=r?"row":"number"==typeof e.colSpan&&e.colSpan>1?"colgroup":"col";return h("th",{key:`${t}-${a}-${e.label}`,class:clsx("kol-table__cell kol-table__cell--header",{[`kol-table__cell--align-${e.textAlign}`]:e.textAlign,[`kol-table__cell--${s}`]:s}),scope:n,colSpan:e.colSpan,rowSpan:e.rowSpan,style:{width:(null==o?void 0:o.width)?`${o.width}ch`:e.width},"aria-sort":s,"data-sort":`sort-${e.sortDirection}`},e.sortDirection?h(KolButtonWcTag,{class:"kol-table__sort-button",exportparts:"icon",_icons:{right:i},_label:e.label,_ariaDescription:this.translateSort,_on:{onClick:t=>{var a;"function"==typeof(null===(a=this.state._on)||void 0===a?void 0:a.onSort)&&e.key&&e.sortDirection&&this.state._on.onSort(t,{key:e.key,currentSortDirection:e.sortDirection}),this.host&&dispatchDomEvent(this.host,KolEvent.sort,{key:e.key,currentSortDirection:e.sortDirection})}}}):e.label)}renderSpacer(e,t){var a,r;const o=(null===(a=this.state._headerCells.vertical)||void 0===a?void 0:a.length)||0,s=null===(r=null==t?void 0:t[0])||void 0===r?void 0:r.reduce(((e,t)=>e+(t.colSpan||1)),0),i=this.state._selection?1:0;return h("tr",{"aria-hidden":"true",class:clsx("kol-table__spacer",`kol-table__spacer--${e}`)},h("td",{class:clsx(`kol-table__spacer-line kol-table__spacer-line--${e}`),colSpan:o+s+i}))}renderFoot(){if(!this.state._dataFoot||0===this.state._dataFoot.length)return null;const e=this.createDataField(this.state._dataFoot,this.state._headerCells,!0);return h("tfoot",{class:"kol-table__footer"},[this.renderSpacer("foot",e),e.map(((e,t)=>this.renderTableRow(e,t,!0,!0)))])}render(){var e;const t=this.createDataField(this.state._data,this.state._headerCells);this.checkboxRefs=[];const a=null===(e=this.state._headerCells.horizontal)||void 0===e?void 0:e.map((e=>this.sortByColumnPosition(e)));return h("div",{key:"f81983e551d1e41281aa41ec2394ec08267fe6a0",class:"kol-table"},h(KolTableSettingsWcTag,{key:"ba42966556deec90ef308fe6f78a863dc02a1e5a",_tableSettings:this.state._tableSettings}),h("div",{key:"a91ceb385d449db182d233c35761c1554c89f72f",ref:e=>this.tableDivElement=e,class:"kol-table__scroll-container",tabindex:this.tableDivElementHasScrollbar?"-1":void 0},h("table",{key:"9f917d159b62dbde6b9fb46766530fd4ee26a29f",class:"kol-table__table",style:{minWidth:this.getTableMinWidth()}},h("div",{key:"07945a7045943e54524e0acff2ad96ecfafc6be8",class:"kol-table__focus-element",tabindex:this.tableDivElementHasScrollbar?"0":void 0,"aria-describedby":"caption"}," "),h("caption",{key:"bb21eb4c05d126477e7e751c9a8c3f83fc70a672",class:"kol-table__caption",id:"caption"},this.state._label),Array.isArray(a)&&h("thead",{key:"439c92996fccdc4be1e792e68b5ec91b57b18b0d",class:"kol-table__head"},[a.map(((e,t)=>h("tr",{class:"kol-table__head-row",key:`thead-${t}`},this.state._selection&&this.renderHeadingSelectionCell(),0===t&&this.renderHeaderTdCell(),Array.isArray(e)&&e.map(((e,a)=>this.renderHeadingCell(e,t,a,!1)))))),this.renderSpacer("head",a)]),h("tbody",{key:"92f3bb34b30d1515c8aac05910280b4025f98a3d",class:"kol-table__body"},t.map(((e,t)=>this.renderTableRow(e,t,!0)))),this.renderFoot())))}get host(){return getElement(this)}static get watchers(){return{_data:["validateData"],_dataFoot:["validateDataFoot"],_headerCells:["validateHeaderCells"],_label:["validateLabel"],_minWidth:["validateMinWidth"],_on:["validateOn"],_selection:["validateSelection"],_tableSettings:["validateTableSettings"]}}};export{KolTableStateless as kol_table_stateless_wc};
4
+ import{r as registerInstance,h,F as Fragment,g as getElement}from"./index-DTM8XbOu.js";import{c as clsx}from"./clsx-eK3rPvPS.js";import{e as KolIconTag,a as KolTooltipWcTag,d as KolButtonWcTag,w as KolTableSettingsWcTag}from"./component-names-CkE54Ym7.js";import{t as translate}from"./i18n-yBVLeHdv.js";import{O as emptyStringByArrayHandler,o as objectObjectHandler,p as parseJson,w as watchValidator,s as setState}from"./common-7RW_NFNf.js";import{v as validateLabel}from"./label-DAfXJvJZ.js";import{v as validateTableData,a as validateTableDataFoot,e as validateTableCallbacks,b as validateTableSelection,d as validateTableSettings}from"./table-settings-CC1LSsqS.js";import{C as Callback}from"./keyboard-D6PoWr38.js";import{n as nonce}from"./dev.utils-vAdYjvGq.js";import{d as dispatchDomEvent,K as KolEvent}from"./events-CoPFQEiC.js";import{i as isObject,c as baseGetTag,r as root,a as isObjectLike,f as freeGlobal,b as isArray,S as Symbol}from"./isObject-DvSELytj.js";import"./i18n-CjhRejiw.js";const validateTableHeaderCells=(e,t)=>{emptyStringByArrayHandler(t,(()=>{objectObjectHandler(t,(()=>{try{t=parseJson(t)}catch(e){}watchValidator(e,"_headerCells",(e=>"object"==typeof e&&null!==e&&(void 0===e.horizontal||Array.isArray(e.horizontal)&&void 0===e.horizontal.find((e=>!Array.isArray(e))))&&(void 0===e.vertical||Array.isArray(e.vertical)&&void 0===e.vertical.find((e=>!Array.isArray(e))))&&!0),new Set(["TableHeaderCellsPropType"]),t)}))}))};var asyncTag="[object AsyncFunction]",funcTag$1="[object Function]",genTag="[object GeneratorFunction]",proxyTag="[object Proxy]";function isFunction(e){if(!isObject(e))return!1;var t=baseGetTag(e);return t==funcTag$1||t==genTag||t==asyncTag||t==proxyTag}var coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var e=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function isMasked(e){return!!maskSrcKey&&maskSrcKey in e}var funcProto$1=Function.prototype,funcToString$1=funcProto$1.toString;function toSource(e){if(null!=e){try{return funcToString$1.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reIsHostCtor=/^\[object .+?Constructor\]$/,funcProto=Function.prototype,objectProto$9=Object.prototype,funcToString=funcProto.toString,hasOwnProperty$7=objectProto$9.hasOwnProperty,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty$7).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function baseIsNative(e){return!(!isObject(e)||isMasked(e))&&(isFunction(e)?reIsNative:reIsHostCtor).test(toSource(e))}function getValue(e,t){return null==e?void 0:e[t]}function getNative(e,t){var a=getValue(e,t);return baseIsNative(a)?a:void 0}var WeakMap=getNative(root,"WeakMap"),MAX_SAFE_INTEGER$1=9007199254740991,reIsUint=/^(?:0|[1-9]\d*)$/;function isIndex(e,t){var a=typeof e;return!!(t=null==t?MAX_SAFE_INTEGER$1:t)&&("number"==a||"symbol"!=a&&reIsUint.test(e))&&e>-1&&e%1==0&&e<t}function eq(e,t){return e===t||e!=e&&t!=t}var MAX_SAFE_INTEGER=9007199254740991;function isLength(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=MAX_SAFE_INTEGER}function isArrayLike(e){return null!=e&&isLength(e.length)&&!isFunction(e)}var objectProto$8=Object.prototype;function isPrototype(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||objectProto$8)}function baseTimes(e,t){for(var a=-1,r=Array(e);++a<e;)r[a]=t(a);return r}var argsTag$2="[object Arguments]";function baseIsArguments(e){return isObjectLike(e)&&baseGetTag(e)==argsTag$2}var objectProto$7=Object.prototype,hasOwnProperty$6=objectProto$7.hasOwnProperty,propertyIsEnumerable$1=objectProto$7.propertyIsEnumerable,isArguments=baseIsArguments(function(){return arguments}())?baseIsArguments:function(e){return isObjectLike(e)&&hasOwnProperty$6.call(e,"callee")&&!propertyIsEnumerable$1.call(e,"callee")};function stubFalse(){return!1}var freeExports$1="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule$1=freeExports$1&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports$1=freeModule$1&&freeModule$1.exports===freeExports$1,Buffer=moduleExports$1?root.Buffer:void 0,nativeIsBuffer=Buffer?Buffer.isBuffer:void 0,isBuffer=nativeIsBuffer||stubFalse,argsTag$1="[object Arguments]",arrayTag$1="[object Array]",boolTag$1="[object Boolean]",dateTag$1="[object Date]",errorTag$1="[object Error]",funcTag="[object Function]",mapTag$2="[object Map]",numberTag$1="[object Number]",objectTag$2="[object Object]",regexpTag$1="[object RegExp]",setTag$2="[object Set]",stringTag$1="[object String]",weakMapTag$1="[object WeakMap]",arrayBufferTag$1="[object ArrayBuffer]",dataViewTag$2="[object DataView]",float32Tag="[object Float32Array]",float64Tag="[object Float64Array]",int8Tag="[object Int8Array]",int16Tag="[object Int16Array]",int32Tag="[object Int32Array]",uint8Tag="[object Uint8Array]",uint8ClampedTag="[object Uint8ClampedArray]",uint16Tag="[object Uint16Array]",uint32Tag="[object Uint32Array]",typedArrayTags={};function baseIsTypedArray(e){return isObjectLike(e)&&isLength(e.length)&&!!typedArrayTags[baseGetTag(e)]}function baseUnary(e){return function(t){return e(t)}}typedArrayTags[float32Tag]=typedArrayTags[float64Tag]=typedArrayTags[int8Tag]=typedArrayTags[int16Tag]=typedArrayTags[int32Tag]=typedArrayTags[uint8Tag]=typedArrayTags[uint8ClampedTag]=typedArrayTags[uint16Tag]=typedArrayTags[uint32Tag]=!0,typedArrayTags[argsTag$1]=typedArrayTags[arrayTag$1]=typedArrayTags[arrayBufferTag$1]=typedArrayTags[boolTag$1]=typedArrayTags[dataViewTag$2]=typedArrayTags[dateTag$1]=typedArrayTags[errorTag$1]=typedArrayTags[funcTag]=typedArrayTags[mapTag$2]=typedArrayTags[numberTag$1]=typedArrayTags[objectTag$2]=typedArrayTags[regexpTag$1]=typedArrayTags[setTag$2]=typedArrayTags[stringTag$1]=typedArrayTags[weakMapTag$1]=!1;var freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{var e=freeModule&&freeModule.require&&freeModule.require("util").types;return e||freeProcess&&freeProcess.binding&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,isTypedArray=nodeIsTypedArray?baseUnary(nodeIsTypedArray):baseIsTypedArray,objectProto$6=Object.prototype,hasOwnProperty$5=objectProto$6.hasOwnProperty;function arrayLikeKeys(e,t){var a=isArray(e),r=!a&&isArguments(e),o=!a&&!r&&isBuffer(e),s=!a&&!r&&!o&&isTypedArray(e),i=a||r||o||s,n=i?baseTimes(e.length,String):[],l=n.length;for(var c in e)!hasOwnProperty$5.call(e,c)||i&&("length"==c||o&&("offset"==c||"parent"==c)||s&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||isIndex(c,l))||n.push(c);return n}function overArg(e,t){return function(a){return e(t(a))}}var nativeKeys=overArg(Object.keys,Object),objectProto$5=Object.prototype,hasOwnProperty$4=objectProto$5.hasOwnProperty;function baseKeys(e){if(!isPrototype(e))return nativeKeys(e);var t=[];for(var a in Object(e))hasOwnProperty$4.call(e,a)&&"constructor"!=a&&t.push(a);return t}function keys(e){return isArrayLike(e)?arrayLikeKeys(e):baseKeys(e)}var nativeCreate=getNative(Object,"create");function hashClear(){this.__data__=nativeCreate?nativeCreate(null):{},this.size=0}function hashDelete(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var HASH_UNDEFINED$2="__lodash_hash_undefined__",objectProto$4=Object.prototype,hasOwnProperty$3=objectProto$4.hasOwnProperty;function hashGet(e){var t=this.__data__;if(nativeCreate){var a=t[e];return a===HASH_UNDEFINED$2?void 0:a}return hasOwnProperty$3.call(t,e)?t[e]:void 0}var objectProto$3=Object.prototype,hasOwnProperty$2=objectProto$3.hasOwnProperty;function hashHas(e){var t=this.__data__;return nativeCreate?void 0!==t[e]:hasOwnProperty$2.call(t,e)}var HASH_UNDEFINED$1="__lodash_hash_undefined__";function hashSet(e,t){var a=this.__data__;return this.size+=this.has(e)?0:1,a[e]=nativeCreate&&void 0===t?HASH_UNDEFINED$1:t,this}function Hash(e){var t=-1,a=null==e?0:e.length;for(this.clear();++t<a;){var r=e[t];this.set(r[0],r[1])}}function listCacheClear(){this.__data__=[],this.size=0}function assocIndexOf(e,t){for(var a=e.length;a--;)if(eq(e[a][0],t))return a;return-1}Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet;var arrayProto=Array.prototype,splice=arrayProto.splice;function listCacheDelete(e){var t=this.__data__,a=assocIndexOf(t,e);return!(a<0)&&(a==t.length-1?t.pop():splice.call(t,a,1),--this.size,!0)}function listCacheGet(e){var t=this.__data__,a=assocIndexOf(t,e);return a<0?void 0:t[a][1]}function listCacheHas(e){return assocIndexOf(this.__data__,e)>-1}function listCacheSet(e,t){var a=this.__data__,r=assocIndexOf(a,e);return r<0?(++this.size,a.push([e,t])):a[r][1]=t,this}function ListCache(e){var t=-1,a=null==e?0:e.length;for(this.clear();++t<a;){var r=e[t];this.set(r[0],r[1])}}ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet;var Map$1=getNative(root,"Map");function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new(Map$1||ListCache),string:new Hash}}function isKeyable(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}function getMapData(e,t){var a=e.__data__;return isKeyable(t)?a["string"==typeof t?"string":"hash"]:a.map}function mapCacheDelete(e){var t=getMapData(this,e).delete(e);return this.size-=t?1:0,t}function mapCacheGet(e){return getMapData(this,e).get(e)}function mapCacheHas(e){return getMapData(this,e).has(e)}function mapCacheSet(e,t){var a=getMapData(this,e),r=a.size;return a.set(e,t),this.size+=a.size==r?0:1,this}function MapCache(e){var t=-1,a=null==e?0:e.length;for(this.clear();++t<a;){var r=e[t];this.set(r[0],r[1])}}function arrayPush(e,t){for(var a=-1,r=t.length,o=e.length;++a<r;)e[o+a]=t[a];return e}function stackClear(){this.__data__=new ListCache,this.size=0}function stackDelete(e){var t=this.__data__,a=t.delete(e);return this.size=t.size,a}function stackGet(e){return this.__data__.get(e)}function stackHas(e){return this.__data__.has(e)}MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet;var LARGE_ARRAY_SIZE=200;function stackSet(e,t){var a=this.__data__;if(a instanceof ListCache){var r=a.__data__;if(!Map$1||r.length<LARGE_ARRAY_SIZE-1)return r.push([e,t]),this.size=++a.size,this;a=this.__data__=new MapCache(r)}return a.set(e,t),this.size=a.size,this}function Stack(e){var t=this.__data__=new ListCache(e);this.size=t.size}function arrayFilter(e,t){for(var a=-1,r=null==e?0:e.length,o=0,s=[];++a<r;){var i=e[a];t(i,a,e)&&(s[o++]=i)}return s}function stubArray(){return[]}Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var objectProto$2=Object.prototype,propertyIsEnumerable=objectProto$2.propertyIsEnumerable,nativeGetSymbols=Object.getOwnPropertySymbols,getSymbols=nativeGetSymbols?function(e){return null==e?[]:(e=Object(e),arrayFilter(nativeGetSymbols(e),(function(t){return propertyIsEnumerable.call(e,t)})))}:stubArray;function baseGetAllKeys(e,t,a){var r=t(e);return isArray(e)?r:arrayPush(r,a(e))}function getAllKeys(e){return baseGetAllKeys(e,keys,getSymbols)}var DataView=getNative(root,"DataView"),Promise$1=getNative(root,"Promise"),Set$1=getNative(root,"Set"),mapTag$1="[object Map]",objectTag$1="[object Object]",promiseTag="[object Promise]",setTag$1="[object Set]",weakMapTag="[object WeakMap]",dataViewTag$1="[object DataView]",dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map$1),promiseCtorString=toSource(Promise$1),setCtorString=toSource(Set$1),weakMapCtorString=toSource(WeakMap),getTag=baseGetTag;(DataView&&getTag(new DataView(new ArrayBuffer(1)))!=dataViewTag$1||Map$1&&getTag(new Map$1)!=mapTag$1||Promise$1&&getTag(Promise$1.resolve())!=promiseTag||Set$1&&getTag(new Set$1)!=setTag$1||WeakMap&&getTag(new WeakMap)!=weakMapTag)&&(getTag=function(e){var t=baseGetTag(e),a=t==objectTag$1?e.constructor:void 0,r=a?toSource(a):"";if(r)switch(r){case dataViewCtorString:return dataViewTag$1;case mapCtorString:return mapTag$1;case promiseCtorString:return promiseTag;case setCtorString:return setTag$1;case weakMapCtorString:return weakMapTag}return t});var Uint8Array=root.Uint8Array,HASH_UNDEFINED="__lodash_hash_undefined__";function setCacheAdd(e){return this.__data__.set(e,HASH_UNDEFINED),this}function setCacheHas(e){return this.__data__.has(e)}function SetCache(e){var t=-1,a=null==e?0:e.length;for(this.__data__=new MapCache;++t<a;)this.add(e[t])}function arraySome(e,t){for(var a=-1,r=null==e?0:e.length;++a<r;)if(t(e[a],a,e))return!0;return!1}function cacheHas(e,t){return e.has(t)}SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas;var COMPARE_PARTIAL_FLAG$3=1,COMPARE_UNORDERED_FLAG$1=2;function equalArrays(e,t,a,r,o,s){var i=a&COMPARE_PARTIAL_FLAG$3,n=e.length,l=t.length;if(n!=l&&!(i&&l>n))return!1;var c=s.get(e),h=s.get(t);if(c&&h)return c==t&&h==e;var d=-1,u=!0,b=a&COMPARE_UNORDERED_FLAG$1?new SetCache:void 0;for(s.set(e,t),s.set(t,e);++d<n;){var p=e[d],y=t[d];if(r)var g=i?r(y,p,d,t,e,s):r(p,y,d,e,t,s);if(void 0!==g){if(g)continue;u=!1;break}if(b){if(!arraySome(t,(function(e,t){if(!cacheHas(b,t)&&(p===e||o(p,e,a,r,s)))return b.push(t)}))){u=!1;break}}else if(p!==y&&!o(p,y,a,r,s)){u=!1;break}}return s.delete(e),s.delete(t),u}function mapToArray(e){var t=-1,a=Array(e.size);return e.forEach((function(e,r){a[++t]=[r,e]})),a}function setToArray(e){var t=-1,a=Array(e.size);return e.forEach((function(e){a[++t]=e})),a}var COMPARE_PARTIAL_FLAG$2=1,COMPARE_UNORDERED_FLAG=2,boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",mapTag="[object Map]",numberTag="[object Number]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0;function equalByTag(e,t,a,r,o,s,i){switch(a){case dataViewTag:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case arrayBufferTag:return!(e.byteLength!=t.byteLength||!s(new Uint8Array(e),new Uint8Array(t)));case boolTag:case dateTag:case numberTag:return eq(+e,+t);case errorTag:return e.name==t.name&&e.message==t.message;case regexpTag:case stringTag:return e==t+"";case mapTag:var n=mapToArray;case setTag:var l=r&COMPARE_PARTIAL_FLAG$2;if(n||(n=setToArray),e.size!=t.size&&!l)return!1;var c=i.get(e);if(c)return c==t;r|=COMPARE_UNORDERED_FLAG,i.set(e,t);var h=equalArrays(n(e),n(t),r,o,s,i);return i.delete(e),h;case symbolTag:if(symbolValueOf)return symbolValueOf.call(e)==symbolValueOf.call(t)}return!1}var COMPARE_PARTIAL_FLAG$1=1,objectProto$1=Object.prototype,hasOwnProperty$1=objectProto$1.hasOwnProperty;function equalObjects(e,t,a,r,o,s){var i=a&COMPARE_PARTIAL_FLAG$1,n=getAllKeys(e),l=n.length;if(l!=getAllKeys(t).length&&!i)return!1;for(var c=l;c--;){var h=n[c];if(!(i?h in t:hasOwnProperty$1.call(t,h)))return!1}var d=s.get(e),u=s.get(t);if(d&&u)return d==t&&u==e;var b=!0;s.set(e,t),s.set(t,e);for(var p=i;++c<l;){var y=e[h=n[c]],g=t[h];if(r)var f=i?r(g,y,h,t,e,s):r(y,g,h,e,t,s);if(!(void 0===f?y===g||o(y,g,a,r,s):f)){b=!1;break}p||(p="constructor"==h)}if(b&&!p){var v=e.constructor,_=t.constructor;v==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof v&&v instanceof v&&"function"==typeof _&&_ instanceof _||(b=!1)}return s.delete(e),s.delete(t),b}var COMPARE_PARTIAL_FLAG=1,argsTag="[object Arguments]",arrayTag="[object Array]",objectTag="[object Object]",objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty;function baseIsEqualDeep(e,t,a,r,o,s){var i=isArray(e),n=isArray(t),l=i?arrayTag:getTag(e),c=n?arrayTag:getTag(t),h=(l=l==argsTag?objectTag:l)==objectTag,d=(c=c==argsTag?objectTag:c)==objectTag,u=l==c;if(u&&isBuffer(e)){if(!isBuffer(t))return!1;i=!0,h=!1}if(u&&!h)return s||(s=new Stack),i||isTypedArray(e)?equalArrays(e,t,a,r,o,s):equalByTag(e,t,l,a,r,o,s);if(!(a&COMPARE_PARTIAL_FLAG)){var b=h&&hasOwnProperty.call(e,"__wrapped__"),p=d&&hasOwnProperty.call(t,"__wrapped__");if(b||p){var y=b?e.value():e,g=p?t.value():t;return s||(s=new Stack),o(y,g,a,r,s)}}return!!u&&(s||(s=new Stack),equalObjects(e,t,a,r,o,s))}function baseIsEqual(e,t,a,r,o){return e===t||(null==e||null==t||!isObjectLike(e)&&!isObjectLike(t)?e!=e&&t!=t:baseIsEqualDeep(e,t,a,r,baseIsEqual,o))}function isEqual(e,t){return baseIsEqual(e,t)}const HEADER_CELL_WIDTH_VALIDATOR=/^\d+(\.\d+)?([a-z]+|%)?$/,validateMinWidth=(e,t,a)=>{watchValidator(e,"_minWidth",(e=>"string"==typeof e&&HEADER_CELL_WIDTH_VALIDATOR.test(e)),new Set(["String","/^\\d+(\\.\\d+)?([a-z]+|%)?$/"]),t,a)},KolTableStateless=class{constructor(e){registerInstance(this,e),this.translateNoEntries=translate("kol-no-entries"),this.state={_data:[],_headerCells:{horizontal:[],vertical:[]},_label:"",_minWidth:"auto"},this.horizontal=!0,this.cellsToRenderTimeouts=new Map,this.dataToKeyMap=new Map,this.checkboxRefs=[],this.translateSort=translate("kol-sort"),this.tableDivElementHasScrollbar=!1,this.renderTableRow=(e,t,a,r=!1)=>{var o,s;let i=String(t);return this.horizontal&&(null===(o=e[0])||void 0===o?void 0:o.data)&&(i=null!==(s=this.getDataKey(e[0].data))&&void 0!==s?s:i),h("tr",{class:clsx("kol-table__row",{"kol-table__row--body":!r,"kol-table__row--footer":r}),key:`row-${i}`},this.renderSelectionCell(e,t),e.map(((e,r)=>this.renderTableCell(e,t,r,a))))},this.renderTableCell=(e,t,a,r)=>{const o=this.getColumnSettings(e);if(o&&!o.visible)return"";let s=`${t}-${a}-${e.label}`;if(e.data){const r=this.getDataKey(e.data);s=r?`${r}-${this.horizontal?a:t}`:s}return e.headerCell?this.renderHeadingCell(e,t,a,r):h("td",{key:`cell-${s}`,class:clsx("kol-table__cell kol-table__cell--body",{[`kol-table__cell--align-${e.textAlign}`]:e.textAlign}),colSpan:e.colSpan,rowSpan:e.rowSpan,style:{textAlign:e.textAlign,width:(null==o?void 0:o.width)?`${o.width}ch`:e.width},ref:"function"==typeof e.render?t=>{this.cellRender(e,t)}:void 0},"function"!=typeof e.render?e.label:"")}}validateData(e){validateTableData(this,e,{beforePatch:e=>{this.updateDataToKeyMap(e)}})}validateDataFoot(e){validateTableDataFoot(this,e)}validateHeaderCells(e){validateTableHeaderCells(this,e),isEqual(this.previousHeaderCells,this.state._headerCells)||this.initializeTableSettings(),this.previousHeaderCells=this.state._headerCells}validateLabel(e){validateLabel(this,e,{required:!0})}validateMinWidth(e){validateMinWidth(this,e)}validateOn(e){validateTableCallbacks(this,e)}validateSelection(e){validateTableSelection(this,e)}validateTableSettings(e){validateTableSettings(this,e)}handleKeyDown(e){var t;if("ArrowUp"===e.key||"ArrowDown"===e.key){const a=null===(t=this.tableDivElement)||void 0===t?void 0:t.querySelector(":focus");let r=this.checkboxRefs.indexOf(a);r>-1&&(e.preventDefault(),"ArrowDown"===e.key?(r=(r+1)%this.checkboxRefs.length,this.checkboxRefs[r].focus()):"ArrowUp"===e.key&&(e.preventDefault(),r=(r+this.checkboxRefs.length-1)%this.checkboxRefs.length,this.checkboxRefs[r].focus()))}}componentDidRender(){this.checkDivElementScrollbar()}componentDidLoad(){this.tableDivElement&&ResizeObserver&&(this.tableDivElementResizeObserver=new ResizeObserver(this.checkDivElementScrollbar.bind(this)),this.tableDivElementResizeObserver.observe(this.tableDivElement))}handleSettingsChange(e){setState(this,"_tableSettings",e.detail)}disconnectedCallback(){var e;null===(e=this.tableDivElementResizeObserver)||void 0===e||e.disconnect()}checkDivElementScrollbar(){this.tableDivElement&&(this.tableDivElementHasScrollbar=this.tableDivElement.scrollWidth>this.tableDivElement.clientWidth)}updateDataToKeyMap(e){e.forEach((e=>{this.dataToKeyMap.has(e)||this.dataToKeyMap.set(e,nonce())})),this.dataToKeyMap.forEach(((t,a)=>{e.includes(a)||this.dataToKeyMap.delete(a)}))}getDataKey(e){return this.dataToKeyMap.get(e)}cellRender(e,t){t&&(clearTimeout(this.cellsToRenderTimeouts.get(t)),this.cellsToRenderTimeouts.set(t,setTimeout((()=>{if("function"==typeof e.render){const a=e.render(t,e,e.data,this.state._data);"string"==typeof a&&(t.textContent=a)}}))))}getNumberOfCols(e,t){let a=0;return e.forEach((e=>{let t=0;Array.isArray(e)&&e.forEach((e=>{var a;return t+=null!==(a=e.colSpan)&&void 0!==a?a:1})),a<t&&(a=t)})),0===a&&(a=t.length),a}getNumberOfRows(e,t){var a;let r=0;return e.forEach((e=>{let t=0;Array.isArray(e)&&e.forEach((e=>{var a;return t+=null!==(a=e.rowSpan)&&void 0!==a?a:1})),r<t&&(r=t)})),0===r?r=t.length:r-=(null===(a=this.state._dataFoot)||void 0===a?void 0:a.length)||0,r}getThePrimaryHeadersWithKeyOrRenderFunction(e){const t=[];return e.forEach((e=>{e.forEach((e=>{"string"!=typeof e.key&&"function"!=typeof e.render||t.push(e)}))})),t}getPrimaryHeaders(e){var t,a;let r=this.getThePrimaryHeadersWithKeyOrRenderFunction(null!==(t=e.horizontal)&&void 0!==t?t:[]);return this.horizontal=!0,0===r.length&&(r=this.getThePrimaryHeadersWithKeyOrRenderFunction(null!==(a=e.vertical)&&void 0!==a?a:[]),r.length>0&&(this.horizontal=!1)),r}getColumnPositionMap(){var e;const t=new Map;return null===(e=this.state._tableSettings)||void 0===e||e.columns.forEach((e=>{t.set(e.key,e.position)})),t}sortByColumnPosition(e){const t=this.getColumnPositionMap();return[...e].sort(((e,a)=>{var r,o,s,i;return(null!==(o=t.get(null!==(r=e.key)&&void 0!==r?r:""))&&void 0!==o?o:Number.MAX_SAFE_INTEGER)-(null!==(i=t.get(null!==(s=a.key)&&void 0!==s?s:""))&&void 0!==i?i:Number.MAX_SAFE_INTEGER)}))}createDataField(e,t,a){var r;t.horizontal=Array.isArray(null==t?void 0:t.horizontal)?t.horizontal:[],t.vertical=Array.isArray(null==t?void 0:t.vertical)?t.vertical:[];const o=this.getPrimaryHeaders(t),s=this.getNumberOfCols(t.horizontal,e);let i=this.getNumberOfRows(t.vertical,e),n=0;a&&(n=i,i+=(null===(r=this.state._dataFoot)||void 0===r?void 0:r.length)||0);const l=[],c=[],h=[];t.vertical.forEach(((e,t)=>{c[t]=0,h[t]=[]}));const d=this.sortByColumnPosition(o);for(let r=n;r<i;r++){const o=[];t.vertical.forEach(((e,t)=>{let a=0;if(h[t].forEach((e=>a+=e)),a<=r){const s=e[r-a+c[t]];if("object"==typeof s){o.push(Object.assign(Object.assign({},s),{headerCell:!0,data:{}}));let e=1;if("number"==typeof s.rowSpan&&s.rowSpan>1&&(e=s.rowSpan),h[t].push(e),"number"==typeof s.colSpan&&s.colSpan>1)for(let a=1;a<s.colSpan;a++)h[t+a].push(e);c[t]++}}}));for(let t=0;t<s;t++)if(!0===this.horizontal){const s=a&&this.state._dataFoot?this.state._dataFoot[r-n]:e[r];"object"!=typeof d[t]||null===d[t]||"object"!=typeof s||null===s||"string"!=typeof d[t].key&&"function"!=typeof d[t].render||o.push(Object.assign(Object.assign({},d[t]),{colSpan:void 0,data:s,label:s[d[t].key],rowSpan:void 0}))}else"object"!=typeof d[r]||null===d[r]||"object"!=typeof e[t]||null===e[t]||"string"!=typeof d[r].key&&"function"!=typeof d[r].render||o.push(Object.assign(Object.assign({},d[r]),{colSpan:void 0,data:e[t],label:e[t][d[r].key],rowSpan:void 0}));l.push(o)}if(0===e.length){let e=0,a=0;Array.isArray(t.horizontal)&&t.horizontal.length>0&&t.horizontal[0].forEach((t=>{e+=t.colSpan||1})),Array.isArray(t.vertical)&&t.vertical.length>0&&(e-=t.vertical.length,t.vertical[0].forEach((e=>{a+=e.rowSpan||1})));const r={colSpan:e,label:this.translateNoEntries,render:void 0,rowSpan:Math.max(a,1)};0===l.length?l.push([r]):l[0].push(r)}return l}handleSelectionChangeCallbackAndEvent(e,t){var a;"function"==typeof(null===(a=this.state._on)||void 0===a?void 0:a[Callback.onSelectionChange])&&this.state._on[Callback.onSelectionChange](e,t),this.host&&dispatchDomEvent(this.host,KolEvent.selectionChange,t)}initializeTableSettings(){if(this._tableSettings)return;const e=this.getPrimaryHeaders(this.state._headerCells);this.state._tableSettings||(this.state._tableSettings={columns:[]}),this.state._tableSettings.columns=e.filter((e=>e.key)).map(((e,t)=>{var a;return{key:null!==(a=e.key)&&void 0!==a?a:nonce(),label:e.label,position:t,visible:!0}}))}componentWillLoad(){this.validateData(this._data),this.validateDataFoot(this._dataFoot),this.validateHeaderCells(this._headerCells),this.validateLabel(this._label),this.validateMinWidth(this._minWidth),this.validateOn(this._on),this.validateSelection(this._selection),this.validateTableSettings(this._tableSettings)}renderSelectionCell(e,t){var a,r,o;const s=this.state._selection;if(!s)return"";const i=this.getSelectionKeyPropertyName(),n=null===(a=e[0])||void 0===a?void 0:a.data;if(!n)return"";const l=n[i],c=s.multiple||void 0===s.multiple,d=null===(r=null==s?void 0:s.selectedKeys)||void 0===r?void 0:r.includes(l),u=null===(o=null==s?void 0:s.disabledKeys)||void 0===o?void 0:o.includes(l),b=s.label(n),p={name:"selection",checked:d,disabled:u,id:l,"aria-label":b};return h("td",{key:`tbody-${t}-selection`,class:"kol-table__cell kol-table__cell--selection"},h("div",{class:clsx("kol-table__selection",{"kol-table__selection--checked":d})},c?h("label",{class:clsx("kol-table__selection-label",{"kol-table__selection-label--disabled":u})},h(KolIconTag,{class:"kol-table__selection-icon",_icons:"codicon "+(d?"codicon-check":""),_label:""}),h("input",Object.assign({class:clsx("kol-table__selection-input kol-table__selection-input--checkbox"),ref:e=>e&&this.checkboxRefs.push(e)},p,{type:"checkbox",onInput:e=>{var t,a;const r=d?null===(a=null==s?void 0:s.selectedKeys)||void 0===a?void 0:a.filter((e=>e!==l)):[...null!==(t=null==s?void 0:s.selectedKeys)&&void 0!==t?t:[],l];this.handleSelectionChangeCallbackAndEvent(e,null!=r?r:[])}}))):h("label",{class:"kol-table__selection-label"},h("input",Object.assign({class:clsx("kol-table__selection-input kol-table__selection-input--radio")},p,{type:"radio",onInput:e=>{this.handleSelectionChangeCallbackAndEvent(e,l)}}))),h(KolTooltipWcTag,{"aria-hidden":"true",class:"kol-table__selection-input-tooltip",_align:"right",_id:`${l}-label`,_label:b})))}getColumnSettings(e){var t;return null===(t=this.state._tableSettings)||void 0===t?void 0:t.columns.find((t=>t.key===e.key))}getSelectionKeyPropertyName(){var e,t;return null!==(t=null===(e=this.state._selection)||void 0===e?void 0:e.keyPropertyName)&&void 0!==t?t:"id"}getDataWithSelectionEnabled(){const e=this.getSelectionKeyPropertyName();return this.state._data.filter((t=>{var a,r;return!(null===(r=null===(a=this.state._selection)||void 0===a?void 0:a.disabledKeys)||void 0===r?void 0:r.includes(t[e]))}))}getSelectedKeysWithoutDisabledKeys(){var e,t;return null===(t=null===(e=this.state._selection)||void 0===e?void 0:e.selectedKeys)||void 0===t?void 0:t.filter((e=>{var t,a;return!(null===(a=null===(t=this.state._selection)||void 0===t?void 0:t.disabledKeys)||void 0===a?void 0:a.includes(e))}))}getSelectedKeysWithDisabledKeysOnly(){var e,t;return null===(t=null===(e=this.state._selection)||void 0===e?void 0:e.selectedKeys)||void 0===t?void 0:t.filter((e=>{var t,a;return null===(a=null===(t=this.state._selection)||void 0===t?void 0:t.disabledKeys)||void 0===a?void 0:a.includes(e)}))}getRevertedSelection(e){var t;const a=this.getSelectionKeyPropertyName(),r=null!==(t=this.getSelectedKeysWithDisabledKeysOnly())&&void 0!==t?t:[];return e&&r.push(...this.getDataWithSelectionEnabled().map((e=>null==e?void 0:e[a]))),r}getTableMinWidth(){var e,t;const a=null!==(t=null===(e=this.state._tableSettings)||void 0===e?void 0:e.columns.filter((e=>e.visible)).reduce(((e,t)=>{var a;return e+(null!==(a=t.width)&&void 0!==a?a:0)}),0))&&void 0!==t?t:0;return"auto"===this.state._minWidth?`${a}ch`:`max(${this.state._minWidth}, ${a}ch)`}renderHeadingSelectionCell(){var e,t;const a=this.state._selection;if(!a||!a.multiple&&void 0!==a.multiple)return h("th",{class:"kol-table__cell kol-table__cell--header",key:"thead-0"});const r=null!==(t=null===(e=this.getSelectedKeysWithoutDisabledKeys())||void 0===e?void 0:e.length)&&void 0!==t?t:0,o=r===this.getDataWithSelectionEnabled().length,s=0!==r&&!o;let i="kol-table-selection-indeterminate";o&&!s&&(i="kol-table-selection-none"),0===r&&(i="kol-table-selection-all");const n=translate(i);return h("th",{key:"thead-0-selection",class:"kol-table__cell kol-table__cell--header"},h("div",{class:clsx("kol-table__selection",{"kol-table__selection--indeterminate":s,"kol-table__selection--checked":o})},h("label",{class:"kol-table__selection-label"},h(KolIconTag,{class:"kol-table__selection-icon",_icons:"codicon "+(s?"codicon-remove":o?"codicon-check":""),_label:""}),h("input",{class:clsx("kol-table__selection-input kol-table__selection-input--checkbox"),"data-testid":"selection-checkbox-all",ref:e=>e&&this.checkboxRefs.push(e),name:"selection",checked:o&&!s,indeterminate:s,"aria-label":n,type:"checkbox",onInput:e=>{this.handleSelectionChangeCallbackAndEvent(e,this.getRevertedSelection(!o))}})),h(KolTooltipWcTag,{"aria-hidden":"true",class:"kol-table__selection-input-tooltip",_align:"right",_id:`${i}-label`,_label:n})))}renderHeaderTdCell(){return h(Fragment,null,Array.isArray(this.state._headerCells.horizontal)&&this.state._headerCells.horizontal.length>0&&Array.isArray(this.state._headerCells.vertical)&&this.state._headerCells.vertical.length>0&&Array.isArray(this.state._headerCells.horizontal)&&h("td",{"aria-hidden":"true",colSpan:this.state._headerCells.vertical.length,rowSpan:this.state._headerCells.horizontal.length}))}renderHeadingCell(e,t,a,r){const o=this.getColumnSettings(e);if(o&&!o.visible)return"";let s="none",i="codicon codicon-fold";if(e.sortDirection)switch(e.sortDirection){case"ASC":i="codicon codicon-chevron-up",s="ascending";break;case"DESC":i="codicon codicon-chevron-down",s="descending";break;default:s="none"}const n=r?"row":"number"==typeof e.colSpan&&e.colSpan>1?"colgroup":"col";return h("th",{key:`${t}-${a}-${e.label}`,class:clsx("kol-table__cell kol-table__cell--header",{[`kol-table__cell--align-${e.textAlign}`]:e.textAlign,[`kol-table__cell--${s}`]:s}),scope:n,colSpan:e.colSpan,rowSpan:e.rowSpan,style:{width:(null==o?void 0:o.width)?`${o.width}ch`:e.width},"aria-sort":s,"data-sort":`sort-${e.sortDirection}`},e.sortDirection?h(KolButtonWcTag,{class:"kol-table__sort-button",exportparts:"icon",_icons:{right:i},_label:e.label,_ariaDescription:this.translateSort,_on:{onClick:t=>{var a;"function"==typeof(null===(a=this.state._on)||void 0===a?void 0:a.onSort)&&e.key&&e.sortDirection&&this.state._on.onSort(t,{key:e.key,currentSortDirection:e.sortDirection}),this.host&&dispatchDomEvent(this.host,KolEvent.sort,{key:e.key,currentSortDirection:e.sortDirection})}}}):e.label)}renderSpacer(e,t){var a,r;const o=(null===(a=this.state._headerCells.vertical)||void 0===a?void 0:a.length)||0,s=null===(r=null==t?void 0:t[0])||void 0===r?void 0:r.reduce(((e,t)=>e+(t.colSpan||1)),0),i=this.state._selection?1:0;return h("tr",{"aria-hidden":"true",class:clsx("kol-table__spacer",`kol-table__spacer--${e}`)},h("td",{class:clsx(`kol-table__spacer-line kol-table__spacer-line--${e}`),colSpan:o+s+i}))}renderFoot(){if(!this.state._dataFoot||0===this.state._dataFoot.length)return null;const e=this.createDataField(this.state._dataFoot,this.state._headerCells,!0);return h("tfoot",{class:"kol-table__footer"},[this.renderSpacer("foot",e),e.map(((e,t)=>this.renderTableRow(e,t,!0,!0)))])}render(){var e;const t=this.createDataField(this.state._data,this.state._headerCells);this.checkboxRefs=[];const a=null===(e=this.state._headerCells.horizontal)||void 0===e?void 0:e.map((e=>this.sortByColumnPosition(e)));return h("div",{key:"f81983e551d1e41281aa41ec2394ec08267fe6a0",class:"kol-table"},h(KolTableSettingsWcTag,{key:"ba42966556deec90ef308fe6f78a863dc02a1e5a",_tableSettings:this.state._tableSettings}),h("div",{key:"a91ceb385d449db182d233c35761c1554c89f72f",ref:e=>this.tableDivElement=e,class:"kol-table__scroll-container",tabindex:this.tableDivElementHasScrollbar?"-1":void 0},h("table",{key:"9f917d159b62dbde6b9fb46766530fd4ee26a29f",class:"kol-table__table",style:{minWidth:this.getTableMinWidth()}},h("div",{key:"07945a7045943e54524e0acff2ad96ecfafc6be8",class:"kol-table__focus-element",tabindex:this.tableDivElementHasScrollbar?"0":void 0,"aria-describedby":"caption"}," "),h("caption",{key:"bb21eb4c05d126477e7e751c9a8c3f83fc70a672",class:"kol-table__caption",id:"caption"},this.state._label),Array.isArray(a)&&h("thead",{key:"439c92996fccdc4be1e792e68b5ec91b57b18b0d",class:"kol-table__head"},[a.map(((e,t)=>h("tr",{class:"kol-table__head-row",key:`thead-${t}`},this.state._selection&&this.renderHeadingSelectionCell(),0===t&&this.renderHeaderTdCell(),Array.isArray(e)&&e.map(((e,a)=>this.renderHeadingCell(e,t,a,!1)))))),this.renderSpacer("head",a)]),h("tbody",{key:"92f3bb34b30d1515c8aac05910280b4025f98a3d",class:"kol-table__body"},t.map(((e,t)=>this.renderTableRow(e,t,!0)))),this.renderFoot())))}get host(){return getElement(this)}static get watchers(){return{_data:["validateData"],_dataFoot:["validateDataFoot"],_headerCells:["validateHeaderCells"],_label:["validateLabel"],_minWidth:["validateMinWidth"],_on:["validateOn"],_selection:["validateSelection"],_tableSettings:["validateTableSettings"]}}};export{KolTableStateless as kol_table_stateless_wc};
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * KoliBri - The accessible HTML-Standard
3
3
  */
4
- import{r as registerInstance,h}from"./index-BwHVuv1c.js";import{m as KolTableStatelessWcTag}from"./component-names-CkE54Ym7.js";import"./common-7RW_NFNf.js";const defaultStyleCss="@charset \"UTF-8\";\n/* forward the rem function */\n/*\n * This file contains all rules for accessibility.\n */\n@layer kol-a11y {\n :host {\n /*\n * Minimum size of interactive elements.\n */\n --a11y-min-size: calc(44rem / var(--kolibri-root-font-size, 16));\n color: black;\n /*\n * No element should be used without a background and font color whose contrast ratio has\n * not been checked. By initially setting the background color to white and the font color\n * to black, the contrast ratio is ensured and explicit adjustment is forced.\n */\n background-color: white;\n /*\n * Verdana is an accessible font that can be used without requiring additional loading time.\n */\n font-family: Verdana;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n * {\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n hyphens: auto;\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n word-break: break-word;\n }\n /*\n * All interactive elements should have a minimum size of to-rem(44).\n */\n /* input:not([type='checkbox'], [type='radio'], [type='range']), */\n /* option, */\n /* select, */\n /* textarea, */\n [role=button],\n button:not([role=link]),\n .kol-input .input {\n min-width: var(--a11y-min-size);\n min-height: var(--a11y-min-size);\n }\n /*\n * Some interactive elements should not inherit the font-family and font-size.\n */\n a,\n button,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n input,\n option,\n select,\n textarea {\n /*\n * All elements should inherit the font family from his parent element.\n */\n font-family: inherit;\n /*\n * All elements should inherit the font size from his parent element.\n */\n font-size: inherit;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n /**\n * Sometimes we need the semantic element for accessibility reasons,\n * but we don't want to show it.\n *\n * - https://www.a11yproject.com/posts/how-to-hide-content/\n */\n .visually-hidden {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n white-space: nowrap;\n clip: rect(0 0 0 0);\n clip-path: inset(50%);\n }\n}\n@layer kol-global {\n /*\n * Dieses CSS stellt sicher, dass der Standard-Style\n * von A und Button resettet werden.\n */\n :is(a, button) {\n background-color: transparent;\n width: 100%;\n margin: 0;\n padding: 0;\n border: none;\n /* 100% needed for custom width from outside */\n }\n /*\n * Ensure elements with hidden attribute to be actually not visible\n * @see https://meowni.ca/hidden.is.a.lie.html\n */\n [hidden] {\n display: none !important;\n }\n .badge-text-hint {\n color: black;\n background-color: lightgray;\n }\n}\n@layer kol-global {\n :host {\n /*\n * The max-width is needed to prevent the table from overflowing the\n * parent node, if the table is wider than the parent node.\n */\n max-width: 100%;\n font-size: calc(16rem / var(--kolibri-root-font-size, 16));\n }\n * {\n /*\n * We prefer to box-sizing: border-box for all elements.\n */\n box-sizing: border-box;\n }\n .kol-span {\n /* KolSpan is a layout component with icons in all directions and a label text in the middle. */\n display: grid;\n place-items: center;\n /* The sub span in KolSpan is the horizontal span with icon left and right and the label text in the middle. */\n }\n .kol-span__container {\n display: flex;\n place-items: center;\n }\n a,\n button {\n cursor: pointer;\n }\n .kol-span .kol-span__label--hide-label .kol-span__label {\n display: none;\n }\n /* Reset browser agent style. */\n button:disabled {\n color: unset;\n }\n .disabled label,\n .disabled:focus-within label,\n [aria-disabled=true],\n [aria-disabled=true]:focus,\n [disabled],\n [disabled]:focus {\n opacity: 0.5;\n outline: none;\n cursor: not-allowed;\n }\n [aria-disabled=true]:focus .kol-span,\n [disabled]:focus .kol-span {\n outline: none !important;\n }\n}\n@layer kol-component {\n :host {\n display: block;\n }\n}\n@layer kol-component {\n @keyframes fadeInOpacity {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n .kol-tooltip {\n display: contents;\n contain: layout;\n }\n .kol-tooltip__floating {\n display: none;\n position: fixed;\n /* Avoid layout interference - see https://floating-ui.com/docs/computePosition */\n top: 0;\n left: 0;\n /* Can be used to specify the tooltip-width from the outside. Unset by default. */\n width: var(--kol-tooltip-width);\n max-width: 90vw;\n max-height: 90vh;\n visibility: hidden;\n animation-duration: 0.25s;\n animation-iteration-count: 1;\n animation-name: fadeInOpacity;\n animation-timing-function: ease-in;\n }\n .kol-tooltip__arrow {\n transform: rotate(45deg);\n color: #000;\n background-color: #fff;\n position: absolute;\n z-index: 999;\n width: calc(10rem / var(--kolibri-root-font-size, 16));\n height: calc(10rem / var(--kolibri-root-font-size, 16));\n }\n .kol-tooltip__content {\n color: #000;\n background-color: #fff;\n position: relative;\n z-index: 1000;\n }\n}\n@layer kol-component {\n .kol-alert {\n display: grid;\n }\n .kol-alert__container {\n display: flex;\n place-items: center;\n }\n .kol-alert__container-content {\n flex-grow: 1;\n }\n .kol-alert__closer {\n /* Visible with forced colors */\n outline: transparent solid calc(1rem / var(--kolibri-root-font-size, 16));\n }\n}\n@layer kol-component {\n :host {\n display: inline-block;\n }\n .kol-button {\n display: inline-flex;\n place-items: center;\n font-style: calc(16rem / var(--kolibri-root-font-size, 16));\n text-align: center;\n text-decoration-line: none;\n }\n .kol-button::before {\n /* Render zero-width character as first element to set the baseline correctly. */\n content: \"​\";\n }\n .kol-button__text {\n width: 100%;\n margin: auto;\n }\n}\n@layer kol-component {\n .kol-popover-button__button {\n display: inline-block;\n }\n .kol-popover-button__popover {\n margin: 0;\n padding: 0;\n border: 0;\n }\n}\n@layer kol-component {\n .kol-table-settings {\n background: #fff;\n position: absolute;\n top: 0;\n right: 0;\n z-index: 1;\n }\n .kol-table-settings__columns-container {\n max-height: calc(200rem / var(--kolibri-root-font-size, 16));\n margin-top: calc(16rem / var(--kolibri-root-font-size, 16));\n overflow: auto;\n }\n .kol-table-settings__columns {\n display: grid;\n overflow: hidden;\n gap: calc(8rem / var(--kolibri-root-font-size, 16));\n align-items: center;\n grid-auto-rows: min-content;\n grid-template-columns: min-content 1fr calc(100rem / var(--kolibri-root-font-size, 16)) auto auto;\n }\n .kol-table-settings__column {\n display: contents;\n }\n}\n@layer kol-component {\n .kol-table {\n display: block;\n position: relative;\n max-width: 100%;\n }\n .kol-table__scroll-container {\n overflow-x: auto;\n overflow-y: hidden;\n }\n .kol-table:has(.kol-table__focus-element:focus) .kol-table__scroll-container {\n /* @see https://remysharp.com/til/css/focus-ring-default-styles */\n outline: 5px auto Highlight;\n outline: 5px auto -webkit-focus-ring-color;\n outline-offset: 2px;\n }\n .kol-table__table {\n width: 100%;\n }\n .kol-table__caption {\n min-height: var(--a11y-min-size);\n padding-right: var(--a11y-min-size);\n text-align: start;\n }\n .kol-table__focus-element {\n font-size: 0;\n }\n .kol-table__sort-button .kol-button {\n color: inherit;\n }\n .kol-table__body {\n text-align: left;\n }\n .kol-table__body .kol-button__text {\n justify-items: start;\n }\n .kol-table__cell--align-left {\n text-align: left;\n }\n .kol-table__cell--align-left .kol-button__text {\n justify-items: start;\n }\n .kol-table__cell--align-center {\n text-align: center;\n }\n .kol-table__cell--align-center .kol-button__text {\n justify-items: center;\n }\n .kol-table__cell--align-right {\n text-align: right;\n }\n .kol-table__cell--align-right .kol-button__text {\n justify-items: end;\n }\n .kol-table__cell--selection {\n width: var(--a11y-min-size);\n height: var(--a11y-min-size);\n white-space: nowrap;\n }\n .kol-table__spacer {\n display: none;\n }\n .kol-table__selection-label {\n display: flex;\n position: relative;\n width: var(--a11y-min-size);\n height: var(--a11y-min-size);\n align-items: center;\n justify-content: center;\n cursor: pointer;\n }\n .kol-table__selection-label--disabled {\n cursor: not-allowed;\n }\n .kol-table__selection-icon {\n display: block;\n position: absolute;\n inset: auto;\n z-index: 1;\n }\n .kol-table__selection-input {\n border-style: solid;\n margin: 0;\n appearance: none;\n cursor: pointer;\n }\n .kol-table__selection-input:disabled {\n cursor: not-allowed;\n }\n .kol-table__selection-input:before {\n content: \"\";\n }\n .kol-table__selection-input--checkbox {\n background-color: rgb(255, 255, 255);\n display: flex;\n position: relative;\n width: calc(var(--a11y-min-size) / 2);\n height: calc(var(--a11y-min-size) / 2);\n border-width: 2px;\n align-items: center;\n justify-content: center;\n line-height: 1.5;\n }\n .kol-table__selection-input--radio {\n border-radius: 100%;\n display: flex;\n width: 1.5em;\n min-width: 1.5em;\n height: 1.5em;\n min-height: 1.5em;\n padding: 0;\n border-width: 2px;\n }\n .kol-table__selection-input--radio:before {\n border-radius: 100%;\n width: 0.75em;\n height: 0.75em;\n margin: auto;\n }\n .kol-table__selection-input--radio:checked:before {\n background-color: #000;\n }\n @media (forced-colors: active) {\n .kol-table__selection-input--radio:checked:before {\n /* Give it a visible background in forced colors mode */\n background-color: selectedItem !important;\n }\n }\n}",KolTableStateless=class{constructor(n){registerInstance(this,n)}render(){return h(KolTableStatelessWcTag,{key:"2d2c2f809dd9393cbdc39e9e229119b900765592",_data:this._data,_dataFoot:this._dataFoot,_headerCells:this._headerCells,_label:this._label,_minWidth:this._minWidth,_on:this._on,_selection:this._selection,_tableSettings:this._tableSettings})}};KolTableStateless.style={default:defaultStyleCss};export{KolTableStateless as kol_table_stateless};
4
+ import{r as registerInstance,h}from"./index-DTM8XbOu.js";import{m as KolTableStatelessWcTag}from"./component-names-CkE54Ym7.js";import"./common-7RW_NFNf.js";const defaultStyleCss="@charset \"UTF-8\";\n/* forward the rem function */\n/*\n * This file contains all rules for accessibility.\n */\n@layer kol-a11y {\n :host {\n /*\n * Minimum size of interactive elements.\n */\n --a11y-min-size: calc(44rem / var(--kolibri-root-font-size, 16));\n color: black;\n /*\n * No element should be used without a background and font color whose contrast ratio has\n * not been checked. By initially setting the background color to white and the font color\n * to black, the contrast ratio is ensured and explicit adjustment is forced.\n */\n background-color: white;\n /*\n * Verdana is an accessible font that can be used without requiring additional loading time.\n */\n font-family: Verdana;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n * {\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n hyphens: auto;\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n word-break: break-word;\n }\n /*\n * All interactive elements should have a minimum size of to-rem(44).\n */\n /* input:not([type='checkbox'], [type='radio'], [type='range']), */\n /* option, */\n /* select, */\n /* textarea, */\n [role=button],\n button:not([role=link]),\n .kol-input .input {\n min-width: var(--a11y-min-size);\n min-height: var(--a11y-min-size);\n }\n /*\n * Some interactive elements should not inherit the font-family and font-size.\n */\n a,\n button,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n input,\n option,\n select,\n textarea {\n /*\n * All elements should inherit the font family from his parent element.\n */\n font-family: inherit;\n /*\n * All elements should inherit the font size from his parent element.\n */\n font-size: inherit;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n /**\n * Sometimes we need the semantic element for accessibility reasons,\n * but we don't want to show it.\n *\n * - https://www.a11yproject.com/posts/how-to-hide-content/\n */\n .visually-hidden {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n white-space: nowrap;\n clip: rect(0 0 0 0);\n clip-path: inset(50%);\n }\n}\n@layer kol-global {\n /*\n * Dieses CSS stellt sicher, dass der Standard-Style\n * von A und Button resettet werden.\n */\n :is(a, button) {\n background-color: transparent;\n width: 100%;\n margin: 0;\n padding: 0;\n border: none;\n /* 100% needed for custom width from outside */\n }\n /*\n * Ensure elements with hidden attribute to be actually not visible\n * @see https://meowni.ca/hidden.is.a.lie.html\n */\n [hidden] {\n display: none !important;\n }\n .badge-text-hint {\n color: black;\n background-color: lightgray;\n }\n}\n@layer kol-global {\n :host {\n /*\n * The max-width is needed to prevent the table from overflowing the\n * parent node, if the table is wider than the parent node.\n */\n max-width: 100%;\n font-size: calc(16rem / var(--kolibri-root-font-size, 16));\n }\n * {\n /*\n * We prefer to box-sizing: border-box for all elements.\n */\n box-sizing: border-box;\n }\n .kol-span {\n /* KolSpan is a layout component with icons in all directions and a label text in the middle. */\n display: grid;\n place-items: center;\n /* The sub span in KolSpan is the horizontal span with icon left and right and the label text in the middle. */\n }\n .kol-span__container {\n display: flex;\n place-items: center;\n }\n a,\n button {\n cursor: pointer;\n }\n .kol-span .kol-span__label--hide-label .kol-span__label {\n display: none;\n }\n /* Reset browser agent style. */\n button:disabled {\n color: unset;\n }\n .disabled label,\n .disabled:focus-within label,\n [aria-disabled=true],\n [aria-disabled=true]:focus,\n [disabled],\n [disabled]:focus {\n opacity: 0.5;\n outline: none;\n cursor: not-allowed;\n }\n [aria-disabled=true]:focus .kol-span,\n [disabled]:focus .kol-span {\n outline: none !important;\n }\n}\n@layer kol-component {\n :host {\n display: block;\n }\n}\n@layer kol-component {\n @keyframes fadeInOpacity {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n .kol-tooltip {\n display: contents;\n contain: layout;\n }\n .kol-tooltip__floating {\n display: none;\n position: fixed;\n /* Avoid layout interference - see https://floating-ui.com/docs/computePosition */\n top: 0;\n left: 0;\n /* Can be used to specify the tooltip-width from the outside. Unset by default. */\n width: var(--kol-tooltip-width);\n max-width: 90vw;\n max-height: 90vh;\n visibility: hidden;\n animation-duration: 0.25s;\n animation-iteration-count: 1;\n animation-name: fadeInOpacity;\n animation-timing-function: ease-in;\n }\n .kol-tooltip__arrow {\n transform: rotate(45deg);\n color: #000;\n background-color: #fff;\n position: absolute;\n z-index: 999;\n width: calc(10rem / var(--kolibri-root-font-size, 16));\n height: calc(10rem / var(--kolibri-root-font-size, 16));\n }\n .kol-tooltip__content {\n color: #000;\n background-color: #fff;\n position: relative;\n z-index: 1000;\n }\n}\n@layer kol-component {\n .kol-alert {\n display: grid;\n }\n .kol-alert__container {\n display: flex;\n place-items: center;\n }\n .kol-alert__container-content {\n flex-grow: 1;\n }\n .kol-alert__closer {\n /* Visible with forced colors */\n outline: transparent solid calc(1rem / var(--kolibri-root-font-size, 16));\n }\n}\n@layer kol-component {\n :host {\n display: inline-block;\n }\n .kol-button {\n display: inline-flex;\n place-items: center;\n font-style: calc(16rem / var(--kolibri-root-font-size, 16));\n text-align: center;\n text-decoration-line: none;\n }\n .kol-button::before {\n /* Render zero-width character as first element to set the baseline correctly. */\n content: \"​\";\n }\n .kol-button__text {\n width: 100%;\n margin: auto;\n }\n}\n@layer kol-component {\n .kol-popover-button__button {\n display: inline-block;\n }\n .kol-popover-button__popover {\n margin: 0;\n padding: 0;\n border: 0;\n }\n}\n@layer kol-component {\n .kol-table-settings {\n background: #fff;\n position: absolute;\n top: 0;\n right: 0;\n z-index: 1;\n }\n .kol-table-settings__columns-container {\n max-height: calc(200rem / var(--kolibri-root-font-size, 16));\n margin-top: calc(16rem / var(--kolibri-root-font-size, 16));\n overflow: auto;\n }\n .kol-table-settings__columns {\n display: grid;\n overflow: hidden;\n gap: calc(8rem / var(--kolibri-root-font-size, 16));\n align-items: center;\n grid-auto-rows: min-content;\n grid-template-columns: min-content 1fr calc(100rem / var(--kolibri-root-font-size, 16)) auto auto;\n }\n .kol-table-settings__column {\n display: contents;\n }\n}\n@layer kol-component {\n .kol-table {\n display: block;\n position: relative;\n max-width: 100%;\n }\n .kol-table__scroll-container {\n overflow-x: auto;\n overflow-y: hidden;\n }\n .kol-table:has(.kol-table__focus-element:focus) .kol-table__scroll-container {\n /* @see https://remysharp.com/til/css/focus-ring-default-styles */\n outline: 5px auto Highlight;\n outline: 5px auto -webkit-focus-ring-color;\n outline-offset: 2px;\n }\n .kol-table__table {\n width: 100%;\n }\n .kol-table__caption {\n min-height: var(--a11y-min-size);\n padding-right: var(--a11y-min-size);\n text-align: start;\n }\n .kol-table__focus-element {\n font-size: 0;\n }\n .kol-table__sort-button .kol-button {\n color: inherit;\n }\n .kol-table__body {\n text-align: left;\n }\n .kol-table__body .kol-button__text {\n justify-items: start;\n }\n .kol-table__cell--align-left {\n text-align: left;\n }\n .kol-table__cell--align-left .kol-button__text {\n justify-items: start;\n }\n .kol-table__cell--align-center {\n text-align: center;\n }\n .kol-table__cell--align-center .kol-button__text {\n justify-items: center;\n }\n .kol-table__cell--align-right {\n text-align: right;\n }\n .kol-table__cell--align-right .kol-button__text {\n justify-items: end;\n }\n .kol-table__cell--selection {\n width: var(--a11y-min-size);\n height: var(--a11y-min-size);\n white-space: nowrap;\n }\n .kol-table__spacer {\n display: none;\n }\n .kol-table__selection-label {\n display: flex;\n position: relative;\n width: var(--a11y-min-size);\n height: var(--a11y-min-size);\n align-items: center;\n justify-content: center;\n cursor: pointer;\n }\n .kol-table__selection-label--disabled {\n cursor: not-allowed;\n }\n .kol-table__selection-icon {\n display: block;\n position: absolute;\n inset: auto;\n z-index: 1;\n }\n .kol-table__selection-input {\n border-style: solid;\n margin: 0;\n appearance: none;\n cursor: pointer;\n }\n .kol-table__selection-input:disabled {\n cursor: not-allowed;\n }\n .kol-table__selection-input:before {\n content: \"\";\n }\n .kol-table__selection-input--checkbox {\n background-color: rgb(255, 255, 255);\n display: flex;\n position: relative;\n width: calc(var(--a11y-min-size) / 2);\n height: calc(var(--a11y-min-size) / 2);\n border-width: 2px;\n align-items: center;\n justify-content: center;\n line-height: 1.5;\n }\n .kol-table__selection-input--radio {\n border-radius: 100%;\n display: flex;\n width: 1.5em;\n min-width: 1.5em;\n height: 1.5em;\n min-height: 1.5em;\n padding: 0;\n border-width: 2px;\n }\n .kol-table__selection-input--radio:before {\n border-radius: 100%;\n width: 0.75em;\n height: 0.75em;\n margin: auto;\n }\n .kol-table__selection-input--radio:checked:before {\n background-color: #000;\n }\n @media (forced-colors: active) {\n .kol-table__selection-input--radio:checked:before {\n /* Give it a visible background in forced colors mode */\n background-color: selectedItem !important;\n }\n }\n}",KolTableStateless=class{constructor(n){registerInstance(this,n)}render(){return h(KolTableStatelessWcTag,{key:"2d2c2f809dd9393cbdc39e9e229119b900765592",_data:this._data,_dataFoot:this._dataFoot,_headerCells:this._headerCells,_label:this._label,_minWidth:this._minWidth,_on:this._on,_selection:this._selection,_tableSettings:this._tableSettings})}};KolTableStateless.style={default:defaultStyleCss};export{KolTableStateless as kol_table_stateless};
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * KoliBri - The accessible HTML-Standard
3
3
  */
4
- import{r as registerInstance,h,g as getElement}from"./index-BwHVuv1c.js";import{w as watchValidator,d as watchBoolean,j as devHint,s as setState,N as watchNumber,H as watchJsonArrayString,I as uiUxHintMillerscheZahl,P as koliBriQuerySelector}from"./common-7RW_NFNf.js";import{v as validateAlign}from"./align-DoCRbhrp.js";import{v as validateLabel}from"./label-DAfXJvJZ.js";import{t as translate}from"./i18n-yBVLeHdv.js";import{d as KolButtonWcTag}from"./component-names-CkE54Ym7.js";import{K as KeyboardKey}from"./keyboard-D6PoWr38.js";import{d as dispatchDomEvent,K as KolEvent}from"./events-CoPFQEiC.js";import{c as clsx}from"./clsx-eK3rPvPS.js";import"./i18n-CjhRejiw.js";const tabBehaviorPropTypeOptions=["select-automatic","select-manual"],validateTabBehavior=(t,e)=>{watchValidator(t,"_behavior",(t=>"string"==typeof t&&tabBehaviorPropTypeOptions.includes(t)),new Set([`KoliBriTabBehavior {${tabBehaviorPropTypeOptions.join(", ")}`]),e)},validateHasCreateButton=(t,e)=>{watchBoolean(t,"_hasCreateButton",e)},defaultStyleCss="/* forward the rem function */\n/*\n * This file contains all rules for accessibility.\n */\n@layer kol-a11y {\n :host {\n /*\n * Minimum size of interactive elements.\n */\n --a11y-min-size: calc(44rem / var(--kolibri-root-font-size, 16));\n color: black;\n /*\n * No element should be used without a background and font color whose contrast ratio has\n * not been checked. By initially setting the background color to white and the font color\n * to black, the contrast ratio is ensured and explicit adjustment is forced.\n */\n background-color: white;\n /*\n * Verdana is an accessible font that can be used without requiring additional loading time.\n */\n font-family: Verdana;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n * {\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n hyphens: auto;\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n word-break: break-word;\n }\n /*\n * All interactive elements should have a minimum size of to-rem(44).\n */\n /* input:not([type='checkbox'], [type='radio'], [type='range']), */\n /* option, */\n /* select, */\n /* textarea, */\n [role=button],\n button:not([role=link]),\n .kol-input .input {\n min-width: var(--a11y-min-size);\n min-height: var(--a11y-min-size);\n }\n /*\n * Some interactive elements should not inherit the font-family and font-size.\n */\n a,\n button,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n input,\n option,\n select,\n textarea {\n /*\n * All elements should inherit the font family from his parent element.\n */\n font-family: inherit;\n /*\n * All elements should inherit the font size from his parent element.\n */\n font-size: inherit;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n /**\n * Sometimes we need the semantic element for accessibility reasons,\n * but we don't want to show it.\n *\n * - https://www.a11yproject.com/posts/how-to-hide-content/\n */\n .visually-hidden {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n white-space: nowrap;\n clip: rect(0 0 0 0);\n clip-path: inset(50%);\n }\n}\n@layer kol-global {\n /*\n * Dieses CSS stellt sicher, dass der Standard-Style\n * von A und Button resettet werden.\n */\n :is(a, button) {\n background-color: transparent;\n width: 100%;\n margin: 0;\n padding: 0;\n border: none;\n /* 100% needed for custom width from outside */\n }\n /*\n * Ensure elements with hidden attribute to be actually not visible\n * @see https://meowni.ca/hidden.is.a.lie.html\n */\n [hidden] {\n display: none !important;\n }\n .badge-text-hint {\n color: black;\n background-color: lightgray;\n }\n}\n@layer kol-global {\n :host {\n /*\n * The max-width is needed to prevent the table from overflowing the\n * parent node, if the table is wider than the parent node.\n */\n max-width: 100%;\n font-size: calc(16rem / var(--kolibri-root-font-size, 16));\n }\n * {\n /*\n * We prefer to box-sizing: border-box for all elements.\n */\n box-sizing: border-box;\n }\n .kol-span {\n /* KolSpan is a layout component with icons in all directions and a label text in the middle. */\n display: grid;\n place-items: center;\n /* The sub span in KolSpan is the horizontal span with icon left and right and the label text in the middle. */\n }\n .kol-span__container {\n display: flex;\n place-items: center;\n }\n a,\n button {\n cursor: pointer;\n }\n .kol-span .kol-span__label--hide-label .kol-span__label {\n display: none;\n }\n /* Reset browser agent style. */\n button:disabled {\n color: unset;\n }\n .disabled label,\n .disabled:focus-within label,\n [aria-disabled=true],\n [aria-disabled=true]:focus,\n [disabled],\n [disabled]:focus {\n opacity: 0.5;\n outline: none;\n cursor: not-allowed;\n }\n [aria-disabled=true]:focus .kol-span,\n [disabled]:focus .kol-span {\n outline: none !important;\n }\n}\n@layer kol-component {\n :host {\n display: block;\n }\n}\n@layer kol-component {\n @keyframes fadeInOpacity {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n .kol-tooltip {\n display: contents;\n contain: layout;\n }\n .kol-tooltip__floating {\n display: none;\n position: fixed;\n /* Avoid layout interference - see https://floating-ui.com/docs/computePosition */\n top: 0;\n left: 0;\n /* Can be used to specify the tooltip-width from the outside. Unset by default. */\n width: var(--kol-tooltip-width);\n max-width: 90vw;\n max-height: 90vh;\n visibility: hidden;\n animation-duration: 0.25s;\n animation-iteration-count: 1;\n animation-name: fadeInOpacity;\n animation-timing-function: ease-in;\n }\n .kol-tooltip__arrow {\n transform: rotate(45deg);\n color: #000;\n background-color: #fff;\n position: absolute;\n z-index: 999;\n width: calc(10rem / var(--kolibri-root-font-size, 16));\n height: calc(10rem / var(--kolibri-root-font-size, 16));\n }\n .kol-tooltip__content {\n color: #000;\n background-color: #fff;\n position: relative;\n z-index: 1000;\n }\n}\n@layer kol-component {\n .kol-tabs {\n display: var(--display);\n grid-template-columns: var(--grid-template-columns);\n grid-template-rows: var(--grid-template-rows);\n }\n .kol-tabs--align-right {\n --display: grid;\n --grid-template-columns: 1fr auto;\n --button-group-flex-direction: column;\n --button-group-order: 2;\n }\n .kol-tabs--align-left {\n --display: grid;\n --grid-template-columns: auto 1fr;\n --button-group-flex-direction: column;\n --button-group-order: 0;\n }\n .kol-tabs--align-bottom {\n --display: grid;\n --grid-template-rows: 1fr auto;\n --button-group-order: 2;\n }\n .kol-tabs__tabs-align-top {\n --display: grid;\n --grid-template-rows: auto 1fr;\n --button-group-order: 0;\n }\n .kol-tabs__content {\n overflow: auto;\n }\n .kol-tabs__button-group {\n display: flex;\n order: var(--button-group-order);\n flex-direction: var(--button-group-flex-direction);\n flex-wrap: wrap;\n }\n .kol-tabs__button-group .kol-button {\n border-bottom-color: transparent;\n display: block;\n border-bottom-style: solid;\n }\n .kol-tabs__panel {\n height: 100%;\n }\n}",KolTabs=class{constructor(t){registerInstance(this,t),this.onCreateLabel=`${translate("kol-new")} …`,this.nextPossibleTabIndex=(t,e,n=1)=>{const a=e+n;return a<t.length?t[a]._disabled?this.nextPossibleTabIndex(t,e,n+1):a:e},this.prevPossibleTabIndex=(t,e,n=1)=>{const a=e-n;return a>=0?t[a]._disabled?this.prevPossibleTabIndex(t,e,n+1):a:e},this.onKeyDown=t=>{switch(t.key){case KeyboardKey.ArrowRight:this.goToNextTab(t);break;case KeyboardKey.ArrowLeft:this.goToPreviousTab(t);break;case KeyboardKey.Space:case KeyboardKey.Enter:this.activateFocusedTab(t)}},this.onClickSelect=(t,e)=>{this.selectNextTabEvent(t,e)},this.onMouseDown=t=>{t.preventDefault()},this.callbacks={onClick:this.onClickSelect,onMouseDown:this.onMouseDown},this.catchTabPanelHost=t=>{this.tabPanelHost=t},this._align="top",this._hasCreateButton=!1,this._selected=0,this.state={_align:"top",_label:"",_selected:0,_tabs:[]},this.selectNextNotDisabledTab=(t,e,n=!0,a)=>{if(t>e.length-1&&(t=e.length-1),t<0&&(t=0),Array.isArray(e)&&e[t]&&e[t]._disabled){if(!0===n){if(t<e.length-1)return this.selectNextNotDisabledTab(t+1,e,!0,a||t);t=a||t,n=!1}if(!1===n){if(t>0)return this.selectNextNotDisabledTab(t-1,e,!1,a||t);devHint("[KolTabs] All tabs are disabled, and therefore no tab can be displayed.")}}return t},this.syncSelectedAndTabs=(t,e,n,a)=>{let o,i;o="_selected"===a?t:this.state._selected,i="_tabs"===a?t:this.state._tabs,i.length>0&&e.set("_selected",this.selectNextNotDisabledTab(o,i))},this.refreshTabPanels=()=>{var t,e,n,a;if(this.tabPanelHost){for(;this.tabPanelHost.firstChild;)this.tabPanelHost.removeChild(this.tabPanelHost.firstChild);for(let o=0;o<(null===(t=this.state._tabs)||void 0===t?void 0:t.length);o++){const t=document.createElement("div");t.setAttribute("aria-labelledby",`${this.state._label.replace(/\s/g,"-")}-tab-${o}`),t.setAttribute("id",`tabpanel-${o}`),t.setAttribute("role","tabpanel"),t.setAttribute("hidden","");const i=document.createElement("slot");i.setAttribute("name",`tabpanel-slot-${o}`),t.appendChild(i),null===(e=this.tabPanelHost)||void 0===e||e.appendChild(t),"undefined"!=typeof HTMLCollection&&(null===(n=this.host)||void 0===n?void 0:n.children)instanceof HTMLCollection&&(null===(a=this.host)||void 0===a?void 0:a.children[o])&&this.host.children[o].setAttribute("slot",`tabpanel-slot-${o}`)}this.updateVisiblePanel()}},this.updateVisiblePanel=()=>{this.tabPanelHost&&Array.from(this.tabPanelHost.children).forEach(((t,e)=>{e===this.state._selected?t.removeAttribute("hidden"):t.setAttribute("hidden","")}))},this.onCreate=t=>{var e,n;t.preventDefault(),null===(n=null===(e=this.state._on)||void 0===e?void 0:e.onCreate)||void 0===n||n.call(e,t),this.host&&dispatchDomEvent(this.host,KolEvent.create)},this.onBlur=()=>{this.currentFocusIndex=void 0}}getCurrentFocusIndex(){return"number"==typeof this.currentFocusIndex?this.currentFocusIndex:this.state._selected}getKeyboardTabChangeMode(){return"select-manual"===this._behavior?"selectFocusOnly":"activateCompletely"}goToNextTab(t){const e=this.nextPossibleTabIndex(this.state._tabs,this.getCurrentFocusIndex());this.selectNextTabEvent(t,e,this.getKeyboardTabChangeMode())}goToPreviousTab(t){const e=this.prevPossibleTabIndex(this.state._tabs,this.getCurrentFocusIndex());this.selectNextTabEvent(t,e,this.getKeyboardTabChangeMode())}activateFocusedTab(t){"number"==typeof this.currentFocusIndex&&this.onSelect(t,this.currentFocusIndex)}selectNextTabEvent(t,e,n="activateCompletely"){var a,o;if(this.currentFocusIndex=e,this.focusTabById(e),"activateCompletely"===n){this._selected=e;null===(o=null===(a=this.state._tabs[e]._on)||void 0===a?void 0:a.onSelect)||void 0===o||o.call(a,t,e),this.onSelect(t,e)}}renderButtonGroup(){return h("div",{"aria-label":this.state._label,class:"kol-tabs__button-group",role:"tablist",onKeyDown:this.onKeyDown,onBlur:this.onBlur},this.state._tabs.map(((t,e)=>h(KolButtonWcTag,{_disabled:t._disabled,_icons:t._icons,_hideLabel:t._hideLabel,_label:t._label,_on:this.callbacks,_tabIndex:this.state._selected===e?0:-1,_tooltipAlign:t._tooltipAlign,_buttonVariant:this.state._selected===e?"custom":void 0,_customClass:this.state._selected===e?"selected":void 0,_ariaControls:`tabpanel-${e}`,_ariaSelected:this.state._selected===e,_id:`${this.state._label.replace(/\s/g,"-")}-tab-${e}`,_role:"tab",_value:e}))),this.state._hasCreateButton&&h(KolButtonWcTag,{class:"kol-tabs__button-create",_label:this.onCreateLabel,_on:{onClick:this.onCreate},_icons:"codicon codicon-plus","data-testid":"tabs-create-button"}))}render(){return h("div",{key:"c90d53464702512863a3483602ed15645a6c0484",ref:t=>{this.tabPanelsElement=t},class:clsx("kol-tabs",`kol-tabs--align-${this.state._align}`)},this.renderButtonGroup(),h("div",{key:"3e172f4835867233726b1ae2081e3a6729eb3b83",class:"kol-tabs__content",ref:this.catchTabPanelHost}))}validateAlign(t){validateAlign(this,t)}validateBehavior(t){validateTabBehavior(this,t)}validateHasCreateButton(t){validateHasCreateButton(this,t)}validateLabel(t){validateLabel(this,t,{required:!0})}validateOn(t){if("object"==typeof t&&null!==t){const e={};"function"==typeof t.onCreate&&(e.onCreate=t.onCreate),"function"==typeof t.onSelect&&(e.onSelect=t.onSelect),setState(this,"_on",e)}}validateSelected(t){watchNumber(this,"_selected",t,{hooks:{beforePatch:this.syncSelectedAndTabs}})}validateTabs(t){watchJsonArrayString(this,"_tabs",(t=>"object"==typeof t&&null!==t&&"string"==typeof t._label&&t._label.length>0),t,void 0,{hooks:{beforePatch:this.syncSelectedAndTabs,afterPatch:this.refreshTabPanels}}),uiUxHintMillerscheZahl("KolTabs",this.state._tabs.length)}componentWillLoad(){this.validateAlign(this._align),this.validateLabel(this._label),this.validateOn(this._on),this.validateSelected(this._selected),this.validateTabs(this._tabs),this.validateBehavior(this._behavior),this.validateHasCreateButton(this._hasCreateButton)}componentDidRender(){this.refreshTabPanels()}focusTabById(t){if(this.tabPanelsElement){const e=koliBriQuerySelector(`button#${this.state._label.replace(/\s/g,"-")}-tab-${t}`,this.tabPanelsElement);null==e||e.focus()}}onSelect(t,e){var n,a;null===(a=null===(n=this._on)||void 0===n?void 0:n.onSelect)||void 0===a||a.call(n,t,e),this.host&&dispatchDomEvent(this.host,KolEvent.select,e),this.focusTabById(e)}get host(){return getElement(this)}static get watchers(){return{_align:["validateAlign"],_behavior:["validateBehavior"],_hasCreateButton:["validateHasCreateButton"],_label:["validateLabel"],_on:["validateOn"],_selected:["validateSelected"],_tabs:["validateTabs"]}}};KolTabs.style={default:defaultStyleCss};export{KolTabs as kol_tabs};
4
+ import{r as registerInstance,h,g as getElement}from"./index-DTM8XbOu.js";import{w as watchValidator,d as watchBoolean,j as devHint,s as setState,N as watchNumber,H as watchJsonArrayString,I as uiUxHintMillerscheZahl,P as koliBriQuerySelector}from"./common-7RW_NFNf.js";import{v as validateAlign}from"./align-DoCRbhrp.js";import{v as validateLabel}from"./label-DAfXJvJZ.js";import{t as translate}from"./i18n-yBVLeHdv.js";import{d as KolButtonWcTag}from"./component-names-CkE54Ym7.js";import{K as KeyboardKey}from"./keyboard-D6PoWr38.js";import{d as dispatchDomEvent,K as KolEvent}from"./events-CoPFQEiC.js";import{c as clsx}from"./clsx-eK3rPvPS.js";import"./i18n-CjhRejiw.js";const tabBehaviorPropTypeOptions=["select-automatic","select-manual"],validateTabBehavior=(t,e)=>{watchValidator(t,"_behavior",(t=>"string"==typeof t&&tabBehaviorPropTypeOptions.includes(t)),new Set([`KoliBriTabBehavior {${tabBehaviorPropTypeOptions.join(", ")}`]),e)},validateHasCreateButton=(t,e)=>{watchBoolean(t,"_hasCreateButton",e)},defaultStyleCss="/* forward the rem function */\n/*\n * This file contains all rules for accessibility.\n */\n@layer kol-a11y {\n :host {\n /*\n * Minimum size of interactive elements.\n */\n --a11y-min-size: calc(44rem / var(--kolibri-root-font-size, 16));\n color: black;\n /*\n * No element should be used without a background and font color whose contrast ratio has\n * not been checked. By initially setting the background color to white and the font color\n * to black, the contrast ratio is ensured and explicit adjustment is forced.\n */\n background-color: white;\n /*\n * Verdana is an accessible font that can be used without requiring additional loading time.\n */\n font-family: Verdana;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n * {\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n hyphens: auto;\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n word-break: break-word;\n }\n /*\n * All interactive elements should have a minimum size of to-rem(44).\n */\n /* input:not([type='checkbox'], [type='radio'], [type='range']), */\n /* option, */\n /* select, */\n /* textarea, */\n [role=button],\n button:not([role=link]),\n .kol-input .input {\n min-width: var(--a11y-min-size);\n min-height: var(--a11y-min-size);\n }\n /*\n * Some interactive elements should not inherit the font-family and font-size.\n */\n a,\n button,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n input,\n option,\n select,\n textarea {\n /*\n * All elements should inherit the font family from his parent element.\n */\n font-family: inherit;\n /*\n * All elements should inherit the font size from his parent element.\n */\n font-size: inherit;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n /**\n * Sometimes we need the semantic element for accessibility reasons,\n * but we don't want to show it.\n *\n * - https://www.a11yproject.com/posts/how-to-hide-content/\n */\n .visually-hidden {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n white-space: nowrap;\n clip: rect(0 0 0 0);\n clip-path: inset(50%);\n }\n}\n@layer kol-global {\n /*\n * Dieses CSS stellt sicher, dass der Standard-Style\n * von A und Button resettet werden.\n */\n :is(a, button) {\n background-color: transparent;\n width: 100%;\n margin: 0;\n padding: 0;\n border: none;\n /* 100% needed for custom width from outside */\n }\n /*\n * Ensure elements with hidden attribute to be actually not visible\n * @see https://meowni.ca/hidden.is.a.lie.html\n */\n [hidden] {\n display: none !important;\n }\n .badge-text-hint {\n color: black;\n background-color: lightgray;\n }\n}\n@layer kol-global {\n :host {\n /*\n * The max-width is needed to prevent the table from overflowing the\n * parent node, if the table is wider than the parent node.\n */\n max-width: 100%;\n font-size: calc(16rem / var(--kolibri-root-font-size, 16));\n }\n * {\n /*\n * We prefer to box-sizing: border-box for all elements.\n */\n box-sizing: border-box;\n }\n .kol-span {\n /* KolSpan is a layout component with icons in all directions and a label text in the middle. */\n display: grid;\n place-items: center;\n /* The sub span in KolSpan is the horizontal span with icon left and right and the label text in the middle. */\n }\n .kol-span__container {\n display: flex;\n place-items: center;\n }\n a,\n button {\n cursor: pointer;\n }\n .kol-span .kol-span__label--hide-label .kol-span__label {\n display: none;\n }\n /* Reset browser agent style. */\n button:disabled {\n color: unset;\n }\n .disabled label,\n .disabled:focus-within label,\n [aria-disabled=true],\n [aria-disabled=true]:focus,\n [disabled],\n [disabled]:focus {\n opacity: 0.5;\n outline: none;\n cursor: not-allowed;\n }\n [aria-disabled=true]:focus .kol-span,\n [disabled]:focus .kol-span {\n outline: none !important;\n }\n}\n@layer kol-component {\n :host {\n display: block;\n }\n}\n@layer kol-component {\n @keyframes fadeInOpacity {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n .kol-tooltip {\n display: contents;\n contain: layout;\n }\n .kol-tooltip__floating {\n display: none;\n position: fixed;\n /* Avoid layout interference - see https://floating-ui.com/docs/computePosition */\n top: 0;\n left: 0;\n /* Can be used to specify the tooltip-width from the outside. Unset by default. */\n width: var(--kol-tooltip-width);\n max-width: 90vw;\n max-height: 90vh;\n visibility: hidden;\n animation-duration: 0.25s;\n animation-iteration-count: 1;\n animation-name: fadeInOpacity;\n animation-timing-function: ease-in;\n }\n .kol-tooltip__arrow {\n transform: rotate(45deg);\n color: #000;\n background-color: #fff;\n position: absolute;\n z-index: 999;\n width: calc(10rem / var(--kolibri-root-font-size, 16));\n height: calc(10rem / var(--kolibri-root-font-size, 16));\n }\n .kol-tooltip__content {\n color: #000;\n background-color: #fff;\n position: relative;\n z-index: 1000;\n }\n}\n@layer kol-component {\n .kol-tabs {\n display: var(--display);\n grid-template-columns: var(--grid-template-columns);\n grid-template-rows: var(--grid-template-rows);\n }\n .kol-tabs--align-right {\n --display: grid;\n --grid-template-columns: 1fr auto;\n --button-group-flex-direction: column;\n --button-group-order: 2;\n }\n .kol-tabs--align-left {\n --display: grid;\n --grid-template-columns: auto 1fr;\n --button-group-flex-direction: column;\n --button-group-order: 0;\n }\n .kol-tabs--align-bottom {\n --display: grid;\n --grid-template-rows: 1fr auto;\n --button-group-order: 2;\n }\n .kol-tabs__tabs-align-top {\n --display: grid;\n --grid-template-rows: auto 1fr;\n --button-group-order: 0;\n }\n .kol-tabs__content {\n overflow: auto;\n }\n .kol-tabs__button-group {\n display: flex;\n order: var(--button-group-order);\n flex-direction: var(--button-group-flex-direction);\n flex-wrap: wrap;\n }\n .kol-tabs__button-group .kol-button {\n border-bottom-color: transparent;\n display: block;\n border-bottom-style: solid;\n }\n .kol-tabs__panel {\n height: 100%;\n }\n}",KolTabs=class{constructor(t){registerInstance(this,t),this.onCreateLabel=`${translate("kol-new")} …`,this.nextPossibleTabIndex=(t,e,n=1)=>{const a=e+n;return a<t.length?t[a]._disabled?this.nextPossibleTabIndex(t,e,n+1):a:e},this.prevPossibleTabIndex=(t,e,n=1)=>{const a=e-n;return a>=0?t[a]._disabled?this.prevPossibleTabIndex(t,e,n+1):a:e},this.onKeyDown=t=>{switch(t.key){case KeyboardKey.ArrowRight:this.goToNextTab(t);break;case KeyboardKey.ArrowLeft:this.goToPreviousTab(t);break;case KeyboardKey.Space:case KeyboardKey.Enter:this.activateFocusedTab(t)}},this.onClickSelect=(t,e)=>{this.selectNextTabEvent(t,e)},this.onMouseDown=t=>{t.preventDefault()},this.callbacks={onClick:this.onClickSelect,onMouseDown:this.onMouseDown},this.catchTabPanelHost=t=>{this.tabPanelHost=t},this._align="top",this._hasCreateButton=!1,this._selected=0,this.state={_align:"top",_label:"",_selected:0,_tabs:[]},this.selectNextNotDisabledTab=(t,e,n=!0,a)=>{if(t>e.length-1&&(t=e.length-1),t<0&&(t=0),Array.isArray(e)&&e[t]&&e[t]._disabled){if(!0===n){if(t<e.length-1)return this.selectNextNotDisabledTab(t+1,e,!0,a||t);t=a||t,n=!1}if(!1===n){if(t>0)return this.selectNextNotDisabledTab(t-1,e,!1,a||t);devHint("[KolTabs] All tabs are disabled, and therefore no tab can be displayed.")}}return t},this.syncSelectedAndTabs=(t,e,n,a)=>{let o,i;o="_selected"===a?t:this.state._selected,i="_tabs"===a?t:this.state._tabs,i.length>0&&e.set("_selected",this.selectNextNotDisabledTab(o,i))},this.refreshTabPanels=()=>{var t,e,n,a;if(this.tabPanelHost){for(;this.tabPanelHost.firstChild;)this.tabPanelHost.removeChild(this.tabPanelHost.firstChild);for(let o=0;o<(null===(t=this.state._tabs)||void 0===t?void 0:t.length);o++){const t=document.createElement("div");t.setAttribute("aria-labelledby",`${this.state._label.replace(/\s/g,"-")}-tab-${o}`),t.setAttribute("id",`tabpanel-${o}`),t.setAttribute("role","tabpanel"),t.setAttribute("hidden","");const i=document.createElement("slot");i.setAttribute("name",`tabpanel-slot-${o}`),t.appendChild(i),null===(e=this.tabPanelHost)||void 0===e||e.appendChild(t),"undefined"!=typeof HTMLCollection&&(null===(n=this.host)||void 0===n?void 0:n.children)instanceof HTMLCollection&&(null===(a=this.host)||void 0===a?void 0:a.children[o])&&this.host.children[o].setAttribute("slot",`tabpanel-slot-${o}`)}this.updateVisiblePanel()}},this.updateVisiblePanel=()=>{this.tabPanelHost&&Array.from(this.tabPanelHost.children).forEach(((t,e)=>{e===this.state._selected?t.removeAttribute("hidden"):t.setAttribute("hidden","")}))},this.onCreate=t=>{var e,n;t.preventDefault(),null===(n=null===(e=this.state._on)||void 0===e?void 0:e.onCreate)||void 0===n||n.call(e,t),this.host&&dispatchDomEvent(this.host,KolEvent.create)},this.onBlur=()=>{this.currentFocusIndex=void 0}}getCurrentFocusIndex(){return"number"==typeof this.currentFocusIndex?this.currentFocusIndex:this.state._selected}getKeyboardTabChangeMode(){return"select-manual"===this._behavior?"selectFocusOnly":"activateCompletely"}goToNextTab(t){const e=this.nextPossibleTabIndex(this.state._tabs,this.getCurrentFocusIndex());this.selectNextTabEvent(t,e,this.getKeyboardTabChangeMode())}goToPreviousTab(t){const e=this.prevPossibleTabIndex(this.state._tabs,this.getCurrentFocusIndex());this.selectNextTabEvent(t,e,this.getKeyboardTabChangeMode())}activateFocusedTab(t){"number"==typeof this.currentFocusIndex&&this.onSelect(t,this.currentFocusIndex)}selectNextTabEvent(t,e,n="activateCompletely"){var a,o;if(this.currentFocusIndex=e,this.focusTabById(e),"activateCompletely"===n){this._selected=e;null===(o=null===(a=this.state._tabs[e]._on)||void 0===a?void 0:a.onSelect)||void 0===o||o.call(a,t,e),this.onSelect(t,e)}}renderButtonGroup(){return h("div",{"aria-label":this.state._label,class:"kol-tabs__button-group",role:"tablist",onKeyDown:this.onKeyDown,onBlur:this.onBlur},this.state._tabs.map(((t,e)=>h(KolButtonWcTag,{_disabled:t._disabled,_icons:t._icons,_hideLabel:t._hideLabel,_label:t._label,_on:this.callbacks,_tabIndex:this.state._selected===e?0:-1,_tooltipAlign:t._tooltipAlign,_buttonVariant:this.state._selected===e?"custom":void 0,_customClass:this.state._selected===e?"selected":void 0,_ariaControls:`tabpanel-${e}`,_ariaSelected:this.state._selected===e,_id:`${this.state._label.replace(/\s/g,"-")}-tab-${e}`,_role:"tab",_value:e}))),this.state._hasCreateButton&&h(KolButtonWcTag,{class:"kol-tabs__button-create",_label:this.onCreateLabel,_on:{onClick:this.onCreate},_icons:"codicon codicon-plus","data-testid":"tabs-create-button"}))}render(){return h("div",{key:"c90d53464702512863a3483602ed15645a6c0484",ref:t=>{this.tabPanelsElement=t},class:clsx("kol-tabs",`kol-tabs--align-${this.state._align}`)},this.renderButtonGroup(),h("div",{key:"3e172f4835867233726b1ae2081e3a6729eb3b83",class:"kol-tabs__content",ref:this.catchTabPanelHost}))}validateAlign(t){validateAlign(this,t)}validateBehavior(t){validateTabBehavior(this,t)}validateHasCreateButton(t){validateHasCreateButton(this,t)}validateLabel(t){validateLabel(this,t,{required:!0})}validateOn(t){if("object"==typeof t&&null!==t){const e={};"function"==typeof t.onCreate&&(e.onCreate=t.onCreate),"function"==typeof t.onSelect&&(e.onSelect=t.onSelect),setState(this,"_on",e)}}validateSelected(t){watchNumber(this,"_selected",t,{hooks:{beforePatch:this.syncSelectedAndTabs}})}validateTabs(t){watchJsonArrayString(this,"_tabs",(t=>"object"==typeof t&&null!==t&&"string"==typeof t._label&&t._label.length>0),t,void 0,{hooks:{beforePatch:this.syncSelectedAndTabs,afterPatch:this.refreshTabPanels}}),uiUxHintMillerscheZahl("KolTabs",this.state._tabs.length)}componentWillLoad(){this.validateAlign(this._align),this.validateLabel(this._label),this.validateOn(this._on),this.validateSelected(this._selected),this.validateTabs(this._tabs),this.validateBehavior(this._behavior),this.validateHasCreateButton(this._hasCreateButton)}componentDidRender(){this.refreshTabPanels()}focusTabById(t){if(this.tabPanelsElement){const e=koliBriQuerySelector(`button#${this.state._label.replace(/\s/g,"-")}-tab-${t}`,this.tabPanelsElement);null==e||e.focus()}}onSelect(t,e){var n,a;null===(a=null===(n=this._on)||void 0===n?void 0:n.onSelect)||void 0===a||a.call(n,t,e),this.host&&dispatchDomEvent(this.host,KolEvent.select,e),this.focusTabById(e)}get host(){return getElement(this)}static get watchers(){return{_align:["validateAlign"],_behavior:["validateBehavior"],_hasCreateButton:["validateHasCreateButton"],_label:["validateLabel"],_on:["validateOn"],_selected:["validateSelected"],_tabs:["validateTabs"]}}};KolTabs.style={default:defaultStyleCss};export{KolTabs as kol_tabs};
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * KoliBri - The accessible HTML-Standard
3
3
  */
4
- import{h,r as registerInstance,g as getElement}from"./index-BwHVuv1c.js";import{c as clsx}from"./clsx-eK3rPvPS.js";import{e as getDefaultProps,c as checkHasMsg,g as getRenderStates,a as convertMsgToInternMsg,F as FormFieldStateWrapper}from"./FormFieldStateWrapper-j7e0a3Oe.js";import{I as InputIconController,a as InputContainerStateWrapperFc}from"./controller-icon-D8NyK7bc.js";import{_ as __rest}from"./Heading-CdL171uD.js";import{w as watchValidator,e as watchString}from"./common-7RW_NFNf.js";import{n as nonce}from"./dev.utils-B25txGhq.js";import{a as validateHasCounter,v as validateMaxLengthBehavior,b as validateMaxLength}from"./max-length-behavior-BJuqKbOX.js";import{v as validatePlaceholder}from"./placeholder-ikSHqukt.js";import{v as validateReadOnly}from"./read-only-BAPnQth3.js";import{v as validateRequired}from"./required-DZ5CUsrb.js";import{v as validateRows}from"./rows-CRXE6nJb.js";import{v as validateSpellCheck}from"./spell-check-BwdT9MHK.js";import"./access-and-short-key-CIkiLGbP.js";import"./disabled-DOGGfuG4.js";import"./hide-label-B1sxX0if.js";import"./label-DAfXJvJZ.js";import"./tooltip-align-B_X7PRrT.js";import"./align-DoCRbhrp.js";import"./events-CoPFQEiC.js";import"./associated.controller-DWb-3J2w.js";import"./bootstrap-ChRg7xqg.js";import"./component-names-CkE54Ym7.js";import"./i18n-CjhRejiw.js";import"./isObject-DvSELytj.js";import"./Alert-CTk_PNsB.js";import"./i18n-yBVLeHdv.js";import"./bem-CwA0xXwr.js";import"./browser-D7tkBuSS.js";import"./InternalUnderlinedBadgeText-BTlxPf6n.js";import"./Icon-BFZ6Qv6o.js";import"./icons-mdo32hNB.js";const textareaResizeOptions=["vertical","none"],isTextareaResizePropType=e=>"string"==typeof e&&textareaResizeOptions.includes(e),validateResizeTextarea=(e,t)=>{watchValidator(e,"_resize",isTextareaResizePropType,new Set(textareaResizeOptions),t,{defaultValue:"vertical"})},TextAreaFc=e=>{const{class:t,msg:n,touched:a,readonly:i,disabled:o,required:l,ariaDescribedBy:r,hideLabel:s,label:d}=e,c=__rest(e,["class","msg","touched","readonly","disabled","required","ariaDescribedBy","hideLabel","label"]),u=checkHasMsg(n,a),p={"kol-textarea--disabled":Boolean(o),"kol-textarea--required":Boolean(l),"kol-textarea--touched":Boolean(a),"kol-textarea--readonly":Boolean(i),[`kol-textarea--${(null==n?void 0:n.type)||"error"}`]:u},m=Object.assign(Object.assign({class:clsx("kol-textarea",p,t),required:l,disabled:o,readonly:i},getDefaultProps({ariaDescribedBy:r,hideLabel:s,label:d})),c);return h("textarea",Object.assign({},m))};function getTextAreaProps(e,t){var n;const a=[...getRenderStates(e).ariaDescribedBy,...null!==(n=t.ariaDescribedBy)&&void 0!==n?n:[]],i=Object.assign(Object.assign({id:e._id,hideLabel:e._hideLabel,label:e._label,value:e._value,accessKey:e._accessKey,disabled:e._disabled,name:e._name,rows:e._rows,readonly:e._readOnly,required:e._required,placeholder:e._placeholder,touched:e._touched,msg:convertMsgToInternMsg(e._msg)},t),{ariaDescribedBy:a});return"_maxLength"in e&&"_maxLengthBehavior"in e&&"hard"===e._maxLengthBehavior&&(i.maxLength=e._maxLength),i}const TextAreaStateWrapper=e=>{var{state:t}=e,n=__rest(e,["state"]);return h(TextAreaFc,Object.assign({},getTextAreaProps(t,n)))};class TextareaController extends InputIconController{constructor(e,t,n){super(e,t,n),this.afterSyncCharCounter=()=>{"string"==typeof this.component._value&&(this.component.state._currentLength=this.component._value.length,this.updateCurrentLengthDebounced(this.component._value.length))},this.component=e}validateHasCounter(e){validateHasCounter(this.component,e)}validateMaxLengthBehavior(e){validateMaxLengthBehavior(this.component,e)}validateMaxLength(e){validateMaxLength(this.component,e,{hooks:{afterPatch:this.afterSyncCharCounter}})}validatePlaceholder(e){validatePlaceholder(this.component,e)}validateReadOnly(e){validateReadOnly(this.component,e)}validateResize(e){validateResizeTextarea(this.component,e)}validateRequired(e){validateRequired(this.component,e)}validateRows(e){validateRows(this.component,e)}validateSpellCheck(e){validateSpellCheck(this.component,e)}validateValue(e){watchString(this.component,"_value",e,{hooks:{afterPatch:this.afterSyncCharCounter}}),this.setFormAssociatedValue(this.component._value)}componentWillLoad(){super.componentWillLoad(),this.validateHasCounter(this.component._hasCounter),this.validateMaxLengthBehavior(this.component._maxLengthBehavior),this.validateMaxLength(this.component._maxLength),this.validatePlaceholder(this.component._placeholder),this.validateReadOnly(this.component._readOnly),this.validateRequired(this.component._required),this.validateResize(this.component._resize),this.validateRows(this.component._rows),this.validateSpellCheck(this.component._spellCheck),this.validateValue(this.component._value)}}const defaultStyleCss="/* forward the rem function */\n/*\n * This file contains all rules for accessibility.\n */\n@layer kol-a11y {\n :host {\n /*\n * Minimum size of interactive elements.\n */\n --a11y-min-size: calc(44rem / var(--kolibri-root-font-size, 16));\n color: black;\n /*\n * No element should be used without a background and font color whose contrast ratio has\n * not been checked. By initially setting the background color to white and the font color\n * to black, the contrast ratio is ensured and explicit adjustment is forced.\n */\n background-color: white;\n /*\n * Verdana is an accessible font that can be used without requiring additional loading time.\n */\n font-family: Verdana;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n * {\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n hyphens: auto;\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n word-break: break-word;\n }\n /*\n * All interactive elements should have a minimum size of to-rem(44).\n */\n /* input:not([type='checkbox'], [type='radio'], [type='range']), */\n /* option, */\n /* select, */\n /* textarea, */\n [role=button],\n button:not([role=link]),\n .kol-input .input {\n min-width: var(--a11y-min-size);\n min-height: var(--a11y-min-size);\n }\n /*\n * Some interactive elements should not inherit the font-family and font-size.\n */\n a,\n button,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n input,\n option,\n select,\n textarea {\n /*\n * All elements should inherit the font family from his parent element.\n */\n font-family: inherit;\n /*\n * All elements should inherit the font size from his parent element.\n */\n font-size: inherit;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n /**\n * Sometimes we need the semantic element for accessibility reasons,\n * but we don't want to show it.\n *\n * - https://www.a11yproject.com/posts/how-to-hide-content/\n */\n .visually-hidden {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n white-space: nowrap;\n clip: rect(0 0 0 0);\n clip-path: inset(50%);\n }\n}\n@layer kol-global {\n /*\n * Dieses CSS stellt sicher, dass der Standard-Style\n * von A und Button resettet werden.\n */\n :is(a, button) {\n background-color: transparent;\n width: 100%;\n margin: 0;\n padding: 0;\n border: none;\n /* 100% needed for custom width from outside */\n }\n /*\n * Ensure elements with hidden attribute to be actually not visible\n * @see https://meowni.ca/hidden.is.a.lie.html\n */\n [hidden] {\n display: none !important;\n }\n .badge-text-hint {\n color: black;\n background-color: lightgray;\n }\n}\n@layer kol-global {\n :host {\n /*\n * The max-width is needed to prevent the table from overflowing the\n * parent node, if the table is wider than the parent node.\n */\n max-width: 100%;\n font-size: calc(16rem / var(--kolibri-root-font-size, 16));\n }\n * {\n /*\n * We prefer to box-sizing: border-box for all elements.\n */\n box-sizing: border-box;\n }\n .kol-span {\n /* KolSpan is a layout component with icons in all directions and a label text in the middle. */\n display: grid;\n place-items: center;\n /* The sub span in KolSpan is the horizontal span with icon left and right and the label text in the middle. */\n }\n .kol-span__container {\n display: flex;\n place-items: center;\n }\n a,\n button {\n cursor: pointer;\n }\n .kol-span .kol-span__label--hide-label .kol-span__label {\n display: none;\n }\n /* Reset browser agent style. */\n button:disabled {\n color: unset;\n }\n .disabled label,\n .disabled:focus-within label,\n [aria-disabled=true],\n [aria-disabled=true]:focus,\n [disabled],\n [disabled]:focus {\n opacity: 0.5;\n outline: none;\n cursor: not-allowed;\n }\n [aria-disabled=true]:focus .kol-span,\n [disabled]:focus .kol-span {\n outline: none !important;\n }\n}\n@layer kol-component {\n :host {\n display: block;\n }\n}\n@layer kol-component {\n @keyframes fadeInOpacity {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n .kol-tooltip {\n display: contents;\n contain: layout;\n }\n .kol-tooltip__floating {\n display: none;\n position: fixed;\n /* Avoid layout interference - see https://floating-ui.com/docs/computePosition */\n top: 0;\n left: 0;\n /* Can be used to specify the tooltip-width from the outside. Unset by default. */\n width: var(--kol-tooltip-width);\n max-width: 90vw;\n max-height: 90vh;\n visibility: hidden;\n animation-duration: 0.25s;\n animation-iteration-count: 1;\n animation-name: fadeInOpacity;\n animation-timing-function: ease-in;\n }\n .kol-tooltip__arrow {\n transform: rotate(45deg);\n color: #000;\n background-color: #fff;\n position: absolute;\n z-index: 999;\n width: calc(10rem / var(--kolibri-root-font-size, 16));\n height: calc(10rem / var(--kolibri-root-font-size, 16));\n }\n .kol-tooltip__content {\n color: #000;\n background-color: #fff;\n position: relative;\n z-index: 1000;\n }\n}\n@layer kol-component {\n .kol-alert {\n display: grid;\n }\n .kol-alert__container {\n display: flex;\n place-items: center;\n }\n .kol-alert__container-content {\n flex-grow: 1;\n }\n .kol-alert__closer {\n /* Visible with forced colors */\n outline: transparent solid calc(1rem / var(--kolibri-root-font-size, 16));\n }\n}\n@layer kol-component {\n .kol-form-field {\n display: grid;\n }\n .kol-form-field:not(.kol-form-field--disabled) .kol-form-field__label {\n cursor: pointer;\n }\n .kol-form-field--disabled .kol-form-field__label {\n opacity: 0.5;\n }\n .kol-form-field--required .kol-form-field__label-text::after {\n content: \"*\";\n }\n .kol-form-field--disabled .kol-form-field__hint {\n opacity: 0.5;\n }\n .kol-form-field--required .kol-form-field__tooltip .span-label::after {\n content: \"*\";\n }\n}\n@layer kol-component {\n .kol-input-container {\n background-color: white;\n display: grid;\n width: 100%;\n min-width: var(--a11y-min-size);\n min-height: var(--a11y-min-size);\n align-items: center;\n grid-template-columns: 1fr;\n }\n .kol-input-container:has(> .kol-input-container__adornment--start) {\n grid-template-columns: auto 1fr;\n }\n .kol-input-container:has(> .kol-input-container__adornment--end) {\n grid-template-columns: 1fr auto;\n }\n .kol-input-container:has(> .kol-input-container__adornment--start):has(> .kol-input-container__adornment--end) {\n grid-template-columns: auto 1fr auto;\n }\n .kol-input-container__container {\n position: relative;\n }\n .kol-input-container__adornment {\n display: flex;\n align-items: center;\n }\n .kol-input-container__adornment .kol-icon {\n display: grid;\n height: var(--a11y-min-size);\n place-items: center;\n }\n}\n@layer kol-component {\n .kol-textarea {\n width: 100%;\n }\n .kol-textarea:focus {\n outline: none;\n }\n}",increaseTextareaHeight=e=>{e.style.overflow="hidden";const t=e.rows,n=e.clientHeight/t;e.rows=1;const a=Math.round(e.scrollHeight/n);return e.rows=t,a},KolTextarea=class{async getValue(){var e;return null===(e=this.textareaRef)||void 0===e?void 0:e.value}async kolFocus(){var e;null===(e=this.textareaRef)||void 0===e||e.focus()}getFormFieldProps(){return{state:this.state,class:clsx("kol-form-field-textarea",{"kol-form-field--has-value":this.state._hasValue,"kol-form-field--has-counter":this.controller.hasSoftCharacterLimit()||this.controller.hasCounter()}),tooltipAlign:this._tooltipAlign,onClick:()=>{var e;return null===(e=this.textareaRef)||void 0===e?void 0:e.focus()},alert:this.showAsAlert()}}getTextAreaProps(){const e="number"==typeof this.state._maxLength?[`${this.state._id}-character-limit-hint`]:void 0;return Object.assign(Object.assign({ref:this.catchRef,state:this.state,style:{resize:this.state._resize},ariaDescribedBy:e},this.controller.onFacade),{onInput:this.onInput,onFocus:e=>{this.controller.onFacade.onFocus(e),this.inputHasFocus=!0},onBlur:e=>{this.controller.onFacade.onBlur(e),this.inputHasFocus=!1}})}render(){return h(FormFieldStateWrapper,Object.assign({key:"a04967ea2fecb1a7c6f238600d52f2d4d4b4cc72"},this.getFormFieldProps()),h(InputContainerStateWrapperFc,{key:"db4f3ed0dfa745c109a3a21346df79722b0f7595",state:this.state},h(TextAreaStateWrapper,Object.assign({key:"71376e1ff01a524c589632fff16023da5bb9774b"},this.getTextAreaProps()))))}constructor(e){registerInstance(this,e),this.catchRef=e=>{this.textareaRef=e},this._adjustHeight=!1,this._disabled=!1,this._hideMsg=!1,this._hideLabel=!1,this._hint="",this._hasCounter=!1,this._maxLengthBehavior="hard",this._readOnly=!1,this._resize="vertical",this._required=!1,this._tooltipAlign="top",this._touched=!1,this.state={_adjustHeight:!1,_currentLength:0,_currentLengthDebounced:0,_hasValue:!1,_hideMsg:!1,_id:`id-${nonce()}`,_label:"",_resize:"vertical"},this.inputHasFocus=!1,this.onInput=e=>{this.textareaRef instanceof HTMLTextAreaElement&&(this._value=this.textareaRef.value,this.state._adjustHeight&&(this._rows=increaseTextareaHeight(this.textareaRef)),this.controller.onFacade.onInput(e))},this.controller=new TextareaController(this,"textarea",this.host)}showAsAlert(){return Boolean(this.state._touched)&&!this.inputHasFocus}validateAccessKey(e){this.controller.validateAccessKey(e)}validateAdjustHeight(e){this.controller.validateAdjustHeight(e)}validateDisabled(e){this.controller.validateDisabled(e)}validateHideMsg(e){this.controller.validateHideMsg(e)}validateHideLabel(e){this.controller.validateHideLabel(e)}validateHasCounter(e){this.controller.validateHasCounter(e)}validateHint(e){this.controller.validateHint(e)}validateIcons(e){this.controller.validateIcons(e)}validateId(e){this.controller.validateId(e)}validateLabel(e){this.controller.validateLabel(e)}validateMaxLength(e){this.controller.validateMaxLength(e)}validateMaxLengthBehavior(e){this.controller.validateMaxLengthBehavior(e)}validateMsg(e){this.controller.validateMsg(e)}validateName(e){this.controller.validateName(e)}validateOn(e){this.controller.validateOn(e)}validatePlaceholder(e){this.controller.validatePlaceholder(e)}validateReadOnly(e){this.controller.validateReadOnly(e)}validateResize(e){this.controller.validateResize(e)}validateRequired(e){this.controller.validateRequired(e)}validateRows(e){this.controller.validateRows(e)}validateShortKey(e){this.controller.validateShortKey(e)}validateSpellCheck(e){this.controller.validateSpellCheck(e)}validateSyncValueBySelector(e){this.controller.validateSyncValueBySelector(e)}validateTouched(e){this.controller.validateTouched(e)}validateValue(e){this.controller.validateValue(e)}componentDidLoad(){setTimeout((()=>{var e;!0===this._adjustHeight&&this.textareaRef?this._rows=(null===(e=this.state)||void 0===e?void 0:e._rows)&&this.state._rows>increaseTextareaHeight(this.textareaRef)?this.state._rows:increaseTextareaHeight(this.textareaRef):this._rows||(this._rows=1)}),0)}componentWillLoad(){this._touched=!0===this._touched,this.controller.componentWillLoad(),this.state._hasValue=!!this.state._value,this.controller.addValueChangeListener((e=>this.state._hasValue=!!e))}static get delegatesFocus(){return!0}get host(){return getElement(this)}static get watchers(){return{_accessKey:["validateAccessKey"],_adjustHeight:["validateAdjustHeight"],_disabled:["validateDisabled"],_hideMsg:["validateHideMsg"],_hideLabel:["validateHideLabel"],_hasCounter:["validateHasCounter"],_hint:["validateHint"],_icons:["validateIcons"],_id:["validateId"],_label:["validateLabel"],_maxLength:["validateMaxLength"],_maxLengthBehavior:["validateMaxLengthBehavior"],_msg:["validateMsg"],_name:["validateName"],_on:["validateOn"],_placeholder:["validatePlaceholder"],_readOnly:["validateReadOnly"],_resize:["validateResize"],_required:["validateRequired"],_rows:["validateRows"],_shortKey:["validateShortKey"],_spellCheck:["validateSpellCheck"],_syncValueBySelector:["validateSyncValueBySelector"],_touched:["validateTouched"],_value:["validateValue"]}}};KolTextarea.style={default:defaultStyleCss};export{KolTextarea as kol_textarea};
4
+ import{h,r as registerInstance,g as getElement}from"./index-DTM8XbOu.js";import{c as clsx}from"./clsx-eK3rPvPS.js";import{e as getDefaultProps,c as checkHasMsg,g as getRenderStates,a as convertMsgToInternMsg,F as FormFieldStateWrapper}from"./FormFieldStateWrapper-CCkAqaaL.js";import{I as InputIconController,a as InputContainerStateWrapperFc}from"./controller-icon-LXybyI6W.js";import{_ as __rest}from"./Heading-BYeuylXc.js";import{w as watchValidator,e as watchString}from"./common-7RW_NFNf.js";import{n as nonce}from"./dev.utils-vAdYjvGq.js";import{a as validateHasCounter,v as validateMaxLengthBehavior,b as validateMaxLength}from"./max-length-behavior-BJuqKbOX.js";import{v as validatePlaceholder}from"./placeholder-ikSHqukt.js";import{v as validateReadOnly}from"./read-only-BAPnQth3.js";import{v as validateRequired}from"./required-DZ5CUsrb.js";import{v as validateRows}from"./rows-CRXE6nJb.js";import{v as validateSpellCheck}from"./spell-check-BwdT9MHK.js";import"./access-and-short-key-CIkiLGbP.js";import"./disabled-DOGGfuG4.js";import"./hide-label-B1sxX0if.js";import"./label-DAfXJvJZ.js";import"./tooltip-align-B_X7PRrT.js";import"./align-DoCRbhrp.js";import"./events-CoPFQEiC.js";import"./associated.controller-DWb-3J2w.js";import"./bootstrap-ChRg7xqg.js";import"./component-names-CkE54Ym7.js";import"./i18n-CjhRejiw.js";import"./isObject-DvSELytj.js";import"./Alert-Bbh--qXI.js";import"./i18n-yBVLeHdv.js";import"./bem-CwA0xXwr.js";import"./browser-D7tkBuSS.js";import"./InternalUnderlinedBadgeText-CRfceIpy.js";import"./Icon-BttEGYV4.js";import"./icons-mdo32hNB.js";const textareaResizeOptions=["vertical","none"],isTextareaResizePropType=e=>"string"==typeof e&&textareaResizeOptions.includes(e),validateResizeTextarea=(e,t)=>{watchValidator(e,"_resize",isTextareaResizePropType,new Set(textareaResizeOptions),t,{defaultValue:"vertical"})},TextAreaFc=e=>{const{class:t,msg:n,touched:a,readonly:i,disabled:o,required:l,ariaDescribedBy:r,hideLabel:s,label:d}=e,c=__rest(e,["class","msg","touched","readonly","disabled","required","ariaDescribedBy","hideLabel","label"]),u=checkHasMsg(n,a),p={"kol-textarea--disabled":Boolean(o),"kol-textarea--required":Boolean(l),"kol-textarea--touched":Boolean(a),"kol-textarea--readonly":Boolean(i),[`kol-textarea--${(null==n?void 0:n.type)||"error"}`]:u},m=Object.assign(Object.assign({class:clsx("kol-textarea",p,t),required:l,disabled:o,readonly:i},getDefaultProps({ariaDescribedBy:r,hideLabel:s,label:d})),c);return h("textarea",Object.assign({},m))};function getTextAreaProps(e,t){var n;const a=[...getRenderStates(e).ariaDescribedBy,...null!==(n=t.ariaDescribedBy)&&void 0!==n?n:[]],i=Object.assign(Object.assign({id:e._id,hideLabel:e._hideLabel,label:e._label,value:e._value,accessKey:e._accessKey,disabled:e._disabled,name:e._name,rows:e._rows,readonly:e._readOnly,required:e._required,placeholder:e._placeholder,touched:e._touched,msg:convertMsgToInternMsg(e._msg)},t),{ariaDescribedBy:a});return"_maxLength"in e&&"_maxLengthBehavior"in e&&"hard"===e._maxLengthBehavior&&(i.maxLength=e._maxLength),i}const TextAreaStateWrapper=e=>{var{state:t}=e,n=__rest(e,["state"]);return h(TextAreaFc,Object.assign({},getTextAreaProps(t,n)))};class TextareaController extends InputIconController{constructor(e,t,n){super(e,t,n),this.afterSyncCharCounter=()=>{"string"==typeof this.component._value&&(this.component.state._currentLength=this.component._value.length,this.updateCurrentLengthDebounced(this.component._value.length))},this.component=e}validateHasCounter(e){validateHasCounter(this.component,e)}validateMaxLengthBehavior(e){validateMaxLengthBehavior(this.component,e)}validateMaxLength(e){validateMaxLength(this.component,e,{hooks:{afterPatch:this.afterSyncCharCounter}})}validatePlaceholder(e){validatePlaceholder(this.component,e)}validateReadOnly(e){validateReadOnly(this.component,e)}validateResize(e){validateResizeTextarea(this.component,e)}validateRequired(e){validateRequired(this.component,e)}validateRows(e){validateRows(this.component,e)}validateSpellCheck(e){validateSpellCheck(this.component,e)}validateValue(e){watchString(this.component,"_value",e,{hooks:{afterPatch:this.afterSyncCharCounter}}),this.setFormAssociatedValue(this.component._value)}componentWillLoad(){super.componentWillLoad(),this.validateHasCounter(this.component._hasCounter),this.validateMaxLengthBehavior(this.component._maxLengthBehavior),this.validateMaxLength(this.component._maxLength),this.validatePlaceholder(this.component._placeholder),this.validateReadOnly(this.component._readOnly),this.validateRequired(this.component._required),this.validateResize(this.component._resize),this.validateRows(this.component._rows),this.validateSpellCheck(this.component._spellCheck),this.validateValue(this.component._value)}}const defaultStyleCss="/* forward the rem function */\n/*\n * This file contains all rules for accessibility.\n */\n@layer kol-a11y {\n :host {\n /*\n * Minimum size of interactive elements.\n */\n --a11y-min-size: calc(44rem / var(--kolibri-root-font-size, 16));\n color: black;\n /*\n * No element should be used without a background and font color whose contrast ratio has\n * not been checked. By initially setting the background color to white and the font color\n * to black, the contrast ratio is ensured and explicit adjustment is forced.\n */\n background-color: white;\n /*\n * Verdana is an accessible font that can be used without requiring additional loading time.\n */\n font-family: Verdana;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n * {\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n hyphens: auto;\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n word-break: break-word;\n }\n /*\n * All interactive elements should have a minimum size of to-rem(44).\n */\n /* input:not([type='checkbox'], [type='radio'], [type='range']), */\n /* option, */\n /* select, */\n /* textarea, */\n [role=button],\n button:not([role=link]),\n .kol-input .input {\n min-width: var(--a11y-min-size);\n min-height: var(--a11y-min-size);\n }\n /*\n * Some interactive elements should not inherit the font-family and font-size.\n */\n a,\n button,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n input,\n option,\n select,\n textarea {\n /*\n * All elements should inherit the font family from his parent element.\n */\n font-family: inherit;\n /*\n * All elements should inherit the font size from his parent element.\n */\n font-size: inherit;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n /**\n * Sometimes we need the semantic element for accessibility reasons,\n * but we don't want to show it.\n *\n * - https://www.a11yproject.com/posts/how-to-hide-content/\n */\n .visually-hidden {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n white-space: nowrap;\n clip: rect(0 0 0 0);\n clip-path: inset(50%);\n }\n}\n@layer kol-global {\n /*\n * Dieses CSS stellt sicher, dass der Standard-Style\n * von A und Button resettet werden.\n */\n :is(a, button) {\n background-color: transparent;\n width: 100%;\n margin: 0;\n padding: 0;\n border: none;\n /* 100% needed for custom width from outside */\n }\n /*\n * Ensure elements with hidden attribute to be actually not visible\n * @see https://meowni.ca/hidden.is.a.lie.html\n */\n [hidden] {\n display: none !important;\n }\n .badge-text-hint {\n color: black;\n background-color: lightgray;\n }\n}\n@layer kol-global {\n :host {\n /*\n * The max-width is needed to prevent the table from overflowing the\n * parent node, if the table is wider than the parent node.\n */\n max-width: 100%;\n font-size: calc(16rem / var(--kolibri-root-font-size, 16));\n }\n * {\n /*\n * We prefer to box-sizing: border-box for all elements.\n */\n box-sizing: border-box;\n }\n .kol-span {\n /* KolSpan is a layout component with icons in all directions and a label text in the middle. */\n display: grid;\n place-items: center;\n /* The sub span in KolSpan is the horizontal span with icon left and right and the label text in the middle. */\n }\n .kol-span__container {\n display: flex;\n place-items: center;\n }\n a,\n button {\n cursor: pointer;\n }\n .kol-span .kol-span__label--hide-label .kol-span__label {\n display: none;\n }\n /* Reset browser agent style. */\n button:disabled {\n color: unset;\n }\n .disabled label,\n .disabled:focus-within label,\n [aria-disabled=true],\n [aria-disabled=true]:focus,\n [disabled],\n [disabled]:focus {\n opacity: 0.5;\n outline: none;\n cursor: not-allowed;\n }\n [aria-disabled=true]:focus .kol-span,\n [disabled]:focus .kol-span {\n outline: none !important;\n }\n}\n@layer kol-component {\n :host {\n display: block;\n }\n}\n@layer kol-component {\n @keyframes fadeInOpacity {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n .kol-tooltip {\n display: contents;\n contain: layout;\n }\n .kol-tooltip__floating {\n display: none;\n position: fixed;\n /* Avoid layout interference - see https://floating-ui.com/docs/computePosition */\n top: 0;\n left: 0;\n /* Can be used to specify the tooltip-width from the outside. Unset by default. */\n width: var(--kol-tooltip-width);\n max-width: 90vw;\n max-height: 90vh;\n visibility: hidden;\n animation-duration: 0.25s;\n animation-iteration-count: 1;\n animation-name: fadeInOpacity;\n animation-timing-function: ease-in;\n }\n .kol-tooltip__arrow {\n transform: rotate(45deg);\n color: #000;\n background-color: #fff;\n position: absolute;\n z-index: 999;\n width: calc(10rem / var(--kolibri-root-font-size, 16));\n height: calc(10rem / var(--kolibri-root-font-size, 16));\n }\n .kol-tooltip__content {\n color: #000;\n background-color: #fff;\n position: relative;\n z-index: 1000;\n }\n}\n@layer kol-component {\n .kol-alert {\n display: grid;\n }\n .kol-alert__container {\n display: flex;\n place-items: center;\n }\n .kol-alert__container-content {\n flex-grow: 1;\n }\n .kol-alert__closer {\n /* Visible with forced colors */\n outline: transparent solid calc(1rem / var(--kolibri-root-font-size, 16));\n }\n}\n@layer kol-component {\n .kol-form-field {\n display: grid;\n }\n .kol-form-field:not(.kol-form-field--disabled) .kol-form-field__label {\n cursor: pointer;\n }\n .kol-form-field--disabled .kol-form-field__label {\n opacity: 0.5;\n }\n .kol-form-field--required .kol-form-field__label-text::after {\n content: \"*\";\n }\n .kol-form-field--disabled .kol-form-field__hint {\n opacity: 0.5;\n }\n .kol-form-field--required .kol-form-field__tooltip .span-label::after {\n content: \"*\";\n }\n}\n@layer kol-component {\n .kol-input-container {\n background-color: white;\n display: grid;\n width: 100%;\n min-width: var(--a11y-min-size);\n min-height: var(--a11y-min-size);\n align-items: center;\n grid-template-columns: 1fr;\n }\n .kol-input-container:has(> .kol-input-container__adornment--start) {\n grid-template-columns: auto 1fr;\n }\n .kol-input-container:has(> .kol-input-container__adornment--end) {\n grid-template-columns: 1fr auto;\n }\n .kol-input-container:has(> .kol-input-container__adornment--start):has(> .kol-input-container__adornment--end) {\n grid-template-columns: auto 1fr auto;\n }\n .kol-input-container__container {\n position: relative;\n }\n .kol-input-container__adornment {\n display: flex;\n align-items: center;\n }\n .kol-input-container__adornment .kol-icon {\n display: grid;\n height: var(--a11y-min-size);\n place-items: center;\n }\n}\n@layer kol-component {\n .kol-textarea {\n width: 100%;\n }\n .kol-textarea:focus {\n outline: none;\n }\n}",increaseTextareaHeight=e=>{e.style.overflow="hidden";const t=e.rows,n=e.clientHeight/t;e.rows=1;const a=Math.round(e.scrollHeight/n);return e.rows=t,a},KolTextarea=class{async getValue(){var e;return null===(e=this.textareaRef)||void 0===e?void 0:e.value}async kolFocus(){var e;null===(e=this.textareaRef)||void 0===e||e.focus()}getFormFieldProps(){return{state:this.state,class:clsx("kol-form-field-textarea",{"kol-form-field--has-value":this.state._hasValue,"kol-form-field--has-counter":this.controller.hasSoftCharacterLimit()||this.controller.hasCounter()}),tooltipAlign:this._tooltipAlign,onClick:()=>{var e;return null===(e=this.textareaRef)||void 0===e?void 0:e.focus()},alert:this.showAsAlert()}}getTextAreaProps(){const e="number"==typeof this.state._maxLength?[`${this.state._id}-character-limit-hint`]:void 0;return Object.assign(Object.assign({ref:this.catchRef,state:this.state,style:{resize:this.state._resize},ariaDescribedBy:e},this.controller.onFacade),{onInput:this.onInput,onFocus:e=>{this.controller.onFacade.onFocus(e),this.inputHasFocus=!0},onBlur:e=>{this.controller.onFacade.onBlur(e),this.inputHasFocus=!1}})}render(){return h(FormFieldStateWrapper,Object.assign({key:"a04967ea2fecb1a7c6f238600d52f2d4d4b4cc72"},this.getFormFieldProps()),h(InputContainerStateWrapperFc,{key:"db4f3ed0dfa745c109a3a21346df79722b0f7595",state:this.state},h(TextAreaStateWrapper,Object.assign({key:"71376e1ff01a524c589632fff16023da5bb9774b"},this.getTextAreaProps()))))}constructor(e){registerInstance(this,e),this.catchRef=e=>{this.textareaRef=e},this._adjustHeight=!1,this._disabled=!1,this._hideMsg=!1,this._hideLabel=!1,this._hint="",this._hasCounter=!1,this._maxLengthBehavior="hard",this._readOnly=!1,this._resize="vertical",this._required=!1,this._tooltipAlign="top",this._touched=!1,this.state={_adjustHeight:!1,_currentLength:0,_currentLengthDebounced:0,_hasValue:!1,_hideMsg:!1,_id:`id-${nonce()}`,_label:"",_resize:"vertical"},this.inputHasFocus=!1,this.onInput=e=>{this.textareaRef instanceof HTMLTextAreaElement&&(this._value=this.textareaRef.value,this.state._adjustHeight&&(this._rows=increaseTextareaHeight(this.textareaRef)),this.controller.onFacade.onInput(e))},this.controller=new TextareaController(this,"textarea",this.host)}showAsAlert(){return Boolean(this.state._touched)&&!this.inputHasFocus}validateAccessKey(e){this.controller.validateAccessKey(e)}validateAdjustHeight(e){this.controller.validateAdjustHeight(e)}validateDisabled(e){this.controller.validateDisabled(e)}validateHideMsg(e){this.controller.validateHideMsg(e)}validateHideLabel(e){this.controller.validateHideLabel(e)}validateHasCounter(e){this.controller.validateHasCounter(e)}validateHint(e){this.controller.validateHint(e)}validateIcons(e){this.controller.validateIcons(e)}validateId(e){this.controller.validateId(e)}validateLabel(e){this.controller.validateLabel(e)}validateMaxLength(e){this.controller.validateMaxLength(e)}validateMaxLengthBehavior(e){this.controller.validateMaxLengthBehavior(e)}validateMsg(e){this.controller.validateMsg(e)}validateName(e){this.controller.validateName(e)}validateOn(e){this.controller.validateOn(e)}validatePlaceholder(e){this.controller.validatePlaceholder(e)}validateReadOnly(e){this.controller.validateReadOnly(e)}validateResize(e){this.controller.validateResize(e)}validateRequired(e){this.controller.validateRequired(e)}validateRows(e){this.controller.validateRows(e)}validateShortKey(e){this.controller.validateShortKey(e)}validateSpellCheck(e){this.controller.validateSpellCheck(e)}validateSyncValueBySelector(e){this.controller.validateSyncValueBySelector(e)}validateTouched(e){this.controller.validateTouched(e)}validateValue(e){this.controller.validateValue(e)}componentDidLoad(){setTimeout((()=>{var e;!0===this._adjustHeight&&this.textareaRef?this._rows=(null===(e=this.state)||void 0===e?void 0:e._rows)&&this.state._rows>increaseTextareaHeight(this.textareaRef)?this.state._rows:increaseTextareaHeight(this.textareaRef):this._rows||(this._rows=1)}),0)}componentWillLoad(){this._touched=!0===this._touched,this.controller.componentWillLoad(),this.state._hasValue=!!this.state._value,this.controller.addValueChangeListener((e=>this.state._hasValue=!!e))}static get delegatesFocus(){return!0}get host(){return getElement(this)}static get watchers(){return{_accessKey:["validateAccessKey"],_adjustHeight:["validateAdjustHeight"],_disabled:["validateDisabled"],_hideMsg:["validateHideMsg"],_hideLabel:["validateHideLabel"],_hasCounter:["validateHasCounter"],_hint:["validateHint"],_icons:["validateIcons"],_id:["validateId"],_label:["validateLabel"],_maxLength:["validateMaxLength"],_maxLengthBehavior:["validateMaxLengthBehavior"],_msg:["validateMsg"],_name:["validateName"],_on:["validateOn"],_placeholder:["validatePlaceholder"],_readOnly:["validateReadOnly"],_resize:["validateResize"],_required:["validateRequired"],_rows:["validateRows"],_shortKey:["validateShortKey"],_spellCheck:["validateSpellCheck"],_syncValueBySelector:["validateSyncValueBySelector"],_touched:["validateTouched"],_value:["validateValue"]}}};KolTextarea.style={default:defaultStyleCss};export{KolTextarea as kol_textarea};
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * KoliBri - The accessible HTML-Standard
3
3
  */
4
- import{h,r as registerInstance,H as Host}from"./index-BwHVuv1c.js";import{t as translate}from"./i18n-yBVLeHdv.js";import{n as nonce}from"./dev.utils-B25txGhq.js";import{n as KolButtonTag}from"./component-names-CkE54Ym7.js";import{K as KolAlertFc}from"./Alert-CTk_PNsB.js";import"./common-7RW_NFNf.js";import"./markdown-RQjNjZ_M.js";import{_ as __rest}from"./Heading-CdL171uD.js";import{c as clsx}from"./clsx-eK3rPvPS.js";import"./i18n-CjhRejiw.js";import"./bem-CwA0xXwr.js";import"./browser-D7tkBuSS.js";const ToastItemFc=t=>{var{status:n,toast:e,onClose:o}=t,s=__rest(t,["status","toast","onClose"]);const{type:a,label:i,description:l,variant:r}=e;return h("div",{class:clsx("kol-toast-item",`kol-toast-item--${n}`)},h(KolAlertFc,{class:"kol-toast-item__alert",alert:!0,label:i,level:0,hasCloser:!0,type:a,variant:r||"card",onCloserClick:o},h("div",Object.assign({},s),l)))},defaultStyleCss="/* forward the rem function */\n/*\n * This file contains all rules for accessibility.\n */\n@layer kol-a11y {\n :host {\n /*\n * Minimum size of interactive elements.\n */\n --a11y-min-size: calc(44rem / var(--kolibri-root-font-size, 16));\n color: black;\n /*\n * No element should be used without a background and font color whose contrast ratio has\n * not been checked. By initially setting the background color to white and the font color\n * to black, the contrast ratio is ensured and explicit adjustment is forced.\n */\n background-color: white;\n /*\n * Verdana is an accessible font that can be used without requiring additional loading time.\n */\n font-family: Verdana;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n * {\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n hyphens: auto;\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n word-break: break-word;\n }\n /*\n * All interactive elements should have a minimum size of to-rem(44).\n */\n /* input:not([type='checkbox'], [type='radio'], [type='range']), */\n /* option, */\n /* select, */\n /* textarea, */\n [role=button],\n button:not([role=link]),\n .kol-input .input {\n min-width: var(--a11y-min-size);\n min-height: var(--a11y-min-size);\n }\n /*\n * Some interactive elements should not inherit the font-family and font-size.\n */\n a,\n button,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n input,\n option,\n select,\n textarea {\n /*\n * All elements should inherit the font family from his parent element.\n */\n font-family: inherit;\n /*\n * All elements should inherit the font size from his parent element.\n */\n font-size: inherit;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n /**\n * Sometimes we need the semantic element for accessibility reasons,\n * but we don't want to show it.\n *\n * - https://www.a11yproject.com/posts/how-to-hide-content/\n */\n .visually-hidden {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n white-space: nowrap;\n clip: rect(0 0 0 0);\n clip-path: inset(50%);\n }\n}\n@layer kol-global {\n /*\n * Dieses CSS stellt sicher, dass der Standard-Style\n * von A und Button resettet werden.\n */\n :is(a, button) {\n background-color: transparent;\n width: 100%;\n margin: 0;\n padding: 0;\n border: none;\n /* 100% needed for custom width from outside */\n }\n /*\n * Ensure elements with hidden attribute to be actually not visible\n * @see https://meowni.ca/hidden.is.a.lie.html\n */\n [hidden] {\n display: none !important;\n }\n .badge-text-hint {\n color: black;\n background-color: lightgray;\n }\n}\n@layer kol-global {\n :host {\n /*\n * The max-width is needed to prevent the table from overflowing the\n * parent node, if the table is wider than the parent node.\n */\n max-width: 100%;\n font-size: calc(16rem / var(--kolibri-root-font-size, 16));\n }\n * {\n /*\n * We prefer to box-sizing: border-box for all elements.\n */\n box-sizing: border-box;\n }\n .kol-span {\n /* KolSpan is a layout component with icons in all directions and a label text in the middle. */\n display: grid;\n place-items: center;\n /* The sub span in KolSpan is the horizontal span with icon left and right and the label text in the middle. */\n }\n .kol-span__container {\n display: flex;\n place-items: center;\n }\n a,\n button {\n cursor: pointer;\n }\n .kol-span .kol-span__label--hide-label .kol-span__label {\n display: none;\n }\n /* Reset browser agent style. */\n button:disabled {\n color: unset;\n }\n .disabled label,\n .disabled:focus-within label,\n [aria-disabled=true],\n [aria-disabled=true]:focus,\n [disabled],\n [disabled]:focus {\n opacity: 0.5;\n outline: none;\n cursor: not-allowed;\n }\n [aria-disabled=true]:focus .kol-span,\n [disabled]:focus .kol-span {\n outline: none !important;\n }\n}\n@layer kol-component {\n :host {\n display: block;\n }\n}\n@layer kol-component {\n @keyframes fadeInOpacity {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n .kol-tooltip {\n display: contents;\n contain: layout;\n }\n .kol-tooltip__floating {\n display: none;\n position: fixed;\n /* Avoid layout interference - see https://floating-ui.com/docs/computePosition */\n top: 0;\n left: 0;\n /* Can be used to specify the tooltip-width from the outside. Unset by default. */\n width: var(--kol-tooltip-width);\n max-width: 90vw;\n max-height: 90vh;\n visibility: hidden;\n animation-duration: 0.25s;\n animation-iteration-count: 1;\n animation-name: fadeInOpacity;\n animation-timing-function: ease-in;\n }\n .kol-tooltip__arrow {\n transform: rotate(45deg);\n color: #000;\n background-color: #fff;\n position: absolute;\n z-index: 999;\n width: calc(10rem / var(--kolibri-root-font-size, 16));\n height: calc(10rem / var(--kolibri-root-font-size, 16));\n }\n .kol-tooltip__content {\n color: #000;\n background-color: #fff;\n position: relative;\n z-index: 1000;\n }\n}\n@layer kol-component {\n .kol-alert {\n display: grid;\n }\n .kol-alert__container {\n display: flex;\n place-items: center;\n }\n .kol-alert__container-content {\n flex-grow: 1;\n }\n .kol-alert__closer {\n /* Visible with forced colors */\n outline: transparent solid calc(1rem / var(--kolibri-root-font-size, 16));\n }\n}\n@layer kol-component {\n :host {\n display: flex;\n position: fixed;\n z-index: 200;\n flex-direction: column;\n }\n .kol-toast-container__close-all {\n align-self: flex-end;\n }\n}",TRANSITION_TIMEOUT=300,KolToastContainer=class{constructor(t){registerInstance(this,t),this.state={_toastStates:[]},this.translateToastCloseAll=translate("kol-toast-close-all"),this.knownRenderFunctions=new Set}async enqueue(t){const n={toast:t,status:"adding",id:`toast-${nonce()}`};return this.state=Object.assign(Object.assign({},this.state),{_toastStates:[n,...this.state._toastStates]}),setTimeout((()=>{this.state=Object.assign(Object.assign({},this.state),{_toastStates:this.state._toastStates.map((t=>t.id===n.id&&"removing"!==t.status?Object.assign(Object.assign({},t),{status:"settled"}):t))})}),300),()=>{this.handleClose(n)}}handleClose(t){this.state=Object.assign(Object.assign({},this.state),{_toastStates:this.state._toastStates.map((n=>(n.id===t.id&&(n.status="removing"),n)))}),setTimeout((()=>{var n,e;this.state=Object.assign(Object.assign({},this.state),{_toastStates:this.state._toastStates.filter((n=>n.id!==t.id))}),null===(e=(n=t.toast).onClose)||void 0===e||e.call(n)}),300)}async closeAll(t=!1){if(t)this.state=Object.assign(Object.assign({},this.state),{_toastStates:[]});else{const t=[...this.state._toastStates];this.state=Object.assign(Object.assign({},this.state),{_toastStates:t.map((t=>Object.assign(Object.assign({},t),{status:"removing"})))}),setTimeout((()=>{this.state=Object.assign(Object.assign({},this.state),{_toastStates:this.state._toastStates.filter((n=>t.every((t=>t.id!==n.id))))}),t.forEach((t=>{var n,e;null===(e=(n=t.toast).onClose)||void 0===e||e.call(n)}))}),300)}}handleToastRef(t,n){n&&"function"==typeof t.toast.render&&!this.knownRenderFunctions.has(t.toast.render)&&(this.knownRenderFunctions.add(t.toast.render),t.toast.render(n,{close:()=>this.handleClose(t)}))}render(){return h(Host,{key:"e6841e1a26bc8c24de441ed1d444175021f8d7b5",class:"kol-toast-container"},this.state._toastStates.length>1&&h(KolButtonTag,{key:"938ab38123fd91e356eb63b4c315d1884eb37197",_label:this.translateToastCloseAll,class:"kol-toast-container__button-close-all",_on:{onClick:()=>{this.closeAll()}}}),this.state._toastStates.map((t=>h(ToastItemFc,{key:t.id,onClose:()=>this.handleClose(t),ref:n=>this.handleToastRef(t,n),toast:t.toast,status:t.status}))))}};KolToastContainer.style={default:defaultStyleCss};export{KolToastContainer as kol_toast_container};
4
+ import{h,r as registerInstance,H as Host}from"./index-DTM8XbOu.js";import{t as translate}from"./i18n-yBVLeHdv.js";import{n as nonce}from"./dev.utils-vAdYjvGq.js";import{n as KolButtonTag}from"./component-names-CkE54Ym7.js";import{K as KolAlertFc}from"./Alert-Bbh--qXI.js";import"./common-7RW_NFNf.js";import"./markdown-RQjNjZ_M.js";import{_ as __rest}from"./Heading-BYeuylXc.js";import{c as clsx}from"./clsx-eK3rPvPS.js";import"./i18n-CjhRejiw.js";import"./bem-CwA0xXwr.js";import"./browser-D7tkBuSS.js";const ToastItemFc=t=>{var{status:n,toast:e,onClose:o}=t,s=__rest(t,["status","toast","onClose"]);const{type:a,label:i,description:l,variant:r}=e;return h("div",{class:clsx("kol-toast-item",`kol-toast-item--${n}`)},h(KolAlertFc,{class:"kol-toast-item__alert",alert:!0,label:i,level:0,hasCloser:!0,type:a,variant:r||"card",onCloserClick:o},h("div",Object.assign({},s),l)))},defaultStyleCss="/* forward the rem function */\n/*\n * This file contains all rules for accessibility.\n */\n@layer kol-a11y {\n :host {\n /*\n * Minimum size of interactive elements.\n */\n --a11y-min-size: calc(44rem / var(--kolibri-root-font-size, 16));\n color: black;\n /*\n * No element should be used without a background and font color whose contrast ratio has\n * not been checked. By initially setting the background color to white and the font color\n * to black, the contrast ratio is ensured and explicit adjustment is forced.\n */\n background-color: white;\n /*\n * Verdana is an accessible font that can be used without requiring additional loading time.\n */\n font-family: Verdana;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n * {\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n hyphens: auto;\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n word-break: break-word;\n }\n /*\n * All interactive elements should have a minimum size of to-rem(44).\n */\n /* input:not([type='checkbox'], [type='radio'], [type='range']), */\n /* option, */\n /* select, */\n /* textarea, */\n [role=button],\n button:not([role=link]),\n .kol-input .input {\n min-width: var(--a11y-min-size);\n min-height: var(--a11y-min-size);\n }\n /*\n * Some interactive elements should not inherit the font-family and font-size.\n */\n a,\n button,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n input,\n option,\n select,\n textarea {\n /*\n * All elements should inherit the font family from his parent element.\n */\n font-family: inherit;\n /*\n * All elements should inherit the font size from his parent element.\n */\n font-size: inherit;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n /**\n * Sometimes we need the semantic element for accessibility reasons,\n * but we don't want to show it.\n *\n * - https://www.a11yproject.com/posts/how-to-hide-content/\n */\n .visually-hidden {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n white-space: nowrap;\n clip: rect(0 0 0 0);\n clip-path: inset(50%);\n }\n}\n@layer kol-global {\n /*\n * Dieses CSS stellt sicher, dass der Standard-Style\n * von A und Button resettet werden.\n */\n :is(a, button) {\n background-color: transparent;\n width: 100%;\n margin: 0;\n padding: 0;\n border: none;\n /* 100% needed for custom width from outside */\n }\n /*\n * Ensure elements with hidden attribute to be actually not visible\n * @see https://meowni.ca/hidden.is.a.lie.html\n */\n [hidden] {\n display: none !important;\n }\n .badge-text-hint {\n color: black;\n background-color: lightgray;\n }\n}\n@layer kol-global {\n :host {\n /*\n * The max-width is needed to prevent the table from overflowing the\n * parent node, if the table is wider than the parent node.\n */\n max-width: 100%;\n font-size: calc(16rem / var(--kolibri-root-font-size, 16));\n }\n * {\n /*\n * We prefer to box-sizing: border-box for all elements.\n */\n box-sizing: border-box;\n }\n .kol-span {\n /* KolSpan is a layout component with icons in all directions and a label text in the middle. */\n display: grid;\n place-items: center;\n /* The sub span in KolSpan is the horizontal span with icon left and right and the label text in the middle. */\n }\n .kol-span__container {\n display: flex;\n place-items: center;\n }\n a,\n button {\n cursor: pointer;\n }\n .kol-span .kol-span__label--hide-label .kol-span__label {\n display: none;\n }\n /* Reset browser agent style. */\n button:disabled {\n color: unset;\n }\n .disabled label,\n .disabled:focus-within label,\n [aria-disabled=true],\n [aria-disabled=true]:focus,\n [disabled],\n [disabled]:focus {\n opacity: 0.5;\n outline: none;\n cursor: not-allowed;\n }\n [aria-disabled=true]:focus .kol-span,\n [disabled]:focus .kol-span {\n outline: none !important;\n }\n}\n@layer kol-component {\n :host {\n display: block;\n }\n}\n@layer kol-component {\n @keyframes fadeInOpacity {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n .kol-tooltip {\n display: contents;\n contain: layout;\n }\n .kol-tooltip__floating {\n display: none;\n position: fixed;\n /* Avoid layout interference - see https://floating-ui.com/docs/computePosition */\n top: 0;\n left: 0;\n /* Can be used to specify the tooltip-width from the outside. Unset by default. */\n width: var(--kol-tooltip-width);\n max-width: 90vw;\n max-height: 90vh;\n visibility: hidden;\n animation-duration: 0.25s;\n animation-iteration-count: 1;\n animation-name: fadeInOpacity;\n animation-timing-function: ease-in;\n }\n .kol-tooltip__arrow {\n transform: rotate(45deg);\n color: #000;\n background-color: #fff;\n position: absolute;\n z-index: 999;\n width: calc(10rem / var(--kolibri-root-font-size, 16));\n height: calc(10rem / var(--kolibri-root-font-size, 16));\n }\n .kol-tooltip__content {\n color: #000;\n background-color: #fff;\n position: relative;\n z-index: 1000;\n }\n}\n@layer kol-component {\n .kol-alert {\n display: grid;\n }\n .kol-alert__container {\n display: flex;\n place-items: center;\n }\n .kol-alert__container-content {\n flex-grow: 1;\n }\n .kol-alert__closer {\n /* Visible with forced colors */\n outline: transparent solid calc(1rem / var(--kolibri-root-font-size, 16));\n }\n}\n@layer kol-component {\n :host {\n display: flex;\n position: fixed;\n z-index: 200;\n flex-direction: column;\n }\n .kol-toast-container__close-all {\n align-self: flex-end;\n }\n}",TRANSITION_TIMEOUT=300,KolToastContainer=class{constructor(t){registerInstance(this,t),this.state={_toastStates:[]},this.translateToastCloseAll=translate("kol-toast-close-all"),this.knownRenderFunctions=new Set}async enqueue(t){const n={toast:t,status:"adding",id:`toast-${nonce()}`};return this.state=Object.assign(Object.assign({},this.state),{_toastStates:[n,...this.state._toastStates]}),setTimeout((()=>{this.state=Object.assign(Object.assign({},this.state),{_toastStates:this.state._toastStates.map((t=>t.id===n.id&&"removing"!==t.status?Object.assign(Object.assign({},t),{status:"settled"}):t))})}),300),()=>{this.handleClose(n)}}handleClose(t){this.state=Object.assign(Object.assign({},this.state),{_toastStates:this.state._toastStates.map((n=>(n.id===t.id&&(n.status="removing"),n)))}),setTimeout((()=>{var n,e;this.state=Object.assign(Object.assign({},this.state),{_toastStates:this.state._toastStates.filter((n=>n.id!==t.id))}),null===(e=(n=t.toast).onClose)||void 0===e||e.call(n)}),300)}async closeAll(t=!1){if(t)this.state=Object.assign(Object.assign({},this.state),{_toastStates:[]});else{const t=[...this.state._toastStates];this.state=Object.assign(Object.assign({},this.state),{_toastStates:t.map((t=>Object.assign(Object.assign({},t),{status:"removing"})))}),setTimeout((()=>{this.state=Object.assign(Object.assign({},this.state),{_toastStates:this.state._toastStates.filter((n=>t.every((t=>t.id!==n.id))))}),t.forEach((t=>{var n,e;null===(e=(n=t.toast).onClose)||void 0===e||e.call(n)}))}),300)}}handleToastRef(t,n){n&&"function"==typeof t.toast.render&&!this.knownRenderFunctions.has(t.toast.render)&&(this.knownRenderFunctions.add(t.toast.render),t.toast.render(n,{close:()=>this.handleClose(t)}))}render(){return h(Host,{key:"e6841e1a26bc8c24de441ed1d444175021f8d7b5",class:"kol-toast-container"},this.state._toastStates.length>1&&h(KolButtonTag,{key:"938ab38123fd91e356eb63b4c315d1884eb37197",_label:this.translateToastCloseAll,class:"kol-toast-container__button-close-all",_on:{onClick:()=>{this.closeAll()}}}),this.state._toastStates.map((t=>h(ToastItemFc,{key:t.id,onClose:()=>this.handleClose(t),ref:n=>this.handleToastRef(t,n),toast:t.toast,status:t.status}))))}};KolToastContainer.style={default:defaultStyleCss};export{KolToastContainer as kol_toast_container};
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * KoliBri - The accessible HTML-Standard
3
3
  */
4
- import{r as registerInstance,h,g as getElement}from"./index-BwHVuv1c.js";import{O as emptyStringByArrayHandler,o as objectObjectHandler,p as parseJson,s as setState}from"./common-7RW_NFNf.js";import{v as validateLabel}from"./label-DAfXJvJZ.js";import{f as KolLinkWcTag,d as KolButtonWcTag}from"./component-names-CkE54Ym7.js";import{v as validateOrientation}from"./orientation-BV4mvHIC.js";import{K as KeyboardKey}from"./keyboard-D6PoWr38.js";const validateToolbarItems=(n,e)=>{emptyStringByArrayHandler(e,(()=>{objectObjectHandler(e,(()=>{void 0===e&&(e=[]);try{e=parseJson(e)}catch(n){}Array.isArray(e)&&e.every((n=>"object"==typeof n&&null!==n))&&setState(n,"_items",e)}))}))},defaultStyleCss="@charset \"UTF-8\";\n/* forward the rem function */\n/*\n * This file contains all rules for accessibility.\n */\n@layer kol-a11y {\n :host {\n /*\n * Minimum size of interactive elements.\n */\n --a11y-min-size: calc(44rem / var(--kolibri-root-font-size, 16));\n color: black;\n /*\n * No element should be used without a background and font color whose contrast ratio has\n * not been checked. By initially setting the background color to white and the font color\n * to black, the contrast ratio is ensured and explicit adjustment is forced.\n */\n background-color: white;\n /*\n * Verdana is an accessible font that can be used without requiring additional loading time.\n */\n font-family: Verdana;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n * {\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n hyphens: auto;\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n word-break: break-word;\n }\n /*\n * All interactive elements should have a minimum size of to-rem(44).\n */\n /* input:not([type='checkbox'], [type='radio'], [type='range']), */\n /* option, */\n /* select, */\n /* textarea, */\n [role=button],\n button:not([role=link]),\n .kol-input .input {\n min-width: var(--a11y-min-size);\n min-height: var(--a11y-min-size);\n }\n /*\n * Some interactive elements should not inherit the font-family and font-size.\n */\n a,\n button,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n input,\n option,\n select,\n textarea {\n /*\n * All elements should inherit the font family from his parent element.\n */\n font-family: inherit;\n /*\n * All elements should inherit the font size from his parent element.\n */\n font-size: inherit;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n /**\n * Sometimes we need the semantic element for accessibility reasons,\n * but we don't want to show it.\n *\n * - https://www.a11yproject.com/posts/how-to-hide-content/\n */\n .visually-hidden {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n white-space: nowrap;\n clip: rect(0 0 0 0);\n clip-path: inset(50%);\n }\n}\n@layer kol-global {\n /*\n * Dieses CSS stellt sicher, dass der Standard-Style\n * von A und Button resettet werden.\n */\n :is(a, button) {\n background-color: transparent;\n width: 100%;\n margin: 0;\n padding: 0;\n border: none;\n /* 100% needed for custom width from outside */\n }\n /*\n * Ensure elements with hidden attribute to be actually not visible\n * @see https://meowni.ca/hidden.is.a.lie.html\n */\n [hidden] {\n display: none !important;\n }\n .badge-text-hint {\n color: black;\n background-color: lightgray;\n }\n}\n@layer kol-global {\n :host {\n /*\n * The max-width is needed to prevent the table from overflowing the\n * parent node, if the table is wider than the parent node.\n */\n max-width: 100%;\n font-size: calc(16rem / var(--kolibri-root-font-size, 16));\n }\n * {\n /*\n * We prefer to box-sizing: border-box for all elements.\n */\n box-sizing: border-box;\n }\n .kol-span {\n /* KolSpan is a layout component with icons in all directions and a label text in the middle. */\n display: grid;\n place-items: center;\n /* The sub span in KolSpan is the horizontal span with icon left and right and the label text in the middle. */\n }\n .kol-span__container {\n display: flex;\n place-items: center;\n }\n a,\n button {\n cursor: pointer;\n }\n .kol-span .kol-span__label--hide-label .kol-span__label {\n display: none;\n }\n /* Reset browser agent style. */\n button:disabled {\n color: unset;\n }\n .disabled label,\n .disabled:focus-within label,\n [aria-disabled=true],\n [aria-disabled=true]:focus,\n [disabled],\n [disabled]:focus {\n opacity: 0.5;\n outline: none;\n cursor: not-allowed;\n }\n [aria-disabled=true]:focus .kol-span,\n [disabled]:focus .kol-span {\n outline: none !important;\n }\n}\n@layer kol-component {\n @keyframes fadeInOpacity {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n .kol-tooltip {\n display: contents;\n contain: layout;\n }\n .kol-tooltip__floating {\n display: none;\n position: fixed;\n /* Avoid layout interference - see https://floating-ui.com/docs/computePosition */\n top: 0;\n left: 0;\n /* Can be used to specify the tooltip-width from the outside. Unset by default. */\n width: var(--kol-tooltip-width);\n max-width: 90vw;\n max-height: 90vh;\n visibility: hidden;\n animation-duration: 0.25s;\n animation-iteration-count: 1;\n animation-name: fadeInOpacity;\n animation-timing-function: ease-in;\n }\n .kol-tooltip__arrow {\n transform: rotate(45deg);\n color: #000;\n background-color: #fff;\n position: absolute;\n z-index: 999;\n width: calc(10rem / var(--kolibri-root-font-size, 16));\n height: calc(10rem / var(--kolibri-root-font-size, 16));\n }\n .kol-tooltip__content {\n color: #000;\n background-color: #fff;\n position: relative;\n z-index: 1000;\n }\n}\n@layer kol-component {\n :host {\n display: inline-block;\n }\n .kol-link {\n display: inline-flex;\n place-items: center;\n font-style: calc(16rem / var(--kolibri-root-font-size, 16));\n text-align: center;\n text-decoration-line: none;\n }\n .kol-link::before {\n /* Render zero-width character as first element to set the baseline correctly. */\n content: \"​\";\n }\n .kol-link__text {\n width: 100%;\n margin: auto;\n }\n}\n@layer kol-component {\n .kol-toolbar {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n }\n .kol-toolbar--orientation-vertical {\n flex-direction: column;\n align-items: stretch;\n }\n .kol-toolbar:focus-within {\n outline: 1px solid;\n outline-offset: 2px;\n }\n}",KolToolbar=class{constructor(n){registerInstance(this,n),this.state={_label:"",_items:[]},this.currentIndex=0,this.indexToElement=new Map,this.renderItem=(n,e)=>{const t=e!==this.currentIndex||(null==n?void 0:n._disabled)?-1:0,o={key:e,class:"button normal kol-toolbar__item",_tabIndex:t},i=n=>{n&&this.indexToElement.set(e,n)};return"_href"in n?h(KolLinkWcTag,Object.assign({},n,o,{ref:i,_role:"button"})):h(KolButtonWcTag,Object.assign({},n,o,{ref:i}))}}render(){return h("div",{key:"db8a0f35bc8bc3a3b4c1539bd3440dd2c317d7fc",class:`kol-toolbar kol-toolbar--orientation-${this.state._orientation}`,role:"toolbar","aria-label":this.state._label},this.state._items.map(this.renderItem))}validateLabel(n){validateLabel(this,n)}validateItems(n){validateToolbarItems(this,n)}validateOrientation(n){validateOrientation(this,n)}getCurrentToolbarItem(n){return"number"==typeof n?this.indexToElement.get(n):void 0}setFirstEnabledItemIndex(){var n;this.currentIndex=null===(n=this.state._items)||void 0===n?void 0:n.findIndex((n=>!n._disabled))}handleKeyDown(n){var e,t;const o=n.code;if(![KeyboardKey.ArrowUp,KeyboardKey.ArrowDown,KeyboardKey.ArrowRight,KeyboardKey.ArrowLeft].includes(o))return;n.preventDefault();const i=(null===(e=this._items)||void 0===e?void 0:e.length)-1,a=this.currentIndex;let r=0;switch(o){case KeyboardKey.ArrowUp:case KeyboardKey.ArrowLeft:r=a!==r?a-1:i;break;case KeyboardKey.ArrowDown:case KeyboardKey.ArrowRight:i!==a&&(r=a+1)}a!==r&&(this.currentIndex=r,null===(t=this.getCurrentToolbarItem(r))||void 0===t||t.kolFocus())}handleBlur(n){n.target===this.host&&this.setFirstEnabledItemIndex()}componentWillLoad(){this.validateLabel(this._label),this.validateItems(this._items),this.validateOrientation(this._orientation),this.setFirstEnabledItemIndex()}get host(){return getElement(this)}static get watchers(){return{_label:["validateLabel"],_items:["validateItems"],_orientation:["validateOrientation"]}}};KolToolbar.style={default:defaultStyleCss};export{KolToolbar as kol_toolbar};
4
+ import{r as registerInstance,h,g as getElement}from"./index-DTM8XbOu.js";import{O as emptyStringByArrayHandler,o as objectObjectHandler,p as parseJson,s as setState}from"./common-7RW_NFNf.js";import{v as validateLabel}from"./label-DAfXJvJZ.js";import{f as KolLinkWcTag,d as KolButtonWcTag}from"./component-names-CkE54Ym7.js";import{v as validateOrientation}from"./orientation-BV4mvHIC.js";import{K as KeyboardKey}from"./keyboard-D6PoWr38.js";const validateToolbarItems=(n,e)=>{emptyStringByArrayHandler(e,(()=>{objectObjectHandler(e,(()=>{void 0===e&&(e=[]);try{e=parseJson(e)}catch(n){}Array.isArray(e)&&e.every((n=>"object"==typeof n&&null!==n))&&setState(n,"_items",e)}))}))},defaultStyleCss="@charset \"UTF-8\";\n/* forward the rem function */\n/*\n * This file contains all rules for accessibility.\n */\n@layer kol-a11y {\n :host {\n /*\n * Minimum size of interactive elements.\n */\n --a11y-min-size: calc(44rem / var(--kolibri-root-font-size, 16));\n color: black;\n /*\n * No element should be used without a background and font color whose contrast ratio has\n * not been checked. By initially setting the background color to white and the font color\n * to black, the contrast ratio is ensured and explicit adjustment is forced.\n */\n background-color: white;\n /*\n * Verdana is an accessible font that can be used without requiring additional loading time.\n */\n font-family: Verdana;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n * {\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n hyphens: auto;\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n word-break: break-word;\n }\n /*\n * All interactive elements should have a minimum size of to-rem(44).\n */\n /* input:not([type='checkbox'], [type='radio'], [type='range']), */\n /* option, */\n /* select, */\n /* textarea, */\n [role=button],\n button:not([role=link]),\n .kol-input .input {\n min-width: var(--a11y-min-size);\n min-height: var(--a11y-min-size);\n }\n /*\n * Some interactive elements should not inherit the font-family and font-size.\n */\n a,\n button,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n input,\n option,\n select,\n textarea {\n /*\n * All elements should inherit the font family from his parent element.\n */\n font-family: inherit;\n /*\n * All elements should inherit the font size from his parent element.\n */\n font-size: inherit;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n /**\n * Sometimes we need the semantic element for accessibility reasons,\n * but we don't want to show it.\n *\n * - https://www.a11yproject.com/posts/how-to-hide-content/\n */\n .visually-hidden {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n white-space: nowrap;\n clip: rect(0 0 0 0);\n clip-path: inset(50%);\n }\n}\n@layer kol-global {\n /*\n * Dieses CSS stellt sicher, dass der Standard-Style\n * von A und Button resettet werden.\n */\n :is(a, button) {\n background-color: transparent;\n width: 100%;\n margin: 0;\n padding: 0;\n border: none;\n /* 100% needed for custom width from outside */\n }\n /*\n * Ensure elements with hidden attribute to be actually not visible\n * @see https://meowni.ca/hidden.is.a.lie.html\n */\n [hidden] {\n display: none !important;\n }\n .badge-text-hint {\n color: black;\n background-color: lightgray;\n }\n}\n@layer kol-global {\n :host {\n /*\n * The max-width is needed to prevent the table from overflowing the\n * parent node, if the table is wider than the parent node.\n */\n max-width: 100%;\n font-size: calc(16rem / var(--kolibri-root-font-size, 16));\n }\n * {\n /*\n * We prefer to box-sizing: border-box for all elements.\n */\n box-sizing: border-box;\n }\n .kol-span {\n /* KolSpan is a layout component with icons in all directions and a label text in the middle. */\n display: grid;\n place-items: center;\n /* The sub span in KolSpan is the horizontal span with icon left and right and the label text in the middle. */\n }\n .kol-span__container {\n display: flex;\n place-items: center;\n }\n a,\n button {\n cursor: pointer;\n }\n .kol-span .kol-span__label--hide-label .kol-span__label {\n display: none;\n }\n /* Reset browser agent style. */\n button:disabled {\n color: unset;\n }\n .disabled label,\n .disabled:focus-within label,\n [aria-disabled=true],\n [aria-disabled=true]:focus,\n [disabled],\n [disabled]:focus {\n opacity: 0.5;\n outline: none;\n cursor: not-allowed;\n }\n [aria-disabled=true]:focus .kol-span,\n [disabled]:focus .kol-span {\n outline: none !important;\n }\n}\n@layer kol-component {\n @keyframes fadeInOpacity {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n .kol-tooltip {\n display: contents;\n contain: layout;\n }\n .kol-tooltip__floating {\n display: none;\n position: fixed;\n /* Avoid layout interference - see https://floating-ui.com/docs/computePosition */\n top: 0;\n left: 0;\n /* Can be used to specify the tooltip-width from the outside. Unset by default. */\n width: var(--kol-tooltip-width);\n max-width: 90vw;\n max-height: 90vh;\n visibility: hidden;\n animation-duration: 0.25s;\n animation-iteration-count: 1;\n animation-name: fadeInOpacity;\n animation-timing-function: ease-in;\n }\n .kol-tooltip__arrow {\n transform: rotate(45deg);\n color: #000;\n background-color: #fff;\n position: absolute;\n z-index: 999;\n width: calc(10rem / var(--kolibri-root-font-size, 16));\n height: calc(10rem / var(--kolibri-root-font-size, 16));\n }\n .kol-tooltip__content {\n color: #000;\n background-color: #fff;\n position: relative;\n z-index: 1000;\n }\n}\n@layer kol-component {\n :host {\n display: inline-block;\n }\n .kol-link {\n display: inline-flex;\n place-items: center;\n font-style: calc(16rem / var(--kolibri-root-font-size, 16));\n text-align: center;\n text-decoration-line: none;\n }\n .kol-link::before {\n /* Render zero-width character as first element to set the baseline correctly. */\n content: \"​\";\n }\n .kol-link__text {\n width: 100%;\n margin: auto;\n }\n}\n@layer kol-component {\n .kol-toolbar {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n }\n .kol-toolbar--orientation-vertical {\n flex-direction: column;\n align-items: stretch;\n }\n .kol-toolbar:focus-within {\n outline: 1px solid;\n outline-offset: 2px;\n }\n}",KolToolbar=class{constructor(n){registerInstance(this,n),this.state={_label:"",_items:[]},this.currentIndex=0,this.indexToElement=new Map,this.renderItem=(n,e)=>{const t=e!==this.currentIndex||(null==n?void 0:n._disabled)?-1:0,o={key:e,class:"button normal kol-toolbar__item",_tabIndex:t},i=n=>{n&&this.indexToElement.set(e,n)};return"_href"in n?h(KolLinkWcTag,Object.assign({},n,o,{ref:i,_role:"button"})):h(KolButtonWcTag,Object.assign({},n,o,{ref:i}))}}render(){return h("div",{key:"db8a0f35bc8bc3a3b4c1539bd3440dd2c317d7fc",class:`kol-toolbar kol-toolbar--orientation-${this.state._orientation}`,role:"toolbar","aria-label":this.state._label},this.state._items.map(this.renderItem))}validateLabel(n){validateLabel(this,n)}validateItems(n){validateToolbarItems(this,n)}validateOrientation(n){validateOrientation(this,n)}getCurrentToolbarItem(n){return"number"==typeof n?this.indexToElement.get(n):void 0}setFirstEnabledItemIndex(){var n;this.currentIndex=null===(n=this.state._items)||void 0===n?void 0:n.findIndex((n=>!n._disabled))}handleKeyDown(n){var e,t;const o=n.code;if(![KeyboardKey.ArrowUp,KeyboardKey.ArrowDown,KeyboardKey.ArrowRight,KeyboardKey.ArrowLeft].includes(o))return;n.preventDefault();const i=(null===(e=this._items)||void 0===e?void 0:e.length)-1,a=this.currentIndex;let r=0;switch(o){case KeyboardKey.ArrowUp:case KeyboardKey.ArrowLeft:r=a!==r?a-1:i;break;case KeyboardKey.ArrowDown:case KeyboardKey.ArrowRight:i!==a&&(r=a+1)}a!==r&&(this.currentIndex=r,null===(t=this.getCurrentToolbarItem(r))||void 0===t||t.kolFocus())}handleBlur(n){n.target===this.host&&this.setFirstEnabledItemIndex()}componentWillLoad(){this.validateLabel(this._label),this.validateItems(this._items),this.validateOrientation(this._orientation),this.setFirstEnabledItemIndex()}get host(){return getElement(this)}static get watchers(){return{_label:["validateLabel"],_items:["validateItems"],_orientation:["validateOrientation"]}}};KolToolbar.style={default:defaultStyleCss};export{KolToolbar as kol_toolbar};
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * KoliBri - The accessible HTML-Standard
3
3
  */
4
- import{r as registerInstance,h,H as Host,g as getElement}from"./index-BwHVuv1c.js";import{b as autoUpdate,a as alignFloatingElements}from"./align-floating-elements-DcJPtpqg.js";import{e as watchString,A as getDocument}from"./common-7RW_NFNf.js";import{v as validateAlign}from"./align-DoCRbhrp.js";import{v as validateLabel}from"./label-DAfXJvJZ.js";import"./Alert-CTk_PNsB.js";import{K as KolSpanFc}from"./Span-CLrfUTlO.js";import"./i18n-yBVLeHdv.js";import"./Heading-CdL171uD.js";import"./clsx-eK3rPvPS.js";import"./component-names-CkE54Ym7.js";import"./bem-CwA0xXwr.js";import"./browser-D7tkBuSS.js";import"./Icon-BFZ6Qv6o.js";import"./markdown-RQjNjZ_M.js";import"./InternalUnderlinedBadgeText-BTlxPf6n.js";import"./isObject-DvSELytj.js";import"./i18n-CjhRejiw.js";const validateBadgeText=(t,e)=>{watchString(t,"_badgeText",e)},validateId=(t,e)=>{watchString(t,"_id",e)},VISIBLE_OVERLAYS=new Set;function showOverlay(t){VISIBLE_OVERLAYS.forEach((t=>{t.style.setProperty("z-index","999")})),VISIBLE_OVERLAYS.add(t),t.style.setProperty("z-index","1000")}function hideOverlay(t){if(VISIBLE_OVERLAYS.delete(t),VISIBLE_OVERLAYS.size>0){const t=Array.from(VISIBLE_OVERLAYS).pop();t&&t.style.setProperty("z-index","1000")}}const TOOLTIP_DELAY=300,KolTooltipWc=class{constructor(t){registerInstance(this,t),this.showTooltip=()=>{if(this.previousSibling&&this.tooltipElement){showOverlay(this.tooltipElement),this.tooltipElement.style.setProperty("display","block"),getDocument().addEventListener("keyup",this.hideTooltipByEscape);const t=this.previousSibling,e=this.tooltipElement;this.cleanupAutoPositioning=autoUpdate(t,e,(()=>{this.alignTooltip()}))}},this.showTooltipWithDelay=()=>{clearTimeout(this.hideTooltipTimeout),clearTimeout(this.showTooltipTimeout),this.showTooltipTimeout=setTimeout((()=>{this.showTooltip()}),300)},this.hideTooltipWithDelay=()=>{clearTimeout(this.hideTooltipTimeout),this.hideTooltipTimeout=setTimeout((()=>{this.hideTooltip()}),300)},this.hideTooltipByEscape=t=>{"Escape"===t.key&&this.hideTooltip()},this.addListeners=t=>{t.addEventListener("mouseenter",this.handleMouseEnter.bind(this)),t.addEventListener("mouseleave",this.handleMouseleave.bind(this)),t.addEventListener("focusin",this.handleFocusIn.bind(this)),t.addEventListener("focusout",this.handleFocusout.bind(this))},this.removeListeners=t=>{t.removeEventListener("mouseenter",this.handleMouseEnter.bind(this)),t.removeEventListener("mouseleave",this.handleMouseleave.bind(this)),t.removeEventListener("focusin",this.handleFocusIn.bind(this)),t.removeEventListener("focusout",this.handleFocusout.bind(this))},this.resyncListeners=(t,e,i=!1)=>{t&&this.removeListeners(t),e&&(i&&(this.previousSibling=e),this.addListeners(e))},this.catchTooltipElement=t=>{this.tooltipElement=t},this.catchArrowElement=t=>{this.arrowElement=t},this._align="top",this.state={_align:"top",_label:""}}async alignTooltip(){this.tooltipElement&&this.previousSibling&&await alignFloatingElements({align:this._align,referenceElement:this.previousSibling,arrowElement:this.arrowElement,floatingElement:this.tooltipElement})}async hideTooltip(){clearTimeout(this.showTooltipTimeout),this.tooltipElement&&(hideOverlay(this.tooltipElement),this.tooltipElement.style.setProperty("display","none"),this.tooltipElement.style.setProperty("visibility","hidden"),this.cleanupAutoPositioning&&(this.cleanupAutoPositioning(),this.cleanupAutoPositioning=void 0)),getDocument().removeEventListener("keyup",this.hideTooltipByEscape)}handleMouseEnter(){this.showTooltipWithDelay()}handleMouseleave(){this.hideTooltipWithDelay()}handleFocusIn(){this.showTooltipWithDelay()}handleFocusout(){this.hideTooltipWithDelay()}render(){return h(Host,{key:"60be1bd258bc5ae2b0ecce9374607d11476071b1",class:"kol-tooltip"},""!==this.state._label&&h("div",{key:"2af044756ca7d87c5b789181da84556a517c0ee4",class:"kol-tooltip__floating",ref:this.catchTooltipElement},h("div",{key:"057fc2de5c87f0f82e9477568992048bf3918e77",class:"kol-tooltip__arrow",ref:this.catchArrowElement}),h(KolSpanFc,{key:"1ba456fb877c04c0dc1e93431f90db07f2e90b47",class:"kol-tooltip__content",id:this.state._id,badgeText:this._badgeText,label:this.state._label})))}validateBadgeText(t){validateBadgeText(this,t)}validateAlign(t){validateAlign(this,t)}validateId(t){validateId(this,t)}validateLabel(t){validateLabel(this,t,{required:!0})}componentWillLoad(){this.validateBadgeText(this._badgeText),this.validateAlign(this._align),this.validateId(this._id),this.validateLabel(this._label)}handleEventListeners(){var t;this.resyncListeners(this.previousSibling,null===(t=this.host)||void 0===t?void 0:t.previousElementSibling,!0),this.resyncListeners(this.tooltipElement,this.tooltipElement)}connectedCallback(){var t;this.previousSibling=null===(t=this.host)||void 0===t?void 0:t.previousElementSibling}componentDidRender(){this.handleEventListeners()}disconnectedCallback(){this.previousSibling&&(this.removeListeners(this.previousSibling),this.previousSibling=void 0),this.tooltipElement&&this.removeListeners(this.tooltipElement),this.cleanupAutoPositioning&&this.cleanupAutoPositioning()}get host(){return getElement(this)}static get watchers(){return{_badgeText:["validateBadgeText"],_align:["validateAlign"],_id:["validateId"],_label:["validateLabel"]}}};export{KolTooltipWc as kol_tooltip_wc};
4
+ import{r as registerInstance,h,H as Host,g as getElement}from"./index-DTM8XbOu.js";import{b as autoUpdate,a as alignFloatingElements}from"./align-floating-elements-DcJPtpqg.js";import{e as watchString,A as getDocument}from"./common-7RW_NFNf.js";import{v as validateAlign}from"./align-DoCRbhrp.js";import{v as validateLabel}from"./label-DAfXJvJZ.js";import"./Alert-Bbh--qXI.js";import{K as KolSpanFc}from"./Span-Bgdwx7W2.js";import"./i18n-yBVLeHdv.js";import"./Heading-BYeuylXc.js";import"./clsx-eK3rPvPS.js";import"./component-names-CkE54Ym7.js";import"./bem-CwA0xXwr.js";import"./browser-D7tkBuSS.js";import"./Icon-BttEGYV4.js";import"./markdown-RQjNjZ_M.js";import"./InternalUnderlinedBadgeText-CRfceIpy.js";import"./isObject-DvSELytj.js";import"./i18n-CjhRejiw.js";const validateBadgeText=(t,e)=>{watchString(t,"_badgeText",e)},validateId=(t,e)=>{watchString(t,"_id",e)},VISIBLE_OVERLAYS=new Set;function showOverlay(t){VISIBLE_OVERLAYS.forEach((t=>{t.style.setProperty("z-index","999")})),VISIBLE_OVERLAYS.add(t),t.style.setProperty("z-index","1000")}function hideOverlay(t){if(VISIBLE_OVERLAYS.delete(t),VISIBLE_OVERLAYS.size>0){const t=Array.from(VISIBLE_OVERLAYS).pop();t&&t.style.setProperty("z-index","1000")}}const TOOLTIP_DELAY=300,KolTooltipWc=class{constructor(t){registerInstance(this,t),this.showTooltip=()=>{if(this.previousSibling&&this.tooltipElement){showOverlay(this.tooltipElement),this.tooltipElement.style.setProperty("display","block"),getDocument().addEventListener("keyup",this.hideTooltipByEscape);const t=this.previousSibling,e=this.tooltipElement;this.cleanupAutoPositioning=autoUpdate(t,e,(()=>{this.alignTooltip()}))}},this.showTooltipWithDelay=()=>{clearTimeout(this.hideTooltipTimeout),clearTimeout(this.showTooltipTimeout),this.showTooltipTimeout=setTimeout((()=>{this.showTooltip()}),300)},this.hideTooltipWithDelay=()=>{clearTimeout(this.hideTooltipTimeout),this.hideTooltipTimeout=setTimeout((()=>{this.hideTooltip()}),300)},this.hideTooltipByEscape=t=>{"Escape"===t.key&&this.hideTooltip()},this.addListeners=t=>{t.addEventListener("mouseenter",this.handleMouseEnter.bind(this)),t.addEventListener("mouseleave",this.handleMouseleave.bind(this)),t.addEventListener("focusin",this.handleFocusIn.bind(this)),t.addEventListener("focusout",this.handleFocusout.bind(this))},this.removeListeners=t=>{t.removeEventListener("mouseenter",this.handleMouseEnter.bind(this)),t.removeEventListener("mouseleave",this.handleMouseleave.bind(this)),t.removeEventListener("focusin",this.handleFocusIn.bind(this)),t.removeEventListener("focusout",this.handleFocusout.bind(this))},this.resyncListeners=(t,e,i=!1)=>{t&&this.removeListeners(t),e&&(i&&(this.previousSibling=e),this.addListeners(e))},this.catchTooltipElement=t=>{this.tooltipElement=t},this.catchArrowElement=t=>{this.arrowElement=t},this._align="top",this.state={_align:"top",_label:""}}async alignTooltip(){this.tooltipElement&&this.previousSibling&&await alignFloatingElements({align:this._align,referenceElement:this.previousSibling,arrowElement:this.arrowElement,floatingElement:this.tooltipElement})}async hideTooltip(){clearTimeout(this.showTooltipTimeout),this.tooltipElement&&(hideOverlay(this.tooltipElement),this.tooltipElement.style.setProperty("display","none"),this.tooltipElement.style.setProperty("visibility","hidden"),this.cleanupAutoPositioning&&(this.cleanupAutoPositioning(),this.cleanupAutoPositioning=void 0)),getDocument().removeEventListener("keyup",this.hideTooltipByEscape)}handleMouseEnter(){this.showTooltipWithDelay()}handleMouseleave(){this.hideTooltipWithDelay()}handleFocusIn(){this.showTooltipWithDelay()}handleFocusout(){this.hideTooltipWithDelay()}render(){return h(Host,{key:"60be1bd258bc5ae2b0ecce9374607d11476071b1",class:"kol-tooltip"},""!==this.state._label&&h("div",{key:"2af044756ca7d87c5b789181da84556a517c0ee4",class:"kol-tooltip__floating",ref:this.catchTooltipElement},h("div",{key:"057fc2de5c87f0f82e9477568992048bf3918e77",class:"kol-tooltip__arrow",ref:this.catchArrowElement}),h(KolSpanFc,{key:"1ba456fb877c04c0dc1e93431f90db07f2e90b47",class:"kol-tooltip__content",id:this.state._id,badgeText:this._badgeText,label:this.state._label})))}validateBadgeText(t){validateBadgeText(this,t)}validateAlign(t){validateAlign(this,t)}validateId(t){validateId(this,t)}validateLabel(t){validateLabel(this,t,{required:!0})}componentWillLoad(){this.validateBadgeText(this._badgeText),this.validateAlign(this._align),this.validateId(this._id),this.validateLabel(this._label)}handleEventListeners(){var t;this.resyncListeners(this.previousSibling,null===(t=this.host)||void 0===t?void 0:t.previousElementSibling,!0),this.resyncListeners(this.tooltipElement,this.tooltipElement)}connectedCallback(){var t;this.previousSibling=null===(t=this.host)||void 0===t?void 0:t.previousElementSibling}componentDidRender(){this.handleEventListeners()}disconnectedCallback(){this.previousSibling&&(this.removeListeners(this.previousSibling),this.previousSibling=void 0),this.tooltipElement&&this.removeListeners(this.tooltipElement),this.cleanupAutoPositioning&&this.cleanupAutoPositioning()}get host(){return getElement(this)}static get watchers(){return{_badgeText:["validateBadgeText"],_align:["validateAlign"],_id:["validateId"],_label:["validateLabel"]}}};export{KolTooltipWc as kol_tooltip_wc};
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * KoliBri - The accessible HTML-Standard
3
3
  */
4
- import{r as registerInstance,h,H as Host,g as getElement}from"./index-BwHVuv1c.js";import{d as watchBoolean}from"./common-7RW_NFNf.js";import{v as validateHref}from"./href-4XW2Ab0f.js";import{v as validateLabel}from"./label-DAfXJvJZ.js";import{v as validateOpen}from"./open-k4WSPWPA.js";import{f as KolLinkWcTag,e as KolIconTag,x as KolTreeTag}from"./component-names-CkE54Ym7.js";import{n as nonce}from"./dev.utils-B25txGhq.js";import{c as clsx}from"./clsx-eK3rPvPS.js";const validateActive=(e,t,a)=>{watchBoolean(e,"_active",t,a)},KolTreeItemWc=class{constructor(e){registerInstance(this,e),this.groupId=`tree-group-${nonce()}`,this.state={_active:!1,_hasChildren:!1,_href:"",_label:"",_open:!1}}render(){const{_href:e,_active:t,_hasChildren:a,_open:i,_label:l}=this.state;return h(Host,{key:"e8cebee52ed0f115c3aa30e82e2e3ccf5d09e626",onSlotchange:this.handleSlotchange.bind(this)},h("li",{key:"c4b1d56ae69f55ca57ad8d863df02fe0d7ff4f00",class:"kol-tree-item",style:{"--level":`${this.level}`}},h(KolLinkWcTag,{key:"8e87e00dae2d0e6dcad5602e28b5642bc31702f5",class:clsx("kol-tree-item__link",{"kol-tree-item__link--first-level":0===this.level,"kol-tree-item__link--active":t}),_href:e,_label:"",_role:"treeitem",_tabIndex:t?0:-1,_ariaExpanded:a?i:void 0,_ariaOwns:a?this.groupId:void 0,ref:e=>this.linkElement=e},h("span",{key:"2375f5ff6abe59419b5d4ef28e5e0f104034fef3",class:"kol-tree-item__link-inner",slot:"expert"},a?h("span",{class:"kol-tree-item__toggle-button",onClick:e=>i?void this.handleCollapseClick(e):void this.handleExpandClick(e)},h(KolIconTag,{class:"kol-tree-item__toggle-button-icon",_icons:"codicon codicon-"+(i?"chevron-down":"chevron-right"),_label:""})):h("span",{class:"kol-tree-item__toggle-button-placeholder"}),h("span",{key:"39c07661723143bfafcc6ee8e96e51bd88daa940",class:"kol-tree-item__text"},l))),h("ul",{key:"2bd2e3a880b4d1946f00e46784f476e69508441b",class:"kol-tree-item__children",hidden:!a||!i,role:"group",id:this.groupId},h("slot",{key:"472cc53e288b84a99a0190a82be67e04ce851f99"}))))}validateActive(e){validateActive(this,e||!1)}validateLabel(e){validateLabel(this,e)}validateOpen(e){validateOpen(this,e)}validateHref(e){validateHref(this,e)}componentWillLoad(){this.validateActive(this._active),this.validateLabel(this._label),this.validateOpen(this._open),this.validateHref(this._href),this.checkForChildren(),this.determineTreeItemDepth()}determineTreeItemDepth(){let e=0,t=this.host.parentNode.host.parentNode;for(;null!==t&&t.tagName.toLowerCase()!==KolTreeTag&&t!==document.body;)t=t.parentElement,e+=1;this.level=e}handleSlotchange(){this.checkForChildren()}checkForChildren(){var e,t;this.state=Object.assign(Object.assign({},this.state),{_hasChildren:Boolean(null===(t=null===(e=this.host.querySelector("slot"))||void 0===e?void 0:e.assignedElements)||void 0===t?void 0:t.call(e).length)})}async focusLink(){await this.linkElement.kolFocus()}async handleExpandClick(e){e.preventDefault(),await this.linkElement.kolFocus(),await this.expand()}async expand(){this.state._hasChildren&&(this.state=Object.assign(Object.assign({},this.state),{_open:!0}))}async handleCollapseClick(e){e.preventDefault(),this.linkElement.focus(),await this.collapse()}async collapse(){this.state._hasChildren&&(this.state=Object.assign(Object.assign({},this.state),{_open:!1}))}async isOpen(){var e;return null!==(e=this.state._open)&&void 0!==e&&e}get host(){return getElement(this)}static get watchers(){return{_active:["validateActive"],_label:["validateLabel"],_open:["validateOpen"],_href:["validateHref"]}}};export{KolTreeItemWc as kol_tree_item_wc};
4
+ import{r as registerInstance,h,H as Host,g as getElement}from"./index-DTM8XbOu.js";import{d as watchBoolean}from"./common-7RW_NFNf.js";import{v as validateHref}from"./href-4XW2Ab0f.js";import{v as validateLabel}from"./label-DAfXJvJZ.js";import{v as validateOpen}from"./open-k4WSPWPA.js";import{f as KolLinkWcTag,e as KolIconTag,x as KolTreeTag}from"./component-names-CkE54Ym7.js";import{n as nonce}from"./dev.utils-vAdYjvGq.js";import{c as clsx}from"./clsx-eK3rPvPS.js";const validateActive=(e,t,a)=>{watchBoolean(e,"_active",t,a)},KolTreeItemWc=class{constructor(e){registerInstance(this,e),this.groupId=`tree-group-${nonce()}`,this.state={_active:!1,_hasChildren:!1,_href:"",_label:"",_open:!1}}render(){const{_href:e,_active:t,_hasChildren:a,_open:i,_label:l}=this.state;return h(Host,{key:"e8cebee52ed0f115c3aa30e82e2e3ccf5d09e626",onSlotchange:this.handleSlotchange.bind(this)},h("li",{key:"c4b1d56ae69f55ca57ad8d863df02fe0d7ff4f00",class:"kol-tree-item",style:{"--level":`${this.level}`}},h(KolLinkWcTag,{key:"8e87e00dae2d0e6dcad5602e28b5642bc31702f5",class:clsx("kol-tree-item__link",{"kol-tree-item__link--first-level":0===this.level,"kol-tree-item__link--active":t}),_href:e,_label:"",_role:"treeitem",_tabIndex:t?0:-1,_ariaExpanded:a?i:void 0,_ariaOwns:a?this.groupId:void 0,ref:e=>this.linkElement=e},h("span",{key:"2375f5ff6abe59419b5d4ef28e5e0f104034fef3",class:"kol-tree-item__link-inner",slot:"expert"},a?h("span",{class:"kol-tree-item__toggle-button",onClick:e=>i?void this.handleCollapseClick(e):void this.handleExpandClick(e)},h(KolIconTag,{class:"kol-tree-item__toggle-button-icon",_icons:"codicon codicon-"+(i?"chevron-down":"chevron-right"),_label:""})):h("span",{class:"kol-tree-item__toggle-button-placeholder"}),h("span",{key:"39c07661723143bfafcc6ee8e96e51bd88daa940",class:"kol-tree-item__text"},l))),h("ul",{key:"2bd2e3a880b4d1946f00e46784f476e69508441b",class:"kol-tree-item__children",hidden:!a||!i,role:"group",id:this.groupId},h("slot",{key:"472cc53e288b84a99a0190a82be67e04ce851f99"}))))}validateActive(e){validateActive(this,e||!1)}validateLabel(e){validateLabel(this,e)}validateOpen(e){validateOpen(this,e)}validateHref(e){validateHref(this,e)}componentWillLoad(){this.validateActive(this._active),this.validateLabel(this._label),this.validateOpen(this._open),this.validateHref(this._href),this.checkForChildren(),this.determineTreeItemDepth()}determineTreeItemDepth(){let e=0,t=this.host.parentNode.host.parentNode;for(;null!==t&&t.tagName.toLowerCase()!==KolTreeTag&&t!==document.body;)t=t.parentElement,e+=1;this.level=e}handleSlotchange(){this.checkForChildren()}checkForChildren(){var e,t;this.state=Object.assign(Object.assign({},this.state),{_hasChildren:Boolean(null===(t=null===(e=this.host.querySelector("slot"))||void 0===e?void 0:e.assignedElements)||void 0===t?void 0:t.call(e).length)})}async focusLink(){await this.linkElement.kolFocus()}async handleExpandClick(e){e.preventDefault(),await this.linkElement.kolFocus(),await this.expand()}async expand(){this.state._hasChildren&&(this.state=Object.assign(Object.assign({},this.state),{_open:!0}))}async handleCollapseClick(e){e.preventDefault(),this.linkElement.focus(),await this.collapse()}async collapse(){this.state._hasChildren&&(this.state=Object.assign(Object.assign({},this.state),{_open:!1}))}async isOpen(){var e;return null!==(e=this.state._open)&&void 0!==e&&e}get host(){return getElement(this)}static get watchers(){return{_active:["validateActive"],_label:["validateLabel"],_open:["validateOpen"],_href:["validateHref"]}}};export{KolTreeItemWc as kol_tree_item_wc};