@dubai-design-system/components-js 5.0.3 → 5.1.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 +233 -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 +88 -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-Bgd2iAET.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 +232 -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 +23 -2
- package/dist/collection/components/dda-input/dda-input.js +47 -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 +156 -25
- 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 +152 -25
- 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-Bc2V1U4_.js +1 -0
- package/dist/components/p-Bzqf-PpF.js +1 -0
- package/dist/components/p-D-CHT-as.js +1 -0
- package/dist/components/p-DJw8qV7U.js +1 -0
- package/dist/components/p-DpwQ9sGp.js +1 -0
- package/dist/dda/dda.css +2 -2
- package/dist/dda/dda.esm.js +1 -1
- package/dist/dda/p-03400387.entry.js +1 -0
- package/dist/dda/p-04bcda8a.entry.js +1 -0
- package/dist/dda/p-18a3d7b1.entry.js +1 -0
- package/dist/dda/p-1f7b8486.entry.js +1 -0
- package/dist/dda/p-3024288f.entry.js +1 -0
- package/dist/dda/p-41b8ed7d.entry.js +1 -0
- package/dist/dda/p-56f60336.entry.js +1 -0
- package/dist/dda/p-65776d80.entry.js +1 -0
- package/dist/dda/p-73611084.entry.js +1 -0
- package/dist/dda/p-7ad8cde9.entry.js +1 -0
- package/dist/dda/p-8134e59d.entry.js +1 -0
- package/dist/dda/p-8494fd9e.entry.js +1 -0
- package/dist/dda/p-876d55b2.entry.js +1 -0
- package/dist/dda/p-88d884a8.entry.js +1 -0
- package/dist/dda/p-8b25ae94.entry.js +1 -0
- package/dist/dda/p-8f376986.entry.js +1 -0
- package/dist/dda/p-90019b80.entry.js +1 -0
- package/dist/dda/p-92fa4777.entry.js +1 -0
- package/dist/dda/p-97431faf.entry.js +1 -0
- package/dist/dda/p-B-I003EB.js +1 -0
- package/dist/dda/p-D6L6zgH9.js +2 -0
- package/dist/dda/p-a5456de2.entry.js +1 -0
- package/dist/dda/p-aa7b4c13.entry.js +1 -0
- package/dist/dda/p-ad40eb27.entry.js +1 -0
- package/dist/dda/p-c055f0d2.entry.js +1 -0
- package/dist/dda/p-c42c8733.entry.js +1 -0
- package/dist/dda/p-c77282be.entry.js +1 -0
- package/dist/dda/p-ca64abe6.entry.js +1 -0
- package/dist/dda/p-ceca8088.entry.js +1 -0
- package/dist/dda/p-d6786b43.entry.js +1 -0
- package/dist/dda/p-e2113e42.entry.js +1 -0
- package/dist/dda/p-ee862207.entry.js +1 -0
- package/dist/dda/p-ef38e28b.entry.js +1 -0
- package/dist/dda/p-f43fb910.entry.js +1 -0
- package/dist/dda/p-fb4db977.entry.js +1 -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 +88 -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-D6L6zgH9.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 +62 -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 +18 -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 -38
- 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,10 +1,18 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
|
+
import { uniqueId } from "../../utils/unique-id";
|
|
2
3
|
export class DdaNumberField {
|
|
3
4
|
constructor() {
|
|
5
|
+
/** Currency shown on the dropdown button. Updates when the user picks a currency. */
|
|
4
6
|
this.selected_currency = 'USD';
|
|
5
7
|
this.is_focused = false;
|
|
8
|
+
/** Extra CSS classes added to the field container. */
|
|
6
9
|
this.custom_class = '';
|
|
10
|
+
/** Accessible name of the currency dropdown button; the selected currency is added after it. */
|
|
11
|
+
this.toggle_button_label = 'Choose currency';
|
|
7
12
|
this.isCurrencyDropdownOpen = false;
|
|
13
|
+
// Per-instance fallback, so the label, helper and error text stay linked
|
|
14
|
+
// to the amount input when the consumer omits input_id.
|
|
15
|
+
this.fallbackId = uniqueId('dda-number-field');
|
|
8
16
|
}
|
|
9
17
|
handleInput(event) {
|
|
10
18
|
const inputElement = event.target;
|
|
@@ -34,13 +42,16 @@ export class DdaNumberField {
|
|
|
34
42
|
return [];
|
|
35
43
|
}
|
|
36
44
|
}
|
|
37
|
-
// F-016: ids derived from the consumer-supplied input_id,
|
|
38
|
-
// dda-input
|
|
45
|
+
// F-016: ids derived from the amount input id (the consumer-supplied input_id,
|
|
46
|
+
// or the generated fallback), same pattern as dda-input.
|
|
47
|
+
get inputId() {
|
|
48
|
+
return this.input_id || this.fallbackId;
|
|
49
|
+
}
|
|
39
50
|
get helperId() {
|
|
40
|
-
return
|
|
51
|
+
return `${this.inputId}-helper`;
|
|
41
52
|
}
|
|
42
53
|
get errorId() {
|
|
43
|
-
return
|
|
54
|
+
return `${this.inputId}-error`;
|
|
44
55
|
}
|
|
45
56
|
get describedBy() {
|
|
46
57
|
const ids = [
|
|
@@ -60,7 +71,8 @@ export class DdaNumberField {
|
|
|
60
71
|
this.custom_class ? `${this.custom_class}` : '',
|
|
61
72
|
this.component_mode,
|
|
62
73
|
].filter(Boolean).join(' ');
|
|
63
|
-
|
|
74
|
+
const id = this.inputId;
|
|
75
|
+
return (h(Host, { key: 'e8e821361d846cd52c01047c1f0648e719e96249' }, h("div", { key: '4141b53316b4dbcd60faa46cf2d2b1c374cef309', class: containerClass }, this.label && h("label", { key: '20593074d31733885d83733dc63cd41376d572dc', htmlFor: id, class: "dda-input-label" }, this.label), h("div", { key: '443763cfb3a895c30815e339cd81d5e9b6de2c3e', class: "dda-input-field-group dda-number-field" }, h("input", { key: '57ed90d585e5a2d4e0c9f39bb1fdb6356d7b50f7', id: id, name: this.input_name, "aria-label": this.aria_label, type: "text", placeholder: this.placeholder, value: this.value, pattern: "[0-9]*", onInput: event => this.handleInput(event), onFocus: this.handleFocus.bind(this), onBlur: this.handleBlur.bind(this), class: "dda-field-group-input", "aria-describedby": this.describedBy, "aria-invalid": this.error_message ? 'true' : undefined }), h("div", { key: 'cd3c78d23ba19978c5b296731192f454db3e5906', class: "dda-input-dropdown-btn" }, h("button", { key: '74d7d3720fcb37122d60ce71155e234393824a26', name: this.toggle_button_name, type: "button", class: "dda-dropdown-select", "aria-label": this.toggle_button_label ? `${this.toggle_button_label}: ${this.selected_currency}` : undefined, "aria-expanded": this.isCurrencyDropdownOpen ? 'true' : 'false', onClick: () => this.toggleCurrencyDropdown() }, this.selected_currency, " ", h("i", { key: 'd2310ea5de9922de9dfab5bac39210921b1be971', class: `material-icons`, "aria-hidden": "true" }, this.isCurrencyDropdownOpen ? 'keyboard_arrow_up' : 'keyboard_arrow_down')), this.isCurrencyDropdownOpen && (h("div", { key: '77491f92b3c065987958c8a0aadead2c941b86be', class: "dda-input-dropdown-list" }, this.parsedCurrencies.length > 0 ? (this.parsedCurrencies.map(option => (h("button", { name: this.currency_button_name, type: "button", class: `dda-input-dropdown-item ${this.selected_currency === option ? 'selected' : ''}`, onClick: () => this.selectCurrency(option) }, option)))) : (h("div", { class: "dda-input-dropdown-item" }, "No options available")))))), this.helper_text && h("span", { key: 'a3e3d37303fac4919afce9a7c6a892de4e8d2771', id: this.helperId, class: "dda-helper-text" }, this.helper_text), this.error_message && h("span", { key: 'da1de1672834e28084e47eb3ae02b6d774b150de', id: this.errorId, class: "dda-error-message" }, this.error_message))));
|
|
64
76
|
}
|
|
65
77
|
static get is() { return "dda-number-field"; }
|
|
66
78
|
static get originalStyleUrls() {
|
|
@@ -87,7 +99,7 @@ export class DdaNumberField {
|
|
|
87
99
|
"optional": false,
|
|
88
100
|
"docs": {
|
|
89
101
|
"tags": [],
|
|
90
|
-
"text": ""
|
|
102
|
+
"text": "Placeholder text of the amount input."
|
|
91
103
|
},
|
|
92
104
|
"getter": false,
|
|
93
105
|
"setter": false,
|
|
@@ -106,7 +118,7 @@ export class DdaNumberField {
|
|
|
106
118
|
"optional": false,
|
|
107
119
|
"docs": {
|
|
108
120
|
"tags": [],
|
|
109
|
-
"text": ""
|
|
121
|
+
"text": "Visible label text, linked to the amount input through `input_id` (or a generated id)."
|
|
110
122
|
},
|
|
111
123
|
"getter": false,
|
|
112
124
|
"setter": false,
|
|
@@ -125,7 +137,7 @@ export class DdaNumberField {
|
|
|
125
137
|
"optional": false,
|
|
126
138
|
"docs": {
|
|
127
139
|
"tags": [],
|
|
128
|
-
"text": ""
|
|
140
|
+
"text": "Initial value of the amount input. Characters other than digits and `.` are removed as the user types."
|
|
129
141
|
},
|
|
130
142
|
"getter": false,
|
|
131
143
|
"setter": false,
|
|
@@ -144,7 +156,7 @@ export class DdaNumberField {
|
|
|
144
156
|
"optional": false,
|
|
145
157
|
"docs": {
|
|
146
158
|
"tags": [],
|
|
147
|
-
"text": ""
|
|
159
|
+
"text": "Helper text shown below the field and linked with `aria-describedby`."
|
|
148
160
|
},
|
|
149
161
|
"getter": false,
|
|
150
162
|
"setter": false,
|
|
@@ -163,7 +175,7 @@ export class DdaNumberField {
|
|
|
163
175
|
"optional": false,
|
|
164
176
|
"docs": {
|
|
165
177
|
"tags": [],
|
|
166
|
-
"text": ""
|
|
178
|
+
"text": "Error text shown below the field. When set, the input gets `aria-invalid=\"true\"`."
|
|
167
179
|
},
|
|
168
180
|
"getter": false,
|
|
169
181
|
"setter": false,
|
|
@@ -182,7 +194,7 @@ export class DdaNumberField {
|
|
|
182
194
|
"optional": true,
|
|
183
195
|
"docs": {
|
|
184
196
|
"tags": [],
|
|
185
|
-
"text": ""
|
|
197
|
+
"text": "Validation style. `error` shows the error colors."
|
|
186
198
|
},
|
|
187
199
|
"getter": false,
|
|
188
200
|
"setter": false,
|
|
@@ -201,7 +213,7 @@ export class DdaNumberField {
|
|
|
201
213
|
"optional": true,
|
|
202
214
|
"docs": {
|
|
203
215
|
"tags": [],
|
|
204
|
-
"text": ""
|
|
216
|
+
"text": "Size. `small` shows a smaller field; omit for the default size."
|
|
205
217
|
},
|
|
206
218
|
"getter": false,
|
|
207
219
|
"setter": false,
|
|
@@ -220,7 +232,7 @@ export class DdaNumberField {
|
|
|
220
232
|
"optional": true,
|
|
221
233
|
"docs": {
|
|
222
234
|
"tags": [],
|
|
223
|
-
"text": ""
|
|
235
|
+
"text": "Status style. `disabled` shows the disabled styling only; it does not set the native `disabled` attribute."
|
|
224
236
|
},
|
|
225
237
|
"getter": false,
|
|
226
238
|
"setter": false,
|
|
@@ -239,7 +251,7 @@ export class DdaNumberField {
|
|
|
239
251
|
"optional": false,
|
|
240
252
|
"docs": {
|
|
241
253
|
"tags": [],
|
|
242
|
-
"text": ""
|
|
254
|
+
"text": "Currency options for the dropdown, as a JSON array string, e.g. `'[\"AED\",\"USD\"]'`."
|
|
243
255
|
},
|
|
244
256
|
"getter": false,
|
|
245
257
|
"setter": false,
|
|
@@ -258,7 +270,7 @@ export class DdaNumberField {
|
|
|
258
270
|
"optional": false,
|
|
259
271
|
"docs": {
|
|
260
272
|
"tags": [],
|
|
261
|
-
"text": ""
|
|
273
|
+
"text": "Currency shown on the dropdown button. Updates when the user picks a currency."
|
|
262
274
|
},
|
|
263
275
|
"getter": false,
|
|
264
276
|
"setter": false,
|
|
@@ -278,7 +290,7 @@ export class DdaNumberField {
|
|
|
278
290
|
"optional": true,
|
|
279
291
|
"docs": {
|
|
280
292
|
"tags": [],
|
|
281
|
-
"text": ""
|
|
293
|
+
"text": "Extra CSS classes added to the field container."
|
|
282
294
|
},
|
|
283
295
|
"getter": false,
|
|
284
296
|
"setter": false,
|
|
@@ -298,7 +310,7 @@ export class DdaNumberField {
|
|
|
298
310
|
"optional": true,
|
|
299
311
|
"docs": {
|
|
300
312
|
"tags": [],
|
|
301
|
-
"text": ""
|
|
313
|
+
"text": "Theme override class for the field, e.g. `light-mode`."
|
|
302
314
|
},
|
|
303
315
|
"getter": false,
|
|
304
316
|
"setter": false,
|
|
@@ -317,7 +329,7 @@ export class DdaNumberField {
|
|
|
317
329
|
"optional": false,
|
|
318
330
|
"docs": {
|
|
319
331
|
"tags": [],
|
|
320
|
-
"text": ""
|
|
332
|
+
"text": "`id` of the amount input. Also used for the label `for` and the helper and error text ids. Optional: an id is generated when it is not set."
|
|
321
333
|
},
|
|
322
334
|
"getter": false,
|
|
323
335
|
"setter": false,
|
|
@@ -336,7 +348,7 @@ export class DdaNumberField {
|
|
|
336
348
|
"optional": true,
|
|
337
349
|
"docs": {
|
|
338
350
|
"tags": [],
|
|
339
|
-
"text": ""
|
|
351
|
+
"text": "Accessible name of the amount input. Use it when there is no visible label."
|
|
340
352
|
},
|
|
341
353
|
"getter": false,
|
|
342
354
|
"setter": false,
|
|
@@ -355,7 +367,7 @@ export class DdaNumberField {
|
|
|
355
367
|
"optional": true,
|
|
356
368
|
"docs": {
|
|
357
369
|
"tags": [],
|
|
358
|
-
"text": ""
|
|
370
|
+
"text": "`name` of the amount input, submitted with its form."
|
|
359
371
|
},
|
|
360
372
|
"getter": false,
|
|
361
373
|
"setter": false,
|
|
@@ -374,7 +386,7 @@ export class DdaNumberField {
|
|
|
374
386
|
"optional": true,
|
|
375
387
|
"docs": {
|
|
376
388
|
"tags": [],
|
|
377
|
-
"text": ""
|
|
389
|
+
"text": "`name` of the currency dropdown button."
|
|
378
390
|
},
|
|
379
391
|
"getter": false,
|
|
380
392
|
"setter": false,
|
|
@@ -393,12 +405,32 @@ export class DdaNumberField {
|
|
|
393
405
|
"optional": true,
|
|
394
406
|
"docs": {
|
|
395
407
|
"tags": [],
|
|
396
|
-
"text": ""
|
|
408
|
+
"text": "`name` of each currency option button."
|
|
397
409
|
},
|
|
398
410
|
"getter": false,
|
|
399
411
|
"setter": false,
|
|
400
412
|
"reflect": false,
|
|
401
413
|
"attribute": "currency_button_name"
|
|
414
|
+
},
|
|
415
|
+
"toggle_button_label": {
|
|
416
|
+
"type": "string",
|
|
417
|
+
"mutable": false,
|
|
418
|
+
"complexType": {
|
|
419
|
+
"original": "string",
|
|
420
|
+
"resolved": "string",
|
|
421
|
+
"references": {}
|
|
422
|
+
},
|
|
423
|
+
"required": false,
|
|
424
|
+
"optional": true,
|
|
425
|
+
"docs": {
|
|
426
|
+
"tags": [],
|
|
427
|
+
"text": "Accessible name of the currency dropdown button; the selected currency is added after it."
|
|
428
|
+
},
|
|
429
|
+
"getter": false,
|
|
430
|
+
"setter": false,
|
|
431
|
+
"reflect": false,
|
|
432
|
+
"attribute": "toggle_button_label",
|
|
433
|
+
"defaultValue": "'Choose currency'"
|
|
402
434
|
}
|
|
403
435
|
};
|
|
404
436
|
}
|
|
@@ -62,10 +62,6 @@ export default {
|
|
|
62
62
|
control: { type: 'text' },
|
|
63
63
|
description: 'Aria label for the number field',
|
|
64
64
|
},
|
|
65
|
-
onchange: {
|
|
66
|
-
control: { type: 'text' },
|
|
67
|
-
description: 'onchange event for the number field',
|
|
68
|
-
},
|
|
69
65
|
input_name: {
|
|
70
66
|
control: { type: 'text' },
|
|
71
67
|
description: 'Name of the input field',
|
|
@@ -101,7 +97,6 @@ export default {
|
|
|
101
97
|
input_id="input"
|
|
102
98
|
aria_label="input"
|
|
103
99
|
currencies='["USD","EUR","GBP","AED","PKR"]'
|
|
104
|
-
onchange="console.log('changed')"
|
|
105
100
|
></dda-number-field>
|
|
106
101
|
\`\`\`
|
|
107
102
|
`,
|
|
@@ -133,7 +128,6 @@ Default.args = {
|
|
|
133
128
|
component_mode: '',
|
|
134
129
|
input_id: 'input',
|
|
135
130
|
aria_label: 'input',
|
|
136
|
-
onchange: '',
|
|
137
131
|
input_name: 'input',
|
|
138
132
|
toggle_button_name: 'toggle-button',
|
|
139
133
|
currency_button_name: 'currency-button',
|
|
@@ -154,7 +148,6 @@ Small.args = {
|
|
|
154
148
|
component_mode: '',
|
|
155
149
|
input_id: 'input',
|
|
156
150
|
aria_label: 'input',
|
|
157
|
-
onchange: '',
|
|
158
151
|
input_name: 'input',
|
|
159
152
|
toggle_button_name: 'toggle-button',
|
|
160
153
|
currency_button_name: 'currency-button',
|
|
@@ -174,7 +167,6 @@ Error.args = {
|
|
|
174
167
|
component_mode: '',
|
|
175
168
|
input_id: 'input',
|
|
176
169
|
aria_label: 'input',
|
|
177
|
-
onchange: '',
|
|
178
170
|
input_name: 'input',
|
|
179
171
|
toggle_button_name: 'toggle-button',
|
|
180
172
|
currency_button_name: 'currency-button',
|
|
@@ -195,7 +187,6 @@ Disabled.args = {
|
|
|
195
187
|
component_mode: '',
|
|
196
188
|
input_id: 'input',
|
|
197
189
|
aria_label: 'input',
|
|
198
|
-
onchange: '',
|
|
199
190
|
input_name: 'input',
|
|
200
191
|
toggle_button_name: 'toggle-button',
|
|
201
192
|
currency_button_name: 'currency-button',
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
2
|
export class DdaPagination {
|
|
3
3
|
constructor() {
|
|
4
|
+
/** Number of pages. Values below 1 become 1. Mutable: the component corrects out-of-range values. */
|
|
4
5
|
this.total_pages = 8;
|
|
6
|
+
/** Selected page, counted from 1. Kept between 1 and `total_pages`; updates when the user changes the page. Mutable: the component assigns it. */
|
|
5
7
|
this.current_page = 1;
|
|
8
|
+
/** Layout: `simple-slider`, `buttons`, `text`, `text-pages`, `button-text`, `buttons-pages` or `full`. */
|
|
6
9
|
this.type = 'simple-slider';
|
|
10
|
+
/** Extra CSS classes added to the pagination element. */
|
|
7
11
|
this.custom_class = '';
|
|
12
|
+
/** Accessible name of the icon-only previous page button (`text`, `text-pages`, `button-text` and `buttons-pages` layouts). */
|
|
13
|
+
this.previous_button_label = 'Previous page';
|
|
14
|
+
/** Accessible name of the icon-only next page button (`text`, `text-pages`, `button-text` and `buttons-pages` layouts). */
|
|
15
|
+
this.next_button_label = 'Next page';
|
|
8
16
|
}
|
|
9
17
|
validateTotalPages(newValue) {
|
|
10
18
|
if (newValue < 1) {
|
|
@@ -26,17 +34,17 @@ export class DdaPagination {
|
|
|
26
34
|
renderPagination() {
|
|
27
35
|
switch (this.type) {
|
|
28
36
|
case 'simple-slider':
|
|
29
|
-
return (h("div", { class: `dda-pagination dda-pagination-simple-slider ${this.custom_class} ${this.component_mode}` }, h("button", { name: this.simple_slider_prev_button, class: "prev", disabled: this.current_page === 1, onClick: () => this.setcurrentpage(this.current_page - 1) }, h("i", { class: "material-icons material-symbols-outlined" }, "arrow_back"), " Prev"), h("span", null, "Page ", this.current_page, " of ", this.total_pages), h("button", { name: this.simple_slider_next_button, class: "next", disabled: this.current_page === this.total_pages, onClick: () => this.setcurrentpage(this.current_page + 1) }, "Next ", h("i", { class: "material-icons material-symbols-outlined" }, "arrow_forward"))));
|
|
37
|
+
return (h("div", { class: `dda-pagination dda-pagination-simple-slider ${this.custom_class} ${this.component_mode}` }, h("button", { name: this.simple_slider_prev_button, class: "prev", disabled: this.current_page === 1, onClick: () => this.setcurrentpage(this.current_page - 1) }, h("i", { class: "material-icons material-symbols-outlined", "aria-hidden": "true" }, "arrow_back"), " Prev"), h("span", null, "Page ", this.current_page, " of ", this.total_pages), h("button", { name: this.simple_slider_next_button, class: "next", disabled: this.current_page === this.total_pages, onClick: () => this.setcurrentpage(this.current_page + 1) }, "Next ", h("i", { class: "material-icons material-symbols-outlined", "aria-hidden": "true" }, "arrow_forward"))));
|
|
30
38
|
case 'buttons':
|
|
31
|
-
return (h("div", { class: `dda-pagination dda-pagination-buttons ${this.custom_class} ${this.component_mode}` }, h("button", { name: this.buttons_prev_button, class: "prev", disabled: this.current_page === 1, onClick: () => this.setcurrentpage(this.current_page - 1) }, h("i", { class: "material-icons material-symbols-outlined" }, "arrow_back"), " Prev"), this.renderPageButtons(), h("button", { name: this.buttons_next_button, class: "next", disabled: this.current_page === this.total_pages, onClick: () => this.setcurrentpage(this.current_page + 1) }, "Next ", h("i", { class: "material-icons material-symbols-outlined" }, "arrow_forward"))));
|
|
39
|
+
return (h("div", { class: `dda-pagination dda-pagination-buttons ${this.custom_class} ${this.component_mode}` }, h("button", { name: this.buttons_prev_button, class: "prev", disabled: this.current_page === 1, onClick: () => this.setcurrentpage(this.current_page - 1) }, h("i", { class: "material-icons material-symbols-outlined", "aria-hidden": "true" }, "arrow_back"), " Prev"), this.renderPageButtons(), h("button", { name: this.buttons_next_button, class: "next", disabled: this.current_page === this.total_pages, onClick: () => this.setcurrentpage(this.current_page + 1) }, "Next ", h("i", { class: "material-icons material-symbols-outlined", "aria-hidden": "true" }, "arrow_forward"))));
|
|
32
40
|
case 'text':
|
|
33
|
-
return (h("div", { class: `dda-pagination dda-pagination-text ${this.custom_class} ${this.component_mode}` }, h("button", { name: this.text_prev_button, class: "prev", disabled: this.current_page === 1, onClick: () => this.setcurrentpage(this.current_page - 1) }, h("i", { class: "material-icons material-symbols-outlined" }, "arrow_back")), h("span", null, "Page ", this.current_page, " of ", this.total_pages), h("button", { name: this.text_next_button, class: "next", disabled: this.current_page === this.total_pages, onClick: () => this.setcurrentpage(this.current_page + 1) }, h("i", { class: "material-icons material-symbols-outlined" }, "arrow_forward"))));
|
|
41
|
+
return (h("div", { class: `dda-pagination dda-pagination-text ${this.custom_class} ${this.component_mode}` }, h("button", { name: this.text_prev_button, class: "prev", "aria-label": this.previous_button_label, disabled: this.current_page === 1, onClick: () => this.setcurrentpage(this.current_page - 1) }, h("i", { class: "material-icons material-symbols-outlined", "aria-hidden": "true" }, "arrow_back")), h("span", null, "Page ", this.current_page, " of ", this.total_pages), h("button", { name: this.text_next_button, class: "next", "aria-label": this.next_button_label, disabled: this.current_page === this.total_pages, onClick: () => this.setcurrentpage(this.current_page + 1) }, h("i", { class: "material-icons material-symbols-outlined", "aria-hidden": "true" }, "arrow_forward"))));
|
|
34
42
|
case 'text-pages':
|
|
35
|
-
return (h("div", { class: `dda-pagination dda-pagination-text-pages ${this.custom_class} ${this.component_mode}` }, h("button", { name: this.text_pages_prev_button, class: "prev", disabled: this.current_page === 1, onClick: () => this.setcurrentpage(this.current_page - 1) }, h("i", { class: "material-icons material-symbols-outlined" }, "arrow_back")), this.renderPageButtons(), h("button", { name: this.text_pages_next_button, class: "next", disabled: this.current_page === this.total_pages, onClick: () => this.setcurrentpage(this.current_page + 1) }, h("i", { class: "material-icons material-symbols-outlined" }, "arrow_forward"))));
|
|
43
|
+
return (h("div", { class: `dda-pagination dda-pagination-text-pages ${this.custom_class} ${this.component_mode}` }, h("button", { name: this.text_pages_prev_button, class: "prev", "aria-label": this.previous_button_label, disabled: this.current_page === 1, onClick: () => this.setcurrentpage(this.current_page - 1) }, h("i", { class: "material-icons material-symbols-outlined", "aria-hidden": "true" }, "arrow_back")), this.renderPageButtons(), h("button", { name: this.text_pages_next_button, class: "next", "aria-label": this.next_button_label, disabled: this.current_page === this.total_pages, onClick: () => this.setcurrentpage(this.current_page + 1) }, h("i", { class: "material-icons material-symbols-outlined", "aria-hidden": "true" }, "arrow_forward"))));
|
|
36
44
|
case 'button-text':
|
|
37
|
-
return (h("div", { class: `dda-pagination dda-pagination-button-text ${this.custom_class} ${this.component_mode}` }, h("button", { name: this.button_text_prev_button, class: "prev", disabled: this.current_page === 1, onClick: () => this.setcurrentpage(this.current_page - 1) }, h("i", { class: "material-icons material-symbols-outlined" }, "arrow_back")), this.renderPageButtons(), h("button", { name: this.button_text_next_button, class: "next", disabled: this.current_page === this.total_pages, onClick: () => this.setcurrentpage(this.current_page + 1) }, h("i", { class: "material-icons material-symbols-outlined" }, "arrow_forward"))));
|
|
45
|
+
return (h("div", { class: `dda-pagination dda-pagination-button-text ${this.custom_class} ${this.component_mode}` }, h("button", { name: this.button_text_prev_button, class: "prev", "aria-label": this.previous_button_label, disabled: this.current_page === 1, onClick: () => this.setcurrentpage(this.current_page - 1) }, h("i", { class: "material-icons material-symbols-outlined", "aria-hidden": "true" }, "arrow_back")), this.renderPageButtons(), h("button", { name: this.button_text_next_button, class: "next", "aria-label": this.next_button_label, disabled: this.current_page === this.total_pages, onClick: () => this.setcurrentpage(this.current_page + 1) }, h("i", { class: "material-icons material-symbols-outlined", "aria-hidden": "true" }, "arrow_forward"))));
|
|
38
46
|
case 'buttons-pages':
|
|
39
|
-
return (h("div", { class: `dda-pagination dda-pagination-buttons-pages ${this.custom_class} ${this.component_mode}` }, h("button", { name: this.buttons_pages_prev_button, class: "prev", disabled: this.current_page === 1, onClick: () => this.setcurrentpage(this.current_page - 1) }, h("i", { class: "material-icons material-symbols-outlined" }, "arrow_back")), h("button", { name: this.buttons_pages_next_button, class: "next", disabled: this.current_page === this.total_pages, onClick: () => this.setcurrentpage(this.current_page + 1) }, h("i", { class: "material-icons material-symbols-outlined" }, "arrow_forward"))));
|
|
47
|
+
return (h("div", { class: `dda-pagination dda-pagination-buttons-pages ${this.custom_class} ${this.component_mode}` }, h("button", { name: this.buttons_pages_prev_button, class: "prev", "aria-label": this.previous_button_label, disabled: this.current_page === 1, onClick: () => this.setcurrentpage(this.current_page - 1) }, h("i", { class: "material-icons material-symbols-outlined", "aria-hidden": "true" }, "arrow_back")), h("button", { name: this.buttons_pages_next_button, class: "next", "aria-label": this.next_button_label, disabled: this.current_page === this.total_pages, onClick: () => this.setcurrentpage(this.current_page + 1) }, h("i", { class: "material-icons material-symbols-outlined", "aria-hidden": "true" }, "arrow_forward"))));
|
|
40
48
|
case 'full':
|
|
41
49
|
return (h("div", { class: `dda-pagination dda-pagination-full ${this.custom_class} ${this.component_mode}` }, this.renderPageButtons()));
|
|
42
50
|
}
|
|
@@ -44,17 +52,18 @@ export class DdaPagination {
|
|
|
44
52
|
renderPageButtons() {
|
|
45
53
|
const buttons = [];
|
|
46
54
|
for (let i = 1; i <= this.total_pages; i++) {
|
|
47
|
-
buttons.push(h("button", { class: i === this.current_page ? 'active' : '', onClick: () => this.setcurrentpage(i) }, i));
|
|
55
|
+
buttons.push(h("button", { class: i === this.current_page ? 'active' : '', "aria-label": `Page ${i}`, "aria-current": i === this.current_page ? 'page' : undefined, onClick: () => this.setcurrentpage(i) }, i));
|
|
48
56
|
}
|
|
49
57
|
return buttons;
|
|
50
58
|
}
|
|
51
59
|
setcurrentpage(page) {
|
|
52
|
-
if (page >= 1 && page <= this.total_pages) {
|
|
60
|
+
if (page >= 1 && page <= this.total_pages && page !== this.current_page) {
|
|
53
61
|
this.current_page = page;
|
|
62
|
+
this.pageChange.emit({ page });
|
|
54
63
|
}
|
|
55
64
|
}
|
|
56
65
|
render() {
|
|
57
|
-
return (h(Host, { key: '
|
|
66
|
+
return (h(Host, { key: '4de1572ef7acf0cd89b620183a723f8f9598fdf9' }, h("div", { key: '1aad2deab4985aaa29e0cf31790a0e7f3587c0d5', class: `dda-pagination-container` }, this.renderPagination())));
|
|
58
67
|
}
|
|
59
68
|
static get is() { return "dda-pagination"; }
|
|
60
69
|
static get originalStyleUrls() {
|
|
@@ -71,7 +80,7 @@ export class DdaPagination {
|
|
|
71
80
|
return {
|
|
72
81
|
"total_pages": {
|
|
73
82
|
"type": "number",
|
|
74
|
-
"mutable":
|
|
83
|
+
"mutable": true,
|
|
75
84
|
"complexType": {
|
|
76
85
|
"original": "number",
|
|
77
86
|
"resolved": "number",
|
|
@@ -81,7 +90,7 @@ export class DdaPagination {
|
|
|
81
90
|
"optional": false,
|
|
82
91
|
"docs": {
|
|
83
92
|
"tags": [],
|
|
84
|
-
"text": ""
|
|
93
|
+
"text": "Number of pages. Values below 1 become 1. Mutable: the component corrects out-of-range values."
|
|
85
94
|
},
|
|
86
95
|
"getter": false,
|
|
87
96
|
"setter": false,
|
|
@@ -91,7 +100,7 @@ export class DdaPagination {
|
|
|
91
100
|
},
|
|
92
101
|
"current_page": {
|
|
93
102
|
"type": "number",
|
|
94
|
-
"mutable":
|
|
103
|
+
"mutable": true,
|
|
95
104
|
"complexType": {
|
|
96
105
|
"original": "number",
|
|
97
106
|
"resolved": "number",
|
|
@@ -101,7 +110,7 @@ export class DdaPagination {
|
|
|
101
110
|
"optional": false,
|
|
102
111
|
"docs": {
|
|
103
112
|
"tags": [],
|
|
104
|
-
"text": ""
|
|
113
|
+
"text": "Selected page, counted from 1. Kept between 1 and `total_pages`; updates when the user changes the page. Mutable: the component assigns it."
|
|
105
114
|
},
|
|
106
115
|
"getter": false,
|
|
107
116
|
"setter": false,
|
|
@@ -121,7 +130,7 @@ export class DdaPagination {
|
|
|
121
130
|
"optional": false,
|
|
122
131
|
"docs": {
|
|
123
132
|
"tags": [],
|
|
124
|
-
"text": ""
|
|
133
|
+
"text": "Layout: `simple-slider`, `buttons`, `text`, `text-pages`, `button-text`, `buttons-pages` or `full`."
|
|
125
134
|
},
|
|
126
135
|
"getter": false,
|
|
127
136
|
"setter": false,
|
|
@@ -141,7 +150,7 @@ export class DdaPagination {
|
|
|
141
150
|
"optional": false,
|
|
142
151
|
"docs": {
|
|
143
152
|
"tags": [],
|
|
144
|
-
"text": ""
|
|
153
|
+
"text": "Extra CSS classes added to the pagination element."
|
|
145
154
|
},
|
|
146
155
|
"getter": false,
|
|
147
156
|
"setter": false,
|
|
@@ -161,7 +170,7 @@ export class DdaPagination {
|
|
|
161
170
|
"optional": true,
|
|
162
171
|
"docs": {
|
|
163
172
|
"tags": [],
|
|
164
|
-
"text": ""
|
|
173
|
+
"text": "Theme override class on the pagination element, e.g. `light-mode`."
|
|
165
174
|
},
|
|
166
175
|
"getter": false,
|
|
167
176
|
"setter": false,
|
|
@@ -180,7 +189,7 @@ export class DdaPagination {
|
|
|
180
189
|
"optional": false,
|
|
181
190
|
"docs": {
|
|
182
191
|
"tags": [],
|
|
183
|
-
"text": ""
|
|
192
|
+
"text": "`name` of the previous page button when `type` is `simple-slider`."
|
|
184
193
|
},
|
|
185
194
|
"getter": false,
|
|
186
195
|
"setter": false,
|
|
@@ -199,7 +208,7 @@ export class DdaPagination {
|
|
|
199
208
|
"optional": false,
|
|
200
209
|
"docs": {
|
|
201
210
|
"tags": [],
|
|
202
|
-
"text": ""
|
|
211
|
+
"text": "`name` of the next page button when `type` is `simple-slider`."
|
|
203
212
|
},
|
|
204
213
|
"getter": false,
|
|
205
214
|
"setter": false,
|
|
@@ -218,7 +227,7 @@ export class DdaPagination {
|
|
|
218
227
|
"optional": false,
|
|
219
228
|
"docs": {
|
|
220
229
|
"tags": [],
|
|
221
|
-
"text": ""
|
|
230
|
+
"text": "`name` of the previous page button when `type` is `buttons`."
|
|
222
231
|
},
|
|
223
232
|
"getter": false,
|
|
224
233
|
"setter": false,
|
|
@@ -237,7 +246,7 @@ export class DdaPagination {
|
|
|
237
246
|
"optional": false,
|
|
238
247
|
"docs": {
|
|
239
248
|
"tags": [],
|
|
240
|
-
"text": ""
|
|
249
|
+
"text": "`name` of the next page button when `type` is `buttons`."
|
|
241
250
|
},
|
|
242
251
|
"getter": false,
|
|
243
252
|
"setter": false,
|
|
@@ -256,7 +265,7 @@ export class DdaPagination {
|
|
|
256
265
|
"optional": false,
|
|
257
266
|
"docs": {
|
|
258
267
|
"tags": [],
|
|
259
|
-
"text": ""
|
|
268
|
+
"text": "`name` of the previous page button when `type` is `text`."
|
|
260
269
|
},
|
|
261
270
|
"getter": false,
|
|
262
271
|
"setter": false,
|
|
@@ -275,7 +284,7 @@ export class DdaPagination {
|
|
|
275
284
|
"optional": false,
|
|
276
285
|
"docs": {
|
|
277
286
|
"tags": [],
|
|
278
|
-
"text": ""
|
|
287
|
+
"text": "`name` of the next page button when `type` is `text`."
|
|
279
288
|
},
|
|
280
289
|
"getter": false,
|
|
281
290
|
"setter": false,
|
|
@@ -294,7 +303,7 @@ export class DdaPagination {
|
|
|
294
303
|
"optional": false,
|
|
295
304
|
"docs": {
|
|
296
305
|
"tags": [],
|
|
297
|
-
"text": ""
|
|
306
|
+
"text": "`name` of the previous page button when `type` is `text-pages`."
|
|
298
307
|
},
|
|
299
308
|
"getter": false,
|
|
300
309
|
"setter": false,
|
|
@@ -313,7 +322,7 @@ export class DdaPagination {
|
|
|
313
322
|
"optional": false,
|
|
314
323
|
"docs": {
|
|
315
324
|
"tags": [],
|
|
316
|
-
"text": ""
|
|
325
|
+
"text": "`name` of the next page button when `type` is `text-pages`."
|
|
317
326
|
},
|
|
318
327
|
"getter": false,
|
|
319
328
|
"setter": false,
|
|
@@ -332,7 +341,7 @@ export class DdaPagination {
|
|
|
332
341
|
"optional": false,
|
|
333
342
|
"docs": {
|
|
334
343
|
"tags": [],
|
|
335
|
-
"text": ""
|
|
344
|
+
"text": "`name` of the previous page button when `type` is `button-text`."
|
|
336
345
|
},
|
|
337
346
|
"getter": false,
|
|
338
347
|
"setter": false,
|
|
@@ -351,7 +360,7 @@ export class DdaPagination {
|
|
|
351
360
|
"optional": false,
|
|
352
361
|
"docs": {
|
|
353
362
|
"tags": [],
|
|
354
|
-
"text": ""
|
|
363
|
+
"text": "`name` of the next page button when `type` is `button-text`."
|
|
355
364
|
},
|
|
356
365
|
"getter": false,
|
|
357
366
|
"setter": false,
|
|
@@ -370,7 +379,7 @@ export class DdaPagination {
|
|
|
370
379
|
"optional": false,
|
|
371
380
|
"docs": {
|
|
372
381
|
"tags": [],
|
|
373
|
-
"text": ""
|
|
382
|
+
"text": "`name` of the previous page button when `type` is `buttons-pages`."
|
|
374
383
|
},
|
|
375
384
|
"getter": false,
|
|
376
385
|
"setter": false,
|
|
@@ -389,15 +398,73 @@ export class DdaPagination {
|
|
|
389
398
|
"optional": false,
|
|
390
399
|
"docs": {
|
|
391
400
|
"tags": [],
|
|
392
|
-
"text": ""
|
|
401
|
+
"text": "`name` of the next page button when `type` is `buttons-pages`."
|
|
393
402
|
},
|
|
394
403
|
"getter": false,
|
|
395
404
|
"setter": false,
|
|
396
405
|
"reflect": false,
|
|
397
406
|
"attribute": "buttons_pages_next_button"
|
|
407
|
+
},
|
|
408
|
+
"previous_button_label": {
|
|
409
|
+
"type": "string",
|
|
410
|
+
"mutable": false,
|
|
411
|
+
"complexType": {
|
|
412
|
+
"original": "string",
|
|
413
|
+
"resolved": "string",
|
|
414
|
+
"references": {}
|
|
415
|
+
},
|
|
416
|
+
"required": false,
|
|
417
|
+
"optional": false,
|
|
418
|
+
"docs": {
|
|
419
|
+
"tags": [],
|
|
420
|
+
"text": "Accessible name of the icon-only previous page button (`text`, `text-pages`, `button-text` and `buttons-pages` layouts)."
|
|
421
|
+
},
|
|
422
|
+
"getter": false,
|
|
423
|
+
"setter": false,
|
|
424
|
+
"reflect": false,
|
|
425
|
+
"attribute": "previous_button_label",
|
|
426
|
+
"defaultValue": "'Previous page'"
|
|
427
|
+
},
|
|
428
|
+
"next_button_label": {
|
|
429
|
+
"type": "string",
|
|
430
|
+
"mutable": false,
|
|
431
|
+
"complexType": {
|
|
432
|
+
"original": "string",
|
|
433
|
+
"resolved": "string",
|
|
434
|
+
"references": {}
|
|
435
|
+
},
|
|
436
|
+
"required": false,
|
|
437
|
+
"optional": false,
|
|
438
|
+
"docs": {
|
|
439
|
+
"tags": [],
|
|
440
|
+
"text": "Accessible name of the icon-only next page button (`text`, `text-pages`, `button-text` and `buttons-pages` layouts)."
|
|
441
|
+
},
|
|
442
|
+
"getter": false,
|
|
443
|
+
"setter": false,
|
|
444
|
+
"reflect": false,
|
|
445
|
+
"attribute": "next_button_label",
|
|
446
|
+
"defaultValue": "'Next page'"
|
|
398
447
|
}
|
|
399
448
|
};
|
|
400
449
|
}
|
|
450
|
+
static get events() {
|
|
451
|
+
return [{
|
|
452
|
+
"method": "pageChange",
|
|
453
|
+
"name": "pageChange",
|
|
454
|
+
"bubbles": true,
|
|
455
|
+
"cancelable": true,
|
|
456
|
+
"composed": true,
|
|
457
|
+
"docs": {
|
|
458
|
+
"tags": [],
|
|
459
|
+
"text": "Emitted when the user moves to a different page. `detail.page` is the new page, counted from 1."
|
|
460
|
+
},
|
|
461
|
+
"complexType": {
|
|
462
|
+
"original": "{ page: number }",
|
|
463
|
+
"resolved": "{ page: number; }",
|
|
464
|
+
"references": {}
|
|
465
|
+
}
|
|
466
|
+
}];
|
|
467
|
+
}
|
|
401
468
|
static get watchers() {
|
|
402
469
|
return [{
|
|
403
470
|
"propName": "total_pages",
|