@public-ui/components 1.5.1 → 1.5.2-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (445) hide show
  1. package/assets/codicons/codicon.css +12 -1
  2. package/assets/codicons/codicon.csv +7 -2
  3. package/assets/codicons/codicon.html +53 -13
  4. package/assets/codicons/codicon.svg +1 -1
  5. package/assets/codicons/codicon.ttf +0 -0
  6. package/cheat-sheet.html +12 -12
  7. package/custom-elements.json +8 -1
  8. package/dist/cjs/{a11y.tipps-6f0ad06e.js → a11y.tipps-251f022e.js} +1 -1
  9. package/dist/cjs/a11y.tipps-251f022e.js.map +1 -0
  10. package/dist/cjs/{app-globals-a5083cd8.js → app-globals-deb2d36b.js} +1 -1
  11. package/dist/cjs/{app-globals-a5083cd8.js.map → app-globals-deb2d36b.js.map} +1 -1
  12. package/dist/cjs/{aria-selected-3d69f172.js → aria-selected-75bbe016.js} +1 -1
  13. package/dist/cjs/{aria-selected-3d69f172.js.map → aria-selected-75bbe016.js.map} +1 -1
  14. package/dist/cjs/{button-link-78099d0b.js → button-link-7da2652e.js} +1 -1
  15. package/dist/cjs/{button-link-78099d0b.js.map → button-link-7da2652e.js.map} +1 -1
  16. package/dist/cjs/{color-d9a0e2e9.js → color-93a094ef.js} +1 -1
  17. package/dist/cjs/{color-d9a0e2e9.js.map → color-93a094ef.js.map} +1 -1
  18. package/dist/cjs/{controller-4c51f1d0.js → controller-361ba1ef.js} +1 -1
  19. package/dist/cjs/{controller-4c51f1d0.js.map → controller-361ba1ef.js.map} +1 -1
  20. package/dist/cjs/{controller-0dc3063e.js → controller-3bf4af0a.js} +1 -1
  21. package/dist/cjs/{controller-0dc3063e.js.map → controller-3bf4af0a.js.map} +1 -1
  22. package/dist/cjs/{controller-47ec1d99.js → controller-90049b82.js} +1 -1
  23. package/dist/cjs/{controller-47ec1d99.js.map → controller-90049b82.js.map} +1 -1
  24. package/dist/cjs/{controller-974e72cd.js → controller-9e5e2756.js} +1 -1
  25. package/dist/cjs/{controller-974e72cd.js.map → controller-9e5e2756.js.map} +1 -1
  26. package/dist/cjs/{controller-f5d21db5.js → controller-c828f7c8.js} +1 -1
  27. package/dist/cjs/{controller-f5d21db5.js.map → controller-c828f7c8.js.map} +1 -1
  28. package/dist/cjs/{controller-1a0e56e5.js → controller-dc5aca49.js} +1 -1
  29. package/dist/cjs/{controller-1a0e56e5.js.map → controller-dc5aca49.js.map} +1 -1
  30. package/dist/cjs/{controller-icon-8a67d498.js → controller-icon-6ed19132.js} +1 -1
  31. package/dist/cjs/{controller-icon-8a67d498.js.map → controller-icon-6ed19132.js.map} +1 -1
  32. package/dist/cjs/{devtools-a1501143.js → devtools-aae8bdf5.js} +1 -1
  33. package/dist/cjs/{devtools-a1501143.js.map → devtools-aae8bdf5.js.map} +1 -1
  34. package/dist/cjs/{disabled-0893d275.js → disabled-849b796c.js} +1 -1
  35. package/dist/cjs/{disabled-0893d275.js.map → disabled-849b796c.js.map} +1 -1
  36. package/dist/cjs/hide-label-3c04c118.js +4 -0
  37. package/dist/cjs/{hide-label-142676e3.js.map → hide-label-3c04c118.js.map} +1 -1
  38. package/dist/cjs/{i18n-c5c6847b.js → i18n-bd375706.js} +1 -1
  39. package/dist/cjs/{i18n-c5c6847b.js.map → i18n-bd375706.js.map} +1 -1
  40. package/dist/cjs/{icon-d0c5f305.js → icon-c6dc105e.js} +1 -1
  41. package/dist/cjs/{icon-d0c5f305.js.map → icon-c6dc105e.js.map} +1 -1
  42. package/dist/cjs/index-29c5d3c6.js +5 -0
  43. package/dist/cjs/index-29c5d3c6.js.map +1 -0
  44. package/dist/cjs/{index-9c91e91b.js → index-2e0791f2.js} +1 -1
  45. package/dist/cjs/{index-9c91e91b.js.map → index-2e0791f2.js.map} +1 -1
  46. package/dist/cjs/index.cjs.js +1 -1
  47. package/dist/cjs/kol-abbr.cjs.entry.js +1 -1
  48. package/dist/cjs/kol-accordion.cjs.entry.js +1 -1
  49. package/dist/cjs/kol-alert-wc_2.cjs.entry.js +1 -1
  50. package/dist/cjs/kol-alert.cjs.entry.js +1 -1
  51. package/dist/cjs/kol-badge.cjs.entry.js +1 -1
  52. package/dist/cjs/kol-breadcrumb.cjs.entry.js +1 -1
  53. package/dist/cjs/kol-button-group-wc.cjs.entry.js +1 -1
  54. package/dist/cjs/kol-button-group.cjs.entry.js +1 -1
  55. package/dist/cjs/kol-button-link.cjs.entry.js +1 -1
  56. package/dist/cjs/kol-button-wc_3.cjs.entry.js +1 -1
  57. package/dist/cjs/kol-button-wc_3.cjs.entry.js.map +1 -1
  58. package/dist/cjs/kol-button.cjs.entry.js +1 -1
  59. package/dist/cjs/kol-card.cjs.entry.js +1 -1
  60. package/dist/cjs/kol-details.cjs.entry.js +1 -1
  61. package/dist/cjs/kol-form.cjs.entry.js +1 -1
  62. package/dist/cjs/kol-heading.cjs.entry.js +1 -1
  63. package/dist/cjs/kol-icon-font-awesome.cjs.entry.js +1 -1
  64. package/dist/cjs/kol-icon-icofont.cjs.entry.js +1 -1
  65. package/dist/cjs/kol-icon.cjs.entry.js +1 -1
  66. package/dist/cjs/kol-image.cjs.entry.js +1 -1
  67. package/dist/cjs/kol-indented-text.cjs.entry.js +1 -1
  68. package/dist/cjs/kol-input-adapter-leanup.cjs.entry.js +1 -1
  69. package/dist/cjs/kol-input-checkbox.cjs.entry.js +1 -1
  70. package/dist/cjs/kol-input-color.cjs.entry.js +1 -1
  71. package/dist/cjs/kol-input-date.cjs.entry.js +1 -1
  72. package/dist/cjs/kol-input-email.cjs.entry.js +1 -1
  73. package/dist/cjs/kol-input-file.cjs.entry.js +1 -1
  74. package/dist/cjs/kol-input-number.cjs.entry.js +1 -1
  75. package/dist/cjs/kol-input-password.cjs.entry.js +1 -1
  76. package/dist/cjs/kol-input-radio-group.cjs.entry.js +1 -1
  77. package/dist/cjs/kol-input-radio.cjs.entry.js +1 -1
  78. package/dist/cjs/kol-input-range.cjs.entry.js +1 -1
  79. package/dist/cjs/kol-input-text.cjs.entry.js +1 -1
  80. package/dist/cjs/kol-kolibri.cjs.entry.js +1 -1
  81. package/dist/cjs/kol-link-button.cjs.entry.js +1 -1
  82. package/dist/cjs/kol-link-group.cjs.entry.js +1 -1
  83. package/dist/cjs/kol-link-wc.cjs.entry.js +1 -1
  84. package/dist/cjs/kol-link.cjs.entry.js +1 -1
  85. package/dist/cjs/kol-logo.cjs.entry.js +1 -1
  86. package/dist/cjs/kol-modal.cjs.entry.js +1 -1
  87. package/dist/cjs/kol-nav.cjs.entry.js +1 -1
  88. package/dist/cjs/kol-nav.cjs.entry.js.map +1 -1
  89. package/dist/cjs/kol-pagination.cjs.entry.js +1 -1
  90. package/dist/cjs/kol-popover.cjs.entry.js +1 -1
  91. package/dist/cjs/kol-progress.cjs.entry.js +1 -1
  92. package/dist/cjs/kol-progress.cjs.entry.js.map +1 -1
  93. package/dist/cjs/kol-quote.cjs.entry.js +1 -1
  94. package/dist/cjs/kol-select.cjs.entry.js +1 -1
  95. package/dist/cjs/kol-skip-nav.cjs.entry.js +1 -1
  96. package/dist/cjs/kol-span.cjs.entry.js +1 -1
  97. package/dist/cjs/kol-spin.cjs.entry.js +1 -1
  98. package/dist/cjs/kol-spin.cjs.entry.js.map +1 -1
  99. package/dist/cjs/kol-split-button.cjs.entry.js +1 -1
  100. package/dist/cjs/kol-symbol.cjs.entry.js +1 -1
  101. package/dist/cjs/kol-table.cjs.entry.js +1 -1
  102. package/dist/cjs/kol-tabs.cjs.entry.js +1 -1
  103. package/dist/cjs/kol-textarea.cjs.entry.js +1 -1
  104. package/dist/cjs/kol-toast.cjs.entry.js +1 -1
  105. package/dist/cjs/kol-tooltip.cjs.entry.js +1 -1
  106. package/dist/cjs/kol-version.cjs.entry.js +1 -1
  107. package/dist/cjs/kolibri.cjs.js +1 -1
  108. package/dist/cjs/kolibri.cjs.js.map +1 -1
  109. package/dist/cjs/label-f7bafefb.js +4 -0
  110. package/dist/cjs/label-f7bafefb.js.map +1 -0
  111. package/dist/cjs/loader.cjs.js +1 -1
  112. package/dist/cjs/loader.cjs.js.map +1 -1
  113. package/dist/cjs/{prop.validators-d6eed32b.js → prop.validators-0e600d26.js} +1 -1
  114. package/dist/cjs/{prop.validators-d6eed32b.js.map → prop.validators-0e600d26.js.map} +1 -1
  115. package/dist/cjs/show-f13f46c8.js +4 -0
  116. package/dist/cjs/{show-6e36cda5.js.map → show-f13f46c8.js.map} +1 -1
  117. package/dist/cjs/{tab-index-9fcb9e3f.js → tab-index-d4f662c6.js} +1 -1
  118. package/dist/cjs/{tab-index-9fcb9e3f.js.map → tab-index-d4f662c6.js.map} +1 -1
  119. package/dist/cjs/{validation-423d5cd3.js → validation-067abd6e.js} +1 -1
  120. package/dist/cjs/{validation-423d5cd3.js.map → validation-067abd6e.js.map} +1 -1
  121. package/dist/cjs/validation-2b48ad79.js +4 -0
  122. package/dist/cjs/{validation-5c91bbc8.js.map → validation-2b48ad79.js.map} +1 -1
  123. package/dist/components/color.js +1 -1
  124. package/dist/components/component12.js +1 -1
  125. package/dist/components/component13.js +1 -1
  126. package/dist/components/component14.js +1 -1
  127. package/dist/components/component15.js +1 -1
  128. package/dist/components/component3.js +1 -1
  129. package/dist/components/component3.js.map +1 -1
  130. package/dist/components/component5.js +1 -1
  131. package/dist/components/component8.js +1 -1
  132. package/dist/components/controller.js +1 -1
  133. package/dist/components/controller2.js +1 -1
  134. package/dist/components/controller3.js +1 -1
  135. package/dist/components/controller4.js +1 -1
  136. package/dist/components/devtools.js +1 -1
  137. package/dist/components/i18n.js +1 -1
  138. package/dist/components/i18n.js.map +1 -1
  139. package/dist/components/kol-breadcrumb.js +1 -1
  140. package/dist/components/kol-button-link.js +1 -1
  141. package/dist/components/kol-input-adapter-leanup.js +1 -1
  142. package/dist/components/kol-input-checkbox.js +1 -1
  143. package/dist/components/kol-input-color.js +1 -1
  144. package/dist/components/kol-input-date.js +1 -1
  145. package/dist/components/kol-input-date.js.map +1 -1
  146. package/dist/components/kol-input-email.js +1 -1
  147. package/dist/components/kol-input-file.js +1 -1
  148. package/dist/components/kol-input-password.js +1 -1
  149. package/dist/components/kol-input-radio-group.js +1 -1
  150. package/dist/components/kol-input-range.js +1 -1
  151. package/dist/components/kol-input-text.js +1 -1
  152. package/dist/components/kol-link-button.js +1 -1
  153. package/dist/components/kol-link-group.js +1 -1
  154. package/dist/components/kol-modal.js +1 -1
  155. package/dist/components/kol-nav.js +1 -1
  156. package/dist/components/kol-nav.js.map +1 -1
  157. package/dist/components/kol-progress.js +1 -1
  158. package/dist/components/kol-progress.js.map +1 -1
  159. package/dist/components/kol-skip-nav.js +1 -1
  160. package/dist/components/kol-spin.js +1 -1
  161. package/dist/components/kol-spin.js.map +1 -1
  162. package/dist/components/kol-split-button.js +1 -1
  163. package/dist/components/kol-table.js +1 -1
  164. package/dist/components/kol-tabs.js +1 -1
  165. package/dist/components/kol-textarea.js +1 -1
  166. package/dist/components/kol-toast.js +1 -1
  167. package/dist/components/prop.validators.js +1 -1
  168. package/dist/components/prop.validators.js.map +1 -1
  169. package/dist/components/shadow2.js +1 -1
  170. package/dist/components/shadow3.js +1 -1
  171. package/dist/components/tab-index.js +1 -1
  172. package/dist/components/validation.js +1 -1
  173. package/dist/esm/{a11y.tipps-1cea9822.js → a11y.tipps-2e27f8e6.js} +1 -1
  174. package/dist/esm/a11y.tipps-2e27f8e6.js.map +1 -0
  175. package/dist/esm/app-globals-1e2df332.js +4 -0
  176. package/dist/esm/{app-globals-6ba5ef2f.js.map → app-globals-1e2df332.js.map} +1 -1
  177. package/dist/esm/{aria-selected-aaf31182.js → aria-selected-0f45e2c3.js} +1 -1
  178. package/dist/esm/{aria-selected-aaf31182.js.map → aria-selected-0f45e2c3.js.map} +1 -1
  179. package/dist/esm/{button-link-4a7e6a2e.js → button-link-abc9999d.js} +1 -1
  180. package/dist/esm/{button-link-4a7e6a2e.js.map → button-link-abc9999d.js.map} +1 -1
  181. package/dist/esm/{color-00a19ef0.js → color-2a715559.js} +1 -1
  182. package/dist/esm/{color-00a19ef0.js.map → color-2a715559.js.map} +1 -1
  183. package/dist/esm/{controller-830cac3b.js → controller-3ae042db.js} +1 -1
  184. package/dist/esm/{controller-830cac3b.js.map → controller-3ae042db.js.map} +1 -1
  185. package/dist/esm/{controller-3e94c3f2.js → controller-6f59f733.js} +1 -1
  186. package/dist/esm/{controller-3e94c3f2.js.map → controller-6f59f733.js.map} +1 -1
  187. package/dist/esm/{controller-1ec68c46.js → controller-9b769c83.js} +1 -1
  188. package/dist/esm/{controller-1ec68c46.js.map → controller-9b769c83.js.map} +1 -1
  189. package/dist/esm/{controller-0cf6cd75.js → controller-abdc8667.js} +1 -1
  190. package/dist/esm/{controller-0cf6cd75.js.map → controller-abdc8667.js.map} +1 -1
  191. package/dist/esm/{controller-985aff52.js → controller-c92d85d6.js} +1 -1
  192. package/dist/esm/{controller-985aff52.js.map → controller-c92d85d6.js.map} +1 -1
  193. package/dist/esm/{controller-53ddde7c.js → controller-ca91917c.js} +1 -1
  194. package/dist/esm/{controller-53ddde7c.js.map → controller-ca91917c.js.map} +1 -1
  195. package/dist/esm/{controller-icon-26c0e34a.js → controller-icon-8d8c747a.js} +1 -1
  196. package/dist/esm/{controller-icon-26c0e34a.js.map → controller-icon-8d8c747a.js.map} +1 -1
  197. package/dist/esm/{devtools-33f1b614.js → devtools-fc4614e6.js} +1 -1
  198. package/dist/esm/{devtools-33f1b614.js.map → devtools-fc4614e6.js.map} +1 -1
  199. package/dist/esm/{disabled-9bd11a04.js → disabled-7ea66fab.js} +1 -1
  200. package/dist/esm/{disabled-9bd11a04.js.map → disabled-7ea66fab.js.map} +1 -1
  201. package/dist/esm/{hide-label-5d7003be.js → hide-label-1fa80b94.js} +1 -1
  202. package/dist/esm/{hide-label-5d7003be.js.map → hide-label-1fa80b94.js.map} +1 -1
  203. package/dist/esm/{i18n-81ce19c0.js → i18n-b8589f01.js} +1 -1
  204. package/dist/esm/{i18n-81ce19c0.js.map → i18n-b8589f01.js.map} +1 -1
  205. package/dist/esm/{icon-dfcf642a.js → icon-52e86ff8.js} +1 -1
  206. package/dist/esm/{icon-dfcf642a.js.map → icon-52e86ff8.js.map} +1 -1
  207. package/dist/esm/{index-133da8ac.js → index-0962b5a1.js} +1 -1
  208. package/dist/esm/{index-133da8ac.js.map → index-0962b5a1.js.map} +1 -1
  209. package/dist/esm/index-50adf9a0.js +5 -0
  210. package/dist/esm/index-50adf9a0.js.map +1 -0
  211. package/dist/esm/index.js +1 -1
  212. package/dist/esm/kol-abbr.entry.js +1 -1
  213. package/dist/esm/kol-accordion.entry.js +1 -1
  214. package/dist/esm/kol-alert-wc_2.entry.js +1 -1
  215. package/dist/esm/kol-alert.entry.js +1 -1
  216. package/dist/esm/kol-badge.entry.js +1 -1
  217. package/dist/esm/kol-breadcrumb.entry.js +1 -1
  218. package/dist/esm/kol-button-group-wc.entry.js +1 -1
  219. package/dist/esm/kol-button-group.entry.js +1 -1
  220. package/dist/esm/kol-button-link.entry.js +1 -1
  221. package/dist/esm/kol-button-wc_3.entry.js +1 -1
  222. package/dist/esm/kol-button-wc_3.entry.js.map +1 -1
  223. package/dist/esm/kol-button.entry.js +1 -1
  224. package/dist/esm/kol-card.entry.js +1 -1
  225. package/dist/esm/kol-details.entry.js +1 -1
  226. package/dist/esm/kol-form.entry.js +1 -1
  227. package/dist/esm/kol-heading.entry.js +1 -1
  228. package/dist/esm/kol-icon-font-awesome.entry.js +1 -1
  229. package/dist/esm/kol-icon-icofont.entry.js +1 -1
  230. package/dist/esm/kol-icon.entry.js +1 -1
  231. package/dist/esm/kol-image.entry.js +1 -1
  232. package/dist/esm/kol-indented-text.entry.js +1 -1
  233. package/dist/esm/kol-input-adapter-leanup.entry.js +1 -1
  234. package/dist/esm/kol-input-checkbox.entry.js +1 -1
  235. package/dist/esm/kol-input-color.entry.js +1 -1
  236. package/dist/esm/kol-input-date.entry.js +1 -1
  237. package/dist/esm/kol-input-email.entry.js +1 -1
  238. package/dist/esm/kol-input-file.entry.js +1 -1
  239. package/dist/esm/kol-input-number.entry.js +1 -1
  240. package/dist/esm/kol-input-password.entry.js +1 -1
  241. package/dist/esm/kol-input-radio-group.entry.js +1 -1
  242. package/dist/esm/kol-input-radio.entry.js +1 -1
  243. package/dist/esm/kol-input-range.entry.js +1 -1
  244. package/dist/esm/kol-input-text.entry.js +1 -1
  245. package/dist/esm/kol-kolibri.entry.js +1 -1
  246. package/dist/esm/kol-link-button.entry.js +1 -1
  247. package/dist/esm/kol-link-group.entry.js +1 -1
  248. package/dist/esm/kol-link-wc.entry.js +1 -1
  249. package/dist/esm/kol-link.entry.js +1 -1
  250. package/dist/esm/kol-logo.entry.js +1 -1
  251. package/dist/esm/kol-modal.entry.js +1 -1
  252. package/dist/esm/kol-nav.entry.js +1 -1
  253. package/dist/esm/kol-nav.entry.js.map +1 -1
  254. package/dist/esm/kol-pagination.entry.js +1 -1
  255. package/dist/esm/kol-popover.entry.js +1 -1
  256. package/dist/esm/kol-progress.entry.js +1 -1
  257. package/dist/esm/kol-progress.entry.js.map +1 -1
  258. package/dist/esm/kol-quote.entry.js +1 -1
  259. package/dist/esm/kol-select.entry.js +1 -1
  260. package/dist/esm/kol-skip-nav.entry.js +1 -1
  261. package/dist/esm/kol-span.entry.js +1 -1
  262. package/dist/esm/kol-spin.entry.js +1 -1
  263. package/dist/esm/kol-spin.entry.js.map +1 -1
  264. package/dist/esm/kol-split-button.entry.js +1 -1
  265. package/dist/esm/kol-symbol.entry.js +1 -1
  266. package/dist/esm/kol-table.entry.js +1 -1
  267. package/dist/esm/kol-tabs.entry.js +1 -1
  268. package/dist/esm/kol-textarea.entry.js +1 -1
  269. package/dist/esm/kol-toast.entry.js +1 -1
  270. package/dist/esm/kol-tooltip.entry.js +1 -1
  271. package/dist/esm/kol-version.entry.js +1 -1
  272. package/dist/esm/kolibri.js +1 -1
  273. package/dist/esm/kolibri.js.map +1 -1
  274. package/dist/esm/label-58f2333f.js +4 -0
  275. package/dist/esm/label-58f2333f.js.map +1 -0
  276. package/dist/esm/loader.js +1 -1
  277. package/dist/esm/loader.js.map +1 -1
  278. package/dist/esm/{prop.validators-e15a584f.js → prop.validators-2c20cdf8.js} +1 -1
  279. package/dist/esm/{prop.validators-e15a584f.js.map → prop.validators-2c20cdf8.js.map} +1 -1
  280. package/dist/esm/show-5a4bfd71.js +4 -0
  281. package/dist/esm/{show-f85eb6d8.js.map → show-5a4bfd71.js.map} +1 -1
  282. package/dist/esm/{tab-index-eff012a1.js → tab-index-2de507bb.js} +1 -1
  283. package/dist/esm/{tab-index-eff012a1.js.map → tab-index-2de507bb.js.map} +1 -1
  284. package/dist/esm/validation-7df9acd0.js +4 -0
  285. package/dist/esm/{validation-ec53a8be.js.map → validation-7df9acd0.js.map} +1 -1
  286. package/dist/esm/{validation-d4aeea71.js → validation-9c8695ca.js} +1 -1
  287. package/dist/esm/{validation-d4aeea71.js.map → validation-9c8695ca.js.map} +1 -1
  288. package/dist/kolibri/{a11y.tipps-1cea9822.js → a11y.tipps-2e27f8e6.js} +1 -1
  289. package/dist/kolibri/a11y.tipps-2e27f8e6.js.map +1 -0
  290. package/dist/kolibri/app-globals-1e2df332.js +4 -0
  291. package/dist/kolibri/aria-selected-0f45e2c3.js +4 -0
  292. package/dist/kolibri/assets/loader.css +46 -0
  293. package/dist/kolibri/{button-link-4a7e6a2e.js → button-link-abc9999d.js} +1 -1
  294. package/dist/kolibri/{color-00a19ef0.js → color-2a715559.js} +1 -1
  295. package/dist/kolibri/controller-3ae042db.js +4 -0
  296. package/dist/kolibri/{controller-3e94c3f2.js → controller-6f59f733.js} +1 -1
  297. package/dist/kolibri/{controller-1ec68c46.js → controller-9b769c83.js} +1 -1
  298. package/dist/kolibri/{controller-0cf6cd75.js → controller-abdc8667.js} +1 -1
  299. package/dist/kolibri/controller-c92d85d6.js +4 -0
  300. package/dist/kolibri/{controller-53ddde7c.js → controller-ca91917c.js} +1 -1
  301. package/dist/kolibri/controller-icon-8d8c747a.js +4 -0
  302. package/dist/kolibri/{devtools-33f1b614.js → devtools-fc4614e6.js} +1 -1
  303. package/dist/kolibri/{disabled-9bd11a04.js → disabled-7ea66fab.js} +1 -1
  304. package/dist/kolibri/hide-label-1fa80b94.js +4 -0
  305. package/dist/kolibri/{i18n-81ce19c0.js → i18n-b8589f01.js} +1 -1
  306. package/dist/kolibri/{icon-dfcf642a.js → icon-52e86ff8.js} +1 -1
  307. package/dist/kolibri/{index-133da8ac.js → index-0962b5a1.js} +1 -1
  308. package/dist/kolibri/{index-133da8ac.js.map → index-0962b5a1.js.map} +1 -1
  309. package/dist/kolibri/index-50adf9a0.js +5 -0
  310. package/dist/kolibri/index-50adf9a0.js.map +1 -0
  311. package/dist/kolibri/index.esm.js +1 -1
  312. package/dist/kolibri/kol-abbr.entry.js +1 -1
  313. package/dist/kolibri/kol-accordion.entry.js +1 -1
  314. package/dist/kolibri/kol-alert-wc_2.entry.js +1 -1
  315. package/dist/kolibri/kol-alert.entry.js +1 -1
  316. package/dist/kolibri/kol-badge.entry.js +1 -1
  317. package/dist/kolibri/kol-breadcrumb.entry.js +1 -1
  318. package/dist/kolibri/kol-button-group-wc.entry.js +1 -1
  319. package/dist/kolibri/kol-button-group.entry.js +1 -1
  320. package/dist/kolibri/kol-button-link.entry.js +1 -1
  321. package/dist/kolibri/kol-button-wc_3.entry.js +1 -1
  322. package/dist/kolibri/kol-button-wc_3.entry.js.map +1 -1
  323. package/dist/kolibri/kol-button.entry.js +1 -1
  324. package/dist/kolibri/kol-card.entry.js +1 -1
  325. package/dist/kolibri/kol-details.entry.js +1 -1
  326. package/dist/kolibri/kol-form.entry.js +1 -1
  327. package/dist/kolibri/kol-heading.entry.js +1 -1
  328. package/dist/kolibri/kol-icon-font-awesome.entry.js +1 -1
  329. package/dist/kolibri/kol-icon-icofont.entry.js +1 -1
  330. package/dist/kolibri/kol-icon.entry.js +1 -1
  331. package/dist/kolibri/kol-image.entry.js +1 -1
  332. package/dist/kolibri/kol-indented-text.entry.js +1 -1
  333. package/dist/kolibri/kol-input-adapter-leanup.entry.js +1 -1
  334. package/dist/kolibri/kol-input-checkbox.entry.js +1 -1
  335. package/dist/kolibri/kol-input-color.entry.js +1 -1
  336. package/dist/kolibri/kol-input-date.entry.js +1 -1
  337. package/dist/kolibri/kol-input-email.entry.js +1 -1
  338. package/dist/kolibri/kol-input-file.entry.js +1 -1
  339. package/dist/kolibri/kol-input-number.entry.js +1 -1
  340. package/dist/kolibri/kol-input-password.entry.js +1 -1
  341. package/dist/kolibri/kol-input-radio-group.entry.js +1 -1
  342. package/dist/kolibri/kol-input-radio.entry.js +1 -1
  343. package/dist/kolibri/kol-input-range.entry.js +1 -1
  344. package/dist/kolibri/kol-input-text.entry.js +1 -1
  345. package/dist/kolibri/kol-kolibri.entry.js +1 -1
  346. package/dist/kolibri/kol-link-button.entry.js +1 -1
  347. package/dist/kolibri/kol-link-group.entry.js +1 -1
  348. package/dist/kolibri/kol-link-wc.entry.js +1 -1
  349. package/dist/kolibri/kol-link-wc.entry.js.map +1 -1
  350. package/dist/kolibri/kol-link.entry.js +1 -1
  351. package/dist/kolibri/kol-logo.entry.js +1 -1
  352. package/dist/kolibri/kol-modal.entry.js +1 -1
  353. package/dist/kolibri/kol-nav.entry.js +1 -1
  354. package/dist/kolibri/kol-nav.entry.js.map +1 -1
  355. package/dist/kolibri/kol-pagination.entry.js +1 -1
  356. package/dist/kolibri/kol-popover.entry.js +1 -1
  357. package/dist/kolibri/kol-progress.entry.js +1 -1
  358. package/dist/kolibri/kol-progress.entry.js.map +1 -1
  359. package/dist/kolibri/kol-quote.entry.js +1 -1
  360. package/dist/kolibri/kol-select.entry.js +1 -1
  361. package/dist/kolibri/kol-skip-nav.entry.js +1 -1
  362. package/dist/kolibri/kol-span.entry.js +1 -1
  363. package/dist/kolibri/kol-spin.entry.js +1 -1
  364. package/dist/kolibri/kol-spin.entry.js.map +1 -1
  365. package/dist/kolibri/kol-split-button.entry.js +1 -1
  366. package/dist/kolibri/kol-symbol.entry.js +1 -1
  367. package/dist/kolibri/kol-table.entry.js +1 -1
  368. package/dist/kolibri/kol-tabs.entry.js +1 -1
  369. package/dist/kolibri/kol-textarea.entry.js +1 -1
  370. package/dist/kolibri/kol-toast.entry.js +1 -1
  371. package/dist/kolibri/kol-tooltip.entry.js +1 -1
  372. package/dist/kolibri/kol-version.entry.js +1 -1
  373. package/dist/kolibri/kolibri.esm.js +1 -1
  374. package/dist/kolibri/kolibri.esm.js.map +1 -1
  375. package/dist/kolibri/label-58f2333f.js +4 -0
  376. package/dist/kolibri/label-58f2333f.js.map +1 -0
  377. package/dist/kolibri/{prop.validators-e15a584f.js → prop.validators-2c20cdf8.js} +1 -1
  378. package/dist/kolibri/show-5a4bfd71.js +4 -0
  379. package/dist/kolibri/tab-index-2de507bb.js +4 -0
  380. package/dist/kolibri/{tab-index-eff012a1.js.map → tab-index-2de507bb.js.map} +1 -1
  381. package/dist/kolibri/validation-7df9acd0.js +4 -0
  382. package/dist/kolibri/{validation-d4aeea71.js → validation-9c8695ca.js} +1 -1
  383. package/dist/loader/index.d.ts +1 -1
  384. package/dist/types/components/spin/component.d.ts +11 -3
  385. package/dist/types/components.d.ts +10 -0
  386. package/dist/types/stencil-public-runtime.d.ts +0 -1
  387. package/dist/types/types/props/variant/spin.d.ts +6 -0
  388. package/dist/types/utils/a11y.tipps.d.ts +1 -0
  389. package/doc/input-email.md +1 -1
  390. package/doc/input-text.md +1 -1
  391. package/doc/nav.md +1 -1
  392. package/doc/spin.md +62 -4
  393. package/jest-test-results.json +1 -1
  394. package/package.json +1 -1
  395. package/vscode-custom-data.json +12 -0
  396. package/dist/cjs/a11y.tipps-6f0ad06e.js.map +0 -1
  397. package/dist/cjs/hide-label-142676e3.js +0 -4
  398. package/dist/cjs/index-2f320bab.js +0 -5
  399. package/dist/cjs/index-2f320bab.js.map +0 -1
  400. package/dist/cjs/label-77683d7b.js +0 -4
  401. package/dist/cjs/label-77683d7b.js.map +0 -1
  402. package/dist/cjs/show-6e36cda5.js +0 -4
  403. package/dist/cjs/validation-5c91bbc8.js +0 -4
  404. package/dist/esm/a11y.tipps-1cea9822.js.map +0 -1
  405. package/dist/esm/app-globals-6ba5ef2f.js +0 -4
  406. package/dist/esm/index-0e29e47a.js +0 -5
  407. package/dist/esm/index-0e29e47a.js.map +0 -1
  408. package/dist/esm/label-4bfc9d30.js +0 -4
  409. package/dist/esm/label-4bfc9d30.js.map +0 -1
  410. package/dist/esm/show-f85eb6d8.js +0 -4
  411. package/dist/esm/validation-ec53a8be.js +0 -4
  412. package/dist/kolibri/a11y.tipps-1cea9822.js.map +0 -1
  413. package/dist/kolibri/app-globals-6ba5ef2f.js +0 -4
  414. package/dist/kolibri/aria-selected-aaf31182.js +0 -4
  415. package/dist/kolibri/controller-830cac3b.js +0 -4
  416. package/dist/kolibri/controller-985aff52.js +0 -4
  417. package/dist/kolibri/controller-icon-26c0e34a.js +0 -4
  418. package/dist/kolibri/hide-label-5d7003be.js +0 -4
  419. package/dist/kolibri/index-0e29e47a.js +0 -5
  420. package/dist/kolibri/index-0e29e47a.js.map +0 -1
  421. package/dist/kolibri/label-4bfc9d30.js +0 -4
  422. package/dist/kolibri/label-4bfc9d30.js.map +0 -1
  423. package/dist/kolibri/show-f85eb6d8.js +0 -4
  424. package/dist/kolibri/tab-index-eff012a1.js +0 -4
  425. package/dist/kolibri/validation-ec53a8be.js +0 -4
  426. /package/dist/kolibri/{app-globals-6ba5ef2f.js.map → app-globals-1e2df332.js.map} +0 -0
  427. /package/dist/kolibri/{aria-selected-aaf31182.js.map → aria-selected-0f45e2c3.js.map} +0 -0
  428. /package/dist/kolibri/{button-link-4a7e6a2e.js.map → button-link-abc9999d.js.map} +0 -0
  429. /package/dist/kolibri/{color-00a19ef0.js.map → color-2a715559.js.map} +0 -0
  430. /package/dist/kolibri/{controller-830cac3b.js.map → controller-3ae042db.js.map} +0 -0
  431. /package/dist/kolibri/{controller-3e94c3f2.js.map → controller-6f59f733.js.map} +0 -0
  432. /package/dist/kolibri/{controller-1ec68c46.js.map → controller-9b769c83.js.map} +0 -0
  433. /package/dist/kolibri/{controller-0cf6cd75.js.map → controller-abdc8667.js.map} +0 -0
  434. /package/dist/kolibri/{controller-985aff52.js.map → controller-c92d85d6.js.map} +0 -0
  435. /package/dist/kolibri/{controller-53ddde7c.js.map → controller-ca91917c.js.map} +0 -0
  436. /package/dist/kolibri/{controller-icon-26c0e34a.js.map → controller-icon-8d8c747a.js.map} +0 -0
  437. /package/dist/kolibri/{devtools-33f1b614.js.map → devtools-fc4614e6.js.map} +0 -0
  438. /package/dist/kolibri/{disabled-9bd11a04.js.map → disabled-7ea66fab.js.map} +0 -0
  439. /package/dist/kolibri/{hide-label-5d7003be.js.map → hide-label-1fa80b94.js.map} +0 -0
  440. /package/dist/kolibri/{i18n-81ce19c0.js.map → i18n-b8589f01.js.map} +0 -0
  441. /package/dist/kolibri/{icon-dfcf642a.js.map → icon-52e86ff8.js.map} +0 -0
  442. /package/dist/kolibri/{prop.validators-e15a584f.js.map → prop.validators-2c20cdf8.js.map} +0 -0
  443. /package/dist/kolibri/{show-f85eb6d8.js.map → show-5a4bfd71.js.map} +0 -0
  444. /package/dist/kolibri/{validation-ec53a8be.js.map → validation-7df9acd0.js.map} +0 -0
  445. /package/dist/kolibri/{validation-d4aeea71.js.map → validation-9c8695ca.js.map} +0 -0
@@ -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{j as a11yHint,w as watchString,F as watchJsonArrayString,l as watchBoolean,B as watchNumber,M as STATE_CHANGE_EVENT,v as propagateFocus,n as nonce}from"./prop.validators.js";import{g as getRenderStates}from"./controller.js";import{I as InputIconController}from"./controller-icon.js";import{f as fillKeyOptionMap}from"./controller2.js";import{h as hasEnoughReadableChars,e as containsOnlyNumbers,d as defineCustomElement$2}from"./component3.js";import{d as defineCustomElement$8}from"./shadow.js";import{d as defineCustomElement$7}from"./component6.js";import{d as defineCustomElement$6}from"./component5.js";import{d as defineCustomElement$5}from"./component4.js";import{d as defineCustomElement$4}from"./component2.js";import{d as defineCustomElement$3}from"./component11.js";import{d as defineCustomElement$1}from"./component.js";const validateInputSelectList=e=>{if("object"==typeof e&&null!==e){if("string"==typeof e.label&&e.label.length>0)return e.disabled=!0===e.disabled,e.label=`${e.label}`.trim(),!1===hasEnoughReadableChars(e.label,3)&&!1===containsOnlyNumbers(e.label)&&a11yHint(`Ein abweichendes Aria-Label (${e.label}) ist nicht barrierefrei. Ein abweichendes Aria-Label sollte aus mindestens drei lesbaren Zeichen bestehen.`),!Array.isArray(e.options)||void 0===e.options.find((e=>!1===validateInputSelectList(e)));if("number"==typeof e.label)return!0}return!1};class SelectController extends InputIconController{constructor(e,t,i){super(e,t,i),this.keyOptionMap=new Map,this.getOptionByKey=e=>this.keyOptionMap.get(e),this.isValueInOptions=(e,t)=>void 0!==t.find((t=>"string"==typeof t.value?t.value===e:!!Array.isArray(t.options)&&this.isValueInOptions(e,t.options))),this.filterValuesInOptions=(e,t)=>e.filter((e=>void 0!==this.isValueInOptions(e,t))),this.beforePatchListValue=(e,t)=>{const i=t.has("_list")?t.get("_list"):this.component.state._list;if(Array.isArray(i)&&i.length>0){this.keyOptionMap.clear(),fillKeyOptionMap(this.keyOptionMap,i);const e=t.has("_value")?t.get("_value"):this.component.state._value,a=this.filterValuesInOptions(Array.isArray(e)&&e.length>0?e:[],i);!1===this.component._multiple&&0===a.length?(t.set("_value",[i[0].value]),this.onStateChange()):Array.isArray(e)&&a.length<e.length&&(t.set("_value",a),this.onStateChange())}},this.component=e}validateHeight(e){watchString(this.component,"_height",e)}validateList(e){watchJsonArrayString(this.component,"_list",validateInputSelectList,e,void 0,{hooks:{beforePatch:this.beforePatchListValue}})}validateMultiple(e){watchBoolean(this.component,"_multiple",e,{hooks:{beforePatch:this.beforePatchListValue}})}validateRequired(e){watchBoolean(this.component,"_required",e)}validateSize(e){watchNumber(this.component,"_size",e,{min:1})}validateValue(e){watchJsonArrayString(this.component,"_value",(()=>!0),e,void 0,{hooks:{beforePatch:this.beforePatchListValue}}),this.setFormAssociatedValue(this.component._value)}componentWillLoad(e){super.componentWillLoad(),this.onStateChange=()=>{if("function"==typeof e){const t=setTimeout((()=>{clearTimeout(t),e(STATE_CHANGE_EVENT)}))}},this.validateHeight(this.component._height),this.validateList(this.component._list),this.validateMultiple(this.component._multiple),this.validateRequired(this.component._required),this.validateSize(this.component._size),this.validateValue(this.component._value)}}const defaultStyleCss=":host{--a11y-min-size:44px}*{hyphens:auto;letter-spacing:inherit;word-break:break-word;word-spacing:inherit}[role='button'],button:not([role='link']),kol-input .input{min-height:var(--a11y-min-size);min-width:var(--a11y-min-size)}a,button,h1,h2,h3,h4,h5,h6,input,option,select,textarea{font-family:inherit;font-size:inherit}:is(a,button){background-color:transparent;border:none;margin:0;padding:0;width:100%;}:host{max-width:100%}*{box-sizing:border-box}kol-span-wc{display:grid;place-items:center}kol-span-wc>span{display:flex;place-items:center}a,button{cursor:pointer}button,input,option,select,textarea{font-family:inherit}.icon-only>kol-span-wc>span>span{display:none}.required label>span::after,.required legend>span::after{content:'*'}:host{display:block}input,textarea{cursor:text}input[type='checkbox'],input[type='color'],input[type='file'],input[type='radio'],input[type='range'],label,option,select{cursor:pointer}input[type='color'],input[type='date'],input[type='datetime-local'],input[type='email'],input[type='file'],input[type='month'],input[type='number'],input[type='password'],input[type='search'],input[type='tel'],input[type='text'],input[type='time'],input[type='url'],input[type='week'],select:not([multiple]),select[multiple] option,textarea{font-size:1rem;width:100%}input[type='file']{padding:calc((var(--a11y-min-size) - 1rem) / 10) 0.5em}select[multiple] option{padding:calc((var(--a11y-min-size) - 1rem) / 2) 0.5em}kol-input.disabled :is(button,input,label,option,select,textarea){cursor:not-allowed;opacity:0.5}kol-input{display:grid}kol-input [slot='input']{flex-grow:1}input:not([type='checkbox'],[type='radio']),select:not([multiple]){height:2.75em}input:focus,option:focus,select:focus,textarea:focus{outline:0}.input{display:flex;align-items:center}.input>kol-icon{display:grid;height:var(--a11y-min-size);place-items:center}",isSelected=(e,t)=>Array.isArray(e)&&e.includes(t),KolSelect=proxyCustomElement(class extends HTMLElement{renderOptgroup(e,t){var i;return h("optgroup",{disabled:!0===e.disabled,label:e.label},null===(i=e.options)||void 0===i?void 0:i.map(((e,i)=>{const a=`${t}-${i}`;return Array.isArray(e.options)?this.renderOptgroup(e,a):h("option",{disabled:!0===e.disabled,key:a,selected:isSelected(this.state._value,e.value),value:a},e.label)})))}render(){const{ariaDescribedBy:e}=getRenderStates(this.state);return h(Host,{class:{"has-value":this.state._hasValue}},h("kol-input",{class:{select:!0},_disabled:this.state._disabled,_error:this.state._error,_hideLabel:this.state._hideLabel,_hint:this.state._hint,_icon:this.state._icon,_id:this.state._id,_required:this.state._required,_touched:this.state._touched,onClick:()=>{var e;return null===(e=this.ref)||void 0===e?void 0:e.focus()}},h("span",{slot:"label"},h("slot",null)),h("select",Object.assign({ref:this.catchRef,title:"",accessKey:this.state._accessKey,"aria-describedby":e.length>0?e.join(" "):void 0,"aria-labelledby":`${this.state._id}-label`,autoCapitalize:"off",autoCorrect:"off",disabled:this.state._disabled,id:this.state._id,multiple:this.state._multiple,name:this.state._name,required:this.state._required,size:this.state._size,slot:"input",spellcheck:"false",style:{height:this.state._height}},{onClick:this.controller.onFacade.onClick,onBlur:this.controller.onFacade.onBlur,onFocus:this.controller.onFacade.onFocus},{onChange:this.onChange}),this.state._list.map(((e,t)=>{const i=`-${t}`;return Array.isArray(e.options)?this.renderOptgroup(e,i):h("option",{disabled:!0===e.disabled,key:i,selected:isSelected(this.state._value,e.value),value:i},e.label)})))))}constructor(){super(),this.__registerHost(),this.__attachShadow(),this.catchRef=e=>{this.ref=e,propagateFocus(this.host,this.ref)},this.onChange=e=>{var t,i;this._value=Array.from((null===(t=this.ref)||void 0===t?void 0:t.options)||[]).filter((e=>!0===e.selected)).map((e=>{var t;return null===(t=this.controller.getOptionByKey(e.value))||void 0===t?void 0:t.value})),this.controller.setFormAssociatedValue(this._value),"function"==typeof(null===(i=this.state._on)||void 0===i?void 0:i.onChange)&&this.state._on.onChange(e,this._value)},this._accessKey=void 0,this._alert=!0,this._disabled=void 0,this._error=void 0,this._height=void 0,this._hideLabel=void 0,this._hint="",this._icon=void 0,this._id=void 0,this._list=void 0,this._multiple=!1,this._name=void 0,this._on=void 0,this._required=void 0,this._size=void 0,this._tabIndex=void 0,this._touched=!1,this._value=void 0,this.state={_hasValue:!1,_height:"",_id:nonce(),_list:[],_multiple:!1,_value:[]},this.controller=new SelectController(this,"textarea",this.host)}validateAccessKey(e){this.controller.validateAccessKey(e)}validateAlert(e){this.controller.validateAlert(e)}validateDisabled(e){this.controller.validateDisabled(e)}validateError(e){this.controller.validateError(e)}validateHeight(e){this.controller.validateHeight(e)}validateHideLabel(e){this.controller.validateHideLabel(e)}validateHint(e){this.controller.validateHint(e)}validateIcon(e){this.controller.validateIcon(e)}validateId(e){this.controller.validateId(e)}validateList(e){this.controller.validateList(e)}validateMultiple(e){this.controller.validateMultiple(e)}validateName(e){this.controller.validateName(e)}validateOn(e){this.controller.validateOn(e)}validateRequired(e){this.controller.validateRequired(e)}validateSize(e){this.controller.validateSize(e)}validateTabIndex(e){this.controller.validateTabIndex(e)}validateTouched(e){this.controller.validateTouched(e)}validateValue(e){this.controller.validateValue(e)}componentWillLoad(){this._alert=!0===this._alert,this._touched=!0===this._touched,this.controller.componentWillLoad(this.onChange),this.state._hasValue=!!this.state._value,this.controller.addValueChangeListener((e=>this.state._hasValue=!!e))}get host(){return this}static get watchers(){return{_accessKey:["validateAccessKey"],_alert:["validateAlert"],_disabled:["validateDisabled"],_error:["validateError"],_height:["validateHeight"],_hideLabel:["validateHideLabel"],_hint:["validateHint"],_icon:["validateIcon"],_id:["validateId"],_list:["validateList"],_multiple:["validateMultiple"],_name:["validateName"],_on:["validateOn"],_required:["validateRequired"],_size:["validateSize"],_tabIndex:["validateTabIndex"],_touched:["validateTouched"],_value:["validateValue"]}}static get style(){return{default:defaultStyleCss}}},[33,"kol-select",{_accessKey:[1,"_access-key"],_alert:[1540],_disabled:[516],_error:[1],_height:[1],_hideLabel:[516,"_hide-label"],_hint:[1],_icon:[1],_id:[1],_list:[1],_multiple:[516],_name:[1],_on:[16],_required:[516],_size:[2],_tabIndex:[2,"_tab-index"],_touched:[1540],_value:[1025],state:[32]}]);function defineCustomElement(){if("undefined"==typeof customElements)return;["kol-select","kol-alert","kol-alert-wc","kol-button-wc","kol-heading-wc","kol-icon","kol-input","kol-span-wc","kol-tooltip"].forEach((e=>{switch(e){case"kol-select":customElements.get(e)||customElements.define(e,KolSelect);break;case"kol-alert":customElements.get(e)||defineCustomElement$8();break;case"kol-alert-wc":customElements.get(e)||defineCustomElement$7();break;case"kol-button-wc":customElements.get(e)||defineCustomElement$6();break;case"kol-heading-wc":customElements.get(e)||defineCustomElement$5();break;case"kol-icon":customElements.get(e)||defineCustomElement$4();break;case"kol-input":customElements.get(e)||defineCustomElement$3();break;case"kol-span-wc":customElements.get(e)||defineCustomElement$2();break;case"kol-tooltip":customElements.get(e)||defineCustomElement$1()}}))}export{KolSelect as K,defineCustomElement as d};
4
+ import{proxyCustomElement,HTMLElement,h,Host}from"@stencil/core/internal/client";import{j as a11yHint,w as watchString,G as watchJsonArrayString,l as watchBoolean,C as watchNumber,N as STATE_CHANGE_EVENT,x as propagateFocus,n as nonce}from"./prop.validators.js";import{g as getRenderStates}from"./controller.js";import{I as InputIconController}from"./controller-icon.js";import{f as fillKeyOptionMap}from"./controller2.js";import{h as hasEnoughReadableChars,e as containsOnlyNumbers,d as defineCustomElement$2}from"./component3.js";import{d as defineCustomElement$8}from"./shadow.js";import{d as defineCustomElement$7}from"./component6.js";import{d as defineCustomElement$6}from"./component5.js";import{d as defineCustomElement$5}from"./component4.js";import{d as defineCustomElement$4}from"./component2.js";import{d as defineCustomElement$3}from"./component11.js";import{d as defineCustomElement$1}from"./component.js";const validateInputSelectList=e=>{if("object"==typeof e&&null!==e){if("string"==typeof e.label&&e.label.length>0)return e.disabled=!0===e.disabled,e.label=`${e.label}`.trim(),!1===hasEnoughReadableChars(e.label,3)&&!1===containsOnlyNumbers(e.label)&&a11yHint(`Ein abweichendes Aria-Label (${e.label}) ist nicht barrierefrei. Ein abweichendes Aria-Label sollte aus mindestens drei lesbaren Zeichen bestehen.`),!Array.isArray(e.options)||void 0===e.options.find((e=>!1===validateInputSelectList(e)));if("number"==typeof e.label)return!0}return!1};class SelectController extends InputIconController{constructor(e,t,i){super(e,t,i),this.keyOptionMap=new Map,this.getOptionByKey=e=>this.keyOptionMap.get(e),this.isValueInOptions=(e,t)=>void 0!==t.find((t=>"string"==typeof t.value?t.value===e:!!Array.isArray(t.options)&&this.isValueInOptions(e,t.options))),this.filterValuesInOptions=(e,t)=>e.filter((e=>void 0!==this.isValueInOptions(e,t))),this.beforePatchListValue=(e,t)=>{const i=t.has("_list")?t.get("_list"):this.component.state._list;if(Array.isArray(i)&&i.length>0){this.keyOptionMap.clear(),fillKeyOptionMap(this.keyOptionMap,i);const e=t.has("_value")?t.get("_value"):this.component.state._value,a=this.filterValuesInOptions(Array.isArray(e)&&e.length>0?e:[],i);!1===this.component._multiple&&0===a.length?(t.set("_value",[i[0].value]),this.onStateChange()):Array.isArray(e)&&a.length<e.length&&(t.set("_value",a),this.onStateChange())}},this.component=e}validateHeight(e){watchString(this.component,"_height",e)}validateList(e){watchJsonArrayString(this.component,"_list",validateInputSelectList,e,void 0,{hooks:{beforePatch:this.beforePatchListValue}})}validateMultiple(e){watchBoolean(this.component,"_multiple",e,{hooks:{beforePatch:this.beforePatchListValue}})}validateRequired(e){watchBoolean(this.component,"_required",e)}validateSize(e){watchNumber(this.component,"_size",e,{min:1})}validateValue(e){watchJsonArrayString(this.component,"_value",(()=>!0),e,void 0,{hooks:{beforePatch:this.beforePatchListValue}}),this.setFormAssociatedValue(this.component._value)}componentWillLoad(e){super.componentWillLoad(),this.onStateChange=()=>{if("function"==typeof e){const t=setTimeout((()=>{clearTimeout(t),e(STATE_CHANGE_EVENT)}))}},this.validateHeight(this.component._height),this.validateList(this.component._list),this.validateMultiple(this.component._multiple),this.validateRequired(this.component._required),this.validateSize(this.component._size),this.validateValue(this.component._value)}}const defaultStyleCss=":host{--a11y-min-size:44px}*{hyphens:auto;letter-spacing:inherit;word-break:break-word;word-spacing:inherit}[role='button'],button:not([role='link']),kol-input .input{min-height:var(--a11y-min-size);min-width:var(--a11y-min-size)}a,button,h1,h2,h3,h4,h5,h6,input,option,select,textarea{font-family:inherit;font-size:inherit}:is(a,button){background-color:transparent;border:none;margin:0;padding:0;width:100%;}:host{max-width:100%}*{box-sizing:border-box}kol-span-wc{display:grid;place-items:center}kol-span-wc>span{display:flex;place-items:center}a,button{cursor:pointer}button,input,option,select,textarea{font-family:inherit}.icon-only>kol-span-wc>span>span{display:none}.required label>span::after,.required legend>span::after{content:'*'}:host{display:block}input,textarea{cursor:text}input[type='checkbox'],input[type='color'],input[type='file'],input[type='radio'],input[type='range'],label,option,select{cursor:pointer}input[type='color'],input[type='date'],input[type='datetime-local'],input[type='email'],input[type='file'],input[type='month'],input[type='number'],input[type='password'],input[type='search'],input[type='tel'],input[type='text'],input[type='time'],input[type='url'],input[type='week'],select:not([multiple]),select[multiple] option,textarea{font-size:1rem;width:100%}input[type='file']{padding:calc((var(--a11y-min-size) - 1rem) / 10) 0.5em}select[multiple] option{padding:calc((var(--a11y-min-size) - 1rem) / 2) 0.5em}kol-input.disabled :is(button,input,label,option,select,textarea){cursor:not-allowed;opacity:0.5}kol-input{display:grid}kol-input [slot='input']{flex-grow:1}input:not([type='checkbox'],[type='radio']),select:not([multiple]){height:2.75em}input:focus,option:focus,select:focus,textarea:focus{outline:0}.input{display:flex;align-items:center}.input>kol-icon{display:grid;height:var(--a11y-min-size);place-items:center}",isSelected=(e,t)=>Array.isArray(e)&&e.includes(t),KolSelect=proxyCustomElement(class extends HTMLElement{renderOptgroup(e,t){var i;return h("optgroup",{disabled:!0===e.disabled,label:e.label},null===(i=e.options)||void 0===i?void 0:i.map(((e,i)=>{const a=`${t}-${i}`;return Array.isArray(e.options)?this.renderOptgroup(e,a):h("option",{disabled:!0===e.disabled,key:a,selected:isSelected(this.state._value,e.value),value:a},e.label)})))}render(){const{ariaDescribedBy:e}=getRenderStates(this.state);return h(Host,{class:{"has-value":this.state._hasValue}},h("kol-input",{class:{select:!0},_disabled:this.state._disabled,_error:this.state._error,_hideLabel:this.state._hideLabel,_hint:this.state._hint,_icon:this.state._icon,_id:this.state._id,_required:this.state._required,_touched:this.state._touched,onClick:()=>{var e;return null===(e=this.ref)||void 0===e?void 0:e.focus()}},h("span",{slot:"label"},h("slot",null)),h("select",Object.assign({ref:this.catchRef,title:"",accessKey:this.state._accessKey,"aria-describedby":e.length>0?e.join(" "):void 0,"aria-labelledby":`${this.state._id}-label`,autoCapitalize:"off",autoCorrect:"off",disabled:this.state._disabled,id:this.state._id,multiple:this.state._multiple,name:this.state._name,required:this.state._required,size:this.state._size,slot:"input",spellcheck:"false",style:{height:this.state._height}},{onClick:this.controller.onFacade.onClick,onBlur:this.controller.onFacade.onBlur,onFocus:this.controller.onFacade.onFocus},{onChange:this.onChange}),this.state._list.map(((e,t)=>{const i=`-${t}`;return Array.isArray(e.options)?this.renderOptgroup(e,i):h("option",{disabled:!0===e.disabled,key:i,selected:isSelected(this.state._value,e.value),value:i},e.label)})))))}constructor(){super(),this.__registerHost(),this.__attachShadow(),this.catchRef=e=>{this.ref=e,propagateFocus(this.host,this.ref)},this.onChange=e=>{var t,i;this._value=Array.from((null===(t=this.ref)||void 0===t?void 0:t.options)||[]).filter((e=>!0===e.selected)).map((e=>{var t;return null===(t=this.controller.getOptionByKey(e.value))||void 0===t?void 0:t.value})),this.controller.setFormAssociatedValue(this._value),"function"==typeof(null===(i=this.state._on)||void 0===i?void 0:i.onChange)&&this.state._on.onChange(e,this._value)},this._accessKey=void 0,this._alert=!0,this._disabled=void 0,this._error=void 0,this._height=void 0,this._hideLabel=void 0,this._hint="",this._icon=void 0,this._id=void 0,this._list=void 0,this._multiple=!1,this._name=void 0,this._on=void 0,this._required=void 0,this._size=void 0,this._tabIndex=void 0,this._touched=!1,this._value=void 0,this.state={_hasValue:!1,_height:"",_id:nonce(),_list:[],_multiple:!1,_value:[]},this.controller=new SelectController(this,"textarea",this.host)}validateAccessKey(e){this.controller.validateAccessKey(e)}validateAlert(e){this.controller.validateAlert(e)}validateDisabled(e){this.controller.validateDisabled(e)}validateError(e){this.controller.validateError(e)}validateHeight(e){this.controller.validateHeight(e)}validateHideLabel(e){this.controller.validateHideLabel(e)}validateHint(e){this.controller.validateHint(e)}validateIcon(e){this.controller.validateIcon(e)}validateId(e){this.controller.validateId(e)}validateList(e){this.controller.validateList(e)}validateMultiple(e){this.controller.validateMultiple(e)}validateName(e){this.controller.validateName(e)}validateOn(e){this.controller.validateOn(e)}validateRequired(e){this.controller.validateRequired(e)}validateSize(e){this.controller.validateSize(e)}validateTabIndex(e){this.controller.validateTabIndex(e)}validateTouched(e){this.controller.validateTouched(e)}validateValue(e){this.controller.validateValue(e)}componentWillLoad(){this._alert=!0===this._alert,this._touched=!0===this._touched,this.controller.componentWillLoad(this.onChange),this.state._hasValue=!!this.state._value,this.controller.addValueChangeListener((e=>this.state._hasValue=!!e))}get host(){return this}static get watchers(){return{_accessKey:["validateAccessKey"],_alert:["validateAlert"],_disabled:["validateDisabled"],_error:["validateError"],_height:["validateHeight"],_hideLabel:["validateHideLabel"],_hint:["validateHint"],_icon:["validateIcon"],_id:["validateId"],_list:["validateList"],_multiple:["validateMultiple"],_name:["validateName"],_on:["validateOn"],_required:["validateRequired"],_size:["validateSize"],_tabIndex:["validateTabIndex"],_touched:["validateTouched"],_value:["validateValue"]}}static get style(){return{default:defaultStyleCss}}},[33,"kol-select",{_accessKey:[1,"_access-key"],_alert:[1540],_disabled:[516],_error:[1],_height:[1],_hideLabel:[516,"_hide-label"],_hint:[1],_icon:[1],_id:[1],_list:[1],_multiple:[516],_name:[1],_on:[16],_required:[516],_size:[2],_tabIndex:[2,"_tab-index"],_touched:[1540],_value:[1025],state:[32]}]);function defineCustomElement(){if("undefined"==typeof customElements)return;["kol-select","kol-alert","kol-alert-wc","kol-button-wc","kol-heading-wc","kol-icon","kol-input","kol-span-wc","kol-tooltip"].forEach((e=>{switch(e){case"kol-select":customElements.get(e)||customElements.define(e,KolSelect);break;case"kol-alert":customElements.get(e)||defineCustomElement$8();break;case"kol-alert-wc":customElements.get(e)||defineCustomElement$7();break;case"kol-button-wc":customElements.get(e)||defineCustomElement$6();break;case"kol-heading-wc":customElements.get(e)||defineCustomElement$5();break;case"kol-icon":customElements.get(e)||defineCustomElement$4();break;case"kol-input":customElements.get(e)||defineCustomElement$3();break;case"kol-span-wc":customElements.get(e)||defineCustomElement$2();break;case"kol-tooltip":customElements.get(e)||defineCustomElement$1()}}))}export{KolSelect as K,defineCustomElement as d};
@@ -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{o as objectObjectHandler,e as parseJson,a as watchValidator,i as isString,f as isStyle,h as isObject,w as watchString,j as a11yHint,k as isEmptyOrPrefixOf,l as watchBoolean}from"./prop.validators.js";import{d as defineCustomElement$1}from"./component2.js";const mapCustomIcon=(t,e,a)=>{isObject(a)?t[e]=a:isString(a,1)&&(t[e]={icon:a})},mapIconProp2State=(t,e)=>{let a={};if(isString(t,1))if("right"===e)a={right:{icon:t}};else a={left:{icon:t}};else"object"==typeof t&&null!==t&&(mapCustomIcon(a,"top",t.top),mapCustomIcon(a,"right",t.right),mapCustomIcon(a,"bottom",t.bottom),mapCustomIcon(a,"left",t.left));return a},beforePatchIcon=t=>{var e,a,i,o,n,s,l;if(null===(e=t.nextState)||void 0===e?void 0:e.has("_icon")){const e=null===(a=t.nextState)||void 0===a?void 0:a.get("_icon"),n=(null===(i=t.nextState)||void 0===i?void 0:i.get("_iconAlign"))||t.state._iconAlign;null===(o=t.nextState)||void 0===o||o.set("_icon",mapIconProp2State(e,n))}else if(null===(n=t.nextState)||void 0===n?void 0:n.has("_iconAlign")){const e=t.state._iconAlign;null===(s=t.nextState)||void 0===s||s.set("_icon",{[e]:void 0,[null===(l=t.nextState)||void 0===l?void 0:l.get("_iconAlign")]:t.state._icon[e]})}},isIcon=t=>"object"==typeof t&&null!==t&&(void 0===t.style||isStyle(t.style))&&isString(t.icon,1),validateIcon=(t,e)=>{objectObjectHandler(e,(()=>{try{e=parseJson(e)}catch(t){}watchValidator(t,"_icon",(t=>null===t||isString(t,1)||"object"==typeof t&&null!==t&&(isString(t.left,1)||isIcon(t.left)||isString(t.right,1)||isIcon(t.right)||isString(t.top,1)||isIcon(t.top)||isString(t.bottom,1)||isIcon(t.bottom))),new Set(["KoliBriIcon"]),e,{hooks:{beforePatch:(e,a)=>{null===e&&a.set("_icon",{}),beforePatchIcon(t)}},required:!0})}))},watchIconAlign=(t,e)=>{watchValidator(t,"_iconAlign",(t=>"left"===t||"right"===t),new Set(["Alignment {left, right, top, bottom}"]),e,{hooks:{beforePatch:()=>{beforePatchIcon(t)}}})},READABLE_CHARS=/[a-zA-Z0-9äöüÄÖÜß]/g,ONLY_NUMBERS=/^\d+$/;function countReadableChars(t){var e;return"string"==typeof t&&(null===(e=t.match(READABLE_CHARS))||void 0===e?void 0:e.length)||0}function hasEnoughReadableChars(t,e=1){return countReadableChars(t)>=e}function containsOnlyNumbers(t){return ONLY_NUMBERS.test(t)}const syncAriaLabelBeforePatch=(t,e,a,i)=>{const o=e.has("_ariaLabel")?e.get("_ariaLabel"):a.state._ariaLabel;if("string"==typeof o){const t=e.has("_label")?e.get("_label"):a.state._label;!1===isEmptyOrPrefixOf(t,o)&&("_ariaLabel"===i?e.set("_label",o):e.set("_ariaLabel",void 0),a11yHint("Das abweichende Aria-Label ist nicht barrierefrei. Ein abweichendes Aria-Label muss aus Gründern der Barrierefreiheit für die Sprachsteuerung mit dem Label-Text beginnen."))}},validateAriaLabel=(t,e,a={})=>{var i;watchString(t,"_ariaLabel",e,{hooks:{afterPatch:(t,e,i,o)=>{var n,s;"function"==typeof(null===(n=a.hooks)||void 0===n?void 0:n.afterPatch)&&(null===(s=a.hooks)||void 0===s||s.afterPatch(t,e,i,o)),"string"==typeof t&&t.length>0&&!1===hasEnoughReadableChars(t,3)&&!1===containsOnlyNumbers(t)&&a11yHint(`Ein abweichendes Aria-Label (${t}) ist nicht barrierefrei. Ein abweichendes Aria-Label sollte aus mindestens drei lesbaren Zeichen bestehen.`)},beforePatch:null===(i=a.hooks)||void 0===i?void 0:i.beforePatch}})},validateAriaLabelWithLabel=(t,e)=>{validateAriaLabel(t,e,{hooks:{beforePatch:syncAriaLabelBeforePatch}})},validateLabel=(t,e,a={})=>{var i;watchString(t,"_label",e,{hooks:{afterPatch:(t,e,i,o)=>{var n,s;"function"==typeof(null===(n=a.hooks)||void 0===n?void 0:n.afterPatch)&&(null===(s=a.hooks)||void 0===s||s.afterPatch(t,e,i,o)),"string"==typeof t&&!1===hasEnoughReadableChars(t,3)&&!1===containsOnlyNumbers(t)&&a11yHint(`Ein Label (${t}) ist nicht barrierefrei. Ein Label sollte aus mindestens drei lesbaren Zeichen bestehen.`)},beforePatch:null===(i=a.hooks)||void 0===i?void 0:i.beforePatch},required:!0})},validateLabelWithAriaLabel=(t,e)=>{validateLabel(t,e,{hooks:{beforePatch:syncAriaLabelBeforePatch}})},KolSpanWc=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this._icon=void 0,this._iconOnly=!1,this._label=void 0,this.state={_icon:{},_iconOnly:!1,_label:"…"}}render(){const t=this.state._label.length>0;return h(Host,{class:{"icon-only":this.state._iconOnly}},this.state._icon.top&&h("kol-icon",{class:"icon top",style:this.state._icon.top.style,_ariaLabel:"",_icon:this.state._icon.top.icon}),h("span",null,this.state._icon.left&&h("kol-icon",{class:"icon left",style:this.state._icon.left.style,_ariaLabel:"",_icon:this.state._icon.left.icon}),!0!==this.state._iconOnly&&this.state._label.length>0?h("span",null,this.state._label):"",h("span",{"aria-hidden":t?"true":void 0,hidden:t},h("slot",{name:"expert"})),this.state._icon.right&&h("kol-icon",{class:"icon right",style:this.state._icon.right.style,_ariaLabel:"",_icon:this.state._icon.right.icon})),this.state._icon.bottom&&h("kol-icon",{class:"icon bottom",style:this.state._icon.bottom.style,_ariaLabel:"",_icon:this.state._icon.bottom.icon}))}validateIcon(t){validateIcon(this,t)}validateIconOnly(t){watchBoolean(this,"_iconOnly",t)}validateLabel(t){validateLabelWithAriaLabel(this,t)}componentWillLoad(){this.validateIcon(this._icon),this.validateIconOnly(this._iconOnly),this.validateLabel(this._label)}static get watchers(){return{_icon:["validateIcon"],_iconOnly:["validateIconOnly"],_label:["validateLabel"]}}},[4,"kol-span-wc",{_icon:[1],_iconOnly:[516,"_icon-only"],_label:[1],state:[32]}]);function defineCustomElement(){if("undefined"==typeof customElements)return;["kol-span-wc","kol-icon"].forEach((t=>{switch(t){case"kol-span-wc":customElements.get(t)||customElements.define(t,KolSpanWc);break;case"kol-icon":customElements.get(t)||defineCustomElement$1()}}))}export{KolSpanWc as K,validateIcon as a,validateLabelWithAriaLabel as b,validateLabel as c,defineCustomElement as d,containsOnlyNumbers as e,hasEnoughReadableChars as h,isIcon as i,validateAriaLabelWithLabel as v,watchIconAlign as w};
4
+ import{proxyCustomElement,HTMLElement,h,Host}from"@stencil/core/internal/client";import{o as objectObjectHandler,e as parseJson,a as watchValidator,i as isString,f as isStyle,h as isObject,w as watchString,j as a11yHint,u as uiUxHint,k as isEmptyOrPrefixOf,l as watchBoolean}from"./prop.validators.js";import{d as defineCustomElement$1}from"./component2.js";const mapCustomIcon=(t,e,a)=>{isObject(a)?t[e]=a:isString(a,1)&&(t[e]={icon:a})},mapIconProp2State=(t,e)=>{let a={};if(isString(t,1))if("right"===e)a={right:{icon:t}};else a={left:{icon:t}};else"object"==typeof t&&null!==t&&(mapCustomIcon(a,"top",t.top),mapCustomIcon(a,"right",t.right),mapCustomIcon(a,"bottom",t.bottom),mapCustomIcon(a,"left",t.left));return a},beforePatchIcon=t=>{var e,a,o,i,n,l,s;if(null===(e=t.nextState)||void 0===e?void 0:e.has("_icon")){const e=null===(a=t.nextState)||void 0===a?void 0:a.get("_icon"),n=(null===(o=t.nextState)||void 0===o?void 0:o.get("_iconAlign"))||t.state._iconAlign;null===(i=t.nextState)||void 0===i||i.set("_icon",mapIconProp2State(e,n))}else if(null===(n=t.nextState)||void 0===n?void 0:n.has("_iconAlign")){const e=t.state._iconAlign;null===(l=t.nextState)||void 0===l||l.set("_icon",{[e]:void 0,[null===(s=t.nextState)||void 0===s?void 0:s.get("_iconAlign")]:t.state._icon[e]})}},isIcon=t=>"object"==typeof t&&null!==t&&(void 0===t.style||isStyle(t.style))&&isString(t.icon,1),validateIcon=(t,e)=>{objectObjectHandler(e,(()=>{try{e=parseJson(e)}catch(t){}watchValidator(t,"_icon",(t=>null===t||isString(t,1)||"object"==typeof t&&null!==t&&(isString(t.left,1)||isIcon(t.left)||isString(t.right,1)||isIcon(t.right)||isString(t.top,1)||isIcon(t.top)||isString(t.bottom,1)||isIcon(t.bottom))),new Set(["KoliBriIcon"]),e,{hooks:{beforePatch:(e,a)=>{null===e&&a.set("_icon",{}),beforePatchIcon(t)}},required:!0})}))},watchIconAlign=(t,e)=>{watchValidator(t,"_iconAlign",(t=>"left"===t||"right"===t),new Set(["Alignment {left, right, top, bottom}"]),e,{hooks:{beforePatch:()=>{beforePatchIcon(t)}}})},READABLE_CHARS=/[a-zA-Z0-9äöüÄÖÜß]/g,ONLY_NUMBERS=/^\d+$/;function countReadableChars(t){var e;return"string"==typeof t&&(null===(e=t.match(READABLE_CHARS))||void 0===e?void 0:e.length)||0}function hasEnoughReadableChars(t,e=1){return countReadableChars(t)>=e}function containsOnlyNumbers(t){return ONLY_NUMBERS.test(t)}const syncAriaLabelBeforePatch=(t,e,a,o)=>{const i=e.has("_ariaLabel")?e.get("_ariaLabel"):a.state._ariaLabel;if("string"==typeof i){const t=e.has("_label")?e.get("_label"):a.state._label;!1===isEmptyOrPrefixOf(t,i)&&("_ariaLabel"===o?e.set("_label",i):e.set("_ariaLabel",void 0),a11yHint("The different Aria label is not barrier-free. A different Aria label must start with the label text for reasons of accessibility for voice control."))}},validateAriaLabel=(t,e,a={})=>{var o;watchString(t,"_ariaLabel",e,{hooks:{afterPatch:(t,e,o,i)=>{var n,l;"function"==typeof(null===(n=a.hooks)||void 0===n?void 0:n.afterPatch)&&(null===(l=a.hooks)||void 0===l||l.afterPatch(t,e,o,i)),"string"==typeof t&&t.length>0&&!1===hasEnoughReadableChars(t,3)&&!1===containsOnlyNumbers(t)&&a11yHint(`The different aria label ("${t}") is not accessible. A different aria label should consist of at least three readable characters.`)},beforePatch:null===(o=a.hooks)||void 0===o?void 0:o.beforePatch}})},validateAriaLabelWithLabel=(t,e)=>{validateAriaLabel(t,e,{hooks:{beforePatch:syncAriaLabelBeforePatch}})},validateLabel=(t,e,a={})=>{var o;watchString(t,"_label",e,{hooks:{afterPatch:(t,e,o,i)=>{var n,l;"function"==typeof(null===(n=a.hooks)||void 0===n?void 0:n.afterPatch)&&(null===(l=a.hooks)||void 0===l||l.afterPatch(t,e,o,i)),"string"==typeof t&&!1===hasEnoughReadableChars(t,3)&&!1===containsOnlyNumbers(t)&&a11yHint(`The heading or label ("${t}") is not accessible. A label should consist of at least three readable characters.`),"string"==typeof t&&t.length>80&&uiUxHint("A heading or label should not be longer than 80 characters.")},beforePatch:null===(o=a.hooks)||void 0===o?void 0:o.beforePatch},required:!0})},validateLabelWithAriaLabel=(t,e)=>{validateLabel(t,e,{hooks:{beforePatch:syncAriaLabelBeforePatch}})},KolSpanWc=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this._icon=void 0,this._iconOnly=!1,this._label=void 0,this.state={_icon:{},_iconOnly:!1,_label:"…"}}render(){const t=this.state._label.length>0;return h(Host,{class:{"icon-only":this.state._iconOnly}},this.state._icon.top&&h("kol-icon",{class:"icon top",style:this.state._icon.top.style,_ariaLabel:"",_icon:this.state._icon.top.icon}),h("span",null,this.state._icon.left&&h("kol-icon",{class:"icon left",style:this.state._icon.left.style,_ariaLabel:"",_icon:this.state._icon.left.icon}),!0!==this.state._iconOnly&&this.state._label.length>0?h("span",null,this.state._label):"",h("span",{"aria-hidden":t?"true":void 0,hidden:t},h("slot",{name:"expert"})),this.state._icon.right&&h("kol-icon",{class:"icon right",style:this.state._icon.right.style,_ariaLabel:"",_icon:this.state._icon.right.icon})),this.state._icon.bottom&&h("kol-icon",{class:"icon bottom",style:this.state._icon.bottom.style,_ariaLabel:"",_icon:this.state._icon.bottom.icon}))}validateIcon(t){validateIcon(this,t)}validateIconOnly(t){watchBoolean(this,"_iconOnly",t)}validateLabel(t){validateLabelWithAriaLabel(this,t)}componentWillLoad(){this.validateIcon(this._icon),this.validateIconOnly(this._iconOnly),this.validateLabel(this._label)}static get watchers(){return{_icon:["validateIcon"],_iconOnly:["validateIconOnly"],_label:["validateLabel"]}}},[4,"kol-span-wc",{_icon:[1],_iconOnly:[516,"_icon-only"],_label:[1],state:[32]}]);function defineCustomElement(){if("undefined"==typeof customElements)return;["kol-span-wc","kol-icon"].forEach((t=>{switch(t){case"kol-span-wc":customElements.get(t)||customElements.define(t,KolSpanWc);break;case"kol-icon":customElements.get(t)||defineCustomElement$1()}}))}export{KolSpanWc as K,validateIcon as a,validateLabelWithAriaLabel as b,validateLabel as c,defineCustomElement as d,containsOnlyNumbers as e,hasEnoughReadableChars as h,isIcon as i,validateAriaLabelWithLabel as v,watchIconAlign as w};
@@ -1 +1 @@
1
- {"file":"component3.js","mappings":";;;;;;;AAqBA,MAAM,aAAa,GAAG,CAAC,KAAuB,EAAE,SAAoB,EAAE,IAA2C;EAChH,IAAI,QAAQ,CAAC,IAAI,CAAC,EAAE;IACnB,KAAK,CAAC,SAAS,CAAC,GAAG,IAAyB,CAAC;GAC7C;OAAM,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE;IAC7B,KAAK,CAAC,SAAS,CAAC,GAAG;MAClB,IAAI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EAAC,QAAQ,GAAG,CAChB,EACN,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,IAAI,gBAAU,KAAK,EAAC,YAAY,EAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,UAAU,EAAC,EAAE,EAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,GAAI,CAC3I,EACN,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,IAAI,gBAAU,KAAK,EAAC,aAAa,EAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,UAAU,EAAC,EAAE,EAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,GAAI,CAC/I,EACN;GACF;EAwBM,YAAY,CAAC,KAAuB;IAC1C,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;GAC1B;EAGM,gBAAgB,CAAC,KAAe;IACtC,YAAY,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;GACvC;EAGM,aAAa,CAAC,KAAc;IAClC,0BAA0B,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;GACxC;EAEM,iBAAiB;IACvB,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9B,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACtC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;GAChC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/types/props/icon.ts","./src/types/props/label.ts","./src/components/span/component.tsx"],"sourcesContent":["import { Generic } from '@a11y-ui/core';\nimport { ButtonStates } from '../button-link';\nimport { AnyIconFontClass, KoliBriCustomIcon, KoliBriIconProp, KoliBriIconState } from '../icon';\nimport { Alignment } from '.';\nimport { objectObjectHandler, parseJson, watchValidator } from '../../utils/prop.validators';\nimport { isObject, isString, isStyle } from '../../utils/validator';\nimport { Stringified } from '../common';\n\n/* types */\n/** de\n * Setzt den unbestimmten Zustand auf der Checkbox, hat keine Auswirkung auf _checked.\n */\n/** en\n * Puts the checkbox in the indeterminate state, does not change the value of _checked.\n */\nexport type PropIcon = {\n\ticon: Stringified<KoliBriIconProp>;\n};\n\n/* validator */\n\nconst mapCustomIcon = (state: KoliBriIconState, alignment: Alignment, icon?: AnyIconFontClass | KoliBriCustomIcon) => {\n\tif (isObject(icon)) {\n\t\tstate[alignment] = icon as KoliBriCustomIcon;\n\t} else if (isString(icon, 1)) {\n\t\tstate[alignment] = {\n\t\t\ticon: icon as AnyIconFontClass,\n\t\t};\n\t}\n};\n\nexport const mapIconProp2State = (icon: KoliBriIconProp, iconAlign?: Alignment): KoliBriIconState => {\n\tlet state: KoliBriIconState = {};\n\tif (isString(icon, 1)) {\n\t\tswitch (iconAlign) {\n\t\t\tcase 'right':\n\t\t\t\tstate = {\n\t\t\t\t\tright: {\n\t\t\t\t\t\ticon: icon as AnyIconFontClass,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tstate = {\n\t\t\t\t\tleft: {\n\t\t\t\t\t\ticon: icon as AnyIconFontClass,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t}\n\t} else if (typeof icon === 'object' && icon !== null) {\n\t\tmapCustomIcon(state, 'top', icon.top);\n\t\tmapCustomIcon(state, 'right', icon.right);\n\t\tmapCustomIcon(state, 'bottom', icon.bottom);\n\t\tmapCustomIcon(state, 'left', icon.left);\n\t}\n\treturn state;\n};\n\nconst beforePatchIcon = (component: Generic.Element.Component): void => {\n\tif (component.nextState?.has('_icon')) {\n\t\tconst icon = component.nextState?.get('_icon') as KoliBriIconProp;\n\t\tconst iconAlign = (component.nextState?.get('_iconAlign') as Alignment) || (component.state as ButtonStates)._iconAlign;\n\t\tcomponent.nextState?.set('_icon', mapIconProp2State(icon, iconAlign));\n\t} else if (component.nextState?.has('_iconAlign')) {\n\t\tconst lastIconAlign = (component.state as ButtonStates)._iconAlign as Alignment;\n\t\tcomponent.nextState?.set('_icon', {\n\t\t\t[lastIconAlign]: undefined,\n\t\t\t[component.nextState?.get('_iconAlign') as Alignment]: (component.state as ButtonStates)._icon[lastIconAlign],\n\t\t});\n\t}\n};\n\nexport const isIcon = (value?: unknown): boolean =>\n\ttypeof value === 'object' &&\n\tvalue !== null &&\n\t(typeof (value as KoliBriCustomIcon).style === 'undefined' || isStyle((value as KoliBriCustomIcon).style)) &&\n\tisString((value as KoliBriCustomIcon).icon, 1);\n\nexport const validateIcon = (component: Generic.Element.Component, value?: KoliBriIconProp): void => {\n\tobjectObjectHandler(value, () => {\n\t\ttry {\n\t\t\tvalue = parseJson<KoliBriIconProp>(value as string);\n\t\t} catch (e) {\n\t\t\t// value behält den ursprünglichen Wert\n\t\t}\n\t\twatchValidator(\n\t\t\tcomponent,\n\t\t\t'_icon',\n\t\t\t(value): boolean => {\n\t\t\t\treturn (\n\t\t\t\t\tvalue === null ||\n\t\t\t\t\tisString(value, 1) ||\n\t\t\t\t\t(typeof value === 'object' &&\n\t\t\t\t\t\tvalue !== null &&\n\t\t\t\t\t\t(isString(value.left, 1) ||\n\t\t\t\t\t\t\tisIcon(value.left) ||\n\t\t\t\t\t\t\tisString(value.right, 1) ||\n\t\t\t\t\t\t\tisIcon(value.right) ||\n\t\t\t\t\t\t\tisString(value.top, 1) ||\n\t\t\t\t\t\t\tisIcon(value.top) ||\n\t\t\t\t\t\t\tisString(value.bottom, 1) ||\n\t\t\t\t\t\t\tisIcon(value.bottom)))\n\t\t\t\t);\n\t\t\t},\n\t\t\tnew Set(['KoliBriIcon']),\n\t\t\tvalue,\n\t\t\t{\n\t\t\t\thooks: {\n\t\t\t\t\tbeforePatch: (nextValue: unknown, nextState: Map<string, unknown>) => {\n\t\t\t\t\t\tif (nextValue === null) {\n\t\t\t\t\t\t\tnextState.set('_icon', {});\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbeforePatchIcon(component);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\trequired: true,\n\t\t\t}\n\t\t);\n\t});\n};\n\nexport const watchIconAlign = (component: Generic.Element.Component, value?: Alignment): void => {\n\twatchValidator(component, '_iconAlign', (value) => value === 'left' || value === 'right', new Set(['Alignment {left, right, top, bottom}']), value, {\n\t\thooks: {\n\t\t\tbeforePatch: () => {\n\t\t\t\tbeforePatchIcon(component);\n\t\t\t},\n\t\t},\n\t});\n};\n","import { Generic } from '@a11y-ui/core';\nimport { a11yHint } from '../../utils/a11y.tipps';\nimport { watchString, WatchStringOptions } from '../../utils/prop.validators';\nimport { isEmptyOrPrefixOf } from '../../utils/validator';\n\n/* types */\n\n/**\n * This is a regular expression that matches all readable characters.\n */\nconst READABLE_CHARS = /[a-zA-Z0-9äöüÄÖÜß]/g;\n\n/**\n * This is a regular expression that matches only numbers.\n */\nconst ONLY_NUMBERS = /^\\d+$/;\n\n/**\n * This function counts the number of readable characters in a string.\n * @param str The string to count.\n * @returns The number of readable characters in the string.\n */\nfunction countReadableChars(str: string): number {\n\treturn typeof str === 'string' ? str.match(READABLE_CHARS)?.length || 0 : 0;\n}\n\n/**\n * This function checks if a string has at least a certain number of readable characters.\n * @param str The string to check.\n * @param min The minimum number of readable characters.\n * @returns True if the string has at least the minimum number of readable characters, false otherwise.\n */\nexport function hasEnoughReadableChars(str: string, min = 1): boolean {\n\treturn countReadableChars(str) >= min;\n}\n\n/**\n * This function checks if a string contains only numbers.\n * @param str The string to check.\n * @returns True if the string contains only numbers, false otherwise.\n */\nexport function containsOnlyNumbers(str: string): boolean {\n\treturn ONLY_NUMBERS.test(str);\n}\n\n/** de\n * Das Label dient der Beschriftung unterschiedlicher Elemente.\n * - Button -> label text\n * - Heading -> headline text\n * - Input, Select und Textarea -> label text\n * - Summary -> summary text\n * - Table -> caption text\n * - etc.\n *\n * Das Label ist häufig ein Pflichtattribut und kann leer gesetzt werden,\n * wenn man das Label mittels dem Expert-Slot überschreiben will.\n */\n/** en\n * The label is used to label different elements.\n * -Button -> label text\n * -Heading -> headline text\n * -Input, Select and Textarea -> label text\n * -Summary -> summary text\n * -Table -> caption text\n * -Etc.\n *\n * The label is often a mandatory attribute and can be set empty,\n * if you want to overwrite the label using the expert slot.\n */\nexport type PropLabel = {\n\tlabel: string;\n};\n\nexport type LabelProp = Generic.Element.Members<PropLabel, unknown>;\n\n/* validator */\n/**\n * Ein abweichendes Aria-Label muss aus Gründern der Barrierefreiheit für\n * die Sprachsteuerung mit dem Label-Text beginnen.\n */\nconst syncAriaLabelBeforePatch: Generic.Element.NextStateHooksCallback = (_nextValue, nextState, component: Generic.Element.Component, key): void => {\n\tconst ariaLabel: string | undefined = nextState.has('_ariaLabel') ? (nextState.get('_ariaLabel') as string) : (component.state._ariaLabel as string);\n\tif (typeof ariaLabel === 'string') {\n\t\tconst label: string = nextState.has('_label') ? (nextState.get('_label') as string) : (component.state._label as string);\n\t\tif (isEmptyOrPrefixOf(label, ariaLabel) === false) {\n\t\t\tif (key === '_ariaLabel') {\n\t\t\t\tnextState.set('_label', ariaLabel);\n\t\t\t\t// smartSetTimeout(() => ((component as Generic.Element.Component & { _label: string })._label = ariaLabel), 50);\n\t\t\t} else {\n\t\t\t\tnextState.set('_ariaLabel', undefined);\n\t\t\t\t// smartSetTimeout(() => ((component as Generic.Element.Component & { _ariaLabel: string })._ariaLabel = label), 50);\n\t\t\t}\n\t\t\ta11yHint(\n\t\t\t\t`Das abweichende Aria-Label ist nicht barrierefrei. Ein abweichendes Aria-Label muss aus Gründern der Barrierefreiheit für die Sprachsteuerung mit dem Label-Text beginnen.`\n\t\t\t);\n\t\t}\n\t}\n};\n\nconst validateAriaLabel = (component: Generic.Element.Component, value?: string, options: WatchStringOptions = {}): void => {\n\twatchString(component, '_ariaLabel', value, {\n\t\thooks: {\n\t\t\tafterPatch: (value, state, component, key) => {\n\t\t\t\tif (typeof options.hooks?.afterPatch === 'function') {\n\t\t\t\t\toptions.hooks?.afterPatch(value, state, component, key);\n\t\t\t\t}\n\t\t\t\tif (typeof value === 'string' && value.length > 0 && hasEnoughReadableChars(value, 3) === false && containsOnlyNumbers(value) === false) {\n\t\t\t\t\ta11yHint(\n\t\t\t\t\t\t`Ein abweichendes Aria-Label (${value}) ist nicht barrierefrei. Ein abweichendes Aria-Label sollte aus mindestens drei lesbaren Zeichen bestehen.`\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t},\n\t\t\tbeforePatch: options.hooks?.beforePatch,\n\t\t},\n\t});\n};\n\nexport const validateAriaLabelWithLabel = (component: Generic.Element.Component, value?: string): void => {\n\tvalidateAriaLabel(component, value, {\n\t\thooks: {\n\t\t\tbeforePatch: syncAriaLabelBeforePatch,\n\t\t},\n\t});\n};\n\nexport const validateLabel = (component: Generic.Element.Component, value?: string, options: WatchStringOptions = {}): void => {\n\twatchString(component, '_label', value, {\n\t\thooks: {\n\t\t\tafterPatch: (value, state, component, key) => {\n\t\t\t\tif (typeof options.hooks?.afterPatch === 'function') {\n\t\t\t\t\toptions.hooks?.afterPatch(value, state, component, key);\n\t\t\t\t}\n\t\t\t\tif (typeof value === 'string' && hasEnoughReadableChars(value, 3) === false && containsOnlyNumbers(value) === false) {\n\t\t\t\t\ta11yHint(`Ein Label (${value}) ist nicht barrierefrei. Ein Label sollte aus mindestens drei lesbaren Zeichen bestehen.`);\n\t\t\t\t}\n\t\t\t},\n\t\t\tbeforePatch: options.hooks?.beforePatch,\n\t\t},\n\t\trequired: true,\n\t});\n};\n\nexport const validateLabelWithAriaLabel = (component: Generic.Element.Component, value?: string): void => {\n\tvalidateLabel(component, value, {\n\t\thooks: {\n\t\t\tbeforePatch: syncAriaLabelBeforePatch,\n\t\t},\n\t});\n};\n","import { Generic } from '@a11y-ui/core';\nimport { Component, h, Host, JSX, Prop, State, Watch } from '@stencil/core';\nimport { Stringified } from '../../types/common';\n\nimport { KoliBriCustomIcon, KoliBriIconProp } from '../../types/icon';\nimport { watchBoolean } from '../../utils/prop.validators';\nimport { validateIcon } from '../../types/props/icon';\nimport { validateLabelWithAriaLabel } from '../../types/props/label';\n\ntype RequiredProps = {\n\tlabel: string;\n};\ntype OptionalProps = {\n\ticon: Stringified<KoliBriIconProp>;\n\ticonOnly: boolean;\n};\nexport type Props = Generic.Element.Members<RequiredProps, OptionalProps>;\n\ntype RequiredStates = {\n\ticon: {\n\t\ttop?: KoliBriCustomIcon;\n\t\tright?: KoliBriCustomIcon;\n\t\tbottom?: KoliBriCustomIcon;\n\t\tleft?: KoliBriCustomIcon;\n\t};\n\ticonOnly: boolean;\n\tlabel: string;\n};\ntype OptionalStates = unknown;\nexport type States = Generic.Element.Members<RequiredStates, OptionalStates>;\n\n/**\n * @internal\n */\n@Component({\n\ttag: 'kol-span-wc',\n\tshadow: false,\n})\nexport class KolSpanWc implements Generic.Element.ComponentApi<RequiredProps, OptionalProps, RequiredStates, OptionalStates> {\n\tpublic render(): JSX.Element {\n\t\tconst hideExpertSlot = this.state._label.length > 0;\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={{\n\t\t\t\t\t'icon-only': this.state._iconOnly,\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{this.state._icon.top && <kol-icon class=\"icon top\" style={this.state._icon.top.style} _ariaLabel=\"\" _icon={this.state._icon.top.icon} />}\n\t\t\t\t<span>\n\t\t\t\t\t{this.state._icon.left && <kol-icon class=\"icon left\" style={this.state._icon.left.style} _ariaLabel=\"\" _icon={this.state._icon.left.icon} />}\n\t\t\t\t\t{this.state._iconOnly !== true && this.state._label.length > 0 ? <span>{this.state._label}</span> : ''}\n\t\t\t\t\t<span aria-hidden={hideExpertSlot ? 'true' : undefined} hidden={hideExpertSlot}>\n\t\t\t\t\t\t<slot name=\"expert\" />\n\t\t\t\t\t</span>\n\t\t\t\t\t{this.state._icon.right && <kol-icon class=\"icon right\" style={this.state._icon.right.style} _ariaLabel=\"\" _icon={this.state._icon.right.icon} />}\n\t\t\t\t</span>\n\t\t\t\t{this.state._icon.bottom && <kol-icon class=\"icon bottom\" style={this.state._icon.bottom.style} _ariaLabel=\"\" _icon={this.state._icon.bottom.icon} />}\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t/**\n\t * Iconklasse (z.B.: \"codicon codicon-home\")\n\t */\n\t@Prop() public _icon?: Stringified<KoliBriIconProp>;\n\n\t/**\n\t * Gibt an, ob nur das Icon angezeigt wird.\n\t */\n\t@Prop({ reflect: true }) public _iconOnly?: boolean = false;\n\n\t/**\n\t * Setzt den sichtbaren Text des Elements.\n\t */\n\t@Prop() public _label!: string;\n\n\t@State() public state: States = {\n\t\t_icon: {},\n\t\t_iconOnly: false,\n\t\t_label: '…', // ⚠ required\n\t};\n\n\t@Watch('_icon')\n\tpublic validateIcon(value?: KoliBriIconProp): void {\n\t\tvalidateIcon(this, value);\n\t}\n\n\t@Watch('_iconOnly')\n\tpublic validateIconOnly(value?: boolean): void {\n\t\twatchBoolean(this, '_iconOnly', value);\n\t}\n\n\t@Watch('_label')\n\tpublic validateLabel(value?: string): void {\n\t\tvalidateLabelWithAriaLabel(this, value);\n\t}\n\n\tpublic componentWillLoad(): void {\n\t\tthis.validateIcon(this._icon);\n\t\tthis.validateIconOnly(this._iconOnly);\n\t\tthis.validateLabel(this._label);\n\t}\n}\n"],"version":3}
1
+ {"file":"component3.js","mappings":";;;;;;;AAqBA,MAAM,aAAa,GAAG,CAAC,KAAuB,EAAE,SAAoB,EAAE,IAA2C;EAChH,IAAI,QAAQ,CAAC,IAAI,CAAC,EAAE;IACnB,KAAK,CAAC,SAAS,CAAC,GAAG,IAAyB,CAAC;GAC7C;OAAM,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE;IAC7B,KAAK,CAAC,SAAS,CAAC,GAAG;MAClB,IAAI,EAAE,IAAwB;KAC9B,CAAC;GACF;AACF,CAAC,CAAC;AAEK,MAAM,iBAA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G,MAAM,GAAG,SAAS,EAAE,MAAM,EAAE,cAAc,IAC7E,YAAM,IAAI,EAAC,QAAQ,GAAG,CAChB,EACN,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,IAAI,gBAAU,KAAK,EAAC,YAAY,EAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,UAAU,EAAC,EAAE,EAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,GAAI,CAC3I,EACN,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,IAAI,gBAAU,KAAK,EAAC,aAAa,EAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,UAAU,EAAC,EAAE,EAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,GAAI,CAC/I,EACN;GACF;EAwBM,YAAY,CAAC,KAAuB;IAC1C,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;GAC1B;EAGM,gBAAgB,CAAC,KAAe;IACtC,YAAY,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;GACvC;EAGM,aAAa,CAAC,KAAc;IAClC,0BAA0B,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;GACxC;EAEM,iBAAiB;IACvB,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9B,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACtC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;GAChC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/types/props/icon.ts","./src/types/props/label.ts","./src/components/span/component.tsx"],"sourcesContent":["import { Generic } from '@a11y-ui/core';\nimport { ButtonStates } from '../button-link';\nimport { AnyIconFontClass, KoliBriCustomIcon, KoliBriIconProp, KoliBriIconState } from '../icon';\nimport { Alignment } from '.';\nimport { objectObjectHandler, parseJson, watchValidator } from '../../utils/prop.validators';\nimport { isObject, isString, isStyle } from '../../utils/validator';\nimport { Stringified } from '../common';\n\n/* types */\n/** de\n * Setzt den unbestimmten Zustand auf der Checkbox, hat keine Auswirkung auf _checked.\n */\n/** en\n * Puts the checkbox in the indeterminate state, does not change the value of _checked.\n */\nexport type PropIcon = {\n\ticon: Stringified<KoliBriIconProp>;\n};\n\n/* validator */\n\nconst mapCustomIcon = (state: KoliBriIconState, alignment: Alignment, icon?: AnyIconFontClass | KoliBriCustomIcon) => {\n\tif (isObject(icon)) {\n\t\tstate[alignment] = icon as KoliBriCustomIcon;\n\t} else if (isString(icon, 1)) {\n\t\tstate[alignment] = {\n\t\t\ticon: icon as AnyIconFontClass,\n\t\t};\n\t}\n};\n\nexport const mapIconProp2State = (icon: KoliBriIconProp, iconAlign?: Alignment): KoliBriIconState => {\n\tlet state: KoliBriIconState = {};\n\tif (isString(icon, 1)) {\n\t\tswitch (iconAlign) {\n\t\t\tcase 'right':\n\t\t\t\tstate = {\n\t\t\t\t\tright: {\n\t\t\t\t\t\ticon: icon as AnyIconFontClass,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tstate = {\n\t\t\t\t\tleft: {\n\t\t\t\t\t\ticon: icon as AnyIconFontClass,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t}\n\t} else if (typeof icon === 'object' && icon !== null) {\n\t\tmapCustomIcon(state, 'top', icon.top);\n\t\tmapCustomIcon(state, 'right', icon.right);\n\t\tmapCustomIcon(state, 'bottom', icon.bottom);\n\t\tmapCustomIcon(state, 'left', icon.left);\n\t}\n\treturn state;\n};\n\nconst beforePatchIcon = (component: Generic.Element.Component): void => {\n\tif (component.nextState?.has('_icon')) {\n\t\tconst icon = component.nextState?.get('_icon') as KoliBriIconProp;\n\t\tconst iconAlign = (component.nextState?.get('_iconAlign') as Alignment) || (component.state as ButtonStates)._iconAlign;\n\t\tcomponent.nextState?.set('_icon', mapIconProp2State(icon, iconAlign));\n\t} else if (component.nextState?.has('_iconAlign')) {\n\t\tconst lastIconAlign = (component.state as ButtonStates)._iconAlign as Alignment;\n\t\tcomponent.nextState?.set('_icon', {\n\t\t\t[lastIconAlign]: undefined,\n\t\t\t[component.nextState?.get('_iconAlign') as Alignment]: (component.state as ButtonStates)._icon[lastIconAlign],\n\t\t});\n\t}\n};\n\nexport const isIcon = (value?: unknown): boolean =>\n\ttypeof value === 'object' &&\n\tvalue !== null &&\n\t(typeof (value as KoliBriCustomIcon).style === 'undefined' || isStyle((value as KoliBriCustomIcon).style)) &&\n\tisString((value as KoliBriCustomIcon).icon, 1);\n\nexport const validateIcon = (component: Generic.Element.Component, value?: KoliBriIconProp): void => {\n\tobjectObjectHandler(value, () => {\n\t\ttry {\n\t\t\tvalue = parseJson<KoliBriIconProp>(value as string);\n\t\t} catch (e) {\n\t\t\t// value behält den ursprünglichen Wert\n\t\t}\n\t\twatchValidator(\n\t\t\tcomponent,\n\t\t\t'_icon',\n\t\t\t(value): boolean => {\n\t\t\t\treturn (\n\t\t\t\t\tvalue === null ||\n\t\t\t\t\tisString(value, 1) ||\n\t\t\t\t\t(typeof value === 'object' &&\n\t\t\t\t\t\tvalue !== null &&\n\t\t\t\t\t\t(isString(value.left, 1) ||\n\t\t\t\t\t\t\tisIcon(value.left) ||\n\t\t\t\t\t\t\tisString(value.right, 1) ||\n\t\t\t\t\t\t\tisIcon(value.right) ||\n\t\t\t\t\t\t\tisString(value.top, 1) ||\n\t\t\t\t\t\t\tisIcon(value.top) ||\n\t\t\t\t\t\t\tisString(value.bottom, 1) ||\n\t\t\t\t\t\t\tisIcon(value.bottom)))\n\t\t\t\t);\n\t\t\t},\n\t\t\tnew Set(['KoliBriIcon']),\n\t\t\tvalue,\n\t\t\t{\n\t\t\t\thooks: {\n\t\t\t\t\tbeforePatch: (nextValue: unknown, nextState: Map<string, unknown>) => {\n\t\t\t\t\t\tif (nextValue === null) {\n\t\t\t\t\t\t\tnextState.set('_icon', {});\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbeforePatchIcon(component);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\trequired: true,\n\t\t\t}\n\t\t);\n\t});\n};\n\nexport const watchIconAlign = (component: Generic.Element.Component, value?: Alignment): void => {\n\twatchValidator(component, '_iconAlign', (value) => value === 'left' || value === 'right', new Set(['Alignment {left, right, top, bottom}']), value, {\n\t\thooks: {\n\t\t\tbeforePatch: () => {\n\t\t\t\tbeforePatchIcon(component);\n\t\t\t},\n\t\t},\n\t});\n};\n","import { Generic } from '@a11y-ui/core';\nimport { a11yHint, uiUxHint } from '../../utils/a11y.tipps';\nimport { watchString, WatchStringOptions } from '../../utils/prop.validators';\nimport { isEmptyOrPrefixOf } from '../../utils/validator';\n\n/* types */\n\n/**\n * This is a regular expression that matches all readable characters.\n *\n * Interesting: https://stackoverflow.com/questions/150033/regular-expression-to-match-non-english-characters\n */\nconst READABLE_CHARS = /[a-zA-Z0-9äöüÄÖÜß]/g;\n\n/**\n * This is a regular expression that matches only numbers.\n */\nconst ONLY_NUMBERS = /^\\d+$/;\n\n/**\n * This function counts the number of readable characters in a string.\n * @param str The string to count.\n * @returns The number of readable characters in the string.\n */\nfunction countReadableChars(str: string): number {\n\treturn typeof str === 'string' ? str.match(READABLE_CHARS)?.length || 0 : 0;\n}\n\n/**\n * This function checks if a string has at least a certain number of readable characters.\n * @param str The string to check.\n * @param min The minimum number of readable characters.\n * @returns True if the string has at least the minimum number of readable characters, false otherwise.\n */\nexport function hasEnoughReadableChars(str: string, min = 1): boolean {\n\treturn countReadableChars(str) >= min;\n}\n\n/**\n * This function checks if a string contains only numbers.\n * @param str The string to check.\n * @returns True if the string contains only numbers, false otherwise.\n */\nexport function containsOnlyNumbers(str: string): boolean {\n\treturn ONLY_NUMBERS.test(str);\n}\n\n/** de\n * Das Label dient der Beschriftung unterschiedlicher Elemente.\n * - Button -> label text\n * - Heading -> headline text\n * - Input, Select und Textarea -> label text\n * - Summary -> summary text\n * - Table -> caption text\n * - etc.\n *\n * Das Label ist häufig ein Pflichtattribut und kann leer gesetzt werden,\n * wenn man das Label mittels dem Expert-Slot überschreiben will.\n */\n/** en\n * The label is used to label different elements.\n * -Button -> label text\n * -Heading -> headline text\n * -Input, Select and Textarea -> label text\n * -Summary -> summary text\n * -Table -> caption text\n * -Etc.\n *\n * The label is often a mandatory attribute and can be set empty,\n * if you want to overwrite the label using the expert slot.\n */\nexport type PropLabel = {\n\tlabel: string;\n};\n\nexport type LabelProp = Generic.Element.Members<PropLabel, unknown>;\n\n/* validator */\n/**\n * Ein abweichendes Aria-Label muss aus Gründern der Barrierefreiheit für\n * die Sprachsteuerung mit dem Label-Text beginnen.\n */\nconst syncAriaLabelBeforePatch: Generic.Element.NextStateHooksCallback = (_nextValue, nextState, component: Generic.Element.Component, key): void => {\n\tconst ariaLabel: string | undefined = nextState.has('_ariaLabel') ? (nextState.get('_ariaLabel') as string) : (component.state._ariaLabel as string);\n\tif (typeof ariaLabel === 'string') {\n\t\tconst label: string = nextState.has('_label') ? (nextState.get('_label') as string) : (component.state._label as string);\n\t\tif (isEmptyOrPrefixOf(label, ariaLabel) === false) {\n\t\t\tif (key === '_ariaLabel') {\n\t\t\t\tnextState.set('_label', ariaLabel);\n\t\t\t\t// smartSetTimeout(() => ((component as Generic.Element.Component & { _label: string })._label = ariaLabel), 50);\n\t\t\t} else {\n\t\t\t\tnextState.set('_ariaLabel', undefined);\n\t\t\t\t// smartSetTimeout(() => ((component as Generic.Element.Component & { _ariaLabel: string })._ariaLabel = label), 50);\n\t\t\t}\n\t\t\ta11yHint(\n\t\t\t\t`The different Aria label is not barrier-free. A different Aria label must start with the label text for reasons of accessibility for voice control.`\n\t\t\t);\n\t\t}\n\t}\n};\n\nconst validateAriaLabel = (component: Generic.Element.Component, value?: string, options: WatchStringOptions = {}): void => {\n\twatchString(component, '_ariaLabel', value, {\n\t\thooks: {\n\t\t\tafterPatch: (value, state, component, key) => {\n\t\t\t\tif (typeof options.hooks?.afterPatch === 'function') {\n\t\t\t\t\toptions.hooks?.afterPatch(value, state, component, key);\n\t\t\t\t}\n\t\t\t\tif (typeof value === 'string' && value.length > 0 && hasEnoughReadableChars(value, 3) === false && containsOnlyNumbers(value) === false) {\n\t\t\t\t\ta11yHint(`The different aria label (\"${value}\") is not accessible. A different aria label should consist of at least three readable characters.`);\n\t\t\t\t}\n\t\t\t},\n\t\t\tbeforePatch: options.hooks?.beforePatch,\n\t\t},\n\t});\n};\n\nexport const validateAriaLabelWithLabel = (component: Generic.Element.Component, value?: string): void => {\n\tvalidateAriaLabel(component, value, {\n\t\thooks: {\n\t\t\tbeforePatch: syncAriaLabelBeforePatch,\n\t\t},\n\t});\n};\n\nexport const validateLabel = (component: Generic.Element.Component, value?: string, options: WatchStringOptions = {}): void => {\n\twatchString(component, '_label', value, {\n\t\thooks: {\n\t\t\tafterPatch: (value, state, component, key) => {\n\t\t\t\tif (typeof options.hooks?.afterPatch === 'function') {\n\t\t\t\t\toptions.hooks?.afterPatch(value, state, component, key);\n\t\t\t\t}\n\t\t\t\tif (typeof value === 'string' && hasEnoughReadableChars(value, 3) === false && containsOnlyNumbers(value) === false) {\n\t\t\t\t\ta11yHint(`The heading or label (\"${value}\") is not accessible. A label should consist of at least three readable characters.`);\n\t\t\t\t}\n\t\t\t\tif (typeof value === 'string' && value.length > 80) {\n\t\t\t\t\tuiUxHint(`A heading or label should not be longer than 80 characters.`);\n\t\t\t\t}\n\t\t\t},\n\t\t\tbeforePatch: options.hooks?.beforePatch,\n\t\t},\n\t\trequired: true,\n\t});\n};\n\nexport const validateLabelWithAriaLabel = (component: Generic.Element.Component, value?: string): void => {\n\tvalidateLabel(component, value, {\n\t\thooks: {\n\t\t\tbeforePatch: syncAriaLabelBeforePatch,\n\t\t},\n\t});\n};\n","import { Generic } from '@a11y-ui/core';\nimport { Component, h, Host, JSX, Prop, State, Watch } from '@stencil/core';\nimport { Stringified } from '../../types/common';\n\nimport { KoliBriCustomIcon, KoliBriIconProp } from '../../types/icon';\nimport { validateIcon } from '../../types/props/icon';\nimport { validateLabelWithAriaLabel } from '../../types/props/label';\nimport { watchBoolean } from '../../utils/prop.validators';\n\ntype RequiredProps = {\n\tlabel: string;\n};\ntype OptionalProps = {\n\ticon: Stringified<KoliBriIconProp>;\n\ticonOnly: boolean;\n};\nexport type Props = Generic.Element.Members<RequiredProps, OptionalProps>;\n\ntype RequiredStates = {\n\ticon: {\n\t\ttop?: KoliBriCustomIcon;\n\t\tright?: KoliBriCustomIcon;\n\t\tbottom?: KoliBriCustomIcon;\n\t\tleft?: KoliBriCustomIcon;\n\t};\n\ticonOnly: boolean;\n\tlabel: string;\n};\ntype OptionalStates = unknown;\nexport type States = Generic.Element.Members<RequiredStates, OptionalStates>;\n\n/**\n * @internal\n */\n@Component({\n\ttag: 'kol-span-wc',\n\tshadow: false,\n})\nexport class KolSpanWc implements Generic.Element.ComponentApi<RequiredProps, OptionalProps, RequiredStates, OptionalStates> {\n\tpublic render(): JSX.Element {\n\t\tconst hideExpertSlot = this.state._label.length > 0;\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={{\n\t\t\t\t\t'icon-only': this.state._iconOnly,\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{this.state._icon.top && <kol-icon class=\"icon top\" style={this.state._icon.top.style} _ariaLabel=\"\" _icon={this.state._icon.top.icon} />}\n\t\t\t\t<span>\n\t\t\t\t\t{this.state._icon.left && <kol-icon class=\"icon left\" style={this.state._icon.left.style} _ariaLabel=\"\" _icon={this.state._icon.left.icon} />}\n\t\t\t\t\t{this.state._iconOnly !== true && this.state._label.length > 0 ? <span>{this.state._label}</span> : ''}\n\t\t\t\t\t<span aria-hidden={hideExpertSlot ? 'true' : undefined} hidden={hideExpertSlot}>\n\t\t\t\t\t\t<slot name=\"expert\" />\n\t\t\t\t\t</span>\n\t\t\t\t\t{this.state._icon.right && <kol-icon class=\"icon right\" style={this.state._icon.right.style} _ariaLabel=\"\" _icon={this.state._icon.right.icon} />}\n\t\t\t\t</span>\n\t\t\t\t{this.state._icon.bottom && <kol-icon class=\"icon bottom\" style={this.state._icon.bottom.style} _ariaLabel=\"\" _icon={this.state._icon.bottom.icon} />}\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t/**\n\t * Iconklasse (z.B.: \"codicon codicon-home\")\n\t */\n\t@Prop() public _icon?: Stringified<KoliBriIconProp>;\n\n\t/**\n\t * Gibt an, ob nur das Icon angezeigt wird.\n\t */\n\t@Prop({ reflect: true }) public _iconOnly?: boolean = false;\n\n\t/**\n\t * Setzt den sichtbaren Text des Elements.\n\t */\n\t@Prop() public _label!: string;\n\n\t@State() public state: States = {\n\t\t_icon: {},\n\t\t_iconOnly: false,\n\t\t_label: '…', // ⚠ required\n\t};\n\n\t@Watch('_icon')\n\tpublic validateIcon(value?: KoliBriIconProp): void {\n\t\tvalidateIcon(this, value);\n\t}\n\n\t@Watch('_iconOnly')\n\tpublic validateIconOnly(value?: boolean): void {\n\t\twatchBoolean(this, '_iconOnly', value);\n\t}\n\n\t@Watch('_label')\n\tpublic validateLabel(value?: string): void {\n\t\tvalidateLabelWithAriaLabel(this, value);\n\t}\n\n\tpublic componentWillLoad(): void {\n\t\tthis.validateIcon(this._icon);\n\t\tthis.validateIconOnly(this._iconOnly);\n\t\tthis.validateLabel(this._label);\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 as HTMLElement$1,h,Host}from"@stencil/core/internal/client";import{w as watchTooltipAlignment,d as defineCustomElement$1}from"./component.js";import{l as watchBoolean,t as setEventTarget,K as KoliBriDevHelper,u as getExperimalMode,d as devHint,a as watchValidator,n as nonce,v as propagateFocus,x as devWarning,y as mapStringOrBoolean2String,z as mapBoolean2String,w as watchString,A as a11yHintDisabled,q as setState}from"./prop.validators.js";import{v as validateAriaLabelWithLabel,a as validateIcon,w as watchIconAlign,b as validateLabelWithAriaLabel,d as defineCustomElement$2}from"./component3.js";import{v as validateTabIndex}from"./tab-index.js";import{d as defineCustomElement$3}from"./component2.js";const validateAriaExpanded=(t,a)=>{watchBoolean(t,"_ariaExpanded",a)},validateDisabled=(t,a)=>{watchBoolean(t,"_disabled",a)},searchFormElement=t=>{for(getExperimalMode()&&(devHint("↓ Search form element start."),console.log(t));t instanceof HTMLElement&&"FORM"!==t.tagName&&"KOL-FORM"!==t.tagName;)t=t.parentElement instanceof HTMLElement?t.parentElement:t.parentNode instanceof ShadowRoot?t.parentNode.host:null,getExperimalMode()&&console.log(t);return getExperimalMode()&&devHint("↑ Search form element finished."),t},propagateResetEventToForm=(t={})=>{const a=searchFormElement(t.form);if(a instanceof HTMLElement){const t=new Event("reset",{bubbles:!0,cancelable:!0});if("FORM"===a.tagName)setEventTarget(t,a),a.dispatchEvent(t);else if("KOL-FORM"===a.tagName){setEventTarget(t,KoliBriDevHelper.querySelector("form",a));const e=a;"object"==typeof e._on&&null!==typeof e._on&&"function"==typeof e._on.onReset&&e._on.onReset(t)}}},propagateSubmitEventToForm=(t={})=>{const a=searchFormElement(t.form);if(a instanceof HTMLElement){const t=new SubmitEvent("submit",{bubbles:!0,cancelable:!0,submitter:a});if("FORM"===a.tagName)setEventTarget(t,a),a.dispatchEvent(t);else if("KOL-FORM"===a.tagName){setEventTarget(t,KoliBriDevHelper.querySelector("form",a));const e=a;"object"==typeof e._on&&null!==typeof e._on&&"function"==typeof e._on.onSubmit&&e._on.onSubmit(t)}}},watchButtonType=(t,a,e)=>{watchValidator(t,a,(t=>"button"===t||"reset"===t||"submit"===t),new Set(["KoliBriButtonType {button, reset, submit}"]),e)},watchButtonVariant=(t,a,e)=>{watchValidator(t,a,(t=>"primary"===t||"secondary"===t||"normal"===t||"danger"===t||"ghost"===t||"custom"===t),new Set(["KoliBriButtonVariant {primary, secondary, normal, danger, ghost, custom}"]),e,{defaultValue:"normal"})},KolButtonWc=proxyCustomElement(class extends HTMLElement$1{constructor(){super(),this.__registerHost(),this.nonce=nonce(),this.catchRef=t=>{this.ref=t,propagateFocus(this.host,this.ref)},this.onClick=t=>{var a,e;"submit"===this.state._type?propagateSubmitEventToForm({form:this.host,ref:this.ref}):"reset"===this.state._type?propagateResetEventToForm({form:this.host,ref:this.ref}):"function"==typeof(null===(a=this.state._on)||void 0===a?void 0:a.onClick)?(t.stopPropagation(),setEventTarget(t,this.ref),null===(e=this.state._on)||void 0===e||e.onClick(t,this.state._value)):devWarning("There was no button click callback configured! (_on.onClick)")},this._accessKey=void 0,this._ariaControls=void 0,this._ariaCurrent=void 0,this._ariaExpanded=void 0,this._ariaLabel=void 0,this._ariaSelected=void 0,this._customClass=void 0,this._disabled=!1,this._icon=void 0,this._iconAlign=void 0,this._iconOnly=!1,this._id=void 0,this._label=void 0,this._on=void 0,this._role=void 0,this._tabIndex=void 0,this._tooltipAlign="top",this._type="button",this._value=void 0,this._variant="normal",this.state={_icon:{},_label:"…",_on:{},_type:"button",_variant:"normal"}}render(){return h(Host,null,h("button",Object.assign({ref:this.catchRef,accessKey:this.state._accessKey,"aria-controls":this.state._ariaControls,"aria-current":mapStringOrBoolean2String(this.state._ariaCurrent),"aria-expanded":mapBoolean2String(this.state._ariaExpanded),"aria-label":!1===this.state._iconOnly?this.state._ariaLabel:void 0,"aria-labelledby":!0===this.state._iconOnly?this.nonce:void 0,"aria-selected":mapStringOrBoolean2String(this.state._ariaSelected),class:{[this.state._variant]:"custom"!==this.state._variant,[this.state._customClass]:"custom"===this.state._variant&&"string"==typeof this.state._customClass&&this.state._customClass.length>0,"icon-only":!0===this.state._iconOnly},disabled:this.state._disabled,id:this.state._id},this.state._on,{onClick:this.onClick,role:this.state._role,tabIndex:this.state._tabIndex,type:this.state._type}),h("kol-span-wc",{_icon:this._icon,_iconOnly:this._iconOnly,_label:this.state._label},h("slot",{name:"expert",slot:"expert"}))),!0===this.state._iconOnly&&h("kol-tooltip",{"aria-hidden":"true",_align:this.state._tooltipAlign,_id:this.nonce,_label:this.state._ariaLabel||this.state._label}))}validateAccessKey(t){watchString(this,"_accessKey",t)}validateAriaControls(t){watchString(this,"_ariaControls",t)}validateAriaCurrent(t){watchValidator(this,"_ariaControls",(t=>!0===t||"date"===t||"location"===t||"page"===t||"step"===t||"time"===t),new Set(["boolean","String {data, location, page, step, time}"]),t)}validateAriaExpanded(t){validateAriaExpanded(this,t)}validateAriaLabel(t){validateAriaLabelWithLabel(this,t)}validateAriaSelected(t){watchBoolean(this,"_ariaSelected",t)}validateCustomClass(t){watchString(this,"_customClass",t,{defaultValue:void 0})}validateDisabled(t){validateDisabled(this,t),!0===t&&a11yHintDisabled()}validateIcon(t){validateIcon(this,t)}validateIconAlign(t){watchIconAlign(this,t)}validateIconOnly(t){watchBoolean(this,"_iconOnly",t,{defaultValue:!1})}validateId(t){watchString(this,"_id",t)}validateLabel(t){validateLabelWithAriaLabel(this,t)}validateOn(t){"object"==typeof t&&null!==t&&(this.state=Object.assign(Object.assign({},this.state),{_on:t}))}validateRole(t){watchString(this,"_role",t)}validateTabIndex(t){validateTabIndex(this,t)}validateTooltipAlign(t){watchTooltipAlignment(this,"_tooltipAlign",t)}validateType(t){watchButtonType(this,"_type",t)}validateValue(t){setState(this,"_value",t)}validateVariant(t){watchButtonVariant(this,"_variant",t)}componentWillLoad(){this.validateAccessKey(this._accessKey),this.validateAriaControls(this._ariaControls),this.validateAriaCurrent(this._ariaCurrent),this.validateAriaExpanded(this._ariaExpanded),this.validateAriaLabel(this._ariaLabel),this.validateAriaSelected(this._ariaSelected),this.validateCustomClass(this._customClass),this.validateDisabled(this._disabled),this.validateIcon(this._icon),this.validateIconAlign(this._iconAlign),this.validateIconOnly(this._iconOnly),this.validateId(this._id),this.validateLabel(this._label),this.validateOn(this._on),this.validateRole(this._role),this.validateTabIndex(this._tabIndex),this.validateTooltipAlign(this._tooltipAlign),this.validateType(this._type),this.validateValue(this._value),this.validateVariant(this._variant)}get host(){return this}static get watchers(){return{_accessKey:["validateAccessKey"],_ariaControls:["validateAriaControls"],_ariaCurrent:["validateAriaCurrent"],_ariaExpanded:["validateAriaExpanded"],_ariaLabel:["validateAriaLabel"],_ariaSelected:["validateAriaSelected"],_customClass:["validateCustomClass"],_disabled:["validateDisabled"],_icon:["validateIcon"],_iconAlign:["validateIconAlign"],_iconOnly:["validateIconOnly"],_id:["validateId"],_label:["validateLabel"],_on:["validateOn"],_role:["validateRole"],_tabIndex:["validateTabIndex"],_tooltipAlign:["validateTooltipAlign"],_type:["validateType"],_value:["validateValue"],_variant:["validateVariant"]}}},[4,"kol-button-wc",{_accessKey:[1,"_access-key"],_ariaControls:[1,"_aria-controls"],_ariaCurrent:[8,"_aria-current"],_ariaExpanded:[516,"_aria-expanded"],_ariaLabel:[1025,"_aria-label"],_ariaSelected:[516,"_aria-selected"],_customClass:[1,"_custom-class"],_disabled:[516],_icon:[1],_iconAlign:[1,"_icon-align"],_iconOnly:[516,"_icon-only"],_id:[1],_label:[1025],_on:[16],_role:[1],_tabIndex:[2,"_tab-index"],_tooltipAlign:[1,"_tooltip-align"],_type:[1],_value:[16],_variant:[1],state:[32]}]);function defineCustomElement(){if("undefined"==typeof customElements)return;["kol-button-wc","kol-icon","kol-span-wc","kol-tooltip"].forEach((t=>{switch(t){case"kol-button-wc":customElements.get(t)||customElements.define(t,KolButtonWc);break;case"kol-icon":customElements.get(t)||defineCustomElement$3();break;case"kol-span-wc":customElements.get(t)||defineCustomElement$2();break;case"kol-tooltip":customElements.get(t)||defineCustomElement$1()}}))}export{KolButtonWc as K,validateDisabled as a,watchButtonType as b,defineCustomElement as d,propagateSubmitEventToForm as p,validateAriaExpanded as v,watchButtonVariant as w};
4
+ import{proxyCustomElement,HTMLElement as HTMLElement$1,h,Host}from"@stencil/core/internal/client";import{w as watchTooltipAlignment,d as defineCustomElement$1}from"./component.js";import{l as watchBoolean,t as setEventTarget,K as KoliBriDevHelper,v as getExperimalMode,d as devHint,a as watchValidator,n as nonce,x as propagateFocus,y as devWarning,z as mapStringOrBoolean2String,A as mapBoolean2String,w as watchString,B as a11yHintDisabled,q as setState}from"./prop.validators.js";import{v as validateAriaLabelWithLabel,a as validateIcon,w as watchIconAlign,b as validateLabelWithAriaLabel,d as defineCustomElement$2}from"./component3.js";import{v as validateTabIndex}from"./tab-index.js";import{d as defineCustomElement$3}from"./component2.js";const validateAriaExpanded=(t,a)=>{watchBoolean(t,"_ariaExpanded",a)},validateDisabled=(t,a)=>{watchBoolean(t,"_disabled",a)},searchFormElement=t=>{for(getExperimalMode()&&(devHint("↓ Search form element start."),console.log(t));t instanceof HTMLElement&&"FORM"!==t.tagName&&"KOL-FORM"!==t.tagName;)t=t.parentElement instanceof HTMLElement?t.parentElement:t.parentNode instanceof ShadowRoot?t.parentNode.host:null,getExperimalMode()&&console.log(t);return getExperimalMode()&&devHint("↑ Search form element finished."),t},propagateResetEventToForm=(t={})=>{const a=searchFormElement(t.form);if(a instanceof HTMLElement){const t=new Event("reset",{bubbles:!0,cancelable:!0});if("FORM"===a.tagName)setEventTarget(t,a),a.dispatchEvent(t);else if("KOL-FORM"===a.tagName){setEventTarget(t,KoliBriDevHelper.querySelector("form",a));const e=a;"object"==typeof e._on&&null!==typeof e._on&&"function"==typeof e._on.onReset&&e._on.onReset(t)}}},propagateSubmitEventToForm=(t={})=>{const a=searchFormElement(t.form);if(a instanceof HTMLElement){const t=new SubmitEvent("submit",{bubbles:!0,cancelable:!0,submitter:a});if("FORM"===a.tagName)setEventTarget(t,a),a.dispatchEvent(t);else if("KOL-FORM"===a.tagName){setEventTarget(t,KoliBriDevHelper.querySelector("form",a));const e=a;"object"==typeof e._on&&null!==typeof e._on&&"function"==typeof e._on.onSubmit&&e._on.onSubmit(t)}}},watchButtonType=(t,a,e)=>{watchValidator(t,a,(t=>"button"===t||"reset"===t||"submit"===t),new Set(["KoliBriButtonType {button, reset, submit}"]),e)},watchButtonVariant=(t,a,e)=>{watchValidator(t,a,(t=>"primary"===t||"secondary"===t||"normal"===t||"danger"===t||"ghost"===t||"custom"===t),new Set(["KoliBriButtonVariant {primary, secondary, normal, danger, ghost, custom}"]),e,{defaultValue:"normal"})},KolButtonWc=proxyCustomElement(class extends HTMLElement$1{constructor(){super(),this.__registerHost(),this.nonce=nonce(),this.catchRef=t=>{this.ref=t,propagateFocus(this.host,this.ref)},this.onClick=t=>{var a,e;"submit"===this.state._type?propagateSubmitEventToForm({form:this.host,ref:this.ref}):"reset"===this.state._type?propagateResetEventToForm({form:this.host,ref:this.ref}):"function"==typeof(null===(a=this.state._on)||void 0===a?void 0:a.onClick)?(t.stopPropagation(),setEventTarget(t,this.ref),null===(e=this.state._on)||void 0===e||e.onClick(t,this.state._value)):devWarning("There was no button click callback configured! (_on.onClick)")},this._accessKey=void 0,this._ariaControls=void 0,this._ariaCurrent=void 0,this._ariaExpanded=void 0,this._ariaLabel=void 0,this._ariaSelected=void 0,this._customClass=void 0,this._disabled=!1,this._icon=void 0,this._iconAlign=void 0,this._iconOnly=!1,this._id=void 0,this._label=void 0,this._on=void 0,this._role=void 0,this._tabIndex=void 0,this._tooltipAlign="top",this._type="button",this._value=void 0,this._variant="normal",this.state={_icon:{},_label:"…",_on:{},_type:"button",_variant:"normal"}}render(){return h(Host,null,h("button",Object.assign({ref:this.catchRef,accessKey:this.state._accessKey,"aria-controls":this.state._ariaControls,"aria-current":mapStringOrBoolean2String(this.state._ariaCurrent),"aria-expanded":mapBoolean2String(this.state._ariaExpanded),"aria-label":!1===this.state._iconOnly?this.state._ariaLabel:void 0,"aria-labelledby":!0===this.state._iconOnly?this.nonce:void 0,"aria-selected":mapStringOrBoolean2String(this.state._ariaSelected),class:{[this.state._variant]:"custom"!==this.state._variant,[this.state._customClass]:"custom"===this.state._variant&&"string"==typeof this.state._customClass&&this.state._customClass.length>0,"icon-only":!0===this.state._iconOnly},disabled:this.state._disabled,id:this.state._id},this.state._on,{onClick:this.onClick,role:this.state._role,tabIndex:this.state._tabIndex,type:this.state._type}),h("kol-span-wc",{_icon:this._icon,_iconOnly:this._iconOnly,_label:this.state._label},h("slot",{name:"expert",slot:"expert"}))),!0===this.state._iconOnly&&h("kol-tooltip",{"aria-hidden":"true",_align:this.state._tooltipAlign,_id:this.nonce,_label:this.state._ariaLabel||this.state._label}))}validateAccessKey(t){watchString(this,"_accessKey",t)}validateAriaControls(t){watchString(this,"_ariaControls",t)}validateAriaCurrent(t){watchValidator(this,"_ariaControls",(t=>!0===t||"date"===t||"location"===t||"page"===t||"step"===t||"time"===t),new Set(["boolean","String {data, location, page, step, time}"]),t)}validateAriaExpanded(t){validateAriaExpanded(this,t)}validateAriaLabel(t){validateAriaLabelWithLabel(this,t)}validateAriaSelected(t){watchBoolean(this,"_ariaSelected",t)}validateCustomClass(t){watchString(this,"_customClass",t,{defaultValue:void 0})}validateDisabled(t){validateDisabled(this,t),!0===t&&a11yHintDisabled()}validateIcon(t){validateIcon(this,t)}validateIconAlign(t){watchIconAlign(this,t)}validateIconOnly(t){watchBoolean(this,"_iconOnly",t,{defaultValue:!1})}validateId(t){watchString(this,"_id",t)}validateLabel(t){validateLabelWithAriaLabel(this,t)}validateOn(t){"object"==typeof t&&null!==t&&(this.state=Object.assign(Object.assign({},this.state),{_on:t}))}validateRole(t){watchString(this,"_role",t)}validateTabIndex(t){validateTabIndex(this,t)}validateTooltipAlign(t){watchTooltipAlignment(this,"_tooltipAlign",t)}validateType(t){watchButtonType(this,"_type",t)}validateValue(t){setState(this,"_value",t)}validateVariant(t){watchButtonVariant(this,"_variant",t)}componentWillLoad(){this.validateAccessKey(this._accessKey),this.validateAriaControls(this._ariaControls),this.validateAriaCurrent(this._ariaCurrent),this.validateAriaExpanded(this._ariaExpanded),this.validateAriaLabel(this._ariaLabel),this.validateAriaSelected(this._ariaSelected),this.validateCustomClass(this._customClass),this.validateDisabled(this._disabled),this.validateIcon(this._icon),this.validateIconAlign(this._iconAlign),this.validateIconOnly(this._iconOnly),this.validateId(this._id),this.validateLabel(this._label),this.validateOn(this._on),this.validateRole(this._role),this.validateTabIndex(this._tabIndex),this.validateTooltipAlign(this._tooltipAlign),this.validateType(this._type),this.validateValue(this._value),this.validateVariant(this._variant)}get host(){return this}static get watchers(){return{_accessKey:["validateAccessKey"],_ariaControls:["validateAriaControls"],_ariaCurrent:["validateAriaCurrent"],_ariaExpanded:["validateAriaExpanded"],_ariaLabel:["validateAriaLabel"],_ariaSelected:["validateAriaSelected"],_customClass:["validateCustomClass"],_disabled:["validateDisabled"],_icon:["validateIcon"],_iconAlign:["validateIconAlign"],_iconOnly:["validateIconOnly"],_id:["validateId"],_label:["validateLabel"],_on:["validateOn"],_role:["validateRole"],_tabIndex:["validateTabIndex"],_tooltipAlign:["validateTooltipAlign"],_type:["validateType"],_value:["validateValue"],_variant:["validateVariant"]}}},[4,"kol-button-wc",{_accessKey:[1,"_access-key"],_ariaControls:[1,"_aria-controls"],_ariaCurrent:[8,"_aria-current"],_ariaExpanded:[516,"_aria-expanded"],_ariaLabel:[1025,"_aria-label"],_ariaSelected:[516,"_aria-selected"],_customClass:[1,"_custom-class"],_disabled:[516],_icon:[1],_iconAlign:[1,"_icon-align"],_iconOnly:[516,"_icon-only"],_id:[1],_label:[1025],_on:[16],_role:[1],_tabIndex:[2,"_tab-index"],_tooltipAlign:[1,"_tooltip-align"],_type:[1],_value:[16],_variant:[1],state:[32]}]);function defineCustomElement(){if("undefined"==typeof customElements)return;["kol-button-wc","kol-icon","kol-span-wc","kol-tooltip"].forEach((t=>{switch(t){case"kol-button-wc":customElements.get(t)||customElements.define(t,KolButtonWc);break;case"kol-icon":customElements.get(t)||defineCustomElement$3();break;case"kol-span-wc":customElements.get(t)||defineCustomElement$2();break;case"kol-tooltip":customElements.get(t)||defineCustomElement$1()}}))}export{KolButtonWc as K,validateDisabled as a,watchButtonType as b,defineCustomElement as d,propagateSubmitEventToForm as p,validateAriaExpanded as v,watchButtonVariant as w};
@@ -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{a as translate}from"./i18n.js";import{w as watchTooltipAlignment,d as defineCustomElement$1}from"./component.js";import{l as watchBoolean,w as watchString,n as nonce,v as propagateFocus,t as setEventTarget,d as devHint,z as mapBoolean2String,A as a11yHintDisabled,H as scrollBySelector}from"./prop.validators.js";import{v as validateAriaLabelWithLabel,a as validateIcon,w as watchIconAlign,b as validateLabelWithAriaLabel,d as defineCustomElement$2}from"./component3.js";import{v as validateTabIndex}from"./tab-index.js";import{d as defineCustomElement$3}from"./component2.js";import{v as validateAriaCurrent,a as validateAriaSelected}from"./aria-selected.js";const validateDownload=(t,e)=>{"boolean"==typeof e?watchBoolean(t,"_download",e):watchString(t,"_download",e)},validateStealth=(t,e)=>{watchBoolean(t,"_stealth",e)},KolLinkWc=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.nonce=nonce(),this.catchRef=t=>{this.ref=t,propagateFocus(this.host,this.ref)},this.onClick=t=>{var e,a;"function"==typeof(null===(e=this.state._on)||void 0===e?void 0:e.onClick)&&(t.preventDefault(),setEventTarget(t,this.ref),null===(a=this.state._on)||void 0===a||a.onClick(t,this.state._href))},this.getRenderValues=()=>{let t={};"string"==typeof this.state._selector&&(t={role:"link",tabIndex:0,onClick:()=>{scrollBySelector(this.state._selector)},onKeyPress:()=>{scrollBySelector(this.state._selector)}});const e="string"==typeof this.state._target&&"_self"!==this.state._target,a={href:"string"==typeof this.state._href&&this.state._href.length>0?this.state._href:"javascript:void(0)",target:"string"==typeof this.state._target&&this.state._target.length>0?this.state._target:void 0,rel:e?"noopener":void 0};return"image"!==this.state._useCase&&!0!==this.state._iconOnly||"string"==typeof this.state._ariaLabel&&0!==this.state._ariaLabel.length||devHint("[KolLink] Es muss ein Aria-Label gesetzt werden, wenn eine Grafik verlinkt oder der Icon-Only-Modus verwendet wird."),{isExternal:e,tagAttrs:a,goToProps:t}},this._ariaControls=void 0,this._ariaCurrent=void 0,this._ariaExpanded=void 0,this._ariaLabel=void 0,this._ariaSelected=void 0,this._disabled=!1,this._download=!1,this._href=void 0,this._icon=void 0,this._iconAlign=void 0,this._iconOnly=!1,this._label=void 0,this._on=void 0,this._role=void 0,this._selector=void 0,this._stealth=!1,this._tabIndex=void 0,this._target=void 0,this._targetDescription=translate("kol-open-link-in-tab"),this._tooltipAlign="right",this._useCase="text",this.state={_href:"javascript:void(0)",_icon:{},_label:""}}render(){const{isExternal:t,tagAttrs:e,goToProps:a}=this.getRenderValues();return h(Host,null,h("a",Object.assign({ref:this.catchRef},e,{"aria-controls":this.state._ariaControls,"aria-current":this.state._ariaCurrent,"aria-expanded":mapBoolean2String(this.state._ariaExpanded),"aria-labelledby":"image"===this.state._useCase||!0===this.state._iconOnly?this.nonce:void 0,"aria-selected":mapBoolean2String(this.state._ariaSelected),class:{disabled:!0===this.state._disabled,"skip ":!1!==this.state._stealth,"icon-only":!0===this.state._iconOnly,"external-link":t}},this.state._on,{onClick:this.onClick,onKeyPress:this.onClick},a,{role:this.state._role,tabIndex:this.state._tabIndex}),h("kol-span-wc",{_icon:this._icon,_iconOnly:this._iconOnly,_label:this.state._label},h("slot",{name:"expert",slot:"expert"})),t&&h("kol-icon",{class:"external-link-icon",_ariaLabel:this.state._targetDescription,_icon:"codicon codicon-link-external"})),(!0===this.state._iconOnly||"image"===this.state._useCase)&&h("kol-tooltip",{"aria-hidden":"true",_align:this.state._tooltipAlign,_id:this.nonce,_label:this.state._ariaLabel||this.state._label}))}validateAriaControls(t){watchString(this,"_ariaControls",t)}validateAriaCurrent(t){validateAriaCurrent(this,t)}validateAriaExpanded(t){watchBoolean(this,"_ariaExpanded",t)}validateAriaLabel(t){validateAriaLabelWithLabel(this,t)}validateAriaSelected(t){validateAriaSelected(this,t)}validateDisabled(t){watchBoolean(this,"_disabled",t),!0===t&&a11yHintDisabled()}validateDownload(t){validateDownload(this,t)}validateHref(t){watchString(this,"_href",t)}validateIcon(t){validateIcon(this,t)}validateIconAlign(t){watchIconAlign(this,t)}validateIconOnly(t){watchBoolean(this,"_iconOnly",t)}validateLabel(t){validateLabelWithAriaLabel(this,t)}validateOn(t){"object"==typeof t&&null!==t&&Object.prototype.hasOwnProperty.call(t,"onClick")&&"function"==typeof t.onClick&&(this.state=Object.assign(Object.assign({},this.state),{_on:t}))}validateRole(t){watchString(this,"_role",t)}validateSelector(t){watchString(this,"_selector",t)}validateStealth(t){validateStealth(this,t)}validateTabIndex(t){validateTabIndex(this,t)}validateTarget(t){watchString(this,"_target",t)}validateTargetDescription(t){watchString(this,"_targetDescription",t)}validateTooltipAlign(t){watchTooltipAlignment(this,"_tooltipAlign",t)}validateUseCase(t){"string"==typeof t&&(this.state=Object.assign(Object.assign({},this.state),{_useCase:t}))}componentWillLoad(){this.validateAriaControls(this._ariaControls),this.validateAriaCurrent(this._ariaCurrent),this.validateAriaExpanded(this._ariaExpanded),this.validateAriaLabel(this._ariaLabel),this.validateAriaSelected(this._ariaSelected),this.validateDisabled(this._disabled),this.validateDownload(this._download),this.validateHref(this._href),this.validateIcon(this._icon),this.validateIconAlign(this._iconAlign),this.validateIconOnly(this._iconOnly),this.validateLabel(this._label),this.validateOn(this._on),this.validateRole(this._role),this.validateSelector(this._selector),this.validateStealth(this._stealth),this.validateTabIndex(this._tabIndex),this.validateTarget(this._target),this.validateTargetDescription(this._targetDescription),this.validateTooltipAlign(this._tooltipAlign),this.validateUseCase(this._useCase)}get host(){return this}static get watchers(){return{_ariaControls:["validateAriaControls"],_ariaCurrent:["validateAriaCurrent"],_ariaExpanded:["validateAriaExpanded"],_ariaLabel:["validateAriaLabel"],_ariaSelected:["validateAriaSelected"],_disabled:["validateDisabled"],_download:["validateDownload"],_href:["validateHref"],_icon:["validateIcon"],_iconAlign:["validateIconAlign"],_iconOnly:["validateIconOnly"],_label:["validateLabel"],_on:["validateOn"],_role:["validateRole"],_selector:["validateSelector"],_stealth:["validateStealth"],_tabIndex:["validateTabIndex"],_target:["validateTarget"],_targetDescription:["validateTargetDescription"],_tooltipAlign:["validateTooltipAlign"],_useCase:["validateUseCase"]}}},[4,"kol-link-wc",{_ariaControls:[1,"_aria-controls"],_ariaCurrent:[8,"_aria-current"],_ariaExpanded:[516,"_aria-expanded"],_ariaLabel:[1,"_aria-label"],_ariaSelected:[516,"_aria-selected"],_disabled:[516],_download:[8],_href:[1],_icon:[1],_iconAlign:[1,"_icon-align"],_iconOnly:[516,"_icon-only"],_label:[1025],_on:[16],_role:[1],_selector:[1],_stealth:[516],_tabIndex:[2,"_tab-index"],_target:[1],_targetDescription:[1,"_target-description"],_tooltipAlign:[1,"_tooltip-align"],_useCase:[1,"_use-case"],state:[32]}]);function defineCustomElement(){if("undefined"==typeof customElements)return;["kol-link-wc","kol-icon","kol-span-wc","kol-tooltip"].forEach((t=>{switch(t){case"kol-link-wc":customElements.get(t)||customElements.define(t,KolLinkWc);break;case"kol-icon":customElements.get(t)||defineCustomElement$3();break;case"kol-span-wc":customElements.get(t)||defineCustomElement$2();break;case"kol-tooltip":customElements.get(t)||defineCustomElement$1()}}))}export{KolLinkWc as K,defineCustomElement as d};
4
+ import{proxyCustomElement,HTMLElement,h,Host}from"@stencil/core/internal/client";import{a as translate}from"./i18n.js";import{w as watchTooltipAlignment,d as defineCustomElement$1}from"./component.js";import{l as watchBoolean,w as watchString,n as nonce,x as propagateFocus,t as setEventTarget,d as devHint,A as mapBoolean2String,B as a11yHintDisabled,I as scrollBySelector}from"./prop.validators.js";import{v as validateAriaLabelWithLabel,a as validateIcon,w as watchIconAlign,b as validateLabelWithAriaLabel,d as defineCustomElement$2}from"./component3.js";import{v as validateTabIndex}from"./tab-index.js";import{d as defineCustomElement$3}from"./component2.js";import{v as validateAriaCurrent,a as validateAriaSelected}from"./aria-selected.js";const validateDownload=(t,e)=>{"boolean"==typeof e?watchBoolean(t,"_download",e):watchString(t,"_download",e)},validateStealth=(t,e)=>{watchBoolean(t,"_stealth",e)},KolLinkWc=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.nonce=nonce(),this.catchRef=t=>{this.ref=t,propagateFocus(this.host,this.ref)},this.onClick=t=>{var e,a;"function"==typeof(null===(e=this.state._on)||void 0===e?void 0:e.onClick)&&(t.preventDefault(),setEventTarget(t,this.ref),null===(a=this.state._on)||void 0===a||a.onClick(t,this.state._href))},this.getRenderValues=()=>{let t={};"string"==typeof this.state._selector&&(t={role:"link",tabIndex:0,onClick:()=>{scrollBySelector(this.state._selector)},onKeyPress:()=>{scrollBySelector(this.state._selector)}});const e="string"==typeof this.state._target&&"_self"!==this.state._target,a={href:"string"==typeof this.state._href&&this.state._href.length>0?this.state._href:"javascript:void(0)",target:"string"==typeof this.state._target&&this.state._target.length>0?this.state._target:void 0,rel:e?"noopener":void 0};return"image"!==this.state._useCase&&!0!==this.state._iconOnly||"string"==typeof this.state._ariaLabel&&0!==this.state._ariaLabel.length||devHint("[KolLink] Es muss ein Aria-Label gesetzt werden, wenn eine Grafik verlinkt oder der Icon-Only-Modus verwendet wird."),{isExternal:e,tagAttrs:a,goToProps:t}},this._ariaControls=void 0,this._ariaCurrent=void 0,this._ariaExpanded=void 0,this._ariaLabel=void 0,this._ariaSelected=void 0,this._disabled=!1,this._download=!1,this._href=void 0,this._icon=void 0,this._iconAlign=void 0,this._iconOnly=!1,this._label=void 0,this._on=void 0,this._role=void 0,this._selector=void 0,this._stealth=!1,this._tabIndex=void 0,this._target=void 0,this._targetDescription=translate("kol-open-link-in-tab"),this._tooltipAlign="right",this._useCase="text",this.state={_href:"javascript:void(0)",_icon:{},_label:""}}render(){const{isExternal:t,tagAttrs:e,goToProps:a}=this.getRenderValues();return h(Host,null,h("a",Object.assign({ref:this.catchRef},e,{"aria-controls":this.state._ariaControls,"aria-current":this.state._ariaCurrent,"aria-expanded":mapBoolean2String(this.state._ariaExpanded),"aria-labelledby":"image"===this.state._useCase||!0===this.state._iconOnly?this.nonce:void 0,"aria-selected":mapBoolean2String(this.state._ariaSelected),class:{disabled:!0===this.state._disabled,"skip ":!1!==this.state._stealth,"icon-only":!0===this.state._iconOnly,"external-link":t}},this.state._on,{onClick:this.onClick,onKeyPress:this.onClick},a,{role:this.state._role,tabIndex:this.state._tabIndex}),h("kol-span-wc",{_icon:this._icon,_iconOnly:this._iconOnly,_label:this.state._label},h("slot",{name:"expert",slot:"expert"})),t&&h("kol-icon",{class:"external-link-icon",_ariaLabel:this.state._targetDescription,_icon:"codicon codicon-link-external"})),(!0===this.state._iconOnly||"image"===this.state._useCase)&&h("kol-tooltip",{"aria-hidden":"true",_align:this.state._tooltipAlign,_id:this.nonce,_label:this.state._ariaLabel||this.state._label}))}validateAriaControls(t){watchString(this,"_ariaControls",t)}validateAriaCurrent(t){validateAriaCurrent(this,t)}validateAriaExpanded(t){watchBoolean(this,"_ariaExpanded",t)}validateAriaLabel(t){validateAriaLabelWithLabel(this,t)}validateAriaSelected(t){validateAriaSelected(this,t)}validateDisabled(t){watchBoolean(this,"_disabled",t),!0===t&&a11yHintDisabled()}validateDownload(t){validateDownload(this,t)}validateHref(t){watchString(this,"_href",t)}validateIcon(t){validateIcon(this,t)}validateIconAlign(t){watchIconAlign(this,t)}validateIconOnly(t){watchBoolean(this,"_iconOnly",t)}validateLabel(t){validateLabelWithAriaLabel(this,t)}validateOn(t){"object"==typeof t&&null!==t&&Object.prototype.hasOwnProperty.call(t,"onClick")&&"function"==typeof t.onClick&&(this.state=Object.assign(Object.assign({},this.state),{_on:t}))}validateRole(t){watchString(this,"_role",t)}validateSelector(t){watchString(this,"_selector",t)}validateStealth(t){validateStealth(this,t)}validateTabIndex(t){validateTabIndex(this,t)}validateTarget(t){watchString(this,"_target",t)}validateTargetDescription(t){watchString(this,"_targetDescription",t)}validateTooltipAlign(t){watchTooltipAlignment(this,"_tooltipAlign",t)}validateUseCase(t){"string"==typeof t&&(this.state=Object.assign(Object.assign({},this.state),{_useCase:t}))}componentWillLoad(){this.validateAriaControls(this._ariaControls),this.validateAriaCurrent(this._ariaCurrent),this.validateAriaExpanded(this._ariaExpanded),this.validateAriaLabel(this._ariaLabel),this.validateAriaSelected(this._ariaSelected),this.validateDisabled(this._disabled),this.validateDownload(this._download),this.validateHref(this._href),this.validateIcon(this._icon),this.validateIconAlign(this._iconAlign),this.validateIconOnly(this._iconOnly),this.validateLabel(this._label),this.validateOn(this._on),this.validateRole(this._role),this.validateSelector(this._selector),this.validateStealth(this._stealth),this.validateTabIndex(this._tabIndex),this.validateTarget(this._target),this.validateTargetDescription(this._targetDescription),this.validateTooltipAlign(this._tooltipAlign),this.validateUseCase(this._useCase)}get host(){return this}static get watchers(){return{_ariaControls:["validateAriaControls"],_ariaCurrent:["validateAriaCurrent"],_ariaExpanded:["validateAriaExpanded"],_ariaLabel:["validateAriaLabel"],_ariaSelected:["validateAriaSelected"],_disabled:["validateDisabled"],_download:["validateDownload"],_href:["validateHref"],_icon:["validateIcon"],_iconAlign:["validateIconAlign"],_iconOnly:["validateIconOnly"],_label:["validateLabel"],_on:["validateOn"],_role:["validateRole"],_selector:["validateSelector"],_stealth:["validateStealth"],_tabIndex:["validateTabIndex"],_target:["validateTarget"],_targetDescription:["validateTargetDescription"],_tooltipAlign:["validateTooltipAlign"],_useCase:["validateUseCase"]}}},[4,"kol-link-wc",{_ariaControls:[1,"_aria-controls"],_ariaCurrent:[8,"_aria-current"],_ariaExpanded:[516,"_aria-expanded"],_ariaLabel:[1,"_aria-label"],_ariaSelected:[516,"_aria-selected"],_disabled:[516],_download:[8],_href:[1],_icon:[1],_iconAlign:[1,"_icon-align"],_iconOnly:[516,"_icon-only"],_label:[1025],_on:[16],_role:[1],_selector:[1],_stealth:[516],_tabIndex:[2,"_tab-index"],_target:[1],_targetDescription:[1,"_target-description"],_tooltipAlign:[1,"_tooltip-align"],_useCase:[1,"_use-case"],state:[32]}]);function defineCustomElement(){if("undefined"==typeof customElements)return;["kol-link-wc","kol-icon","kol-span-wc","kol-tooltip"].forEach((t=>{switch(t){case"kol-link-wc":customElements.get(t)||customElements.define(t,KolLinkWc);break;case"kol-icon":customElements.get(t)||defineCustomElement$3();break;case"kol-span-wc":customElements.get(t)||defineCustomElement$2();break;case"kol-tooltip":customElements.get(t)||defineCustomElement$1()}}))}export{KolLinkWc as K,defineCustomElement as d};
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * KoliBri - The accessible HTML-Standard
3
3
  */
4
- import{l as watchBoolean,u as getExperimalMode,w as watchString,A as a11yHintDisabled,d as devHint,q as setState,o as objectObjectHandler,e as parseJson}from"./prop.validators.js";import{v as validateTabIndex}from"./tab-index.js";const getRenderStates=t=>{const e="string"==typeof t._error&&t._error.length>0&&!0===t._touched,n="string"==typeof t._hint&&t._hint.length>0,o=[];return!0===e&&o.push(`${t._id}-error`),!0===n&&o.push(`${t._id}-hint`),{hasError:e,hasHint:n,ariaDescribedBy:o}},EXPERIMENTAL_MODE=getExperimalMode();class ControlledInputController{constructor(t,e,n){var o,i,s,a,h;if(this.syncFormAssociatedName=()=>{var t;EXPERIMENTAL_MODE&&(null===(t=this.formAssociated)||void 0===t||t.setAttribute("name",this.component.state._name||this.component.state._id))},this.setFormAssociatedValue=(t=null)=>{var e;EXPERIMENTAL_MODE&&(null===(e=this.formAssociated)||void 0===e||e.setAttribute("value",t))},this.component=t,this.name=e,this.host=n,EXPERIMENTAL_MODE){this.formAssociated=document.createElement("input"),this.formAssociated.setAttribute("type","hidden");const t=(null===(o=this.host)||void 0===o?void 0:o.children)||[];for(let e=0;e<t.length;e++)"INPUT"===(null===(i=this.host)||void 0===i?void 0:i.children[e].tagName)&&(null===(s=this.host)||void 0===s||s.removeChild(null===(a=this.host)||void 0===a?void 0:a.children[e]));null===(h=this.host)||void 0===h||h.appendChild(this.formAssociated)}}validateAlert(t){watchBoolean(this.component,"_alert",t)}validateTouched(t){watchBoolean(this.component,"_touched",t)}componentWillLoad(){this.validateAlert(this.component._alert),this.validateTouched(this.component._touched)}}class InputController extends ControlledInputController{constructor(t,e,n){super(t,e,n),this.hideLabel=!1,this.valueChangeListeners=[],this.onFacade={onBlur:this.onBlur.bind(this),onChange:this.onChange.bind(this),onClick:this.onClick.bind(this),onFocus:this.onFocus.bind(this)},this.component=t}validateAccessKey(t){watchString(this.component,"_accessKey",t)}validateAdjustHeight(t){watchBoolean(this.component,"_adjustHeight",t)}validateDisabled(t){watchBoolean(this.component,"_disabled",t),!0===t&&a11yHintDisabled()}validateError(t){watchString(this.component,"_error",t)}validateHideLabel(t){watchBoolean(this.component,"_hideLabel",t)}validateHint(t){watchString(this.component,"_hint",t)}validateId(t){watchString(this.component,"_id",t,{hooks:{afterPatch:this.syncFormAssociatedName},minLength:1}),""!==t&&void 0!==t||devHint("Eine eindeutige ID an den Eingabefeldern ist nicht zwingend erforderlich, könnte aber für die E2E-Tests relevant sein.")}validateName(t){watchString(this.component,"_name",t,{hooks:{afterPatch:this.syncFormAssociatedName}}),void 0===t&&devHint("Ein Name an den Eingabefeldern ist nicht zwingend erforderlich, kann aber für die Autocomplete-Funktion und für das statische Versenden des Eingabefeldes relevant sein.")}validateOn(t){"object"==typeof t&&setState(this.component,"_on",t)}validateSmartButton(t){objectObjectHandler(t,(()=>{try{t=parseJson(t)}catch(t){}setState(this.component,"_smartButton",t)}))}validateTabIndex(t){validateTabIndex(this.component,t)}componentWillLoad(){super.componentWillLoad(),this.validateAccessKey(this.component._accessKey),this.validateAdjustHeight(this.component._adjustHeight),this.validateError(this.component._error),this.validateDisabled(this.component._disabled),this.validateHideLabel(this.component._hideLabel),this.validateHint(this.component._hint),this.validateId(this.component._id),this.validateName(this.component._name),this.validateSmartButton(this.component._smartButton),this.validateOn(this.component._on),this.validateTabIndex(this.component._tabIndex),this.syncFormAssociatedName()}onBlur(t){var e;this.component._alert=!0,this.component._touched=!0,"function"==typeof(null===(e=this.component._on)||void 0===e?void 0:e.onBlur)&&this.component._on.onBlur(t)}onChange(t){var e;const n=t.target.value;this.setFormAssociatedValue(n),this.valueChangeListeners.forEach((t=>t(n))),"function"==typeof(null===(e=this.component._on)||void 0===e?void 0:e.onChange)&&this.component._on.onChange(t,n)}onClick(t){var e;"function"==typeof(null===(e=this.component._on)||void 0===e?void 0:e.onClick)&&this.component._on.onClick(t)}onFocus(t){var e;this.component._alert=!0,"function"==typeof(null===(e=this.component._on)||void 0===e?void 0:e.onFocus)&&this.component._on.onFocus(t)}setValue(t,e){var n;this.setFormAssociatedValue(e),"function"==typeof(null===(n=this.component._on)||void 0===n?void 0:n.onChange)&&this.component._on.onChange(t,e)}addValueChangeListener(t){this.valueChangeListeners.push(t)}}export{InputController as I,getRenderStates as g};
4
+ import{l as watchBoolean,v as getExperimalMode,w as watchString,B as a11yHintDisabled,d as devHint,q as setState,o as objectObjectHandler,e as parseJson}from"./prop.validators.js";import{v as validateTabIndex}from"./tab-index.js";const getRenderStates=t=>{const e="string"==typeof t._error&&t._error.length>0&&!0===t._touched,n="string"==typeof t._hint&&t._hint.length>0,o=[];return!0===e&&o.push(`${t._id}-error`),!0===n&&o.push(`${t._id}-hint`),{hasError:e,hasHint:n,ariaDescribedBy:o}},EXPERIMENTAL_MODE=getExperimalMode();class ControlledInputController{constructor(t,e,n){var o,i,s,a,h;if(this.syncFormAssociatedName=()=>{var t;EXPERIMENTAL_MODE&&(null===(t=this.formAssociated)||void 0===t||t.setAttribute("name",this.component.state._name||this.component.state._id))},this.setFormAssociatedValue=(t=null)=>{var e;EXPERIMENTAL_MODE&&(null===(e=this.formAssociated)||void 0===e||e.setAttribute("value",t))},this.component=t,this.name=e,this.host=n,EXPERIMENTAL_MODE){this.formAssociated=document.createElement("input"),this.formAssociated.setAttribute("type","hidden");const t=(null===(o=this.host)||void 0===o?void 0:o.children)||[];for(let e=0;e<t.length;e++)"INPUT"===(null===(i=this.host)||void 0===i?void 0:i.children[e].tagName)&&(null===(s=this.host)||void 0===s||s.removeChild(null===(a=this.host)||void 0===a?void 0:a.children[e]));null===(h=this.host)||void 0===h||h.appendChild(this.formAssociated)}}validateAlert(t){watchBoolean(this.component,"_alert",t)}validateTouched(t){watchBoolean(this.component,"_touched",t)}componentWillLoad(){this.validateAlert(this.component._alert),this.validateTouched(this.component._touched)}}class InputController extends ControlledInputController{constructor(t,e,n){super(t,e,n),this.hideLabel=!1,this.valueChangeListeners=[],this.onFacade={onBlur:this.onBlur.bind(this),onChange:this.onChange.bind(this),onClick:this.onClick.bind(this),onFocus:this.onFocus.bind(this)},this.component=t}validateAccessKey(t){watchString(this.component,"_accessKey",t)}validateAdjustHeight(t){watchBoolean(this.component,"_adjustHeight",t)}validateDisabled(t){watchBoolean(this.component,"_disabled",t),!0===t&&a11yHintDisabled()}validateError(t){watchString(this.component,"_error",t)}validateHideLabel(t){watchBoolean(this.component,"_hideLabel",t)}validateHint(t){watchString(this.component,"_hint",t)}validateId(t){watchString(this.component,"_id",t,{hooks:{afterPatch:this.syncFormAssociatedName},minLength:1}),""!==t&&void 0!==t||devHint("Eine eindeutige ID an den Eingabefeldern ist nicht zwingend erforderlich, könnte aber für die E2E-Tests relevant sein.")}validateName(t){watchString(this.component,"_name",t,{hooks:{afterPatch:this.syncFormAssociatedName}}),void 0===t&&devHint("Ein Name an den Eingabefeldern ist nicht zwingend erforderlich, kann aber für die Autocomplete-Funktion und für das statische Versenden des Eingabefeldes relevant sein.")}validateOn(t){"object"==typeof t&&setState(this.component,"_on",t)}validateSmartButton(t){objectObjectHandler(t,(()=>{try{t=parseJson(t)}catch(t){}setState(this.component,"_smartButton",t)}))}validateTabIndex(t){validateTabIndex(this.component,t)}componentWillLoad(){super.componentWillLoad(),this.validateAccessKey(this.component._accessKey),this.validateAdjustHeight(this.component._adjustHeight),this.validateError(this.component._error),this.validateDisabled(this.component._disabled),this.validateHideLabel(this.component._hideLabel),this.validateHint(this.component._hint),this.validateId(this.component._id),this.validateName(this.component._name),this.validateSmartButton(this.component._smartButton),this.validateOn(this.component._on),this.validateTabIndex(this.component._tabIndex),this.syncFormAssociatedName()}onBlur(t){var e;this.component._alert=!0,this.component._touched=!0,"function"==typeof(null===(e=this.component._on)||void 0===e?void 0:e.onBlur)&&this.component._on.onBlur(t)}onChange(t){var e;const n=t.target.value;this.setFormAssociatedValue(n),this.valueChangeListeners.forEach((t=>t(n))),"function"==typeof(null===(e=this.component._on)||void 0===e?void 0:e.onChange)&&this.component._on.onChange(t,n)}onClick(t){var e;"function"==typeof(null===(e=this.component._on)||void 0===e?void 0:e.onClick)&&this.component._on.onClick(t)}onFocus(t){var e;this.component._alert=!0,"function"==typeof(null===(e=this.component._on)||void 0===e?void 0:e.onFocus)&&this.component._on.onFocus(t)}setValue(t,e){var n;this.setFormAssociatedValue(e),"function"==typeof(null===(n=this.component._on)||void 0===n?void 0:n.onChange)&&this.component._on.onChange(t,e)}addValueChangeListener(t){this.valueChangeListeners.push(t)}}export{InputController as I,getRenderStates as g};
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * KoliBri - The accessible HTML-Standard
3
3
  */
4
- import{a as watchValidator,F as watchJsonArrayString,J as mapString2Unknown,q as setState,M as STATE_CHANGE_EVENT,l as watchBoolean}from"./prop.validators.js";import{I as InputController}from"./controller.js";const fillKeyOptionMap=(t,e,o="")=>{e.forEach(((e,a)=>{const i=`${o}-${a}`;"object"==typeof e&&null!==e&&"string"==typeof e.label&&e.label.length>0&&(Array.isArray(e.options)?fillKeyOptionMap(t,e.options,i):t.set(i,e))}))};class InputCheckboxRadioController extends InputController{constructor(t,e,o){super(t,e,o),this.component=t}validateRequired(t){watchBoolean(this.component,"_required",t)}componentWillLoad(){super.componentWillLoad(),this.validateRequired(this.component._required)}}class InputRadioController extends InputCheckboxRadioController{constructor(t,e,o){super(t,e,o),this.keyOptionMap=new Map,this.getOptionByKey=t=>this.keyOptionMap.get(t),this.isValueInOptions=(t,e)=>void 0!==e.find((e=>e.value===t)),this.beforePatchListValue=(t,e)=>{const o=e.has("_list")?e.get("_list"):this.component.state._list;if(Array.isArray(o)&&o.length>0){this.keyOptionMap.clear(),fillKeyOptionMap(this.keyOptionMap,o);const t=e.has("_value")?e.get("_value"):this.component.state._value;if(!1===this.isValueInOptions(t,o)){const t=o[0].value;e.set("_value",t),this.onStateChange()}}},this.component=t}validateOrientation(t){watchValidator(this.component,"_orientation",(t=>"horizontal"===t||"vertical"===t),new Set(["Orientation {horizontal, vertical}"]),t,{defaultValue:"vertical"})}validateList(t){watchJsonArrayString(this.component,"_list",(t=>"object"==typeof t&&null!==t&&"string"==typeof t.label&&t.label.length>0),t,void 0,{hooks:{beforePatch:this.beforePatchListValue}})}validateValue(t){t=mapString2Unknown(t),t=Array.isArray(t)?t[0]:t,setState(this.component,"_value",t,{beforePatch:this.beforePatchListValue}),this.setFormAssociatedValue(this.component._value)}componentWillLoad(t){super.componentWillLoad(),this.onStateChange=()=>{if("function"==typeof t){const e=setTimeout((()=>{clearTimeout(e),t(STATE_CHANGE_EVENT)}))}},this.validateOrientation(this.component._orientation),this.validateList(this.component._list),this.validateValue(this.component._value)}}export{InputCheckboxRadioController as I,InputRadioController as a,fillKeyOptionMap as f};
4
+ import{a as watchValidator,G as watchJsonArrayString,M as mapString2Unknown,q as setState,N as STATE_CHANGE_EVENT,l as watchBoolean}from"./prop.validators.js";import{I as InputController}from"./controller.js";const fillKeyOptionMap=(t,e,o="")=>{e.forEach(((e,a)=>{const i=`${o}-${a}`;"object"==typeof e&&null!==e&&"string"==typeof e.label&&e.label.length>0&&(Array.isArray(e.options)?fillKeyOptionMap(t,e.options,i):t.set(i,e))}))};class InputCheckboxRadioController extends InputController{constructor(t,e,o){super(t,e,o),this.component=t}validateRequired(t){watchBoolean(this.component,"_required",t)}componentWillLoad(){super.componentWillLoad(),this.validateRequired(this.component._required)}}class InputRadioController extends InputCheckboxRadioController{constructor(t,e,o){super(t,e,o),this.keyOptionMap=new Map,this.getOptionByKey=t=>this.keyOptionMap.get(t),this.isValueInOptions=(t,e)=>void 0!==e.find((e=>e.value===t)),this.beforePatchListValue=(t,e)=>{const o=e.has("_list")?e.get("_list"):this.component.state._list;if(Array.isArray(o)&&o.length>0){this.keyOptionMap.clear(),fillKeyOptionMap(this.keyOptionMap,o);const t=e.has("_value")?e.get("_value"):this.component.state._value;if(!1===this.isValueInOptions(t,o)){const t=o[0].value;e.set("_value",t),this.onStateChange()}}},this.component=t}validateOrientation(t){watchValidator(this.component,"_orientation",(t=>"horizontal"===t||"vertical"===t),new Set(["Orientation {horizontal, vertical}"]),t,{defaultValue:"vertical"})}validateList(t){watchJsonArrayString(this.component,"_list",(t=>"object"==typeof t&&null!==t&&"string"==typeof t.label&&t.label.length>0),t,void 0,{hooks:{beforePatch:this.beforePatchListValue}})}validateValue(t){t=mapString2Unknown(t),t=Array.isArray(t)?t[0]:t,setState(this.component,"_value",t,{beforePatch:this.beforePatchListValue}),this.setFormAssociatedValue(this.component._value)}componentWillLoad(t){super.componentWillLoad(),this.onStateChange=()=>{if("function"==typeof t){const e=setTimeout((()=>{clearTimeout(e),t(STATE_CHANGE_EVENT)}))}},this.validateOrientation(this.component._orientation),this.validateList(this.component._list),this.validateValue(this.component._value)}}export{InputCheckboxRadioController as I,InputRadioController as a,fillKeyOptionMap as f};
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * KoliBri - The accessible HTML-Standard
3
3
  */
4
- import{a as watchValidator,F as watchJsonArrayString}from"./prop.validators.js";import{I as InputPasswordController}from"./controller4.js";class InputTextEmailController extends InputPasswordController{constructor(t,o,r){super(t,o,r),this.component=t}validateList(t){watchJsonArrayString(this.component,"_list",(t=>"string"==typeof t),t)}componentWillLoad(){super.componentWillLoad(),this.validateList(this.component._list)}}class InputTextController extends InputTextEmailController{constructor(t,o,r){super(t,o,r),this.hasError=!1,this.hasList=!1,this.component=t}validateType(t){watchValidator(this.component,"_type",(t=>"string"==typeof t&&("text"===t||"search"===t||"url"===t||"tel"===t)),new Set(["String {text, search, url, tel}"]),t)}componentWillLoad(){super.componentWillLoad(),this.validateType(this.component._type)}}export{InputTextEmailController as I,InputTextController as a};
4
+ import{a as watchValidator,G as watchJsonArrayString}from"./prop.validators.js";import{I as InputPasswordController}from"./controller4.js";class InputTextEmailController extends InputPasswordController{constructor(t,o,r){super(t,o,r),this.component=t}validateList(t){watchJsonArrayString(this.component,"_list",(t=>"string"==typeof t),t)}componentWillLoad(){super.componentWillLoad(),this.validateList(this.component._list)}}class InputTextController extends InputTextEmailController{constructor(t,o,r){super(t,o,r),this.hasError=!1,this.hasList=!1,this.component=t}validateType(t){watchValidator(this.component,"_type",(t=>"string"==typeof t&&("text"===t||"search"===t||"url"===t||"tel"===t)),new Set(["String {text, search, url, tel}"]),t)}componentWillLoad(){super.componentWillLoad(),this.validateType(this.component._type)}}export{InputTextEmailController as I,InputTextController as a};
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * KoliBri - The accessible HTML-Standard
3
3
  */
4
- import{d as devHint,a as watchValidator,l as watchBoolean,B as watchNumber,w as watchString}from"./prop.validators.js";import{I as InputIconController}from"./controller-icon.js";class InputPasswordController extends InputIconController{constructor(e,t,a){super(e,t,a),this.handleHiddenLabelAndRequired=()=>{!0===this.component.state._hideLabel&&!0===this.component.state._required?(devHint("[KolInput*] Wenn man das Label ausblendet, dann kann der sehende Nutzer:in nicht mehr erkennen, ob die Eingabe erforderlich ist."),this.hideLabel=!1):this.hideLabel=!0===this.component.state._hideLabel},this.component=e}validateAutoComplete(e){watchValidator(this.component,"_autoComplete",(e=>"string"==typeof e&&("on"===e||"off"===e)),new Set(["on | off"]),e)}validateHideLabel(e){watchBoolean(this.component,"_hideLabel",e,{hooks:{afterPatch:this.handleHiddenLabelAndRequired}})}validateMaxLength(e){watchNumber(this.component,"_maxLength",e,{min:0})}validatePattern(e){watchString(this.component,"_pattern",e)}validatePlaceholder(e){watchString(this.component,"_placeholder",e)}validateReadOnly(e){watchBoolean(this.component,"_readOnly",e)}validateRequired(e){watchBoolean(this.component,"_required",e,{hooks:{afterPatch:this.handleHiddenLabelAndRequired}})}validateSize(e){watchNumber(this.component,"_size",e,{min:1})}validateValue(e){watchString(this.component,"_value",e)}componentWillLoad(){super.componentWillLoad(),this.validateAutoComplete(this.component._autoComplete),this.validateMaxLength(this.component._maxLength),this.validatePattern(this.component._pattern),this.validatePlaceholder(this.component._placeholder),this.validateReadOnly(this.component._readOnly),this.validateRequired(this.component._required),this.validateSize(this.component._size),this.validateValue(this.component._value)}onBlur(e){this.component.state=Object.assign(Object.assign({},this.component.state),{_placeholder:this.placeholderCache}),this.placeholderCache=void 0,super.onBlur(e)}onFocus(e){this.placeholderCache=this.component.state._placeholder,this.component.state=Object.assign(Object.assign({},this.component.state),{_placeholder:void 0}),super.onFocus(e)}}export{InputPasswordController as I};
4
+ import{d as devHint,a as watchValidator,l as watchBoolean,C as watchNumber,w as watchString}from"./prop.validators.js";import{I as InputIconController}from"./controller-icon.js";class InputPasswordController extends InputIconController{constructor(e,t,a){super(e,t,a),this.handleHiddenLabelAndRequired=()=>{!0===this.component.state._hideLabel&&!0===this.component.state._required?(devHint("[KolInput*] Wenn man das Label ausblendet, dann kann der sehende Nutzer:in nicht mehr erkennen, ob die Eingabe erforderlich ist."),this.hideLabel=!1):this.hideLabel=!0===this.component.state._hideLabel},this.component=e}validateAutoComplete(e){watchValidator(this.component,"_autoComplete",(e=>"string"==typeof e&&("on"===e||"off"===e)),new Set(["on | off"]),e)}validateHideLabel(e){watchBoolean(this.component,"_hideLabel",e,{hooks:{afterPatch:this.handleHiddenLabelAndRequired}})}validateMaxLength(e){watchNumber(this.component,"_maxLength",e,{min:0})}validatePattern(e){watchString(this.component,"_pattern",e)}validatePlaceholder(e){watchString(this.component,"_placeholder",e)}validateReadOnly(e){watchBoolean(this.component,"_readOnly",e)}validateRequired(e){watchBoolean(this.component,"_required",e,{hooks:{afterPatch:this.handleHiddenLabelAndRequired}})}validateSize(e){watchNumber(this.component,"_size",e,{min:1})}validateValue(e){watchString(this.component,"_value",e)}componentWillLoad(){super.componentWillLoad(),this.validateAutoComplete(this.component._autoComplete),this.validateMaxLength(this.component._maxLength),this.validatePattern(this.component._pattern),this.validatePlaceholder(this.component._placeholder),this.validateReadOnly(this.component._readOnly),this.validateRequired(this.component._required),this.validateSize(this.component._size),this.validateValue(this.component._value)}onBlur(e){this.component.state=Object.assign(Object.assign({},this.component.state),{_placeholder:this.placeholderCache}),this.placeholderCache=void 0,super.onBlur(e)}onFocus(e){this.placeholderCache=this.component.state._placeholder,this.component.state=Object.assign(Object.assign({},this.component.state),{_placeholder:void 0}),super.onFocus(e)}}export{InputPasswordController as I};
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * KoliBri - The accessible HTML-Standard
3
3
  */
4
- import{Q as initKoliBri,R as getDevMode,U as renderDevAdvice,b as getDocument,L as Log,u as getExperimalMode,V as getColorContrastAnalysis,W as KoliBriUtils,X as koliBriA11yColorContrast,Y as KoliBri,P as koliBriQuerySelector,Z as koliBriQuerySelectorAll,_ as koliBriQuerySelectorColors,e as parseJson,$ as stringifyJson}from"./prop.validators.js";function prototypeKoliBri(o,e){try{Object.defineProperty(KoliBri,o,{get:function(){return e}})}catch(e){Log.debug(`KoliBri property ${o} is already bind.`)}}const metaModeLog=(o,e)=>Log.debug(`${o} ${e?"":"not "}activated`),initialize=()=>{if(initKoliBri(),getDevMode()){renderDevAdvice(),prototypeKoliBri("a11yColorContrast",koliBriA11yColorContrast),prototypeKoliBri("querySelector",koliBriQuerySelector),prototypeKoliBri("querySelectorAll",koliBriQuerySelectorAll),prototypeKoliBri("querySelectorColors",koliBriQuerySelectorColors),prototypeKoliBri("utils",(function(){return KoliBriUtils})),prototypeKoliBri("parseJson",parseJson),prototypeKoliBri("stringifyJson",stringifyJson);const o=getDocument().body,e=getDocument().createElement("svg");if(e.setAttribute("aria-label","KoliBri-DevTools"),e.setAttribute("xmlns","http://www.w3.org/2000/svg"),e.setAttribute("role","toolbar"),e.setAttribute("style","position: fixed;color: black;font-size: 200%;bottom: 0.25rem;right: 0.25rem;"),e.innerHTML='<svg\n xmlns="http://www.w3.org/2000/svg"\n width="50"\n height="50"\n viewBox="0 0 600 600"\n>\n <path d="M353 322L213 304V434L353 322Z" fill="#047" />\n <path d="M209 564V304L149 434L209 564Z" fill="#047" />\n <path d="M357 316L417 250L361 210L275 244L357 316Z" fill="#047" />\n <path d="M353 318L35 36L213 300L353 318Z" fill="#047" />\n <path d="M329 218L237 92L250 222L272 241L329 218Z" fill="#047" />\n <path d="M391 286L565 272L421 252L391 286Z" fill="#047" />\n</svg>',getDocument().body.appendChild(e),metaModeLog("Development mode",getDevMode()),metaModeLog("Experimental mode",getExperimalMode()),metaModeLog("Color contrast analysis",getColorContrastAnalysis()),getColorContrastAnalysis()){const e=setTimeout((()=>{clearTimeout(e),setInterval((()=>{KoliBriUtils.queryHtmlElementColors(getDocument().createElement("div"),koliBriA11yColorContrast(o),!1,!1)}),1e4)}),2500)}}};export{initialize};
4
+ import{R as initKoliBri,U as getDevMode,V as renderDevAdvice,b as getDocument,L as Log,v as getExperimalMode,W as getColorContrastAnalysis,X as KoliBriUtils,Y as koliBriA11yColorContrast,Z as KoliBri,Q as koliBriQuerySelector,_ as koliBriQuerySelectorAll,$ as koliBriQuerySelectorColors,e as parseJson,a0 as stringifyJson}from"./prop.validators.js";function prototypeKoliBri(o,e){try{Object.defineProperty(KoliBri,o,{get:function(){return e}})}catch(e){Log.debug(`KoliBri property ${o} is already bind.`)}}const metaModeLog=(o,e)=>Log.debug(`${o} ${e?"":"not "}activated`),initialize=()=>{if(initKoliBri(),getDevMode()){renderDevAdvice(),prototypeKoliBri("a11yColorContrast",koliBriA11yColorContrast),prototypeKoliBri("querySelector",koliBriQuerySelector),prototypeKoliBri("querySelectorAll",koliBriQuerySelectorAll),prototypeKoliBri("querySelectorColors",koliBriQuerySelectorColors),prototypeKoliBri("utils",(function(){return KoliBriUtils})),prototypeKoliBri("parseJson",parseJson),prototypeKoliBri("stringifyJson",stringifyJson);const o=getDocument().body,e=getDocument().createElement("svg");if(e.setAttribute("aria-label","KoliBri-DevTools"),e.setAttribute("xmlns","http://www.w3.org/2000/svg"),e.setAttribute("role","toolbar"),e.setAttribute("style","position: fixed;color: black;font-size: 200%;bottom: 0.25rem;right: 0.25rem;"),e.innerHTML='<svg\n xmlns="http://www.w3.org/2000/svg"\n width="50"\n height="50"\n viewBox="0 0 600 600"\n>\n <path d="M353 322L213 304V434L353 322Z" fill="#047" />\n <path d="M209 564V304L149 434L209 564Z" fill="#047" />\n <path d="M357 316L417 250L361 210L275 244L357 316Z" fill="#047" />\n <path d="M353 318L35 36L213 300L353 318Z" fill="#047" />\n <path d="M329 218L237 92L250 222L272 241L329 218Z" fill="#047" />\n <path d="M391 286L565 272L421 252L391 286Z" fill="#047" />\n</svg>',getDocument().body.appendChild(e),metaModeLog("Development mode",getDevMode()),metaModeLog("Experimental mode",getExperimalMode()),metaModeLog("Color contrast analysis",getColorContrastAnalysis()),getColorContrastAnalysis()){const e=setTimeout((()=>{clearTimeout(e),setInterval((()=>{KoliBriUtils.queryHtmlElementColors(getDocument().createElement("div"),koliBriA11yColorContrast(o),!1,!1)}),1e4)}),2500)}}};export{initialize};