@dubai-design-system/components-js 5.0.3 → 5.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.
- package/CHANGELOG.md +198 -1
- package/MIGRATION.md +423 -0
- package/dist/cjs/dda-accordion.cjs.entry.js +12 -7
- package/dist/cjs/dda-alert.cjs.entry.js +20 -3
- package/dist/cjs/dda-attach-file.cjs.entry.js +24 -8
- package/dist/cjs/dda-avatar.cjs.entry.js +23 -12
- package/dist/cjs/dda-banner.cjs.entry.js +14 -5
- package/dist/cjs/dda-breadcrumb.cjs.entry.js +22 -10
- package/dist/cjs/dda-button.cjs.entry.js +16 -9
- package/dist/cjs/dda-checkbox.cjs.entry.js +5 -4
- package/dist/cjs/dda-chip.cjs.entry.js +8 -3
- package/dist/cjs/dda-credit-card.cjs.entry.js +5 -3
- package/dist/cjs/dda-creditcard-field.cjs.entry.js +26 -8
- package/dist/cjs/dda-dropdown.cjs.entry.js +31 -5
- package/dist/cjs/dda-footer.cjs.entry.js +9 -3
- package/dist/cjs/dda-header.cjs.entry.js +80 -8
- package/dist/cjs/dda-home-banner.cjs.entry.js +11 -5
- package/dist/cjs/dda-horizontal-stepper.cjs.entry.js +22 -5
- package/dist/cjs/dda-input.cjs.entry.js +17 -10
- package/dist/cjs/dda-link-button_2.cjs.entry.js +21 -13
- package/dist/cjs/dda-number-field.cjs.entry.js +20 -8
- package/dist/cjs/dda-pagination.cjs.entry.js +21 -11
- package/dist/cjs/dda-phonefield.cjs.entry.js +27 -9
- package/dist/cjs/dda-progressbar.cjs.entry.js +8 -3
- package/dist/cjs/dda-range-slider.cjs.entry.js +15 -3
- package/dist/cjs/dda-search-input.cjs.entry.js +27 -12
- package/dist/cjs/dda-segmented-tabs.cjs.entry.js +54 -6
- package/dist/cjs/dda-select.cjs.entry.js +40 -8
- package/dist/cjs/dda-sticky-footer.cjs.entry.js +20 -3
- package/dist/cjs/dda-tabs.cjs.entry.js +10 -4
- package/dist/cjs/dda-textarea.cjs.entry.js +22 -12
- package/dist/cjs/dda-toggle.cjs.entry.js +5 -4
- package/dist/cjs/dda-tooltip.cjs.entry.js +6 -4
- package/dist/cjs/dda-ui-card.cjs.entry.js +19 -2
- package/dist/cjs/dda-vertical-stepper.cjs.entry.js +23 -3
- package/dist/cjs/dda.cjs.js +2 -2
- package/dist/cjs/index-Dm7JbFAh.js +2116 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/unique-id-DahNGdQy.js +14 -0
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/dda-accordion/dda-accordion.js +16 -11
- package/dist/collection/components/dda-alert/dda-alert.js +74 -17
- package/dist/collection/components/dda-alert/dda-alert.stories.js +2 -8
- package/dist/collection/components/dda-attach-file/dda-attach-file.js +35 -19
- package/dist/collection/components/dda-attach-file/dda-attach-file.stories.js +0 -9
- package/dist/collection/components/dda-avatar/dda-avatar.js +53 -25
- package/dist/collection/components/dda-avatar/dda-avatar.stories.js +1 -1
- package/dist/collection/components/dda-banner/dda-banner.css +35 -0
- package/dist/collection/components/dda-banner/dda-banner.js +34 -5
- package/dist/collection/components/dda-breadcrumb/dda-breadcrumb.js +49 -12
- package/dist/collection/components/dda-button/dda-button.js +29 -22
- package/dist/collection/components/dda-checkbox/dda-checkbox.css +13 -0
- package/dist/collection/components/dda-checkbox/dda-checkbox.js +13 -12
- package/dist/collection/components/dda-checkbox/dda-checkbox.stories.js +0 -11
- package/dist/collection/components/dda-chip/dda-chip.js +34 -9
- package/dist/collection/components/dda-chip/dda-chip.stories.js +0 -11
- package/dist/collection/components/dda-credit-card/dda-credit-card.js +10 -8
- package/dist/collection/components/dda-creditcard-field/dda-creditcard-field.js +58 -23
- package/dist/collection/components/dda-creditcard-field/dda-creditcard-field.stories.js +1 -10
- package/dist/collection/components/dda-dropdown/dda-dropdown.js +90 -18
- package/dist/collection/components/dda-dropdown/dda-dropdown.stories.js +0 -4
- package/dist/collection/components/dda-footer/dda-footer.js +57 -10
- package/dist/collection/components/dda-footer/dda-footer.stories.js +5 -4
- package/dist/collection/components/dda-header/dda-header.css +11 -0
- package/dist/collection/components/dda-header/dda-header.js +224 -37
- package/dist/collection/components/dda-header/dda-header.stories.js +12 -21
- package/dist/collection/components/dda-home-banner/dda-home-banner.js +8 -2
- package/dist/collection/components/dda-home-banner/home-banner.css +21 -1
- package/dist/collection/components/dda-input/dda-input.js +28 -21
- package/dist/collection/components/dda-input/dda-input.stories.js +0 -13
- package/dist/collection/components/dda-link-button/dda-link-button.js +30 -23
- package/dist/collection/components/dda-number-field/dda-number-field.js +54 -22
- package/dist/collection/components/dda-number-field/dda-number-field.stories.js +0 -9
- package/dist/collection/components/dda-pagination/dda-pagination.js +95 -28
- package/dist/collection/components/dda-pagination/dda-pagination.stories.js +24 -24
- package/dist/collection/components/dda-phonefield/dda-phonefield.js +62 -24
- package/dist/collection/components/dda-phonefield/dda-phonefield.stories.js +0 -13
- package/dist/collection/components/dda-progressbar/dda-progressbar.js +13 -8
- package/dist/collection/components/dda-radiobutton/dda-radiobutton.css +121 -4
- package/dist/collection/components/dda-radiobutton/dda-radiobutton.js +13 -12
- package/dist/collection/components/dda-radiobutton/dda-radiobutton.stories.js +5 -16
- package/dist/collection/components/dda-range-slider/dda-range-slider.js +29 -17
- package/dist/collection/components/dda-search-input/dda-search-input.js +61 -26
- package/dist/collection/components/dda-search-input/dda-search-input.stories.js +0 -9
- package/dist/collection/components/dda-select/dda-select.js +78 -20
- package/dist/collection/components/dda-sticky-footer/dda-sticky-footer.js +80 -43
- package/dist/collection/components/dda-sticky-footer/dda-sticky-footer.stories.js +1 -1
- package/dist/collection/components/dda-tabs/dda-tabs.js +21 -15
- package/dist/collection/components/dda-tabs/dda-tabs.stories.js +3 -10
- package/dist/collection/components/dda-textarea/dda-textarea.js +33 -23
- package/dist/collection/components/dda-textarea/dda-textarea.stories.js +0 -9
- package/dist/collection/components/dda-toggle/dda-toggle.css +9 -0
- package/dist/collection/components/dda-toggle/dda-toggle.js +47 -8
- package/dist/collection/components/dda-toggle/dda-toggle.stories.js +10 -22
- package/dist/collection/components/dda-tooltip/dda-tooltip.js +9 -7
- package/dist/collection/components/dda-ui-card/dda-ui-card.js +55 -13
- package/dist/collection/components/segmented-groups/dda-segmented-tabs/dda-segmented-tabs.js +79 -11
- package/dist/collection/components/stepper/dda-horizontal-stepper/dda-horizontal-stepper.css +4 -1
- package/dist/collection/components/stepper/dda-horizontal-stepper/dda-horizontal-stepper.js +24 -6
- package/dist/collection/components/stepper/dda-horizontal-stepper/dda-horizontal-stepper.stories.js +2 -2
- package/dist/collection/components/stepper/dda-vertical-stepper/dda-vertical-stepper.js +49 -6
- package/dist/collection/components/stepper/dda-vertical-stepper/dda-vertical-stepper.stories.js +2 -2
- package/dist/collection/global/global.css +117 -4
- package/dist/collection/global/input.css +56 -2
- package/dist/collection/storybook/component-api.js +15 -0
- package/dist/collection/utils/placeholder-color.js +89 -0
- package/dist/collection/utils/unique-id.js +10 -0
- package/dist/components/dda-accordion.js +1 -1
- package/dist/components/dda-alert.js +1 -1
- package/dist/components/dda-attach-file.js +1 -1
- package/dist/components/dda-avatar.js +1 -1
- package/dist/components/dda-banner.js +1 -1
- package/dist/components/dda-breadcrumb.js +1 -1
- package/dist/components/dda-button.js +1 -1
- package/dist/components/dda-checkbox.js +1 -1
- package/dist/components/dda-chip.js +1 -1
- package/dist/components/dda-credit-card.js +1 -1
- package/dist/components/dda-creditcard-field.js +1 -1
- package/dist/components/dda-dropdown.js +1 -1
- package/dist/components/dda-footer.js +1 -1
- package/dist/components/dda-header.js +1 -1
- package/dist/components/dda-home-banner.js +1 -1
- package/dist/components/dda-horizontal-stepper.js +1 -1
- package/dist/components/dda-input.js +1 -1
- package/dist/components/dda-link-button.js +1 -1
- package/dist/components/dda-number-field.js +1 -1
- package/dist/components/dda-pagination.js +1 -1
- package/dist/components/dda-phonefield.js +1 -1
- package/dist/components/dda-progressbar.js +1 -1
- package/dist/components/dda-radiobutton.js +1 -1
- package/dist/components/dda-range-slider.js +1 -1
- package/dist/components/dda-search-input.js +1 -1
- package/dist/components/dda-segmented-tabs.js +1 -1
- package/dist/components/dda-select.js +1 -1
- package/dist/components/dda-sticky-footer.js +1 -1
- package/dist/components/dda-tabs.js +1 -1
- package/dist/components/dda-textarea.js +1 -1
- package/dist/components/dda-toggle.js +1 -1
- package/dist/components/dda-tooltip.js +1 -1
- package/dist/components/dda-ui-card.js +1 -1
- package/dist/components/dda-vertical-stepper.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/p-B-I003EB.js +1 -0
- package/dist/components/p-B4nkZ15I.js +1 -0
- package/dist/components/p-Bk2uycTf.js +1 -0
- package/dist/components/p-C96R7OFb.js +1 -0
- package/dist/components/p-Ciz-pnTr.js +1 -0
- package/dist/components/p-CleacZFl.js +1 -0
- package/dist/dda/dda.css +2 -2
- package/dist/dda/dda.esm.js +1 -1
- package/dist/dda/p-0daa2a14.entry.js +1 -0
- package/dist/dda/p-1537b9dd.entry.js +1 -0
- package/dist/dda/p-175c52b8.entry.js +1 -0
- package/dist/dda/p-2b65a79a.entry.js +1 -0
- package/dist/dda/p-2d93b185.entry.js +1 -0
- package/dist/dda/p-30d3a014.entry.js +1 -0
- package/dist/dda/p-33b890a5.entry.js +1 -0
- package/dist/dda/p-64d90f29.entry.js +1 -0
- package/dist/dda/p-69bc04c1.entry.js +1 -0
- package/dist/dda/p-6daa282f.entry.js +1 -0
- package/dist/dda/p-72f22d1f.entry.js +1 -0
- package/dist/dda/p-7549868d.entry.js +1 -0
- package/dist/dda/p-7a51a946.entry.js +1 -0
- package/dist/dda/p-7b187e1f.entry.js +1 -0
- package/dist/dda/p-7b4d895e.entry.js +1 -0
- package/dist/dda/p-8f408141.entry.js +1 -0
- package/dist/dda/p-91341ca7.entry.js +1 -0
- package/dist/dda/p-9552def5.entry.js +1 -0
- package/dist/dda/p-9672af43.entry.js +1 -0
- package/dist/dda/p-98bba4dc.entry.js +1 -0
- package/dist/dda/p-B-I003EB.js +1 -0
- package/dist/dda/p-a0768b2f.entry.js +1 -0
- package/dist/dda/p-a5bd30ad.entry.js +1 -0
- package/dist/dda/p-a83f6267.entry.js +1 -0
- package/dist/dda/p-b17f79df.entry.js +1 -0
- package/dist/dda/p-b79505e1.entry.js +1 -0
- package/dist/dda/p-b8b98df2.entry.js +1 -0
- package/dist/dda/p-cc2cc09b.entry.js +1 -0
- package/dist/dda/p-ceee08fa.entry.js +1 -0
- package/dist/dda/p-d000e69d.entry.js +1 -0
- package/dist/dda/p-e3a65ceb.entry.js +1 -0
- package/dist/dda/p-e5b79469.entry.js +1 -0
- package/dist/dda/p-f2f3be5f.entry.js +1 -0
- package/dist/dda/p-f92e0a32.entry.js +1 -0
- package/dist/dda/p-o6021Dsk.js +2 -0
- package/dist/esm/dda-accordion.entry.js +12 -7
- package/dist/esm/dda-alert.entry.js +20 -3
- package/dist/esm/dda-attach-file.entry.js +24 -8
- package/dist/esm/dda-avatar.entry.js +23 -12
- package/dist/esm/dda-banner.entry.js +14 -5
- package/dist/esm/dda-breadcrumb.entry.js +22 -10
- package/dist/esm/dda-button.entry.js +16 -9
- package/dist/esm/dda-checkbox.entry.js +5 -4
- package/dist/esm/dda-chip.entry.js +8 -3
- package/dist/esm/dda-credit-card.entry.js +5 -3
- package/dist/esm/dda-creditcard-field.entry.js +26 -8
- package/dist/esm/dda-dropdown.entry.js +31 -5
- package/dist/esm/dda-footer.entry.js +9 -3
- package/dist/esm/dda-header.entry.js +80 -8
- package/dist/esm/dda-home-banner.entry.js +11 -5
- package/dist/esm/dda-horizontal-stepper.entry.js +22 -5
- package/dist/esm/dda-input.entry.js +17 -10
- package/dist/esm/dda-link-button_2.entry.js +21 -13
- package/dist/esm/dda-number-field.entry.js +20 -8
- package/dist/esm/dda-pagination.entry.js +21 -11
- package/dist/esm/dda-phonefield.entry.js +27 -9
- package/dist/esm/dda-progressbar.entry.js +8 -3
- package/dist/esm/dda-range-slider.entry.js +15 -3
- package/dist/esm/dda-search-input.entry.js +27 -12
- package/dist/esm/dda-segmented-tabs.entry.js +54 -6
- package/dist/esm/dda-select.entry.js +40 -8
- package/dist/esm/dda-sticky-footer.entry.js +20 -3
- package/dist/esm/dda-tabs.entry.js +10 -4
- package/dist/esm/dda-textarea.entry.js +22 -12
- package/dist/esm/dda-toggle.entry.js +5 -4
- package/dist/esm/dda-tooltip.entry.js +6 -4
- package/dist/esm/dda-ui-card.entry.js +19 -2
- package/dist/esm/dda-vertical-stepper.entry.js +23 -3
- package/dist/esm/dda.js +3 -3
- package/dist/esm/index-o6021Dsk.js +2106 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/unique-id-B-I003EB.js +12 -0
- package/dist/types/components/dda-accordion/dda-accordion.d.ts +6 -0
- package/dist/types/components/dda-alert/dda-alert.d.ts +21 -0
- package/dist/types/components/dda-attach-file/dda-attach-file.d.ts +17 -0
- package/dist/types/components/dda-attach-file/dda-attach-file.stories.d.ts +0 -4
- package/dist/types/components/dda-avatar/dda-avatar.d.ts +20 -0
- package/dist/types/components/dda-banner/dda-banner.d.ts +5 -0
- package/dist/types/components/dda-breadcrumb/dda-breadcrumb.d.ts +12 -6
- package/dist/types/components/dda-button/dda-button.d.ts +15 -4
- package/dist/types/components/dda-checkbox/dda-checkbox.d.ts +11 -0
- package/dist/types/components/dda-checkbox/dda-checkbox.stories.d.ts +0 -10
- package/dist/types/components/dda-chip/dda-chip.d.ts +10 -0
- package/dist/types/components/dda-chip/dda-chip.stories.d.ts +0 -6
- package/dist/types/components/dda-credit-card/dda-credit-card.d.ts +7 -0
- package/dist/types/components/dda-creditcard-field/dda-creditcard-field.d.ts +24 -0
- package/dist/types/components/dda-creditcard-field/dda-creditcard-field.stories.d.ts +0 -6
- package/dist/types/components/dda-dropdown/dda-dropdown.d.ts +25 -0
- package/dist/types/components/dda-dropdown/dda-dropdown.stories.d.ts +0 -4
- package/dist/types/components/dda-footer/dda-footer.d.ts +13 -0
- package/dist/types/components/dda-header/dda-header.d.ts +60 -0
- package/dist/types/components/dda-header/dda-header.stories.d.ts +6 -0
- package/dist/types/components/dda-home-banner/dda-home-banner.d.ts +1 -0
- package/dist/types/components/dda-input/dda-input.d.ts +16 -0
- package/dist/types/components/dda-input/dda-input.stories.d.ts +0 -6
- package/dist/types/components/dda-link-button/dda-link-button.d.ts +14 -3
- package/dist/types/components/dda-number-field/dda-number-field.d.ts +21 -0
- package/dist/types/components/dda-number-field/dda-number-field.stories.d.ts +0 -6
- package/dist/types/components/dda-pagination/dda-pagination.d.ts +26 -0
- package/dist/types/components/dda-phonefield/dda-phonefield.d.ts +21 -0
- package/dist/types/components/dda-phonefield/dda-phonefield.stories.d.ts +0 -6
- package/dist/types/components/dda-progressbar/dda-progressbar.d.ts +7 -0
- package/dist/types/components/dda-radiobutton/dda-radiobutton.d.ts +11 -0
- package/dist/types/components/dda-radiobutton/dda-radiobutton.stories.d.ts +5 -15
- package/dist/types/components/dda-range-slider/dda-range-slider.d.ts +16 -0
- package/dist/types/components/dda-search-input/dda-search-input.d.ts +21 -0
- package/dist/types/components/dda-search-input/dda-search-input.stories.d.ts +0 -6
- package/dist/types/components/dda-select/dda-select.d.ts +23 -0
- package/dist/types/components/dda-sticky-footer/dda-sticky-footer.d.ts +46 -3
- package/dist/types/components/dda-tabs/dda-tabs.d.ts +12 -1
- package/dist/types/components/dda-tabs/dda-tabs.stories.d.ts +0 -4
- package/dist/types/components/dda-textarea/dda-textarea.d.ts +16 -0
- package/dist/types/components/dda-textarea/dda-textarea.stories.d.ts +0 -6
- package/dist/types/components/dda-toggle/dda-toggle.d.ts +11 -0
- package/dist/types/components/dda-toggle/dda-toggle.stories.d.ts +2 -12
- package/dist/types/components/dda-tooltip/dda-tooltip.d.ts +5 -0
- package/dist/types/components/dda-ui-card/dda-ui-card.d.ts +13 -1
- package/dist/types/components/segmented-groups/dda-segmented-tabs/dda-segmented-tabs.d.ts +19 -2
- package/dist/types/components/stepper/dda-horizontal-stepper/dda-horizontal-stepper.d.ts +6 -0
- package/dist/types/components/stepper/dda-vertical-stepper/dda-vertical-stepper.d.ts +8 -0
- package/dist/types/components.d.ts +2373 -47
- package/dist/types/utils/placeholder-color.d.ts +10 -0
- package/dist/types/utils/unique-id.d.ts +6 -0
- package/package.json +4 -3
- package/readme.md +6 -0
- package/dist/cjs/index-CDUC0Pdj.js +0 -1986
- package/dist/components/p-9UeqjDnY.js +0 -1
- package/dist/components/p-CrTEb7xH.js +0 -1
- package/dist/components/p-DldlmGnP.js +0 -1
- package/dist/components/p-NvTw9Mx1.js +0 -1
- package/dist/components/p-i15-_er0.js +0 -1
- package/dist/dda/p-016e4090.entry.js +0 -1
- package/dist/dda/p-0229b303.entry.js +0 -1
- package/dist/dda/p-05a6f90d.entry.js +0 -1
- package/dist/dda/p-1c9a6035.entry.js +0 -1
- package/dist/dda/p-2c313105.entry.js +0 -1
- package/dist/dda/p-2cec7be6.entry.js +0 -1
- package/dist/dda/p-2f4ace4c.entry.js +0 -1
- package/dist/dda/p-360a0577.entry.js +0 -1
- package/dist/dda/p-3e49128d.entry.js +0 -1
- package/dist/dda/p-3fa27728.entry.js +0 -1
- package/dist/dda/p-43e1c12f.entry.js +0 -1
- package/dist/dda/p-4428417d.entry.js +0 -1
- package/dist/dda/p-44ce832e.entry.js +0 -1
- package/dist/dda/p-560a3f0c.entry.js +0 -1
- package/dist/dda/p-5712bbd9.entry.js +0 -1
- package/dist/dda/p-626d7e7b.entry.js +0 -1
- package/dist/dda/p-68008c64.entry.js +0 -1
- package/dist/dda/p-6f3d9f78.entry.js +0 -1
- package/dist/dda/p-79db1218.entry.js +0 -1
- package/dist/dda/p-84911fab.entry.js +0 -1
- package/dist/dda/p-90d9648b.entry.js +0 -1
- package/dist/dda/p-91040abe.entry.js +0 -1
- package/dist/dda/p-Cq6A4mXg.js +0 -2
- package/dist/dda/p-a1421a54.entry.js +0 -1
- package/dist/dda/p-a22b1c56.entry.js +0 -1
- package/dist/dda/p-aa0e9035.entry.js +0 -1
- package/dist/dda/p-b2981646.entry.js +0 -1
- package/dist/dda/p-c1f45887.entry.js +0 -1
- package/dist/dda/p-c50e1141.entry.js +0 -1
- package/dist/dda/p-d8a9cab1.entry.js +0 -1
- package/dist/dda/p-dd966009.entry.js +0 -1
- package/dist/dda/p-ed099201.entry.js +0 -1
- package/dist/dda/p-f4bd2b2e.entry.js +0 -1
- package/dist/dda/p-fc30c60e.entry.js +0 -1
- package/dist/esm/index-Cq6A4mXg.js +0 -1976
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
2
|
export class DdaCreditCard {
|
|
3
3
|
constructor() {
|
|
4
|
+
/** Extra CSS classes added to the card container. */
|
|
4
5
|
this.custom_class = '';
|
|
5
6
|
}
|
|
6
7
|
render() {
|
|
8
|
+
var _a;
|
|
7
9
|
const cardClass = [
|
|
8
10
|
'dda-credit-card-container',
|
|
9
11
|
this.design ? `dda-credit-card-${this.design}` : '',
|
|
10
12
|
this.custom_class ? `${this.custom_class}` : "",
|
|
11
13
|
this.component_mode,
|
|
12
14
|
].filter(Boolean).join(' ');
|
|
13
|
-
return (h(Host, { key: '
|
|
15
|
+
return (h(Host, { key: 'a2b51766a37e26931722154096371e0c6e4f613e' }, h("div", { key: '6a230b5a394819e020e6d602c24b190e10a0412b', class: cardClass }, h("div", { key: '0e736764ef1421aa4c74cfd2651f5b28b5923bfe', class: "dda-credit-card-header" }, h("div", { key: '3ca757d69ce6f3dccf6ed2a774f81af804701b4d', class: "card-balance-info" }, h("span", { key: 'f199cbddbde087a4e0019bc5f49d688aa91b332e', class: "card-balance-label" }, "Current Balance"), h("span", { key: 'e51769b4f7ac8013035074abec4677feb32b7ecb', class: "card-balance" }, this.balance)), h("i", { key: '64cac265fa7e397b4a48efeedc4fdd1bbe01463e', class: "material-icons material-symbols-outlined", "aria-hidden": "true" }, "wifi")), h("div", { key: '8c14cdf5cd7932395b3b99d76dc712418034944d', class: "dda-credit-card-body" }, h("div", { key: '3c040ff604757b252088df1db1949a0b6e856bf0', class: "card-userinfo" }, h("span", { key: '1427d499c577ffefad4ea29eb01ddff6fa248a28', class: "dda-card-name" }, this.name), h("span", { key: 'fa7bc5a8a59aa86766f1d974e4e4f0819f17e59c', class: "dda-card-number" }, "**** ", String((_a = this.card_number) !== null && _a !== void 0 ? _a : '').slice(-4))), h("div", { key: '4fddb8131ca26074f5ed74d1992e15b51d20f4b1' }, this.card_type && h("img", { key: '51ea45a24d2a8101eb357b8fba88449479f69bee', src: this.card_type, alt: "Card Type", class: "card-type-icon" }))))));
|
|
14
16
|
}
|
|
15
17
|
static get is() { return "dda-credit-card"; }
|
|
16
18
|
static get originalStyleUrls() {
|
|
@@ -37,7 +39,7 @@ export class DdaCreditCard {
|
|
|
37
39
|
"optional": false,
|
|
38
40
|
"docs": {
|
|
39
41
|
"tags": [],
|
|
40
|
-
"text": ""
|
|
42
|
+
"text": "Balance text shown under the fixed \"Current Balance\" label, e.g. `AED 5,750.20`."
|
|
41
43
|
},
|
|
42
44
|
"getter": false,
|
|
43
45
|
"setter": false,
|
|
@@ -56,7 +58,7 @@ export class DdaCreditCard {
|
|
|
56
58
|
"optional": false,
|
|
57
59
|
"docs": {
|
|
58
60
|
"tags": [],
|
|
59
|
-
"text": ""
|
|
61
|
+
"text": "Card holder name."
|
|
60
62
|
},
|
|
61
63
|
"getter": false,
|
|
62
64
|
"setter": false,
|
|
@@ -75,7 +77,7 @@ export class DdaCreditCard {
|
|
|
75
77
|
"optional": false,
|
|
76
78
|
"docs": {
|
|
77
79
|
"tags": [],
|
|
78
|
-
"text": ""
|
|
80
|
+
"text": "Card number. Only the last four characters are shown, after `****`. When not set, only `****` is shown."
|
|
79
81
|
},
|
|
80
82
|
"getter": false,
|
|
81
83
|
"setter": false,
|
|
@@ -94,7 +96,7 @@ export class DdaCreditCard {
|
|
|
94
96
|
"optional": false,
|
|
95
97
|
"docs": {
|
|
96
98
|
"tags": [],
|
|
97
|
-
"text": ""
|
|
99
|
+
"text": "URL of the card type image (e.g. a card brand logo) shown at the bottom end of the card. When not set, no image is rendered."
|
|
98
100
|
},
|
|
99
101
|
"getter": false,
|
|
100
102
|
"setter": false,
|
|
@@ -113,7 +115,7 @@ export class DdaCreditCard {
|
|
|
113
115
|
"optional": false,
|
|
114
116
|
"docs": {
|
|
115
117
|
"tags": [],
|
|
116
|
-
"text": ""
|
|
118
|
+
"text": "Background design: `default`, `green` or `dark`."
|
|
117
119
|
},
|
|
118
120
|
"getter": false,
|
|
119
121
|
"setter": false,
|
|
@@ -132,7 +134,7 @@ export class DdaCreditCard {
|
|
|
132
134
|
"optional": true,
|
|
133
135
|
"docs": {
|
|
134
136
|
"tags": [],
|
|
135
|
-
"text": ""
|
|
137
|
+
"text": "Extra CSS classes added to the card container."
|
|
136
138
|
},
|
|
137
139
|
"getter": false,
|
|
138
140
|
"setter": false,
|
|
@@ -152,7 +154,7 @@ export class DdaCreditCard {
|
|
|
152
154
|
"optional": true,
|
|
153
155
|
"docs": {
|
|
154
156
|
"tags": [],
|
|
155
|
-
"text": ""
|
|
157
|
+
"text": "Theme override class for the card, e.g. `light-mode`."
|
|
156
158
|
},
|
|
157
159
|
"getter": false,
|
|
158
160
|
"setter": false,
|
|
@@ -1,22 +1,34 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
|
+
import { uniqueId } from "../../utils/unique-id";
|
|
2
3
|
export class DdaCreditCardField {
|
|
3
4
|
constructor() {
|
|
5
|
+
/** Card number. Shown as groups of four digits separated by ` - `; the component updates it as the user types. Mutable: the component assigns it. */
|
|
4
6
|
this.value = '';
|
|
7
|
+
/** Disables the input and applies the disabled look. */
|
|
5
8
|
this.disabled = false;
|
|
9
|
+
/** Extra CSS classes added to the field container. */
|
|
6
10
|
this.custom_class = '';
|
|
11
|
+
/** Sets the input `maxlength`: 25 characters when `false` (16 digits with separators), 100 when `true`. */
|
|
7
12
|
this.restrict_input = false;
|
|
8
13
|
// F-018 (WCAG 1.3.5): card number is exactly the field type autocomplete
|
|
9
14
|
// exists for. Default to the correct token; still overridable.
|
|
15
|
+
/** `autocomplete` token of the input. Defaults to `cc-number`. */
|
|
10
16
|
this.autocomplete = 'cc-number';
|
|
11
17
|
this.formattedValue = '';
|
|
18
|
+
// Per-instance fallback, so the label, helper and error text stay linked
|
|
19
|
+
// to the input when the consumer omits input_id.
|
|
20
|
+
this.fallbackId = uniqueId('dda-creditcard-field');
|
|
21
|
+
}
|
|
22
|
+
// F-016: ids derived from the input id (the consumer-supplied input_id,
|
|
23
|
+
// or the generated fallback), same pattern as dda-input.
|
|
24
|
+
get inputId() {
|
|
25
|
+
return this.input_id || this.fallbackId;
|
|
12
26
|
}
|
|
13
|
-
// F-016: ids derived from the consumer-supplied input_id, same pattern as
|
|
14
|
-
// dda-input/dda-select.
|
|
15
27
|
get helperId() {
|
|
16
|
-
return
|
|
28
|
+
return `${this.inputId}-helper`;
|
|
17
29
|
}
|
|
18
30
|
get errorId() {
|
|
19
|
-
return
|
|
31
|
+
return `${this.inputId}-error`;
|
|
20
32
|
}
|
|
21
33
|
get describedBy() {
|
|
22
34
|
const ids = [
|
|
@@ -30,9 +42,13 @@ export class DdaCreditCardField {
|
|
|
30
42
|
const inputValue = inputElement.value.replace(/[^0-9-]/g, '');
|
|
31
43
|
const maxLength = this.restrict_input ? 100 : 25;
|
|
32
44
|
if (inputValue.length <= maxLength) {
|
|
45
|
+
const changed = inputValue !== this.value;
|
|
33
46
|
this.value = inputValue;
|
|
34
47
|
this.formatCardNumber(this.value);
|
|
35
48
|
inputElement.value = this.formattedValue;
|
|
49
|
+
if (changed) {
|
|
50
|
+
this.valueChange.emit({ value: this.value });
|
|
51
|
+
}
|
|
36
52
|
}
|
|
37
53
|
else {
|
|
38
54
|
inputElement.value = this.formattedValue;
|
|
@@ -62,7 +78,8 @@ export class DdaCreditCardField {
|
|
|
62
78
|
this.custom_class ? `${this.custom_class}` : '',
|
|
63
79
|
this.component_mode,
|
|
64
80
|
].filter(Boolean).join(' ');
|
|
65
|
-
|
|
81
|
+
const id = this.inputId;
|
|
82
|
+
return (h(Host, { key: '49503120129a4036ea69ad5427873e7c80689472' }, h("div", { key: 'c4bbd736f977b8fbd780ca9f51f18577f957d449', class: inputClass }, this.label && h("label", { key: '718fec1b47645d3733602fbab31cda9f09e29b9c', htmlFor: id, class: "dda-input-label" }, this.label), h("div", { key: 'cb96d9ca72d92fb1cae781b7fc5033fbba82fa4d', class: "dda-input-field-wrapper" }, this.card_icon && h("img", { key: 'fa10e97d30a0c97245005fc66dbe81640653e2fd', src: this.card_icon, alt: "Card Icon", class: "dda-creditcard-icon" }), h("input", { key: 'c4b042e4ead4b79e1e63f00777a9f62a8f3964a6', "aria-label": this.aria_label, id: id, name: this.input_name, type: "text", inputmode: "numeric", autocomplete: this.autocomplete, placeholder: this.placeholder, value: this.formattedValue, onInput: (event) => this.handleInput(event), class: "dda-input-field", disabled: this.disabled, maxlength: this.restrict_input ? 100 : 25, "aria-describedby": this.describedBy, "aria-invalid": this.error_message ? 'true' : undefined })), this.helper_text && h("span", { key: '6021061f65edff9a4eb040285ea76147c81072f7', id: this.helperId, class: "dda-helper-text" }, this.helper_text), this.error_message && h("span", { key: '32a5d2c0e72e1ec62c9c6ce89d7fc950ab77505e', id: this.errorId, class: "dda-error-message" }, this.error_message))));
|
|
66
83
|
}
|
|
67
84
|
static get is() { return "dda-creditcard-field"; }
|
|
68
85
|
static get originalStyleUrls() {
|
|
@@ -89,7 +106,7 @@ export class DdaCreditCardField {
|
|
|
89
106
|
"optional": false,
|
|
90
107
|
"docs": {
|
|
91
108
|
"tags": [],
|
|
92
|
-
"text": ""
|
|
109
|
+
"text": "Placeholder text of the input, e.g. `0000 - 0000 - 0000 - 0000`."
|
|
93
110
|
},
|
|
94
111
|
"getter": false,
|
|
95
112
|
"setter": false,
|
|
@@ -108,7 +125,7 @@ export class DdaCreditCardField {
|
|
|
108
125
|
"optional": false,
|
|
109
126
|
"docs": {
|
|
110
127
|
"tags": [],
|
|
111
|
-
"text": ""
|
|
128
|
+
"text": "Label text shown above the input. Linked to the input through `input_id` (or a generated id)."
|
|
112
129
|
},
|
|
113
130
|
"getter": false,
|
|
114
131
|
"setter": false,
|
|
@@ -117,7 +134,7 @@ export class DdaCreditCardField {
|
|
|
117
134
|
},
|
|
118
135
|
"value": {
|
|
119
136
|
"type": "string",
|
|
120
|
-
"mutable":
|
|
137
|
+
"mutable": true,
|
|
121
138
|
"complexType": {
|
|
122
139
|
"original": "string",
|
|
123
140
|
"resolved": "string",
|
|
@@ -127,7 +144,7 @@ export class DdaCreditCardField {
|
|
|
127
144
|
"optional": false,
|
|
128
145
|
"docs": {
|
|
129
146
|
"tags": [],
|
|
130
|
-
"text": ""
|
|
147
|
+
"text": "Card number. Shown as groups of four digits separated by ` - `; the component updates it as the user types. Mutable: the component assigns it."
|
|
131
148
|
},
|
|
132
149
|
"getter": false,
|
|
133
150
|
"setter": false,
|
|
@@ -147,7 +164,7 @@ export class DdaCreditCardField {
|
|
|
147
164
|
"optional": false,
|
|
148
165
|
"docs": {
|
|
149
166
|
"tags": [],
|
|
150
|
-
"text": ""
|
|
167
|
+
"text": "URL of an image shown at the start of the input, e.g. a card brand logo."
|
|
151
168
|
},
|
|
152
169
|
"getter": false,
|
|
153
170
|
"setter": false,
|
|
@@ -166,7 +183,7 @@ export class DdaCreditCardField {
|
|
|
166
183
|
"optional": false,
|
|
167
184
|
"docs": {
|
|
168
185
|
"tags": [],
|
|
169
|
-
"text": ""
|
|
186
|
+
"text": "Error text shown below the input. Also sets `aria-invalid=\"true\"` on the input."
|
|
170
187
|
},
|
|
171
188
|
"getter": false,
|
|
172
189
|
"setter": false,
|
|
@@ -185,7 +202,7 @@ export class DdaCreditCardField {
|
|
|
185
202
|
"optional": true,
|
|
186
203
|
"docs": {
|
|
187
204
|
"tags": [],
|
|
188
|
-
"text": ""
|
|
205
|
+
"text": "Validation state: `error` applies the error colors."
|
|
189
206
|
},
|
|
190
207
|
"getter": false,
|
|
191
208
|
"setter": false,
|
|
@@ -204,7 +221,7 @@ export class DdaCreditCardField {
|
|
|
204
221
|
"optional": true,
|
|
205
222
|
"docs": {
|
|
206
223
|
"tags": [],
|
|
207
|
-
"text": ""
|
|
224
|
+
"text": "Size: `default` or `small`."
|
|
208
225
|
},
|
|
209
226
|
"getter": false,
|
|
210
227
|
"setter": false,
|
|
@@ -223,7 +240,7 @@ export class DdaCreditCardField {
|
|
|
223
240
|
"optional": true,
|
|
224
241
|
"docs": {
|
|
225
242
|
"tags": [],
|
|
226
|
-
"text": ""
|
|
243
|
+
"text": "Adds the class `dda-input-<value>`. `disabled` gives only the disabled look; use `disabled` to disable the input."
|
|
227
244
|
},
|
|
228
245
|
"getter": false,
|
|
229
246
|
"setter": false,
|
|
@@ -242,7 +259,7 @@ export class DdaCreditCardField {
|
|
|
242
259
|
"optional": false,
|
|
243
260
|
"docs": {
|
|
244
261
|
"tags": [],
|
|
245
|
-
"text": ""
|
|
262
|
+
"text": "Helper text shown below the input. Linked by `aria-describedby`."
|
|
246
263
|
},
|
|
247
264
|
"getter": false,
|
|
248
265
|
"setter": false,
|
|
@@ -261,7 +278,7 @@ export class DdaCreditCardField {
|
|
|
261
278
|
"optional": false,
|
|
262
279
|
"docs": {
|
|
263
280
|
"tags": [],
|
|
264
|
-
"text": ""
|
|
281
|
+
"text": "Disables the input and applies the disabled look."
|
|
265
282
|
},
|
|
266
283
|
"getter": false,
|
|
267
284
|
"setter": false,
|
|
@@ -281,7 +298,7 @@ export class DdaCreditCardField {
|
|
|
281
298
|
"optional": true,
|
|
282
299
|
"docs": {
|
|
283
300
|
"tags": [],
|
|
284
|
-
"text": ""
|
|
301
|
+
"text": "Extra CSS classes added to the field container."
|
|
285
302
|
},
|
|
286
303
|
"getter": false,
|
|
287
304
|
"setter": false,
|
|
@@ -301,7 +318,7 @@ export class DdaCreditCardField {
|
|
|
301
318
|
"optional": false,
|
|
302
319
|
"docs": {
|
|
303
320
|
"tags": [],
|
|
304
|
-
"text": ""
|
|
321
|
+
"text": "Sets the input `maxlength`: 25 characters when `false` (16 digits with separators), 100 when `true`."
|
|
305
322
|
},
|
|
306
323
|
"getter": false,
|
|
307
324
|
"setter": false,
|
|
@@ -321,7 +338,7 @@ export class DdaCreditCardField {
|
|
|
321
338
|
"optional": true,
|
|
322
339
|
"docs": {
|
|
323
340
|
"tags": [],
|
|
324
|
-
"text": ""
|
|
341
|
+
"text": "Theme override class for the field, e.g. `light-mode`."
|
|
325
342
|
},
|
|
326
343
|
"getter": false,
|
|
327
344
|
"setter": false,
|
|
@@ -340,7 +357,7 @@ export class DdaCreditCardField {
|
|
|
340
357
|
"optional": false,
|
|
341
358
|
"docs": {
|
|
342
359
|
"tags": [],
|
|
343
|
-
"text": ""
|
|
360
|
+
"text": "`id` of the inner `<input>`. Also used to link the label, helper text and error message. Optional: an id is generated when it is not set."
|
|
344
361
|
},
|
|
345
362
|
"getter": false,
|
|
346
363
|
"setter": false,
|
|
@@ -359,7 +376,7 @@ export class DdaCreditCardField {
|
|
|
359
376
|
"optional": true,
|
|
360
377
|
"docs": {
|
|
361
378
|
"tags": [],
|
|
362
|
-
"text": ""
|
|
379
|
+
"text": "Accessible name of the input. Use it when there is no visible `label`."
|
|
363
380
|
},
|
|
364
381
|
"getter": false,
|
|
365
382
|
"setter": false,
|
|
@@ -378,7 +395,7 @@ export class DdaCreditCardField {
|
|
|
378
395
|
"optional": true,
|
|
379
396
|
"docs": {
|
|
380
397
|
"tags": [],
|
|
381
|
-
"text": ""
|
|
398
|
+
"text": "`name` of the inner `<input>`, submitted with its form."
|
|
382
399
|
},
|
|
383
400
|
"getter": false,
|
|
384
401
|
"setter": false,
|
|
@@ -397,7 +414,7 @@ export class DdaCreditCardField {
|
|
|
397
414
|
"optional": false,
|
|
398
415
|
"docs": {
|
|
399
416
|
"tags": [],
|
|
400
|
-
"text": ""
|
|
417
|
+
"text": "`autocomplete` token of the input. Defaults to `cc-number`."
|
|
401
418
|
},
|
|
402
419
|
"getter": false,
|
|
403
420
|
"setter": false,
|
|
@@ -412,4 +429,22 @@ export class DdaCreditCardField {
|
|
|
412
429
|
"formattedValue": {}
|
|
413
430
|
};
|
|
414
431
|
}
|
|
432
|
+
static get events() {
|
|
433
|
+
return [{
|
|
434
|
+
"method": "valueChange",
|
|
435
|
+
"name": "valueChange",
|
|
436
|
+
"bubbles": true,
|
|
437
|
+
"cancelable": true,
|
|
438
|
+
"composed": true,
|
|
439
|
+
"docs": {
|
|
440
|
+
"tags": [],
|
|
441
|
+
"text": "Emitted when user input changes `value`, after the component removes characters other than digits and `-`. `detail.value` is the new `value`."
|
|
442
|
+
},
|
|
443
|
+
"complexType": {
|
|
444
|
+
"original": "{ value: string }",
|
|
445
|
+
"resolved": "{ value: string; }",
|
|
446
|
+
"references": {}
|
|
447
|
+
}
|
|
448
|
+
}];
|
|
449
|
+
}
|
|
415
450
|
}
|
|
@@ -12,7 +12,7 @@ export default {
|
|
|
12
12
|
},
|
|
13
13
|
restrict_input: {
|
|
14
14
|
control: 'boolean',
|
|
15
|
-
description: '
|
|
15
|
+
description: 'Sets maxlength to 100 characters instead of 25',
|
|
16
16
|
},
|
|
17
17
|
value: {
|
|
18
18
|
control: 'text',
|
|
@@ -66,10 +66,6 @@ export default {
|
|
|
66
66
|
control: { type: 'text' },
|
|
67
67
|
description: 'Accessible label for the credit card field',
|
|
68
68
|
},
|
|
69
|
-
onchange: {
|
|
70
|
-
control: { type: 'text' },
|
|
71
|
-
description: 'onchange event for the credit card field',
|
|
72
|
-
},
|
|
73
69
|
input_name: {
|
|
74
70
|
control: { type: 'text' },
|
|
75
71
|
description: 'Name of the input field',
|
|
@@ -100,7 +96,6 @@ export default {
|
|
|
100
96
|
component_mode=""
|
|
101
97
|
input_id="input"
|
|
102
98
|
aria_label="credit-card-field"
|
|
103
|
-
onchange="console.log('changed')"
|
|
104
99
|
input_name="input"
|
|
105
100
|
autocomplete="cc-number"
|
|
106
101
|
></dda-creditcard-field>
|
|
@@ -132,7 +127,6 @@ Default.args = {
|
|
|
132
127
|
component_mode: '',
|
|
133
128
|
input_id: 'input',
|
|
134
129
|
aria_label: 'credit-card-field',
|
|
135
|
-
onchange: '',
|
|
136
130
|
input_name: 'input',
|
|
137
131
|
autocomplete: 'cc-number',
|
|
138
132
|
};
|
|
@@ -151,7 +145,6 @@ SmallSize.args = {
|
|
|
151
145
|
component_mode: '',
|
|
152
146
|
input_id: 'input',
|
|
153
147
|
aria_label: 'credit-card-field',
|
|
154
|
-
onchange: '',
|
|
155
148
|
input_name: 'input',
|
|
156
149
|
autocomplete: 'cc-number',
|
|
157
150
|
};
|
|
@@ -170,7 +163,6 @@ WithErrorMessage.args = {
|
|
|
170
163
|
component_mode: '',
|
|
171
164
|
input_id: 'input',
|
|
172
165
|
aria_label: 'credit-card-field',
|
|
173
|
-
onchange: '',
|
|
174
166
|
input_name: 'input',
|
|
175
167
|
autocomplete: 'cc-number',
|
|
176
168
|
};
|
|
@@ -190,7 +182,6 @@ Disabled.args = {
|
|
|
190
182
|
component_mode: '',
|
|
191
183
|
input_id: 'input',
|
|
192
184
|
aria_label: 'credit-card-field',
|
|
193
|
-
onchange: '',
|
|
194
185
|
input_name: 'input',
|
|
195
186
|
autocomplete: 'cc-number',
|
|
196
187
|
};
|
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
|
+
import { uniqueId } from "../../utils/unique-id";
|
|
2
3
|
export class DdaDropdown {
|
|
3
4
|
constructor() {
|
|
5
|
+
/** Disables the dropdown: the list does not open and options cannot be picked. */
|
|
4
6
|
this.disabled = false;
|
|
7
|
+
/** Button background: `bg-white` (field style) or `bg-transparent` (no border, background or padding). */
|
|
5
8
|
this.type = 'bg-white';
|
|
9
|
+
/** Size: `medium` or `small`. */
|
|
6
10
|
this.size = 'medium';
|
|
7
|
-
|
|
11
|
+
/** Shows only the three-dots icon, without the selected text and arrow. */
|
|
12
|
+
this.icon_mode = false;
|
|
13
|
+
/** Extra CSS classes added to the dropdown container. */
|
|
8
14
|
this.custom_class = '';
|
|
15
|
+
/** Accessible name of the dropdown button in `icon_mode` when `aria_label` and `label` are not set. */
|
|
16
|
+
this.toggle_button_label = 'Show options';
|
|
9
17
|
this.isopen = false;
|
|
18
|
+
// Fallback id so the label is wired when no button_id is passed.
|
|
19
|
+
this.fallbackId = uniqueId('dda-dropdown');
|
|
10
20
|
}
|
|
11
21
|
get parsedOptions() {
|
|
12
22
|
try {
|
|
@@ -21,13 +31,28 @@ export class DdaDropdown {
|
|
|
21
31
|
this.isopen = !this.isopen;
|
|
22
32
|
}
|
|
23
33
|
}
|
|
34
|
+
// The label has no `for`: label[for] on a <button> replaces the button text
|
|
35
|
+
// as its name, so the selected option was not announced. A click on the
|
|
36
|
+
// label still acts on the button, like a native label click did.
|
|
37
|
+
onHostClick(event) {
|
|
38
|
+
var _a;
|
|
39
|
+
const target = event.target;
|
|
40
|
+
if (!target || typeof target.closest !== 'function' || !target.closest('label.dda-input-label')) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
(_a = this.buttonEl) === null || _a === void 0 ? void 0 : _a.focus();
|
|
44
|
+
this.toggleDropdown();
|
|
45
|
+
}
|
|
24
46
|
selectOption(option) {
|
|
25
47
|
if (!this.disabled) {
|
|
26
48
|
this.selected = option;
|
|
27
49
|
this.isopen = false;
|
|
50
|
+
this.optionSelect.emit({ value: option });
|
|
28
51
|
}
|
|
29
52
|
}
|
|
30
53
|
render() {
|
|
54
|
+
const id = this.button_id || this.fallbackId;
|
|
55
|
+
const labelId = `${id}-label`;
|
|
31
56
|
const containerClass = [
|
|
32
57
|
'dda-input-container dda-inline-flex',
|
|
33
58
|
this.disabled ? 'dda-input-disabled' : '',
|
|
@@ -35,7 +60,7 @@ export class DdaDropdown {
|
|
|
35
60
|
this.custom_class ? `${this.custom_class}` : '',
|
|
36
61
|
this.component_mode,
|
|
37
62
|
].filter(Boolean).join(' ');
|
|
38
|
-
return (h(Host, { key: '
|
|
63
|
+
return (h(Host, { key: '8b053569398521717cd7b5fecfc20da86ddc36e2' }, h("div", { key: 'f05077b9937e415212e3ca95272284f4f43a2f4e', class: containerClass }, this.label && h("label", { key: '5d7a1d12cece57a300deb5ee40ac42fe30991e05', id: labelId, class: "dda-input-label" }, this.label), h("div", { key: 'dec4834ffda3aaf39799640c2e3403ad2bbde804', class: `dda-dropdown-container ${this.type}` }, h("button", { key: '74cdd5264b2ba9e149b002ef9f32761d4657dffe', ref: el => (this.buttonEl = el), id: id, name: this.arrow_button_name, "aria-label": this.aria_label || (this.icon_mode && !this.label ? this.toggle_button_label : undefined), "aria-labelledby": this.label && !this.aria_label ? `${labelId} ${id}` : undefined, "aria-expanded": this.isopen ? 'true' : 'false', type: "button", class: "dda-input-field dda-dropdown-header", onClick: () => this.toggleDropdown() }, h("i", { key: '114ea6a6e36e3f10fb2eb170a0869c659be91fcc', class: `three-dots material-icons`, "aria-hidden": "true" }, this.isopen ? 'more_vert' : 'more_vert'), !this.icon_mode && h("span", { key: '38daede9e618b1f3cf3b04e73799f5ba94f2aabe', class: "dda-dropdown-text" }, h("span", { key: 'd8e2f92b77bfd9611b56322123c22282051d6744' }, this.selected || 'Select an option'), " ", h("i", { key: '11ce919e89fbbe0bbcc5df8124d40ffa683e9520', class: `material-icons`, "aria-hidden": "true" }, this.isopen ? 'keyboard_arrow_up' : 'keyboard_arrow_down'))), this.isopen && (h("div", { key: 'e1ab0eb1476986e8964eea8469d367b9f607f737', class: "dda-input-dropdown-list" }, this.parsedOptions.length > 0 ? (this.parsedOptions.map(option => (h("button", { type: "button", name: this.dropdown_button_name, class: `dda-input-dropdown-item ${this.selected === option ? 'selected' : ''}`, onClick: () => { this.selectOption(option); } }, option)))) : (h("div", { class: "dda-input-dropdown-item" }, "No options available"))))), this.helper_text && h("span", { key: '8d8f98cd697819f29bebc593167ef47c4e5eed33', class: "dda-helper-text" }, this.helper_text), this.error && h("span", { key: '4c129c5b219115796263afe4daf726ea9b77ee04', class: "dda-error-message" }, this.error))));
|
|
39
64
|
}
|
|
40
65
|
static get is() { return "dda-dropdown"; }
|
|
41
66
|
static get originalStyleUrls() {
|
|
@@ -62,7 +87,7 @@ export class DdaDropdown {
|
|
|
62
87
|
"optional": false,
|
|
63
88
|
"docs": {
|
|
64
89
|
"tags": [],
|
|
65
|
-
"text": ""
|
|
90
|
+
"text": "Label shown above the dropdown. The dropdown button is named by the label and its current text."
|
|
66
91
|
},
|
|
67
92
|
"getter": false,
|
|
68
93
|
"setter": false,
|
|
@@ -81,7 +106,7 @@ export class DdaDropdown {
|
|
|
81
106
|
"optional": false,
|
|
82
107
|
"docs": {
|
|
83
108
|
"tags": [],
|
|
84
|
-
"text": ""
|
|
109
|
+
"text": "Options as a JSON array string, e.g. `'[\"Edit\",\"Download\",\"Delete\"]'`. Invalid JSON shows \"No options available\"."
|
|
85
110
|
},
|
|
86
111
|
"getter": false,
|
|
87
112
|
"setter": false,
|
|
@@ -90,7 +115,7 @@ export class DdaDropdown {
|
|
|
90
115
|
},
|
|
91
116
|
"selected": {
|
|
92
117
|
"type": "string",
|
|
93
|
-
"mutable":
|
|
118
|
+
"mutable": true,
|
|
94
119
|
"complexType": {
|
|
95
120
|
"original": "string",
|
|
96
121
|
"resolved": "string",
|
|
@@ -100,7 +125,7 @@ export class DdaDropdown {
|
|
|
100
125
|
"optional": false,
|
|
101
126
|
"docs": {
|
|
102
127
|
"tags": [],
|
|
103
|
-
"text": ""
|
|
128
|
+
"text": "The selected option. Must match an entry in `options`. The button shows \"Select an option\" when it is empty. Updated when the user picks an option. Mutable: the component assigns it."
|
|
104
129
|
},
|
|
105
130
|
"getter": false,
|
|
106
131
|
"setter": false,
|
|
@@ -119,7 +144,7 @@ export class DdaDropdown {
|
|
|
119
144
|
"optional": false,
|
|
120
145
|
"docs": {
|
|
121
146
|
"tags": [],
|
|
122
|
-
"text": ""
|
|
147
|
+
"text": "Disables the dropdown: the list does not open and options cannot be picked."
|
|
123
148
|
},
|
|
124
149
|
"getter": false,
|
|
125
150
|
"setter": false,
|
|
@@ -139,7 +164,7 @@ export class DdaDropdown {
|
|
|
139
164
|
"optional": false,
|
|
140
165
|
"docs": {
|
|
141
166
|
"tags": [],
|
|
142
|
-
"text": ""
|
|
167
|
+
"text": "Error text shown under the dropdown."
|
|
143
168
|
},
|
|
144
169
|
"getter": false,
|
|
145
170
|
"setter": false,
|
|
@@ -158,7 +183,7 @@ export class DdaDropdown {
|
|
|
158
183
|
"optional": false,
|
|
159
184
|
"docs": {
|
|
160
185
|
"tags": [],
|
|
161
|
-
"text": ""
|
|
186
|
+
"text": "Helper text shown under the dropdown."
|
|
162
187
|
},
|
|
163
188
|
"getter": false,
|
|
164
189
|
"setter": false,
|
|
@@ -177,7 +202,7 @@ export class DdaDropdown {
|
|
|
177
202
|
"optional": false,
|
|
178
203
|
"docs": {
|
|
179
204
|
"tags": [],
|
|
180
|
-
"text": ""
|
|
205
|
+
"text": "Button background: `bg-white` (field style) or `bg-transparent` (no border, background or padding)."
|
|
181
206
|
},
|
|
182
207
|
"getter": false,
|
|
183
208
|
"setter": false,
|
|
@@ -197,7 +222,7 @@ export class DdaDropdown {
|
|
|
197
222
|
"optional": false,
|
|
198
223
|
"docs": {
|
|
199
224
|
"tags": [],
|
|
200
|
-
"text": ""
|
|
225
|
+
"text": "Size: `medium` or `small`."
|
|
201
226
|
},
|
|
202
227
|
"getter": false,
|
|
203
228
|
"setter": false,
|
|
@@ -217,7 +242,7 @@ export class DdaDropdown {
|
|
|
217
242
|
"optional": false,
|
|
218
243
|
"docs": {
|
|
219
244
|
"tags": [],
|
|
220
|
-
"text": ""
|
|
245
|
+
"text": "Shows only the three-dots icon, without the selected text and arrow."
|
|
221
246
|
},
|
|
222
247
|
"getter": false,
|
|
223
248
|
"setter": false,
|
|
@@ -237,7 +262,7 @@ export class DdaDropdown {
|
|
|
237
262
|
"optional": true,
|
|
238
263
|
"docs": {
|
|
239
264
|
"tags": [],
|
|
240
|
-
"text": ""
|
|
265
|
+
"text": "Extra CSS classes added to the dropdown container."
|
|
241
266
|
},
|
|
242
267
|
"getter": false,
|
|
243
268
|
"setter": false,
|
|
@@ -257,7 +282,7 @@ export class DdaDropdown {
|
|
|
257
282
|
"optional": true,
|
|
258
283
|
"docs": {
|
|
259
284
|
"tags": [],
|
|
260
|
-
"text": ""
|
|
285
|
+
"text": "Theme override class for the dropdown, e.g. `light-mode`."
|
|
261
286
|
},
|
|
262
287
|
"getter": false,
|
|
263
288
|
"setter": false,
|
|
@@ -276,7 +301,7 @@ export class DdaDropdown {
|
|
|
276
301
|
"optional": false,
|
|
277
302
|
"docs": {
|
|
278
303
|
"tags": [],
|
|
279
|
-
"text": ""
|
|
304
|
+
"text": "`id` of the dropdown button. The label id is built from it. When it is not set, the component generates a unique id."
|
|
280
305
|
},
|
|
281
306
|
"getter": false,
|
|
282
307
|
"setter": false,
|
|
@@ -295,7 +320,7 @@ export class DdaDropdown {
|
|
|
295
320
|
"optional": true,
|
|
296
321
|
"docs": {
|
|
297
322
|
"tags": [],
|
|
298
|
-
"text": ""
|
|
323
|
+
"text": "Accessible name of the dropdown button. Set it when `icon_mode` is on."
|
|
299
324
|
},
|
|
300
325
|
"getter": false,
|
|
301
326
|
"setter": false,
|
|
@@ -314,7 +339,7 @@ export class DdaDropdown {
|
|
|
314
339
|
"optional": true,
|
|
315
340
|
"docs": {
|
|
316
341
|
"tags": [],
|
|
317
|
-
"text": ""
|
|
342
|
+
"text": "`name` of the dropdown button that opens the list."
|
|
318
343
|
},
|
|
319
344
|
"getter": false,
|
|
320
345
|
"setter": false,
|
|
@@ -333,12 +358,32 @@ export class DdaDropdown {
|
|
|
333
358
|
"optional": true,
|
|
334
359
|
"docs": {
|
|
335
360
|
"tags": [],
|
|
336
|
-
"text": ""
|
|
361
|
+
"text": "`name` of each option button in the list."
|
|
337
362
|
},
|
|
338
363
|
"getter": false,
|
|
339
364
|
"setter": false,
|
|
340
365
|
"reflect": false,
|
|
341
366
|
"attribute": "dropdown_button_name"
|
|
367
|
+
},
|
|
368
|
+
"toggle_button_label": {
|
|
369
|
+
"type": "string",
|
|
370
|
+
"mutable": false,
|
|
371
|
+
"complexType": {
|
|
372
|
+
"original": "string",
|
|
373
|
+
"resolved": "string",
|
|
374
|
+
"references": {}
|
|
375
|
+
},
|
|
376
|
+
"required": false,
|
|
377
|
+
"optional": true,
|
|
378
|
+
"docs": {
|
|
379
|
+
"tags": [],
|
|
380
|
+
"text": "Accessible name of the dropdown button in `icon_mode` when `aria_label` and `label` are not set."
|
|
381
|
+
},
|
|
382
|
+
"getter": false,
|
|
383
|
+
"setter": false,
|
|
384
|
+
"reflect": false,
|
|
385
|
+
"attribute": "toggle_button_label",
|
|
386
|
+
"defaultValue": "'Show options'"
|
|
342
387
|
}
|
|
343
388
|
};
|
|
344
389
|
}
|
|
@@ -347,4 +392,31 @@ export class DdaDropdown {
|
|
|
347
392
|
"isopen": {}
|
|
348
393
|
};
|
|
349
394
|
}
|
|
395
|
+
static get events() {
|
|
396
|
+
return [{
|
|
397
|
+
"method": "optionSelect",
|
|
398
|
+
"name": "optionSelect",
|
|
399
|
+
"bubbles": true,
|
|
400
|
+
"cancelable": true,
|
|
401
|
+
"composed": true,
|
|
402
|
+
"docs": {
|
|
403
|
+
"tags": [],
|
|
404
|
+
"text": "Emitted every time the user picks an option, also when it is already selected, so the dropdown works as an action menu. `detail.value` is the option."
|
|
405
|
+
},
|
|
406
|
+
"complexType": {
|
|
407
|
+
"original": "{ value: string }",
|
|
408
|
+
"resolved": "{ value: string; }",
|
|
409
|
+
"references": {}
|
|
410
|
+
}
|
|
411
|
+
}];
|
|
412
|
+
}
|
|
413
|
+
static get listeners() {
|
|
414
|
+
return [{
|
|
415
|
+
"name": "click",
|
|
416
|
+
"method": "onHostClick",
|
|
417
|
+
"target": undefined,
|
|
418
|
+
"capture": false,
|
|
419
|
+
"passive": false
|
|
420
|
+
}];
|
|
421
|
+
}
|
|
350
422
|
}
|