@public-ui/components 2.2.16-rc.0 → 2.2.16-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (271) hide show
  1. package/custom-elements.json +1 -1
  2. package/dist/cjs/{Alert-a366cff6.js → Alert-32a5cc5e.js} +1 -1
  3. package/dist/cjs/{Alert-a366cff6.js.map → Alert-32a5cc5e.js.map} +1 -1
  4. package/dist/cjs/{Collapsible-c1fffcc6.js → Collapsible-c9efc75a.js} +1 -1
  5. package/dist/cjs/{Collapsible-c1fffcc6.js.map → Collapsible-c9efc75a.js.map} +1 -1
  6. package/dist/cjs/{FormFieldMsg-4b472b6d.js → FormFieldMsg-4a4c8878.js} +1 -1
  7. package/dist/cjs/{FormFieldMsg-4b472b6d.js.map → FormFieldMsg-4a4c8878.js.map} +1 -1
  8. package/dist/cjs/{InternalUnderlinedBadgeText-50bb5ced.js → InternalUnderlinedBadgeText-09f44cd7.js} +1 -1
  9. package/dist/cjs/{InternalUnderlinedBadgeText-50bb5ced.js.map → InternalUnderlinedBadgeText-09f44cd7.js.map} +1 -1
  10. package/dist/cjs/{app-globals-e34048fa.js → app-globals-04bdffab.js} +1 -1
  11. package/dist/cjs/{app-globals-e34048fa.js.map → app-globals-04bdffab.js.map} +1 -1
  12. package/dist/cjs/{dev.utils-6fd01f93.js → dev.utils-2628f528.js} +1 -1
  13. package/dist/cjs/{dev.utils-6fd01f93.js.map → dev.utils-2628f528.js.map} +1 -1
  14. package/dist/cjs/{devtools-2c191a1b.js → devtools-5bf6ad87.js} +1 -1
  15. package/dist/cjs/{devtools-2c191a1b.js.map → devtools-5bf6ad87.js.map} +1 -1
  16. package/dist/cjs/{index-331862cf.js → index-c776c56b.js} +1 -1
  17. package/dist/cjs/{index-331862cf.js.map → index-c776c56b.js.map} +1 -1
  18. package/dist/cjs/kol-abbr.cjs.entry.js +1 -1
  19. package/dist/cjs/kol-accordion.cjs.entry.js +1 -1
  20. package/dist/cjs/kol-alert-wc.cjs.entry.js +1 -1
  21. package/dist/cjs/kol-alert.cjs.entry.js +1 -1
  22. package/dist/cjs/kol-avatar-wc.cjs.entry.js +1 -1
  23. package/dist/cjs/kol-avatar.cjs.entry.js +1 -1
  24. package/dist/cjs/kol-badge.cjs.entry.js +1 -1
  25. package/dist/cjs/kol-breadcrumb.cjs.entry.js +1 -1
  26. package/dist/cjs/kol-button-group-wc.cjs.entry.js +1 -1
  27. package/dist/cjs/kol-button-group.cjs.entry.js +1 -1
  28. package/dist/cjs/kol-button-link.cjs.entry.js +1 -1
  29. package/dist/cjs/kol-button-wc.cjs.entry.js +1 -1
  30. package/dist/cjs/kol-button.cjs.entry.js +1 -1
  31. package/dist/cjs/kol-card.cjs.entry.js +1 -1
  32. package/dist/cjs/kol-combobox.cjs.entry.js +1 -1
  33. package/dist/cjs/kol-details.cjs.entry.js +1 -1
  34. package/dist/cjs/kol-drawer.cjs.entry.js +1 -1
  35. package/dist/cjs/kol-form.cjs.entry.js +1 -1
  36. package/dist/cjs/kol-heading-wc.cjs.entry.js +1 -1
  37. package/dist/cjs/kol-heading.cjs.entry.js +1 -1
  38. package/dist/cjs/kol-icon.cjs.entry.js +1 -1
  39. package/dist/cjs/kol-image.cjs.entry.js +1 -1
  40. package/dist/cjs/kol-indented-text-wc.cjs.entry.js +1 -1
  41. package/dist/cjs/kol-indented-text.cjs.entry.js +1 -1
  42. package/dist/cjs/kol-input-checkbox.cjs.entry.js +1 -1
  43. package/dist/cjs/kol-input-color.cjs.entry.js +1 -1
  44. package/dist/cjs/kol-input-date.cjs.entry.js +1 -1
  45. package/dist/cjs/kol-input-email.cjs.entry.js +1 -1
  46. package/dist/cjs/kol-input-file.cjs.entry.js +1 -1
  47. package/dist/cjs/kol-input-number.cjs.entry.js +1 -1
  48. package/dist/cjs/kol-input-password.cjs.entry.js +1 -1
  49. package/dist/cjs/kol-input-radio.cjs.entry.js +1 -1
  50. package/dist/cjs/kol-input-range.cjs.entry.js +1 -1
  51. package/dist/cjs/kol-input-text.cjs.entry.js +1 -1
  52. package/dist/cjs/kol-input.cjs.entry.js +1 -1
  53. package/dist/cjs/kol-kolibri.cjs.entry.js +1 -1
  54. package/dist/cjs/kol-link-button.cjs.entry.js +1 -1
  55. package/dist/cjs/kol-link-group.cjs.entry.js +1 -1
  56. package/dist/cjs/kol-link-wc.cjs.entry.js +1 -1
  57. package/dist/cjs/kol-link.cjs.entry.js +1 -1
  58. package/dist/cjs/kol-logo.cjs.entry.js +1 -1
  59. package/dist/cjs/kol-modal.cjs.entry.js +1 -1
  60. package/dist/cjs/kol-nav.cjs.entry.js +1 -1
  61. package/dist/cjs/kol-pagination.cjs.entry.js +1 -1
  62. package/dist/cjs/kol-popover-button.cjs.entry.js +1 -1
  63. package/dist/cjs/kol-popover-wc.cjs.entry.js +1 -1
  64. package/dist/cjs/kol-progress.cjs.entry.js +1 -1
  65. package/dist/cjs/kol-quote.cjs.entry.js +1 -1
  66. package/dist/cjs/kol-select.cjs.entry.js +1 -1
  67. package/dist/cjs/kol-single-select.cjs.entry.js +1 -1
  68. package/dist/cjs/kol-skip-nav.cjs.entry.js +1 -1
  69. package/dist/cjs/kol-span-wc.cjs.entry.js +1 -1
  70. package/dist/cjs/kol-spin.cjs.entry.js +1 -1
  71. package/dist/cjs/kol-split-button.cjs.entry.js +1 -1
  72. package/dist/cjs/kol-symbol.cjs.entry.js +1 -1
  73. package/dist/cjs/kol-table-stateful.cjs.entry.js +1 -1
  74. package/dist/cjs/kol-table-stateless-wc.cjs.entry.js +1 -1
  75. package/dist/cjs/kol-table-stateless.cjs.entry.js +1 -1
  76. package/dist/cjs/kol-table.cjs.entry.js +1 -1
  77. package/dist/cjs/kol-tabs.cjs.entry.js +1 -1
  78. package/dist/cjs/kol-textarea.cjs.entry.js +1 -1
  79. package/dist/cjs/kol-toast-container.cjs.entry.js +1 -1
  80. package/dist/cjs/kol-toolbar.cjs.entry.js +1 -1
  81. package/dist/cjs/kol-tooltip-wc.cjs.entry.js +1 -1
  82. package/dist/cjs/kol-tree-item-wc.cjs.entry.js +1 -1
  83. package/dist/cjs/kol-tree-item.cjs.entry.js +1 -1
  84. package/dist/cjs/kol-tree-wc.cjs.entry.js +1 -1
  85. package/dist/cjs/kol-tree.cjs.entry.js +1 -1
  86. package/dist/cjs/kol-version.cjs.entry.js +1 -1
  87. package/dist/cjs/kolibri.cjs.js +1 -1
  88. package/dist/cjs/loader.cjs.js +1 -1
  89. package/dist/cjs/test-component.cjs.entry.js +1 -1
  90. package/dist/esm/Alert-9a37a638.js +4 -0
  91. package/dist/esm/{Alert-981ed837.js.map → Alert-9a37a638.js.map} +1 -1
  92. package/dist/esm/{Collapsible-9f1aef6a.js → Collapsible-29766e0c.js} +1 -1
  93. package/dist/esm/{Collapsible-9f1aef6a.js.map → Collapsible-29766e0c.js.map} +1 -1
  94. package/dist/esm/{FormFieldMsg-0da7f228.js → FormFieldMsg-1c17f4ff.js} +1 -1
  95. package/dist/esm/{FormFieldMsg-0da7f228.js.map → FormFieldMsg-1c17f4ff.js.map} +1 -1
  96. package/dist/esm/InternalUnderlinedBadgeText-40aac46d.js +4 -0
  97. package/dist/esm/{InternalUnderlinedBadgeText-c9ba3be5.js.map → InternalUnderlinedBadgeText-40aac46d.js.map} +1 -1
  98. package/dist/esm/{app-globals-c22a6993.js → app-globals-09d02b04.js} +1 -1
  99. package/dist/esm/{app-globals-c22a6993.js.map → app-globals-09d02b04.js.map} +1 -1
  100. package/dist/esm/{dev.utils-73ce9898.js → dev.utils-da85e627.js} +1 -1
  101. package/dist/esm/{dev.utils-73ce9898.js.map → dev.utils-da85e627.js.map} +1 -1
  102. package/dist/esm/{devtools-7368c640.js → devtools-0d36070b.js} +1 -1
  103. package/dist/esm/{devtools-7368c640.js.map → devtools-0d36070b.js.map} +1 -1
  104. package/dist/esm/{index-8a68d70d.js → index-e850ccc2.js} +1 -1
  105. package/dist/esm/{index-8a68d70d.js.map → index-e850ccc2.js.map} +1 -1
  106. package/dist/esm/kol-abbr.entry.js +1 -1
  107. package/dist/esm/kol-accordion.entry.js +1 -1
  108. package/dist/esm/kol-alert-wc.entry.js +1 -1
  109. package/dist/esm/kol-alert.entry.js +1 -1
  110. package/dist/esm/kol-avatar-wc.entry.js +1 -1
  111. package/dist/esm/kol-avatar.entry.js +1 -1
  112. package/dist/esm/kol-badge.entry.js +1 -1
  113. package/dist/esm/kol-breadcrumb.entry.js +1 -1
  114. package/dist/esm/kol-button-group-wc.entry.js +1 -1
  115. package/dist/esm/kol-button-group.entry.js +1 -1
  116. package/dist/esm/kol-button-link.entry.js +1 -1
  117. package/dist/esm/kol-button-wc.entry.js +1 -1
  118. package/dist/esm/kol-button.entry.js +1 -1
  119. package/dist/esm/kol-card.entry.js +1 -1
  120. package/dist/esm/kol-combobox.entry.js +1 -1
  121. package/dist/esm/kol-details.entry.js +1 -1
  122. package/dist/esm/kol-drawer.entry.js +1 -1
  123. package/dist/esm/kol-form.entry.js +1 -1
  124. package/dist/esm/kol-heading-wc.entry.js +1 -1
  125. package/dist/esm/kol-heading.entry.js +1 -1
  126. package/dist/esm/kol-icon.entry.js +1 -1
  127. package/dist/esm/kol-image.entry.js +1 -1
  128. package/dist/esm/kol-indented-text-wc.entry.js +1 -1
  129. package/dist/esm/kol-indented-text.entry.js +1 -1
  130. package/dist/esm/kol-input-checkbox.entry.js +1 -1
  131. package/dist/esm/kol-input-color.entry.js +1 -1
  132. package/dist/esm/kol-input-date.entry.js +1 -1
  133. package/dist/esm/kol-input-email.entry.js +1 -1
  134. package/dist/esm/kol-input-file.entry.js +1 -1
  135. package/dist/esm/kol-input-number.entry.js +1 -1
  136. package/dist/esm/kol-input-password.entry.js +1 -1
  137. package/dist/esm/kol-input-radio.entry.js +1 -1
  138. package/dist/esm/kol-input-range.entry.js +1 -1
  139. package/dist/esm/kol-input-text.entry.js +1 -1
  140. package/dist/esm/kol-input.entry.js +1 -1
  141. package/dist/esm/kol-kolibri.entry.js +1 -1
  142. package/dist/esm/kol-link-button.entry.js +1 -1
  143. package/dist/esm/kol-link-group.entry.js +1 -1
  144. package/dist/esm/kol-link-wc.entry.js +1 -1
  145. package/dist/esm/kol-link.entry.js +1 -1
  146. package/dist/esm/kol-logo.entry.js +1 -1
  147. package/dist/esm/kol-modal.entry.js +1 -1
  148. package/dist/esm/kol-nav.entry.js +1 -1
  149. package/dist/esm/kol-pagination.entry.js +1 -1
  150. package/dist/esm/kol-popover-button.entry.js +1 -1
  151. package/dist/esm/kol-popover-wc.entry.js +1 -1
  152. package/dist/esm/kol-progress.entry.js +1 -1
  153. package/dist/esm/kol-quote.entry.js +1 -1
  154. package/dist/esm/kol-select.entry.js +1 -1
  155. package/dist/esm/kol-single-select.entry.js +1 -1
  156. package/dist/esm/kol-skip-nav.entry.js +1 -1
  157. package/dist/esm/kol-span-wc.entry.js +1 -1
  158. package/dist/esm/kol-spin.entry.js +1 -1
  159. package/dist/esm/kol-split-button.entry.js +1 -1
  160. package/dist/esm/kol-symbol.entry.js +1 -1
  161. package/dist/esm/kol-table-stateful.entry.js +1 -1
  162. package/dist/esm/kol-table-stateless-wc.entry.js +1 -1
  163. package/dist/esm/kol-table-stateless.entry.js +1 -1
  164. package/dist/esm/kol-table.entry.js +1 -1
  165. package/dist/esm/kol-tabs.entry.js +1 -1
  166. package/dist/esm/kol-textarea.entry.js +1 -1
  167. package/dist/esm/kol-toast-container.entry.js +1 -1
  168. package/dist/esm/kol-toolbar.entry.js +1 -1
  169. package/dist/esm/kol-tooltip-wc.entry.js +1 -1
  170. package/dist/esm/kol-tree-item-wc.entry.js +1 -1
  171. package/dist/esm/kol-tree-item.entry.js +1 -1
  172. package/dist/esm/kol-tree-wc.entry.js +1 -1
  173. package/dist/esm/kol-tree.entry.js +1 -1
  174. package/dist/esm/kol-version.entry.js +1 -1
  175. package/dist/esm/kolibri.js +1 -1
  176. package/dist/esm/loader.js +1 -1
  177. package/dist/esm/test-component.entry.js +1 -1
  178. package/dist/kolibri/{Alert-981ed837.js → Alert-9a37a638.js} +1 -1
  179. package/dist/kolibri/{Collapsible-9f1aef6a.js → Collapsible-29766e0c.js} +1 -1
  180. package/dist/kolibri/FormFieldMsg-1c17f4ff.js +4 -0
  181. package/dist/kolibri/InternalUnderlinedBadgeText-40aac46d.js +4 -0
  182. package/dist/kolibri/app-globals-09d02b04.js +4 -0
  183. package/dist/kolibri/{app-globals-c22a6993.js.map → app-globals-09d02b04.js.map} +1 -1
  184. package/dist/kolibri/{dev.utils-73ce9898.js → dev.utils-da85e627.js} +1 -1
  185. package/dist/kolibri/{devtools-7368c640.js → devtools-0d36070b.js} +1 -1
  186. package/dist/kolibri/{index-8a68d70d.js → index-e850ccc2.js} +1 -1
  187. package/dist/kolibri/{index-8a68d70d.js.map → index-e850ccc2.js.map} +1 -1
  188. package/dist/kolibri/kol-abbr.entry.js +1 -1
  189. package/dist/kolibri/kol-accordion.entry.js +1 -1
  190. package/dist/kolibri/kol-alert-wc.entry.js +1 -1
  191. package/dist/kolibri/kol-alert.entry.js +1 -1
  192. package/dist/kolibri/kol-avatar-wc.entry.js +1 -1
  193. package/dist/kolibri/kol-avatar.entry.js +1 -1
  194. package/dist/kolibri/kol-badge.entry.js +1 -1
  195. package/dist/kolibri/kol-breadcrumb.entry.js +1 -1
  196. package/dist/kolibri/kol-button-group-wc.entry.js +1 -1
  197. package/dist/kolibri/kol-button-group.entry.js +1 -1
  198. package/dist/kolibri/kol-button-link.entry.js +1 -1
  199. package/dist/kolibri/kol-button-wc.entry.js +1 -1
  200. package/dist/kolibri/kol-button.entry.js +1 -1
  201. package/dist/kolibri/kol-card.entry.js +1 -1
  202. package/dist/kolibri/kol-combobox.entry.js +1 -1
  203. package/dist/kolibri/kol-details.entry.js +1 -1
  204. package/dist/kolibri/kol-drawer.entry.js +1 -1
  205. package/dist/kolibri/kol-form.entry.js +1 -1
  206. package/dist/kolibri/kol-heading-wc.entry.js +1 -1
  207. package/dist/kolibri/kol-heading.entry.js +1 -1
  208. package/dist/kolibri/kol-icon.entry.js +1 -1
  209. package/dist/kolibri/kol-image.entry.js +1 -1
  210. package/dist/kolibri/kol-indented-text-wc.entry.js +1 -1
  211. package/dist/kolibri/kol-indented-text.entry.js +1 -1
  212. package/dist/kolibri/kol-input-checkbox.entry.js +1 -1
  213. package/dist/kolibri/kol-input-color.entry.js +1 -1
  214. package/dist/kolibri/kol-input-date.entry.js +1 -1
  215. package/dist/kolibri/kol-input-email.entry.js +1 -1
  216. package/dist/kolibri/kol-input-file.entry.js +1 -1
  217. package/dist/kolibri/kol-input-number.entry.js +1 -1
  218. package/dist/kolibri/kol-input-password.entry.js +1 -1
  219. package/dist/kolibri/kol-input-radio.entry.js +1 -1
  220. package/dist/kolibri/kol-input-range.entry.js +1 -1
  221. package/dist/kolibri/kol-input-text.entry.js +1 -1
  222. package/dist/kolibri/kol-input.entry.js +1 -1
  223. package/dist/kolibri/kol-kolibri.entry.js +1 -1
  224. package/dist/kolibri/kol-link-button.entry.js +1 -1
  225. package/dist/kolibri/kol-link-group.entry.js +1 -1
  226. package/dist/kolibri/kol-link-wc.entry.js +1 -1
  227. package/dist/kolibri/kol-link.entry.js +1 -1
  228. package/dist/kolibri/kol-logo.entry.js +1 -1
  229. package/dist/kolibri/kol-modal.entry.js +1 -1
  230. package/dist/kolibri/kol-nav.entry.js +1 -1
  231. package/dist/kolibri/kol-pagination.entry.js +1 -1
  232. package/dist/kolibri/kol-popover-button.entry.js +1 -1
  233. package/dist/kolibri/kol-popover-wc.entry.js +1 -1
  234. package/dist/kolibri/kol-progress.entry.js +1 -1
  235. package/dist/kolibri/kol-quote.entry.js +1 -1
  236. package/dist/kolibri/kol-select.entry.js +1 -1
  237. package/dist/kolibri/kol-single-select.entry.js +1 -1
  238. package/dist/kolibri/kol-skip-nav.entry.js +1 -1
  239. package/dist/kolibri/kol-skip-nav.entry.js.map +1 -1
  240. package/dist/kolibri/kol-span-wc.entry.js +1 -1
  241. package/dist/kolibri/kol-spin.entry.js +1 -1
  242. package/dist/kolibri/kol-split-button.entry.js +1 -1
  243. package/dist/kolibri/kol-symbol.entry.js +1 -1
  244. package/dist/kolibri/kol-table-stateful.entry.js +1 -1
  245. package/dist/kolibri/kol-table-stateless-wc.entry.js +1 -1
  246. package/dist/kolibri/kol-table-stateless.entry.js +1 -1
  247. package/dist/kolibri/kol-table.entry.js +1 -1
  248. package/dist/kolibri/kol-tabs.entry.js +1 -1
  249. package/dist/kolibri/kol-textarea.entry.js +1 -1
  250. package/dist/kolibri/kol-toast-container.entry.js +1 -1
  251. package/dist/kolibri/kol-toolbar.entry.js +1 -1
  252. package/dist/kolibri/kol-tooltip-wc.entry.js +1 -1
  253. package/dist/kolibri/kol-tree-item-wc.entry.js +1 -1
  254. package/dist/kolibri/kol-tree-item.entry.js +1 -1
  255. package/dist/kolibri/kol-tree-wc.entry.js +1 -1
  256. package/dist/kolibri/kol-tree.entry.js +1 -1
  257. package/dist/kolibri/kol-version.entry.js +1 -1
  258. package/dist/kolibri/kolibri.esm.js +1 -1
  259. package/dist/kolibri/test-component.entry.js +1 -1
  260. package/package.json +1 -1
  261. package/dist/esm/Alert-981ed837.js +0 -4
  262. package/dist/esm/InternalUnderlinedBadgeText-c9ba3be5.js +0 -4
  263. package/dist/kolibri/FormFieldMsg-0da7f228.js +0 -4
  264. package/dist/kolibri/InternalUnderlinedBadgeText-c9ba3be5.js +0 -4
  265. package/dist/kolibri/app-globals-c22a6993.js +0 -4
  266. /package/dist/kolibri/{Alert-981ed837.js.map → Alert-9a37a638.js.map} +0 -0
  267. /package/dist/kolibri/{Collapsible-9f1aef6a.js.map → Collapsible-29766e0c.js.map} +0 -0
  268. /package/dist/kolibri/{FormFieldMsg-0da7f228.js.map → FormFieldMsg-1c17f4ff.js.map} +0 -0
  269. /package/dist/kolibri/{InternalUnderlinedBadgeText-c9ba3be5.js.map → InternalUnderlinedBadgeText-40aac46d.js.map} +0 -0
  270. /package/dist/kolibri/{dev.utils-73ce9898.js.map → dev.utils-da85e627.js.map} +0 -0
  271. /package/dist/kolibri/{devtools-7368c640.js.map → devtools-0d36070b.js.map} +0 -0
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * KoliBri - The accessible HTML-Standard
3
3
  */
4
- import{h,F as Fragment,H as Host,r as registerInstance,g as getElement}from"./index-8a68d70d.js";import{j as watchBoolean,v as watchJsonArrayString,A as buildBadgeTextString,B as showExpertSlot}from"./index-7a63e9eb.js";import{l as KolInputTag}from"./component-names-4cb1c62b.js";import{n as nonce}from"./dev.utils-73ce9898.js";import{t as tryToDispatchKoliBriEvent,s as stopPropagation}from"./events-29e84d75.js";import{p as propagateSubmitEventToForm}from"./controller-728fbdd1.js";import{g as getRenderStates}from"./controller-c87b8bd9.js";import{I as InternalUnderlinedBadgeText}from"./InternalUnderlinedBadgeText-c9ba3be5.js";import{I as InputIconController}from"./controller-icon-b3eb5a58.js";import{f as fillKeyOptionMap,v as validateOptionsWithOptgroup}from"./controller-06c08e87.js";import{v as validateRows}from"./rows-8ed50d64.js";import"./associated.controller-d302adf7.js";import"./access-and-short-key-914780a7.js";import"./hide-label-0d754c8e.js";import"./label-7d1ce375.js";import"./tooltip-align-6964dd71.js";import"./align-f3101425.js";import"./icons-adcda9b0.js";class SelectController extends InputIconController{constructor(t,e,n){super(t,e,n),this.keyOptionMap=new Map,this.getOptionByKey=t=>this.keyOptionMap.get(t),this.isValueInOptions=(t,e)=>void 0!==e.find(e=>"string"==typeof e.value?e.value===t:!!Array.isArray(e.options)&&this.isValueInOptions(t,e.options)),this.filterValuesInOptions=(t,e)=>t.filter(t=>void 0!==this.isValueInOptions(t,e)),this.afterPatchOptions=(t,e,n,i)=>{"_value"===i&&this.setFormAssociatedValue(t)},this.beforePatchOptions=(t,e)=>{const n=e.has("_options")?e.get("_options"):this.component.state._options;if(Array.isArray(n)&&n.length>0){this.keyOptionMap.clear(),fillKeyOptionMap(this.keyOptionMap,n);const t=e.has("_value")?e.get("_value"):this.component.state._value,i=this.filterValuesInOptions(Array.isArray(t)&&t.length>0?t:[],n);!1===this.component._multiple&&0===i.length?e.set("_value",[n[0].value]):Array.isArray(t)&&i.length<t.length&&e.set("_value",i)}},this.component=t}validateOptions(t){validateOptionsWithOptgroup(this.component,t,{hooks:{afterPatch:this.afterPatchOptions,beforePatch:this.beforePatchOptions}})}validateMultiple(t){watchBoolean(this.component,"_multiple",t,{hooks:{afterPatch:this.afterPatchOptions,beforePatch:this.beforePatchOptions}})}validateRequired(t){watchBoolean(this.component,"_required",t)}validateRows(t){validateRows(this.component,t)}validateValue(t){watchJsonArrayString(this.component,"_value",()=>!0,t,void 0,{hooks:{afterPatch:this.afterPatchOptions,beforePatch:this.beforePatchOptions}})}componentWillLoad(){super.componentWillLoad(),this.validateOptions(this.component._options),this.validateMultiple(this.component._multiple),this.validateRequired(this.component._required),this.validateRows(this.component._rows),this.validateValue(this.component._value)}}const defaultStyleCss="@charset \"UTF-8\";\n/*\n * This file contains all rules for accessibility.\n */\n@layer kol-a11y {\n :host {\n /*\n * Minimum size of interactive elements.\n */\n --a11y-min-size: calc(44rem / var(--kolibri-root-font-size, 16));\n color: black;\n /*\n * No element should be used without a background and font color whose contrast ratio has\n * not been checked. By initially setting the background color to white and the font color\n * to black, the contrast ratio is ensured and explicit adjustment is forced.\n */\n background-color: white;\n /*\n * Verdana is an accessible font that can be used without requiring additional loading time.\n */\n font-family: Verdana;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n * {\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n hyphens: auto;\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n word-break: break-word;\n }\n /*\n * All interactive elements should have a minimum size of rem(44).\n */\n /* input:not([type='checkbox'], [type='radio'], [type='range']), */\n /* option, */\n /* select, */\n /* textarea, */\n button,\n .kol-input .input {\n min-width: var(--a11y-min-size);\n min-height: var(--a11y-min-size);\n }\n /*\n * Some interactive elements should not inherit the font-family and font-size.\n */\n a,\n button,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n input,\n option,\n select,\n textarea {\n /*\n * All elements should inherit the font family from his parent element.\n */\n font-family: inherit;\n /*\n * All elements should inherit the font size from his parent element.\n */\n font-size: inherit;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n /**\n * Sometimes we need the semantic element for accessibility reasons,\n * but we don't want to show it.\n *\n * - https://www.a11yproject.com/posts/how-to-hide-content/\n */\n .visually-hidden {\n position: fixed;\n top: 0;\n left: 0;\n width: 1px;\n height: 1px;\n overflow: hidden;\n white-space: nowrap;\n clip-path: inset(50%);\n }\n}\n@layer kol-global {\n /*\n * Dieses CSS stellt sicher, dass der Standard-Style\n * von A und Button resettet werden.\n */\n :is(a, button) {\n background-color: transparent;\n width: 100%; /* 100% needed for custom width from outside */\n margin: 0;\n padding: 0;\n border: none;\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 font-size: calc(16rem / var(--kolibri-root-font-size, 16));\n }\n * {\n /*\n * We prefer to box-sizing: border-box for all elements.\n */\n box-sizing: border-box;\n }\n /* KolSpan is a layout component with icons in all directions and a label text in the middle. */\n .kol-span-wc {\n display: grid;\n place-items: center;\n }\n /* The sub span in KolSpan is the horizontal span with icon left and right and the label text in the middle. */\n .kol-span-wc > span {\n display: flex;\n place-items: center;\n }\n a,\n button {\n cursor: pointer;\n }\n /* This is the text label. */\n .hide-label > .kol-span-wc > span > span {\n display: none;\n }\n /* Reset browser agent style. */\n button:disabled {\n color: unset;\n }\n .disabled label,\n .disabled:focus-within label,\n [aria-disabled=true],\n [aria-disabled=true]:focus,\n [disabled],\n [disabled]:focus {\n opacity: 0.5;\n outline: none;\n cursor: not-allowed;\n }\n [aria-disabled=true]:focus .kol-span-wc,\n [disabled]:focus .kol-span-wc {\n outline: none !important;\n }\n .badge-text-hint {\n color: black;\n background-color: lightgray;\n }\n}\n@layer kol-component {\n :host {\n display: block;\n }\n}\n@layer kol-component {\n .kol-tooltip-wc {\n display: contents;\n contain: layout;\n }\n .kol-tooltip-wc .tooltip-floating {\n display: none;\n position: fixed;\n /* Avoid layout interference - see https://floating-ui.com/docs/computePosition */\n top: 0;\n left: 0;\n /* Can be used to specify the tooltip-width from the outside. Unset by default. */\n width: var(--kol-tooltip-width);\n max-width: 90vw;\n max-height: 90vh;\n visibility: hidden;\n animation-duration: 0.25s;\n animation-iteration-count: 1;\n animation-name: fadeInOpacity;\n animation-timing-function: ease-in;\n }\n /* Shared between content and arrow */\n .kol-tooltip-wc .tooltip-area {\n color: #000;\n background-color: #fff;\n }\n .kol-tooltip-wc .tooltip-arrow {\n transform: rotate(45deg);\n position: absolute;\n z-index: 999;\n width: calc(10rem / var(--kolibri-root-font-size, 16));\n height: calc(10rem / var(--kolibri-root-font-size, 16));\n }\n .kol-tooltip-wc .tooltip-content {\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 .required label > span::after,\n .required legend > span::after {\n content: \"*\";\n }\n}\n@layer kol-component {\n input,\n textarea {\n cursor: text;\n }\n input[type=checkbox],\n input[type=color],\n input[type=file],\n input[type=radio],\n input[type=range],\n label,\n option,\n select {\n cursor: pointer;\n }\n /* input[type='checkbox'], */\n /* input[type='radio'], */\n /* input[type='range'], */\n input[type=color],\n input[type=date],\n input[type=datetime-local],\n input[type=email],\n input[type=file],\n input[type=month],\n input[type=number],\n input[type=password],\n input[type=search],\n input[type=tel],\n input[type=text],\n input[type=time],\n input[type=url],\n input[type=week],\n option,\n select,\n textarea {\n background-color: transparent;\n width: 100%;\n }\n /* needed hack for vertical alignment */\n input[type=file] {\n padding: calc((var(--a11y-min-size) - (16rem / var(--kolibri-root-font-size, 16))) / 10) 0.5em;\n }\n /* needed hack for vertical alignment */\n select[multiple] option {\n padding: calc((var(--a11y-min-size) - (16rem / var(--kolibri-root-font-size, 16))) / 2) 0.5em;\n }\n}\n@layer kol-component {\n .kol-alert-wc {\n display: grid;\n }\n .kol-alert-wc .heading {\n display: flex;\n place-items: center;\n }\n .kol-alert-wc .heading > div {\n flex-grow: 1;\n }\n .close {\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-input {\n display: grid;\n }\n .kol-input .input-slot {\n flex-grow: 1;\n }\n input:focus,\n option:focus,\n select:focus,\n textarea:focus {\n outline: 0;\n }\n .input {\n background-color: white;\n display: flex;\n align-items: center;\n cursor: pointer;\n }\n button:not([role=link]) {\n min-height: auto;\n }\n .input > .kol-icon {\n display: grid;\n place-items: center;\n }\n .kol-input.required .input-tooltip .span-label::after {\n content: \"*\";\n }\n}\n@layer kol-component {\n option:checked::before {\n content: \"✓ \";\n }\n}",KolSelectDefaultStyle0=defaultStyleCss,isSelected=(t,e)=>Array.isArray(t)&&t.includes(e),KolSelect=class{async getValue(){return this.state._value}async focus(){await this.kolFocus()}async kolFocus(){var t;null===(t=this.selectRef)||void 0===t||t.focus()}renderOptgroup(t,e){var n;return h("optgroup",{disabled:t.disabled,label:t.label},null===(n=t.options)||void 0===n?void 0:n.map((t,n)=>{const i=`${e}-${n}`;return Array.isArray(t.options)?this.renderOptgroup(t,i):h("option",{disabled:t.disabled,key:i,selected:isSelected(this.state._value,t.value),value:i},t.label)}))}render(){const{ariaDescribedBy:t}=getRenderStates(this.state),e=showExpertSlot(this.state._label);return h(Host,{key:"21b462515346780c325523c8c55c0d7322b0fc42",class:{"kol-select":!0,"has-value":this.state._hasValue}},h(KolInputTag,{key:"25fd8495fc3622fd6eb3b576163503e52194e4cd",class:{"hide-label":!!this.state._hideLabel,select:!0},_accessKey:this.state._accessKey,_alert:this.showAsAlert(),_disabled:this.state._disabled,_hideError:this.state._hideError,_hideLabel:this.state._hideLabel,_hint:this.state._hint,_icons:this.state._icons,_id:this.state._id,_label:this.state._label,_msg:this.state._msg,_required:this.state._required,_shortKey:this.state._shortKey,_tooltipAlign:this._tooltipAlign,_touched:this.state._touched,onClick:()=>{var t;return null===(t=this.selectRef)||void 0===t?void 0:t.focus()},role:"presentation"},h("span",{key:"45bb5fb9ca3af07674267472f841eadc229d5fa0",slot:"label"},e?h("slot",{name:"expert"}):"string"==typeof this.state._accessKey||"string"==typeof this.state._shortKey?h(Fragment,null,h(InternalUnderlinedBadgeText,{badgeText:buildBadgeTextString(this.state._accessKey,this.state._shortKey),label:this.state._label})," ",h("kbd",{class:"badge-text-hint","aria-hidden":"true"},buildBadgeTextString(this.state._accessKey,this.state._shortKey))):h("span",null,this.state._label)),h("div",{key:"66409c5cdab5caf00a390238917bafb10e587ad1",slot:"input"},h("form",{key:"fc2f1effeb153c22b5ee77289ec66bfdd1cf17ed",onSubmit:t=>{t.preventDefault(),propagateSubmitEventToForm({form:this.host,ref:this.selectRef})}},h("input",{key:"04b19515fb209a89e8c90be28ff1d136f454f468",type:"submit",hidden:!0}),h("select",Object.assign({key:"675f5c799f0e27bc9fb06d1dd7e1a81dda1de3ff",ref:this.catchRef,title:"",accessKey:this.state._accessKey,"aria-describedby":t.length>0?t.join(" "):void 0,"aria-label":this.state._hideLabel&&"string"==typeof this.state._label?this.state._label:void 0,autoCapitalize:"off",autoCorrect:"off",disabled:this.state._disabled,id:this.state._id,multiple:this.state._multiple,name:this.state._name,required:this.state._required,size:this.state._rows},this.controller.onFacade,{onInput:this.onInput.bind(this),onChange:this.onChange.bind(this),onFocus:t=>{this.controller.onFacade.onFocus(t),this.inputHasFocus=!0},onBlur:t=>{this.controller.onFacade.onBlur(t),this.inputHasFocus=!1}}),this.state._options.map((t,e)=>{const n=`-${e}`;return Array.isArray(t.options)?this.renderOptgroup(t,n):h("option",{disabled:t.disabled,key:n,selected:isSelected(this.state._value,t.value),value:n},t.label)}))))))}constructor(t){registerInstance(this,t),this.catchRef=t=>{this.selectRef=t},this._accessKey=void 0,this._alert=void 0,this._disabled=!1,this._error=void 0,this._hideError=!1,this._hideLabel=!1,this._hint="",this._icons=void 0,this._id=void 0,this._label=void 0,this._msg=void 0,this._multiple=!1,this._name=void 0,this._on=void 0,this._options=void 0,this._required=!1,this._shortKey=void 0,this._rows=void 0,this._syncValueBySelector=void 0,this._tabIndex=void 0,this._tooltipAlign="top",this._touched=!1,this._value=void 0,this.state={_hasValue:!1,_hideError:!1,_id:`id-${nonce()}`,_label:"",_multiple:!1,_options:[],_value:[]},this.inputHasFocus=!1,this.controller=new SelectController(this,"select",this.host)}showAsAlert(){return void 0===this.state._alert?Boolean(this.state._touched)&&!this.inputHasFocus:this.state._alert}validateAccessKey(t){this.controller.validateAccessKey(t)}validateAlert(t){this.controller.validateAlert(t)}validateDisabled(t){this.controller.validateDisabled(t)}validateError(t){this.controller.validateError(t)}validateHideError(t){this.controller.validateHideError(t)}validateHideLabel(t){this.controller.validateHideLabel(t)}validateHint(t){this.controller.validateHint(t)}validateIcons(t){this.controller.validateIcons(t)}validateId(t){this.controller.validateId(t)}validateLabel(t){this.controller.validateLabel(t)}validateMsg(t){this.controller.validateMsg(t)}validateMultiple(t){this.controller.validateMultiple(t)}validateName(t){this.controller.validateName(t)}validateOn(t){this.controller.validateOn(t)}validateOptions(t){this.controller.validateOptions(t)}validateRequired(t){this.controller.validateRequired(t)}validateRows(t){this.controller.validateRows(t)}validateShortKey(t){this.controller.validateShortKey(t)}validateSyncValueBySelector(t){this.controller.validateSyncValueBySelector(t)}validateTabIndex(t){this.controller.validateTabIndex(t)}validateTouched(t){this.controller.validateTouched(t)}validateValue(t){this.controller.validateValue(t)}componentWillLoad(){this._touched=!0===this._touched,this.controller.componentWillLoad(),this.state._hasValue=!!this.state._value,this.controller.addValueChangeListener(t=>this.state._hasValue=!!t)}onInput(t){var e,n,i;this._value=Array.from((null===(e=this.selectRef)||void 0===e?void 0:e.options)||[]).filter(t=>!0===t.selected).map(t=>{var e;return null===(e=this.controller.getOptionByKey(t.value))||void 0===e?void 0:e.value}),tryToDispatchKoliBriEvent("input",this.host,this._value),null===(i=null===(n=this.state._on)||void 0===n?void 0:n.onInput)||void 0===i||i.call(n,t,this._value)}onChange(t){var e,n;stopPropagation(t),tryToDispatchKoliBriEvent("change",this.host,this._value),this.controller.setFormAssociatedValue(this._value),null===(n=null===(e=this.state._on)||void 0===e?void 0:e.onChange)||void 0===n||n.call(e,t,this._value)}get host(){return getElement(this)}static get watchers(){return{_accessKey:["validateAccessKey"],_alert:["validateAlert"],_disabled:["validateDisabled"],_error:["validateError"],_hideError:["validateHideError"],_hideLabel:["validateHideLabel"],_hint:["validateHint"],_icons:["validateIcons"],_id:["validateId"],_label:["validateLabel"],_msg:["validateMsg"],_multiple:["validateMultiple"],_name:["validateName"],_on:["validateOn"],_options:["validateOptions"],_required:["validateRequired"],_rows:["validateRows"],_shortKey:["validateShortKey"],_syncValueBySelector:["validateSyncValueBySelector"],_tabIndex:["validateTabIndex"],_touched:["validateTouched"],_value:["validateValue"]}}};KolSelect.style={default:KolSelectDefaultStyle0};export{KolSelect as kol_select};
4
+ import{h,F as Fragment,H as Host,r as registerInstance,g as getElement}from"./index-e850ccc2.js";import{j as watchBoolean,v as watchJsonArrayString,A as buildBadgeTextString,B as showExpertSlot}from"./index-7a63e9eb.js";import{l as KolInputTag}from"./component-names-4cb1c62b.js";import{n as nonce}from"./dev.utils-da85e627.js";import{t as tryToDispatchKoliBriEvent,s as stopPropagation}from"./events-29e84d75.js";import{p as propagateSubmitEventToForm}from"./controller-728fbdd1.js";import{g as getRenderStates}from"./controller-c87b8bd9.js";import{I as InternalUnderlinedBadgeText}from"./InternalUnderlinedBadgeText-40aac46d.js";import{I as InputIconController}from"./controller-icon-b3eb5a58.js";import{f as fillKeyOptionMap,v as validateOptionsWithOptgroup}from"./controller-06c08e87.js";import{v as validateRows}from"./rows-8ed50d64.js";import"./associated.controller-d302adf7.js";import"./access-and-short-key-914780a7.js";import"./hide-label-0d754c8e.js";import"./label-7d1ce375.js";import"./tooltip-align-6964dd71.js";import"./align-f3101425.js";import"./icons-adcda9b0.js";class SelectController extends InputIconController{constructor(t,e,n){super(t,e,n),this.keyOptionMap=new Map,this.getOptionByKey=t=>this.keyOptionMap.get(t),this.isValueInOptions=(t,e)=>void 0!==e.find(e=>"string"==typeof e.value?e.value===t:!!Array.isArray(e.options)&&this.isValueInOptions(t,e.options)),this.filterValuesInOptions=(t,e)=>t.filter(t=>void 0!==this.isValueInOptions(t,e)),this.afterPatchOptions=(t,e,n,i)=>{"_value"===i&&this.setFormAssociatedValue(t)},this.beforePatchOptions=(t,e)=>{const n=e.has("_options")?e.get("_options"):this.component.state._options;if(Array.isArray(n)&&n.length>0){this.keyOptionMap.clear(),fillKeyOptionMap(this.keyOptionMap,n);const t=e.has("_value")?e.get("_value"):this.component.state._value,i=this.filterValuesInOptions(Array.isArray(t)&&t.length>0?t:[],n);!1===this.component._multiple&&0===i.length?e.set("_value",[n[0].value]):Array.isArray(t)&&i.length<t.length&&e.set("_value",i)}},this.component=t}validateOptions(t){validateOptionsWithOptgroup(this.component,t,{hooks:{afterPatch:this.afterPatchOptions,beforePatch:this.beforePatchOptions}})}validateMultiple(t){watchBoolean(this.component,"_multiple",t,{hooks:{afterPatch:this.afterPatchOptions,beforePatch:this.beforePatchOptions}})}validateRequired(t){watchBoolean(this.component,"_required",t)}validateRows(t){validateRows(this.component,t)}validateValue(t){watchJsonArrayString(this.component,"_value",()=>!0,t,void 0,{hooks:{afterPatch:this.afterPatchOptions,beforePatch:this.beforePatchOptions}})}componentWillLoad(){super.componentWillLoad(),this.validateOptions(this.component._options),this.validateMultiple(this.component._multiple),this.validateRequired(this.component._required),this.validateRows(this.component._rows),this.validateValue(this.component._value)}}const defaultStyleCss="@charset \"UTF-8\";\n/*\n * This file contains all rules for accessibility.\n */\n@layer kol-a11y {\n :host {\n /*\n * Minimum size of interactive elements.\n */\n --a11y-min-size: calc(44rem / var(--kolibri-root-font-size, 16));\n color: black;\n /*\n * No element should be used without a background and font color whose contrast ratio has\n * not been checked. By initially setting the background color to white and the font color\n * to black, the contrast ratio is ensured and explicit adjustment is forced.\n */\n background-color: white;\n /*\n * Verdana is an accessible font that can be used without requiring additional loading time.\n */\n font-family: Verdana;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n * {\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n hyphens: auto;\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n word-break: break-word;\n }\n /*\n * All interactive elements should have a minimum size of rem(44).\n */\n /* input:not([type='checkbox'], [type='radio'], [type='range']), */\n /* option, */\n /* select, */\n /* textarea, */\n button,\n .kol-input .input {\n min-width: var(--a11y-min-size);\n min-height: var(--a11y-min-size);\n }\n /*\n * Some interactive elements should not inherit the font-family and font-size.\n */\n a,\n button,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n input,\n option,\n select,\n textarea {\n /*\n * All elements should inherit the font family from his parent element.\n */\n font-family: inherit;\n /*\n * All elements should inherit the font size from his parent element.\n */\n font-size: inherit;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n /**\n * Sometimes we need the semantic element for accessibility reasons,\n * but we don't want to show it.\n *\n * - https://www.a11yproject.com/posts/how-to-hide-content/\n */\n .visually-hidden {\n position: fixed;\n top: 0;\n left: 0;\n width: 1px;\n height: 1px;\n overflow: hidden;\n white-space: nowrap;\n clip-path: inset(50%);\n }\n}\n@layer kol-global {\n /*\n * Dieses CSS stellt sicher, dass der Standard-Style\n * von A und Button resettet werden.\n */\n :is(a, button) {\n background-color: transparent;\n width: 100%; /* 100% needed for custom width from outside */\n margin: 0;\n padding: 0;\n border: none;\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 font-size: calc(16rem / var(--kolibri-root-font-size, 16));\n }\n * {\n /*\n * We prefer to box-sizing: border-box for all elements.\n */\n box-sizing: border-box;\n }\n /* KolSpan is a layout component with icons in all directions and a label text in the middle. */\n .kol-span-wc {\n display: grid;\n place-items: center;\n }\n /* The sub span in KolSpan is the horizontal span with icon left and right and the label text in the middle. */\n .kol-span-wc > span {\n display: flex;\n place-items: center;\n }\n a,\n button {\n cursor: pointer;\n }\n /* This is the text label. */\n .hide-label > .kol-span-wc > span > span {\n display: none;\n }\n /* Reset browser agent style. */\n button:disabled {\n color: unset;\n }\n .disabled label,\n .disabled:focus-within label,\n [aria-disabled=true],\n [aria-disabled=true]:focus,\n [disabled],\n [disabled]:focus {\n opacity: 0.5;\n outline: none;\n cursor: not-allowed;\n }\n [aria-disabled=true]:focus .kol-span-wc,\n [disabled]:focus .kol-span-wc {\n outline: none !important;\n }\n .badge-text-hint {\n color: black;\n background-color: lightgray;\n }\n}\n@layer kol-component {\n :host {\n display: block;\n }\n}\n@layer kol-component {\n .kol-tooltip-wc {\n display: contents;\n contain: layout;\n }\n .kol-tooltip-wc .tooltip-floating {\n display: none;\n position: fixed;\n /* Avoid layout interference - see https://floating-ui.com/docs/computePosition */\n top: 0;\n left: 0;\n /* Can be used to specify the tooltip-width from the outside. Unset by default. */\n width: var(--kol-tooltip-width);\n max-width: 90vw;\n max-height: 90vh;\n visibility: hidden;\n animation-duration: 0.25s;\n animation-iteration-count: 1;\n animation-name: fadeInOpacity;\n animation-timing-function: ease-in;\n }\n /* Shared between content and arrow */\n .kol-tooltip-wc .tooltip-area {\n color: #000;\n background-color: #fff;\n }\n .kol-tooltip-wc .tooltip-arrow {\n transform: rotate(45deg);\n position: absolute;\n z-index: 999;\n width: calc(10rem / var(--kolibri-root-font-size, 16));\n height: calc(10rem / var(--kolibri-root-font-size, 16));\n }\n .kol-tooltip-wc .tooltip-content {\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 .required label > span::after,\n .required legend > span::after {\n content: \"*\";\n }\n}\n@layer kol-component {\n input,\n textarea {\n cursor: text;\n }\n input[type=checkbox],\n input[type=color],\n input[type=file],\n input[type=radio],\n input[type=range],\n label,\n option,\n select {\n cursor: pointer;\n }\n /* input[type='checkbox'], */\n /* input[type='radio'], */\n /* input[type='range'], */\n input[type=color],\n input[type=date],\n input[type=datetime-local],\n input[type=email],\n input[type=file],\n input[type=month],\n input[type=number],\n input[type=password],\n input[type=search],\n input[type=tel],\n input[type=text],\n input[type=time],\n input[type=url],\n input[type=week],\n option,\n select,\n textarea {\n background-color: transparent;\n width: 100%;\n }\n /* needed hack for vertical alignment */\n input[type=file] {\n padding: calc((var(--a11y-min-size) - (16rem / var(--kolibri-root-font-size, 16))) / 10) 0.5em;\n }\n /* needed hack for vertical alignment */\n select[multiple] option {\n padding: calc((var(--a11y-min-size) - (16rem / var(--kolibri-root-font-size, 16))) / 2) 0.5em;\n }\n}\n@layer kol-component {\n .kol-alert-wc {\n display: grid;\n }\n .kol-alert-wc .heading {\n display: flex;\n place-items: center;\n }\n .kol-alert-wc .heading > div {\n flex-grow: 1;\n }\n .close {\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-input {\n display: grid;\n }\n .kol-input .input-slot {\n flex-grow: 1;\n }\n input:focus,\n option:focus,\n select:focus,\n textarea:focus {\n outline: 0;\n }\n .input {\n background-color: white;\n display: flex;\n align-items: center;\n cursor: pointer;\n }\n button:not([role=link]) {\n min-height: auto;\n }\n .input > .kol-icon {\n display: grid;\n place-items: center;\n }\n .kol-input.required .input-tooltip .span-label::after {\n content: \"*\";\n }\n}\n@layer kol-component {\n option:checked::before {\n content: \"✓ \";\n }\n}",KolSelectDefaultStyle0=defaultStyleCss,isSelected=(t,e)=>Array.isArray(t)&&t.includes(e),KolSelect=class{async getValue(){return this.state._value}async focus(){await this.kolFocus()}async kolFocus(){var t;null===(t=this.selectRef)||void 0===t||t.focus()}renderOptgroup(t,e){var n;return h("optgroup",{disabled:t.disabled,label:t.label},null===(n=t.options)||void 0===n?void 0:n.map((t,n)=>{const i=`${e}-${n}`;return Array.isArray(t.options)?this.renderOptgroup(t,i):h("option",{disabled:t.disabled,key:i,selected:isSelected(this.state._value,t.value),value:i},t.label)}))}render(){const{ariaDescribedBy:t}=getRenderStates(this.state),e=showExpertSlot(this.state._label);return h(Host,{key:"21b462515346780c325523c8c55c0d7322b0fc42",class:{"kol-select":!0,"has-value":this.state._hasValue}},h(KolInputTag,{key:"25fd8495fc3622fd6eb3b576163503e52194e4cd",class:{"hide-label":!!this.state._hideLabel,select:!0},_accessKey:this.state._accessKey,_alert:this.showAsAlert(),_disabled:this.state._disabled,_hideError:this.state._hideError,_hideLabel:this.state._hideLabel,_hint:this.state._hint,_icons:this.state._icons,_id:this.state._id,_label:this.state._label,_msg:this.state._msg,_required:this.state._required,_shortKey:this.state._shortKey,_tooltipAlign:this._tooltipAlign,_touched:this.state._touched,onClick:()=>{var t;return null===(t=this.selectRef)||void 0===t?void 0:t.focus()},role:"presentation"},h("span",{key:"45bb5fb9ca3af07674267472f841eadc229d5fa0",slot:"label"},e?h("slot",{name:"expert"}):"string"==typeof this.state._accessKey||"string"==typeof this.state._shortKey?h(Fragment,null,h(InternalUnderlinedBadgeText,{badgeText:buildBadgeTextString(this.state._accessKey,this.state._shortKey),label:this.state._label})," ",h("kbd",{class:"badge-text-hint","aria-hidden":"true"},buildBadgeTextString(this.state._accessKey,this.state._shortKey))):h("span",null,this.state._label)),h("div",{key:"66409c5cdab5caf00a390238917bafb10e587ad1",slot:"input"},h("form",{key:"fc2f1effeb153c22b5ee77289ec66bfdd1cf17ed",onSubmit:t=>{t.preventDefault(),propagateSubmitEventToForm({form:this.host,ref:this.selectRef})}},h("input",{key:"04b19515fb209a89e8c90be28ff1d136f454f468",type:"submit",hidden:!0}),h("select",Object.assign({key:"675f5c799f0e27bc9fb06d1dd7e1a81dda1de3ff",ref:this.catchRef,title:"",accessKey:this.state._accessKey,"aria-describedby":t.length>0?t.join(" "):void 0,"aria-label":this.state._hideLabel&&"string"==typeof this.state._label?this.state._label:void 0,autoCapitalize:"off",autoCorrect:"off",disabled:this.state._disabled,id:this.state._id,multiple:this.state._multiple,name:this.state._name,required:this.state._required,size:this.state._rows},this.controller.onFacade,{onInput:this.onInput.bind(this),onChange:this.onChange.bind(this),onFocus:t=>{this.controller.onFacade.onFocus(t),this.inputHasFocus=!0},onBlur:t=>{this.controller.onFacade.onBlur(t),this.inputHasFocus=!1}}),this.state._options.map((t,e)=>{const n=`-${e}`;return Array.isArray(t.options)?this.renderOptgroup(t,n):h("option",{disabled:t.disabled,key:n,selected:isSelected(this.state._value,t.value),value:n},t.label)}))))))}constructor(t){registerInstance(this,t),this.catchRef=t=>{this.selectRef=t},this._accessKey=void 0,this._alert=void 0,this._disabled=!1,this._error=void 0,this._hideError=!1,this._hideLabel=!1,this._hint="",this._icons=void 0,this._id=void 0,this._label=void 0,this._msg=void 0,this._multiple=!1,this._name=void 0,this._on=void 0,this._options=void 0,this._required=!1,this._shortKey=void 0,this._rows=void 0,this._syncValueBySelector=void 0,this._tabIndex=void 0,this._tooltipAlign="top",this._touched=!1,this._value=void 0,this.state={_hasValue:!1,_hideError:!1,_id:`id-${nonce()}`,_label:"",_multiple:!1,_options:[],_value:[]},this.inputHasFocus=!1,this.controller=new SelectController(this,"select",this.host)}showAsAlert(){return void 0===this.state._alert?Boolean(this.state._touched)&&!this.inputHasFocus:this.state._alert}validateAccessKey(t){this.controller.validateAccessKey(t)}validateAlert(t){this.controller.validateAlert(t)}validateDisabled(t){this.controller.validateDisabled(t)}validateError(t){this.controller.validateError(t)}validateHideError(t){this.controller.validateHideError(t)}validateHideLabel(t){this.controller.validateHideLabel(t)}validateHint(t){this.controller.validateHint(t)}validateIcons(t){this.controller.validateIcons(t)}validateId(t){this.controller.validateId(t)}validateLabel(t){this.controller.validateLabel(t)}validateMsg(t){this.controller.validateMsg(t)}validateMultiple(t){this.controller.validateMultiple(t)}validateName(t){this.controller.validateName(t)}validateOn(t){this.controller.validateOn(t)}validateOptions(t){this.controller.validateOptions(t)}validateRequired(t){this.controller.validateRequired(t)}validateRows(t){this.controller.validateRows(t)}validateShortKey(t){this.controller.validateShortKey(t)}validateSyncValueBySelector(t){this.controller.validateSyncValueBySelector(t)}validateTabIndex(t){this.controller.validateTabIndex(t)}validateTouched(t){this.controller.validateTouched(t)}validateValue(t){this.controller.validateValue(t)}componentWillLoad(){this._touched=!0===this._touched,this.controller.componentWillLoad(),this.state._hasValue=!!this.state._value,this.controller.addValueChangeListener(t=>this.state._hasValue=!!t)}onInput(t){var e,n,i;this._value=Array.from((null===(e=this.selectRef)||void 0===e?void 0:e.options)||[]).filter(t=>!0===t.selected).map(t=>{var e;return null===(e=this.controller.getOptionByKey(t.value))||void 0===e?void 0:e.value}),tryToDispatchKoliBriEvent("input",this.host,this._value),null===(i=null===(n=this.state._on)||void 0===n?void 0:n.onInput)||void 0===i||i.call(n,t,this._value)}onChange(t){var e,n;stopPropagation(t),tryToDispatchKoliBriEvent("change",this.host,this._value),this.controller.setFormAssociatedValue(this._value),null===(n=null===(e=this.state._on)||void 0===e?void 0:e.onChange)||void 0===n||n.call(e,t,this._value)}get host(){return getElement(this)}static get watchers(){return{_accessKey:["validateAccessKey"],_alert:["validateAlert"],_disabled:["validateDisabled"],_error:["validateError"],_hideError:["validateHideError"],_hideLabel:["validateHideLabel"],_hint:["validateHint"],_icons:["validateIcons"],_id:["validateId"],_label:["validateLabel"],_msg:["validateMsg"],_multiple:["validateMultiple"],_name:["validateName"],_on:["validateOn"],_options:["validateOptions"],_required:["validateRequired"],_rows:["validateRows"],_shortKey:["validateShortKey"],_syncValueBySelector:["validateSyncValueBySelector"],_tabIndex:["validateTabIndex"],_touched:["validateTouched"],_value:["validateValue"]}}};KolSelect.style={default:KolSelectDefaultStyle0};export{KolSelect as kol_select};
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * KoliBri - The accessible HTML-Standard
3
3
  */
4
- import{h,F as Fragment,H as Host,r as registerInstance,g as getElement}from"./index-8a68d70d.js";import{j as watchBoolean,w as watchValidator,y as watchString,F as watchNumber,A as buildBadgeTextString,B as showExpertSlot}from"./index-7a63e9eb.js";import{c as clsx}from"./clsx-09a06a12.js";import{l as KolInputTag,g as KolIconTag}from"./component-names-4cb1c62b.js";import{t as translate}from"./i18n-3dd5729d.js";import{n as nonce}from"./dev.utils-73ce9898.js";import{t as tryToDispatchKoliBriEvent}from"./events-29e84d75.js";import{g as getRenderStates}from"./controller-c87b8bd9.js";import{I as InternalUnderlinedBadgeText}from"./InternalUnderlinedBadgeText-c9ba3be5.js";import{I as InputIconController}from"./controller-icon-b3eb5a58.js";import{f as fillKeyOptionMap,b as validateOptions}from"./controller-06c08e87.js";import"./i18n-b14e6088.js";import"./associated.controller-d302adf7.js";import"./access-and-short-key-914780a7.js";import"./hide-label-0d754c8e.js";import"./label-7d1ce375.js";import"./tooltip-align-6964dd71.js";import"./align-f3101425.js";import"./icons-adcda9b0.js";class SingleSelectController extends InputIconController{constructor(e,t,n){super(e,t,n),this.keyOptionMap=new Map,this.afterPatchOptions=(e,t,n,i)=>{"_value"===i&&this.setFormAssociatedValue(e)},this.beforePatchOptions=(e,t)=>{const n=t.has("_options")?t.get("_options"):this.component.state._options;Array.isArray(n)&&n.length>0&&(this.keyOptionMap.clear(),fillKeyOptionMap(this.keyOptionMap,n))},this.component=e}validateOptions(e){validateOptions(this.component,e,{hooks:{afterPatch:this.afterPatchOptions,beforePatch:this.beforePatchOptions}})}validateRequired(e){watchBoolean(this.component,"_required",e)}validateValue(e){watchValidator(this.component,"_value",e=>void 0!==e,new Set(["KoliBriUnknown"]),e)}validatePlaceholder(e){watchString(this.component,"_placeholder",e)}validateHideClearButton(e){watchBoolean(this.component,"_hideClearButton",e)}validateRows(e){watchNumber(this.component,"_rows",e)}componentWillLoad(){super.componentWillLoad(),this.validateOptions(this.component._options),this.validateRequired(this.component._required),this.validateValue(this.component._value),this.validatePlaceholder(this.component._placeholder),this.validateHideClearButton(this.component._hideClearButton),this.validateRows(this.component._rows)}}const defaultStyleCss="/*\n * This file contains all rules for accessibility.\n */\n@layer kol-a11y {\n :host {\n /*\n * Minimum size of interactive elements.\n */\n --a11y-min-size: calc(44rem / var(--kolibri-root-font-size, 16));\n color: black;\n /*\n * No element should be used without a background and font color whose contrast ratio has\n * not been checked. By initially setting the background color to white and the font color\n * to black, the contrast ratio is ensured and explicit adjustment is forced.\n */\n background-color: white;\n /*\n * Verdana is an accessible font that can be used without requiring additional loading time.\n */\n font-family: Verdana;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n * {\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n hyphens: auto;\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n word-break: break-word;\n }\n /*\n * All interactive elements should have a minimum size of rem(44).\n */\n /* input:not([type='checkbox'], [type='radio'], [type='range']), */\n /* option, */\n /* select, */\n /* textarea, */\n button,\n .kol-input .input {\n min-width: var(--a11y-min-size);\n min-height: var(--a11y-min-size);\n }\n /*\n * Some interactive elements should not inherit the font-family and font-size.\n */\n a,\n button,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n input,\n option,\n select,\n textarea {\n /*\n * All elements should inherit the font family from his parent element.\n */\n font-family: inherit;\n /*\n * All elements should inherit the font size from his parent element.\n */\n font-size: inherit;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n /**\n * Sometimes we need the semantic element for accessibility reasons,\n * but we don't want to show it.\n *\n * - https://www.a11yproject.com/posts/how-to-hide-content/\n */\n .visually-hidden {\n position: fixed;\n top: 0;\n left: 0;\n width: 1px;\n height: 1px;\n overflow: hidden;\n white-space: nowrap;\n clip-path: inset(50%);\n }\n}\n@layer kol-global {\n /*\n * Dieses CSS stellt sicher, dass der Standard-Style\n * von A und Button resettet werden.\n */\n :is(a, button) {\n background-color: transparent;\n width: 100%; /* 100% needed for custom width from outside */\n margin: 0;\n padding: 0;\n border: none;\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 font-size: calc(16rem / var(--kolibri-root-font-size, 16));\n }\n * {\n /*\n * We prefer to box-sizing: border-box for all elements.\n */\n box-sizing: border-box;\n }\n /* KolSpan is a layout component with icons in all directions and a label text in the middle. */\n .kol-span-wc {\n display: grid;\n place-items: center;\n }\n /* The sub span in KolSpan is the horizontal span with icon left and right and the label text in the middle. */\n .kol-span-wc > span {\n display: flex;\n place-items: center;\n }\n a,\n button {\n cursor: pointer;\n }\n /* This is the text label. */\n .hide-label > .kol-span-wc > span > span {\n display: none;\n }\n /* Reset browser agent style. */\n button:disabled {\n color: unset;\n }\n .disabled label,\n .disabled:focus-within label,\n [aria-disabled=true],\n [aria-disabled=true]:focus,\n [disabled],\n [disabled]:focus {\n opacity: 0.5;\n outline: none;\n cursor: not-allowed;\n }\n [aria-disabled=true]:focus .kol-span-wc,\n [disabled]:focus .kol-span-wc {\n outline: none !important;\n }\n .badge-text-hint {\n color: black;\n background-color: lightgray;\n }\n}\n@layer kol-component {\n :host {\n display: block;\n }\n}\n@layer kol-component {\n .kol-tooltip-wc {\n display: contents;\n contain: layout;\n }\n .kol-tooltip-wc .tooltip-floating {\n display: none;\n position: fixed;\n /* Avoid layout interference - see https://floating-ui.com/docs/computePosition */\n top: 0;\n left: 0;\n /* Can be used to specify the tooltip-width from the outside. Unset by default. */\n width: var(--kol-tooltip-width);\n max-width: 90vw;\n max-height: 90vh;\n visibility: hidden;\n animation-duration: 0.25s;\n animation-iteration-count: 1;\n animation-name: fadeInOpacity;\n animation-timing-function: ease-in;\n }\n /* Shared between content and arrow */\n .kol-tooltip-wc .tooltip-area {\n color: #000;\n background-color: #fff;\n }\n .kol-tooltip-wc .tooltip-arrow {\n transform: rotate(45deg);\n position: absolute;\n z-index: 999;\n width: calc(10rem / var(--kolibri-root-font-size, 16));\n height: calc(10rem / var(--kolibri-root-font-size, 16));\n }\n .kol-tooltip-wc .tooltip-content {\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 .required label > span::after,\n .required legend > span::after {\n content: \"*\";\n }\n}\n@layer kol-component {\n input,\n textarea {\n cursor: text;\n }\n input[type=checkbox],\n input[type=color],\n input[type=file],\n input[type=radio],\n input[type=range],\n label,\n option,\n select {\n cursor: pointer;\n }\n /* input[type='checkbox'], */\n /* input[type='radio'], */\n /* input[type='range'], */\n input[type=color],\n input[type=date],\n input[type=datetime-local],\n input[type=email],\n input[type=file],\n input[type=month],\n input[type=number],\n input[type=password],\n input[type=search],\n input[type=tel],\n input[type=text],\n input[type=time],\n input[type=url],\n input[type=week],\n option,\n select,\n textarea {\n background-color: transparent;\n width: 100%;\n }\n /* needed hack for vertical alignment */\n input[type=file] {\n padding: calc((var(--a11y-min-size) - (16rem / var(--kolibri-root-font-size, 16))) / 10) 0.5em;\n }\n /* needed hack for vertical alignment */\n select[multiple] option {\n padding: calc((var(--a11y-min-size) - (16rem / var(--kolibri-root-font-size, 16))) / 2) 0.5em;\n }\n}\n@layer kol-component {\n .kol-alert-wc {\n display: grid;\n }\n .kol-alert-wc .heading {\n display: flex;\n place-items: center;\n }\n .kol-alert-wc .heading > div {\n flex-grow: 1;\n }\n .close {\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-input {\n display: grid;\n }\n .kol-input .input-slot {\n flex-grow: 1;\n }\n input:focus,\n option:focus,\n select:focus,\n textarea:focus {\n outline: 0;\n }\n .input {\n background-color: white;\n display: flex;\n align-items: center;\n cursor: pointer;\n }\n button:not([role=link]) {\n min-height: auto;\n }\n .input > .kol-icon {\n display: grid;\n place-items: center;\n }\n .kol-input.required .input-tooltip .span-label::after {\n content: \"*\";\n }\n}\n@layer kol-component {\n .single-select {\n position: relative;\n }\n .single-select.disabled, .single-select.disabled * {\n cursor: not-allowed !important;\n }\n .single-select__group {\n display: inline-flex;\n align-items: center;\n }\n .single-select__input {\n flex-grow: 1;\n }\n .single-select__button {\n width: var(--a11y-min-size);\n height: auto;\n }\n .single-select__listbox {\n background-color: white;\n display: block;\n position: absolute;\n z-index: 2;\n max-height: calc((40rem / var(--kolibri-root-font-size, 16)) * var(--visible-options, 5) + (2rem / var(--kolibri-root-font-size, 16))) !important;\n margin: 0;\n padding: 0;\n overflow-x: hidden;\n overflow-y: auto;\n list-style-type: none;\n }\n .single-select__item.highlighted {\n background-color: #f0f0f0;\n }\n .single-select__listbox--cursor-hidden .single-select__item {\n cursor: none !important;\n }\n .single-select__no-results-message {\n display: flex;\n min-height: calc(50rem / var(--kolibri-root-font-size, 16));\n align-items: center;\n justify-content: center;\n cursor: default;\n }\n}",KolSingleSelectDefaultStyle0=defaultStyleCss,KolSingleSelect=class{async getValue(){return this._value}async kolFocus(){var e;null===(e=this.refInput)||void 0===e||e.focus()}onBlur(){var e,t,n;const i=null===(e=this.state._options)||void 0===e?void 0:e.find(e=>{var t,n;return(null===(t=e.label)||void 0===t?void 0:t.toLowerCase())===(null===(n=this._inputValue)||void 0===n?void 0:n.toLowerCase())});i?this.selectOption(i):(this._inputValue=null===(n=null===(t=this.state._options)||void 0===t?void 0:t.find(e=>e.value===this._value))||void 0===n?void 0:n.label,this._filteredOptions=[...this.state._options]),this._isOpen=!1,this._hasOpened=!1}createEventWithTarget(e,t){const n=new CustomEvent(e,{bubbles:!0,detail:t});return this.refInput&&(Object.defineProperty(n,"target",{value:this.refInput}),Object.defineProperty(n,"currentTarget",{value:this.refInput})),n}clearSelection(){if(!this.state._disabled){const e=null;this._focusedOptionIndex=-1,this._value=e,this._inputValue="",this._filteredOptions=[...this.state._options];const t=this.createEventWithTarget("input",{name:this.state._name,value:e}),n=this.createEventWithTarget("change",{name:this.state._name,value:e});this.controller.onFacade.onInput(t,!0,{value:e}),this.controller.onFacade.onChange(n,{value:e})}}selectOption(e){var t,n;this._value=e.value,this._inputValue=e.label;const i=this.createEventWithTarget("input",{name:null!==(t=this.state._name)&&void 0!==t?t:"",value:e.value}),o=this.createEventWithTarget("change",{name:null!==(n=this.state._name)&&void 0!==n?n:"",value:e.value});this.controller.onFacade.onInput(i,!1,e.value),this.controller.onFacade.onChange(o,e.value),this._filteredOptions=[...this.state._options],this.controller.setFormAssociatedValue(this._value)}onInput(e){const t=e.target;this._inputValue=t.value,this._isOpen=!0,this.setFilteredOptionsByQuery(t.value),this._focusedOptionIndex=-1}handleKeyDownDropdown(e){1===e.key.length&&/[a-z0-9]/i.test(e.key)&&(e.preventDefault(),this._isOpen=!0,this.focusSuggestionStartingWith(e.key))}setFilteredOptionsByQuery(e){""===(null==e?void 0:e.trim())?this._filteredOptions=[...this.state._options]:Array.isArray(this.state._options)&&this.state._options.length>0&&e.length>0&&(this._filteredOptions=this.state._options.filter(t=>{var n,i;return null===(i=null===(n=t.label)||void 0===n?void 0:n.toLowerCase())||void 0===i?void 0:i.includes(null==e?void 0:e.toLowerCase())}))}moveFocus(e){if(!this._filteredOptions)return;let t=this._focusedOptionIndex+e;t>=this._filteredOptions.length&&(t=0),t<0&&(t=this._filteredOptions.length-1),this._focusedOptionIndex=t,this.focusOption(this._focusedOptionIndex)}focusOption(e){if(this.refOptions){const t=this.refOptions[e];null==t||t.focus()}}focusSuggestionStartingWith(e){const t=e.toLowerCase(),n=Array.isArray(this._filteredOptions)&&this._filteredOptions.findIndex(e=>e.label.toLowerCase().startsWith(t));"number"==typeof n&&(this._focusedOptionIndex=n,this.focusOption(n))}render(){var e;const t=showExpertSlot(this.state._label),{ariaDescribedBy:n}=getRenderStates(this.state);return h(Host,{key:"dc3138e5d26bf2378a912798f4d74df22b9f40e5",class:"kol-single-select"},h("div",{key:"0e66657247dd08a547763a40f11d1bd265cca470",class:`single-select ${!0===this.state._disabled?"disabled":""} `},h(KolInputTag,{key:"3bf80abe04b484fd849936644c4de583ea08160b",_accessKey:this.state._accessKey,_alert:this.showAsAlert(),_disabled:this.state._disabled,_hideError:this.state._hideError,_hideLabel:this.state._hideLabel,_hint:this.state._hint,_icons:this.state._icons,_id:this.state._id,_label:this.state._label,_msg:this.state._msg,_required:this.state._required,_shortKey:this.state._shortKey,_tooltipAlign:this._tooltipAlign,_touched:this.state._touched,role:"presentation"},h("span",{key:"3a27fc72a26d502f5f1a50656e39f81f9c0d9d26",slot:"label"},t?h("slot",{name:"expert"}):"string"==typeof this.state._accessKey||"string"==typeof this.state._shortKey?h(Fragment,null,h(InternalUnderlinedBadgeText,{badgeText:buildBadgeTextString(this.state._accessKey||this.state._shortKey),label:this.state._label})," ",h("kbd",{class:"badge-text-hint","aria-hidden":"true"},buildBadgeTextString(this.state._accessKey||this.state._shortKey))):h("span",null,this.state._label)),h("div",{key:"287432b2cc43c8536d0b59e9e4495a12227e6916",slot:"input"},h("div",{key:"feb7b795dc4a6ab2447167222d9a3973f868a7da",class:"single-select__group"},h("input",Object.assign({key:"0269ac20421be08d3bcbcaed90e9537805144265",ref:this.catchRef,class:"single-select__input","data-testid":"single-select-input",type:"text","aria-autocomplete":"both","aria-controls":"listbox",value:this._inputValue,accessKey:this.state._accessKey,"aria-describedby":n.length>0?n.join(" "):void 0,"aria-label":this.state._hideLabel&&"string"==typeof this.state._label?this.state._label:void 0,"aria-activedescendant":this._isOpen&&this._focusedOptionIndex>=0?`option-${this._focusedOptionIndex}`:void 0,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",disabled:this.state._disabled,name:this.state._name,required:this.state._required},this.controller.onFacade,{onInput:this.onInput.bind(this),onChange:this.onChange.bind(this),onClick:this.toggleListbox.bind(this),onFocus:e=>{this.controller.onFacade.onFocus(e),this.inputHasFocus=!0},onBlur:e=>{this.controller.onFacade.onBlur(e),this.inputHasFocus=!1},placeholder:this.state._placeholder})),this._inputValue&&!this.state._hideClearButton&&h(KolIconTag,{key:"c164fce346fa45496dbfbd00eaf4f233b2dd2d0e",_icons:"codicon codicon-close",_label:translate("kol-delete-selection"),onClick:()=>{var e;this.clearSelection(),null===(e=this.refInput)||void 0===e||e.focus()},class:"single-select__delete"}),h("button",{key:"7789846b0cf22c722d3829e40f1d080c74dbdb35",tabindex:"-1",class:"single-select__button",onClick:this.toggleListbox.bind(this),disabled:this.state._disabled},h(KolIconTag,{key:"271820f17ac5c260ca3c84d558d50357dad2de11",_icons:"codicon codicon-triangle-down",_label:translate("kol-dropdown")}))),this._isOpen&&!(!0===this.state._disabled)&&h("ul",{key:"32a63fa612e7142e4b85ead40ee6ff2edeeae6b2",role:"listbox",class:clsx("single-select__listbox",this.blockSuggestionMouseOver&&"single-select__listbox--cursor-hidden"),style:{"--visible-options":`${null!==(e=this._rows)&&void 0!==e?e:5}`},onKeyDown:this.handleKeyDownDropdown.bind(this)},Array.isArray(this._filteredOptions)&&this._filteredOptions.length>0?this._filteredOptions.map((e,t)=>h("li",{id:`option-${t}`,key:`-${t}`,ref:e=>{e&&(this.refOptions[t]=e)},tabIndex:-1,role:"option","aria-selected":this._value===e.value?"true":void 0,onClick:t=>{var n;this.selectOption(e),null===(n=this.refInput)||void 0===n||n.focus(),this.toggleListbox(t),this._isOpen=!1,this._hasOpened=!1},onMouseOver:()=>{this.blockSuggestionMouseOver||(this._focusedOptionIndex=t,this.focusOption(t))},onFocus:()=>{this._focusedOptionIndex=t,this.focusOption(t)},class:"single-select__item",onKeyDown:t=>{var n;"Enter"!==t.key&&"NumpadEnter"!==t.key||(this.selectOption(e),null===(n=this.refInput)||void 0===n||n.focus(),this.toggleListbox(t),t.preventDefault())}},h("input",{class:"visually-hidden",type:"radio",name:"options",id:`option-radio-${t}`,value:e.value,checked:this._value===e.value||t===this._focusedOptionIndex}),h("label",{htmlFor:`option-radio-${t}`,class:"radio-label"},e.label))):h("li",{class:"single-select__no-results-message"},translate("kol-no-results-message")," "))))))}handleFocusOut(){setTimeout(()=>{var e;(null===(e=this.host)||void 0===e?void 0:e.contains(document.activeElement))||this.onBlur()},0)}handleWindowBlur(){this.onBlur()}handleKeyDown(e){var t,n;const i=(t,n)=>{var i;e.preventDefault(),void 0!==t&&(this._isOpen=t,t||null===(i=this.refInput)||void 0===i||i.focus()),null==n||n()};switch(e.key){case"Down":case"ArrowDown":this.blockSuggestionMouseOver=!0,i(!0,()=>this.moveFocus(1));break;case"Up":case"ArrowUp":this.blockSuggestionMouseOver=!0,i(!0,()=>this.moveFocus(-1));break;case"Tab":this._isOpen&&(this._isOpen=!this._isOpen,null===(t=this.refInput)||void 0===t||t.focus());break;case"Esc":case"Escape":this._hasOpened=!1,this._isOpen=!1,i(!1);break;case" ":this._isOpen?Array.isArray(this._filteredOptions)&&this._filteredOptions.length>0&&(this.selectOption(this._filteredOptions[this._focusedOptionIndex]),null===(n=this.refInput)||void 0===n||n.focus(),i(!1)):this.toggleListbox(e);break;case"NumpadEnter":case"Enter":this.toggleListbox(e),this._hasOpened=!1,this._isOpen=!1;break;case"Home":this.blockSuggestionMouseOver=!0,i(void 0,()=>{this._isOpen&&(this._focusedOptionIndex=0,this.focusOption(this._focusedOptionIndex))});break;case"End":this.blockSuggestionMouseOver=!0,i(void 0,()=>{this._isOpen&&(this._focusedOptionIndex=this._filteredOptions?this._filteredOptions.length-1:0,this.focusOption(this._focusedOptionIndex))});break;case"PageUp":this.blockSuggestionMouseOver=!0,i(void 0,()=>this._isOpen&&this.moveFocus(-10));break;case"PageDown":this.blockSuggestionMouseOver=!0,i(void 0,()=>this._isOpen&&this.moveFocus(10))}}constructor(e){registerInstance(this,e),this.refOptions=[],this.catchRef=e=>{this.refInput=e},this.toggleListbox=e=>{var t;if(null==e||e.preventDefault(),!this.state._disabled&&!this._hasOpened){this._isOpen=!0,this._hasOpened=!0,null===(t=this.refInput)||void 0===t||t.focus();const e=Array.isArray(this._filteredOptions)?this._filteredOptions.findIndex(e=>e.label===this._inputValue):-1,n=this.refOptions[e];null==n||n.scrollIntoView({block:"nearest"}),this.focusOption(this._focusedOptionIndex)}},this._focusedOptionIndex=-1,this._isOpen=!1,this._hasOpened=!1,this._filteredOptions=[],this._inputValue="",this.blockSuggestionMouseOver=!1,this._accessKey=void 0,this._placeholder=void 0,this._alert=void 0,this._disabled=!1,this._hideError=!1,this._hideLabel=!1,this._hint="",this._icons=void 0,this._id=void 0,this._label=void 0,this._msg=void 0,this._name=void 0,this._on=void 0,this._options=void 0,this._required=!1,this._shortKey=void 0,this._syncValueBySelector=void 0,this._tabIndex=void 0,this._tooltipAlign="top",this._touched=!1,this._value=void 0,this._hideClearButton=!1,this._rows=void 0,this.state={_hideError:!1,_id:`id-${nonce()}`,_label:"",_options:[],_hideClearButton:!1},this.inputHasFocus=!1,this.controller=new SingleSelectController(this,"single-select",this.host)}showAsAlert(){return void 0===this.state._alert?Boolean(this.state._touched)&&!this.inputHasFocus:this.state._alert}validatePlaceholder(e){this.controller.validatePlaceholder(e)}validateAccessKey(e){this.controller.validateAccessKey(e)}validateAlert(e){this.controller.validateAlert(e)}validateDisabled(e){this.controller.validateDisabled(e)}validateHideError(e){this.controller.validateHideError(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)}validateMsg(e){this.controller.validateMsg(e)}validateName(e){this.controller.validateName(e)}validateOn(e){this.controller.validateOn(e)}validateOptions(e){this.controller.validateOptions(e),this._filteredOptions=e,this.updateInputValue(this._value)}validateRequired(e){this.controller.validateRequired(e)}validateShortKey(e){this.controller.validateShortKey(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),this.oldValue=e,this.updateInputValue(e)}validateHideClearButton(e){this.controller.validateHideClearButton(e)}validateRows(e){this.controller.validateRows(e)}handleMouseEvent(){this.blockSuggestionMouseOver=!1}updateInputValue(e){if(Array.isArray(this._options)){const t=this._options.find(t=>t.value===e);this._inputValue=t?String(t.label):""}}componentWillLoad(){this.refOptions=[],this._touched=!0===this._touched,this.controller.componentWillLoad(),this.oldValue=this._value,this._filteredOptions=this.state._options,this.updateInputValue(this._value)}onChange(e){var t,n,i,o;this.oldValue!==(null===(t=this.refInput)||void 0===t?void 0:t.value)&&(this.oldValue=null===(n=this.refInput)||void 0===n?void 0:n.value),tryToDispatchKoliBriEvent("change",this.host,this._value),"function"!=typeof(null===(i=this.state._on)||void 0===i?void 0:i.onChange)||this._isOpen||this.state._on.onChange(e,this._value&&this.oldValue!==(null===(o=this.refInput)||void 0===o?void 0:o.value))}static get delegatesFocus(){return!0}get host(){return getElement(this)}static get watchers(){return{_placeholder:["validatePlaceholder"],_accessKey:["validateAccessKey"],_alert:["validateAlert"],_disabled:["validateDisabled"],_hideError:["validateHideError"],_hideLabel:["validateHideLabel"],_hint:["validateHint"],_icons:["validateIcons"],_id:["validateId"],_label:["validateLabel"],_msg:["validateMsg"],_name:["validateName"],_on:["validateOn"],_options:["validateOptions"],_required:["validateRequired"],_shortKey:["validateShortKey"],_syncValueBySelector:["validateSyncValueBySelector"],_tabIndex:["validateTabIndex"],_touched:["validateTouched"],_value:["validateValue"],"_hideClearButton ":["validateHideClearButton"],_rows:["validateRows"]}}};KolSingleSelect.style={default:KolSingleSelectDefaultStyle0};export{KolSingleSelect as kol_single_select};
4
+ import{h,F as Fragment,H as Host,r as registerInstance,g as getElement}from"./index-e850ccc2.js";import{j as watchBoolean,w as watchValidator,y as watchString,F as watchNumber,A as buildBadgeTextString,B as showExpertSlot}from"./index-7a63e9eb.js";import{c as clsx}from"./clsx-09a06a12.js";import{l as KolInputTag,g as KolIconTag}from"./component-names-4cb1c62b.js";import{t as translate}from"./i18n-3dd5729d.js";import{n as nonce}from"./dev.utils-da85e627.js";import{t as tryToDispatchKoliBriEvent}from"./events-29e84d75.js";import{g as getRenderStates}from"./controller-c87b8bd9.js";import{I as InternalUnderlinedBadgeText}from"./InternalUnderlinedBadgeText-40aac46d.js";import{I as InputIconController}from"./controller-icon-b3eb5a58.js";import{f as fillKeyOptionMap,b as validateOptions}from"./controller-06c08e87.js";import"./i18n-b14e6088.js";import"./associated.controller-d302adf7.js";import"./access-and-short-key-914780a7.js";import"./hide-label-0d754c8e.js";import"./label-7d1ce375.js";import"./tooltip-align-6964dd71.js";import"./align-f3101425.js";import"./icons-adcda9b0.js";class SingleSelectController extends InputIconController{constructor(e,t,n){super(e,t,n),this.keyOptionMap=new Map,this.afterPatchOptions=(e,t,n,i)=>{"_value"===i&&this.setFormAssociatedValue(e)},this.beforePatchOptions=(e,t)=>{const n=t.has("_options")?t.get("_options"):this.component.state._options;Array.isArray(n)&&n.length>0&&(this.keyOptionMap.clear(),fillKeyOptionMap(this.keyOptionMap,n))},this.component=e}validateOptions(e){validateOptions(this.component,e,{hooks:{afterPatch:this.afterPatchOptions,beforePatch:this.beforePatchOptions}})}validateRequired(e){watchBoolean(this.component,"_required",e)}validateValue(e){watchValidator(this.component,"_value",e=>void 0!==e,new Set(["KoliBriUnknown"]),e)}validatePlaceholder(e){watchString(this.component,"_placeholder",e)}validateHideClearButton(e){watchBoolean(this.component,"_hideClearButton",e)}validateRows(e){watchNumber(this.component,"_rows",e)}componentWillLoad(){super.componentWillLoad(),this.validateOptions(this.component._options),this.validateRequired(this.component._required),this.validateValue(this.component._value),this.validatePlaceholder(this.component._placeholder),this.validateHideClearButton(this.component._hideClearButton),this.validateRows(this.component._rows)}}const defaultStyleCss="/*\n * This file contains all rules for accessibility.\n */\n@layer kol-a11y {\n :host {\n /*\n * Minimum size of interactive elements.\n */\n --a11y-min-size: calc(44rem / var(--kolibri-root-font-size, 16));\n color: black;\n /*\n * No element should be used without a background and font color whose contrast ratio has\n * not been checked. By initially setting the background color to white and the font color\n * to black, the contrast ratio is ensured and explicit adjustment is forced.\n */\n background-color: white;\n /*\n * Verdana is an accessible font that can be used without requiring additional loading time.\n */\n font-family: Verdana;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n * {\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n hyphens: auto;\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n word-break: break-word;\n }\n /*\n * All interactive elements should have a minimum size of rem(44).\n */\n /* input:not([type='checkbox'], [type='radio'], [type='range']), */\n /* option, */\n /* select, */\n /* textarea, */\n button,\n .kol-input .input {\n min-width: var(--a11y-min-size);\n min-height: var(--a11y-min-size);\n }\n /*\n * Some interactive elements should not inherit the font-family and font-size.\n */\n a,\n button,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n input,\n option,\n select,\n textarea {\n /*\n * All elements should inherit the font family from his parent element.\n */\n font-family: inherit;\n /*\n * All elements should inherit the font size from his parent element.\n */\n font-size: inherit;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n /**\n * Sometimes we need the semantic element for accessibility reasons,\n * but we don't want to show it.\n *\n * - https://www.a11yproject.com/posts/how-to-hide-content/\n */\n .visually-hidden {\n position: fixed;\n top: 0;\n left: 0;\n width: 1px;\n height: 1px;\n overflow: hidden;\n white-space: nowrap;\n clip-path: inset(50%);\n }\n}\n@layer kol-global {\n /*\n * Dieses CSS stellt sicher, dass der Standard-Style\n * von A und Button resettet werden.\n */\n :is(a, button) {\n background-color: transparent;\n width: 100%; /* 100% needed for custom width from outside */\n margin: 0;\n padding: 0;\n border: none;\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 font-size: calc(16rem / var(--kolibri-root-font-size, 16));\n }\n * {\n /*\n * We prefer to box-sizing: border-box for all elements.\n */\n box-sizing: border-box;\n }\n /* KolSpan is a layout component with icons in all directions and a label text in the middle. */\n .kol-span-wc {\n display: grid;\n place-items: center;\n }\n /* The sub span in KolSpan is the horizontal span with icon left and right and the label text in the middle. */\n .kol-span-wc > span {\n display: flex;\n place-items: center;\n }\n a,\n button {\n cursor: pointer;\n }\n /* This is the text label. */\n .hide-label > .kol-span-wc > span > span {\n display: none;\n }\n /* Reset browser agent style. */\n button:disabled {\n color: unset;\n }\n .disabled label,\n .disabled:focus-within label,\n [aria-disabled=true],\n [aria-disabled=true]:focus,\n [disabled],\n [disabled]:focus {\n opacity: 0.5;\n outline: none;\n cursor: not-allowed;\n }\n [aria-disabled=true]:focus .kol-span-wc,\n [disabled]:focus .kol-span-wc {\n outline: none !important;\n }\n .badge-text-hint {\n color: black;\n background-color: lightgray;\n }\n}\n@layer kol-component {\n :host {\n display: block;\n }\n}\n@layer kol-component {\n .kol-tooltip-wc {\n display: contents;\n contain: layout;\n }\n .kol-tooltip-wc .tooltip-floating {\n display: none;\n position: fixed;\n /* Avoid layout interference - see https://floating-ui.com/docs/computePosition */\n top: 0;\n left: 0;\n /* Can be used to specify the tooltip-width from the outside. Unset by default. */\n width: var(--kol-tooltip-width);\n max-width: 90vw;\n max-height: 90vh;\n visibility: hidden;\n animation-duration: 0.25s;\n animation-iteration-count: 1;\n animation-name: fadeInOpacity;\n animation-timing-function: ease-in;\n }\n /* Shared between content and arrow */\n .kol-tooltip-wc .tooltip-area {\n color: #000;\n background-color: #fff;\n }\n .kol-tooltip-wc .tooltip-arrow {\n transform: rotate(45deg);\n position: absolute;\n z-index: 999;\n width: calc(10rem / var(--kolibri-root-font-size, 16));\n height: calc(10rem / var(--kolibri-root-font-size, 16));\n }\n .kol-tooltip-wc .tooltip-content {\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 .required label > span::after,\n .required legend > span::after {\n content: \"*\";\n }\n}\n@layer kol-component {\n input,\n textarea {\n cursor: text;\n }\n input[type=checkbox],\n input[type=color],\n input[type=file],\n input[type=radio],\n input[type=range],\n label,\n option,\n select {\n cursor: pointer;\n }\n /* input[type='checkbox'], */\n /* input[type='radio'], */\n /* input[type='range'], */\n input[type=color],\n input[type=date],\n input[type=datetime-local],\n input[type=email],\n input[type=file],\n input[type=month],\n input[type=number],\n input[type=password],\n input[type=search],\n input[type=tel],\n input[type=text],\n input[type=time],\n input[type=url],\n input[type=week],\n option,\n select,\n textarea {\n background-color: transparent;\n width: 100%;\n }\n /* needed hack for vertical alignment */\n input[type=file] {\n padding: calc((var(--a11y-min-size) - (16rem / var(--kolibri-root-font-size, 16))) / 10) 0.5em;\n }\n /* needed hack for vertical alignment */\n select[multiple] option {\n padding: calc((var(--a11y-min-size) - (16rem / var(--kolibri-root-font-size, 16))) / 2) 0.5em;\n }\n}\n@layer kol-component {\n .kol-alert-wc {\n display: grid;\n }\n .kol-alert-wc .heading {\n display: flex;\n place-items: center;\n }\n .kol-alert-wc .heading > div {\n flex-grow: 1;\n }\n .close {\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-input {\n display: grid;\n }\n .kol-input .input-slot {\n flex-grow: 1;\n }\n input:focus,\n option:focus,\n select:focus,\n textarea:focus {\n outline: 0;\n }\n .input {\n background-color: white;\n display: flex;\n align-items: center;\n cursor: pointer;\n }\n button:not([role=link]) {\n min-height: auto;\n }\n .input > .kol-icon {\n display: grid;\n place-items: center;\n }\n .kol-input.required .input-tooltip .span-label::after {\n content: \"*\";\n }\n}\n@layer kol-component {\n .single-select {\n position: relative;\n }\n .single-select.disabled, .single-select.disabled * {\n cursor: not-allowed !important;\n }\n .single-select__group {\n display: inline-flex;\n align-items: center;\n }\n .single-select__input {\n flex-grow: 1;\n }\n .single-select__button {\n width: var(--a11y-min-size);\n height: auto;\n }\n .single-select__listbox {\n background-color: white;\n display: block;\n position: absolute;\n z-index: 2;\n max-height: calc((40rem / var(--kolibri-root-font-size, 16)) * var(--visible-options, 5) + (2rem / var(--kolibri-root-font-size, 16))) !important;\n margin: 0;\n padding: 0;\n overflow-x: hidden;\n overflow-y: auto;\n list-style-type: none;\n }\n .single-select__item.highlighted {\n background-color: #f0f0f0;\n }\n .single-select__listbox--cursor-hidden .single-select__item {\n cursor: none !important;\n }\n .single-select__no-results-message {\n display: flex;\n min-height: calc(50rem / var(--kolibri-root-font-size, 16));\n align-items: center;\n justify-content: center;\n cursor: default;\n }\n}",KolSingleSelectDefaultStyle0=defaultStyleCss,KolSingleSelect=class{async getValue(){return this._value}async kolFocus(){var e;null===(e=this.refInput)||void 0===e||e.focus()}onBlur(){var e,t,n;const i=null===(e=this.state._options)||void 0===e?void 0:e.find(e=>{var t,n;return(null===(t=e.label)||void 0===t?void 0:t.toLowerCase())===(null===(n=this._inputValue)||void 0===n?void 0:n.toLowerCase())});i?this.selectOption(i):(this._inputValue=null===(n=null===(t=this.state._options)||void 0===t?void 0:t.find(e=>e.value===this._value))||void 0===n?void 0:n.label,this._filteredOptions=[...this.state._options]),this._isOpen=!1,this._hasOpened=!1}createEventWithTarget(e,t){const n=new CustomEvent(e,{bubbles:!0,detail:t});return this.refInput&&(Object.defineProperty(n,"target",{value:this.refInput}),Object.defineProperty(n,"currentTarget",{value:this.refInput})),n}clearSelection(){if(!this.state._disabled){const e=null;this._focusedOptionIndex=-1,this._value=e,this._inputValue="",this._filteredOptions=[...this.state._options];const t=this.createEventWithTarget("input",{name:this.state._name,value:e}),n=this.createEventWithTarget("change",{name:this.state._name,value:e});this.controller.onFacade.onInput(t,!0,{value:e}),this.controller.onFacade.onChange(n,{value:e})}}selectOption(e){var t,n;this._value=e.value,this._inputValue=e.label;const i=this.createEventWithTarget("input",{name:null!==(t=this.state._name)&&void 0!==t?t:"",value:e.value}),o=this.createEventWithTarget("change",{name:null!==(n=this.state._name)&&void 0!==n?n:"",value:e.value});this.controller.onFacade.onInput(i,!1,e.value),this.controller.onFacade.onChange(o,e.value),this._filteredOptions=[...this.state._options],this.controller.setFormAssociatedValue(this._value)}onInput(e){const t=e.target;this._inputValue=t.value,this._isOpen=!0,this.setFilteredOptionsByQuery(t.value),this._focusedOptionIndex=-1}handleKeyDownDropdown(e){1===e.key.length&&/[a-z0-9]/i.test(e.key)&&(e.preventDefault(),this._isOpen=!0,this.focusSuggestionStartingWith(e.key))}setFilteredOptionsByQuery(e){""===(null==e?void 0:e.trim())?this._filteredOptions=[...this.state._options]:Array.isArray(this.state._options)&&this.state._options.length>0&&e.length>0&&(this._filteredOptions=this.state._options.filter(t=>{var n,i;return null===(i=null===(n=t.label)||void 0===n?void 0:n.toLowerCase())||void 0===i?void 0:i.includes(null==e?void 0:e.toLowerCase())}))}moveFocus(e){if(!this._filteredOptions)return;let t=this._focusedOptionIndex+e;t>=this._filteredOptions.length&&(t=0),t<0&&(t=this._filteredOptions.length-1),this._focusedOptionIndex=t,this.focusOption(this._focusedOptionIndex)}focusOption(e){if(this.refOptions){const t=this.refOptions[e];null==t||t.focus()}}focusSuggestionStartingWith(e){const t=e.toLowerCase(),n=Array.isArray(this._filteredOptions)&&this._filteredOptions.findIndex(e=>e.label.toLowerCase().startsWith(t));"number"==typeof n&&(this._focusedOptionIndex=n,this.focusOption(n))}render(){var e;const t=showExpertSlot(this.state._label),{ariaDescribedBy:n}=getRenderStates(this.state);return h(Host,{key:"dc3138e5d26bf2378a912798f4d74df22b9f40e5",class:"kol-single-select"},h("div",{key:"0e66657247dd08a547763a40f11d1bd265cca470",class:`single-select ${!0===this.state._disabled?"disabled":""} `},h(KolInputTag,{key:"3bf80abe04b484fd849936644c4de583ea08160b",_accessKey:this.state._accessKey,_alert:this.showAsAlert(),_disabled:this.state._disabled,_hideError:this.state._hideError,_hideLabel:this.state._hideLabel,_hint:this.state._hint,_icons:this.state._icons,_id:this.state._id,_label:this.state._label,_msg:this.state._msg,_required:this.state._required,_shortKey:this.state._shortKey,_tooltipAlign:this._tooltipAlign,_touched:this.state._touched,role:"presentation"},h("span",{key:"3a27fc72a26d502f5f1a50656e39f81f9c0d9d26",slot:"label"},t?h("slot",{name:"expert"}):"string"==typeof this.state._accessKey||"string"==typeof this.state._shortKey?h(Fragment,null,h(InternalUnderlinedBadgeText,{badgeText:buildBadgeTextString(this.state._accessKey||this.state._shortKey),label:this.state._label})," ",h("kbd",{class:"badge-text-hint","aria-hidden":"true"},buildBadgeTextString(this.state._accessKey||this.state._shortKey))):h("span",null,this.state._label)),h("div",{key:"287432b2cc43c8536d0b59e9e4495a12227e6916",slot:"input"},h("div",{key:"feb7b795dc4a6ab2447167222d9a3973f868a7da",class:"single-select__group"},h("input",Object.assign({key:"0269ac20421be08d3bcbcaed90e9537805144265",ref:this.catchRef,class:"single-select__input","data-testid":"single-select-input",type:"text","aria-autocomplete":"both","aria-controls":"listbox",value:this._inputValue,accessKey:this.state._accessKey,"aria-describedby":n.length>0?n.join(" "):void 0,"aria-label":this.state._hideLabel&&"string"==typeof this.state._label?this.state._label:void 0,"aria-activedescendant":this._isOpen&&this._focusedOptionIndex>=0?`option-${this._focusedOptionIndex}`:void 0,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",disabled:this.state._disabled,name:this.state._name,required:this.state._required},this.controller.onFacade,{onInput:this.onInput.bind(this),onChange:this.onChange.bind(this),onClick:this.toggleListbox.bind(this),onFocus:e=>{this.controller.onFacade.onFocus(e),this.inputHasFocus=!0},onBlur:e=>{this.controller.onFacade.onBlur(e),this.inputHasFocus=!1},placeholder:this.state._placeholder})),this._inputValue&&!this.state._hideClearButton&&h(KolIconTag,{key:"c164fce346fa45496dbfbd00eaf4f233b2dd2d0e",_icons:"codicon codicon-close",_label:translate("kol-delete-selection"),onClick:()=>{var e;this.clearSelection(),null===(e=this.refInput)||void 0===e||e.focus()},class:"single-select__delete"}),h("button",{key:"7789846b0cf22c722d3829e40f1d080c74dbdb35",tabindex:"-1",class:"single-select__button",onClick:this.toggleListbox.bind(this),disabled:this.state._disabled},h(KolIconTag,{key:"271820f17ac5c260ca3c84d558d50357dad2de11",_icons:"codicon codicon-triangle-down",_label:translate("kol-dropdown")}))),this._isOpen&&!(!0===this.state._disabled)&&h("ul",{key:"32a63fa612e7142e4b85ead40ee6ff2edeeae6b2",role:"listbox",class:clsx("single-select__listbox",this.blockSuggestionMouseOver&&"single-select__listbox--cursor-hidden"),style:{"--visible-options":`${null!==(e=this._rows)&&void 0!==e?e:5}`},onKeyDown:this.handleKeyDownDropdown.bind(this)},Array.isArray(this._filteredOptions)&&this._filteredOptions.length>0?this._filteredOptions.map((e,t)=>h("li",{id:`option-${t}`,key:`-${t}`,ref:e=>{e&&(this.refOptions[t]=e)},tabIndex:-1,role:"option","aria-selected":this._value===e.value?"true":void 0,onClick:t=>{var n;this.selectOption(e),null===(n=this.refInput)||void 0===n||n.focus(),this.toggleListbox(t),this._isOpen=!1,this._hasOpened=!1},onMouseOver:()=>{this.blockSuggestionMouseOver||(this._focusedOptionIndex=t,this.focusOption(t))},onFocus:()=>{this._focusedOptionIndex=t,this.focusOption(t)},class:"single-select__item",onKeyDown:t=>{var n;"Enter"!==t.key&&"NumpadEnter"!==t.key||(this.selectOption(e),null===(n=this.refInput)||void 0===n||n.focus(),this.toggleListbox(t),t.preventDefault())}},h("input",{class:"visually-hidden",type:"radio",name:"options",id:`option-radio-${t}`,value:e.value,checked:this._value===e.value||t===this._focusedOptionIndex}),h("label",{htmlFor:`option-radio-${t}`,class:"radio-label"},e.label))):h("li",{class:"single-select__no-results-message"},translate("kol-no-results-message")," "))))))}handleFocusOut(){setTimeout(()=>{var e;(null===(e=this.host)||void 0===e?void 0:e.contains(document.activeElement))||this.onBlur()},0)}handleWindowBlur(){this.onBlur()}handleKeyDown(e){var t,n;const i=(t,n)=>{var i;e.preventDefault(),void 0!==t&&(this._isOpen=t,t||null===(i=this.refInput)||void 0===i||i.focus()),null==n||n()};switch(e.key){case"Down":case"ArrowDown":this.blockSuggestionMouseOver=!0,i(!0,()=>this.moveFocus(1));break;case"Up":case"ArrowUp":this.blockSuggestionMouseOver=!0,i(!0,()=>this.moveFocus(-1));break;case"Tab":this._isOpen&&(this._isOpen=!this._isOpen,null===(t=this.refInput)||void 0===t||t.focus());break;case"Esc":case"Escape":this._hasOpened=!1,this._isOpen=!1,i(!1);break;case" ":this._isOpen?Array.isArray(this._filteredOptions)&&this._filteredOptions.length>0&&(this.selectOption(this._filteredOptions[this._focusedOptionIndex]),null===(n=this.refInput)||void 0===n||n.focus(),i(!1)):this.toggleListbox(e);break;case"NumpadEnter":case"Enter":this.toggleListbox(e),this._hasOpened=!1,this._isOpen=!1;break;case"Home":this.blockSuggestionMouseOver=!0,i(void 0,()=>{this._isOpen&&(this._focusedOptionIndex=0,this.focusOption(this._focusedOptionIndex))});break;case"End":this.blockSuggestionMouseOver=!0,i(void 0,()=>{this._isOpen&&(this._focusedOptionIndex=this._filteredOptions?this._filteredOptions.length-1:0,this.focusOption(this._focusedOptionIndex))});break;case"PageUp":this.blockSuggestionMouseOver=!0,i(void 0,()=>this._isOpen&&this.moveFocus(-10));break;case"PageDown":this.blockSuggestionMouseOver=!0,i(void 0,()=>this._isOpen&&this.moveFocus(10))}}constructor(e){registerInstance(this,e),this.refOptions=[],this.catchRef=e=>{this.refInput=e},this.toggleListbox=e=>{var t;if(null==e||e.preventDefault(),!this.state._disabled&&!this._hasOpened){this._isOpen=!0,this._hasOpened=!0,null===(t=this.refInput)||void 0===t||t.focus();const e=Array.isArray(this._filteredOptions)?this._filteredOptions.findIndex(e=>e.label===this._inputValue):-1,n=this.refOptions[e];null==n||n.scrollIntoView({block:"nearest"}),this.focusOption(this._focusedOptionIndex)}},this._focusedOptionIndex=-1,this._isOpen=!1,this._hasOpened=!1,this._filteredOptions=[],this._inputValue="",this.blockSuggestionMouseOver=!1,this._accessKey=void 0,this._placeholder=void 0,this._alert=void 0,this._disabled=!1,this._hideError=!1,this._hideLabel=!1,this._hint="",this._icons=void 0,this._id=void 0,this._label=void 0,this._msg=void 0,this._name=void 0,this._on=void 0,this._options=void 0,this._required=!1,this._shortKey=void 0,this._syncValueBySelector=void 0,this._tabIndex=void 0,this._tooltipAlign="top",this._touched=!1,this._value=void 0,this._hideClearButton=!1,this._rows=void 0,this.state={_hideError:!1,_id:`id-${nonce()}`,_label:"",_options:[],_hideClearButton:!1},this.inputHasFocus=!1,this.controller=new SingleSelectController(this,"single-select",this.host)}showAsAlert(){return void 0===this.state._alert?Boolean(this.state._touched)&&!this.inputHasFocus:this.state._alert}validatePlaceholder(e){this.controller.validatePlaceholder(e)}validateAccessKey(e){this.controller.validateAccessKey(e)}validateAlert(e){this.controller.validateAlert(e)}validateDisabled(e){this.controller.validateDisabled(e)}validateHideError(e){this.controller.validateHideError(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)}validateMsg(e){this.controller.validateMsg(e)}validateName(e){this.controller.validateName(e)}validateOn(e){this.controller.validateOn(e)}validateOptions(e){this.controller.validateOptions(e),this._filteredOptions=e,this.updateInputValue(this._value)}validateRequired(e){this.controller.validateRequired(e)}validateShortKey(e){this.controller.validateShortKey(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),this.oldValue=e,this.updateInputValue(e)}validateHideClearButton(e){this.controller.validateHideClearButton(e)}validateRows(e){this.controller.validateRows(e)}handleMouseEvent(){this.blockSuggestionMouseOver=!1}updateInputValue(e){if(Array.isArray(this._options)){const t=this._options.find(t=>t.value===e);this._inputValue=t?String(t.label):""}}componentWillLoad(){this.refOptions=[],this._touched=!0===this._touched,this.controller.componentWillLoad(),this.oldValue=this._value,this._filteredOptions=this.state._options,this.updateInputValue(this._value)}onChange(e){var t,n,i,o;this.oldValue!==(null===(t=this.refInput)||void 0===t?void 0:t.value)&&(this.oldValue=null===(n=this.refInput)||void 0===n?void 0:n.value),tryToDispatchKoliBriEvent("change",this.host,this._value),"function"!=typeof(null===(i=this.state._on)||void 0===i?void 0:i.onChange)||this._isOpen||this.state._on.onChange(e,this._value&&this.oldValue!==(null===(o=this.refInput)||void 0===o?void 0:o.value))}static get delegatesFocus(){return!0}get host(){return getElement(this)}static get watchers(){return{_placeholder:["validatePlaceholder"],_accessKey:["validateAccessKey"],_alert:["validateAlert"],_disabled:["validateDisabled"],_hideError:["validateHideError"],_hideLabel:["validateHideLabel"],_hint:["validateHint"],_icons:["validateIcons"],_id:["validateId"],_label:["validateLabel"],_msg:["validateMsg"],_name:["validateName"],_on:["validateOn"],_options:["validateOptions"],_required:["validateRequired"],_shortKey:["validateShortKey"],_syncValueBySelector:["validateSyncValueBySelector"],_tabIndex:["validateTabIndex"],_touched:["validateTouched"],_value:["validateValue"],"_hideClearButton ":["validateHideClearButton"],_rows:["validateRows"]}}};KolSingleSelect.style={default:KolSingleSelectDefaultStyle0};export{KolSingleSelect as kol_single_select};
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * KoliBri - The accessible HTML-Standard
3
3
  */
4
- import{r as registerInstance,h,H as Host}from"./index-8a68d70d.js";import"./index-7a63e9eb.js";import{r as removeNavLabel,a as addNavLabel}from"./unique-nav-labels-4be6182a.js";import{w as watchNavLinks}from"./validation-7170ea32.js";import{j as KolLinkWcTag}from"./component-names-4cb1c62b.js";import{v as validateLabel}from"./label-7d1ce375.js";const defaultStyleCss="/*\n * This file contains all rules for accessibility.\n */\n@layer kol-a11y {\n :host {\n /*\n * Minimum size of interactive elements.\n */\n --a11y-min-size: calc(44rem / var(--kolibri-root-font-size, 16));\n color: black;\n /*\n * No element should be used without a background and font color whose contrast ratio has\n * not been checked. By initially setting the background color to white and the font color\n * to black, the contrast ratio is ensured and explicit adjustment is forced.\n */\n background-color: white;\n /*\n * Verdana is an accessible font that can be used without requiring additional loading time.\n */\n font-family: Verdana;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n * {\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n hyphens: auto;\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n word-break: break-word;\n }\n /*\n * All interactive elements should have a minimum size of rem(44).\n */\n /* input:not([type='checkbox'], [type='radio'], [type='range']), */\n /* option, */\n /* select, */\n /* textarea, */\n button,\n .kol-input .input {\n min-width: var(--a11y-min-size);\n min-height: var(--a11y-min-size);\n }\n /*\n * Some interactive elements should not inherit the font-family and font-size.\n */\n a,\n button,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n input,\n option,\n select,\n textarea {\n /*\n * All elements should inherit the font family from his parent element.\n */\n font-family: inherit;\n /*\n * All elements should inherit the font size from his parent element.\n */\n font-size: inherit;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n /**\n * Sometimes we need the semantic element for accessibility reasons,\n * but we don't want to show it.\n *\n * - https://www.a11yproject.com/posts/how-to-hide-content/\n */\n .visually-hidden {\n position: fixed;\n top: 0;\n left: 0;\n width: 1px;\n height: 1px;\n overflow: hidden;\n white-space: nowrap;\n clip-path: inset(50%);\n }\n}\n@layer kol-global {\n /*\n * Dieses CSS stellt sicher, dass der Standard-Style\n * von A und Button resettet werden.\n */\n :is(a, button) {\n background-color: transparent;\n width: 100%; /* 100% needed for custom width from outside */\n margin: 0;\n padding: 0;\n border: none;\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 font-size: calc(16rem / var(--kolibri-root-font-size, 16));\n }\n * {\n /*\n * We prefer to box-sizing: border-box for all elements.\n */\n box-sizing: border-box;\n }\n /* KolSpan is a layout component with icons in all directions and a label text in the middle. */\n .kol-span-wc {\n display: grid;\n place-items: center;\n }\n /* The sub span in KolSpan is the horizontal span with icon left and right and the label text in the middle. */\n .kol-span-wc > span {\n display: flex;\n place-items: center;\n }\n a,\n button {\n cursor: pointer;\n }\n /* This is the text label. */\n .hide-label > .kol-span-wc > span > span {\n display: none;\n }\n /* Reset browser agent style. */\n button:disabled {\n color: unset;\n }\n .disabled label,\n .disabled:focus-within label,\n [aria-disabled=true],\n [aria-disabled=true]:focus,\n [disabled],\n [disabled]:focus {\n opacity: 0.5;\n outline: none;\n cursor: not-allowed;\n }\n [aria-disabled=true]:focus .kol-span-wc,\n [disabled]:focus .kol-span-wc {\n outline: none !important;\n }\n .badge-text-hint {\n color: black;\n background-color: lightgray;\n }\n}\n@layer kol-component {\n ul {\n display: grid;\n place-items: center;\n list-style: none;\n }\n ul li {\n height: 0;\n }\n .kol-link-wc a {\n position: absolute;\n left: calc(-99999rem / var(--kolibri-root-font-size, 16));\n z-index: 9999999;\n line-height: 1;\n }\n .kol-link-wc a:focus {\n background-color: #fff;\n position: unset;\n left: unset;\n }\n}",KolSkipNavDefaultStyle0=defaultStyleCss,KolSkipNav=class{constructor(n){registerInstance(this,n),this._label=void 0,this._links=void 0,this.state={_label:"",_links:[]}}render(){return h(Host,{key:"f29c8a4158c4341821fcad18594cd382ef61ccd9",class:"kol-skip-nav"},h("nav",{key:"e747f5e6fe1d2da606d507983e008657f57dcede","aria-label":this.state._label},h("ul",{key:"719ba2c745ee86290bb2f232a6c09610059f86b2"},this.state._links.map((n,e)=>h("li",{key:e},h(KolLinkWcTag,Object.assign({},n)))))))}validateLabel(n,e,t=!1){t||removeNavLabel(this.state._label),validateLabel(this,n,{required:!0}),addNavLabel(this.state._label)}validateLinks(n){watchNavLinks("KolSkipNav",this,n)}componentWillLoad(){this.validateLabel(this._label,void 0,!0),this.validateLinks(this._links)}disconnectedCallback(){removeNavLabel(this.state._label)}static get watchers(){return{_label:["validateLabel"],_links:["validateLinks"]}}};KolSkipNav.style={default:KolSkipNavDefaultStyle0};export{KolSkipNav as kol_skip_nav};
4
+ import{r as registerInstance,h,H as Host}from"./index-e850ccc2.js";import"./index-7a63e9eb.js";import{r as removeNavLabel,a as addNavLabel}from"./unique-nav-labels-4be6182a.js";import{w as watchNavLinks}from"./validation-7170ea32.js";import{j as KolLinkWcTag}from"./component-names-4cb1c62b.js";import{v as validateLabel}from"./label-7d1ce375.js";const defaultStyleCss="/*\n * This file contains all rules for accessibility.\n */\n@layer kol-a11y {\n :host {\n /*\n * Minimum size of interactive elements.\n */\n --a11y-min-size: calc(44rem / var(--kolibri-root-font-size, 16));\n color: black;\n /*\n * No element should be used without a background and font color whose contrast ratio has\n * not been checked. By initially setting the background color to white and the font color\n * to black, the contrast ratio is ensured and explicit adjustment is forced.\n */\n background-color: white;\n /*\n * Verdana is an accessible font that can be used without requiring additional loading time.\n */\n font-family: Verdana;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n * {\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n hyphens: auto;\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n word-break: break-word;\n }\n /*\n * All interactive elements should have a minimum size of rem(44).\n */\n /* input:not([type='checkbox'], [type='radio'], [type='range']), */\n /* option, */\n /* select, */\n /* textarea, */\n button,\n .kol-input .input {\n min-width: var(--a11y-min-size);\n min-height: var(--a11y-min-size);\n }\n /*\n * Some interactive elements should not inherit the font-family and font-size.\n */\n a,\n button,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n input,\n option,\n select,\n textarea {\n /*\n * All elements should inherit the font family from his parent element.\n */\n font-family: inherit;\n /*\n * All elements should inherit the font size from his parent element.\n */\n font-size: inherit;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n /**\n * Sometimes we need the semantic element for accessibility reasons,\n * but we don't want to show it.\n *\n * - https://www.a11yproject.com/posts/how-to-hide-content/\n */\n .visually-hidden {\n position: fixed;\n top: 0;\n left: 0;\n width: 1px;\n height: 1px;\n overflow: hidden;\n white-space: nowrap;\n clip-path: inset(50%);\n }\n}\n@layer kol-global {\n /*\n * Dieses CSS stellt sicher, dass der Standard-Style\n * von A und Button resettet werden.\n */\n :is(a, button) {\n background-color: transparent;\n width: 100%; /* 100% needed for custom width from outside */\n margin: 0;\n padding: 0;\n border: none;\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 font-size: calc(16rem / var(--kolibri-root-font-size, 16));\n }\n * {\n /*\n * We prefer to box-sizing: border-box for all elements.\n */\n box-sizing: border-box;\n }\n /* KolSpan is a layout component with icons in all directions and a label text in the middle. */\n .kol-span-wc {\n display: grid;\n place-items: center;\n }\n /* The sub span in KolSpan is the horizontal span with icon left and right and the label text in the middle. */\n .kol-span-wc > span {\n display: flex;\n place-items: center;\n }\n a,\n button {\n cursor: pointer;\n }\n /* This is the text label. */\n .hide-label > .kol-span-wc > span > span {\n display: none;\n }\n /* Reset browser agent style. */\n button:disabled {\n color: unset;\n }\n .disabled label,\n .disabled:focus-within label,\n [aria-disabled=true],\n [aria-disabled=true]:focus,\n [disabled],\n [disabled]:focus {\n opacity: 0.5;\n outline: none;\n cursor: not-allowed;\n }\n [aria-disabled=true]:focus .kol-span-wc,\n [disabled]:focus .kol-span-wc {\n outline: none !important;\n }\n .badge-text-hint {\n color: black;\n background-color: lightgray;\n }\n}\n@layer kol-component {\n ul {\n display: grid;\n place-items: center;\n list-style: none;\n }\n ul li {\n height: 0;\n }\n .kol-link-wc a {\n position: absolute;\n left: calc(-99999rem / var(--kolibri-root-font-size, 16));\n z-index: 9999999;\n line-height: 1;\n }\n .kol-link-wc a:focus {\n background-color: #fff;\n position: unset;\n left: unset;\n }\n}",KolSkipNavDefaultStyle0=defaultStyleCss,KolSkipNav=class{constructor(n){registerInstance(this,n),this._label=void 0,this._links=void 0,this.state={_label:"",_links:[]}}render(){return h(Host,{key:"f29c8a4158c4341821fcad18594cd382ef61ccd9",class:"kol-skip-nav"},h("nav",{key:"e747f5e6fe1d2da606d507983e008657f57dcede","aria-label":this.state._label},h("ul",{key:"719ba2c745ee86290bb2f232a6c09610059f86b2"},this.state._links.map((n,e)=>h("li",{key:e},h(KolLinkWcTag,Object.assign({},n)))))))}validateLabel(n,e,t=!1){t||removeNavLabel(this.state._label),validateLabel(this,n,{required:!0}),addNavLabel(this.state._label)}validateLinks(n){watchNavLinks("KolSkipNav",this,n)}componentWillLoad(){this.validateLabel(this._label,void 0,!0),this.validateLinks(this._links)}disconnectedCallback(){removeNavLabel(this.state._label)}static get watchers(){return{_label:["validateLabel"],_links:["validateLinks"]}}};KolSkipNav.style={default:KolSkipNavDefaultStyle0};export{KolSkipNav as kol_skip_nav};