@public-ui/components 4.5.0-rc.7 → 4.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (499) hide show
  1. package/assets/kolicons/kolicons.eot +0 -0
  2. package/assets/kolicons/kolicons.ttf +0 -0
  3. package/assets/kolicons/kolicons.woff +0 -0
  4. package/assets/kolicons/kolicons.woff2 +0 -0
  5. package/assets/kolicons/style.css +6 -6
  6. package/custom-elements.json +1 -1
  7. package/dist/cjs/{Heading-d30Feghg.js → Heading-CFe7VL6f.js} +3 -3
  8. package/dist/cjs/{Heading-d30Feghg.js.map → Heading-CFe7VL6f.js.map} +1 -1
  9. package/dist/cjs/{api-C8ZkIyx7.js → api-kNqVTMqf.js} +8 -8
  10. package/dist/cjs/{api-C8ZkIyx7.js.map → api-kNqVTMqf.js.map} +1 -1
  11. package/dist/cjs/{api-CRSjJs8P.js → api-n8IopicV.js} +12 -12
  12. package/dist/cjs/{api-CRSjJs8P.js.map → api-n8IopicV.js.map} +1 -1
  13. package/dist/cjs/{app-globals-B6wB2cXk.js → app-globals-KA8S4Kl9.js} +4 -4
  14. package/dist/cjs/{app-globals-B6wB2cXk.js.map → app-globals-KA8S4Kl9.js.map} +1 -1
  15. package/dist/cjs/{base-LmwA5h1k.js → base-B07RMt0-.js} +5 -5
  16. package/dist/cjs/{base-LmwA5h1k.js.map → base-B07RMt0-.js.map} +1 -1
  17. package/dist/cjs/{base-C3MDHUog.js → base-Bw44v5Il.js} +4 -4
  18. package/dist/cjs/{base-C3MDHUog.js.map → base-Bw44v5Il.js.map} +1 -1
  19. package/dist/cjs/{base-DgUZAiNc.js → base-DGx5qxja.js} +16 -16
  20. package/dist/cjs/{base-DgUZAiNc.js.map → base-DGx5qxja.js.map} +1 -1
  21. package/dist/cjs/{base-CyQnTxi6.js → base-Og0FJHrO.js} +4 -4
  22. package/dist/cjs/{base-CyQnTxi6.js.map → base-Og0FJHrO.js.map} +1 -1
  23. package/dist/cjs/{base-web-component-C-CwpVZw.js → base-web-component-9l9kVbBw.js} +5 -5
  24. package/dist/cjs/{base-web-component-C-CwpVZw.js.map → base-web-component-9l9kVbBw.js.map} +1 -1
  25. package/dist/cjs/{base-web-component-d2k3Mc9P.js → base-web-component-MA3Hmf00.js} +7 -7
  26. package/dist/cjs/{base-web-component-d2k3Mc9P.js.map → base-web-component-MA3Hmf00.js.map} +1 -1
  27. package/dist/cjs/{behavior-C-BdOoSN.js → behavior-CddJDVDz.js} +3 -3
  28. package/dist/cjs/{behavior-C-BdOoSN.js.map → behavior-CddJDVDz.js.map} +1 -1
  29. package/dist/cjs/{component-D2kI8uwF.js → component-8M23HGR8.js} +5 -5
  30. package/dist/cjs/{component-D2kI8uwF.js.map → component-8M23HGR8.js.map} +1 -1
  31. package/dist/cjs/{component-BIz_gAas.js → component-B1t_MP4V.js} +7 -7
  32. package/dist/cjs/{component-BIz_gAas.js.map → component-B1t_MP4V.js.map} +1 -1
  33. package/dist/cjs/{component-B1kzY-J5.js → component-B92xMW4N.js} +4 -4
  34. package/dist/cjs/{component-B1kzY-J5.js.map → component-B92xMW4N.js.map} +1 -1
  35. package/dist/cjs/{component-BairlFHi.js → component-BGdViN9u.js} +3 -3
  36. package/dist/cjs/{component-BairlFHi.js.map → component-BGdViN9u.js.map} +1 -1
  37. package/dist/cjs/{component-B1zMXSkZ.js → component-BZKcc9iM.js} +5 -5
  38. package/dist/cjs/{component-B1zMXSkZ.js.map → component-BZKcc9iM.js.map} +1 -1
  39. package/dist/cjs/{component-CmyhDJ0r.js → component-C8WDkeRK.js} +3 -3
  40. package/dist/cjs/{component-CmyhDJ0r.js.map → component-C8WDkeRK.js.map} +1 -1
  41. package/dist/cjs/{component-BHDnSaCH.js → component-CESKZB76.js} +3 -3
  42. package/dist/cjs/{component-BHDnSaCH.js.map → component-CESKZB76.js.map} +1 -1
  43. package/dist/cjs/{component-D33lYKYT.js → component-CQRRF1jV.js} +3 -3
  44. package/dist/cjs/{component-D33lYKYT.js.map → component-CQRRF1jV.js.map} +1 -1
  45. package/dist/cjs/{component-DaAVlb5U.js → component-D7IXFVHR.js} +4 -4
  46. package/dist/cjs/{component-DaAVlb5U.js.map → component-D7IXFVHR.js.map} +1 -1
  47. package/dist/cjs/{component-DITtC2F9.js → component-Dzx6SM5K.js} +7 -7
  48. package/dist/cjs/{component-DITtC2F9.js.map → component-Dzx6SM5K.js.map} +1 -1
  49. package/dist/cjs/{component-_jdRFw0Y.js → component-K9JCKLMC.js} +4 -4
  50. package/dist/cjs/{component-_jdRFw0Y.js.map → component-K9JCKLMC.js.map} +1 -1
  51. package/dist/cjs/{component-KT0MKnL5.js → component-inHq7qad.js} +5 -5
  52. package/dist/cjs/{component-KT0MKnL5.js.map → component-inHq7qad.js.map} +1 -1
  53. package/dist/cjs/{dev.utils-B1bWgxrQ.js → dev.utils-CIsKrkDZ.js} +3 -3
  54. package/dist/cjs/{dev.utils-B1bWgxrQ.js.map → dev.utils-CIsKrkDZ.js.map} +1 -1
  55. package/dist/cjs/{devtools-DlcIXbRm.js → devtools-DEHRYx1J.js} +4 -4
  56. package/dist/cjs/{devtools-DlcIXbRm.js.map → devtools-DEHRYx1J.js.map} +1 -1
  57. package/dist/cjs/{field-control-D0lryu2-.js → field-control-gMhh35Xz.js} +8 -8
  58. package/dist/cjs/{field-control-D0lryu2-.js.map → field-control-gMhh35Xz.js.map} +1 -1
  59. package/dist/cjs/{group-DIGY9sM6.js → group-eUk7QHkH.js} +5 -5
  60. package/dist/cjs/{group-DIGY9sM6.js.map → group-eUk7QHkH.js.map} +1 -1
  61. package/dist/cjs/{index-qcrGfEY6.js → index-CjTDipy9.js} +3 -3
  62. package/dist/cjs/index-CjTDipy9.js.map +1 -0
  63. package/dist/cjs/{input-BjNjOSo5.js → input-D1hDtOel.js} +5 -5
  64. package/dist/cjs/{input-BjNjOSo5.js.map → input-D1hDtOel.js.map} +1 -1
  65. package/dist/cjs/{input-container-DghKiuUH.js → input-container-C9wW0ZFj.js} +7 -7
  66. package/dist/cjs/{input-container-DghKiuUH.js.map → input-container-C9wW0ZFj.js.map} +1 -1
  67. package/dist/cjs/{item-BMB6SaVm.js → item-C6TgTi4l.js} +4 -4
  68. package/dist/cjs/{item-BMB6SaVm.js.map → item-C6TgTi4l.js.map} +1 -1
  69. package/dist/cjs/{item-BKz8BDg2.js → item-D2TI8Iec.js} +4 -4
  70. package/dist/cjs/{item-BKz8BDg2.js.map → item-D2TI8Iec.js.map} +1 -1
  71. package/dist/cjs/{item-DdnTb-BP.js → item-DoAJ6Wmk.js} +3 -3
  72. package/dist/cjs/{item-DdnTb-BP.js.map → item-DoAJ6Wmk.js.map} +1 -1
  73. package/dist/cjs/{item-CFojolE7.js → item-se0KVw5y.js} +8 -8
  74. package/dist/cjs/{item-CFojolE7.js.map → item-se0KVw5y.js.map} +1 -1
  75. package/dist/cjs/kol-abbr.cjs.entry.js +2 -2
  76. package/dist/cjs/kol-accordion.cjs.entry.js +7 -7
  77. package/dist/cjs/kol-alert.cjs.entry.js +11 -11
  78. package/dist/cjs/kol-avatar.cjs.entry.js +1 -1
  79. package/dist/cjs/kol-badge.cjs.entry.js +10 -10
  80. package/dist/cjs/kol-breadcrumb.cjs.entry.js +9 -9
  81. package/dist/cjs/kol-button-link.cjs.entry.js +10 -10
  82. package/dist/cjs/kol-button.cjs.entry.js +10 -10
  83. package/dist/cjs/kol-card.cjs.entry.js +11 -11
  84. package/dist/cjs/kol-click-button.cjs.entry.js +2 -2
  85. package/dist/cjs/kol-combobox.cjs.entry.js +18 -18
  86. package/dist/cjs/kol-details.cjs.entry.js +7 -7
  87. package/dist/cjs/kol-dialog.cjs.entry.js +13 -13
  88. package/dist/cjs/kol-drawer.cjs.entry.js +12 -12
  89. package/dist/cjs/kol-form.cjs.entry.js +12 -12
  90. package/dist/cjs/kol-heading.cjs.entry.js +1 -1
  91. package/dist/cjs/kol-icon.cjs.entry.js +3 -3
  92. package/dist/cjs/kol-image.cjs.entry.js +1 -1
  93. package/dist/cjs/kol-input-checkbox.cjs.entry.js +17 -17
  94. package/dist/cjs/kol-input-color.cjs.entry.js +18 -18
  95. package/dist/cjs/kol-input-date.cjs.entry.js +18 -18
  96. package/dist/cjs/kol-input-email.cjs.entry.js +20 -20
  97. package/dist/cjs/kol-input-file.cjs.entry.js +17 -17
  98. package/dist/cjs/kol-input-number.cjs.entry.js +18 -18
  99. package/dist/cjs/kol-input-password.cjs.entry.js +20 -20
  100. package/dist/cjs/kol-input-radio.cjs.entry.js +17 -17
  101. package/dist/cjs/kol-input-range.cjs.entry.js +18 -18
  102. package/dist/cjs/kol-input-text.cjs.entry.js +20 -20
  103. package/dist/cjs/kol-kolibri.cjs.entry.js +2 -2
  104. package/dist/cjs/kol-link-button.cjs.entry.js +10 -10
  105. package/dist/cjs/kol-link.cjs.entry.js +10 -10
  106. package/dist/cjs/kol-meter.cjs.entry.js +1 -1
  107. package/dist/cjs/kol-modal.cjs.entry.js +13 -13
  108. package/dist/cjs/kol-nav.cjs.entry.js +13 -13
  109. package/dist/cjs/kol-pagination.cjs.entry.js +18 -18
  110. package/dist/cjs/kol-popover-button.cjs.entry.js +11 -11
  111. package/dist/cjs/kol-progress.cjs.entry.js +1 -1
  112. package/dist/cjs/kol-quote.cjs.entry.js +1 -1
  113. package/dist/cjs/kol-select.cjs.entry.js +17 -17
  114. package/dist/cjs/kol-single-select.cjs.entry.js +18 -18
  115. package/dist/cjs/kol-skeleton.cjs.entry.js +2 -2
  116. package/dist/cjs/kol-skip-nav.cjs.entry.js +9 -9
  117. package/dist/cjs/kol-spin.cjs.entry.js +3 -3
  118. package/dist/cjs/kol-split-button.cjs.entry.js +12 -12
  119. package/dist/cjs/kol-table-stateful.cjs.entry.js +25 -25
  120. package/dist/cjs/kol-table-stateless.cjs.entry.js +19 -19
  121. package/dist/cjs/kol-tabs.cjs.entry.js +9 -9
  122. package/dist/cjs/kol-textarea.cjs.entry.js +17 -17
  123. package/dist/cjs/kol-toast-container.cjs.entry.js +11 -11
  124. package/dist/cjs/kol-toolbar.cjs.entry.js +11 -11
  125. package/dist/cjs/kol-tooltip-wc.cjs.entry.js +4 -4
  126. package/dist/cjs/kol-tree-item.cjs.entry.js +9 -9
  127. package/dist/cjs/kol-tree.cjs.entry.js +1 -1
  128. package/dist/cjs/kol-version.cjs.entry.js +9 -9
  129. package/dist/cjs/kolibri.cjs.js +2 -2
  130. package/dist/cjs/loader.cjs.js +2 -2
  131. package/dist/cjs/{resolve-props-pAyNSZMT.js → resolve-props-JqnN_2MF.js} +3 -3
  132. package/dist/cjs/{resolve-props-pAyNSZMT.js.map → resolve-props-JqnN_2MF.js.map} +1 -1
  133. package/dist/cjs/{scroll-lock-CNwobwd2.js → scroll-lock-CxkP-oj1.js} +3 -3
  134. package/dist/cjs/{scroll-lock-CNwobwd2.js.map → scroll-lock-CxkP-oj1.js.map} +1 -1
  135. package/dist/cjs/{suggestions-D4TMMZSv.js → suggestions-BDfdREI5.js} +4 -4
  136. package/dist/cjs/{suggestions-D4TMMZSv.js.map → suggestions-BDfdREI5.js.map} +1 -1
  137. package/dist/cjs/test-component.cjs.entry.js +1 -1
  138. package/dist/cjs/{toggle-handler-mIB8gvse.js → toggle-handler-Bm0e15f-.js} +5 -5
  139. package/dist/cjs/{toggle-handler-mIB8gvse.js.map → toggle-handler-Bm0e15f-.js.map} +1 -1
  140. package/dist/collection/components/accordion/style.css +2 -2
  141. package/dist/collection/components/alert/style.css +2 -2
  142. package/dist/collection/components/badge/style.css +2 -2
  143. package/dist/collection/components/breadcrumb/style.css +2 -2
  144. package/dist/collection/components/button/style.css +2 -2
  145. package/dist/collection/components/button-link/style.css +2 -2
  146. package/dist/collection/components/card/style.css +2 -2
  147. package/dist/collection/components/combobox/style.css +2 -2
  148. package/dist/collection/components/details/style.css +2 -2
  149. package/dist/collection/components/dialog/style.css +2 -2
  150. package/dist/collection/components/drawer/style.css +2 -2
  151. package/dist/collection/components/form/style.css +2 -2
  152. package/dist/collection/components/icon/style.css +2 -2
  153. package/dist/collection/components/input-checkbox/style.css +2 -2
  154. package/dist/collection/components/input-color/style.css +2 -2
  155. package/dist/collection/components/input-date/style.css +2 -2
  156. package/dist/collection/components/input-email/style.css +2 -2
  157. package/dist/collection/components/input-file/style.css +2 -2
  158. package/dist/collection/components/input-number/style.css +2 -2
  159. package/dist/collection/components/input-password/style.css +2 -2
  160. package/dist/collection/components/input-radio/style.css +2 -2
  161. package/dist/collection/components/input-range/style.css +2 -2
  162. package/dist/collection/components/input-text/style.css +2 -2
  163. package/dist/collection/components/link/style.css +2 -2
  164. package/dist/collection/components/link-button/style.css +2 -2
  165. package/dist/collection/components/modal/style.css +2 -2
  166. package/dist/collection/components/nav/style.css +2 -2
  167. package/dist/collection/components/pagination/style.css +2 -2
  168. package/dist/collection/components/popover-button/style.css +2 -2
  169. package/dist/collection/components/select/style.css +2 -2
  170. package/dist/collection/components/single-select/style.css +2 -2
  171. package/dist/collection/components/skip-nav/style.css +2 -2
  172. package/dist/collection/components/split-button/style.css +2 -2
  173. package/dist/collection/components/table-stateful/style.css +2 -2
  174. package/dist/collection/components/table-stateless/style.css +2 -2
  175. package/dist/collection/components/tabs/style.css +2 -2
  176. package/dist/collection/components/textarea/style.css +2 -2
  177. package/dist/collection/components/toaster/style.css +2 -2
  178. package/dist/collection/components/toolbar/style.css +2 -2
  179. package/dist/collection/components/tree-item/style.css +2 -2
  180. package/dist/collection/components/version/style.css +2 -2
  181. package/dist/components/kol-accordion.js +1 -1
  182. package/dist/components/kol-alert.js +1 -1
  183. package/dist/components/kol-badge.js +1 -1
  184. package/dist/components/kol-breadcrumb.js +1 -1
  185. package/dist/components/kol-button-link.js +1 -1
  186. package/dist/components/kol-button.js +1 -1
  187. package/dist/components/kol-card.js +1 -1
  188. package/dist/components/kol-combobox.js +1 -1
  189. package/dist/components/kol-details.js +1 -1
  190. package/dist/components/kol-dialog.js +1 -1
  191. package/dist/components/kol-drawer.js +1 -1
  192. package/dist/components/kol-form.js +1 -1
  193. package/dist/components/kol-icon.js +1 -1
  194. package/dist/components/kol-input-checkbox.js +1 -1
  195. package/dist/components/kol-input-color.js +1 -1
  196. package/dist/components/kol-input-date.js +1 -1
  197. package/dist/components/kol-input-email.js +1 -1
  198. package/dist/components/kol-input-file.js +1 -1
  199. package/dist/components/kol-input-number.js +1 -1
  200. package/dist/components/kol-input-password.js +1 -1
  201. package/dist/components/kol-input-radio.js +1 -1
  202. package/dist/components/kol-input-range.js +1 -1
  203. package/dist/components/kol-input-text.js +1 -1
  204. package/dist/components/kol-link-button.js +1 -1
  205. package/dist/components/kol-link.js +1 -1
  206. package/dist/components/kol-modal.js +1 -1
  207. package/dist/components/kol-nav.js +1 -1
  208. package/dist/components/kol-pagination.js +1 -1
  209. package/dist/components/kol-popover-button.js +1 -1
  210. package/dist/components/kol-select.js +1 -1
  211. package/dist/components/kol-single-select.js +1 -1
  212. package/dist/components/kol-skip-nav.js +1 -1
  213. package/dist/components/kol-split-button.js +1 -1
  214. package/dist/components/kol-table-stateful.js +1 -1
  215. package/dist/components/kol-table-stateless.js +1 -1
  216. package/dist/components/kol-tabs.js +1 -1
  217. package/dist/components/kol-textarea.js +1 -1
  218. package/dist/components/kol-toast-container.js +1 -1
  219. package/dist/components/kol-toolbar.js +1 -1
  220. package/dist/components/kol-tree-item.js +1 -1
  221. package/dist/components/kol-version.js +1 -1
  222. package/dist/esm/{Heading-NHB1reiQ.js → Heading-DYEtnAIe.js} +3 -3
  223. package/dist/{kolibri/Heading-NHB1reiQ.js.map → esm/Heading-DYEtnAIe.js.map} +1 -1
  224. package/dist/esm/{api-BAEPnyL7.js → api-Bhr2ic7C.js} +12 -12
  225. package/dist/{kolibri/api-BAEPnyL7.js.map → esm/api-Bhr2ic7C.js.map} +1 -1
  226. package/dist/esm/{api-CagcODCX.js → api-DwdE0qU0.js} +8 -8
  227. package/dist/esm/{api-CagcODCX.js.map → api-DwdE0qU0.js.map} +1 -1
  228. package/dist/esm/{app-globals-CwlOH1sO.js → app-globals-DlrwRj26.js} +4 -4
  229. package/dist/esm/{app-globals-CwlOH1sO.js.map → app-globals-DlrwRj26.js.map} +1 -1
  230. package/dist/esm/{base-BFU17cMm.js → base-BwsdAVVP.js} +16 -16
  231. package/dist/{kolibri/base-BFU17cMm.js.map → esm/base-BwsdAVVP.js.map} +1 -1
  232. package/dist/esm/{base-BpKxLJ6r.js → base-CQQKxfxv.js} +4 -4
  233. package/dist/{kolibri/base-BpKxLJ6r.js.map → esm/base-CQQKxfxv.js.map} +1 -1
  234. package/dist/esm/{base-Cm_c8klt.js → base-CdUYL1Y_.js} +5 -5
  235. package/dist/esm/{base-Cm_c8klt.js.map → base-CdUYL1Y_.js.map} +1 -1
  236. package/dist/esm/{base-DitGpYOV.js → base-D5a-Ls-4.js} +4 -4
  237. package/dist/{kolibri/base-DitGpYOV.js.map → esm/base-D5a-Ls-4.js.map} +1 -1
  238. package/dist/esm/{base-web-component-BFCVvyYG.js → base-web-component-6IoFcVM9.js} +7 -7
  239. package/dist/{kolibri/base-web-component-BFCVvyYG.js.map → esm/base-web-component-6IoFcVM9.js.map} +1 -1
  240. package/dist/esm/{base-web-component-6J5sCsnZ.js → base-web-component-CyCs0EpM.js} +5 -5
  241. package/dist/esm/{base-web-component-6J5sCsnZ.js.map → base-web-component-CyCs0EpM.js.map} +1 -1
  242. package/dist/esm/{behavior-CH_2MMuX.js → behavior-COQhqcG7.js} +3 -3
  243. package/dist/{kolibri/behavior-CH_2MMuX.js.map → esm/behavior-COQhqcG7.js.map} +1 -1
  244. package/dist/esm/{component-Dg6TIbeY.js → component-BOFlST8N.js} +5 -5
  245. package/dist/{kolibri/component-Dg6TIbeY.js.map → esm/component-BOFlST8N.js.map} +1 -1
  246. package/dist/esm/{component-BpOMe842.js → component-C4dhT4Ba.js} +3 -3
  247. package/dist/{kolibri/component-BpOMe842.js.map → esm/component-C4dhT4Ba.js.map} +1 -1
  248. package/dist/esm/{component-Ba4gjLBG.js → component-C9cJK7Cf.js} +5 -5
  249. package/dist/esm/{component-Ba4gjLBG.js.map → component-C9cJK7Cf.js.map} +1 -1
  250. package/dist/esm/{component-Do9rjnte.js → component-CBkrKKXd.js} +7 -7
  251. package/dist/esm/{component-Do9rjnte.js.map → component-CBkrKKXd.js.map} +1 -1
  252. package/dist/esm/{component-C5BFsKau.js → component-CHz6TLzY.js} +5 -5
  253. package/dist/esm/{component-C5BFsKau.js.map → component-CHz6TLzY.js.map} +1 -1
  254. package/dist/esm/{component-CBpYh2q-.js → component-CODtL04S.js} +7 -7
  255. package/dist/esm/{component-CBpYh2q-.js.map → component-CODtL04S.js.map} +1 -1
  256. package/dist/esm/{component-C3sXiwbS.js → component-D30YHxgS.js} +3 -3
  257. package/dist/esm/{component-C3sXiwbS.js.map → component-D30YHxgS.js.map} +1 -1
  258. package/dist/esm/{component-DZbJLUju.js → component-DXmRJdLc.js} +4 -4
  259. package/dist/{kolibri/component-DZbJLUju.js.map → esm/component-DXmRJdLc.js.map} +1 -1
  260. package/dist/esm/{component-C_d54ujF.js → component-DoCNds1d.js} +4 -4
  261. package/dist/{kolibri/component-C_d54ujF.js.map → esm/component-DoCNds1d.js.map} +1 -1
  262. package/dist/esm/{component-CvCfEqSE.js → component-fK2EUkFf.js} +4 -4
  263. package/dist/esm/{component-CvCfEqSE.js.map → component-fK2EUkFf.js.map} +1 -1
  264. package/dist/esm/{component-BF8FPuIW.js → component-kDR4_xf0.js} +3 -3
  265. package/dist/esm/{component-BF8FPuIW.js.map → component-kDR4_xf0.js.map} +1 -1
  266. package/dist/esm/{component-DzoBgfR4.js → component-kxFmDVse.js} +3 -3
  267. package/dist/esm/{component-DzoBgfR4.js.map → component-kxFmDVse.js.map} +1 -1
  268. package/dist/esm/{dev.utils-CJMVCYWh.js → dev.utils-DDqySnXB.js} +3 -3
  269. package/dist/{kolibri/dev.utils-CJMVCYWh.js.map → esm/dev.utils-DDqySnXB.js.map} +1 -1
  270. package/dist/esm/{devtools-rRHULXVr.js → devtools-CjmOcVsT.js} +4 -4
  271. package/dist/{kolibri/devtools-rRHULXVr.js.map → esm/devtools-CjmOcVsT.js.map} +1 -1
  272. package/dist/esm/{field-control-DXxCMXvx.js → field-control-Dkru7B-M.js} +8 -8
  273. package/dist/{kolibri/field-control-DXxCMXvx.js.map → esm/field-control-Dkru7B-M.js.map} +1 -1
  274. package/dist/esm/{group-CI4sSgiu.js → group-CXJiUqKv.js} +5 -5
  275. package/dist/esm/{group-CI4sSgiu.js.map → group-CXJiUqKv.js.map} +1 -1
  276. package/dist/esm/{index-DQdQBwMc.js → index-wY4pHWJG.js} +3 -3
  277. package/dist/esm/index-wY4pHWJG.js.map +1 -0
  278. package/dist/esm/{input-CDtJZ2sy.js → input-C_ZwHs-7.js} +5 -5
  279. package/dist/esm/{input-CDtJZ2sy.js.map → input-C_ZwHs-7.js.map} +1 -1
  280. package/dist/esm/{input-container-DROwwh7_.js → input-container-CBl9xcK-.js} +7 -7
  281. package/dist/{kolibri/input-container-DROwwh7_.js.map → esm/input-container-CBl9xcK-.js.map} +1 -1
  282. package/dist/esm/{item-C6p5wW-z.js → item-BacIXvMT.js} +4 -4
  283. package/dist/esm/{item-C6p5wW-z.js.map → item-BacIXvMT.js.map} +1 -1
  284. package/dist/esm/{item-CHP-bw8Q.js → item-DewHrd_f.js} +4 -4
  285. package/dist/{kolibri/item-CHP-bw8Q.js.map → esm/item-DewHrd_f.js.map} +1 -1
  286. package/dist/esm/{item-Cbi_ZY6o.js → item-lEB6GAqe.js} +3 -3
  287. package/dist/esm/{item-Cbi_ZY6o.js.map → item-lEB6GAqe.js.map} +1 -1
  288. package/dist/esm/{item-ZjrNIhfW.js → item-nGiqyOvt.js} +8 -8
  289. package/dist/{kolibri/item-ZjrNIhfW.js.map → esm/item-nGiqyOvt.js.map} +1 -1
  290. package/dist/esm/kol-abbr.entry.js +2 -2
  291. package/dist/esm/kol-accordion.entry.js +7 -7
  292. package/dist/esm/kol-alert.entry.js +11 -11
  293. package/dist/esm/kol-avatar.entry.js +1 -1
  294. package/dist/esm/kol-badge.entry.js +10 -10
  295. package/dist/esm/kol-breadcrumb.entry.js +9 -9
  296. package/dist/esm/kol-button-link.entry.js +10 -10
  297. package/dist/esm/kol-button.entry.js +10 -10
  298. package/dist/esm/kol-card.entry.js +11 -11
  299. package/dist/esm/kol-click-button.entry.js +2 -2
  300. package/dist/esm/kol-combobox.entry.js +18 -18
  301. package/dist/esm/kol-details.entry.js +7 -7
  302. package/dist/esm/kol-dialog.entry.js +13 -13
  303. package/dist/esm/kol-drawer.entry.js +12 -12
  304. package/dist/esm/kol-form.entry.js +12 -12
  305. package/dist/esm/kol-heading.entry.js +1 -1
  306. package/dist/esm/kol-icon.entry.js +3 -3
  307. package/dist/esm/kol-image.entry.js +1 -1
  308. package/dist/esm/kol-input-checkbox.entry.js +17 -17
  309. package/dist/esm/kol-input-color.entry.js +18 -18
  310. package/dist/esm/kol-input-date.entry.js +18 -18
  311. package/dist/esm/kol-input-email.entry.js +20 -20
  312. package/dist/esm/kol-input-file.entry.js +17 -17
  313. package/dist/esm/kol-input-number.entry.js +18 -18
  314. package/dist/esm/kol-input-password.entry.js +20 -20
  315. package/dist/esm/kol-input-radio.entry.js +17 -17
  316. package/dist/esm/kol-input-range.entry.js +18 -18
  317. package/dist/esm/kol-input-text.entry.js +20 -20
  318. package/dist/esm/kol-kolibri.entry.js +2 -2
  319. package/dist/esm/kol-link-button.entry.js +10 -10
  320. package/dist/esm/kol-link.entry.js +10 -10
  321. package/dist/esm/kol-meter.entry.js +1 -1
  322. package/dist/esm/kol-modal.entry.js +13 -13
  323. package/dist/esm/kol-nav.entry.js +13 -13
  324. package/dist/esm/kol-pagination.entry.js +18 -18
  325. package/dist/esm/kol-popover-button.entry.js +11 -11
  326. package/dist/esm/kol-progress.entry.js +1 -1
  327. package/dist/esm/kol-quote.entry.js +1 -1
  328. package/dist/esm/kol-select.entry.js +17 -17
  329. package/dist/esm/kol-single-select.entry.js +18 -18
  330. package/dist/esm/kol-skeleton.entry.js +2 -2
  331. package/dist/esm/kol-skip-nav.entry.js +9 -9
  332. package/dist/esm/kol-spin.entry.js +3 -3
  333. package/dist/esm/kol-split-button.entry.js +12 -12
  334. package/dist/esm/kol-table-stateful.entry.js +25 -25
  335. package/dist/esm/kol-table-stateless.entry.js +19 -19
  336. package/dist/esm/kol-tabs.entry.js +9 -9
  337. package/dist/esm/kol-textarea.entry.js +17 -17
  338. package/dist/esm/kol-toast-container.entry.js +11 -11
  339. package/dist/esm/kol-toolbar.entry.js +11 -11
  340. package/dist/esm/kol-tooltip-wc.entry.js +4 -4
  341. package/dist/esm/kol-tree-item.entry.js +9 -9
  342. package/dist/esm/kol-tree.entry.js +1 -1
  343. package/dist/esm/kol-version.entry.js +9 -9
  344. package/dist/esm/kolibri.js +3 -3
  345. package/dist/esm/loader.js +3 -3
  346. package/dist/esm/{resolve-props-CjBvvXId.js → resolve-props-DrFDeILa.js} +3 -3
  347. package/dist/esm/{resolve-props-CjBvvXId.js.map → resolve-props-DrFDeILa.js.map} +1 -1
  348. package/dist/esm/{scroll-lock-6SV-XFXR.js → scroll-lock-BotxOlMX.js} +3 -3
  349. package/dist/{kolibri/scroll-lock-6SV-XFXR.js.map → esm/scroll-lock-BotxOlMX.js.map} +1 -1
  350. package/dist/esm/{suggestions-BYMmW1aV.js → suggestions-CX5S2xAI.js} +4 -4
  351. package/dist/esm/{suggestions-BYMmW1aV.js.map → suggestions-CX5S2xAI.js.map} +1 -1
  352. package/dist/esm/test-component.entry.js +1 -1
  353. package/dist/esm/{toggle-handler-D-yalcds.js → toggle-handler-VctiltrE.js} +5 -5
  354. package/dist/esm/{toggle-handler-D-yalcds.js.map → toggle-handler-VctiltrE.js.map} +1 -1
  355. package/dist/kolibri/{Heading-NHB1reiQ.js → Heading-DYEtnAIe.js} +2 -2
  356. package/dist/{esm/Heading-NHB1reiQ.js.map → kolibri/Heading-DYEtnAIe.js.map} +1 -1
  357. package/dist/kolibri/{api-BAEPnyL7.js → api-Bhr2ic7C.js} +2 -2
  358. package/dist/{esm/api-BAEPnyL7.js.map → kolibri/api-Bhr2ic7C.js.map} +1 -1
  359. package/dist/kolibri/api-DwdE0qU0.js +5 -0
  360. package/dist/kolibri/{api-CagcODCX.js.map → api-DwdE0qU0.js.map} +1 -1
  361. package/dist/kolibri/app-globals-DlrwRj26.js +5 -0
  362. package/dist/kolibri/{app-globals-CwlOH1sO.js.map → app-globals-DlrwRj26.js.map} +1 -1
  363. package/dist/kolibri/{base-BFU17cMm.js → base-BwsdAVVP.js} +2 -2
  364. package/dist/{esm/base-BFU17cMm.js.map → kolibri/base-BwsdAVVP.js.map} +1 -1
  365. package/dist/kolibri/{base-BpKxLJ6r.js → base-CQQKxfxv.js} +2 -2
  366. package/dist/{esm/base-BpKxLJ6r.js.map → kolibri/base-CQQKxfxv.js.map} +1 -1
  367. package/dist/kolibri/{base-Cm_c8klt.js → base-CdUYL1Y_.js} +2 -2
  368. package/dist/kolibri/{base-Cm_c8klt.js.map → base-CdUYL1Y_.js.map} +1 -1
  369. package/dist/kolibri/{base-DitGpYOV.js → base-D5a-Ls-4.js} +2 -2
  370. package/dist/{esm/base-DitGpYOV.js.map → kolibri/base-D5a-Ls-4.js.map} +1 -1
  371. package/dist/kolibri/{base-web-component-BFCVvyYG.js → base-web-component-6IoFcVM9.js} +2 -2
  372. package/dist/{esm/base-web-component-BFCVvyYG.js.map → kolibri/base-web-component-6IoFcVM9.js.map} +1 -1
  373. package/dist/kolibri/{base-web-component-6J5sCsnZ.js → base-web-component-CyCs0EpM.js} +2 -2
  374. package/dist/kolibri/{base-web-component-6J5sCsnZ.js.map → base-web-component-CyCs0EpM.js.map} +1 -1
  375. package/dist/kolibri/{behavior-CH_2MMuX.js → behavior-COQhqcG7.js} +2 -2
  376. package/dist/{esm/behavior-CH_2MMuX.js.map → kolibri/behavior-COQhqcG7.js.map} +1 -1
  377. package/dist/kolibri/{component-Dg6TIbeY.js → component-BOFlST8N.js} +2 -2
  378. package/dist/{esm/component-Dg6TIbeY.js.map → kolibri/component-BOFlST8N.js.map} +1 -1
  379. package/dist/kolibri/{component-BpOMe842.js → component-C4dhT4Ba.js} +2 -2
  380. package/dist/{esm/component-BpOMe842.js.map → kolibri/component-C4dhT4Ba.js.map} +1 -1
  381. package/dist/kolibri/component-C9cJK7Cf.js +5 -0
  382. package/dist/kolibri/{component-Ba4gjLBG.js.map → component-C9cJK7Cf.js.map} +1 -1
  383. package/dist/kolibri/{component-Do9rjnte.js → component-CBkrKKXd.js} +2 -2
  384. package/dist/kolibri/{component-Do9rjnte.js.map → component-CBkrKKXd.js.map} +1 -1
  385. package/dist/kolibri/component-CHz6TLzY.js +5 -0
  386. package/dist/kolibri/{component-C5BFsKau.js.map → component-CHz6TLzY.js.map} +1 -1
  387. package/dist/kolibri/component-CODtL04S.js +5 -0
  388. package/dist/kolibri/{component-CBpYh2q-.js.map → component-CODtL04S.js.map} +1 -1
  389. package/dist/kolibri/{component-C3sXiwbS.js → component-D30YHxgS.js} +2 -2
  390. package/dist/kolibri/{component-C3sXiwbS.js.map → component-D30YHxgS.js.map} +1 -1
  391. package/dist/kolibri/{component-DZbJLUju.js → component-DXmRJdLc.js} +2 -2
  392. package/dist/{esm/component-DZbJLUju.js.map → kolibri/component-DXmRJdLc.js.map} +1 -1
  393. package/dist/kolibri/{component-C_d54ujF.js → component-DoCNds1d.js} +2 -2
  394. package/dist/{esm/component-C_d54ujF.js.map → kolibri/component-DoCNds1d.js.map} +1 -1
  395. package/dist/kolibri/{component-CvCfEqSE.js → component-fK2EUkFf.js} +2 -2
  396. package/dist/kolibri/{component-CvCfEqSE.js.map → component-fK2EUkFf.js.map} +1 -1
  397. package/dist/kolibri/{component-BF8FPuIW.js → component-kDR4_xf0.js} +2 -2
  398. package/dist/kolibri/{component-BF8FPuIW.js.map → component-kDR4_xf0.js.map} +1 -1
  399. package/dist/kolibri/component-kxFmDVse.js +5 -0
  400. package/dist/kolibri/{component-DzoBgfR4.js.map → component-kxFmDVse.js.map} +1 -1
  401. package/dist/kolibri/{dev.utils-CJMVCYWh.js → dev.utils-DDqySnXB.js} +2 -2
  402. package/dist/{esm/dev.utils-CJMVCYWh.js.map → kolibri/dev.utils-DDqySnXB.js.map} +1 -1
  403. package/dist/kolibri/{devtools-rRHULXVr.js → devtools-CjmOcVsT.js} +2 -2
  404. package/dist/{esm/devtools-rRHULXVr.js.map → kolibri/devtools-CjmOcVsT.js.map} +1 -1
  405. package/dist/kolibri/field-control-Dkru7B-M.js +5 -0
  406. package/dist/{esm/field-control-DXxCMXvx.js.map → kolibri/field-control-Dkru7B-M.js.map} +1 -1
  407. package/dist/kolibri/{group-CI4sSgiu.js → group-CXJiUqKv.js} +2 -2
  408. package/dist/kolibri/{group-CI4sSgiu.js.map → group-CXJiUqKv.js.map} +1 -1
  409. package/dist/kolibri/{index-DQdQBwMc.js → index-wY4pHWJG.js} +2 -2
  410. package/dist/kolibri/index-wY4pHWJG.js.map +1 -0
  411. package/dist/kolibri/{input-CDtJZ2sy.js → input-C_ZwHs-7.js} +2 -2
  412. package/dist/kolibri/{input-CDtJZ2sy.js.map → input-C_ZwHs-7.js.map} +1 -1
  413. package/dist/kolibri/{input-container-DROwwh7_.js → input-container-CBl9xcK-.js} +2 -2
  414. package/dist/{esm/input-container-DROwwh7_.js.map → kolibri/input-container-CBl9xcK-.js.map} +1 -1
  415. package/dist/kolibri/item-BacIXvMT.js +5 -0
  416. package/dist/kolibri/{item-C6p5wW-z.js.map → item-BacIXvMT.js.map} +1 -1
  417. package/dist/kolibri/item-DewHrd_f.js +5 -0
  418. package/dist/{esm/item-CHP-bw8Q.js.map → kolibri/item-DewHrd_f.js.map} +1 -1
  419. package/dist/kolibri/{item-Cbi_ZY6o.js → item-lEB6GAqe.js} +2 -2
  420. package/dist/kolibri/{item-Cbi_ZY6o.js.map → item-lEB6GAqe.js.map} +1 -1
  421. package/dist/kolibri/{item-ZjrNIhfW.js → item-nGiqyOvt.js} +2 -2
  422. package/dist/{esm/item-ZjrNIhfW.js.map → kolibri/item-nGiqyOvt.js.map} +1 -1
  423. package/dist/kolibri/kol-abbr.entry.js +1 -1
  424. package/dist/kolibri/kol-accordion.entry.js +1 -1
  425. package/dist/kolibri/kol-alert.entry.js +1 -1
  426. package/dist/kolibri/kol-avatar.entry.js +1 -1
  427. package/dist/kolibri/kol-badge.entry.js +1 -1
  428. package/dist/kolibri/kol-breadcrumb.entry.js +1 -1
  429. package/dist/kolibri/kol-button-link.entry.js +1 -1
  430. package/dist/kolibri/kol-button.entry.js +1 -1
  431. package/dist/kolibri/kol-card.entry.js +1 -1
  432. package/dist/kolibri/kol-click-button.entry.js +1 -1
  433. package/dist/kolibri/kol-combobox.entry.js +1 -1
  434. package/dist/kolibri/kol-details.entry.js +1 -1
  435. package/dist/kolibri/kol-dialog.entry.js +1 -1
  436. package/dist/kolibri/kol-drawer.entry.js +1 -1
  437. package/dist/kolibri/kol-form.entry.js +1 -1
  438. package/dist/kolibri/kol-heading.entry.js +1 -1
  439. package/dist/kolibri/kol-icon.entry.js +1 -1
  440. package/dist/kolibri/kol-image.entry.js +1 -1
  441. package/dist/kolibri/kol-input-checkbox.entry.js +1 -1
  442. package/dist/kolibri/kol-input-color.entry.js +1 -1
  443. package/dist/kolibri/kol-input-date.entry.js +1 -1
  444. package/dist/kolibri/kol-input-email.entry.js +1 -1
  445. package/dist/kolibri/kol-input-file.entry.js +1 -1
  446. package/dist/kolibri/kol-input-number.entry.js +1 -1
  447. package/dist/kolibri/kol-input-password.entry.js +1 -1
  448. package/dist/kolibri/kol-input-radio.entry.js +1 -1
  449. package/dist/kolibri/kol-input-range.entry.js +1 -1
  450. package/dist/kolibri/kol-input-text.entry.js +1 -1
  451. package/dist/kolibri/kol-kolibri.entry.js +1 -1
  452. package/dist/kolibri/kol-link-button.entry.js +1 -1
  453. package/dist/kolibri/kol-link.entry.js +1 -1
  454. package/dist/kolibri/kol-meter.entry.js +1 -1
  455. package/dist/kolibri/kol-modal.entry.js +1 -1
  456. package/dist/kolibri/kol-nav.entry.js +1 -1
  457. package/dist/kolibri/kol-pagination.entry.js +1 -1
  458. package/dist/kolibri/kol-popover-button.entry.js +1 -1
  459. package/dist/kolibri/kol-progress.entry.js +1 -1
  460. package/dist/kolibri/kol-quote.entry.js +1 -1
  461. package/dist/kolibri/kol-select.entry.js +1 -1
  462. package/dist/kolibri/kol-single-select.entry.js +1 -1
  463. package/dist/kolibri/kol-skeleton.entry.js +1 -1
  464. package/dist/kolibri/kol-skip-nav.entry.js +1 -1
  465. package/dist/kolibri/kol-spin.entry.js +1 -1
  466. package/dist/kolibri/kol-split-button.entry.js +1 -1
  467. package/dist/kolibri/kol-table-stateful.entry.js +1 -1
  468. package/dist/kolibri/kol-table-stateless.entry.js +1 -1
  469. package/dist/kolibri/kol-tabs.entry.js +1 -1
  470. package/dist/kolibri/kol-textarea.entry.js +1 -1
  471. package/dist/kolibri/kol-toast-container.entry.js +1 -1
  472. package/dist/kolibri/kol-toolbar.entry.js +1 -1
  473. package/dist/kolibri/kol-tooltip-wc.entry.js +1 -1
  474. package/dist/kolibri/kol-tree-item.entry.js +1 -1
  475. package/dist/kolibri/kol-tree.entry.js +1 -1
  476. package/dist/kolibri/kol-version.entry.js +1 -1
  477. package/dist/kolibri/kolibri.esm.js +1 -1
  478. package/dist/kolibri/{resolve-props-CjBvvXId.js → resolve-props-DrFDeILa.js} +2 -2
  479. package/dist/kolibri/{resolve-props-CjBvvXId.js.map → resolve-props-DrFDeILa.js.map} +1 -1
  480. package/dist/kolibri/{scroll-lock-6SV-XFXR.js → scroll-lock-BotxOlMX.js} +2 -2
  481. package/dist/{esm/scroll-lock-6SV-XFXR.js.map → kolibri/scroll-lock-BotxOlMX.js.map} +1 -1
  482. package/dist/kolibri/{suggestions-BYMmW1aV.js → suggestions-CX5S2xAI.js} +2 -2
  483. package/dist/kolibri/{suggestions-BYMmW1aV.js.map → suggestions-CX5S2xAI.js.map} +1 -1
  484. package/dist/kolibri/test-component.entry.js +1 -1
  485. package/dist/kolibri/{toggle-handler-D-yalcds.js → toggle-handler-VctiltrE.js} +2 -2
  486. package/dist/kolibri/{toggle-handler-D-yalcds.js.map → toggle-handler-VctiltrE.js.map} +1 -1
  487. package/package.json +2 -2
  488. package/dist/cjs/index-qcrGfEY6.js.map +0 -1
  489. package/dist/esm/index-DQdQBwMc.js.map +0 -1
  490. package/dist/kolibri/api-CagcODCX.js +0 -5
  491. package/dist/kolibri/app-globals-CwlOH1sO.js +0 -5
  492. package/dist/kolibri/component-Ba4gjLBG.js +0 -5
  493. package/dist/kolibri/component-C5BFsKau.js +0 -5
  494. package/dist/kolibri/component-CBpYh2q-.js +0 -5
  495. package/dist/kolibri/component-DzoBgfR4.js +0 -5
  496. package/dist/kolibri/field-control-DXxCMXvx.js +0 -5
  497. package/dist/kolibri/index-DQdQBwMc.js.map +0 -1
  498. package/dist/kolibri/item-C6p5wW-z.js +0 -5
  499. package/dist/kolibri/item-CHP-bw8Q.js +0 -5
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * KoliBri - The accessible HTML-Standard
3
3
  */
4
- import{a as e}from"./tslib.es6-QNbPBOk5.js";import{h as s,F as a}from"./index-DQdQBwMc.js";import"./common-BqpMtheU.js";import{i as o,g as i,c as l}from"./api-BAEPnyL7.js";import{c as r}from"./clsx-COFh-Vc8.js";import{a as t}from"./dev.utils-CJMVCYWh.js";import{g as d}from"./block-bem-DxQXsOt3.js";const c=c=>{const{class:n,msg:b,required:u,disabled:m,touched:p,readonly:j,ariaDescribedBy:B,hideLabel:y,label:g,suggestions:h,value:f}=c,O=e(c,["class","msg","required","disabled","touched","readonly","ariaDescribedBy","hideLabel","label","suggestions","value"]);const q=Object.assign(Object.assign({class:r(d("kol-input")(Object.assign({disabled:Boolean(m),required:Boolean(u),touched:Boolean(p),readonly:Boolean(j)},o(b,p)?{[i(b)]:true}:{})),n),required:u,disabled:m,readonly:j,type:"text",list:h&&typeof O.id==="string"?t(O.id,"list"):undefined},l({ariaDescribedBy:B,hideLabel:y,label:g})),O);return s(a,null,s("input",Object.assign({},q,{value:f})),h)};export{c as I};
5
- //# sourceMappingURL=input-CDtJZ2sy.js.map
4
+ import{a as e}from"./tslib.es6-QNbPBOk5.js";import{h as s,F as a}from"./index-wY4pHWJG.js";import"./common-BqpMtheU.js";import{i as o,g as i,c as r}from"./api-Bhr2ic7C.js";import{c as l}from"./clsx-COFh-Vc8.js";import{a as t}from"./dev.utils-DDqySnXB.js";import{g as d}from"./block-bem-DxQXsOt3.js";const c=c=>{const{class:n,msg:b,required:u,disabled:m,touched:p,readonly:j,ariaDescribedBy:B,hideLabel:y,label:g,suggestions:h,value:f}=c,O=e(c,["class","msg","required","disabled","touched","readonly","ariaDescribedBy","hideLabel","label","suggestions","value"]);const q=Object.assign(Object.assign({class:l(d("kol-input")(Object.assign({disabled:Boolean(m),required:Boolean(u),touched:Boolean(p),readonly:Boolean(j)},o(b,p)?{[i(b)]:true}:{})),n),required:u,disabled:m,readonly:j,type:"text",list:h&&typeof O.id==="string"?t(O.id,"list"):undefined},r({ariaDescribedBy:B,hideLabel:y,label:g})),O);return s(a,null,s("input",Object.assign({},q,{value:f})),h)};export{c as I};
5
+ //# sourceMappingURL=input-C_ZwHs-7.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"input-CDtJZ2sy.js","sources":["src/internal/functional-components/form-field/input.tsx"],"sourcesContent":["import { Fragment, h, type FunctionalComponent as FC } from '@stencil/core';\nimport type { JSXBase, VNode } from '@stencil/core/internal';\nimport { getMsgType, isMsgDefinedAndInputTouched, type MsgPropType, type Stringified } from '../../../schema';\nimport clsx from '../../../utils/clsx';\nimport { createRelatedUniqueId } from '../../../utils/dev.utils';\nimport { getBlockBem } from '../bem-root-node/block-bem';\nimport type { DefaultInputProps } from './default-input-props';\nimport { getDefaultInputProps } from './default-input-props';\n\n/**\n * Stencil only writes a property whose value changed: `null` writes the empty value on the first\n * render, `undefined` leaves the native default untouched. A range input, for example, falls back to\n * the middle of its range only when its value is written.\n */\ntype NullableNativeValue = string | number | null;\n\nexport type InputFCProps = Omit<DefaultInputProps<JSXBase.InputHTMLAttributes<HTMLInputElement>>, 'max' | 'min' | 'step'> & {\n\tmsg?: Stringified<MsgPropType>;\n\ttouched?: boolean;\n\tspellcheck?: boolean;\n\t/** Rendered after the input; the input references it through `list`. */\n\tsuggestions?: VNode;\n\tmax?: NullableNativeValue;\n\tmin?: NullableNativeValue;\n\tstep?: NullableNativeValue;\n\tvalue?: NullableNativeValue | string[];\n} & {\n\t[key: `aria-${string}`]: unknown;\n\t[key: `data-${string}`]: unknown;\n};\n\n/**\n * Native `<input>` of a form field. The input itself is the root of the `kol-input` block, so the\n * block classes are set on it directly instead of through `BemRootNodeFC`.\n */\nexport const InputFC: FC<InputFCProps> = (props) => {\n\tconst { class: classNames, msg, required, disabled, touched, readonly, ariaDescribedBy, hideLabel, label, suggestions, value, ...other } = props;\n\n\tconst inputProps: JSXBase.InputHTMLAttributes<HTMLInputElement> = {\n\t\tclass: clsx(\n\t\t\tgetBlockBem('kol-input')({\n\t\t\t\tdisabled: Boolean(disabled),\n\t\t\t\trequired: Boolean(required),\n\t\t\t\ttouched: Boolean(touched),\n\t\t\t\treadonly: Boolean(readonly),\n\t\t\t\t...(isMsgDefinedAndInputTouched(msg, touched) ? { [getMsgType(msg) as string]: true } : {}),\n\t\t\t}),\n\t\t\tclassNames,\n\t\t),\n\t\trequired: required,\n\t\tdisabled: disabled,\n\t\treadonly: readonly,\n\t\ttype: 'text',\n\t\tlist: suggestions && typeof other.id === 'string' ? createRelatedUniqueId(other.id, 'list') : undefined,\n\t\t...getDefaultInputProps({ ariaDescribedBy, hideLabel, label }),\n\t\t...(other as JSXBase.InputHTMLAttributes<HTMLInputElement>),\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<input {...inputProps} value={value as JSXBase.InputHTMLAttributes<HTMLInputElement>['value']} />\n\t\t\t{suggestions}\n\t\t</>\n\t);\n};\n"],"names":[],"mappings":";;;;;;;;;;;AAmCa,MAAA,OAAO,GAAqB,CAAC,KAAK,KAAI;IAClD,MAAM,EAAE,KAAK,EAAE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A,OAAA,EAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAW,UAAU,EAAA,EAAE,KAAK,EAAE,KAA+D,EAAI,CAAA,CAAA,EAChG,WAAW,CACV;AAEL;;;;"}
1
+ {"version":3,"file":"input-C_ZwHs-7.js","sources":["src/internal/functional-components/form-field/input.tsx"],"sourcesContent":["import { Fragment, h, type FunctionalComponent as FC } from '@stencil/core';\nimport type { JSXBase, VNode } from '@stencil/core/internal';\nimport { getMsgType, isMsgDefinedAndInputTouched, type MsgPropType, type Stringified } from '../../../schema';\nimport clsx from '../../../utils/clsx';\nimport { createRelatedUniqueId } from '../../../utils/dev.utils';\nimport { getBlockBem } from '../bem-root-node/block-bem';\nimport type { DefaultInputProps } from './default-input-props';\nimport { getDefaultInputProps } from './default-input-props';\n\n/**\n * Stencil only writes a property whose value changed: `null` writes the empty value on the first\n * render, `undefined` leaves the native default untouched. A range input, for example, falls back to\n * the middle of its range only when its value is written.\n */\ntype NullableNativeValue = string | number | null;\n\nexport type InputFCProps = Omit<DefaultInputProps<JSXBase.InputHTMLAttributes<HTMLInputElement>>, 'max' | 'min' | 'step'> & {\n\tmsg?: Stringified<MsgPropType>;\n\ttouched?: boolean;\n\tspellcheck?: boolean;\n\t/** Rendered after the input; the input references it through `list`. */\n\tsuggestions?: VNode;\n\tmax?: NullableNativeValue;\n\tmin?: NullableNativeValue;\n\tstep?: NullableNativeValue;\n\tvalue?: NullableNativeValue | string[];\n} & {\n\t[key: `aria-${string}`]: unknown;\n\t[key: `data-${string}`]: unknown;\n};\n\n/**\n * Native `<input>` of a form field. The input itself is the root of the `kol-input` block, so the\n * block classes are set on it directly instead of through `BemRootNodeFC`.\n */\nexport const InputFC: FC<InputFCProps> = (props) => {\n\tconst { class: classNames, msg, required, disabled, touched, readonly, ariaDescribedBy, hideLabel, label, suggestions, value, ...other } = props;\n\n\tconst inputProps: JSXBase.InputHTMLAttributes<HTMLInputElement> = {\n\t\tclass: clsx(\n\t\t\tgetBlockBem('kol-input')({\n\t\t\t\tdisabled: Boolean(disabled),\n\t\t\t\trequired: Boolean(required),\n\t\t\t\ttouched: Boolean(touched),\n\t\t\t\treadonly: Boolean(readonly),\n\t\t\t\t...(isMsgDefinedAndInputTouched(msg, touched) ? { [getMsgType(msg) as string]: true } : {}),\n\t\t\t}),\n\t\t\tclassNames,\n\t\t),\n\t\trequired: required,\n\t\tdisabled: disabled,\n\t\treadonly: readonly,\n\t\ttype: 'text',\n\t\tlist: suggestions && typeof other.id === 'string' ? createRelatedUniqueId(other.id, 'list') : undefined,\n\t\t...getDefaultInputProps({ ariaDescribedBy, hideLabel, label }),\n\t\t...(other as JSXBase.InputHTMLAttributes<HTMLInputElement>),\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<input {...inputProps} value={value as JSXBase.InputHTMLAttributes<HTMLInputElement>['value']} />\n\t\t\t{suggestions}\n\t\t</>\n\t);\n};\n"],"names":[],"mappings":";;;;;;;;;;;AAmCa,MAAA,OAAO,GAAqB,CAAC,KAAK,KAAI;IAClD,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAA,GAAe,KAAK,EAAf,KAAK,GAAK,MAAA,CAAA,KAAK,EAA1I,CAAA,OAAA,EAAA,KAAA,EAAA,UAAA,EAAA,UAAA,EAAA,SAAA,EAAA,UAAA,EAAA,iBAAA,EAAA,WAAA,EAAA,OAAA,EAAA,aAAA,EAAA,OAAA,CAAkI,CAAQ;AAEhJ,IAAA,MAAM,UAAU,GAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EACf,KAAK,EAAE,IAAI,CACV,WAAW,CAAC,WAAW,CAAC,CACvB,MAAA,CAAA,MAAA,CAAA,EAAA,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,EAC3B,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,EAC3B,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,EACzB,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,EACxB,GAAC,2BAA2B,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,GAAG,CAAW,GAAG,IAAI,EAAE,GAAG,EAAE,EACzF,CAAA,EACF,UAAU,CACV,EACD,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,WAAW,IAAI,OAAO,KAAK,CAAC,EAAE,KAAK,QAAQ,GAAG,qBAAqB,CAAC,KAAK,CAAC,EAAE,EAAE,MAAM,CAAC,GAAG,SAAS,EACpG,EAAA,oBAAoB,CAAC,EAAE,eAAe,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAA,EAC1D,KAAuD,CAC3D;AAED,IAAA,QACC,CAAA,CAAA,QAAA,EAAA,IAAA,EACC,CAAA,CAAA,OAAA,EAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAW,UAAU,EAAA,EAAE,KAAK,EAAE,KAA+D,EAAI,CAAA,CAAA,EAChG,WAAW,CACV;AAEL;;;;"}
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * KoliBri - The accessible HTML-Standard
3
3
  */
4
- import{F as o,D as t,j as n,p as s}from"./common-BqpMtheU.js";import{c as e}from"./base-web-component-3R1Dy3QK.js";import{h as r}from"./index-DQdQBwMc.js";import{B as i}from"./component-CBpYh2q-.js";import{I as c}from"./component-BpOMe842.js";import{a as l}from"./tslib.es6-QNbPBOk5.js";import{i as a,g as m}from"./api-BAEPnyL7.js";import{b as d}from"./bem-registry-CX5kvaqt.js";import{c as p}from"./clsx-COFh-Vc8.js";import{B as f}from"./component-C3sXiwbS.js";const u=(o,s,e)=>{if(n(e)){o[s]=e}else if(t(e,1)){o[s]={icon:e}}};const b=o=>{let n={};if(t(o,1)){n={left:{icon:o}}}else if(typeof o==="object"&&o!==null){u(n,"top",o.top);u(n,"right",o.right);u(n,"bottom",o.bottom);u(n,"left",o.left)}return n};const j=n=>typeof n==="object"&&n!==null&&(typeof n.style==="undefined"||o(n.style))&&(typeof n.label==="undefined"||t(n.label))&&t(n.icon,1);const y=o=>t(o,0)||j(o);function v(o){let n=o;if(typeof o==="string"){try{n=s(o)}catch(o){}}if(t(n,1)){return b(n)}if(typeof n==="object"&&n!==null){const o=n;if(Object.keys(o).length===0||["left","right","top","bottom"].some((t=>y(o[t])))){return b(n)}}throw new Error(`Invalid icons: ${typeof o}`)}const B=e("icons",{},v);const h=o=>{var t;if(!o){return null}return typeof o==="string"?r(c,{class:"kol-input-container__icon",icons:o,label:""}):r(c,{class:"kol-input-container__icon",icons:o.icon,label:(t=o.label)!==null&&t!==void 0?t:"",style:o.style})};const A=({icons:o,smartButton:t,startAdornment:n,endAdornment:s})=>({startAdornment:[n!==null&&n!==void 0?n:null,h(o===null||o===void 0?void 0:o.left)].filter(Boolean),endAdornment:[t?r(i,Object.assign({},t)):null,h(o===null||o===void 0?void 0:o.right),s!==null&&s!==void 0?s:null].filter(Boolean)});const g=d.forBlock("kol-input-container");const O=(o,t)=>{var{position:n="start",class:s}=o,e=l(o,["position","class"]);return r("div",Object.assign({class:p(g("adornment",{[n]:true}),s)},e),t)};function k(o){if(!o){return false}return Array.isArray(o)?o.length>0:Boolean(o)}const w=(o,t)=>{const{class:n,startAdornment:s,endAdornment:e,disabled:i,msg:c,touched:d}=o,p=l(o,["class","startAdornment","endAdornment","disabled","msg","touched"]);const u=k(s)||k(e);return r(f,Object.assign({block:"kol-input-container",modifiers:Object.assign({disabled:Boolean(i)},a(c,d)?{[m(c)]:true}:{}),class:n},p),u&&r(O,{position:"start"},s),r("div",{class:g("container")},t),u&&r(O,{position:"end"},e))};export{w as I,A as g,B as h};
5
- //# sourceMappingURL=input-container-DROwwh7_.js.map
4
+ import{F as o,D as t,j as n,p as s}from"./common-BqpMtheU.js";import{c as e}from"./base-web-component-3R1Dy3QK.js";import{h as r}from"./index-wY4pHWJG.js";import{B as i}from"./component-CODtL04S.js";import{I as c}from"./component-C4dhT4Ba.js";import{a as l}from"./tslib.es6-QNbPBOk5.js";import{i as a,g as m}from"./api-Bhr2ic7C.js";import{b as d}from"./bem-registry-CX5kvaqt.js";import{c as f}from"./clsx-COFh-Vc8.js";import{B as p}from"./component-D30YHxgS.js";const u=(o,s,e)=>{if(n(e)){o[s]=e}else if(t(e,1)){o[s]={icon:e}}};const b=o=>{let n={};if(t(o,1)){n={left:{icon:o}}}else if(typeof o==="object"&&o!==null){u(n,"top",o.top);u(n,"right",o.right);u(n,"bottom",o.bottom);u(n,"left",o.left)}return n};const j=n=>typeof n==="object"&&n!==null&&(typeof n.style==="undefined"||o(n.style))&&(typeof n.label==="undefined"||t(n.label))&&t(n.icon,1);const v=o=>t(o,0)||j(o);function y(o){let n=o;if(typeof o==="string"){try{n=s(o)}catch(o){}}if(t(n,1)){return b(n)}if(typeof n==="object"&&n!==null){const o=n;if(Object.keys(o).length===0||["left","right","top","bottom"].some((t=>v(o[t])))){return b(n)}}throw new Error(`Invalid icons: ${typeof o}`)}const h=e("icons",{},y);const B=o=>{var t;if(!o){return null}return typeof o==="string"?r(c,{class:"kol-input-container__icon",icons:o,label:""}):r(c,{class:"kol-input-container__icon",icons:o.icon,label:(t=o.label)!==null&&t!==void 0?t:"",style:o.style})};const g=({icons:o,smartButton:t,startAdornment:n,endAdornment:s})=>({startAdornment:[n!==null&&n!==void 0?n:null,B(o===null||o===void 0?void 0:o.left)].filter(Boolean),endAdornment:[t?r(i,Object.assign({},t)):null,B(o===null||o===void 0?void 0:o.right),s!==null&&s!==void 0?s:null].filter(Boolean)});const A=d.forBlock("kol-input-container");const O=(o,t)=>{var{position:n="start",class:s}=o,e=l(o,["position","class"]);return r("div",Object.assign({class:f(A("adornment",{[n]:true}),s)},e),t)};function k(o){if(!o){return false}return Array.isArray(o)?o.length>0:Boolean(o)}const C=(o,t)=>{const{class:n,startAdornment:s,endAdornment:e,disabled:i,msg:c,touched:d}=o,f=l(o,["class","startAdornment","endAdornment","disabled","msg","touched"]);const u=k(s)||k(e);return r(p,Object.assign({block:"kol-input-container",modifiers:Object.assign({disabled:Boolean(i)},a(c,d)?{[m(c)]:true}:{}),class:n},f),u&&r(O,{position:"start"},s),r("div",{class:A("container")},t),u&&r(O,{position:"end"},e))};export{C as I,g,h};
5
+ //# sourceMappingURL=input-container-CBl9xcK-.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"input-container-DROwwh7_.js","sources":["src/schema/props/icons.ts","src/internal/props/horizontal-icons.ts","src/internal/functional-components/form-field/adornments.tsx","src/internal/functional-components/form-field/input-container.tsx"],"sourcesContent":["import type { Generic } from 'adopted-style-sheets';\n\nimport type { AnyIconFontClass, KoliBriCustomIcon, KoliBriHorizontalIconsProp, KoliBriIconsProp, KoliBriIconsState } from '../types';\nimport type { Stringified } from '../types/common';\nimport type { WatchOptions } from '../utils';\nimport { objectObjectHandler, parseJson, watchValidator } from '../utils';\nimport { isObject, isString, isStyle } from '../validators';\n\nimport type { AlignPropType } from './align';\n\n/* types */\nexport type IconsPropType = Stringified<KoliBriIconsProp>;\nexport type IconsHorizontalPropType = Stringified<KoliBriHorizontalIconsProp>;\n\n/**\n * Defines the icon classnames.\n */\nexport type PropIcons = {\n\ticons: IconsPropType;\n};\nexport type PropHorizontalIcons = {\n\ticons: IconsHorizontalPropType;\n};\n\n/* validator */\n\nconst mapCustomIcon = (state: KoliBriIconsState, alignment: AlignPropType, 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: KoliBriIconsProp): KoliBriIconsState => {\n\tlet state: KoliBriIconsState = {};\n\tif (isString(icon, 1)) {\n\t\tstate = {\n\t\t\tleft: {\n\t\t\t\ticon: icon as AnyIconFontClass,\n\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('_icons')) {\n\t\tconst icons = component.nextState?.get('_icons') as KoliBriIconsProp;\n\t\tcomponent.nextState?.set('_icons', mapIconProp2State(icons));\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\t(typeof (value as KoliBriCustomIcon).label === 'undefined' || isString((value as KoliBriCustomIcon).label)) &&\n\tisString((value as KoliBriCustomIcon).icon, 1);\n\nexport const validateIcons = (component: Generic.Element.Component, value?: IconsPropType, options: WatchOptions = {}): void => {\n\tobjectObjectHandler(value, () => {\n\t\ttry {\n\t\t\tvalue = parseJson<KoliBriIconsProp>(value as string);\n\t\t} catch {\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'_icons',\n\t\t\t(value): boolean => {\n\t\t\t\tconst valueIsEmptyObject = typeof value === 'object' && value !== null && Object.keys(value).length === 0;\n\t\t\t\treturn (\n\t\t\t\t\tvalue === null ||\n\t\t\t\t\tvalueIsEmptyObject ||\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, 0) ||\n\t\t\t\t\t\t\tisIcon(value.left) ||\n\t\t\t\t\t\t\tisString(value.right, 0) ||\n\t\t\t\t\t\t\tisIcon(value.right) ||\n\t\t\t\t\t\t\tisString(value.top, 0) ||\n\t\t\t\t\t\t\tisIcon(value.top) ||\n\t\t\t\t\t\t\tisString(value.bottom, 0) ||\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\t...options,\n\t\t\t\tdefaultValue: {},\n\t\t\t\thooks: {\n\t\t\t\t\tafterPatch: options.hooks?.afterPatch,\n\t\t\t\t\tbeforePatch: (nextValue, nextState, component, key) => {\n\t\t\t\t\t\tif (typeof options.hooks?.beforePatch === 'function') {\n\t\t\t\t\t\t\toptions.hooks?.beforePatch(nextValue, nextState, component, key);\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},\n\t\t);\n\t});\n};\n","import type { IconsHorizontalPropType, KoliBriIconsProp, KoliBriIconsState } from '../../schema';\nimport { isIcon, isString, mapIconProp2State, parseJson } from '../../schema';\nimport type { Prop } from './helpers/factory';\nimport { createPropDefinition } from './helpers/factory';\n\n/**\n * Horizontal icons prop for form fields\n *\n * Description:\n * Icons rendered at the start (`left`) and end (`right`) of an input, as an object, as a JSON\n * string when it is passed through an HTML attribute, or as a single icon class that is placed\n * on the left. The value is normalized to an icon object per position.\n *\n * Accessibility:\n * - Icons are decorative unless they carry a `label` (WCAG 1.1.1 Non-text Content)\n *\n * @see https://www.w3.org/WAI/WCAG21/Understanding/non-text-content.html\n */\nexport type HorizontalIconsProp = Prop<'icons', IconsHorizontalPropType, KoliBriIconsState>;\n\nconst isIconPosition = (value: unknown): boolean => isString(value, 0) || isIcon(value);\n\nfunction normalizeHorizontalIcons(value: unknown): KoliBriIconsState | never {\n\tlet parsed = value;\n\tif (typeof value === 'string') {\n\t\ttry {\n\t\t\tparsed = parseJson<KoliBriIconsProp>(value);\n\t\t} catch {\n\t\t\t// A plain icon class is no JSON and stays a string.\n\t\t}\n\t}\n\tif (isString(parsed, 1)) {\n\t\treturn mapIconProp2State(parsed as KoliBriIconsProp);\n\t}\n\tif (typeof parsed === 'object' && parsed !== null) {\n\t\tconst icons = parsed as Record<string, unknown>;\n\t\tif (Object.keys(icons).length === 0 || ['left', 'right', 'top', 'bottom'].some((position) => isIconPosition(icons[position]))) {\n\t\t\treturn mapIconProp2State(parsed as KoliBriIconsProp);\n\t\t}\n\t}\n\tthrow new Error(`Invalid icons: ${typeof value}`);\n}\n\nexport const horizontalIconsProp = createPropDefinition<HorizontalIconsProp>('icons', {}, normalizeHorizontalIcons);\n","import { h } from '@stencil/core';\nimport type { VNode } from '@stencil/core/internal';\nimport type { IconOrIconClass, KoliBriHorizontalIcons } from '../../../schema';\nimport { ButtonFC } from '../button/component';\nimport type { ButtonItemFcProps } from '../button/item';\nimport { IconFC } from '../icon/component';\n\ntype InputAdornmentsOptions = {\n\ticons?: KoliBriHorizontalIcons;\n\t/** The smart button, resolved by `getSmartButtonFcProps` of the form field base. */\n\tsmartButton?: ButtonItemFcProps;\n\t/** Field-specific content before the left icon, e.g. the step-down button of `kol-input-number`. */\n\tstartAdornment?: VNode | null;\n\t/** Field-specific content after the smart button and the right icon, e.g. the clear button. */\n\tendAdornment?: VNode | null;\n};\n\nconst renderIcon = (icon?: IconOrIconClass): VNode | null => {\n\tif (!icon) {\n\t\treturn null;\n\t}\n\treturn typeof icon === 'string' ? (\n\t\t<IconFC class=\"kol-input-container__icon\" icons={icon} label=\"\" />\n\t) : (\n\t\t<IconFC class=\"kol-input-container__icon\" icons={icon.icon} label={icon.label ?? ''} style={icon.style} />\n\t);\n};\n\n/**\n * Adornments of `InputContainerFC`: the field-specific start content and the left icon at the start;\n * the smart button, the right icon and the field-specific end content at the end.\n */\nexport const getInputAdornments = ({\n\ticons,\n\tsmartButton,\n\tstartAdornment,\n\tendAdornment,\n}: InputAdornmentsOptions): { startAdornment: VNode[]; endAdornment: VNode[] } => ({\n\tstartAdornment: [startAdornment ?? null, renderIcon(icons?.left)].filter(Boolean) as VNode[],\n\tendAdornment: [smartButton ? <ButtonFC {...smartButton} /> : null, renderIcon(icons?.right), endAdornment ?? null].filter(Boolean) as VNode[],\n});\n","import { h, type FunctionalComponent as FC } from '@stencil/core';\nimport type { JSXBase, VNode } from '@stencil/core/internal';\nimport { getMsgType, isMsgDefinedAndInputTouched, type MsgPropType, type Stringified } from '../../../schema';\nimport { bem } from '../../../schema/bem-registry';\nimport clsx from '../../../utils/clsx';\nimport { BemRootNodeFC } from '../bem-root-node/component';\n\nconst inputContainerBem = bem.forBlock('kol-input-container');\n\ntype InputAdornmentType = VNode | VNode[] | null;\n\nexport type InputAdornmentFCProps = JSXBase.HTMLAttributes<HTMLDivElement> & {\n\tposition?: 'start' | 'end';\n};\n\n/** Slot before or after the input, e.g. for icons or the smart button. */\nexport const InputAdornmentFC: FC<InputAdornmentFCProps> = ({ position = 'start', class: className, ...other }, children) => (\n\t<div class={clsx(inputContainerBem('adornment', { [position]: true }), className)} {...other}>\n\t\t{children}\n\t</div>\n);\n\nexport type InputContainerFCProps = JSXBase.HTMLAttributes<HTMLDivElement> & {\n\tstartAdornment?: InputAdornmentType;\n\tendAdornment?: InputAdornmentType;\n\tdisabled?: boolean;\n\tmsg?: Stringified<MsgPropType>;\n\ttouched?: boolean;\n};\n\nfunction hasItems(items?: InputAdornmentType): boolean {\n\tif (!items) {\n\t\treturn false;\n\t}\n\n\treturn Array.isArray(items) ? items.length > 0 : Boolean(items);\n}\n\n/** Box around the native control of a field. Both adornments render as soon as one of them has content. */\nexport const InputContainerFC: FC<InputContainerFCProps> = (props, children) => {\n\tconst { class: classNames, startAdornment, endAdornment, disabled, msg, touched, ...other } = props;\n\tconst withAdornments = hasItems(startAdornment) || hasItems(endAdornment);\n\n\treturn (\n\t\t<BemRootNodeFC\n\t\t\tblock=\"kol-input-container\"\n\t\t\tmodifiers={{\n\t\t\t\tdisabled: Boolean(disabled),\n\t\t\t\t...(isMsgDefinedAndInputTouched(msg, touched) ? { [getMsgType(msg) as string]: true } : {}),\n\t\t\t}}\n\t\t\tclass={classNames}\n\t\t\t{...other}\n\t\t>\n\t\t\t{withAdornments && <InputAdornmentFC position=\"start\">{startAdornment}</InputAdornmentFC>}\n\t\t\t<div class={inputContainerBem('container')}>{children}</div>\n\t\t\t{withAdornments && <InputAdornmentFC position=\"end\">{endAdornment}</InputAdornmentFC>}\n\t\t</BemRootNodeFC>\n\t);\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;AA0BA,MAAM,aAAa,GAAG,CAAC,KAAwB,EAAE,SAAwB,EAAE,IAA2C,KAAI;AACzH,IAAA,IAAI,QAAQ,CAAC,IAAI,CAAC,EAAE;AACnB,QAAA,KAAK,CAAC,SAAS,CAAC,GAAG,IAAyB;;AACtC,SAAA,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE;QAC7B,KAAK,CAAC,SAAS,CAAC,GAAG;AAClB,YAAA,IAAI,EAAE,IAAwB;SAC9B;;AAEH,CAAC;AAEM,MAAM,iBAAiB,GAAG,CAAC,IAAsB,KAAuB;IAC9E,IAAI,KAAK,GAAsB,EAAE;AACjC,IAAA,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE;AACtB,QAAA,KAAK,GAAG;AACP,YAAA,IAAI,EAAE;AACL,gBAAA,IAAI,EAAE,IAAwB;AAC9B,aAAA;SACD;;SACK,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,EAAE;QACrD,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC;QACrC,aAAa,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC;QACzC,aAAa,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC;QAC3C,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC;;AAExC,IA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,MAAA,CAAA,EACb,KAAK,EAAC,qBAAqB,EAC3B,SAAS,EAAA,MAAA,CAAA,MAAA,CAAA,EACR,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,KACvB,2BAA2B,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,GAAG,CAAW,GAAG,IAAI,EAAE,GAAG,EAAE,IAE3F,KAAK,EAAE,UAAU,EAAA,EACb,KAAK,CAAA,EAER,cAAc,IAAI,EAAC,gBAAgB,EAAA,EAAC,QAAQ,EAAC,OAAO,EAAE,EAAA,cAAc,CAAoB,EACzF,CAAK,CAAA,KAAA,EAAA,EAAA,KAAK,EAAE,iBAAiB,CAAC,WAAW,CAAC,EAAA,EAAG,QAAQ,CAAO,EAC3D,cAAc,IAAI,CAAA,CAAC,gBAAgB,EAAA,EAAC,QAAQ,EAAC,KAAK,EAAA,EAAE,YAAY,CAAoB,CACtE;AAElB;;;;"}
1
+ {"version":3,"file":"input-container-CBl9xcK-.js","sources":["src/schema/props/icons.ts","src/internal/props/horizontal-icons.ts","src/internal/functional-components/form-field/adornments.tsx","src/internal/functional-components/form-field/input-container.tsx"],"sourcesContent":["import type { Generic } from 'adopted-style-sheets';\n\nimport type { AnyIconFontClass, KoliBriCustomIcon, KoliBriHorizontalIconsProp, KoliBriIconsProp, KoliBriIconsState } from '../types';\nimport type { Stringified } from '../types/common';\nimport type { WatchOptions } from '../utils';\nimport { objectObjectHandler, parseJson, watchValidator } from '../utils';\nimport { isObject, isString, isStyle } from '../validators';\n\nimport type { AlignPropType } from './align';\n\n/* types */\nexport type IconsPropType = Stringified<KoliBriIconsProp>;\nexport type IconsHorizontalPropType = Stringified<KoliBriHorizontalIconsProp>;\n\n/**\n * Defines the icon classnames.\n */\nexport type PropIcons = {\n\ticons: IconsPropType;\n};\nexport type PropHorizontalIcons = {\n\ticons: IconsHorizontalPropType;\n};\n\n/* validator */\n\nconst mapCustomIcon = (state: KoliBriIconsState, alignment: AlignPropType, 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: KoliBriIconsProp): KoliBriIconsState => {\n\tlet state: KoliBriIconsState = {};\n\tif (isString(icon, 1)) {\n\t\tstate = {\n\t\t\tleft: {\n\t\t\t\ticon: icon as AnyIconFontClass,\n\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('_icons')) {\n\t\tconst icons = component.nextState?.get('_icons') as KoliBriIconsProp;\n\t\tcomponent.nextState?.set('_icons', mapIconProp2State(icons));\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\t(typeof (value as KoliBriCustomIcon).label === 'undefined' || isString((value as KoliBriCustomIcon).label)) &&\n\tisString((value as KoliBriCustomIcon).icon, 1);\n\nexport const validateIcons = (component: Generic.Element.Component, value?: IconsPropType, options: WatchOptions = {}): void => {\n\tobjectObjectHandler(value, () => {\n\t\ttry {\n\t\t\tvalue = parseJson<KoliBriIconsProp>(value as string);\n\t\t} catch {\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'_icons',\n\t\t\t(value): boolean => {\n\t\t\t\tconst valueIsEmptyObject = typeof value === 'object' && value !== null && Object.keys(value).length === 0;\n\t\t\t\treturn (\n\t\t\t\t\tvalue === null ||\n\t\t\t\t\tvalueIsEmptyObject ||\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, 0) ||\n\t\t\t\t\t\t\tisIcon(value.left) ||\n\t\t\t\t\t\t\tisString(value.right, 0) ||\n\t\t\t\t\t\t\tisIcon(value.right) ||\n\t\t\t\t\t\t\tisString(value.top, 0) ||\n\t\t\t\t\t\t\tisIcon(value.top) ||\n\t\t\t\t\t\t\tisString(value.bottom, 0) ||\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\t...options,\n\t\t\t\tdefaultValue: {},\n\t\t\t\thooks: {\n\t\t\t\t\tafterPatch: options.hooks?.afterPatch,\n\t\t\t\t\tbeforePatch: (nextValue, nextState, component, key) => {\n\t\t\t\t\t\tif (typeof options.hooks?.beforePatch === 'function') {\n\t\t\t\t\t\t\toptions.hooks?.beforePatch(nextValue, nextState, component, key);\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},\n\t\t);\n\t});\n};\n","import type { IconsHorizontalPropType, KoliBriIconsProp, KoliBriIconsState } from '../../schema';\nimport { isIcon, isString, mapIconProp2State, parseJson } from '../../schema';\nimport type { Prop } from './helpers/factory';\nimport { createPropDefinition } from './helpers/factory';\n\n/**\n * Horizontal icons prop for form fields\n *\n * Description:\n * Icons rendered at the start (`left`) and end (`right`) of an input, as an object, as a JSON\n * string when it is passed through an HTML attribute, or as a single icon class that is placed\n * on the left. The value is normalized to an icon object per position.\n *\n * Accessibility:\n * - Icons are decorative unless they carry a `label` (WCAG 1.1.1 Non-text Content)\n *\n * @see https://www.w3.org/WAI/WCAG21/Understanding/non-text-content.html\n */\nexport type HorizontalIconsProp = Prop<'icons', IconsHorizontalPropType, KoliBriIconsState>;\n\nconst isIconPosition = (value: unknown): boolean => isString(value, 0) || isIcon(value);\n\nfunction normalizeHorizontalIcons(value: unknown): KoliBriIconsState | never {\n\tlet parsed = value;\n\tif (typeof value === 'string') {\n\t\ttry {\n\t\t\tparsed = parseJson<KoliBriIconsProp>(value);\n\t\t} catch {\n\t\t\t// A plain icon class is no JSON and stays a string.\n\t\t}\n\t}\n\tif (isString(parsed, 1)) {\n\t\treturn mapIconProp2State(parsed as KoliBriIconsProp);\n\t}\n\tif (typeof parsed === 'object' && parsed !== null) {\n\t\tconst icons = parsed as Record<string, unknown>;\n\t\tif (Object.keys(icons).length === 0 || ['left', 'right', 'top', 'bottom'].some((position) => isIconPosition(icons[position]))) {\n\t\t\treturn mapIconProp2State(parsed as KoliBriIconsProp);\n\t\t}\n\t}\n\tthrow new Error(`Invalid icons: ${typeof value}`);\n}\n\nexport const horizontalIconsProp = createPropDefinition<HorizontalIconsProp>('icons', {}, normalizeHorizontalIcons);\n","import { h } from '@stencil/core';\nimport type { VNode } from '@stencil/core/internal';\nimport type { IconOrIconClass, KoliBriHorizontalIcons } from '../../../schema';\nimport { ButtonFC } from '../button/component';\nimport type { ButtonItemFcProps } from '../button/item';\nimport { IconFC } from '../icon/component';\n\ntype InputAdornmentsOptions = {\n\ticons?: KoliBriHorizontalIcons;\n\t/** The smart button, resolved by `getSmartButtonFcProps` of the form field base. */\n\tsmartButton?: ButtonItemFcProps;\n\t/** Field-specific content before the left icon, e.g. the step-down button of `kol-input-number`. */\n\tstartAdornment?: VNode | null;\n\t/** Field-specific content after the smart button and the right icon, e.g. the clear button. */\n\tendAdornment?: VNode | null;\n};\n\nconst renderIcon = (icon?: IconOrIconClass): VNode | null => {\n\tif (!icon) {\n\t\treturn null;\n\t}\n\treturn typeof icon === 'string' ? (\n\t\t<IconFC class=\"kol-input-container__icon\" icons={icon} label=\"\" />\n\t) : (\n\t\t<IconFC class=\"kol-input-container__icon\" icons={icon.icon} label={icon.label ?? ''} style={icon.style} />\n\t);\n};\n\n/**\n * Adornments of `InputContainerFC`: the field-specific start content and the left icon at the start;\n * the smart button, the right icon and the field-specific end content at the end.\n */\nexport const getInputAdornments = ({\n\ticons,\n\tsmartButton,\n\tstartAdornment,\n\tendAdornment,\n}: InputAdornmentsOptions): { startAdornment: VNode[]; endAdornment: VNode[] } => ({\n\tstartAdornment: [startAdornment ?? null, renderIcon(icons?.left)].filter(Boolean) as VNode[],\n\tendAdornment: [smartButton ? <ButtonFC {...smartButton} /> : null, renderIcon(icons?.right), endAdornment ?? null].filter(Boolean) as VNode[],\n});\n","import { h, type FunctionalComponent as FC } from '@stencil/core';\nimport type { JSXBase, VNode } from '@stencil/core/internal';\nimport { getMsgType, isMsgDefinedAndInputTouched, type MsgPropType, type Stringified } from '../../../schema';\nimport { bem } from '../../../schema/bem-registry';\nimport clsx from '../../../utils/clsx';\nimport { BemRootNodeFC } from '../bem-root-node/component';\n\nconst inputContainerBem = bem.forBlock('kol-input-container');\n\ntype InputAdornmentType = VNode | VNode[] | null;\n\nexport type InputAdornmentFCProps = JSXBase.HTMLAttributes<HTMLDivElement> & {\n\tposition?: 'start' | 'end';\n};\n\n/** Slot before or after the input, e.g. for icons or the smart button. */\nexport const InputAdornmentFC: FC<InputAdornmentFCProps> = ({ position = 'start', class: className, ...other }, children) => (\n\t<div class={clsx(inputContainerBem('adornment', { [position]: true }), className)} {...other}>\n\t\t{children}\n\t</div>\n);\n\nexport type InputContainerFCProps = JSXBase.HTMLAttributes<HTMLDivElement> & {\n\tstartAdornment?: InputAdornmentType;\n\tendAdornment?: InputAdornmentType;\n\tdisabled?: boolean;\n\tmsg?: Stringified<MsgPropType>;\n\ttouched?: boolean;\n};\n\nfunction hasItems(items?: InputAdornmentType): boolean {\n\tif (!items) {\n\t\treturn false;\n\t}\n\n\treturn Array.isArray(items) ? items.length > 0 : Boolean(items);\n}\n\n/** Box around the native control of a field. Both adornments render as soon as one of them has content. */\nexport const InputContainerFC: FC<InputContainerFCProps> = (props, children) => {\n\tconst { class: classNames, startAdornment, endAdornment, disabled, msg, touched, ...other } = props;\n\tconst withAdornments = hasItems(startAdornment) || hasItems(endAdornment);\n\n\treturn (\n\t\t<BemRootNodeFC\n\t\t\tblock=\"kol-input-container\"\n\t\t\tmodifiers={{\n\t\t\t\tdisabled: Boolean(disabled),\n\t\t\t\t...(isMsgDefinedAndInputTouched(msg, touched) ? { [getMsgType(msg) as string]: true } : {}),\n\t\t\t}}\n\t\t\tclass={classNames}\n\t\t\t{...other}\n\t\t>\n\t\t\t{withAdornments && <InputAdornmentFC position=\"start\">{startAdornment}</InputAdornmentFC>}\n\t\t\t<div class={inputContainerBem('container')}>{children}</div>\n\t\t\t{withAdornments && <InputAdornmentFC position=\"end\">{endAdornment}</InputAdornmentFC>}\n\t\t</BemRootNodeFC>\n\t);\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;AA0BA,MAAM,aAAa,GAAG,CAAC,KAAwB,EAAE,SAAwB,EAAE,IAA2C,KAAI;AACzH,IAAA,IAAI,QAAQ,CAAC,IAAI,CAAC,EAAE;AACnB,QAAA,KAAK,CAAC,SAAS,CAAC,GAAG,IAAyB;;AACtC,SAAA,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE;QAC7B,KAAK,CAAC,SAAS,CAAC,GAAG;AAClB,YAAA,IAAI,EAAE,IAAwB;SAC9B;;AAEH,CAAC;AAEM,MAAM,iBAAiB,GAAG,CAAC,IAAsB,KAAuB;IAC9E,IAAI,KAAK,GAAsB,EAAE;AACjC,IAAA,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE;AACtB,QAAA,KAAK,GAAG;AACP,YAAA,IAAI,EAAE;AACL,gBAAA,IAAI,EAAE,IAAwB;AAC9B,aAAA;SACD;;SACK,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,EAAE;QACrD,aAAa,CAAC,KAAK,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GAAA,KAAK,EAAf,KAAK,UAAK,KAAK,EAA7F,CAAqF,OAAA,EAAA,gBAAA,EAAA,cAAA,EAAA,UAAA,EAAA,KAAA,EAAA,SAAA,CAAA,CAAQ;IACnG,MAAM,cAAc,GAAG,QAAQ,CAAC,cAAc,CAAC,IAAI,QAAQ,CAAC,YAAY,CAAC;IAEzE,QACC,EAAC,aAAa,EAAA,MAAA,CAAA,MAAA,CAAA,EACb,KAAK,EAAC,qBAAqB,EAC3B,SAAS,EAAA,MAAA,CAAA,MAAA,CAAA,EACR,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,KACvB,2BAA2B,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,GAAG,CAAW,GAAG,IAAI,EAAE,GAAG,EAAE,IAE3F,KAAK,EAAE,UAAU,EAAA,EACb,KAAK,CAAA,EAER,cAAc,IAAI,EAAC,gBAAgB,EAAA,EAAC,QAAQ,EAAC,OAAO,EAAE,EAAA,cAAc,CAAoB,EACzF,CAAK,CAAA,KAAA,EAAA,EAAA,KAAK,EAAE,iBAAiB,CAAC,WAAW,CAAC,EAAA,EAAG,QAAQ,CAAO,EAC3D,cAAc,IAAI,CAAA,CAAC,gBAAgB,EAAA,EAAC,QAAQ,EAAC,KAAK,EAAA,EAAE,YAAY,CAAoB,CACtE;AAElB;;;;"}
@@ -0,0 +1,5 @@
1
+ /*!
2
+ * KoliBri - The accessible HTML-Standard
3
+ */
4
+ import{o}from"./ariaCurrentService-YoLNpD5S.js";import{s as t}from"./common-BqpMtheU.js";import{n as e}from"./dev.utils-DDqySnXB.js";import{c as r}from"./element-interaction-Cy9tx3Sx.js";import{d as n,K as i}from"./events-CRHxtwup.js";import{B as s}from"./base-web-component-3R1Dy3QK.js";import{T as l}from"./behavior-D1kOlK6p.js";import{r as c}from"./resolve-props-DrFDeILa.js";const f=f=>{const a=new l(s.stateLess);const d=r();const p=e();let u;let m="";let v;let j;let y=false;const D=()=>typeof(u===null||u===void 0?void 0:u.href)==="string"?u.href:"";const b=()=>{const o=u===null||u===void 0?void 0:u.label;return typeof o==="string"&&o.length>0?o:D()};const h=o=>{const t=o===(u===null||u===void 0?void 0:u.href)?u.ariaCurrentValue:"";if(m!==t){m=t;if(!y){f()}}};const x=o=>{a.hideTooltip();if((u===null||u===void 0?void 0:u.disabled)===true){o.preventDefault();return}const e=D();const r=u===null||u===void 0?void 0:u.on;if(typeof(r===null||r===void 0?void 0:r.onClick)==="function"){t(o,d.el);r.onClick(o,e)}if(v){n(v,i.click,e)}};const C=o=>{if(o){v=o}};return{getFcProps:(t,e)=>{u=c(t);if(!j){y=true;j=o(h);y=false}a.componentWillLoad({label:b(),align:u.tooltipAlign});return Object.assign(Object.assign(Object.assign({},u),e),{ariaCurrent:m,ariaDescriptionId:p,expertSlot:t._label==="",handleAnchorClick:x,ref:C,refAnchor:d,refTooltip:a.setTooltipElementRef})},syncListeners:()=>{if(d.el){a.syncListeners(undefined,d.el,true)}},destroy:()=>{j===null||j===void 0?void 0:j();j=undefined;a.destroy()}}};export{f as c};
5
+ //# sourceMappingURL=item-BacIXvMT.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"item-C6p5wW-z.js","sources":["src/internal/functional-components/link/item.ts"],"sourcesContent":["import type { JSXBase } from '@stencil/core/internal';\n\nimport { onLocationChange, type UnsubscribeFunction } from '../../../components/link/ariaCurrentService';\nimport type { AlignPropType } from '../../../schema';\nimport { setEventTarget } from '../../../schema';\nimport { nonce } from '../../../utils/dev.utils';\nimport { createCtaRef } from '../../../utils/element-interaction';\nimport { dispatchDomEvent, KolEvent } from '../../../utils/events';\nimport { BaseWebComponent } from '../base-web-component';\nimport { TooltipBehavior } from '../tooltip/behavior';\nimport type { LinkFCProps } from './component';\nimport type { EmbeddedLinkProps, ResolvedLinkProps } from './resolve-props';\nimport { resolveLinkProps } from './resolve-props';\n\n/** Attributes the embedding component puts on the `.kol-link` root, e.g. its BEM element class. */\nexport type LinkItemRootAttributes = Pick<JSXBase.HTMLAttributes<HTMLElement>, 'class'>;\n\n/**\n * One orchestrated link embedded in another component's shadow DOM: everything `LinkFC` needs to\n * render, plus the lifecycle hooks the surrounding web component has to drive. The counterpart of\n * `button/item.ts`.\n *\n * Besides the tooltip behavior, the anchor ref and the description id, the item keeps the\n * `aria-current` state of the link: it follows the location like the link elements do and asks the\n * embedding component to render again when it changes.\n */\nexport type LinkItem = {\n\t/**\n\t * Resolves the link for the current render pass. Call once per render, so changed props take\n\t * effect.\n\t */\n\tgetFcProps(props: EmbeddedLinkProps, rootAttributes?: LinkItemRootAttributes): LinkFCProps;\n\t/** Re-registers the tooltip listeners. Call from `componentDidRender`. */\n\tsyncListeners(): void;\n\t/** Tears down the tooltip behavior and the location subscription. Call from `disconnectedCallback`. */\n\tdestroy(): void;\n};\n\n/**\n * @param requestRender - Renders the embedding component again, after the location changed the\n * `aria-current` state of the link.\n */\nexport const createLinkItem = (requestRender: () => void): LinkItem => {\n\tconst tooltipBehavior = new TooltipBehavior(BaseWebComponent.stateLess);\n\tconst ctaRef = createCtaRef<HTMLAnchorElement>();\n\tconst ariaDescriptionId = nonce();\n\tlet resolved: ResolvedLinkProps | undefined;\n\tlet ariaCurrent = '';\n\tlet rootElement: HTMLElement | undefined;\n\tlet unsubscribe: UnsubscribeFunction | undefined;\n\tlet subscribing = false;\n\n\tconst getHref = (): string => (typeof resolved?.href === 'string' ? resolved.href : '');\n\n\tconst getTooltipLabel = (): string => {\n\t\tconst label = resolved?.label;\n\t\treturn typeof label === 'string' && label.length > 0 ? label : getHref();\n\t};\n\n\tconst handleLocationChange = (location: string): void => {\n\t\tconst next = location === resolved?.href ? (resolved.ariaCurrentValue as string) : '';\n\t\tif (ariaCurrent !== next) {\n\t\t\tariaCurrent = next;\n\t\t\t// The subscription calls back synchronously once while the render pass subscribes.\n\t\t\tif (!subscribing) {\n\t\t\t\trequestRender();\n\t\t\t}\n\t\t}\n\t};\n\n\tconst handleAnchorClick = (event: Event): void => {\n\t\ttooltipBehavior.hideTooltip();\n\t\tif (resolved?.disabled === true) {\n\t\t\tevent.preventDefault();\n\t\t\treturn;\n\t\t}\n\t\tconst href = getHref();\n\t\tconst on = resolved?.on;\n\t\tif (typeof on?.onClick === 'function') {\n\t\t\tsetEventTarget(event, ctaRef.el);\n\t\t\ton.onClick(event, href);\n\t\t}\n\t\tif (rootElement) {\n\t\t\tdispatchDomEvent(rootElement, KolEvent.click, href);\n\t\t}\n\t};\n\n\tconst refRoot = (element?: HTMLElement): void => {\n\t\tif (element) {\n\t\t\trootElement = element;\n\t\t}\n\t};\n\n\treturn {\n\t\tgetFcProps: (props: EmbeddedLinkProps, rootAttributes?: LinkItemRootAttributes): LinkFCProps => {\n\t\t\tresolved = resolveLinkProps(props);\n\t\t\tif (!unsubscribe) {\n\t\t\t\tsubscribing = true;\n\t\t\t\tunsubscribe = onLocationChange(handleLocationChange);\n\t\t\t\tsubscribing = false;\n\t\t\t}\n\t\t\ttooltipBehavior.componentWillLoad({\n\t\t\t\tlabel: getTooltipLabel(),\n\t\t\t\talign: resolved.tooltipAlign as AlignPropType,\n\t\t\t});\n\n\t\t\treturn {\n\t\t\t\t...resolved,\n\t\t\t\t...rootAttributes,\n\t\t\t\tariaCurrent,\n\t\t\t\tariaDescriptionId,\n\t\t\t\texpertSlot: props._label === '',\n\t\t\t\thandleAnchorClick,\n\t\t\t\tref: refRoot,\n\t\t\t\trefAnchor: ctaRef,\n\t\t\t\trefTooltip: tooltipBehavior.setTooltipElementRef,\n\t\t\t} as LinkFCProps;\n\t\t},\n\t\tsyncListeners: (): void => {\n\t\t\tif (ctaRef.el) {\n\t\t\t\ttooltipBehavior.syncListeners(undefined, ctaRef.el, true);\n\t\t\t}\n\t\t},\n\t\tdestroy: (): void => {\n\t\t\tunsubscribe?.();\n\t\t\tunsubscribe = undefined;\n\t\t\ttooltipBehavior.destroy();\n\t\t},\n\t};\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AA0Ca,MAAA,cAAc,GAAG,CAAC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WAAW;gBACX,iBAAiB,EACjB,UAAU,EAAE,KAAK,CAAC,MAAM,KAAK,EAAE,EAC/B,iBAAiB,EACjB,GAAG,EAAE,OAAO,EACZ,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,eAAe,CAAC,oBAAoB,EAAA,CACjC;SAChB;QACD,aAAa,EAAE,MAAW;AACzB,YAAA,IAAI,MAAM,CAAC,EAAE,EAAE;gBACd,eAAe,CAAC,aAAa,CAAC,SAAS,EAAE,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC;;SAE1D;QACD,OAAO,EAAE,MAAW;AACnB,YAAA,WAAW,KAAX,IAAA,IAAA,WAAW,KAAX,MAAA,GAAA,MAAA,GAAA,WAAW,EAAI;YACf,WAAW,GAAG,SAAS;YACvB,eAAe,CAAC,OAAO,EAAE;SACzB;KACD;AACF;;;;"}
1
+ {"version":3,"file":"item-BacIXvMT.js","sources":["src/internal/functional-components/link/item.ts"],"sourcesContent":["import type { JSXBase } from '@stencil/core/internal';\n\nimport { onLocationChange, type UnsubscribeFunction } from '../../../components/link/ariaCurrentService';\nimport type { AlignPropType } from '../../../schema';\nimport { setEventTarget } from '../../../schema';\nimport { nonce } from '../../../utils/dev.utils';\nimport { createCtaRef } from '../../../utils/element-interaction';\nimport { dispatchDomEvent, KolEvent } from '../../../utils/events';\nimport { BaseWebComponent } from '../base-web-component';\nimport { TooltipBehavior } from '../tooltip/behavior';\nimport type { LinkFCProps } from './component';\nimport type { EmbeddedLinkProps, ResolvedLinkProps } from './resolve-props';\nimport { resolveLinkProps } from './resolve-props';\n\n/** Attributes the embedding component puts on the `.kol-link` root, e.g. its BEM element class. */\nexport type LinkItemRootAttributes = Pick<JSXBase.HTMLAttributes<HTMLElement>, 'class'>;\n\n/**\n * One orchestrated link embedded in another component's shadow DOM: everything `LinkFC` needs to\n * render, plus the lifecycle hooks the surrounding web component has to drive. The counterpart of\n * `button/item.ts`.\n *\n * Besides the tooltip behavior, the anchor ref and the description id, the item keeps the\n * `aria-current` state of the link: it follows the location like the link elements do and asks the\n * embedding component to render again when it changes.\n */\nexport type LinkItem = {\n\t/**\n\t * Resolves the link for the current render pass. Call once per render, so changed props take\n\t * effect.\n\t */\n\tgetFcProps(props: EmbeddedLinkProps, rootAttributes?: LinkItemRootAttributes): LinkFCProps;\n\t/** Re-registers the tooltip listeners. Call from `componentDidRender`. */\n\tsyncListeners(): void;\n\t/** Tears down the tooltip behavior and the location subscription. Call from `disconnectedCallback`. */\n\tdestroy(): void;\n};\n\n/**\n * @param requestRender - Renders the embedding component again, after the location changed the\n * `aria-current` state of the link.\n */\nexport const createLinkItem = (requestRender: () => void): LinkItem => {\n\tconst tooltipBehavior = new TooltipBehavior(BaseWebComponent.stateLess);\n\tconst ctaRef = createCtaRef<HTMLAnchorElement>();\n\tconst ariaDescriptionId = nonce();\n\tlet resolved: ResolvedLinkProps | undefined;\n\tlet ariaCurrent = '';\n\tlet rootElement: HTMLElement | undefined;\n\tlet unsubscribe: UnsubscribeFunction | undefined;\n\tlet subscribing = false;\n\n\tconst getHref = (): string => (typeof resolved?.href === 'string' ? resolved.href : '');\n\n\tconst getTooltipLabel = (): string => {\n\t\tconst label = resolved?.label;\n\t\treturn typeof label === 'string' && label.length > 0 ? label : getHref();\n\t};\n\n\tconst handleLocationChange = (location: string): void => {\n\t\tconst next = location === resolved?.href ? (resolved.ariaCurrentValue as string) : '';\n\t\tif (ariaCurrent !== next) {\n\t\t\tariaCurrent = next;\n\t\t\t// The subscription calls back synchronously once while the render pass subscribes.\n\t\t\tif (!subscribing) {\n\t\t\t\trequestRender();\n\t\t\t}\n\t\t}\n\t};\n\n\tconst handleAnchorClick = (event: Event): void => {\n\t\ttooltipBehavior.hideTooltip();\n\t\tif (resolved?.disabled === true) {\n\t\t\tevent.preventDefault();\n\t\t\treturn;\n\t\t}\n\t\tconst href = getHref();\n\t\tconst on = resolved?.on;\n\t\tif (typeof on?.onClick === 'function') {\n\t\t\tsetEventTarget(event, ctaRef.el);\n\t\t\ton.onClick(event, href);\n\t\t}\n\t\tif (rootElement) {\n\t\t\tdispatchDomEvent(rootElement, KolEvent.click, href);\n\t\t}\n\t};\n\n\tconst refRoot = (element?: HTMLElement): void => {\n\t\tif (element) {\n\t\t\trootElement = element;\n\t\t}\n\t};\n\n\treturn {\n\t\tgetFcProps: (props: EmbeddedLinkProps, rootAttributes?: LinkItemRootAttributes): LinkFCProps => {\n\t\t\tresolved = resolveLinkProps(props);\n\t\t\tif (!unsubscribe) {\n\t\t\t\tsubscribing = true;\n\t\t\t\tunsubscribe = onLocationChange(handleLocationChange);\n\t\t\t\tsubscribing = false;\n\t\t\t}\n\t\t\ttooltipBehavior.componentWillLoad({\n\t\t\t\tlabel: getTooltipLabel(),\n\t\t\t\talign: resolved.tooltipAlign as AlignPropType,\n\t\t\t});\n\n\t\t\treturn {\n\t\t\t\t...resolved,\n\t\t\t\t...rootAttributes,\n\t\t\t\tariaCurrent,\n\t\t\t\tariaDescriptionId,\n\t\t\t\texpertSlot: props._label === '',\n\t\t\t\thandleAnchorClick,\n\t\t\t\tref: refRoot,\n\t\t\t\trefAnchor: ctaRef,\n\t\t\t\trefTooltip: tooltipBehavior.setTooltipElementRef,\n\t\t\t} as LinkFCProps;\n\t\t},\n\t\tsyncListeners: (): void => {\n\t\t\tif (ctaRef.el) {\n\t\t\t\ttooltipBehavior.syncListeners(undefined, ctaRef.el, true);\n\t\t\t}\n\t\t},\n\t\tdestroy: (): void => {\n\t\t\tunsubscribe?.();\n\t\t\tunsubscribe = undefined;\n\t\t\ttooltipBehavior.destroy();\n\t\t},\n\t};\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AA0Ca,MAAA,cAAc,GAAG,CAAC,aAAyB,KAAc;IACrE,MAAM,eAAe,GAAG,IAAI,eAAe,CAAC,gBAAgB,CAAC,SAAS,CAAC;AACvE,IAAA,MAAM,MAAM,GAAG,YAAY,EAAqB;AAChD,IAAA,MAAM,iBAAiB,GAAG,KAAK,EAAE;AACjC,IAAA,IAAI,QA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D,aAAa,EAAE,MAAW;AACzB,YAAA,IAAI,MAAM,CAAC,EAAE,EAAE;gBACd,eAAe,CAAC,aAAa,CAAC,SAAS,EAAE,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC;;SAE1D;QACD,OAAO,EAAE,MAAW;AACnB,YAAA,WAAW,KAAX,IAAA,IAAA,WAAW,KAAX,MAAA,GAAA,MAAA,GAAA,WAAW,EAAI;YACf,WAAW,GAAG,SAAS;YACvB,eAAe,CAAC,OAAO,EAAE;SACzB;KACD;AACF;;;;"}
@@ -0,0 +1,5 @@
1
+ /*!
2
+ * KoliBri - The accessible HTML-Standard
3
+ */
4
+ import{X as o}from"./common-BqpMtheU.js";import{n as s,c as t}from"./dev.utils-DDqySnXB.js";import{c as e}from"./element-interaction-Cy9tx3Sx.js";import{d as a,K as n}from"./events-CRHxtwup.js";import{e as r,a as i,c as l,d as m}from"./api-BvTefIaj.js";import{d as p}from"./disabled-CdyeAMlW.js";import{a as c,c as d,g as f,h as j,i as v,l as u,d as b,s as g,t as D,e as y,v as C}from"./variant-CeijQFzL.js";import{B as O,d as h}from"./base-web-component-3R1Dy3QK.js";import{l as w}from"./label-with-expert-slot-CocPu9HB.js";import{p as x,a as B}from"./component-CHz6TLzY.js";import{r as H}from"./resolve-props-YWmoYL6c.js";import{i as L,T as q}from"./behavior-D1kOlK6p.js";import{n as z}from"./name-D8963H-v.js";const K={required:[w],optional:[c,d,r,i,l,m,f,p,j,L,v,u,z,x,b,g,D,y,C]};const T=r=>{var i;const l=new B(O.stateLess);const c=new q(O.stateLess);const d=e();let f;let u;const b=h(K);delete b.tabIndex;const D=o=>{p.apply(o,(o=>{b.disabled=o}))};D(r.disabled);j.apply(r.hideLabel,(o=>{b.hideLabel=o}));g.apply(r.icons,(o=>{b.icons=o}));v.apply(false,(o=>{b.inline=o}));y.apply("top",(o=>{b.tooltipAlign=o}));m.apply("button",(o=>{b.type=o}));w.apply(r.label,(o=>{b.label=o}));let L=x.getDefaultValue();x.apply(r.popoverAlign,(o=>{L=o}));b.popoverAlign=L;l.componentWillLoad({align:L});C.apply((i=o("buttonVariantDefault",r.getFlagHost()))!==null&&i!==void 0?i:"normal",(o=>{b.variant=o}));b.ariaDescriptionId=s();b.popoverId=t("popover");const z=o=>{const s=r.getEventTarget?r.getEventTarget():u;if(s){a(s,o)}};const T=o=>{r.setOpen(o.newState==="open")};b.handleClick=o=>{o.stopPropagation();c.hideTooltip();l.setShow(!r.getOpen());z(n.click)};b.handleMouseDown=()=>z(n.mousedown);b.handleFocus=()=>z(n.focus);b.handleBlur=()=>z(n.blur);b.refButton=o=>{d(o);l.setTriggerElement(o)};b.refPopover=o=>{f=o;l.setPopoverElementRef(o)};b.refTooltip=c.setTooltipElementRef;const Y=o=>{u=o};const F=()=>{c.componentWillLoad({label:b.label,align:b.tooltipAlign})};const M=o=>{var s,t;const e=H(Object.assign(Object.assign({},o),{_on:undefined,_variant:(s=o._variant)!==null&&s!==void 0?s:"normal"}),r.getFlagHost());b.accessKey=e.accessKey;b.ariaDescription=e.ariaDescription;b.customClass=e.customClass;b.disabled=e.disabled;b.hideLabel=e.hideLabel;b.icons=e.icons;b.id=e.id;b.inline=e.inline;b.label=e.label;b.name=e.name;b.shortKey=e.shortKey;b.tabIndex=e.tabIndex;b.tooltipAlign=e.tooltipAlign;b.type=e.type;b.variant=e.variant;x.apply((t=o._popoverAlign)!==null&&t!==void 0?t:"bottom",(o=>{b.popoverAlign=o;l.watchAlign(o)}));F()};F();return{getFcProps:o=>{if(o){M(o)}return Object.assign(Object.assign({},b),{popoverOpen:r.getOpen(),ref:Y})},hide:()=>l.setShow(false),setDisabled:D,syncListeners:()=>{if(d.el){c.syncListeners(undefined,d.el,true)}f===null||f===void 0?void 0:f.addEventListener("toggle",T)},destroy:()=>{c.destroy();if(f){f.removeEventListener("toggle",T);f=undefined}l.destroy()}}};export{T as c};
5
+ //# sourceMappingURL=item-DewHrd_f.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"item-CHP-bw8Q.js","sources":["src/internal/functional-components/popover-button/api.tsx","src/internal/functional-components/popover-button/item.ts"],"sourcesContent":["import {\n\taccessKeyProp,\n\tariaDescriptionProp,\n\tariaHasPopupProp,\n\tariaSelectedProp,\n\tbuttonCallbacksProp,\n\tbuttonTypeProp,\n\tcustomClassProp,\n\tdisabledProp,\n\thideLabelProp,\n\tidProp,\n\tinlineProp,\n\tlabelWithExpertSlotProp,\n\tlinkRoleProp,\n\tnameProp,\n\tpopoverAlignProp,\n\tshortKeyProp,\n\tspanIconsProp,\n\ttabIndexProp,\n\ttooltipAlignProp,\n\tvariantProp,\n} from '../../props';\nimport type { ApiFromConfig, PropsConfigShape, WebComponentInterface } from '../generic-types';\n\n/**\n * Props configuration for the popover button component.\n *\n * `label` is the only required prop. All others are optional.\n *\n * Notes on prop choices:\n * - `buttonCallbacksProp`, `ariaHasPopupProp`, `ariaSelectedProp` and `linkRoleProp` are carried\n * because `ButtonFC` requires the full button prop surface. The popover button never exposes\n * them: the click callback is reserved for toggling the popover and the ARIA attributes are not\n * rendered, so their store entries keep the `''` sentinel and the element watchers are omitted\n * (same rationale as `ariaHasPopup` on `ButtonApi`).\n * - `ariaControls` and `ariaExpanded` are deliberately absent: the component renders them itself,\n * pointing at the popover element and reflecting its open state.\n * - `_syncValueBySelector` and `_value` are deliberately absent: neither is rendered, and both are\n * opaque pass-throughs to `FormAssociationBehavior` (inherited from `BaseButtonWebComponent`).\n * They stay raw `@Prop`s on the web component, which forwards them from their watchers.\n */\nexport const popoverButtonPropsConfig = {\n\trequired: [labelWithExpertSlotProp],\n\toptional: [\n\t\taccessKeyProp,\n\t\tariaDescriptionProp,\n\t\tariaHasPopupProp,\n\t\tariaSelectedProp,\n\t\tbuttonCallbacksProp,\n\t\tbuttonTypeProp,\n\t\tcustomClassProp,\n\t\tdisabledProp,\n\t\thideLabelProp,\n\t\tidProp,\n\t\tinlineProp,\n\t\tlinkRoleProp,\n\t\tnameProp,\n\t\tpopoverAlignProp,\n\t\tshortKeyProp,\n\t\tspanIconsProp,\n\t\ttabIndexProp,\n\t\ttooltipAlignProp,\n\t\tvariantProp,\n\t],\n} as const satisfies PropsConfigShape;\n\nexport type PopoverButtonApi = ApiFromConfig<\n\ttypeof popoverButtonPropsConfig,\n\t{\n\t\tCallbacks: {\n\t\t\t/**\n\t\t\t * Blur handler bound to the button element. Implemented by the web component, which also\n\t\t\t * dispatches the custom `KolEvent.blur` event on the host element.\n\t\t\t */\n\t\t\tblur: (event: FocusEvent) => void;\n\t\t\t/**\n\t\t\t * Click handler bound to the button element. Implemented by the web component; toggles the\n\t\t\t * popover and dispatches `KolEvent.click`. Not exposed as a consumer callback.\n\t\t\t */\n\t\t\tclick: (event: MouseEvent) => void;\n\t\t\t/**\n\t\t\t * Focus handler bound to the button element. Implemented by the web component, which also\n\t\t\t * dispatches the custom `KolEvent.focus` event on the host element.\n\t\t\t */\n\t\t\tfocus: (event: FocusEvent) => void;\n\t\t\t/**\n\t\t\t * Mousedown handler bound to the button element. Implemented by the web component, which\n\t\t\t * also dispatches the custom `KolEvent.mousedown` event on the host element.\n\t\t\t */\n\t\t\tmouseDown: (event: MouseEvent) => void;\n\t\t};\n\t\tRefs: {\n\t\t\tbutton: HTMLButtonElement;\n\t\t\tpopover: HTMLDivElement;\n\t\t\ttooltip: HTMLDivElement;\n\t\t};\n\t\tStates: {\n\t\t\t/**\n\t\t\t * DOM id of the visually-hidden span that carries the aria description, referenced by the\n\t\t\t * button's aria-describedby attribute (aria-description lacks screen reader support).\n\t\t\t */\n\t\t\tariaDescriptionId: string;\n\t\t\t/**\n\t\t\t * Whether the popover is currently open. Derived from the native popover `toggle` event,\n\t\t\t * so class modifier and `aria-expanded` always match the real popover state.\n\t\t\t */\n\t\t\tpopoverOpen: boolean;\n\t\t\t/**\n\t\t\t * DOM id of the popover element, referenced by the button's aria-controls attribute.\n\t\t\t * Generated once per web component instance and never changed afterwards.\n\t\t\t */\n\t\t\tpopoverId: string;\n\t\t};\n\t}\n>;\n\n/**\n * Web component interface for the public `kol-popover-button`.\n *\n * `_id` is an internal prop of the functional component, not part of the public element.\n * `on` is never a consumer prop: its click callback is reserved for toggling the popover. Both\n * are part of `PopoverButtonApi`, but their watchers are omitted here instead of being declared\n * as no-ops.\n */\nexport type PopoverButtonWebComponentInterface = Omit<\n\tWebComponentInterface<PopoverButtonApi>,\n\t'watchAriaHasPopup' | 'watchId' | 'watchOn' | 'watchRole' | 'watchAriaSelected'\n>;\n","import { getFeatureFlag } from 'adopted-style-sheets';\n\nimport type { AlignPropType, IconsPropType, InternalButtonProps, LabelWithExpertSlotPropType, PopoverButtonProps } from '../../../schema';\nimport { createUniqueId, nonce } from '../../../utils/dev.utils';\nimport { createCtaRef } from '../../../utils/element-interaction';\nimport { dispatchDomEvent, KolEvent } from '../../../utils/events';\nimport {\n\tbuttonTypeProp,\n\tdisabledProp,\n\thideLabelProp,\n\tinlineProp,\n\tlabelWithExpertSlotProp,\n\tpopoverAlignProp,\n\tspanIconsProp,\n\ttooltipAlignProp,\n\tvariantProp,\n} from '../../props';\nimport { BaseWebComponent } from '../base-web-component';\nimport { resolveButtonProps } from '../button/resolve-props';\nimport { PopoverBehavior } from '../popover/behavior';\nimport { buildDefaultPropsFromConfig } from '../props-from-config';\nimport { TooltipBehavior } from '../tooltip/behavior';\nimport { popoverButtonPropsConfig } from './api';\nimport type { PopoverButtonFCProps } from './component';\n\n/**\n * One orchestrated popover button embedded in another component's shadow DOM: everything\n * `PopoverButtonFC` needs to render, plus the lifecycle hooks the surrounding web component has to\n * drive.\n *\n * It exists because `PopoverButtonFC` is stateless while the popover is not — the toggle\n * behavior, the open state, the tooltip behavior and three element refs have to live somewhere.\n * `BasePopoverButtonWebComponent` owns exactly that for the `kol-popover-button` elements, but a\n * component that embeds the popover button *next to* its own button (`kol-split-button`) needs a\n * second, independent set of them and cannot inherit it. The item is a plain object with closures,\n * like `breadcrumb/link-item.ts`, so the embedding component composes it instead of inheriting it.\n *\n * The open state is not kept here: it belongs to the embedding component as a reactive `@State()`\n * field, reached through the `getOpen`/`setOpen` accessors, so toggling re-renders the host.\n */\nexport type PopoverButtonItem = {\n\t/**\n\t * Fully resolved props for `PopoverButtonFC`, with the current open state applied. With\n\t * `popoverButtonProps`, the toggle button is resolved from them for this render pass, the way the\n\t * popover button elements resolve their `@Prop`s; call once per render then.\n\t */\n\tgetFcProps(popoverButtonProps?: PopoverButtonProps): PopoverButtonFCProps;\n\t/** Closes the popover programmatically. */\n\thide(): void;\n\t/** Applies a changed `disabled` value; call from the embedding component's watcher. */\n\tsetDisabled(value?: boolean): void;\n\t/** Re-registers tooltip and toggle listeners. Call from `componentDidRender`. */\n\tsyncListeners(): void;\n\t/** Tears down listeners, the popover behavior and the tooltip behavior. */\n\tdestroy(): void;\n};\n\nexport type PopoverButtonItemOptions = {\n\t/** Whether the toggle button starts disabled. */\n\tdisabled?: boolean;\n\t/**\n\t * Element the synthetic `KolEvent` DOM events are dispatched on, an ancestor of the button inside\n\t * the embedding component's shadow DOM; they bubble out to the consumer from there. Defaults to\n\t * the `.kol-popover-button` root.\n\t */\n\tgetEventTarget?: () => HTMLElement | undefined;\n\t/** Element the theme-scoped `buttonVariantDefault` feature flag is resolved against. */\n\tgetFlagHost: () => HTMLElement | undefined;\n\t/** Reads the embedding component's reactive open state. */\n\tgetOpen: () => boolean;\n\t/** Hides the label and renders it as a tooltip instead. */\n\thideLabel?: boolean;\n\t/** Icon classnames of the toggle button. */\n\ticons?: IconsPropType;\n\t/** Visible or semantic label of the toggle button. */\n\tlabel?: LabelWithExpertSlotPropType;\n\t/** Where to show the popover preferably. */\n\tpopoverAlign?: AlignPropType;\n\t/** Writes the embedding component's reactive open state. */\n\tsetOpen: (open: boolean) => void;\n};\n\nexport const createPopoverButtonItem = (options: PopoverButtonItemOptions): PopoverButtonItem => {\n\tconst popoverBehavior = new PopoverBehavior(BaseWebComponent.stateLess);\n\tconst tooltipBehavior = new TooltipBehavior(BaseWebComponent.stateLess);\n\tconst ctaRef = createCtaRef<HTMLButtonElement>();\n\tlet popoverElement: HTMLDivElement | undefined;\n\tlet rootElement: HTMLElement | undefined;\n\n\tconst props = buildDefaultPropsFromConfig(popoverButtonPropsConfig);\n\n\t// An unset tabindex must not render as `tabindex=\"0\"` — buttons are natively tabbable and the\n\t// attribute would pin them into the document tab order.\n\tdelete props.tabIndex;\n\n\tconst applyDisabled = (value?: boolean): void => {\n\t\tdisabledProp.apply(value, (v) => {\n\t\t\tprops.disabled = v;\n\t\t});\n\t};\n\n\tapplyDisabled(options.disabled);\n\thideLabelProp.apply(options.hideLabel, (v) => {\n\t\tprops.hideLabel = v;\n\t});\n\tspanIconsProp.apply(options.icons, (v) => {\n\t\tprops.icons = v;\n\t});\n\t// `inlineProp` defaults to `true`, `tooltipAlignProp` to `'right'` — both are shared with the\n\t// link. The popover button elements declare `false` and `'top'` as their `@Prop` defaults, so\n\t// the embedded button has to restate them; leaving them out renders a different button.\n\tinlineProp.apply(false, (v) => {\n\t\tprops.inline = v;\n\t});\n\ttooltipAlignProp.apply('top', (v) => {\n\t\tprops.tooltipAlign = v;\n\t});\n\tbuttonTypeProp.apply('button', (v) => {\n\t\tprops.type = v;\n\t});\n\tlabelWithExpertSlotProp.apply(options.label, (v) => {\n\t\tprops.label = v;\n\t});\n\t// An invalid `popoverAlign` is ignored, so the behavior loads with the default then.\n\tlet popoverAlign = popoverAlignProp.getDefaultValue();\n\tpopoverAlignProp.apply(options.popoverAlign, (v) => {\n\t\tpopoverAlign = v;\n\t});\n\tprops.popoverAlign = popoverAlign;\n\tpopoverBehavior.componentWillLoad({ align: popoverAlign });\n\tvariantProp.apply(getFeatureFlag('buttonVariantDefault', options.getFlagHost()) ?? 'normal', (v) => {\n\t\tprops.variant = v;\n\t});\n\n\tprops.ariaDescriptionId = nonce();\n\tprops.popoverId = createUniqueId('popover');\n\n\tconst dispatch = (event: KolEvent): void => {\n\t\tconst target = options.getEventTarget ? options.getEventTarget() : rootElement;\n\t\tif (target) {\n\t\t\tdispatchDomEvent(target, event);\n\t\t}\n\t};\n\n\tconst handleToggle = (event: Event): void => {\n\t\toptions.setOpen((event as ToggleEvent).newState === 'open');\n\t};\n\n\tprops.handleClick = (event: MouseEvent): void => {\n\t\tevent.stopPropagation();\n\t\ttooltipBehavior.hideTooltip();\n\t\tpopoverBehavior.setShow(!options.getOpen());\n\t\tdispatch(KolEvent.click);\n\t};\n\tprops.handleMouseDown = (): void => dispatch(KolEvent.mousedown);\n\tprops.handleFocus = (): void => dispatch(KolEvent.focus);\n\tprops.handleBlur = (): void => dispatch(KolEvent.blur);\n\n\tprops.refButton = (element?: HTMLButtonElement): void => {\n\t\tctaRef(element);\n\t\tpopoverBehavior.setTriggerElement(element);\n\t};\n\tprops.refPopover = (element?: HTMLDivElement): void => {\n\t\tpopoverElement = element;\n\t\tpopoverBehavior.setPopoverElementRef(element);\n\t};\n\tprops.refTooltip = tooltipBehavior.setTooltipElementRef;\n\n\tconst refRoot = (element?: HTMLElement): void => {\n\t\trootElement = element;\n\t};\n\n\tconst loadTooltip = (): void => {\n\t\ttooltipBehavior.componentWillLoad({\n\t\t\tlabel: props.label as string,\n\t\t\talign: props.tooltipAlign as AlignPropType,\n\t\t});\n\t};\n\n\t/*\n\t * The `@Prop` defaults of the popover button elements: they equal those of the button elements,\n\t * except for the variant, which is `normal` instead of the `buttonVariantDefault` feature flag.\n\t */\n\tconst applyPopoverButtonProps = (popoverButtonProps: PopoverButtonProps): void => {\n\t\tconst resolved = resolveButtonProps(\n\t\t\t{ ...popoverButtonProps, _on: undefined, _variant: popoverButtonProps._variant ?? 'normal' } as InternalButtonProps,\n\t\t\toptions.getFlagHost(),\n\t\t);\n\t\tprops.accessKey = resolved.accessKey;\n\t\tprops.ariaDescription = resolved.ariaDescription;\n\t\tprops.customClass = resolved.customClass;\n\t\tprops.disabled = resolved.disabled;\n\t\tprops.hideLabel = resolved.hideLabel;\n\t\tprops.icons = resolved.icons;\n\t\tprops.id = resolved.id;\n\t\tprops.inline = resolved.inline;\n\t\tprops.label = resolved.label;\n\t\tprops.name = resolved.name;\n\t\tprops.shortKey = resolved.shortKey;\n\t\tprops.tabIndex = resolved.tabIndex;\n\t\tprops.tooltipAlign = resolved.tooltipAlign;\n\t\tprops.type = resolved.type;\n\t\tprops.variant = resolved.variant;\n\t\tpopoverAlignProp.apply(popoverButtonProps._popoverAlign ?? 'bottom', (v) => {\n\t\t\tprops.popoverAlign = v;\n\t\t\tpopoverBehavior.watchAlign(v);\n\t\t});\n\t\tloadTooltip();\n\t};\n\n\tloadTooltip();\n\n\treturn {\n\t\tgetFcProps: (popoverButtonProps?: PopoverButtonProps): PopoverButtonFCProps => {\n\t\t\tif (popoverButtonProps) {\n\t\t\t\tapplyPopoverButtonProps(popoverButtonProps);\n\t\t\t}\n\t\t\treturn { ...props, popoverOpen: options.getOpen(), ref: refRoot } as PopoverButtonFCProps;\n\t\t},\n\t\thide: (): void => popoverBehavior.setShow(false),\n\t\tsetDisabled: applyDisabled,\n\t\tsyncListeners: (): void => {\n\t\t\tif (ctaRef.el) {\n\t\t\t\ttooltipBehavior.syncListeners(undefined, ctaRef.el, true);\n\t\t\t}\n\t\t\t// addEventListener is idempotent for an identical listener, so per-render calls are safe.\n\t\t\tpopoverElement?.addEventListener('toggle', handleToggle);\n\t\t},\n\t\tdestroy: (): void => {\n\t\t\ttooltipBehavior.destroy();\n\t\t\tif (popoverElement) {\n\t\t\t\tpopoverElement.removeEventListener('toggle', handleToggle);\n\t\t\t\tpopoverElement = undefined;\n\t\t\t}\n\t\t\tpopoverBehavior.destroy();\n\t\t},\n\t};\n};\n"],"names":["getFeatureFlag"],"mappings":";;;;;;;;;;;;;;;;;AAyCO,MAAM,wBAAwB,GAAG;IACvC,QAAQ,EAAE,CAAC,uBAAuB,CAAC;AACnC,IAAA,QAAQ,EAAE;QACT,aAAa;QACb,mBAAmB;QACnB,gBAAgB;QAChB,gBAAgB;QAChB,mBAAmB;QACnB,cAAc;QACd,eAAe;QACf,YAAY;QACZ,aAAa;QACb,MAAM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,CAAC,CAAC,KAAI;AAC1E,YAAA,KAAK,CAAC,YAAY,GAAG,CAAC;AACtB,YAAA,eAAe,CAAC,UAAU,CAAC,CAAC,CAAC;AAC9B,SAAC,CAAC;AACF,QAAA,WAAW,EAAE;AACd,KAAC;AAED,IAAA,WAAW,EAAE;IAEb,OAAO;AACN,QAAA,UAAU,EAAE,CAAC,kBAAuC,KAA0B;YAC7E,IAAI,kBAAkB,EAAE;gBACvB,uBAAuB,CAAC,kBAAkB,CAAC;;YAE5C,OAAO,MAAK,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAA,KAAK,CAAE,EAAA,EAAA,WAAW,EAAE,OAAO,CAAC,OAAO,EAAE,EAAE,GAAG,EAAE,OAAO,GAA0B;SACzF;QACD,IAAI,EAAE,MAAY,eAAe,CAAC,OAAO,CAAC,KAAK,CAAC;AAChD,QAAA,WAAW,EAAE,aAAa;QAC1B,aAAa,EAAE,MAAW;AACzB,YAAA,IAAI,MAAM,CAAC,EAAE,EAAE;gBACd,eAAe,CAAC,aAAa,CAAC,SAAS,EAAE,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC;;YAG1D,cAAc,KAAA,IAAA,IAAd,cAAc,KAAA,MAAA,GAAA,MAAA,GAAd,cAAc,CAAE,gBAAgB,CAAC,QAAQ,EAAE,YAAY,CAAC;SACxD;QACD,OAAO,EAAE,MAAW;YACnB,eAAe,CAAC,OAAO,EAAE;YACzB,IAAI,cAAc,EAAE;AACnB,gBAAA,cAAc,CAAC,mBAAmB,CAAC,QAAQ,EAAE,YAAY,CAAC;gBAC1D,cAAc,GAAG,SAAS;;YAE3B,eAAe,CAAC,OAAO,EAAE;SACzB;KACD;AACF;;;;"}
1
+ {"version":3,"file":"item-DewHrd_f.js","sources":["src/internal/functional-components/popover-button/api.tsx","src/internal/functional-components/popover-button/item.ts"],"sourcesContent":["import {\n\taccessKeyProp,\n\tariaDescriptionProp,\n\tariaHasPopupProp,\n\tariaSelectedProp,\n\tbuttonCallbacksProp,\n\tbuttonTypeProp,\n\tcustomClassProp,\n\tdisabledProp,\n\thideLabelProp,\n\tidProp,\n\tinlineProp,\n\tlabelWithExpertSlotProp,\n\tlinkRoleProp,\n\tnameProp,\n\tpopoverAlignProp,\n\tshortKeyProp,\n\tspanIconsProp,\n\ttabIndexProp,\n\ttooltipAlignProp,\n\tvariantProp,\n} from '../../props';\nimport type { ApiFromConfig, PropsConfigShape, WebComponentInterface } from '../generic-types';\n\n/**\n * Props configuration for the popover button component.\n *\n * `label` is the only required prop. All others are optional.\n *\n * Notes on prop choices:\n * - `buttonCallbacksProp`, `ariaHasPopupProp`, `ariaSelectedProp` and `linkRoleProp` are carried\n * because `ButtonFC` requires the full button prop surface. The popover button never exposes\n * them: the click callback is reserved for toggling the popover and the ARIA attributes are not\n * rendered, so their store entries keep the `''` sentinel and the element watchers are omitted\n * (same rationale as `ariaHasPopup` on `ButtonApi`).\n * - `ariaControls` and `ariaExpanded` are deliberately absent: the component renders them itself,\n * pointing at the popover element and reflecting its open state.\n * - `_syncValueBySelector` and `_value` are deliberately absent: neither is rendered, and both are\n * opaque pass-throughs to `FormAssociationBehavior` (inherited from `BaseButtonWebComponent`).\n * They stay raw `@Prop`s on the web component, which forwards them from their watchers.\n */\nexport const popoverButtonPropsConfig = {\n\trequired: [labelWithExpertSlotProp],\n\toptional: [\n\t\taccessKeyProp,\n\t\tariaDescriptionProp,\n\t\tariaHasPopupProp,\n\t\tariaSelectedProp,\n\t\tbuttonCallbacksProp,\n\t\tbuttonTypeProp,\n\t\tcustomClassProp,\n\t\tdisabledProp,\n\t\thideLabelProp,\n\t\tidProp,\n\t\tinlineProp,\n\t\tlinkRoleProp,\n\t\tnameProp,\n\t\tpopoverAlignProp,\n\t\tshortKeyProp,\n\t\tspanIconsProp,\n\t\ttabIndexProp,\n\t\ttooltipAlignProp,\n\t\tvariantProp,\n\t],\n} as const satisfies PropsConfigShape;\n\nexport type PopoverButtonApi = ApiFromConfig<\n\ttypeof popoverButtonPropsConfig,\n\t{\n\t\tCallbacks: {\n\t\t\t/**\n\t\t\t * Blur handler bound to the button element. Implemented by the web component, which also\n\t\t\t * dispatches the custom `KolEvent.blur` event on the host element.\n\t\t\t */\n\t\t\tblur: (event: FocusEvent) => void;\n\t\t\t/**\n\t\t\t * Click handler bound to the button element. Implemented by the web component; toggles the\n\t\t\t * popover and dispatches `KolEvent.click`. Not exposed as a consumer callback.\n\t\t\t */\n\t\t\tclick: (event: MouseEvent) => void;\n\t\t\t/**\n\t\t\t * Focus handler bound to the button element. Implemented by the web component, which also\n\t\t\t * dispatches the custom `KolEvent.focus` event on the host element.\n\t\t\t */\n\t\t\tfocus: (event: FocusEvent) => void;\n\t\t\t/**\n\t\t\t * Mousedown handler bound to the button element. Implemented by the web component, which\n\t\t\t * also dispatches the custom `KolEvent.mousedown` event on the host element.\n\t\t\t */\n\t\t\tmouseDown: (event: MouseEvent) => void;\n\t\t};\n\t\tRefs: {\n\t\t\tbutton: HTMLButtonElement;\n\t\t\tpopover: HTMLDivElement;\n\t\t\ttooltip: HTMLDivElement;\n\t\t};\n\t\tStates: {\n\t\t\t/**\n\t\t\t * DOM id of the visually-hidden span that carries the aria description, referenced by the\n\t\t\t * button's aria-describedby attribute (aria-description lacks screen reader support).\n\t\t\t */\n\t\t\tariaDescriptionId: string;\n\t\t\t/**\n\t\t\t * Whether the popover is currently open. Derived from the native popover `toggle` event,\n\t\t\t * so class modifier and `aria-expanded` always match the real popover state.\n\t\t\t */\n\t\t\tpopoverOpen: boolean;\n\t\t\t/**\n\t\t\t * DOM id of the popover element, referenced by the button's aria-controls attribute.\n\t\t\t * Generated once per web component instance and never changed afterwards.\n\t\t\t */\n\t\t\tpopoverId: string;\n\t\t};\n\t}\n>;\n\n/**\n * Web component interface for the public `kol-popover-button`.\n *\n * `_id` is an internal prop of the functional component, not part of the public element.\n * `on` is never a consumer prop: its click callback is reserved for toggling the popover. Both\n * are part of `PopoverButtonApi`, but their watchers are omitted here instead of being declared\n * as no-ops.\n */\nexport type PopoverButtonWebComponentInterface = Omit<\n\tWebComponentInterface<PopoverButtonApi>,\n\t'watchAriaHasPopup' | 'watchId' | 'watchOn' | 'watchRole' | 'watchAriaSelected'\n>;\n","import { getFeatureFlag } from 'adopted-style-sheets';\n\nimport type { AlignPropType, IconsPropType, InternalButtonProps, LabelWithExpertSlotPropType, PopoverButtonProps } from '../../../schema';\nimport { createUniqueId, nonce } from '../../../utils/dev.utils';\nimport { createCtaRef } from '../../../utils/element-interaction';\nimport { dispatchDomEvent, KolEvent } from '../../../utils/events';\nimport {\n\tbuttonTypeProp,\n\tdisabledProp,\n\thideLabelProp,\n\tinlineProp,\n\tlabelWithExpertSlotProp,\n\tpopoverAlignProp,\n\tspanIconsProp,\n\ttooltipAlignProp,\n\tvariantProp,\n} from '../../props';\nimport { BaseWebComponent } from '../base-web-component';\nimport { resolveButtonProps } from '../button/resolve-props';\nimport { PopoverBehavior } from '../popover/behavior';\nimport { buildDefaultPropsFromConfig } from '../props-from-config';\nimport { TooltipBehavior } from '../tooltip/behavior';\nimport { popoverButtonPropsConfig } from './api';\nimport type { PopoverButtonFCProps } from './component';\n\n/**\n * One orchestrated popover button embedded in another component's shadow DOM: everything\n * `PopoverButtonFC` needs to render, plus the lifecycle hooks the surrounding web component has to\n * drive.\n *\n * It exists because `PopoverButtonFC` is stateless while the popover is not — the toggle\n * behavior, the open state, the tooltip behavior and three element refs have to live somewhere.\n * `BasePopoverButtonWebComponent` owns exactly that for the `kol-popover-button` elements, but a\n * component that embeds the popover button *next to* its own button (`kol-split-button`) needs a\n * second, independent set of them and cannot inherit it. The item is a plain object with closures,\n * like `breadcrumb/link-item.ts`, so the embedding component composes it instead of inheriting it.\n *\n * The open state is not kept here: it belongs to the embedding component as a reactive `@State()`\n * field, reached through the `getOpen`/`setOpen` accessors, so toggling re-renders the host.\n */\nexport type PopoverButtonItem = {\n\t/**\n\t * Fully resolved props for `PopoverButtonFC`, with the current open state applied. With\n\t * `popoverButtonProps`, the toggle button is resolved from them for this render pass, the way the\n\t * popover button elements resolve their `@Prop`s; call once per render then.\n\t */\n\tgetFcProps(popoverButtonProps?: PopoverButtonProps): PopoverButtonFCProps;\n\t/** Closes the popover programmatically. */\n\thide(): void;\n\t/** Applies a changed `disabled` value; call from the embedding component's watcher. */\n\tsetDisabled(value?: boolean): void;\n\t/** Re-registers tooltip and toggle listeners. Call from `componentDidRender`. */\n\tsyncListeners(): void;\n\t/** Tears down listeners, the popover behavior and the tooltip behavior. */\n\tdestroy(): void;\n};\n\nexport type PopoverButtonItemOptions = {\n\t/** Whether the toggle button starts disabled. */\n\tdisabled?: boolean;\n\t/**\n\t * Element the synthetic `KolEvent` DOM events are dispatched on, an ancestor of the button inside\n\t * the embedding component's shadow DOM; they bubble out to the consumer from there. Defaults to\n\t * the `.kol-popover-button` root.\n\t */\n\tgetEventTarget?: () => HTMLElement | undefined;\n\t/** Element the theme-scoped `buttonVariantDefault` feature flag is resolved against. */\n\tgetFlagHost: () => HTMLElement | undefined;\n\t/** Reads the embedding component's reactive open state. */\n\tgetOpen: () => boolean;\n\t/** Hides the label and renders it as a tooltip instead. */\n\thideLabel?: boolean;\n\t/** Icon classnames of the toggle button. */\n\ticons?: IconsPropType;\n\t/** Visible or semantic label of the toggle button. */\n\tlabel?: LabelWithExpertSlotPropType;\n\t/** Where to show the popover preferably. */\n\tpopoverAlign?: AlignPropType;\n\t/** Writes the embedding component's reactive open state. */\n\tsetOpen: (open: boolean) => void;\n};\n\nexport const createPopoverButtonItem = (options: PopoverButtonItemOptions): PopoverButtonItem => {\n\tconst popoverBehavior = new PopoverBehavior(BaseWebComponent.stateLess);\n\tconst tooltipBehavior = new TooltipBehavior(BaseWebComponent.stateLess);\n\tconst ctaRef = createCtaRef<HTMLButtonElement>();\n\tlet popoverElement: HTMLDivElement | undefined;\n\tlet rootElement: HTMLElement | undefined;\n\n\tconst props = buildDefaultPropsFromConfig(popoverButtonPropsConfig);\n\n\t// An unset tabindex must not render as `tabindex=\"0\"` — buttons are natively tabbable and the\n\t// attribute would pin them into the document tab order.\n\tdelete props.tabIndex;\n\n\tconst applyDisabled = (value?: boolean): void => {\n\t\tdisabledProp.apply(value, (v) => {\n\t\t\tprops.disabled = v;\n\t\t});\n\t};\n\n\tapplyDisabled(options.disabled);\n\thideLabelProp.apply(options.hideLabel, (v) => {\n\t\tprops.hideLabel = v;\n\t});\n\tspanIconsProp.apply(options.icons, (v) => {\n\t\tprops.icons = v;\n\t});\n\t// `inlineProp` defaults to `true`, `tooltipAlignProp` to `'right'` — both are shared with the\n\t// link. The popover button elements declare `false` and `'top'` as their `@Prop` defaults, so\n\t// the embedded button has to restate them; leaving them out renders a different button.\n\tinlineProp.apply(false, (v) => {\n\t\tprops.inline = v;\n\t});\n\ttooltipAlignProp.apply('top', (v) => {\n\t\tprops.tooltipAlign = v;\n\t});\n\tbuttonTypeProp.apply('button', (v) => {\n\t\tprops.type = v;\n\t});\n\tlabelWithExpertSlotProp.apply(options.label, (v) => {\n\t\tprops.label = v;\n\t});\n\t// An invalid `popoverAlign` is ignored, so the behavior loads with the default then.\n\tlet popoverAlign = popoverAlignProp.getDefaultValue();\n\tpopoverAlignProp.apply(options.popoverAlign, (v) => {\n\t\tpopoverAlign = v;\n\t});\n\tprops.popoverAlign = popoverAlign;\n\tpopoverBehavior.componentWillLoad({ align: popoverAlign });\n\tvariantProp.apply(getFeatureFlag('buttonVariantDefault', options.getFlagHost()) ?? 'normal', (v) => {\n\t\tprops.variant = v;\n\t});\n\n\tprops.ariaDescriptionId = nonce();\n\tprops.popoverId = createUniqueId('popover');\n\n\tconst dispatch = (event: KolEvent): void => {\n\t\tconst target = options.getEventTarget ? options.getEventTarget() : rootElement;\n\t\tif (target) {\n\t\t\tdispatchDomEvent(target, event);\n\t\t}\n\t};\n\n\tconst handleToggle = (event: Event): void => {\n\t\toptions.setOpen((event as ToggleEvent).newState === 'open');\n\t};\n\n\tprops.handleClick = (event: MouseEvent): void => {\n\t\tevent.stopPropagation();\n\t\ttooltipBehavior.hideTooltip();\n\t\tpopoverBehavior.setShow(!options.getOpen());\n\t\tdispatch(KolEvent.click);\n\t};\n\tprops.handleMouseDown = (): void => dispatch(KolEvent.mousedown);\n\tprops.handleFocus = (): void => dispatch(KolEvent.focus);\n\tprops.handleBlur = (): void => dispatch(KolEvent.blur);\n\n\tprops.refButton = (element?: HTMLButtonElement): void => {\n\t\tctaRef(element);\n\t\tpopoverBehavior.setTriggerElement(element);\n\t};\n\tprops.refPopover = (element?: HTMLDivElement): void => {\n\t\tpopoverElement = element;\n\t\tpopoverBehavior.setPopoverElementRef(element);\n\t};\n\tprops.refTooltip = tooltipBehavior.setTooltipElementRef;\n\n\tconst refRoot = (element?: HTMLElement): void => {\n\t\trootElement = element;\n\t};\n\n\tconst loadTooltip = (): void => {\n\t\ttooltipBehavior.componentWillLoad({\n\t\t\tlabel: props.label as string,\n\t\t\talign: props.tooltipAlign as AlignPropType,\n\t\t});\n\t};\n\n\t/*\n\t * The `@Prop` defaults of the popover button elements: they equal those of the button elements,\n\t * except for the variant, which is `normal` instead of the `buttonVariantDefault` feature flag.\n\t */\n\tconst applyPopoverButtonProps = (popoverButtonProps: PopoverButtonProps): void => {\n\t\tconst resolved = resolveButtonProps(\n\t\t\t{ ...popoverButtonProps, _on: undefined, _variant: popoverButtonProps._variant ?? 'normal' } as InternalButtonProps,\n\t\t\toptions.getFlagHost(),\n\t\t);\n\t\tprops.accessKey = resolved.accessKey;\n\t\tprops.ariaDescription = resolved.ariaDescription;\n\t\tprops.customClass = resolved.customClass;\n\t\tprops.disabled = resolved.disabled;\n\t\tprops.hideLabel = resolved.hideLabel;\n\t\tprops.icons = resolved.icons;\n\t\tprops.id = resolved.id;\n\t\tprops.inline = resolved.inline;\n\t\tprops.label = resolved.label;\n\t\tprops.name = resolved.name;\n\t\tprops.shortKey = resolved.shortKey;\n\t\tprops.tabIndex = resolved.tabIndex;\n\t\tprops.tooltipAlign = resolved.tooltipAlign;\n\t\tprops.type = resolved.type;\n\t\tprops.variant = resolved.variant;\n\t\tpopoverAlignProp.apply(popoverButtonProps._popoverAlign ?? 'bottom', (v) => {\n\t\t\tprops.popoverAlign = v;\n\t\t\tpopoverBehavior.watchAlign(v);\n\t\t});\n\t\tloadTooltip();\n\t};\n\n\tloadTooltip();\n\n\treturn {\n\t\tgetFcProps: (popoverButtonProps?: PopoverButtonProps): PopoverButtonFCProps => {\n\t\t\tif (popoverButtonProps) {\n\t\t\t\tapplyPopoverButtonProps(popoverButtonProps);\n\t\t\t}\n\t\t\treturn { ...props, popoverOpen: options.getOpen(), ref: refRoot } as PopoverButtonFCProps;\n\t\t},\n\t\thide: (): void => popoverBehavior.setShow(false),\n\t\tsetDisabled: applyDisabled,\n\t\tsyncListeners: (): void => {\n\t\t\tif (ctaRef.el) {\n\t\t\t\ttooltipBehavior.syncListeners(undefined, ctaRef.el, true);\n\t\t\t}\n\t\t\t// addEventListener is idempotent for an identical listener, so per-render calls are safe.\n\t\t\tpopoverElement?.addEventListener('toggle', handleToggle);\n\t\t},\n\t\tdestroy: (): void => {\n\t\t\ttooltipBehavior.destroy();\n\t\t\tif (popoverElement) {\n\t\t\t\tpopoverElement.removeEventListener('toggle', handleToggle);\n\t\t\t\tpopoverElement = undefined;\n\t\t\t}\n\t\t\tpopoverBehavior.destroy();\n\t\t},\n\t};\n};\n"],"names":["getFeatureFlag"],"mappings":";;;;;;;;;;;;;;;;;AAyCO,MAAM,wBAAwB,GAAG;IACvC,QAAQ,EAAE,CAAC,uBAAuB,CAAC;AACnC,IAAA,QAAQ,EAAE;QACT,aAAa;QACb,mBAAmB;QACnB,gBAAgB;QAChB,gBAAgB;QAChB,mBAAmB;QACnB,cAAc;QACd,eAAe;QACf,YAAY;QACZ,aAAa;QACb,MAAM;QACN,UAAU;QACV,YAAY;QACZ,QAAQ;QACR,gBAAgB;QAChB,YAAY;QACZ,aAAa;QACb,YAAY;QACZ,gBAAgB;QAChB,WAAW;AACX,KAAA;CACmC;;ACkBxB,MAAA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AAW,EAAE;AACd,KAAC;AAED,IAAA,WAAW,EAAE;IAEb,OAAO;AACN,QAAA,UAAU,EAAE,CAAC,kBAAuC,KAA0B;YAC7E,IAAI,kBAAkB,EAAE;gBACvB,uBAAuB,CAAC,kBAAkB,CAAC;;YAE5C,OAAO,MAAK,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAA,KAAK,CAAE,EAAA,EAAA,WAAW,EAAE,OAAO,CAAC,OAAO,EAAE,EAAE,GAAG,EAAE,OAAO,GAA0B;SACzF;QACD,IAAI,EAAE,MAAY,eAAe,CAAC,OAAO,CAAC,KAAK,CAAC;AAChD,QAAA,WAAW,EAAE,aAAa;QAC1B,aAAa,EAAE,MAAW;AACzB,YAAA,IAAI,MAAM,CAAC,EAAE,EAAE;gBACd,eAAe,CAAC,aAAa,CAAC,SAAS,EAAE,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC;;YAG1D,cAAc,KAAA,IAAA,IAAd,cAAc,KAAA,MAAA,GAAA,MAAA,GAAd,cAAc,CAAE,gBAAgB,CAAC,QAAQ,EAAE,YAAY,CAAC;SACxD;QACD,OAAO,EAAE,MAAW;YACnB,eAAe,CAAC,OAAO,EAAE;YACzB,IAAI,cAAc,EAAE;AACnB,gBAAA,cAAc,CAAC,mBAAmB,CAAC,QAAQ,EAAE,YAAY,CAAC;gBAC1D,cAAc,GAAG,SAAS;;YAE3B,eAAe,CAAC,OAAO,EAAE;SACzB;KACD;AACF;;;;"}
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * KoliBri - The accessible HTML-Standard
3
3
  */
4
- import{p as o,a as e}from"./controller-D1hrFVo3.js";import{s as t}from"./common-BqpMtheU.js";import{n}from"./dev.utils-CJMVCYWh.js";import{c as s}from"./element-interaction-Cy9tx3Sx.js";import{d as i,K as r}from"./events-CRHxtwup.js";import{B as l}from"./base-web-component-3R1Dy3QK.js";import{T as d}from"./behavior-D1kOlK6p.js";import{r as c}from"./resolve-props-YWmoYL6c.js";const a=a=>{const m=new d(l.stateLess);const v=s();const f=n();let u;let p;let j;const b=(o,e)=>{if(j){i(j,o,e)}};const h=n=>{n.stopPropagation();m.hideTooltip();if((u===null||u===void 0?void 0:u.type)==="submit"){o({form:j})}else if((u===null||u===void 0?void 0:u.type)==="reset"){e({form:j})}else{const o=u===null||u===void 0?void 0:u.on.onClick;if(typeof o==="function"){t(n,v.el);o(n,p)}}b(r.click,p)};const y=o=>{var e,t;(t=u===null||u===void 0?void 0:(e=u.on).onMouseDown)===null||t===void 0?void 0:t.call(e,o);b(r.mousedown)};const C=o=>{var e,t;(t=u===null||u===void 0?void 0:(e=u.on).onFocus)===null||t===void 0?void 0:t.call(e,o);b(r.focus)};const D=o=>{var e,t;(t=u===null||u===void 0?void 0:(e=u.on).onBlur)===null||t===void 0?void 0:t.call(e,o);b(r.blur)};const g=o=>{if(o){j=o}};return{getFcProps:(o,e)=>{u=c(o,a());p=o._value;m.componentWillLoad({label:u.label,align:u.tooltipAlign});return Object.assign(Object.assign(Object.assign({},u),e),{ariaDescriptionId:f,handleBlur:D,handleClick:h,handleFocus:C,handleMouseDown:y,ref:g,refButton:v,refTooltip:m.setTooltipElementRef})},getElement:()=>v.el,getRootElement:()=>j,syncListeners:()=>{if(v.el){m.syncListeners(undefined,v.el,true)}},destroy:()=>{m.destroy()}}};export{a as c};
5
- //# sourceMappingURL=item-Cbi_ZY6o.js.map
4
+ import{p as o,a as e}from"./controller-D1hrFVo3.js";import{s as t}from"./common-BqpMtheU.js";import{n}from"./dev.utils-DDqySnXB.js";import{c as s}from"./element-interaction-Cy9tx3Sx.js";import{d as i,K as r}from"./events-CRHxtwup.js";import{B as l}from"./base-web-component-3R1Dy3QK.js";import{T as d}from"./behavior-D1kOlK6p.js";import{r as c}from"./resolve-props-YWmoYL6c.js";const a=a=>{const m=new d(l.stateLess);const v=s();const f=n();let u;let p;let j;const b=(o,e)=>{if(j){i(j,o,e)}};const h=n=>{n.stopPropagation();m.hideTooltip();if((u===null||u===void 0?void 0:u.type)==="submit"){o({form:j})}else if((u===null||u===void 0?void 0:u.type)==="reset"){e({form:j})}else{const o=u===null||u===void 0?void 0:u.on.onClick;if(typeof o==="function"){t(n,v.el);o(n,p)}}b(r.click,p)};const D=o=>{var e,t;(t=u===null||u===void 0?void 0:(e=u.on).onMouseDown)===null||t===void 0?void 0:t.call(e,o);b(r.mousedown)};const y=o=>{var e,t;(t=u===null||u===void 0?void 0:(e=u.on).onFocus)===null||t===void 0?void 0:t.call(e,o);b(r.focus)};const B=o=>{var e,t;(t=u===null||u===void 0?void 0:(e=u.on).onBlur)===null||t===void 0?void 0:t.call(e,o);b(r.blur)};const g=o=>{if(o){j=o}};return{getFcProps:(o,e)=>{u=c(o,a());p=o._value;m.componentWillLoad({label:u.label,align:u.tooltipAlign});return Object.assign(Object.assign(Object.assign({},u),e),{ariaDescriptionId:f,handleBlur:B,handleClick:h,handleFocus:y,handleMouseDown:D,ref:g,refButton:v,refTooltip:m.setTooltipElementRef})},getElement:()=>v.el,getRootElement:()=>j,syncListeners:()=>{if(v.el){m.syncListeners(undefined,v.el,true)}},destroy:()=>{m.destroy()}}};export{a as c};
5
+ //# sourceMappingURL=item-lEB6GAqe.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"item-Cbi_ZY6o.js","sources":["src/internal/functional-components/button/item.ts"],"sourcesContent":["import type { JSXBase } from '@stencil/core/internal';\n\nimport { propagateResetEventToForm, propagateSubmitEventToForm } from '../../../components/form/controller';\nimport type { InternalButtonProps, StencilUnknown } from '../../../schema';\nimport { setEventTarget } from '../../../schema';\nimport { nonce } from '../../../utils/dev.utils';\nimport { createCtaRef } from '../../../utils/element-interaction';\nimport { dispatchDomEvent, KolEvent } from '../../../utils/events';\nimport { BaseWebComponent } from '../base-web-component';\nimport type { FunctionalComponentProps } from '../generic-types';\nimport { TooltipBehavior } from '../tooltip/behavior';\nimport type { ButtonApi } from './api';\nimport type { ResolvedButtonProps } from './resolve-props';\nimport { resolveButtonProps } from './resolve-props';\n\n/**\n * Attributes the embedding component puts on the `.kol-button` root, e.g. its BEM element class,\n * a `data-testid`, `hidden` or listeners for the `KolEvent` DOM events of the button.\n */\nexport type ButtonItemRootAttributes = Partial<Pick<JSXBase.HTMLAttributes<HTMLElement>, 'aria-current' | 'class' | 'hidden' | 'onBlur' | 'onFocus'>> & {\n\t[dataAttribute: `data-${string}`]: string;\n};\n\n/** Everything `ButtonFC` needs for one render pass, plus the ref of its root element. */\nexport type ButtonItemFcProps = FunctionalComponentProps<ButtonApi> &\n\tButtonItemRootAttributes & {\n\t\t/**\n\t\t * Ref of the `.kol-button` root. The `KolEvent` DOM events are dispatched on it: it stands where\n\t\t * the host of a separate button element would stand, so the events bubble along the same path.\n\t\t */\n\t\tref: (element?: HTMLElement) => void;\n\t};\n\n/**\n * One orchestrated button embedded in another component's shadow DOM: everything `ButtonFC` needs\n * to render, plus the lifecycle hooks the surrounding web component has to drive.\n *\n * `ButtonFC` is stateless, but an embedded button is not: its tooltip behavior, its event handlers,\n * its element refs and its description id have to live somewhere. The item is a plain object with\n * closures, like `popover-button/item.ts`, so the embedding component composes one per button.\n *\n * The button's form association is absent: an embedded button carries no `_name`, so there is no\n * form value to write.\n */\nexport type ButtonItem = {\n\t/**\n\t * Resolves the button for the current render pass. Call once per render, so changed props such\n\t * as `_disabled` or `_label` take effect.\n\t */\n\tgetFcProps(props: InternalButtonProps, rootAttributes?: ButtonItemRootAttributes): ButtonItemFcProps;\n\t/** The rendered `<button>`, once it is in the DOM. */\n\tgetElement(): HTMLButtonElement | undefined;\n\t/** The `.kol-button` root, once it is in the DOM. */\n\tgetRootElement(): HTMLElement | undefined;\n\t/** Re-registers the tooltip listeners. Call from `componentDidRender`. */\n\tsyncListeners(): void;\n\t/** Tears down the tooltip behavior. Call from `disconnectedCallback`. */\n\tdestroy(): void;\n};\n\n/**\n * @param getFlagHost - Element the theme-scoped `buttonVariantDefault` feature flag is resolved against.\n */\nexport const createButtonItem = (getFlagHost: () => HTMLElement | undefined): ButtonItem => {\n\tconst tooltipBehavior = new TooltipBehavior(BaseWebComponent.stateLess);\n\tconst ctaRef = createCtaRef<HTMLButtonElement>();\n\tconst ariaDescriptionId = nonce();\n\tlet resolved: ResolvedButtonProps | undefined;\n\tlet value: StencilUnknown;\n\tlet rootElement: HTMLElement | undefined;\n\n\tconst dispatch = (event: KolEvent, detail?: unknown): void => {\n\t\tif (rootElement) {\n\t\t\tdispatchDomEvent(rootElement, event, detail);\n\t\t}\n\t};\n\n\tconst handleClick = (event: MouseEvent): void => {\n\t\tevent.stopPropagation();\n\t\ttooltipBehavior.hideTooltip();\n\n\t\tif (resolved?.type === 'submit') {\n\t\t\tpropagateSubmitEventToForm({ form: rootElement, ref: ctaRef.el });\n\t\t} else if (resolved?.type === 'reset') {\n\t\t\tpropagateResetEventToForm({ form: rootElement, ref: ctaRef.el });\n\t\t} else {\n\t\t\tconst onClick = resolved?.on.onClick;\n\t\t\tif (typeof onClick === 'function') {\n\t\t\t\tsetEventTarget(event, ctaRef.el);\n\t\t\t\tonClick(event, value);\n\t\t\t}\n\t\t}\n\n\t\tdispatch(KolEvent.click, value);\n\t};\n\n\tconst handleMouseDown = (event: MouseEvent): void => {\n\t\tresolved?.on.onMouseDown?.(event);\n\t\tdispatch(KolEvent.mousedown);\n\t};\n\n\tconst handleFocus = (event: FocusEvent): void => {\n\t\tresolved?.on.onFocus?.(event);\n\t\tdispatch(KolEvent.focus);\n\t};\n\n\tconst handleBlur = (event: FocusEvent): void => {\n\t\tresolved?.on.onBlur?.(event);\n\t\tdispatch(KolEvent.blur);\n\t};\n\n\t/*\n\t * Keeps the last root when Stencil resets the ref: a click that removes the button (e.g. a clear\n\t * button clearing its own field) resets the ref before the button loses the focus, and the blur\n\t * still has to be dispatched from where the button stood.\n\t */\n\tconst refRoot = (element?: HTMLElement): void => {\n\t\tif (element) {\n\t\t\trootElement = element;\n\t\t}\n\t};\n\n\treturn {\n\t\tgetFcProps: (props: InternalButtonProps, rootAttributes?: ButtonItemRootAttributes): ButtonItemFcProps => {\n\t\t\tresolved = resolveButtonProps(props, getFlagHost());\n\t\t\tvalue = props._value;\n\n\t\t\ttooltipBehavior.componentWillLoad({\n\t\t\t\tlabel: resolved.label,\n\t\t\t\talign: resolved.tooltipAlign,\n\t\t\t});\n\n\t\t\treturn {\n\t\t\t\t...resolved,\n\t\t\t\t...rootAttributes,\n\t\t\t\tariaDescriptionId,\n\t\t\t\thandleBlur,\n\t\t\t\thandleClick,\n\t\t\t\thandleFocus,\n\t\t\t\thandleMouseDown,\n\t\t\t\tref: refRoot,\n\t\t\t\trefButton: ctaRef,\n\t\t\t\trefTooltip: tooltipBehavior.setTooltipElementRef,\n\t\t\t};\n\t\t},\n\t\tgetElement: (): HTMLButtonElement | undefined => ctaRef.el,\n\t\tgetRootElement: (): HTMLElement | undefined => rootElement,\n\t\tsyncListeners: (): void => {\n\t\t\tif (ctaRef.el) {\n\t\t\t\ttooltipBehavior.syncListeners(undefined, ctaRef.el, true);\n\t\t\t}\n\t\t},\n\t\tdestroy: (): void => {\n\t\t\ttooltipBehavior.destroy();\n\t\t},\n\t};\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AA+Da,MAAA,gBAAgB,GAAG,CAAC,WAA0C,KAAgB;IAC1F,MAAM,eAAe,GAAG,IAAI,eAAe,CAAC,gBAAgB,CAAC,SAAS,CAAC;AACvE,IAAA,MAAM,MAAM,GAAG,YAAY,EAAqB;AAChD,IAAA,MAAM,iBAAiB,GAAG,KAAK,EAAE;AACjC,IAAA,IAAI,QAAyC;AAC7C,IAAA,IAAI,KAAqB;AACzB,IAAA,IAAI,WAAoC;AAExC,IAAA,MAAM,QAAQ,GAAG,CAAC,KAAe,EAAE,MAAgB,KAAU;QAC5D,IAAI,WAAW,EAAE;AAChB,YAAA,gBAAgB,CAAC,WAAW,EAAE,KAAK,EAAE,MAAM,CAAC;;AAE9C,KAAC;AAED,IAAA,MAAM,WAAW,GAAG,CAAC,KAAiB,KAAU;QAC/C,KAAK,C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AE,OAAO,EACZ,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,eAAe,CAAC,oBAAoB,EAC/C,CAAA;SACF;AACD,QAAA,UAAU,EAAE,MAAqC,MAAM,CAAC,EAAE;AAC1D,QAAA,cAAc,EAAE,MAA+B,WAAW;QAC1D,aAAa,EAAE,MAAW;AACzB,YAAA,IAAI,MAAM,CAAC,EAAE,EAAE;gBACd,eAAe,CAAC,aAAa,CAAC,SAAS,EAAE,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC;;SAE1D;QACD,OAAO,EAAE,MAAW;YACnB,eAAe,CAAC,OAAO,EAAE;SACzB;KACD;AACF;;;;"}
1
+ {"version":3,"file":"item-lEB6GAqe.js","sources":["src/internal/functional-components/button/item.ts"],"sourcesContent":["import type { JSXBase } from '@stencil/core/internal';\n\nimport { propagateResetEventToForm, propagateSubmitEventToForm } from '../../../components/form/controller';\nimport type { InternalButtonProps, StencilUnknown } from '../../../schema';\nimport { setEventTarget } from '../../../schema';\nimport { nonce } from '../../../utils/dev.utils';\nimport { createCtaRef } from '../../../utils/element-interaction';\nimport { dispatchDomEvent, KolEvent } from '../../../utils/events';\nimport { BaseWebComponent } from '../base-web-component';\nimport type { FunctionalComponentProps } from '../generic-types';\nimport { TooltipBehavior } from '../tooltip/behavior';\nimport type { ButtonApi } from './api';\nimport type { ResolvedButtonProps } from './resolve-props';\nimport { resolveButtonProps } from './resolve-props';\n\n/**\n * Attributes the embedding component puts on the `.kol-button` root, e.g. its BEM element class,\n * a `data-testid`, `hidden` or listeners for the `KolEvent` DOM events of the button.\n */\nexport type ButtonItemRootAttributes = Partial<Pick<JSXBase.HTMLAttributes<HTMLElement>, 'aria-current' | 'class' | 'hidden' | 'onBlur' | 'onFocus'>> & {\n\t[dataAttribute: `data-${string}`]: string;\n};\n\n/** Everything `ButtonFC` needs for one render pass, plus the ref of its root element. */\nexport type ButtonItemFcProps = FunctionalComponentProps<ButtonApi> &\n\tButtonItemRootAttributes & {\n\t\t/**\n\t\t * Ref of the `.kol-button` root. The `KolEvent` DOM events are dispatched on it: it stands where\n\t\t * the host of a separate button element would stand, so the events bubble along the same path.\n\t\t */\n\t\tref: (element?: HTMLElement) => void;\n\t};\n\n/**\n * One orchestrated button embedded in another component's shadow DOM: everything `ButtonFC` needs\n * to render, plus the lifecycle hooks the surrounding web component has to drive.\n *\n * `ButtonFC` is stateless, but an embedded button is not: its tooltip behavior, its event handlers,\n * its element refs and its description id have to live somewhere. The item is a plain object with\n * closures, like `popover-button/item.ts`, so the embedding component composes one per button.\n *\n * The button's form association is absent: an embedded button carries no `_name`, so there is no\n * form value to write.\n */\nexport type ButtonItem = {\n\t/**\n\t * Resolves the button for the current render pass. Call once per render, so changed props such\n\t * as `_disabled` or `_label` take effect.\n\t */\n\tgetFcProps(props: InternalButtonProps, rootAttributes?: ButtonItemRootAttributes): ButtonItemFcProps;\n\t/** The rendered `<button>`, once it is in the DOM. */\n\tgetElement(): HTMLButtonElement | undefined;\n\t/** The `.kol-button` root, once it is in the DOM. */\n\tgetRootElement(): HTMLElement | undefined;\n\t/** Re-registers the tooltip listeners. Call from `componentDidRender`. */\n\tsyncListeners(): void;\n\t/** Tears down the tooltip behavior. Call from `disconnectedCallback`. */\n\tdestroy(): void;\n};\n\n/**\n * @param getFlagHost - Element the theme-scoped `buttonVariantDefault` feature flag is resolved against.\n */\nexport const createButtonItem = (getFlagHost: () => HTMLElement | undefined): ButtonItem => {\n\tconst tooltipBehavior = new TooltipBehavior(BaseWebComponent.stateLess);\n\tconst ctaRef = createCtaRef<HTMLButtonElement>();\n\tconst ariaDescriptionId = nonce();\n\tlet resolved: ResolvedButtonProps | undefined;\n\tlet value: StencilUnknown;\n\tlet rootElement: HTMLElement | undefined;\n\n\tconst dispatch = (event: KolEvent, detail?: unknown): void => {\n\t\tif (rootElement) {\n\t\t\tdispatchDomEvent(rootElement, event, detail);\n\t\t}\n\t};\n\n\tconst handleClick = (event: MouseEvent): void => {\n\t\tevent.stopPropagation();\n\t\ttooltipBehavior.hideTooltip();\n\n\t\tif (resolved?.type === 'submit') {\n\t\t\tpropagateSubmitEventToForm({ form: rootElement, ref: ctaRef.el });\n\t\t} else if (resolved?.type === 'reset') {\n\t\t\tpropagateResetEventToForm({ form: rootElement, ref: ctaRef.el });\n\t\t} else {\n\t\t\tconst onClick = resolved?.on.onClick;\n\t\t\tif (typeof onClick === 'function') {\n\t\t\t\tsetEventTarget(event, ctaRef.el);\n\t\t\t\tonClick(event, value);\n\t\t\t}\n\t\t}\n\n\t\tdispatch(KolEvent.click, value);\n\t};\n\n\tconst handleMouseDown = (event: MouseEvent): void => {\n\t\tresolved?.on.onMouseDown?.(event);\n\t\tdispatch(KolEvent.mousedown);\n\t};\n\n\tconst handleFocus = (event: FocusEvent): void => {\n\t\tresolved?.on.onFocus?.(event);\n\t\tdispatch(KolEvent.focus);\n\t};\n\n\tconst handleBlur = (event: FocusEvent): void => {\n\t\tresolved?.on.onBlur?.(event);\n\t\tdispatch(KolEvent.blur);\n\t};\n\n\t/*\n\t * Keeps the last root when Stencil resets the ref: a click that removes the button (e.g. a clear\n\t * button clearing its own field) resets the ref before the button loses the focus, and the blur\n\t * still has to be dispatched from where the button stood.\n\t */\n\tconst refRoot = (element?: HTMLElement): void => {\n\t\tif (element) {\n\t\t\trootElement = element;\n\t\t}\n\t};\n\n\treturn {\n\t\tgetFcProps: (props: InternalButtonProps, rootAttributes?: ButtonItemRootAttributes): ButtonItemFcProps => {\n\t\t\tresolved = resolveButtonProps(props, getFlagHost());\n\t\t\tvalue = props._value;\n\n\t\t\ttooltipBehavior.componentWillLoad({\n\t\t\t\tlabel: resolved.label,\n\t\t\t\talign: resolved.tooltipAlign,\n\t\t\t});\n\n\t\t\treturn {\n\t\t\t\t...resolved,\n\t\t\t\t...rootAttributes,\n\t\t\t\tariaDescriptionId,\n\t\t\t\thandleBlur,\n\t\t\t\thandleClick,\n\t\t\t\thandleFocus,\n\t\t\t\thandleMouseDown,\n\t\t\t\tref: refRoot,\n\t\t\t\trefButton: ctaRef,\n\t\t\t\trefTooltip: tooltipBehavior.setTooltipElementRef,\n\t\t\t};\n\t\t},\n\t\tgetElement: (): HTMLButtonElement | undefined => ctaRef.el,\n\t\tgetRootElement: (): HTMLElement | undefined => rootElement,\n\t\tsyncListeners: (): void => {\n\t\t\tif (ctaRef.el) {\n\t\t\t\ttooltipBehavior.syncListeners(undefined, ctaRef.el, true);\n\t\t\t}\n\t\t},\n\t\tdestroy: (): void => {\n\t\t\ttooltipBehavior.destroy();\n\t\t},\n\t};\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AA+Da,MAAA,gBAAgB,GAAG,CAAC,WAA0C,KAAgB;IAC1F,MAAM,eAAe,GAAG,IAAI,eAAe,CAAC,gBAAgB,CAAC,SAAS,CAAC;AACvE,IAAA,MAAM,MAAM,GAAG,YAAY,EAAqB;AAChD,IAAA,MAAM,iBAAiB,GAAG,KAAK,EAAE;AACjC,IAAA,IAAI,QAAyC;AAC7C,IAAA,IAAI,KAAqB;AACzB,IAAA,IAAI,WAAoC;AAExC,IAAA,MAAM,QAAQ,GAAG,CAAC,KAAe,EAAE,MAAgB,KAAU;QAC5D,IAAI,WAAW,EAAE;AAChB,YAAA,gBAAgB,CAAC,WAAW,EAAE,KAAK,EAAE,MAAM,CAAC;;AAE9C,KAAC;AAED,IAAA,MAAM,WAAW,GAAG,CAAC,KAAiB,KAAU;QAC/C,KAAK,CAAC,eAAe,EAAE;QACvB,eAAe,CAAC,WAAW,EAAE;QAE7B,IAAI,CAAA,QAAQ,KAAA,IAAA,IAAR,QAAQ,KAAA,MAAA,GAAA,MAAA,GAAR,QAAQ,CAAE,IAAI,MAAK,QAAQ,EAAE;AAChC,YAAA,0BAA0B,CAAC,EAAE,IAAI,EAAE,WAA2B,CAAE,CAAC;;aAC3D,IAAI,CAAA,QAAQ,KAAA,IAAA,IAAR,QAAQ,KAAA,MAAA,GAAA,MAAA,GAAR,QAAQ,CAAE,IAAI,MAAK,OAAO,EAAE;AACtC,Y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,eAAe,CAAC,OAAO,EAAE;SACzB;KACD;AACF;;;;"}
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * KoliBri - The accessible HTML-Standard
3
3
  */
4
- import{h as t}from"./index-DQdQBwMc.js";import{t as e}from"./i18n-BaCf-SDK.js";import{b as s}from"./bem-registry-CX5kvaqt.js";import{n,c as i}from"./dev.utils-CJMVCYWh.js";import{B as o}from"./component-C3sXiwbS.js";import{B as a}from"./component-CBpYh2q-.js";import{p as l,S as r}from"./common-BqpMtheU.js";import{d as c,K as u}from"./events-CRHxtwup.js";import{r as p,a as g}from"./unique-nav-labels-DugFb3rS.js";import{c as h,q as f,a as d,b,d as m}from"./base-web-component-3R1Dy3QK.js";import{g as v,e as C}from"./variant-CeijQFzL.js";import{c as y}from"./item-Cbi_ZY6o.js";import{c as S}from"./item-pool-BOxAYePG.js";import{c as z}from"./element-interaction-Cy9tx3Sx.js";import{B as j,s as k}from"./base-web-component-6J5sCsnZ.js";const x=h("boundaryCount",1,(t=>Math.max(0,t)));const O=h("page",0,f);const B=h("pageSize",1,f);const _=/^\[object Object\]$/;function P(t){if(t===""||typeof t==="string"&&_.test(t)){throw new Error("Unreflected page size options")}const e=typeof t==="string"?l(t):t;if(Array.isArray(e)&&e.every((t=>typeof t==="number"))){return e.map((t=>({label:`${t}`,value:t})))}throw new Error("Invalid page size options")}const w=h("pageSizeOptions",[],P);const A=d();const $=["first","last","next","previous"];const D=t=>({first:t,last:t,next:t,previous:t});function F(t){if(typeof t==="boolean"){return D(t)}if(typeof t==="object"&&t!==null){const e={};$.forEach((s=>{const n=t[s];if(typeof n==="boolean"){e[s]=n}}));return e}if(typeof t==="string"){const e=l(t);return typeof e==="object"&&e!==null?F(e):D(false)}throw new Error("Invalid pagination buttons")}const M=h("hasButtons",D(true),F);const q=h("label","",b);const K=h("max",0,f);const E=h("siblingCount",1,(t=>Math.max(0,t)));const H={required:[O,A,K],optional:[x,v,w,B,M,q,E,C]};const I=(t,e=1)=>Math.ceil(t/e);const Q=(t,e,s)=>{if(s>0){const n=I(s,e);if(n>0){if(t>n){return n}if(t<1){return 1}}}return undefined};const Y=(t,e)=>{var s,n;if(e.length>0){return(n=(s=e.find((e=>e.value===t)))===null||s===void 0?void 0:s.value)!==null&&n!==void 0?n:e[0].value}return t};const L=(t,e,s,n)=>{const i=[];let o=false;for(let a=1;a<=e;a++){if(a<=s||a>e-s||a>=t-n&&a<=t+n){o=true;i.push({page:a,selected:a===t})}else if(o){o=false;i.push("separator")}else{i.push(null)}}return i};const T=(t,e,s)=>{const n=t*e;return{start:Math.max(0,(t-1)*e+1),end:s<n?s:n}};const J=s.forBlock("kol-pagination");const R={left:"kolicon-chevron-double-left"};const U={left:"kolicon-chevron-left"};const X={right:"kolicon-chevron-right"};const Z={right:"kolicon-chevron-double-right"};const G=(t=>t.includes("-")?t:`${t}-${t.toUpperCase()}`)(navigator.language||"de-DE");const V=new Intl.NumberFormat(G,{style:"decimal",minimumFractionDigits:0,maximumFractionDigits:0});const W=({boundaryCount:s,customClass:i,getButtonFcProps:o,handlePageClick:l,hasButtons:r,label:c,max:u,navigationCallbacks:p,page:g,pageSize:h,pageSizeOptions:f,renderPageSizeSelect:d,siblingCount:b,tooltipAlign:m})=>{const v=I(u,h);const{start:C,end:y}=T(g,h,u);const S=(e,s,n,l)=>t("li",null,t(a,Object.assign({},o(`navigation-${e}`,{_customClass:i,_disabled:l,_icons:s,_hideLabel:true,_label:n,_on:p[e],_tooltipAlign:m},{class:J("button",{[e]:true})}))));const z=(s,r)=>{const c=V.format(s);const u=`${e("kol-page")} ${c}`;return t("li",{key:n()},r?t(a,Object.assign({},o(`page-${s}`,{_ariaDescription:u,_customClass:i,_label:c},{"aria-current":"page",class:`${J("button",{selected:true})} selected`}))):t(a,Object.assign({},o(`page-${s}`,{_ariaDescription:u,_customClass:i,_label:c,_on:{onClick:t=>l(t,s)}},{class:J("button",{numbers:true})}))))};return[t("span",{role:"status","aria-live":"polite",class:J("entries")},e("kol-table-visible-range",{placeholders:{start:V.format(C),end:V.format(y),total:V.format(u)}})),t("nav",{class:J("navigation"),"aria-label":c},t("ul",{class:J("navigation-list")},r.first&&S("first",R,e("kol-page-first"),g<=1),r.previous&&S("previous",U,e("kol-page-back"),g<=1),L(g,v,s,b).map((e=>e===null?null:e==="separator"?t("li",{key:n()},t("span",{class:J("separator"),"aria-hidden":"true"})):z(e.page,e.selected))),r.next&&S("next",X,e("kol-page-next"),v<=g),r.last&&S("last",Z,e("kol-page-last"),v<=g))),(f===null||f===void 0?void 0:f.length)>0&&t("div",{class:"page-size"},t("div",{class:J("page-size-select")},d({label:e("kol-entries-per-site"),options:f,value:h})))]};const N=e=>t(o,{block:"kol-pagination"},t(W,Object.assign({},e)));class tt extends j{constructor(t,e){super();this.getHost=t;this.requestRender=e;this._disabled=false;this._multiple=false;this.ctaRef=z();this.id=i("select");this.loaded=false;this.focused=false;this.touched=false;this.initFormAssociation("select")}get host(){var t;return(t=this.getHost)===null||t===void 0?void 0:t.call(this)}get inputHasFocus(){return this.focused}set inputHasFocus(t){if(t!==this.focused){this.focused=t;this.requestRender()}}get _touched(){return this.touched}set _touched(t){if(t!==this.touched){this.touched=t===true;this.applyTouched(t);this.requestRender()}}get _value(){return this.value}set _value(t){if(t!==this.value){this.value=t;this.applyValue(t);this.requestRender()}}getAccessKeyProp(){return undefined}getShortKeyProp(){return undefined}render(t){if(this.loaded){this.update(t)}else{this.load(t)}return this.renderSelectField()}sync(){this.syncFormField()}destroy(){this.destroyFormField()}load(t){this.passed=t;this._on=t.on;this.value=t.value;this.initRenderProps(k);this.applyAriaDetails(undefined);this.applyName(undefined);this.applySyncValueBySelector(undefined);this.applyTouched(false);this.applyAccessKey(undefined);this.applyMsg(undefined);this.applyDisabled(false);this.applyHideMsg(false);this.applyHideLabel(false);this.applyHint("");this.applyInfoPopover(undefined);this.applyLabel(t.label);this.applyShortKey(undefined);this.applyOn(t.on);this.applyTooltipAlign("top");this.applyVariant(undefined);this.applyTabIndex(undefined);this.applyIcons(undefined);this.applyOptions(t.options);this.applyMultiple(false);this.applyRequired(false);this.applyRows(undefined);this.applyValue(t.value);this.loaded=true}update(t){const e=this.passed;this.passed=t;if(t.label!==e.label){this.applyLabel(t.label)}if(t.options!==e.options){this.applyOptions(t.options)}if(t.on!==e.on){this._on=t.on;this.applyOn(t.on)}if(t.value!==e.value&&t.value!==this.value){this.value=t.value;this.applyValue(t.value)}}}const et=["boundaryCount","customClass","hasButtons","on","page","pageSize","pageSizeOptions","siblingCount","tooltipAlign","max","label"];const st=()=>{const t=m(H);return{get:e=>t[e],set:(e,s)=>{t[e]=s}}};const nt=t=>{var s;const n=(s=t.store)!==null&&s!==void 0?s:st();const i=e("kol-pagination");const o=S((()=>y(t.getEventTarget)),(t=>t.syncListeners()),(t=>t.destroy()));const a=(t,e,s)=>o.get(t).getFcProps(e,s);const l=S((()=>new tt(t.getEventTarget,t.requestRender)),(t=>t.sync()),(t=>t.destroy()));let h=1;let f={};n.set("label",i);const d=(e,s)=>{setTimeout((()=>{var i,o;(o=(i=n.get("on")).onChangePage)===null||o===void 0?void 0:o.call(i,e,s);const a=t.getEventTarget();if(a){c(a,u.changePage,s)}}))};const b=(t,e,s)=>{const i=Q(t,e,s);if(i!==undefined){n.set("page",i);d(r,i)}};const m=t=>{if(t===undefined||t===null){return}B.apply(t,(t=>{const e=Y(t,n.get("pageSizeOptions"));n.set("pageSize",e);b(n.get("page"),e,n.get("max"))}))};const z=(t,e)=>{if(!e){p(n.get("label"))}q.apply(t!==null&&t!==void 0?t:i,(t=>n.set("label",t)));g(n.get("label"))};const j=(e,s)=>{var i,o;(o=(i=n.get("on")).onClick)===null||o===void 0?void 0:o.call(i,e,s);const a=t.getEventTarget();if(a){c(a,u.click,s)}d(e,s)};const k=(e,s)=>{const i=parseInt(s);if(i>0&&h!==i){m(i);h=i;t.requestRender();setTimeout((()=>{var s,i;const o=h;(i=(s=n.get("on")).onChangePageSize)===null||i===void 0?void 0:i.call(s,e,o);const a=t.getEventTarget();if(a){c(a,u.changePageSize,o)}}))}};const _={onChange:k};const P=t=>l.get("page-size").render(Object.assign(Object.assign({},t),{on:_}));const $={first:{onClick:t=>j(t,1)},last:{onClick:t=>j(t,I(n.get("max"),n.get("pageSize")))},next:{onClick:t=>j(t,n.get("page")+1)},previous:{onClick:t=>j(t,n.get("page")-1)}};const D={applyBoundaryCount:t=>x.apply(t,(t=>n.set("boundaryCount",t))),applyCustomClass:t=>v.apply(t,(t=>n.set("customClass",t))),applyHasButtons:t=>M.apply(t,(t=>n.set("hasButtons",Object.assign(Object.assign({},n.get("hasButtons")),t)))),applyLabel:t=>z(t,false),applyMax:t=>{if(t===undefined||t===null){return}K.apply(t,(t=>{n.set("max",t);b(n.get("page"),n.get("pageSize"),t)}))},applyOn:t=>A.apply(t,(t=>n.set("on",t))),applyPage:t=>{if(t===undefined||t===null){return}O.apply(t,(t=>{n.set("page",t);b(t,n.get("pageSize"),n.get("max"))}))},applyPageSize:t=>{m(t);h=t},applyPageSizeOptions:t=>w.apply(t,(t=>{n.set("pageSizeOptions",t);let e;if(t.length>0){e=Y(n.get("pageSize"),t);n.set("pageSize",e)}b(n.get("page"),e,n.get("max"))})),applySiblingCount:t=>E.apply(t,(t=>n.set("siblingCount",t))),applyTooltipAlign:t=>C.apply(t!==null&&t!==void 0?t:"top",(t=>n.set("tooltipAlign",t))),load:t=>{f=Object.assign({},t);D.applyBoundaryCount(t.boundaryCount);D.applyCustomClass(t.customClass);D.applyHasButtons(t.hasButtons);z(t.label,true);D.applyOn(t.on);D.applyPage(t.page);D.applyPageSize(t.pageSize);D.applyPageSizeOptions(t.pageSizeOptions);D.applySiblingCount(t.siblingCount);D.applyTooltipAlign(t.tooltipAlign);D.applyMax(t.max);D.applyPage(t.page)},update:t=>{for(const e of et){if(t[e]!==f[e]){f=Object.assign(Object.assign({},f),{[e]:t[e]});if(e!=="pageSize"||t.pageSize!==h){F[e](t[e])}}}},getFcProps:()=>{o.beginRender();l.beginRender();return{boundaryCount:n.get("boundaryCount"),customClass:n.get("customClass"),getButtonFcProps:a,handlePageClick:j,handlePageSizeChange:k,hasButtons:n.get("hasButtons"),label:n.get("label"),max:n.get("max"),navigationCallbacks:$,on:n.get("on"),page:n.get("page"),pageSize:n.get("pageSize"),pageSizeOptions:n.get("pageSizeOptions"),renderPageSizeSelect:P,siblingCount:n.get("siblingCount"),tooltipAlign:n.get("tooltipAlign")}},sync:()=>{o.endRender();l.endRender()},destroy:()=>{p(n.get("label"));o.destroy();l.destroy()}};const F={boundaryCount:D.applyBoundaryCount,customClass:D.applyCustomClass,hasButtons:D.applyHasButtons,label:D.applyLabel,max:D.applyMax,on:D.applyOn,page:D.applyPage,pageSize:D.applyPageSize,pageSizeOptions:D.applyPageSizeOptions,siblingCount:D.applySiblingCount,tooltipAlign:D.applyTooltipAlign};return D};export{N as P,nt as c,H as p};
5
- //# sourceMappingURL=item-ZjrNIhfW.js.map
4
+ import{h as t}from"./index-wY4pHWJG.js";import{t as e}from"./i18n-BaCf-SDK.js";import{b as s}from"./bem-registry-CX5kvaqt.js";import{n,c as i}from"./dev.utils-DDqySnXB.js";import{B as o}from"./component-D30YHxgS.js";import{B as a}from"./component-CODtL04S.js";import{p as l,S as r}from"./common-BqpMtheU.js";import{d as c,K as u}from"./events-CRHxtwup.js";import{r as p,a as g}from"./unique-nav-labels-DugFb3rS.js";import{c as f,q as h,a as d,b,d as m}from"./base-web-component-3R1Dy3QK.js";import{g as v,e as C}from"./variant-CeijQFzL.js";import{c as y}from"./item-lEB6GAqe.js";import{c as S}from"./item-pool-BOxAYePG.js";import{c as z}from"./element-interaction-Cy9tx3Sx.js";import{B as j,s as k}from"./base-web-component-CyCs0EpM.js";const x=f("boundaryCount",1,(t=>Math.max(0,t)));const O=f("page",0,h);const B=f("pageSize",1,h);const _=/^\[object Object\]$/;function P(t){if(t===""||typeof t==="string"&&_.test(t)){throw new Error("Unreflected page size options")}const e=typeof t==="string"?l(t):t;if(Array.isArray(e)&&e.every((t=>typeof t==="number"))){return e.map((t=>({label:`${t}`,value:t})))}throw new Error("Invalid page size options")}const w=f("pageSizeOptions",[],P);const A=d();const D=["first","last","next","previous"];const $=t=>({first:t,last:t,next:t,previous:t});function F(t){if(typeof t==="boolean"){return $(t)}if(typeof t==="object"&&t!==null){const e={};D.forEach((s=>{const n=t[s];if(typeof n==="boolean"){e[s]=n}}));return e}if(typeof t==="string"){const e=l(t);return typeof e==="object"&&e!==null?F(e):$(false)}throw new Error("Invalid pagination buttons")}const q=f("hasButtons",$(true),F);const M=f("label","",b);const E=f("max",0,h);const H=f("siblingCount",1,(t=>Math.max(0,t)));const K={required:[O,A,E],optional:[x,v,w,B,q,M,H,C]};const I=(t,e=1)=>Math.ceil(t/e);const L=(t,e,s)=>{if(s>0){const n=I(s,e);if(n>0){if(t>n){return n}if(t<1){return 1}}}return undefined};const G=(t,e)=>{var s,n;if(e.length>0){return(n=(s=e.find((e=>e.value===t)))===null||s===void 0?void 0:s.value)!==null&&n!==void 0?n:e[0].value}return t};const T=(t,e,s,n)=>{const i=[];let o=false;for(let a=1;a<=e;a++){if(a<=s||a>e-s||a>=t-n&&a<=t+n){o=true;i.push({page:a,selected:a===t})}else if(o){o=false;i.push("separator")}else{i.push(null)}}return i};const Y=(t,e,s)=>{const n=t*e;return{start:Math.max(0,(t-1)*e+1),end:s<n?s:n}};const Q=s.forBlock("kol-pagination");const R={left:"kolicon-chevron-double-left"};const U={left:"kolicon-chevron-left"};const X={right:"kolicon-chevron-right"};const J={right:"kolicon-chevron-double-right"};const W=(t=>t.includes("-")?t:`${t}-${t.toUpperCase()}`)(navigator.language||"de-DE");const N=new Intl.NumberFormat(W,{style:"decimal",minimumFractionDigits:0,maximumFractionDigits:0});const V=({boundaryCount:s,customClass:i,getButtonFcProps:o,handlePageClick:l,hasButtons:r,label:c,max:u,navigationCallbacks:p,page:g,pageSize:f,pageSizeOptions:h,renderPageSizeSelect:d,siblingCount:b,tooltipAlign:m})=>{const v=I(u,f);const{start:C,end:y}=Y(g,f,u);const S=(e,s,n,l)=>t("li",null,t(a,Object.assign({},o(`navigation-${e}`,{_customClass:i,_disabled:l,_icons:s,_hideLabel:true,_label:n,_on:p[e],_tooltipAlign:m},{class:Q("button",{[e]:true})}))));const z=(s,r)=>{const c=N.format(s);const u=`${e("kol-page")} ${c}`;return t("li",{key:n()},r?t(a,Object.assign({},o(`page-${s}`,{_ariaDescription:u,_customClass:i,_label:c},{"aria-current":"page",class:`${Q("button",{selected:true})} selected`}))):t(a,Object.assign({},o(`page-${s}`,{_ariaDescription:u,_customClass:i,_label:c,_on:{onClick:t=>l(t,s)}},{class:Q("button",{numbers:true})}))))};return[t("span",{role:"status","aria-live":"polite",class:Q("entries")},e("kol-table-visible-range",{placeholders:{start:N.format(C),end:N.format(y),total:N.format(u)}})),t("nav",{class:Q("navigation"),"aria-label":c},t("ul",{class:Q("navigation-list")},r.first&&S("first",R,e("kol-page-first"),g<=1),r.previous&&S("previous",U,e("kol-page-back"),g<=1),T(g,v,s,b).map((e=>e===null?null:e==="separator"?t("li",{key:n()},t("span",{class:Q("separator"),"aria-hidden":"true"})):z(e.page,e.selected))),r.next&&S("next",X,e("kol-page-next"),v<=g),r.last&&S("last",J,e("kol-page-last"),v<=g))),(h===null||h===void 0?void 0:h.length)>0&&t("div",{class:"page-size"},t("div",{class:Q("page-size-select")},d({label:e("kol-entries-per-site"),options:h,value:f})))]};const Z=e=>t(o,{block:"kol-pagination"},t(V,Object.assign({},e)));class tt extends j{constructor(t,e){super();this.getHost=t;this.requestRender=e;this._disabled=false;this._multiple=false;this.ctaRef=z();this.id=i("select");this.loaded=false;this.focused=false;this.touched=false;this.initFormAssociation("select")}get host(){var t;return(t=this.getHost)===null||t===void 0?void 0:t.call(this)}get inputHasFocus(){return this.focused}set inputHasFocus(t){if(t!==this.focused){this.focused=t;this.requestRender()}}get _touched(){return this.touched}set _touched(t){if(t!==this.touched){this.touched=t===true;this.applyTouched(t);this.requestRender()}}get _value(){return this.value}set _value(t){if(t!==this.value){this.value=t;this.applyValue(t);this.requestRender()}}getAccessKeyProp(){return undefined}getShortKeyProp(){return undefined}render(t){if(this.loaded){this.update(t)}else{this.load(t)}return this.renderSelectField()}sync(){this.syncFormField()}destroy(){this.destroyFormField()}load(t){this.passed=t;this._on=t.on;this.value=t.value;this.initRenderProps(k);this.applyAriaDetails(undefined);this.applyName(undefined);this.applySyncValueBySelector(undefined);this.applyTouched(false);this.applyAccessKey(undefined);this.applyMsg(undefined);this.applyDisabled(false);this.applyHideMsg(false);this.applyHideLabel(false);this.applyHint("");this.applyInfoPopover(undefined);this.applyLabel(t.label);this.applyShortKey(undefined);this.applyOn(t.on);this.applyTooltipAlign("top");this.applyVariant(undefined);this.applyTabIndex(undefined);this.applyIcons(undefined);this.applyOptions(t.options);this.applyMultiple(false);this.applyRequired(false);this.applyRows(undefined);this.applyValue(t.value);this.loaded=true}update(t){const e=this.passed;this.passed=t;if(t.label!==e.label){this.applyLabel(t.label)}if(t.options!==e.options){this.applyOptions(t.options)}if(t.on!==e.on){this._on=t.on;this.applyOn(t.on)}if(t.value!==e.value&&t.value!==this.value){this.value=t.value;this.applyValue(t.value)}}}const et=["boundaryCount","customClass","hasButtons","on","page","pageSize","pageSizeOptions","siblingCount","tooltipAlign","max","label"];const st=()=>{const t=m(K);return{get:e=>t[e],set:(e,s)=>{t[e]=s}}};const nt=t=>{var s;const n=(s=t.store)!==null&&s!==void 0?s:st();const i=e("kol-pagination");const o=S((()=>y(t.getEventTarget)),(t=>t.syncListeners()),(t=>t.destroy()));const a=(t,e,s)=>o.get(t).getFcProps(e,s);const l=S((()=>new tt(t.getEventTarget,t.requestRender)),(t=>t.sync()),(t=>t.destroy()));let f=1;let h={};n.set("label",i);const d=(e,s)=>{setTimeout((()=>{var i,o;(o=(i=n.get("on")).onChangePage)===null||o===void 0?void 0:o.call(i,e,s);const a=t.getEventTarget();if(a){c(a,u.changePage,s)}}))};const b=(t,e,s)=>{const i=L(t,e,s);if(i!==undefined){n.set("page",i);d(r,i)}};const m=t=>{if(t===undefined||t===null){return}B.apply(t,(t=>{const e=G(t,n.get("pageSizeOptions"));n.set("pageSize",e);b(n.get("page"),e,n.get("max"))}))};const z=(t,e)=>{if(!e){p(n.get("label"))}M.apply(t!==null&&t!==void 0?t:i,(t=>n.set("label",t)));g(n.get("label"))};const j=(e,s)=>{var i,o;(o=(i=n.get("on")).onClick)===null||o===void 0?void 0:o.call(i,e,s);const a=t.getEventTarget();if(a){c(a,u.click,s)}d(e,s)};const k=(e,s)=>{const i=parseInt(s);if(i>0&&f!==i){m(i);f=i;t.requestRender();setTimeout((()=>{var s,i;const o=f;(i=(s=n.get("on")).onChangePageSize)===null||i===void 0?void 0:i.call(s,e,o);const a=t.getEventTarget();if(a){c(a,u.changePageSize,o)}}))}};const _={onChange:k};const P=t=>l.get("page-size").render(Object.assign(Object.assign({},t),{on:_}));const D={first:{onClick:t=>j(t,1)},last:{onClick:t=>j(t,I(n.get("max"),n.get("pageSize")))},next:{onClick:t=>j(t,n.get("page")+1)},previous:{onClick:t=>j(t,n.get("page")-1)}};const $={applyBoundaryCount:t=>x.apply(t,(t=>n.set("boundaryCount",t))),applyCustomClass:t=>v.apply(t,(t=>n.set("customClass",t))),applyHasButtons:t=>q.apply(t,(t=>n.set("hasButtons",Object.assign(Object.assign({},n.get("hasButtons")),t)))),applyLabel:t=>z(t,false),applyMax:t=>{if(t===undefined||t===null){return}E.apply(t,(t=>{n.set("max",t);b(n.get("page"),n.get("pageSize"),t)}))},applyOn:t=>A.apply(t,(t=>n.set("on",t))),applyPage:t=>{if(t===undefined||t===null){return}O.apply(t,(t=>{n.set("page",t);b(t,n.get("pageSize"),n.get("max"))}))},applyPageSize:t=>{m(t);f=t},applyPageSizeOptions:t=>w.apply(t,(t=>{n.set("pageSizeOptions",t);let e;if(t.length>0){e=G(n.get("pageSize"),t);n.set("pageSize",e)}b(n.get("page"),e,n.get("max"))})),applySiblingCount:t=>H.apply(t,(t=>n.set("siblingCount",t))),applyTooltipAlign:t=>C.apply(t!==null&&t!==void 0?t:"top",(t=>n.set("tooltipAlign",t))),load:t=>{h=Object.assign({},t);$.applyBoundaryCount(t.boundaryCount);$.applyCustomClass(t.customClass);$.applyHasButtons(t.hasButtons);z(t.label,true);$.applyOn(t.on);$.applyPage(t.page);$.applyPageSize(t.pageSize);$.applyPageSizeOptions(t.pageSizeOptions);$.applySiblingCount(t.siblingCount);$.applyTooltipAlign(t.tooltipAlign);$.applyMax(t.max);$.applyPage(t.page)},update:t=>{for(const e of et){if(t[e]!==h[e]){h=Object.assign(Object.assign({},h),{[e]:t[e]});if(e!=="pageSize"||t.pageSize!==f){F[e](t[e])}}}},getFcProps:()=>{o.beginRender();l.beginRender();return{boundaryCount:n.get("boundaryCount"),customClass:n.get("customClass"),getButtonFcProps:a,handlePageClick:j,handlePageSizeChange:k,hasButtons:n.get("hasButtons"),label:n.get("label"),max:n.get("max"),navigationCallbacks:D,on:n.get("on"),page:n.get("page"),pageSize:n.get("pageSize"),pageSizeOptions:n.get("pageSizeOptions"),renderPageSizeSelect:P,siblingCount:n.get("siblingCount"),tooltipAlign:n.get("tooltipAlign")}},sync:()=>{o.endRender();l.endRender()},destroy:()=>{p(n.get("label"));o.destroy();l.destroy()}};const F={boundaryCount:$.applyBoundaryCount,customClass:$.applyCustomClass,hasButtons:$.applyHasButtons,label:$.applyLabel,max:$.applyMax,on:$.applyOn,page:$.applyPage,pageSize:$.applyPageSize,pageSizeOptions:$.applyPageSizeOptions,siblingCount:$.applySiblingCount,tooltipAlign:$.applyTooltipAlign};return $};export{Z as P,nt as c,K as p};
5
+ //# sourceMappingURL=item-nGiqyOvt.js.map