@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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./model\";\nimport { cls, uuid } from \"../../utils\";\nimport { DBButton } from \"../button/button\";\nimport { DBTabList } from \"../tab-list/tab-list\";\nimport { DBTabItem } from \"../tab-item/tab-item\";\nimport { DBTabPanel } from \"../tab-panel/tab-panel\";\n\nimport { Component, h, Fragment, Prop, State } from \"@stencil/core\";\n\n\n/**\n * @slot children - This is a default/unnamed slot\n\n */\n @Component({\n tag: \"db-tabs\",\n})\nexport class DBTabs {\n private _ref!: HTMLDivElement | null;\n @Prop() id: DBTabsProps[\"id\"];\n @Prop() name: DBTabsProps[\"name\"];\n @Prop() arrowScrollDistance: DBTabsProps[\"arrowScrollDistance\"];\n @Prop() orientation: DBTabsProps[\"orientation\"];\n @Prop() behavior: DBTabsProps[\"behavior\"];\n @Prop() initialSelectedMode: DBTabsProps[\"initialSelectedMode\"];\n @Prop() initialSelectedIndex: DBTabsProps[\"initialSelectedIndex\"];\n @Prop({attribute: \"classname\"}) className: DBTabsProps[\"className\"];\n @Prop() alignment: DBTabsProps[\"alignment\"];\n @Prop() width: DBTabsProps[\"width\"];\n @Prop() tabs: DBTabsProps[\"tabs\"];\n\n @State() _id = \"tabs-\" + uuid();\n @State() _name = \"\";\n @State() initialized = false;\n @State() showScrollLeft = false;\n @State() showScrollRight = false;\n @State() scrollContainer = null;\n\n convertTabs(tabs: unknown[] | string | undefined) {\n try {\n if (typeof tabs === \"string\") {\n return JSON.parse(tabs);\n }\n return tabs as DBSimpleTabProps[];\n } catch (error) {\n console.error(error);\n }\n return [];\n }\n evaluateScrollButtons(tList: Element) {\n const needsScroll = tList.scrollWidth > tList.clientWidth;\n this.showScrollLeft = needsScroll && tList.scrollLeft > 1;\n this.showScrollRight =\n needsScroll && tList.scrollLeft < tList.scrollWidth - tList.clientWidth;\n }\n scroll(left?: boolean) {\n let step = this.arrowScrollDistance || 100;\n if (left) {\n step *= -1;\n }\n this.scrollContainer?.scrollBy({\n top: 0,\n left: step,\n behavior: \"smooth\",\n });\n }\n initTabList() {\n if (this._ref) {\n const tabList = this._ref.querySelector(\".db-tab-list\");\n if (tabList) {\n const container: HTMLElement | null =\n tabList.querySelector('[role=\"tablist\"]');\n if (container) {\n container.setAttribute(\n \"aria-orientation\",\n this.orientation || \"horizontal\"\n );\n if (this.behavior === \"arrows\") {\n this.scrollContainer = container;\n this.evaluateScrollButtons(container);\n container.addEventListener(\"scroll\", () => {\n this.evaluateScrollButtons(container);\n });\n }\n }\n }\n }\n }\n initTabs(init?: boolean) {\n if (this._ref) {\n const tabItems = Array.from<Element>(\n this._ref.getElementsByClassName(\"db-tab-item\")\n );\n for (const tabItem of tabItems) {\n const index: number = tabItems.indexOf(tabItem);\n const label = tabItem.querySelector(\"label\");\n const input = tabItem.querySelector(\"input\");\n if (input && label) {\n if (!input.id) {\n const tabId = `${this._name}-tab-${index}`;\n label.setAttribute(\"for\", tabId);\n input.setAttribute(\n \"aria-controls\",\n `${this._name}-tab-panel-${index}`\n );\n input.id = tabId;\n input.setAttribute(\"name\", this._name);\n }\n if (init) {\n // Auto select\n const autoSelect =\n !this.initialSelectedMode || this.initialSelectedMode === \"auto\";\n const shouldAutoSelect =\n (this.initialSelectedIndex == null && index === 0) ||\n this.initialSelectedIndex === index;\n if (autoSelect && shouldAutoSelect) {\n input.click();\n }\n }\n }\n }\n const tabPanels = Array.from<Element>(\n this._ref.querySelectorAll(\n \":is(:scope > .db-tab-panel, :scope > db-tab-panel > .db-tab-panel)\"\n )\n );\n for (const panel of tabPanels) {\n if (panel.id) continue;\n const index: number = tabPanels.indexOf(panel);\n panel.id = `${this._name}-tab-panel-${index}`;\n panel.setAttribute(\"aria-labelledby\", `${this._name}-tab-${index}`);\n }\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: HTMLElement | 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-tabs\");\n this._id = this.id || this._id;\n this._name = `tabs-${this.name || uuid()}`;\n this.initialized = true;\n }\n\n componentDidUpdate() {\n if (this._ref && this.initialized) {\n this.initTabList();\n this.initTabs(true);\n const tabList = this._ref.querySelector(\".db-tab-list\");\n if (tabList) {\n const observer = new MutationObserver((mutations) => {\n mutations.forEach((mutation) => {\n if (mutation.removedNodes.length || mutation.addedNodes.length) {\n this.initTabList();\n this.initTabs();\n }\n });\n });\n observer.observe(tabList, {\n childList: true,\n subtree: true,\n });\n }\n this.initialized = false;\n }\n }\n\n render() {\n return (\n <div\n class={cls(\"db-tabs\", this.className)}\n ref={(el: any) => {\n this._ref = el;\n }}\n id={this._id}\n data-orientation={this.orientation}\n data-scroll-behavior={this.behavior}\n data-alignment={this.alignment ?? \"start\"}\n data-width={this.width ?? \"auto\"}\n >\n {this.showScrollLeft ? (\n <db-button\n class=\"tabs-scroll-left\"\n variant=\"ghost\"\n icon=\"chevron_left\"\n noText={true}\n onClick={() => this.scroll(true)}\n >\n Scroll left\n </db-button>\n ) : null}\n {this.tabs ? (\n <Fragment>\n <db-tab-list>\n {this.convertTabs(this.tabs)?.map((tab, index) => (\n <db-tab-item\n key={this.name + \"tab-item\" + index}\n active={tab.active}\n label={tab.label}\n iconAfter={tab.iconAfter}\n icon={tab.icon}\n noText={tab.noText}\n ></db-tab-item>\n ))}\n </db-tab-list>\n {this.convertTabs(this.tabs)?.map((tab, index) => (\n <db-tab-panel\n key={this.name + \"tab-panel\" + index}\n content={tab.content}\n >\n {tab.children}\n </db-tab-panel>\n ))}\n </Fragment>\n ) : null}\n {this.showScrollRight ? (\n <db-button\n class=\"tabs-scroll-right\"\n variant=\"ghost\"\n icon=\"chevron_right\"\n noText={true}\n onClick={() => this.scroll()}\n >\n Scroll right\n </db-button>\n ) : null}\n <slot></slot>\n </div>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"tabs.js","sourceRoot":"","sources":["../../../src/components/tabs/tabs.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAMxC,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAG3E;;;GAGG;AAIH,MAAM,OAAO,MAAM;IAHlB;QAmBU,QAAG,GAAG,OAAO,GAAG,IAAI,EAAE,CAAC;QACvB,UAAK,GAAG,EAAE,CAAC;QACX,gBAAW,GAAG,KAAK,CAAC;QACpB,mBAAc,GAAG,KAAK,CAAC;QACvB,oBAAe,GAAG,KAAK,CAAC;QACxB,oBAAe,GAAG,IAAI,CAAC;KAyPjC;IAvPC,WAAW,CAAC,IAAoC;QAC9C,IAAI,CAAC;YACH,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;gBAC7B,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAC1B,CAAC;YACD,OAAO,IAA0B,CAAC;QACpC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC;QACD,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,qBAAqB,C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,KAAK,EAChB,SAAS,EAAE,GAAG,CAAC,SAAS,EACxB,IAAI,EAAE,GAAG,CAAC,IAAI,EACd,MAAM,EAAE,GAAG,CAAC,MAAM,GACL,CAChB,CAAC,CACU,EACb,MAAA,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC;mBAAE,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,CAChD,oBACE,GAAG,EAAE,IAAI,CAAC,IAAI,GAAG,WAAW,GAAG,KAAK,EACpC,OAAO,EAAE,GAAG,CAAC,OAAO,IAEnB,GAAG,CAAC,QAAQ,CACA,CAChB,CAAC,CACO,CACZ,CAAC,CAAC,CAAC,IAAI;YACP,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CACtB,iBACE,KAAK,EAAC,mBAAmB,EACzB,OAAO,EAAC,OAAO,EACf,IAAI,EAAC,eAAe,EACpB,IAAI,EAAC,QAAQ,EACb,MAAM,EAAE,IAAI,EACZ,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,mBAGlB,CACb,CAAC,CAAC,CAAC,IAAI;YACR,8DAAa,CACT,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { DBSimpleTabProps, DBTabsProps, DBTabsState } from \"./model\";\nimport { cls, uuid } from \"../../utils\";\nimport { DBButton } from \"../button/button\";\nimport { DBTabList } from \"../tab-list/tab-list\";\nimport { DBTabItem } from \"../tab-item/tab-item\";\nimport { DBTabPanel } from \"../tab-panel/tab-panel\";\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-tabs\",\n})\nexport class DBTabs {\n private _ref!: HTMLDivElement | null;\n @Prop() id: DBTabsProps[\"id\"];\n @Prop() name: DBTabsProps[\"name\"];\n @Prop() arrowScrollDistance: DBTabsProps[\"arrowScrollDistance\"];\n @Prop() orientation: DBTabsProps[\"orientation\"];\n @Prop() behavior: DBTabsProps[\"behavior\"];\n @Prop() initialSelectedMode: DBTabsProps[\"initialSelectedMode\"];\n @Prop() initialSelectedIndex: DBTabsProps[\"initialSelectedIndex\"];\n @Event() onIndexChange: any;\n @Event() onTabSelect: any;\n @Prop({attribute: \"classname\"}) className: DBTabsProps[\"className\"];\n @Prop() alignment: DBTabsProps[\"alignment\"];\n @Prop() width: DBTabsProps[\"width\"];\n @Prop() tabs: DBTabsProps[\"tabs\"];\n\n @State() _id = \"tabs-\" + uuid();\n @State() _name = \"\";\n @State() initialized = false;\n @State() showScrollLeft = false;\n @State() showScrollRight = false;\n @State() scrollContainer = null;\n\n convertTabs(tabs: unknown[] | string | undefined) {\n try {\n if (typeof tabs === \"string\") {\n return JSON.parse(tabs);\n }\n return tabs as DBSimpleTabProps[];\n } catch (error) {\n console.error(error);\n }\n return [];\n }\n evaluateScrollButtons(tList: Element) {\n const needsScroll = tList.scrollWidth > tList.clientWidth;\n this.showScrollLeft = needsScroll && tList.scrollLeft > 1;\n this.showScrollRight =\n needsScroll && tList.scrollLeft < tList.scrollWidth - tList.clientWidth;\n }\n scroll(left?: boolean) {\n let step = this.arrowScrollDistance || 100;\n if (left) {\n step *= -1;\n }\n this.scrollContainer?.scrollBy({\n top: 0,\n left: step,\n behavior: \"smooth\",\n });\n }\n initTabList() {\n if (this._ref) {\n const tabList = this._ref.querySelector(\".db-tab-list\");\n if (tabList) {\n const container: HTMLElement | null =\n tabList.querySelector('[role=\"tablist\"]');\n if (container) {\n container.setAttribute(\n \"aria-orientation\",\n this.orientation || \"horizontal\"\n );\n if (this.behavior === \"arrows\") {\n this.scrollContainer = container;\n this.evaluateScrollButtons(container);\n container.addEventListener(\"scroll\", () => {\n this.evaluateScrollButtons(container);\n });\n }\n }\n }\n }\n }\n initTabs(init?: boolean) {\n if (this._ref) {\n const tabItems = Array.from<Element>(\n this._ref.getElementsByClassName(\"db-tab-item\")\n );\n for (const tabItem of tabItems) {\n const index: number = tabItems.indexOf(tabItem);\n const label = tabItem.querySelector(\"label\");\n const input = tabItem.querySelector(\"input\");\n if (input && label) {\n if (!input.id) {\n const tabId = `${this._name}-tab-${index}`;\n label.setAttribute(\"for\", tabId);\n input.setAttribute(\n \"aria-controls\",\n `${this._name}-tab-panel-${index}`\n );\n input.id = tabId;\n input.setAttribute(\"name\", this._name);\n }\n if (init) {\n // Auto select\n const autoSelect =\n !this.initialSelectedMode || this.initialSelectedMode === \"auto\";\n const shouldAutoSelect =\n (this.initialSelectedIndex == null && index === 0) ||\n this.initialSelectedIndex === index;\n if (autoSelect && shouldAutoSelect) {\n input.click();\n }\n }\n }\n }\n const tabPanels = Array.from<Element>(\n this._ref.querySelectorAll(\n \":is(:scope > .db-tab-panel, :scope > db-tab-panel > .db-tab-panel)\"\n )\n );\n for (const panel of tabPanels) {\n if (panel.id) continue;\n const index: number = tabPanels.indexOf(panel);\n panel.id = `${this._name}-tab-panel-${index}`;\n panel.setAttribute(\"aria-labelledby\", `${this._name}-tab-${index}`);\n }\n }\n }\n handleChange(event: any) {\n if (this.onIndexChange && event.target) {\n const list = event.target.closest(\"ul\");\n const listItem =\n // db-tab-item for angular and stencil wrapping elements\n event.target.closest(\"db-tab-item\") ?? event.target.closest(\"li\");\n if (list !== null && listItem !== null) {\n this.onIndexChange.emit(Array.from(list.childNodes).indexOf(listItem));\n }\n }\n if (this.onTabSelect) {\n this.onTabSelect.emit(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: HTMLElement | 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-tabs\");\n this._id = this.id || this._id;\n this._name = `tabs-${this.name || uuid()}`;\n this.initialized = true;\n }\n\n componentDidUpdate() {\n if (this._ref && this.initialized) {\n this.initTabList();\n this.initTabs(true);\n const tabList = this._ref.querySelector(\".db-tab-list\");\n if (tabList) {\n const observer = new MutationObserver((mutations) => {\n mutations.forEach((mutation) => {\n if (mutation.removedNodes.length || mutation.addedNodes.length) {\n this.initTabList();\n this.initTabs();\n }\n });\n });\n observer.observe(tabList, {\n childList: true,\n subtree: true,\n });\n }\n this.initialized = false;\n }\n }\n\n render() {\n return (\n <div\n class={cls(\"db-tabs\", this.className)}\n ref={(el: any) => {\n this._ref = el;\n }}\n id={this._id}\n data-orientation={this.orientation}\n data-scroll-behavior={this.behavior}\n data-alignment={this.alignment ?? \"start\"}\n data-width={this.width ?? \"auto\"}\n onChange={(event) => this.handleChange(event)}\n >\n {this.showScrollLeft ? (\n <db-button\n class=\"tabs-scroll-left\"\n variant=\"ghost\"\n icon=\"chevron_left\"\n type=\"button\"\n noText={true}\n onClick={() => this.scroll(true)}\n >\n Scroll left\n </db-button>\n ) : null}\n {this.tabs ? (\n <Fragment>\n <db-tab-list>\n {this.convertTabs(this.tabs)?.map((tab, index) => (\n <db-tab-item\n key={this.name + \"tab-item\" + index}\n active={tab.active}\n label={tab.label}\n iconAfter={tab.iconAfter}\n icon={tab.icon}\n noText={tab.noText}\n ></db-tab-item>\n ))}\n </db-tab-list>\n {this.convertTabs(this.tabs)?.map((tab, index) => (\n <db-tab-panel\n key={this.name + \"tab-panel\" + index}\n content={tab.content}\n >\n {tab.children}\n </db-tab-panel>\n ))}\n </Fragment>\n ) : null}\n {this.showScrollRight ? (\n <db-button\n class=\"tabs-scroll-right\"\n variant=\"ghost\"\n icon=\"chevron_right\"\n type=\"button\"\n noText={true}\n onClick={() => this.scroll()}\n >\n Scroll right\n </db-button>\n ) : null}\n <slot></slot>\n </div>\n );\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/shared/model.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAsCvD,MAAM,CAAC,MAAM,YAAY,GAAI,CAAC,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,EAAE,SAAS,EAAE,YAAY,CAAW,CAAC;AA2BrH,MAAM,CAAC,MAAM,WAAW,GAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAW,CAAC;AAQ3E,MAAM,CAAC,MAAM,UAAU,GAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAW,CAAC;AAQ1E,MAAM,CAAC,MAAM,aAAa,GAAI,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,EAA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AE,eAAe,EAAE,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,CAAW,CAAC;AA0Dh2B,MAAM,CAAC,MAAM,eAAe,GAAI,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,CAAW,CAAC;AAExG,MAAM,CAAC,MAAM,cAAc,GAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAW,CAAC;AAEhF,MAAM,CAAC,MAAM,sBAAsB,GAAI,CAAC,aAAa,EAAE,4BAA4B,EAAE,QAAQ,EAAE,0BAA0B,EAAE,aAAa,EAAE,eAAe,EAAE,iCAAiC,EAAE,YAAY,CAAW,CAAC;AA6EtN,MAAM,CAAC,MAAM,aAAa,GAAI,CAAC,OAAO,EAAE,QAAQ,CAAW,CAAC","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}"]}
1
+ {"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/shared/model.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAsCvD,MAAM,CAAC,MAAM,YAAY,GAAI,CAAC,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,EAAE,SAAS,EAAE,YAAY,CAAW,CAAC;AA2BrH,MAAM,CAAC,MAAM,WAAW,GAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAW,CAAC;AAQ3E,MAAM,CAAC,MAAM,UAAU,GAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAW,CAAC;AAQ1E,MAAM,CAAC,MAAM,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,CAAW,CAAC;AAiBvL,MAAM,CAAC,MAAM,cAAc,GAAI,CAAC,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,CAAW,CAAC;AAcpJ,MAAM,CAAC,MAAM,eAAe,GAAI,CAAC,YAAY,EAAE,UAAU,CAAW,CAAC;AAQrE,MAAM,CAAC,MAAM,SAAS,GAAI,CAAC,MAAM,EAAE,MAAM,CAAW,CAAC;AAQrD,MAAM,CAAC,MAAM,YAAY,GAAI,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAW,CAAC;AAQ5E,MAAM,CAAC,MAAM,gBAAgB,GAAI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AAe,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,CAAW,CAAC;AA0Dh2B,MAAM,CAAC,MAAM,eAAe,GAAI,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,CAAW,CAAC;AAExG,MAAM,CAAC,MAAM,cAAc,GAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAW,CAAC;AAEhF,MAAM,CAAC,MAAM,sBAAsB,GAAI,CAAC,aAAa,EAAE,4BAA4B,EAAE,QAAQ,EAAE,0BAA0B,EAAE,aAAa,EAAE,eAAe,EAAE,iCAAiC,EAAE,YAAY,CAAW,CAAC;AA6EtN,MAAM,CAAC,MAAM,aAAa,GAAI,CAAC,OAAO,EAAE,QAAQ,CAAW,CAAC","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}"]}
@@ -37,15 +37,6 @@ export const cls = (...args) => {
37
37
  }
38
38
  return result.trim();
39
39
  };
40
- const reactHtmlAttributes = ['suppressHydrationWarning', 'suppressContentEditableWarning', 'translate', 'title', 'tabIndex', 'style', 'spellCheck', 'nonce', 'lang', 'hidden', 'draggable', 'dir', 'contextMenu', 'contentEditable', 'autoFocus', 'accessKey', 'is', 'inputMode', 'unselectable', 'security', 'results', 'vocab', 'typeof', 'rev', 'resource', 'rel', 'property', 'inlist', 'datatype', 'content', 'about', 'role', 'radioGroup', 'color'];
41
- export const filterPassingProps = (props, propsPassingFilter) => Object.keys(props).filter(key => (key.startsWith('data-') || key.startsWith('aria-') || key.startsWith('default') || key.startsWith('auto') || key.startsWith('item') || key.startsWith('on') || reactHtmlAttributes.includes(key)) && !propsPassingFilter.includes(key)).reduce((obj, key) => {
42
- return Object.assign(Object.assign({}, obj), { [key]: props[key] });
43
- }, {});
44
- export const getRootProps = (props, rooProps) => {
45
- return Object.keys(props).filter(key => rooProps.includes(key)).reduce((obj, key) => {
46
- return Object.assign(Object.assign({}, obj), { [key]: props[key] });
47
- }, {});
48
- };
49
40
  export const visibleInVX = (el) => {
50
41
  const { left, right } = el.getBoundingClientRect();
51
42
  const { innerWidth } = window;
@@ -148,8 +139,6 @@ export const stringPropVisible = (givenString, showString) => {
148
139
  }
149
140
  };
150
141
  export default {
151
- getRootProps,
152
- filterPassingProps,
153
142
  cls,
154
143
  addAttributeToChildren,
155
144
  uuid,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,IAAI,GAAG,GAAG,EAAE;;IACvB,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QAClC,IAAI,MAAA,MAAM,CAAC,MAAM,0CAAE,UAAU,EAAE,CAAC;YAC9B,OAAO,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;QACpC,CAAC;aAAM,IAAI,MAAA,MAAM,CAAC,MAAM,0CAAE,eAAe,EAAE,CAAC;YAC1C,OAAO,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACrE,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AAC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G,EAAE,CAAC,UAAU,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;AAE3F;;;;GAIG;AACH,8DAA8D;AAC9D,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,UAAoB,EAAO,EAAE;IAC9D,IAAI,UAAU,EAAE,CAAC;QACf,OAAO,MAAM,CAAC,UAAU,CAAC,CAAC;IAC5B,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AAEF,8DAA8D;AAC9D,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAc,EAAO,EAAE;IACjD,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QACxC,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,kBAAkB,CAAC,CAAC,IAAI,CAAC,CAAC;AACnC,CAAC,CAAC;AACF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,WAAoB,EAAE,UAAoB,EAAE,EAAE;IAC9E,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC7B,OAAO,CAAC,CAAC,WAAW,CAAC;IACvB,CAAC;SAAM,CAAC;QACN,OAAO,UAAU,IAAI,WAAW,CAAC;IACnC,CAAC;AACH,CAAC,CAAC;AACF,eAAe;IACb,YAAY;IACZ,kBAAkB;IAClB,GAAG;IACH,sBAAsB;IACtB,IAAI;IACJ,WAAW;IACX,WAAW;IACX,QAAQ;IACR,iBAAiB;IACjB,gBAAgB;IAChB,YAAY;IACZ,KAAK;IACL,kBAAkB;IAClB,WAAW;IACX,iBAAiB;CAClB,CAAA","sourcesContent":["export const uuid = () => {\n if (typeof window !== 'undefined') {\n if (window.crypto?.randomUUID) {\n return window.crypto.randomUUID();\n } else if (window.crypto?.getRandomValues) {\n return window.crypto.getRandomValues(new Uint32Array(3)).join('-');\n }\n }\n return Math.random().toString().substring(2);\n};\nexport const addAttributeToChildren = (element: Element, attribute: {\n key: string;\n value: string;\n}) => {\n const children = element.children;\n Object.values(children).forEach((child: Element) => {\n child.setAttribute(attribute.key, attribute.value);\n if (child.children.length > 0) {\n addAttributeToChildren(child, attribute);\n }\n });\n};\nexport type ClassNameArg = string | {\n [key: string]: boolean | undefined;\n} | undefined;\nexport const cls = (...args: ClassNameArg[]) => {\n let result = '';\n for (const arg of args) {\n if (arg) {\n if (typeof arg === 'string') {\n result += `${arg} `;\n } else {\n for (const key in arg) {\n if (arg[key]) {\n result += `${key} `;\n }\n }\n }\n }\n }\n return result.trim();\n};\nconst reactHtmlAttributes = ['suppressHydrationWarning', 'suppressContentEditableWarning', 'translate', 'title', 'tabIndex', 'style', 'spellCheck', 'nonce', 'lang', 'hidden', 'draggable', 'dir', 'contextMenu', 'contentEditable', 'autoFocus', 'accessKey', 'is', 'inputMode', 'unselectable', 'security', 'results', 'vocab', 'typeof', 'rev', 'resource', 'rel', 'property', 'inlist', 'datatype', 'content', 'about', 'role', 'radioGroup', 'color'];\nexport const filterPassingProps = (props: Record<string, unknown>, propsPassingFilter: string[]): Record<string, unknown> => Object.keys(props).filter(key => (key.startsWith('data-') || key.startsWith('aria-') || key.startsWith('default') || key.startsWith('auto') || key.startsWith('item') || key.startsWith('on') || reactHtmlAttributes.includes(key)) && !propsPassingFilter.includes(key)).reduce((obj: Record<string, unknown>, key: string) => {\n return {\n ...obj,\n [key]: props[key]\n };\n}, {});\nexport const getRootProps = (props: Record<string, unknown>, rooProps: string[]): Record<string, unknown> => {\n return Object.keys(props).filter(key => rooProps.includes(key)).reduce((obj: Record<string, unknown>, key: string) => {\n return {\n ...obj,\n [key]: props[key]\n };\n }, {});\n};\nexport const visibleInVX = (el: Element) => {\n const {\n left,\n right\n } = el.getBoundingClientRect();\n const {\n innerWidth\n } = window;\n return left >= 0 && right <= innerWidth;\n};\nexport const visibleInVY = (el: Element) => {\n const {\n top,\n bottom\n } = el.getBoundingClientRect();\n const {\n innerHeight\n } = window;\n return top >= 0 && bottom <= innerHeight;\n};\nexport const isInView = (el: Element) => {\n const {\n top,\n bottom,\n left,\n right\n } = el.getBoundingClientRect();\n const {\n innerHeight,\n innerWidth\n } = window;\n let outTop = top < 0;\n let outBottom = bottom > innerHeight;\n let outLeft = left < 0;\n let outRight = right > innerWidth;\n\n // We need to check if it was already outside\n const outsideY = el.hasAttribute('data-outside-vy');\n const outsideX = el.hasAttribute('data-outside-vx');\n const parentRect = el?.parentElement?.getBoundingClientRect();\n if (parentRect) {\n if (outsideY) {\n const position = el.getAttribute('data-outside-vy');\n if (position === 'top') {\n outTop = parentRect.top - (bottom - parentRect.bottom) < 0;\n } else {\n outBottom = parentRect.bottom + (parentRect.top - top) > innerHeight;\n }\n }\n if (outsideX) {\n const position = el.getAttribute('data-outside-vx');\n if (position === 'left') {\n outLeft = parentRect.left - (right - parentRect.right) < 0;\n } else {\n outRight = parentRect.right + (parentRect.left - left) > innerWidth;\n }\n }\n }\n return {\n outTop,\n outBottom,\n outLeft,\n outRight\n };\n};\nexport interface DBDataOutsidePair {\n vx?: 'left' | 'right';\n vy?: 'top' | 'bottom';\n}\nexport const handleDataOutside = (el: Element): DBDataOutsidePair => {\n const {\n outTop,\n outBottom,\n outLeft,\n outRight\n } = isInView(el);\n let dataOutsidePair: DBDataOutsidePair = {};\n if (outTop || outBottom) {\n dataOutsidePair = {\n vy: outTop ? 'top' : 'bottom'\n };\n el.setAttribute('data-outside-vy', dataOutsidePair.vy!);\n } else {\n el.removeAttribute('data-outside-vy');\n }\n if (outLeft || outRight) {\n dataOutsidePair = {\n ...dataOutsidePair,\n vx: outRight ? 'right' : 'left'\n };\n el.setAttribute('data-outside-vx', dataOutsidePair.vx!);\n } else {\n el.removeAttribute('data-outside-vx');\n }\n return dataOutsidePair;\n};\nexport const isArrayOfStrings = (value: unknown): value is string[] => Array.isArray(value) && value.every(item => typeof item === 'string');\nconst appleOs = ['Mac', 'iPhone', 'iPad', 'iPod'];\nexport const hasVoiceOver = (): boolean => typeof window !== 'undefined' && appleOs.some(os => window.navigator.userAgent.includes(os));\nexport const delay = (fn: () => void, ms: number) => new Promise(() => setTimeout(fn, ms));\n\n/**\n * Some frameworks like stencil would not add \"true\" as value for a prop\n * if it is used in a framework like angular e.g.: [disabled]=\"myDisabledProp\"\n * @param originBool Some boolean to convert to string\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const getBooleanAsString = (originBool?: boolean): any => {\n if (originBool) {\n return String(originBool);\n }\n return originBool;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const getHideProp = (show?: boolean): any => {\n if (show === undefined || show === null) {\n return undefined;\n }\n return getBooleanAsString(!show);\n};\nexport const stringPropVisible = (givenString?: string, showString?: boolean) => {\n if (showString === undefined) {\n return !!givenString;\n } else {\n return showString && givenString;\n }\n};\nexport default {\n getRootProps,\n filterPassingProps,\n cls,\n addAttributeToChildren,\n uuid,\n visibleInVX,\n visibleInVY,\n isInView,\n handleDataOutside,\n isArrayOfStrings,\n hasVoiceOver,\n delay,\n getBooleanAsString,\n getHideProp,\n stringPropVisible\n}"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,IAAI,GAAG,GAAG,EAAE;;IACvB,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QAClC,IAAI,MAAA,MAAM,CAAC,MAAM,0CAAE,UAAU,EAAE,CAAC;YAC9B,OAAO,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;QACpC,CAAC;aAAM,IAAI,MAAA,MAAM,CAAC,MAAM,0CAAE,eAAe,EAAE,CAAC;YAC1C,OAAO,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACrE,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AAC/C,CAAC,CAAC;AAC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CAAC,IAAc,EAAO,EAAE;IACjD,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QACxC,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,kBAAkB,CAAC,CAAC,IAAI,CAAC,CAAC;AACnC,CAAC,CAAC;AACF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,WAAoB,EAAE,UAAoB,EAAE,EAAE;IAC9E,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC7B,OAAO,CAAC,CAAC,WAAW,CAAC;IACvB,CAAC;SAAM,CAAC;QACN,OAAO,UAAU,IAAI,WAAW,CAAC;IACnC,CAAC;AACH,CAAC,CAAC;AACF,eAAe;IACb,GAAG;IACH,sBAAsB;IACtB,IAAI;IACJ,WAAW;IACX,WAAW;IACX,QAAQ;IACR,iBAAiB;IACjB,gBAAgB;IAChB,YAAY;IACZ,KAAK;IACL,kBAAkB;IAClB,WAAW;IACX,iBAAiB;CAClB,CAAA","sourcesContent":["export const uuid = () => {\n if (typeof window !== 'undefined') {\n if (window.crypto?.randomUUID) {\n return window.crypto.randomUUID();\n } else if (window.crypto?.getRandomValues) {\n return window.crypto.getRandomValues(new Uint32Array(3)).join('-');\n }\n }\n return Math.random().toString().substring(2);\n};\nexport const addAttributeToChildren = (element: Element, attribute: {\n key: string;\n value: string;\n}) => {\n const children = element.children;\n Object.values(children).forEach((child: Element) => {\n child.setAttribute(attribute.key, attribute.value);\n if (child.children.length > 0) {\n addAttributeToChildren(child, attribute);\n }\n });\n};\nexport type ClassNameArg = string | {\n [key: string]: boolean | undefined;\n} | undefined;\nexport const cls = (...args: ClassNameArg[]) => {\n let result = '';\n for (const arg of args) {\n if (arg) {\n if (typeof arg === 'string') {\n result += `${arg} `;\n } else {\n for (const key in arg) {\n if (arg[key]) {\n result += `${key} `;\n }\n }\n }\n }\n }\n return result.trim();\n};\nexport const visibleInVX = (el: Element) => {\n const {\n left,\n right\n } = el.getBoundingClientRect();\n const {\n innerWidth\n } = window;\n return left >= 0 && right <= innerWidth;\n};\nexport const visibleInVY = (el: Element) => {\n const {\n top,\n bottom\n } = el.getBoundingClientRect();\n const {\n innerHeight\n } = window;\n return top >= 0 && bottom <= innerHeight;\n};\nexport const isInView = (el: Element) => {\n const {\n top,\n bottom,\n left,\n right\n } = el.getBoundingClientRect();\n const {\n innerHeight,\n innerWidth\n } = window;\n let outTop = top < 0;\n let outBottom = bottom > innerHeight;\n let outLeft = left < 0;\n let outRight = right > innerWidth;\n\n // We need to check if it was already outside\n const outsideY = el.hasAttribute('data-outside-vy');\n const outsideX = el.hasAttribute('data-outside-vx');\n const parentRect = el?.parentElement?.getBoundingClientRect();\n if (parentRect) {\n if (outsideY) {\n const position = el.getAttribute('data-outside-vy');\n if (position === 'top') {\n outTop = parentRect.top - (bottom - parentRect.bottom) < 0;\n } else {\n outBottom = parentRect.bottom + (parentRect.top - top) > innerHeight;\n }\n }\n if (outsideX) {\n const position = el.getAttribute('data-outside-vx');\n if (position === 'left') {\n outLeft = parentRect.left - (right - parentRect.right) < 0;\n } else {\n outRight = parentRect.right + (parentRect.left - left) > innerWidth;\n }\n }\n }\n return {\n outTop,\n outBottom,\n outLeft,\n outRight\n };\n};\nexport interface DBDataOutsidePair {\n vx?: 'left' | 'right';\n vy?: 'top' | 'bottom';\n}\nexport const handleDataOutside = (el: Element): DBDataOutsidePair => {\n const {\n outTop,\n outBottom,\n outLeft,\n outRight\n } = isInView(el);\n let dataOutsidePair: DBDataOutsidePair = {};\n if (outTop || outBottom) {\n dataOutsidePair = {\n vy: outTop ? 'top' : 'bottom'\n };\n el.setAttribute('data-outside-vy', dataOutsidePair.vy!);\n } else {\n el.removeAttribute('data-outside-vy');\n }\n if (outLeft || outRight) {\n dataOutsidePair = {\n ...dataOutsidePair,\n vx: outRight ? 'right' : 'left'\n };\n el.setAttribute('data-outside-vx', dataOutsidePair.vx!);\n } else {\n el.removeAttribute('data-outside-vx');\n }\n return dataOutsidePair;\n};\nexport const isArrayOfStrings = (value: unknown): value is string[] => Array.isArray(value) && value.every(item => typeof item === 'string');\nconst appleOs = ['Mac', 'iPhone', 'iPad', 'iPod'];\nexport const hasVoiceOver = (): boolean => typeof window !== 'undefined' && appleOs.some(os => window.navigator.userAgent.includes(os));\nexport const delay = (fn: () => void, ms: number) => new Promise(() => setTimeout(fn, ms));\n\n/**\n * Some frameworks like stencil would not add \"true\" as value for a prop\n * if it is used in a framework like angular e.g.: [disabled]=\"myDisabledProp\"\n * @param originBool Some boolean to convert to string\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const getBooleanAsString = (originBool?: boolean): any => {\n if (originBool) {\n return String(originBool);\n }\n return originBool;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const getHideProp = (show?: boolean): any => {\n if (show === undefined || show === null) {\n return undefined;\n }\n return getBooleanAsString(!show);\n};\nexport const stringPropVisible = (givenString?: string, showString?: boolean) => {\n if (showString === undefined) {\n return !!givenString;\n } else {\n return showString && givenString;\n }\n};\nexport default {\n cls,\n addAttributeToChildren,\n uuid,\n visibleInVX,\n visibleInVY,\n isInView,\n handleDataOutside,\n isArrayOfStrings,\n hasVoiceOver,\n delay,\n getBooleanAsString,\n getHideProp,\n stringPropVisible\n}"]}
@@ -0,0 +1,16 @@
1
+ const reactHtmlAttributes = ['suppressHydrationWarning', 'suppressContentEditableWarning', 'translate', 'title', 'tabIndex', 'style', 'spellCheck', 'nonce', 'lang', 'hidden', 'draggable', 'dir', 'contextMenu', 'contentEditable', 'accessKey', 'is', 'inputMode', 'unselectable', 'security', 'results', 'vocab', 'typeof', 'rev', 'resource', 'rel', 'property', 'inlist', 'datatype', 'content', 'about', 'role', 'radioGroup', 'color',
2
+ // other attributes for button,input,etc.
3
+ 'form', 'formAction', 'formEncType', 'formMethod', 'formNoValidate', 'formTarget', 'capture', 'dirName', 'download', 'ping'];
4
+ export const filterPassingProps = (props, propsPassingFilter) => Object.keys(props).filter(key => (key.startsWith('data-') || key.startsWith('aria-') || key.startsWith('default') || key.startsWith('auto') || key.startsWith('item') || key.startsWith('on') || reactHtmlAttributes.includes(key)) && !propsPassingFilter.includes(key)).reduce((obj, key) => {
5
+ return Object.assign(Object.assign({}, obj), { [key]: props[key] });
6
+ }, {});
7
+ export const getRootProps = (props, rooProps) => {
8
+ return Object.keys(props).filter(key => rooProps.includes(key)).reduce((obj, key) => {
9
+ return Object.assign(Object.assign({}, obj), { [key]: props[key] });
10
+ }, {});
11
+ };
12
+ export default {
13
+ getRootProps,
14
+ filterPassingProps
15
+ };
16
+ //# sourceMappingURL=react.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react.js","sourceRoot":"","sources":["../../src/utils/react.ts"],"names":[],"mappings":"AAAA,MAAM,mBAAmB,GAAG,CAAC,0BAA0B,EAAE,gCAAgC,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO;IAC5a,yCAAyC;IACzC,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;AAC7H,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAA8B,EAAE,kBAA4B,EAA2B,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,mBAAmB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,GAA4B,EAAE,GAAW,EAAE,EAAE;IAC1b,uCACK,GAAG,KACN,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,IACjB;AACJ,CAAC,EAAE,EAAE,CAAC,CAAC;AACP,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAA8B,EAAE,QAAkB,EAA2B,EAAE;IAC1G,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,GAA4B,EAAE,GAAW,EAAE,EAAE;QACnH,uCACK,GAAG,KACN,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,IACjB;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC,CAAC;AACF,eAAe;IACb,YAAY;IACZ,kBAAkB;CACnB,CAAA","sourcesContent":["const reactHtmlAttributes = ['suppressHydrationWarning', 'suppressContentEditableWarning', 'translate', 'title', 'tabIndex', 'style', 'spellCheck', 'nonce', 'lang', 'hidden', 'draggable', 'dir', 'contextMenu', 'contentEditable', 'accessKey', 'is', 'inputMode', 'unselectable', 'security', 'results', 'vocab', 'typeof', 'rev', 'resource', 'rel', 'property', 'inlist', 'datatype', 'content', 'about', 'role', 'radioGroup', 'color',\n// other attributes for button,input,etc.\n'form', 'formAction', 'formEncType', 'formMethod', 'formNoValidate', 'formTarget', 'capture', 'dirName', 'download', 'ping'];\nexport const filterPassingProps = (props: Record<string, unknown>, propsPassingFilter: string[]): Record<string, unknown> => Object.keys(props).filter(key => (key.startsWith('data-') || key.startsWith('aria-') || key.startsWith('default') || key.startsWith('auto') || key.startsWith('item') || key.startsWith('on') || reactHtmlAttributes.includes(key)) && !propsPassingFilter.includes(key)).reduce((obj: Record<string, unknown>, key: string) => {\n return {\n ...obj,\n [key]: props[key]\n };\n}, {});\nexport const getRootProps = (props: Record<string, unknown>, rooProps: string[]): Record<string, unknown> => {\n return Object.keys(props).filter(key => rooProps.includes(key)).reduce((obj: Record<string, unknown>, key: string) => {\n return {\n ...obj,\n [key]: props[key]\n };\n }, {});\n};\nexport default {\n getRootProps,\n filterPassingProps\n}"]}
@@ -2302,29 +2302,29 @@
2302
2302
  },
2303
2303
  {
2304
2304
  "kind": "field",
2305
- "name": "checked",
2305
+ "name": "indeterminate",
2306
2306
  "type": {
2307
2307
  "text": "boolean"
2308
2308
  },
2309
- "description": "Define the radio or checkbox elements checked state",
2309
+ "description": "Define an [indeterminate](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#indeterminate) state of a checkbox",
2310
2310
  "resolvedValue": {
2311
- "name": "checked",
2311
+ "name": "indeterminate",
2312
2312
  "type": "boolean",
2313
- "comment": "Define the radio or checkbox elements checked state",
2313
+ "comment": "Define an [indeterminate](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#indeterminate) state of a checkbox",
2314
2314
  "resolvedType": "boolean"
2315
2315
  }
2316
2316
  },
2317
2317
  {
2318
2318
  "kind": "field",
2319
- "name": "indeterminate",
2319
+ "name": "checked",
2320
2320
  "type": {
2321
2321
  "text": "boolean"
2322
2322
  },
2323
- "description": "Define an [indeterminate](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#indeterminate) state of a checkbox",
2323
+ "description": "Define the radio or checkbox elements checked state",
2324
2324
  "resolvedValue": {
2325
- "name": "indeterminate",
2325
+ "name": "checked",
2326
2326
  "type": "boolean",
2327
- "comment": "Define an [indeterminate](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#indeterminate) state of a checkbox",
2327
+ "comment": "Define the radio or checkbox elements checked state",
2328
2328
  "resolvedType": "boolean"
2329
2329
  }
2330
2330
  },
@@ -2683,30 +2683,30 @@
2683
2683
  }
2684
2684
  },
2685
2685
  {
2686
- "name": "checked",
2687
- "fieldName": "checked",
2686
+ "name": "indeterminate",
2687
+ "fieldName": "indeterminate",
2688
2688
  "type": {
2689
2689
  "text": "boolean"
2690
2690
  },
2691
- "description": "Define the radio or checkbox elements checked state",
2691
+ "description": "Define an [indeterminate](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#indeterminate) state of a checkbox",
2692
2692
  "resolvedValue": {
2693
- "name": "checked",
2693
+ "name": "indeterminate",
2694
2694
  "type": "boolean",
2695
- "comment": "Define the radio or checkbox elements checked state",
2695
+ "comment": "Define an [indeterminate](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#indeterminate) state of a checkbox",
2696
2696
  "resolvedType": "boolean"
2697
2697
  }
2698
2698
  },
2699
2699
  {
2700
- "name": "indeterminate",
2701
- "fieldName": "indeterminate",
2700
+ "name": "checked",
2701
+ "fieldName": "checked",
2702
2702
  "type": {
2703
2703
  "text": "boolean"
2704
2704
  },
2705
- "description": "Define an [indeterminate](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#indeterminate) state of a checkbox",
2705
+ "description": "Define the radio or checkbox elements checked state",
2706
2706
  "resolvedValue": {
2707
- "name": "indeterminate",
2707
+ "name": "checked",
2708
2708
  "type": "boolean",
2709
- "comment": "Define an [indeterminate](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#indeterminate) state of a checkbox",
2709
+ "comment": "Define the radio or checkbox elements checked state",
2710
2710
  "resolvedType": "boolean"
2711
2711
  }
2712
2712
  },
@@ -4648,6 +4648,20 @@
4648
4648
  "resolvedType": "string"
4649
4649
  }
4650
4650
  },
4651
+ {
4652
+ "kind": "field",
4653
+ "name": "size",
4654
+ "type": {
4655
+ "text": "number"
4656
+ },
4657
+ "description": "Size of the control",
4658
+ "resolvedValue": {
4659
+ "name": "size",
4660
+ "type": "number",
4661
+ "comment": "Size of the control",
4662
+ "resolvedType": "number"
4663
+ }
4664
+ },
4651
4665
  {
4652
4666
  "kind": "field",
4653
4667
  "name": "autocomplete",
@@ -5318,6 +5332,20 @@
5318
5332
  "resolvedType": "string"
5319
5333
  }
5320
5334
  },
5335
+ {
5336
+ "name": "size",
5337
+ "fieldName": "size",
5338
+ "type": {
5339
+ "text": "number"
5340
+ },
5341
+ "description": "Size of the control",
5342
+ "resolvedValue": {
5343
+ "name": "size",
5344
+ "type": "number",
5345
+ "comment": "Size of the control",
5346
+ "resolvedType": "number"
5347
+ }
5348
+ },
5321
5349
  {
5322
5350
  "name": "autocomplete",
5323
5351
  "fieldName": "autocomplete",
@@ -7259,6 +7287,20 @@
7259
7287
  "resolvedType": "string"
7260
7288
  }
7261
7289
  },
7290
+ {
7291
+ "kind": "field",
7292
+ "name": "size",
7293
+ "type": {
7294
+ "text": "number"
7295
+ },
7296
+ "description": "Size of the control",
7297
+ "resolvedValue": {
7298
+ "name": "size",
7299
+ "type": "number",
7300
+ "comment": "Size of the control",
7301
+ "resolvedType": "number"
7302
+ }
7303
+ },
7262
7304
  {
7263
7305
  "kind": "field",
7264
7306
  "name": "autocomplete",
@@ -7753,6 +7795,20 @@
7753
7795
  "resolvedType": "string"
7754
7796
  }
7755
7797
  },
7798
+ {
7799
+ "name": "size",
7800
+ "fieldName": "size",
7801
+ "type": {
7802
+ "text": "number"
7803
+ },
7804
+ "description": "Size of the control",
7805
+ "resolvedValue": {
7806
+ "name": "size",
7807
+ "type": "number",
7808
+ "comment": "Size of the control",
7809
+ "resolvedType": "number"
7810
+ }
7811
+ },
7756
7812
  {
7757
7813
  "name": "autocomplete",
7758
7814
  "fieldName": "autocomplete",
@@ -7908,6 +7964,20 @@
7908
7964
  "resolvedType": "string"
7909
7965
  }
7910
7966
  },
7967
+ {
7968
+ "kind": "field",
7969
+ "name": "checked",
7970
+ "type": {
7971
+ "text": "boolean"
7972
+ },
7973
+ "description": "Define the radio or checkbox elements checked state",
7974
+ "resolvedValue": {
7975
+ "name": "checked",
7976
+ "type": "boolean",
7977
+ "comment": "Define the radio or checkbox elements checked state",
7978
+ "resolvedType": "boolean"
7979
+ }
7980
+ },
7911
7981
  {
7912
7982
  "kind": "field",
7913
7983
  "name": "change",
@@ -8016,16 +8086,16 @@
8016
8086
  },
8017
8087
  {
8018
8088
  "kind": "field",
8019
- "name": "checked",
8089
+ "name": "value",
8020
8090
  "type": {
8021
- "text": "boolean"
8091
+ "text": "any"
8022
8092
  },
8023
- "description": "Define the radio or checkbox elements checked state",
8093
+ "description": "The value property is to receive results from the native form element.",
8024
8094
  "resolvedValue": {
8025
- "name": "checked",
8026
- "type": "boolean",
8027
- "comment": "Define the radio or checkbox elements checked state",
8028
- "resolvedType": "boolean"
8095
+ "name": "value",
8096
+ "type": "any",
8097
+ "comment": "The value property is to receive results from the native form element.",
8098
+ "resolvedType": "any"
8029
8099
  }
8030
8100
  },
8031
8101
  {
@@ -8153,14 +8223,6 @@
8153
8223
  },
8154
8224
  "default": "false"
8155
8225
  },
8156
- {
8157
- "kind": "field",
8158
- "name": "initialized",
8159
- "type": {
8160
- "text": "boolean"
8161
- },
8162
- "default": "false"
8163
- },
8164
8226
  {
8165
8227
  "kind": "method",
8166
8228
  "name": "handleChange",
@@ -8239,6 +8301,20 @@
8239
8301
  "resolvedType": "string"
8240
8302
  }
8241
8303
  },
8304
+ {
8305
+ "name": "checked",
8306
+ "fieldName": "checked",
8307
+ "type": {
8308
+ "text": "boolean"
8309
+ },
8310
+ "description": "Define the radio or checkbox elements checked state",
8311
+ "resolvedValue": {
8312
+ "name": "checked",
8313
+ "type": "boolean",
8314
+ "comment": "Define the radio or checkbox elements checked state",
8315
+ "resolvedType": "boolean"
8316
+ }
8317
+ },
8242
8318
  {
8243
8319
  "name": "change",
8244
8320
  "fieldName": "change",
@@ -8346,17 +8422,17 @@
8346
8422
  }
8347
8423
  },
8348
8424
  {
8349
- "name": "checked",
8350
- "fieldName": "checked",
8425
+ "name": "value",
8426
+ "fieldName": "value",
8351
8427
  "type": {
8352
- "text": "boolean"
8428
+ "text": "any"
8353
8429
  },
8354
- "description": "Define the radio or checkbox elements checked state",
8430
+ "description": "The value property is to receive results from the native form element.",
8355
8431
  "resolvedValue": {
8356
- "name": "checked",
8357
- "type": "boolean",
8358
- "comment": "Define the radio or checkbox elements checked state",
8359
- "resolvedType": "boolean"
8432
+ "name": "value",
8433
+ "type": "any",
8434
+ "comment": "The value property is to receive results from the native form element.",
8435
+ "resolvedType": "any"
8360
8436
  }
8361
8437
  },
8362
8438
  {
@@ -8727,7 +8803,7 @@
8727
8803
  {
8728
8804
  "name": "event",
8729
8805
  "type": {
8730
- "text": "ChangeEvent<HTMLInputElement>"
8806
+ "text": "any"
8731
8807
  }
8732
8808
  }
8733
8809
  ]
@@ -12957,6 +13033,18 @@
12957
13033
  }
12958
13034
  ]
12959
13035
  },
13036
+ {
13037
+ "kind": "method",
13038
+ "name": "handleChange",
13039
+ "parameters": [
13040
+ {
13041
+ "name": "event",
13042
+ "type": {
13043
+ "text": "any"
13044
+ }
13045
+ }
13046
+ ]
13047
+ },
12960
13048
  {
12961
13049
  "kind": "method",
12962
13050
  "name": "enableAttributePassing",
@@ -13147,7 +13235,20 @@
13147
13235
  }
13148
13236
  ],
13149
13237
  "tagName": "db-tabs",
13150
- "events": [],
13238
+ "events": [
13239
+ {
13240
+ "name": "onIndexChange",
13241
+ "type": {
13242
+ "text": "any"
13243
+ }
13244
+ },
13245
+ {
13246
+ "name": "onTabSelect",
13247
+ "type": {
13248
+ "text": "any"
13249
+ }
13250
+ }
13251
+ ],
13151
13252
  "customElement": true
13152
13253
  }
13153
13254
  ],