@refinitiv-ui/elements 5.0.0-beta.3 → 5.0.0-dev.204
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 +325 -73
- package/README.md +13 -2
- package/lib/accordion/custom-elements.json +0 -13
- package/lib/accordion/custom-elements.md +18 -0
- package/lib/accordion/index.d.ts +13 -10
- package/lib/accordion/index.js +15 -18
- package/lib/appstate-bar/custom-elements.json +1 -1
- package/lib/appstate-bar/custom-elements.md +22 -0
- package/lib/appstate-bar/index.d.ts +15 -6
- package/lib/appstate-bar/index.js +17 -11
- package/lib/autosuggest/custom-elements.json +24 -4
- package/lib/autosuggest/custom-elements.md +54 -0
- package/lib/autosuggest/helpers/types.d.ts +22 -1
- package/lib/autosuggest/helpers/types.js +0 -1
- package/lib/autosuggest/helpers/utils.d.ts +2 -2
- package/lib/autosuggest/helpers/utils.js +1 -3
- package/lib/autosuggest/index.d.ts +21 -9
- package/lib/autosuggest/index.js +45 -31
- package/lib/button/custom-elements.json +3 -3
- package/lib/button/custom-elements.md +23 -0
- package/lib/button/index.d.ts +27 -20
- package/lib/button/index.js +92 -74
- package/lib/button/themes/halo/dark/index.js +1 -1
- package/lib/button/themes/halo/light/index.js +1 -1
- package/lib/button/themes/solar/charcoal/index.js +1 -1
- package/lib/button/themes/solar/pearl/index.js +1 -1
- package/lib/button-bar/custom-elements.md +9 -0
- package/lib/button-bar/index.d.ts +60 -4
- package/lib/button-bar/index.js +164 -19
- package/lib/calendar/constants.d.ts +26 -0
- package/lib/calendar/constants.js +28 -0
- package/lib/calendar/custom-elements.json +8 -6
- package/lib/calendar/custom-elements.md +35 -0
- package/lib/calendar/index.d.ts +119 -21
- package/lib/calendar/index.js +512 -157
- package/lib/calendar/locales.d.ts +1 -31
- package/lib/calendar/locales.js +3 -107
- package/lib/calendar/themes/halo/dark/index.js +1 -1
- package/lib/calendar/themes/halo/light/index.js +1 -1
- package/lib/calendar/themes/solar/charcoal/index.js +1 -1
- package/lib/calendar/themes/solar/pearl/index.js +1 -1
- package/lib/calendar/types.d.ts +12 -13
- package/lib/calendar/types.js +1 -7
- package/lib/calendar/utils.d.ts +31 -1
- package/lib/calendar/utils.js +105 -3
- package/lib/canvas/custom-elements.json +9 -7
- package/lib/canvas/custom-elements.md +27 -0
- package/lib/canvas/index.d.ts +14 -6
- package/lib/canvas/index.js +17 -12
- package/lib/card/custom-elements.json +21 -9
- package/lib/card/custom-elements.md +24 -0
- package/lib/card/helpers/types.d.ts +1 -1
- package/lib/card/helpers/types.js +0 -1
- package/lib/card/index.d.ts +67 -20
- package/lib/card/index.js +132 -35
- package/lib/card/themes/halo/dark/index.js +1 -1
- package/lib/card/themes/halo/light/index.js +1 -1
- package/lib/card/themes/solar/charcoal/index.js +1 -1
- package/lib/card/themes/solar/pearl/index.js +1 -1
- package/lib/chart/custom-elements.json +3 -3
- package/lib/chart/custom-elements.md +16 -0
- package/lib/chart/helpers/index.d.ts +2 -0
- package/lib/chart/helpers/index.js +2 -0
- package/lib/chart/helpers/legend.d.ts +2 -2
- package/lib/chart/helpers/legend.js +2 -3
- package/lib/chart/helpers/merge.d.ts +15 -0
- package/lib/chart/helpers/merge.js +28 -0
- package/lib/chart/helpers/types.d.ts +40 -12
- package/lib/chart/helpers/types.js +0 -1
- package/lib/chart/index.d.ts +34 -26
- package/lib/chart/index.js +58 -55
- package/lib/chart/plugins/doughnut-center-label.js +4 -5
- package/lib/checkbox/custom-elements.json +4 -4
- package/lib/checkbox/custom-elements.md +18 -0
- package/lib/checkbox/index.d.ts +29 -14
- package/lib/checkbox/index.js +65 -34
- package/lib/checkbox/themes/halo/dark/index.js +1 -1
- package/lib/checkbox/themes/halo/light/index.js +1 -1
- package/lib/clock/custom-elements.json +21 -4
- package/lib/clock/custom-elements.md +28 -0
- package/lib/clock/index.d.ts +25 -6
- package/lib/clock/index.js +44 -18
- package/lib/clock/themes/halo/dark/index.js +1 -1
- package/lib/clock/themes/halo/light/index.js +1 -1
- package/lib/clock/themes/solar/charcoal/index.js +1 -1
- package/lib/clock/themes/solar/pearl/index.js +1 -1
- package/lib/clock/utils/TickManager.js +2 -3
- package/lib/clock/utils/timestamps.js +0 -1
- package/lib/collapse/custom-elements.md +27 -0
- package/lib/collapse/index.d.ts +15 -8
- package/lib/collapse/index.js +18 -13
- package/lib/color-dialog/custom-elements.json +29 -16
- package/lib/color-dialog/custom-elements.md +39 -0
- package/lib/color-dialog/elements/color-palettes.d.ts +13 -6
- package/lib/color-dialog/elements/color-palettes.js +16 -13
- package/lib/color-dialog/elements/grayscale-palettes.d.ts +13 -6
- package/lib/color-dialog/elements/grayscale-palettes.js +17 -13
- package/lib/color-dialog/elements/palettes.d.ts +15 -3
- package/lib/color-dialog/elements/palettes.js +65 -45
- package/lib/color-dialog/helpers/color-helpers.d.ts +7 -53
- package/lib/color-dialog/helpers/color-helpers.js +12 -110
- package/lib/color-dialog/helpers/value-model.d.ts +1 -1
- package/lib/color-dialog/helpers/value-model.js +18 -17
- package/lib/color-dialog/index.d.ts +27 -20
- package/lib/color-dialog/index.js +54 -45
- package/lib/combo-box/custom-elements.json +51 -17
- package/lib/combo-box/custom-elements.md +42 -0
- package/lib/combo-box/helpers/filter.d.ts +4 -4
- package/lib/combo-box/helpers/filter.js +0 -1
- package/lib/combo-box/helpers/keyboard-event.js +0 -1
- package/lib/combo-box/helpers/renderer.d.ts +8 -0
- package/lib/combo-box/helpers/renderer.js +24 -0
- package/lib/combo-box/helpers/types.d.ts +2 -2
- package/lib/combo-box/helpers/types.js +0 -1
- package/lib/combo-box/index.d.ts +63 -32
- package/lib/combo-box/index.js +102 -60
- package/lib/combo-box/themes/halo/dark/index.js +2 -3
- package/lib/combo-box/themes/halo/light/index.js +2 -3
- package/lib/combo-box/themes/solar/charcoal/index.js +2 -3
- package/lib/combo-box/themes/solar/pearl/index.js +2 -3
- package/lib/counter/custom-elements.json +39 -0
- package/lib/counter/custom-elements.md +11 -0
- package/lib/counter/index.d.ts +91 -0
- package/lib/counter/index.js +154 -0
- package/lib/counter/themes/halo/dark/index.js +3 -0
- package/lib/counter/themes/halo/light/index.js +3 -0
- package/lib/counter/themes/solar/charcoal/index.js +3 -0
- package/lib/counter/themes/solar/pearl/index.js +3 -0
- package/lib/counter/utils.d.ts +13 -0
- package/lib/counter/utils.js +52 -0
- package/lib/datetime-picker/custom-elements.json +53 -24
- package/lib/datetime-picker/custom-elements.md +57 -0
- package/lib/datetime-picker/index.d.ts +34 -16
- package/lib/datetime-picker/index.js +56 -38
- package/lib/datetime-picker/locales.d.ts +1 -1
- package/lib/datetime-picker/locales.js +12 -2
- package/lib/datetime-picker/themes/solar/charcoal/index.js +1 -1
- package/lib/datetime-picker/themes/solar/pearl/index.js +1 -1
- package/lib/datetime-picker/types.d.ts +1 -1
- package/lib/datetime-picker/types.js +0 -1
- package/lib/datetime-picker/utils.js +1 -2
- package/lib/dialog/custom-elements.json +34 -12
- package/lib/dialog/custom-elements.md +47 -0
- package/lib/dialog/draggable-element.js +25 -16
- package/lib/dialog/index.d.ts +25 -21
- package/lib/dialog/index.js +36 -32
- package/lib/email-field/custom-elements.json +81 -94
- package/lib/email-field/custom-elements.md +37 -0
- package/lib/email-field/index.d.ts +47 -112
- package/lib/email-field/index.js +48 -241
- package/lib/email-field/themes/halo/dark/index.js +1 -1
- package/lib/email-field/themes/halo/light/index.js +1 -1
- package/lib/email-field/themes/solar/charcoal/index.js +1 -1
- package/lib/email-field/themes/solar/pearl/index.js +1 -1
- package/lib/events.d.ts +121 -0
- package/lib/events.js +1 -0
- package/lib/flag/custom-elements.md +10 -0
- package/lib/flag/index.d.ts +14 -5
- package/lib/flag/index.js +19 -12
- package/lib/flag/utils/FlagLoader.d.ts +1 -1
- package/lib/flag/utils/FlagLoader.js +1 -2
- package/lib/header/custom-elements.md +18 -0
- package/lib/header/index.d.ts +10 -3
- package/lib/header/index.js +12 -8
- package/lib/heatmap/custom-elements.json +13 -0
- package/lib/heatmap/custom-elements.md +26 -0
- package/lib/heatmap/helpers/color.d.ts +1 -1
- package/lib/heatmap/helpers/color.js +1 -2
- package/lib/heatmap/helpers/text.d.ts +1 -1
- package/lib/heatmap/helpers/text.js +0 -1
- package/lib/heatmap/helpers/track.js +2 -3
- package/lib/heatmap/helpers/types.js +0 -1
- package/lib/heatmap/index.d.ts +32 -13
- package/lib/heatmap/index.js +61 -35
- package/lib/icon/custom-elements.json +6 -4
- package/lib/icon/custom-elements.md +8 -0
- package/lib/icon/index.d.ts +17 -7
- package/lib/icon/index.js +36 -18
- package/lib/icon/utils/IconLoader.d.ts +6 -1
- package/lib/icon/utils/IconLoader.js +24 -18
- package/lib/index.d.ts +2 -0
- package/lib/index.js +2 -1
- package/lib/interactive-chart/custom-elements.json +5 -11
- package/lib/interactive-chart/custom-elements.md +31 -0
- package/lib/interactive-chart/helpers/merge.d.ts +15 -0
- package/lib/interactive-chart/helpers/merge.js +28 -0
- package/lib/interactive-chart/helpers/types.d.ts +10 -9
- package/lib/interactive-chart/helpers/types.js +6 -2
- package/lib/interactive-chart/index.d.ts +37 -18
- package/lib/interactive-chart/index.js +61 -51
- package/lib/item/custom-elements.json +4 -4
- package/lib/item/custom-elements.md +29 -0
- package/lib/item/helpers/types.d.ts +1 -1
- package/lib/item/helpers/types.js +0 -1
- package/lib/item/index.d.ts +26 -9
- package/lib/item/index.js +43 -16
- package/lib/label/custom-elements.json +7 -16
- package/lib/label/custom-elements.md +11 -0
- package/lib/label/index.d.ts +41 -73
- package/lib/label/index.js +150 -187
- package/lib/layout/custom-elements.md +26 -0
- package/lib/layout/index.d.ts +11 -4
- package/lib/layout/index.js +13 -9
- package/lib/led-gauge/custom-elements.json +4 -4
- package/lib/led-gauge/custom-elements.md +17 -0
- package/lib/led-gauge/index.d.ts +13 -5
- package/lib/led-gauge/index.js +16 -11
- package/lib/list/custom-elements.json +37 -5
- package/lib/list/custom-elements.md +33 -0
- package/lib/list/extensible-function.js +2 -1
- package/lib/list/helpers/list-renderer.d.ts +2 -2
- package/lib/list/helpers/list-renderer.js +4 -3
- package/lib/list/helpers/types.d.ts +2 -2
- package/lib/list/helpers/types.js +0 -1
- package/lib/list/index.d.ts +47 -12
- package/lib/list/index.js +100 -39
- package/lib/list/renderer.d.ts +2 -2
- package/lib/list/renderer.js +1 -2
- package/lib/loader/custom-elements.md +5 -0
- package/lib/loader/index.d.ts +8 -1
- package/lib/loader/index.js +11 -8
- package/lib/multi-input/custom-elements.json +7 -6
- package/lib/multi-input/custom-elements.md +43 -0
- package/lib/multi-input/helpers/types.d.ts +1 -1
- package/lib/multi-input/helpers/types.js +0 -1
- package/lib/multi-input/index.d.ts +19 -8
- package/lib/multi-input/index.js +28 -18
- package/lib/multi-input/themes/solar/charcoal/index.js +1 -1
- package/lib/multi-input/themes/solar/pearl/index.js +1 -1
- package/lib/notification/custom-elements.md +26 -0
- package/lib/notification/elements/notification-tray.d.ts +10 -4
- package/lib/notification/elements/notification-tray.js +15 -11
- package/lib/notification/elements/notification.d.ts +19 -7
- package/lib/notification/elements/notification.js +25 -13
- package/lib/notification/helpers/status.d.ts +1 -1
- package/lib/notification/helpers/status.js +1 -2
- package/lib/notification/helpers/types.d.ts +1 -1
- package/lib/notification/helpers/types.js +0 -1
- package/lib/notification/index.d.ts +2 -2
- package/lib/notification/index.js +2 -3
- package/lib/number-field/custom-elements.json +99 -54
- package/lib/number-field/custom-elements.md +42 -0
- package/lib/number-field/index.d.ts +104 -52
- package/lib/number-field/index.js +129 -88
- package/lib/number-field/themes/halo/dark/index.js +1 -1
- package/lib/number-field/themes/halo/light/index.js +1 -1
- package/lib/number-field/themes/solar/charcoal/index.js +1 -1
- package/lib/number-field/themes/solar/pearl/index.js +1 -1
- package/lib/overlay/custom-elements.json +26 -13
- package/lib/overlay/custom-elements.md +54 -0
- package/lib/overlay/elements/overlay-backdrop.d.ts +12 -5
- package/lib/overlay/elements/overlay-backdrop.js +13 -9
- package/lib/overlay/elements/overlay-viewport.d.ts +11 -4
- package/lib/overlay/elements/overlay-viewport.js +12 -9
- package/lib/overlay/elements/overlay.d.ts +18 -6
- package/lib/overlay/elements/overlay.js +35 -28
- package/lib/overlay/helpers/functions.js +0 -1
- package/lib/overlay/helpers/types.js +0 -1
- package/lib/overlay/index.d.ts +2 -2
- package/lib/overlay/index.js +1 -2
- package/lib/overlay/managers/backdrop-manager.d.ts +2 -2
- package/lib/overlay/managers/backdrop-manager.js +2 -3
- package/lib/overlay/managers/close-manager.d.ts +1 -1
- package/lib/overlay/managers/close-manager.js +1 -2
- package/lib/overlay/managers/focus-manager.d.ts +1 -1
- package/lib/overlay/managers/focus-manager.js +3 -5
- package/lib/overlay/managers/interaction-lock-manager.js +2 -3
- package/lib/overlay/managers/viewport-manager.d.ts +3 -3
- package/lib/overlay/managers/viewport-manager.js +6 -3
- package/lib/overlay/managers/zindex-manager.d.ts +1 -1
- package/lib/overlay/managers/zindex-manager.js +1 -4
- package/lib/overlay-menu/custom-elements.json +126 -12
- package/lib/overlay-menu/custom-elements.md +44 -0
- package/lib/overlay-menu/helpers/types.d.ts +3 -3
- package/lib/overlay-menu/helpers/types.js +0 -1
- package/lib/overlay-menu/index.d.ts +44 -12
- package/lib/overlay-menu/index.js +66 -35
- package/lib/overlay-menu/managers/menu-manager.d.ts +2 -2
- package/lib/overlay-menu/managers/menu-manager.js +8 -8
- package/lib/pagination/custom-elements.json +16 -33
- package/lib/pagination/custom-elements.md +26 -0
- package/lib/pagination/index.d.ts +156 -81
- package/lib/pagination/index.js +373 -214
- package/lib/pagination/themes/halo/dark/index.js +1 -1
- package/lib/pagination/themes/halo/light/index.js +1 -1
- package/lib/pagination/themes/solar/charcoal/index.js +1 -1
- package/lib/pagination/themes/solar/pearl/index.js +1 -1
- package/lib/panel/custom-elements.md +11 -0
- package/lib/panel/index.d.ts +11 -4
- package/lib/panel/index.js +13 -9
- package/lib/password-field/custom-elements.json +62 -67
- package/lib/password-field/custom-elements.md +39 -0
- package/lib/password-field/index.d.ts +46 -90
- package/lib/password-field/index.js +52 -190
- package/lib/password-field/themes/halo/dark/index.js +1 -1
- package/lib/password-field/themes/halo/light/index.js +1 -1
- package/lib/password-field/themes/solar/charcoal/index.js +1 -1
- package/lib/password-field/themes/solar/pearl/index.js +1 -1
- package/lib/pill/custom-elements.json +9 -7
- package/lib/pill/custom-elements.md +22 -0
- package/lib/pill/index.d.ts +15 -7
- package/lib/pill/index.js +21 -27
- package/lib/pill/themes/halo/dark/index.js +1 -1
- package/lib/pill/themes/halo/light/index.js +1 -1
- package/lib/progress-bar/custom-elements.md +18 -0
- package/lib/progress-bar/index.d.ts +11 -15
- package/lib/progress-bar/index.js +14 -25
- package/lib/radio-button/custom-elements.json +4 -4
- package/lib/radio-button/custom-elements.md +19 -0
- package/lib/radio-button/index.d.ts +33 -9
- package/lib/radio-button/index.js +97 -24
- package/lib/radio-button/radio-button-registry.d.ts +3 -2
- package/lib/radio-button/radio-button-registry.js +57 -5
- package/lib/radio-button/themes/halo/dark/index.js +1 -1
- package/lib/radio-button/themes/halo/light/index.js +1 -1
- package/lib/rating/custom-elements.md +17 -0
- package/lib/rating/index.d.ts +11 -4
- package/lib/rating/index.js +16 -10
- package/lib/search-field/custom-elements.json +70 -74
- package/lib/search-field/custom-elements.md +41 -0
- package/lib/search-field/index.d.ts +47 -97
- package/lib/search-field/index.js +50 -212
- package/lib/search-field/themes/halo/dark/index.js +1 -1
- package/lib/search-field/themes/halo/light/index.js +1 -1
- package/lib/search-field/themes/solar/charcoal/index.js +1 -1
- package/lib/search-field/themes/solar/pearl/index.js +1 -1
- package/lib/select/custom-elements.json +5 -4
- package/lib/select/custom-elements.md +24 -0
- package/lib/select/helpers/types.d.ts +1 -1
- package/lib/select/helpers/types.js +0 -1
- package/lib/select/index.d.ts +26 -11
- package/lib/select/index.js +93 -52
- package/lib/select/themes/halo/dark/index.js +1 -1
- package/lib/select/themes/halo/light/index.js +1 -1
- package/lib/sidebar-layout/custom-elements.json +2 -6
- package/lib/sidebar-layout/custom-elements.md +21 -0
- package/lib/sidebar-layout/index.d.ts +15 -7
- package/lib/sidebar-layout/index.js +16 -10
- package/lib/slider/custom-elements.json +4 -4
- package/lib/slider/custom-elements.md +28 -0
- package/lib/slider/index.d.ts +18 -5
- package/lib/slider/index.js +69 -16
- package/lib/sparkline/custom-elements.json +4 -4
- package/lib/sparkline/custom-elements.md +16 -0
- package/lib/sparkline/index.d.ts +14 -5
- package/lib/sparkline/index.js +17 -10
- package/lib/swing-gauge/const.d.ts +22 -0
- package/lib/swing-gauge/const.js +26 -0
- package/lib/swing-gauge/custom-elements.json +51 -22
- package/lib/swing-gauge/custom-elements.md +17 -0
- package/lib/swing-gauge/helpers.d.ts +8 -0
- package/lib/swing-gauge/helpers.js +105 -0
- package/lib/swing-gauge/index.d.ts +220 -72
- package/lib/swing-gauge/index.js +648 -168
- package/lib/swing-gauge/themes/halo/dark/index.js +1 -1
- package/lib/swing-gauge/themes/halo/light/index.js +1 -1
- package/lib/swing-gauge/themes/solar/charcoal/index.js +1 -1
- package/lib/swing-gauge/themes/solar/pearl/index.js +1 -1
- package/lib/swing-gauge/types.d.ts +34 -0
- package/lib/swing-gauge/types.js +1 -0
- package/lib/tab/custom-elements.json +10 -21
- package/lib/tab/custom-elements.md +22 -0
- package/lib/tab/index.d.ts +19 -14
- package/lib/tab/index.js +31 -40
- package/lib/tab/themes/halo/dark/index.js +1 -1
- package/lib/tab/themes/halo/light/index.js +1 -1
- package/lib/tab/themes/solar/charcoal/index.js +1 -1
- package/lib/tab/themes/solar/pearl/index.js +1 -1
- package/lib/tab-bar/custom-elements.json +0 -6
- package/lib/tab-bar/custom-elements.md +11 -0
- package/lib/tab-bar/helpers/animate.d.ts +1 -1
- package/lib/tab-bar/helpers/animate.js +5 -2
- package/lib/tab-bar/index.d.ts +12 -5
- package/lib/tab-bar/index.js +18 -21
- package/lib/tab-bar/themes/solar/charcoal/index.js +1 -1
- package/lib/tab-bar/themes/solar/pearl/index.js +1 -1
- package/lib/text-field/custom-elements.json +78 -89
- package/lib/text-field/custom-elements.md +35 -0
- package/lib/text-field/index.d.ts +67 -80
- package/lib/text-field/index.js +106 -157
- package/lib/text-field/themes/halo/dark/index.js +1 -1
- package/lib/text-field/themes/halo/light/index.js +1 -1
- package/lib/text-field/themes/solar/charcoal/index.js +1 -1
- package/lib/text-field/themes/solar/pearl/index.js +1 -1
- package/lib/time-picker/custom-elements.json +6 -8
- package/lib/time-picker/custom-elements.md +28 -0
- package/lib/time-picker/index.d.ts +105 -65
- package/lib/time-picker/index.js +297 -169
- package/lib/time-picker/themes/solar/charcoal/index.js +1 -1
- package/lib/time-picker/themes/solar/pearl/index.js +1 -1
- package/lib/toggle/custom-elements.json +4 -4
- package/lib/toggle/custom-elements.md +19 -0
- package/lib/toggle/index.d.ts +22 -5
- package/lib/toggle/index.js +58 -13
- package/lib/toggle/themes/halo/dark/index.js +1 -1
- package/lib/toggle/themes/halo/light/index.js +1 -1
- package/lib/toggle/themes/solar/charcoal/index.js +1 -1
- package/lib/toggle/themes/solar/pearl/index.js +1 -1
- package/lib/tooltip/custom-elements.md +14 -0
- package/lib/tooltip/elements/title-tooltip.js +2 -3
- package/lib/tooltip/elements/tooltip-element.d.ts +2 -3
- package/lib/tooltip/elements/tooltip-element.js +0 -2
- package/lib/tooltip/helpers/overflow-tooltip.d.ts +1 -1
- package/lib/tooltip/helpers/overflow-tooltip.js +1 -2
- package/lib/tooltip/helpers/renderer.d.ts +1 -1
- package/lib/tooltip/helpers/renderer.js +0 -1
- package/lib/tooltip/helpers/types.d.ts +1 -1
- package/lib/tooltip/helpers/types.js +0 -1
- package/lib/tooltip/index.d.ts +18 -11
- package/lib/tooltip/index.js +27 -23
- package/lib/tooltip/managers/tooltip-manager.d.ts +2 -2
- package/lib/tooltip/managers/tooltip-manager.js +17 -11
- package/lib/tornado-chart/custom-elements.md +18 -0
- package/lib/tornado-chart/elements/tornado-chart.d.ts +12 -5
- package/lib/tornado-chart/elements/tornado-chart.js +15 -11
- package/lib/tornado-chart/elements/tornado-item.d.ts +13 -6
- package/lib/tornado-chart/elements/tornado-item.js +17 -12
- package/lib/tornado-chart/index.d.ts +2 -2
- package/lib/tornado-chart/index.js +2 -3
- package/lib/tree/custom-elements.json +30 -2
- package/lib/tree/custom-elements.md +32 -0
- package/lib/tree/elements/tree-item.d.ts +53 -5
- package/lib/tree/elements/tree-item.js +114 -34
- package/lib/tree/elements/tree.d.ts +65 -20
- package/lib/tree/elements/tree.js +151 -34
- package/lib/tree/helpers/filter.d.ts +8 -0
- package/lib/tree/helpers/filter.js +33 -0
- package/lib/tree/helpers/renderer.d.ts +2 -2
- package/lib/tree/helpers/renderer.js +4 -4
- package/lib/tree/helpers/types.d.ts +13 -1
- package/lib/tree/helpers/types.js +0 -1
- package/lib/tree/index.d.ts +4 -4
- package/lib/tree/index.js +3 -4
- package/lib/tree/managers/tree-manager.d.ts +22 -10
- package/lib/tree/managers/tree-manager.js +56 -41
- package/lib/tree/themes/halo/dark/index.js +1 -1
- package/lib/tree/themes/halo/light/index.js +1 -1
- package/lib/tree/themes/solar/charcoal/index.js +1 -1
- package/lib/tree/themes/solar/pearl/index.js +1 -1
- package/lib/tree-select/custom-elements.json +14 -5
- package/lib/tree-select/custom-elements.md +26 -0
- package/lib/tree-select/helpers/types.d.ts +2 -2
- package/lib/tree-select/helpers/types.js +0 -1
- package/lib/tree-select/index.d.ts +55 -27
- package/lib/tree-select/index.js +107 -45
- package/lib/tree-select/themes/halo/dark/index.js +3 -2
- package/lib/tree-select/themes/halo/light/index.js +3 -2
- package/lib/tree-select/themes/solar/charcoal/index.js +3 -2
- package/lib/tree-select/themes/solar/pearl/index.js +3 -2
- package/lib/version.d.ts +1 -0
- package/lib/version.js +1 -0
- package/package.json +601 -25
- package/lib/accordion/index.js.map +0 -1
- package/lib/appstate-bar/index.js.map +0 -1
- package/lib/autosuggest/helpers/const.d.ts +0 -2
- package/lib/autosuggest/helpers/const.js +0 -4
- package/lib/autosuggest/helpers/const.js.map +0 -1
- package/lib/autosuggest/helpers/types.js.map +0 -1
- package/lib/autosuggest/helpers/utils.js.map +0 -1
- package/lib/autosuggest/index.js.map +0 -1
- package/lib/button/index.js.map +0 -1
- package/lib/button-bar/index.js.map +0 -1
- package/lib/calendar/index.js.map +0 -1
- package/lib/calendar/locales.js.map +0 -1
- package/lib/calendar/types.js.map +0 -1
- package/lib/calendar/utils.js.map +0 -1
- package/lib/canvas/index.js.map +0 -1
- package/lib/card/helpers/types.js.map +0 -1
- package/lib/card/index.js.map +0 -1
- package/lib/chart/helpers/legend.js.map +0 -1
- package/lib/chart/helpers/types.js.map +0 -1
- package/lib/chart/index.js.map +0 -1
- package/lib/chart/plugins/doughnut-center-label.js.map +0 -1
- package/lib/checkbox/index.js.map +0 -1
- package/lib/clock/index.js.map +0 -1
- package/lib/clock/utils/TickManager.js.map +0 -1
- package/lib/clock/utils/timestamps.js.map +0 -1
- package/lib/collapse/index.js.map +0 -1
- package/lib/color-dialog/elements/color-palettes.js.map +0 -1
- package/lib/color-dialog/elements/grayscale-palettes.js.map +0 -1
- package/lib/color-dialog/elements/palettes.js.map +0 -1
- package/lib/color-dialog/helpers/color-helpers.js.map +0 -1
- package/lib/color-dialog/helpers/value-model.js.map +0 -1
- package/lib/color-dialog/index.js.map +0 -1
- package/lib/combo-box/helpers/filter.js.map +0 -1
- package/lib/combo-box/helpers/keyboard-event.js.map +0 -1
- package/lib/combo-box/helpers/types.js.map +0 -1
- package/lib/combo-box/index.js.map +0 -1
- package/lib/datetime-picker/index.js.map +0 -1
- package/lib/datetime-picker/locales.js.map +0 -1
- package/lib/datetime-picker/types.js.map +0 -1
- package/lib/datetime-picker/utils.js.map +0 -1
- package/lib/dialog/draggable-element.js.map +0 -1
- package/lib/dialog/index.js.map +0 -1
- package/lib/email-field/index.js.map +0 -1
- package/lib/flag/index.js.map +0 -1
- package/lib/flag/utils/FlagLoader.js.map +0 -1
- package/lib/header/index.js.map +0 -1
- package/lib/heatmap/helpers/color.js.map +0 -1
- package/lib/heatmap/helpers/text.js.map +0 -1
- package/lib/heatmap/helpers/track.js.map +0 -1
- package/lib/heatmap/helpers/types.js.map +0 -1
- package/lib/heatmap/index.js.map +0 -1
- package/lib/icon/index.js.map +0 -1
- package/lib/icon/utils/IconLoader.js.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/interactive-chart/helpers/types.js.map +0 -1
- package/lib/interactive-chart/index.js.map +0 -1
- package/lib/item/helpers/types.js.map +0 -1
- package/lib/item/index.js.map +0 -1
- package/lib/label/helpers/text.d.ts +0 -35
- package/lib/label/helpers/text.js +0 -57
- package/lib/label/helpers/text.js.map +0 -1
- package/lib/label/index.js.map +0 -1
- package/lib/layout/index.js.map +0 -1
- package/lib/led-gauge/index.js.map +0 -1
- package/lib/list/extensible-function.js.map +0 -1
- package/lib/list/helpers/list-renderer.js.map +0 -1
- package/lib/list/helpers/types.js.map +0 -1
- package/lib/list/index.js.map +0 -1
- package/lib/list/renderer.js.map +0 -1
- package/lib/loader/index.js.map +0 -1
- package/lib/multi-input/helpers/types.js.map +0 -1
- package/lib/multi-input/index.js.map +0 -1
- package/lib/notification/elements/notification-tray.js.map +0 -1
- package/lib/notification/elements/notification.js.map +0 -1
- package/lib/notification/helpers/status.js.map +0 -1
- package/lib/notification/helpers/types.js.map +0 -1
- package/lib/notification/index.js.map +0 -1
- package/lib/number-field/index.js.map +0 -1
- package/lib/overlay/elements/overlay-backdrop.js.map +0 -1
- package/lib/overlay/elements/overlay-viewport.js.map +0 -1
- package/lib/overlay/elements/overlay.js.map +0 -1
- package/lib/overlay/helpers/functions.js.map +0 -1
- package/lib/overlay/helpers/types.js.map +0 -1
- package/lib/overlay/index.js.map +0 -1
- package/lib/overlay/managers/backdrop-manager.js.map +0 -1
- package/lib/overlay/managers/close-manager.js.map +0 -1
- package/lib/overlay/managers/focus-manager.js.map +0 -1
- package/lib/overlay/managers/interaction-lock-manager.js.map +0 -1
- package/lib/overlay/managers/viewport-manager.js.map +0 -1
- package/lib/overlay/managers/zindex-manager.js.map +0 -1
- package/lib/overlay-menu/helpers/types.js.map +0 -1
- package/lib/overlay-menu/helpers/uuid.d.ts +0 -7
- package/lib/overlay-menu/helpers/uuid.js +0 -14
- package/lib/overlay-menu/helpers/uuid.js.map +0 -1
- package/lib/overlay-menu/index.js.map +0 -1
- package/lib/overlay-menu/managers/menu-manager.js.map +0 -1
- package/lib/pagination/helpers/types.d.ts +0 -9
- package/lib/pagination/helpers/types.js +0 -2
- package/lib/pagination/helpers/types.js.map +0 -1
- package/lib/pagination/index.js.map +0 -1
- package/lib/panel/index.js.map +0 -1
- package/lib/password-field/index.js.map +0 -1
- package/lib/pill/index.js.map +0 -1
- package/lib/progress-bar/index.js.map +0 -1
- package/lib/radio-button/index.js.map +0 -1
- package/lib/radio-button/radio-button-registry.js.map +0 -1
- package/lib/rating/index.js.map +0 -1
- package/lib/search-field/index.js.map +0 -1
- package/lib/select/helpers/types.js.map +0 -1
- package/lib/select/index.js.map +0 -1
- package/lib/sidebar-layout/index.js.map +0 -1
- package/lib/slider/index.js.map +0 -1
- package/lib/sparkline/index.js.map +0 -1
- package/lib/swing-gauge/helpers/canvas.d.ts +0 -8
- package/lib/swing-gauge/helpers/canvas.js +0 -115
- package/lib/swing-gauge/helpers/canvas.js.map +0 -1
- package/lib/swing-gauge/helpers/types.d.ts +0 -33
- package/lib/swing-gauge/helpers/types.js +0 -2
- package/lib/swing-gauge/helpers/types.js.map +0 -1
- package/lib/swing-gauge/index.js.map +0 -1
- package/lib/tab/index.js.map +0 -1
- package/lib/tab-bar/helpers/animate.js.map +0 -1
- package/lib/tab-bar/index.js.map +0 -1
- package/lib/text-field/index.js.map +0 -1
- package/lib/time-picker/index.js.map +0 -1
- package/lib/toggle/index.js.map +0 -1
- package/lib/tooltip/elements/title-tooltip.js.map +0 -1
- package/lib/tooltip/elements/tooltip-element.js.map +0 -1
- package/lib/tooltip/helpers/overflow-tooltip.js.map +0 -1
- package/lib/tooltip/helpers/renderer.js.map +0 -1
- package/lib/tooltip/helpers/types.js.map +0 -1
- package/lib/tooltip/index.js.map +0 -1
- package/lib/tooltip/managers/tooltip-manager.js.map +0 -1
- package/lib/tornado-chart/elements/tornado-chart.js.map +0 -1
- package/lib/tornado-chart/elements/tornado-item.js.map +0 -1
- package/lib/tornado-chart/index.js.map +0 -1
- package/lib/tree/elements/tree-item.js.map +0 -1
- package/lib/tree/elements/tree.js.map +0 -1
- package/lib/tree/helpers/renderer.js.map +0 -1
- package/lib/tree/helpers/types.js.map +0 -1
- package/lib/tree/index.js.map +0 -1
- package/lib/tree/managers/tree-manager.js.map +0 -1
- package/lib/tree-select/helpers/types.js.map +0 -1
- package/lib/tree-select/index.js.map +0 -1
package/lib/pagination/index.js
CHANGED
|
@@ -1,244 +1,388 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
7
|
-
import {
|
|
8
|
-
import '
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { BasicElement, html, css, WarningNotice, DeprecationNotice } from '@refinitiv-ui/core';
|
|
3
|
+
import { customElement } from '@refinitiv-ui/core/lib/decorators/custom-element.js';
|
|
4
|
+
import { property } from '@refinitiv-ui/core/lib/decorators/property.js';
|
|
5
|
+
import { state } from '@refinitiv-ui/core/lib/decorators/state.js';
|
|
6
|
+
import { query } from '@refinitiv-ui/core/lib/decorators/query.js';
|
|
7
|
+
import { VERSION } from '../version.js';
|
|
8
|
+
import '../button/index.js';
|
|
9
|
+
import '../button-bar/index.js';
|
|
10
|
+
import '../layout/index.js';
|
|
11
|
+
import '../text-field/index.js';
|
|
12
|
+
import '@refinitiv-ui/phrasebook/lib/locale/en/pagination.js';
|
|
9
13
|
import { translate } from '@refinitiv-ui/translate';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
import '../text-field';
|
|
14
|
+
const pageDeprecation = new DeprecationNotice('Property `page` is deprecated, use `value` instead.');
|
|
15
|
+
const pageSizeDeprecation = new DeprecationNotice('Property `pageSize ` is deprecated, use `max` instead.');
|
|
16
|
+
const totalItemsDeprecation = new DeprecationNotice('Property `totalItems ` is deprecated, use `max` instead.');
|
|
14
17
|
/**
|
|
15
18
|
* Used to control and navigate through multiple pages
|
|
16
|
-
* @fires
|
|
19
|
+
* @fires value-changed - Fired when the `value` property is changed
|
|
17
20
|
*/
|
|
18
21
|
let Pagination = class Pagination extends BasicElement {
|
|
19
22
|
constructor() {
|
|
20
23
|
super(...arguments);
|
|
21
24
|
/**
|
|
22
|
-
*
|
|
25
|
+
* Current page internal current page value
|
|
26
|
+
*/
|
|
27
|
+
this._value = '';
|
|
28
|
+
/**
|
|
29
|
+
* Max page
|
|
23
30
|
*/
|
|
24
|
-
this.
|
|
31
|
+
this._max = '';
|
|
25
32
|
/**
|
|
26
|
-
* Number of item per page
|
|
33
|
+
* Number of item per page internal value
|
|
34
|
+
* @deprecated
|
|
27
35
|
*/
|
|
28
|
-
this.
|
|
36
|
+
this._pageSize = '';
|
|
29
37
|
/**
|
|
30
|
-
* Total items
|
|
38
|
+
* Total items internal value
|
|
39
|
+
* @deprecated
|
|
31
40
|
*/
|
|
32
|
-
this.
|
|
41
|
+
this._totalItems = '';
|
|
33
42
|
/**
|
|
34
43
|
* Set state to disable
|
|
35
44
|
*/
|
|
36
45
|
this.disabled = false;
|
|
46
|
+
/**
|
|
47
|
+
* State for check the input focus
|
|
48
|
+
*/
|
|
49
|
+
this.inputFocused = false;
|
|
37
50
|
}
|
|
38
51
|
/**
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
* and the internal template of the element.
|
|
42
|
-
* @return CSS template
|
|
52
|
+
* Element version number
|
|
53
|
+
* @returns version number
|
|
43
54
|
*/
|
|
44
|
-
static get
|
|
45
|
-
return
|
|
46
|
-
:host {
|
|
47
|
-
display: block;
|
|
48
|
-
--responsive-width: 450;
|
|
49
|
-
}
|
|
50
|
-
`;
|
|
55
|
+
static get version() {
|
|
56
|
+
return VERSION;
|
|
51
57
|
}
|
|
52
58
|
/**
|
|
53
|
-
*
|
|
54
|
-
* @
|
|
55
|
-
* @returns {void}
|
|
59
|
+
* Internal current page
|
|
60
|
+
* @returns current page
|
|
56
61
|
*/
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
if (
|
|
60
|
-
|
|
62
|
+
get internalValue() {
|
|
63
|
+
let value = parseInt(this._value, 10) || 0;
|
|
64
|
+
if (value <= 0) {
|
|
65
|
+
value = 1;
|
|
61
66
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
return value;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Current page
|
|
71
|
+
*/
|
|
72
|
+
get value() {
|
|
73
|
+
return this._value;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Set current page
|
|
77
|
+
* @param value current page
|
|
78
|
+
*/
|
|
79
|
+
set value(value) {
|
|
80
|
+
let newValue = value;
|
|
81
|
+
if (!newValue || !this.validatePage(newValue, true, 'value')) {
|
|
82
|
+
newValue = '';
|
|
69
83
|
}
|
|
70
|
-
|
|
71
|
-
|
|
84
|
+
const oldValue = this._value;
|
|
85
|
+
if (oldValue !== newValue) {
|
|
86
|
+
this._value = newValue.toString();
|
|
72
87
|
}
|
|
88
|
+
this.requestUpdate('value', oldValue);
|
|
73
89
|
}
|
|
74
90
|
/**
|
|
75
|
-
*
|
|
76
|
-
* @returns
|
|
91
|
+
* Internal max page
|
|
92
|
+
* @returns max page
|
|
77
93
|
*/
|
|
78
|
-
|
|
79
|
-
const
|
|
80
|
-
const pageSize =
|
|
81
|
-
|
|
82
|
-
if (
|
|
83
|
-
|
|
94
|
+
get internalMax() {
|
|
95
|
+
const max = parseInt(this._max, 10) || 0;
|
|
96
|
+
const pageSize = this.internalPageSize;
|
|
97
|
+
const totalItems = this.internalTotalitems;
|
|
98
|
+
if (!max && !totalItems) {
|
|
99
|
+
return Infinity;
|
|
84
100
|
}
|
|
85
|
-
if (
|
|
86
|
-
|
|
101
|
+
else if (max >= 1) {
|
|
102
|
+
return max;
|
|
87
103
|
}
|
|
88
|
-
|
|
104
|
+
if (pageSize > 0) {
|
|
105
|
+
const totalPage = Math.ceil(totalItems / pageSize);
|
|
106
|
+
return totalPage >= 1 ? totalPage : 1;
|
|
107
|
+
}
|
|
108
|
+
return 1;
|
|
89
109
|
}
|
|
90
110
|
/**
|
|
91
|
-
*
|
|
92
|
-
* @returns
|
|
111
|
+
* Max page
|
|
112
|
+
* @returns max page
|
|
113
|
+
*/
|
|
114
|
+
get max() {
|
|
115
|
+
return this._max;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Set max page
|
|
119
|
+
* @param value max page
|
|
93
120
|
*/
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
if (totalItems < 1) {
|
|
99
|
-
this.totalItems = '0';
|
|
100
|
-
this.page = '1';
|
|
121
|
+
set max(value) {
|
|
122
|
+
let newValue = value;
|
|
123
|
+
if (!newValue || !this.validatePage(value, true, 'max')) {
|
|
124
|
+
newValue = '';
|
|
101
125
|
}
|
|
102
|
-
|
|
103
|
-
|
|
126
|
+
const oldValue = this._max;
|
|
127
|
+
if (oldValue !== newValue) {
|
|
128
|
+
this._max = newValue.toString();
|
|
104
129
|
}
|
|
105
|
-
this.
|
|
130
|
+
this.requestUpdate('max', oldValue);
|
|
106
131
|
}
|
|
107
132
|
/**
|
|
108
|
-
*
|
|
109
|
-
* @returns
|
|
133
|
+
* Current page
|
|
134
|
+
* @returns current page
|
|
135
|
+
* @deprecated
|
|
136
|
+
* @ignore
|
|
137
|
+
*/
|
|
138
|
+
get page() {
|
|
139
|
+
pageDeprecation.once();
|
|
140
|
+
return this._value;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Set current page
|
|
144
|
+
* @param value - Set current page
|
|
145
|
+
* @deprecated
|
|
146
|
+
* @ignore
|
|
110
147
|
*/
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
148
|
+
set page(value) {
|
|
149
|
+
pageDeprecation.show();
|
|
150
|
+
let newValue = value;
|
|
151
|
+
if (!newValue || !this.validatePage(value, true, 'page')) {
|
|
152
|
+
newValue = '';
|
|
114
153
|
}
|
|
115
|
-
|
|
116
|
-
|
|
154
|
+
const oldValue = this._value;
|
|
155
|
+
if (oldValue !== newValue) {
|
|
156
|
+
this._value = newValue.toString();
|
|
117
157
|
}
|
|
118
|
-
this.
|
|
119
|
-
// recalculate button state
|
|
120
|
-
this.updateButtons();
|
|
158
|
+
this.requestUpdate('page', oldValue);
|
|
121
159
|
}
|
|
122
160
|
/**
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
* @
|
|
161
|
+
* Number of item per page
|
|
162
|
+
* @returns number of items per page
|
|
163
|
+
* @deprecated
|
|
164
|
+
* @ignore
|
|
127
165
|
*/
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
const lastPage = this.disabled || page >= this.totalPage;
|
|
132
|
-
this.previousPageButton.disabled = firstPage;
|
|
133
|
-
this.firstPageButton.disabled = firstPage;
|
|
134
|
-
this.nextPageButton.disabled = lastPage;
|
|
135
|
-
this.lastPageButton.disabled = lastPage;
|
|
166
|
+
get pageSize() {
|
|
167
|
+
pageSizeDeprecation.once();
|
|
168
|
+
return this._pageSize;
|
|
136
169
|
}
|
|
137
170
|
/**
|
|
138
|
-
*
|
|
139
|
-
*
|
|
140
|
-
* @
|
|
171
|
+
* Set number of item per page
|
|
172
|
+
* @param value - number of item per page
|
|
173
|
+
* @deprecated
|
|
174
|
+
* @ignore
|
|
141
175
|
*/
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
if (
|
|
146
|
-
|
|
147
|
-
return totalPage > 0 ? totalPage : 1;
|
|
176
|
+
set pageSize(value) {
|
|
177
|
+
pageSizeDeprecation.show();
|
|
178
|
+
let newValue = value;
|
|
179
|
+
if (!newValue || !this.validatePage(value, true, 'page-size')) {
|
|
180
|
+
newValue = '';
|
|
148
181
|
}
|
|
149
|
-
|
|
182
|
+
// Validate to show warning only, need to keep developer value.
|
|
183
|
+
// Check page still is in supported range if page-size changed
|
|
184
|
+
const newTotalPage = Math.ceil(this.internalTotalitems / (parseInt(newValue, 10) || 1)) || 1;
|
|
185
|
+
if (this.internalValue > newTotalPage) {
|
|
186
|
+
new WarningNotice(`${this.localName} : The specified value "${newValue}" of page-size caused the value of page property is out of supported range.`).show();
|
|
187
|
+
}
|
|
188
|
+
const oldValue = this._pageSize;
|
|
189
|
+
if (oldValue !== newValue) {
|
|
190
|
+
this._pageSize = newValue;
|
|
191
|
+
}
|
|
192
|
+
this.requestUpdate('pageSize', oldValue);
|
|
150
193
|
}
|
|
151
194
|
/**
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
* @param oldPage a old page value
|
|
156
|
-
* @param newPage a new page value
|
|
157
|
-
* @return return a new page value
|
|
195
|
+
* Internal page size
|
|
196
|
+
* @deprecated
|
|
197
|
+
* @returns page size
|
|
158
198
|
*/
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
199
|
+
get internalPageSize() {
|
|
200
|
+
return parseInt(this._pageSize, 10);
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Internal total items
|
|
204
|
+
* @returns total items
|
|
205
|
+
* @deprecated
|
|
206
|
+
*/
|
|
207
|
+
get internalTotalitems() {
|
|
208
|
+
const totalItems = parseInt(this._totalItems, 10) || 0;
|
|
209
|
+
return totalItems >= 1 ? totalItems : 0;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Total items
|
|
213
|
+
* @returns total items
|
|
214
|
+
* @deprecated
|
|
215
|
+
* @ignore
|
|
216
|
+
*/
|
|
217
|
+
get totalItems() {
|
|
218
|
+
totalItemsDeprecation.once();
|
|
219
|
+
return this._totalItems;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Set total items
|
|
223
|
+
* @param value total items
|
|
224
|
+
* @deprecated
|
|
225
|
+
* @ignore
|
|
226
|
+
*/
|
|
227
|
+
set totalItems(value) {
|
|
228
|
+
totalItemsDeprecation.show();
|
|
229
|
+
let newValue = value;
|
|
230
|
+
if (!newValue || !this.validatePage(value, true, 'total-items')) {
|
|
231
|
+
newValue = '';
|
|
163
232
|
}
|
|
164
|
-
|
|
165
|
-
|
|
233
|
+
// Validate to show warning only, need to keep developer value.
|
|
234
|
+
// Check page still is in supported range if total-item changed
|
|
235
|
+
const newTotalPage = Math.ceil((parseInt(newValue, 10) || 1) / this.internalPageSize) || 1;
|
|
236
|
+
if (this.internalValue > newTotalPage) {
|
|
237
|
+
new WarningNotice(`${this.localName} : The specified value "${newValue}" of total-items caused the value of page property is out of supported range.`).show();
|
|
166
238
|
}
|
|
167
|
-
|
|
168
|
-
|
|
239
|
+
const oldValue = this._totalItems;
|
|
240
|
+
if (oldValue !== newValue) {
|
|
241
|
+
this._totalItems = newValue;
|
|
169
242
|
}
|
|
170
|
-
|
|
243
|
+
this.requestUpdate('totalItems', oldValue);
|
|
171
244
|
}
|
|
172
245
|
/**
|
|
173
|
-
* Get
|
|
174
|
-
* @returns
|
|
246
|
+
* Get infinite pagination state
|
|
247
|
+
* @returns infinite pagination state
|
|
175
248
|
*/
|
|
176
|
-
get
|
|
177
|
-
|
|
178
|
-
const pageSize = Number.parseInt(this.pageSize, 10);
|
|
179
|
-
const totalCount = Number.parseInt(this.totalItems, 10);
|
|
180
|
-
const from = ((page - 1) * pageSize) + 1;
|
|
181
|
-
const to = page * pageSize > totalCount ? totalCount : page * pageSize;
|
|
182
|
-
return {
|
|
183
|
-
from,
|
|
184
|
-
to,
|
|
185
|
-
totalCount,
|
|
186
|
-
pageSize
|
|
187
|
-
};
|
|
249
|
+
get infinitePaginate() {
|
|
250
|
+
return this.internalMax === Infinity; // internalMax always returns 1-Infinity
|
|
188
251
|
}
|
|
189
252
|
/**
|
|
190
|
-
*
|
|
191
|
-
* @returns
|
|
253
|
+
* Getter for display text in the input
|
|
254
|
+
* @returns input text
|
|
192
255
|
*/
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
256
|
+
get inputText() {
|
|
257
|
+
if (this.inputFocused) {
|
|
258
|
+
return this.internalValue.toString();
|
|
259
|
+
}
|
|
260
|
+
else {
|
|
261
|
+
return (this.infinitePaginate ? this.t('PAGE', { page: this.internalValue }) : this.t('PAGE_OF', { page: this.internalValue, pageTotal: this.internalMax }));
|
|
262
|
+
}
|
|
196
263
|
}
|
|
197
264
|
/**
|
|
198
|
-
*
|
|
199
|
-
* @returns {void}
|
|
265
|
+
* State for checking the first page button is available
|
|
200
266
|
*/
|
|
201
|
-
|
|
202
|
-
this.
|
|
203
|
-
setTimeout(() => {
|
|
204
|
-
this.input.select();
|
|
205
|
-
});
|
|
267
|
+
get useFirstButton() {
|
|
268
|
+
return !this.disabled && this.internalValue >= 2;
|
|
206
269
|
}
|
|
207
270
|
/**
|
|
208
|
-
*
|
|
209
|
-
* @param event Event object
|
|
210
|
-
* @returns {void}
|
|
271
|
+
* State for checking the previous page button is available
|
|
211
272
|
*/
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
273
|
+
get usePreviousButton() {
|
|
274
|
+
return this.useFirstButton;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* State for checking the next page button is available
|
|
278
|
+
*/
|
|
279
|
+
get useNextButton() {
|
|
280
|
+
return !this.disabled && this.internalValue < this.internalMax;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* State for checking the last page button is available
|
|
284
|
+
*/
|
|
285
|
+
get useLastButton() {
|
|
286
|
+
return this.useNextButton && !this.infinitePaginate;
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* @override
|
|
290
|
+
*/
|
|
291
|
+
updated(changedProperties) {
|
|
292
|
+
super.updated(changedProperties);
|
|
293
|
+
if (this.inputFocused && changedProperties.has('inputFocused')) {
|
|
294
|
+
void this.selectInput();
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Validate page value which returns true when value is valid
|
|
299
|
+
* @param value value
|
|
300
|
+
* @param warning show warning message when value is invalid
|
|
301
|
+
* @param propName property name to show in warning message
|
|
302
|
+
* @returns result of validation
|
|
303
|
+
*/
|
|
304
|
+
validatePage(value, warning = false, propName = '') {
|
|
305
|
+
if ((/^[1-9]([0-9]+)?$/).test(value)) {
|
|
306
|
+
return true;
|
|
307
|
+
}
|
|
308
|
+
else {
|
|
309
|
+
if (value !== null && warning && propName) {
|
|
310
|
+
new WarningNotice(`${this.localName} : The specified value "${value}" of ${propName} property is not valid, The value must be integer and greater than 0.`).show();
|
|
311
|
+
}
|
|
312
|
+
return false;
|
|
219
313
|
}
|
|
220
314
|
}
|
|
221
315
|
/**
|
|
222
|
-
* Handles action when Enter key is press onto the input
|
|
316
|
+
* Handles action when Enter and Tab key is press onto the input
|
|
223
317
|
* @param event Keyboard event
|
|
224
318
|
* @returns {void}
|
|
225
319
|
*/
|
|
226
320
|
onInputKeyDown(event) {
|
|
227
321
|
var _a, _b;
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
322
|
+
const isEnter = event.key === 'Enter' || event.keyCode === 13;
|
|
323
|
+
const isTab = event.key === 'Tab' || event.keyCode === 9;
|
|
324
|
+
if (isEnter || isTab) {
|
|
325
|
+
this.updatePageInput();
|
|
326
|
+
if (isEnter) {
|
|
327
|
+
this.input.blur();
|
|
328
|
+
event.preventDefault();
|
|
329
|
+
/**
|
|
330
|
+
* Issue only in firefox
|
|
331
|
+
* cannot blur() or focus() to this.input so create a temp to this.input loses focus
|
|
332
|
+
*/
|
|
333
|
+
const temp = document.createElement('input');
|
|
334
|
+
(_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.appendChild(temp);
|
|
335
|
+
temp.focus();
|
|
336
|
+
this.input.blur();
|
|
337
|
+
(_b = this.shadowRoot) === null || _b === void 0 ? void 0 : _b.removeChild(temp);
|
|
338
|
+
}
|
|
240
339
|
}
|
|
241
340
|
}
|
|
341
|
+
/**
|
|
342
|
+
* Handles action when input focused change
|
|
343
|
+
* @param event focus change event
|
|
344
|
+
* @returns {void}
|
|
345
|
+
*/
|
|
346
|
+
onInputFocusedChanged(event) {
|
|
347
|
+
this.inputFocused = event.detail.value;
|
|
348
|
+
if (!this.inputFocused) {
|
|
349
|
+
this.updatePageInput();
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* Update page by using value from the input
|
|
354
|
+
* @returns {void}
|
|
355
|
+
*/
|
|
356
|
+
updatePageInput() {
|
|
357
|
+
// Prevent update page to the same value
|
|
358
|
+
if (this.value === this.input.value) {
|
|
359
|
+
return;
|
|
360
|
+
}
|
|
361
|
+
const oldValue = this.value;
|
|
362
|
+
let newValue = parseInt(this.input.value, 10);
|
|
363
|
+
// Reset input and boundary value into supported range.
|
|
364
|
+
if (this.validatePage(this.input.value)) {
|
|
365
|
+
if (newValue > this.internalMax) {
|
|
366
|
+
newValue = this.internalMax;
|
|
367
|
+
}
|
|
368
|
+
this.value = newValue.toString();
|
|
369
|
+
}
|
|
370
|
+
// When input value is invalid in case less than support range (value<1), then reset value = '1'.
|
|
371
|
+
else if (!isNaN(newValue) && newValue < 1) {
|
|
372
|
+
this.value = '1';
|
|
373
|
+
}
|
|
374
|
+
if (this.value !== oldValue) {
|
|
375
|
+
this.notifyValueChange();
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* Select text in input when update element complete
|
|
380
|
+
* @returns returns a promise void
|
|
381
|
+
*/
|
|
382
|
+
async selectInput() {
|
|
383
|
+
await this.updateComplete;
|
|
384
|
+
this.input.select();
|
|
385
|
+
}
|
|
242
386
|
/**
|
|
243
387
|
* Updates page value depending on direction
|
|
244
388
|
* @param direction page value direction
|
|
@@ -246,21 +390,35 @@ let Pagination = class Pagination extends BasicElement {
|
|
|
246
390
|
* @returns {void}
|
|
247
391
|
*/
|
|
248
392
|
updatePage(direction, event = false) {
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
393
|
+
/**
|
|
394
|
+
* Handle in case the value of max property is greater than value of value/page property,
|
|
395
|
+
* which it might happen by using developer API.
|
|
396
|
+
*/
|
|
397
|
+
let page = this.internalValue;
|
|
398
|
+
if (page > this.internalMax) {
|
|
399
|
+
page = this.internalMax + 1;
|
|
400
|
+
}
|
|
401
|
+
const limit = direction === 'increment' ? page >= this.internalMax : page <= 1;
|
|
402
|
+
if (!limit) {
|
|
403
|
+
this.value = direction === 'increment' ? (page + 1).toString() : (page - 1).toString();
|
|
253
404
|
if (event) {
|
|
254
|
-
this.
|
|
405
|
+
this.notifyValueChange();
|
|
255
406
|
}
|
|
256
407
|
}
|
|
257
408
|
}
|
|
409
|
+
/**
|
|
410
|
+
* Fires event when value change
|
|
411
|
+
* @returns {void}
|
|
412
|
+
*/
|
|
413
|
+
notifyValueChange() {
|
|
414
|
+
this.notifyPropertyChange('value', this.value);
|
|
415
|
+
this.notifyPropertyChange('page', this.value); // deprecated. support backwards compatibility.
|
|
416
|
+
}
|
|
258
417
|
/**
|
|
259
418
|
* Go to the next page
|
|
260
419
|
* @returns {void}
|
|
261
420
|
*/
|
|
262
421
|
next() {
|
|
263
|
-
this.input.blur();
|
|
264
422
|
this.updatePage('increment');
|
|
265
423
|
}
|
|
266
424
|
/**
|
|
@@ -268,7 +426,6 @@ let Pagination = class Pagination extends BasicElement {
|
|
|
268
426
|
* @returns {void}
|
|
269
427
|
*/
|
|
270
428
|
onNextTap() {
|
|
271
|
-
this.input.blur();
|
|
272
429
|
this.updatePage('increment', true);
|
|
273
430
|
}
|
|
274
431
|
/**
|
|
@@ -276,15 +433,13 @@ let Pagination = class Pagination extends BasicElement {
|
|
|
276
433
|
* @returns {void}
|
|
277
434
|
*/
|
|
278
435
|
previous() {
|
|
279
|
-
this.input.blur();
|
|
280
436
|
this.updatePage('decrement');
|
|
281
437
|
}
|
|
282
438
|
/**
|
|
283
|
-
* Go to the previous page and fires
|
|
439
|
+
* Go to the previous page and fires event
|
|
284
440
|
* @returns {void}
|
|
285
441
|
*/
|
|
286
442
|
onPreviousTap() {
|
|
287
|
-
this.input.blur();
|
|
288
443
|
this.updatePage('decrement', true);
|
|
289
444
|
}
|
|
290
445
|
/**
|
|
@@ -292,8 +447,7 @@ let Pagination = class Pagination extends BasicElement {
|
|
|
292
447
|
* @returns {void}
|
|
293
448
|
*/
|
|
294
449
|
first() {
|
|
295
|
-
this.
|
|
296
|
-
this.page = '1';
|
|
450
|
+
this.value = '1';
|
|
297
451
|
}
|
|
298
452
|
/**
|
|
299
453
|
* Go to the first page and fires event
|
|
@@ -301,15 +455,18 @@ let Pagination = class Pagination extends BasicElement {
|
|
|
301
455
|
*/
|
|
302
456
|
onFirstTap() {
|
|
303
457
|
this.first();
|
|
304
|
-
this.
|
|
458
|
+
this.notifyValueChange();
|
|
305
459
|
}
|
|
306
460
|
/**
|
|
307
461
|
* Go to the last page
|
|
308
462
|
* @returns {void}
|
|
309
463
|
*/
|
|
310
464
|
last() {
|
|
311
|
-
this.
|
|
312
|
-
|
|
465
|
+
if (this.infinitePaginate) {
|
|
466
|
+
new WarningNotice(`${this.localName}: Cannot call "last()" when "max" attribute/property is unset.`).show();
|
|
467
|
+
return;
|
|
468
|
+
}
|
|
469
|
+
this.value = this.internalMax.toString();
|
|
313
470
|
}
|
|
314
471
|
/**
|
|
315
472
|
* Go to the last page and fires event
|
|
@@ -317,35 +474,44 @@ let Pagination = class Pagination extends BasicElement {
|
|
|
317
474
|
*/
|
|
318
475
|
onLastTap() {
|
|
319
476
|
this.last();
|
|
320
|
-
this.
|
|
477
|
+
this.notifyValueChange();
|
|
478
|
+
}
|
|
479
|
+
/**
|
|
480
|
+
* A `CSSResultGroup` that will be used
|
|
481
|
+
* to style the host, slotted children
|
|
482
|
+
* and the internal template of the element.
|
|
483
|
+
* @return CSS template
|
|
484
|
+
*/
|
|
485
|
+
static get styles() {
|
|
486
|
+
return css `
|
|
487
|
+
:host {
|
|
488
|
+
display: inline-block;
|
|
489
|
+
}
|
|
490
|
+
`;
|
|
321
491
|
}
|
|
322
492
|
/**
|
|
323
493
|
* A `TemplateResult` that will be used
|
|
324
494
|
* to render the updated internal template.
|
|
325
|
-
* @return
|
|
495
|
+
* @return Render template
|
|
326
496
|
*/
|
|
327
497
|
render() {
|
|
328
498
|
return html `
|
|
329
|
-
<ef-layout part="container" flex nowrap
|
|
330
|
-
<div id="info" part="info">${this.t('ITEM_INFO', this.pageInfo)}</div>
|
|
499
|
+
<ef-layout part="container" flex nowrap>
|
|
331
500
|
<ef-button-bar part="buttons">
|
|
332
|
-
<ef-button id="first" icon="skip-to-start" @tap="${this.onFirstTap}"></ef-button>
|
|
333
|
-
<ef-button id="previous" icon="left" @tap="${this.onPreviousTap}"></ef-button>
|
|
501
|
+
<ef-button id="first" icon="skip-to-start" @tap="${this.onFirstTap}" .disabled=${!this.useFirstButton}></ef-button>
|
|
502
|
+
<ef-button id="previous" icon="left" @tap="${this.onPreviousTap}" .disabled=${!this.usePreviousButton}></ef-button>
|
|
334
503
|
</ef-button-bar>
|
|
335
504
|
<ef-text-field
|
|
336
505
|
id="input"
|
|
337
506
|
part="input"
|
|
338
|
-
@
|
|
339
|
-
@
|
|
340
|
-
|
|
341
|
-
.
|
|
342
|
-
page: this.page,
|
|
343
|
-
pageTotal: this.totalPage
|
|
344
|
-
})}"
|
|
507
|
+
@focused-changed=${this.onInputFocusedChanged}
|
|
508
|
+
@keydown=${this.onInputKeyDown}
|
|
509
|
+
.value=${this.inputText}
|
|
510
|
+
.disabled=${this.disabled}
|
|
345
511
|
no-spinner></ef-text-field>
|
|
346
512
|
<ef-button-bar part="buttons">
|
|
347
|
-
<ef-button id="next" icon="right" @tap="${this.onNextTap}"></ef-button>
|
|
348
|
-
<ef-button id="last" icon="skip-to-end" @tap="${this.onLastTap}"></ef-button>
|
|
513
|
+
<ef-button id="next" icon="right" @tap="${this.onNextTap}" .disabled=${!this.useNextButton}></ef-button>
|
|
514
|
+
<ef-button id="last" icon="skip-to-end" @tap="${this.onLastTap}" .disabled=${!this.useLastButton}></ef-button>
|
|
349
515
|
</ef-button-bar>
|
|
350
516
|
</ef-layout>
|
|
351
517
|
`;
|
|
@@ -353,41 +519,34 @@ let Pagination = class Pagination extends BasicElement {
|
|
|
353
519
|
};
|
|
354
520
|
__decorate([
|
|
355
521
|
property({ type: String })
|
|
356
|
-
], Pagination.prototype, "
|
|
522
|
+
], Pagination.prototype, "value", null);
|
|
523
|
+
__decorate([
|
|
524
|
+
property({ type: String })
|
|
525
|
+
], Pagination.prototype, "max", null);
|
|
526
|
+
__decorate([
|
|
527
|
+
property({ type: String })
|
|
528
|
+
], Pagination.prototype, "page", null);
|
|
357
529
|
__decorate([
|
|
358
530
|
property({ type: String, attribute: 'page-size' })
|
|
359
|
-
], Pagination.prototype, "pageSize",
|
|
531
|
+
], Pagination.prototype, "pageSize", null);
|
|
360
532
|
__decorate([
|
|
361
533
|
property({ type: String, attribute: 'total-items' })
|
|
362
|
-
], Pagination.prototype, "totalItems",
|
|
534
|
+
], Pagination.prototype, "totalItems", null);
|
|
363
535
|
__decorate([
|
|
364
536
|
property({ type: Boolean, reflect: true })
|
|
365
537
|
], Pagination.prototype, "disabled", void 0);
|
|
366
|
-
__decorate([
|
|
367
|
-
query('#info')
|
|
368
|
-
], Pagination.prototype, "infoElement", void 0);
|
|
369
538
|
__decorate([
|
|
370
539
|
query('#input')
|
|
371
540
|
], Pagination.prototype, "input", void 0);
|
|
372
|
-
__decorate([
|
|
373
|
-
query('#first')
|
|
374
|
-
], Pagination.prototype, "firstPageButton", void 0);
|
|
375
|
-
__decorate([
|
|
376
|
-
query('#previous')
|
|
377
|
-
], Pagination.prototype, "previousPageButton", void 0);
|
|
378
|
-
__decorate([
|
|
379
|
-
query('#next')
|
|
380
|
-
], Pagination.prototype, "nextPageButton", void 0);
|
|
381
|
-
__decorate([
|
|
382
|
-
query('#last')
|
|
383
|
-
], Pagination.prototype, "lastPageButton", void 0);
|
|
384
541
|
__decorate([
|
|
385
542
|
translate()
|
|
386
543
|
], Pagination.prototype, "t", void 0);
|
|
544
|
+
__decorate([
|
|
545
|
+
state()
|
|
546
|
+
], Pagination.prototype, "inputFocused", void 0);
|
|
387
547
|
Pagination = __decorate([
|
|
388
548
|
customElement('ef-pagination', {
|
|
389
549
|
alias: 'emerald-pagination'
|
|
390
550
|
})
|
|
391
551
|
], Pagination);
|
|
392
552
|
export { Pagination };
|
|
393
|
-
//# sourceMappingURL=index.js.map
|