@db-ux/wc-core-components 3.1.20 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/cjs/db-accordion-item.cjs.entry.js +2 -2
- package/dist/cjs/db-accordion.cjs.entry.js +2 -2
- package/dist/cjs/db-badge.cjs.entry.js +2 -2
- package/dist/cjs/db-brand.cjs.entry.js +2 -2
- package/dist/cjs/db-button.cjs.entry.js +2 -2
- package/dist/cjs/db-card.cjs.entry.js +2 -2
- package/dist/cjs/db-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/db-custom-select-dropdown.db-custom-select-list.db-custom-select-list-item.db-input.db-tag.entry.cjs.js.map +1 -1
- package/dist/cjs/db-custom-select-dropdown_5.cjs.entry.js +5 -15
- package/dist/cjs/db-custom-select-form-field.cjs.entry.js +2 -2
- package/dist/cjs/db-custom-select.cjs.entry.js +10 -10
- package/dist/cjs/db-custom-select.entry.cjs.js.map +1 -1
- package/dist/cjs/db-divider.cjs.entry.js +2 -2
- package/dist/cjs/db-drawer.cjs.entry.js +2 -2
- package/dist/cjs/db-header.cjs.entry.js +2 -2
- package/dist/cjs/db-icon.cjs.entry.js +2 -2
- package/dist/cjs/db-infotext.cjs.entry.js +2 -2
- package/dist/cjs/db-link.cjs.entry.js +2 -2
- package/dist/cjs/db-navigation-item.cjs.entry.js +2 -2
- package/dist/cjs/db-navigation.cjs.entry.js +2 -2
- package/dist/cjs/db-notification.cjs.entry.js +2 -2
- package/dist/cjs/db-page.cjs.entry.js +2 -2
- package/dist/cjs/db-popover.cjs.entry.js +3 -3
- package/dist/cjs/db-radio.cjs.entry.js +2 -2
- package/dist/cjs/db-section.cjs.entry.js +2 -2
- package/dist/cjs/db-select.cjs.entry.js +2 -2
- package/dist/cjs/db-stack.cjs.entry.js +2 -2
- package/dist/cjs/db-switch.cjs.entry.js +70 -5
- package/dist/cjs/db-switch.entry.cjs.js.map +1 -1
- package/dist/cjs/db-tab-item_3.cjs.entry.js +8 -8
- package/dist/cjs/db-tabs.cjs.entry.js +4 -4
- package/dist/cjs/db-textarea.cjs.entry.js +4 -4
- package/dist/cjs/db-tooltip.cjs.entry.js +3 -3
- package/dist/cjs/db-ux.cjs.js +3 -3
- package/dist/cjs/db-ux.cjs.js.map +1 -1
- package/dist/cjs/{document-click-listener-CKUiT8IL.js → document-click-listener-DGna8oDJ.js} +3 -3
- package/dist/cjs/{document-click-listener-CKUiT8IL.js.map → document-click-listener-DGna8oDJ.js.map} +1 -1
- package/dist/cjs/{document-scroll-listener-BlwNKh0i.js → document-scroll-listener-BBXRu9dN.js} +3 -3
- package/dist/cjs/{document-scroll-listener-BlwNKh0i.js.map → document-scroll-listener-BBXRu9dN.js.map} +1 -1
- package/dist/cjs/{index-DjV59BYq.js → index-Bm2Cw2rz.js} +22 -2
- package/dist/cjs/index-Bm2Cw2rz.js.map +1 -0
- package/dist/cjs/{index-BKsFzv8w.js → index-Cn0jjcY0.js} +7 -4
- package/dist/{esm/index-Bxi-mtJ7.js.map → cjs/index-Cn0jjcY0.js.map} +1 -1
- package/dist/cjs/index.cjs.js +7 -4
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/custom-select/custom-select.js +9 -9
- package/dist/collection/components/custom-select/custom-select.js.map +1 -1
- package/dist/collection/components/custom-select/model.js.map +1 -1
- package/dist/collection/components/input/input.js +4 -14
- package/dist/collection/components/input/input.js.map +1 -1
- package/dist/collection/components/input/model.js.map +1 -1
- package/dist/collection/components/switch/model.js.map +1 -1
- package/dist/collection/components/switch/switch.js +260 -51
- package/dist/collection/components/switch/switch.js.map +1 -1
- package/dist/collection/components/tab-item/tab-item.js +2 -2
- package/dist/collection/components/tab-list/tab-list.js +2 -2
- package/dist/collection/components/tab-panel/tab-panel.js +2 -2
- package/dist/collection/components/tabs/tabs.js +2 -2
- package/dist/collection/components/textarea/textarea.js +2 -2
- package/dist/collection/shared/model.js +1 -0
- package/dist/collection/shared/model.js.map +1 -1
- package/dist/collection/utils/index.js +19 -0
- package/dist/collection/utils/index.js.map +1 -1
- package/dist/custom-elements.json +329 -132
- package/dist/db-ux/db-custom-select-dropdown.db-custom-select-list.db-custom-select-list-item.db-input.db-tag.entry.esm.js.map +1 -1
- package/dist/db-ux/db-custom-select.entry.esm.js.map +1 -1
- package/dist/db-ux/db-switch.entry.esm.js.map +1 -1
- package/dist/db-ux/db-ux.esm.js +1 -1
- package/dist/db-ux/db-ux.esm.js.map +1 -1
- package/dist/db-ux/index.esm.js +1 -1
- package/dist/db-ux/index.esm.js.map +1 -1
- package/dist/db-ux/p-0530a878.entry.js +2 -0
- package/dist/db-ux/{p-2c457e48.entry.js.map → p-0530a878.entry.js.map} +1 -1
- package/dist/db-ux/{p-3390e528.entry.js → p-09bedc1a.entry.js} +2 -2
- package/dist/db-ux/{p-75d3a947.entry.js → p-0c4d5d88.entry.js} +2 -2
- package/dist/db-ux/p-38d2dfea.entry.js +2 -0
- package/dist/db-ux/p-38d2dfea.entry.js.map +1 -0
- package/dist/db-ux/{p-31b7ea66.entry.js → p-3cb7ff97.entry.js} +2 -2
- package/dist/db-ux/{p-1a7001bb.entry.js → p-45ca9947.entry.js} +2 -2
- package/dist/db-ux/p-4769ec6d.entry.js +2 -0
- package/dist/db-ux/{p-950bf6ab.entry.js.map → p-4769ec6d.entry.js.map} +1 -1
- package/dist/db-ux/{p-56488bc3.entry.js → p-68bc689b.entry.js} +2 -2
- package/dist/db-ux/p-71a9c2c9.entry.js +2 -0
- package/dist/db-ux/p-7c27fe0d.entry.js +2 -0
- package/dist/db-ux/{p-72bd1665.entry.js.map → p-7c27fe0d.entry.js.map} +1 -1
- package/dist/db-ux/{p-82083293.entry.js → p-807ad902.entry.js} +2 -2
- package/dist/db-ux/{p-b3ccfc6a.entry.js → p-82311da9.entry.js} +2 -2
- package/dist/db-ux/{p-cd51d733.entry.js → p-82369b8d.entry.js} +2 -2
- package/dist/db-ux/{p-43be6218.entry.js → p-85ad9dfb.entry.js} +2 -2
- package/dist/db-ux/{p-1c50fd87.entry.js → p-870bb35b.entry.js} +2 -2
- package/dist/db-ux/{p-2bc4be80.entry.js → p-88e27985.entry.js} +2 -2
- package/dist/db-ux/{p-a7a0c5a3.entry.js → p-9ce7a144.entry.js} +2 -2
- package/dist/db-ux/p-BMfF_eQJ.js +2 -0
- package/dist/db-ux/{p-BRouKtF5.js.map → p-BMfF_eQJ.js.map} +1 -1
- package/dist/db-ux/p-BX4jNwUm.js +2 -0
- package/dist/db-ux/{p-BwSmFFdU.js.map → p-BX4jNwUm.js.map} +1 -1
- package/dist/db-ux/p-DhKljLRG.js +2 -0
- package/dist/db-ux/p-DhKljLRG.js.map +1 -0
- package/dist/db-ux/{p-Bxi-mtJ7.js → p-_OYZj_2L.js} +2 -2
- package/dist/db-ux/{p-Bxi-mtJ7.js.map → p-_OYZj_2L.js.map} +1 -1
- package/dist/db-ux/p-a334df8c.entry.js +2 -0
- package/dist/db-ux/{p-d0a2e1d4.entry.js → p-b1be4ba0.entry.js} +2 -2
- package/dist/db-ux/{p-c9b2b24e.entry.js → p-b2acf6bd.entry.js} +2 -2
- package/dist/db-ux/{p-da7e3ac7.entry.js → p-b63d89c7.entry.js} +2 -2
- package/dist/db-ux/{p-132ee89d.entry.js → p-ca3555c1.entry.js} +2 -2
- package/dist/db-ux/p-ce826494.entry.js +2 -0
- package/dist/db-ux/{p-90f21d44.entry.js.map → p-ce826494.entry.js.map} +1 -1
- package/dist/db-ux/{p-26e115a8.entry.js → p-cf9785fe.entry.js} +2 -2
- package/dist/db-ux/{p-1f490d67.entry.js → p-d17fe729.entry.js} +2 -2
- package/dist/db-ux/{p-53c419b0.entry.js → p-d93934d2.entry.js} +2 -2
- package/dist/db-ux/p-eab5ef6f.entry.js +2 -0
- package/dist/db-ux/p-eab5ef6f.entry.js.map +1 -0
- package/dist/db-ux/{p-364cc533.entry.js → p-eabd7598.entry.js} +2 -2
- package/dist/db-ux/p-f2483bef.entry.js +2 -0
- package/dist/db-ux/{p-fbf46ee6.entry.js.map → p-f2483bef.entry.js.map} +1 -1
- package/dist/db-ux/{p-963fde68.entry.js → p-f30ec184.entry.js} +2 -2
- package/dist/db-ux/p-f30ec184.entry.js.map +1 -0
- package/dist/esm/db-accordion-item.entry.js +2 -2
- package/dist/esm/db-accordion.entry.js +2 -2
- package/dist/esm/db-badge.entry.js +2 -2
- package/dist/esm/db-brand.entry.js +2 -2
- package/dist/esm/db-button.entry.js +2 -2
- package/dist/esm/db-card.entry.js +2 -2
- package/dist/esm/db-checkbox.entry.js +2 -2
- package/dist/esm/db-custom-select-dropdown.db-custom-select-list.db-custom-select-list-item.db-input.db-tag.entry.js.map +1 -1
- package/dist/esm/db-custom-select-dropdown_5.entry.js +5 -15
- package/dist/esm/db-custom-select-form-field.entry.js +2 -2
- package/dist/esm/db-custom-select.entry.js +10 -10
- package/dist/esm/db-custom-select.entry.js.map +1 -1
- package/dist/esm/db-divider.entry.js +2 -2
- package/dist/esm/db-drawer.entry.js +2 -2
- package/dist/esm/db-header.entry.js +2 -2
- package/dist/esm/db-icon.entry.js +2 -2
- package/dist/esm/db-infotext.entry.js +2 -2
- package/dist/esm/db-link.entry.js +2 -2
- package/dist/esm/db-navigation-item.entry.js +2 -2
- package/dist/esm/db-navigation.entry.js +2 -2
- package/dist/esm/db-notification.entry.js +2 -2
- package/dist/esm/db-page.entry.js +2 -2
- package/dist/esm/db-popover.entry.js +3 -3
- package/dist/esm/db-radio.entry.js +2 -2
- package/dist/esm/db-section.entry.js +2 -2
- package/dist/esm/db-select.entry.js +2 -2
- package/dist/esm/db-stack.entry.js +2 -2
- package/dist/esm/db-switch.entry.js +70 -5
- package/dist/esm/db-switch.entry.js.map +1 -1
- package/dist/esm/db-tab-item_3.entry.js +8 -8
- package/dist/esm/db-tabs.entry.js +4 -4
- package/dist/esm/db-textarea.entry.js +4 -4
- package/dist/esm/db-tooltip.entry.js +3 -3
- package/dist/esm/db-ux.js +4 -4
- package/dist/esm/db-ux.js.map +1 -1
- package/dist/esm/{document-click-listener-B4S1N-ro.js → document-click-listener-D1ZXrKSx.js} +3 -3
- package/dist/esm/{document-click-listener-B4S1N-ro.js.map → document-click-listener-D1ZXrKSx.js.map} +1 -1
- package/dist/esm/{document-scroll-listener-DC7DAxof.js → document-scroll-listener-DF6f0ByI.js} +3 -3
- package/dist/esm/{document-scroll-listener-DC7DAxof.js.map → document-scroll-listener-DF6f0ByI.js.map} +1 -1
- package/dist/esm/{index-YECpAE3G.js → index-DhKljLRG.js} +22 -3
- package/dist/esm/index-DhKljLRG.js.map +1 -0
- package/dist/esm/{index-Bxi-mtJ7.js → index-_OYZj_2L.js} +7 -4
- package/dist/{cjs/index-BKsFzv8w.js.map → esm/index-_OYZj_2L.js.map} +1 -1
- package/dist/esm/index.js +6 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/types/components/custom-select/custom-select.d.ts +1 -1
- package/dist/types/components/custom-select/model.d.ts +1 -1
- package/dist/types/components/input/input.d.ts +0 -1
- package/dist/types/components/input/model.d.ts +0 -1
- package/dist/types/components/switch/model.d.ts +7 -3
- package/dist/types/components/switch/switch.d.ts +19 -4
- package/dist/types/components.d.ts +14 -4
- package/dist/types/shared/model.d.ts +2 -0
- package/dist/types/stencil-public-runtime.d.ts +2 -1
- package/dist/types/utils/index.d.ts +10 -0
- package/dist/vscode.html-custom-data.json +48 -23
- package/dist/web-types.json +96 -40
- package/package.json +4 -4
- package/dist/cjs/index-DjV59BYq.js.map +0 -1
- package/dist/db-ux/p-07a7eb33.entry.js +0 -2
- package/dist/db-ux/p-2c457e48.entry.js +0 -2
- package/dist/db-ux/p-69a7e5f9.entry.js +0 -2
- package/dist/db-ux/p-72bd1665.entry.js +0 -2
- package/dist/db-ux/p-90f21d44.entry.js +0 -2
- package/dist/db-ux/p-950bf6ab.entry.js +0 -2
- package/dist/db-ux/p-963fde68.entry.js.map +0 -1
- package/dist/db-ux/p-BRouKtF5.js +0 -2
- package/dist/db-ux/p-BwSmFFdU.js +0 -2
- package/dist/db-ux/p-YECpAE3G.js +0 -2
- package/dist/db-ux/p-YECpAE3G.js.map +0 -1
- package/dist/db-ux/p-a5b542fa.entry.js +0 -2
- package/dist/db-ux/p-a5b542fa.entry.js.map +0 -1
- package/dist/db-ux/p-ad8ff0ae.entry.js +0 -2
- package/dist/db-ux/p-ad8ff0ae.entry.js.map +0 -1
- package/dist/db-ux/p-fbf46ee6.entry.js +0 -2
- package/dist/esm/index-YECpAE3G.js.map +0 -1
- /package/dist/db-ux/{p-3390e528.entry.js.map → p-09bedc1a.entry.js.map} +0 -0
- /package/dist/db-ux/{p-75d3a947.entry.js.map → p-0c4d5d88.entry.js.map} +0 -0
- /package/dist/db-ux/{p-31b7ea66.entry.js.map → p-3cb7ff97.entry.js.map} +0 -0
- /package/dist/db-ux/{p-1a7001bb.entry.js.map → p-45ca9947.entry.js.map} +0 -0
- /package/dist/db-ux/{p-56488bc3.entry.js.map → p-68bc689b.entry.js.map} +0 -0
- /package/dist/db-ux/{p-07a7eb33.entry.js.map → p-71a9c2c9.entry.js.map} +0 -0
- /package/dist/db-ux/{p-82083293.entry.js.map → p-807ad902.entry.js.map} +0 -0
- /package/dist/db-ux/{p-b3ccfc6a.entry.js.map → p-82311da9.entry.js.map} +0 -0
- /package/dist/db-ux/{p-cd51d733.entry.js.map → p-82369b8d.entry.js.map} +0 -0
- /package/dist/db-ux/{p-43be6218.entry.js.map → p-85ad9dfb.entry.js.map} +0 -0
- /package/dist/db-ux/{p-1c50fd87.entry.js.map → p-870bb35b.entry.js.map} +0 -0
- /package/dist/db-ux/{p-2bc4be80.entry.js.map → p-88e27985.entry.js.map} +0 -0
- /package/dist/db-ux/{p-a7a0c5a3.entry.js.map → p-9ce7a144.entry.js.map} +0 -0
- /package/dist/db-ux/{p-69a7e5f9.entry.js.map → p-a334df8c.entry.js.map} +0 -0
- /package/dist/db-ux/{p-d0a2e1d4.entry.js.map → p-b1be4ba0.entry.js.map} +0 -0
- /package/dist/db-ux/{p-c9b2b24e.entry.js.map → p-b2acf6bd.entry.js.map} +0 -0
- /package/dist/db-ux/{p-da7e3ac7.entry.js.map → p-b63d89c7.entry.js.map} +0 -0
- /package/dist/db-ux/{p-132ee89d.entry.js.map → p-ca3555c1.entry.js.map} +0 -0
- /package/dist/db-ux/{p-26e115a8.entry.js.map → p-cf9785fe.entry.js.map} +0 -0
- /package/dist/db-ux/{p-1f490d67.entry.js.map → p-d17fe729.entry.js.map} +0 -0
- /package/dist/db-ux/{p-53c419b0.entry.js.map → p-d93934d2.entry.js.map} +0 -0
- /package/dist/db-ux/{p-364cc533.entry.js.map → p-eabd7598.entry.js.map} +0 -0
|
@@ -16,6 +16,7 @@ export const EmphasisList = ['weak', 'strong'];
|
|
|
16
16
|
export const ValidationList = ['invalid', 'valid', 'no-validation'];
|
|
17
17
|
export const FieldSizingList = ['fixed', 'content'];
|
|
18
18
|
export const LabelVariantList = ['above', 'floating'];
|
|
19
|
+
export const LabelVariantHorizontalList = ['leading', 'trailing'];
|
|
19
20
|
export 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'];
|
|
20
21
|
export const LinkTargetList = ['_self', '_blank', '_parent', '_top'];
|
|
21
22
|
export const LinkReferrerPolicyList = ['no-referrer', 'no-referrer-when-downgrade', 'origin', 'origin-when-cross-origin', 'same-origin', 'strict-origin', 'strict-origin-when-cross-origin', 'unsafe-url'];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/shared/model.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAiCvD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,EAAE,SAAS,EAAE,YAAY,CAAU,CAAC;AA+CnH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAU,CAAC;AAQzE,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAU,CAAC;AAQxE,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,CAAU,CAAC;AAExH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,cAAc,EAAE,YAAY,CAAU,CAAC;AAEtH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,GAAG,uBAAuB,EAAE,GAAG,qBAAqB,CAAU,CAAC;AAiB7F,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,CAAU,CAAC;AAoBlJ,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,YAAY,EAAE,UAAU,CAAU,CAAC;AAQnE,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,CAAU,CAAC;AAQnD,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AAM,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,CAAU,CAAC;AA+D91B,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAU,CAAC;AAE9E,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,aAAa,EAAE,4BAA4B,EAAE,QAAQ,EAAE,0BAA0B,EAAE,aAAa,EAAE,eAAe,EAAE,iCAAiC,EAAE,YAAY,CAAU,CAAC;AA2EpN,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAU,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 * [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 | string;\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://design-system.deutschebahn.com/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 | string;\n};\nexport type ShowIconLeadingProps = {\n /**\n * Enables or disables the visibility of the leading icon.\n * For many components this property is optional to reflect Figma properties.\n */\n showIconLeading?: boolean | string;\n};\nexport type ShowIconTrailingProps = {\n /**\n * Enables or disables the visibility of the trailing icon.\n * For many components this property is optional to reflect Figma properties.\n */\n showIconTrailing?: boolean | string;\n};\nexport type IconLeadingProps = {\n /**\n * Define an icon by its identifier (like e.g. _user_, compare to [Icons](https://design-system.deutschebahn.com/core-web/review/main/foundations/icons/overview)) to get displayed in front of the elements content.\n */\n iconLeading?: IconTypes;\n};\nexport type IconTrailingProps = {\n /**\n * Define an icon by its identifier (like e.g. _user_, compare to [Icons](https://design-system.deutschebahn.com/core-web/review/main/foundations/icons/overview)) to get displayed in front of the elements content.\n */\n iconTrailing?: 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 | string;\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 PlacementHorizontalList = ['left', 'right', 'left-start', 'left-end', 'right-start', 'right-end'] as const;\nexport type PlacementHorizontalType = (typeof PlacementHorizontalList)[number];\nexport const PlacementVerticalList = ['top', 'bottom', 'top-start', 'top-end', 'bottom-start', 'bottom-end'] as const;\nexport type PlacementVerticalType = (typeof PlacementVerticalList)[number];\nexport const PlacementList = [...PlacementHorizontalList, ...PlacementVerticalList] 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: any) => void;\n};\nexport type GapProps = {\n /**\n * If the absolute element should have a gap between the parent element.\n */\n gap?: boolean | string;\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 | string;\n};\nexport type WrapProps = {\n /**\n * Determines whether the text should wrap when its parent container is too small, preventing overflow.\n */\n wrap?: boolean | string;\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 | string;\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 | string;\n /**\n * Use fixed with for default max-width\n */\n width?: PopoverWidthType;\n};\nexport type NameProps = {\n /**\n * The name attribute gives the name of the element to group it.\n */\n name?: string;\n};\nexport type NameState = {\n _name?: string;\n handleNameAttribute: () => 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 ValidationList = ['invalid', 'valid', 'no-validation'] as const;\nexport type ValidationType = (typeof ValidationList)[number];\n\n/**\n * Properties to control the required state and its visual annotation for input components.\n */\nexport type RequiredProps = {\n /**\n * When the required attribute specified, the user will be required to fill the form element before submitting the form.\n * The form element will be marked semantically as required and by default also visually with an asterisk '*' next to the label (unless the property `showRequiredAsterisk` is also set with the value `false`).\n */\n required?: boolean | string;\n /**\n * This attribute allows to specify whether a form field which is marked as required will show a visual indicator (an asterisk '*').\n * It allows to prevent adding the visual indicator but still keep the field semantically required by setting its value to `false`.\n * By default, its value is `true`, so the asterisk is shown when `required` is set.\n */\n showRequiredAsterisk?: boolean | string;\n};\nexport type ShowLabelProps = {\n /**\n * Enables/disables the visibility of the label\n */\n showLabel?: boolean | string;\n};\nexport type ValueProps = {\n /**\n * The value property is to receive results from the native form element.\n */\n value?: any;\n};\nexport type BaseFormProps = {\n /**\n * The disabled attribute can be set to keep a user from clicking on the form element.\n */\n disabled?: boolean | string;\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};\nexport type CustomFormProps = {\n /**\n * Overwrites auto handling for aria-describedby.\n */\n ariaDescribedBy?: string;\n /**\n * \tAssociates the control with a form element\n */\n form?: string;\n\n /**\n * Marks an input element as invalid (red) / valid (green) / no-validation (grey). Overwrites the :user-valid selector.\n */\n validation?: ValidationType;\n};\nexport type FormProps = CustomFormProps & BaseFormProps & RequiredProps & ShowLabelProps & ValueProps;\nexport const FieldSizingList = ['fixed', 'content'] as const;\nexport type FieldSizingType = (typeof FieldSizingList)[number];\nexport type FormTextProps = {\n /**\n * Maximum length (number of characters) of value\n */\n maxLength?: number | string;\n /**\n * Minimum length (number of characters) of value\n */\n minLength?: number | string;\n /**\n * Maximum length (number of characters) of value\n */\n maxlength?: number | string;\n /**\n * Minimum length (number of characters) of value\n */\n minlength?: number | string;\n /**\n * The disabled attribute can be set to keep a user from edit on the form element\n */\n readOnly?: boolean | string;\n /**\n * The disabled attribute can be set to keep a user from edit on the form element\n */\n readonly?: boolean | string;\n\n /**\n * Adds shrinkwrap for input and textarea: https://developer.mozilla.org/en-US/docs/Web/CSS/field-sizing\n * Note: Only supported in Chromium browsers so far\n */\n fieldSizing?: FieldSizingType;\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 | string;\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 | string;\n};\nexport type FromValidState = {\n hasValidState: () => boolean;\n handleValidation: () => void;\n _invalidMessage?: string;\n};\nexport type FormState = {\n _messageId?: string;\n _validMessageId?: string;\n _invalidMessageId?: string;\n _descByIds?: string;\n _value?: string;\n _invalidMessage?: string;\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 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 * Disables the link.\n */\n disabled?: boolean | string;\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 * 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};\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 GeneralEvent<T> = Event;\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type GeneralKeyboardEvent<T> = KeyboardEvent;\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> | any) => void;\n};\nexport type ToggleEventProps = {\n toggle?: (open: boolean) => void;\n onToggle?: (open: boolean) => void;\n};\nexport type ToggleEventState<T> = {\n handleToggle: (event?: ClickEvent<T> | any) => void;\n};\nexport type CloseEventProps<T> = {\n /**\n * Function to handle button click (close).\n */\n onClose?: (event?: T) => void;\n /**\n * Function to handle button click (close).\n */\n close?: (event?: T) => void;\n};\nexport type CloseEventState<T> = {\n handleClose: (event?: T | void, forceClose?: boolean) => 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 | string;\n};\nexport type ActiveProps = {\n /**\n * If the tab is checked/active.\n */\n active?: boolean | string;\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> | any) => 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> | any) => 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> | any) => void;\n handleFocus: (event: InteractionEvent<T> | any) => 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 AriaControlsProps = {\n /**\n * Pass `aria-controls` to inner element\n */\n controls?: string;\n};\nexport type ValueLabelType = {\n value: string;\n label?: string;\n};\nexport type DocumentScrollState = {\n _documentScrollListenerCallbackId?: string;\n handleDocumentScroll: (event: any, parent?: HTMLElement) => void;\n _observer?: IntersectionObserver;\n};\nexport type PopoverState = {\n handleEscape: (event: any) => void;\n handleAutoPlacement: (parent?: HTMLElement) => void;\n handleEnter: (parent?: HTMLElement) => void;\n handleLeave: (event?: any) => void;\n} & DocumentScrollState"]}
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/shared/model.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAiCvD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,EAAE,SAAS,EAAE,YAAY,CAAU,CAAC;AA+CnH,MAAM,CAAC,MAAM,WAAW,GAA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CAAC,aAAa,EAAE,4BAA4B,EAAE,QAAQ,EAAE,0BAA0B,EAAE,aAAa,EAAE,eAAe,EAAE,iCAAiC,EAAE,YAAY,CAAU,CAAC;AA2EpN,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAU,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 * [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 | string;\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://design-system.deutschebahn.com/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 | string;\n};\nexport type ShowIconLeadingProps = {\n /**\n * Enables or disables the visibility of the leading icon.\n * For many components this property is optional to reflect Figma properties.\n */\n showIconLeading?: boolean | string;\n};\nexport type ShowIconTrailingProps = {\n /**\n * Enables or disables the visibility of the trailing icon.\n * For many components this property is optional to reflect Figma properties.\n */\n showIconTrailing?: boolean | string;\n};\nexport type IconLeadingProps = {\n /**\n * Define an icon by its identifier (like e.g. _user_, compare to [Icons](https://design-system.deutschebahn.com/core-web/review/main/foundations/icons/overview)) to get displayed in front of the elements content.\n */\n iconLeading?: IconTypes;\n};\nexport type IconTrailingProps = {\n /**\n * Define an icon by its identifier (like e.g. _user_, compare to [Icons](https://design-system.deutschebahn.com/core-web/review/main/foundations/icons/overview)) to get displayed in front of the elements content.\n */\n iconTrailing?: 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 | string;\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 PlacementHorizontalList = ['left', 'right', 'left-start', 'left-end', 'right-start', 'right-end'] as const;\nexport type PlacementHorizontalType = (typeof PlacementHorizontalList)[number];\nexport const PlacementVerticalList = ['top', 'bottom', 'top-start', 'top-end', 'bottom-start', 'bottom-end'] as const;\nexport type PlacementVerticalType = (typeof PlacementVerticalList)[number];\nexport const PlacementList = [...PlacementHorizontalList, ...PlacementVerticalList] 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: any) => void;\n};\nexport type GapProps = {\n /**\n * If the absolute element should have a gap between the parent element.\n */\n gap?: boolean | string;\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 | string;\n};\nexport type WrapProps = {\n /**\n * Determines whether the text should wrap when its parent container is too small, preventing overflow.\n */\n wrap?: boolean | string;\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 | string;\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 | string;\n /**\n * Use fixed with for default max-width\n */\n width?: PopoverWidthType;\n};\nexport type NameProps = {\n /**\n * The name attribute gives the name of the element to group it.\n */\n name?: string;\n};\nexport type NameState = {\n _name?: string;\n handleNameAttribute: () => 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 ValidationList = ['invalid', 'valid', 'no-validation'] as const;\nexport type ValidationType = (typeof ValidationList)[number];\n\n/**\n * Properties to control the required state and its visual annotation for input components.\n */\nexport type RequiredProps = {\n /**\n * When the required attribute specified, the user will be required to fill the form element before submitting the form.\n * The form element will be marked semantically as required and by default also visually with an asterisk '*' next to the label (unless the property `showRequiredAsterisk` is also set with the value `false`).\n */\n required?: boolean | string;\n /**\n * This attribute allows to specify whether a form field which is marked as required will show a visual indicator (an asterisk '*').\n * It allows to prevent adding the visual indicator but still keep the field semantically required by setting its value to `false`.\n * By default, its value is `true`, so the asterisk is shown when `required` is set.\n */\n showRequiredAsterisk?: boolean | string;\n};\nexport type ShowLabelProps = {\n /**\n * Enables/disables the visibility of the label\n */\n showLabel?: boolean | string;\n};\nexport type ValueProps = {\n /**\n * The value property is to receive results from the native form element.\n */\n value?: any;\n};\nexport type BaseFormProps = {\n /**\n * The disabled attribute can be set to keep a user from clicking on the form element.\n */\n disabled?: boolean | string;\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};\nexport type CustomFormProps = {\n /**\n * Overwrites auto handling for aria-describedby.\n */\n ariaDescribedBy?: string;\n /**\n * \tAssociates the control with a form element\n */\n form?: string;\n\n /**\n * Marks an input element as invalid (red) / valid (green) / no-validation (grey). Overwrites the :user-valid selector.\n */\n validation?: ValidationType;\n};\nexport type FormProps = CustomFormProps & BaseFormProps & RequiredProps & ShowLabelProps & ValueProps;\nexport const FieldSizingList = ['fixed', 'content'] as const;\nexport type FieldSizingType = (typeof FieldSizingList)[number];\nexport type FormTextProps = {\n /**\n * Maximum length (number of characters) of value\n */\n maxLength?: number | string;\n /**\n * Minimum length (number of characters) of value\n */\n minLength?: number | string;\n /**\n * Maximum length (number of characters) of value\n */\n maxlength?: number | string;\n /**\n * Minimum length (number of characters) of value\n */\n minlength?: number | string;\n /**\n * The disabled attribute can be set to keep a user from edit on the form element\n */\n readOnly?: boolean | string;\n /**\n * The disabled attribute can be set to keep a user from edit on the form element\n */\n readonly?: boolean | string;\n\n /**\n * Adds shrinkwrap for input and textarea: https://developer.mozilla.org/en-US/docs/Web/CSS/field-sizing\n * Note: Only supported in Chromium browsers so far\n */\n fieldSizing?: FieldSizingType;\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 | string;\n};\nexport const LabelVariantList = ['above', 'floating'] as const;\nexport type LabelVariantType = (typeof LabelVariantList)[number];\nexport const LabelVariantHorizontalList = ['leading', 'trailing'] as const;\nexport type LabelVariantHorizontalType = (typeof LabelVariantHorizontalList)[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 | string;\n};\nexport type FromValidState = {\n hasValidState: () => boolean;\n handleValidation: () => void;\n _invalidMessage?: string;\n};\nexport type FormState = {\n _messageId?: string;\n _validMessageId?: string;\n _invalidMessageId?: string;\n _descByIds?: string;\n _value?: string;\n _invalidMessage?: string;\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 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 * Disables the link.\n */\n disabled?: boolean | string;\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 * 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};\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 GeneralEvent<T> = Event;\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type GeneralKeyboardEvent<T> = KeyboardEvent;\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> | any) => void;\n};\nexport type ToggleEventProps = {\n toggle?: (open: boolean) => void;\n onToggle?: (open: boolean) => void;\n};\nexport type ToggleEventState<T> = {\n handleToggle: (event?: ClickEvent<T> | any) => void;\n};\nexport type CloseEventProps<T> = {\n /**\n * Function to handle button click (close).\n */\n onClose?: (event?: T) => void;\n /**\n * Function to handle button click (close).\n */\n close?: (event?: T) => void;\n};\nexport type CloseEventState<T> = {\n handleClose: (event?: T | void, forceClose?: boolean) => 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 | string;\n};\nexport type ActiveProps = {\n /**\n * If the tab is checked/active.\n */\n active?: boolean | string;\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> | any) => 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> | any) => 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> | any) => void;\n handleFocus: (event: InteractionEvent<T> | any) => 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 AriaControlsProps = {\n /**\n * Pass `aria-controls` to inner element\n */\n controls?: string;\n};\nexport type ValueLabelType = {\n value: string;\n label?: string;\n};\nexport type DocumentScrollState = {\n _documentScrollListenerCallbackId?: string;\n handleDocumentScroll: (event: any, parent?: HTMLElement) => void;\n _observer?: IntersectionObserver;\n};\nexport type PopoverState = {\n handleEscape: (event: any) => void;\n handleAutoPlacement: (parent?: HTMLElement) => void;\n handleEnter: (parent?: HTMLElement) => void;\n handleLeave: (event?: any) => void;\n} & DocumentScrollState"]}
|
|
@@ -40,6 +40,25 @@ export const cls = (...args) => {
|
|
|
40
40
|
export const isArrayOfStrings = (value) => Array.isArray(value) && value.every(item => typeof item === 'string');
|
|
41
41
|
const appleOs = ['Mac', 'iPhone', 'iPad', 'iPod'];
|
|
42
42
|
export const hasVoiceOver = () => typeof window !== 'undefined' && appleOs.some(os => window.navigator.userAgent.includes(os));
|
|
43
|
+
/**
|
|
44
|
+
* Determines if the current browser is Safari running on an iOS device.
|
|
45
|
+
*
|
|
46
|
+
* This function checks the user agent string to verify both iOS platform
|
|
47
|
+
* (iPad, iPhone, or iPod) and Safari browser, excluding other browsers
|
|
48
|
+
* such as Chrome, Firefox, Opera, and Edge on iOS.
|
|
49
|
+
*
|
|
50
|
+
* @returns {boolean} `true` if the browser is Safari on iOS, otherwise `false`.
|
|
51
|
+
*/
|
|
52
|
+
export const isIOSSafari = () => {
|
|
53
|
+
if (typeof window === 'undefined' || typeof navigator === 'undefined')
|
|
54
|
+
return false;
|
|
55
|
+
const ua = navigator.userAgent;
|
|
56
|
+
// iOS detection
|
|
57
|
+
const isIOS = /iP(ad|hone|od)/.test(ua);
|
|
58
|
+
// Safari detection (not Chrome or Firefox on iOS)
|
|
59
|
+
const isSafari = !!ua.match(/Safari/) && !ua.match(/CriOS|FxiOS|OPiOS|EdgiOS/);
|
|
60
|
+
return isIOS && isSafari;
|
|
61
|
+
};
|
|
43
62
|
export const delay = (fn, ms) => new Promise(() => setTimeout(fn, ms));
|
|
44
63
|
/**
|
|
45
64
|
* Some frameworks like stencil would not add "true" as value for a prop
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AACA,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;AACF,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,OAAgB,EAAE,SAGxD,EAAE,EAAE;IACH,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;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,GAAG,CAAC,MAG5B,EAAE,MAAc,EAAE,EAAE;;IACnB,MAAM,GAAG,GAAG,MAAA,MAAA,MAAM,CAAC,EAAE,mCAAI,MAAM,CAAC,KAAK,mCAAI,IAAI,EAAE,CAAC;IAChD,OAAO,GAAG,MAAM,GAAG,GAAG,EAAE,CAAC;AAC3B,CAAC,CAAC;AACF,MAAM,CAAC,MAAM,eAAe,GAAG,CAAK,KAA+C,EAAoC,EAAE,CAAE,KAAiC,CAAC,GAAG,KAAK,SAAS,CAAA","sourcesContent":["import { ClickEvent, GeneralKeyboardEvent } from '../shared/model';\nexport 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 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));\n\n/**\n * Determines if the current browser is Safari running on an iOS device.\n *\n * This function checks the user agent string to verify both iOS platform\n * (iPad, iPhone, or iPod) and Safari browser, excluding other browsers\n * such as Chrome, Firefox, Opera, and Edge on iOS.\n *\n * @returns {boolean} `true` if the browser is Safari on iOS, otherwise `false`.\n */\nexport const isIOSSafari = (): boolean => {\n if (typeof window === 'undefined' || typeof navigator === 'undefined') return false;\n const ua = navigator.userAgent;\n // iOS detection\n const isIOS = /iP(ad|hone|od)/.test(ua);\n // Safari detection (not Chrome or Firefox on iOS)\n const isSafari = !!ua.match(/Safari/) && !ua.match(/CriOS|FxiOS|OPiOS|EdgiOS/);\n return isIOS && isSafari;\n};\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 | string): any => {\n if (originBool === undefined || originBool === null) return;\n if (typeof originBool === 'string') {\n return String(Boolean(originBool));\n }\n return String(originBool);\n};\nexport const getBoolean = (originBool?: boolean | string, propertyName?: string): boolean | undefined => {\n if (originBool === undefined || originBool === null) return;\n if (typeof originBool === 'string' && propertyName) {\n return Boolean(propertyName === originBool || originBool);\n }\n return Boolean(originBool);\n};\nexport const getNumber = (originNumber?: number | string, alternativeNumber?: number | string): number | undefined => {\n if ((originNumber === undefined || originNumber === null) && (alternativeNumber === undefined || alternativeNumber === null)) {\n return;\n }\n return Number(originNumber ?? alternativeNumber);\n};\n\n/**\n * Retrieves the input value based on the provided value and input type.\n *\n * If the input type is \"number\" or \"range\", the value is processed as a number.\n * Otherwise, the value is returned as-is.\n *\n * @param value - The input value, which can be a number, string, or undefined.\n * @param inputType - The type of the input, such as \"number\", \"range\", or other string types.\n * @returns The processed input value as a string, number, or undefined.\n */\nexport const getInputValue = (value?: number | string, inputType?: string): string | number | undefined => {\n return inputType && ['number', 'range'].includes(inputType) ? getNumber(value) : value;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const getHideProp = (show?: boolean | string): any => {\n if (show === undefined || show === null) {\n return undefined;\n }\n return getBooleanAsString(!Boolean(show));\n};\nexport const stringPropVisible = (givenString?: string, showString?: boolean | string) => {\n if (showString === undefined) {\n return !!givenString;\n } else {\n return Boolean(showString) && Boolean(givenString);\n }\n};\nexport const getSearchInput = (element: HTMLElement): HTMLInputElement | null => element.querySelector<HTMLInputElement>(`input[type=\"search\"]`);\nexport const getOptionKey = (option: {\n id?: string;\n value?: string | number | string[] | undefined;\n}, prefix: string) => {\n const key = option.id ?? option.value ?? uuid();\n return `${prefix}${key}`;\n};\nexport const isKeyboardEvent = <T,>(event?: ClickEvent<T> | GeneralKeyboardEvent<T>): event is GeneralKeyboardEvent<T> => (event as GeneralKeyboardEvent<T>).key !== undefined"]}
|