@public-ui/components 3.0.0-rc.4 → 3.0.0-rc.6

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 (702) hide show
  1. package/custom-elements.json +152 -111
  2. package/dist/cjs/{Alert-d3173bbc.js → Alert-a5b198e6.js} +1 -1
  3. package/dist/cjs/{Alert-d3173bbc.js.map → Alert-a5b198e6.js.map} +1 -1
  4. package/dist/cjs/{Collapsible-4b03ba6d.js → Collapsible-844445d4.js} +1 -1
  5. package/dist/cjs/{Collapsible-4b03ba6d.js.map → Collapsible-844445d4.js.map} +1 -1
  6. package/dist/cjs/{CustomSuggestionsOptionsGroup-63905604.js → CustomSuggestionsOptionsGroup-77d600fa.js} +1 -1
  7. package/dist/cjs/{CustomSuggestionsOptionsGroup-63905604.js.map → CustomSuggestionsOptionsGroup-77d600fa.js.map} +1 -1
  8. package/dist/cjs/{FieldControlStateWrapper-6bafd228.js → FieldControlStateWrapper-07e57b91.js} +1 -1
  9. package/dist/cjs/{FieldControlStateWrapper-6bafd228.js.map → FieldControlStateWrapper-07e57b91.js.map} +1 -1
  10. package/dist/cjs/FormFieldMsg-e1ae42e0.js +4 -0
  11. package/dist/cjs/{FormFieldMsg-370f014e.js.map → FormFieldMsg-e1ae42e0.js.map} +1 -1
  12. package/dist/cjs/{Heading-f5dd89a7.js → Heading-11d92da1.js} +1 -1
  13. package/dist/cjs/{Heading-f5dd89a7.js.map → Heading-11d92da1.js.map} +1 -1
  14. package/dist/cjs/Icon-e7c8d39a.js +4 -0
  15. package/dist/cjs/{Icon-0eed071b.js.map → Icon-e7c8d39a.js.map} +1 -1
  16. package/dist/cjs/{Input-766cb8ca.js → Input-36131161.js} +1 -1
  17. package/dist/cjs/{Input-766cb8ca.js.map → Input-36131161.js.map} +1 -1
  18. package/dist/cjs/{InputStateWrapper-9e99208c.js → InputStateWrapper-e31cb78c.js} +1 -1
  19. package/dist/cjs/{InputStateWrapper-9e99208c.js.map → InputStateWrapper-e31cb78c.js.map} +1 -1
  20. package/dist/cjs/{InternalUnderlinedBadgeText-58120685.js → InternalUnderlinedBadgeText-ee3dbba6.js} +1 -1
  21. package/dist/cjs/{InternalUnderlinedBadgeText-58120685.js.map → InternalUnderlinedBadgeText-ee3dbba6.js.map} +1 -1
  22. package/dist/cjs/{Span-722fdf09.js → Span-b6b1c70b.js} +1 -1
  23. package/dist/cjs/{Span-722fdf09.js.map → Span-b6b1c70b.js.map} +1 -1
  24. package/dist/cjs/{app-globals-916df316.js → app-globals-5daba31a.js} +1 -1
  25. package/dist/cjs/{app-globals-916df316.js.map → app-globals-5daba31a.js.map} +1 -1
  26. package/dist/cjs/component-names-74abfa2e.js +4 -0
  27. package/dist/cjs/component-names-74abfa2e.js.map +1 -0
  28. package/dist/cjs/{controller-111255ac.js → controller-3383d544.js} +1 -1
  29. package/dist/cjs/{controller-111255ac.js.map → controller-3383d544.js.map} +1 -1
  30. package/dist/cjs/{controller-a9e3b9a8.js → controller-ea888e13.js} +1 -1
  31. package/dist/cjs/{controller-a9e3b9a8.js.map → controller-ea888e13.js.map} +1 -1
  32. package/dist/cjs/{controller-c17a58e8.js → controller-f5116746.js} +1 -1
  33. package/dist/cjs/{controller-c17a58e8.js.map → controller-f5116746.js.map} +1 -1
  34. package/dist/cjs/{controller-14077cbb.js → controller-fcd5edcb.js} +1 -1
  35. package/dist/cjs/{controller-14077cbb.js.map → controller-fcd5edcb.js.map} +1 -1
  36. package/dist/cjs/{controller-icon-4cb3d925.js → controller-icon-87bb43d8.js} +1 -1
  37. package/dist/cjs/{controller-icon-4cb3d925.js.map → controller-icon-87bb43d8.js.map} +1 -1
  38. package/dist/cjs/{dev.utils-c561d218.js → dev.utils-0fbf39d5.js} +1 -1
  39. package/dist/cjs/{dev.utils-c561d218.js.map → dev.utils-0fbf39d5.js.map} +1 -1
  40. package/dist/cjs/{devtools-d8ea3563.js → devtools-10797f26.js} +1 -1
  41. package/dist/cjs/{devtools-d8ea3563.js.map → devtools-10797f26.js.map} +1 -1
  42. package/dist/cjs/getRenderStates-46cbeb01.js +4 -0
  43. package/dist/cjs/getRenderStates-46cbeb01.js.map +1 -0
  44. package/dist/cjs/i18n-583e3c4b.js +4 -0
  45. package/dist/cjs/i18n-583e3c4b.js.map +1 -0
  46. package/dist/cjs/{i18n-1d085d07.js → i18n-cdacfb29.js} +1 -1
  47. package/dist/cjs/{i18n-1d085d07.js.map → i18n-cdacfb29.js.map} +1 -1
  48. package/dist/cjs/index-5eda7e82.js +4 -0
  49. package/dist/cjs/{index-07fcbac9.js.map → index-5eda7e82.js.map} +1 -1
  50. package/dist/cjs/index.cjs.js +1 -1
  51. package/dist/cjs/index.cjs.js.map +1 -1
  52. package/dist/cjs/kol-abbr.cjs.entry.js +1 -1
  53. package/dist/cjs/kol-abbr.cjs.entry.js.map +1 -1
  54. package/dist/cjs/kol-accordion.cjs.entry.js +1 -1
  55. package/dist/cjs/kol-accordion.cjs.entry.js.map +1 -1
  56. package/dist/cjs/kol-alert-wc.cjs.entry.js +1 -1
  57. package/dist/cjs/kol-alert.cjs.entry.js +1 -1
  58. package/dist/cjs/kol-alert.cjs.entry.js.map +1 -1
  59. package/dist/cjs/kol-avatar-wc.cjs.entry.js +1 -1
  60. package/dist/cjs/kol-avatar.cjs.entry.js +1 -1
  61. package/dist/cjs/kol-avatar.cjs.entry.js.map +1 -1
  62. package/dist/cjs/kol-badge.cjs.entry.js +1 -1
  63. package/dist/cjs/kol-badge.cjs.entry.js.map +1 -1
  64. package/dist/cjs/kol-breadcrumb.cjs.entry.js +1 -1
  65. package/dist/cjs/kol-breadcrumb.cjs.entry.js.map +1 -1
  66. package/dist/cjs/kol-button-link.cjs.entry.js +1 -1
  67. package/dist/cjs/kol-button-link.cjs.entry.js.map +1 -1
  68. package/dist/cjs/kol-button-wc.cjs.entry.js +1 -1
  69. package/dist/cjs/kol-button.cjs.entry.js +1 -1
  70. package/dist/cjs/kol-button.cjs.entry.js.map +1 -1
  71. package/dist/cjs/kol-card.cjs.entry.js +1 -1
  72. package/dist/cjs/kol-card.cjs.entry.js.map +1 -1
  73. package/dist/cjs/kol-combobox.cjs.entry.js +1 -1
  74. package/dist/cjs/kol-combobox.cjs.entry.js.map +1 -1
  75. package/dist/cjs/kol-details.cjs.entry.js +1 -1
  76. package/dist/cjs/kol-details.cjs.entry.js.map +1 -1
  77. package/dist/cjs/kol-drawer.cjs.entry.js +1 -1
  78. package/dist/cjs/kol-drawer.cjs.entry.js.map +1 -1
  79. package/dist/cjs/kol-form.cjs.entry.js +1 -1
  80. package/dist/cjs/kol-form.cjs.entry.js.map +1 -1
  81. package/dist/cjs/kol-heading.cjs.entry.js +1 -1
  82. package/dist/cjs/kol-heading.cjs.entry.js.map +1 -1
  83. package/dist/cjs/kol-icon.cjs.entry.js +1 -1
  84. package/dist/cjs/kol-icon.cjs.entry.js.map +1 -1
  85. package/dist/cjs/kol-image.cjs.entry.js +1 -1
  86. package/dist/cjs/kol-image.cjs.entry.js.map +1 -1
  87. package/dist/cjs/kol-input-checkbox.cjs.entry.js +1 -1
  88. package/dist/cjs/kol-input-checkbox.cjs.entry.js.map +1 -1
  89. package/dist/cjs/kol-input-color.cjs.entry.js +1 -1
  90. package/dist/cjs/kol-input-color.cjs.entry.js.map +1 -1
  91. package/dist/cjs/kol-input-date.cjs.entry.js +1 -1
  92. package/dist/cjs/kol-input-date.cjs.entry.js.map +1 -1
  93. package/dist/cjs/kol-input-email.cjs.entry.js +1 -1
  94. package/dist/cjs/kol-input-email.cjs.entry.js.map +1 -1
  95. package/dist/cjs/kol-input-file.cjs.entry.js +1 -1
  96. package/dist/cjs/kol-input-file.cjs.entry.js.map +1 -1
  97. package/dist/cjs/kol-input-number.cjs.entry.js +1 -1
  98. package/dist/cjs/kol-input-number.cjs.entry.js.map +1 -1
  99. package/dist/cjs/kol-input-password.cjs.entry.js +1 -1
  100. package/dist/cjs/kol-input-password.cjs.entry.js.map +1 -1
  101. package/dist/cjs/kol-input-radio.cjs.entry.js +1 -1
  102. package/dist/cjs/kol-input-radio.cjs.entry.js.map +1 -1
  103. package/dist/cjs/kol-input-range.cjs.entry.js +1 -1
  104. package/dist/cjs/kol-input-range.cjs.entry.js.map +1 -1
  105. package/dist/cjs/kol-input-text.cjs.entry.js +1 -1
  106. package/dist/cjs/kol-input-text.cjs.entry.js.map +1 -1
  107. package/dist/cjs/kol-input.cjs.entry.js +1 -1
  108. package/dist/cjs/kol-kolibri.cjs.entry.js +1 -1
  109. package/dist/cjs/kol-kolibri.cjs.entry.js.map +1 -1
  110. package/dist/cjs/kol-link-button.cjs.entry.js +1 -1
  111. package/dist/cjs/kol-link-button.cjs.entry.js.map +1 -1
  112. package/dist/cjs/kol-link-wc.cjs.entry.js +1 -1
  113. package/dist/cjs/kol-link.cjs.entry.js +1 -1
  114. package/dist/cjs/kol-link.cjs.entry.js.map +1 -1
  115. package/dist/cjs/kol-modal.cjs.entry.js +1 -1
  116. package/dist/cjs/kol-modal.cjs.entry.js.map +1 -1
  117. package/dist/cjs/kol-nav.cjs.entry.js +1 -1
  118. package/dist/cjs/kol-nav.cjs.entry.js.map +1 -1
  119. package/dist/cjs/kol-pagination.cjs.entry.js +1 -1
  120. package/dist/cjs/kol-pagination.cjs.entry.js.map +1 -1
  121. package/dist/cjs/kol-popover-button.cjs.entry.js +4 -0
  122. package/dist/cjs/kol-popover-button.cjs.entry.js.map +1 -0
  123. package/dist/cjs/kol-popover-wc.cjs.entry.js +1 -1
  124. package/dist/cjs/kol-popover-wc.cjs.entry.js.map +1 -1
  125. package/dist/cjs/kol-progress.cjs.entry.js +1 -1
  126. package/dist/cjs/kol-progress.cjs.entry.js.map +1 -1
  127. package/dist/cjs/kol-quote.cjs.entry.js +1 -1
  128. package/dist/cjs/kol-quote.cjs.entry.js.map +1 -1
  129. package/dist/cjs/kol-select.cjs.entry.js +1 -1
  130. package/dist/cjs/kol-select.cjs.entry.js.map +1 -1
  131. package/dist/cjs/kol-single-select.cjs.entry.js +1 -1
  132. package/dist/cjs/kol-single-select.cjs.entry.js.map +1 -1
  133. package/dist/cjs/kol-skip-nav.cjs.entry.js +1 -1
  134. package/dist/cjs/kol-skip-nav.cjs.entry.js.map +1 -1
  135. package/dist/cjs/kol-spin.cjs.entry.js +1 -1
  136. package/dist/cjs/kol-spin.cjs.entry.js.map +1 -1
  137. package/dist/cjs/kol-split-button.cjs.entry.js +1 -1
  138. package/dist/cjs/kol-split-button.cjs.entry.js.map +1 -1
  139. package/dist/cjs/kol-table-stateful.cjs.entry.js +1 -1
  140. package/dist/cjs/kol-table-stateful.cjs.entry.js.map +1 -1
  141. package/dist/cjs/kol-table-stateless-wc.cjs.entry.js +1 -1
  142. package/dist/cjs/kol-table-stateless.cjs.entry.js +1 -1
  143. package/dist/cjs/kol-table-stateless.cjs.entry.js.map +1 -1
  144. package/dist/cjs/kol-tabs.cjs.entry.js +1 -1
  145. package/dist/cjs/kol-tabs.cjs.entry.js.map +1 -1
  146. package/dist/cjs/kol-textarea.cjs.entry.js +1 -1
  147. package/dist/cjs/kol-textarea.cjs.entry.js.map +1 -1
  148. package/dist/cjs/kol-toast-container.cjs.entry.js +1 -1
  149. package/dist/cjs/kol-toast-container.cjs.entry.js.map +1 -1
  150. package/dist/cjs/kol-toolbar.cjs.entry.js +1 -1
  151. package/dist/cjs/kol-toolbar.cjs.entry.js.map +1 -1
  152. package/dist/cjs/kol-tooltip-wc.cjs.entry.js +1 -1
  153. package/dist/cjs/kol-tree-item-wc.cjs.entry.js +1 -1
  154. package/dist/cjs/kol-tree-item.cjs.entry.js +1 -1
  155. package/dist/cjs/kol-tree-item.cjs.entry.js.map +1 -1
  156. package/dist/cjs/kol-tree-wc.cjs.entry.js +1 -1
  157. package/dist/cjs/kol-tree.cjs.entry.js +1 -1
  158. package/dist/cjs/kol-tree.cjs.entry.js.map +1 -1
  159. package/dist/cjs/kol-version.cjs.entry.js +1 -1
  160. package/dist/cjs/kol-version.cjs.entry.js.map +1 -1
  161. package/dist/cjs/kolibri.cjs.js +1 -1
  162. package/dist/cjs/loader.cjs.js +1 -1
  163. package/dist/cjs/test-component.cjs.entry.js +1 -1
  164. package/dist/components/component-names.js +1 -1
  165. package/dist/components/component-names.js.map +1 -1
  166. package/dist/components/getRenderStates.js +1 -1
  167. package/dist/components/getRenderStates.js.map +1 -1
  168. package/dist/components/i18n.js +1 -1
  169. package/dist/components/i18n.js.map +1 -1
  170. package/dist/components/index.js +1 -1
  171. package/dist/components/index.js.map +1 -1
  172. package/dist/components/kol-abbr.js +1 -1
  173. package/dist/components/kol-abbr.js.map +1 -1
  174. package/dist/components/kol-accordion.js.map +1 -1
  175. package/dist/components/kol-alert-wc.js +1 -1
  176. package/dist/components/kol-alert.js +1 -1
  177. package/dist/components/kol-alert.js.map +1 -1
  178. package/dist/components/kol-avatar-wc.js +1 -1
  179. package/dist/components/kol-avatar.js +1 -1
  180. package/dist/components/kol-avatar.js.map +1 -1
  181. package/dist/components/kol-badge.js +1 -1
  182. package/dist/components/kol-badge.js.map +1 -1
  183. package/dist/components/kol-breadcrumb.js.map +1 -1
  184. package/dist/components/kol-button-link.js +1 -1
  185. package/dist/components/kol-button-link.js.map +1 -1
  186. package/dist/components/kol-button-wc.js +1 -1
  187. package/dist/components/kol-button.js +1 -1
  188. package/dist/components/kol-button.js.map +1 -1
  189. package/dist/components/kol-card.js +1 -1
  190. package/dist/components/kol-card.js.map +1 -1
  191. package/dist/components/kol-combobox.js +1 -1
  192. package/dist/components/kol-combobox.js.map +1 -1
  193. package/dist/components/kol-details.js +1 -1
  194. package/dist/components/kol-details.js.map +1 -1
  195. package/dist/components/kol-drawer.js +1 -1
  196. package/dist/components/kol-drawer.js.map +1 -1
  197. package/dist/components/kol-form.js +1 -1
  198. package/dist/components/kol-form.js.map +1 -1
  199. package/dist/components/kol-heading.js +1 -1
  200. package/dist/components/kol-heading.js.map +1 -1
  201. package/dist/components/kol-icon.js +1 -1
  202. package/dist/components/kol-icon.js.map +1 -1
  203. package/dist/components/kol-image.js +1 -1
  204. package/dist/components/kol-image.js.map +1 -1
  205. package/dist/components/kol-input-checkbox.js +1 -1
  206. package/dist/components/kol-input-checkbox.js.map +1 -1
  207. package/dist/components/kol-input-color.js +1 -1
  208. package/dist/components/kol-input-color.js.map +1 -1
  209. package/dist/components/kol-input-date.js +1 -1
  210. package/dist/components/kol-input-date.js.map +1 -1
  211. package/dist/components/kol-input-email.js +1 -1
  212. package/dist/components/kol-input-email.js.map +1 -1
  213. package/dist/components/kol-input-file.js +1 -1
  214. package/dist/components/kol-input-file.js.map +1 -1
  215. package/dist/components/kol-input-number.js +1 -1
  216. package/dist/components/kol-input-number.js.map +1 -1
  217. package/dist/components/kol-input-password.js +1 -1
  218. package/dist/components/kol-input-password.js.map +1 -1
  219. package/dist/components/kol-input-radio.js +1 -1
  220. package/dist/components/kol-input-radio.js.map +1 -1
  221. package/dist/components/kol-input-range.js +1 -1
  222. package/dist/components/kol-input-range.js.map +1 -1
  223. package/dist/components/kol-input-text.js +1 -1
  224. package/dist/components/kol-input-text.js.map +1 -1
  225. package/dist/components/kol-input.js +1 -1
  226. package/dist/components/kol-kolibri.js +1 -1
  227. package/dist/components/kol-kolibri.js.map +1 -1
  228. package/dist/components/kol-link-button.js +1 -1
  229. package/dist/components/kol-link-button.js.map +1 -1
  230. package/dist/components/kol-link-wc.js +1 -1
  231. package/dist/components/kol-link.js +1 -1
  232. package/dist/components/kol-link.js.map +1 -1
  233. package/dist/components/kol-modal.js +1 -1
  234. package/dist/components/kol-modal.js.map +1 -1
  235. package/dist/components/kol-nav.js +1 -1
  236. package/dist/components/kol-nav.js.map +1 -1
  237. package/dist/components/kol-pagination.js +1 -1
  238. package/dist/components/kol-pagination.js.map +1 -1
  239. package/dist/components/kol-popover-button.d.ts +11 -0
  240. package/dist/components/kol-popover-button.js +4 -0
  241. package/dist/components/kol-popover-button.js.map +1 -0
  242. package/dist/components/kol-popover-wc.js +1 -1
  243. package/dist/components/kol-popover-wc.js.map +1 -1
  244. package/dist/components/kol-progress.js +1 -1
  245. package/dist/components/kol-progress.js.map +1 -1
  246. package/dist/components/kol-quote.js +1 -1
  247. package/dist/components/kol-quote.js.map +1 -1
  248. package/dist/components/kol-select.js +1 -1
  249. package/dist/components/kol-select.js.map +1 -1
  250. package/dist/components/kol-single-select.js +1 -1
  251. package/dist/components/kol-single-select.js.map +1 -1
  252. package/dist/components/kol-skip-nav.js +1 -1
  253. package/dist/components/kol-skip-nav.js.map +1 -1
  254. package/dist/components/kol-spin.js +1 -1
  255. package/dist/components/kol-spin.js.map +1 -1
  256. package/dist/components/kol-split-button.js +1 -1
  257. package/dist/components/kol-split-button.js.map +1 -1
  258. package/dist/components/kol-table-stateful.js +1 -1
  259. package/dist/components/kol-table-stateful.js.map +1 -1
  260. package/dist/components/kol-table-stateless-wc.js +1 -1
  261. package/dist/components/kol-table-stateless.js +1 -1
  262. package/dist/components/kol-table-stateless.js.map +1 -1
  263. package/dist/components/kol-tabs.js +1 -1
  264. package/dist/components/kol-tabs.js.map +1 -1
  265. package/dist/components/kol-textarea.js +1 -1
  266. package/dist/components/kol-textarea.js.map +1 -1
  267. package/dist/components/kol-toast-container.js +1 -1
  268. package/dist/components/kol-toast-container.js.map +1 -1
  269. package/dist/components/kol-toolbar.js +1 -1
  270. package/dist/components/kol-toolbar.js.map +1 -1
  271. package/dist/components/kol-tooltip-wc.js +1 -1
  272. package/dist/components/kol-tree-item-wc.js +1 -1
  273. package/dist/components/kol-tree-item.js +1 -1
  274. package/dist/components/kol-tree-item.js.map +1 -1
  275. package/dist/components/kol-tree-wc.js +1 -1
  276. package/dist/components/kol-tree.js +1 -1
  277. package/dist/components/kol-tree.js.map +1 -1
  278. package/dist/components/kol-version.js +1 -1
  279. package/dist/components/kol-version.js.map +1 -1
  280. package/dist/esm/{Alert-080adf2e.js → Alert-fb4611d9.js} +1 -1
  281. package/dist/esm/{Alert-080adf2e.js.map → Alert-fb4611d9.js.map} +1 -1
  282. package/dist/esm/{Collapsible-cc9fb8f0.js → Collapsible-fb8abe4a.js} +1 -1
  283. package/dist/esm/{Collapsible-cc9fb8f0.js.map → Collapsible-fb8abe4a.js.map} +1 -1
  284. package/dist/esm/{CustomSuggestionsOptionsGroup-1505a9ba.js → CustomSuggestionsOptionsGroup-a10a4cf2.js} +1 -1
  285. package/dist/esm/{CustomSuggestionsOptionsGroup-1505a9ba.js.map → CustomSuggestionsOptionsGroup-a10a4cf2.js.map} +1 -1
  286. package/dist/esm/{FieldControlStateWrapper-5432d9b6.js → FieldControlStateWrapper-eab24f20.js} +1 -1
  287. package/dist/esm/{FieldControlStateWrapper-5432d9b6.js.map → FieldControlStateWrapper-eab24f20.js.map} +1 -1
  288. package/dist/esm/{FormFieldMsg-1ed3f51d.js → FormFieldMsg-00f6a985.js} +1 -1
  289. package/dist/esm/{FormFieldMsg-1ed3f51d.js.map → FormFieldMsg-00f6a985.js.map} +1 -1
  290. package/dist/esm/{Heading-0459992b.js → Heading-e581ac05.js} +1 -1
  291. package/dist/esm/{Heading-0459992b.js.map → Heading-e581ac05.js.map} +1 -1
  292. package/dist/esm/{Icon-936c5cfc.js → Icon-0127c9ad.js} +1 -1
  293. package/dist/esm/{Icon-936c5cfc.js.map → Icon-0127c9ad.js.map} +1 -1
  294. package/dist/esm/{Input-40160769.js → Input-3c3e229e.js} +1 -1
  295. package/dist/esm/{Input-40160769.js.map → Input-3c3e229e.js.map} +1 -1
  296. package/dist/esm/{InputStateWrapper-e1a2298b.js → InputStateWrapper-e55ca6b7.js} +1 -1
  297. package/dist/esm/{InputStateWrapper-e1a2298b.js.map → InputStateWrapper-e55ca6b7.js.map} +1 -1
  298. package/dist/esm/{InternalUnderlinedBadgeText-22278de8.js → InternalUnderlinedBadgeText-e33ead64.js} +1 -1
  299. package/dist/esm/{InternalUnderlinedBadgeText-22278de8.js.map → InternalUnderlinedBadgeText-e33ead64.js.map} +1 -1
  300. package/dist/esm/{Span-97af2595.js → Span-d5aaae43.js} +1 -1
  301. package/dist/esm/{Span-97af2595.js.map → Span-d5aaae43.js.map} +1 -1
  302. package/dist/esm/{app-globals-1242eb39.js → app-globals-1e7de5a5.js} +1 -1
  303. package/dist/esm/{app-globals-1242eb39.js.map → app-globals-1e7de5a5.js.map} +1 -1
  304. package/dist/esm/component-names-545d6582.js +4 -0
  305. package/dist/esm/component-names-545d6582.js.map +1 -0
  306. package/dist/esm/{controller-eb6f1a77.js → controller-6727a24c.js} +1 -1
  307. package/dist/esm/{controller-eb6f1a77.js.map → controller-6727a24c.js.map} +1 -1
  308. package/dist/esm/{controller-e699ee47.js → controller-7d258ad2.js} +1 -1
  309. package/dist/esm/{controller-e699ee47.js.map → controller-7d258ad2.js.map} +1 -1
  310. package/dist/esm/{controller-502cff08.js → controller-b00e9aff.js} +1 -1
  311. package/dist/esm/{controller-502cff08.js.map → controller-b00e9aff.js.map} +1 -1
  312. package/dist/esm/{controller-002a86ad.js → controller-f84a4671.js} +1 -1
  313. package/dist/esm/{controller-002a86ad.js.map → controller-f84a4671.js.map} +1 -1
  314. package/dist/esm/{controller-icon-4be72f9f.js → controller-icon-00be418c.js} +1 -1
  315. package/dist/esm/{controller-icon-4be72f9f.js.map → controller-icon-00be418c.js.map} +1 -1
  316. package/dist/esm/{dev.utils-b9e6a3e1.js → dev.utils-7a7f446c.js} +1 -1
  317. package/dist/esm/{dev.utils-b9e6a3e1.js.map → dev.utils-7a7f446c.js.map} +1 -1
  318. package/dist/esm/{devtools-5850e9b1.js → devtools-5d616428.js} +1 -1
  319. package/dist/esm/{devtools-5850e9b1.js.map → devtools-5d616428.js.map} +1 -1
  320. package/dist/esm/getRenderStates-3f00199d.js +4 -0
  321. package/dist/esm/getRenderStates-3f00199d.js.map +1 -0
  322. package/dist/esm/{i18n-5fe08f1c.js → i18n-35276313.js} +1 -1
  323. package/dist/esm/{i18n-5fe08f1c.js.map → i18n-35276313.js.map} +1 -1
  324. package/dist/esm/i18n-c120df5c.js +4 -0
  325. package/dist/esm/i18n-c120df5c.js.map +1 -0
  326. package/dist/esm/index-c4d5cf81.js +4 -0
  327. package/dist/esm/{index-91489a9f.js.map → index-c4d5cf81.js.map} +1 -1
  328. package/dist/esm/index.js +1 -1
  329. package/dist/esm/index.js.map +1 -1
  330. package/dist/esm/kol-abbr.entry.js +1 -1
  331. package/dist/esm/kol-abbr.entry.js.map +1 -1
  332. package/dist/esm/kol-accordion.entry.js +1 -1
  333. package/dist/esm/kol-accordion.entry.js.map +1 -1
  334. package/dist/esm/kol-alert-wc.entry.js +1 -1
  335. package/dist/esm/kol-alert.entry.js +1 -1
  336. package/dist/esm/kol-alert.entry.js.map +1 -1
  337. package/dist/esm/kol-avatar-wc.entry.js +1 -1
  338. package/dist/esm/kol-avatar.entry.js +1 -1
  339. package/dist/esm/kol-avatar.entry.js.map +1 -1
  340. package/dist/esm/kol-badge.entry.js +1 -1
  341. package/dist/esm/kol-badge.entry.js.map +1 -1
  342. package/dist/esm/kol-breadcrumb.entry.js +1 -1
  343. package/dist/esm/kol-breadcrumb.entry.js.map +1 -1
  344. package/dist/esm/kol-button-link.entry.js +1 -1
  345. package/dist/esm/kol-button-link.entry.js.map +1 -1
  346. package/dist/esm/kol-button-wc.entry.js +1 -1
  347. package/dist/esm/kol-button.entry.js +1 -1
  348. package/dist/esm/kol-button.entry.js.map +1 -1
  349. package/dist/esm/kol-card.entry.js +1 -1
  350. package/dist/esm/kol-card.entry.js.map +1 -1
  351. package/dist/esm/kol-combobox.entry.js +1 -1
  352. package/dist/esm/kol-combobox.entry.js.map +1 -1
  353. package/dist/esm/kol-details.entry.js +1 -1
  354. package/dist/esm/kol-details.entry.js.map +1 -1
  355. package/dist/esm/kol-drawer.entry.js +1 -1
  356. package/dist/esm/kol-drawer.entry.js.map +1 -1
  357. package/dist/esm/kol-form.entry.js +1 -1
  358. package/dist/esm/kol-form.entry.js.map +1 -1
  359. package/dist/esm/kol-heading.entry.js +1 -1
  360. package/dist/esm/kol-heading.entry.js.map +1 -1
  361. package/dist/esm/kol-icon.entry.js +1 -1
  362. package/dist/esm/kol-icon.entry.js.map +1 -1
  363. package/dist/esm/kol-image.entry.js +1 -1
  364. package/dist/esm/kol-image.entry.js.map +1 -1
  365. package/dist/esm/kol-input-checkbox.entry.js +1 -1
  366. package/dist/esm/kol-input-checkbox.entry.js.map +1 -1
  367. package/dist/esm/kol-input-color.entry.js +1 -1
  368. package/dist/esm/kol-input-color.entry.js.map +1 -1
  369. package/dist/esm/kol-input-date.entry.js +1 -1
  370. package/dist/esm/kol-input-date.entry.js.map +1 -1
  371. package/dist/esm/kol-input-email.entry.js +1 -1
  372. package/dist/esm/kol-input-email.entry.js.map +1 -1
  373. package/dist/esm/kol-input-file.entry.js +1 -1
  374. package/dist/esm/kol-input-file.entry.js.map +1 -1
  375. package/dist/esm/kol-input-number.entry.js +1 -1
  376. package/dist/esm/kol-input-number.entry.js.map +1 -1
  377. package/dist/esm/kol-input-password.entry.js +1 -1
  378. package/dist/esm/kol-input-password.entry.js.map +1 -1
  379. package/dist/esm/kol-input-radio.entry.js +1 -1
  380. package/dist/esm/kol-input-radio.entry.js.map +1 -1
  381. package/dist/esm/kol-input-range.entry.js +1 -1
  382. package/dist/esm/kol-input-range.entry.js.map +1 -1
  383. package/dist/esm/kol-input-text.entry.js +1 -1
  384. package/dist/esm/kol-input-text.entry.js.map +1 -1
  385. package/dist/esm/kol-input.entry.js +1 -1
  386. package/dist/esm/kol-kolibri.entry.js +1 -1
  387. package/dist/esm/kol-kolibri.entry.js.map +1 -1
  388. package/dist/esm/kol-link-button.entry.js +1 -1
  389. package/dist/esm/kol-link-button.entry.js.map +1 -1
  390. package/dist/esm/kol-link-wc.entry.js +1 -1
  391. package/dist/esm/kol-link.entry.js +1 -1
  392. package/dist/esm/kol-link.entry.js.map +1 -1
  393. package/dist/esm/kol-modal.entry.js +1 -1
  394. package/dist/esm/kol-modal.entry.js.map +1 -1
  395. package/dist/esm/kol-nav.entry.js +1 -1
  396. package/dist/esm/kol-nav.entry.js.map +1 -1
  397. package/dist/esm/kol-pagination.entry.js +1 -1
  398. package/dist/esm/kol-pagination.entry.js.map +1 -1
  399. package/dist/esm/kol-popover-button.entry.js +4 -0
  400. package/dist/esm/kol-popover-button.entry.js.map +1 -0
  401. package/dist/esm/kol-popover-wc.entry.js +1 -1
  402. package/dist/esm/kol-popover-wc.entry.js.map +1 -1
  403. package/dist/esm/kol-progress.entry.js +1 -1
  404. package/dist/esm/kol-progress.entry.js.map +1 -1
  405. package/dist/esm/kol-quote.entry.js +1 -1
  406. package/dist/esm/kol-quote.entry.js.map +1 -1
  407. package/dist/esm/kol-select.entry.js +1 -1
  408. package/dist/esm/kol-select.entry.js.map +1 -1
  409. package/dist/esm/kol-single-select.entry.js +1 -1
  410. package/dist/esm/kol-single-select.entry.js.map +1 -1
  411. package/dist/esm/kol-skip-nav.entry.js +1 -1
  412. package/dist/esm/kol-skip-nav.entry.js.map +1 -1
  413. package/dist/esm/kol-spin.entry.js +1 -1
  414. package/dist/esm/kol-spin.entry.js.map +1 -1
  415. package/dist/esm/kol-split-button.entry.js +1 -1
  416. package/dist/esm/kol-split-button.entry.js.map +1 -1
  417. package/dist/esm/kol-table-stateful.entry.js +1 -1
  418. package/dist/esm/kol-table-stateful.entry.js.map +1 -1
  419. package/dist/esm/kol-table-stateless-wc.entry.js +1 -1
  420. package/dist/esm/kol-table-stateless.entry.js +1 -1
  421. package/dist/esm/kol-table-stateless.entry.js.map +1 -1
  422. package/dist/esm/kol-tabs.entry.js +1 -1
  423. package/dist/esm/kol-tabs.entry.js.map +1 -1
  424. package/dist/esm/kol-textarea.entry.js +1 -1
  425. package/dist/esm/kol-textarea.entry.js.map +1 -1
  426. package/dist/esm/kol-toast-container.entry.js +1 -1
  427. package/dist/esm/kol-toast-container.entry.js.map +1 -1
  428. package/dist/esm/kol-toolbar.entry.js +1 -1
  429. package/dist/esm/kol-toolbar.entry.js.map +1 -1
  430. package/dist/esm/kol-tooltip-wc.entry.js +1 -1
  431. package/dist/esm/kol-tree-item-wc.entry.js +1 -1
  432. package/dist/esm/kol-tree-item.entry.js +1 -1
  433. package/dist/esm/kol-tree-item.entry.js.map +1 -1
  434. package/dist/esm/kol-tree-wc.entry.js +1 -1
  435. package/dist/esm/kol-tree.entry.js +1 -1
  436. package/dist/esm/kol-tree.entry.js.map +1 -1
  437. package/dist/esm/kol-version.entry.js +1 -1
  438. package/dist/esm/kol-version.entry.js.map +1 -1
  439. package/dist/esm/kolibri.js +1 -1
  440. package/dist/esm/loader.js +1 -1
  441. package/dist/esm/test-component.entry.js +1 -1
  442. package/dist/kolibri/{Alert-080adf2e.js → Alert-fb4611d9.js} +1 -1
  443. package/dist/kolibri/{Collapsible-cc9fb8f0.js → Collapsible-fb8abe4a.js} +1 -1
  444. package/dist/kolibri/{CustomSuggestionsOptionsGroup-1505a9ba.js → CustomSuggestionsOptionsGroup-a10a4cf2.js} +1 -1
  445. package/dist/kolibri/{FieldControlStateWrapper-5432d9b6.js → FieldControlStateWrapper-eab24f20.js} +1 -1
  446. package/dist/kolibri/FormFieldMsg-00f6a985.js +4 -0
  447. package/dist/kolibri/{Heading-0459992b.js → Heading-e581ac05.js} +1 -1
  448. package/dist/kolibri/Icon-0127c9ad.js +4 -0
  449. package/dist/kolibri/Input-3c3e229e.js +4 -0
  450. package/dist/kolibri/{InputStateWrapper-e1a2298b.js → InputStateWrapper-e55ca6b7.js} +1 -1
  451. package/dist/kolibri/{InternalUnderlinedBadgeText-22278de8.js → InternalUnderlinedBadgeText-e33ead64.js} +1 -1
  452. package/dist/kolibri/{Span-97af2595.js → Span-d5aaae43.js} +1 -1
  453. package/dist/kolibri/app-globals-1e7de5a5.js +4 -0
  454. package/dist/kolibri/component-names-545d6582.js +4 -0
  455. package/dist/kolibri/component-names-545d6582.js.map +1 -0
  456. package/dist/kolibri/{controller-eb6f1a77.js → controller-6727a24c.js} +1 -1
  457. package/dist/kolibri/{controller-e699ee47.js → controller-7d258ad2.js} +1 -1
  458. package/dist/kolibri/{controller-502cff08.js → controller-b00e9aff.js} +1 -1
  459. package/dist/kolibri/{controller-002a86ad.js → controller-f84a4671.js} +1 -1
  460. package/dist/kolibri/{controller-icon-4be72f9f.js → controller-icon-00be418c.js} +1 -1
  461. package/dist/kolibri/{dev.utils-b9e6a3e1.js → dev.utils-7a7f446c.js} +1 -1
  462. package/dist/kolibri/devtools-5d616428.js +4 -0
  463. package/dist/kolibri/{devtools-5850e9b1.js.map → devtools-5d616428.js.map} +1 -1
  464. package/dist/kolibri/getRenderStates-3f00199d.js +4 -0
  465. package/dist/kolibri/getRenderStates-3f00199d.js.map +1 -0
  466. package/dist/kolibri/i18n-35276313.js +4 -0
  467. package/dist/kolibri/i18n-c120df5c.js +4 -0
  468. package/dist/kolibri/i18n-c120df5c.js.map +1 -0
  469. package/dist/kolibri/{index-91489a9f.js → index-c4d5cf81.js} +1 -1
  470. package/dist/kolibri/{index-91489a9f.js.map → index-c4d5cf81.js.map} +1 -1
  471. package/dist/kolibri/index.esm.js +1 -1
  472. package/dist/kolibri/index.esm.js.map +1 -1
  473. package/dist/kolibri/kol-abbr.entry.js +1 -1
  474. package/dist/kolibri/kol-abbr.entry.js.map +1 -1
  475. package/dist/kolibri/kol-accordion.entry.js +1 -1
  476. package/dist/kolibri/kol-accordion.entry.js.map +1 -1
  477. package/dist/kolibri/kol-alert-wc.entry.js +1 -1
  478. package/dist/kolibri/kol-alert-wc.entry.js.map +1 -1
  479. package/dist/kolibri/kol-alert.entry.js +1 -1
  480. package/dist/kolibri/kol-alert.entry.js.map +1 -1
  481. package/dist/kolibri/kol-avatar-wc.entry.js +1 -1
  482. package/dist/kolibri/kol-avatar.entry.js +1 -1
  483. package/dist/kolibri/kol-avatar.entry.js.map +1 -1
  484. package/dist/kolibri/kol-badge.entry.js +1 -1
  485. package/dist/kolibri/kol-badge.entry.js.map +1 -1
  486. package/dist/kolibri/kol-breadcrumb.entry.js +1 -1
  487. package/dist/kolibri/kol-breadcrumb.entry.js.map +1 -1
  488. package/dist/kolibri/kol-button-link.entry.js +1 -1
  489. package/dist/kolibri/kol-button-link.entry.js.map +1 -1
  490. package/dist/kolibri/kol-button-wc.entry.js +1 -1
  491. package/dist/kolibri/kol-button-wc.entry.js.map +1 -1
  492. package/dist/kolibri/kol-button.entry.js +1 -1
  493. package/dist/kolibri/kol-button.entry.js.map +1 -1
  494. package/dist/kolibri/kol-card.entry.js +1 -1
  495. package/dist/kolibri/kol-card.entry.js.map +1 -1
  496. package/dist/kolibri/kol-combobox.entry.js +1 -1
  497. package/dist/kolibri/kol-combobox.entry.js.map +1 -1
  498. package/dist/kolibri/kol-details.entry.js +1 -1
  499. package/dist/kolibri/kol-details.entry.js.map +1 -1
  500. package/dist/kolibri/kol-drawer.entry.js +1 -1
  501. package/dist/kolibri/kol-drawer.entry.js.map +1 -1
  502. package/dist/kolibri/kol-form.entry.js +1 -1
  503. package/dist/kolibri/kol-form.entry.js.map +1 -1
  504. package/dist/kolibri/kol-heading.entry.js +1 -1
  505. package/dist/kolibri/kol-heading.entry.js.map +1 -1
  506. package/dist/kolibri/kol-icon.entry.js +1 -1
  507. package/dist/kolibri/kol-icon.entry.js.map +1 -1
  508. package/dist/kolibri/kol-image.entry.js +1 -1
  509. package/dist/kolibri/kol-image.entry.js.map +1 -1
  510. package/dist/kolibri/kol-input-checkbox.entry.js +1 -1
  511. package/dist/kolibri/kol-input-checkbox.entry.js.map +1 -1
  512. package/dist/kolibri/kol-input-color.entry.js +1 -1
  513. package/dist/kolibri/kol-input-color.entry.js.map +1 -1
  514. package/dist/kolibri/kol-input-date.entry.js +1 -1
  515. package/dist/kolibri/kol-input-date.entry.js.map +1 -1
  516. package/dist/kolibri/kol-input-email.entry.js +1 -1
  517. package/dist/kolibri/kol-input-email.entry.js.map +1 -1
  518. package/dist/kolibri/kol-input-file.entry.js +1 -1
  519. package/dist/kolibri/kol-input-file.entry.js.map +1 -1
  520. package/dist/kolibri/kol-input-number.entry.js +1 -1
  521. package/dist/kolibri/kol-input-number.entry.js.map +1 -1
  522. package/dist/kolibri/kol-input-password.entry.js +1 -1
  523. package/dist/kolibri/kol-input-password.entry.js.map +1 -1
  524. package/dist/kolibri/kol-input-radio.entry.js +1 -1
  525. package/dist/kolibri/kol-input-radio.entry.js.map +1 -1
  526. package/dist/kolibri/kol-input-range.entry.js +1 -1
  527. package/dist/kolibri/kol-input-range.entry.js.map +1 -1
  528. package/dist/kolibri/kol-input-text.entry.js +1 -1
  529. package/dist/kolibri/kol-input-text.entry.js.map +1 -1
  530. package/dist/kolibri/kol-input.entry.js +1 -1
  531. package/dist/kolibri/kol-kolibri.entry.js +1 -1
  532. package/dist/kolibri/kol-kolibri.entry.js.map +1 -1
  533. package/dist/kolibri/kol-link-button.entry.js +1 -1
  534. package/dist/kolibri/kol-link-button.entry.js.map +1 -1
  535. package/dist/kolibri/kol-link-wc.entry.js +1 -1
  536. package/dist/kolibri/kol-link-wc.entry.js.map +1 -1
  537. package/dist/kolibri/kol-link.entry.js +1 -1
  538. package/dist/kolibri/kol-link.entry.js.map +1 -1
  539. package/dist/kolibri/kol-modal.entry.js +1 -1
  540. package/dist/kolibri/kol-modal.entry.js.map +1 -1
  541. package/dist/kolibri/kol-nav.entry.js +1 -1
  542. package/dist/kolibri/kol-nav.entry.js.map +1 -1
  543. package/dist/kolibri/kol-pagination.entry.js +1 -1
  544. package/dist/kolibri/kol-pagination.entry.js.map +1 -1
  545. package/dist/kolibri/kol-popover-button.entry.js +4 -0
  546. package/dist/kolibri/kol-popover-button.entry.js.map +1 -0
  547. package/dist/kolibri/kol-popover-wc.entry.js +1 -1
  548. package/dist/kolibri/kol-popover-wc.entry.js.map +1 -1
  549. package/dist/kolibri/kol-progress.entry.js +1 -1
  550. package/dist/kolibri/kol-progress.entry.js.map +1 -1
  551. package/dist/kolibri/kol-quote.entry.js +1 -1
  552. package/dist/kolibri/kol-quote.entry.js.map +1 -1
  553. package/dist/kolibri/kol-select.entry.js +1 -1
  554. package/dist/kolibri/kol-select.entry.js.map +1 -1
  555. package/dist/kolibri/kol-single-select.entry.js +1 -1
  556. package/dist/kolibri/kol-single-select.entry.js.map +1 -1
  557. package/dist/kolibri/kol-skip-nav.entry.js +1 -1
  558. package/dist/kolibri/kol-skip-nav.entry.js.map +1 -1
  559. package/dist/kolibri/kol-spin.entry.js +1 -1
  560. package/dist/kolibri/kol-spin.entry.js.map +1 -1
  561. package/dist/kolibri/kol-split-button.entry.js +1 -1
  562. package/dist/kolibri/kol-split-button.entry.js.map +1 -1
  563. package/dist/kolibri/kol-table-stateful.entry.js +1 -1
  564. package/dist/kolibri/kol-table-stateful.entry.js.map +1 -1
  565. package/dist/kolibri/kol-table-stateless-wc.entry.js +1 -1
  566. package/dist/kolibri/kol-table-stateless.entry.js +1 -1
  567. package/dist/kolibri/kol-table-stateless.entry.js.map +1 -1
  568. package/dist/kolibri/kol-tabs.entry.js +1 -1
  569. package/dist/kolibri/kol-tabs.entry.js.map +1 -1
  570. package/dist/kolibri/kol-textarea.entry.js +1 -1
  571. package/dist/kolibri/kol-textarea.entry.js.map +1 -1
  572. package/dist/kolibri/kol-toast-container.entry.js +1 -1
  573. package/dist/kolibri/kol-toast-container.entry.js.map +1 -1
  574. package/dist/kolibri/kol-toolbar.entry.js +1 -1
  575. package/dist/kolibri/kol-toolbar.entry.js.map +1 -1
  576. package/dist/kolibri/kol-tooltip-wc.entry.js +1 -1
  577. package/dist/kolibri/kol-tree-item-wc.entry.js +1 -1
  578. package/dist/kolibri/kol-tree-item.entry.js +1 -1
  579. package/dist/kolibri/kol-tree-item.entry.js.map +1 -1
  580. package/dist/kolibri/kol-tree-wc.entry.js +1 -1
  581. package/dist/kolibri/kol-tree.entry.js +1 -1
  582. package/dist/kolibri/kol-tree.entry.js.map +1 -1
  583. package/dist/kolibri/kol-version.entry.js +1 -1
  584. package/dist/kolibri/kol-version.entry.js.map +1 -1
  585. package/dist/kolibri/kolibri.esm.js +1 -1
  586. package/dist/kolibri/kolibri.esm.js.map +1 -1
  587. package/dist/kolibri/test-component.entry.js +1 -1
  588. package/dist/types/components/button/shadow.d.ts +0 -1
  589. package/dist/types/components/button-link/shadow.d.ts +0 -1
  590. package/dist/types/components/combobox/shadow.d.ts +0 -2
  591. package/dist/types/components/component-list.d.ts +3 -3
  592. package/dist/types/components/input-checkbox/shadow.d.ts +0 -2
  593. package/dist/types/components/input-color/shadow.d.ts +0 -2
  594. package/dist/types/components/input-date/shadow.d.ts +0 -2
  595. package/dist/types/components/input-email/shadow.d.ts +0 -2
  596. package/dist/types/components/input-file/shadow.d.ts +5 -2
  597. package/dist/types/components/input-number/shadow.d.ts +0 -2
  598. package/dist/types/components/input-password/shadow.d.ts +0 -2
  599. package/dist/types/components/input-radio/shadow.d.ts +0 -2
  600. package/dist/types/components/input-range/shadow.d.ts +0 -2
  601. package/dist/types/components/input-text/shadow.d.ts +0 -2
  602. package/dist/types/components/link/shadow.d.ts +0 -1
  603. package/dist/types/components/link-button/shadow.d.ts +0 -1
  604. package/dist/types/components/popover-button/shadow.d.ts +39 -0
  605. package/dist/types/components/progress/shadow.d.ts +1 -1
  606. package/dist/types/components/single-select/controller.d.ts +3 -2
  607. package/dist/types/components/single-select/shadow.d.ts +6 -6
  608. package/dist/types/components/split-button/shadow.d.ts +0 -1
  609. package/dist/types/components/textarea/shadow.d.ts +0 -2
  610. package/dist/types/components.d.ts +200 -149
  611. package/dist/types/core/component-names.d.ts +1 -0
  612. package/dist/types/locales/de.d.ts +2 -0
  613. package/dist/types/locales/en.d.ts +2 -0
  614. package/dist/types/schema/components/combobox.d.ts +0 -2
  615. package/dist/types/schema/components/index.d.ts +1 -1
  616. package/dist/types/schema/components/input-checkbox.d.ts +0 -2
  617. package/dist/types/schema/components/input-color.d.ts +0 -2
  618. package/dist/types/schema/components/input-date.d.ts +0 -1
  619. package/dist/types/schema/components/input-email.d.ts +0 -2
  620. package/dist/types/schema/components/input-file.d.ts +0 -2
  621. package/dist/types/schema/components/input-number.d.ts +0 -1
  622. package/dist/types/schema/components/input-password.d.ts +0 -2
  623. package/dist/types/schema/components/input-radio.d.ts +0 -2
  624. package/dist/types/schema/components/input-range.d.ts +0 -2
  625. package/dist/types/schema/components/input-text.d.ts +0 -2
  626. package/dist/types/schema/components/popover-button.d.ts +9 -0
  627. package/dist/types/schema/components/single-select.d.ts +3 -3
  628. package/dist/types/schema/components/textarea.d.ts +0 -2
  629. package/dist/types/schema/index.d.ts +1 -1
  630. package/dist/types/schema/interfaces/EventDetail.d.ts +4 -0
  631. package/dist/types/schema/props/index.d.ts +1 -1
  632. package/dist/types/schema/props/popover-align.d.ts +7 -0
  633. package/dist/types/schema/tag-names.d.ts +18 -17
  634. package/dist/types/schema/types/input/control/number.d.ts +0 -1
  635. package/doc/button-link.md +0 -1
  636. package/doc/button.md +0 -1
  637. package/doc/combobox.md +0 -1
  638. package/doc/input-checkbox.md +0 -1
  639. package/doc/input-color.md +0 -1
  640. package/doc/input-date.md +0 -1
  641. package/doc/input-email.md +0 -1
  642. package/doc/input-file.md +0 -1
  643. package/doc/input-number.md +0 -1
  644. package/doc/input-password.md +0 -1
  645. package/doc/input-radio.md +0 -1
  646. package/doc/input-range.md +0 -1
  647. package/doc/input-text.md +0 -1
  648. package/doc/link-button.md +0 -1
  649. package/doc/link.md +0 -1
  650. package/doc/popover-button.md +42 -0
  651. package/doc/single-select.md +23 -23
  652. package/doc/split-button.md +0 -1
  653. package/doc/textarea.md +0 -1
  654. package/package.json +1 -1
  655. package/vscode-custom-data.json +169 -72
  656. package/dist/cjs/FormFieldMsg-370f014e.js +0 -4
  657. package/dist/cjs/Icon-0eed071b.js +0 -4
  658. package/dist/cjs/component-names-cf0c0d8a.js +0 -4
  659. package/dist/cjs/component-names-cf0c0d8a.js.map +0 -1
  660. package/dist/cjs/getRenderStates-3c874ec5.js +0 -4
  661. package/dist/cjs/getRenderStates-3c874ec5.js.map +0 -1
  662. package/dist/cjs/i18n-737701e2.js +0 -4
  663. package/dist/cjs/i18n-737701e2.js.map +0 -1
  664. package/dist/cjs/index-07fcbac9.js +0 -4
  665. package/dist/esm/component-names-a18a51c8.js +0 -4
  666. package/dist/esm/component-names-a18a51c8.js.map +0 -1
  667. package/dist/esm/getRenderStates-a7a33541.js +0 -4
  668. package/dist/esm/getRenderStates-a7a33541.js.map +0 -1
  669. package/dist/esm/i18n-7ea9f137.js +0 -4
  670. package/dist/esm/i18n-7ea9f137.js.map +0 -1
  671. package/dist/esm/index-91489a9f.js +0 -4
  672. package/dist/kolibri/FormFieldMsg-1ed3f51d.js +0 -4
  673. package/dist/kolibri/Icon-936c5cfc.js +0 -4
  674. package/dist/kolibri/Input-40160769.js +0 -4
  675. package/dist/kolibri/app-globals-1242eb39.js +0 -4
  676. package/dist/kolibri/component-names-a18a51c8.js +0 -4
  677. package/dist/kolibri/component-names-a18a51c8.js.map +0 -1
  678. package/dist/kolibri/devtools-5850e9b1.js +0 -4
  679. package/dist/kolibri/getRenderStates-a7a33541.js +0 -4
  680. package/dist/kolibri/getRenderStates-a7a33541.js.map +0 -1
  681. package/dist/kolibri/i18n-5fe08f1c.js +0 -4
  682. package/dist/kolibri/i18n-7ea9f137.js +0 -4
  683. package/dist/kolibri/i18n-7ea9f137.js.map +0 -1
  684. /package/dist/kolibri/{Alert-080adf2e.js.map → Alert-fb4611d9.js.map} +0 -0
  685. /package/dist/kolibri/{Collapsible-cc9fb8f0.js.map → Collapsible-fb8abe4a.js.map} +0 -0
  686. /package/dist/kolibri/{CustomSuggestionsOptionsGroup-1505a9ba.js.map → CustomSuggestionsOptionsGroup-a10a4cf2.js.map} +0 -0
  687. /package/dist/kolibri/{FieldControlStateWrapper-5432d9b6.js.map → FieldControlStateWrapper-eab24f20.js.map} +0 -0
  688. /package/dist/kolibri/{FormFieldMsg-1ed3f51d.js.map → FormFieldMsg-00f6a985.js.map} +0 -0
  689. /package/dist/kolibri/{Heading-0459992b.js.map → Heading-e581ac05.js.map} +0 -0
  690. /package/dist/kolibri/{Icon-936c5cfc.js.map → Icon-0127c9ad.js.map} +0 -0
  691. /package/dist/kolibri/{Input-40160769.js.map → Input-3c3e229e.js.map} +0 -0
  692. /package/dist/kolibri/{InputStateWrapper-e1a2298b.js.map → InputStateWrapper-e55ca6b7.js.map} +0 -0
  693. /package/dist/kolibri/{InternalUnderlinedBadgeText-22278de8.js.map → InternalUnderlinedBadgeText-e33ead64.js.map} +0 -0
  694. /package/dist/kolibri/{Span-97af2595.js.map → Span-d5aaae43.js.map} +0 -0
  695. /package/dist/kolibri/{app-globals-1242eb39.js.map → app-globals-1e7de5a5.js.map} +0 -0
  696. /package/dist/kolibri/{controller-eb6f1a77.js.map → controller-6727a24c.js.map} +0 -0
  697. /package/dist/kolibri/{controller-e699ee47.js.map → controller-7d258ad2.js.map} +0 -0
  698. /package/dist/kolibri/{controller-502cff08.js.map → controller-b00e9aff.js.map} +0 -0
  699. /package/dist/kolibri/{controller-002a86ad.js.map → controller-f84a4671.js.map} +0 -0
  700. /package/dist/kolibri/{controller-icon-4be72f9f.js.map → controller-icon-00be418c.js.map} +0 -0
  701. /package/dist/kolibri/{dev.utils-b9e6a3e1.js.map → dev.utils-7a7f446c.js.map} +0 -0
  702. /package/dist/kolibri/{i18n-5fe08f1c.js.map → i18n-35276313.js.map} +0 -0
@@ -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-91489a9f.js";import{c as clsx}from"./clsx-09a06a12.js";import{n as nonce}from"./dev.utils-b9e6a3e1.js";import{I as InputIconController,K as KolInputContainerFc}from"./controller-icon-4be72f9f.js";import{v as validateHasCounter}from"./has-counter-a43c36ef.js";import{k as watchNumber,i as watchString,b as watchBoolean,w as watchValidator,s as setState}from"./prop.validators-9feb1d92.js";import{v as validateRows}from"./rows-26af6558.js";import{v as validateSpellCheck}from"./spell-check-60fa0b9f.js";import{_ as __rest}from"./tslib.es6-1173d062.js";import{d as getDefaultProps,g as getRenderStates,K as KolFormFieldStateWrapperFc}from"./getRenderStates-a7a33541.js";import{c as checkHasError,a as convertMsgToInternMsg}from"./FormFieldMsg-1ed3f51d.js";import"./reuse-32931294.js";import"./dev.utils-fab45cbc.js";import"./InternalUnderlinedBadgeText-22278de8.js";import"./isObject-ffcbbb76.js";import"./component-names-a18a51c8.js";import"./Icon-936c5cfc.js";import"./icons-199f1746.js";import"./common-54bf85ba.js";import"./index-da3e0c00.js";import"./events-5adf6b62.js";import"./associated.controller-52d302aa.js";import"./access-and-short-key-9cca88b8.js";import"./tooltip-align-8e0fa436.js";import"./align-4719d626.js";import"./hide-label-429a15ea.js";import"./label-d0315384.js";import"./i18n-5fe08f1c.js";import"./i18n-7ea9f137.js";import"./Alert-080adf2e.js";import"./Heading-0459992b.js";const cssResizeOptions=["vertical","none"],TextAreaFc=e=>{const{class:t,msg:n,touched:a,readonly:i,disabled:o,required:l,ariaDescribedBy:s,hideLabel:r,label:d}=e,c=__rest(e,["class","msg","touched","readonly","disabled","required","ariaDescribedBy","hideLabel","label"]),u=checkHasError(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:s,hideLabel:r,label:d})),c);return h("textarea",Object.assign({},m))},KolTextAreaFc=TextAreaFc;function getTextAreaProps(e){const{ariaDescribedBy:t}=getRenderStates(e);return{id:e._id,hideLabel:e._hideLabel,label:e._label,value:e._value,accessKey:e._accessKey,disabled:e._disabled,name:e._name,ariaDescribedBy:t,rows:e._rows,readonly:e._readOnly,required:e._required,placeholder:e._placeholder,maxLength:e._maxLength,touched:e._touched,msg:convertMsgToInternMsg(e._msg)}}const TextAreaStateWrapper=e=>{var{state:t}=e,n=__rest(e,["state"]);return h(KolTextAreaFc,Object.assign({},getTextAreaProps(t),n))},KolTextAreaStateWrapperFc=TextAreaStateWrapper;class TextareaController extends InputIconController{constructor(e,t,n){super(e,t,n),this.afterSyncCharCounter=()=>{"string"==typeof this.component._value&&this.component._value.length>0&&(this.component.state._currentLength=this.component._value.length)},this.component=e}validateHasCounter(e){validateHasCounter(this.component,e,{hooks:{afterPatch:this.afterSyncCharCounter}})}validateMaxLength(e){watchNumber(this.component,"_maxLength",e,{hooks:{afterPatch:this.afterSyncCharCounter},min:0})}validatePlaceholder(e){watchString(this.component,"_placeholder",e)}validateReadOnly(e){watchBoolean(this.component,"_readOnly",e)}validateResize(e){watchValidator(this.component,"_resize",(e=>"string"==typeof e&&cssResizeOptions.includes(e)),new Set(`String {${cssResizeOptions.join(", ")}`),e,{defaultValue:"vertical"})}validateRequired(e){watchBoolean(this.component,"_required",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.validateMaxLength(this.component._maxLength),this.validatePlaceholder(this.component._placeholder),this.validateReadOnly(this.component._readOnly),this.validateResize(this.component._resize),this.validateRequired(this.component._required),this.validateRows(this.component._rows),this.validateSpellCheck(this.component._spellCheck),this.validateValue(this.component._value)}}const defaultStyleCss="/*\n * This file contains all rules for accessibility.\n */\n@layer kol-global {\n :host {\n /*\n * Minimum size of interactive elements.\n */\n --a11y-min-size: calc(44rem / var(--kolibri-root-font-size, 16));\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 color: black;\n /*\n * Verdana is an accessible font that can be used without requiring additional loading time.\n */\n font-family: Verdana;\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 * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\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 * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n /*\n * All interactive elements should have a minimum size of 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 min-height: var(--a11y-min-size);\n min-width: 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}\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 clip: rect(0 0 0 0);\n clip-path: inset(50%);\n height: calc(1rem / var(--kolibri-root-font-size, 16));\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: calc(1rem / var(--kolibri-root-font-size, 16));\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 border: none;\n margin: 0;\n padding: 0;\n width: 100%; /* 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}\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 }\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 cursor: not-allowed;\n opacity: 0.5;\n outline: none;\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 :host {\n font-size: calc(16rem / var(--kolibri-root-font-size, 16));\n }\n .kol-tooltip {\n display: contents;\n }\n .kol-tooltip__floating {\n animation-duration: 0.5s;\n animation-iteration-count: 1;\n animation-name: fadeInOpacity;\n animation-timing-function: ease-in;\n box-sizing: border-box;\n display: none;\n position: fixed;\n visibility: hidden;\n /* Avoid layout interference - see https://floating-ui.com/docs/computePosition */\n top: 0;\n left: 0;\n max-width: 90vw;\n max-height: 90vh;\n /* Can be used to specify the tooltip-width from the outside. Unset by default. */\n width: var(--kol-tooltip-width);\n }\n .kol-tooltip__arrow {\n background-color: #fff;\n color: #000;\n height: calc(10rem / var(--kolibri-root-font-size, 16));\n position: absolute;\n transform: rotate(45deg);\n width: calc(10rem / var(--kolibri-root-font-size, 16));\n z-index: 999;\n }\n .kol-tooltip__content {\n background-color: #fff;\n color: #000;\n position: relative;\n z-index: 1000;\n }\n @keyframes fadeInOpacity {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n}\n@layer kol-component {\n :host {\n display: block;\n }\n}\n@layer kol-component {\n .kol-alert {\n display: grid;\n }\n .kol-alert__container {\n place-items: center;\n display: flex;\n }\n .kol-alert__container-content {\n flex-grow: 1;\n }\n .kol-alert__close-button {\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 font-size: calc(16rem / var(--kolibri-root-font-size, 16));\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 align-items: center;\n background-color: white;\n cursor: pointer;\n display: grid;\n grid-template-columns: 1fr;\n min-height: var(--a11y-min-size);\n min-width: var(--a11y-min-size);\n width: 100%;\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 font-size: calc(16rem / var(--kolibri-root-font-size, 16));\n width: 100%;\n }\n .kol-textarea:focus {\n outline: none;\n }\n}",KolTextareaDefaultStyle0=defaultStyleCss,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.state._hasCounter}),tooltipAlign:this._tooltipAlign,onClick:()=>{var e;return null===(e=this.textareaRef)||void 0===e?void 0:e.focus()},alert:this.showAsAlert()}}getTextAreaProps(){return Object.assign(Object.assign({ref:this.catchRef,state:this.state,style:{resize:this.state._resize}},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(KolFormFieldStateWrapperFc,Object.assign({key:"872d9e86581bcaa2f890bc1922f51e150e719dcc"},this.getFormFieldProps()),h(KolInputContainerFc,{key:"d606938ceeb96ddd460e0da945a41de58201ed8a",state:this.state},h(KolTextAreaStateWrapperFc,Object.assign({key:"e1fff4989bfb2c73e5b33ee6c81be446de2b1994"},this.getTextAreaProps()))))}constructor(e){registerInstance(this,e),this.catchRef=e=>{this.textareaRef=e},this.onInput=e=>{if(this.textareaRef instanceof HTMLTextAreaElement){const t=this.textareaRef.value;setState(this,"_currentLength",t.length),this._value=t,this.state._adjustHeight&&(this._rows=increaseTextareaHeight(this.textareaRef)),this.controller.onFacade.onInput(e)}},this._accessKey=void 0,this._adjustHeight=!1,this._disabled=!1,this._hasCounter=!1,this._hideMsg=!1,this._hideLabel=!1,this._hint="",this._icons=void 0,this._id=void 0,this._label=void 0,this._maxLength=void 0,this._msg=void 0,this._name=void 0,this._on=void 0,this._placeholder=void 0,this._readOnly=!1,this._resize="vertical",this._required=!1,this._rows=void 0,this._shortKey=void 0,this._spellCheck=void 0,this._syncValueBySelector=void 0,this._tabIndex=void 0,this._tooltipAlign="top",this._touched=!1,this._value=void 0,this.state={_adjustHeight:!1,_currentLength:0,_hasValue:!1,_hideMsg:!1,_id:`id-${nonce()}`,_label:"",_resize:"vertical"},this.inputHasFocus=!1,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)}validateHasCounter(e){this.controller.validateHasCounter(e)}validateHideMsg(e){this.controller.validateHideMsg(e)}validateHideLabel(e){this.controller.validateHideLabel(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)}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)}validateTabIndex(e){this.controller.validateTabIndex(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"],_hasCounter:["validateHasCounter"],_hideMsg:["validateHideMsg"],_hideLabel:["validateHideLabel"],_hint:["validateHint"],_icons:["validateIcons"],_id:["validateId"],_label:["validateLabel"],_maxLength:["validateMaxLength"],_msg:["validateMsg"],_name:["validateName"],_on:["validateOn"],_placeholder:["validatePlaceholder"],_readOnly:["validateReadOnly"],_resize:["validateResize"],_required:["validateRequired"],_rows:["validateRows"],_shortKey:["validateShortKey"],_spellCheck:["validateSpellCheck"],_syncValueBySelector:["validateSyncValueBySelector"],_tabIndex:["validateTabIndex"],_touched:["validateTouched"],_value:["validateValue"]}}};KolTextarea.style={default:KolTextareaDefaultStyle0};export{KolTextarea as kol_textarea};
4
+ import{h,r as registerInstance,g as getElement}from"./index-c4d5cf81.js";import{c as clsx}from"./clsx-09a06a12.js";import{n as nonce}from"./dev.utils-7a7f446c.js";import{I as InputIconController,K as KolInputContainerFc}from"./controller-icon-00be418c.js";import{v as validateHasCounter}from"./has-counter-a43c36ef.js";import{k as watchNumber,i as watchString,b as watchBoolean,w as watchValidator,s as setState}from"./prop.validators-9feb1d92.js";import{v as validateRows}from"./rows-26af6558.js";import{v as validateSpellCheck}from"./spell-check-60fa0b9f.js";import{_ as __rest}from"./tslib.es6-1173d062.js";import{d as getDefaultProps,g as getRenderStates,K as KolFormFieldStateWrapperFc}from"./getRenderStates-3f00199d.js";import{c as checkHasError,a as convertMsgToInternMsg}from"./FormFieldMsg-00f6a985.js";import"./reuse-32931294.js";import"./dev.utils-fab45cbc.js";import"./InternalUnderlinedBadgeText-e33ead64.js";import"./isObject-ffcbbb76.js";import"./component-names-545d6582.js";import"./Icon-0127c9ad.js";import"./icons-199f1746.js";import"./common-54bf85ba.js";import"./index-da3e0c00.js";import"./events-5adf6b62.js";import"./associated.controller-52d302aa.js";import"./access-and-short-key-9cca88b8.js";import"./tooltip-align-8e0fa436.js";import"./align-4719d626.js";import"./hide-label-429a15ea.js";import"./label-d0315384.js";import"./i18n-35276313.js";import"./i18n-c120df5c.js";import"./Alert-fb4611d9.js";import"./Heading-e581ac05.js";const cssResizeOptions=["vertical","none"],TextAreaFc=e=>{const{class:t,msg:n,touched:a,readonly:i,disabled:o,required:l,ariaDescribedBy:s,hideLabel:r,label:d}=e,c=__rest(e,["class","msg","touched","readonly","disabled","required","ariaDescribedBy","hideLabel","label"]),u=checkHasError(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:s,hideLabel:r,label:d})),c);return h("textarea",Object.assign({},m))},KolTextAreaFc=TextAreaFc;function getTextAreaProps(e){const{ariaDescribedBy:t}=getRenderStates(e);return{id:e._id,hideLabel:e._hideLabel,label:e._label,value:e._value,accessKey:e._accessKey,disabled:e._disabled,name:e._name,ariaDescribedBy:t,rows:e._rows,readonly:e._readOnly,required:e._required,placeholder:e._placeholder,maxLength:e._maxLength,touched:e._touched,msg:convertMsgToInternMsg(e._msg)}}const TextAreaStateWrapper=e=>{var{state:t}=e,n=__rest(e,["state"]);return h(KolTextAreaFc,Object.assign({},getTextAreaProps(t),n))},KolTextAreaStateWrapperFc=TextAreaStateWrapper;class TextareaController extends InputIconController{constructor(e,t,n){super(e,t,n),this.afterSyncCharCounter=()=>{"string"==typeof this.component._value&&this.component._value.length>0&&(this.component.state._currentLength=this.component._value.length)},this.component=e}validateHasCounter(e){validateHasCounter(this.component,e,{hooks:{afterPatch:this.afterSyncCharCounter}})}validateMaxLength(e){watchNumber(this.component,"_maxLength",e,{hooks:{afterPatch:this.afterSyncCharCounter},min:0})}validatePlaceholder(e){watchString(this.component,"_placeholder",e)}validateReadOnly(e){watchBoolean(this.component,"_readOnly",e)}validateResize(e){watchValidator(this.component,"_resize",(e=>"string"==typeof e&&cssResizeOptions.includes(e)),new Set(`String {${cssResizeOptions.join(", ")}`),e,{defaultValue:"vertical"})}validateRequired(e){watchBoolean(this.component,"_required",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.validateMaxLength(this.component._maxLength),this.validatePlaceholder(this.component._placeholder),this.validateReadOnly(this.component._readOnly),this.validateResize(this.component._resize),this.validateRequired(this.component._required),this.validateRows(this.component._rows),this.validateSpellCheck(this.component._spellCheck),this.validateValue(this.component._value)}}const defaultStyleCss="/*\n * This file contains all rules for accessibility.\n */\n@layer kol-global {\n :host {\n /*\n * Minimum size of interactive elements.\n */\n --a11y-min-size: calc(44rem / var(--kolibri-root-font-size, 16));\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 color: black;\n /*\n * Verdana is an accessible font that can be used without requiring additional loading time.\n */\n font-family: Verdana;\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 * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\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 * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n /*\n * All interactive elements should have a minimum size of 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 min-height: var(--a11y-min-size);\n min-width: 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}\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 clip: rect(0 0 0 0);\n clip-path: inset(50%);\n height: calc(1rem / var(--kolibri-root-font-size, 16));\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: calc(1rem / var(--kolibri-root-font-size, 16));\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 border: none;\n margin: 0;\n padding: 0;\n width: 100%; /* 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}\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 }\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 cursor: not-allowed;\n opacity: 0.5;\n outline: none;\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 :host {\n font-size: calc(16rem / var(--kolibri-root-font-size, 16));\n }\n .kol-tooltip {\n display: contents;\n }\n .kol-tooltip__floating {\n animation-duration: 0.25s;\n animation-iteration-count: 1;\n animation-name: fadeInOpacity;\n animation-timing-function: ease-in;\n box-sizing: border-box;\n display: none;\n position: fixed;\n visibility: hidden;\n /* Avoid layout interference - see https://floating-ui.com/docs/computePosition */\n top: 0;\n left: 0;\n max-width: 90vw;\n max-height: 90vh;\n /* Can be used to specify the tooltip-width from the outside. Unset by default. */\n width: var(--kol-tooltip-width);\n }\n .kol-tooltip__arrow {\n background-color: #fff;\n color: #000;\n height: calc(10rem / var(--kolibri-root-font-size, 16));\n position: absolute;\n transform: rotate(45deg);\n width: calc(10rem / var(--kolibri-root-font-size, 16));\n z-index: 999;\n }\n .kol-tooltip__content {\n background-color: #fff;\n color: #000;\n position: relative;\n z-index: 1000;\n }\n @keyframes fadeInOpacity {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n}\n@layer kol-component {\n .kol-alert {\n display: grid;\n }\n .kol-alert__container {\n place-items: center;\n display: flex;\n }\n .kol-alert__container-content {\n flex-grow: 1;\n }\n .kol-alert__close-button {\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 font-size: rem(16);\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 align-items: center;\n background-color: white;\n cursor: pointer;\n display: grid;\n grid-template-columns: 1fr;\n min-height: var(--a11y-min-size);\n min-width: var(--a11y-min-size);\n width: 100%;\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 font-size: calc(16rem / var(--kolibri-root-font-size, 16));\n width: 100%;\n }\n .kol-textarea:focus {\n outline: none;\n }\n}",KolTextareaDefaultStyle0=defaultStyleCss,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.state._hasCounter}),tooltipAlign:this._tooltipAlign,onClick:()=>{var e;return null===(e=this.textareaRef)||void 0===e?void 0:e.focus()},alert:this.showAsAlert()}}getTextAreaProps(){return Object.assign(Object.assign({ref:this.catchRef,state:this.state,style:{resize:this.state._resize}},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(KolFormFieldStateWrapperFc,Object.assign({key:"54807a3fa69016bfdc687a2ce7fcb95d87541257"},this.getFormFieldProps()),h(KolInputContainerFc,{key:"01f3d68c72c820b577b870bbf385db3cc382e14a",state:this.state},h(KolTextAreaStateWrapperFc,Object.assign({key:"cb701ff29fe33ca11d0d061754e2309db671c790"},this.getTextAreaProps()))))}constructor(e){registerInstance(this,e),this.catchRef=e=>{this.textareaRef=e},this.onInput=e=>{if(this.textareaRef instanceof HTMLTextAreaElement){const t=this.textareaRef.value;setState(this,"_currentLength",t.length),this._value=t,this.state._adjustHeight&&(this._rows=increaseTextareaHeight(this.textareaRef)),this.controller.onFacade.onInput(e)}},this._accessKey=void 0,this._adjustHeight=!1,this._disabled=!1,this._hasCounter=!1,this._hideMsg=!1,this._hideLabel=!1,this._hint="",this._icons=void 0,this._id=void 0,this._label=void 0,this._maxLength=void 0,this._msg=void 0,this._name=void 0,this._on=void 0,this._placeholder=void 0,this._readOnly=!1,this._resize="vertical",this._required=!1,this._rows=void 0,this._shortKey=void 0,this._spellCheck=void 0,this._syncValueBySelector=void 0,this._tooltipAlign="top",this._touched=!1,this._value=void 0,this.state={_adjustHeight:!1,_currentLength:0,_hasValue:!1,_hideMsg:!1,_id:`id-${nonce()}`,_label:"",_resize:"vertical"},this.inputHasFocus=!1,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)}validateHasCounter(e){this.controller.validateHasCounter(e)}validateHideMsg(e){this.controller.validateHideMsg(e)}validateHideLabel(e){this.controller.validateHideLabel(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)}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"],_hasCounter:["validateHasCounter"],_hideMsg:["validateHideMsg"],_hideLabel:["validateHideLabel"],_hint:["validateHint"],_icons:["validateIcons"],_id:["validateId"],_label:["validateLabel"],_maxLength:["validateMaxLength"],_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:KolTextareaDefaultStyle0};export{KolTextarea as kol_textarea};
@@ -1 +1 @@
1
- {"file":"kol-textarea.entry.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBO,MAAM,gBAAgB,GAAG,CAAC,UAAU,EAAE,MAAM,CAAU;;ACX7D,MAAM,UAAU,GAAsB,CAAC,KAAK;IAC3C,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE,SAAS,EAAE,KAAK,KAAe,KAAK,EAAf,KAAK,UAAK,KAAK,EAAtH,wGAA8G,CAAQ,CAAC;IAE7H,MAAM,OAAO,GAAG,aAAa,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IAE5C,MAAM,eAAe,GAAG;QACvB,CAAC,wBAAwB,GAAG,OAAO,CAAC,QAAQ,CAAC;QAC7C,CAAC,wBAAwB,GAAG,OAAO,CAAC,QAAQ,CAAC;QAC7C,CAAC,uBAAuB,GAAG,OAAO,CAAC,OAAO,CAAC;QAC3C,CAAC,wBAAwB,GAAG,OAAO,CAAC,QAAQ,CAAC;QAC7C,CA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EAAE,CAAC,CAAC,CAAC;KACN;IAEM,iBAAiB;QACvB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC;QACvC,IAAI,CAAC,UAAU,CAAC,iBAAiB,EAAE,CAAC;QACpC,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;QAC3C,IAAI,CAAC,UAAU,CAAC,sBAAsB,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KAC5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["KolInputContainerStateWrapperFc"],"sources":["src/schema/components/textarea.ts","src/functional-components/inputs/TextArea/TextArea.tsx","src/functional-component-wrappers/TextAreaStateWrapper/TextAreaStateWrapper.tsx","src/components/textarea/controller.ts","src/components/textarea/style.scss?tag=kol-textarea&mode=default&encapsulation=shadow","src/components/textarea/shadow.tsx"],"sourcesContent":["import type { Generic } from 'adopted-style-sheets';\n\nimport type {\n\tMsgPropType,\n\tPropAccessKey,\n\tPropAdjustHeight,\n\tPropDisabled,\n\tPropHasCounter,\n\tPropHideMsg,\n\tPropHideLabel,\n\tPropId,\n\tPropLabelWithExpertSlot,\n\tPropMsg,\n\tPropName,\n\tPropReadOnly,\n\tPropRequired,\n\tPropRows,\n\tPropShortKey,\n\tPropSpellCheck,\n\tPropSyncValueBySelector,\n\tPropTouched,\n} from '../props';\nimport type { InputTypeOnDefault, KoliBriHorizontalIcons, Stringified } from '../types';\n\nexport const cssResizeOptions = ['vertical', 'none'] as const;\nexport type CSSResize = (typeof cssResizeOptions)[number];\n\ntype RequiredProps = PropLabelWithExpertSlot;\ntype OptionalProps = {\n\thint: string;\n\ticons: KoliBriHorizontalIcons;\n\tmaxLength: number;\n\tmsg: Stringified<MsgPropType>;\n\ton: InputTypeOnDefault;\n\tplaceholder: string;\n\tresize: CSSResize;\n\ttabIndex: number;\n\tvalue: string;\n} & PropAccessKey &\n\tPropAdjustHeight &\n\tPropDisabled &\n\tPropHasCounter &\n\tPropHideMsg &\n\tPropHideLabel &\n\tPropId &\n\tPropName &\n\tPropReadOnly &\n\tPropRequired &\n\tPropRows &\n\tPropShortKey &\n\tPropSpellCheck &\n\tPropSyncValueBySelector &\n\tPropTouched;\n\ntype RequiredStates = {\n\tadjustHeight: boolean;\n\tcurrentLength: number;\n\thasValue: boolean;\n\tresize: CSSResize;\n} & PropAdjustHeight &\n\tPropHideMsg &\n\tPropId &\n\tPropLabelWithExpertSlot;\n\ntype OptionalStates = {\n\thint: string;\n\ticons: KoliBriHorizontalIcons;\n\tmaxLength: number;\n\ton: InputTypeOnDefault;\n\tplaceholder: string;\n\ttabIndex: number;\n\tvalue: string;\n} & PropAccessKey &\n\tPropDisabled &\n\tPropHasCounter &\n\tPropHideLabel &\n\tPropMsg &\n\tPropName &\n\tPropReadOnly &\n\tPropRequired &\n\tPropRows &\n\tPropShortKey &\n\tPropSpellCheck &\n\tPropTouched;\n\nexport type TextareaProps = Generic.Element.Members<RequiredProps, OptionalProps>;\nexport type TextareaStates = Generic.Element.Members<RequiredStates, OptionalStates>;\nexport type TextareaWatches = Generic.Element.Watchers<RequiredProps, OptionalProps>;\nexport type TextareaAPI = Generic.Element.ComponentApi<RequiredProps, OptionalProps, RequiredStates, OptionalStates>;\n","import { h, type FunctionalComponent as FC } from '@stencil/core';\nimport type { JSXBase } from '@stencil/core/internal';\nimport clsx from 'clsx';\nimport { getDefaultProps } from '../_helpers/getDefaultProps';\nimport type { DefaultInputProps } from '../_types';\nimport { checkHasError, type InternMsgPropType } from '../../../schema';\n\nexport type TextAreaProps = DefaultInputProps<JSXBase.TextareaHTMLAttributes<HTMLTextAreaElement>> & {\n\tvalue: string;\n\ttouched?: boolean;\n\tmsg?: InternMsgPropType;\n};\n\nconst TextAreaFc: FC<TextAreaProps> = (props) => {\n\tconst { class: classNames, msg, touched, readonly, disabled, required, ariaDescribedBy, hideLabel, label, ...other } = props;\n\n\tconst showMsg = checkHasError(msg, touched);\n\n\tconst stateCssClasses = {\n\t\t['kol-textarea--disabled']: Boolean(disabled),\n\t\t['kol-textarea--required']: Boolean(required),\n\t\t['kol-textarea--touched']: Boolean(touched),\n\t\t['kol-textarea--readonly']: Boolean(readonly),\n\t\t[`kol-textarea--${msg?.type || 'error'}`]: showMsg,\n\t};\n\n\tconst inputProps: JSXBase.TextareaHTMLAttributes<HTMLTextAreaElement> = {\n\t\tclass: clsx('kol-textarea', stateCssClasses, classNames),\n\t\trequired: required,\n\t\tdisabled: disabled,\n\t\treadonly: readonly,\n\t\t...getDefaultProps({ ariaDescribedBy, hideLabel, label }),\n\t\t...other,\n\t};\n\n\treturn <textarea {...inputProps} />;\n};\n\nexport default TextAreaFc;\n","import { h, type FunctionalComponent as FC } from '@stencil/core';\nimport KolTextAreaFc, { type TextAreaProps } from '../../functional-components/inputs/TextArea';\n\nimport { convertMsgToInternMsg, type TextareaStates } from '../../schema';\nimport { getRenderStates } from '../_helpers/getRenderStates';\n\nexport type TextAreaStateWrapperProps = Partial<TextAreaProps> & {\n\tstate: TextareaStates;\n};\n\nfunction getTextAreaProps(state: TextareaStates): TextAreaProps {\n\tconst { ariaDescribedBy } = getRenderStates(state);\n\n\tconst props: TextAreaProps = {\n\t\tid: state._id,\n\t\thideLabel: state._hideLabel,\n\t\tlabel: state._label,\n\t\tvalue: state._value as string,\n\t\taccessKey: state._accessKey,\n\t\tdisabled: state._disabled,\n\t\tname: state._name,\n\t\tariaDescribedBy: ariaDescribedBy,\n\t\trows: state._rows,\n\t\treadonly: state._readOnly,\n\t\trequired: state._required,\n\t\tplaceholder: state._placeholder,\n\t\tmaxLength: state._maxLength,\n\t\ttouched: state._touched,\n\t\tmsg: convertMsgToInternMsg(state._msg),\n\t};\n\n\treturn props;\n}\n\nconst TextAreaStateWrapper: FC<TextAreaStateWrapperProps> = ({ state, ...other }) => {\n\treturn <KolTextAreaFc {...getTextAreaProps(state)} {...other} />;\n};\n\nexport default TextAreaStateWrapper;\n","import type { CSSResize, HasCounterPropType, RowsPropType, SpellCheckPropType, TextareaProps, TextareaWatches } from '../../schema';\nimport { cssResizeOptions, validateHasCounter, validateRows, validateSpellCheck, watchBoolean, watchNumber, watchString, watchValidator } from '../../schema';\n\nimport { InputIconController } from '../@deprecated/input/controller-icon';\n\nimport type { Generic } from 'adopted-style-sheets';\nexport class TextareaController extends InputIconController implements TextareaWatches {\n\tprotected readonly component: Generic.Element.Component & TextareaProps;\n\n\tpublic constructor(component: Generic.Element.Component & TextareaProps, name: string, host?: HTMLElement) {\n\t\tsuper(component, name, host);\n\t\tthis.component = component;\n\t}\n\n\tprivate afterSyncCharCounter = () => {\n\t\tif (typeof this.component._value === 'string' && this.component._value.length > 0) {\n\t\t\tthis.component.state._currentLength = this.component._value.length;\n\t\t}\n\t};\n\n\tpublic validateHasCounter(value?: HasCounterPropType): void {\n\t\tvalidateHasCounter(this.component, value, {\n\t\t\thooks: {\n\t\t\t\tafterPatch: this.afterSyncCharCounter,\n\t\t\t},\n\t\t});\n\t}\n\n\tpublic validateMaxLength(value?: number): void {\n\t\twatchNumber(this.component, '_maxLength', value, {\n\t\t\thooks: {\n\t\t\t\tafterPatch: this.afterSyncCharCounter,\n\t\t\t},\n\t\t\tmin: 0,\n\t\t});\n\t}\n\n\tpublic validatePlaceholder(value?: string): void {\n\t\twatchString(this.component, '_placeholder', value);\n\t}\n\n\tpublic validateReadOnly(value?: boolean): void {\n\t\twatchBoolean(this.component, '_readOnly', value);\n\t}\n\n\tpublic validateResize(value?: CSSResize): void {\n\t\twatchValidator(\n\t\t\tthis.component,\n\t\t\t'_resize',\n\t\t\t(value) => typeof value === 'string' && cssResizeOptions.includes(value),\n\t\t\tnew Set(`String {${cssResizeOptions.join(', ')}`),\n\t\t\tvalue,\n\t\t\t{\n\t\t\t\tdefaultValue: 'vertical',\n\t\t\t},\n\t\t);\n\t}\n\n\tpublic validateRequired(value?: boolean): void {\n\t\twatchBoolean(this.component, '_required', value);\n\t}\n\n\tpublic validateRows(value?: RowsPropType): void {\n\t\tvalidateRows(this.component, value);\n\t}\n\n\tpublic validateSpellCheck(value?: SpellCheckPropType): void {\n\t\tvalidateSpellCheck(this.component, value);\n\t}\n\n\tpublic validateValue(value?: string): void {\n\t\twatchString(this.component, '_value', value, {\n\t\t\thooks: {\n\t\t\t\tafterPatch: this.afterSyncCharCounter,\n\t\t\t},\n\t\t});\n\t\tthis.setFormAssociatedValue(this.component._value);\n\t}\n\n\tpublic componentWillLoad(): void {\n\t\tsuper.componentWillLoad();\n\t\tthis.validateHasCounter(this.component._hasCounter);\n\t\tthis.validateMaxLength(this.component._maxLength);\n\t\tthis.validatePlaceholder(this.component._placeholder);\n\t\tthis.validateReadOnly(this.component._readOnly);\n\t\tthis.validateResize(this.component._resize);\n\t\tthis.validateRequired(this.component._required);\n\t\tthis.validateRows(this.component._rows);\n\t\tthis.validateSpellCheck(this.component._spellCheck);\n\t\tthis.validateValue(this.component._value);\n\t}\n}\n","@import '../../styles/global';\n@import '../../styles/kol-alert-mixin';\n@import '../../styles/kol-form-field-mixin';\n@import '../../styles/kol-input-container-mixin';\n@import '../@shared/mixins';\n@import '../host-display-block';\n\n@include kol-alert;\n@include kol-form-field;\n@include kol-input-container;\n\n@layer kol-component {\n\t.kol-textarea {\n\t\tfont-size: rem(16);\n\t\twidth: 100%;\n\n\t\t&:focus {\n\t\t\toutline: none;\n\t\t}\n\t}\n}\n","import type { JSX } from '@stencil/core';\nimport { Component, Element, h, Method, Prop, State, Watch } from '@stencil/core';\nimport clsx from 'clsx';\n\nimport type {\n\tAdjustHeightPropType,\n\tCSSResize,\n\tFocusableElement,\n\tHasCounterPropType,\n\tHideMsgPropType,\n\tIdPropType,\n\tInputTypeOnDefault,\n\tKoliBriHorizontalIcons,\n\tLabelWithExpertSlotPropType,\n\tMsgPropType,\n\tNamePropType,\n\tRowsPropType,\n\tShortKeyPropType,\n\tSpellCheckPropType,\n\tStringified,\n\tSyncValueBySelectorPropType,\n\tTextareaAPI,\n\tTextareaStates,\n\tTooltipAlignPropType,\n} from '../../schema';\nimport { setState } from '../../schema';\n\nimport { nonce } from '../../utils/dev.utils';\nimport KolFormFieldStateWrapperFc, { type FormFieldStateWrapperProps } from '../../functional-component-wrappers/FormFieldStateWrapper';\nimport KolTextAreaStateWrapperFc, { type TextAreaStateWrapperProps } from '../../functional-component-wrappers/TextAreaStateWrapper';\nimport KolInputContainerStateWrapperFc from '../../functional-component-wrappers/InputContainerStateWrapper';\nimport { TextareaController } from './controller';\n\n/**\n * https://stackoverflow.com/questions/17772260/textarea-auto-height\n */\nconst increaseTextareaHeight = (el: HTMLTextAreaElement): number => {\n\tel.style.overflow = 'hidden'; // verhindert, dass ein Scrollbalken kurz angezeigt wird\n\tconst currentRows = el.rows;\n\tconst rowHeight = el.clientHeight / currentRows;\n\tel.rows = 1;\n\tconst nextRows = Math.round(el.scrollHeight / rowHeight);\n\tel.rows = currentRows;\n\treturn nextRows;\n};\n\n/**\n * @slot - Die Beschriftung des Eingabefeldes.\n */\n@Component({\n\ttag: 'kol-textarea',\n\tstyleUrls: {\n\t\tdefault: './style.scss',\n\t},\n\tshadow: {\n\t\tdelegatesFocus: true,\n\t},\n})\nexport class KolTextarea implements TextareaAPI, FocusableElement {\n\t@Element() private readonly host?: HTMLKolTextareaElement;\n\tprivate textareaRef?: HTMLTextAreaElement;\n\n\tprivate readonly catchRef = (ref?: HTMLTextAreaElement) => {\n\t\tthis.textareaRef = ref;\n\t};\n\n\t@Method()\n\t// eslint-disable-next-line @typescript-eslint/require-await\n\tpublic async getValue(): Promise<string | undefined> {\n\t\treturn this.textareaRef?.value;\n\t}\n\n\t@Method()\n\t// eslint-disable-next-line @typescript-eslint/require-await\n\tpublic async kolFocus() {\n\t\tthis.textareaRef?.focus();\n\t}\n\n\tprivate getFormFieldProps(): FormFieldStateWrapperProps {\n\t\treturn {\n\t\t\tstate: this.state,\n\t\t\tclass: clsx('kol-form-field-textarea', {\n\t\t\t\t'kol-form-field--has-value': this.state._hasValue,\n\t\t\t\t'kol-form-field--has-counter': !!this.state._hasCounter,\n\t\t\t}),\n\t\t\ttooltipAlign: this._tooltipAlign,\n\t\t\tonClick: () => this.textareaRef?.focus(),\n\t\t\talert: this.showAsAlert(),\n\t\t};\n\t}\n\n\tprivate getTextAreaProps(): TextAreaStateWrapperProps {\n\t\treturn {\n\t\t\tref: this.catchRef,\n\t\t\tstate: this.state,\n\t\t\tstyle: {\n\t\t\t\tresize: this.state._resize,\n\t\t\t},\n\t\t\t...this.controller.onFacade,\n\t\t\tonInput: this.onInput,\n\t\t\tonFocus: (event: Event) => {\n\t\t\t\tthis.controller.onFacade.onFocus(event);\n\t\t\t\tthis.inputHasFocus = true;\n\t\t\t},\n\t\t\tonBlur: (event: Event) => {\n\t\t\t\tthis.controller.onFacade.onBlur(event);\n\t\t\t\tthis.inputHasFocus = false;\n\t\t\t},\n\t\t};\n\t}\n\n\tpublic render(): JSX.Element {\n\t\treturn (\n\t\t\t<KolFormFieldStateWrapperFc {...this.getFormFieldProps()}>\n\t\t\t\t<KolInputContainerStateWrapperFc state={this.state}>\n\t\t\t\t\t<KolTextAreaStateWrapperFc {...this.getTextAreaProps()} />\n\t\t\t\t</KolInputContainerStateWrapperFc>\n\t\t\t</KolFormFieldStateWrapperFc>\n\t\t);\n\t}\n\n\tprivate readonly controller: TextareaController;\n\n\t/**\n\t * Defines which key combination can be used to trigger or focus the interactive element of the component.\n\t */\n\t@Prop() public _accessKey?: string;\n\n\t/**\n\t * Adjusts the height of the element to its content.\n\t * @TODO: change back to AdjustHeightPropType after stencil #4663 has been resolved\n\t */\n\t@Prop() public _adjustHeight?: boolean = false;\n\n\t/**\n\t * Makes the element not focusable and ignore all events.\n\t * @TODO: Change type back to `DisabledPropType` after Stencil#4663 has been resolved.\n\t */\n\t@Prop() public _disabled?: boolean = false;\n\n\t/**\n\t * Shows the character count on the lower border of the input.\n\t * @TODO: Change type back to `HasCounterPropType` after Stencil#4663 has been resolved.\n\t */\n\t@Prop() public _hasCounter?: boolean = false;\n\n\t/**\n\t * Hides the error message but leaves it in the DOM for the input's aria-describedby.\n\t * @TODO: Change type back to `HideMsgPropType` after Stencil#4663 has been resolved.\n\t */\n\t@Prop({ mutable: true, reflect: true }) public _hideMsg?: boolean = false;\n\n\t/**\n\t * Hides the caption by default and displays the caption text with a tooltip when the\n\t * interactive element is focused or the mouse is over it.\n\t * @TODO: Change type back to `HideLabelPropType` after Stencil#4663 has been resolved.\n\t */\n\t@Prop() public _hideLabel?: boolean = false;\n\n\t/**\n\t * Defines the hint text.\n\t */\n\t@Prop() public _hint?: string = '';\n\n\t/**\n\t * Defines the icon classnames (e.g. `_icons=\"fa-solid fa-user\"`).\n\t */\n\t@Prop() public _icons?: KoliBriHorizontalIcons;\n\n\t/**\n\t * Defines the internal ID of the primary component element.\n\t */\n\t@Prop() public _id?: IdPropType;\n\n\t/**\n\t * Defines the visible or semantic label of the component (e.g. aria-label, label, headline, caption, summary, etc.). Set to `false` to enable the expert slot.\n\t */\n\t@Prop() public _label!: LabelWithExpertSlotPropType;\n\n\t/**\n\t * Defines the maximum number of input characters.\n\t */\n\t@Prop() public _maxLength?: number;\n\n\t/**\n\t * Defines the properties for a message rendered as Alert component.\n\t */\n\t@Prop() public _msg?: Stringified<MsgPropType>;\n\n\t/**\n\t * Defines the technical name of an input field.\n\t */\n\t@Prop() public _name?: NamePropType;\n\n\t/**\n\t * Gibt die EventCallback-Funktionen für das Input-Event an.\n\t */\n\t@Prop() public _on?: InputTypeOnDefault;\n\n\t/**\n\t * Defines the placeholder for input field. To be shown when there's no value.\n\t */\n\t@Prop() public _placeholder?: string;\n\n\t/**\n\t * Makes the input element read only.\n\t * @TODO: Change type back to `ReadOnlyPropType` after Stencil#4663 has been resolved.\n\t */\n\t@Prop() public _readOnly?: boolean = false;\n\n\t/**\n\t * Defines whether and in which direction the size of the input can be changed by the user. (https://developer.mozilla.org/de/docs/Web/CSS/resize)\n\t * In version 3 (v3), horizontal resizing is abolished. The corresponding property is then reduced to the properties `vertical` (default) and `none`.\n\t */\n\t@Prop() public _resize?: CSSResize = 'vertical';\n\n\t/**\n\t * Makes the input element required.\n\t * @TODO: Change type back to `RequiredPropType` after Stencil#4663 has been resolved.\n\t */\n\t@Prop() public _required?: boolean = false;\n\n\t/**\n\t * Defines how many rows of text should be visible at the same time.\n\t */\n\t@Prop({ mutable: true, reflect: false }) public _rows?: RowsPropType;\n\n\t/**\n\t * Adds a visual short key hint to the component.\n\t */\n\t@Prop() public _shortKey?: ShortKeyPropType;\n\n\t/**\n\t * Defines whether the browser should check the spelling and grammar.\n\t */\n\t@Prop() public _spellCheck?: SpellCheckPropType;\n\n\t/**\n\t * Selector for synchronizing the value with another input element.\n\t * @internal\n\t */\n\t@Prop() public _syncValueBySelector?: SyncValueBySelectorPropType;\n\n\t/**\n\t * Defines which tab-index the primary element of the component has. (https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex)\n\t */\n\t@Prop() public _tabIndex?: number;\n\n\t/**\n\t * Defines where to show the Tooltip preferably: top, right, bottom or left.\n\t */\n\t@Prop() public _tooltipAlign?: TooltipAlignPropType = 'top';\n\n\t/**\n\t * Shows if the input was touched by a user.\n\t * @TODO: Change type back to `TouchedPropType` after Stencil#4663 has been resolved.\n\t */\n\t@Prop({ mutable: true, reflect: true }) public _touched?: boolean = false;\n\n\t/**\n\t * Defines the value of the input.\n\t */\n\t@Prop({ mutable: true, reflect: true }) public _value?: string;\n\n\t@State() public state: TextareaStates = {\n\t\t_adjustHeight: false,\n\t\t_currentLength: 0,\n\t\t_hasValue: false,\n\t\t_hideMsg: false,\n\t\t_id: `id-${nonce()}`,\n\t\t_label: '', // ⚠ required\n\t\t_resize: 'vertical',\n\t};\n\n\t@State() private inputHasFocus = false;\n\n\tpublic constructor() {\n\t\tthis.controller = new TextareaController(this, 'textarea', this.host);\n\t}\n\n\tprivate showAsAlert(): boolean {\n\t\treturn Boolean(this.state._touched) && !this.inputHasFocus;\n\t}\n\n\t@Watch('_accessKey')\n\tpublic validateAccessKey(value?: string): void {\n\t\tthis.controller.validateAccessKey(value);\n\t}\n\n\t@Watch('_adjustHeight')\n\tpublic validateAdjustHeight(value?: AdjustHeightPropType): void {\n\t\tthis.controller.validateAdjustHeight(value);\n\t}\n\n\t@Watch('_disabled')\n\tpublic validateDisabled(value?: boolean): void {\n\t\tthis.controller.validateDisabled(value);\n\t}\n\n\t@Watch('_hasCounter')\n\tpublic validateHasCounter(value?: HasCounterPropType): void {\n\t\tthis.controller.validateHasCounter(value);\n\t}\n\n\t@Watch('_hideMsg')\n\tpublic validateHideMsg(value?: HideMsgPropType): void {\n\t\tthis.controller.validateHideMsg(value);\n\t}\n\n\t@Watch('_hideLabel')\n\tpublic validateHideLabel(value?: boolean): void {\n\t\tthis.controller.validateHideLabel(value);\n\t}\n\n\t@Watch('_hint')\n\tpublic validateHint(value?: string): void {\n\t\tthis.controller.validateHint(value);\n\t}\n\n\t@Watch('_icons')\n\tpublic validateIcons(value?: Stringified<KoliBriHorizontalIcons>): void {\n\t\tthis.controller.validateIcons(value);\n\t}\n\n\t@Watch('_id')\n\tpublic validateId(value?: string): void {\n\t\tthis.controller.validateId(value);\n\t}\n\n\t@Watch('_label')\n\tpublic validateLabel(value?: LabelWithExpertSlotPropType): void {\n\t\tthis.controller.validateLabel(value);\n\t}\n\n\t@Watch('_maxLength')\n\tpublic validateMaxLength(value?: number): void {\n\t\tthis.controller.validateMaxLength(value);\n\t}\n\n\t@Watch('_msg')\n\tpublic validateMsg(value?: Stringified<MsgPropType>): void {\n\t\tthis.controller.validateMsg(value);\n\t}\n\n\t@Watch('_name')\n\tpublic validateName(value?: string): void {\n\t\tthis.controller.validateName(value);\n\t}\n\n\t@Watch('_on')\n\tpublic validateOn(value?: InputTypeOnDefault): void {\n\t\tthis.controller.validateOn(value);\n\t}\n\n\t@Watch('_placeholder')\n\tpublic validatePlaceholder(value?: string): void {\n\t\tthis.controller.validatePlaceholder(value);\n\t}\n\n\t@Watch('_readOnly')\n\tpublic validateReadOnly(value?: boolean): void {\n\t\tthis.controller.validateReadOnly(value);\n\t}\n\n\t@Watch('_resize')\n\tpublic validateResize(value?: CSSResize): void {\n\t\tthis.controller.validateResize(value);\n\t}\n\n\t@Watch('_required')\n\tpublic validateRequired(value?: boolean): void {\n\t\tthis.controller.validateRequired(value);\n\t}\n\n\t@Watch('_rows')\n\tpublic validateRows(value?: RowsPropType): void {\n\t\tthis.controller.validateRows(value);\n\t}\n\n\t@Watch('_shortKey')\n\tpublic validateShortKey(value?: ShortKeyPropType): void {\n\t\tthis.controller.validateShortKey(value);\n\t}\n\n\t@Watch('_spellCheck')\n\tpublic validateSpellCheck(value?: SpellCheckPropType): void {\n\t\tthis.controller.validateSpellCheck(value);\n\t}\n\n\t@Watch('_syncValueBySelector')\n\tpublic validateSyncValueBySelector(value?: SyncValueBySelectorPropType): void {\n\t\tthis.controller.validateSyncValueBySelector(value);\n\t}\n\n\t@Watch('_tabIndex')\n\tpublic validateTabIndex(value?: number): void {\n\t\tthis.controller.validateTabIndex(value);\n\t}\n\n\t@Watch('_touched')\n\tpublic validateTouched(value?: boolean): void {\n\t\tthis.controller.validateTouched(value);\n\t}\n\n\t@Watch('_value')\n\tpublic validateValue(value?: string): void {\n\t\tthis.controller.validateValue(value);\n\t}\n\n\tpublic componentDidLoad(): void {\n\t\tsetTimeout(() => {\n\t\t\tif (this._adjustHeight === true && this.textareaRef /* SSR instanceof HTMLTextAreaElement */) {\n\t\t\t\tthis._rows =\n\t\t\t\t\tthis.state?._rows && this.state._rows > increaseTextareaHeight(this.textareaRef) ? this.state._rows : increaseTextareaHeight(this.textareaRef);\n\t\t\t} else if (!this._rows) {\n\t\t\t\tthis._rows = 1;\n\t\t\t}\n\t\t}, 0);\n\t}\n\n\tpublic componentWillLoad(): void {\n\t\tthis._touched = this._touched === true;\n\t\tthis.controller.componentWillLoad();\n\t\tthis.state._hasValue = !!this.state._value;\n\t\tthis.controller.addValueChangeListener((v) => (this.state._hasValue = !!v));\n\t}\n\n\tprivate readonly onInput = (event: InputEvent) => {\n\t\tif (this.textareaRef instanceof HTMLTextAreaElement) {\n\t\t\tconst value = this.textareaRef.value;\n\t\t\tsetState(this, '_currentLength', value.length);\n\t\t\tthis._value = value;\n\t\t\tif (this.state._adjustHeight) {\n\t\t\t\tthis._rows = increaseTextareaHeight(this.textareaRef);\n\t\t\t}\n\t\t\tthis.controller.onFacade.onInput(event);\n\t\t}\n\t};\n}\n"],"version":3}
1
+ {"file":"kol-textarea.entry.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBO,MAAM,gBAAgB,GAAG,CAAC,UAAU,EAAE,MAAM,CAAU;;ACX7D,MAAM,UAAU,GAAsB,CAAC,KAAK;IAC3C,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE,SAAS,EAAE,KAAK,KAAe,KAAK,EAAf,KAAK,UAAK,KAAK,EAAtH,wGAA8G,CAAQ,CAAC;IAE7H,MAAM,OAAO,GAAG,aAAa,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IAE5C,MAAM,eAAe,GAAG;QACvB,CAAC,wBAAwB,GAAG,OAAO,CAAC,QAAQ,CAAC;QAC7C,CAAC,wBAAwB,GAAG,OAAO,CAAC,QAAQ,CAAC;QAC7C,CAAC,uBAAuB,GAAG,OAAO,CAAC,OAAO,CAAC;QAC3C,CAAC,wBAAwB,GAAG,OAAO,CAAC,QAAQ,CAAC;QAC7C,CAAC,iBAAiB,CAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,IAAI,KAAI,OAAO,EAAE,GAAG,OAAO;KAClD,CAAC;IAEF,MAAM,UAAU,iCACf,KAAK,EAAE,IAAI,CAAC,cAAc,EAAE,eAAe,EAAE,UAAU,CAAC,EACxD,QAAQ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,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KAC5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["KolInputContainerStateWrapperFc"],"sources":["src/schema/components/textarea.ts","src/functional-components/inputs/TextArea/TextArea.tsx","src/functional-component-wrappers/TextAreaStateWrapper/TextAreaStateWrapper.tsx","src/components/textarea/controller.ts","src/components/textarea/style.scss?tag=kol-textarea&mode=default&encapsulation=shadow","src/components/textarea/shadow.tsx"],"sourcesContent":["import type { Generic } from 'adopted-style-sheets';\n\nimport type {\n\tMsgPropType,\n\tPropAccessKey,\n\tPropAdjustHeight,\n\tPropDisabled,\n\tPropHasCounter,\n\tPropHideMsg,\n\tPropHideLabel,\n\tPropId,\n\tPropLabelWithExpertSlot,\n\tPropMsg,\n\tPropName,\n\tPropReadOnly,\n\tPropRequired,\n\tPropRows,\n\tPropShortKey,\n\tPropSpellCheck,\n\tPropSyncValueBySelector,\n\tPropTouched,\n} from '../props';\nimport type { InputTypeOnDefault, KoliBriHorizontalIcons, Stringified } from '../types';\n\nexport const cssResizeOptions = ['vertical', 'none'] as const;\nexport type CSSResize = (typeof cssResizeOptions)[number];\n\ntype RequiredProps = PropLabelWithExpertSlot;\ntype OptionalProps = {\n\thint: string;\n\ticons: KoliBriHorizontalIcons;\n\tmaxLength: number;\n\tmsg: Stringified<MsgPropType>;\n\ton: InputTypeOnDefault;\n\tplaceholder: string;\n\tresize: CSSResize;\n\tvalue: string;\n} & PropAccessKey &\n\tPropAdjustHeight &\n\tPropDisabled &\n\tPropHasCounter &\n\tPropHideMsg &\n\tPropHideLabel &\n\tPropId &\n\tPropName &\n\tPropReadOnly &\n\tPropRequired &\n\tPropRows &\n\tPropShortKey &\n\tPropSpellCheck &\n\tPropSyncValueBySelector &\n\tPropTouched;\n\ntype RequiredStates = {\n\tadjustHeight: boolean;\n\tcurrentLength: number;\n\thasValue: boolean;\n\tresize: CSSResize;\n} & PropAdjustHeight &\n\tPropHideMsg &\n\tPropId &\n\tPropLabelWithExpertSlot;\n\ntype OptionalStates = {\n\thint: string;\n\ticons: KoliBriHorizontalIcons;\n\tmaxLength: number;\n\ton: InputTypeOnDefault;\n\tplaceholder: string;\n\tvalue: string;\n} & PropAccessKey &\n\tPropDisabled &\n\tPropHasCounter &\n\tPropHideLabel &\n\tPropMsg &\n\tPropName &\n\tPropReadOnly &\n\tPropRequired &\n\tPropRows &\n\tPropShortKey &\n\tPropSpellCheck &\n\tPropTouched;\n\nexport type TextareaProps = Generic.Element.Members<RequiredProps, OptionalProps>;\nexport type TextareaStates = Generic.Element.Members<RequiredStates, OptionalStates>;\nexport type TextareaWatches = Generic.Element.Watchers<RequiredProps, OptionalProps>;\nexport type TextareaAPI = Generic.Element.ComponentApi<RequiredProps, OptionalProps, RequiredStates, OptionalStates>;\n","import { h, type FunctionalComponent as FC } from '@stencil/core';\nimport type { JSXBase } from '@stencil/core/internal';\nimport clsx from 'clsx';\nimport { getDefaultProps } from '../_helpers/getDefaultProps';\nimport type { DefaultInputProps } from '../_types';\nimport { checkHasError, type InternMsgPropType } from '../../../schema';\n\nexport type TextAreaProps = DefaultInputProps<JSXBase.TextareaHTMLAttributes<HTMLTextAreaElement>> & {\n\tvalue: string;\n\ttouched?: boolean;\n\tmsg?: InternMsgPropType;\n};\n\nconst TextAreaFc: FC<TextAreaProps> = (props) => {\n\tconst { class: classNames, msg, touched, readonly, disabled, required, ariaDescribedBy, hideLabel, label, ...other } = props;\n\n\tconst showMsg = checkHasError(msg, touched);\n\n\tconst stateCssClasses = {\n\t\t['kol-textarea--disabled']: Boolean(disabled),\n\t\t['kol-textarea--required']: Boolean(required),\n\t\t['kol-textarea--touched']: Boolean(touched),\n\t\t['kol-textarea--readonly']: Boolean(readonly),\n\t\t[`kol-textarea--${msg?.type || 'error'}`]: showMsg,\n\t};\n\n\tconst inputProps: JSXBase.TextareaHTMLAttributes<HTMLTextAreaElement> = {\n\t\tclass: clsx('kol-textarea', stateCssClasses, classNames),\n\t\trequired: required,\n\t\tdisabled: disabled,\n\t\treadonly: readonly,\n\t\t...getDefaultProps({ ariaDescribedBy, hideLabel, label }),\n\t\t...other,\n\t};\n\n\treturn <textarea {...inputProps} />;\n};\n\nexport default TextAreaFc;\n","import { h, type FunctionalComponent as FC } from '@stencil/core';\nimport KolTextAreaFc, { type TextAreaProps } from '../../functional-components/inputs/TextArea';\n\nimport { convertMsgToInternMsg, type TextareaStates } from '../../schema';\nimport { getRenderStates } from '../_helpers/getRenderStates';\n\nexport type TextAreaStateWrapperProps = Partial<TextAreaProps> & {\n\tstate: TextareaStates;\n};\n\nfunction getTextAreaProps(state: TextareaStates): TextAreaProps {\n\tconst { ariaDescribedBy } = getRenderStates(state);\n\n\tconst props: TextAreaProps = {\n\t\tid: state._id,\n\t\thideLabel: state._hideLabel,\n\t\tlabel: state._label,\n\t\tvalue: state._value as string,\n\t\taccessKey: state._accessKey,\n\t\tdisabled: state._disabled,\n\t\tname: state._name,\n\t\tariaDescribedBy: ariaDescribedBy,\n\t\trows: state._rows,\n\t\treadonly: state._readOnly,\n\t\trequired: state._required,\n\t\tplaceholder: state._placeholder,\n\t\tmaxLength: state._maxLength,\n\t\ttouched: state._touched,\n\t\tmsg: convertMsgToInternMsg(state._msg),\n\t};\n\n\treturn props;\n}\n\nconst TextAreaStateWrapper: FC<TextAreaStateWrapperProps> = ({ state, ...other }) => {\n\treturn <KolTextAreaFc {...getTextAreaProps(state)} {...other} />;\n};\n\nexport default TextAreaStateWrapper;\n","import type { CSSResize, HasCounterPropType, RowsPropType, SpellCheckPropType, TextareaProps, TextareaWatches } from '../../schema';\nimport { cssResizeOptions, validateHasCounter, validateRows, validateSpellCheck, watchBoolean, watchNumber, watchString, watchValidator } from '../../schema';\n\nimport { InputIconController } from '../@deprecated/input/controller-icon';\n\nimport type { Generic } from 'adopted-style-sheets';\nexport class TextareaController extends InputIconController implements TextareaWatches {\n\tprotected readonly component: Generic.Element.Component & TextareaProps;\n\n\tpublic constructor(component: Generic.Element.Component & TextareaProps, name: string, host?: HTMLElement) {\n\t\tsuper(component, name, host);\n\t\tthis.component = component;\n\t}\n\n\tprivate afterSyncCharCounter = () => {\n\t\tif (typeof this.component._value === 'string' && this.component._value.length > 0) {\n\t\t\tthis.component.state._currentLength = this.component._value.length;\n\t\t}\n\t};\n\n\tpublic validateHasCounter(value?: HasCounterPropType): void {\n\t\tvalidateHasCounter(this.component, value, {\n\t\t\thooks: {\n\t\t\t\tafterPatch: this.afterSyncCharCounter,\n\t\t\t},\n\t\t});\n\t}\n\n\tpublic validateMaxLength(value?: number): void {\n\t\twatchNumber(this.component, '_maxLength', value, {\n\t\t\thooks: {\n\t\t\t\tafterPatch: this.afterSyncCharCounter,\n\t\t\t},\n\t\t\tmin: 0,\n\t\t});\n\t}\n\n\tpublic validatePlaceholder(value?: string): void {\n\t\twatchString(this.component, '_placeholder', value);\n\t}\n\n\tpublic validateReadOnly(value?: boolean): void {\n\t\twatchBoolean(this.component, '_readOnly', value);\n\t}\n\n\tpublic validateResize(value?: CSSResize): void {\n\t\twatchValidator(\n\t\t\tthis.component,\n\t\t\t'_resize',\n\t\t\t(value) => typeof value === 'string' && cssResizeOptions.includes(value),\n\t\t\tnew Set(`String {${cssResizeOptions.join(', ')}`),\n\t\t\tvalue,\n\t\t\t{\n\t\t\t\tdefaultValue: 'vertical',\n\t\t\t},\n\t\t);\n\t}\n\n\tpublic validateRequired(value?: boolean): void {\n\t\twatchBoolean(this.component, '_required', value);\n\t}\n\n\tpublic validateRows(value?: RowsPropType): void {\n\t\tvalidateRows(this.component, value);\n\t}\n\n\tpublic validateSpellCheck(value?: SpellCheckPropType): void {\n\t\tvalidateSpellCheck(this.component, value);\n\t}\n\n\tpublic validateValue(value?: string): void {\n\t\twatchString(this.component, '_value', value, {\n\t\t\thooks: {\n\t\t\t\tafterPatch: this.afterSyncCharCounter,\n\t\t\t},\n\t\t});\n\t\tthis.setFormAssociatedValue(this.component._value);\n\t}\n\n\tpublic componentWillLoad(): void {\n\t\tsuper.componentWillLoad();\n\t\tthis.validateHasCounter(this.component._hasCounter);\n\t\tthis.validateMaxLength(this.component._maxLength);\n\t\tthis.validatePlaceholder(this.component._placeholder);\n\t\tthis.validateReadOnly(this.component._readOnly);\n\t\tthis.validateResize(this.component._resize);\n\t\tthis.validateRequired(this.component._required);\n\t\tthis.validateRows(this.component._rows);\n\t\tthis.validateSpellCheck(this.component._spellCheck);\n\t\tthis.validateValue(this.component._value);\n\t}\n}\n","@use '../../styles/global' as *;\n@use '../../styles/kol-alert-mixin' as *;\n@use '../../styles/kol-form-field-mixin' as *;\n@use '../../styles/kol-input-container-mixin' as *;\n@use '../@shared/mixins' as *;\n@use '../host-display-block' as *;\n\n@include kol-alert;\n@include kol-form-field;\n@include kol-input-container;\n\n@layer kol-component {\n\t.kol-textarea {\n\t\tfont-size: rem(16);\n\t\twidth: 100%;\n\n\t\t&:focus {\n\t\t\toutline: none;\n\t\t}\n\t}\n}\n","import type { JSX } from '@stencil/core';\nimport { Component, Element, h, Method, Prop, State, Watch } from '@stencil/core';\nimport clsx from 'clsx';\n\nimport type {\n\tAdjustHeightPropType,\n\tCSSResize,\n\tFocusableElement,\n\tHasCounterPropType,\n\tHideMsgPropType,\n\tIdPropType,\n\tInputTypeOnDefault,\n\tKoliBriHorizontalIcons,\n\tLabelWithExpertSlotPropType,\n\tMsgPropType,\n\tNamePropType,\n\tRowsPropType,\n\tShortKeyPropType,\n\tSpellCheckPropType,\n\tStringified,\n\tSyncValueBySelectorPropType,\n\tTextareaAPI,\n\tTextareaStates,\n\tTooltipAlignPropType,\n} from '../../schema';\nimport { setState } from '../../schema';\n\nimport { nonce } from '../../utils/dev.utils';\nimport KolFormFieldStateWrapperFc, { type FormFieldStateWrapperProps } from '../../functional-component-wrappers/FormFieldStateWrapper';\nimport KolTextAreaStateWrapperFc, { type TextAreaStateWrapperProps } from '../../functional-component-wrappers/TextAreaStateWrapper';\nimport KolInputContainerStateWrapperFc from '../../functional-component-wrappers/InputContainerStateWrapper';\nimport { TextareaController } from './controller';\n\n/**\n * https://stackoverflow.com/questions/17772260/textarea-auto-height\n */\nconst increaseTextareaHeight = (el: HTMLTextAreaElement): number => {\n\tel.style.overflow = 'hidden'; // verhindert, dass ein Scrollbalken kurz angezeigt wird\n\tconst currentRows = el.rows;\n\tconst rowHeight = el.clientHeight / currentRows;\n\tel.rows = 1;\n\tconst nextRows = Math.round(el.scrollHeight / rowHeight);\n\tel.rows = currentRows;\n\treturn nextRows;\n};\n\n/**\n * @slot - Die Beschriftung des Eingabefeldes.\n */\n@Component({\n\ttag: 'kol-textarea',\n\tstyleUrls: {\n\t\tdefault: './style.scss',\n\t},\n\tshadow: {\n\t\tdelegatesFocus: true,\n\t},\n})\nexport class KolTextarea implements TextareaAPI, FocusableElement {\n\t@Element() private readonly host?: HTMLKolTextareaElement;\n\tprivate textareaRef?: HTMLTextAreaElement;\n\n\tprivate readonly catchRef = (ref?: HTMLTextAreaElement) => {\n\t\tthis.textareaRef = ref;\n\t};\n\n\t@Method()\n\t// eslint-disable-next-line @typescript-eslint/require-await\n\tpublic async getValue(): Promise<string | undefined> {\n\t\treturn this.textareaRef?.value;\n\t}\n\n\t@Method()\n\t// eslint-disable-next-line @typescript-eslint/require-await\n\tpublic async kolFocus() {\n\t\tthis.textareaRef?.focus();\n\t}\n\n\tprivate getFormFieldProps(): FormFieldStateWrapperProps {\n\t\treturn {\n\t\t\tstate: this.state,\n\t\t\tclass: clsx('kol-form-field-textarea', {\n\t\t\t\t'kol-form-field--has-value': this.state._hasValue,\n\t\t\t\t'kol-form-field--has-counter': !!this.state._hasCounter,\n\t\t\t}),\n\t\t\ttooltipAlign: this._tooltipAlign,\n\t\t\tonClick: () => this.textareaRef?.focus(),\n\t\t\talert: this.showAsAlert(),\n\t\t};\n\t}\n\n\tprivate getTextAreaProps(): TextAreaStateWrapperProps {\n\t\treturn {\n\t\t\tref: this.catchRef,\n\t\t\tstate: this.state,\n\t\t\tstyle: {\n\t\t\t\tresize: this.state._resize,\n\t\t\t},\n\t\t\t...this.controller.onFacade,\n\t\t\tonInput: this.onInput,\n\t\t\tonFocus: (event: Event) => {\n\t\t\t\tthis.controller.onFacade.onFocus(event);\n\t\t\t\tthis.inputHasFocus = true;\n\t\t\t},\n\t\t\tonBlur: (event: Event) => {\n\t\t\t\tthis.controller.onFacade.onBlur(event);\n\t\t\t\tthis.inputHasFocus = false;\n\t\t\t},\n\t\t};\n\t}\n\n\tpublic render(): JSX.Element {\n\t\treturn (\n\t\t\t<KolFormFieldStateWrapperFc {...this.getFormFieldProps()}>\n\t\t\t\t<KolInputContainerStateWrapperFc state={this.state}>\n\t\t\t\t\t<KolTextAreaStateWrapperFc {...this.getTextAreaProps()} />\n\t\t\t\t</KolInputContainerStateWrapperFc>\n\t\t\t</KolFormFieldStateWrapperFc>\n\t\t);\n\t}\n\n\tprivate readonly controller: TextareaController;\n\n\t/**\n\t * Defines which key combination can be used to trigger or focus the interactive element of the component.\n\t */\n\t@Prop() public _accessKey?: string;\n\n\t/**\n\t * Adjusts the height of the element to its content.\n\t * @TODO: change back to AdjustHeightPropType after stencil #4663 has been resolved\n\t */\n\t@Prop() public _adjustHeight?: boolean = false;\n\n\t/**\n\t * Makes the element not focusable and ignore all events.\n\t * @TODO: Change type back to `DisabledPropType` after Stencil#4663 has been resolved.\n\t */\n\t@Prop() public _disabled?: boolean = false;\n\n\t/**\n\t * Shows the character count on the lower border of the input.\n\t * @TODO: Change type back to `HasCounterPropType` after Stencil#4663 has been resolved.\n\t */\n\t@Prop() public _hasCounter?: boolean = false;\n\n\t/**\n\t * Hides the error message but leaves it in the DOM for the input's aria-describedby.\n\t * @TODO: Change type back to `HideMsgPropType` after Stencil#4663 has been resolved.\n\t */\n\t@Prop({ mutable: true, reflect: true }) public _hideMsg?: boolean = false;\n\n\t/**\n\t * Hides the caption by default and displays the caption text with a tooltip when the\n\t * interactive element is focused or the mouse is over it.\n\t * @TODO: Change type back to `HideLabelPropType` after Stencil#4663 has been resolved.\n\t */\n\t@Prop() public _hideLabel?: boolean = false;\n\n\t/**\n\t * Defines the hint text.\n\t */\n\t@Prop() public _hint?: string = '';\n\n\t/**\n\t * Defines the icon classnames (e.g. `_icons=\"fa-solid fa-user\"`).\n\t */\n\t@Prop() public _icons?: KoliBriHorizontalIcons;\n\n\t/**\n\t * Defines the internal ID of the primary component element.\n\t */\n\t@Prop() public _id?: IdPropType;\n\n\t/**\n\t * Defines the visible or semantic label of the component (e.g. aria-label, label, headline, caption, summary, etc.). Set to `false` to enable the expert slot.\n\t */\n\t@Prop() public _label!: LabelWithExpertSlotPropType;\n\n\t/**\n\t * Defines the maximum number of input characters.\n\t */\n\t@Prop() public _maxLength?: number;\n\n\t/**\n\t * Defines the properties for a message rendered as Alert component.\n\t */\n\t@Prop() public _msg?: Stringified<MsgPropType>;\n\n\t/**\n\t * Defines the technical name of an input field.\n\t */\n\t@Prop() public _name?: NamePropType;\n\n\t/**\n\t * Gibt die EventCallback-Funktionen für das Input-Event an.\n\t */\n\t@Prop() public _on?: InputTypeOnDefault;\n\n\t/**\n\t * Defines the placeholder for input field. To be shown when there's no value.\n\t */\n\t@Prop() public _placeholder?: string;\n\n\t/**\n\t * Makes the input element read only.\n\t * @TODO: Change type back to `ReadOnlyPropType` after Stencil#4663 has been resolved.\n\t */\n\t@Prop() public _readOnly?: boolean = false;\n\n\t/**\n\t * Defines whether and in which direction the size of the input can be changed by the user. (https://developer.mozilla.org/de/docs/Web/CSS/resize)\n\t * In version 3 (v3), horizontal resizing is abolished. The corresponding property is then reduced to the properties `vertical` (default) and `none`.\n\t */\n\t@Prop() public _resize?: CSSResize = 'vertical';\n\n\t/**\n\t * Makes the input element required.\n\t * @TODO: Change type back to `RequiredPropType` after Stencil#4663 has been resolved.\n\t */\n\t@Prop() public _required?: boolean = false;\n\n\t/**\n\t * Defines how many rows of text should be visible at the same time.\n\t */\n\t@Prop({ mutable: true, reflect: false }) public _rows?: RowsPropType;\n\n\t/**\n\t * Adds a visual short key hint to the component.\n\t */\n\t@Prop() public _shortKey?: ShortKeyPropType;\n\n\t/**\n\t * Defines whether the browser should check the spelling and grammar.\n\t */\n\t@Prop() public _spellCheck?: SpellCheckPropType;\n\n\t/**\n\t * Selector for synchronizing the value with another input element.\n\t * @internal\n\t */\n\t@Prop() public _syncValueBySelector?: SyncValueBySelectorPropType;\n\n\t/**\n\t * Defines where to show the Tooltip preferably: top, right, bottom or left.\n\t */\n\t@Prop() public _tooltipAlign?: TooltipAlignPropType = 'top';\n\n\t/**\n\t * Shows if the input was touched by a user.\n\t * @TODO: Change type back to `TouchedPropType` after Stencil#4663 has been resolved.\n\t */\n\t@Prop({ mutable: true, reflect: true }) public _touched?: boolean = false;\n\n\t/**\n\t * Defines the value of the input.\n\t */\n\t@Prop({ mutable: true, reflect: true }) public _value?: string;\n\n\t@State() public state: TextareaStates = {\n\t\t_adjustHeight: false,\n\t\t_currentLength: 0,\n\t\t_hasValue: false,\n\t\t_hideMsg: false,\n\t\t_id: `id-${nonce()}`,\n\t\t_label: '', // ⚠ required\n\t\t_resize: 'vertical',\n\t};\n\n\t@State() private inputHasFocus = false;\n\n\tpublic constructor() {\n\t\tthis.controller = new TextareaController(this, 'textarea', this.host);\n\t}\n\n\tprivate showAsAlert(): boolean {\n\t\treturn Boolean(this.state._touched) && !this.inputHasFocus;\n\t}\n\n\t@Watch('_accessKey')\n\tpublic validateAccessKey(value?: string): void {\n\t\tthis.controller.validateAccessKey(value);\n\t}\n\n\t@Watch('_adjustHeight')\n\tpublic validateAdjustHeight(value?: AdjustHeightPropType): void {\n\t\tthis.controller.validateAdjustHeight(value);\n\t}\n\n\t@Watch('_disabled')\n\tpublic validateDisabled(value?: boolean): void {\n\t\tthis.controller.validateDisabled(value);\n\t}\n\n\t@Watch('_hasCounter')\n\tpublic validateHasCounter(value?: HasCounterPropType): void {\n\t\tthis.controller.validateHasCounter(value);\n\t}\n\n\t@Watch('_hideMsg')\n\tpublic validateHideMsg(value?: HideMsgPropType): void {\n\t\tthis.controller.validateHideMsg(value);\n\t}\n\n\t@Watch('_hideLabel')\n\tpublic validateHideLabel(value?: boolean): void {\n\t\tthis.controller.validateHideLabel(value);\n\t}\n\n\t@Watch('_hint')\n\tpublic validateHint(value?: string): void {\n\t\tthis.controller.validateHint(value);\n\t}\n\n\t@Watch('_icons')\n\tpublic validateIcons(value?: Stringified<KoliBriHorizontalIcons>): void {\n\t\tthis.controller.validateIcons(value);\n\t}\n\n\t@Watch('_id')\n\tpublic validateId(value?: string): void {\n\t\tthis.controller.validateId(value);\n\t}\n\n\t@Watch('_label')\n\tpublic validateLabel(value?: LabelWithExpertSlotPropType): void {\n\t\tthis.controller.validateLabel(value);\n\t}\n\n\t@Watch('_maxLength')\n\tpublic validateMaxLength(value?: number): void {\n\t\tthis.controller.validateMaxLength(value);\n\t}\n\n\t@Watch('_msg')\n\tpublic validateMsg(value?: Stringified<MsgPropType>): void {\n\t\tthis.controller.validateMsg(value);\n\t}\n\n\t@Watch('_name')\n\tpublic validateName(value?: string): void {\n\t\tthis.controller.validateName(value);\n\t}\n\n\t@Watch('_on')\n\tpublic validateOn(value?: InputTypeOnDefault): void {\n\t\tthis.controller.validateOn(value);\n\t}\n\n\t@Watch('_placeholder')\n\tpublic validatePlaceholder(value?: string): void {\n\t\tthis.controller.validatePlaceholder(value);\n\t}\n\n\t@Watch('_readOnly')\n\tpublic validateReadOnly(value?: boolean): void {\n\t\tthis.controller.validateReadOnly(value);\n\t}\n\n\t@Watch('_resize')\n\tpublic validateResize(value?: CSSResize): void {\n\t\tthis.controller.validateResize(value);\n\t}\n\n\t@Watch('_required')\n\tpublic validateRequired(value?: boolean): void {\n\t\tthis.controller.validateRequired(value);\n\t}\n\n\t@Watch('_rows')\n\tpublic validateRows(value?: RowsPropType): void {\n\t\tthis.controller.validateRows(value);\n\t}\n\n\t@Watch('_shortKey')\n\tpublic validateShortKey(value?: ShortKeyPropType): void {\n\t\tthis.controller.validateShortKey(value);\n\t}\n\n\t@Watch('_spellCheck')\n\tpublic validateSpellCheck(value?: SpellCheckPropType): void {\n\t\tthis.controller.validateSpellCheck(value);\n\t}\n\n\t@Watch('_syncValueBySelector')\n\tpublic validateSyncValueBySelector(value?: SyncValueBySelectorPropType): void {\n\t\tthis.controller.validateSyncValueBySelector(value);\n\t}\n\n\t@Watch('_touched')\n\tpublic validateTouched(value?: boolean): void {\n\t\tthis.controller.validateTouched(value);\n\t}\n\n\t@Watch('_value')\n\tpublic validateValue(value?: string): void {\n\t\tthis.controller.validateValue(value);\n\t}\n\n\tpublic componentDidLoad(): void {\n\t\tsetTimeout(() => {\n\t\t\tif (this._adjustHeight === true && this.textareaRef /* SSR instanceof HTMLTextAreaElement */) {\n\t\t\t\tthis._rows =\n\t\t\t\t\tthis.state?._rows && this.state._rows > increaseTextareaHeight(this.textareaRef) ? this.state._rows : increaseTextareaHeight(this.textareaRef);\n\t\t\t} else if (!this._rows) {\n\t\t\t\tthis._rows = 1;\n\t\t\t}\n\t\t}, 0);\n\t}\n\n\tpublic componentWillLoad(): void {\n\t\tthis._touched = this._touched === true;\n\t\tthis.controller.componentWillLoad();\n\t\tthis.state._hasValue = !!this.state._value;\n\t\tthis.controller.addValueChangeListener((v) => (this.state._hasValue = !!v));\n\t}\n\n\tprivate readonly onInput = (event: InputEvent) => {\n\t\tif (this.textareaRef instanceof HTMLTextAreaElement) {\n\t\t\tconst value = this.textareaRef.value;\n\t\t\tsetState(this, '_currentLength', value.length);\n\t\t\tthis._value = value;\n\t\t\tif (this.state._adjustHeight) {\n\t\t\t\tthis._rows = increaseTextareaHeight(this.textareaRef);\n\t\t\t}\n\t\t\tthis.controller.onFacade.onInput(event);\n\t\t}\n\t};\n}\n"],"version":3}
@@ -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-91489a9f.js";import{t as translate}from"./i18n-5fe08f1c.js";import{n as nonce}from"./dev.utils-b9e6a3e1.js";import{i as KolButtonTag}from"./component-names-a18a51c8.js";import{_ as __rest}from"./tslib.es6-1173d062.js";import{c as clsx}from"./clsx-09a06a12.js";import{K as KolAlertFc}from"./Alert-080adf2e.js";import"./i18n-7ea9f137.js";import"./reuse-32931294.js";import"./dev.utils-fab45cbc.js";import"./Heading-0459992b.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)))},KolToastItemFc=ToastItemFc,defaultStyleCss="/*\n * This file contains all rules for accessibility.\n */\n@layer kol-global {\n :host {\n /*\n * Minimum size of interactive elements.\n */\n --a11y-min-size: calc(44rem / var(--kolibri-root-font-size, 16));\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 color: black;\n /*\n * Verdana is an accessible font that can be used without requiring additional loading time.\n */\n font-family: Verdana;\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 * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\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 * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n /*\n * All interactive elements should have a minimum size of 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 min-height: var(--a11y-min-size);\n min-width: 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}\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 clip: rect(0 0 0 0);\n clip-path: inset(50%);\n height: calc(1rem / var(--kolibri-root-font-size, 16));\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: calc(1rem / var(--kolibri-root-font-size, 16));\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 border: none;\n margin: 0;\n padding: 0;\n width: 100%; /* 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}\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 }\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 cursor: not-allowed;\n opacity: 0.5;\n outline: none;\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 :host {\n font-size: calc(16rem / var(--kolibri-root-font-size, 16));\n }\n .kol-tooltip {\n display: contents;\n }\n .kol-tooltip__floating {\n animation-duration: 0.5s;\n animation-iteration-count: 1;\n animation-name: fadeInOpacity;\n animation-timing-function: ease-in;\n box-sizing: border-box;\n display: none;\n position: fixed;\n visibility: hidden;\n /* Avoid layout interference - see https://floating-ui.com/docs/computePosition */\n top: 0;\n left: 0;\n max-width: 90vw;\n max-height: 90vh;\n /* Can be used to specify the tooltip-width from the outside. Unset by default. */\n width: var(--kol-tooltip-width);\n }\n .kol-tooltip__arrow {\n background-color: #fff;\n color: #000;\n height: calc(10rem / var(--kolibri-root-font-size, 16));\n position: absolute;\n transform: rotate(45deg);\n width: calc(10rem / var(--kolibri-root-font-size, 16));\n z-index: 999;\n }\n .kol-tooltip__content {\n background-color: #fff;\n color: #000;\n position: relative;\n z-index: 1000;\n }\n @keyframes fadeInOpacity {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n}\n@layer kol-component {\n .kol-alert {\n display: grid;\n }\n .kol-alert__container {\n place-items: center;\n display: flex;\n }\n .kol-alert__container-content {\n flex-grow: 1;\n }\n .kol-alert__close-button {\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 flex-direction: column;\n font-size: calc(16rem / var(--kolibri-root-font-size, 16));\n position: fixed;\n z-index: 200;\n }\n .kol-toast-container__close-all {\n align-self: flex-end;\n }\n}",KolToastContainerDefaultStyle0=defaultStyleCss,TRANSITION_TIMEOUT=300,KolToastContainer=class{constructor(t){registerInstance(this,t),this.knownRenderFunctions=new Set,this.state={_toastStates:[]}}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((()=>{this.state=Object.assign(Object.assign({},this.state),{_toastStates:this.state._toastStates.filter((n=>n.id!==t.id))})}),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))))})}),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:"4446bc4544f05d74ee8afd3757d8c0b7ce58d6c4",class:"kol-toast-container"},this.state._toastStates.length>1&&h(KolButtonTag,{key:"923a3ae7f4463e710bebbe94ffb7d55812510f70",_label:translate("kol-toast-close-all"),class:"kol-toast-container__button-close-all",_on:{onClick:()=>{this.closeAll()}}}),this.state._toastStates.map((t=>h(KolToastItemFc,{key:t.id,onClose:()=>this.handleClose(t),ref:n=>this.handleToastRef(t,n),toast:t.toast,status:t.status}))))}};KolToastContainer.style={default:KolToastContainerDefaultStyle0};export{KolToastContainer as kol_toast_container};
4
+ import{h,r as registerInstance,H as Host}from"./index-c4d5cf81.js";import{t as translate}from"./i18n-35276313.js";import{n as nonce}from"./dev.utils-7a7f446c.js";import{i as KolButtonTag}from"./component-names-545d6582.js";import{_ as __rest}from"./tslib.es6-1173d062.js";import{c as clsx}from"./clsx-09a06a12.js";import{K as KolAlertFc}from"./Alert-fb4611d9.js";import"./i18n-c120df5c.js";import"./reuse-32931294.js";import"./dev.utils-fab45cbc.js";import"./Heading-e581ac05.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)))},KolToastItemFc=ToastItemFc,defaultStyleCss="/*\n * This file contains all rules for accessibility.\n */\n@layer kol-global {\n :host {\n /*\n * Minimum size of interactive elements.\n */\n --a11y-min-size: calc(44rem / var(--kolibri-root-font-size, 16));\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 color: black;\n /*\n * Verdana is an accessible font that can be used without requiring additional loading time.\n */\n font-family: Verdana;\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 * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\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 * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n /*\n * All interactive elements should have a minimum size of 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 min-height: var(--a11y-min-size);\n min-width: 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}\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 clip: rect(0 0 0 0);\n clip-path: inset(50%);\n height: calc(1rem / var(--kolibri-root-font-size, 16));\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: calc(1rem / var(--kolibri-root-font-size, 16));\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 border: none;\n margin: 0;\n padding: 0;\n width: 100%; /* 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}\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 }\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 cursor: not-allowed;\n opacity: 0.5;\n outline: none;\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 :host {\n font-size: calc(16rem / var(--kolibri-root-font-size, 16));\n }\n .kol-tooltip {\n display: contents;\n }\n .kol-tooltip__floating {\n animation-duration: 0.25s;\n animation-iteration-count: 1;\n animation-name: fadeInOpacity;\n animation-timing-function: ease-in;\n box-sizing: border-box;\n display: none;\n position: fixed;\n visibility: hidden;\n /* Avoid layout interference - see https://floating-ui.com/docs/computePosition */\n top: 0;\n left: 0;\n max-width: 90vw;\n max-height: 90vh;\n /* Can be used to specify the tooltip-width from the outside. Unset by default. */\n width: var(--kol-tooltip-width);\n }\n .kol-tooltip__arrow {\n background-color: #fff;\n color: #000;\n height: calc(10rem / var(--kolibri-root-font-size, 16));\n position: absolute;\n transform: rotate(45deg);\n width: calc(10rem / var(--kolibri-root-font-size, 16));\n z-index: 999;\n }\n .kol-tooltip__content {\n background-color: #fff;\n color: #000;\n position: relative;\n z-index: 1000;\n }\n @keyframes fadeInOpacity {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n}\n@layer kol-component {\n .kol-alert {\n display: grid;\n }\n .kol-alert__container {\n place-items: center;\n display: flex;\n }\n .kol-alert__container-content {\n flex-grow: 1;\n }\n .kol-alert__close-button {\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 flex-direction: column;\n font-size: calc(16rem / var(--kolibri-root-font-size, 16));\n position: fixed;\n z-index: 200;\n }\n .kol-toast-container__close-all {\n align-self: flex-end;\n }\n}",KolToastContainerDefaultStyle0=defaultStyleCss,TRANSITION_TIMEOUT=300,KolToastContainer=class{constructor(t){registerInstance(this,t),this.knownRenderFunctions=new Set,this.state={_toastStates:[]}}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((()=>{this.state=Object.assign(Object.assign({},this.state),{_toastStates:this.state._toastStates.filter((n=>n.id!==t.id))})}),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))))})}),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:"3da212ef32465c5dedc95c8e05e15fa7240d9842",class:"kol-toast-container"},this.state._toastStates.length>1&&h(KolButtonTag,{key:"39a14c88696b2a635d61a4ab35bf1042a5e97389",_label:translate("kol-toast-close-all"),class:"kol-toast-container__button-close-all",_on:{onClick:()=>{this.closeAll()}}}),this.state._toastStates.map((t=>h(KolToastItemFc,{key:t.id,onClose:()=>this.handleClose(t),ref:n=>this.handleToastRef(t,n),toast:t.toast,status:t.status}))))}};KolToastContainer.style={default:KolToastContainerDefaultStyle0};export{KolToastContainer as kol_toast_container};
@@ -1 +1 @@
1
- {"file":"kol-toast-container.entry.js","mappings":";;;;;;;;;;;;;;;AAaA,MAAM,WAAW,GAAuB,CAAC,EAAoC;QAApC,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,OAAY,EAAP,KAAK,cAAlC,8BAAoC,CAAF;IAC1E,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAEpD,QACC,WAAK,KAAK,EAAE,IAAI,CAAC,gBAAgB,EAAE,mBAAmB,MAAM,EAAE,CAAC;QAC9D,EAAC,UAAU,IACV,KAAK,EAAC,uBAAuB,EAC7B,KAAK,EAAE,IAAI,EACX,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,CAAC,EACR,SAAS,EAAE,IA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,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE;YACxH,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YACvD,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,MAAM,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;SAChF;KACD;IAEM,MAAM;QACZ,QACC,EAAC,IAAI,qDAAC,KAAK,EAAC,qBAAqB,IAC/B,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,KAClC,EAAC,YAAY,qDACZ,MAAM,EAAE,SAAS,CAAC,qBAAqB,CAAC,EACxC,KAAK,EAAC,uCAAuC,EAC7C,GAAG,EAAE;gBACJ,OAAO,EAAE;oBACR,KAAK,IAAI,CAAC,QAAQ,EAAE,CAAC;iBACrB;aACD,GACc,CAChB,EACA,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,UAAU,MACvC,EAAC,cAAc,IACd,GAAG,EAAE,UAAU,CAAC,EAAE,EAClB,OAAO,EAAE,MAAM,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,EAC3C,GAAG,EAAE,CAAC,OAAwB,KAAK,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,OAAO,CAAC,EAC3E,KAAK,EAAE,UAAU,CAAC,KAAK,EACvB,MAAM,EAAE,UAAU,CAAC,MAAM,GACxB,CACF,CAAC,CACI,EACN;KACF;;;;;;;;","names":[],"sources":["src/functional-components/ToastItem/ToastItem.tsx","src/components/toaster/style.scss?tag=kol-toast-container&mode=default&encapsulation=shadow","src/components/toaster/shadow.tsx"],"sourcesContent":["import { h, type FunctionalComponent as FC } from '@stencil/core';\nimport type { JSXBase } from '@stencil/core/internal';\nimport { type Toast } from '../../schema';\n\nimport KolAlertFc from '../Alert';\nimport clsx from 'clsx';\n\ntype ToastItemProps = JSXBase.HTMLAttributes<HTMLDivElement> & {\n\tstatus: 'adding' | 'settled' | 'removing';\n\ttoast: Toast;\n\tonClose: () => void;\n};\n\nconst ToastItemFc: FC<ToastItemProps> = ({ status, toast, onClose, ...other }) => {\n\tconst { type, label, description, variant } = toast;\n\n\treturn (\n\t\t<div class={clsx('kol-toast-item', `kol-toast-item--${status}`)}>\n\t\t\t<KolAlertFc\n\t\t\t\tclass=\"kol-toast-item__alert\"\n\t\t\t\talert={true}\n\t\t\t\tlabel={label}\n\t\t\t\tlevel={0}\n\t\t\t\thasCloser={true}\n\t\t\t\ttype={type}\n\t\t\t\tvariant={variant || 'card'}\n\t\t\t\tonCloserClick={onClose}\n\t\t\t>\n\t\t\t\t<div {...other}>{description}</div>\n\t\t\t</KolAlertFc>\n\t\t</div>\n\t);\n};\n\nexport default ToastItemFc;\n","@import '../../styles/global';\n@import '../../styles/kol-alert-mixin';\n@import '../@shared/mixins';\n\n@include kol-alert;\n\n@layer kol-component {\n\t:host {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tfont-size: rem(16);\n\t\tposition: fixed;\n\t\tz-index: 200;\n\t}\n\n\t.kol-toast-container {\n\t\t&__close-all {\n\t\t\talign-self: flex-end;\n\t\t}\n\t}\n}\n","import type { JSX } from '@stencil/core';\nimport { Component, h, Host, Method, State } from '@stencil/core';\n\nimport { translate } from '../../i18n';\nimport { nonce } from '../../utils/dev.utils';\n\nimport type { Toast, ToasterAPI, ToasterStates, ToastRenderFunction, ToastState } from '../../schema';\nimport { KolButtonTag } from '../../core/component-names';\nimport { KolToastItemFc } from '../../functional-components';\n\nconst TRANSITION_TIMEOUT = 300;\n\n@Component({\n\ttag: 'kol-toast-container',\n\tstyleUrls: {\n\t\tdefault: './style.scss',\n\t},\n\tshadow: true,\n})\nexport class KolToastContainer implements ToasterAPI {\n\t@State() public state: ToasterStates = {\n\t\t_toastStates: [],\n\t};\n\n\t/* Keep track of render functions, so we call each only once. */\n\tprivate knownRenderFunctions = new Set<ToastRenderFunction>();\n\n\t// Stencil requires async function:\n\t@Method()\n\t// eslint-disable-next-line @typescript-eslint/require-await\n\tpublic async enqueue(toast: Toast) {\n\t\tconst newToastState: ToastState = {\n\t\t\ttoast,\n\t\t\tstatus: 'adding',\n\t\t\tid: `toast-${nonce()}`,\n\t\t};\n\t\tthis.state = {\n\t\t\t...this.state,\n\t\t\t_toastStates: [newToastState, ...this.state._toastStates],\n\t\t};\n\n\t\tsetTimeout(() => {\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\t_toastStates: this.state._toastStates.map((localToastState) =>\n\t\t\t\t\tlocalToastState.id === newToastState.id && localToastState.status !== 'removing'\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t...localToastState,\n\t\t\t\t\t\t\t\tstatus: 'settled',\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t: localToastState,\n\t\t\t\t),\n\t\t\t};\n\t\t}, TRANSITION_TIMEOUT);\n\n\t\treturn () => {\n\t\t\tthis.handleClose(newToastState);\n\t\t};\n\t}\n\n\tprivate handleClose(toastState: ToastState) {\n\t\tthis.state = {\n\t\t\t...this.state,\n\t\t\t_toastStates: this.state._toastStates.map((localToastState) => {\n\t\t\t\tif (localToastState.id === toastState.id) {\n\t\t\t\t\tlocalToastState.status = 'removing';\n\t\t\t\t}\n\t\t\t\treturn localToastState;\n\t\t\t}),\n\t\t};\n\n\t\tsetTimeout(() => {\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\t_toastStates: this.state._toastStates.filter((localToastState) => localToastState.id !== toastState.id),\n\t\t\t};\n\t\t}, TRANSITION_TIMEOUT);\n\t}\n\n\t@Method()\n\t// eslint-disable-next-line @typescript-eslint/require-await\n\tpublic async closeAll(immediate: boolean = false) {\n\t\tif (immediate) {\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\t_toastStates: [],\n\t\t\t};\n\t\t} else {\n\t\t\tconst toastsToClose = [...this.state._toastStates]; // Create a snapshot of the open toasts at the time closeAll has been called\n\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\t_toastStates: toastsToClose.map((localToastState) => ({\n\t\t\t\t\t...localToastState,\n\t\t\t\t\tstatus: 'removing',\n\t\t\t\t})),\n\t\t\t};\n\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.state = {\n\t\t\t\t\t...this.state,\n\t\t\t\t\t_toastStates: this.state._toastStates.filter((toastState) => toastsToClose.every((toastToClose) => toastToClose.id !== toastState.id)),\n\t\t\t\t};\n\t\t\t}, TRANSITION_TIMEOUT);\n\t\t}\n\t}\n\n\tprivate handleToastRef(toastState: ToastState, element?: HTMLDivElement) {\n\t\tif (element && typeof toastState.toast.render === 'function' && !this.knownRenderFunctions.has(toastState.toast.render)) {\n\t\t\tthis.knownRenderFunctions.add(toastState.toast.render);\n\t\t\ttoastState.toast.render(element, { close: () => this.handleClose(toastState) });\n\t\t}\n\t}\n\n\tpublic render(): JSX.Element {\n\t\treturn (\n\t\t\t<Host class=\"kol-toast-container\">\n\t\t\t\t{this.state._toastStates.length > 1 && (\n\t\t\t\t\t<KolButtonTag\n\t\t\t\t\t\t_label={translate('kol-toast-close-all')}\n\t\t\t\t\t\tclass=\"kol-toast-container__button-close-all\"\n\t\t\t\t\t\t_on={{\n\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\tvoid this.closeAll();\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}}\n\t\t\t\t\t></KolButtonTag>\n\t\t\t\t)}\n\t\t\t\t{this.state._toastStates.map((toastState) => (\n\t\t\t\t\t<KolToastItemFc\n\t\t\t\t\t\tkey={toastState.id}\n\t\t\t\t\t\tonClose={() => this.handleClose(toastState)}\n\t\t\t\t\t\tref={(element?: HTMLDivElement) => this.handleToastRef(toastState, element)}\n\t\t\t\t\t\ttoast={toastState.toast}\n\t\t\t\t\t\tstatus={toastState.status}\n\t\t\t\t\t/>\n\t\t\t\t))}\n\t\t\t</Host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ClB,OAAO,EAAE,MAAM,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,EAC3C,GAAG,EAAE,CAAC,OAAwB,KAAK,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,OAAO,CAAC,EAC3E,KAAK,EAAE,UAAU,CAAC,KAAK,EACvB,MAAM,EAAE,UAAU,CAAC,MAAM,GACxB,CACF,CAAC,CACI,EACN;KACF;;;;;;;;","names":[],"sources":["src/functional-components/ToastItem/ToastItem.tsx","src/components/toaster/style.scss?tag=kol-toast-container&mode=default&encapsulation=shadow","src/components/toaster/shadow.tsx"],"sourcesContent":["import { h, type FunctionalComponent as FC } from '@stencil/core';\nimport type { JSXBase } from '@stencil/core/internal';\nimport { type Toast } from '../../schema';\n\nimport KolAlertFc from '../Alert';\nimport clsx from 'clsx';\n\ntype ToastItemProps = JSXBase.HTMLAttributes<HTMLDivElement> & {\n\tstatus: 'adding' | 'settled' | 'removing';\n\ttoast: Toast;\n\tonClose: () => void;\n};\n\nconst ToastItemFc: FC<ToastItemProps> = ({ status, toast, onClose, ...other }) => {\n\tconst { type, label, description, variant } = toast;\n\n\treturn (\n\t\t<div class={clsx('kol-toast-item', `kol-toast-item--${status}`)}>\n\t\t\t<KolAlertFc\n\t\t\t\tclass=\"kol-toast-item__alert\"\n\t\t\t\talert={true}\n\t\t\t\tlabel={label}\n\t\t\t\tlevel={0}\n\t\t\t\thasCloser={true}\n\t\t\t\ttype={type}\n\t\t\t\tvariant={variant || 'card'}\n\t\t\t\tonCloserClick={onClose}\n\t\t\t>\n\t\t\t\t<div {...other}>{description}</div>\n\t\t\t</KolAlertFc>\n\t\t</div>\n\t);\n};\n\nexport default ToastItemFc;\n","@use '../../styles/global' as *;\n@use '../../styles/kol-alert-mixin' as *;\n@use '../@shared/mixins' as *;\n\n@include kol-alert;\n\n@layer kol-component {\n\t:host {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tfont-size: rem(16);\n\t\tposition: fixed;\n\t\tz-index: 200;\n\t}\n\n\t.kol-toast-container {\n\t\t&__close-all {\n\t\t\talign-self: flex-end;\n\t\t}\n\t}\n}\n","import type { JSX } from '@stencil/core';\nimport { Component, h, Host, Method, State } from '@stencil/core';\n\nimport { translate } from '../../i18n';\nimport { nonce } from '../../utils/dev.utils';\n\nimport type { Toast, ToasterAPI, ToasterStates, ToastRenderFunction, ToastState } from '../../schema';\nimport { KolButtonTag } from '../../core/component-names';\nimport { KolToastItemFc } from '../../functional-components';\n\nconst TRANSITION_TIMEOUT = 300;\n\n@Component({\n\ttag: 'kol-toast-container',\n\tstyleUrls: {\n\t\tdefault: './style.scss',\n\t},\n\tshadow: true,\n})\nexport class KolToastContainer implements ToasterAPI {\n\t@State() public state: ToasterStates = {\n\t\t_toastStates: [],\n\t};\n\n\t/* Keep track of render functions, so we call each only once. */\n\tprivate knownRenderFunctions = new Set<ToastRenderFunction>();\n\n\t// Stencil requires async function:\n\t@Method()\n\t// eslint-disable-next-line @typescript-eslint/require-await\n\tpublic async enqueue(toast: Toast) {\n\t\tconst newToastState: ToastState = {\n\t\t\ttoast,\n\t\t\tstatus: 'adding',\n\t\t\tid: `toast-${nonce()}`,\n\t\t};\n\t\tthis.state = {\n\t\t\t...this.state,\n\t\t\t_toastStates: [newToastState, ...this.state._toastStates],\n\t\t};\n\n\t\tsetTimeout(() => {\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\t_toastStates: this.state._toastStates.map((localToastState) =>\n\t\t\t\t\tlocalToastState.id === newToastState.id && localToastState.status !== 'removing'\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t...localToastState,\n\t\t\t\t\t\t\t\tstatus: 'settled',\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t: localToastState,\n\t\t\t\t),\n\t\t\t};\n\t\t}, TRANSITION_TIMEOUT);\n\n\t\treturn () => {\n\t\t\tthis.handleClose(newToastState);\n\t\t};\n\t}\n\n\tprivate handleClose(toastState: ToastState) {\n\t\tthis.state = {\n\t\t\t...this.state,\n\t\t\t_toastStates: this.state._toastStates.map((localToastState) => {\n\t\t\t\tif (localToastState.id === toastState.id) {\n\t\t\t\t\tlocalToastState.status = 'removing';\n\t\t\t\t}\n\t\t\t\treturn localToastState;\n\t\t\t}),\n\t\t};\n\n\t\tsetTimeout(() => {\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\t_toastStates: this.state._toastStates.filter((localToastState) => localToastState.id !== toastState.id),\n\t\t\t};\n\t\t}, TRANSITION_TIMEOUT);\n\t}\n\n\t@Method()\n\t// eslint-disable-next-line @typescript-eslint/require-await\n\tpublic async closeAll(immediate: boolean = false) {\n\t\tif (immediate) {\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\t_toastStates: [],\n\t\t\t};\n\t\t} else {\n\t\t\tconst toastsToClose = [...this.state._toastStates]; // Create a snapshot of the open toasts at the time closeAll has been called\n\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\t_toastStates: toastsToClose.map((localToastState) => ({\n\t\t\t\t\t...localToastState,\n\t\t\t\t\tstatus: 'removing',\n\t\t\t\t})),\n\t\t\t};\n\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.state = {\n\t\t\t\t\t...this.state,\n\t\t\t\t\t_toastStates: this.state._toastStates.filter((toastState) => toastsToClose.every((toastToClose) => toastToClose.id !== toastState.id)),\n\t\t\t\t};\n\t\t\t}, TRANSITION_TIMEOUT);\n\t\t}\n\t}\n\n\tprivate handleToastRef(toastState: ToastState, element?: HTMLDivElement) {\n\t\tif (element && typeof toastState.toast.render === 'function' && !this.knownRenderFunctions.has(toastState.toast.render)) {\n\t\t\tthis.knownRenderFunctions.add(toastState.toast.render);\n\t\t\ttoastState.toast.render(element, { close: () => this.handleClose(toastState) });\n\t\t}\n\t}\n\n\tpublic render(): JSX.Element {\n\t\treturn (\n\t\t\t<Host class=\"kol-toast-container\">\n\t\t\t\t{this.state._toastStates.length > 1 && (\n\t\t\t\t\t<KolButtonTag\n\t\t\t\t\t\t_label={translate('kol-toast-close-all')}\n\t\t\t\t\t\tclass=\"kol-toast-container__button-close-all\"\n\t\t\t\t\t\t_on={{\n\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\tvoid this.closeAll();\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}}\n\t\t\t\t\t></KolButtonTag>\n\t\t\t\t)}\n\t\t\t\t{this.state._toastStates.map((toastState) => (\n\t\t\t\t\t<KolToastItemFc\n\t\t\t\t\t\tkey={toastState.id}\n\t\t\t\t\t\tonClose={() => this.handleClose(toastState)}\n\t\t\t\t\t\tref={(element?: HTMLDivElement) => this.handleToastRef(toastState, element)}\n\t\t\t\t\t\ttoast={toastState.toast}\n\t\t\t\t\t\tstatus={toastState.status}\n\t\t\t\t\t/>\n\t\t\t\t))}\n\t\t\t</Host>\n\t\t);\n\t}\n}\n"],"version":3}
@@ -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-91489a9f.js";import{e as KolLinkTag,i as KolButtonTag}from"./component-names-a18a51c8.js";import{t as emptyStringByArrayHandler,o as objectObjectHandler,p as parseJson,s as setState}from"./prop.validators-9feb1d92.js";import{v as validateLabel}from"./label-d0315384.js";import"./index-da3e0c00.js";import"./dev.utils-fab45cbc.js";const validateToolbarItems=(e,n)=>{emptyStringByArrayHandler(n,(()=>{objectObjectHandler(n,(()=>{void 0===n&&(n=[]);try{n=parseJson(n)}catch(e){}Array.isArray(n)&&n.every((e=>"object"==typeof e&&null!==e))&&setState(e,"_items",n)}))}))},defaultStyleCss="/*\n * This file contains all rules for accessibility.\n */\n@layer kol-global {\n :host {\n /*\n * Minimum size of interactive elements.\n */\n --a11y-min-size: calc(44rem / var(--kolibri-root-font-size, 16));\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 color: black;\n /*\n * Verdana is an accessible font that can be used without requiring additional loading time.\n */\n font-family: Verdana;\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 * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\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 * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n /*\n * All interactive elements should have a minimum size of 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 min-height: var(--a11y-min-size);\n min-width: 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}\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 clip: rect(0 0 0 0);\n clip-path: inset(50%);\n height: calc(1rem / var(--kolibri-root-font-size, 16));\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: calc(1rem / var(--kolibri-root-font-size, 16));\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 border: none;\n margin: 0;\n padding: 0;\n width: 100%; /* 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}\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 }\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 cursor: not-allowed;\n opacity: 0.5;\n outline: none;\n }\n [aria-disabled=true]:focus .kol-span,\n [disabled]:focus .kol-span {\n outline: none !important;\n }\n}\n@layer kol-component {\n .kol-toolbar {\n font-size: calc(16rem / var(--kolibri-root-font-size, 16));\n display: flex;\n align-items: center;\n gap: calc(16rem / var(--kolibri-root-font-size, 16));\n flex-wrap: wrap;\n }\n .kol-toolbar:focus-within {\n outline: calc(1rem / var(--kolibri-root-font-size, 16)) solid;\n outline-offset: calc(2rem / var(--kolibri-root-font-size, 16));\n }\n}",KolToolbarDefaultStyle0=defaultStyleCss,KolToolbar=class{constructor(e){registerInstance(this,e),this.indexToElement=new Map,this.renderItem=(e,n)=>{const t=n!==this.currentIndex||(null==e?void 0:e._disabled)?-1:0,o={key:n,class:"kol-toolbar__item",_tabIndex:t},i=e=>{e&&this.indexToElement.set(n,e)};return h("_href"in e?KolLinkTag:KolButtonTag,Object.assign({},e,o,{ref:i}))},this.state={_label:"",_items:[]},this.currentIndex=0,this._label=void 0,this._items=void 0}render(){return h("div",{key:"303cfe01af1a3776d1a3161bfd6253449c4101c1",class:"kol-toolbar",role:"toolbar","aria-label":this.state._label},this.state._items.map(this.renderItem))}validateLabel(e){validateLabel(this,e)}validateItems(e){validateToolbarItems(this,e)}getCurrentToolbarItem(e){return"number"==typeof e?this.indexToElement.get(e):void 0}setFirstEnabledItemIndex(){var e;this.currentIndex=null===(e=this.state._items)||void 0===e?void 0:e.findIndex((e=>!e._disabled))}handleKeyDown(e){var n,t;if(!("ArrowRight"===e.code||"ArrowLeft"===e.code))return;e.preventDefault();const o=(null===(n=this._items)||void 0===n?void 0:n.length)-1,i=this.currentIndex;let a=0;switch(e.code){case"ArrowLeft":a=i!==a?i-1:o;break;case"ArrowRight":o!==i&&(a=i+1)}i!==a&&(this.currentIndex=a,null===(t=this.getCurrentToolbarItem(a))||void 0===t||t.kolFocus())}handleBlur(e){e.target===this.host&&this.setFirstEnabledItemIndex()}componentWillLoad(){this.validateLabel(this._label),this.validateItems(this._items),this.setFirstEnabledItemIndex()}get host(){return getElement(this)}static get watchers(){return{_label:["validateLabel"],_items:["validateItems"]}}};KolToolbar.style={default:KolToolbarDefaultStyle0};export{KolToolbar as kol_toolbar};
4
+ import{r as registerInstance,h,g as getElement}from"./index-c4d5cf81.js";import{e as KolLinkTag,i as KolButtonTag}from"./component-names-545d6582.js";import{t as emptyStringByArrayHandler,o as objectObjectHandler,p as parseJson,s as setState}from"./prop.validators-9feb1d92.js";import{v as validateLabel}from"./label-d0315384.js";import"./index-da3e0c00.js";import"./dev.utils-fab45cbc.js";const validateToolbarItems=(e,n)=>{emptyStringByArrayHandler(n,(()=>{objectObjectHandler(n,(()=>{void 0===n&&(n=[]);try{n=parseJson(n)}catch(e){}Array.isArray(n)&&n.every((e=>"object"==typeof e&&null!==e))&&setState(e,"_items",n)}))}))},defaultStyleCss="/*\n * This file contains all rules for accessibility.\n */\n@layer kol-global {\n :host {\n /*\n * Minimum size of interactive elements.\n */\n --a11y-min-size: calc(44rem / var(--kolibri-root-font-size, 16));\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 color: black;\n /*\n * Verdana is an accessible font that can be used without requiring additional loading time.\n */\n font-family: Verdana;\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 * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\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 * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n /*\n * All interactive elements should have a minimum size of 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 min-height: var(--a11y-min-size);\n min-width: 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}\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 clip: rect(0 0 0 0);\n clip-path: inset(50%);\n height: calc(1rem / var(--kolibri-root-font-size, 16));\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: calc(1rem / var(--kolibri-root-font-size, 16));\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 border: none;\n margin: 0;\n padding: 0;\n width: 100%; /* 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}\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 }\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 cursor: not-allowed;\n opacity: 0.5;\n outline: none;\n }\n [aria-disabled=true]:focus .kol-span,\n [disabled]:focus .kol-span {\n outline: none !important;\n }\n}\n@layer kol-component {\n .kol-toolbar {\n font-size: calc(16rem / var(--kolibri-root-font-size, 16));\n display: flex;\n align-items: center;\n gap: calc(16rem / var(--kolibri-root-font-size, 16));\n flex-wrap: wrap;\n }\n .kol-toolbar:focus-within {\n outline: 1px solid;\n outline-offset: 2px;\n }\n}",KolToolbarDefaultStyle0=defaultStyleCss,KolToolbar=class{constructor(e){registerInstance(this,e),this.indexToElement=new Map,this.renderItem=(e,n)=>{const t=n!==this.currentIndex||(null==e?void 0:e._disabled)?-1:0,i={key:n,class:"kol-toolbar__item",_tabIndex:t},o=e=>{e&&this.indexToElement.set(n,e)};return h("_href"in e?KolLinkTag:KolButtonTag,Object.assign({},e,i,{ref:o}))},this.state={_label:"",_items:[]},this.currentIndex=0,this._label=void 0,this._items=void 0}render(){return h("div",{key:"786f1f807100f84a06883023addd4e03ee9e7207",class:"kol-toolbar",role:"toolbar","aria-label":this.state._label},this.state._items.map(this.renderItem))}validateLabel(e){validateLabel(this,e)}validateItems(e){validateToolbarItems(this,e)}getCurrentToolbarItem(e){return"number"==typeof e?this.indexToElement.get(e):void 0}setFirstEnabledItemIndex(){var e;this.currentIndex=null===(e=this.state._items)||void 0===e?void 0:e.findIndex((e=>!e._disabled))}handleKeyDown(e){var n,t;if(!("ArrowRight"===e.code||"ArrowLeft"===e.code))return;e.preventDefault();const i=(null===(n=this._items)||void 0===n?void 0:n.length)-1,o=this.currentIndex;let a=0;switch(e.code){case"ArrowLeft":a=o!==a?o-1:i;break;case"ArrowRight":i!==o&&(a=o+1)}o!==a&&(this.currentIndex=a,null===(t=this.getCurrentToolbarItem(a))||void 0===t||t.kolFocus())}handleBlur(e){e.target===this.host&&this.setFirstEnabledItemIndex()}componentWillLoad(){this.validateLabel(this._label),this.validateItems(this._items),this.setFirstEnabledItemIndex()}get host(){return getElement(this)}static get watchers(){return{_label:["validateLabel"],_items:["validateItems"]}}};KolToolbar.style={default:KolToolbarDefaultStyle0};export{KolToolbar as kol_toolbar};
@@ -1 +1 @@
1
- {"file":"kol-toolbar.entry.js","mappings":";;;;;;;;;;AAiBO,MAAM,oBAAoB,GAAG,CAAC,SAAoC,EAAE,KAA4B;IACtG,yBAAyB,CAAC,KAAK,EAAE;QAChC,mBAAmB,CAAC,KAAK,EAAE;YAC1B,IAAI,OAAO,KAAK,KAAK,WAAW,EAAE;gBACjC,KAAK,GAAG,EAAE,CAAC;aACX;YACD,IAAI;gBACH,KAAK,GAAG,SAAS,CAAwB,KAAK,CAAC,CAAC;aAEhD;YAAC,OAAO,CAAC,EAAE;aAEX;YACD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,KAA0B,KAAK,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC,EAAE;gBACrH,QAAQ,CAAC,SAAS,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;aACrC;SACD,CAAC,CAAC;KACH,CAAC,CAAC;AACJ,CAAC;;AClCD,MAAM,eAAe,GAAG,s9IAAs9I,CAAC;AAC/+I,gCAAe,eAAe;;MCajB,UAAU;;;QAUd,mBAAc,GAAG,IAAI,GAAG,EAAqD,CAAC;QAE9E,eAAU,GAAG,CAAC,OAA4B,EAAE,KAAa;YAChE,MAAM,QAAQ,GAAG,KAAK,KAAK,IAAI,CAAC,YAAY,IAAI,EAAC,OAA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=kol-toolbar&mode=default&encapsulation=shadow","src/components/toolbar/shadow.tsx"],"sourcesContent":["import type { Generic } from 'adopted-style-sheets';\n\nimport { emptyStringByArrayHandler, objectObjectHandler, parseJson, setState } from '../utils';\nimport type { ButtonProps, LinkProps } from '../../schema';\n\n/* types */\nexport type ToolbarItemPropType = ButtonProps | LinkProps;\nexport type ToolbarItemsPropType = ToolbarItemPropType[];\n\n/**\n * Defines the primary toolbar items.\n */\nexport type PropToolbarItems = {\n\titems: ToolbarItemsPropType;\n};\n\n/* validator */\nexport const validateToolbarItems = (component: Generic.Element.Component, value?: ToolbarItemsPropType): void => {\n\temptyStringByArrayHandler(value, () => {\n\t\tobjectObjectHandler(value, () => {\n\t\t\tif (typeof value === 'undefined') {\n\t\t\t\tvalue = [];\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tvalue = parseJson<ToolbarItemPropType[]>(value);\n\t\t\t\t// eslint-disable-next-line no-empty\n\t\t\t} catch (e) {\n\t\t\t\t// value keeps the original items\n\t\t\t}\n\t\t\tif (Array.isArray(value) && value.every((items: ToolbarItemPropType) => typeof items === 'object' && items !== null)) {\n\t\t\t\tsetState(component, '_items', value);\n\t\t\t}\n\t\t});\n\t});\n};\n","@import '../@shared/mixins';\n@import '../../styles/global';\n\n@layer kol-component {\n\t.kol-toolbar {\n\t\tfont-size: rem(16);\n\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: rem(16);\n\t\tflex-wrap: wrap;\n\n\t\t&:focus-within {\n\t\t\toutline: rem(1) solid;\n\t\t\toutline-offset: rem(2);\n\t\t}\n\t}\n}\n","import type { JSX } from '@stencil/core';\nimport { Component, Element, h, Listen, Prop, State, Watch } from '@stencil/core';\n\nimport type { LabelPropType, ToolbarAPI, ToolbarStates, ToolbarItemsPropType, ToolbarItemPropType } from '../../schema';\nimport { validateLabel, validateToolbarItems } from '../../schema';\nimport { KolLinkTag, KolButtonTag } from '../../core/component-names';\n\n@Component({\n\ttag: 'kol-toolbar',\n\tstyleUrls: {\n\t\tdefault: './style.scss',\n\t},\n\tshadow: true,\n})\nexport class KolToolbar implements ToolbarAPI {\n\t@Element() host!: HTMLElement;\n\n\t@State() public state: ToolbarStates = {\n\t\t_label: '',\n\t\t_items: [],\n\t};\n\n\t@State() private currentIndex: number = 0;\n\n\tprivate indexToElement = new Map<number, HTMLKolLinkElement | HTMLKolButtonElement>();\n\n\tprivate renderItem = (element: ToolbarItemPropType, index: number): JSX.Element => {\n\t\tconst tabIndex = index === this.currentIndex && !element?._disabled ? 0 : -1;\n\t\tconst props = {\n\t\t\tkey: index,\n\t\t\tclass: 'kol-toolbar__item',\n\t\t\t_tabIndex: tabIndex,\n\t\t};\n\t\tconst catchRef = (element?: HTMLKolLinkElement | HTMLKolButtonElement) => {\n\t\t\telement && this.indexToElement.set(index, element);\n\t\t};\n\n\t\treturn '_href' in element ? (\n\t\t\t<KolLinkTag {...element} {...props} ref={catchRef}></KolLinkTag>\n\t\t) : (\n\t\t\t<KolButtonTag {...element} {...props} ref={catchRef}></KolButtonTag>\n\t\t);\n\t};\n\n\tpublic render(): JSX.Element {\n\t\treturn (\n\t\t\t<div class=\"kol-toolbar\" role=\"toolbar\" aria-label={this.state._label}>\n\t\t\t\t{this.state._items.map(this.renderItem)}\n\t\t\t</div>\n\t\t);\n\t}\n\n\t/**\n\t * Defines the visible or semantic label of the component (e.g. aria-label, label, headline, caption, summary, etc.).\n\t */\n\t@Prop() public _label!: string;\n\n\t/**\n\t * Defines the functional elements of toolbar to render (e.g. kol-link, kol-button).\n\t */\n\t@Prop() public _items!: ToolbarItemsPropType;\n\n\t@Watch('_label') validateLabel(value?: LabelPropType): void {\n\t\tvalidateLabel(this, value);\n\t}\n\n\t@Watch('_items')\n\tpublic validateItems(value?: ToolbarItemsPropType): void {\n\t\tvalidateToolbarItems(this, value);\n\t}\n\n\t/**\n\t * Retrieves the toolbar item by index if defined.\n\t * If not it use the current index of state.\n\t *\n\t * @returns An array of HTMLElements representing the toolbar items.\n\t */\n\tprivate getCurrentToolbarItem(index?: number): ChildNode | undefined {\n\t\treturn typeof index === 'number' ? this.indexToElement.get(index) : undefined;\n\t}\n\n\t/**\n\t * Sets the index of the first enabled toolbar item.\n\t */\n\tprivate setFirstEnabledItemIndex() {\n\t\tthis.currentIndex = this.state._items?.findIndex((item) => !item._disabled);\n\t}\n\n\t@Listen('keydown')\n\tpublic handleKeyDown(event: KeyboardEvent) {\n\t\tconst isArrowKey = event.code === 'ArrowRight' || event.code === 'ArrowLeft';\n\t\tif (!isArrowKey) return;\n\t\tevent.preventDefault();\n\n\t\tconst lastItemIndex = this._items?.length - 1;\n\t\tconst currentIndex = this.currentIndex;\n\t\tlet nextIndex = 0;\n\n\t\tswitch (event.code) {\n\t\t\tcase 'ArrowLeft':\n\t\t\t\tnextIndex = currentIndex !== nextIndex ? currentIndex - 1 : lastItemIndex;\n\t\t\t\tbreak;\n\t\t\tcase 'ArrowRight':\n\t\t\t\tif (lastItemIndex !== currentIndex) nextIndex = currentIndex + 1;\n\t\t\t\tbreak;\n\t\t}\n\t\tif (currentIndex === nextIndex) return;\n\n\t\tthis.currentIndex = nextIndex;\n\t\tvoid (this.getCurrentToolbarItem(nextIndex) as HTMLKolLinkElement | HTMLKolButtonElement | undefined)?.kolFocus();\n\t}\n\n\t/**\n\t * Resets the tabIndexes of the toolbar to default.\n\t */\n\t@Listen('blur', { capture: true })\n\tpublic handleBlur(event: FocusEvent) {\n\t\tif (event.target === this.host) this.setFirstEnabledItemIndex();\n\t}\n\n\tpublic componentWillLoad(): void {\n\t\tthis.validateLabel(this._label);\n\t\tthis.validateItems(this._items);\n\t\tthis.setFirstEnabledItemIndex();\n\t}\n}\n"],"version":3}
1
+ {"file":"kol-toolbar.entry.js","mappings":";;;;;;;;;;AAiBO,MAAM,oBAAoB,GAAG,CAAC,SAAoC,EAAE,KAA4B;IACtG,yBAAyB,CAAC,KAAK,EAAE;QAChC,mBAAmB,CAAC,KAAK,EAAE;YAC1B,IAAI,OAAO,KAAK,K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;YACP,KAAK,YAAY;gBAChB,IAAI,aAAa,KAAK,YAAY;oBAAE,SAAS,GAAG,YAAY,GAAG,CAAC,CAAC;gBACjE,MAAM;SACP;QACD,IAAI,YAAY,KAAK,SAAS;YAAE,OAAO;QAEvC,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC;QAC9B,MAAK,MAAC,IAAI,CAAC,qBAAqB,CAAC,SAAS,CAA2D,0CAAE,QAAQ,EAAE,CAAA,CAAC;KAClH;IAMM,UAAU,CAAC,KAAiB;QAClC,IAAI,KAAK,CAAC,MAAM,KAAK,IAAI,CAAC,IAAI;YAAE,IAAI,CAAC,wBAAwB,EAAE,CAAC;KAChE;IAEM,iBAAiB;QACvB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAChC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAChC,IAAI,CAAC,wBAAwB,EAAE,CAAC;KAChC;;;;;;;;;;;;;","names":[],"sources":["src/schema/props/toolbar-items.ts","src/components/toolbar/style.scss?tag=kol-toolbar&mode=default&encapsulation=shadow","src/components/toolbar/shadow.tsx"],"sourcesContent":["import type { Generic } from 'adopted-style-sheets';\n\nimport { emptyStringByArrayHandler, objectObjectHandler, parseJson, setState } from '../utils';\nimport type { ButtonProps, LinkProps } from '../../schema';\n\n/* types */\nexport type ToolbarItemPropType = ButtonProps | LinkProps;\nexport type ToolbarItemsPropType = ToolbarItemPropType[];\n\n/**\n * Defines the primary toolbar items.\n */\nexport type PropToolbarItems = {\n\titems: ToolbarItemsPropType;\n};\n\n/* validator */\nexport const validateToolbarItems = (component: Generic.Element.Component, value?: ToolbarItemsPropType): void => {\n\temptyStringByArrayHandler(value, () => {\n\t\tobjectObjectHandler(value, () => {\n\t\t\tif (typeof value === 'undefined') {\n\t\t\t\tvalue = [];\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tvalue = parseJson<ToolbarItemPropType[]>(value);\n\t\t\t\t// eslint-disable-next-line no-empty\n\t\t\t} catch (e) {\n\t\t\t\t// value keeps the original items\n\t\t\t}\n\t\t\tif (Array.isArray(value) && value.every((items: ToolbarItemPropType) => typeof items === 'object' && items !== null)) {\n\t\t\t\tsetState(component, '_items', value);\n\t\t\t}\n\t\t});\n\t});\n};\n","@use '../@shared/mixins' as *;\n@use '../../styles/global' as *;\n\n@layer kol-component {\n\t.kol-toolbar {\n\t\tfont-size: rem(16);\n\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: rem(16);\n\t\tflex-wrap: wrap;\n\n\t\t&:focus-within {\n\t\t\toutline: 1px solid;\n\t\t\toutline-offset: 2px;\n\t\t}\n\t}\n}\n","import type { JSX } from '@stencil/core';\nimport { Component, Element, h, Listen, Prop, State, Watch } from '@stencil/core';\n\nimport type { LabelPropType, ToolbarAPI, ToolbarStates, ToolbarItemsPropType, ToolbarItemPropType } from '../../schema';\nimport { validateLabel, validateToolbarItems } from '../../schema';\nimport { KolLinkTag, KolButtonTag } from '../../core/component-names';\n\n@Component({\n\ttag: 'kol-toolbar',\n\tstyleUrls: {\n\t\tdefault: './style.scss',\n\t},\n\tshadow: true,\n})\nexport class KolToolbar implements ToolbarAPI {\n\t@Element() host!: HTMLElement;\n\n\t@State() public state: ToolbarStates = {\n\t\t_label: '',\n\t\t_items: [],\n\t};\n\n\t@State() private currentIndex: number = 0;\n\n\tprivate indexToElement = new Map<number, HTMLKolLinkElement | HTMLKolButtonElement>();\n\n\tprivate renderItem = (element: ToolbarItemPropType, index: number): JSX.Element => {\n\t\tconst tabIndex = index === this.currentIndex && !element?._disabled ? 0 : -1;\n\t\tconst props = {\n\t\t\tkey: index,\n\t\t\tclass: 'kol-toolbar__item',\n\t\t\t_tabIndex: tabIndex,\n\t\t};\n\t\tconst catchRef = (element?: HTMLKolLinkElement | HTMLKolButtonElement) => {\n\t\t\telement && this.indexToElement.set(index, element);\n\t\t};\n\n\t\treturn '_href' in element ? (\n\t\t\t<KolLinkTag {...element} {...props} ref={catchRef}></KolLinkTag>\n\t\t) : (\n\t\t\t<KolButtonTag {...element} {...props} ref={catchRef}></KolButtonTag>\n\t\t);\n\t};\n\n\tpublic render(): JSX.Element {\n\t\treturn (\n\t\t\t<div class=\"kol-toolbar\" role=\"toolbar\" aria-label={this.state._label}>\n\t\t\t\t{this.state._items.map(this.renderItem)}\n\t\t\t</div>\n\t\t);\n\t}\n\n\t/**\n\t * Defines the visible or semantic label of the component (e.g. aria-label, label, headline, caption, summary, etc.).\n\t */\n\t@Prop() public _label!: string;\n\n\t/**\n\t * Defines the functional elements of toolbar to render (e.g. kol-link, kol-button).\n\t */\n\t@Prop() public _items!: ToolbarItemsPropType;\n\n\t@Watch('_label') validateLabel(value?: LabelPropType): void {\n\t\tvalidateLabel(this, value);\n\t}\n\n\t@Watch('_items')\n\tpublic validateItems(value?: ToolbarItemsPropType): void {\n\t\tvalidateToolbarItems(this, value);\n\t}\n\n\t/**\n\t * Retrieves the toolbar item by index if defined.\n\t * If not it use the current index of state.\n\t *\n\t * @returns An array of HTMLElements representing the toolbar items.\n\t */\n\tprivate getCurrentToolbarItem(index?: number): ChildNode | undefined {\n\t\treturn typeof index === 'number' ? this.indexToElement.get(index) : undefined;\n\t}\n\n\t/**\n\t * Sets the index of the first enabled toolbar item.\n\t */\n\tprivate setFirstEnabledItemIndex() {\n\t\tthis.currentIndex = this.state._items?.findIndex((item) => !item._disabled);\n\t}\n\n\t@Listen('keydown')\n\tpublic handleKeyDown(event: KeyboardEvent) {\n\t\tconst isArrowKey = event.code === 'ArrowRight' || event.code === 'ArrowLeft';\n\t\tif (!isArrowKey) return;\n\t\tevent.preventDefault();\n\n\t\tconst lastItemIndex = this._items?.length - 1;\n\t\tconst currentIndex = this.currentIndex;\n\t\tlet nextIndex = 0;\n\n\t\tswitch (event.code) {\n\t\t\tcase 'ArrowLeft':\n\t\t\t\tnextIndex = currentIndex !== nextIndex ? currentIndex - 1 : lastItemIndex;\n\t\t\t\tbreak;\n\t\t\tcase 'ArrowRight':\n\t\t\t\tif (lastItemIndex !== currentIndex) nextIndex = currentIndex + 1;\n\t\t\t\tbreak;\n\t\t}\n\t\tif (currentIndex === nextIndex) return;\n\n\t\tthis.currentIndex = nextIndex;\n\t\tvoid (this.getCurrentToolbarItem(nextIndex) as HTMLKolLinkElement | HTMLKolButtonElement | undefined)?.kolFocus();\n\t}\n\n\t/**\n\t * Resets the tabIndexes of the toolbar to default.\n\t */\n\t@Listen('blur', { capture: true })\n\tpublic handleBlur(event: FocusEvent) {\n\t\tif (event.target === this.host) this.setFirstEnabledItemIndex();\n\t}\n\n\tpublic componentWillLoad(): void {\n\t\tthis.validateLabel(this._label);\n\t\tthis.validateItems(this._items);\n\t\tthis.setFirstEnabledItemIndex();\n\t}\n}\n"],"version":3}
@@ -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-91489a9f.js";import{b as autoUpdate,a as alignFloatingElements}from"./align-floating-elements-db77d917.js";import{K as KolSpanFc}from"./Span-97af2595.js";import{i as watchString}from"./prop.validators-9feb1d92.js";import{g as getDocument}from"./dev.utils-fab45cbc.js";import{v as validateAlign}from"./align-4719d626.js";import{v as validateLabel}from"./label-d0315384.js";import"./reuse-32931294.js";import"./tslib.es6-1173d062.js";import"./clsx-09a06a12.js";import"./Icon-936c5cfc.js";import"./component-names-a18a51c8.js";import"./InternalUnderlinedBadgeText-22278de8.js";import"./isObject-ffcbbb76.js";import"./index-da3e0c00.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 KolTooltipWc=class{constructor(t){registerInstance(this,t),this.hasFocusIn=!1,this.hasMouseIn=!1,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.hideTooltip=()=>{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)},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.showOrHideTooltip=()=>{clearTimeout(this.overFocusTimeout),this.overFocusTimeout=setTimeout((()=>{this.hasMouseIn||this.hasFocusIn?this.showTooltip():this.hideTooltip()}),300)},this._badgeText=void 0,this._align="top",this._id=void 0,this._label=void 0,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})}handleMouseEnter(){this.hasMouseIn=!0,this.showOrHideTooltip()}handleMouseleave(){this.hasMouseIn=!1,this.showOrHideTooltip()}handleFocusIn(){this.hasFocusIn=!0,this.showOrHideTooltip()}handleFocusout(){this.hasFocusIn=!1,this.showOrHideTooltip()}render(){return h(Host,{key:"6b03bbbae8b6a083bcdb3b304e9985101a5be022",class:"kol-tooltip"},""!==this.state._label&&h("div",{key:"75fa23644f41ba3fde4e1be656ed89fe2bd5be9d",class:"kol-tooltip__floating",ref:this.catchTooltipElement},h("div",{key:"74d99d02b5d7557e4dc9c8d81880d76fbc23aa2d",class:"kol-tooltip__arrow",ref:this.catchArrowElement}),h(KolSpanFc,{key:"7a6b461ff6da4a292fabd08ab8a6bd90412a85fc",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-c4d5cf81.js";import{b as autoUpdate,a as alignFloatingElements}from"./align-floating-elements-db77d917.js";import{K as KolSpanFc}from"./Span-d5aaae43.js";import{i as watchString}from"./prop.validators-9feb1d92.js";import{g as getDocument}from"./dev.utils-fab45cbc.js";import{v as validateAlign}from"./align-4719d626.js";import{v as validateLabel}from"./label-d0315384.js";import"./reuse-32931294.js";import"./tslib.es6-1173d062.js";import"./clsx-09a06a12.js";import"./Icon-0127c9ad.js";import"./component-names-545d6582.js";import"./InternalUnderlinedBadgeText-e33ead64.js";import"./isObject-ffcbbb76.js";import"./index-da3e0c00.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 KolTooltipWc=class{constructor(t){registerInstance(this,t),this.hasFocusIn=!1,this.hasMouseIn=!1,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.hideTooltip=()=>{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)},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.showOrHideTooltip=()=>{clearTimeout(this.overFocusTimeout),this.overFocusTimeout=setTimeout((()=>{this.hasMouseIn||this.hasFocusIn?this.showTooltip():this.hideTooltip()}),300)},this._badgeText=void 0,this._align="top",this._id=void 0,this._label=void 0,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})}handleMouseEnter(){this.hasMouseIn=!0,this.showOrHideTooltip()}handleMouseleave(){this.hasMouseIn=!1,this.showOrHideTooltip()}handleFocusIn(){this.hasFocusIn=!0,this.showOrHideTooltip()}handleFocusout(){this.hasFocusIn=!1,this.showOrHideTooltip()}render(){return h(Host,{key:"ca7a0e84c0bcf91c4ddd70293ef69be64c6c9bb2",class:"kol-tooltip"},""!==this.state._label&&h("div",{key:"57033c3355b84f3adf83e1dd96ce67ba43fb497e",class:"kol-tooltip__floating",ref:this.catchTooltipElement},h("div",{key:"c4f076e0bb5194b9d4f143a92c8bf7a6fe2c60f2",class:"kol-tooltip__arrow",ref:this.catchArrowElement}),h(KolSpanFc,{key:"492b1c85bceb336e5a3c6bab5878d9f9673c068c",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-91489a9f.js";import{f as KolLinkWcTag,d as KolIconTag,q as KolTreeTag}from"./component-names-a18a51c8.js";import{n as nonce}from"./dev.utils-b9e6a3e1.js";import{c as clsx}from"./clsx-09a06a12.js";import{b as watchBoolean}from"./prop.validators-9feb1d92.js";import{v as validateLabel}from"./label-d0315384.js";import{v as validateOpen}from"./open-20d08415.js";import{v as validateHref}from"./href-d8ec67f8.js";import"./reuse-32931294.js";import"./dev.utils-fab45cbc.js";import"./index-da3e0c00.js";const validateActive=(e,t,a)=>{watchBoolean(e,"_active",t,a)},KolTreeItemWc=class{constructor(e){registerInstance(this,e),this.groupId=`tree-group-${nonce()}`,this.level=void 0,this.state={_active:!1,_hasChildren:!1,_href:"",_label:"",_open:!1},this._active=void 0,this._label=void 0,this._open=void 0,this._href=void 0}render(){const{_href:e,_active:t,_hasChildren:a,_open:i,_label:s}=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:"f037767f3e0142ec622d5e3dc03f303b30831abf",slot:"expert"},a&&h("span",{key:"a344ded5e01b484b686aeb71b4370fe37f3fd8b1",class:"kol-tree-item__toggle-button",onClick:e=>i?void this.handleCollapseClick(e):void this.handleExpandClick(e)},h(KolIconTag,{key:"d84793747ce43c28fca27abde4c76f4a5feb060b",class:"kol-tree-item__toggle-button-icon",_icons:"codicon codicon-"+(i?"chevron-down":"chevron-right"),_label:""}))," ",s)),h("ul",{key:"828ff0900dc3f9018e939ef0d519cdcabbab652b",class:"kol-tree-item__children",hidden:!a||!i,role:"group",id:this.groupId},h("slot",{key:"7fd8f3b71eb060d42835e3d1b311ab4bb7930f99"}))))}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-c4d5cf81.js";import{f as KolLinkWcTag,d as KolIconTag,q as KolTreeTag}from"./component-names-545d6582.js";import{n as nonce}from"./dev.utils-7a7f446c.js";import{c as clsx}from"./clsx-09a06a12.js";import{b as watchBoolean}from"./prop.validators-9feb1d92.js";import{v as validateLabel}from"./label-d0315384.js";import{v as validateOpen}from"./open-20d08415.js";import{v as validateHref}from"./href-d8ec67f8.js";import"./reuse-32931294.js";import"./dev.utils-fab45cbc.js";import"./index-da3e0c00.js";const validateActive=(e,t,a)=>{watchBoolean(e,"_active",t,a)},KolTreeItemWc=class{constructor(e){registerInstance(this,e),this.groupId=`tree-group-${nonce()}`,this.level=void 0,this.state={_active:!1,_hasChildren:!1,_href:"",_label:"",_open:!1},this._active=void 0,this._label=void 0,this._open=void 0,this._href=void 0}render(){const{_href:e,_active:t,_hasChildren:a,_open:i,_label:s}=this.state;return h(Host,{key:"47a111738019f7354b1d36837c222e02ab10137d",onSlotchange:this.handleSlotchange.bind(this)},h("li",{key:"398ec1c8b14a475e1db8793d834e1a1f5ab7f8a8",class:"kol-tree-item",style:{"--level":`${this.level}`}},h(KolLinkWcTag,{key:"e2c6837d17f2a3de1791b5a3db0c203c82cd8314",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:"24635791abb2d66842a1ad927e55c96474a799aa",slot:"expert"},a&&h("span",{key:"bce52e076282063863c3be6c4fa35438826d0a65",class:"kol-tree-item__toggle-button",onClick:e=>i?void this.handleCollapseClick(e):void this.handleExpandClick(e)},h(KolIconTag,{key:"0ec6b6e5ca49b358e42d8e9a32e0f577ff052f1c",class:"kol-tree-item__toggle-button-icon",_icons:"codicon codicon-"+(i?"chevron-down":"chevron-right"),_label:""}))," ",s)),h("ul",{key:"c1b26bffcea443aa6aef777883951bb3bd7cdee0",class:"kol-tree-item__children",hidden:!a||!i,role:"group",id:this.groupId},h("slot",{key:"0905f77b0b3f8a596a12a36044444622c66106ef"}))))}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};
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * KoliBri - The accessible HTML-Standard
3
3
  */
4
- import{r as registerInstance,h}from"./index-91489a9f.js";import{o as KolTreeItemWcTag}from"./component-names-a18a51c8.js";const defaultStyleCss="/*\n * This file contains all rules for accessibility.\n */\n@layer kol-global {\n :host {\n /*\n * Minimum size of interactive elements.\n */\n --a11y-min-size: calc(44rem / var(--kolibri-root-font-size, 16));\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 color: black;\n /*\n * Verdana is an accessible font that can be used without requiring additional loading time.\n */\n font-family: Verdana;\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 * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\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 * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n /*\n * All interactive elements should have a minimum size of 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 min-height: var(--a11y-min-size);\n min-width: 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}\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 clip: rect(0 0 0 0);\n clip-path: inset(50%);\n height: calc(1rem / var(--kolibri-root-font-size, 16));\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: calc(1rem / var(--kolibri-root-font-size, 16));\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 border: none;\n margin: 0;\n padding: 0;\n width: 100%; /* 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}\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 }\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 cursor: not-allowed;\n opacity: 0.5;\n outline: none;\n }\n [aria-disabled=true]:focus .kol-span,\n [disabled]:focus .kol-span {\n outline: none !important;\n }\n}\n@layer kol-component {\n .kol-tree-item {\n font-size: calc(16rem / var(--kolibri-root-font-size, 16));\n }\n .kol-tree-item__link .kol-link {\n padding-right: calc(6rem / var(--kolibri-root-font-size, 16));\n padding-left: calc((22.4rem / var(--kolibri-root-font-size, 16)) * var(--level));\n padding-top: calc(6.4rem / var(--kolibri-root-font-size, 16));\n padding-bottom: calc(6.4rem / var(--kolibri-root-font-size, 16));\n }\n .kol-tree-item__link--first-level .kol-link {\n padding-left: calc(6rem / var(--kolibri-root-font-size, 16));\n }\n .kol-tree-item__children {\n margin: 0;\n padding: 0;\n list-style: none;\n }\n .kol-tree-item .kol-span {\n place-items: unset;\n }\n}",KolTreeItemDefaultStyle0=defaultStyleCss,KolTreeItem=class{constructor(n){registerInstance(this,n),this._active=void 0,this._label=void 0,this._open=void 0,this._href=void 0}async focusLink(){this.element&&await this.element.focusLink()}async expand(){this.element&&await this.element.expand()}async collapse(){this.element&&await this.element.collapse()}async isOpen(){var n,e;return null!==(e=await(null===(n=this.element)||void 0===n?void 0:n.isOpen()))&&void 0!==e&&e}render(){return h(KolTreeItemWcTag,{key:"59e322059558664a9ca5d03a7a98bafa9b84cb98",_active:this._active,_label:this._label,_open:this._open,_href:this._href,ref:n=>this.element=n},h("slot",{key:"728328010d981a229607662273528d35587ef1e4"}))}};KolTreeItem.style={default:KolTreeItemDefaultStyle0};export{KolTreeItem as kol_tree_item};
4
+ import{r as registerInstance,h}from"./index-c4d5cf81.js";import{o as KolTreeItemWcTag}from"./component-names-545d6582.js";const defaultStyleCss="/*\n * This file contains all rules for accessibility.\n */\n@layer kol-global {\n :host {\n /*\n * Minimum size of interactive elements.\n */\n --a11y-min-size: calc(44rem / var(--kolibri-root-font-size, 16));\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 color: black;\n /*\n * Verdana is an accessible font that can be used without requiring additional loading time.\n */\n font-family: Verdana;\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 * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\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 * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n /*\n * All interactive elements should have a minimum size of 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 min-height: var(--a11y-min-size);\n min-width: 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}\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 clip: rect(0 0 0 0);\n clip-path: inset(50%);\n height: calc(1rem / var(--kolibri-root-font-size, 16));\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: calc(1rem / var(--kolibri-root-font-size, 16));\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 border: none;\n margin: 0;\n padding: 0;\n width: 100%; /* 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}\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 }\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 cursor: not-allowed;\n opacity: 0.5;\n outline: none;\n }\n [aria-disabled=true]:focus .kol-span,\n [disabled]:focus .kol-span {\n outline: none !important;\n }\n}\n@layer kol-component {\n .kol-tree-item {\n font-size: calc(16rem / var(--kolibri-root-font-size, 16));\n }\n .kol-tree-item__link .kol-link {\n padding-right: calc(6rem / var(--kolibri-root-font-size, 16));\n padding-left: calc((22.4rem / var(--kolibri-root-font-size, 16)) * var(--level));\n padding-top: calc(6.4rem / var(--kolibri-root-font-size, 16));\n padding-bottom: calc(6.4rem / var(--kolibri-root-font-size, 16));\n }\n .kol-tree-item__link--first-level .kol-link {\n padding-left: calc(6rem / var(--kolibri-root-font-size, 16));\n }\n .kol-tree-item__children {\n margin: 0;\n padding: 0;\n list-style: none;\n }\n .kol-tree-item .kol-span {\n place-items: unset;\n }\n}",KolTreeItemDefaultStyle0=defaultStyleCss,KolTreeItem=class{constructor(n){registerInstance(this,n),this._active=void 0,this._label=void 0,this._open=void 0,this._href=void 0}async focusLink(){this.element&&await this.element.focusLink()}async expand(){this.element&&await this.element.expand()}async collapse(){this.element&&await this.element.collapse()}async isOpen(){var n,e;return null!==(e=await(null===(n=this.element)||void 0===n?void 0:n.isOpen()))&&void 0!==e&&e}render(){return h(KolTreeItemWcTag,{key:"7e324bdae8c40e274a670a3e650cb98dcb2119ad",_active:this._active,_label:this._label,_open:this._open,_href:this._href,ref:n=>this.element=n},h("slot",{key:"a46e2038580225044a65a10420efad4d97e4981c"}))}};KolTreeItem.style={default:KolTreeItemDefaultStyle0};export{KolTreeItem as kol_tree_item};
@@ -1 +1 @@
1
- {"file":"kol-tree-item.entry.js","mappings":";;;;;;AAAA,MAAM,eAAe,GAAG,2wJAA2wJ,CAAC;AACpyJ,iCAAe,eAAe;;MCWjB,WAAW;;;;;;;;IAuBb,MAAM,SAAS;QACxB,IAAI,IAAI,CAAC,OAAO,EAAE;YACjB,MAAM,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;SAC/B;KACD;IAES,MAAM,MAAM;QACrB,IAAI,IAAI,CAAC,OAAO,EAAE;YACjB,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;SAC5B;KACD;IAES,MAAM,QAAQ;QACvB,IAAI,IAAI,CAAC,OAAO,EAAE;YACjB,MAAM,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;SAC9B;KACD;IAES,MAAM,MAAM;;QACrB,OAAO,OAAC,OAAM,MAAA,IAAI,CAAC,OAAO,0CAAE,MAAM,EAAE,CAAA,CAAC,mCAAI,KAAK,CAAC;KAC/C;IAEM,MAAM;QACZ,QACC,EAAC,gBAAgB,qDAChB,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,GAAG,EAAE,CAAC,OAAkC,MAAM,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,IAErE,8DAAQ,CACU,EAClB;KACF;;;;;;;;","names":[],"sources":["src/components/tree-item/style.scss?tag=kol-tree-item&mode=default&encapsulation=shadow","src/components/tree-item/shadow.tsx"],"sourcesContent":["@import '../@shared/mixins';\n@import '../../styles/global';\n\n@layer kol-component {\n\t.kol-tree-item {\n\t\t$root: &;\n\t\tfont-size: rem(16);\n\n\t\t&__link {\n\t\t\t.kol-link {\n\t\t\t\tpadding-right: rem(6);\n\t\t\t\tpadding-left: calc(rem(22.4) * var(--level));\n\t\t\t\tpadding-top: rem(6.4);\n\t\t\t\tpadding-bottom: rem(6.4);\n\t\t\t}\n\n\t\t\t&--first-level .kol-link {\n\t\t\t\tpadding-left: rem(6);\n\t\t\t}\n\t\t}\n\n\t\t&__children {\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\n\t\t\tlist-style: none;\n\t\t}\n\n\t\t.kol-span {\n\t\t\tplace-items: unset; // unset 'center' style from global layer\n\t\t}\n\t}\n}\n","import { Component, h, type JSX, Method, Prop } from '@stencil/core';\n\nimport type { HrefPropType, LabelPropType, OpenPropType, TreeItemProps } from '../../schema';\nimport { KolTreeItemWcTag } from '../../core/component-names';\n\n@Component({\n\ttag: 'kol-tree-item', // keep in sync with `const TREE_ITEM_TAG_NAME`\n\tstyleUrls: {\n\t\tdefault: './style.scss',\n\t},\n\tshadow: true,\n})\nexport class KolTreeItem implements TreeItemProps {\n\tprivate element?: HTMLKolTreeItemWcElement;\n\n\t/**\n\t * If set (to true) the tree item is the active one.\n\t */\n\t@Prop() _active?: OpenPropType;\n\n\t/**\n\t * Defines the visible or semantic label of the component (e.g. aria-label, label, headline, caption, summary, etc.).\n\t */\n\t@Prop() _label!: LabelPropType;\n\n\t/**\n\t * Opens/expands the element when truthy, closes/collapses when falsy.\n\t */\n\t@Prop() _open?: OpenPropType;\n\n\t/**\n\t * Defines the target URI of the link.\n\t */\n\t@Prop() _href!: HrefPropType;\n\n\t@Method() async focusLink() {\n\t\tif (this.element) {\n\t\t\tawait this.element.focusLink();\n\t\t}\n\t}\n\n\t@Method() async expand() {\n\t\tif (this.element) {\n\t\t\tawait this.element.expand();\n\t\t}\n\t}\n\n\t@Method() async collapse() {\n\t\tif (this.element) {\n\t\t\tawait this.element.collapse();\n\t\t}\n\t}\n\n\t@Method() async isOpen() {\n\t\treturn (await this.element?.isOpen()) ?? false;\n\t}\n\n\tpublic render(): JSX.Element {\n\t\treturn (\n\t\t\t<KolTreeItemWcTag\n\t\t\t\t_active={this._active}\n\t\t\t\t_label={this._label}\n\t\t\t\t_open={this._open}\n\t\t\t\t_href={this._href}\n\t\t\t\tref={(element?: HTMLKolTreeItemWcElement) => (this.element = element)}\n\t\t\t>\n\t\t\t\t<slot />\n\t\t\t</KolTreeItemWcTag>\n\t\t);\n\t}\n}\n"],"version":3}
1
+ {"file":"kol-tree-item.entry.js","mappings":";;;;;;AAAA,MAAM,eAAe,GAAG,2wJAA2wJ,CAAC;AACpyJ,iCAAe,eAAe;;MCWjB,WAAW;;;;;;;;IAuBb,MAAM,SAAS;QACxB,IAAI,IAAI,CAAC,OAAO,EAAE;YACjB,MAAM,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;SAC/B;KACD;IAES,MAAM,MAAM;QACrB,IAAI,IAAI,CAAC,OAAO,EAAE;YACjB,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;SAC5B;KACD;IAES,MAAM,QAAQ;QACvB,IAAI,IAAI,CAAC,OAAO,EAAE;YACjB,MAAM,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;SAC9B;KACD;IAES,MAAM,MAAM;;QACrB,OAAO,OAAC,OAAM,MAAA,IAAI,CAAC,OAAO,0CAAE,MAAM,EAAE,CAAA,CAAC,mCAAI,KAAK,CAAC;KAC/C;IAEM,MAAM;QACZ,QACC,EAAC,gBAAgB,qDAChB,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,GAAG,EAAE,CAAC,OAAkC,MAAM,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,IAErE,8DAAQ,CACU,EAClB;KACF;;;;;;;;","names":[],"sources":["src/components/tree-item/style.scss?tag=kol-tree-item&mode=default&encapsulation=shadow","src/components/tree-item/shadow.tsx"],"sourcesContent":["@use '../@shared/mixins' as *;\n@use '../../styles/global' as *;\n\n@layer kol-component {\n\t.kol-tree-item {\n\t\t$root: &;\n\t\tfont-size: rem(16);\n\n\t\t&__link {\n\t\t\t.kol-link {\n\t\t\t\tpadding-right: rem(6);\n\t\t\t\tpadding-left: calc(rem(22.4) * var(--level));\n\t\t\t\tpadding-top: rem(6.4);\n\t\t\t\tpadding-bottom: rem(6.4);\n\t\t\t}\n\n\t\t\t&--first-level .kol-link {\n\t\t\t\tpadding-left: rem(6);\n\t\t\t}\n\t\t}\n\n\t\t&__children {\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\n\t\t\tlist-style: none;\n\t\t}\n\n\t\t.kol-span {\n\t\t\tplace-items: unset; // unset 'center' style from global layer\n\t\t}\n\t}\n}\n","import { Component, h, type JSX, Method, Prop } from '@stencil/core';\n\nimport type { HrefPropType, LabelPropType, OpenPropType, TreeItemProps } from '../../schema';\nimport { KolTreeItemWcTag } from '../../core/component-names';\n\n@Component({\n\ttag: 'kol-tree-item', // keep in sync with `const TREE_ITEM_TAG_NAME`\n\tstyleUrls: {\n\t\tdefault: './style.scss',\n\t},\n\tshadow: true,\n})\nexport class KolTreeItem implements TreeItemProps {\n\tprivate element?: HTMLKolTreeItemWcElement;\n\n\t/**\n\t * If set (to true) the tree item is the active one.\n\t */\n\t@Prop() _active?: OpenPropType;\n\n\t/**\n\t * Defines the visible or semantic label of the component (e.g. aria-label, label, headline, caption, summary, etc.).\n\t */\n\t@Prop() _label!: LabelPropType;\n\n\t/**\n\t * Opens/expands the element when truthy, closes/collapses when falsy.\n\t */\n\t@Prop() _open?: OpenPropType;\n\n\t/**\n\t * Defines the target URI of the link.\n\t */\n\t@Prop() _href!: HrefPropType;\n\n\t@Method() async focusLink() {\n\t\tif (this.element) {\n\t\t\tawait this.element.focusLink();\n\t\t}\n\t}\n\n\t@Method() async expand() {\n\t\tif (this.element) {\n\t\t\tawait this.element.expand();\n\t\t}\n\t}\n\n\t@Method() async collapse() {\n\t\tif (this.element) {\n\t\t\tawait this.element.collapse();\n\t\t}\n\t}\n\n\t@Method() async isOpen() {\n\t\treturn (await this.element?.isOpen()) ?? false;\n\t}\n\n\tpublic render(): JSX.Element {\n\t\treturn (\n\t\t\t<KolTreeItemWcTag\n\t\t\t\t_active={this._active}\n\t\t\t\t_label={this._label}\n\t\t\t\t_open={this._open}\n\t\t\t\t_href={this._href}\n\t\t\t\tref={(element?: HTMLKolTreeItemWcElement) => (this.element = element)}\n\t\t\t>\n\t\t\t\t<slot />\n\t\t\t</KolTreeItemWcTag>\n\t\t);\n\t}\n}\n"],"version":3}
@@ -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-91489a9f.js";import{r as KolTreeItemTag,q as KolTreeTag}from"./component-names-a18a51c8.js";import{v as validateLabel}from"./label-d0315384.js";import"./prop.validators-9feb1d92.js";import"./index-da3e0c00.js";import"./dev.utils-fab45cbc.js";const KolTreeWc=class{constructor(e){registerInstance(this,e),this.state={_label:""},this._label=void 0}validateLabel(e){validateLabel(this,e)}render(){return h(Host,{key:"7ed304596f8d9f4ab353c881aa3e7a058d23b1cc",onSlotchange:this.handleSlotchange.bind(this)},h("nav",{key:"53d283e8c52792eb96d540a364cd13f6e504a433",class:"kol-tree","aria-label":this.state._label},h("ul",{key:"c2ce2459919900ee430507a5599ff09d54638376",class:"kol-tree__treeview-navigation",role:"tree","aria-label":this.state._label},h("slot",{key:"cba291c46b0bbfe699b154b0333932a1829ff03e"}))))}static isTreeItem(e){return(null==e?void 0:e.tagName)===KolTreeItemTag.toUpperCase()}componentWillLoad(){this.validateLabel(this._label),this.handleTreeChange(),this.observeChildListMutations()}disconnectedCallback(){var e;null===(e=this.observer)||void 0===e||e.disconnect()}observeChildListMutations(){this.observer=new MutationObserver(this.handleTreeChange.bind(this)),this.observeTopLevelItems()}handleSlotchange(){this.observeTopLevelItems(),this.handleTreeChange()}observeTopLevelItems(){var e;null===(e=this.getTopLevelTreeItems())||void 0===e||e.forEach((e=>{var t;null===(t=this.observer)||void 0===t||t.observe(e,{childList:!0,subtree:!0})}))}getTopLevelTreeItems(){var e,t,a;return null===(a=null===(t=null===(e=this.host.querySelector("slot"))||void 0===e?void 0:e.assignedNodes)||void 0===t?void 0:t.call(e))||void 0===a?void 0:a.filter(KolTreeWc.isTreeItem)}handleTreeChange(){this.treeItemElements=this.getTreeItemElements(),this.ensureActiveItemVisibility()}getTreeItemElements(){var e;return null===(e=this.getTopLevelTreeItems())||void 0===e?void 0:e.reduce(((e,t)=>{const a=t.querySelectorAll(KolTreeItemTag);return[...e,t,...a]}),[])}async getOpenTreeItemElements(){if(!this.treeItemElements)return;const e=async t=>!KolTreeWc.isTreeItem(t.parentElement)||await t.parentElement.isOpen()&&await e(t.parentElement);return(await Promise.all(this.treeItemElements.map((async t=>({value:t,include:await e(t)}))))).filter((e=>e.include)).map((e=>e.value))}async handleKeyDown(e){var t,a,l,i,r,s,n,o,c;const d=await this.getOpenTreeItemElements(),v=null===(t=document.activeElement)||void 0===t?void 0:t.closest(KolTreeItemTag);if(!d||!v)return;const u=null==d?void 0:d.findIndex((e=>e===v));switch(e.key){case"ArrowDown":await(null===(a=d[u+1])||void 0===a?void 0:a.focusLink()),e.preventDefault();break;case"ArrowUp":await(null===(l=d[u-1])||void 0===l?void 0:l.focusLink()),e.preventDefault();break;case"Right":case"ArrowRight":e.preventDefault(),await v.isOpen()?await(null===(i=d[u+1])||void 0===i?void 0:i.focusLink()):await v.expand();break;case"Left":case"ArrowLeft":if(e.preventDefault(),await v.isOpen())await v.collapse();else{const e=d.findIndex((e=>e===v.parentElement));-1!==e&&await(null===(r=d[e])||void 0===r?void 0:r.focusLink())}break;case"Home":await(null===(s=d[0])||void 0===s?void 0:s.focusLink()),e.preventDefault();break;case"End":await(null===(n=d[d.length-1])||void 0===n?void 0:n.focusLink()),e.preventDefault();break;case null===(o=e.key.match(/[a-zA-Z0-9]/))||void 0===o?void 0:o.input:{const t=e.key.toLowerCase(),a=d.indexOf(v)+1,l=d.concat(d),i=l.slice(a,a+d.length).findIndex((e=>{var a;return null===(a=e.getAttribute("_label"))||void 0===a?void 0:a.trim().toLowerCase().startsWith(t)}));-1!==i&&(await l[a+i].focusLink(),e.preventDefault());break}case"*":{const e=null===(c=v.parentElement)||void 0===c?void 0:c.querySelectorAll(KolTreeItemTag);null==e||e.forEach((e=>{e.expand()}));break}}}async handleFocusOut(e){e.relatedTarget&&!e.relatedTarget.closest(KolTreeTag)&&await this.ensureActiveItemVisibility()}async ensureActiveItemVisibility(){const e=t=>{KolTreeWc.isTreeItem(t.parentElement)&&(t.parentElement.expand(),e(t.parentElement))},t=(()=>{var e,t,a,l;const i=null!==(l=null===(a=null===(t=null===(e=this.host.querySelector("slot"))||void 0===e?void 0:e.assignedNodes)||void 0===t?void 0:t.call(e))||void 0===a?void 0:a.filter(KolTreeWc.isTreeItem))&&void 0!==l?l:[];for(const e of i){if(e._active)return e;const t=e.querySelector(`${KolTreeItemTag}[_active="true"]`);if(t&&t._active)return t}})();t&&e(t)}get host(){return getElement(this)}static get watchers(){return{_label:["validateLabel"]}}};export{KolTreeWc as kol_tree_wc};
4
+ import{r as registerInstance,h,H as Host,g as getElement}from"./index-c4d5cf81.js";import{r as KolTreeItemTag,q as KolTreeTag}from"./component-names-545d6582.js";import{v as validateLabel}from"./label-d0315384.js";import"./prop.validators-9feb1d92.js";import"./index-da3e0c00.js";import"./dev.utils-fab45cbc.js";const KolTreeWc=class{constructor(e){registerInstance(this,e),this.state={_label:""},this._label=void 0}validateLabel(e){validateLabel(this,e)}render(){return h(Host,{key:"f0992d8b937f65cdfdba353d68dab4cb1a9521f6",onSlotchange:this.handleSlotchange.bind(this)},h("nav",{key:"a6019633e2daf8a2de4237276e569d761f3c7f01",class:"kol-tree","aria-label":this.state._label},h("ul",{key:"eb2a06ca8c566cd95e5f451c85683e8bd116c454",class:"kol-tree__treeview-navigation",role:"tree","aria-label":this.state._label},h("slot",{key:"fce3cb6dfe150bee569753840720a4a26f9923d4"}))))}static isTreeItem(e){return(null==e?void 0:e.tagName)===KolTreeItemTag.toUpperCase()}componentWillLoad(){this.validateLabel(this._label),this.handleTreeChange(),this.observeChildListMutations()}disconnectedCallback(){var e;null===(e=this.observer)||void 0===e||e.disconnect()}observeChildListMutations(){this.observer=new MutationObserver(this.handleTreeChange.bind(this)),this.observeTopLevelItems()}handleSlotchange(){this.observeTopLevelItems(),this.handleTreeChange()}observeTopLevelItems(){var e;null===(e=this.getTopLevelTreeItems())||void 0===e||e.forEach((e=>{var t;null===(t=this.observer)||void 0===t||t.observe(e,{childList:!0,subtree:!0})}))}getTopLevelTreeItems(){var e,t,a;return null===(a=null===(t=null===(e=this.host.querySelector("slot"))||void 0===e?void 0:e.assignedNodes)||void 0===t?void 0:t.call(e))||void 0===a?void 0:a.filter(KolTreeWc.isTreeItem)}handleTreeChange(){this.treeItemElements=this.getTreeItemElements(),this.ensureActiveItemVisibility()}getTreeItemElements(){var e;return null===(e=this.getTopLevelTreeItems())||void 0===e?void 0:e.reduce(((e,t)=>{const a=t.querySelectorAll(KolTreeItemTag);return[...e,t,...a]}),[])}async getOpenTreeItemElements(){if(!this.treeItemElements)return;const e=async t=>!KolTreeWc.isTreeItem(t.parentElement)||await t.parentElement.isOpen()&&await e(t.parentElement);return(await Promise.all(this.treeItemElements.map((async t=>({value:t,include:await e(t)}))))).filter((e=>e.include)).map((e=>e.value))}async handleKeyDown(e){var t,a,l,i,r,s,n,o,c;const d=await this.getOpenTreeItemElements(),v=null===(t=document.activeElement)||void 0===t?void 0:t.closest(KolTreeItemTag);if(!d||!v)return;const u=null==d?void 0:d.findIndex((e=>e===v));switch(e.key){case"ArrowDown":await(null===(a=d[u+1])||void 0===a?void 0:a.focusLink()),e.preventDefault();break;case"ArrowUp":await(null===(l=d[u-1])||void 0===l?void 0:l.focusLink()),e.preventDefault();break;case"Right":case"ArrowRight":e.preventDefault(),await v.isOpen()?await(null===(i=d[u+1])||void 0===i?void 0:i.focusLink()):await v.expand();break;case"Left":case"ArrowLeft":if(e.preventDefault(),await v.isOpen())await v.collapse();else{const e=d.findIndex((e=>e===v.parentElement));-1!==e&&await(null===(r=d[e])||void 0===r?void 0:r.focusLink())}break;case"Home":await(null===(s=d[0])||void 0===s?void 0:s.focusLink()),e.preventDefault();break;case"End":await(null===(n=d[d.length-1])||void 0===n?void 0:n.focusLink()),e.preventDefault();break;case null===(o=e.key.match(/[a-zA-Z0-9]/))||void 0===o?void 0:o.input:{const t=e.key.toLowerCase(),a=d.indexOf(v)+1,l=d.concat(d),i=l.slice(a,a+d.length).findIndex((e=>{var a;return null===(a=e.getAttribute("_label"))||void 0===a?void 0:a.trim().toLowerCase().startsWith(t)}));-1!==i&&(await l[a+i].focusLink(),e.preventDefault());break}case"*":{const e=null===(c=v.parentElement)||void 0===c?void 0:c.querySelectorAll(KolTreeItemTag);null==e||e.forEach((e=>{e.expand()}));break}}}async handleFocusOut(e){e.relatedTarget&&!e.relatedTarget.closest(KolTreeTag)&&await this.ensureActiveItemVisibility()}async ensureActiveItemVisibility(){const e=t=>{KolTreeWc.isTreeItem(t.parentElement)&&(t.parentElement.expand(),e(t.parentElement))},t=(()=>{var e,t,a,l;const i=null!==(l=null===(a=null===(t=null===(e=this.host.querySelector("slot"))||void 0===e?void 0:e.assignedNodes)||void 0===t?void 0:t.call(e))||void 0===a?void 0:a.filter(KolTreeWc.isTreeItem))&&void 0!==l?l:[];for(const e of i){if(e._active)return e;const t=e.querySelector(`${KolTreeItemTag}[_active="true"]`);if(t&&t._active)return t}})();t&&e(t)}get host(){return getElement(this)}static get watchers(){return{_label:["validateLabel"]}}};export{KolTreeWc as kol_tree_wc};