@public-ui/components 2.2.18-rc.3 → 2.2.19-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (352) hide show
  1. package/custom-elements.json +1 -1
  2. package/dist/cjs/{Alert-b418e647.js → Alert-6b20ccf2.js} +1 -1
  3. package/dist/cjs/Alert-6b20ccf2.js.map +1 -0
  4. package/dist/cjs/{Collapsible-683f02bf.js → Collapsible-d6a43fb5.js} +1 -1
  5. package/dist/cjs/{Collapsible-683f02bf.js.map → Collapsible-d6a43fb5.js.map} +1 -1
  6. package/dist/cjs/FormFieldMsg-0b875270.js +4 -0
  7. package/dist/cjs/{FormFieldMsg-1a1d3926.js.map → FormFieldMsg-0b875270.js.map} +1 -1
  8. package/dist/cjs/{InternalUnderlinedBadgeText-b3a854ad.js → InternalUnderlinedBadgeText-032edb65.js} +1 -1
  9. package/dist/cjs/{InternalUnderlinedBadgeText-b3a854ad.js.map → InternalUnderlinedBadgeText-032edb65.js.map} +1 -1
  10. package/dist/cjs/{app-globals-31034bb5.js → app-globals-00fea29a.js} +1 -1
  11. package/dist/cjs/{app-globals-31034bb5.js.map → app-globals-00fea29a.js.map} +1 -1
  12. package/dist/cjs/{controller-c43af365.js → controller-0cb0dcc8.js} +1 -1
  13. package/dist/cjs/{controller-c43af365.js.map → controller-0cb0dcc8.js.map} +1 -1
  14. package/dist/cjs/controller-5f0b9d88.js +4 -0
  15. package/dist/cjs/controller-5f0b9d88.js.map +1 -0
  16. package/dist/cjs/{controller-d5e3c3cf.js → controller-92913356.js} +1 -1
  17. package/dist/cjs/{controller-d5e3c3cf.js.map → controller-92913356.js.map} +1 -1
  18. package/dist/cjs/{controller-54a1c7fe.js → controller-98c19677.js} +1 -1
  19. package/dist/cjs/{controller-54a1c7fe.js.map → controller-98c19677.js.map} +1 -1
  20. package/dist/cjs/{controller-icon-ae06d8fb.js → controller-icon-14c0c431.js} +1 -1
  21. package/dist/cjs/{controller-icon-ae06d8fb.js.map → controller-icon-14c0c431.js.map} +1 -1
  22. package/dist/cjs/{dev.utils-3bde43fd.js → dev.utils-28ae50b8.js} +1 -1
  23. package/dist/cjs/{dev.utils-3bde43fd.js.map → dev.utils-28ae50b8.js.map} +1 -1
  24. package/dist/cjs/{devtools-1059ea89.js → devtools-bb2f6207.js} +1 -1
  25. package/dist/cjs/{devtools-1059ea89.js.map → devtools-bb2f6207.js.map} +1 -1
  26. package/dist/cjs/{i18n-ae496e9d.js → i18n-d0affe26.js} +1 -1
  27. package/dist/cjs/{i18n-ae496e9d.js.map → i18n-d0affe26.js.map} +1 -1
  28. package/dist/cjs/i18n-d4db57d6.js +4 -0
  29. package/dist/cjs/i18n-d4db57d6.js.map +1 -0
  30. package/dist/cjs/{index-2caeb663.js → index-93503a6f.js} +1 -1
  31. package/dist/cjs/{index-2caeb663.js.map → index-93503a6f.js.map} +1 -1
  32. package/dist/cjs/index.cjs.js +1 -1
  33. package/dist/cjs/kol-abbr.cjs.entry.js +1 -1
  34. package/dist/cjs/kol-accordion.cjs.entry.js +1 -1
  35. package/dist/cjs/kol-alert-wc.cjs.entry.js +1 -1
  36. package/dist/cjs/kol-alert.cjs.entry.js +1 -1
  37. package/dist/cjs/kol-avatar-wc.cjs.entry.js +1 -1
  38. package/dist/cjs/kol-avatar.cjs.entry.js +1 -1
  39. package/dist/cjs/kol-badge.cjs.entry.js +1 -1
  40. package/dist/cjs/kol-badge.cjs.entry.js.map +1 -1
  41. package/dist/cjs/kol-breadcrumb.cjs.entry.js +1 -1
  42. package/dist/cjs/kol-button-group-wc.cjs.entry.js +1 -1
  43. package/dist/cjs/kol-button-group.cjs.entry.js +1 -1
  44. package/dist/cjs/kol-button-link.cjs.entry.js +1 -1
  45. package/dist/cjs/kol-button-wc.cjs.entry.js +1 -1
  46. package/dist/cjs/kol-button.cjs.entry.js +1 -1
  47. package/dist/cjs/kol-card.cjs.entry.js +1 -1
  48. package/dist/cjs/kol-combobox.cjs.entry.js +1 -1
  49. package/dist/cjs/kol-details.cjs.entry.js +1 -1
  50. package/dist/cjs/kol-drawer.cjs.entry.js +1 -1
  51. package/dist/cjs/kol-form.cjs.entry.js +1 -1
  52. package/dist/cjs/kol-heading-wc.cjs.entry.js +1 -1
  53. package/dist/cjs/kol-heading.cjs.entry.js +1 -1
  54. package/dist/cjs/kol-icon.cjs.entry.js +1 -1
  55. package/dist/cjs/kol-image.cjs.entry.js +1 -1
  56. package/dist/cjs/kol-indented-text-wc.cjs.entry.js +1 -1
  57. package/dist/cjs/kol-indented-text.cjs.entry.js +1 -1
  58. package/dist/cjs/kol-input-checkbox.cjs.entry.js +1 -1
  59. package/dist/cjs/kol-input-color.cjs.entry.js +1 -1
  60. package/dist/cjs/kol-input-date.cjs.entry.js +1 -1
  61. package/dist/cjs/kol-input-email.cjs.entry.js +1 -1
  62. package/dist/cjs/kol-input-file.cjs.entry.js +1 -1
  63. package/dist/cjs/kol-input-number.cjs.entry.js +1 -1
  64. package/dist/cjs/kol-input-password.cjs.entry.js +1 -1
  65. package/dist/cjs/kol-input-radio.cjs.entry.js +1 -1
  66. package/dist/cjs/kol-input-radio.cjs.entry.js.map +1 -1
  67. package/dist/cjs/kol-input-range.cjs.entry.js +1 -1
  68. package/dist/cjs/kol-input-text.cjs.entry.js +1 -1
  69. package/dist/cjs/kol-input.cjs.entry.js +1 -1
  70. package/dist/cjs/kol-kolibri.cjs.entry.js +1 -1
  71. package/dist/cjs/kol-link-button.cjs.entry.js +1 -1
  72. package/dist/cjs/kol-link-group.cjs.entry.js +1 -1
  73. package/dist/cjs/kol-link-wc.cjs.entry.js +1 -1
  74. package/dist/cjs/kol-link.cjs.entry.js +1 -1
  75. package/dist/cjs/kol-logo.cjs.entry.js +1 -1
  76. package/dist/cjs/kol-modal.cjs.entry.js +1 -1
  77. package/dist/cjs/kol-nav.cjs.entry.js +1 -1
  78. package/dist/cjs/kol-pagination.cjs.entry.js +1 -1
  79. package/dist/cjs/kol-popover-button.cjs.entry.js +1 -1
  80. package/dist/cjs/kol-popover-wc.cjs.entry.js +1 -1
  81. package/dist/cjs/kol-progress.cjs.entry.js +1 -1
  82. package/dist/cjs/kol-quote.cjs.entry.js +1 -1
  83. package/dist/cjs/kol-select.cjs.entry.js +1 -1
  84. package/dist/cjs/kol-single-select.cjs.entry.js +1 -1
  85. package/dist/cjs/kol-single-select.cjs.entry.js.map +1 -1
  86. package/dist/cjs/kol-skip-nav.cjs.entry.js +1 -1
  87. package/dist/cjs/kol-span-wc.cjs.entry.js +1 -1
  88. package/dist/cjs/kol-spin.cjs.entry.js +1 -1
  89. package/dist/cjs/kol-split-button.cjs.entry.js +1 -1
  90. package/dist/cjs/kol-symbol.cjs.entry.js +1 -1
  91. package/dist/cjs/kol-table-stateful.cjs.entry.js +1 -1
  92. package/dist/cjs/kol-table-stateless-wc.cjs.entry.js +1 -1
  93. package/dist/cjs/kol-table-stateless.cjs.entry.js +1 -1
  94. package/dist/cjs/kol-table.cjs.entry.js +1 -1
  95. package/dist/cjs/kol-tabs.cjs.entry.js +1 -1
  96. package/dist/cjs/kol-textarea.cjs.entry.js +1 -1
  97. package/dist/cjs/kol-toast-container.cjs.entry.js +1 -1
  98. package/dist/cjs/kol-toolbar.cjs.entry.js +1 -1
  99. package/dist/cjs/kol-tooltip-wc.cjs.entry.js +1 -1
  100. package/dist/cjs/kol-tree-item-wc.cjs.entry.js +1 -1
  101. package/dist/cjs/kol-tree-item.cjs.entry.js +1 -1
  102. package/dist/cjs/kol-tree-wc.cjs.entry.js +1 -1
  103. package/dist/cjs/kol-tree.cjs.entry.js +1 -1
  104. package/dist/cjs/kol-version.cjs.entry.js +1 -1
  105. package/dist/cjs/kolibri.cjs.js +1 -1
  106. package/dist/cjs/loader.cjs.js +1 -1
  107. package/dist/cjs/test-component.cjs.entry.js +1 -1
  108. package/dist/components/Alert.js +1 -1
  109. package/dist/components/Alert.js.map +1 -1
  110. package/dist/components/controller2.js +1 -1
  111. package/dist/components/controller2.js.map +1 -1
  112. package/dist/components/i18n.js +1 -1
  113. package/dist/components/i18n.js.map +1 -1
  114. package/dist/components/kol-badge.js +1 -1
  115. package/dist/components/kol-badge.js.map +1 -1
  116. package/dist/components/kol-input-radio.js +1 -1
  117. package/dist/components/kol-input-radio.js.map +1 -1
  118. package/dist/components/kol-single-select.js +1 -1
  119. package/dist/components/kol-single-select.js.map +1 -1
  120. package/dist/esm/{Alert-304de12c.js → Alert-0c514a6d.js} +1 -1
  121. package/dist/esm/Alert-0c514a6d.js.map +1 -0
  122. package/dist/esm/{Collapsible-e9e495e6.js → Collapsible-013530ba.js} +1 -1
  123. package/dist/esm/{Collapsible-e9e495e6.js.map → Collapsible-013530ba.js.map} +1 -1
  124. package/dist/esm/{FormFieldMsg-89b0a10f.js → FormFieldMsg-778709b3.js} +1 -1
  125. package/dist/esm/{FormFieldMsg-89b0a10f.js.map → FormFieldMsg-778709b3.js.map} +1 -1
  126. package/dist/esm/{InternalUnderlinedBadgeText-8401ab52.js → InternalUnderlinedBadgeText-64832a6c.js} +1 -1
  127. package/dist/esm/{InternalUnderlinedBadgeText-8401ab52.js.map → InternalUnderlinedBadgeText-64832a6c.js.map} +1 -1
  128. package/dist/esm/{app-globals-b7f7683e.js → app-globals-ccaba449.js} +1 -1
  129. package/dist/esm/{app-globals-b7f7683e.js.map → app-globals-ccaba449.js.map} +1 -1
  130. package/dist/esm/{controller-b80ab45c.js → controller-39af3c59.js} +1 -1
  131. package/dist/esm/{controller-b80ab45c.js.map → controller-39af3c59.js.map} +1 -1
  132. package/dist/esm/{controller-7a8fe823.js → controller-5f736145.js} +1 -1
  133. package/dist/esm/{controller-7a8fe823.js.map → controller-5f736145.js.map} +1 -1
  134. package/dist/esm/controller-628ce6cc.js +4 -0
  135. package/dist/esm/controller-628ce6cc.js.map +1 -0
  136. package/dist/esm/{controller-f2ec3fe1.js → controller-ea7356ee.js} +1 -1
  137. package/dist/esm/{controller-f2ec3fe1.js.map → controller-ea7356ee.js.map} +1 -1
  138. package/dist/esm/{controller-icon-cfb10b73.js → controller-icon-2d458d9b.js} +1 -1
  139. package/dist/esm/{controller-icon-cfb10b73.js.map → controller-icon-2d458d9b.js.map} +1 -1
  140. package/dist/esm/{dev.utils-9fe1c2ca.js → dev.utils-47c3024f.js} +1 -1
  141. package/dist/esm/{dev.utils-9fe1c2ca.js.map → dev.utils-47c3024f.js.map} +1 -1
  142. package/dist/esm/{devtools-cf6b236a.js → devtools-6184f489.js} +1 -1
  143. package/dist/esm/{devtools-cf6b236a.js.map → devtools-6184f489.js.map} +1 -1
  144. package/dist/esm/{i18n-3dd5729d.js → i18n-92411229.js} +1 -1
  145. package/dist/esm/{i18n-3dd5729d.js.map → i18n-92411229.js.map} +1 -1
  146. package/dist/esm/i18n-95419cc2.js +4 -0
  147. package/dist/esm/i18n-95419cc2.js.map +1 -0
  148. package/dist/esm/{index-1299b45a.js → index-baac09c0.js} +1 -1
  149. package/dist/esm/{index-1299b45a.js.map → index-baac09c0.js.map} +1 -1
  150. package/dist/esm/index.js +1 -1
  151. package/dist/esm/kol-abbr.entry.js +1 -1
  152. package/dist/esm/kol-accordion.entry.js +1 -1
  153. package/dist/esm/kol-alert-wc.entry.js +1 -1
  154. package/dist/esm/kol-alert.entry.js +1 -1
  155. package/dist/esm/kol-avatar-wc.entry.js +1 -1
  156. package/dist/esm/kol-avatar.entry.js +1 -1
  157. package/dist/esm/kol-badge.entry.js +1 -1
  158. package/dist/esm/kol-badge.entry.js.map +1 -1
  159. package/dist/esm/kol-breadcrumb.entry.js +1 -1
  160. package/dist/esm/kol-button-group-wc.entry.js +1 -1
  161. package/dist/esm/kol-button-group.entry.js +1 -1
  162. package/dist/esm/kol-button-link.entry.js +1 -1
  163. package/dist/esm/kol-button-wc.entry.js +1 -1
  164. package/dist/esm/kol-button.entry.js +1 -1
  165. package/dist/esm/kol-card.entry.js +1 -1
  166. package/dist/esm/kol-combobox.entry.js +1 -1
  167. package/dist/esm/kol-details.entry.js +1 -1
  168. package/dist/esm/kol-drawer.entry.js +1 -1
  169. package/dist/esm/kol-form.entry.js +1 -1
  170. package/dist/esm/kol-heading-wc.entry.js +1 -1
  171. package/dist/esm/kol-heading.entry.js +1 -1
  172. package/dist/esm/kol-icon.entry.js +1 -1
  173. package/dist/esm/kol-image.entry.js +1 -1
  174. package/dist/esm/kol-indented-text-wc.entry.js +1 -1
  175. package/dist/esm/kol-indented-text.entry.js +1 -1
  176. package/dist/esm/kol-input-checkbox.entry.js +1 -1
  177. package/dist/esm/kol-input-color.entry.js +1 -1
  178. package/dist/esm/kol-input-date.entry.js +1 -1
  179. package/dist/esm/kol-input-email.entry.js +1 -1
  180. package/dist/esm/kol-input-file.entry.js +1 -1
  181. package/dist/esm/kol-input-number.entry.js +1 -1
  182. package/dist/esm/kol-input-password.entry.js +1 -1
  183. package/dist/esm/kol-input-radio.entry.js +1 -1
  184. package/dist/esm/kol-input-radio.entry.js.map +1 -1
  185. package/dist/esm/kol-input-range.entry.js +1 -1
  186. package/dist/esm/kol-input-text.entry.js +1 -1
  187. package/dist/esm/kol-input.entry.js +1 -1
  188. package/dist/esm/kol-kolibri.entry.js +1 -1
  189. package/dist/esm/kol-link-button.entry.js +1 -1
  190. package/dist/esm/kol-link-group.entry.js +1 -1
  191. package/dist/esm/kol-link-wc.entry.js +1 -1
  192. package/dist/esm/kol-link.entry.js +1 -1
  193. package/dist/esm/kol-logo.entry.js +1 -1
  194. package/dist/esm/kol-modal.entry.js +1 -1
  195. package/dist/esm/kol-nav.entry.js +1 -1
  196. package/dist/esm/kol-pagination.entry.js +1 -1
  197. package/dist/esm/kol-popover-button.entry.js +1 -1
  198. package/dist/esm/kol-popover-wc.entry.js +1 -1
  199. package/dist/esm/kol-progress.entry.js +1 -1
  200. package/dist/esm/kol-quote.entry.js +1 -1
  201. package/dist/esm/kol-select.entry.js +1 -1
  202. package/dist/esm/kol-single-select.entry.js +1 -1
  203. package/dist/esm/kol-single-select.entry.js.map +1 -1
  204. package/dist/esm/kol-skip-nav.entry.js +1 -1
  205. package/dist/esm/kol-span-wc.entry.js +1 -1
  206. package/dist/esm/kol-spin.entry.js +1 -1
  207. package/dist/esm/kol-split-button.entry.js +1 -1
  208. package/dist/esm/kol-symbol.entry.js +1 -1
  209. package/dist/esm/kol-table-stateful.entry.js +1 -1
  210. package/dist/esm/kol-table-stateless-wc.entry.js +1 -1
  211. package/dist/esm/kol-table-stateless.entry.js +1 -1
  212. package/dist/esm/kol-table.entry.js +1 -1
  213. package/dist/esm/kol-tabs.entry.js +1 -1
  214. package/dist/esm/kol-textarea.entry.js +1 -1
  215. package/dist/esm/kol-toast-container.entry.js +1 -1
  216. package/dist/esm/kol-toolbar.entry.js +1 -1
  217. package/dist/esm/kol-tooltip-wc.entry.js +1 -1
  218. package/dist/esm/kol-tree-item-wc.entry.js +1 -1
  219. package/dist/esm/kol-tree-item.entry.js +1 -1
  220. package/dist/esm/kol-tree-wc.entry.js +1 -1
  221. package/dist/esm/kol-tree.entry.js +1 -1
  222. package/dist/esm/kol-version.entry.js +1 -1
  223. package/dist/esm/kolibri.js +1 -1
  224. package/dist/esm/loader.js +1 -1
  225. package/dist/esm/test-component.entry.js +1 -1
  226. package/dist/kolibri/Alert-0c514a6d.js +4 -0
  227. package/dist/kolibri/Alert-0c514a6d.js.map +1 -0
  228. package/dist/kolibri/{Collapsible-e9e495e6.js → Collapsible-013530ba.js} +1 -1
  229. package/dist/kolibri/FormFieldMsg-778709b3.js +4 -0
  230. package/dist/kolibri/InternalUnderlinedBadgeText-64832a6c.js +4 -0
  231. package/dist/kolibri/{app-globals-b7f7683e.js → app-globals-ccaba449.js} +1 -1
  232. package/dist/kolibri/{controller-b80ab45c.js → controller-39af3c59.js} +1 -1
  233. package/dist/kolibri/{controller-7a8fe823.js → controller-5f736145.js} +1 -1
  234. package/dist/kolibri/controller-628ce6cc.js +4 -0
  235. package/dist/kolibri/controller-628ce6cc.js.map +1 -0
  236. package/dist/kolibri/{controller-f2ec3fe1.js → controller-ea7356ee.js} +1 -1
  237. package/dist/kolibri/{controller-icon-cfb10b73.js → controller-icon-2d458d9b.js} +1 -1
  238. package/dist/kolibri/{dev.utils-9fe1c2ca.js → dev.utils-47c3024f.js} +1 -1
  239. package/dist/kolibri/{devtools-cf6b236a.js → devtools-6184f489.js} +1 -1
  240. package/dist/kolibri/i18n-92411229.js +4 -0
  241. package/dist/kolibri/i18n-95419cc2.js +4 -0
  242. package/dist/kolibri/i18n-95419cc2.js.map +1 -0
  243. package/dist/kolibri/{index-1299b45a.js → index-baac09c0.js} +1 -1
  244. package/dist/kolibri/{index-1299b45a.js.map → index-baac09c0.js.map} +1 -1
  245. package/dist/kolibri/index.esm.js +1 -1
  246. package/dist/kolibri/kol-abbr.entry.js +1 -1
  247. package/dist/kolibri/kol-accordion.entry.js +1 -1
  248. package/dist/kolibri/kol-alert-wc.entry.js +1 -1
  249. package/dist/kolibri/kol-alert.entry.js +1 -1
  250. package/dist/kolibri/kol-avatar-wc.entry.js +1 -1
  251. package/dist/kolibri/kol-avatar.entry.js +1 -1
  252. package/dist/kolibri/kol-badge.entry.js +1 -1
  253. package/dist/kolibri/kol-badge.entry.js.map +1 -1
  254. package/dist/kolibri/kol-breadcrumb.entry.js +1 -1
  255. package/dist/kolibri/kol-button-group-wc.entry.js +1 -1
  256. package/dist/kolibri/kol-button-group.entry.js +1 -1
  257. package/dist/kolibri/kol-button-link.entry.js +1 -1
  258. package/dist/kolibri/kol-button-wc.entry.js +1 -1
  259. package/dist/kolibri/kol-button.entry.js +1 -1
  260. package/dist/kolibri/kol-card.entry.js +1 -1
  261. package/dist/kolibri/kol-combobox.entry.js +1 -1
  262. package/dist/kolibri/kol-details.entry.js +1 -1
  263. package/dist/kolibri/kol-drawer.entry.js +1 -1
  264. package/dist/kolibri/kol-form.entry.js +1 -1
  265. package/dist/kolibri/kol-heading-wc.entry.js +1 -1
  266. package/dist/kolibri/kol-heading.entry.js +1 -1
  267. package/dist/kolibri/kol-icon.entry.js +1 -1
  268. package/dist/kolibri/kol-image.entry.js +1 -1
  269. package/dist/kolibri/kol-indented-text-wc.entry.js +1 -1
  270. package/dist/kolibri/kol-indented-text.entry.js +1 -1
  271. package/dist/kolibri/kol-input-checkbox.entry.js +1 -1
  272. package/dist/kolibri/kol-input-color.entry.js +1 -1
  273. package/dist/kolibri/kol-input-date.entry.js +1 -1
  274. package/dist/kolibri/kol-input-email.entry.js +1 -1
  275. package/dist/kolibri/kol-input-file.entry.js +1 -1
  276. package/dist/kolibri/kol-input-number.entry.js +1 -1
  277. package/dist/kolibri/kol-input-password.entry.js +1 -1
  278. package/dist/kolibri/kol-input-radio.entry.js +1 -1
  279. package/dist/kolibri/kol-input-radio.entry.js.map +1 -1
  280. package/dist/kolibri/kol-input-range.entry.js +1 -1
  281. package/dist/kolibri/kol-input-text.entry.js +1 -1
  282. package/dist/kolibri/kol-input.entry.js +1 -1
  283. package/dist/kolibri/kol-input.entry.js.map +1 -1
  284. package/dist/kolibri/kol-kolibri.entry.js +1 -1
  285. package/dist/kolibri/kol-link-button.entry.js +1 -1
  286. package/dist/kolibri/kol-link-group.entry.js +1 -1
  287. package/dist/kolibri/kol-link-wc.entry.js +1 -1
  288. package/dist/kolibri/kol-link.entry.js +1 -1
  289. package/dist/kolibri/kol-logo.entry.js +1 -1
  290. package/dist/kolibri/kol-modal.entry.js +1 -1
  291. package/dist/kolibri/kol-nav.entry.js +1 -1
  292. package/dist/kolibri/kol-pagination.entry.js +1 -1
  293. package/dist/kolibri/kol-popover-button.entry.js +1 -1
  294. package/dist/kolibri/kol-popover-wc.entry.js +1 -1
  295. package/dist/kolibri/kol-progress.entry.js +1 -1
  296. package/dist/kolibri/kol-quote.entry.js +1 -1
  297. package/dist/kolibri/kol-select.entry.js +1 -1
  298. package/dist/kolibri/kol-single-select.entry.js +1 -1
  299. package/dist/kolibri/kol-single-select.entry.js.map +1 -1
  300. package/dist/kolibri/kol-skip-nav.entry.js +1 -1
  301. package/dist/kolibri/kol-span-wc.entry.js +1 -1
  302. package/dist/kolibri/kol-spin.entry.js +1 -1
  303. package/dist/kolibri/kol-split-button.entry.js +1 -1
  304. package/dist/kolibri/kol-symbol.entry.js +1 -1
  305. package/dist/kolibri/kol-table-stateful.entry.js +1 -1
  306. package/dist/kolibri/kol-table-stateless-wc.entry.js +1 -1
  307. package/dist/kolibri/kol-table-stateless.entry.js +1 -1
  308. package/dist/kolibri/kol-table.entry.js +1 -1
  309. package/dist/kolibri/kol-tabs.entry.js +1 -1
  310. package/dist/kolibri/kol-textarea.entry.js +1 -1
  311. package/dist/kolibri/kol-toast-container.entry.js +1 -1
  312. package/dist/kolibri/kol-toolbar.entry.js +1 -1
  313. package/dist/kolibri/kol-tooltip-wc.entry.js +1 -1
  314. package/dist/kolibri/kol-tree-item-wc.entry.js +1 -1
  315. package/dist/kolibri/kol-tree-item.entry.js +1 -1
  316. package/dist/kolibri/kol-tree-wc.entry.js +1 -1
  317. package/dist/kolibri/kol-tree.entry.js +1 -1
  318. package/dist/kolibri/kol-version.entry.js +1 -1
  319. package/dist/kolibri/kolibri.esm.js +1 -1
  320. package/dist/kolibri/test-component.entry.js +1 -1
  321. package/package.json +1 -1
  322. package/dist/cjs/Alert-b418e647.js.map +0 -1
  323. package/dist/cjs/FormFieldMsg-1a1d3926.js +0 -4
  324. package/dist/cjs/controller-8de3ece4.js +0 -4
  325. package/dist/cjs/controller-8de3ece4.js.map +0 -1
  326. package/dist/cjs/i18n-1c001171.js +0 -4
  327. package/dist/cjs/i18n-1c001171.js.map +0 -1
  328. package/dist/esm/Alert-304de12c.js.map +0 -1
  329. package/dist/esm/controller-6852ec73.js +0 -4
  330. package/dist/esm/controller-6852ec73.js.map +0 -1
  331. package/dist/esm/i18n-b14e6088.js +0 -4
  332. package/dist/esm/i18n-b14e6088.js.map +0 -1
  333. package/dist/kolibri/Alert-304de12c.js +0 -4
  334. package/dist/kolibri/Alert-304de12c.js.map +0 -1
  335. package/dist/kolibri/FormFieldMsg-89b0a10f.js +0 -4
  336. package/dist/kolibri/InternalUnderlinedBadgeText-8401ab52.js +0 -4
  337. package/dist/kolibri/controller-6852ec73.js +0 -4
  338. package/dist/kolibri/controller-6852ec73.js.map +0 -1
  339. package/dist/kolibri/i18n-3dd5729d.js +0 -4
  340. package/dist/kolibri/i18n-b14e6088.js +0 -4
  341. package/dist/kolibri/i18n-b14e6088.js.map +0 -1
  342. /package/dist/kolibri/{Collapsible-e9e495e6.js.map → Collapsible-013530ba.js.map} +0 -0
  343. /package/dist/kolibri/{FormFieldMsg-89b0a10f.js.map → FormFieldMsg-778709b3.js.map} +0 -0
  344. /package/dist/kolibri/{InternalUnderlinedBadgeText-8401ab52.js.map → InternalUnderlinedBadgeText-64832a6c.js.map} +0 -0
  345. /package/dist/kolibri/{app-globals-b7f7683e.js.map → app-globals-ccaba449.js.map} +0 -0
  346. /package/dist/kolibri/{controller-b80ab45c.js.map → controller-39af3c59.js.map} +0 -0
  347. /package/dist/kolibri/{controller-7a8fe823.js.map → controller-5f736145.js.map} +0 -0
  348. /package/dist/kolibri/{controller-f2ec3fe1.js.map → controller-ea7356ee.js.map} +0 -0
  349. /package/dist/kolibri/{controller-icon-cfb10b73.js.map → controller-icon-2d458d9b.js.map} +0 -0
  350. /package/dist/kolibri/{dev.utils-9fe1c2ca.js.map → dev.utils-47c3024f.js.map} +0 -0
  351. /package/dist/kolibri/{devtools-cf6b236a.js.map → devtools-6184f489.js.map} +0 -0
  352. /package/dist/kolibri/{i18n-3dd5729d.js.map → i18n-92411229.js.map} +0 -0
@@ -1 +1 @@
1
- {"file":"i18n.js","mappings":";;;AAAA,kBAAe;IACd,KAAK,EAAE,QAAQ;IACf,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,QAAQ;IACjB,OAAO,EAAE,WAAW;IACpB,KAAK,EAAE,WAAW;IAClB,kBAAkB,EAAE,wFAAwF;IAC5G,EAAE,EAAE,KAAK;IACT,UAAU,EAAE,SAAS;IACrB,GAAG,EAAE,KAAK;IACV,YAAY,EAAE,mCAAmC;IACjD,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B,GAAkC,EAClC,eAGoF,YAAY;IAEhG,IAAI,GAAG,IAAI,WAAW,CAAC,GAAG,CAAC,CAAC;IAC5B,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;IACnC,OAAO,IAAI,CAAC;AACb;;;;","names":[],"sources":["src/locales/de.ts","src/locales/en.ts","src/core/i18n.ts"],"sourcesContent":["export default {\n\terror: 'Fehler',\n\twarning: 'Warnung',\n\tinfo: 'Hinweis',\n\tsuccess: 'Erfolg',\n\tmessage: 'Nachricht',\n\tclose: 'Schließen',\n\t'form-description': 'Formular-Felder, die mit einem Sternchen (*) gekennzeichnet sind, sind Pflichtangaben.',\n\tof: 'von',\n\tcharacters: 'Zeichen',\n\tnew: 'Neu',\n\t'no-entries': 'Es sind keine Einträge vorhanden.',\n\t'change-order': 'Sortierung von {{colLabel}} ändern',\n\t'action-running': 'Aktion wird ausgeführt...',\n\t'action-done': 'Aktion abgeschlossen',\n\tpagination: 'Paginierung',\n\t'page-first': 'Direkt zur ersten Seite',\n\t'page-back': 'Eine Seite zurück',\n\t'page-next': 'Eine Seite weiter',\n\t'page-last': 'Direkt zur letzten Seite',\n\t'entries-per-site': 'Einträge pro Seite',\n\tpage: 'Seite',\n\t'page-current': 'Seite {{page}}',\n\t'page-selected': 'Seite {{page}} ist ausgewählt',\n\t'page-per-site': '{{entries}} Einträge pro Seite',\n\t'nav-maximize': 'Navigation maximieren',\n\t'nav-minimize': 'Navigation minimieren',\n\t'logo-description': 'Logo {{orgShort}}. Bundesadler mit Flaggenstab und Schriftzug {{orgLong}}',\n\t'open-link-in-tab': 'Öffnet in neuem Tab.',\n\t'kolibri-logo': 'Logo von KoliBri',\n\t'table-pagination-label': 'Paginierung für die Tabelle {{label}}',\n\t'avatar-alt': 'Avatar von {{name}}',\n\t'split-button-dropdown-label-open': 'Optionen anzeigen',\n\t'split-button-dropdown-label-close': 'Optionen schließen',\n\t'toast-close-all': 'Alle schließen',\n\t'error-list': 'Fehlerliste',\n\t'error-list-message': 'Bitte korrigieren Sie folgende Fehler:',\n\tversion: 'Versionsnummer',\n\t'table-visible-range': 'Einträge {{start}} bis {{end}} von {{total}}',\n\t'table-selection-all': 'Alle auswählen',\n\t'table-selection-none': 'Alle abwählen',\n\t'table-selection-indeterminate': 'Alle auswählen bei teilweiser Auswahl',\n\tdropdown: 'Auswahlliste',\n\t'nav-label-open': 'Untermenü zu {{label}} öffnen',\n\t'nav-label-close': 'Untermenü zu {{label}} schließen',\n\t'close-alert': 'Benachrichtigung schließen',\n\t'show-password': 'einblenden',\n\t'hide-password': 'ausblenden',\n\t'no-results-message': 'Keine Ergebnisse gefunden.',\n\t'delete-selection': 'Auswahl entfernen',\n\tsort: 'sortieren',\n\t'pagination-position-top': 'oben',\n\t'pagination-position-bottom': 'unten',\n};\n","export default {\n\terror: 'Error',\n\twarning: 'Warning',\n\tinfo: 'Note',\n\tsuccess: 'Success',\n\tmessage: 'Message',\n\tclose: 'Close',\n\t'form-description': 'Form fields marked with an asterisk (*) are mandatory.',\n\tof: 'of',\n\tcharacters: 'characters',\n\tnew: 'New',\n\t'no-entries': 'No entries available.',\n\t'change-order': 'Change order of {{colLabel}}',\n\t'action-running': 'Action is running...',\n\t'action-done': 'Action done',\n\tpagination: 'Pagination',\n\t'page-first': 'Directly to the first page',\n\t'page-back': 'One page back',\n\t'page-next': 'One page further',\n\t'page-last': 'Directly to the last page',\n\t'entries-per-site': 'Entries per page',\n\tpage: 'Page',\n\t'page-current': 'Page {{page}}',\n\t'page-selected': 'Page {{page}} is selected',\n\t'page-per-site': '{{entries}} entries per page',\n\t'nav-maximize': 'Maximize navigation',\n\t'nav-minimize': 'Minimize navigation',\n\t'logo-description': 'Logo {{orgShort}}. Federal eagle with flag staff and lettering {{orgLong}}',\n\t'open-link-in-tab': 'Opens in new tab.',\n\t'kolibri-logo': 'KoliBri logo',\n\t'table-pagination-label': 'Pagination for table {{label}}',\n\t'avatar-alt': 'Avatar of {{name}}',\n\t'split-button-dropdown-label-open': 'Show options',\n\t'split-button-dropdown-label-close': 'Hide options',\n\t'toast-close-all': 'Close all',\n\t'error-list': 'Error list',\n\t'error-list-message': 'Please correct the following errors',\n\tversion: 'Version number',\n\t'table-visible-range': 'Entries {{start}} to {{end}} of {{total}}',\n\t'table-selection-all': 'Select all',\n\t'table-selection-none': 'Deselect all',\n\t'table-selection-indeterminate': 'Select all with partial selection',\n\tdropdown: 'Dropdown',\n\t'nav-label-open': 'Submenu for {{label}} open',\n\t'nav-label-close': 'Submenu for {{label}} close',\n\t'close-alert': 'Close notification',\n\t'show-password': 'Show',\n\t'hide-password': 'Hide',\n\t'no-results-message': 'No results found.',\n\t'delete-selection': 'Delete selection',\n\tsort: 'sort',\n\t'pagination-position-top': 'top',\n\t'pagination-position-bottom': 'bottom',\n};\n","import type { Generic } from 'adopted-style-sheets';\nimport locale_de from '../locales/de';\nimport locale_en from '../locales/en';\n\nexport type ResourcePrefix = 'Kol';\nexport type ComponentKeys = keyof typeof locale_de;\n\nconst mapLocaleKeys = (locale: { [K in ComponentKeys]: string }) =>\n\t(Object.keys(locale) as ComponentKeys[]).reduce((a, c) => ((a[`${'kol'}-${c}`] = locale[c]), a), {} as Generic.I18n.Map<ResourcePrefix, ComponentKeys>);\n\nconst TRANSLATIONS = new Set<Generic.I18n.RegisterPatch<Generic.I18n.Locale.ISO_639_1, ResourcePrefix, ComponentKeys>>([\n\t(t: (language: 'en', translationMap: Generic.I18n.Map<ResourcePrefix, ComponentKeys>) => Generic.I18n.Locale.ISO_639_1) => t('en', mapLocaleKeys(locale_en)),\n\t(t: (language: 'de', translationMap: Generic.I18n.Map<ResourcePrefix, ComponentKeys>) => Generic.I18n.Locale.ISO_639_1) => t('de', mapLocaleKeys(locale_de)),\n]);\n\ninterface ITranslationOptions {\n\t/**\n\t * Placeholders to insert into the text. Replacing {{key}} with the specified value if the \"key\".\n\t */\n\tplaceholders?: { [K: string]: string };\n}\n\n// String.replaceAll should be used but is only available with ECMAScript 2021.\nconst replaceAll = function (text: string, search: string, replacement: string) {\n\treturn text.split(search).join(replacement);\n};\n\ntype Resources = Map<string, string>;\n\nexport class I18nService {\n\tprivate resourceMap = new Map<Generic.I18n.Locale.ISO_639_1, Resources>();\n\tlanguage: Generic.I18n.Locale.ISO_639_1;\n\n\tpublic constructor(initialLanguage?: Generic.I18n.Locale.ISO_639_1) {\n\t\tthis.language = initialLanguage ?? 'de';\n\t}\n\n\t/**\n\t * Adds a resource bundle for the specified language.\n\t * @param lng the language the bundle is for\n\t * @param translationMap the translations of the given language\n\t */\n\tpublic addTranslations(\n\t\ttranslations?:\n\t\t\t| Generic.I18n.RegisterPatch<Generic.I18n.Locale.ISO_639_1, string, string>\n\t\t\t| Generic.I18n.RegisterPatch<Generic.I18n.Locale.ISO_639_1, string, string>[]\n\t\t\t| Set<Generic.I18n.RegisterPatch<Generic.I18n.Locale.ISO_639_1, string, string>>,\n\t) {\n\t\tif (Array.isArray(translations)) {\n\t\t\ttranslations = new Set(translations);\n\t\t} else if (typeof translations === 'function') {\n\t\t\ttranslations = new Set([translations]);\n\t\t}\n\n\t\tif (translations !== undefined) {\n\t\t\ttranslations.forEach((t) =>\n\t\t\t\tt((l, t) => {\n\t\t\t\t\tlet resources = this.resourceMap.get(l);\n\t\t\t\t\tif (!resources) {\n\t\t\t\t\t\tresources = new Map<string, string>();\n\t\t\t\t\t\tthis.resourceMap.set(l, resources);\n\t\t\t\t\t}\n\n\t\t\t\t\tObject.entries(t).forEach(([k, v]) => {\n\t\t\t\t\t\tif (v) {\n\t\t\t\t\t\t\tresources.set(k, v);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\treturn l;\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Set the current language.\n\t * @param lng the language the bundle is for\n\t */\n\tpublic setLanguage(lng: Generic.I18n.Locale.ISO_639_1) {\n\t\tthis.language = lng;\n\t}\n\n\t/**\n\t * Determines a human-readable translated text for the given resource key.\n\t * @param key the resource key\n\t * @param options optional translation parameters\n\t * @returns the translated text\n\t */\n\tpublic translate(key: string, options?: ITranslationOptions) {\n\t\tlet result = this.resourceMap.get(this.language)?.get(key);\n\t\tif (result) {\n\t\t\tif (options?.placeholders) {\n\t\t\t\tObject.entries(options.placeholders).forEach(([k, v]) => {\n\t\t\t\t\tresult = replaceAll(result!, `{{${k}}}`, v);\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tresult = key;\n\t\t}\n\t\treturn result;\n\t}\n}\n\nlet i18n: I18nService;\n\nexport const getI18nInstance = () => {\n\treturn i18n;\n};\n\nexport const initializeI18n = (\n\tlng: Generic.I18n.Locale.ISO_639_1,\n\ttranslations:\n\t\t| Generic.I18n.RegisterPatch<Generic.I18n.Locale.ISO_639_1, string, string>\n\t\t| Generic.I18n.RegisterPatch<Generic.I18n.Locale.ISO_639_1, string, string>[]\n\t\t| Set<Generic.I18n.RegisterPatch<Generic.I18n.Locale.ISO_639_1, string, string>> = TRANSLATIONS,\n) => {\n\ti18n = new I18nService(lng);\n\ti18n.addTranslations(translations);\n\treturn i18n;\n};\n"],"version":3}
1
+ {"file":"i18n.js","mappings":";;;AAAA,kBAAe;IACd,KAAK,EAAE,QAAQ;IACf,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,QAAQ;IACjB,OAAO,EAAE,WAAW;IACpB,KAAK,EAAE,WAAW;IAClB,kBAAkB,EAAE,wFAAwF;IAC5G,EAAE,EAAE,KAAK;IACT,UAAU,EAAE,SAAS;IACrB,GAAG,EAAE,KAAK;IACV,YAAY,EAAE,mCAAmC;IACjD,cAAc,EAAE,oCAAoC;IACpD,gBAAgB,EAAE,2BAA2B;IAC7C,aAAa,EAAE,sBAAsB;IACrC,UAAU,EAAE,aAAa;IACzB,YAAY,EAAE,yBAAyB;IACvC,WAAW,EAAE,mBAAmB;IAChC,WAAW,EAAE,mBAAmB;IAChC,WAAW,EAAE,0BAA0B;IACvC,kBAAkB,EAAE,oBAAoB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n\terror: 'Fehler',\n\twarning: 'Warnung',\n\tinfo: 'Hinweis',\n\tsuccess: 'Erfolg',\n\tmessage: 'Nachricht',\n\tclose: 'Schließen',\n\t'form-description': 'Formular-Felder, die mit einem Sternchen (*) gekennzeichnet sind, sind Pflichtangaben.',\n\tof: 'von',\n\tcharacters: 'Zeichen',\n\tnew: 'Neu',\n\t'no-entries': 'Es sind keine Einträge vorhanden.',\n\t'change-order': 'Sortierung von {{colLabel}} ändern',\n\t'action-running': 'Aktion wird ausgeführt...',\n\t'action-done': 'Aktion abgeschlossen',\n\tpagination: 'Paginierung',\n\t'page-first': 'Direkt zur ersten Seite',\n\t'page-back': 'Eine Seite zurück',\n\t'page-next': 'Eine Seite weiter',\n\t'page-last': 'Direkt zur letzten Seite',\n\t'entries-per-site': 'Einträge pro Seite',\n\tpage: 'Seite',\n\t'page-current': 'Seite {{page}}',\n\t'page-selected': 'Seite {{page}} ist ausgewählt',\n\t'page-per-site': '{{entries}} Einträge pro Seite',\n\t'nav-maximize': 'Navigation maximieren',\n\t'nav-minimize': 'Navigation minimieren',\n\t'logo-description': 'Logo {{orgShort}}. Bundesadler mit Flaggenstab und Schriftzug {{orgLong}}',\n\t'open-link-in-tab': 'Öffnet in neuem Tab.',\n\t'kolibri-logo': 'Logo von KoliBri',\n\t'table-pagination-label': 'Paginierung für die Tabelle {{label}}',\n\t'avatar-alt': 'Avatar von {{name}}',\n\t'split-button-dropdown-label-open': 'Optionen anzeigen',\n\t'split-button-dropdown-label-close': 'Optionen schließen',\n\t'toast-close-all': 'Alle Benachrichtigungen schließen',\n\t'error-list': 'Fehlerliste',\n\t'error-list-message': 'Bitte korrigieren Sie folgende Fehler:',\n\tversion: 'Versionsnummer',\n\t'table-visible-range': 'Einträge {{start}} bis {{end}} von {{total}}',\n\t'table-selection-all': 'Alle auswählen',\n\t'table-selection-none': 'Alle abwählen',\n\t'table-selection-indeterminate': 'Alle auswählen bei teilweiser Auswahl',\n\tdropdown: 'Auswahlliste',\n\t'nav-label-open': 'Untermenü zu {{label}} öffnen',\n\t'nav-label-close': 'Untermenü zu {{label}} schließen',\n\t'close-alert': 'Benachrichtigung schließen',\n\t'show-password': 'einblenden',\n\t'hide-password': 'ausblenden',\n\t'no-results-message': 'Keine Ergebnisse gefunden.',\n\t'delete-selection': 'Auswahl entfernen',\n\tsort: 'sortieren',\n\t'pagination-position-top': 'oben',\n\t'pagination-position-bottom': 'unten',\n};\n","export default {\n\terror: 'Error',\n\twarning: 'Warning',\n\tinfo: 'Note',\n\tsuccess: 'Success',\n\tmessage: 'Message',\n\tclose: 'Close',\n\t'form-description': 'Form fields marked with an asterisk (*) are mandatory.',\n\tof: 'of',\n\tcharacters: 'characters',\n\tnew: 'New',\n\t'no-entries': 'No entries available.',\n\t'change-order': 'Change order of {{colLabel}}',\n\t'action-running': 'Action is running...',\n\t'action-done': 'Action done',\n\tpagination: 'Pagination',\n\t'page-first': 'Directly to the first page',\n\t'page-back': 'One page back',\n\t'page-next': 'One page further',\n\t'page-last': 'Directly to the last page',\n\t'entries-per-site': 'Entries per page',\n\tpage: 'Page',\n\t'page-current': 'Page {{page}}',\n\t'page-selected': 'Page {{page}} is selected',\n\t'page-per-site': '{{entries}} entries per page',\n\t'nav-maximize': 'Maximize navigation',\n\t'nav-minimize': 'Minimize navigation',\n\t'logo-description': 'Logo {{orgShort}}. Federal eagle with flag staff and lettering {{orgLong}}',\n\t'open-link-in-tab': 'Opens in new tab.',\n\t'kolibri-logo': 'KoliBri logo',\n\t'table-pagination-label': 'Pagination for table {{label}}',\n\t'avatar-alt': 'Avatar of {{name}}',\n\t'split-button-dropdown-label-open': 'Show options',\n\t'split-button-dropdown-label-close': 'Hide options',\n\t'toast-close-all': 'Close all notifications',\n\t'error-list': 'Error list',\n\t'error-list-message': 'Please correct the following errors',\n\tversion: 'Version number',\n\t'table-visible-range': 'Entries {{start}} to {{end}} of {{total}}',\n\t'table-selection-all': 'Select all',\n\t'table-selection-none': 'Deselect all',\n\t'table-selection-indeterminate': 'Select all with partial selection',\n\tdropdown: 'Dropdown',\n\t'nav-label-open': 'Submenu for {{label}} open',\n\t'nav-label-close': 'Submenu for {{label}} close',\n\t'close-alert': 'Close notification',\n\t'show-password': 'Show',\n\t'hide-password': 'Hide',\n\t'no-results-message': 'No results found.',\n\t'delete-selection': 'Delete selection',\n\tsort: 'sort',\n\t'pagination-position-top': 'top',\n\t'pagination-position-bottom': 'bottom',\n};\n","import type { Generic } from 'adopted-style-sheets';\nimport locale_de from '../locales/de';\nimport locale_en from '../locales/en';\n\nexport type ResourcePrefix = 'Kol';\nexport type ComponentKeys = keyof typeof locale_de;\n\nconst mapLocaleKeys = (locale: { [K in ComponentKeys]: string }) =>\n\t(Object.keys(locale) as ComponentKeys[]).reduce((a, c) => ((a[`${'kol'}-${c}`] = locale[c]), a), {} as Generic.I18n.Map<ResourcePrefix, ComponentKeys>);\n\nconst TRANSLATIONS = new Set<Generic.I18n.RegisterPatch<Generic.I18n.Locale.ISO_639_1, ResourcePrefix, ComponentKeys>>([\n\t(t: (language: 'en', translationMap: Generic.I18n.Map<ResourcePrefix, ComponentKeys>) => Generic.I18n.Locale.ISO_639_1) => t('en', mapLocaleKeys(locale_en)),\n\t(t: (language: 'de', translationMap: Generic.I18n.Map<ResourcePrefix, ComponentKeys>) => Generic.I18n.Locale.ISO_639_1) => t('de', mapLocaleKeys(locale_de)),\n]);\n\ninterface ITranslationOptions {\n\t/**\n\t * Placeholders to insert into the text. Replacing {{key}} with the specified value if the \"key\".\n\t */\n\tplaceholders?: { [K: string]: string };\n}\n\n// String.replaceAll should be used but is only available with ECMAScript 2021.\nconst replaceAll = function (text: string, search: string, replacement: string) {\n\treturn text.split(search).join(replacement);\n};\n\ntype Resources = Map<string, string>;\n\nexport class I18nService {\n\tprivate resourceMap = new Map<Generic.I18n.Locale.ISO_639_1, Resources>();\n\tlanguage: Generic.I18n.Locale.ISO_639_1;\n\n\tpublic constructor(initialLanguage?: Generic.I18n.Locale.ISO_639_1) {\n\t\tthis.language = initialLanguage ?? 'de';\n\t}\n\n\t/**\n\t * Adds a resource bundle for the specified language.\n\t * @param lng the language the bundle is for\n\t * @param translationMap the translations of the given language\n\t */\n\tpublic addTranslations(\n\t\ttranslations?:\n\t\t\t| Generic.I18n.RegisterPatch<Generic.I18n.Locale.ISO_639_1, string, string>\n\t\t\t| Generic.I18n.RegisterPatch<Generic.I18n.Locale.ISO_639_1, string, string>[]\n\t\t\t| Set<Generic.I18n.RegisterPatch<Generic.I18n.Locale.ISO_639_1, string, string>>,\n\t) {\n\t\tif (Array.isArray(translations)) {\n\t\t\ttranslations = new Set(translations);\n\t\t} else if (typeof translations === 'function') {\n\t\t\ttranslations = new Set([translations]);\n\t\t}\n\n\t\tif (translations !== undefined) {\n\t\t\ttranslations.forEach((t) =>\n\t\t\t\tt((l, t) => {\n\t\t\t\t\tlet resources = this.resourceMap.get(l);\n\t\t\t\t\tif (!resources) {\n\t\t\t\t\t\tresources = new Map<string, string>();\n\t\t\t\t\t\tthis.resourceMap.set(l, resources);\n\t\t\t\t\t}\n\n\t\t\t\t\tObject.entries(t).forEach(([k, v]) => {\n\t\t\t\t\t\tif (v) {\n\t\t\t\t\t\t\tresources.set(k, v);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\treturn l;\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Set the current language.\n\t * @param lng the language the bundle is for\n\t */\n\tpublic setLanguage(lng: Generic.I18n.Locale.ISO_639_1) {\n\t\tthis.language = lng;\n\t}\n\n\t/**\n\t * Determines a human-readable translated text for the given resource key.\n\t * @param key the resource key\n\t * @param options optional translation parameters\n\t * @returns the translated text\n\t */\n\tpublic translate(key: string, options?: ITranslationOptions) {\n\t\tlet result = this.resourceMap.get(this.language)?.get(key);\n\t\tif (result) {\n\t\t\tif (options?.placeholders) {\n\t\t\t\tObject.entries(options.placeholders).forEach(([k, v]) => {\n\t\t\t\t\tresult = replaceAll(result!, `{{${k}}}`, v);\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tresult = key;\n\t\t}\n\t\treturn result;\n\t}\n}\n\nlet i18n: I18nService;\n\nexport const getI18nInstance = () => {\n\treturn i18n;\n};\n\nexport const initializeI18n = (\n\tlng: Generic.I18n.Locale.ISO_639_1,\n\ttranslations:\n\t\t| Generic.I18n.RegisterPatch<Generic.I18n.Locale.ISO_639_1, string, string>\n\t\t| Generic.I18n.RegisterPatch<Generic.I18n.Locale.ISO_639_1, string, string>[]\n\t\t| Set<Generic.I18n.RegisterPatch<Generic.I18n.Locale.ISO_639_1, string, string>> = TRANSLATIONS,\n) => {\n\ti18n = new I18nService(lng);\n\ti18n.addTranslations(translations);\n\treturn i18n;\n};\n"],"version":3}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * KoliBri - The accessible HTML-Standard
3
3
  */
4
- import{proxyCustomElement,HTMLElement,h,Host}from"@stencil/core/internal/client";import{h as featureHint,o as objectObjectHandler,q as parseJson,l as setState}from"./index2.js";import{c as KolButtonWcTag,g as KolSpanWcTag}from"./component-names.js";import{n as nonce}from"./dev.utils.js";import{h as handleColorChange,v as validateColor}from"./color.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 .kol-tooltip-wc {\n display: contents;\n }\n .kol-tooltip-wc .tooltip-floating {\n opacity: 0;\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, unset);\n max-width: 90vw;\n max-height: 90vh;\n animation-direction: normal;\n /* Can be used to specify the animation duration from the outside. 250ms by default. */\n animation-duration: var(--kolibri-tooltip-animation-duration, 250ms);\n animation-fill-mode: forwards;\n animation-iteration-count: 1;\n animation-timing-function: ease-in;\n }\n .kol-tooltip-wc .tooltip-floating.hide {\n animation-name: hideTooltip;\n }\n .kol-tooltip-wc .tooltip-floating.show {\n animation-name: showTooltip;\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 hideTooltip {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n display: none;\n }\n }\n @keyframes showTooltip {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n}\n@layer kol-component {\n :host > span {\n /* Visible with forced colors */\n outline: transparent solid calc(1rem / var(--kolibri-root-font-size, 16));\n display: inline-flex;\n place-items: center;\n }\n :host > span > .kol-button-wc button {\n color: inherit;\n }\n}",KolBadgeDefaultStyle0=defaultStyleCss;featureHint("[KolBadge] Optimierung des _color-Properties (rgba, rgb, hex usw.).");const KolBadge$1=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.bgColorStr="#000",this.colorStr="#fff",this.id=nonce(),this.handleColorChange=n=>{const t=handleColorChange(n);this.bgColorStr=t.backgroundColor,this.colorStr=t.foregroundColor},this._color="#000",this._icons=void 0,this._label=void 0,this._smartButton=void 0,this.state={_color:{backgroundColor:"#000",foregroundColor:"#fff"}}}renderSmartButton(n){return h(KolButtonWcTag,{_ariaControls:this.id,_customClass:n._customClass,_disabled:n._disabled,_hideLabel:!0,_icons:n._icons,_id:n._id,_label:n._label,_on:n._on,_tooltipAlign:n._tooltipAlign,_variant:n._variant})}render(){const n="object"==typeof this.state._smartButton&&null!==this.state._smartButton;return h(Host,{key:"e18cef57a5d00c73f9040d17f16e53a22bb21c2d",class:"kol-badge"},h("span",{key:"6375f9d2c8c8863165d6e0dce77ad89f708275b5",class:{"smart-button":"object"==typeof this.state._smartButton&&null!==this.state._smartButton},style:{backgroundColor:this.bgColorStr,color:this.colorStr}},h(KolSpanWcTag,{key:"a74d942a94c5bbeb002bbd42a5d45a9e75c704e8",id:n?this.id:void 0,_allowMarkdown:!0,_icons:this._icons,_label:this._label}),n&&this.renderSmartButton(this.state._smartButton)))}validateColor(n){validateColor(this,n,{defaultValue:"#000",hooks:{beforePatch:this.handleColorChange}})}validateSmartButton(n){objectObjectHandler(n,()=>{try{n=parseJson(n)}catch(n){}setState(this,"_smartButton",n)})}componentWillLoad(){this.validateColor(this._color),this.validateSmartButton(this._smartButton)}static get watchers(){return{_color:["validateColor"],_smartButton:["validateSmartButton"]}}static get style(){return{default:KolBadgeDefaultStyle0}}},[33,"kol-badge",{_color:[1],_icons:[1],_label:[1],_smartButton:[1,"_smart-button"],state:[32]},void 0,{_color:["validateColor"],_smartButton:["validateSmartButton"]}]);function defineCustomElement$1(){if("undefined"==typeof customElements)return;["kol-badge"].forEach(n=>{if("kol-badge"===n)customElements.get(n)||customElements.define(n,KolBadge$1)})}const KolBadge=KolBadge$1,defineCustomElement=defineCustomElement$1;export{KolBadge,defineCustomElement};
4
+ import{proxyCustomElement,HTMLElement,h,Host}from"@stencil/core/internal/client";import{h as featureHint,o as objectObjectHandler,q as parseJson,l as setState}from"./index2.js";import{c as KolButtonWcTag,g as KolSpanWcTag}from"./component-names.js";import{n as nonce}from"./dev.utils.js";import{h as handleColorChange,v as validateColor}from"./color.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 .kol-tooltip-wc {\n display: contents;\n }\n .kol-tooltip-wc .tooltip-floating {\n opacity: 0;\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, unset);\n max-width: 90vw;\n max-height: 90vh;\n animation-direction: normal;\n /* Can be used to specify the animation duration from the outside. 250ms by default. */\n animation-duration: var(--kolibri-tooltip-animation-duration, 250ms);\n animation-fill-mode: forwards;\n animation-iteration-count: 1;\n animation-timing-function: ease-in;\n }\n .kol-tooltip-wc .tooltip-floating.hide {\n animation-name: hideTooltip;\n }\n .kol-tooltip-wc .tooltip-floating.show {\n animation-name: showTooltip;\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 hideTooltip {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n display: none;\n }\n }\n @keyframes showTooltip {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n}\n@layer kol-component {\n :host > span {\n /* Visible with forced colors */\n outline: transparent solid calc(1rem / var(--kolibri-root-font-size, 16));\n display: inline-flex;\n place-items: center;\n }\n :host > span > .kol-button-wc button {\n color: inherit;\n }\n}",KolBadgeDefaultStyle0=defaultStyleCss;featureHint("[KolBadge] Optimierung des _color-Properties (rgba, rgb, hex usw.).");const KolBadge$1=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.bgColorStr="#000",this.colorStr="#fff",this.id=nonce(),this.handleColorChange=n=>{const t=handleColorChange(n);this.bgColorStr=t.backgroundColor,this.colorStr=t.foregroundColor},this._color="#000",this._icons=void 0,this._label=void 0,this._smartButton=void 0,this.state={_color:{backgroundColor:"#000",foregroundColor:"#fff"}}}renderSmartButton(n){return h(KolButtonWcTag,{_ariaControls:this.id,_ariaDescription:n._ariaDescription,_customClass:n._customClass,_disabled:n._disabled,_hideLabel:!0,_icons:n._icons,_id:n._id,_label:n._label,_on:n._on,_tooltipAlign:n._tooltipAlign,_variant:n._variant})}render(){const n="object"==typeof this.state._smartButton&&null!==this.state._smartButton;return h(Host,{key:"4feef27579b3fef20e90585b1afadb10ff93cbdb",class:"kol-badge"},h("span",{key:"fcdf3294e40d4c6e0268ef4fc5ca106b12c0a258",class:{"smart-button":"object"==typeof this.state._smartButton&&null!==this.state._smartButton},style:{backgroundColor:this.bgColorStr,color:this.colorStr}},h(KolSpanWcTag,{key:"eb2f1148028f06742c2a478d0955a61bfc4c8ad3",id:n?this.id:void 0,_allowMarkdown:!0,_icons:this._icons,_label:this._label}),n&&this.renderSmartButton(this.state._smartButton)))}validateColor(n){validateColor(this,n,{defaultValue:"#000",hooks:{beforePatch:this.handleColorChange}})}validateSmartButton(n){objectObjectHandler(n,()=>{try{n=parseJson(n)}catch(n){}setState(this,"_smartButton",n)})}componentWillLoad(){this.validateColor(this._color),this.validateSmartButton(this._smartButton)}static get watchers(){return{_color:["validateColor"],_smartButton:["validateSmartButton"]}}static get style(){return{default:KolBadgeDefaultStyle0}}},[33,"kol-badge",{_color:[1],_icons:[1],_label:[1],_smartButton:[1,"_smart-button"],state:[32]},void 0,{_color:["validateColor"],_smartButton:["validateSmartButton"]}]);function defineCustomElement$1(){if("undefined"==typeof customElements)return;["kol-badge"].forEach(n=>{if("kol-badge"===n)customElements.get(n)||customElements.define(n,KolBadge$1)})}const KolBadge=KolBadge$1,defineCustomElement=defineCustomElement$1;export{KolBadge,defineCustomElement};
@@ -1 +1 @@
1
- {"file":"kol-badge.js","mappings":";;;;;;;;;AAAA,MAAM,eAAe,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AI,CAAC,KAAK,CAAC,YAAY,KAAK,IAAI;aAC/F,EACD,KAAK,EAAE;gBACN,eAAe,EAAE,IAAI,CAAC,UAAU;gBAChC,KAAK,EAAE,IAAI,CAAC,QAAQ;aACpB,IAED,EAAC,YAAY,qDAAC,EAAE,EAAE,cAAc,GAAG,IAAI,CAAC,EAAE,GAAG,SAAS,EAAE,cAAc,QAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,GAAiB,EAC/H,cAAc,IAAI,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,YAA2B,CAAC,CAC3E,CACD,EACN;KACF;IAoCM,aAAa,CAAC,KAA8B;QAClD,aAAa,CAAC,IAAI,EAAE,KAAK,EAAE;YAC1B,YAAY,EAAE,MAAM;YACpB,KAAK,EAAE;gBACN,WAAW,EAAE,IAAI,CAAC,iBAAiB;aACnC;SACD,CAAC,CAAC;KACH;IAGM,mBAAmB,CAAC,KAA4B;QACtD,mBAAmB,CAAC,KAAK,EAAE;YAC1B,IAAI;gBACH,KAAK,GAAG,SAAS,CAAc,KAAe,CAAC,CAAC;aAEhD;YAAC,OAAO,CAAC,EAAE;aAEX;YACD,QAAQ,CAAC,IAAI,EAAE,cAAc,EAAE,KAAK,CAAC,CAAC;SACtC,CAAC,CAAC;KACH;IAEM,iBAAiB;QACvB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAChC,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;KAC5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["KolBadge"],"sources":["src/components/badge/style.scss?tag=kol-badge&mode=default&encapsulation=shadow","src/components/badge/shadow.tsx"],"sourcesContent":["@use '../@shared/mixins' as *;\n@use '../style' as *;\n@use '../tooltip/style.scss' as *;\n\n@layer kol-component {\n\t:host > span {\n\t\t/* Visible with forced colors */\n\t\toutline: transparent solid to-rem(1);\n\t\tdisplay: inline-flex;\n\t\tplace-items: center;\n\t}\n\n\t:host > span > .kol-button-wc button {\n\t\tcolor: inherit;\n\t}\n}\n","import type { BadgeAPI, BadgeStates, ButtonProps, KoliBriIconsProp, LabelPropType, PropColor, Stringified } from '../../schema';\nimport { featureHint, handleColorChange, objectObjectHandler, parseJson, setState, validateColor } from '../../schema';\nimport { Component, h, Host, Prop, State, Watch } from '@stencil/core';\nimport { KolSpanWcTag } from '../../core/component-names';\n\nimport { nonce } from '../../utils/dev.utils';\n\nimport type { JSX } from '@stencil/core';\nimport { KolButtonWcTag } from '../../core/component-names';\nfeatureHint(`[KolBadge] Optimierung des _color-Properties (rgba, rgb, hex usw.).`);\n\n@Component({\n\ttag: 'kol-badge',\n\tstyleUrls: {\n\t\tdefault: './style.scss',\n\t},\n\tshadow: true,\n})\nexport class KolBadge implements BadgeAPI {\n\tprivate bgColorStr = '#000';\n\tprivate colorStr = '#fff';\n\tprivate readonly id = nonce();\n\n\tprivate renderSmartButton(props: ButtonProps): JSX.Element {\n\t\treturn (\n\t\t\t<KolButtonWcTag\n\t\t\t\t_ariaControls={this.id}\n\t\t\t\t_customClass={props._customClass}\n\t\t\t\t_disabled={props._disabled}\n\t\t\t\t_hideLabel={true}\n\t\t\t\t_icons={props._icons}\n\t\t\t\t_id={props._id}\n\t\t\t\t_label={props._label}\n\t\t\t\t_on={props._on}\n\t\t\t\t_tooltipAlign={props._tooltipAlign}\n\t\t\t\t_variant={props._variant}\n\t\t\t></KolButtonWcTag>\n\t\t);\n\t}\n\n\tpublic render(): JSX.Element {\n\t\tconst hasSmartButton = typeof this.state._smartButton === 'object' && this.state._smartButton !== null;\n\t\treturn (\n\t\t\t<Host class=\"kol-badge\">\n\t\t\t\t<span\n\t\t\t\t\tclass={{\n\t\t\t\t\t\t'smart-button': typeof this.state._smartButton === 'object' && this.state._smartButton !== null,\n\t\t\t\t\t}}\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tbackgroundColor: this.bgColorStr,\n\t\t\t\t\t\tcolor: this.colorStr,\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<KolSpanWcTag id={hasSmartButton ? this.id : undefined} _allowMarkdown _icons={this._icons} _label={this._label}></KolSpanWcTag>\n\t\t\t\t\t{hasSmartButton && this.renderSmartButton(this.state._smartButton as ButtonProps)}\n\t\t\t\t</span>\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t/**\n\t * Defines the backgroundColor and foregroundColor.\n\t */\n\t@Prop() public _color?: Stringified<PropColor> = '#000';\n\n\t/**\n\t * Defines the icon classnames (e.g. `_icons=\"fa-solid fa-user\"`).\n\t */\n\t@Prop() public _icons?: Stringified<KoliBriIconsProp>;\n\n\t/**\n\t * Defines the visible or semantic label of the component (e.g. aria-label, label, headline, caption, summary, etc.).\n\t */\n\t@Prop() public _label!: LabelPropType;\n\n\t/**\n\t * Allows to add a button with an arbitrary action within the element (_hide-label only).\n\t */\n\t@Prop() public _smartButton?: Stringified<ButtonProps>;\n\n\t@State() public state: BadgeStates = {\n\t\t_color: {\n\t\t\tbackgroundColor: '#000',\n\t\t\tforegroundColor: '#fff',\n\t\t},\n\t};\n\n\tprivate handleColorChange = (value: unknown) => {\n\t\tconst colorPair = handleColorChange(value);\n\t\tthis.bgColorStr = colorPair.backgroundColor;\n\t\tthis.colorStr = colorPair.foregroundColor as string;\n\t};\n\n\t@Watch('_color')\n\tpublic validateColor(value?: Stringified<PropColor>): void {\n\t\tvalidateColor(this, value, {\n\t\t\tdefaultValue: '#000',\n\t\t\thooks: {\n\t\t\t\tbeforePatch: this.handleColorChange,\n\t\t\t},\n\t\t});\n\t}\n\n\t@Watch('_smartButton')\n\tpublic validateSmartButton(value?: ButtonProps | string): void {\n\t\tobjectObjectHandler(value, () => {\n\t\t\ttry {\n\t\t\t\tvalue = parseJson<ButtonProps>(value as string);\n\t\t\t\t// eslint-disable-next-line no-empty\n\t\t\t} catch (e) {\n\t\t\t\t// value behält den ursprünglichen Wert\n\t\t\t}\n\t\t\tsetState(this, '_smartButton', value);\n\t\t});\n\t}\n\n\tpublic componentWillLoad(): void {\n\t\tthis.validateColor(this._color);\n\t\tthis.validateSmartButton(this._smartButton);\n\t}\n}\n"],"version":3}
1
+ {"file":"kol-badge.js","mappings":";;;;;;;;;AAAA,MAAM,eAAe,GAAG,2tMAA2tM,CAAC;AACpvM,8BAAe,eAAe;;ACQ9B,WAAW,CAAC,qEAAqE,CAAC,CAAC;MAStEA,UAAQ;;;;;QACZ,eAAU,GAAG,MAAM,CAAC;QACpB,aAAQ,GAAG,MAAM,CAAC;QACT,OAAE,GAAG,KAAK,EAAE,CAAC;QAmEtB,sBAAiB,GAAG,CAAC,KAAc;YAC1C,MAAM,SAAS,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC;YAC3C,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC,eAAe,CAAC;YAC5C,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC,eAAyB,CAAC;SACpD,CAAC;sBA5B+C,MAAM;;;;qBAiBlB;YACpC,MAAM,EAAE;gBACP,eAAe,EAAE,MAAM;gBACvB,eAAe,EAAE,MAAM;aACvB;SACD;;IA/DO,iBAAiB,CAAC,KAAkB;QAC3C,QACC,EAAC,cAAc,IACd,aAAa,EAAE,IAAI,CAAC,EAAE,EACtB,gBAAgB,EAAE,KAAK,CAAC,gBAAgB,EACxC,YAAY,EAAE,KAAK,CAAC,YAAY,EAChC,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,UAAU,EAAE,IAAI,EAChB,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,GAAG,EAAE,KAAK,CAAC,GAAG,EACd,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,GAAG,EAAE,KAAK,CAAC,GAAG,EACd,aAAa,EAAE,KAAK,CAAC,aAAa,EAClC,QAAQ,EAAE,KAAK,CAAC,QAAQ,GACvB,EACD;KACF;IAEM,MAAM;QACZ,MAAM,cAAc,GAAG,OAAO,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["KolBadge"],"sources":["src/components/badge/style.scss?tag=kol-badge&mode=default&encapsulation=shadow","src/components/badge/shadow.tsx"],"sourcesContent":["@use '../@shared/mixins' as *;\n@use '../style' as *;\n@use '../tooltip/style.scss' as *;\n\n@layer kol-component {\n\t:host > span {\n\t\t/* Visible with forced colors */\n\t\toutline: transparent solid to-rem(1);\n\t\tdisplay: inline-flex;\n\t\tplace-items: center;\n\t}\n\n\t:host > span > .kol-button-wc button {\n\t\tcolor: inherit;\n\t}\n}\n","import type { BadgeAPI, BadgeStates, ButtonProps, KoliBriIconsProp, LabelPropType, PropColor, Stringified } from '../../schema';\nimport { featureHint, handleColorChange, objectObjectHandler, parseJson, setState, validateColor } from '../../schema';\nimport { Component, h, Host, Prop, State, Watch } from '@stencil/core';\nimport { KolSpanWcTag } from '../../core/component-names';\n\nimport { nonce } from '../../utils/dev.utils';\n\nimport type { JSX } from '@stencil/core';\nimport { KolButtonWcTag } from '../../core/component-names';\nfeatureHint(`[KolBadge] Optimierung des _color-Properties (rgba, rgb, hex usw.).`);\n\n@Component({\n\ttag: 'kol-badge',\n\tstyleUrls: {\n\t\tdefault: './style.scss',\n\t},\n\tshadow: true,\n})\nexport class KolBadge implements BadgeAPI {\n\tprivate bgColorStr = '#000';\n\tprivate colorStr = '#fff';\n\tprivate readonly id = nonce();\n\n\tprivate renderSmartButton(props: ButtonProps): JSX.Element {\n\t\treturn (\n\t\t\t<KolButtonWcTag\n\t\t\t\t_ariaControls={this.id}\n\t\t\t\t_ariaDescription={props._ariaDescription}\n\t\t\t\t_customClass={props._customClass}\n\t\t\t\t_disabled={props._disabled}\n\t\t\t\t_hideLabel={true}\n\t\t\t\t_icons={props._icons}\n\t\t\t\t_id={props._id}\n\t\t\t\t_label={props._label}\n\t\t\t\t_on={props._on}\n\t\t\t\t_tooltipAlign={props._tooltipAlign}\n\t\t\t\t_variant={props._variant}\n\t\t\t/>\n\t\t);\n\t}\n\n\tpublic render(): JSX.Element {\n\t\tconst hasSmartButton = typeof this.state._smartButton === 'object' && this.state._smartButton !== null;\n\t\treturn (\n\t\t\t<Host class=\"kol-badge\">\n\t\t\t\t<span\n\t\t\t\t\tclass={{\n\t\t\t\t\t\t'smart-button': typeof this.state._smartButton === 'object' && this.state._smartButton !== null,\n\t\t\t\t\t}}\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tbackgroundColor: this.bgColorStr,\n\t\t\t\t\t\tcolor: this.colorStr,\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<KolSpanWcTag id={hasSmartButton ? this.id : undefined} _allowMarkdown _icons={this._icons} _label={this._label}></KolSpanWcTag>\n\t\t\t\t\t{hasSmartButton && this.renderSmartButton(this.state._smartButton as ButtonProps)}\n\t\t\t\t</span>\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t/**\n\t * Defines the backgroundColor and foregroundColor.\n\t */\n\t@Prop() public _color?: Stringified<PropColor> = '#000';\n\n\t/**\n\t * Defines the icon classnames (e.g. `_icons=\"fa-solid fa-user\"`).\n\t */\n\t@Prop() public _icons?: Stringified<KoliBriIconsProp>;\n\n\t/**\n\t * Defines the visible or semantic label of the component (e.g. aria-label, label, headline, caption, summary, etc.).\n\t */\n\t@Prop() public _label!: LabelPropType;\n\n\t/**\n\t * Allows to add a button with an arbitrary action within the element (_hide-label only).\n\t */\n\t@Prop() public _smartButton?: Stringified<ButtonProps>;\n\n\t@State() public state: BadgeStates = {\n\t\t_color: {\n\t\t\tbackgroundColor: '#000',\n\t\t\tforegroundColor: '#fff',\n\t\t},\n\t};\n\n\tprivate handleColorChange = (value: unknown) => {\n\t\tconst colorPair = handleColorChange(value);\n\t\tthis.bgColorStr = colorPair.backgroundColor;\n\t\tthis.colorStr = colorPair.foregroundColor as string;\n\t};\n\n\t@Watch('_color')\n\tpublic validateColor(value?: Stringified<PropColor>): void {\n\t\tvalidateColor(this, value, {\n\t\t\tdefaultValue: '#000',\n\t\t\thooks: {\n\t\t\t\tbeforePatch: this.handleColorChange,\n\t\t\t},\n\t\t});\n\t}\n\n\t@Watch('_smartButton')\n\tpublic validateSmartButton(value?: ButtonProps | string): void {\n\t\tobjectObjectHandler(value, () => {\n\t\t\ttry {\n\t\t\t\tvalue = parseJson<ButtonProps>(value as string);\n\t\t\t\t// eslint-disable-next-line no-empty\n\t\t\t} catch (e) {\n\t\t\t\t// value behält den ursprünglichen Wert\n\t\t\t}\n\t\t\tsetState(this, '_smartButton', value);\n\t\t});\n\t}\n\n\tpublic componentWillLoad(): void {\n\t\tthis.validateColor(this._color);\n\t\tthis.validateSmartButton(this._smartButton);\n\t}\n}\n"],"version":3}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * KoliBri - The accessible HTML-Standard
3
3
  */
4
- import{proxyCustomElement,HTMLElement,h,Host}from"@stencil/core/internal/client";import{C as showExpertSlot}from"./index2.js";import{n as nonce}from"./dev.utils.js";import{t as tryToDispatchKoliBriEvent,s as stopPropagation}from"./events.js";import{g as getRenderStates}from"./controller2.js";import{a as InputRadioController}from"./controller3.js";import{p as propagateSubmitEventToForm}from"./controller.js";import{k as KolInputTag}from"./component-names.js";import"./i18n2.js";import{F as FormFieldMsgFc}from"./FormFieldMsg.js";const defaultStyleCss="@layer kol-component {\n :host {\n display: block;\n }\n}\n@layer kol-component {\n .kol-tooltip-wc {\n display: contents;\n }\n .kol-tooltip-wc .tooltip-floating {\n opacity: 0;\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, unset);\n max-width: 90vw;\n max-height: 90vh;\n animation-direction: normal;\n /* Can be used to specify the animation duration from the outside. 250ms by default. */\n animation-duration: var(--kolibri-tooltip-animation-duration, 250ms);\n animation-fill-mode: forwards;\n animation-iteration-count: 1;\n animation-timing-function: ease-in;\n }\n .kol-tooltip-wc .tooltip-floating.hide {\n animation-name: hideTooltip;\n }\n .kol-tooltip-wc .tooltip-floating.show {\n animation-name: showTooltip;\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 hideTooltip {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n display: none;\n }\n }\n @keyframes showTooltip {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n}\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 .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 :host {\n --border-width: 2px;\n --input-size: 1.5em;\n }\n .kol-input .icons {\n display: none;\n }\n label {\n cursor: pointer;\n }\n input {\n border-style: solid;\n border-radius: 100%;\n display: flex;\n width: var(--input-size);\n min-width: var(--input-size);\n height: var(--input-size);\n min-height: var(--input-size);\n margin: 0;\n padding: 0;\n border-width: var(--border-width);\n appearance: none;\n cursor: pointer;\n }\n input:before {\n border-radius: 100%;\n width: calc(var(--input-size) / 2);\n height: calc(var(--input-size) / 2);\n margin: auto;\n content: \"\";\n }\n input:checked:before {\n background-color: #000;\n }\n @media (forced-colors: active) {\n input:checked:before {\n /* Give it a visible background in forced colors mode */\n background-color: selectedItem !important;\n }\n }\n fieldset {\n display: flex;\n }\n fieldset.vertical {\n flex-direction: column;\n }\n fieldset .input-slot {\n display: flex;\n align-items: center;\n }\n /* required star is on fieldset legend */\n .required label > span::after {\n content: \"\";\n }\n}",KolInputRadioDefaultStyle0=defaultStyleCss,KolInputRadio$1=proxyCustomElement(class extends HTMLElement{async getValue(){return this.currentValue}async focus(){await this.kolFocus()}async kolFocus(){var e;null===(e=this.inputRef)||void 0===e||e.focus()}render(){const{ariaDescribedBy:e,hasError:t}=getRenderStates(this.state),n=showExpertSlot(this.state._label),i="string"==typeof this._hint&&this._hint.length>0;return h(Host,{key:"f024b1dc4ee66d69521d477b0514a49c6a0d44ed",class:"kol-input-radio"},h("fieldset",{key:"9c9cb9980f73a565fc640ba5165ffaabd9a67c88",class:{fieldset:!0,disabled:!0===this.state._disabled,error:!0===t,required:!0===this.state._required,"hidden-error":!0===this._hideError,[this.state._orientation]:!0}},h("legend",{key:"1a9297ad6eed45d02eb8b968d1d8c0cadee05de4",class:"block w-full mb-1 leading-normal"},h("span",{key:"e810fc276bfd5e4111fb16f1e36472e75da32b50"},h("span",{key:"d039159587647a8733c1cee54e6c40eec7847f5d",slot:"label"},n?h("slot",{name:"expert"}):this._label))),this.state._options.map((t,n)=>{const i=`${this.state._id}-${n}`,o=`radio-${n}`,a=this.state._value===t.value;return h(KolInputTag,{class:{radio:!0,disabled:Boolean(this.state._disabled||t.disabled)},key:i,_disabled:this.state._disabled||t.disabled,_hideLabel:this.state._hideLabel,_hint:t.hint,_id:i,_label:t.label,_renderNoLabel:!0,_required:this.state._required,_slotName:o,_tooltipAlign:this._tooltipAlign,_touched:this.state._touched},h("div",{slot:o,class:"radio-input-wrapper"},h("input",Object.assign({ref:this.state._value===t.value?this.catchRef:void 0,title:"","aria-describedby":e.length>0?e.join(" "):void 0,"aria-label":this.state._hideLabel&&"string"==typeof t.label?t.label:void 0,type:"radio",id:i,checked:a,name:this.state._name||this.state._id,disabled:this.state._disabled||t.disabled,required:this.state._required,tabIndex:this.state._tabIndex,value:`-${n}`},this.controller.onFacade,{onChange:this.onChange,onClick:void 0,onInput:this.onInput,onKeyDown:this.onKeyDown.bind(this),onFocus:e=>{this.controller.onFacade.onFocus(e),this.inputHasFocus=!0},onBlur:e=>{this.controller.onFacade.onBlur(e),this.inputHasFocus=!1}})),h("label",{class:"radio-label",htmlFor:`${i}`,style:{height:this.state._hideLabel?"0":void 0,margin:this.state._hideLabel?"0":void 0,padding:this.state._hideLabel?"0":void 0,visibility:this.state._hideLabel?"hidden":void 0}},h("span",null,h("span",{class:"radio-label-span-inner"},t.label)))))}),t&&h(FormFieldMsgFc,{key:"4ab353a44639e311e4f63cc14eebb0cd77736827",_alert:this.showAsAlert(),_hideError:this.state._hideError,_msg:this.state._msg,_id:this.state._id}),i&&h("span",{key:"cfc2dbeaa917525177d88f9f4ea7a65ac32a5e4b",class:"hint"},this.state._hint)))}constructor(){super(),this.__registerHost(),this.__attachShadow(),this.catchRef=e=>{this.inputRef=e},this.onInput=e=>{var t;if(e.target instanceof HTMLInputElement){const n=this.controller.getOptionByKey(e.target.value);void 0!==n&&(tryToDispatchKoliBriEvent("input",this.host,n.value),"function"==typeof(null===(t=this.state._on)||void 0===t?void 0:t.onInput)&&this.state._on.onInput(e,n.value))}},this.onChange=e=>{var t;if(e.target instanceof HTMLInputElement){const n=this.controller.getOptionByKey(e.target.value);void 0!==n&&(stopPropagation(e),tryToDispatchKoliBriEvent("change",this.host,n.value),this.controller.setFormAssociatedValue(n.value),"function"==typeof(null===(t=this.state._on)||void 0===t?void 0:t.onChange)&&this.state._on.onChange(e,n.value),this.currentValue=n.value)}},this.onKeyDown=e=>{"Enter"!==e.code&&"NumpadEnter"!==e.code||propagateSubmitEventToForm({form:this.host,ref:this.inputRef})},this._alert=void 0,this._disabled=!1,this._error=void 0,this._hideError=!1,this._hideLabel=!1,this._hint="",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._orientation="vertical",this._required=!1,this._syncValueBySelector=void 0,this._tabIndex=void 0,this._tooltipAlign="top",this._touched=!1,this._value=void 0,this.state={_hideError:!1,_id:`id-${nonce()}`,_label:"",_options:[],_orientation:"vertical"},this.inputHasFocus=!1,this.controller=new InputRadioController(this,"radio",this.host)}showAsAlert(){return void 0===this.state._alert?Boolean(this.state._touched)&&!this.inputHasFocus:this.state._alert}validateTooltipAlign(e){this.controller.validateTooltipAlign(e)}validateAlert(e){this.controller.validateAlert(e)}validateDisabled(e){this.controller.validateDisabled(e)}validateError(e){this.controller.validateError(e)}validateHideLabel(e){this.controller.validateHideLabel(e)}validateHideError(e){this.controller.validateHideError(e)}validateHint(e){this.controller.validateHint(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)}validateOrientation(e){this.controller.validateOrientation(e)}validateRequired(e){this.controller.validateRequired(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)}componentWillLoad(){this._touched=!0===this._touched,this.currentValue=this._value,this.controller.componentWillLoad()}static get delegatesFocus(){return!0}get host(){return this}static get watchers(){return{_tooltipAlign:["validateTooltipAlign"],_alert:["validateAlert"],_disabled:["validateDisabled"],_error:["validateError"],_hideLabel:["validateHideLabel"],_hideError:["validateHideError"],_hint:["validateHint"],_id:["validateId"],_label:["validateLabel"],_msg:["validateMsg"],_name:["validateName"],_on:["validateOn"],_options:["validateOptions"],_orientation:["validateOrientation"],_required:["validateRequired"],_syncValueBySelector:["validateSyncValueBySelector"],_tabIndex:["validateTabIndex"],_touched:["validateTouched"],_value:["validateValue"]}}static get style(){return{default:KolInputRadioDefaultStyle0}}},[49,"kol-input-radio",{_alert:[1540],_disabled:[4],_error:[1],_hideError:[1540,"_hide-error"],_hideLabel:[4,"_hide-label"],_hint:[1],_id:[1],_label:[1],_msg:[1],_name:[1],_on:[16],_options:[1],_orientation:[1],_required:[4],_syncValueBySelector:[1,"_sync-value-by-selector"],_tabIndex:[2,"_tab-index"],_tooltipAlign:[1,"_tooltip-align"],_touched:[1540],_value:[8],state:[32],inputHasFocus:[32],getValue:[64],focus:[64],kolFocus:[64]},void 0,{_tooltipAlign:["validateTooltipAlign"],_alert:["validateAlert"],_disabled:["validateDisabled"],_error:["validateError"],_hideLabel:["validateHideLabel"],_hideError:["validateHideError"],_hint:["validateHint"],_id:["validateId"],_label:["validateLabel"],_msg:["validateMsg"],_name:["validateName"],_on:["validateOn"],_options:["validateOptions"],_orientation:["validateOrientation"],_required:["validateRequired"],_syncValueBySelector:["validateSyncValueBySelector"],_tabIndex:["validateTabIndex"],_touched:["validateTouched"],_value:["validateValue"]}]);function defineCustomElement$1(){if("undefined"==typeof customElements)return;["kol-input-radio"].forEach(e=>{if("kol-input-radio"===e)customElements.get(e)||customElements.define(e,KolInputRadio$1)})}const KolInputRadio=KolInputRadio$1,defineCustomElement=defineCustomElement$1;export{KolInputRadio,defineCustomElement};
4
+ import{proxyCustomElement,HTMLElement,h,Host}from"@stencil/core/internal/client";import{C as showExpertSlot}from"./index2.js";import{n as nonce}from"./dev.utils.js";import{t as tryToDispatchKoliBriEvent,s as stopPropagation}from"./events.js";import{g as getRenderStates}from"./controller2.js";import{a as InputRadioController}from"./controller3.js";import{p as propagateSubmitEventToForm}from"./controller.js";import{k as KolInputTag}from"./component-names.js";import"./i18n2.js";import{F as FormFieldMsgFc}from"./FormFieldMsg.js";const defaultStyleCss="@layer kol-component {\n :host {\n display: block;\n }\n}\n@layer kol-component {\n .kol-tooltip-wc {\n display: contents;\n }\n .kol-tooltip-wc .tooltip-floating {\n opacity: 0;\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, unset);\n max-width: 90vw;\n max-height: 90vh;\n animation-direction: normal;\n /* Can be used to specify the animation duration from the outside. 250ms by default. */\n animation-duration: var(--kolibri-tooltip-animation-duration, 250ms);\n animation-fill-mode: forwards;\n animation-iteration-count: 1;\n animation-timing-function: ease-in;\n }\n .kol-tooltip-wc .tooltip-floating.hide {\n animation-name: hideTooltip;\n }\n .kol-tooltip-wc .tooltip-floating.show {\n animation-name: showTooltip;\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 hideTooltip {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n display: none;\n }\n }\n @keyframes showTooltip {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n}\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 .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 :host {\n --border-width: 2px;\n --input-size: 1.5em;\n }\n .kol-input .icons {\n display: none;\n }\n label {\n cursor: pointer;\n }\n input {\n border-style: solid;\n border-radius: 100%;\n display: flex;\n width: var(--input-size);\n min-width: var(--input-size);\n height: var(--input-size);\n min-height: var(--input-size);\n margin: 0;\n padding: 0;\n border-width: var(--border-width);\n appearance: none;\n cursor: pointer;\n }\n input:before {\n border-radius: 100%;\n width: calc(var(--input-size) / 2);\n height: calc(var(--input-size) / 2);\n margin: auto;\n content: \"\";\n }\n input:checked:before {\n background-color: #000;\n }\n @media (forced-colors: active) {\n input:checked:before {\n /* Give it a visible background in forced colors mode */\n background-color: selectedItem !important;\n }\n }\n fieldset {\n display: flex;\n }\n fieldset.vertical {\n flex-direction: column;\n }\n fieldset .input-slot {\n display: flex;\n align-items: center;\n }\n /* required star is on fieldset legend */\n .required label > span::after {\n content: \"\";\n }\n}",KolInputRadioDefaultStyle0=defaultStyleCss,KolInputRadio$1=proxyCustomElement(class extends HTMLElement{async getValue(){return this.currentValue}async focus(){await this.kolFocus()}async kolFocus(){var e;null===(e=this.inputRef)||void 0===e||e.focus()}render(){const{ariaDescribedBy:e,hasError:t,hasHint:n}=getRenderStates(this.state),i=showExpertSlot(this.state._label);return h(Host,{key:"0ace03e6b8caeac0abb1577ac3baac3dcd5a26ff",class:"kol-input-radio"},h("fieldset",{key:"94c25cd781f26aa3dc2938c2fd2b6d068b22117e","aria-describedby":e.length>0?e.join(" "):void 0,class:{fieldset:!0,disabled:!0===this.state._disabled,error:!0===t,required:!0===this.state._required,"hidden-error":!0===this._hideError,[this.state._orientation]:!0}},h("legend",{key:"92887a844b031ccdb7550e55550d3d528f851c40",class:"block w-full mb-1 leading-normal"},h("span",{key:"6a28e88daa688a56ca2f8a453f77b7d55a3bd237"},h("span",{key:"6acfe8d22beff0105bec6f203e29bfde5f2c4ba5",slot:"label"},i?h("slot",{name:"expert"}):this._label))),this.state._options.map((e,t)=>{const n=`${this.state._id}-${t}`,i=`radio-${t}`,a=this.state._value===e.value;return h(KolInputTag,{class:{radio:!0,disabled:Boolean(this.state._disabled||e.disabled)},key:n,_disabled:this.state._disabled||e.disabled,_hideLabel:this.state._hideLabel,_hint:e.hint,_id:n,_label:e.label,_renderNoLabel:!0,_required:this.state._required,_slotName:i,_tooltipAlign:this._tooltipAlign,_touched:this.state._touched},h("div",{slot:i,class:"radio-input-wrapper"},h("input",Object.assign({ref:this.state._value===e.value?this.catchRef:void 0,title:"","aria-label":this.state._hideLabel&&"string"==typeof e.label?e.label:void 0,type:"radio",id:n,checked:a,name:this.state._name||this.state._id,disabled:this.state._disabled||e.disabled,required:this.state._required,tabIndex:this.state._tabIndex,value:`-${t}`},this.controller.onFacade,{onChange:this.onChange,onClick:void 0,onInput:this.onInput,onKeyDown:this.onKeyDown.bind(this),onFocus:e=>{this.controller.onFacade.onFocus(e),this.inputHasFocus=!0},onBlur:e=>{this.controller.onFacade.onBlur(e),this.inputHasFocus=!1}})),h("label",{class:"radio-label",htmlFor:`${n}`,style:{height:this.state._hideLabel?"0":void 0,margin:this.state._hideLabel?"0":void 0,padding:this.state._hideLabel?"0":void 0,visibility:this.state._hideLabel?"hidden":void 0}},h("span",null,h("span",{class:"radio-label-span-inner"},e.label)))))}),t&&h(FormFieldMsgFc,{key:"2b39bf4d20435ee90359429bebfe12766d383b94",_alert:this.showAsAlert(),_hideError:this.state._hideError,_msg:this.state._msg,_id:this.state._id}),n&&h("span",{key:"9a18f783fa05aac61ac49475eb1f2bb1a83e4e63",class:"hint",id:`${this.state._id}-hint`},this.state._hint)))}constructor(){super(),this.__registerHost(),this.__attachShadow(),this.catchRef=e=>{this.inputRef=e},this.onInput=e=>{var t;if(e.target instanceof HTMLInputElement){const n=this.controller.getOptionByKey(e.target.value);void 0!==n&&(tryToDispatchKoliBriEvent("input",this.host,n.value),"function"==typeof(null===(t=this.state._on)||void 0===t?void 0:t.onInput)&&this.state._on.onInput(e,n.value))}},this.onChange=e=>{var t;if(e.target instanceof HTMLInputElement){const n=this.controller.getOptionByKey(e.target.value);void 0!==n&&(stopPropagation(e),tryToDispatchKoliBriEvent("change",this.host,n.value),this.controller.setFormAssociatedValue(n.value),"function"==typeof(null===(t=this.state._on)||void 0===t?void 0:t.onChange)&&this.state._on.onChange(e,n.value),this.currentValue=n.value)}},this.onKeyDown=e=>{"Enter"!==e.code&&"NumpadEnter"!==e.code||propagateSubmitEventToForm({form:this.host,ref:this.inputRef})},this._alert=void 0,this._disabled=!1,this._error=void 0,this._hideError=!1,this._hideLabel=!1,this._hint="",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._orientation="vertical",this._required=!1,this._syncValueBySelector=void 0,this._tabIndex=void 0,this._tooltipAlign="top",this._touched=!1,this._value=void 0,this.state={_hideError:!1,_id:`id-${nonce()}`,_label:"",_options:[],_orientation:"vertical"},this.inputHasFocus=!1,this.controller=new InputRadioController(this,"radio",this.host)}showAsAlert(){return void 0===this.state._alert?Boolean(this.state._touched)&&!this.inputHasFocus:this.state._alert}validateTooltipAlign(e){this.controller.validateTooltipAlign(e)}validateAlert(e){this.controller.validateAlert(e)}validateDisabled(e){this.controller.validateDisabled(e)}validateError(e){this.controller.validateError(e)}validateHideLabel(e){this.controller.validateHideLabel(e)}validateHideError(e){this.controller.validateHideError(e)}validateHint(e){this.controller.validateHint(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)}validateOrientation(e){this.controller.validateOrientation(e)}validateRequired(e){this.controller.validateRequired(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)}componentWillLoad(){this._touched=!0===this._touched,this.currentValue=this._value,this.controller.componentWillLoad()}static get delegatesFocus(){return!0}get host(){return this}static get watchers(){return{_tooltipAlign:["validateTooltipAlign"],_alert:["validateAlert"],_disabled:["validateDisabled"],_error:["validateError"],_hideLabel:["validateHideLabel"],_hideError:["validateHideError"],_hint:["validateHint"],_id:["validateId"],_label:["validateLabel"],_msg:["validateMsg"],_name:["validateName"],_on:["validateOn"],_options:["validateOptions"],_orientation:["validateOrientation"],_required:["validateRequired"],_syncValueBySelector:["validateSyncValueBySelector"],_tabIndex:["validateTabIndex"],_touched:["validateTouched"],_value:["validateValue"]}}static get style(){return{default:KolInputRadioDefaultStyle0}}},[49,"kol-input-radio",{_alert:[1540],_disabled:[4],_error:[1],_hideError:[1540,"_hide-error"],_hideLabel:[4,"_hide-label"],_hint:[1],_id:[1],_label:[1],_msg:[1],_name:[1],_on:[16],_options:[1],_orientation:[1],_required:[4],_syncValueBySelector:[1,"_sync-value-by-selector"],_tabIndex:[2,"_tab-index"],_tooltipAlign:[1,"_tooltip-align"],_touched:[1540],_value:[8],state:[32],inputHasFocus:[32],getValue:[64],focus:[64],kolFocus:[64]},void 0,{_tooltipAlign:["validateTooltipAlign"],_alert:["validateAlert"],_disabled:["validateDisabled"],_error:["validateError"],_hideLabel:["validateHideLabel"],_hideError:["validateHideError"],_hint:["validateHint"],_id:["validateId"],_label:["validateLabel"],_msg:["validateMsg"],_name:["validateName"],_on:["validateOn"],_options:["validateOptions"],_orientation:["validateOrientation"],_required:["validateRequired"],_syncValueBySelector:["validateSyncValueBySelector"],_tabIndex:["validateTabIndex"],_touched:["validateTouched"],_value:["validateValue"]}]);function defineCustomElement$1(){if("undefined"==typeof customElements)return;["kol-input-radio"].forEach(e=>{if("kol-input-radio"===e)customElements.get(e)||customElements.define(e,KolInputRadio$1)})}const KolInputRadio=KolInputRadio$1,defineCustomElement=defineCustomElement$1;export{KolInputRadio,defineCustomElement};
@@ -1 +1 @@
1
- {"file":"kol-input-radio.js","mappings":";;;;;;;;;;;;;;AAAA,MAAM,eAAe,GAAG,ytRAAytR,CAAC;AAClvR,mCAAe,eAAe;;MCwCjBA,eAAa;IAelB,MAAM,QAAQ;QACpB,OAAO,IAAI,CAAC,YAAY,CAAC;KACzB;IAMM,MAAM,KAAK;QACjB,MAAM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,CAAC,CAAC;KACvC;IAGM,mBAAmB,CAAC,KAAmB;QAC7C,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;KAC3C;IAGM,gBAAgB,CAAC,KAAe;QACtC,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;KACxC;IAGM,2BAA2B,CAAC,KAAmC;QACrE,IAAI,CAAC,UAAU,CAAC,2BAA2B,CAAC,KAAK,CAAC,CAAC;KACnD;IAGM,gBAAgB,CAAC,KAAc;QACrC,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;KACxC;IAGM,eAAe,CAAC,KAAe;QACrC,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;KACvC;IAGM,aAAa,CAAC,KAAmC;QACvD,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;KACrC;IAEM,iBAAiB;QACvB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC;QACvC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC;QAChC,IAAI,CAAC,UAAU,CAAC,iBAAiB,EAAE,CAAC;KACpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["KolInputRadio","KolFormFieldMsgFc"],"sources":["src/components/input-radio/style.scss?tag=kol-input-radio&mode=default&encapsulation=shadow","src/components/input-radio/shadow.tsx"],"sourcesContent":["@use '../@shared/mixins' as *;\n@use '../@shared/kol-alert-mixin' as *;\n@use '../style' as *;\n@use '../input' as *;\n\n@include kol-alert-styles;\n\n@layer kol-component {\n\t:host {\n\t\t--border-width: 2px;\n\t\t--input-size: 1.5em;\n\t}\n\n\t.kol-input .icons {\n\t\tdisplay: none;\n\t}\n\n\tlabel {\n\t\tcursor: pointer;\n\t}\n\n\tinput {\n\t\tborder-style: solid;\n\t\tborder-radius: 100%;\n\t\tdisplay: flex;\n\t\twidth: var(--input-size);\n\t\tmin-width: var(--input-size);\n\t\theight: var(--input-size);\n\t\tmin-height: var(--input-size);\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t\tborder-width: var(--border-width);\n\t\tappearance: none;\n\t\tcursor: pointer;\n\t}\n\n\tinput:before {\n\t\tborder-radius: 100%;\n\t\twidth: calc(var(--input-size) / 2);\n\t\theight: calc(var(--input-size) / 2);\n\t\tmargin: auto;\n\n\t\tcontent: '';\n\t}\n\n\tinput:checked:before {\n\t\tbackground-color: #000;\n\t}\n\n\t@media (forced-colors: active) {\n\t\tinput:checked:before {\n\t\t\t/* Give it a visible background in forced colors mode */\n\t\t\tbackground-color: selectedItem !important;\n\t\t}\n\t}\n\n\tfieldset {\n\t\tdisplay: flex;\n\t}\n\n\tfieldset.vertical {\n\t\tflex-direction: column;\n\t}\n\n\tfieldset .input-slot {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t}\n\n\t/* required star is on fieldset legend */\n\t.required label > span::after {\n\t\tcontent: '';\n\t}\n}\n","import type {\n\tFocusableElement,\n\tHideErrorPropType,\n\tIdPropType,\n\tInputRadioAPI,\n\tInputRadioStates,\n\tInputTypeOnDefault,\n\tLabelWithExpertSlotPropType,\n\tMsgPropType,\n\tNamePropType,\n\tOrientation,\n\tRadioOptionsPropType,\n\tStencilUnknown,\n\tStringified,\n\tSyncValueBySelectorPropType,\n\tTooltipAlignPropType,\n} from '../../schema';\nimport { showExpertSlot } from '../../schema';\nimport type { JSX } from '@stencil/core';\nimport { Component, Element, h, Host, Method, Prop, State, Watch } from '@stencil/core';\n\nimport { nonce } from '../../utils/dev.utils';\nimport { stopPropagation, tryToDispatchKoliBriEvent } from '../../utils/events';\nimport { getRenderStates } from '../input/controller';\nimport { InputRadioController } from './controller';\nimport { propagateSubmitEventToForm } from '../form/controller';\nimport { KolInputTag } from '../../core/component-names';\nimport { KolFormFieldMsgFc } from '../../functional-components';\n\n/**\n * @slot - Die Legende/Überschrift der Radiobuttons.\n */\n@Component({\n\ttag: 'kol-input-radio',\n\tstyleUrls: {\n\t\tdefault: './style.scss',\n\t},\n\tshadow: {\n\t\tdelegatesFocus: true,\n\t},\n})\nexport class KolInputRadio implements InputRadioAPI, FocusableElement {\n\t@Element() private readonly host?: HTMLKolInputRadioElement;\n\tprivate currentValue?: StencilUnknown;\n\n\tprivate inputRef?: HTMLInputElement;\n\n\tprivate readonly catchRef = (ref?: HTMLInputElement) => {\n\t\tthis.inputRef = ref;\n\t};\n\n\t/**\n\t * Returns the selected value.\n\t */\n\t@Method()\n\t// eslint-disable-next-line @typescript-eslint/require-await\n\tpublic async getValue(): Promise<StencilUnknown | undefined> {\n\t\treturn this.currentValue;\n\t}\n\n\t/**\n\t * @deprecated Use kolFocus instead.\n\t */\n\t@Method()\n\tpublic async focus() {\n\t\tawait this.kolFocus();\n\t}\n\n\t/**\n\t * Focuses the radio input.\n\t */\n\t@Method()\n\t// eslint-disable-next-line @typescript-eslint/require-await\n\tpublic async kolFocus() {\n\t\tthis.inputRef?.focus();\n\t}\n\n\tpublic render(): JSX.Element {\n\t\tconst { ariaDescribedBy, hasError } = getRenderStates(this.state);\n\t\tconst hasExpertSlot = showExpertSlot(this.state._label);\n\t\tconst hasHint = typeof this._hint === 'string' && this._hint.length > 0;\n\t\treturn (\n\t\t\t<Host class=\"kol-input-radio\">\n\t\t\t\t<fieldset\n\t\t\t\t\tclass={{\n\t\t\t\t\t\tfieldset: true,\n\t\t\t\t\t\tdisabled: this.state._disabled === true,\n\t\t\t\t\t\terror: hasError === true,\n\t\t\t\t\t\trequired: this.state._required === true,\n\t\t\t\t\t\t'hidden-error': this._hideError === true,\n\t\t\t\t\t\t[this.state._orientation]: true,\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<legend class=\"block w-full mb-1 leading-normal\">\n\t\t\t\t\t\t{/* INFO: span is needed for css styling :after content like a star (*) or optional text ! */}\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t{/* INFO: label comes with any html tag or as plain text! */}\n\t\t\t\t\t\t\t<span slot=\"label\">{hasExpertSlot ? <slot name=\"expert\"></slot> : this._label}</span>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</legend>\n\t\t\t\t\t{this.state._options.map((option, index) => {\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Damit der Value einer Option ein beliebigen Typ haben kann\n\t\t\t\t\t\t * muss man auf HTML-Ebene den Value auf einen String-Wert\n\t\t\t\t\t\t * mappen. Das tun wir mittels der Map.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tconst customId = `${this.state._id}-${index}`;\n\t\t\t\t\t\tconst slotName = `radio-${index}`;\n\t\t\t\t\t\tconst selected = this.state._value === option.value;\n\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<KolInputTag\n\t\t\t\t\t\t\t\tclass={{\n\t\t\t\t\t\t\t\t\tradio: true,\n\t\t\t\t\t\t\t\t\tdisabled: Boolean(this.state._disabled || option.disabled),\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tkey={customId}\n\t\t\t\t\t\t\t\t_disabled={this.state._disabled || option.disabled}\n\t\t\t\t\t\t\t\t_hideLabel={this.state._hideLabel}\n\t\t\t\t\t\t\t\t_hint={option.hint}\n\t\t\t\t\t\t\t\t_id={customId}\n\t\t\t\t\t\t\t\t_label={option.label as string}\n\t\t\t\t\t\t\t\t_renderNoLabel={true}\n\t\t\t\t\t\t\t\t_required={this.state._required}\n\t\t\t\t\t\t\t\t_slotName={slotName}\n\t\t\t\t\t\t\t\t_tooltipAlign={this._tooltipAlign}\n\t\t\t\t\t\t\t\t_touched={this.state._touched}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<div slot={slotName} class=\"radio-input-wrapper\">\n\t\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\t\tref={this.state._value === option.value ? this.catchRef : undefined}\n\t\t\t\t\t\t\t\t\t\ttitle=\"\"\n\t\t\t\t\t\t\t\t\t\taria-describedby={ariaDescribedBy.length > 0 ? ariaDescribedBy.join(' ') : undefined}\n\t\t\t\t\t\t\t\t\t\taria-label={this.state._hideLabel && typeof option.label === 'string' ? option.label : undefined}\n\t\t\t\t\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\t\t\t\t\tid={customId}\n\t\t\t\t\t\t\t\t\t\tchecked={selected}\n\t\t\t\t\t\t\t\t\t\tname={this.state._name || this.state._id}\n\t\t\t\t\t\t\t\t\t\tdisabled={this.state._disabled || option.disabled}\n\t\t\t\t\t\t\t\t\t\trequired={this.state._required}\n\t\t\t\t\t\t\t\t\t\ttabIndex={this.state._tabIndex}\n\t\t\t\t\t\t\t\t\t\tvalue={`-${index}`}\n\t\t\t\t\t\t\t\t\t\t{...this.controller.onFacade}\n\t\t\t\t\t\t\t\t\t\tonChange={this.onChange}\n\t\t\t\t\t\t\t\t\t\tonClick={undefined} // onClick is not needed since onChange already triggers the correct event\n\t\t\t\t\t\t\t\t\t\tonInput={this.onInput}\n\t\t\t\t\t\t\t\t\t\tonKeyDown={this.onKeyDown.bind(this)}\n\t\t\t\t\t\t\t\t\t\tonFocus={(event) => {\n\t\t\t\t\t\t\t\t\t\t\tthis.controller.onFacade.onFocus(event);\n\t\t\t\t\t\t\t\t\t\t\tthis.inputHasFocus = true;\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\tonBlur={(event) => {\n\t\t\t\t\t\t\t\t\t\t\tthis.controller.onFacade.onBlur(event);\n\t\t\t\t\t\t\t\t\t\t\tthis.inputHasFocus = false;\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t<label\n\t\t\t\t\t\t\t\t\t\tclass=\"radio-label\"\n\t\t\t\t\t\t\t\t\t\thtmlFor={`${customId}`}\n\t\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\t\theight: this.state._hideLabel ? '0' : undefined,\n\t\t\t\t\t\t\t\t\t\t\tmargin: this.state._hideLabel ? '0' : undefined,\n\t\t\t\t\t\t\t\t\t\t\tpadding: this.state._hideLabel ? '0' : undefined,\n\t\t\t\t\t\t\t\t\t\t\tvisibility: this.state._hideLabel ? 'hidden' : undefined,\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"radio-label-span-inner\">{option.label}</span>\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</KolInputTag>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t\t{hasError && <KolFormFieldMsgFc _alert={this.showAsAlert()} _hideError={this.state._hideError} _msg={this.state._msg} _id={this.state._id} />}\n\t\t\t\t\t{hasHint && <span class=\"hint\">{this.state._hint}</span>}\n\t\t\t\t</fieldset>\n\t\t\t</Host>\n\t\t);\n\t}\n\n\tprivate readonly controller: InputRadioController;\n\n\t/**\n\t * Defines whether the screen-readers should read out the notification.\n\t * @deprecated Will be removed in v3. Use automatic behaviour instead.\n\t */\n\t@Prop({ mutable: true, reflect: true }) public _alert?: boolean;\n\n\t/**\n\t * Makes the element not focusable and ignore all events.\n\t * @TODO: Change type back to `DisabledPropType` after Stencil#4663 has been resolved.\n\t */\n\t@Prop() public _disabled?: boolean = false;\n\n\t/**\n\t * Defines the error message text.\n\t * @deprecated Will be removed in v3. Use `msg` instead.\n\t */\n\t@Prop() public _error?: string;\n\n\t/**\n\t * Hides the error message but leaves it in the DOM for the input's aria-describedby.\n\t * @TODO: Change type back to `HideErrorPropType` after Stencil#4663 has been resolved.\n\t */\n\t@Prop({ mutable: true, reflect: true }) public _hideError?: boolean = false;\n\n\t/**\n\t * Hides the caption by default and displays the caption text with a tooltip when the\n\t * interactive element is focused or the mouse is over it.\n\t * @TODO: Change type back to `HideLabelPropType` after Stencil#4663 has been resolved.\n\t */\n\t@Prop() public _hideLabel?: boolean = false;\n\n\t/**\n\t * Defines the hint text.\n\t */\n\t@Prop() public _hint?: string = '';\n\n\t/**\n\t * Defines the internal ID of the primary component element.\n\t */\n\t@Prop() public _id?: IdPropType;\n\n\t/**\n\t * Defines the visible or semantic label of the component (e.g. aria-label, label, headline, caption, summary, etc.). Set to `false` to enable the expert slot.\n\t */\n\t@Prop() public _label!: LabelWithExpertSlotPropType;\n\n\t/**\n\t * Defines the properties for a message rendered as Alert component.\n\t */\n\t@Prop() public _msg?: Stringified<MsgPropType>;\n\n\t/**\n\t * Defines the technical name of an input field.\n\t */\n\t@Prop() public _name?: NamePropType;\n\n\t/**\n\t * Gibt die EventCallback-Funktionen für das Input-Event an.\n\t */\n\t@Prop() public _on?: InputTypeOnDefault;\n\n\t/**\n\t * Options the user can choose from.\n\t */\n\t@Prop() public _options?: RadioOptionsPropType;\n\n\t/**\n\t * Defines whether the orientation of the component is horizontal or vertical.\n\t */\n\t@Prop() public _orientation?: Orientation = 'vertical';\n\n\t/**\n\t * Makes the input element required.\n\t * @TODO: Change type back to `RequiredPropType` after Stencil#4663 has been resolved.\n\t */\n\t@Prop() public _required?: boolean = false;\n\n\t/**\n\t * Selector for synchronizing the value with another input element.\n\t * @internal\n\t */\n\t@Prop() public _syncValueBySelector?: SyncValueBySelectorPropType;\n\n\t/**\n\t * Defines which tab-index the primary element of the component has. (https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex)\n\t */\n\t@Prop() public _tabIndex?: number;\n\n\t/**\n\t * Defines where to show the Tooltip preferably: top, right, bottom or left.\n\t */\n\t@Prop() public _tooltipAlign?: TooltipAlignPropType = 'top';\n\n\t/**\n\t * Shows if the input was touched by a user.\n\t * @TODO: Change type back to `TouchedPropType` after Stencil#4663 has been resolved.\n\t */\n\t@Prop({ mutable: true, reflect: true }) public _touched?: boolean = false;\n\n\t/**\n\t * Defines the value of the input.\n\t * @see Known bug: https://github.com/ionic-team/stencil/issues/3902\n\t */\n\t@Prop() public _value?: StencilUnknown;\n\n\t@State() public state: InputRadioStates = {\n\t\t_hideError: false,\n\t\t_id: `id-${nonce()}`,\n\t\t_label: '', // ⚠ required\n\t\t_options: [],\n\t\t_orientation: 'vertical',\n\t};\n\n\t@State() private inputHasFocus = false;\n\n\tpublic constructor() {\n\t\tthis.controller = new InputRadioController(this, 'radio', this.host);\n\t}\n\n\tprivate showAsAlert(): boolean {\n\t\tif (this.state._alert === undefined) {\n\t\t\treturn Boolean(this.state._touched) && !this.inputHasFocus;\n\t\t}\n\t\treturn this.state._alert;\n\t}\n\n\t@Watch('_tooltipAlign')\n\tpublic validateTooltipAlign(value?: TooltipAlignPropType): void {\n\t\tthis.controller.validateTooltipAlign(value);\n\t}\n\t@Watch('_alert')\n\tpublic validateAlert(value?: boolean): void {\n\t\tthis.controller.validateAlert(value);\n\t}\n\n\t@Watch('_disabled')\n\tpublic validateDisabled(value?: boolean): void {\n\t\tthis.controller.validateDisabled(value);\n\t}\n\n\t@Watch('_error')\n\tpublic validateError(value?: string): void {\n\t\tthis.controller.validateError(value);\n\t}\n\n\t@Watch('_hideLabel')\n\tpublic validateHideLabel(value?: boolean): void {\n\t\tthis.controller.validateHideLabel(value);\n\t}\n\n\t@Watch('_hideError')\n\tpublic validateHideError(value?: HideErrorPropType): void {\n\t\tthis.controller.validateHideError(value);\n\t}\n\n\t@Watch('_hint')\n\tpublic validateHint(value?: string): void {\n\t\tthis.controller.validateHint(value);\n\t}\n\n\t@Watch('_id')\n\tpublic validateId(value?: string): void {\n\t\tthis.controller.validateId(value);\n\t}\n\n\t@Watch('_label')\n\tpublic validateLabel(value?: LabelWithExpertSlotPropType): void {\n\t\tthis.controller.validateLabel(value);\n\t}\n\n\t@Watch('_msg')\n\tpublic validateMsg(value?: Stringified<MsgPropType>): void {\n\t\tthis.controller.validateMsg(value);\n\t}\n\n\t@Watch('_name')\n\tpublic validateName(value?: string): void {\n\t\tthis.controller.validateName(value);\n\t}\n\n\t@Watch('_on')\n\tpublic validateOn(value?: InputTypeOnDefault): void {\n\t\tthis.controller.validateOn(value);\n\t}\n\n\t@Watch('_options')\n\tpublic validateOptions(value?: RadioOptionsPropType): void {\n\t\tthis.controller.validateOptions(value);\n\t}\n\n\t@Watch('_orientation')\n\tpublic validateOrientation(value?: Orientation): void {\n\t\tthis.controller.validateOrientation(value);\n\t}\n\n\t@Watch('_required')\n\tpublic validateRequired(value?: boolean): void {\n\t\tthis.controller.validateRequired(value);\n\t}\n\n\t@Watch('_syncValueBySelector')\n\tpublic validateSyncValueBySelector(value?: SyncValueBySelectorPropType): void {\n\t\tthis.controller.validateSyncValueBySelector(value);\n\t}\n\n\t@Watch('_tabIndex')\n\tpublic validateTabIndex(value?: number): void {\n\t\tthis.controller.validateTabIndex(value);\n\t}\n\n\t@Watch('_touched')\n\tpublic validateTouched(value?: boolean): void {\n\t\tthis.controller.validateTouched(value);\n\t}\n\n\t@Watch('_value')\n\tpublic validateValue(value?: Stringified<StencilUnknown>): void {\n\t\tthis.controller.validateValue(value);\n\t}\n\n\tpublic componentWillLoad(): void {\n\t\tthis._touched = this._touched === true;\n\t\tthis.currentValue = this._value;\n\t\tthis.controller.componentWillLoad();\n\t}\n\n\tprivate onInput = (event: Event): void => {\n\t\tif (event.target instanceof HTMLInputElement) {\n\t\t\tconst option = this.controller.getOptionByKey(event.target.value);\n\t\t\tif (option !== undefined) {\n\t\t\t\t// Event handling\n\t\t\t\ttryToDispatchKoliBriEvent('input', this.host, option.value);\n\n\t\t\t\t// Callback\n\t\t\t\tif (typeof this.state._on?.onInput === 'function') {\n\t\t\t\t\tthis.state._on.onInput(event, option.value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\tprivate onChange = (event: Event): void => {\n\t\tif (event.target instanceof HTMLInputElement) {\n\t\t\tconst option = this.controller.getOptionByKey(event.target.value);\n\t\t\tif (option !== undefined) {\n\t\t\t\t// Event handling\n\t\t\t\tstopPropagation(event);\n\t\t\t\ttryToDispatchKoliBriEvent('change', this.host, option.value);\n\n\t\t\t\t// Static form handling\n\t\t\t\tthis.controller.setFormAssociatedValue(option.value);\n\n\t\t\t\t// Callback\n\t\t\t\tif (typeof this.state._on?.onChange === 'function') {\n\t\t\t\t\tthis.state._on.onChange(event, option.value);\n\t\t\t\t}\n\n\t\t\t\tthis.currentValue = option.value;\n\t\t\t}\n\t\t}\n\t};\n\n\tprivate readonly onKeyDown = (event: KeyboardEvent) => {\n\t\tif (event.code === 'Enter' || event.code === 'NumpadEnter') {\n\t\t\tpropagateSubmitEventToForm({\n\t\t\t\tform: this.host,\n\t\t\t\tref: this.inputRef,\n\t\t\t});\n\t\t}\n\t};\n}\n"],"version":3}
1
+ {"file":"kol-input-radio.js","mappings":";;;;;;;;;;;;;;AAAA,MAAM,eAAe,GAAG,ytRAAytR,CAAC;AAClvR,mCAAe,eAAe;;MCwCjBA,eAAa;IAelB,MAAM,QAAQ;QACpB,OAAO,IAAI,CAAC,YAAY,CAAC;KACzB;IAMM,MAAM,KAAK;QACjB,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;KACtB;IAOM,MAAM,QAAQ;;QACpB,MAAA,IAAI,CAAC,QAAQ,0CAAE,KAAK,EAAE,CAAC;KACvB;IAEM,MAAM;QACZ,MAAM,EAAE,eAAe,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC3E,MAAM,aAAa,GAAG,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACxD,QACC,EAAC,IAAI,qDAAC,KAAK,EAAC,iBAAiB,IAC5B,qFACmB,eAAe,CAAC,MAAM,GAAG,CAAC,GAAG,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,SAAS,EACpF,KAAK,EAAE;gBACN,QAAQ,EAAE,IAAI;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AAa,CAAC,KAAK,CAAC,CAAC;KACrC;IAEM,iBAAiB;QACvB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC;QACvC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC;QAChC,IAAI,CAAC,UAAU,CAAC,iBAAiB,EAAE,CAAC;KACpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["KolInputRadio","KolFormFieldMsgFc"],"sources":["src/components/input-radio/style.scss?tag=kol-input-radio&mode=default&encapsulation=shadow","src/components/input-radio/shadow.tsx"],"sourcesContent":["@use '../@shared/mixins' as *;\n@use '../@shared/kol-alert-mixin' as *;\n@use '../style' as *;\n@use '../input' as *;\n\n@include kol-alert-styles;\n\n@layer kol-component {\n\t:host {\n\t\t--border-width: 2px;\n\t\t--input-size: 1.5em;\n\t}\n\n\t.kol-input .icons {\n\t\tdisplay: none;\n\t}\n\n\tlabel {\n\t\tcursor: pointer;\n\t}\n\n\tinput {\n\t\tborder-style: solid;\n\t\tborder-radius: 100%;\n\t\tdisplay: flex;\n\t\twidth: var(--input-size);\n\t\tmin-width: var(--input-size);\n\t\theight: var(--input-size);\n\t\tmin-height: var(--input-size);\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t\tborder-width: var(--border-width);\n\t\tappearance: none;\n\t\tcursor: pointer;\n\t}\n\n\tinput:before {\n\t\tborder-radius: 100%;\n\t\twidth: calc(var(--input-size) / 2);\n\t\theight: calc(var(--input-size) / 2);\n\t\tmargin: auto;\n\n\t\tcontent: '';\n\t}\n\n\tinput:checked:before {\n\t\tbackground-color: #000;\n\t}\n\n\t@media (forced-colors: active) {\n\t\tinput:checked:before {\n\t\t\t/* Give it a visible background in forced colors mode */\n\t\t\tbackground-color: selectedItem !important;\n\t\t}\n\t}\n\n\tfieldset {\n\t\tdisplay: flex;\n\t}\n\n\tfieldset.vertical {\n\t\tflex-direction: column;\n\t}\n\n\tfieldset .input-slot {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t}\n\n\t/* required star is on fieldset legend */\n\t.required label > span::after {\n\t\tcontent: '';\n\t}\n}\n","import type {\n\tFocusableElement,\n\tHideErrorPropType,\n\tIdPropType,\n\tInputRadioAPI,\n\tInputRadioStates,\n\tInputTypeOnDefault,\n\tLabelWithExpertSlotPropType,\n\tMsgPropType,\n\tNamePropType,\n\tOrientation,\n\tRadioOptionsPropType,\n\tStencilUnknown,\n\tStringified,\n\tSyncValueBySelectorPropType,\n\tTooltipAlignPropType,\n} from '../../schema';\nimport { showExpertSlot } from '../../schema';\nimport type { JSX } from '@stencil/core';\nimport { Component, Element, h, Host, Method, Prop, State, Watch } from '@stencil/core';\n\nimport { nonce } from '../../utils/dev.utils';\nimport { stopPropagation, tryToDispatchKoliBriEvent } from '../../utils/events';\nimport { getRenderStates } from '../input/controller';\nimport { InputRadioController } from './controller';\nimport { propagateSubmitEventToForm } from '../form/controller';\nimport { KolInputTag } from '../../core/component-names';\nimport { KolFormFieldMsgFc } from '../../functional-components';\n\n/**\n * @slot - Die Legende/Überschrift der Radiobuttons.\n */\n@Component({\n\ttag: 'kol-input-radio',\n\tstyleUrls: {\n\t\tdefault: './style.scss',\n\t},\n\tshadow: {\n\t\tdelegatesFocus: true,\n\t},\n})\nexport class KolInputRadio implements InputRadioAPI, FocusableElement {\n\t@Element() private readonly host?: HTMLKolInputRadioElement;\n\tprivate currentValue?: StencilUnknown;\n\n\tprivate inputRef?: HTMLInputElement;\n\n\tprivate readonly catchRef = (ref?: HTMLInputElement) => {\n\t\tthis.inputRef = ref;\n\t};\n\n\t/**\n\t * Returns the selected value.\n\t */\n\t@Method()\n\t// eslint-disable-next-line @typescript-eslint/require-await\n\tpublic async getValue(): Promise<StencilUnknown | undefined> {\n\t\treturn this.currentValue;\n\t}\n\n\t/**\n\t * @deprecated Use kolFocus instead.\n\t */\n\t@Method()\n\tpublic async focus() {\n\t\tawait this.kolFocus();\n\t}\n\n\t/**\n\t * Focuses the radio input.\n\t */\n\t@Method()\n\t// eslint-disable-next-line @typescript-eslint/require-await\n\tpublic async kolFocus() {\n\t\tthis.inputRef?.focus();\n\t}\n\n\tpublic render(): JSX.Element {\n\t\tconst { ariaDescribedBy, hasError, hasHint } = getRenderStates(this.state);\n\t\tconst hasExpertSlot = showExpertSlot(this.state._label);\n\t\treturn (\n\t\t\t<Host class=\"kol-input-radio\">\n\t\t\t\t<fieldset\n\t\t\t\t\taria-describedby={ariaDescribedBy.length > 0 ? ariaDescribedBy.join(' ') : undefined}\n\t\t\t\t\tclass={{\n\t\t\t\t\t\tfieldset: true,\n\t\t\t\t\t\tdisabled: this.state._disabled === true,\n\t\t\t\t\t\terror: hasError === true,\n\t\t\t\t\t\trequired: this.state._required === true,\n\t\t\t\t\t\t'hidden-error': this._hideError === true,\n\t\t\t\t\t\t[this.state._orientation]: true,\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<legend class=\"block w-full mb-1 leading-normal\">\n\t\t\t\t\t\t{/* INFO: span is needed for css styling :after content like a star (*) or optional text ! */}\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t{/* INFO: label comes with any html tag or as plain text! */}\n\t\t\t\t\t\t\t<span slot=\"label\">{hasExpertSlot ? <slot name=\"expert\"></slot> : this._label}</span>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</legend>\n\t\t\t\t\t{this.state._options.map((option, index) => {\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Damit der Value einer Option ein beliebigen Typ haben kann\n\t\t\t\t\t\t * muss man auf HTML-Ebene den Value auf einen String-Wert\n\t\t\t\t\t\t * mappen. Das tun wir mittels der Map.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tconst customId = `${this.state._id}-${index}`;\n\t\t\t\t\t\tconst slotName = `radio-${index}`;\n\t\t\t\t\t\tconst selected = this.state._value === option.value;\n\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<KolInputTag\n\t\t\t\t\t\t\t\tclass={{\n\t\t\t\t\t\t\t\t\tradio: true,\n\t\t\t\t\t\t\t\t\tdisabled: Boolean(this.state._disabled || option.disabled),\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tkey={customId}\n\t\t\t\t\t\t\t\t_disabled={this.state._disabled || option.disabled}\n\t\t\t\t\t\t\t\t_hideLabel={this.state._hideLabel}\n\t\t\t\t\t\t\t\t_hint={option.hint}\n\t\t\t\t\t\t\t\t_id={customId}\n\t\t\t\t\t\t\t\t_label={option.label as string}\n\t\t\t\t\t\t\t\t_renderNoLabel={true}\n\t\t\t\t\t\t\t\t_required={this.state._required}\n\t\t\t\t\t\t\t\t_slotName={slotName}\n\t\t\t\t\t\t\t\t_tooltipAlign={this._tooltipAlign}\n\t\t\t\t\t\t\t\t_touched={this.state._touched}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<div slot={slotName} class=\"radio-input-wrapper\">\n\t\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\t\tref={this.state._value === option.value ? this.catchRef : undefined}\n\t\t\t\t\t\t\t\t\t\ttitle=\"\"\n\t\t\t\t\t\t\t\t\t\taria-label={this.state._hideLabel && typeof option.label === 'string' ? option.label : undefined}\n\t\t\t\t\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\t\t\t\t\tid={customId}\n\t\t\t\t\t\t\t\t\t\tchecked={selected}\n\t\t\t\t\t\t\t\t\t\tname={this.state._name || this.state._id}\n\t\t\t\t\t\t\t\t\t\tdisabled={this.state._disabled || option.disabled}\n\t\t\t\t\t\t\t\t\t\trequired={this.state._required}\n\t\t\t\t\t\t\t\t\t\ttabIndex={this.state._tabIndex}\n\t\t\t\t\t\t\t\t\t\tvalue={`-${index}`}\n\t\t\t\t\t\t\t\t\t\t{...this.controller.onFacade}\n\t\t\t\t\t\t\t\t\t\tonChange={this.onChange}\n\t\t\t\t\t\t\t\t\t\tonClick={undefined} // onClick is not needed since onChange already triggers the correct event\n\t\t\t\t\t\t\t\t\t\tonInput={this.onInput}\n\t\t\t\t\t\t\t\t\t\tonKeyDown={this.onKeyDown.bind(this)}\n\t\t\t\t\t\t\t\t\t\tonFocus={(event) => {\n\t\t\t\t\t\t\t\t\t\t\tthis.controller.onFacade.onFocus(event);\n\t\t\t\t\t\t\t\t\t\t\tthis.inputHasFocus = true;\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\tonBlur={(event) => {\n\t\t\t\t\t\t\t\t\t\t\tthis.controller.onFacade.onBlur(event);\n\t\t\t\t\t\t\t\t\t\t\tthis.inputHasFocus = false;\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t<label\n\t\t\t\t\t\t\t\t\t\tclass=\"radio-label\"\n\t\t\t\t\t\t\t\t\t\thtmlFor={`${customId}`}\n\t\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\t\theight: this.state._hideLabel ? '0' : undefined,\n\t\t\t\t\t\t\t\t\t\t\tmargin: this.state._hideLabel ? '0' : undefined,\n\t\t\t\t\t\t\t\t\t\t\tpadding: this.state._hideLabel ? '0' : undefined,\n\t\t\t\t\t\t\t\t\t\t\tvisibility: this.state._hideLabel ? 'hidden' : undefined,\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"radio-label-span-inner\">{option.label}</span>\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</KolInputTag>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t\t{hasError && <KolFormFieldMsgFc _alert={this.showAsAlert()} _hideError={this.state._hideError} _msg={this.state._msg} _id={this.state._id} />}\n\t\t\t\t\t{hasHint && (\n\t\t\t\t\t\t<span class=\"hint\" id={`${this.state._id}-hint`}>\n\t\t\t\t\t\t\t{this.state._hint}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t)}\n\t\t\t\t</fieldset>\n\t\t\t</Host>\n\t\t);\n\t}\n\n\tprivate readonly controller: InputRadioController;\n\n\t/**\n\t * Defines whether the screen-readers should read out the notification.\n\t * @deprecated Will be removed in v3. Use automatic behaviour instead.\n\t */\n\t@Prop({ mutable: true, reflect: true }) public _alert?: boolean;\n\n\t/**\n\t * Makes the element not focusable and ignore all events.\n\t * @TODO: Change type back to `DisabledPropType` after Stencil#4663 has been resolved.\n\t */\n\t@Prop() public _disabled?: boolean = false;\n\n\t/**\n\t * Defines the error message text.\n\t * @deprecated Will be removed in v3. Use `msg` instead.\n\t */\n\t@Prop() public _error?: string;\n\n\t/**\n\t * Hides the error message but leaves it in the DOM for the input's aria-describedby.\n\t * @TODO: Change type back to `HideErrorPropType` after Stencil#4663 has been resolved.\n\t */\n\t@Prop({ mutable: true, reflect: true }) public _hideError?: boolean = false;\n\n\t/**\n\t * Hides the caption by default and displays the caption text with a tooltip when the\n\t * interactive element is focused or the mouse is over it.\n\t * @TODO: Change type back to `HideLabelPropType` after Stencil#4663 has been resolved.\n\t */\n\t@Prop() public _hideLabel?: boolean = false;\n\n\t/**\n\t * Defines the hint text.\n\t */\n\t@Prop() public _hint?: string = '';\n\n\t/**\n\t * Defines the internal ID of the primary component element.\n\t */\n\t@Prop() public _id?: IdPropType;\n\n\t/**\n\t * Defines the visible or semantic label of the component (e.g. aria-label, label, headline, caption, summary, etc.). Set to `false` to enable the expert slot.\n\t */\n\t@Prop() public _label!: LabelWithExpertSlotPropType;\n\n\t/**\n\t * Defines the properties for a message rendered as Alert component.\n\t */\n\t@Prop() public _msg?: Stringified<MsgPropType>;\n\n\t/**\n\t * Defines the technical name of an input field.\n\t */\n\t@Prop() public _name?: NamePropType;\n\n\t/**\n\t * Gibt die EventCallback-Funktionen für das Input-Event an.\n\t */\n\t@Prop() public _on?: InputTypeOnDefault;\n\n\t/**\n\t * Options the user can choose from.\n\t */\n\t@Prop() public _options?: RadioOptionsPropType;\n\n\t/**\n\t * Defines whether the orientation of the component is horizontal or vertical.\n\t */\n\t@Prop() public _orientation?: Orientation = 'vertical';\n\n\t/**\n\t * Makes the input element required.\n\t * @TODO: Change type back to `RequiredPropType` after Stencil#4663 has been resolved.\n\t */\n\t@Prop() public _required?: boolean = false;\n\n\t/**\n\t * Selector for synchronizing the value with another input element.\n\t * @internal\n\t */\n\t@Prop() public _syncValueBySelector?: SyncValueBySelectorPropType;\n\n\t/**\n\t * Defines which tab-index the primary element of the component has. (https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex)\n\t */\n\t@Prop() public _tabIndex?: number;\n\n\t/**\n\t * Defines where to show the Tooltip preferably: top, right, bottom or left.\n\t */\n\t@Prop() public _tooltipAlign?: TooltipAlignPropType = 'top';\n\n\t/**\n\t * Shows if the input was touched by a user.\n\t * @TODO: Change type back to `TouchedPropType` after Stencil#4663 has been resolved.\n\t */\n\t@Prop({ mutable: true, reflect: true }) public _touched?: boolean = false;\n\n\t/**\n\t * Defines the value of the input.\n\t * @see Known bug: https://github.com/ionic-team/stencil/issues/3902\n\t */\n\t@Prop() public _value?: StencilUnknown;\n\n\t@State() public state: InputRadioStates = {\n\t\t_hideError: false,\n\t\t_id: `id-${nonce()}`,\n\t\t_label: '', // ⚠ required\n\t\t_options: [],\n\t\t_orientation: 'vertical',\n\t};\n\n\t@State() private inputHasFocus = false;\n\n\tpublic constructor() {\n\t\tthis.controller = new InputRadioController(this, 'radio', this.host);\n\t}\n\n\tprivate showAsAlert(): boolean {\n\t\tif (this.state._alert === undefined) {\n\t\t\treturn Boolean(this.state._touched) && !this.inputHasFocus;\n\t\t}\n\t\treturn this.state._alert;\n\t}\n\n\t@Watch('_tooltipAlign')\n\tpublic validateTooltipAlign(value?: TooltipAlignPropType): void {\n\t\tthis.controller.validateTooltipAlign(value);\n\t}\n\t@Watch('_alert')\n\tpublic validateAlert(value?: boolean): void {\n\t\tthis.controller.validateAlert(value);\n\t}\n\n\t@Watch('_disabled')\n\tpublic validateDisabled(value?: boolean): void {\n\t\tthis.controller.validateDisabled(value);\n\t}\n\n\t@Watch('_error')\n\tpublic validateError(value?: string): void {\n\t\tthis.controller.validateError(value);\n\t}\n\n\t@Watch('_hideLabel')\n\tpublic validateHideLabel(value?: boolean): void {\n\t\tthis.controller.validateHideLabel(value);\n\t}\n\n\t@Watch('_hideError')\n\tpublic validateHideError(value?: HideErrorPropType): void {\n\t\tthis.controller.validateHideError(value);\n\t}\n\n\t@Watch('_hint')\n\tpublic validateHint(value?: string): void {\n\t\tthis.controller.validateHint(value);\n\t}\n\n\t@Watch('_id')\n\tpublic validateId(value?: string): void {\n\t\tthis.controller.validateId(value);\n\t}\n\n\t@Watch('_label')\n\tpublic validateLabel(value?: LabelWithExpertSlotPropType): void {\n\t\tthis.controller.validateLabel(value);\n\t}\n\n\t@Watch('_msg')\n\tpublic validateMsg(value?: Stringified<MsgPropType>): void {\n\t\tthis.controller.validateMsg(value);\n\t}\n\n\t@Watch('_name')\n\tpublic validateName(value?: string): void {\n\t\tthis.controller.validateName(value);\n\t}\n\n\t@Watch('_on')\n\tpublic validateOn(value?: InputTypeOnDefault): void {\n\t\tthis.controller.validateOn(value);\n\t}\n\n\t@Watch('_options')\n\tpublic validateOptions(value?: RadioOptionsPropType): void {\n\t\tthis.controller.validateOptions(value);\n\t}\n\n\t@Watch('_orientation')\n\tpublic validateOrientation(value?: Orientation): void {\n\t\tthis.controller.validateOrientation(value);\n\t}\n\n\t@Watch('_required')\n\tpublic validateRequired(value?: boolean): void {\n\t\tthis.controller.validateRequired(value);\n\t}\n\n\t@Watch('_syncValueBySelector')\n\tpublic validateSyncValueBySelector(value?: SyncValueBySelectorPropType): void {\n\t\tthis.controller.validateSyncValueBySelector(value);\n\t}\n\n\t@Watch('_tabIndex')\n\tpublic validateTabIndex(value?: number): void {\n\t\tthis.controller.validateTabIndex(value);\n\t}\n\n\t@Watch('_touched')\n\tpublic validateTouched(value?: boolean): void {\n\t\tthis.controller.validateTouched(value);\n\t}\n\n\t@Watch('_value')\n\tpublic validateValue(value?: Stringified<StencilUnknown>): void {\n\t\tthis.controller.validateValue(value);\n\t}\n\n\tpublic componentWillLoad(): void {\n\t\tthis._touched = this._touched === true;\n\t\tthis.currentValue = this._value;\n\t\tthis.controller.componentWillLoad();\n\t}\n\n\tprivate onInput = (event: Event): void => {\n\t\tif (event.target instanceof HTMLInputElement) {\n\t\t\tconst option = this.controller.getOptionByKey(event.target.value);\n\t\t\tif (option !== undefined) {\n\t\t\t\t// Event handling\n\t\t\t\ttryToDispatchKoliBriEvent('input', this.host, option.value);\n\n\t\t\t\t// Callback\n\t\t\t\tif (typeof this.state._on?.onInput === 'function') {\n\t\t\t\t\tthis.state._on.onInput(event, option.value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\tprivate onChange = (event: Event): void => {\n\t\tif (event.target instanceof HTMLInputElement) {\n\t\t\tconst option = this.controller.getOptionByKey(event.target.value);\n\t\t\tif (option !== undefined) {\n\t\t\t\t// Event handling\n\t\t\t\tstopPropagation(event);\n\t\t\t\ttryToDispatchKoliBriEvent('change', this.host, option.value);\n\n\t\t\t\t// Static form handling\n\t\t\t\tthis.controller.setFormAssociatedValue(option.value);\n\n\t\t\t\t// Callback\n\t\t\t\tif (typeof this.state._on?.onChange === 'function') {\n\t\t\t\t\tthis.state._on.onChange(event, option.value);\n\t\t\t\t}\n\n\t\t\t\tthis.currentValue = option.value;\n\t\t\t}\n\t\t}\n\t};\n\n\tprivate readonly onKeyDown = (event: KeyboardEvent) => {\n\t\tif (event.code === 'Enter' || event.code === 'NumpadEnter') {\n\t\t\tpropagateSubmitEventToForm({\n\t\t\t\tform: this.host,\n\t\t\t\tref: this.inputRef,\n\t\t\t});\n\t\t}\n\t};\n}\n"],"version":3}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * KoliBri - The accessible HTML-Standard
3
3
  */
4
- import{proxyCustomElement,HTMLElement,h,Host,Fragment}from"@stencil/core/internal/client";import{j as watchBoolean,w as watchValidator,m as watchString,D as watchNumber,J as buildBadgeTextString,C as showExpertSlot}from"./index2.js";import{c as clsx}from"./clsx.js";import{k as KolInputTag,e as KolIconTag}from"./component-names.js";import{t as translate}from"./i18n2.js";import{n as nonce}from"./dev.utils.js";import{t as tryToDispatchKoliBriEvent}from"./events.js";import{g as getRenderStates}from"./controller2.js";import{I as InternalUnderlinedBadgeText}from"./InternalUnderlinedBadgeText.js";import{I as InputIconController}from"./controller-icon.js";import{f as fillKeyOptionMap,b as validateOptions}from"./controller3.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 }\n .kol-tooltip-wc .tooltip-floating {\n opacity: 0;\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, unset);\n max-width: 90vw;\n max-height: 90vh;\n animation-direction: normal;\n /* Can be used to specify the animation duration from the outside. 250ms by default. */\n animation-duration: var(--kolibri-tooltip-animation-duration, 250ms);\n animation-fill-mode: forwards;\n animation-iteration-count: 1;\n animation-timing-function: ease-in;\n }\n .kol-tooltip-wc .tooltip-floating.hide {\n animation-name: hideTooltip;\n }\n .kol-tooltip-wc .tooltip-floating.show {\n animation-name: showTooltip;\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 hideTooltip {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n display: none;\n }\n }\n @keyframes showTooltip {\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$1=proxyCustomElement(class extends HTMLElement{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;if(e.value===this._value)return this._inputValue=e.label,void(this._filteredOptions=[...this.state._options]);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:"3fafd0245696a55c24c2783611fdbc67b08355dd",class:"kol-single-select"},h("div",{key:"a4f45b56bb95b417647a03bbd0d2d78e6ac90585",class:`single-select ${!0===this.state._disabled?"disabled":""} `},h(KolInputTag,{key:"d81bafafd3e6178d610d7b301a9ce6c902db3aca",_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:"9f186f984ed1639208247b7ba021951fb5e5e20d",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:"4d353782d00e20753ad311db6e9fd9a62183bcdd",slot:"input"},h("div",{key:"f8700bc080d3511d043b0216a9b5812fb4bc3dc4",class:"single-select__group"},h("input",Object.assign({key:"30c418d9304fe36c1ca1bb702264ed5546f2889e",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-keyshortcuts":this.state._shortKey,"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:"dc652b81cf633ea7067d47269a7f3fb7432b3e2f",_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:"07ecf92ce00cfcba08d295108a486353cad021b3",tabindex:"-1",class:"single-select__button",onClick:this.toggleListbox.bind(this),disabled:this.state._disabled},h(KolIconTag,{key:"249a8b5ea3face2f71f5379df830e0d17cb31c57",_icons:"codicon codicon-triangle-down",_label:translate("kol-dropdown")}))),this._isOpen&&!(!0===this.state._disabled)&&h("ul",{key:"7cc61149ec5255e37ae35fd5370db6dd93d28964",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(){super(),this.__registerHost(),this.__attachShadow(),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 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"]}}static get style(){return{default:KolSingleSelectDefaultStyle0}}},[49,"kol-single-select",{_accessKey:[1,"_access-key"],_placeholder:[1],_alert:[1540],_disabled:[4],_hideError:[1540,"_hide-error"],_hideLabel:[4,"_hide-label"],_hint:[1],_icons:[1],_id:[1],_label:[1],_msg:[1],_name:[1],_on:[16],_options:[1],_required:[4],_shortKey:[1,"_short-key"],_syncValueBySelector:[1,"_sync-value-by-selector"],_tabIndex:[2,"_tab-index"],_tooltipAlign:[1,"_tooltip-align"],_touched:[1540],_value:[1544],_hideClearButton:[4,"_hide-clear-button"],_rows:[2],_isOpen:[32],_hasOpened:[32],_filteredOptions:[32],_inputValue:[32],blockSuggestionMouseOver:[32],state:[32],inputHasFocus:[32],getValue:[64],kolFocus:[64]},[[8,"focusout","handleFocusOut"],[8,"blur","handleWindowBlur"],[0,"keydown","handleKeyDown"],[1,"mousemove","handleMouseEvent"]],{_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"]}]);function defineCustomElement$1(){if("undefined"==typeof customElements)return;["kol-single-select"].forEach(e=>{if("kol-single-select"===e)customElements.get(e)||customElements.define(e,KolSingleSelect$1)})}const KolSingleSelect=KolSingleSelect$1,defineCustomElement=defineCustomElement$1;export{KolSingleSelect,defineCustomElement};
4
+ import{proxyCustomElement,HTMLElement,h,Host,Fragment}from"@stencil/core/internal/client";import{j as watchBoolean,w as watchValidator,m as watchString,D as watchNumber,J as buildBadgeTextString,C as showExpertSlot}from"./index2.js";import{c as clsx}from"./clsx.js";import{k as KolInputTag,e as KolIconTag}from"./component-names.js";import{t as translate}from"./i18n2.js";import{n as nonce}from"./dev.utils.js";import{t as tryToDispatchKoliBriEvent}from"./events.js";import{g as getRenderStates}from"./controller2.js";import{I as InternalUnderlinedBadgeText}from"./InternalUnderlinedBadgeText.js";import{I as InputIconController}from"./controller-icon.js";import{f as fillKeyOptionMap,b as validateOptions}from"./controller3.js";class SingleSelectController extends InputIconController{constructor(e,t,i){super(e,t,i),this.keyOptionMap=new Map,this.afterPatchOptions=(e,t,i,n)=>{"_value"===n&&this.setFormAssociatedValue(e)},this.beforePatchOptions=(e,t)=>{const i=t.has("_options")?t.get("_options"):this.component.state._options;Array.isArray(i)&&i.length>0&&(this.keyOptionMap.clear(),fillKeyOptionMap(this.keyOptionMap,i))},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 }\n .kol-tooltip-wc .tooltip-floating {\n opacity: 0;\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, unset);\n max-width: 90vw;\n max-height: 90vh;\n animation-direction: normal;\n /* Can be used to specify the animation duration from the outside. 250ms by default. */\n animation-duration: var(--kolibri-tooltip-animation-duration, 250ms);\n animation-fill-mode: forwards;\n animation-iteration-count: 1;\n animation-timing-function: ease-in;\n }\n .kol-tooltip-wc .tooltip-floating.hide {\n animation-name: hideTooltip;\n }\n .kol-tooltip-wc .tooltip-floating.show {\n animation-name: showTooltip;\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 hideTooltip {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n display: none;\n }\n }\n @keyframes showTooltip {\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:not(.single-select__item--disabled).highlighted {\n background-color: #f0f0f0;\n }\n .single-select__listbox--cursor-hidden .single-select__item {\n cursor: none !important;\n }\n .single-select__item--disabled:focus, .single-select__item--disabled:focus * {\n cursor: not-allowed;\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$1=proxyCustomElement(class extends HTMLElement{async getValue(){return this._value}async kolFocus(){var e;null===(e=this.refInput)||void 0===e||e.focus()}onBlur(){var e,t,i;const n=null===(e=this.state._options)||void 0===e?void 0:e.find(e=>{var t,i;return(null===(t=e.label)||void 0===t?void 0:t.toLowerCase())===(null===(i=this._inputValue)||void 0===i?void 0:i.toLowerCase())});n?this.selectOption(n):(this._inputValue=null===(i=null===(t=this.state._options)||void 0===t?void 0:t.find(e=>e.value===this._value))||void 0===i?void 0:i.label,this._filteredOptions=[...this.state._options]),this._isOpen=!1,this._hasOpened=!1}createEventWithTarget(e,t){const i=new CustomEvent(e,{bubbles:!0,detail:t});return this.refInput&&(Object.defineProperty(i,"target",{value:this.refInput}),Object.defineProperty(i,"currentTarget",{value:this.refInput})),i}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}),i=this.createEventWithTarget("change",{name:this.state._name,value:e});this.controller.onFacade.onInput(t,!0,{value:e}),this.controller.onFacade.onChange(i,{value:e})}}selectOption(e){var t,i;if(e.value===this._value)return this._inputValue=e.label,void(this._filteredOptions=[...this.state._options]);this._value=e.value,this._inputValue=e.label;const n=this.createEventWithTarget("input",{name:null!==(t=this.state._name)&&void 0!==t?t:"",value:e.value}),o=this.createEventWithTarget("change",{name:null!==(i=this.state._name)&&void 0!==i?i:"",value:e.value});this.controller.onFacade.onInput(n,!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 i,n;return null===(n=null===(i=t.label)||void 0===i?void 0:i.toLowerCase())||void 0===n?void 0:n.includes(null==e?void 0:e.toLowerCase())}))}moveFocus(e){if(!this._filteredOptions)return;let t=this._focusedOptionIndex+e,i=0,n=!1;const o=this._filteredOptions.length;for(;i<o;){t>=this._filteredOptions.length&&(t=0),t<0&&(t=this._filteredOptions.length-1);if(!this._filteredOptions[t].disabled){n=!0;break}t+=e,i++}n&&(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(),i=Array.isArray(this._filteredOptions)&&this._filteredOptions.findIndex(e=>e.label.toLowerCase().startsWith(t)&&!e.disabled);"number"==typeof i&&i>=0&&(this._focusedOptionIndex=i,this.focusOption(i))}render(){var e;const t=showExpertSlot(this.state._label),{ariaDescribedBy:i}=getRenderStates(this.state);return h(Host,{key:"eb08407aee51dbd63e5f60f502ce1ae55fda755c",class:"kol-single-select"},h("div",{key:"2a3df79dbea8777b23db99e9a6e59ad209b9eb4d",class:`single-select ${!0===this.state._disabled?"disabled":""} `},h(KolInputTag,{key:"0a05e6a16d4f41ca518a0b02fa395c9589aeeb91",_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:"00fb8faa11342f56a731e8cbe6fa9b627469dda0",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:"fc68fcaa0d244d36617b866d33431e114914efd0",slot:"input"},h("div",{key:"a6bd25b065ba04658a752abd9ce0fe2892eb8ebd",class:"single-select__group"},h("input",Object.assign({key:"6d6c3deeabc4f28c802d477e988f05149992b891",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-keyshortcuts":this.state._shortKey,"aria-describedby":i.length>0?i.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:"7c9cb0d5de633700ac46b5e1116c5c5255cfb220",_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:"b3406ac5995db4c2e1600ee378b9020bfb8f0b0a",tabindex:"-1",class:"single-select__button",onClick:this.toggleListbox.bind(this),disabled:this.state._disabled},h(KolIconTag,{key:"979b6ab3a87ecc47225aeab0412ab297a83884cf",_icons:"codicon codicon-triangle-down",_label:translate("kol-dropdown")}))),this._isOpen&&!(!0===this.state._disabled)&&h("ul",{key:"127bbec729c3a33349afa88435aa41dc4f070dae",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)=>{var i;return 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,"aria-disabled":e.disabled?"true":void 0,onClick:t=>{var i;e.disabled||(this.selectOption(e),null===(i=this.refInput)||void 0===i||i.focus(),this.toggleListbox(t),this._isOpen=!1,this._hasOpened=!1)},onMouseOver:()=>{this.blockSuggestionMouseOver||(this._focusedOptionIndex=t,this.focusOption(t))},onFocus:()=>{e.disabled||(this._focusedOptionIndex=t,this.focusOption(t))},class:clsx("single-select__item",{"single-select__item--disabled":e.disabled}),onKeyDown:t=>{var i;e.disabled||"Enter"!==t.key&&"NumpadEnter"!==t.key||(this.selectOption(e),null===(i=this.refInput)||void 0===i||i.focus(),this.toggleListbox(t),t.preventDefault())}},h("input",{class:"visually-hidden",type:"radio",disabled:null!==(i=e.disabled)&&void 0!==i?i:void 0,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,i;const n=(t,i)=>{var n;e.preventDefault(),void 0!==t&&(this._isOpen=t,t||null===(n=this.refInput)||void 0===n||n.focus()),null==i||i()};switch(e.key){case"Down":case"ArrowDown":this.blockSuggestionMouseOver=!0,n(!0,()=>this.moveFocus(1));break;case"Up":case"ArrowUp":this.blockSuggestionMouseOver=!0,n(!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,n(!1);break;case" ":this._isOpen?Array.isArray(this._filteredOptions)&&this._filteredOptions.length>0&&(this.selectOption(this._filteredOptions[this._focusedOptionIndex]),null===(i=this.refInput)||void 0===i||i.focus(),n(!1)):this.toggleListbox(e);break;case"NumpadEnter":case"Enter":this.toggleListbox(e),this._hasOpened=!1,this._isOpen=!1;break;case"Home":this.blockSuggestionMouseOver=!0,n(void 0,()=>{this._isOpen&&(this._focusedOptionIndex=0,this.focusOption(this._focusedOptionIndex))});break;case"End":this.blockSuggestionMouseOver=!0,n(void 0,()=>{this._isOpen&&(this._focusedOptionIndex=this._filteredOptions?this._filteredOptions.length-1:0,this.focusOption(this._focusedOptionIndex))});break;case"PageUp":this.blockSuggestionMouseOver=!0,n(void 0,()=>this._isOpen&&this.moveFocus(-10));break;case"PageDown":this.blockSuggestionMouseOver=!0,n(void 0,()=>this._isOpen&&this.moveFocus(10))}}constructor(){super(),this.__registerHost(),this.__attachShadow(),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,i=this.refOptions[e];null==i||i.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,i,n,o;this.oldValue!==(null===(t=this.refInput)||void 0===t?void 0:t.value)&&(this.oldValue=null===(i=this.refInput)||void 0===i?void 0:i.value),tryToDispatchKoliBriEvent("change",this.host,this._value),"function"!=typeof(null===(n=this.state._on)||void 0===n?void 0:n.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 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"]}}static get style(){return{default:KolSingleSelectDefaultStyle0}}},[49,"kol-single-select",{_accessKey:[1,"_access-key"],_placeholder:[1],_alert:[1540],_disabled:[4],_hideError:[1540,"_hide-error"],_hideLabel:[4,"_hide-label"],_hint:[1],_icons:[1],_id:[1],_label:[1],_msg:[1],_name:[1],_on:[16],_options:[1],_required:[4],_shortKey:[1,"_short-key"],_syncValueBySelector:[1,"_sync-value-by-selector"],_tabIndex:[2,"_tab-index"],_tooltipAlign:[1,"_tooltip-align"],_touched:[1540],_value:[1544],_hideClearButton:[4,"_hide-clear-button"],_rows:[2],_isOpen:[32],_hasOpened:[32],_filteredOptions:[32],_inputValue:[32],blockSuggestionMouseOver:[32],state:[32],inputHasFocus:[32],getValue:[64],kolFocus:[64]},[[8,"focusout","handleFocusOut"],[8,"blur","handleWindowBlur"],[0,"keydown","handleKeyDown"],[1,"mousemove","handleMouseEvent"]],{_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"]}]);function defineCustomElement$1(){if("undefined"==typeof customElements)return;["kol-single-select"].forEach(e=>{if("kol-single-select"===e)customElements.get(e)||customElements.define(e,KolSingleSelect$1)})}const KolSingleSelect=KolSingleSelect$1,defineCustomElement=defineCustomElement$1;export{KolSingleSelect,defineCustomElement};