@db-ux/wc-core-components 1.0.0 → 1.1.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 (211) hide show
  1. package/dist/cjs/db-accordion-item.cjs.entry.js +1 -1
  2. package/dist/cjs/db-accordion.cjs.entry.js +1 -1
  3. package/dist/cjs/db-badge.cjs.entry.js +1 -1
  4. package/dist/cjs/db-brand.cjs.entry.js +1 -1
  5. package/dist/cjs/db-button.cjs.entry.js +1 -1
  6. package/dist/cjs/db-card.cjs.entry.js +1 -1
  7. package/dist/cjs/db-checkbox.cjs.entry.js +15 -16
  8. package/dist/cjs/db-checkbox.cjs.entry.js.map +1 -1
  9. package/dist/cjs/db-divider.cjs.entry.js +1 -1
  10. package/dist/cjs/db-drawer.cjs.entry.js +1 -1
  11. package/dist/cjs/db-header.cjs.entry.js +2 -2
  12. package/dist/cjs/db-icon.cjs.entry.js +1 -1
  13. package/dist/cjs/db-infotext.cjs.entry.js +1 -1
  14. package/dist/cjs/db-input.cjs.entry.js +3 -3
  15. package/dist/cjs/db-input.cjs.entry.js.map +1 -1
  16. package/dist/cjs/db-link.cjs.entry.js +1 -1
  17. package/dist/cjs/db-navigation-item.cjs.entry.js +2 -2
  18. package/dist/cjs/db-navigation.cjs.entry.js +1 -1
  19. package/dist/cjs/db-notification.cjs.entry.js +1 -1
  20. package/dist/cjs/db-page.cjs.entry.js +1 -1
  21. package/dist/cjs/db-popover.cjs.entry.js +1 -1
  22. package/dist/cjs/db-radio.cjs.entry.js +4 -9
  23. package/dist/cjs/db-radio.cjs.entry.js.map +1 -1
  24. package/dist/cjs/db-section.cjs.entry.js +1 -1
  25. package/dist/cjs/db-select.cjs.entry.js +5 -5
  26. package/dist/cjs/db-select.cjs.entry.js.map +1 -1
  27. package/dist/cjs/db-stack.cjs.entry.js +1 -1
  28. package/dist/cjs/db-switch.cjs.entry.js +8 -4
  29. package/dist/cjs/db-switch.cjs.entry.js.map +1 -1
  30. package/dist/cjs/db-tab-item_3.cjs.entry.js +3 -3
  31. package/dist/cjs/db-tab-item_3.cjs.entry.js.map +1 -1
  32. package/dist/cjs/db-tabs.cjs.entry.js +21 -4
  33. package/dist/cjs/db-tabs.cjs.entry.js.map +1 -1
  34. package/dist/cjs/db-tag.cjs.entry.js +1 -1
  35. package/dist/cjs/db-textarea.cjs.entry.js +1 -1
  36. package/dist/cjs/db-tooltip.cjs.entry.js +1 -1
  37. package/dist/cjs/db-ux.cjs.js +1 -1
  38. package/dist/cjs/{index-c0df827d.js → index-403366c7.js} +1 -12
  39. package/dist/cjs/index-403366c7.js.map +1 -0
  40. package/dist/cjs/index.cjs.js +2 -4
  41. package/dist/cjs/index.cjs.js.map +1 -1
  42. package/dist/cjs/loader.cjs.js +1 -1
  43. package/dist/cjs/{navigation-bb2d5552.js → navigation-5586b826.js} +2 -2
  44. package/dist/cjs/{navigation-bb2d5552.js.map → navigation-5586b826.js.map} +1 -1
  45. package/dist/collection/components/checkbox/checkbox.js +21 -22
  46. package/dist/collection/components/checkbox/checkbox.js.map +1 -1
  47. package/dist/collection/components/input/input.js +27 -2
  48. package/dist/collection/components/input/input.js.map +1 -1
  49. package/dist/collection/components/input/model.js.map +1 -1
  50. package/dist/collection/components/radio/radio.js +3 -8
  51. package/dist/collection/components/radio/radio.js.map +1 -1
  52. package/dist/collection/components/select/model.js.map +1 -1
  53. package/dist/collection/components/select/select.js +29 -4
  54. package/dist/collection/components/select/select.js.map +1 -1
  55. package/dist/collection/components/switch/model.js.map +1 -1
  56. package/dist/collection/components/switch/switch.js +38 -10
  57. package/dist/collection/components/switch/switch.js.map +1 -1
  58. package/dist/collection/components/tab-item/tab-item.js +2 -2
  59. package/dist/collection/components/tab-item/tab-item.js.map +1 -1
  60. package/dist/collection/components/tabs/model.js.map +1 -1
  61. package/dist/collection/components/tabs/tabs.js +51 -3
  62. package/dist/collection/components/tabs/tabs.js.map +1 -1
  63. package/dist/collection/shared/model.js.map +1 -1
  64. package/dist/collection/utils/index.js +0 -11
  65. package/dist/collection/utils/index.js.map +1 -1
  66. package/dist/collection/utils/react.js +16 -0
  67. package/dist/collection/utils/react.js.map +1 -0
  68. package/dist/custom-elements.json +144 -43
  69. package/dist/db-ux/db-ux.esm.js +1 -1
  70. package/dist/db-ux/db-ux.esm.js.map +1 -1
  71. package/dist/db-ux/index.esm.js +1 -1
  72. package/dist/db-ux/index.esm.js.map +1 -1
  73. package/dist/db-ux/p-0983e297.entry.js +2 -0
  74. package/dist/db-ux/p-0983e297.entry.js.map +1 -0
  75. package/dist/db-ux/{p-34f88e4e.js → p-0cdf053e.js} +2 -2
  76. package/dist/db-ux/{p-2d32aa06.entry.js → p-0d08f973.entry.js} +2 -2
  77. package/dist/db-ux/{p-78e5293a.entry.js → p-123cb839.entry.js} +2 -2
  78. package/dist/db-ux/p-123cb839.entry.js.map +1 -0
  79. package/dist/db-ux/{p-10d30f53.entry.js → p-1665a1f6.entry.js} +2 -2
  80. package/dist/db-ux/{p-b0f1a571.entry.js → p-1efdd41a.entry.js} +2 -2
  81. package/dist/db-ux/{p-031e9fbf.entry.js → p-223b1031.entry.js} +2 -2
  82. package/dist/db-ux/{p-a3be13fd.entry.js → p-2f695fb2.entry.js} +2 -2
  83. package/dist/db-ux/{p-ab8a1944.entry.js → p-300fb4ff.entry.js} +2 -2
  84. package/dist/db-ux/{p-d48f3770.entry.js → p-3958b712.entry.js} +2 -2
  85. package/dist/db-ux/p-3958b712.entry.js.map +1 -0
  86. package/dist/db-ux/{p-fea6db86.entry.js → p-398c72a6.entry.js} +2 -2
  87. package/dist/db-ux/p-45bb9feb.js +2 -0
  88. package/dist/db-ux/p-45bb9feb.js.map +1 -0
  89. package/dist/db-ux/{p-43aa16d7.entry.js → p-5c1b65ac.entry.js} +2 -2
  90. package/dist/db-ux/p-69948f78.entry.js +2 -0
  91. package/dist/db-ux/p-69948f78.entry.js.map +1 -0
  92. package/dist/db-ux/{p-6b6f1f7f.entry.js → p-7eb92648.entry.js} +2 -2
  93. package/dist/db-ux/{p-1c12853c.entry.js → p-8d9ef330.entry.js} +2 -2
  94. package/dist/db-ux/{p-79b43b42.entry.js → p-90caefe4.entry.js} +2 -2
  95. package/dist/db-ux/{p-c6d54dd4.entry.js → p-95e59a69.entry.js} +2 -2
  96. package/dist/db-ux/{p-71cb932e.entry.js → p-ab783af4.entry.js} +2 -2
  97. package/dist/db-ux/{p-3f2e2d87.entry.js → p-b0b04684.entry.js} +2 -2
  98. package/dist/db-ux/{p-79d9caa7.entry.js → p-b2886d1c.entry.js} +2 -2
  99. package/dist/db-ux/p-b4eefd78.entry.js +2 -0
  100. package/dist/db-ux/{p-08126c21.entry.js → p-c367b891.entry.js} +2 -2
  101. package/dist/db-ux/{p-1066cd52.entry.js → p-cf22eaea.entry.js} +2 -2
  102. package/dist/db-ux/{p-2e318e2a.entry.js → p-e1788dce.entry.js} +2 -2
  103. package/dist/db-ux/p-e1788dce.entry.js.map +1 -0
  104. package/dist/db-ux/p-e24051a3.entry.js +2 -0
  105. package/dist/db-ux/p-e24051a3.entry.js.map +1 -0
  106. package/dist/db-ux/{p-683d690f.entry.js → p-e6f5c82d.entry.js} +2 -2
  107. package/dist/db-ux/{p-5a689165.entry.js → p-f23ca7f6.entry.js} +2 -2
  108. package/dist/db-ux/{p-b47af6eb.entry.js → p-f3251c56.entry.js} +2 -2
  109. package/dist/db-ux/{p-8e2a086b.entry.js → p-f78c8591.entry.js} +2 -2
  110. package/dist/db-ux/p-fa9a7966.entry.js +2 -0
  111. package/dist/db-ux/p-fa9a7966.entry.js.map +1 -0
  112. package/dist/esm/db-accordion-item.entry.js +1 -1
  113. package/dist/esm/db-accordion.entry.js +1 -1
  114. package/dist/esm/db-badge.entry.js +1 -1
  115. package/dist/esm/db-brand.entry.js +1 -1
  116. package/dist/esm/db-button.entry.js +1 -1
  117. package/dist/esm/db-card.entry.js +1 -1
  118. package/dist/esm/db-checkbox.entry.js +15 -16
  119. package/dist/esm/db-checkbox.entry.js.map +1 -1
  120. package/dist/esm/db-divider.entry.js +1 -1
  121. package/dist/esm/db-drawer.entry.js +1 -1
  122. package/dist/esm/db-header.entry.js +2 -2
  123. package/dist/esm/db-icon.entry.js +1 -1
  124. package/dist/esm/db-infotext.entry.js +1 -1
  125. package/dist/esm/db-input.entry.js +3 -3
  126. package/dist/esm/db-input.entry.js.map +1 -1
  127. package/dist/esm/db-link.entry.js +1 -1
  128. package/dist/esm/db-navigation-item.entry.js +2 -2
  129. package/dist/esm/db-navigation.entry.js +1 -1
  130. package/dist/esm/db-notification.entry.js +1 -1
  131. package/dist/esm/db-page.entry.js +1 -1
  132. package/dist/esm/db-popover.entry.js +1 -1
  133. package/dist/esm/db-radio.entry.js +4 -9
  134. package/dist/esm/db-radio.entry.js.map +1 -1
  135. package/dist/esm/db-section.entry.js +1 -1
  136. package/dist/esm/db-select.entry.js +5 -5
  137. package/dist/esm/db-select.entry.js.map +1 -1
  138. package/dist/esm/db-stack.entry.js +1 -1
  139. package/dist/esm/db-switch.entry.js +8 -4
  140. package/dist/esm/db-switch.entry.js.map +1 -1
  141. package/dist/esm/db-tab-item_3.entry.js +3 -3
  142. package/dist/esm/db-tab-item_3.entry.js.map +1 -1
  143. package/dist/esm/db-tabs.entry.js +22 -5
  144. package/dist/esm/db-tabs.entry.js.map +1 -1
  145. package/dist/esm/db-tag.entry.js +1 -1
  146. package/dist/esm/db-textarea.entry.js +1 -1
  147. package/dist/esm/db-tooltip.entry.js +1 -1
  148. package/dist/esm/db-ux.js +1 -1
  149. package/dist/esm/{index-fad99efc.js → index-7d31752e.js} +2 -11
  150. package/dist/esm/index-7d31752e.js.map +1 -0
  151. package/dist/esm/index.js +2 -2
  152. package/dist/esm/index.js.map +1 -1
  153. package/dist/esm/loader.js +1 -1
  154. package/dist/esm/{navigation-9fec9921.js → navigation-09e3ace3.js} +2 -2
  155. package/dist/esm/{navigation-9fec9921.js.map → navigation-09e3ace3.js.map} +1 -1
  156. package/dist/types/components/checkbox/checkbox.d.ts +1 -1
  157. package/dist/types/components/input/input.d.ts +1 -0
  158. package/dist/types/components/input/model.d.ts +2 -2
  159. package/dist/types/components/select/model.d.ts +2 -2
  160. package/dist/types/components/select/select.d.ts +1 -0
  161. package/dist/types/components/switch/model.d.ts +2 -2
  162. package/dist/types/components/switch/switch.d.ts +3 -2
  163. package/dist/types/components/tab-item/tab-item.d.ts +1 -2
  164. package/dist/types/components/tabs/model.d.ts +9 -0
  165. package/dist/types/components/tabs/tabs.d.ts +3 -0
  166. package/dist/types/components.d.ts +24 -0
  167. package/dist/types/shared/model.d.ts +6 -0
  168. package/dist/types/utils/index.d.ts +0 -4
  169. package/dist/types/utils/react.d.ts +7 -0
  170. package/dist/vscode.html-custom-data.json +14 -7
  171. package/dist/web-types.json +54 -19
  172. package/package.json +3 -3
  173. package/dist/cjs/index-c0df827d.js.map +0 -1
  174. package/dist/db-ux/p-1566cfef.entry.js +0 -2
  175. package/dist/db-ux/p-1566cfef.entry.js.map +0 -1
  176. package/dist/db-ux/p-2e318e2a.entry.js.map +0 -1
  177. package/dist/db-ux/p-6f645f17.entry.js +0 -2
  178. package/dist/db-ux/p-6f645f17.entry.js.map +0 -1
  179. package/dist/db-ux/p-78e5293a.entry.js.map +0 -1
  180. package/dist/db-ux/p-871805e1.entry.js +0 -2
  181. package/dist/db-ux/p-871805e1.entry.js.map +0 -1
  182. package/dist/db-ux/p-99d90022.js +0 -2
  183. package/dist/db-ux/p-99d90022.js.map +0 -1
  184. package/dist/db-ux/p-a494046c.entry.js +0 -2
  185. package/dist/db-ux/p-a494046c.entry.js.map +0 -1
  186. package/dist/db-ux/p-d48f3770.entry.js.map +0 -1
  187. package/dist/db-ux/p-f65f4eac.entry.js +0 -2
  188. package/dist/esm/index-fad99efc.js.map +0 -1
  189. /package/dist/db-ux/{p-34f88e4e.js.map → p-0cdf053e.js.map} +0 -0
  190. /package/dist/db-ux/{p-2d32aa06.entry.js.map → p-0d08f973.entry.js.map} +0 -0
  191. /package/dist/db-ux/{p-10d30f53.entry.js.map → p-1665a1f6.entry.js.map} +0 -0
  192. /package/dist/db-ux/{p-b0f1a571.entry.js.map → p-1efdd41a.entry.js.map} +0 -0
  193. /package/dist/db-ux/{p-031e9fbf.entry.js.map → p-223b1031.entry.js.map} +0 -0
  194. /package/dist/db-ux/{p-a3be13fd.entry.js.map → p-2f695fb2.entry.js.map} +0 -0
  195. /package/dist/db-ux/{p-ab8a1944.entry.js.map → p-300fb4ff.entry.js.map} +0 -0
  196. /package/dist/db-ux/{p-fea6db86.entry.js.map → p-398c72a6.entry.js.map} +0 -0
  197. /package/dist/db-ux/{p-43aa16d7.entry.js.map → p-5c1b65ac.entry.js.map} +0 -0
  198. /package/dist/db-ux/{p-6b6f1f7f.entry.js.map → p-7eb92648.entry.js.map} +0 -0
  199. /package/dist/db-ux/{p-1c12853c.entry.js.map → p-8d9ef330.entry.js.map} +0 -0
  200. /package/dist/db-ux/{p-79b43b42.entry.js.map → p-90caefe4.entry.js.map} +0 -0
  201. /package/dist/db-ux/{p-c6d54dd4.entry.js.map → p-95e59a69.entry.js.map} +0 -0
  202. /package/dist/db-ux/{p-71cb932e.entry.js.map → p-ab783af4.entry.js.map} +0 -0
  203. /package/dist/db-ux/{p-3f2e2d87.entry.js.map → p-b0b04684.entry.js.map} +0 -0
  204. /package/dist/db-ux/{p-79d9caa7.entry.js.map → p-b2886d1c.entry.js.map} +0 -0
  205. /package/dist/db-ux/{p-f65f4eac.entry.js.map → p-b4eefd78.entry.js.map} +0 -0
  206. /package/dist/db-ux/{p-08126c21.entry.js.map → p-c367b891.entry.js.map} +0 -0
  207. /package/dist/db-ux/{p-1066cd52.entry.js.map → p-cf22eaea.entry.js.map} +0 -0
  208. /package/dist/db-ux/{p-683d690f.entry.js.map → p-e6f5c82d.entry.js.map} +0 -0
  209. /package/dist/db-ux/{p-5a689165.entry.js.map → p-f23ca7f6.entry.js.map} +0 -0
  210. /package/dist/db-ux/{p-b47af6eb.entry.js.map → p-f3251c56.entry.js.map} +0 -0
  211. /package/dist/db-ux/{p-8e2a086b.entry.js.map → p-f78c8591.entry.js.map} +0 -0
@@ -4,8 +4,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  require('./index-3d093f06.js');
6
6
  const constants = require('./constants-89822e5f.js');
7
- const index = require('./index-c0df827d.js');
8
- const navigation = require('./navigation-bb2d5552.js');
7
+ const index = require('./index-403366c7.js');
8
+ const navigation = require('./navigation-5586b826.js');
9
9
 
10
10
  /* eslint-disable @typescript-eslint/no-explicit-any */
11
11
  const SemanticList = ['adaptive', 'neutral', 'critical', 'informational', 'warning', 'successful'];
@@ -80,10 +80,8 @@ exports.TESTING_VIEWPORTS = constants.TESTING_VIEWPORTS;
80
80
  exports.addAttributeToChildren = index.addAttributeToChildren;
81
81
  exports.cls = index.cls;
82
82
  exports.delay = index.delay;
83
- exports.filterPassingProps = index.filterPassingProps;
84
83
  exports.getBooleanAsString = index.getBooleanAsString;
85
84
  exports.getHideProp = index.getHideProp;
86
- exports.getRootProps = index.getRootProps;
87
85
  exports.handleDataOutside = index.handleDataOutside;
88
86
  exports.hasVoiceOver = index.hasVoiceOver;
89
87
  exports.isArrayOfStrings = index.isArrayOfStrings;
@@ -1 +1 @@
1
- {"file":"index.cjs.js","mappings":";;;;;;;;;AAAA;MAsCa,YAAY,GAAI,CAAC,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,EAAE,SAAS,EAAE,YAAY,EAAY;MA2BxG,WAAW,GAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAY;MAQ9D,UAAU,GAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAY;MAQ7D,aAAa,GAAI,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,cAAc,EAAE,YAAY,EAAY;MAiB1K,cAAc,GAAI,C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AE,oBAAoB,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,eAAe,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAY;MA0Dn1B,eAAe,GAAI,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAY;MAE3F,cAAc,GAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAY;MAEnE,sBAAsB,GAAI,CAAC,aAAa,EAAE,4BAA4B,EAAE,QAAQ,EAAE,0BAA0B,EAAE,aAAa,EAAE,eAAe,EAAE,iCAAiC,EAAE,YAAY,EAAY;MA6EzM,aAAa,GAAI,CAAC,OAAO,EAAE,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/shared/model.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport { IconTypes } from '@db-ux/core-foundations';\nexport type GlobalProps = {\n /**\n * default slot\n */\n\n children?: any;\n\n /**\n * React specific for adding className to the component.\n */\n className?: string;\n\n /**\n * Workaround for TypeScript using class for all components.\n */\n class?: string | any;\n\n /**\n * [`aria-describedby`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-describedby) is used to link to the elements that describe the element with the set attribute.\n */\n describedbyid?: string;\n\n /**\n * [ID](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id) of the component, generated automatically for some components as a fallback if unset.\n */\n id?: string;\n\n /**\n * Before using please check for the [accessibility concerns](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus#accessibility_concerns)\n */\n autofocus?: boolean;\n};\nexport type GlobalState = {\n _id?: string;\n};\nexport const SemanticList = (['adaptive', 'neutral', 'critical', 'informational', 'warning', 'successful'] as const);\nexport type SemanticType = (typeof SemanticList)[number];\nexport type SemanticProps = {\n /**\n * The semantic defines the default variants for most components.\n */\n semantic?: SemanticType;\n};\nexport type IconProps = {\n /**\n * Define an icon by its identifier (like e.g. _user_, compare to [Icons](https://db-ux-design-system.github.io/core-web/review/main/foundations/icons/overview)) to get displayed in front of the elements content.\n */\n icon?: IconTypes;\n};\nexport type ShowIconProps = {\n /**\n * Enables or disables the visibility of the icon. The default value depends on the component.\n * For many components this property is optional to reflect Figma properties.\n */\n showIcon?: boolean;\n};\nexport type IconAfterProps = {\n /**\n * Define an icon by its identifier (like e.g. _user_, compare to [Icons](https://db-ux-design-system.github.io/core-web/review/main/foundations/icons/overview)) to get displayed in front of the elements content.\n */\n iconAfter?: IconTypes;\n};\nexport const SpacingList = (['medium', 'small', 'large', 'none'] as const);\nexport type SpacingType = (typeof SpacingList)[number];\nexport type SpacingProps = {\n /**\n * The spacing attribute changes the padding of the component.\n */\n spacing?: SpacingType;\n};\nexport const MarginList = (['medium', 'small', 'large', 'none'] as const);\nexport type MarginType = (typeof MarginList)[number];\nexport type MarginProps = {\n /**\n * The margin attribute changes the margin of the component.\n */\n margin?: MarginType;\n};\nexport const PlacementList = (['left', 'right', 'top', 'bottom', 'left-start', 'left-end', 'right-start', 'right-end', 'top-start', 'top-end', 'bottom-start', 'bottom-end'] as const);\nexport type PlacementType = (typeof PlacementList)[number];\nexport type PlacementProps = {\n /**\n * The `placement` attributes values change the position to absolute and adds a transform based on the placement.\n */\n placement?: PlacementType;\n};\nexport type NavigationBehaviorState = {\n handleNavigationItemClick: (event: unknown) => void;\n};\nexport type GapProps = {\n /**\n * If the absolute element should have a gap between the parent element.\n */\n gap?: boolean;\n};\nexport const GapSpacingList = (['none', '3x-large', '2x-large', 'x-large', 'large', 'medium', 'small', 'x-small', '2x-small', '3x-small'] as const);\nexport type GapSpacingType = (typeof GapSpacingList)[number];\nexport type GapSpacingProps = {\n /**\n * Set the gap/spacing between elements\n */\n gap?: GapSpacingType;\n};\nexport type OverflowProps = {\n /**\n * The overflow attribute sets a max-width and longer text will be dotted.\n */\n overflow?: boolean;\n};\nexport const OrientationList = (['horizontal', 'vertical'] as const);\nexport type OrientationType = (typeof OrientationList)[number];\nexport type OrientationProps = {\n /**\n * Change the orientation. Defaults to horizontal.\n */\n orientation?: OrientationType;\n};\nexport const WidthList = (['full', 'auto'] as const);\nexport type WidthType = (typeof WidthList)[number];\nexport type WidthProps = {\n /**\n * Width of the component. Auto width based on children size, full width based on parent elements width.\n */\n width?: WidthType;\n};\nexport const MaxWidthList = (['full', 'medium', 'large', 'small'] as const);\nexport type MaxWidthType = (typeof MaxWidthList)[number];\nexport type ContainerWidthProps = {\n /**\n * Set max width for the component\n */\n width?: MaxWidthType;\n};\nexport const PopoverDelayList = (['none', 'slow', 'fast'] as const);\nexport type PopoverDelayType = (typeof PopoverDelayList)[number];\nexport const PopoverWidthList = (['auto', 'fixed'] as const);\nexport type PopoverWidthType = (typeof PopoverWidthList)[number];\nexport type PopoverProps = {\n /**\n * Add a delay before showing the tooltip\n */\n delay?: PopoverDelayType;\n /**\n * Disable animation\n */\n animation?: boolean;\n /**\n * Use fixed with for default max-width\n */\n width?: PopoverWidthType;\n};\nexport type PopoverState = {\n handleAutoPlacement: () => void;\n};\nexport type ContentSlotProps = {\n /**\n * Default slot which is used to pass in additional content.\n */\n content?: any;\n};\nexport const SizeList = (['small', 'medium'] as const);\nexport type SizeType = (typeof SizeList)[number];\nexport type SizeProps = {\n /**\n * The size attribute changes the font-size and other related sizes of the component.\n */\n size?: SizeType;\n};\nexport const EmphasisList = (['weak', 'strong'] as const);\nexport type EmphasisType = (typeof EmphasisList)[number];\nexport type EmphasisProps = {\n /**\n * The emphasis attribute divides in between a weak or strong importance.\n */\n emphasis?: EmphasisType;\n};\nexport const TagEmphasisList = ([...EmphasisList, 'origin'] as const);\nexport type TagEmphasisType = (typeof TagEmphasisList)[number];\nexport type TagEmphasisProps = {\n /**\n * The emphasis attribute divides in between a weak, strong or origin appearance.\n */\n emphasis?: TagEmphasisType;\n};\nexport const ValidationList = (['invalid', 'valid', 'no-validation'] as const);\nexport type ValidationType = (typeof ValidationList)[number];\nexport type FormProps = {\n /**\n * Marks an input element as invalid (red) / valid (green) / no-validation (grey). Overwrites the :user-valid selector.\n */\n validation?: ValidationType;\n /**\n * The disabled attribute can be set to keep a user from clicking on the form element.\n */\n disabled?: boolean;\n /**\n * \tAssociates the control with a form element\n */\n form?: string;\n\n /**\n * The label attribute specifies the caption of the form element.\n */\n label?: string;\n\n /**\n * The name attribute gives the name of the form control, as used in form submission and in the form element's elements object.\n */\n name?: string;\n\n /**\n * When the required attribute specified, the user will be required to fill the form element before submitting the form.\n */\n required?: boolean;\n /**\n * Enables/disables the visibility of the label\n */\n showLabel?: boolean;\n /**\n * The value property is to receive results from the native form element.\n */\n value?: any;\n};\nexport type FormTextProps = {\n /**\n * Maximum length (number of characters) of value\n */\n maxLength?: number;\n /**\n * Minimum length (number of characters) of value\n */\n minLength?: number;\n /**\n * The disabled attribute can be set to keep a user from edit on the form element\n */\n readOnly?: boolean;\n};\nexport type FormCheckProps = {\n /**\n * Define the radio or checkbox elements checked state\n */\n checked?: boolean;\n};\nexport const LabelVariantList = (['above', 'floating'] as const);\nexport type LabelVariantType = (typeof LabelVariantList)[number];\nexport const AutoCompleteList = (['off', 'on', 'name', 'honorific-prefix', 'given-name', 'additional-name', 'family-name', 'honorific-suffix', 'nickname', 'email', 'username', 'new-password', 'current-password', 'one-time-code', 'organization-title', 'organization', 'street-address', 'shipping', 'billing', 'address-line1', 'address-line2', 'address-line3', 'address-level4', 'address-level3', 'address-level2', 'address-level1', 'country', 'country-name', 'postal-code', 'cc-name', 'cc-given-name', 'cc-additional-name', 'cc-family-name', 'cc-number', 'cc-exp', 'cc-exp-month', 'cc-exp-year', 'cc-csc', 'cc-type', 'transaction-currency', 'transaction-amount', 'language', 'bday', 'bday-day', 'bday-month', 'bday-year', 'sex', 'tel', 'tel-country-code', 'tel-national', 'tel-area-code', 'tel-local', 'tel-extension', 'impp', 'url', 'photo', 'webauthn'] as const);\nexport type AutoCompleteType = (typeof AutoCompleteList)[number];\nexport type FormMessageProps = {\n /**\n * Change the variant of the label to float or hidden\n */\n variant?: LabelVariantType;\n /**\n * Text that appears in the form control when it has no value set\n */\n placeholder?: string;\n /**\n * Optional helper message for form components\n */\n message?: string;\n\n /**\n * Helper message for valid form components\n */\n validMessage?: string;\n\n /**\n * Helper message for invalid form components\n */\n invalidMessage?: string;\n\n /**\n * Set/overwrite icon for helper message for form components\n */\n messageIcon?: IconTypes;\n\n /**\n * See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete\n */\n autocomplete?: string | AutoCompleteType;\n\n /**\n * Enables or disables the visibility of the message.\n */\n showMessage?: boolean;\n};\nexport type FormState = {\n _messageId?: string;\n _validMessageId?: string;\n _invalidMessageId?: string;\n _descByIds?: string;\n _value?: string;\n\n /**\n * https://www.davidmacd.com/blog/test-aria-describedby-errormessage-aria-live.html\n * Currently VoiceOver isn't supporting changes from aria-describedby.\n * This is an internal Fallback\n */\n _voiceOverFallback?: string;\n};\nexport type InitializedState = {\n initialized: boolean;\n};\nexport const LinkCurrentList = (['time', 'true', 'false', 'date', 'page', 'step', 'location'] as const);\nexport type LinkCurrentType = (typeof LinkCurrentList)[number];\nexport const LinkTargetList = (['_self', '_blank', '_parent', '_top'] as const);\nexport type LinkTargetType = (typeof LinkTargetList)[number];\nexport const LinkReferrerPolicyList = (['no-referrer', 'no-referrer-when-downgrade', 'origin', 'origin-when-cross-origin', 'same-origin', 'strict-origin', 'strict-origin-when-cross-origin', 'unsafe-url'] as const);\nexport type LinkReferrerPolicyType = (typeof LinkReferrerPolicyList)[number];\nexport type LinkProps = {\n /**\n * Sets aria attribute based on [`aria-current`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-current).\n */\n current?: boolean | LinkCurrentType;\n /**\n * Disables the link.\n */\n disabled?: boolean;\n /**\n * The [URL that the hyperlink points to](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#href).\n */\n href?: string;\n /**\n * Hints for the human [language of the linked page or document](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#hreflang).\n */\n hreflang?: string;\n /**\n * Sets aria attribute based on [`aria-label`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label).\n */\n label?: string;\n /**\n * Where to open the linked URL, as the name for a [browsing context](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target).\n */\n target?: LinkTargetType;\n /**\n * The relationship of the linked URL as space-separated link types.\n */\n rel?: string;\n /**\n * Sets aria role based on [`aria-role`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles).\n */\n role?: string;\n /**\n * How much of the referrer to send when following the link.\n */\n referrerpolicy?: LinkReferrerPolicyType;\n /**\n * Sets aria role based on [`aria-selected`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-selected).\n */\n selected?: boolean;\n};\nexport type TextProps = {\n /**\n * Alternative for default slot/children.\n */\n text?: string;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type ClickEvent<T> = MouseEvent;\nexport type ClickEventProps<T> = {\n /**\n * React specific onClick to pass to forward ref.\n */\n onClick?: (event: ClickEvent<T>) => void;\n};\nexport type ClickEventState<T> = {\n handleClick: (event: ClickEvent<T>) => void;\n};\nexport type ToggleEventProps = {\n onToggle?: (open: boolean) => void;\n};\nexport type ToggleEventState<T> = {\n toggle: (event?: ClickEvent<T>) => void;\n};\nexport type CloseEventProps = {\n /**\n * Function to handle button click (close).\n */\n onClose?: (event?: any) => void;\n};\nexport type CloseEventState = {\n handleClose: (event: any) => void;\n};\nexport const AlignmentList = (['start', 'center'] as const);\nexport type AlignmentType = (typeof AlignmentList)[number];\nexport type AlignmentProps = {\n /**\n * Define the content alignment in full width\n */\n alignment?: AlignmentType;\n};\nexport type ActiveProps = {\n /**\n * If the tab is checked/active.\n */\n active?: boolean;\n};\nexport type InputEvent<T> = Event;\nexport type InputEventProps<T> = {\n input?: (event: InputEvent<T>) => void;\n onInput?: (event: InputEvent<T>) => void;\n};\nexport type InputEventState<T> = {\n handleInput: (event: InputEvent<T>) => void;\n};\nexport type ChangeEvent<T> = Event;\nexport type ChangeEventProps<T> = {\n change?: (event: ChangeEvent<T>) => void;\n onChange?: (event: ChangeEvent<T>) => void;\n};\nexport type ChangeEventState<T> = {\n handleChange: (event: ChangeEvent<T>) => void;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type InteractionEvent<T> = FocusEvent;\nexport type FocusEventProps<T> = {\n blur?: (event: InteractionEvent<T>) => void;\n onBlur?: (event: InteractionEvent<T>) => void;\n focus?: (event: InteractionEvent<T>) => void;\n onFocus?: (event: InteractionEvent<T>) => void;\n};\nexport type FocusEventState<T> = {\n handleBlur: (event: InteractionEvent<T>) => void;\n handleFocus: (event: InteractionEvent<T>) => void;\n};\nexport type InnerCloseButtonProps = {\n /**\n * The closeButtonId attribute changes the id inside the close button.\n */\n closeButtonId?: string;\n /**\n * The closeButtonText attribute changes the text inside the close button.\n */\n closeButtonText?: string;\n};\nexport type NavigationBackButtonProps = {\n /**\n * The backButtonId attribute changes the id inside the back button.\n */\n backButtonId?: string;\n /**\n * The backButtonText attribute changes the text inside the back button.\n */\n backButtonText?: string;\n};\nexport type AriaLabelledByProps = {\n /**\n * Pass aria-labelledby to inner element\n */\n labelledBy?: string;\n};\nexport type AriaControlsProps = {\n /**\n * Pass aria-controls to inner element\n */\n controls?: string;\n};\nexport type ValueLabelType = {\n value: string;\n label?: string;\n}"],"version":3}
1
+ {"file":"index.cjs.js","mappings":";;;;;;;;;AAAA;MAsCa,YAAY,GAAI,CAAC,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,EAAE,SAAS,EAAE,YAAY,EAAY;MA2Bx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AAE,oBAAoB,EAAE,cAAc,EAAE,gBAAgB,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe,EAAE,eAAe,EAAE,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,SAAS,EAAE,cAAc,EAAE,aAAa,EAAE,SAAS,EAAE,eAAe,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,WAAW,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,EAAE,QAAQ,EAAE,SAAS,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,eAAe,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAY;MA0Dn1B,eAAe,GAAI,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAY;MAE3F,cAAc,GAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAY;MAEnE,sBAAsB,GAAI,CAAC,aAAa,EAAE,4BAA4B,EAAE,QAAQ,EAAE,0BAA0B,EAAE,aAAa,EAAE,eAAe,EAAE,iCAAiC,EAAE,YAAY,EAAY;MA6EzM,aAAa,GAAI,CAAC,OAAO,EAAE,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/shared/model.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport { IconTypes } from '@db-ux/core-foundations';\nexport type GlobalProps = {\n /**\n * default slot\n */\n\n children?: any;\n\n /**\n * React specific for adding className to the component.\n */\n className?: string;\n\n /**\n * Workaround for TypeScript using class for all components.\n */\n class?: string | any;\n\n /**\n * [`aria-describedby`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-describedby) is used to link to the elements that describe the element with the set attribute.\n */\n describedbyid?: string;\n\n /**\n * [ID](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id) of the component, generated automatically for some components as a fallback if unset.\n */\n id?: string;\n\n /**\n * Before using please check for the [accessibility concerns](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus#accessibility_concerns)\n */\n autofocus?: boolean;\n};\nexport type GlobalState = {\n _id?: string;\n};\nexport const SemanticList = (['adaptive', 'neutral', 'critical', 'informational', 'warning', 'successful'] as const);\nexport type SemanticType = (typeof SemanticList)[number];\nexport type SemanticProps = {\n /**\n * The semantic defines the default variants for most components.\n */\n semantic?: SemanticType;\n};\nexport type IconProps = {\n /**\n * Define an icon by its identifier (like e.g. _user_, compare to [Icons](https://db-ux-design-system.github.io/core-web/review/main/foundations/icons/overview)) to get displayed in front of the elements content.\n */\n icon?: IconTypes;\n};\nexport type ShowIconProps = {\n /**\n * Enables or disables the visibility of the icon. The default value depends on the component.\n * For many components this property is optional to reflect Figma properties.\n */\n showIcon?: boolean;\n};\nexport type IconAfterProps = {\n /**\n * Define an icon by its identifier (like e.g. _user_, compare to [Icons](https://db-ux-design-system.github.io/core-web/review/main/foundations/icons/overview)) to get displayed in front of the elements content.\n */\n iconAfter?: IconTypes;\n};\nexport const SpacingList = (['medium', 'small', 'large', 'none'] as const);\nexport type SpacingType = (typeof SpacingList)[number];\nexport type SpacingProps = {\n /**\n * The spacing attribute changes the padding of the component.\n */\n spacing?: SpacingType;\n};\nexport const MarginList = (['medium', 'small', 'large', 'none'] as const);\nexport type MarginType = (typeof MarginList)[number];\nexport type MarginProps = {\n /**\n * The margin attribute changes the margin of the component.\n */\n margin?: MarginType;\n};\nexport const PlacementList = (['left', 'right', 'top', 'bottom', 'left-start', 'left-end', 'right-start', 'right-end', 'top-start', 'top-end', 'bottom-start', 'bottom-end'] as const);\nexport type PlacementType = (typeof PlacementList)[number];\nexport type PlacementProps = {\n /**\n * The `placement` attributes values change the position to absolute and adds a transform based on the placement.\n */\n placement?: PlacementType;\n};\nexport type NavigationBehaviorState = {\n handleNavigationItemClick: (event: unknown) => void;\n};\nexport type GapProps = {\n /**\n * If the absolute element should have a gap between the parent element.\n */\n gap?: boolean;\n};\nexport const GapSpacingList = (['none', '3x-large', '2x-large', 'x-large', 'large', 'medium', 'small', 'x-small', '2x-small', '3x-small'] as const);\nexport type GapSpacingType = (typeof GapSpacingList)[number];\nexport type GapSpacingProps = {\n /**\n * Set the gap/spacing between elements\n */\n gap?: GapSpacingType;\n};\nexport type OverflowProps = {\n /**\n * The overflow attribute sets a max-width and longer text will be dotted.\n */\n overflow?: boolean;\n};\nexport const OrientationList = (['horizontal', 'vertical'] as const);\nexport type OrientationType = (typeof OrientationList)[number];\nexport type OrientationProps = {\n /**\n * Change the orientation. Defaults to horizontal.\n */\n orientation?: OrientationType;\n};\nexport const WidthList = (['full', 'auto'] as const);\nexport type WidthType = (typeof WidthList)[number];\nexport type WidthProps = {\n /**\n * Width of the component. Auto width based on children size, full width based on parent elements width.\n */\n width?: WidthType;\n};\nexport const MaxWidthList = (['full', 'medium', 'large', 'small'] as const);\nexport type MaxWidthType = (typeof MaxWidthList)[number];\nexport type ContainerWidthProps = {\n /**\n * Set max width for the component\n */\n width?: MaxWidthType;\n};\nexport const PopoverDelayList = (['none', 'slow', 'fast'] as const);\nexport type PopoverDelayType = (typeof PopoverDelayList)[number];\nexport const PopoverWidthList = (['auto', 'fixed'] as const);\nexport type PopoverWidthType = (typeof PopoverWidthList)[number];\nexport type PopoverProps = {\n /**\n * Add a delay before showing the tooltip\n */\n delay?: PopoverDelayType;\n /**\n * Disable animation\n */\n animation?: boolean;\n /**\n * Use fixed with for default max-width\n */\n width?: PopoverWidthType;\n};\nexport type PopoverState = {\n handleAutoPlacement: () => void;\n};\nexport type ContentSlotProps = {\n /**\n * Default slot which is used to pass in additional content.\n */\n content?: any;\n};\nexport const SizeList = (['small', 'medium'] as const);\nexport type SizeType = (typeof SizeList)[number];\nexport type SizeProps = {\n /**\n * The size attribute changes the font-size and other related sizes of the component.\n */\n size?: SizeType;\n};\nexport const EmphasisList = (['weak', 'strong'] as const);\nexport type EmphasisType = (typeof EmphasisList)[number];\nexport type EmphasisProps = {\n /**\n * The emphasis attribute divides in between a weak or strong importance.\n */\n emphasis?: EmphasisType;\n};\nexport const TagEmphasisList = ([...EmphasisList, 'origin'] as const);\nexport type TagEmphasisType = (typeof TagEmphasisList)[number];\nexport type TagEmphasisProps = {\n /**\n * The emphasis attribute divides in between a weak, strong or origin appearance.\n */\n emphasis?: TagEmphasisType;\n};\nexport const ValidationList = (['invalid', 'valid', 'no-validation'] as const);\nexport type ValidationType = (typeof ValidationList)[number];\nexport type FormProps = {\n /**\n * Marks an input element as invalid (red) / valid (green) / no-validation (grey). Overwrites the :user-valid selector.\n */\n validation?: ValidationType;\n /**\n * The disabled attribute can be set to keep a user from clicking on the form element.\n */\n disabled?: boolean;\n /**\n * \tAssociates the control with a form element\n */\n form?: string;\n\n /**\n * The label attribute specifies the caption of the form element.\n */\n label?: string;\n\n /**\n * The name attribute gives the name of the form control, as used in form submission and in the form element's elements object.\n */\n name?: string;\n\n /**\n * When the required attribute specified, the user will be required to fill the form element before submitting the form.\n */\n required?: boolean;\n /**\n * Enables/disables the visibility of the label\n */\n showLabel?: boolean;\n /**\n * The value property is to receive results from the native form element.\n */\n value?: any;\n};\nexport type FormTextProps = {\n /**\n * Maximum length (number of characters) of value\n */\n maxLength?: number;\n /**\n * Minimum length (number of characters) of value\n */\n minLength?: number;\n /**\n * The disabled attribute can be set to keep a user from edit on the form element\n */\n readOnly?: boolean;\n};\nexport type FormSizeProps = {\n /**\n * Size of the control\n */\n size?: number;\n};\nexport type FormCheckProps = {\n /**\n * Define the radio or checkbox elements checked state\n */\n checked?: boolean;\n};\nexport const LabelVariantList = (['above', 'floating'] as const);\nexport type LabelVariantType = (typeof LabelVariantList)[number];\nexport const AutoCompleteList = (['off', 'on', 'name', 'honorific-prefix', 'given-name', 'additional-name', 'family-name', 'honorific-suffix', 'nickname', 'email', 'username', 'new-password', 'current-password', 'one-time-code', 'organization-title', 'organization', 'street-address', 'shipping', 'billing', 'address-line1', 'address-line2', 'address-line3', 'address-level4', 'address-level3', 'address-level2', 'address-level1', 'country', 'country-name', 'postal-code', 'cc-name', 'cc-given-name', 'cc-additional-name', 'cc-family-name', 'cc-number', 'cc-exp', 'cc-exp-month', 'cc-exp-year', 'cc-csc', 'cc-type', 'transaction-currency', 'transaction-amount', 'language', 'bday', 'bday-day', 'bday-month', 'bday-year', 'sex', 'tel', 'tel-country-code', 'tel-national', 'tel-area-code', 'tel-local', 'tel-extension', 'impp', 'url', 'photo', 'webauthn'] as const);\nexport type AutoCompleteType = (typeof AutoCompleteList)[number];\nexport type FormMessageProps = {\n /**\n * Change the variant of the label to float or hidden\n */\n variant?: LabelVariantType;\n /**\n * Text that appears in the form control when it has no value set\n */\n placeholder?: string;\n /**\n * Optional helper message for form components\n */\n message?: string;\n\n /**\n * Helper message for valid form components\n */\n validMessage?: string;\n\n /**\n * Helper message for invalid form components\n */\n invalidMessage?: string;\n\n /**\n * Set/overwrite icon for helper message for form components\n */\n messageIcon?: IconTypes;\n\n /**\n * See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete\n */\n autocomplete?: string | AutoCompleteType;\n\n /**\n * Enables or disables the visibility of the message.\n */\n showMessage?: boolean;\n};\nexport type FormState = {\n _messageId?: string;\n _validMessageId?: string;\n _invalidMessageId?: string;\n _descByIds?: string;\n _value?: string;\n\n /**\n * https://www.davidmacd.com/blog/test-aria-describedby-errormessage-aria-live.html\n * Currently VoiceOver isn't supporting changes from aria-describedby.\n * This is an internal Fallback\n */\n _voiceOverFallback?: string;\n};\nexport type InitializedState = {\n initialized: boolean;\n};\nexport const LinkCurrentList = (['time', 'true', 'false', 'date', 'page', 'step', 'location'] as const);\nexport type LinkCurrentType = (typeof LinkCurrentList)[number];\nexport const LinkTargetList = (['_self', '_blank', '_parent', '_top'] as const);\nexport type LinkTargetType = (typeof LinkTargetList)[number];\nexport const LinkReferrerPolicyList = (['no-referrer', 'no-referrer-when-downgrade', 'origin', 'origin-when-cross-origin', 'same-origin', 'strict-origin', 'strict-origin-when-cross-origin', 'unsafe-url'] as const);\nexport type LinkReferrerPolicyType = (typeof LinkReferrerPolicyList)[number];\nexport type LinkProps = {\n /**\n * Sets aria attribute based on [`aria-current`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-current).\n */\n current?: boolean | LinkCurrentType;\n /**\n * Disables the link.\n */\n disabled?: boolean;\n /**\n * The [URL that the hyperlink points to](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#href).\n */\n href?: string;\n /**\n * Hints for the human [language of the linked page or document](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#hreflang).\n */\n hreflang?: string;\n /**\n * Sets aria attribute based on [`aria-label`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label).\n */\n label?: string;\n /**\n * Where to open the linked URL, as the name for a [browsing context](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target).\n */\n target?: LinkTargetType;\n /**\n * The relationship of the linked URL as space-separated link types.\n */\n rel?: string;\n /**\n * Sets aria role based on [`aria-role`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles).\n */\n role?: string;\n /**\n * How much of the referrer to send when following the link.\n */\n referrerpolicy?: LinkReferrerPolicyType;\n /**\n * Sets aria role based on [`aria-selected`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-selected).\n */\n selected?: boolean;\n};\nexport type TextProps = {\n /**\n * Alternative for default slot/children.\n */\n text?: string;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type ClickEvent<T> = MouseEvent;\nexport type ClickEventProps<T> = {\n /**\n * React specific onClick to pass to forward ref.\n */\n onClick?: (event: ClickEvent<T>) => void;\n};\nexport type ClickEventState<T> = {\n handleClick: (event: ClickEvent<T>) => void;\n};\nexport type ToggleEventProps = {\n onToggle?: (open: boolean) => void;\n};\nexport type ToggleEventState<T> = {\n toggle: (event?: ClickEvent<T>) => void;\n};\nexport type CloseEventProps = {\n /**\n * Function to handle button click (close).\n */\n onClose?: (event?: any) => void;\n};\nexport type CloseEventState = {\n handleClose: (event: any) => void;\n};\nexport const AlignmentList = (['start', 'center'] as const);\nexport type AlignmentType = (typeof AlignmentList)[number];\nexport type AlignmentProps = {\n /**\n * Define the content alignment in full width\n */\n alignment?: AlignmentType;\n};\nexport type ActiveProps = {\n /**\n * If the tab is checked/active.\n */\n active?: boolean;\n};\nexport type InputEvent<T> = Event;\nexport type InputEventProps<T> = {\n input?: (event: InputEvent<T>) => void;\n onInput?: (event: InputEvent<T>) => void;\n};\nexport type InputEventState<T> = {\n handleInput: (event: InputEvent<T>) => void;\n};\nexport type ChangeEvent<T> = Event;\nexport type ChangeEventProps<T> = {\n change?: (event: ChangeEvent<T>) => void;\n onChange?: (event: ChangeEvent<T>) => void;\n};\nexport type ChangeEventState<T> = {\n handleChange: (event: ChangeEvent<T>) => void;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type InteractionEvent<T> = FocusEvent;\nexport type FocusEventProps<T> = {\n blur?: (event: InteractionEvent<T>) => void;\n onBlur?: (event: InteractionEvent<T>) => void;\n focus?: (event: InteractionEvent<T>) => void;\n onFocus?: (event: InteractionEvent<T>) => void;\n};\nexport type FocusEventState<T> = {\n handleBlur: (event: InteractionEvent<T>) => void;\n handleFocus: (event: InteractionEvent<T>) => void;\n};\nexport type InnerCloseButtonProps = {\n /**\n * The closeButtonId attribute changes the id inside the close button.\n */\n closeButtonId?: string;\n /**\n * The closeButtonText attribute changes the text inside the close button.\n */\n closeButtonText?: string;\n};\nexport type NavigationBackButtonProps = {\n /**\n * The backButtonId attribute changes the id inside the back button.\n */\n backButtonId?: string;\n /**\n * The backButtonText attribute changes the text inside the back button.\n */\n backButtonText?: string;\n};\nexport type AriaLabelledByProps = {\n /**\n * Pass aria-labelledby to inner element\n */\n labelledBy?: string;\n};\nexport type AriaControlsProps = {\n /**\n * Pass aria-controls to inner element\n */\n controls?: string;\n};\nexport type ValueLabelType = {\n value: string;\n label?: string;\n}"],"version":3}
@@ -8,7 +8,7 @@ const appGlobals = require('./app-globals-3a1e7e63.js');
8
8
  const defineCustomElements = async (win, options) => {
9
9
  if (typeof window === 'undefined') return undefined;
10
10
  await appGlobals.globalScripts();
11
- return index.bootstrapLazy([["db-tabs.cjs",[[4,"db-tabs",{"id":[1],"name":[1],"arrowScrollDistance":[2,"arrow-scroll-distance"],"orientation":[1],"behavior":[1],"initialSelectedMode":[1,"initial-selected-mode"],"initialSelectedIndex":[2,"initial-selected-index"],"className":[1,"classname"],"alignment":[1],"width":[1],"tabs":[1],"_id":[32],"_name":[32],"initialized":[32],"showScrollLeft":[32],"showScrollRight":[32],"scrollContainer":[32]}]]],["db-header.cjs",[[4,"db-header",{"id":[1],"forceMobile":[4,"force-mobile"],"drawerOpen":[4,"drawer-open"],"className":[1,"classname"],"width":[1],"burgerMenuLabel":[1,"burger-menu-label"],"_id":[32],"initialized":[32],"forcedToMobile":[32]}]]],["db-accordion.cjs",[[4,"db-accordion",{"id":[1],"name":[1],"behavior":[1],"initOpenIndex":[16],"className":[1,"classname"],"variant":[1],"items":[1],"_id":[32],"_name":[32],"initialized":[32],"_initOpenIndexDone":[32]}]]],["db-checkbox.cjs",[[4,"db-checkbox",{"id":[1],"message":[1],"showMessage":[4,"show-message"],"checked":[4],"indeterminate":[4],"change":[16],"validation":[1],"invalidMessage":[1,"invalid-message"],"required":[4],"validMessage":[1,"valid-message"],"blur":[16],"focus":[16],"className":[1,"classname"],"size":[1],"showLabel":[4,"show-label"],"name":[1],"disabled":[4],"value":[8],"label":[1],"messageIcon":[1,"message-icon"],"initialized":[32],"_id":[32],"_messageId":[32],"_validMessageId":[32],"_invalidMessageId":[32],"_descByIds":[32],"_voiceOverFallback":[32]}]]],["db-input.cjs",[[4,"db-input",{"id":[1],"dataListId":[1,"data-list-id"],"message":[1],"showMessage":[4,"show-message"],"value":[8],"input":[16],"change":[16],"validation":[1],"invalidMessage":[1,"invalid-message"],"required":[4],"minLength":[2,"min-length"],"maxLength":[2,"max-length"],"pattern":[1],"validMessage":[1,"valid-message"],"blur":[16],"focus":[16],"className":[1,"classname"],"variant":[1],"showLabel":[4,"show-label"],"showIcon":[4,"show-icon"],"icon":[1],"iconAfter":[1,"icon-after"],"label":[1],"name":[1],"type":[1],"placeholder":[1],"disabled":[4],"step":[8],"max":[8],"min":[8],"readOnly":[4,"read-only"],"form":[1],"autocomplete":[1],"autofocus":[4],"dataList":[16],"messageIcon":[1,"message-icon"],"_id":[32],"_messageId":[32],"_validMessageId":[32],"_invalidMessageId":[32],"_dataListId":[32],"_descByIds":[32],"_value":[32],"_voiceOverFallback":[32]}]]],["db-navigation-item.cjs",[[4,"db-navigation-item",{"subNavigationExpanded":[4,"sub-navigation-expanded"],"id":[1],"className":[1,"classname"],"width":[1],"icon":[1],"showIcon":[4,"show-icon"],"active":[4],"disabled":[4],"text":[1],"backButtonId":[1,"back-button-id"],"backButtonText":[1,"back-button-text"],"initialized":[32],"hasAreaPopup":[32],"hasSubNavigation":[32],"isSubNavigationExpanded":[32],"subNavigationId":[32],"navigationItemSafeTriangle":[32]}]]],["db-notification.cjs",[[4,"db-notification",{"id":[1],"className":[1,"classname"],"ariaLive":[1,"aria-live"],"semantic":[1],"variant":[1],"icon":[1],"showIcon":[4,"show-icon"],"linkVariant":[1,"link-variant"],"headline":[8],"showHeadline":[4,"show-headline"],"text":[1],"timestamp":[1],"showTimestamp":[4,"show-timestamp"],"closeable":[4],"closeButtonId":[1,"close-button-id"],"closeButtonText":[1,"close-button-text"]}]]],["db-select.cjs",[[4,"db-select",{"id":[1],"message":[1],"showMessage":[4,"show-message"],"value":[8],"input":[16],"change":[16],"validation":[1],"invalidMessage":[1,"invalid-message"],"required":[4],"validMessage":[1,"valid-message"],"blur":[16],"focus":[16],"className":[1,"classname"],"variant":[1],"showLabel":[4,"show-label"],"icon":[1],"showIcon":[4,"show-icon"],"label":[1],"disabled":[4],"name":[1],"autocomplete":[1],"options":[16],"placeholder":[1],"messageIcon":[1,"message-icon"],"_id":[32],"_messageId":[32],"_validMessageId":[32],"_invalidMessageId":[32],"_placeholderId":[32],"_descByIds":[32],"_value":[32],"initialized":[32],"_voiceOverFallback":[32]}]]],["db-textarea.cjs",[[0,"db-textarea",{"id":[1],"message":[1],"showMessage":[4,"show-message"],"value":[8],"input":[16],"change":[16],"validation":[1],"invalidMessage":[1,"invalid-message"],"required":[4],"minLength":[2,"min-length"],"maxLength":[2,"max-length"],"validMessage":[1,"valid-message"],"blur":[16],"focus":[16],"className":[1,"classname"],"variant":[1],"showLabel":[4,"show-label"],"label":[1],"resize":[1],"disabled":[4],"readOnly":[4,"read-only"],"form":[1],"name":[1],"wrap":[1],"spellCheck":[4,"spell-check"],"autocomplete":[1],"placeholder":[1],"rows":[2],"cols":[2],"messageIcon":[1,"message-icon"],"_id":[32],"_messageId":[32],"_validMessageId":[32],"_invalidMessageId":[32],"_descByIds":[32],"_value":[32],"_voiceOverFallback":[32]}]]],["db-badge.cjs",[[4,"db-badge",{"placement":[1],"id":[1],"className":[1,"classname"],"semantic":[1],"size":[1],"emphasis":[1],"label":[1],"text":[1],"initialized":[32]}]]],["db-brand.cjs",[[4,"db-brand",{"hideLogo":[4,"hide-logo"],"icon":[1],"showIcon":[4,"show-icon"],"id":[1],"className":[1,"classname"],"text":[1]}]]],["db-card.cjs",[[4,"db-card",{"id":[1],"className":[1,"classname"],"behavior":[1],"elevationLevel":[1,"elevation-level"],"spacing":[1]}]]],["db-divider.cjs",[[0,"db-divider",{"id":[1],"margin":[1],"variant":[1],"emphasis":[1],"width":[1],"className":[1,"classname"]}]]],["db-icon.cjs",[[4,"db-icon",{"id":[1],"className":[1,"classname"],"icon":[1],"weight":[1],"variant":[1],"text":[1]}]]],["db-link.cjs",[[4,"db-link",{"id":[1],"className":[1,"classname"],"href":[1],"target":[1],"rel":[1],"role":[1],"hreflang":[1],"disabled":[4],"selected":[4],"label":[1],"current":[8],"size":[1],"showIcon":[4,"show-icon"],"variant":[1],"content":[1],"text":[1]}]]],["db-navigation.cjs",[[4,"db-navigation",{"id":[1],"labelledBy":[1,"labelled-by"],"className":[1,"classname"],"_id":[32]}]]],["db-page.cjs",[[4,"db-page",{"fadeIn":[4,"fade-in"],"documentOverflow":[1,"document-overflow"],"variant":[1],"id":[1],"className":[1,"classname"],"fontsLoaded":[32]}]]],["db-popover.cjs",[[4,"db-popover",{"id":[1],"className":[1,"classname"],"spacing":[1],"gap":[4],"animation":[4],"open":[4],"delay":[1],"width":[1],"placement":[1],"initialized":[32],"isExpanded":[32]}]]],["db-radio.cjs",[[4,"db-radio",{"id":[1],"checked":[4],"change":[16],"blur":[16],"focus":[16],"size":[1],"showLabel":[4,"show-label"],"className":[1,"classname"],"validation":[1],"name":[1],"disabled":[4],"describedbyid":[1],"value":[8],"required":[4],"label":[1],"initialized":[32],"_id":[32]}]]],["db-section.cjs",[[4,"db-section",{"id":[1],"className":[1,"classname"],"spacing":[1],"width":[1],"_id":[32]}]]],["db-stack.cjs",[[4,"db-stack",{"id":[1],"className":[1,"classname"],"gap":[1],"variant":[1],"direction":[1],"alignment":[1],"justifyContent":[1,"justify-content"],"wrap":[4]}]]],["db-switch.cjs",[[4,"db-switch",{"id":[1],"change":[16],"blur":[16],"focus":[16],"visualAid":[4,"visual-aid"],"size":[1],"showLabel":[4,"show-label"],"emphasis":[1],"className":[1,"classname"],"checked":[4],"disabled":[4],"describedbyid":[1],"validation":[1],"name":[1],"required":[4],"icon":[1],"iconAfter":[1,"icon-after"],"label":[1],"_id":[32],"_checked":[32],"initialized":[32]}]]],["db-tag.cjs",[[4,"db-tag",{"disabled":[4],"removeButton":[1,"remove-button"],"id":[1],"className":[1,"classname"],"semantic":[1],"emphasis":[1],"icon":[1],"showCheckState":[4,"show-check-state"],"showIcon":[4,"show-icon"],"noText":[4,"no-text"],"overflow":[4],"text":[1],"behavior":[1],"initialized":[32]}]]],["db-tooltip.cjs",[[4,"db-tooltip",{"id":[1],"className":[1,"classname"],"emphasis":[1],"animation":[4],"delay":[1],"width":[1],"showArrow":[4,"show-arrow"],"placement":[1],"_id":[32],"initialized":[32]}]]],["db-drawer.cjs",[[4,"db-drawer",{"open":[4],"backdrop":[1],"variant":[1],"id":[1],"className":[1,"classname"],"spacing":[1],"width":[1],"direction":[1],"rounded":[4],"closeButtonId":[1,"close-button-id"],"closeButtonText":[1,"close-button-text"]}]]],["db-accordion-item.cjs",[[4,"db-accordion-item",{"id":[1],"defaultOpen":[4,"default-open"],"className":[1,"classname"],"disabled":[4],"headlinePlain":[1,"headline-plain"],"text":[1],"_id":[32],"_open":[32]}]]],["db-tab-item_3.cjs",[[4,"db-tab-item",{"active":[4],"change":[16],"className":[1,"classname"],"id":[1],"icon":[1],"iconAfter":[1,"icon-after"],"showIcon":[4,"show-icon"],"noText":[4,"no-text"],"disabled":[4],"controls":[1],"checked":[4],"label":[1],"initialized":[32],"_selected":[32]}],[4,"db-tab-list",{"id":[1],"className":[1,"classname"],"_id":[32]}],[4,"db-tab-panel",{"className":[1,"classname"],"id":[1],"labelledBy":[1,"labelled-by"],"content":[1]}]]],["db-infotext.cjs",[[4,"db-infotext",{"id":[1],"className":[1,"classname"],"icon":[1],"semantic":[1],"size":[1],"showIcon":[4,"show-icon"],"text":[1]}]]],["db-button.cjs",[[4,"db-button",{"id":[1],"className":[1,"classname"],"type":[1],"disabled":[4],"label":[1],"icon":[1],"showIcon":[4,"show-icon"],"size":[1],"state":[1],"width":[1],"variant":[1],"noText":[4,"no-text"],"name":[1],"value":[1],"describedbyid":[1],"ariaexpanded":[4],"ariapressed":[4],"text":[1]}]]]], options);
11
+ return index.bootstrapLazy([["db-tabs.cjs",[[4,"db-tabs",{"id":[1],"name":[1],"arrowScrollDistance":[2,"arrow-scroll-distance"],"orientation":[1],"behavior":[1],"initialSelectedMode":[1,"initial-selected-mode"],"initialSelectedIndex":[2,"initial-selected-index"],"className":[1,"classname"],"alignment":[1],"width":[1],"tabs":[1],"_id":[32],"_name":[32],"initialized":[32],"showScrollLeft":[32],"showScrollRight":[32],"scrollContainer":[32]}]]],["db-header.cjs",[[4,"db-header",{"id":[1],"forceMobile":[4,"force-mobile"],"drawerOpen":[4,"drawer-open"],"className":[1,"classname"],"width":[1],"burgerMenuLabel":[1,"burger-menu-label"],"_id":[32],"initialized":[32],"forcedToMobile":[32]}]]],["db-accordion.cjs",[[4,"db-accordion",{"id":[1],"name":[1],"behavior":[1],"initOpenIndex":[16],"className":[1,"classname"],"variant":[1],"items":[1],"_id":[32],"_name":[32],"initialized":[32],"_initOpenIndexDone":[32]}]]],["db-checkbox.cjs",[[4,"db-checkbox",{"id":[1],"message":[1],"showMessage":[4,"show-message"],"indeterminate":[4],"checked":[4],"change":[16],"validation":[1],"invalidMessage":[1,"invalid-message"],"required":[4],"validMessage":[1,"valid-message"],"blur":[16],"focus":[16],"className":[1,"classname"],"size":[1],"showLabel":[4,"show-label"],"name":[1],"disabled":[4],"value":[8],"label":[1],"messageIcon":[1,"message-icon"],"initialized":[32],"_id":[32],"_messageId":[32],"_validMessageId":[32],"_invalidMessageId":[32],"_descByIds":[32],"_voiceOverFallback":[32]}]]],["db-input.cjs",[[4,"db-input",{"id":[1],"dataListId":[1,"data-list-id"],"message":[1],"showMessage":[4,"show-message"],"value":[8],"input":[16],"change":[16],"validation":[1],"invalidMessage":[1,"invalid-message"],"required":[4],"minLength":[2,"min-length"],"maxLength":[2,"max-length"],"pattern":[1],"validMessage":[1,"valid-message"],"blur":[16],"focus":[16],"className":[1,"classname"],"variant":[1],"showLabel":[4,"show-label"],"showIcon":[4,"show-icon"],"icon":[1],"iconAfter":[1,"icon-after"],"label":[1],"name":[1],"type":[1],"placeholder":[1],"disabled":[4],"step":[8],"max":[8],"min":[8],"readOnly":[4,"read-only"],"form":[1],"size":[2],"autocomplete":[1],"autofocus":[4],"dataList":[16],"messageIcon":[1,"message-icon"],"_id":[32],"_messageId":[32],"_validMessageId":[32],"_invalidMessageId":[32],"_dataListId":[32],"_descByIds":[32],"_value":[32],"_voiceOverFallback":[32]}]]],["db-navigation-item.cjs",[[4,"db-navigation-item",{"subNavigationExpanded":[4,"sub-navigation-expanded"],"id":[1],"className":[1,"classname"],"width":[1],"icon":[1],"showIcon":[4,"show-icon"],"active":[4],"disabled":[4],"text":[1],"backButtonId":[1,"back-button-id"],"backButtonText":[1,"back-button-text"],"initialized":[32],"hasAreaPopup":[32],"hasSubNavigation":[32],"isSubNavigationExpanded":[32],"subNavigationId":[32],"navigationItemSafeTriangle":[32]}]]],["db-notification.cjs",[[4,"db-notification",{"id":[1],"className":[1,"classname"],"ariaLive":[1,"aria-live"],"semantic":[1],"variant":[1],"icon":[1],"showIcon":[4,"show-icon"],"linkVariant":[1,"link-variant"],"headline":[8],"showHeadline":[4,"show-headline"],"text":[1],"timestamp":[1],"showTimestamp":[4,"show-timestamp"],"closeable":[4],"closeButtonId":[1,"close-button-id"],"closeButtonText":[1,"close-button-text"]}]]],["db-select.cjs",[[4,"db-select",{"id":[1],"message":[1],"showMessage":[4,"show-message"],"value":[8],"input":[16],"change":[16],"validation":[1],"invalidMessage":[1,"invalid-message"],"required":[4],"validMessage":[1,"valid-message"],"blur":[16],"focus":[16],"className":[1,"classname"],"variant":[1],"showLabel":[4,"show-label"],"icon":[1],"showIcon":[4,"show-icon"],"label":[1],"disabled":[4],"name":[1],"size":[2],"autocomplete":[1],"options":[16],"placeholder":[1],"messageIcon":[1,"message-icon"],"_id":[32],"_messageId":[32],"_validMessageId":[32],"_invalidMessageId":[32],"_placeholderId":[32],"_descByIds":[32],"_value":[32],"initialized":[32],"_voiceOverFallback":[32]}]]],["db-textarea.cjs",[[0,"db-textarea",{"id":[1],"message":[1],"showMessage":[4,"show-message"],"value":[8],"input":[16],"change":[16],"validation":[1],"invalidMessage":[1,"invalid-message"],"required":[4],"minLength":[2,"min-length"],"maxLength":[2,"max-length"],"validMessage":[1,"valid-message"],"blur":[16],"focus":[16],"className":[1,"classname"],"variant":[1],"showLabel":[4,"show-label"],"label":[1],"resize":[1],"disabled":[4],"readOnly":[4,"read-only"],"form":[1],"name":[1],"wrap":[1],"spellCheck":[4,"spell-check"],"autocomplete":[1],"placeholder":[1],"rows":[2],"cols":[2],"messageIcon":[1,"message-icon"],"_id":[32],"_messageId":[32],"_validMessageId":[32],"_invalidMessageId":[32],"_descByIds":[32],"_value":[32],"_voiceOverFallback":[32]}]]],["db-badge.cjs",[[4,"db-badge",{"placement":[1],"id":[1],"className":[1,"classname"],"semantic":[1],"size":[1],"emphasis":[1],"label":[1],"text":[1],"initialized":[32]}]]],["db-brand.cjs",[[4,"db-brand",{"hideLogo":[4,"hide-logo"],"icon":[1],"showIcon":[4,"show-icon"],"id":[1],"className":[1,"classname"],"text":[1]}]]],["db-card.cjs",[[4,"db-card",{"id":[1],"className":[1,"classname"],"behavior":[1],"elevationLevel":[1,"elevation-level"],"spacing":[1]}]]],["db-divider.cjs",[[0,"db-divider",{"id":[1],"margin":[1],"variant":[1],"emphasis":[1],"width":[1],"className":[1,"classname"]}]]],["db-icon.cjs",[[4,"db-icon",{"id":[1],"className":[1,"classname"],"icon":[1],"weight":[1],"variant":[1],"text":[1]}]]],["db-link.cjs",[[4,"db-link",{"id":[1],"className":[1,"classname"],"href":[1],"target":[1],"rel":[1],"role":[1],"hreflang":[1],"disabled":[4],"selected":[4],"label":[1],"current":[8],"size":[1],"showIcon":[4,"show-icon"],"variant":[1],"content":[1],"text":[1]}]]],["db-navigation.cjs",[[4,"db-navigation",{"id":[1],"labelledBy":[1,"labelled-by"],"className":[1,"classname"],"_id":[32]}]]],["db-page.cjs",[[4,"db-page",{"fadeIn":[4,"fade-in"],"documentOverflow":[1,"document-overflow"],"variant":[1],"id":[1],"className":[1,"classname"],"fontsLoaded":[32]}]]],["db-popover.cjs",[[4,"db-popover",{"id":[1],"className":[1,"classname"],"spacing":[1],"gap":[4],"animation":[4],"open":[4],"delay":[1],"width":[1],"placement":[1],"initialized":[32],"isExpanded":[32]}]]],["db-radio.cjs",[[4,"db-radio",{"id":[1],"checked":[4],"change":[16],"blur":[16],"focus":[16],"size":[1],"showLabel":[4,"show-label"],"className":[1,"classname"],"validation":[1],"name":[1],"disabled":[4],"describedbyid":[1],"value":[8],"required":[4],"label":[1],"initialized":[32],"_id":[32]}]]],["db-section.cjs",[[4,"db-section",{"id":[1],"className":[1,"classname"],"spacing":[1],"width":[1],"_id":[32]}]]],["db-stack.cjs",[[4,"db-stack",{"id":[1],"className":[1,"classname"],"gap":[1],"variant":[1],"direction":[1],"alignment":[1],"justifyContent":[1,"justify-content"],"wrap":[4]}]]],["db-switch.cjs",[[4,"db-switch",{"id":[1],"checked":[4],"change":[16],"blur":[16],"focus":[16],"visualAid":[4,"visual-aid"],"size":[1],"showLabel":[4,"show-label"],"emphasis":[1],"className":[1,"classname"],"value":[8],"disabled":[4],"describedbyid":[1],"validation":[1],"name":[1],"required":[4],"icon":[1],"iconAfter":[1,"icon-after"],"label":[1],"_id":[32],"_checked":[32]}]]],["db-tag.cjs",[[4,"db-tag",{"disabled":[4],"removeButton":[1,"remove-button"],"id":[1],"className":[1,"classname"],"semantic":[1],"emphasis":[1],"icon":[1],"showCheckState":[4,"show-check-state"],"showIcon":[4,"show-icon"],"noText":[4,"no-text"],"overflow":[4],"text":[1],"behavior":[1],"initialized":[32]}]]],["db-tooltip.cjs",[[4,"db-tooltip",{"id":[1],"className":[1,"classname"],"emphasis":[1],"animation":[4],"delay":[1],"width":[1],"showArrow":[4,"show-arrow"],"placement":[1],"_id":[32],"initialized":[32]}]]],["db-drawer.cjs",[[4,"db-drawer",{"open":[4],"backdrop":[1],"variant":[1],"id":[1],"className":[1,"classname"],"spacing":[1],"width":[1],"direction":[1],"rounded":[4],"closeButtonId":[1,"close-button-id"],"closeButtonText":[1,"close-button-text"]}]]],["db-accordion-item.cjs",[[4,"db-accordion-item",{"id":[1],"defaultOpen":[4,"default-open"],"className":[1,"classname"],"disabled":[4],"headlinePlain":[1,"headline-plain"],"text":[1],"_id":[32],"_open":[32]}]]],["db-tab-item_3.cjs",[[4,"db-tab-item",{"active":[4],"change":[16],"className":[1,"classname"],"id":[1],"icon":[1],"iconAfter":[1,"icon-after"],"showIcon":[4,"show-icon"],"noText":[4,"no-text"],"disabled":[4],"controls":[1],"checked":[4],"label":[1],"initialized":[32],"_selected":[32]}],[4,"db-tab-list",{"id":[1],"className":[1,"classname"],"_id":[32]}],[4,"db-tab-panel",{"className":[1,"classname"],"id":[1],"labelledBy":[1,"labelled-by"],"content":[1]}]]],["db-infotext.cjs",[[4,"db-infotext",{"id":[1],"className":[1,"classname"],"icon":[1],"semantic":[1],"size":[1],"showIcon":[4,"show-icon"],"text":[1]}]]],["db-button.cjs",[[4,"db-button",{"id":[1],"className":[1,"classname"],"type":[1],"disabled":[4],"label":[1],"icon":[1],"showIcon":[4,"show-icon"],"size":[1],"state":[1],"width":[1],"variant":[1],"noText":[4,"no-text"],"name":[1],"value":[1],"describedbyid":[1],"ariaexpanded":[4],"ariapressed":[4],"text":[1]}]]]], options);
12
12
  };
13
13
 
14
14
  exports.setNonce = index.setNonce;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const index = require('./index-c0df827d.js');
3
+ const index = require('./index-403366c7.js');
4
4
 
5
5
  const isEventTargetNavigationItem = (event) => {
6
6
  var _a, _b;
@@ -137,4 +137,4 @@ class NavigationItemSafeTriangle {
137
137
  exports.NavigationItemSafeTriangle = NavigationItemSafeTriangle;
138
138
  exports.isEventTargetNavigationItem = isEventTargetNavigationItem;
139
139
 
140
- //# sourceMappingURL=navigation-bb2d5552.js.map
140
+ //# sourceMappingURL=navigation-5586b826.js.map
@@ -1 +1 @@
1
- {"file":"navigation-bb2d5552.js","mappings":";;;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CAAC,EAAE,KAAK,WAAW,CAAC,EAAE,GAAG,CAAC,CAAC;QACxJ,IAAI,mBAAmB,EAAE;YACvB,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC;SAC/B;KACF;;;;;;","names":["handleDataOutside"],"sources":["src/utils/navigation.ts"],"sourcesContent":["import { handleDataOutside } from './index';\nexport type TriangleData = {\n itemRect: DOMRect;\n parentElementWidth: number;\n subNavigationHeight: number;\n padding: number;\n outsideVX: 'left' | 'right' | undefined;\n outsideVY: 'top' | 'bottom' | undefined;\n};\nexport const isEventTargetNavigationItem = (event: unknown): boolean => {\n const {\n target\n } = (event as {\n target: HTMLElement;\n });\n return Boolean(!target?.classList?.contains('db-navigation-item-expand-button') && target?.parentElement?.classList.contains('db-navigation-item'));\n};\nexport class NavigationItemSafeTriangle {\n private readonly element: HTMLElement | null;\n private readonly subNavigation: Element | null;\n private readonly parentSubNavigation: Element | null = null;\n private triangleData?: TriangleData;\n private initialized: boolean = false;\n private mouseX: number = 0;\n private mouseY: number = 0;\n constructor(element: HTMLElement | null, subNavigation: Element | null) {\n this.element = element;\n this.subNavigation = subNavigation;\n if (!this.element || !this.subNavigation) {\n return;\n }\n this.parentSubNavigation = this.element?.closest('.db-sub-navigation');\n\n /*\n * only initiate if:\n * 1. item is not at root navigation level\n * 2. item is not in the mobile navigation / within db-drawer\n */\n if (this.parentSubNavigation && !this.element.closest('.db-drawer')) {\n this.init();\n }\n }\n private init() {\n const parentElementWidth = this.parentSubNavigation?.getBoundingClientRect().width ?? 0;\n\n // the triangle has the width of the sub-navigation, current nav-item can be wider.\n // so the width of the triangle must be adapted to a possibly wider nav-item.\n this.element?.style.setProperty('--db-navigation-item-inline-size', `${parentElementWidth}px`);\n this.initialized = true;\n }\n public enableFollow() {\n if (!this.initialized || this.triangleData || !this.element || !this.subNavigation) {\n return;\n }\n const dataOutsidePair = handleDataOutside(this.subNavigation);\n const itemRect = this.element.getBoundingClientRect();\n const parentElementWidth = this.parentSubNavigation?.getBoundingClientRect().width ?? 0;\n this.triangleData = {\n itemRect,\n parentElementWidth,\n subNavigationHeight: this.subNavigation.getBoundingClientRect().height,\n padding: (parentElementWidth - itemRect.width) / 2,\n outsideVX: dataOutsidePair.vx,\n outsideVY: dataOutsidePair.vy\n };\n }\n public disableFollow() {\n this.triangleData = undefined;\n }\n private getTriangleTipX(): number {\n if (!this.triangleData) return 0;\n if (this.triangleData.outsideVX === 'right') {\n // vertical flipped triangle needs an inverted x pos\n return this.triangleData.itemRect.width - this.mouseX;\n }\n\n // triangle stops shrinking from 75% x pos\n return Math.min(this.mouseX, this.triangleData.itemRect.width * 0.75);\n }\n private getTriangleTipY(): number {\n if (!this.triangleData) return 0;\n\n // padding must be added to the y pos of the tip so that the y pos matches the cursor\n const mouseYLimited = Math.max(Math.min(this.mouseY, this.triangleData.itemRect.height), 0) + this.triangleData.padding;\n if (this.triangleData.outsideVY === 'bottom') {\n // add offset to tip y pos to match corrected sub-navigation y pos\n return mouseYLimited + (this.triangleData.subNavigationHeight - this.triangleData.padding * 2 - this.triangleData.itemRect.height);\n }\n return mouseYLimited;\n }\n private hasMouseEnteredSubNavigation(): boolean {\n if (!this.triangleData) {\n return false;\n }\n const isSubNavigationOnLeftSide = this.triangleData.outsideVX === 'right';\n if (isSubNavigationOnLeftSide && this.mouseX < -1 * this.triangleData.padding) {\n return true;\n }\n if (!isSubNavigationOnLeftSide && this.mouseX > this.triangleData.parentElementWidth - this.triangleData.padding) {\n return true;\n }\n return false;\n }\n private getTriangleCoordinates(variant: 'safe-triangle' | 'fill-gap'): undefined | {\n lb: string;\n lt: string;\n rt: string;\n rb: string;\n } {\n if (!this.triangleData) {\n return;\n }\n if (variant === 'fill-gap') {\n const itemHeight = `${this.triangleData.itemRect.height + 2 * this.triangleData.padding}px`;\n const xStart = `${this.triangleData.parentElementWidth - this.triangleData.padding}px`;\n return {\n lb: `${xStart} ${itemHeight}`,\n lt: `${xStart} 0`,\n rt: '100% 0',\n rb: `100% ${itemHeight}`\n };\n }\n const tipX = this.getTriangleTipX();\n const tipY = this.getTriangleTipY();\n const lb = `${tipX}px ${tipY}px`;\n const lt = `${tipX}px ${tipY}px`;\n return {\n lb,\n lt,\n rt: '100% 0',\n rb: '100% 100%'\n };\n }\n public followByMouseEvent(event: MouseEvent) {\n if (!this.initialized || !this.triangleData || !this.element || !this.subNavigation) {\n return;\n }\n this.mouseX = event.clientX - this.triangleData.itemRect.left;\n this.mouseY = event.clientY - this.triangleData.itemRect.top;\n const isOverSubNavigation = this.hasMouseEnteredSubNavigation();\n const coordinates = this.getTriangleCoordinates(isOverSubNavigation ? 'fill-gap' : 'safe-triangle');\n if (!coordinates) {\n return;\n }\n this.element.style.setProperty('--db-navigation-item-clip-path', `polygon(${coordinates.lb}, ${coordinates.lt}, ${coordinates.rt}, ${coordinates.rb})`);\n if (isOverSubNavigation) {\n this.triangleData = undefined;\n }\n }\n}\nexport default {\n isEventTargetNavigationItem,\n NavigationItemSafeTriangle\n}"],"version":3}
1
+ {"file":"navigation-5586b826.js","mappings":";;;;MASa,2BAA2B,GAAG,CAAC,KAAc;;IACxD,MAAM,EACJ,MAAM,EACP,GAAI,KAEH,CAAC;IACH,OAAO,OAAO,CAAC,EAAC,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,SAAS,0CAAE,QAAQ,CAAC,kCAAkC,CAAC,CAAA,KAAI,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,aAAa,0CAAE,SAAS,CAAC,QAAQ,CAAC,oBAAoB,CAAC,CAAA,CAAC,CAAC;AACtJ,EAAE;MACW,0BAA0B;IAQrC,YAAY,OAA2B,EAAE,aAA6B;;QALrD,wBAAmB,GAAmB,IAAI,CAAC;QAEpD,gBAAW,GAAY,KAAK,CAAC;QAC7B,WAAM,GAAW,CAAC,CAAC;QACnB,WAAM,GAAW,CAAC,CAAC;QAEzB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,aAAa,GAAG,aAAa,CAA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C,IAAI,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE;YACnF,OAAO;SACR;QACD,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC;QAC9D,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC;QAC7D,MAAM,mBAAmB,GAAG,IAAI,CAAC,4BAA4B,EAAE,CAAC;QAChE,MAAM,WAAW,GAAG,IAAI,CAAC,sBAAsB,CAAC,mBAAmB,GAAG,UAAU,GAAG,eAAe,CAAC,CAAC;QACpG,IAAI,CAAC,WAAW,EAAE;YAChB,OAAO;SACR;QACD,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,gCAAgC,EAAE,WAAW,WAAW,CAAC,EAAE,KAAK,WAAW,CAAC,EAAE,KAAK,WAAW,CAAC,EAAE,KAAK,WAAW,CAAC,EAAE,GAAG,CAAC,CAAC;QACxJ,IAAI,mBAAmB,EAAE;YACvB,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC;SAC/B;KACF;;;;;;","names":["handleDataOutside"],"sources":["src/utils/navigation.ts"],"sourcesContent":["import { handleDataOutside } from './index';\nexport type TriangleData = {\n itemRect: DOMRect;\n parentElementWidth: number;\n subNavigationHeight: number;\n padding: number;\n outsideVX: 'left' | 'right' | undefined;\n outsideVY: 'top' | 'bottom' | undefined;\n};\nexport const isEventTargetNavigationItem = (event: unknown): boolean => {\n const {\n target\n } = (event as {\n target: HTMLElement;\n });\n return Boolean(!target?.classList?.contains('db-navigation-item-expand-button') && target?.parentElement?.classList.contains('db-navigation-item'));\n};\nexport class NavigationItemSafeTriangle {\n private readonly element: HTMLElement | null;\n private readonly subNavigation: Element | null;\n private readonly parentSubNavigation: Element | null = null;\n private triangleData?: TriangleData;\n private initialized: boolean = false;\n private mouseX: number = 0;\n private mouseY: number = 0;\n constructor(element: HTMLElement | null, subNavigation: Element | null) {\n this.element = element;\n this.subNavigation = subNavigation;\n if (!this.element || !this.subNavigation) {\n return;\n }\n this.parentSubNavigation = this.element?.closest('.db-sub-navigation');\n\n /*\n * only initiate if:\n * 1. item is not at root navigation level\n * 2. item is not in the mobile navigation / within db-drawer\n */\n if (this.parentSubNavigation && !this.element.closest('.db-drawer')) {\n this.init();\n }\n }\n private init() {\n const parentElementWidth = this.parentSubNavigation?.getBoundingClientRect().width ?? 0;\n\n // the triangle has the width of the sub-navigation, current nav-item can be wider.\n // so the width of the triangle must be adapted to a possibly wider nav-item.\n this.element?.style.setProperty('--db-navigation-item-inline-size', `${parentElementWidth}px`);\n this.initialized = true;\n }\n public enableFollow() {\n if (!this.initialized || this.triangleData || !this.element || !this.subNavigation) {\n return;\n }\n const dataOutsidePair = handleDataOutside(this.subNavigation);\n const itemRect = this.element.getBoundingClientRect();\n const parentElementWidth = this.parentSubNavigation?.getBoundingClientRect().width ?? 0;\n this.triangleData = {\n itemRect,\n parentElementWidth,\n subNavigationHeight: this.subNavigation.getBoundingClientRect().height,\n padding: (parentElementWidth - itemRect.width) / 2,\n outsideVX: dataOutsidePair.vx,\n outsideVY: dataOutsidePair.vy\n };\n }\n public disableFollow() {\n this.triangleData = undefined;\n }\n private getTriangleTipX(): number {\n if (!this.triangleData) return 0;\n if (this.triangleData.outsideVX === 'right') {\n // vertical flipped triangle needs an inverted x pos\n return this.triangleData.itemRect.width - this.mouseX;\n }\n\n // triangle stops shrinking from 75% x pos\n return Math.min(this.mouseX, this.triangleData.itemRect.width * 0.75);\n }\n private getTriangleTipY(): number {\n if (!this.triangleData) return 0;\n\n // padding must be added to the y pos of the tip so that the y pos matches the cursor\n const mouseYLimited = Math.max(Math.min(this.mouseY, this.triangleData.itemRect.height), 0) + this.triangleData.padding;\n if (this.triangleData.outsideVY === 'bottom') {\n // add offset to tip y pos to match corrected sub-navigation y pos\n return mouseYLimited + (this.triangleData.subNavigationHeight - this.triangleData.padding * 2 - this.triangleData.itemRect.height);\n }\n return mouseYLimited;\n }\n private hasMouseEnteredSubNavigation(): boolean {\n if (!this.triangleData) {\n return false;\n }\n const isSubNavigationOnLeftSide = this.triangleData.outsideVX === 'right';\n if (isSubNavigationOnLeftSide && this.mouseX < -1 * this.triangleData.padding) {\n return true;\n }\n if (!isSubNavigationOnLeftSide && this.mouseX > this.triangleData.parentElementWidth - this.triangleData.padding) {\n return true;\n }\n return false;\n }\n private getTriangleCoordinates(variant: 'safe-triangle' | 'fill-gap'): undefined | {\n lb: string;\n lt: string;\n rt: string;\n rb: string;\n } {\n if (!this.triangleData) {\n return;\n }\n if (variant === 'fill-gap') {\n const itemHeight = `${this.triangleData.itemRect.height + 2 * this.triangleData.padding}px`;\n const xStart = `${this.triangleData.parentElementWidth - this.triangleData.padding}px`;\n return {\n lb: `${xStart} ${itemHeight}`,\n lt: `${xStart} 0`,\n rt: '100% 0',\n rb: `100% ${itemHeight}`\n };\n }\n const tipX = this.getTriangleTipX();\n const tipY = this.getTriangleTipY();\n const lb = `${tipX}px ${tipY}px`;\n const lt = `${tipX}px ${tipY}px`;\n return {\n lb,\n lt,\n rt: '100% 0',\n rb: '100% 100%'\n };\n }\n public followByMouseEvent(event: MouseEvent) {\n if (!this.initialized || !this.triangleData || !this.element || !this.subNavigation) {\n return;\n }\n this.mouseX = event.clientX - this.triangleData.itemRect.left;\n this.mouseY = event.clientY - this.triangleData.itemRect.top;\n const isOverSubNavigation = this.hasMouseEnteredSubNavigation();\n const coordinates = this.getTriangleCoordinates(isOverSubNavigation ? 'fill-gap' : 'safe-triangle');\n if (!coordinates) {\n return;\n }\n this.element.style.setProperty('--db-navigation-item-clip-path', `polygon(${coordinates.lb}, ${coordinates.lt}, ${coordinates.rt}, ${coordinates.rb})`);\n if (isOverSubNavigation) {\n this.triangleData = undefined;\n }\n }\n}\nexport default {\n isEventTargetNavigationItem,\n NavigationItemSafeTriangle\n}"],"version":3}
@@ -1,5 +1,5 @@
1
- import { cls, delay, getHideProp, hasVoiceOver, stringPropVisible, uuid, } from "../../utils";
2
1
  import { DEFAULT_INVALID_MESSAGE, DEFAULT_INVALID_MESSAGE_ID_SUFFIX, DEFAULT_MESSAGE_ID_SUFFIX, DEFAULT_VALID_MESSAGE, DEFAULT_VALID_MESSAGE_ID_SUFFIX, } from "../../shared/constants";
2
+ import { cls, delay, getHideProp, hasVoiceOver, stringPropVisible, uuid, } from "../../utils";
3
3
  import { h } from "@stencil/core";
4
4
  /**
5
5
  * @slot children - This is a default/unnamed slot
@@ -115,27 +115,26 @@ export class DBCheckbox {
115
115
  this._descByIds = messageId;
116
116
  }
117
117
  }
118
- if (this.initialized && document && this._id) {
119
- const checkboxElement = document === null || document === void 0 ? void 0 : document.getElementById(this._id);
120
- if (checkboxElement) {
121
- // in angular this must be set via native element
122
- if (this.checked != undefined) {
123
- checkboxElement.checked = this.checked;
124
- }
125
- if (this.indeterminate !== undefined) {
126
- // When indeterminate is set, the value of the checked prop only impacts the form submitted values.
127
- // It has no accessibility or UX implications. (https://mui.com/material-ui/react-checkbox/)
128
- checkboxElement.indeterminate = this.indeterminate;
129
- }
130
- this.initialized = false;
118
+ if (this._ref) {
119
+ if (this.indeterminate !== undefined) {
120
+ // When indeterminate is set, the value of the checked prop only impacts the form submitted values.
121
+ // It has no accessibility or UX implications. (https://mui.com/material-ui/react-checkbox/)
122
+ this._ref.indeterminate = this.indeterminate;
131
123
  }
132
124
  }
125
+ if (this.initialized && this._ref) {
126
+ // in angular this must be set via native element
127
+ if (this.checked != undefined) {
128
+ this._ref.checked = this.checked;
129
+ }
130
+ this.initialized = false;
131
+ }
133
132
  }
134
133
  render() {
135
134
  var _a, _b, _c, _d;
136
- return (h("div", { key: '6f903d630c468fdd7075c59b05e4137f5850e517', class: cls("db-checkbox", this.className), "data-size": this.size, "data-hide-label": getHideProp(this.showLabel) }, h("label", { key: '122e74ed43e7d3ea0423c926bce7efe784f1efcc', htmlFor: this._id }, h("input", { key: '6dd67eb9a4e99426f8aa04f4d13d26302dd543f2', type: "checkbox", "aria-invalid": this.validation === "invalid", "data-custom-validity": this.validation, ref: (el) => {
135
+ return (h("div", { key: '516ed45e71cec94c78630961047e4eb17559fe74', class: cls("db-checkbox", this.className), "data-size": this.size, "data-hide-label": getHideProp(this.showLabel) }, h("label", { key: '8fdb1fe937b3ea39220b59a785967435ff38f08c', htmlFor: this._id }, h("input", { key: 'e7367922a1f060d40d2182a0f1dafc2b0c93f25f', type: "checkbox", "aria-invalid": this.validation === "invalid", "data-custom-validity": this.validation, ref: (el) => {
137
136
  this._ref = el;
138
- }, id: this._id, name: this.name, checked: this.checked, disabled: this.disabled, value: this.value, required: this.required, onChange: (event) => this.handleChange(event), onBlur: (event) => this.handleBlur(event), onFocus: (event) => this.handleFocus(event), "aria-describedby": this._descByIds }), this.label ? this.label : h("slot", null)), stringPropVisible(this.message, this.showMessage) ? (h("db-infotext", { size: "small", icon: this.messageIcon, id: this._messageId }, this.message)) : null, h("db-infotext", { key: '8b0db2ae635836386a2d1a5cd9a606a761493b20', size: "small", semantic: "successful", id: this._validMessageId }, (_a = this.validMessage) !== null && _a !== void 0 ? _a : DEFAULT_VALID_MESSAGE), h("db-infotext", { key: '75a7192d1a2999c9493453cc9d1019e74ce9ee85', size: "small", semantic: "critical", id: this._invalidMessageId }, (_d = (_b = this.invalidMessage) !== null && _b !== void 0 ? _b : (_c = this._ref) === null || _c === void 0 ? void 0 : _c.validationMessage) !== null && _d !== void 0 ? _d : DEFAULT_INVALID_MESSAGE), h("span", { key: '82516ae6e6ef5675d42a1aded5f00ebab1f1830c', "data-visually-hidden": "true", role: "status" }, this._voiceOverFallback)));
137
+ }, id: this._id, name: this.name, checked: this.checked, disabled: this.disabled, value: this.value, required: this.required, onChange: (event) => this.handleChange(event), onBlur: (event) => this.handleBlur(event), onFocus: (event) => this.handleFocus(event), "aria-describedby": this._descByIds }), this.label ? this.label : h("slot", null)), stringPropVisible(this.message, this.showMessage) ? (h("db-infotext", { size: "small", icon: this.messageIcon, id: this._messageId }, this.message)) : null, h("db-infotext", { key: 'c23ca5064548b1317552b66bd1e051483a761670', size: "small", semantic: "successful", id: this._validMessageId }, (_a = this.validMessage) !== null && _a !== void 0 ? _a : DEFAULT_VALID_MESSAGE), h("db-infotext", { key: '3adf578c5d66981b4d538dee7be9c9d371d47f7b', size: "small", semantic: "critical", id: this._invalidMessageId }, (_d = (_b = this.invalidMessage) !== null && _b !== void 0 ? _b : (_c = this._ref) === null || _c === void 0 ? void 0 : _c.validationMessage) !== null && _d !== void 0 ? _d : DEFAULT_INVALID_MESSAGE), h("span", { key: 'df025ce6148d146c671e0ffd7853f265713f8feb', "data-visually-hidden": "true", role: "status" }, this._voiceOverFallback)));
139
138
  }
140
139
  static get is() { return "db-checkbox"; }
141
140
  static get properties() {
@@ -215,11 +214,11 @@ export class DBCheckbox {
215
214
  "attribute": "show-message",
216
215
  "reflect": false
217
216
  },
218
- "checked": {
217
+ "indeterminate": {
219
218
  "type": "boolean",
220
219
  "mutable": false,
221
220
  "complexType": {
222
- "original": "DBCheckboxProps[\"checked\"]",
221
+ "original": "DBCheckboxProps[\"indeterminate\"]",
223
222
  "resolved": "boolean",
224
223
  "references": {
225
224
  "DBCheckboxProps": {
@@ -237,14 +236,14 @@ export class DBCheckbox {
237
236
  },
238
237
  "getter": false,
239
238
  "setter": false,
240
- "attribute": "checked",
239
+ "attribute": "indeterminate",
241
240
  "reflect": false
242
241
  },
243
- "indeterminate": {
242
+ "checked": {
244
243
  "type": "boolean",
245
244
  "mutable": false,
246
245
  "complexType": {
247
- "original": "DBCheckboxProps[\"indeterminate\"]",
246
+ "original": "DBCheckboxProps[\"checked\"]",
248
247
  "resolved": "boolean",
249
248
  "references": {
250
249
  "DBCheckboxProps": {
@@ -262,7 +261,7 @@ export class DBCheckbox {
262
261
  },
263
262
  "getter": false,
264
263
  "setter": false,
265
- "attribute": "indeterminate",
264
+ "attribute": "checked",
266
265
  "reflect": false
267
266
  },
268
267
  "change": {
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox.js","sourceRoot":"","sources":["../../../src/components/checkbox/checkbox.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,GAAG,EACH,KAAK,EACL,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,IAAI,GACL,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,uBAAuB,EACvB,iCAAiC,EACjC,yBAAyB,EACzB,qBAAqB,EACrB,+BAA+B,GAChC,MAAM,wBAAwB,CAAC;AAQhC,OAAO,EAAE,SAAS,EAAE,CAAC,EAAY,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAG3E;;;GAGG;AAIH,MAAM,OAAO,UAAU;IAHtB;QA6BU,gBAAW,GAAG,KAAK,CAAC;QACpB,QAAG,GAAG,SAAS,CAAC;QAChB,eAAU,GAAG,SAAS,CAAC;QACvB,oBAAe,GAAG,SAAS,CAAC;QAC5B,sBAAiB,GAAG,SAAS,CAAC;QAC9B,eAAU,GAAG,EAAE,CAAC;QAChB,uBAAkB,GAAG,EAAE,CAAC;KA6LlC;IA3LC,YAAY,CAAC,KAAoC;;QAC/C,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC5B,CAAC;QACD,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC;QACD,2EAA2E;QAC3E,IAAI,CAAC,CAAA,MAAA,IAAI,CAAC,IAAI,0CAAE,QAAQ,CAAC,KAAK,CAAA,IAAI,IAAI,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;YAChE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,iBAAiB,CAAC;YACzC,IAAI,YAAY,EAAE,EAAE,CAAC;gBACnB,IAAI,CAAC,kBAAkB;oBACr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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { DBCheckboxProps, DBCheckboxState } from \"./model\";\nimport {\n cls,\n delay,\n getHideProp,\n hasVoiceOver,\n stringPropVisible,\n uuid,\n} from \"../../utils\";\nimport {\n DEFAULT_INVALID_MESSAGE,\n DEFAULT_INVALID_MESSAGE_ID_SUFFIX,\n DEFAULT_MESSAGE_ID_SUFFIX,\n DEFAULT_VALID_MESSAGE,\n DEFAULT_VALID_MESSAGE_ID_SUFFIX,\n} from \"../../shared/constants\";\nimport { ChangeEvent, InteractionEvent } from \"../../shared/model\";\nimport {\n handleFrameworkEventAngular,\n handleFrameworkEventVue,\n} from \"../../utils/form-components\";\nimport { DBInfotext } from \"../infotext/infotext\";\n\nimport { Component, h, Fragment, Event, Prop, State } from \"@stencil/core\";\n\n\n/**\n * @slot children - This is a default/unnamed slot\n\n */\n @Component({\n tag: \"db-checkbox\",\n})\nexport class DBCheckbox {\n private _ref!: HTMLInputElement | null;\n @Prop() id: DBCheckboxProps[\"id\"];\n @Prop() message: DBCheckboxProps[\"message\"];\n @Prop() showMessage: DBCheckboxProps[\"showMessage\"];\n @Prop() checked: DBCheckboxProps[\"checked\"];\n @Prop() indeterminate: DBCheckboxProps[\"indeterminate\"];\n @Event() onChange: any;\n @Prop() change: DBCheckboxProps[\"change\"];\n @Prop() validation: DBCheckboxProps[\"validation\"];\n @Prop() invalidMessage: DBCheckboxProps[\"invalidMessage\"];\n @Prop() required: DBCheckboxProps[\"required\"];\n @Prop() validMessage: DBCheckboxProps[\"validMessage\"];\n @Event() onBlur: any;\n @Prop() blur: DBCheckboxProps[\"blur\"];\n @Event() onFocus: any;\n @Prop() focus: DBCheckboxProps[\"focus\"];\n @Prop({attribute: \"classname\"}) className: DBCheckboxProps[\"className\"];\n @Prop() size: DBCheckboxProps[\"size\"];\n @Prop() showLabel: DBCheckboxProps[\"showLabel\"];\n @Prop() name: DBCheckboxProps[\"name\"];\n @Prop() disabled: DBCheckboxProps[\"disabled\"];\n @Prop() value: DBCheckboxProps[\"value\"];\n @Prop() label: DBCheckboxProps[\"label\"];\n\n @Prop() messageIcon: DBCheckboxProps[\"messageIcon\"];\n @State() initialized = false;\n @State() _id = undefined;\n @State() _messageId = undefined;\n @State() _validMessageId = undefined;\n @State() _invalidMessageId = undefined;\n @State() _descByIds = \"\";\n @State() _voiceOverFallback = \"\";\n\n handleChange(event: ChangeEvent<HTMLInputElement>) {\n if (this.onChange) {\n this.onChange.emit(event);\n }\n if (this.change) {\n this.change(event);\n }\n /* For a11y reasons we need to map the correct message with the checkbox */\n if (!this._ref?.validity.valid || this.validation === \"invalid\") {\n this._descByIds = this._invalidMessageId;\n if (hasVoiceOver()) {\n this._voiceOverFallback =\n this.invalidMessage ??\n this._ref?.validationMessage ??\n DEFAULT_INVALID_MESSAGE;\n delay(() => (this._voiceOverFallback = \"\"), 1000);\n }\n } else if (\n this.validation === \"valid\" ||\n (this._ref?.validity.valid && this.required)\n ) {\n this._descByIds = this._validMessageId;\n if (hasVoiceOver()) {\n this._voiceOverFallback = this.validMessage ?? DEFAULT_VALID_MESSAGE;\n delay(() => (this._voiceOverFallback = \"\"), 1000);\n }\n } else if (stringPropVisible(this.message, this.showMessage)) {\n this._descByIds = this._messageId;\n } else {\n this._descByIds = \"\";\n }\n }\n handleBlur(event: InteractionEvent<HTMLInputElement>) {\n if (this.onBlur) {\n this.onBlur.emit(event);\n }\n if (this.blur) {\n this.blur(event);\n }\n }\n handleFocus(event: InteractionEvent<HTMLInputElement>) {\n if (this.onFocus) {\n this.onFocus.emit(event);\n }\n if (this.focus) {\n this.focus(event);\n }\n }\n\n /**\n * Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.\n * @param element the ref for the component\n * @param customElementSelector the custom element like `my-component`\n */\n private enableAttributePassing(\n element: HTMLInputElement | null,\n customElementSelector: string\n ) {\n const parent = element?.closest(customElementSelector);\n if (element && parent) {\n const attributes = parent.attributes;\n for (let i = 0; i < attributes.length; i++) {\n const attr = attributes.item(i);\n if (\n attr &&\n (attr.name.startsWith(\"data-\") || attr.name.startsWith(\"aria-\"))\n ) {\n element.setAttribute(attr.name, attr.value);\n parent.removeAttribute(attr.name);\n }\n if (attr && attr.name === \"class\") {\n const isWebComponent = attr.value.includes(\"hydrated\");\n const value = attr.value.replace(\"hydrated\", \"\").trim();\n const currentClass = element.getAttribute(\"class\");\n element.setAttribute(\n attr.name,\n `${currentClass ? `${currentClass} ` : \"\"}${value}`\n );\n if (isWebComponent) {\n // Stencil is using this class for lazy loading component\n parent.setAttribute(\"class\", \"hydrated\");\n } else {\n parent.removeAttribute(attr.name);\n }\n }\n }\n }\n }\n\n componentDidLoad() {\n this.enableAttributePassing(this._ref, \"db-checkbox\");\n this.initialized = true;\n const mId = this.id ?? `checkbox-${uuid()}`;\n this._id = mId;\n this._messageId = mId + DEFAULT_MESSAGE_ID_SUFFIX;\n this._validMessageId = mId + DEFAULT_VALID_MESSAGE_ID_SUFFIX;\n this._invalidMessageId = mId + DEFAULT_INVALID_MESSAGE_ID_SUFFIX;\n }\n\n componentDidUpdate() {\n if (this._id) {\n const messageId = this._id + DEFAULT_MESSAGE_ID_SUFFIX;\n this._messageId = messageId;\n this._validMessageId = this._id + DEFAULT_VALID_MESSAGE_ID_SUFFIX;\n this._invalidMessageId = this._id + DEFAULT_INVALID_MESSAGE_ID_SUFFIX;\n if (stringPropVisible(this.message, this.showMessage)) {\n this._descByIds = messageId;\n }\n }\n if (this.initialized && document && this._id) {\n const checkboxElement = document?.getElementById(\n this._id\n ) as HTMLInputElement;\n if (checkboxElement) {\n // in angular this must be set via native element\n if (this.checked != undefined) {\n checkboxElement.checked = this.checked;\n }\n if (this.indeterminate !== undefined) {\n // When indeterminate is set, the value of the checked prop only impacts the form submitted values.\n // It has no accessibility or UX implications. (https://mui.com/material-ui/react-checkbox/)\n checkboxElement.indeterminate = this.indeterminate;\n }\n this.initialized = false;\n }\n }\n }\n\n render() {\n return (\n <div\n class={cls(\"db-checkbox\", this.className)}\n data-size={this.size}\n data-hide-label={getHideProp(this.showLabel)}\n >\n <label htmlFor={this._id}>\n <input\n type=\"checkbox\"\n aria-invalid={this.validation === \"invalid\"}\n data-custom-validity={this.validation}\n ref={(el: any) => {\n this._ref = el;\n }}\n id={this._id}\n name={this.name}\n checked={this.checked}\n disabled={this.disabled}\n value={this.value}\n required={this.required}\n onChange={(event) => this.handleChange(event)}\n onBlur={(event) => this.handleBlur(event)}\n onFocus={(event) => this.handleFocus(event)}\n aria-describedby={this._descByIds}\n />\n {this.label ? this.label : <slot></slot>}\n </label>\n {stringPropVisible(this.message, this.showMessage) ? (\n <db-infotext\n size=\"small\"\n icon={this.messageIcon}\n id={this._messageId}\n >\n {this.message}\n </db-infotext>\n ) : null}\n <db-infotext\n size=\"small\"\n semantic=\"successful\"\n id={this._validMessageId}\n >\n {this.validMessage ?? DEFAULT_VALID_MESSAGE}\n </db-infotext>\n <db-infotext\n size=\"small\"\n semantic=\"critical\"\n id={this._invalidMessageId}\n >\n {this.invalidMessage ??\n this._ref?.validationMessage ??\n DEFAULT_INVALID_MESSAGE}\n </db-infotext>\n <span data-visually-hidden=\"true\" role=\"status\">\n {this._voiceOverFallback}\n </span>\n </div>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"checkbox.js","sourceRoot":"","sources":["../../../src/components/checkbox/checkbox.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,uBAAuB,EACvB,iCAAiC,EACjC,yBAAyB,EACzB,qBAAqB,EACrB,+BAA+B,GAChC,MAAM,wBAAwB,CAAC;AAOhC,OAAO,EACL,GAAG,EACH,KAAK,EACL,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,IAAI,GACL,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,SAAS,EAAE,CAAC,EAAY,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAG3E;;;GAGG;AAIH,MAAM,OAAO,UAAU;IAHtB;QA6BU,gBAAW,GAAG,KAAK,CAAC;QACpB,QAAG,GAAG,SAAS,CAAC;QAChB,eAAU,GAAG,SAAS,CAAC;QACvB,oBAAe,GAAG,SAAS,CAAC;QAC5B,sBAAiB,GAAG,SAAS,CAAC;QAC9B,eAAU,GAAG,EAAE,CAAC;QAChB,uBAAkB,GAAG,EAAE,CAAC;KA0LlC;IAxLC,YAAY,CAAC,KAAoC;;QAC/C,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC5B,CAAC;QACD,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC;QACD,2EAA2E;QAC3E,IAAI,CAAC,CAAA,MAAA,IAAI,CAAC,IAAI,0CAAE,QAAQ,CAAC,KAAK,CAAA,IAAI,IAAI,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;YAChE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,iBAAiB,CAAC;YACzC,IAAI,YAAY,EAAE,EAAE,CAAC;gBACnB,IAAI,CAAC,kBAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { DBCheckboxProps, DBCheckboxState } from \"./model\";\nimport {\n DEFAULT_INVALID_MESSAGE,\n DEFAULT_INVALID_MESSAGE_ID_SUFFIX,\n DEFAULT_MESSAGE_ID_SUFFIX,\n DEFAULT_VALID_MESSAGE,\n DEFAULT_VALID_MESSAGE_ID_SUFFIX,\n} from \"../../shared/constants\";\nimport { ChangeEvent, InteractionEvent } from \"../../shared/model\";\nimport {\n handleFrameworkEventAngular,\n handleFrameworkEventVue,\n} from \"../../utils/form-components\";\nimport { DBInfotext } from \"../infotext/infotext\";\nimport {\n cls,\n delay,\n getHideProp,\n hasVoiceOver,\n stringPropVisible,\n uuid,\n} from \"../../utils\";\n\nimport { Component, h, Fragment, Event, Prop, State } from \"@stencil/core\";\n\n\n/**\n * @slot children - This is a default/unnamed slot\n\n */\n @Component({\n tag: \"db-checkbox\",\n})\nexport class DBCheckbox {\n private _ref!: HTMLInputElement | null;\n @Prop() id: DBCheckboxProps[\"id\"];\n @Prop() message: DBCheckboxProps[\"message\"];\n @Prop() showMessage: DBCheckboxProps[\"showMessage\"];\n @Prop() indeterminate: DBCheckboxProps[\"indeterminate\"];\n @Prop() checked: DBCheckboxProps[\"checked\"];\n @Event() onChange: any;\n @Prop() change: DBCheckboxProps[\"change\"];\n @Prop() validation: DBCheckboxProps[\"validation\"];\n @Prop() invalidMessage: DBCheckboxProps[\"invalidMessage\"];\n @Prop() required: DBCheckboxProps[\"required\"];\n @Prop() validMessage: DBCheckboxProps[\"validMessage\"];\n @Event() onBlur: any;\n @Prop() blur: DBCheckboxProps[\"blur\"];\n @Event() onFocus: any;\n @Prop() focus: DBCheckboxProps[\"focus\"];\n @Prop({attribute: \"classname\"}) className: DBCheckboxProps[\"className\"];\n @Prop() size: DBCheckboxProps[\"size\"];\n @Prop() showLabel: DBCheckboxProps[\"showLabel\"];\n @Prop() name: DBCheckboxProps[\"name\"];\n @Prop() disabled: DBCheckboxProps[\"disabled\"];\n @Prop() value: DBCheckboxProps[\"value\"];\n @Prop() label: DBCheckboxProps[\"label\"];\n\n @Prop() messageIcon: DBCheckboxProps[\"messageIcon\"];\n @State() initialized = false;\n @State() _id = undefined;\n @State() _messageId = undefined;\n @State() _validMessageId = undefined;\n @State() _invalidMessageId = undefined;\n @State() _descByIds = \"\";\n @State() _voiceOverFallback = \"\";\n\n handleChange(event: ChangeEvent<HTMLInputElement>) {\n if (this.onChange) {\n this.onChange.emit(event);\n }\n if (this.change) {\n this.change(event);\n }\n /* For a11y reasons we need to map the correct message with the checkbox */\n if (!this._ref?.validity.valid || this.validation === \"invalid\") {\n this._descByIds = this._invalidMessageId;\n if (hasVoiceOver()) {\n this._voiceOverFallback =\n this.invalidMessage ??\n this._ref?.validationMessage ??\n DEFAULT_INVALID_MESSAGE;\n delay(() => (this._voiceOverFallback = \"\"), 1000);\n }\n } else if (\n this.validation === \"valid\" ||\n (this._ref?.validity.valid && this.required)\n ) {\n this._descByIds = this._validMessageId;\n if (hasVoiceOver()) {\n this._voiceOverFallback = this.validMessage ?? DEFAULT_VALID_MESSAGE;\n delay(() => (this._voiceOverFallback = \"\"), 1000);\n }\n } else if (stringPropVisible(this.message, this.showMessage)) {\n this._descByIds = this._messageId;\n } else {\n this._descByIds = \"\";\n }\n }\n handleBlur(event: InteractionEvent<HTMLInputElement>) {\n if (this.onBlur) {\n this.onBlur.emit(event);\n }\n if (this.blur) {\n this.blur(event);\n }\n }\n handleFocus(event: InteractionEvent<HTMLInputElement>) {\n if (this.onFocus) {\n this.onFocus.emit(event);\n }\n if (this.focus) {\n this.focus(event);\n }\n }\n\n /**\n * Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.\n * @param element the ref for the component\n * @param customElementSelector the custom element like `my-component`\n */\n private enableAttributePassing(\n element: HTMLInputElement | null,\n customElementSelector: string\n ) {\n const parent = element?.closest(customElementSelector);\n if (element && parent) {\n const attributes = parent.attributes;\n for (let i = 0; i < attributes.length; i++) {\n const attr = attributes.item(i);\n if (\n attr &&\n (attr.name.startsWith(\"data-\") || attr.name.startsWith(\"aria-\"))\n ) {\n element.setAttribute(attr.name, attr.value);\n parent.removeAttribute(attr.name);\n }\n if (attr && attr.name === \"class\") {\n const isWebComponent = attr.value.includes(\"hydrated\");\n const value = attr.value.replace(\"hydrated\", \"\").trim();\n const currentClass = element.getAttribute(\"class\");\n element.setAttribute(\n attr.name,\n `${currentClass ? `${currentClass} ` : \"\"}${value}`\n );\n if (isWebComponent) {\n // Stencil is using this class for lazy loading component\n parent.setAttribute(\"class\", \"hydrated\");\n } else {\n parent.removeAttribute(attr.name);\n }\n }\n }\n }\n }\n\n componentDidLoad() {\n this.enableAttributePassing(this._ref, \"db-checkbox\");\n this.initialized = true;\n const mId = this.id ?? `checkbox-${uuid()}`;\n this._id = mId;\n this._messageId = mId + DEFAULT_MESSAGE_ID_SUFFIX;\n this._validMessageId = mId + DEFAULT_VALID_MESSAGE_ID_SUFFIX;\n this._invalidMessageId = mId + DEFAULT_INVALID_MESSAGE_ID_SUFFIX;\n }\n\n componentDidUpdate() {\n if (this._id) {\n const messageId = this._id + DEFAULT_MESSAGE_ID_SUFFIX;\n this._messageId = messageId;\n this._validMessageId = this._id + DEFAULT_VALID_MESSAGE_ID_SUFFIX;\n this._invalidMessageId = this._id + DEFAULT_INVALID_MESSAGE_ID_SUFFIX;\n if (stringPropVisible(this.message, this.showMessage)) {\n this._descByIds = messageId;\n }\n }\n if (this._ref) {\n if (this.indeterminate !== undefined) {\n // When indeterminate is set, the value of the checked prop only impacts the form submitted values.\n // It has no accessibility or UX implications. (https://mui.com/material-ui/react-checkbox/)\n this._ref.indeterminate = this.indeterminate;\n }\n }\n if (this.initialized && this._ref) {\n // in angular this must be set via native element\n if (this.checked != undefined) {\n this._ref.checked = this.checked;\n }\n this.initialized = false;\n }\n }\n\n render() {\n return (\n <div\n class={cls(\"db-checkbox\", this.className)}\n data-size={this.size}\n data-hide-label={getHideProp(this.showLabel)}\n >\n <label htmlFor={this._id}>\n <input\n type=\"checkbox\"\n aria-invalid={this.validation === \"invalid\"}\n data-custom-validity={this.validation}\n ref={(el: any) => {\n this._ref = el;\n }}\n id={this._id}\n name={this.name}\n checked={this.checked}\n disabled={this.disabled}\n value={this.value}\n required={this.required}\n onChange={(event) => this.handleChange(event)}\n onBlur={(event) => this.handleBlur(event)}\n onFocus={(event) => this.handleFocus(event)}\n aria-describedby={this._descByIds}\n />\n {this.label ? this.label : <slot></slot>}\n </label>\n {stringPropVisible(this.message, this.showMessage) ? (\n <db-infotext\n size=\"small\"\n icon={this.messageIcon}\n id={this._messageId}\n >\n {this.message}\n </db-infotext>\n ) : null}\n <db-infotext\n size=\"small\"\n semantic=\"successful\"\n id={this._validMessageId}\n >\n {this.validMessage ?? DEFAULT_VALID_MESSAGE}\n </db-infotext>\n <db-infotext\n size=\"small\"\n semantic=\"critical\"\n id={this._invalidMessageId}\n >\n {this.invalidMessage ??\n this._ref?.validationMessage ??\n DEFAULT_INVALID_MESSAGE}\n </db-infotext>\n <span data-visually-hidden=\"true\" role=\"status\">\n {this._voiceOverFallback}\n </span>\n </div>\n );\n }\n}\n"]}
@@ -140,9 +140,9 @@ export class DBInput {
140
140
  }
141
141
  render() {
142
142
  var _a, _b, _c, _d, _e, _f, _g, _h;
143
- return (h("div", { key: '0f521207be8cf0672a87922ec9639f47ef9d39ac', class: cls("db-input", this.className), "data-variant": this.variant, "data-hide-label": getHideProp(this.showLabel), "data-hide-icon": getHideProp(this.showIcon), "data-icon": this.icon, "data-icon-after": this.iconAfter, "data-hide-icon-after": getHideProp(this.showIcon) }, h("label", { key: '711cfa71b5f0e1b2d6ba89a6e43e2f6e7f97d089', htmlFor: this._id }, (_a = this.label) !== null && _a !== void 0 ? _a : DEFAULT_LABEL), h("input", { key: '4f5316e89c031116fc09c3a42f4c42e3d430ad7f', "aria-invalid": this.validation === "invalid", "data-custom-validity": this.validation, ref: (el) => {
143
+ return (h("div", { key: 'c495a9fab61d950908b499b3e0086d43ab640e9e', class: cls("db-input", this.className), "data-variant": this.variant, "data-hide-label": getHideProp(this.showLabel), "data-hide-icon": getHideProp(this.showIcon), "data-icon": this.icon, "data-icon-after": this.iconAfter, "data-hide-icon-after": getHideProp(this.showIcon) }, h("label", { key: '1455952e00ec64ebbdff99dbfeca1bcab0fad386', htmlFor: this._id }, (_a = this.label) !== null && _a !== void 0 ? _a : DEFAULT_LABEL), h("input", { key: 'a44ee0cf8bf6f970a8e5124f6a0e3ac3271ec49d', "aria-invalid": this.validation === "invalid", "data-custom-validity": this.validation, ref: (el) => {
144
144
  this._ref = el;
145
- }, id: this._id, name: this.name, type: this.type || "text", placeholder: (_b = this.placeholder) !== null && _b !== void 0 ? _b : DEFAULT_PLACEHOLDER, disabled: this.disabled, required: this.required, step: this.step, value: (_c = this.value) !== null && _c !== void 0 ? _c : this._value, maxLength: this.maxLength, minLength: this.minLength, max: this.max, min: this.min, readOnly: this.readOnly, form: this.form, pattern: this.pattern, autoComplete: this.autocomplete, autoFocus: this.autofocus, onInput: (event) => this.handleInput(event), onChange: (event) => this.handleChange(event), onBlur: (event) => this.handleBlur(event), onFocus: (event) => this.handleFocus(event), list: this.dataList && this._dataListId, "aria-describedby": this._descByIds }), this.dataList ? (h("datalist", { id: this._dataListId }, (_d = this.getDataList(this.dataList)) === null || _d === void 0 ? void 0 : _d.map((option) => (h("option", { key: this._dataListId + "-option-" + option.value, value: option.value }, option.label))))) : null, h("slot", { key: 'd8989ce54df793e12783e695c47fdd0459ff76a2' }), stringPropVisible(this.message, this.showMessage) ? (h("db-infotext", { size: "small", icon: this.messageIcon, id: this._messageId }, this.message)) : null, h("db-infotext", { key: '38ff43ca42a686082cda229801079baa2cd14101', size: "small", semantic: "successful", id: this._validMessageId }, (_e = this.validMessage) !== null && _e !== void 0 ? _e : DEFAULT_VALID_MESSAGE), h("db-infotext", { key: '713f3e75192a41fcae4de9b6829bfa17c461097d', size: "small", semantic: "critical", id: this._invalidMessageId }, (_h = (_f = this.invalidMessage) !== null && _f !== void 0 ? _f : (_g = this._ref) === null || _g === void 0 ? void 0 : _g.validationMessage) !== null && _h !== void 0 ? _h : DEFAULT_INVALID_MESSAGE), h("span", { key: '8ebbf7d87f4adc7ebcf7e8ea138c6a4cac88b588', "data-visually-hidden": "true", role: "status" }, this._voiceOverFallback)));
145
+ }, id: this._id, name: this.name, type: this.type || "text", placeholder: (_b = this.placeholder) !== null && _b !== void 0 ? _b : DEFAULT_PLACEHOLDER, disabled: this.disabled, required: this.required, step: this.step, value: (_c = this.value) !== null && _c !== void 0 ? _c : this._value, maxLength: this.maxLength, minLength: this.minLength, max: this.max, min: this.min, readOnly: this.readOnly, form: this.form, pattern: this.pattern, size: this.size, autoComplete: this.autocomplete, autoFocus: this.autofocus, onInput: (event) => this.handleInput(event), onChange: (event) => this.handleChange(event), onBlur: (event) => this.handleBlur(event), onFocus: (event) => this.handleFocus(event), list: this.dataList && this._dataListId, "aria-describedby": this._descByIds }), this.dataList ? (h("datalist", { id: this._dataListId }, (_d = this.getDataList(this.dataList)) === null || _d === void 0 ? void 0 : _d.map((option) => (h("option", { key: this._dataListId + "-option-" + option.value, value: option.value }, option.label))))) : null, h("slot", { key: '84a78c2ff5cc605c59a3e6ce87fdd7a9ff00d62d' }), stringPropVisible(this.message, this.showMessage) ? (h("db-infotext", { size: "small", icon: this.messageIcon, id: this._messageId }, this.message)) : null, h("db-infotext", { key: 'cb6f79a3454d4a43252908a06ac865f136d29831', size: "small", semantic: "successful", id: this._validMessageId }, (_e = this.validMessage) !== null && _e !== void 0 ? _e : DEFAULT_VALID_MESSAGE), h("db-infotext", { key: 'cceacdec37a23a0ecbf20cd72f713a8bb01de9cd', size: "small", semantic: "critical", id: this._invalidMessageId }, (_h = (_f = this.invalidMessage) !== null && _f !== void 0 ? _f : (_g = this._ref) === null || _g === void 0 ? void 0 : _g.validationMessage) !== null && _h !== void 0 ? _h : DEFAULT_INVALID_MESSAGE), h("span", { key: 'f9e3edcb965bd270a3183fd5d715ef4b1138b90b', "data-visually-hidden": "true", role: "status" }, this._voiceOverFallback)));
146
146
  }
147
147
  static get is() { return "db-input"; }
148
148
  static get properties() {
@@ -939,6 +939,31 @@ export class DBInput {
939
939
  "attribute": "form",
940
940
  "reflect": false
941
941
  },
942
+ "size": {
943
+ "type": "number",
944
+ "mutable": false,
945
+ "complexType": {
946
+ "original": "DBInputProps[\"size\"]",
947
+ "resolved": "number",
948
+ "references": {
949
+ "DBInputProps": {
950
+ "location": "import",
951
+ "path": "./model",
952
+ "id": "src/components/input/model.ts::DBInputProps"
953
+ }
954
+ }
955
+ },
956
+ "required": false,
957
+ "optional": false,
958
+ "docs": {
959
+ "tags": [],
960
+ "text": ""
961
+ },
962
+ "getter": false,
963
+ "setter": false,
964
+ "attribute": "size",
965
+ "reflect": false
966
+ },
942
967
  "autocomplete": {
943
968
  "type": "string",
944
969
  "mutable": false,
@@ -1 +1 @@
1
- {"version":3,"file":"input.js","sourceRoot":"","sources":["../../../src/components/input/input.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,GAAG,EACH,KAAK,EACL,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,IAAI,GACL,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,i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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n cls,\n delay,\n getHideProp,\n hasVoiceOver,\n isArrayOfStrings,\n stringPropVisible,\n uuid,\n} from \"../../utils\";\nimport { DBInputProps, DBInputState } from \"./model\";\nimport {\n DEFAULT_DATALIST_ID_SUFFIX,\n DEFAULT_INVALID_MESSAGE,\n DEFAULT_INVALID_MESSAGE_ID_SUFFIX,\n DEFAULT_LABEL,\n DEFAULT_MESSAGE_ID_SUFFIX,\n DEFAULT_PLACEHOLDER,\n DEFAULT_VALID_MESSAGE,\n DEFAULT_VALID_MESSAGE_ID_SUFFIX,\n} from \"../../shared/constants\";\nimport {\n ChangeEvent,\n InputEvent,\n InteractionEvent,\n ValueLabelType,\n} from \"../../shared/model\";\nimport { DBInfotext } from \"../infotext/infotext\";\nimport {\n handleFrameworkEventVue,\n handleFrameworkEventAngular,\n} from \"../../utils/form-components\";\n\nimport { Component, h, Fragment, Event, Prop, State } from \"@stencil/core\";\n\n\n/**\n * @slot children - This is a default/unnamed slot\n\n */\n @Component({\n tag: \"db-input\",\n})\nexport class DBInput {\n private _ref!: HTMLInputElement | null;\n @Prop() id: DBInputProps[\"id\"];\n @Prop() dataListId: DBInputProps[\"dataListId\"];\n @Prop() message: DBInputProps[\"message\"];\n @Prop() showMessage: DBInputProps[\"showMessage\"];\n @Prop() value: DBInputProps[\"value\"];\n @Event() onInput: any;\n @Prop() input: DBInputProps[\"input\"];\n @Event() onChange: any;\n @Prop() change: DBInputProps[\"change\"];\n @Prop() validation: DBInputProps[\"validation\"];\n @Prop() invalidMessage: DBInputProps[\"invalidMessage\"];\n @Prop() required: DBInputProps[\"required\"];\n @Prop() minLength: DBInputProps[\"minLength\"];\n @Prop() maxLength: DBInputProps[\"maxLength\"];\n @Prop() pattern: DBInputProps[\"pattern\"];\n @Prop() validMessage: DBInputProps[\"validMessage\"];\n @Event() onBlur: any;\n @Prop() blur: DBInputProps[\"blur\"];\n @Event() onFocus: any;\n @Prop() focus: DBInputProps[\"focus\"];\n @Prop({attribute: \"classname\"}) className: DBInputProps[\"className\"];\n @Prop() variant: DBInputProps[\"variant\"];\n @Prop() showLabel: DBInputProps[\"showLabel\"];\n @Prop() showIcon: DBInputProps[\"showIcon\"];\n @Prop() icon: DBInputProps[\"icon\"];\n @Prop() iconAfter: DBInputProps[\"iconAfter\"];\n @Prop() label: DBInputProps[\"label\"];\n @Prop() name: DBInputProps[\"name\"];\n @Prop() type: DBInputProps[\"type\"];\n @Prop() placeholder: DBInputProps[\"placeholder\"];\n @Prop() disabled: DBInputProps[\"disabled\"];\n @Prop() step: DBInputProps[\"step\"];\n @Prop() max: DBInputProps[\"max\"];\n @Prop() min: DBInputProps[\"min\"];\n @Prop() readOnly: DBInputProps[\"readOnly\"];\n @Prop() form: DBInputProps[\"form\"];\n @Prop() autocomplete: DBInputProps[\"autocomplete\"];\n @Prop() autofocus: DBInputProps[\"autofocus\"];\n @Prop() dataList: DBInputProps[\"dataList\"];\n\n @Prop() messageIcon: DBInputProps[\"messageIcon\"];\n @State() _id = undefined;\n @State() _messageId = undefined;\n @State() _validMessageId = undefined;\n @State() _invalidMessageId = undefined;\n @State() _dataListId = undefined;\n @State() _descByIds = \"\";\n @State() _value = \"\";\n @State() _voiceOverFallback = \"\";\n\n handleInput(event: InputEvent<HTMLInputElement>) {\n if (this.onInput) {\n this.onInput.emit(event);\n }\n if (this.input) {\n this.input(event);\n }\n }\n handleChange(event: ChangeEvent<HTMLInputElement>) {\n if (this.onChange) {\n this.onChange.emit(event);\n }\n if (this.change) {\n this.change(event);\n }\n /* For a11y reasons we need to map the correct message with the input */\n if (!this._ref?.validity.valid || this.validation === \"invalid\") {\n this._descByIds = this._invalidMessageId;\n if (hasVoiceOver()) {\n this._voiceOverFallback =\n this.invalidMessage ??\n this._ref?.validationMessage ??\n DEFAULT_INVALID_MESSAGE;\n delay(() => (this._voiceOverFallback = \"\"), 1000);\n }\n } else if (\n this.validation === \"valid\" ||\n (this._ref?.validity.valid &&\n (this.required || this.minLength || this.maxLength || this.pattern))\n ) {\n this._descByIds = this._validMessageId;\n if (hasVoiceOver()) {\n this._voiceOverFallback = this.validMessage ?? DEFAULT_VALID_MESSAGE;\n delay(() => (this._voiceOverFallback = \"\"), 1000);\n }\n } else if (stringPropVisible(this.message, this.showMessage)) {\n this._descByIds = this._messageId;\n } else {\n this._descByIds = \"\";\n }\n }\n handleBlur(event: InteractionEvent<HTMLInputElement>) {\n if (this.onBlur) {\n this.onBlur.emit(event);\n }\n if (this.blur) {\n this.blur(event);\n }\n }\n handleFocus(event: InteractionEvent<HTMLInputElement>) {\n if (this.onFocus) {\n this.onFocus.emit(event);\n }\n if (this.focus) {\n this.focus(event);\n }\n }\n getDataList(_list?: string[] | ValueLabelType[]) {\n return Array.from(\n (isArrayOfStrings(_list)\n ? _list.map((val: string) => ({\n value: val,\n label: undefined,\n }))\n : _list) || []\n );\n }\n\n /**\n * Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.\n * @param element the ref for the component\n * @param customElementSelector the custom element like `my-component`\n */\n private enableAttributePassing(\n element: HTMLInputElement | null,\n customElementSelector: string\n ) {\n const parent = element?.closest(customElementSelector);\n if (element && parent) {\n const attributes = parent.attributes;\n for (let i = 0; i < attributes.length; i++) {\n const attr = attributes.item(i);\n if (\n attr &&\n (attr.name.startsWith(\"data-\") || attr.name.startsWith(\"aria-\"))\n ) {\n element.setAttribute(attr.name, attr.value);\n parent.removeAttribute(attr.name);\n }\n if (attr && attr.name === \"class\") {\n const isWebComponent = attr.value.includes(\"hydrated\");\n const value = attr.value.replace(\"hydrated\", \"\").trim();\n const currentClass = element.getAttribute(\"class\");\n element.setAttribute(\n attr.name,\n `${currentClass ? `${currentClass} ` : \"\"}${value}`\n );\n if (isWebComponent) {\n // Stencil is using this class for lazy loading component\n parent.setAttribute(\"class\", \"hydrated\");\n } else {\n parent.removeAttribute(attr.name);\n }\n }\n }\n }\n }\n\n componentDidLoad() {\n this.enableAttributePassing(this._ref, \"db-input\");\n const mId = this.id ?? `input-${uuid()}`;\n this._id = mId;\n this._messageId = mId + DEFAULT_MESSAGE_ID_SUFFIX;\n this._validMessageId = mId + DEFAULT_VALID_MESSAGE_ID_SUFFIX;\n this._invalidMessageId = mId + DEFAULT_INVALID_MESSAGE_ID_SUFFIX;\n this._dataListId = mId + DEFAULT_DATALIST_ID_SUFFIX;\n }\n\n componentDidUpdate() {\n if (this._id) {\n const messageId = this._id + DEFAULT_MESSAGE_ID_SUFFIX;\n this._messageId = messageId;\n this._validMessageId = this._id + DEFAULT_VALID_MESSAGE_ID_SUFFIX;\n this._invalidMessageId = this._id + DEFAULT_INVALID_MESSAGE_ID_SUFFIX;\n this._dataListId =\n this.dataListId ?? this._id + DEFAULT_DATALIST_ID_SUFFIX;\n if (stringPropVisible(this.message, this.showMessage)) {\n this._descByIds = messageId;\n }\n }\n this._value = this.value;\n }\n\n render() {\n return (\n <div\n class={cls(\"db-input\", this.className)}\n data-variant={this.variant}\n data-hide-label={getHideProp(this.showLabel)}\n data-hide-icon={getHideProp(this.showIcon)}\n data-icon={this.icon}\n data-icon-after={this.iconAfter}\n data-hide-icon-after={getHideProp(this.showIcon)}\n >\n <label htmlFor={this._id}>{this.label ?? DEFAULT_LABEL}</label>\n <input\n aria-invalid={this.validation === \"invalid\"}\n data-custom-validity={this.validation}\n ref={(el: any) => {\n this._ref = el;\n }}\n id={this._id}\n name={this.name}\n type={this.type || \"text\"}\n placeholder={this.placeholder ?? DEFAULT_PLACEHOLDER}\n disabled={this.disabled}\n required={this.required}\n step={this.step}\n value={this.value ?? this._value}\n maxLength={this.maxLength}\n minLength={this.minLength}\n max={this.max}\n min={this.min}\n readOnly={this.readOnly}\n form={this.form}\n pattern={this.pattern}\n autoComplete={this.autocomplete}\n autoFocus={this.autofocus}\n onInput={(event) => this.handleInput(event)}\n onChange={(event) => this.handleChange(event)}\n onBlur={(event) => this.handleBlur(event)}\n onFocus={(event) => this.handleFocus(event)}\n list={this.dataList && this._dataListId}\n aria-describedby={this._descByIds}\n />\n {this.dataList ? (\n <datalist id={this._dataListId}>\n {this.getDataList(this.dataList)?.map((option) => (\n <option\n key={this._dataListId + \"-option-\" + option.value}\n value={option.value}\n >\n {option.label}\n </option>\n ))}\n </datalist>\n ) : null}\n <slot></slot>\n {stringPropVisible(this.message, this.showMessage) ? (\n <db-infotext\n size=\"small\"\n icon={this.messageIcon}\n id={this._messageId}\n >\n {this.message}\n </db-infotext>\n ) : null}\n <db-infotext\n size=\"small\"\n semantic=\"successful\"\n id={this._validMessageId}\n >\n {this.validMessage ?? DEFAULT_VALID_MESSAGE}\n </db-infotext>\n <db-infotext\n size=\"small\"\n semantic=\"critical\"\n id={this._invalidMessageId}\n >\n {this.invalidMessage ??\n this._ref?.validationMessage ??\n DEFAULT_INVALID_MESSAGE}\n </db-infotext>\n <span data-visually-hidden=\"true\" role=\"status\">\n {this._voiceOverFallback}\n </span>\n </div>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"input.js","sourceRoot":"","sources":["../../../src/components/input/input.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,GAAG,EACH,KAAK,EACL,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,IAAI,GACL,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,iCAAiC,EACjC,aAAa,EACb,yBAAyB,EACzB,mBAAmB,EACnB,qBAAqB,EACrB,+BAA+B,GAChC,MAAM,wBAAwB,CAAC;AAahC,OAAO,EAAE,SAAS,EAAE,CAAC,EAAY,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAG3E;;;GAGG;AAIH,MAAM,OAAO,OAAO;IAHnB;QA+CU,QAAG,GAAG,SAAS,CAAC;QAChB,eAAU,GAAG,SAAS,CAAC;QACvB,oBAAe,GAAG,SAAS,CAAC;QAC5B,sBAAiB,GAAG,SAAS,CAAC;QAC9B,gBAAW,GAAG,SAAS,CAAC;QACxB,eAAU,GAAG,EAAE,CAAC;QAChB,WAAM,GAAG,EAAE,CAAC;QACZ,uBAAkB,GAAG,EAAE,CAAC;KA8NlC;IA5NC,WAAW,CAAC,KAAmC;QAC7C,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC3B,CAAC;QACD,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACpB,CAAC;IAC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n cls,\n delay,\n getHideProp,\n hasVoiceOver,\n isArrayOfStrings,\n stringPropVisible,\n uuid,\n} from \"../../utils\";\nimport { DBInputProps, DBInputState } from \"./model\";\nimport {\n DEFAULT_DATALIST_ID_SUFFIX,\n DEFAULT_INVALID_MESSAGE,\n DEFAULT_INVALID_MESSAGE_ID_SUFFIX,\n DEFAULT_LABEL,\n DEFAULT_MESSAGE_ID_SUFFIX,\n DEFAULT_PLACEHOLDER,\n DEFAULT_VALID_MESSAGE,\n DEFAULT_VALID_MESSAGE_ID_SUFFIX,\n} from \"../../shared/constants\";\nimport {\n ChangeEvent,\n InputEvent,\n InteractionEvent,\n ValueLabelType,\n} from \"../../shared/model\";\nimport { DBInfotext } from \"../infotext/infotext\";\nimport {\n handleFrameworkEventVue,\n handleFrameworkEventAngular,\n} from \"../../utils/form-components\";\n\nimport { Component, h, Fragment, Event, Prop, State } from \"@stencil/core\";\n\n\n/**\n * @slot children - This is a default/unnamed slot\n\n */\n @Component({\n tag: \"db-input\",\n})\nexport class DBInput {\n private _ref!: HTMLInputElement | null;\n @Prop() id: DBInputProps[\"id\"];\n @Prop() dataListId: DBInputProps[\"dataListId\"];\n @Prop() message: DBInputProps[\"message\"];\n @Prop() showMessage: DBInputProps[\"showMessage\"];\n @Prop() value: DBInputProps[\"value\"];\n @Event() onInput: any;\n @Prop() input: DBInputProps[\"input\"];\n @Event() onChange: any;\n @Prop() change: DBInputProps[\"change\"];\n @Prop() validation: DBInputProps[\"validation\"];\n @Prop() invalidMessage: DBInputProps[\"invalidMessage\"];\n @Prop() required: DBInputProps[\"required\"];\n @Prop() minLength: DBInputProps[\"minLength\"];\n @Prop() maxLength: DBInputProps[\"maxLength\"];\n @Prop() pattern: DBInputProps[\"pattern\"];\n @Prop() validMessage: DBInputProps[\"validMessage\"];\n @Event() onBlur: any;\n @Prop() blur: DBInputProps[\"blur\"];\n @Event() onFocus: any;\n @Prop() focus: DBInputProps[\"focus\"];\n @Prop({attribute: \"classname\"}) className: DBInputProps[\"className\"];\n @Prop() variant: DBInputProps[\"variant\"];\n @Prop() showLabel: DBInputProps[\"showLabel\"];\n @Prop() showIcon: DBInputProps[\"showIcon\"];\n @Prop() icon: DBInputProps[\"icon\"];\n @Prop() iconAfter: DBInputProps[\"iconAfter\"];\n @Prop() label: DBInputProps[\"label\"];\n @Prop() name: DBInputProps[\"name\"];\n @Prop() type: DBInputProps[\"type\"];\n @Prop() placeholder: DBInputProps[\"placeholder\"];\n @Prop() disabled: DBInputProps[\"disabled\"];\n @Prop() step: DBInputProps[\"step\"];\n @Prop() max: DBInputProps[\"max\"];\n @Prop() min: DBInputProps[\"min\"];\n @Prop() readOnly: DBInputProps[\"readOnly\"];\n @Prop() form: DBInputProps[\"form\"];\n @Prop() size: DBInputProps[\"size\"];\n @Prop() autocomplete: DBInputProps[\"autocomplete\"];\n @Prop() autofocus: DBInputProps[\"autofocus\"];\n @Prop() dataList: DBInputProps[\"dataList\"];\n\n @Prop() messageIcon: DBInputProps[\"messageIcon\"];\n @State() _id = undefined;\n @State() _messageId = undefined;\n @State() _validMessageId = undefined;\n @State() _invalidMessageId = undefined;\n @State() _dataListId = undefined;\n @State() _descByIds = \"\";\n @State() _value = \"\";\n @State() _voiceOverFallback = \"\";\n\n handleInput(event: InputEvent<HTMLInputElement>) {\n if (this.onInput) {\n this.onInput.emit(event);\n }\n if (this.input) {\n this.input(event);\n }\n }\n handleChange(event: ChangeEvent<HTMLInputElement>) {\n if (this.onChange) {\n this.onChange.emit(event);\n }\n if (this.change) {\n this.change(event);\n }\n /* For a11y reasons we need to map the correct message with the input */\n if (!this._ref?.validity.valid || this.validation === \"invalid\") {\n this._descByIds = this._invalidMessageId;\n if (hasVoiceOver()) {\n this._voiceOverFallback =\n this.invalidMessage ??\n this._ref?.validationMessage ??\n DEFAULT_INVALID_MESSAGE;\n delay(() => (this._voiceOverFallback = \"\"), 1000);\n }\n } else if (\n this.validation === \"valid\" ||\n (this._ref?.validity.valid &&\n (this.required || this.minLength || this.maxLength || this.pattern))\n ) {\n this._descByIds = this._validMessageId;\n if (hasVoiceOver()) {\n this._voiceOverFallback = this.validMessage ?? DEFAULT_VALID_MESSAGE;\n delay(() => (this._voiceOverFallback = \"\"), 1000);\n }\n } else if (stringPropVisible(this.message, this.showMessage)) {\n this._descByIds = this._messageId;\n } else {\n this._descByIds = \"\";\n }\n }\n handleBlur(event: InteractionEvent<HTMLInputElement>) {\n if (this.onBlur) {\n this.onBlur.emit(event);\n }\n if (this.blur) {\n this.blur(event);\n }\n }\n handleFocus(event: InteractionEvent<HTMLInputElement>) {\n if (this.onFocus) {\n this.onFocus.emit(event);\n }\n if (this.focus) {\n this.focus(event);\n }\n }\n getDataList(_list?: string[] | ValueLabelType[]) {\n return Array.from(\n (isArrayOfStrings(_list)\n ? _list.map((val: string) => ({\n value: val,\n label: undefined,\n }))\n : _list) || []\n );\n }\n\n /**\n * Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.\n * @param element the ref for the component\n * @param customElementSelector the custom element like `my-component`\n */\n private enableAttributePassing(\n element: HTMLInputElement | null,\n customElementSelector: string\n ) {\n const parent = element?.closest(customElementSelector);\n if (element && parent) {\n const attributes = parent.attributes;\n for (let i = 0; i < attributes.length; i++) {\n const attr = attributes.item(i);\n if (\n attr &&\n (attr.name.startsWith(\"data-\") || attr.name.startsWith(\"aria-\"))\n ) {\n element.setAttribute(attr.name, attr.value);\n parent.removeAttribute(attr.name);\n }\n if (attr && attr.name === \"class\") {\n const isWebComponent = attr.value.includes(\"hydrated\");\n const value = attr.value.replace(\"hydrated\", \"\").trim();\n const currentClass = element.getAttribute(\"class\");\n element.setAttribute(\n attr.name,\n `${currentClass ? `${currentClass} ` : \"\"}${value}`\n );\n if (isWebComponent) {\n // Stencil is using this class for lazy loading component\n parent.setAttribute(\"class\", \"hydrated\");\n } else {\n parent.removeAttribute(attr.name);\n }\n }\n }\n }\n }\n\n componentDidLoad() {\n this.enableAttributePassing(this._ref, \"db-input\");\n const mId = this.id ?? `input-${uuid()}`;\n this._id = mId;\n this._messageId = mId + DEFAULT_MESSAGE_ID_SUFFIX;\n this._validMessageId = mId + DEFAULT_VALID_MESSAGE_ID_SUFFIX;\n this._invalidMessageId = mId + DEFAULT_INVALID_MESSAGE_ID_SUFFIX;\n this._dataListId = mId + DEFAULT_DATALIST_ID_SUFFIX;\n }\n\n componentDidUpdate() {\n if (this._id) {\n const messageId = this._id + DEFAULT_MESSAGE_ID_SUFFIX;\n this._messageId = messageId;\n this._validMessageId = this._id + DEFAULT_VALID_MESSAGE_ID_SUFFIX;\n this._invalidMessageId = this._id + DEFAULT_INVALID_MESSAGE_ID_SUFFIX;\n this._dataListId =\n this.dataListId ?? this._id + DEFAULT_DATALIST_ID_SUFFIX;\n if (stringPropVisible(this.message, this.showMessage)) {\n this._descByIds = messageId;\n }\n }\n this._value = this.value;\n }\n\n render() {\n return (\n <div\n class={cls(\"db-input\", this.className)}\n data-variant={this.variant}\n data-hide-label={getHideProp(this.showLabel)}\n data-hide-icon={getHideProp(this.showIcon)}\n data-icon={this.icon}\n data-icon-after={this.iconAfter}\n data-hide-icon-after={getHideProp(this.showIcon)}\n >\n <label htmlFor={this._id}>{this.label ?? DEFAULT_LABEL}</label>\n <input\n aria-invalid={this.validation === \"invalid\"}\n data-custom-validity={this.validation}\n ref={(el: any) => {\n this._ref = el;\n }}\n id={this._id}\n name={this.name}\n type={this.type || \"text\"}\n placeholder={this.placeholder ?? DEFAULT_PLACEHOLDER}\n disabled={this.disabled}\n required={this.required}\n step={this.step}\n value={this.value ?? this._value}\n maxLength={this.maxLength}\n minLength={this.minLength}\n max={this.max}\n min={this.min}\n readOnly={this.readOnly}\n form={this.form}\n pattern={this.pattern}\n size={this.size}\n autoComplete={this.autocomplete}\n autoFocus={this.autofocus}\n onInput={(event) => this.handleInput(event)}\n onChange={(event) => this.handleChange(event)}\n onBlur={(event) => this.handleBlur(event)}\n onFocus={(event) => this.handleFocus(event)}\n list={this.dataList && this._dataListId}\n aria-describedby={this._descByIds}\n />\n {this.dataList ? (\n <datalist id={this._dataListId}>\n {this.getDataList(this.dataList)?.map((option) => (\n <option\n key={this._dataListId + \"-option-\" + option.value}\n value={option.value}\n >\n {option.label}\n </option>\n ))}\n </datalist>\n ) : null}\n <slot></slot>\n {stringPropVisible(this.message, this.showMessage) ? (\n <db-infotext\n size=\"small\"\n icon={this.messageIcon}\n id={this._messageId}\n >\n {this.message}\n </db-infotext>\n ) : null}\n <db-infotext\n size=\"small\"\n semantic=\"successful\"\n id={this._validMessageId}\n >\n {this.validMessage ?? DEFAULT_VALID_MESSAGE}\n </db-infotext>\n <db-infotext\n size=\"small\"\n semantic=\"critical\"\n id={this._invalidMessageId}\n >\n {this.invalidMessage ??\n this._ref?.validationMessage ??\n DEFAULT_INVALID_MESSAGE}\n </db-infotext>\n <span data-visually-hidden=\"true\" role=\"status\">\n {this._voiceOverFallback}\n </span>\n </div>\n );\n }\n}\n"]}