@refinitiv-ui/elements 5.12.2 → 6.0.0-next.2
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/README.md +4 -4
- package/lib/accordion/index.d.ts +5 -0
- package/lib/accordion/index.js +2 -2
- package/lib/accordion/themes/halo/dark/index.js +1 -1
- package/lib/accordion/themes/halo/light/index.js +1 -1
- package/lib/accordion/themes/solar/charcoal/index.js +1 -1
- package/lib/accordion/themes/solar/pearl/index.js +1 -1
- package/lib/appstate-bar/index.d.ts +11 -0
- package/lib/appstate-bar/index.js +8 -3
- package/lib/appstate-bar/themes/halo/dark/index.js +1 -1
- package/lib/appstate-bar/themes/halo/light/index.js +1 -1
- package/lib/appstate-bar/themes/solar/charcoal/index.js +1 -1
- package/lib/appstate-bar/themes/solar/pearl/index.js +1 -1
- package/lib/autosuggest/index.d.ts +5 -0
- package/lib/autosuggest/index.js +22 -12
- package/lib/autosuggest/themes/halo/dark/index.js +3 -3
- package/lib/autosuggest/themes/halo/light/index.js +3 -3
- package/lib/autosuggest/themes/solar/charcoal/index.js +3 -3
- package/lib/autosuggest/themes/solar/pearl/index.js +3 -3
- package/lib/button/index.d.ts +7 -13
- package/lib/button/index.js +8 -43
- 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/index.d.ts +5 -0
- package/lib/button-bar/index.js +4 -5
- package/lib/button-bar/themes/halo/dark/index.js +1 -1
- package/lib/button-bar/themes/halo/light/index.js +1 -1
- package/lib/button-bar/themes/solar/charcoal/index.js +1 -1
- package/lib/button-bar/themes/solar/pearl/index.js +1 -1
- package/lib/calendar/constants.js +1 -1
- package/lib/calendar/index.d.ts +6 -1
- package/lib/calendar/index.js +39 -15
- package/lib/calendar/locales.js +5 -5
- 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 +1 -1
- package/lib/calendar/utils.js +5 -5
- package/lib/canvas/index.d.ts +5 -0
- package/lib/canvas/index.js +3 -4
- package/lib/card/index.d.ts +21 -0
- package/lib/card/index.js +37 -15
- package/lib/card/themes/halo/dark/index.js +3 -3
- package/lib/card/themes/halo/light/index.js +3 -3
- package/lib/card/themes/solar/charcoal/index.js +3 -3
- package/lib/card/themes/solar/pearl/index.js +3 -3
- package/lib/chart/index.d.ts +5 -0
- package/lib/chart/index.js +18 -22
- package/lib/chart/plugins/doughnut-center-label.js +6 -11
- package/lib/chart/themes/halo/dark/index.js +2 -2
- package/lib/chart/themes/halo/light/index.js +2 -2
- package/lib/chart/themes/solar/charcoal/index.js +2 -2
- package/lib/chart/themes/solar/pearl/index.js +2 -2
- package/lib/checkbox/index.d.ts +5 -0
- package/lib/checkbox/index.js +3 -3
- package/lib/checkbox/themes/halo/dark/index.js +2 -2
- package/lib/checkbox/themes/halo/light/index.js +2 -2
- package/lib/checkbox/themes/solar/charcoal/index.js +2 -2
- package/lib/checkbox/themes/solar/pearl/index.js +2 -2
- package/lib/clock/index.d.ts +5 -0
- package/lib/clock/index.js +6 -6
- package/lib/clock/utils/TickManager.js +2 -2
- package/lib/collapse/index.d.ts +5 -0
- package/lib/collapse/index.js +7 -9
- package/lib/collapse/themes/halo/dark/index.js +3 -3
- package/lib/collapse/themes/halo/light/index.js +3 -3
- package/lib/collapse/themes/solar/charcoal/index.js +3 -3
- package/lib/collapse/themes/solar/pearl/index.js +3 -3
- package/lib/color-dialog/elements/color-palettes.d.ts +5 -0
- package/lib/color-dialog/elements/color-palettes.js +1 -1
- package/lib/color-dialog/elements/grayscale-palettes.d.ts +5 -0
- package/lib/color-dialog/elements/grayscale-palettes.js +2 -2
- package/lib/color-dialog/elements/palettes.js +4 -5
- package/lib/color-dialog/helpers/value-model.js +1 -1
- package/lib/color-dialog/index.d.ts +6 -1
- package/lib/color-dialog/index.js +17 -12
- package/lib/color-dialog/themes/halo/dark/index.js +5 -5
- package/lib/color-dialog/themes/halo/light/index.js +5 -5
- package/lib/color-dialog/themes/solar/charcoal/index.js +5 -5
- package/lib/color-dialog/themes/solar/pearl/index.js +5 -5
- package/lib/combo-box/helpers/filter.d.ts +1 -1
- package/lib/combo-box/helpers/types.d.ts +1 -1
- package/lib/combo-box/index.d.ts +9 -4
- package/lib/combo-box/index.js +31 -14
- package/lib/combo-box/themes/halo/dark/index.js +5 -5
- package/lib/combo-box/themes/halo/light/index.js +5 -5
- package/lib/combo-box/themes/solar/charcoal/index.js +5 -5
- package/lib/combo-box/themes/solar/pearl/index.js +5 -5
- package/lib/counter/index.d.ts +11 -6
- package/lib/counter/index.js +8 -8
- package/lib/counter/themes/halo/dark/index.js +1 -1
- package/lib/counter/themes/halo/light/index.js +1 -1
- package/lib/counter/themes/solar/charcoal/index.js +1 -1
- package/lib/counter/themes/solar/pearl/index.js +1 -1
- package/lib/datetime-field/constants.d.ts +4 -0
- package/lib/datetime-field/constants.js +5 -0
- package/lib/datetime-field/custom-elements.json +345 -0
- package/lib/datetime-field/custom-elements.md +61 -0
- package/lib/datetime-field/index.d.ts +322 -0
- package/lib/datetime-field/index.js +660 -0
- package/lib/datetime-field/themes/halo/dark/index.js +3 -0
- package/lib/datetime-field/themes/halo/light/index.js +3 -0
- package/lib/datetime-field/themes/solar/charcoal/index.js +3 -0
- package/lib/datetime-field/themes/solar/pearl/index.js +3 -0
- package/lib/datetime-field/types.d.ts +10 -0
- package/lib/datetime-field/types.js +1 -0
- package/lib/datetime-field/utils.d.ts +25 -0
- package/lib/datetime-field/utils.js +79 -0
- package/lib/datetime-picker/index.d.ts +5 -0
- package/lib/datetime-picker/index.js +6 -7
- package/lib/datetime-picker/themes/halo/dark/index.js +5 -5
- package/lib/datetime-picker/themes/halo/light/index.js +5 -5
- package/lib/datetime-picker/themes/solar/charcoal/index.js +5 -5
- package/lib/datetime-picker/themes/solar/pearl/index.js +5 -5
- package/lib/datetime-picker/utils.js +1 -1
- package/lib/dialog/draggable-element.js +1 -2
- package/lib/dialog/index.d.ts +6 -1
- package/lib/dialog/index.js +5 -5
- package/lib/dialog/themes/halo/dark/index.js +5 -5
- package/lib/dialog/themes/halo/light/index.js +5 -5
- package/lib/dialog/themes/solar/charcoal/index.js +5 -5
- package/lib/dialog/themes/solar/pearl/index.js +5 -5
- package/lib/email-field/index.d.ts +6 -1
- package/lib/email-field/index.js +8 -3
- 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/flag/index.d.ts +5 -0
- package/lib/flag/index.js +3 -3
- package/lib/flag/utils/FlagLoader.d.ts +1 -1
- package/lib/flag/utils/FlagLoader.js +1 -1
- package/lib/header/index.d.ts +5 -0
- package/lib/header/index.js +2 -2
- package/lib/heatmap/helpers/color.d.ts +1 -1
- package/lib/heatmap/helpers/color.js +3 -5
- package/lib/heatmap/helpers/text.d.ts +1 -7
- package/lib/heatmap/helpers/text.js +1 -18
- package/lib/heatmap/index.d.ts +5 -0
- package/lib/heatmap/index.js +22 -30
- package/lib/heatmap/themes/halo/dark/index.js +2 -2
- package/lib/heatmap/themes/halo/light/index.js +2 -2
- package/lib/heatmap/themes/solar/charcoal/index.js +2 -2
- package/lib/heatmap/themes/solar/pearl/index.js +2 -2
- package/lib/icon/index.d.ts +5 -0
- package/lib/icon/index.js +3 -3
- package/lib/icon/utils/IconLoader.d.ts +1 -1
- package/lib/icon/utils/IconLoader.js +1 -1
- package/lib/interactive-chart/helpers/types.d.ts +1 -1
- package/lib/interactive-chart/index.d.ts +5 -12
- package/lib/interactive-chart/index.js +20 -36
- package/lib/interactive-chart/themes/halo/dark/index.js +1 -1
- package/lib/interactive-chart/themes/halo/light/index.js +1 -1
- package/lib/interactive-chart/themes/solar/charcoal/index.js +1 -1
- package/lib/interactive-chart/themes/solar/pearl/index.js +1 -1
- package/lib/item/helpers/types.d.ts +1 -1
- package/lib/item/index.d.ts +24 -17
- package/lib/item/index.js +45 -48
- package/lib/item/themes/halo/dark/index.js +2 -2
- package/lib/item/themes/halo/light/index.js +2 -2
- package/lib/item/themes/solar/charcoal/index.js +2 -2
- package/lib/item/themes/solar/pearl/index.js +2 -2
- package/lib/label/index.d.ts +6 -1
- package/lib/label/index.js +6 -6
- package/lib/label/themes/halo/dark/index.js +1 -1
- package/lib/label/themes/halo/light/index.js +1 -1
- package/lib/label/themes/solar/charcoal/index.js +1 -1
- package/lib/label/themes/solar/pearl/index.js +1 -1
- package/lib/layout/index.d.ts +5 -0
- package/lib/layout/index.js +2 -2
- package/lib/led-gauge/index.d.ts +5 -0
- package/lib/led-gauge/index.js +2 -2
- package/lib/led-gauge/themes/halo/dark/index.js +1 -1
- package/lib/led-gauge/themes/halo/light/index.js +1 -1
- package/lib/led-gauge/themes/solar/charcoal/index.js +1 -1
- package/lib/led-gauge/themes/solar/pearl/index.js +1 -1
- package/lib/list/custom-elements.json +0 -13
- package/lib/list/custom-elements.md +9 -10
- package/lib/list/helpers/item-id.d.ts +8 -0
- package/lib/list/helpers/item-id.js +13 -0
- package/lib/list/helpers/{list-renderer.d.ts → renderer.d.ts} +4 -0
- package/lib/list/helpers/{list-renderer.js → renderer.js} +8 -0
- package/lib/list/helpers/types.d.ts +1 -1
- package/lib/list/index.d.ts +18 -12
- package/lib/list/index.js +30 -29
- package/lib/list/renderer.d.ts +1 -1
- package/lib/list/themes/halo/dark/index.js +2 -2
- package/lib/list/themes/halo/light/index.js +2 -2
- package/lib/list/themes/solar/charcoal/index.js +2 -2
- package/lib/list/themes/solar/pearl/index.js +2 -2
- package/lib/loader/index.d.ts +6 -0
- package/lib/loader/index.js +5 -1
- package/lib/multi-input/helpers/types.d.ts +1 -1
- package/lib/multi-input/index.d.ts +5 -0
- package/lib/multi-input/index.js +6 -7
- package/lib/multi-input/themes/halo/dark/index.js +2 -2
- package/lib/multi-input/themes/halo/light/index.js +2 -2
- package/lib/multi-input/themes/solar/charcoal/index.js +2 -2
- package/lib/multi-input/themes/solar/pearl/index.js +2 -2
- package/lib/notification/elements/notification-tray.d.ts +5 -0
- package/lib/notification/elements/notification-tray.js +4 -4
- package/lib/notification/elements/notification.d.ts +15 -0
- package/lib/notification/elements/notification.js +12 -3
- package/lib/notification/themes/halo/dark/index.js +1 -1
- package/lib/notification/themes/halo/light/index.js +1 -1
- package/lib/notification/themes/solar/charcoal/index.js +1 -1
- package/lib/notification/themes/solar/pearl/index.js +1 -1
- package/lib/number-field/index.d.ts +8 -3
- package/lib/number-field/index.js +14 -4
- 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/elements/overlay-backdrop.d.ts +5 -0
- package/lib/overlay/elements/overlay-backdrop.js +2 -2
- package/lib/overlay/elements/overlay-viewport.d.ts +5 -0
- package/lib/overlay/elements/overlay-viewport.js +1 -1
- package/lib/overlay/elements/overlay.d.ts +5 -0
- package/lib/overlay/elements/overlay.js +7 -5
- package/lib/overlay/managers/focus-manager.js +11 -6
- package/lib/overlay/managers/interaction-lock-manager.js +1 -1
- package/lib/overlay/managers/viewport-manager.js +4 -5
- package/lib/overlay/managers/zindex-manager.js +1 -1
- package/lib/overlay-menu/helpers/types.d.ts +7 -1
- package/lib/overlay-menu/helpers/types.js +7 -1
- package/lib/overlay-menu/index.d.ts +14 -4
- package/lib/overlay-menu/index.js +57 -29
- package/lib/overlay-menu/managers/menu-manager.js +2 -1
- package/lib/overlay-menu/themes/halo/dark/index.js +3 -3
- package/lib/overlay-menu/themes/halo/light/index.js +3 -3
- package/lib/overlay-menu/themes/solar/charcoal/index.js +3 -3
- package/lib/overlay-menu/themes/solar/pearl/index.js +3 -3
- package/lib/pagination/index.d.ts +79 -91
- package/lib/pagination/index.js +205 -239
- package/lib/pagination/themes/halo/dark/index.js +4 -5
- package/lib/pagination/themes/halo/light/index.js +4 -5
- package/lib/pagination/themes/solar/charcoal/index.js +4 -5
- package/lib/pagination/themes/solar/pearl/index.js +4 -5
- package/lib/panel/index.d.ts +5 -0
- package/lib/panel/index.js +2 -2
- package/lib/password-field/index.d.ts +7 -2
- package/lib/password-field/index.js +7 -4
- 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/index.d.ts +21 -0
- package/lib/pill/index.js +36 -5
- package/lib/pill/themes/halo/dark/index.js +2 -2
- package/lib/pill/themes/halo/light/index.js +2 -2
- package/lib/pill/themes/solar/charcoal/index.js +2 -2
- package/lib/pill/themes/solar/pearl/index.js +2 -2
- package/lib/progress-bar/index.d.ts +5 -0
- package/lib/progress-bar/index.js +3 -3
- package/lib/radio-button/index.d.ts +5 -0
- package/lib/radio-button/index.js +3 -3
- package/lib/radio-button/radio-button-registry.d.ts +1 -1
- package/lib/radio-button/radio-button-registry.js +4 -2
- package/lib/radio-button/themes/halo/dark/index.js +1 -1
- package/lib/radio-button/themes/halo/light/index.js +1 -1
- package/lib/radio-button/themes/solar/charcoal/index.js +1 -1
- package/lib/radio-button/themes/solar/pearl/index.js +1 -1
- package/lib/rating/index.d.ts +5 -0
- package/lib/rating/index.js +4 -4
- package/lib/search-field/index.d.ts +7 -2
- package/lib/search-field/index.js +8 -4
- 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/index.d.ts +5 -0
- package/lib/select/index.js +11 -14
- package/lib/select/themes/halo/dark/index.js +3 -3
- package/lib/select/themes/halo/light/index.js +3 -3
- package/lib/select/themes/solar/charcoal/index.js +3 -3
- package/lib/select/themes/solar/pearl/index.js +3 -3
- package/lib/sidebar-layout/index.d.ts +5 -0
- package/lib/sidebar-layout/index.js +4 -4
- package/lib/sidebar-layout/themes/halo/dark/index.js +1 -1
- package/lib/sidebar-layout/themes/halo/light/index.js +1 -1
- package/lib/sidebar-layout/themes/solar/charcoal/index.js +1 -1
- package/lib/sidebar-layout/themes/solar/pearl/index.js +1 -1
- package/lib/slider/constants.d.ts +15 -0
- package/lib/slider/constants.js +18 -0
- package/lib/slider/index.d.ts +55 -80
- package/lib/slider/index.js +365 -460
- package/lib/slider/themes/halo/dark/index.js +1 -1
- package/lib/slider/themes/halo/light/index.js +1 -1
- package/lib/slider/themes/solar/charcoal/index.js +1 -1
- package/lib/slider/themes/solar/pearl/index.js +1 -1
- package/lib/slider/utils.d.ts +35 -0
- package/lib/slider/utils.js +54 -0
- package/lib/sparkline/index.d.ts +5 -0
- package/lib/sparkline/index.js +9 -10
- package/lib/swing-gauge/index.d.ts +5 -0
- package/lib/swing-gauge/index.js +14 -8
- 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/tab/index.d.ts +5 -0
- package/lib/tab/index.js +4 -4
- package/lib/tab/themes/halo/dark/index.js +2 -2
- package/lib/tab/themes/halo/light/index.js +2 -2
- package/lib/tab/themes/solar/charcoal/index.js +2 -2
- package/lib/tab/themes/solar/pearl/index.js +2 -2
- package/lib/tab-bar/index.d.ts +5 -0
- package/lib/tab-bar/index.js +6 -6
- package/lib/tab-bar/themes/halo/dark/index.js +2 -2
- package/lib/tab-bar/themes/halo/light/index.js +2 -2
- package/lib/tab-bar/themes/solar/charcoal/index.js +2 -2
- package/lib/tab-bar/themes/solar/pearl/index.js +2 -2
- package/lib/text-field/index.d.ts +19 -1
- package/lib/text-field/index.js +35 -11
- 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/index.d.ts +6 -1
- package/lib/time-picker/index.js +11 -11
- package/lib/time-picker/themes/halo/dark/index.js +2 -2
- package/lib/time-picker/themes/halo/light/index.js +2 -2
- package/lib/time-picker/themes/solar/charcoal/index.js +2 -2
- package/lib/time-picker/themes/solar/pearl/index.js +2 -2
- package/lib/toggle/index.d.ts +5 -0
- package/lib/toggle/index.js +2 -2
- package/lib/tooltip/elements/tooltip-element.d.ts +1 -2
- package/lib/tooltip/index.d.ts +6 -0
- package/lib/tooltip/index.js +7 -8
- package/lib/tooltip/managers/tooltip-manager.js +2 -2
- package/lib/tooltip/themes/halo/dark/index.js +1 -1
- package/lib/tooltip/themes/halo/light/index.js +1 -1
- package/lib/tooltip/themes/solar/charcoal/index.js +1 -1
- package/lib/tooltip/themes/solar/pearl/index.js +1 -1
- package/lib/tornado-chart/elements/tornado-chart.d.ts +5 -0
- package/lib/tornado-chart/elements/tornado-chart.js +2 -2
- package/lib/tornado-chart/elements/tornado-item.d.ts +5 -0
- package/lib/tornado-chart/elements/tornado-item.js +3 -3
- package/lib/tornado-chart/themes/halo/dark/index.js +2 -2
- package/lib/tornado-chart/themes/halo/light/index.js +2 -2
- package/lib/tornado-chart/themes/solar/charcoal/index.js +2 -2
- package/lib/tornado-chart/themes/solar/pearl/index.js +2 -2
- package/lib/tree/elements/tree-item.d.ts +8 -3
- package/lib/tree/elements/tree-item.js +5 -6
- package/lib/tree/elements/tree.d.ts +7 -3
- package/lib/tree/elements/tree.js +6 -7
- package/lib/tree/helpers/renderer.d.ts +4 -0
- package/lib/tree/helpers/renderer.js +20 -13
- package/lib/tree/helpers/types.d.ts +1 -1
- package/lib/tree/managers/tree-manager.d.ts +1 -1
- package/lib/tree/themes/halo/dark/index.js +4 -4
- package/lib/tree/themes/halo/light/index.js +4 -4
- package/lib/tree/themes/solar/charcoal/index.js +4 -4
- package/lib/tree/themes/solar/pearl/index.js +4 -4
- package/lib/tree-select/index.d.ts +8 -7
- package/lib/tree-select/index.js +39 -38
- package/lib/tree-select/themes/halo/dark/index.js +9 -9
- package/lib/tree-select/themes/halo/light/index.js +9 -9
- package/lib/tree-select/themes/solar/charcoal/index.js +9 -9
- package/lib/tree-select/themes/solar/pearl/index.js +9 -9
- package/lib/version.js +1 -1
- package/package.json +35 -295
package/lib/pagination/index.js
CHANGED
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { BasicElement, html, css, WarningNotice
|
|
3
|
-
import { customElement } from '@refinitiv-ui/core/
|
|
4
|
-
import { property } from '@refinitiv-ui/core/
|
|
5
|
-
import { state } from '@refinitiv-ui/core/
|
|
6
|
-
import {
|
|
2
|
+
import { BasicElement, html, css, WarningNotice } from '@refinitiv-ui/core';
|
|
3
|
+
import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
|
|
4
|
+
import { property } from '@refinitiv-ui/core/decorators/property.js';
|
|
5
|
+
import { state } from '@refinitiv-ui/core/decorators/state.js';
|
|
6
|
+
import { ifDefined } from '@refinitiv-ui/core/directives/if-defined.js';
|
|
7
|
+
import { ref, createRef } from '@refinitiv-ui/core/directives/ref.js';
|
|
7
8
|
import { VERSION } from '../version.js';
|
|
8
9
|
import '../button/index.js';
|
|
9
10
|
import '../button-bar/index.js';
|
|
10
11
|
import '../layout/index.js';
|
|
11
12
|
import '../text-field/index.js';
|
|
12
|
-
import '@refinitiv-ui/phrasebook/
|
|
13
|
+
import '@refinitiv-ui/phrasebook/locale/en/pagination.js';
|
|
13
14
|
import { translate } from '@refinitiv-ui/translate';
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
var Direction;
|
|
16
|
+
(function (Direction) {
|
|
17
|
+
Direction["increment"] = "increment";
|
|
18
|
+
Direction["decrement"] = "decrement";
|
|
19
|
+
})(Direction || (Direction = {}));
|
|
17
20
|
/**
|
|
18
21
|
* Used to control and navigate through multiple pages
|
|
19
22
|
* @fires value-changed - Fired when the `value` property is changed
|
|
@@ -29,20 +32,14 @@ let Pagination = class Pagination extends BasicElement {
|
|
|
29
32
|
* Max page
|
|
30
33
|
*/
|
|
31
34
|
this._max = '';
|
|
32
|
-
/**
|
|
33
|
-
* Number of item per page internal value
|
|
34
|
-
* @deprecated
|
|
35
|
-
*/
|
|
36
|
-
this._pageSize = '';
|
|
37
|
-
/**
|
|
38
|
-
* Total items internal value
|
|
39
|
-
* @deprecated
|
|
40
|
-
*/
|
|
41
|
-
this._totalItems = '';
|
|
42
35
|
/**
|
|
43
36
|
* Set state to disable
|
|
44
37
|
*/
|
|
45
38
|
this.disabled = false;
|
|
39
|
+
/**
|
|
40
|
+
* Reference input element
|
|
41
|
+
*/
|
|
42
|
+
this.inputRef = createRef();
|
|
46
43
|
/**
|
|
47
44
|
* State for check the input focus
|
|
48
45
|
*/
|
|
@@ -93,19 +90,10 @@ let Pagination = class Pagination extends BasicElement {
|
|
|
93
90
|
*/
|
|
94
91
|
get internalMax() {
|
|
95
92
|
const max = parseInt(this._max, 10) || 0;
|
|
96
|
-
|
|
97
|
-
const totalItems = this.internalTotalitems;
|
|
98
|
-
if (!max && !totalItems) {
|
|
93
|
+
if (!max) {
|
|
99
94
|
return Infinity;
|
|
100
95
|
}
|
|
101
|
-
|
|
102
|
-
return max;
|
|
103
|
-
}
|
|
104
|
-
if (pageSize > 0) {
|
|
105
|
-
const totalPage = Math.ceil(totalItems / pageSize);
|
|
106
|
-
return totalPage >= 1 ? totalPage : 1;
|
|
107
|
-
}
|
|
108
|
-
return 1;
|
|
96
|
+
return max >= 1 ? max : 1;
|
|
109
97
|
}
|
|
110
98
|
/**
|
|
111
99
|
* Max page
|
|
@@ -130,142 +118,41 @@ let Pagination = class Pagination extends BasicElement {
|
|
|
130
118
|
this.requestUpdate('max', oldValue);
|
|
131
119
|
}
|
|
132
120
|
/**
|
|
133
|
-
*
|
|
134
|
-
* @returns
|
|
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
|
|
147
|
-
*/
|
|
148
|
-
set page(value) {
|
|
149
|
-
pageDeprecation.show();
|
|
150
|
-
let newValue = value;
|
|
151
|
-
if (!newValue || !this.validatePage(value, true, 'page')) {
|
|
152
|
-
newValue = '';
|
|
153
|
-
}
|
|
154
|
-
const oldValue = this._value;
|
|
155
|
-
if (oldValue !== newValue) {
|
|
156
|
-
this._value = newValue.toString();
|
|
157
|
-
}
|
|
158
|
-
this.requestUpdate('page', oldValue);
|
|
159
|
-
}
|
|
160
|
-
/**
|
|
161
|
-
* Number of item per page
|
|
162
|
-
* @returns number of items per page
|
|
163
|
-
* @deprecated
|
|
164
|
-
* @ignore
|
|
165
|
-
*/
|
|
166
|
-
get pageSize() {
|
|
167
|
-
pageSizeDeprecation.once();
|
|
168
|
-
return this._pageSize;
|
|
169
|
-
}
|
|
170
|
-
/**
|
|
171
|
-
* Set number of item per page
|
|
172
|
-
* @param value - number of item per page
|
|
173
|
-
* @deprecated
|
|
174
|
-
* @ignore
|
|
175
|
-
*/
|
|
176
|
-
set pageSize(value) {
|
|
177
|
-
pageSizeDeprecation.show();
|
|
178
|
-
let newValue = value;
|
|
179
|
-
if (!newValue || !this.validatePage(value, true, 'page-size')) {
|
|
180
|
-
newValue = '';
|
|
181
|
-
}
|
|
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);
|
|
193
|
-
}
|
|
194
|
-
/**
|
|
195
|
-
* Internal page size
|
|
196
|
-
* @deprecated
|
|
197
|
-
* @returns page size
|
|
198
|
-
*/
|
|
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
|
|
121
|
+
* Get infinite pagination state
|
|
122
|
+
* @returns infinite pagination state
|
|
216
123
|
*/
|
|
217
|
-
get
|
|
218
|
-
|
|
219
|
-
return this._totalItems;
|
|
124
|
+
get infinitePaginate() {
|
|
125
|
+
return this.internalMax === Infinity; // internalMax always returns 1-Infinity
|
|
220
126
|
}
|
|
221
127
|
/**
|
|
222
|
-
*
|
|
223
|
-
* @
|
|
224
|
-
* @deprecated
|
|
225
|
-
* @ignore
|
|
128
|
+
* Getter for input element
|
|
129
|
+
* @returns input element
|
|
226
130
|
*/
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
let newValue = value;
|
|
230
|
-
if (!newValue || !this.validatePage(value, true, 'total-items')) {
|
|
231
|
-
newValue = '';
|
|
232
|
-
}
|
|
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();
|
|
238
|
-
}
|
|
239
|
-
const oldValue = this._totalItems;
|
|
240
|
-
if (oldValue !== newValue) {
|
|
241
|
-
this._totalItems = newValue;
|
|
242
|
-
}
|
|
243
|
-
this.requestUpdate('totalItems', oldValue);
|
|
131
|
+
get inputElement() {
|
|
132
|
+
return this.inputRef.value || null;
|
|
244
133
|
}
|
|
245
134
|
/**
|
|
246
|
-
*
|
|
247
|
-
* @returns
|
|
135
|
+
* Getter for display page number or text depends on focusing the input
|
|
136
|
+
* @returns string page number value or translate directive result
|
|
248
137
|
*/
|
|
249
|
-
get
|
|
250
|
-
return this.
|
|
138
|
+
get inputValue() {
|
|
139
|
+
return this.inputFocused ? this.internalValue.toString() : this.inputTextFormat;
|
|
251
140
|
}
|
|
252
141
|
/**
|
|
253
|
-
*
|
|
254
|
-
* @returns
|
|
142
|
+
* Get page text format in various translation
|
|
143
|
+
* @returns translate directive result
|
|
255
144
|
*/
|
|
256
|
-
get
|
|
257
|
-
if (this.
|
|
258
|
-
return this.internalValue.
|
|
259
|
-
}
|
|
260
|
-
else {
|
|
261
|
-
return (this.infinitePaginate ? this.t('PAGE', { page: this.internalValue }) : this.t('PAGE_OF', { page: this.internalValue, pageTotal: this.internalMax }));
|
|
145
|
+
get inputTextFormat() {
|
|
146
|
+
if (!this.infinitePaginate) {
|
|
147
|
+
return this.t('PAGE_OF', { page: this.internalValue, pageTotal: this.internalMax });
|
|
262
148
|
}
|
|
149
|
+
return this.t('PAGE', { page: this.internalValue });
|
|
263
150
|
}
|
|
264
151
|
/**
|
|
265
152
|
* State for checking the first page button is available
|
|
266
153
|
*/
|
|
267
154
|
get useFirstButton() {
|
|
268
|
-
return !this.disabled && this.internalValue
|
|
155
|
+
return !this.disabled && this.hasPreviousPage(this.internalValue);
|
|
269
156
|
}
|
|
270
157
|
/**
|
|
271
158
|
* State for checking the previous page button is available
|
|
@@ -277,7 +164,7 @@ let Pagination = class Pagination extends BasicElement {
|
|
|
277
164
|
* State for checking the next page button is available
|
|
278
165
|
*/
|
|
279
166
|
get useNextButton() {
|
|
280
|
-
return !this.disabled && this.
|
|
167
|
+
return !this.disabled && this.hasNextPage(this.internalValue);
|
|
281
168
|
}
|
|
282
169
|
/**
|
|
283
170
|
* State for checking the last page button is available
|
|
@@ -294,6 +181,14 @@ let Pagination = class Pagination extends BasicElement {
|
|
|
294
181
|
void this.selectInput();
|
|
295
182
|
}
|
|
296
183
|
}
|
|
184
|
+
/**
|
|
185
|
+
* Select text in input when update element complete
|
|
186
|
+
* @returns returns a promise void
|
|
187
|
+
*/
|
|
188
|
+
async selectInput() {
|
|
189
|
+
await this.updateComplete;
|
|
190
|
+
this.inputElement?.select();
|
|
191
|
+
}
|
|
297
192
|
/**
|
|
298
193
|
* Validate page value which returns true when value is valid
|
|
299
194
|
* @param value value
|
|
@@ -313,55 +208,19 @@ let Pagination = class Pagination extends BasicElement {
|
|
|
313
208
|
}
|
|
314
209
|
}
|
|
315
210
|
/**
|
|
316
|
-
*
|
|
317
|
-
* @param
|
|
318
|
-
* @returns {void}
|
|
319
|
-
*/
|
|
320
|
-
onInputKeyDown(event) {
|
|
321
|
-
var _a, _b;
|
|
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
|
-
}
|
|
339
|
-
}
|
|
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
|
|
211
|
+
* Set page to the pagination
|
|
212
|
+
* @param value page number
|
|
354
213
|
* @returns {void}
|
|
355
214
|
*/
|
|
356
|
-
|
|
215
|
+
setPage(value) {
|
|
357
216
|
// Prevent update page to the same value
|
|
358
|
-
if (this.value ===
|
|
217
|
+
if (this.value === value) {
|
|
359
218
|
return;
|
|
360
219
|
}
|
|
361
220
|
const oldValue = this.value;
|
|
362
|
-
let newValue = parseInt(
|
|
221
|
+
let newValue = parseInt(value, 10);
|
|
363
222
|
// Reset input and boundary value into supported range.
|
|
364
|
-
if (this.validatePage(
|
|
223
|
+
if (this.validatePage(value)) {
|
|
365
224
|
if (newValue > this.internalMax) {
|
|
366
225
|
newValue = this.internalMax;
|
|
367
226
|
}
|
|
@@ -375,36 +234,52 @@ let Pagination = class Pagination extends BasicElement {
|
|
|
375
234
|
this.notifyValueChange();
|
|
376
235
|
}
|
|
377
236
|
}
|
|
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
|
-
}
|
|
386
237
|
/**
|
|
387
238
|
* Updates page value depending on direction
|
|
388
239
|
* @param direction page value direction
|
|
389
|
-
* @param
|
|
240
|
+
* @param withEvent whether the event page-changed should fire
|
|
390
241
|
* @returns {void}
|
|
391
242
|
*/
|
|
392
|
-
updatePage(direction,
|
|
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
|
-
*/
|
|
243
|
+
updatePage(direction, withEvent = false) {
|
|
244
|
+
// Get current page
|
|
397
245
|
let page = this.internalValue;
|
|
398
|
-
|
|
399
|
-
|
|
246
|
+
let newPage;
|
|
247
|
+
// Check the direction
|
|
248
|
+
if (direction === Direction.increment) {
|
|
249
|
+
newPage = this.hasNextPage(page) ? page + 1 : page;
|
|
400
250
|
}
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
251
|
+
else {
|
|
252
|
+
/**
|
|
253
|
+
* Handle in case the page value is greater than max, so the decrement must reset page to the max page.
|
|
254
|
+
* which it might happen by using developer API.
|
|
255
|
+
*/
|
|
256
|
+
page = page > this.internalMax ? this.internalMax + 1 : page;
|
|
257
|
+
newPage = this.hasPreviousPage(page) ? page - 1 : page;
|
|
258
|
+
}
|
|
259
|
+
// Update page and fire event
|
|
260
|
+
if (newPage !== page) {
|
|
261
|
+
this.value = String(newPage);
|
|
262
|
+
withEvent && this.notifyValueChange();
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Update input value. Do not update pagination actual value until Enter key is pressed or blur event is fired
|
|
267
|
+
* @param value input value
|
|
268
|
+
* @param direction update from old value
|
|
269
|
+
* @returns void
|
|
270
|
+
*/
|
|
271
|
+
updateInputValue(value = 1, direction = null) {
|
|
272
|
+
if (!this.inputElement) {
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
let newValue = value;
|
|
276
|
+
// Update base on old value
|
|
277
|
+
if (direction) {
|
|
278
|
+
const changeValue = direction === Direction.increment ? value : -Math.abs(value);
|
|
279
|
+
newValue = Number(this.inputElement.value) + changeValue;
|
|
407
280
|
}
|
|
281
|
+
this.inputElement.value = String(newValue);
|
|
282
|
+
this.inputElement.setAttribute('aria-valuenow', this.inputElement.value);
|
|
408
283
|
}
|
|
409
284
|
/**
|
|
410
285
|
* Fires event when value change
|
|
@@ -412,35 +287,34 @@ let Pagination = class Pagination extends BasicElement {
|
|
|
412
287
|
*/
|
|
413
288
|
notifyValueChange() {
|
|
414
289
|
this.notifyPropertyChange('value', this.value);
|
|
415
|
-
this.notifyPropertyChange('page', this.value); // deprecated. support backwards compatibility.
|
|
416
290
|
}
|
|
417
291
|
/**
|
|
418
292
|
* Go to the next page
|
|
419
293
|
* @returns {void}
|
|
420
294
|
*/
|
|
421
295
|
next() {
|
|
422
|
-
this.updatePage(
|
|
296
|
+
this.updatePage(Direction.increment);
|
|
423
297
|
}
|
|
424
298
|
/**
|
|
425
299
|
* Go to the next page and fires event
|
|
426
300
|
* @returns {void}
|
|
427
301
|
*/
|
|
428
302
|
onNextTap() {
|
|
429
|
-
this.updatePage(
|
|
303
|
+
this.updatePage(Direction.increment, true);
|
|
430
304
|
}
|
|
431
305
|
/**
|
|
432
306
|
* Go to the previous page
|
|
433
307
|
* @returns {void}
|
|
434
308
|
*/
|
|
435
309
|
previous() {
|
|
436
|
-
this.updatePage(
|
|
310
|
+
this.updatePage(Direction.decrement);
|
|
437
311
|
}
|
|
438
312
|
/**
|
|
439
313
|
* Go to the previous page and fires event
|
|
440
314
|
* @returns {void}
|
|
441
315
|
*/
|
|
442
316
|
onPreviousTap() {
|
|
443
|
-
this.updatePage(
|
|
317
|
+
this.updatePage(Direction.decrement, true);
|
|
444
318
|
}
|
|
445
319
|
/**
|
|
446
320
|
* Go to the first page
|
|
@@ -476,6 +350,102 @@ let Pagination = class Pagination extends BasicElement {
|
|
|
476
350
|
this.last();
|
|
477
351
|
this.notifyValueChange();
|
|
478
352
|
}
|
|
353
|
+
/**
|
|
354
|
+
* Check pagination has a next page
|
|
355
|
+
* @param page current page number
|
|
356
|
+
* @returns true if pagination has a next page
|
|
357
|
+
*/
|
|
358
|
+
hasNextPage(page) {
|
|
359
|
+
return page < this.internalMax;
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* Check pagination has a previous page
|
|
363
|
+
* @param page current page number
|
|
364
|
+
* @returns true if pagination has a previous page
|
|
365
|
+
*/
|
|
366
|
+
hasPreviousPage(page) {
|
|
367
|
+
return page > 1;
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* Check pagination has a last page
|
|
371
|
+
* @returns true if pagination has a last page
|
|
372
|
+
*/
|
|
373
|
+
hasLastPage() {
|
|
374
|
+
return !this.infinitePaginate;
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* Handles action when input focused change
|
|
378
|
+
* @param event focus change event
|
|
379
|
+
* @returns {void}
|
|
380
|
+
*/
|
|
381
|
+
onFocusedChanged(event) {
|
|
382
|
+
if (!this.inputElement) {
|
|
383
|
+
return;
|
|
384
|
+
}
|
|
385
|
+
this.inputFocused = event.type === 'focus';
|
|
386
|
+
if (!this.inputFocused) {
|
|
387
|
+
this.setPage(this.inputElement.value);
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* Runs on input element `input` event
|
|
392
|
+
* @param event `input` event
|
|
393
|
+
* @returns {void}
|
|
394
|
+
*/
|
|
395
|
+
onInputInput() {
|
|
396
|
+
if (!this.inputElement) {
|
|
397
|
+
return;
|
|
398
|
+
}
|
|
399
|
+
const currentInput = this.inputElement.value;
|
|
400
|
+
const inputValue = this.inputElement.value.replace(/[^\d]/g, ''); // stripe invalid charactors
|
|
401
|
+
// Page value cannot start with `0`, reset it if found.
|
|
402
|
+
if (inputValue.startsWith('0')) {
|
|
403
|
+
this.inputElement.value = inputValue.substring(1);
|
|
404
|
+
}
|
|
405
|
+
else if (currentInput !== inputValue) { // update if found new value
|
|
406
|
+
this.inputElement.value = inputValue;
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
/**
|
|
410
|
+
* Handles key down event
|
|
411
|
+
* @param event Key down event object
|
|
412
|
+
* @returns {void}
|
|
413
|
+
*/
|
|
414
|
+
onKeyDown(event) {
|
|
415
|
+
if (event.defaultPrevented) {
|
|
416
|
+
return;
|
|
417
|
+
}
|
|
418
|
+
// Handle keyboard shortcuts
|
|
419
|
+
switch (event.key) {
|
|
420
|
+
case 'Enter':
|
|
421
|
+
this.inputElement && this.setPage(this.inputElement.value);
|
|
422
|
+
event.preventDefault();
|
|
423
|
+
break;
|
|
424
|
+
case 'Up':
|
|
425
|
+
case 'ArrowUp':
|
|
426
|
+
this.inputElement && this.hasNextPage(Number(this.inputElement.value || 1)) && this.updateInputValue(1, Direction.increment);
|
|
427
|
+
this.inputElement?.select();
|
|
428
|
+
event.preventDefault();
|
|
429
|
+
break;
|
|
430
|
+
case 'Down':
|
|
431
|
+
case 'ArrowDown':
|
|
432
|
+
this.inputElement && this.hasPreviousPage(Number(this.inputElement.value || 1)) && this.updateInputValue(1, Direction.decrement);
|
|
433
|
+
this.inputElement?.select();
|
|
434
|
+
event.preventDefault();
|
|
435
|
+
break;
|
|
436
|
+
case 'Home':
|
|
437
|
+
this.updateInputValue(1);
|
|
438
|
+
this.inputElement?.select();
|
|
439
|
+
event.preventDefault();
|
|
440
|
+
break;
|
|
441
|
+
case 'End':
|
|
442
|
+
this.hasLastPage() && this.updateInputValue(this.internalMax);
|
|
443
|
+
this.inputElement?.select();
|
|
444
|
+
event.preventDefault();
|
|
445
|
+
break;
|
|
446
|
+
default: // No default
|
|
447
|
+
}
|
|
448
|
+
}
|
|
479
449
|
/**
|
|
480
450
|
* A `CSSResultGroup` that will be used
|
|
481
451
|
* to style the host, slotted children
|
|
@@ -497,19 +467,27 @@ let Pagination = class Pagination extends BasicElement {
|
|
|
497
467
|
render() {
|
|
498
468
|
return html `
|
|
499
469
|
<ef-layout part="container" flex nowrap>
|
|
500
|
-
<ef-button-bar part="buttons">
|
|
470
|
+
<ef-button-bar part="buttons" aria-hidden="true" tabindex="-1">
|
|
501
471
|
<ef-button id="first" icon="skip-to-start" @tap="${this.onFirstTap}" .disabled=${!this.useFirstButton}></ef-button>
|
|
502
472
|
<ef-button id="previous" icon="left" @tap="${this.onPreviousTap}" .disabled=${!this.usePreviousButton}></ef-button>
|
|
503
473
|
</ef-button-bar>
|
|
504
|
-
<
|
|
474
|
+
<label part="label" for="input">${this.inputTextFormat}</label>
|
|
475
|
+
<input
|
|
505
476
|
id="input"
|
|
506
477
|
part="input"
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
478
|
+
role="spinbutton"
|
|
479
|
+
aria-valuenow=${this.internalValue}
|
|
480
|
+
aria-valuemin="1"
|
|
481
|
+
aria-valuemax=${ifDefined(this.max || undefined)}
|
|
482
|
+
.value=${this.inputValue}
|
|
510
483
|
.disabled=${this.disabled}
|
|
511
|
-
|
|
512
|
-
|
|
484
|
+
@focus=${this.onFocusedChanged}
|
|
485
|
+
@blur=${this.onFocusedChanged}
|
|
486
|
+
@input=${this.onInputInput}
|
|
487
|
+
@keydown=${this.onKeyDown}
|
|
488
|
+
${ref(this.inputRef)}
|
|
489
|
+
/>
|
|
490
|
+
<ef-button-bar part="buttons" aria-hidden="true" tabindex="-1">
|
|
513
491
|
<ef-button id="next" icon="right" @tap="${this.onNextTap}" .disabled=${!this.useNextButton}></ef-button>
|
|
514
492
|
<ef-button id="last" icon="skip-to-end" @tap="${this.onLastTap}" .disabled=${!this.useLastButton}></ef-button>
|
|
515
493
|
</ef-button-bar>
|
|
@@ -523,21 +501,9 @@ __decorate([
|
|
|
523
501
|
__decorate([
|
|
524
502
|
property({ type: String })
|
|
525
503
|
], Pagination.prototype, "max", null);
|
|
526
|
-
__decorate([
|
|
527
|
-
property({ type: String })
|
|
528
|
-
], Pagination.prototype, "page", null);
|
|
529
|
-
__decorate([
|
|
530
|
-
property({ type: String, attribute: 'page-size' })
|
|
531
|
-
], Pagination.prototype, "pageSize", null);
|
|
532
|
-
__decorate([
|
|
533
|
-
property({ type: String, attribute: 'total-items' })
|
|
534
|
-
], Pagination.prototype, "totalItems", null);
|
|
535
504
|
__decorate([
|
|
536
505
|
property({ type: Boolean, reflect: true })
|
|
537
506
|
], Pagination.prototype, "disabled", void 0);
|
|
538
|
-
__decorate([
|
|
539
|
-
query('#input')
|
|
540
|
-
], Pagination.prototype, "input", void 0);
|
|
541
507
|
__decorate([
|
|
542
508
|
translate()
|
|
543
509
|
], Pagination.prototype, "t", void 0);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import '@refinitiv-ui/elements/
|
|
2
|
-
import '@refinitiv-ui/elements/
|
|
3
|
-
import '@refinitiv-ui/elements/
|
|
4
|
-
import '@refinitiv-ui/elements/lib/layout/themes/halo/dark';
|
|
1
|
+
import '@refinitiv-ui/elements/button/themes/halo/dark';
|
|
2
|
+
import '@refinitiv-ui/elements/button-bar/themes/halo/dark';
|
|
3
|
+
import '@refinitiv-ui/elements/layout/themes/halo/dark';
|
|
5
4
|
|
|
6
|
-
elf.customStyles.define('ef-pagination', ':host [part=container]{align-items:center;justify-content:flex-end}:host [part=input]{min-width:40px;text-align:center;height:22px;width:150px;margin:0}:host [part=button],:host [part=input]{touch-action:manipulation}:host{margin:1px 0}:host [part=buttons]{margin:0}');
|
|
5
|
+
elf.customStyles.define('ef-pagination', ':host [part=container]{align-items:center;justify-content:flex-end}:host [part=label]{clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;width:1px;margin:-1px;overflow:hidden;padding:0;position:absolute}:host [part=input]{display:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;font-family:inherit;font-size:12rem;font-weight:400;max-width:100%;padding:0 8px;outline:0;box-sizing:border-box;display:inline-flex;align-items:center;position:relative;vertical-align:middle;color:#ccc;border-radius:0;background-color:#0d0d0d;text-overflow:ellipsis;border:1px solid #404040;touch-action:manipulation;min-width:40px;text-align:center;height:22px;width:150px;margin:0}:host [part=input][disabled]{color:rgba(204,204,204,.5);border:1px solid rgba(64,64,64,.5)}:host [part=input][type=number]{padding-right:0}:host [part=input][warning]{border:1px solid #7f6400}:host [part=input][warning][disabled]{color:rgba(204,204,204,.5);border:1px solid rgba(127,100,0,.5)}:host [part=input][error],:host [part=input][error][warning]{border:1px solid #a01c2b}:host [part=input][error][disabled],:host [part=input][error][warning][disabled]{color:rgba(204,204,204,.5);border:1px solid rgba(160,28,43,.5)}:host [part=input] ::-ms-clear{display:none}:host [part=input]::-webkit-clear-button,:host [part=input]::-webkit-inner-spin-button,:host [part=input]::-webkit-search-cancel-button,:host [part=input]::-webkit-search-decoration{-webkit-appearance:none}:host [part=input]:hover{border-color:grey;color:#fff}:host [part=input]:focus{background-size:100% 2px,100% 1px!important;background-position:center bottom!important;border-color:#334bff}:host [part=button]{touch-action:manipulation}:host{margin:1px 0}:host [part=input]::-moz-selection{color:#fff;background-color:#334bff}:host [part=input]::selection{color:#fff;background-color:#334bff}:host [part=buttons]{margin:0}');
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import '@refinitiv-ui/elements/
|
|
2
|
-
import '@refinitiv-ui/elements/
|
|
3
|
-
import '@refinitiv-ui/elements/
|
|
4
|
-
import '@refinitiv-ui/elements/lib/layout/themes/halo/light';
|
|
1
|
+
import '@refinitiv-ui/elements/button/themes/halo/light';
|
|
2
|
+
import '@refinitiv-ui/elements/button-bar/themes/halo/light';
|
|
3
|
+
import '@refinitiv-ui/elements/layout/themes/halo/light';
|
|
5
4
|
|
|
6
|
-
elf.customStyles.define('ef-pagination', ':host [part=container]{align-items:center;justify-content:flex-end}:host [part=input]{min-width:40px;text-align:center;width:150px;margin:0 1px}:host [part=button],:host [part=input]{touch-action:manipulation}:host{margin:1px 0}:host [part=buttons]{margin:0}');
|
|
5
|
+
elf.customStyles.define('ef-pagination', ':host [part=container]{align-items:center;justify-content:flex-end}:host [part=label]{clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;width:1px;margin:-1px;overflow:hidden;padding:0;position:absolute}:host [part=input]{display:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;font-family:inherit;font-size:12rem;font-weight:400;height:24px;max-width:100%;padding:0 8px;outline:0;box-sizing:border-box;display:inline-flex;align-items:center;position:relative;vertical-align:middle;color:#404040;border-radius:0;background-color:#fff;text-overflow:ellipsis;border:1px solid #595959;touch-action:manipulation;min-width:40px;text-align:center;width:150px;margin:0 1px}:host [part=input][disabled]{color:rgba(64,64,64,.5);border:1px solid rgba(89,89,89,.5)}:host [part=input][type=number]{padding-right:0}:host [part=input][warning]{border:1px solid #cca000}:host [part=input][warning][disabled]{color:rgba(64,64,64,.5);border:1px solid rgba(204,160,0,.5)}:host [part=input][error],:host [part=input][error][warning]{border:1px solid #b63243}:host [part=input][error][disabled],:host [part=input][error][warning][disabled]{color:rgba(64,64,64,.5);border:1px solid rgba(182,50,67,.5)}:host [part=input] ::-ms-clear{display:none}:host [part=input]::-webkit-clear-button,:host [part=input]::-webkit-inner-spin-button,:host [part=input]::-webkit-search-cancel-button,:host [part=input]::-webkit-search-decoration{-webkit-appearance:none}:host [part=input]:hover{border-color:#0d0d0d;color:#0d0d0d}:host [part=input]:focus{background-size:100% 2px,100% 1px!important;background-position:center bottom!important;border-color:#334bff}:host [part=button]{touch-action:manipulation}:host{margin:1px 0}:host [part=input]::-moz-selection{color:#fff;background-color:#334bff}:host [part=input]::selection{color:#fff;background-color:#334bff}:host [part=buttons]{margin:0}');
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import '@refinitiv-ui/elements/
|
|
2
|
-
import '@refinitiv-ui/elements/
|
|
3
|
-
import '@refinitiv-ui/elements/
|
|
4
|
-
import '@refinitiv-ui/elements/lib/layout/themes/solar/charcoal';
|
|
1
|
+
import '@refinitiv-ui/elements/button/themes/solar/charcoal';
|
|
2
|
+
import '@refinitiv-ui/elements/button-bar/themes/solar/charcoal';
|
|
3
|
+
import '@refinitiv-ui/elements/layout/themes/solar/charcoal';
|
|
5
4
|
|
|
6
|
-
elf.customStyles.define('ef-pagination', ':host [part=container]{align-items:center;justify-content:flex-end}:host [part=input]{min-width:40px;text-align:center;height:21px;width:150px;margin:0}:host [part=button],:host [part=input]{touch-action:manipulation}:host{--first-icon:previous;--last-icon:next;--previous-icon:left;--next-icon:right}');
|
|
5
|
+
elf.customStyles.define('ef-pagination', ':host [part=container]{align-items:center;justify-content:flex-end}:host [part=label]{clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;width:1px;margin:-1px;overflow:hidden;padding:0;position:absolute}:host [part=input]{display:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;font-family:inherit;font-size:13rem;font-weight:400;max-width:100%;padding:0 5px;outline:0;box-sizing:border-box;display:inline-flex;align-items:center;position:relative;vertical-align:middle;color:#c2c2c2;border-radius:0;background-color:#000;text-overflow:ellipsis;border:1px solid #4a4a52;touch-action:manipulation;min-width:40px;text-align:center;height:21px;width:150px;margin:0}:host [part=input][disabled]{color:rgba(194,194,194,.6);border:1px solid rgba(74,74,82,.6)}:host [part=input][type=number]{padding-right:0}:host [part=input][warning]{border:1px solid #f93}:host [part=input][warning][disabled]{color:rgba(194,194,194,.6);border:1px solid rgba(255,153,51,.6)}:host [part=input][error],:host [part=input][error][warning]{border:1px solid #f5475b}:host [part=input][error][disabled],:host [part=input][error][warning][disabled]{color:rgba(194,194,194,.6);border:1px solid rgba(245,71,91,.6)}:host [part=input] ::-ms-clear{display:none}:host [part=input]::-webkit-clear-button,:host [part=input]::-webkit-inner-spin-button,:host [part=input]::-webkit-search-cancel-button,:host [part=input]::-webkit-search-decoration{-webkit-appearance:none}:host [part=input]:hover{border-color:#77777d;color:#c2c2c2}:host [part=button]{touch-action:manipulation}:host{--first-icon:previous;--last-icon:next;--previous-icon:left;--next-icon:right}:host [part=input]:focus{background-size:100% 2px,100% 1px!important;background-position:center bottom!important;border-color:#f93;border-style:dotted}');
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import '@refinitiv-ui/elements/
|
|
2
|
-
import '@refinitiv-ui/elements/
|
|
3
|
-
import '@refinitiv-ui/elements/
|
|
4
|
-
import '@refinitiv-ui/elements/lib/layout/themes/solar/pearl';
|
|
1
|
+
import '@refinitiv-ui/elements/button/themes/solar/pearl';
|
|
2
|
+
import '@refinitiv-ui/elements/button-bar/themes/solar/pearl';
|
|
3
|
+
import '@refinitiv-ui/elements/layout/themes/solar/pearl';
|
|
5
4
|
|
|
6
|
-
elf.customStyles.define('ef-pagination', ':host [part=container]{align-items:center;justify-content:flex-end}:host [part=input]{min-width:40px;text-align:center;height:23px;width:150px;margin:0 1px}:host [part=button],:host [part=input]{touch-action:manipulation}:host{--first-icon:previous;--last-icon:next;--previous-icon:left;--next-icon:right}');
|
|
5
|
+
elf.customStyles.define('ef-pagination', ':host [part=container]{align-items:center;justify-content:flex-end}:host [part=label]{clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;width:1px;margin:-1px;overflow:hidden;padding:0;position:absolute}:host [part=input]{display:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;font-family:inherit;font-size:13rem;font-weight:400;max-width:100%;padding:0 5px;outline:0;box-sizing:border-box;display:inline-flex;align-items:center;position:relative;vertical-align:middle;color:#484848;border-radius:0;background-color:#fff;text-overflow:ellipsis;border:1px solid #a9afba;touch-action:manipulation;min-width:40px;text-align:center;height:23px;width:150px;margin:0 1px}:host [part=input][disabled]{color:rgba(72,72,72,.6);border:1px solid rgba(169,175,186,.6)}:host [part=input][type=number]{padding-right:0}:host [part=input][warning]{border:1px solid #f93}:host [part=input][warning][disabled]{color:rgba(72,72,72,.6);border:1px solid rgba(255,153,51,.6)}:host [part=input][error],:host [part=input][error][warning]{border:1px solid #d94255}:host [part=input][error][disabled],:host [part=input][error][warning][disabled]{color:rgba(72,72,72,.6);border:1px solid rgba(217,66,85,.6)}:host [part=input] ::-ms-clear{display:none}:host [part=input]::-webkit-clear-button,:host [part=input]::-webkit-inner-spin-button,:host [part=input]::-webkit-search-cancel-button,:host [part=input]::-webkit-search-decoration{-webkit-appearance:none}:host [part=input]:hover{border-color:#bfc3cb;color:#484848}:host [part=button]{touch-action:manipulation}:host{--first-icon:previous;--last-icon:next;--previous-icon:left;--next-icon:right}:host [part=input]:focus{background-size:100% 2px,100% 1px!important;background-position:center bottom!important;border-color:#ffb266;border-style:dotted}');
|
package/lib/panel/index.d.ts
CHANGED