@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
|
@@ -1,31 +1 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* Used to format views
|
|
4
|
-
*/
|
|
5
|
-
declare const ViewFormatTranslateParams: TranslateParams;
|
|
6
|
-
/**
|
|
7
|
-
* Get a list of weekday abbreviations based on locale
|
|
8
|
-
* @param locale Locale
|
|
9
|
-
* @param [width='short'] Day width
|
|
10
|
-
* @returns The list of weekdays starting from Sunday
|
|
11
|
-
*/
|
|
12
|
-
declare const weekdaysNames: (locale: string, width?: Intl.DateTimeFormatOptions['weekday']) => string[];
|
|
13
|
-
/**
|
|
14
|
-
* Get a list of months based on locale
|
|
15
|
-
* @param locale Locale
|
|
16
|
-
* @param [width='short'] Month width
|
|
17
|
-
* @returns The list of months starting from January
|
|
18
|
-
*/
|
|
19
|
-
declare const monthsNames: (locale: string, width?: Intl.DateTimeFormatOptions['month']) => string[];
|
|
20
|
-
/**
|
|
21
|
-
* @deprecated
|
|
22
|
-
* Some old browsers (as IE11) do not support formatting of old dates before BC
|
|
23
|
-
* Instead simply convert the date manually to match Translate function
|
|
24
|
-
* @param date Date
|
|
25
|
-
* @param locale locale
|
|
26
|
-
* @param [includeMonth=false] true to include month
|
|
27
|
-
* @param [includeEra=false] tru to include era descriptor
|
|
28
|
-
* @returns formatted dates
|
|
29
|
-
*/
|
|
30
|
-
declare const formatLocaleDate: (date: Date, locale: string, includeMonth?: boolean, includeEra?: boolean) => string;
|
|
31
|
-
export { weekdaysNames, monthsNames, formatLocaleDate, ViewFormatTranslateParams };
|
|
1
|
+
export {};
|
package/lib/calendar/locales.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { Phrasebook } from '@refinitiv-ui/phrasebook';
|
|
2
|
-
import {
|
|
3
|
-
import { utcParse } from '@refinitiv-ui/utils';
|
|
2
|
+
import { CalendarLocaleScope } from './constants.js';
|
|
4
3
|
// While Intl can support literally all world languages
|
|
5
4
|
// for safety still limit the number of locales, for the following reasons
|
|
6
5
|
// 1) different browsers and OS support different locales, and the result might be different.
|
|
7
6
|
// 2) first day of week is different. Currently it is not possible to get this info out of Intl object
|
|
8
7
|
const globals = {
|
|
9
|
-
VIEW_FORMAT: '{includeMonth, select, true {{includeEra, select, true {{ date, date, calendarMonthEra }}
|
|
8
|
+
VIEW_FORMAT: '{includeMonth, select, true {{includeEra, select, true {{ date, date, calendarMonthEra }} other {{ date, date, calendarMonth }}}} other {{ includeEra, select, true {{ date, date, calendarYearEra }} other {{ date, date, calendarYear }}}}}',
|
|
10
9
|
FIRST_DAY_OF_WEEK: '1'
|
|
11
10
|
};
|
|
12
11
|
const en = globals;
|
|
@@ -24,7 +23,7 @@ const ru = globals;
|
|
|
24
23
|
const th = Object.assign(Object.assign({}, globals), { FIRST_DAY_OF_WEEK: '0' });
|
|
25
24
|
const zh = globals;
|
|
26
25
|
const ar = Object.assign(Object.assign({}, globals), { FIRST_DAY_OF_WEEK: '6' });
|
|
27
|
-
const scope =
|
|
26
|
+
const scope = CalendarLocaleScope;
|
|
28
27
|
Phrasebook.define('en', scope, en);
|
|
29
28
|
Phrasebook.define('en-CA', scope, enCA);
|
|
30
29
|
Phrasebook.define('en-US', scope, enUS);
|
|
@@ -40,106 +39,3 @@ Phrasebook.define('ru', scope, ru);
|
|
|
40
39
|
Phrasebook.define('th', scope, th);
|
|
41
40
|
Phrasebook.define('zh', scope, zh);
|
|
42
41
|
Phrasebook.define('ar', scope, ar);
|
|
43
|
-
const calendar = {
|
|
44
|
-
// calendar property is not part of TypeScript Intl.DateTimeFormatOptions,
|
|
45
|
-
// but is supported by all modern browsers and is required by Intl.DateTimeFormat polyfill
|
|
46
|
-
calendar: 'gregory',
|
|
47
|
-
timeZone: 'UTC'
|
|
48
|
-
};
|
|
49
|
-
/**
|
|
50
|
-
* Custom formats for date formatting
|
|
51
|
-
*/
|
|
52
|
-
const DateMessageFormats = {
|
|
53
|
-
date: {
|
|
54
|
-
calendarMonthEra: Object.assign(Object.assign({}, calendar), { month: 'long', year: 'numeric', era: 'short' }),
|
|
55
|
-
calendarMonth: Object.assign(Object.assign({}, calendar), { month: 'long', year: 'numeric' }),
|
|
56
|
-
calendarYearEra: Object.assign(Object.assign({}, calendar), { year: 'numeric', era: 'short' }),
|
|
57
|
-
calendarYear: Object.assign(Object.assign({}, calendar), { year: 'numeric' })
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
/**
|
|
61
|
-
* Used to format views
|
|
62
|
-
*/
|
|
63
|
-
const ViewFormatTranslateParams = {
|
|
64
|
-
unicodeExtensions: {
|
|
65
|
-
// while latest Chrome, FF and Intl.DateTimeFormat polyfill support
|
|
66
|
-
// calendar option to format date,
|
|
67
|
-
// older browsers as Safari and IE11 need this to be provided as
|
|
68
|
-
// unicode extension, e.g. lang="th-u-ca-gregory"
|
|
69
|
-
ca: 'gregory'
|
|
70
|
-
},
|
|
71
|
-
formats: DateMessageFormats
|
|
72
|
-
};
|
|
73
|
-
/**
|
|
74
|
-
* Get locale based on provided locale and Phrasebook available locales
|
|
75
|
-
* @param locale locale tag
|
|
76
|
-
* @returns resolved locale
|
|
77
|
-
*/
|
|
78
|
-
const getLocale = (locale) => {
|
|
79
|
-
return resolveLocale(scope, locale) || DEFAULT_LOCALE;
|
|
80
|
-
};
|
|
81
|
-
/**
|
|
82
|
-
* Get a list of weekday abbreviations based on locale
|
|
83
|
-
* @param locale Locale
|
|
84
|
-
* @param [width='short'] Day width
|
|
85
|
-
* @returns The list of weekdays starting from Sunday
|
|
86
|
-
*/
|
|
87
|
-
const weekdaysNames = (locale, width = 'narrow') => {
|
|
88
|
-
locale = getLocale(locale);
|
|
89
|
-
// we know that Jan 04 1970 is Sunday
|
|
90
|
-
let day = 4;
|
|
91
|
-
const date = utcParse({
|
|
92
|
-
year: 1970,
|
|
93
|
-
month: 0,
|
|
94
|
-
day: day
|
|
95
|
-
});
|
|
96
|
-
const weekdays = [];
|
|
97
|
-
while (day < 11) {
|
|
98
|
-
weekdays.push(date.toLocaleDateString(locale, { weekday: width, timeZone: 'UTC' }));
|
|
99
|
-
day += 1;
|
|
100
|
-
date.setUTCDate(day);
|
|
101
|
-
}
|
|
102
|
-
return weekdays;
|
|
103
|
-
};
|
|
104
|
-
/**
|
|
105
|
-
* Get a list of months based on locale
|
|
106
|
-
* @param locale Locale
|
|
107
|
-
* @param [width='short'] Month width
|
|
108
|
-
* @returns The list of months starting from January
|
|
109
|
-
*/
|
|
110
|
-
const monthsNames = (locale, width = 'short') => {
|
|
111
|
-
locale = getLocale(locale);
|
|
112
|
-
let month = 0;
|
|
113
|
-
const date = utcParse({
|
|
114
|
-
year: 1970,
|
|
115
|
-
month,
|
|
116
|
-
day: 1
|
|
117
|
-
});
|
|
118
|
-
const months = [];
|
|
119
|
-
while (month < 12) {
|
|
120
|
-
months.push(date.toLocaleDateString(locale, { month: width, timeZone: 'UTC' }));
|
|
121
|
-
month += 1;
|
|
122
|
-
date.setUTCMonth(month);
|
|
123
|
-
}
|
|
124
|
-
return months;
|
|
125
|
-
};
|
|
126
|
-
/**
|
|
127
|
-
* @deprecated
|
|
128
|
-
* Some old browsers (as IE11) do not support formatting of old dates before BC
|
|
129
|
-
* Instead simply convert the date manually to match Translate function
|
|
130
|
-
* @param date Date
|
|
131
|
-
* @param locale locale
|
|
132
|
-
* @param [includeMonth=false] true to include month
|
|
133
|
-
* @param [includeEra=false] tru to include era descriptor
|
|
134
|
-
* @returns formatted dates
|
|
135
|
-
*/
|
|
136
|
-
const formatLocaleDate = (date, locale, includeMonth = false, includeEra = false) => {
|
|
137
|
-
const monthNames = monthsNames(locale, 'long');
|
|
138
|
-
locale = getLocale(locale);
|
|
139
|
-
const year = date.getUTCFullYear();
|
|
140
|
-
const month = date.getUTCMonth();
|
|
141
|
-
// BC flags are not supported. Always use English
|
|
142
|
-
return `${includeMonth ? `${monthNames[month]} ` : ''} ${year > 0 ? year : year === 0 ? '1' : Math.abs(year - 1)}${includeEra ? year <= 0 ? ' BC' : ' AD' : ''}`;
|
|
143
|
-
};
|
|
144
|
-
export { weekdaysNames, monthsNames, formatLocaleDate, ViewFormatTranslateParams };
|
|
145
|
-
//# sourceMappingURL=locales.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import '@refinitiv-ui/elements/lib/button/themes/halo/dark';
|
|
2
2
|
|
|
3
|
-
elf.customStyles.define('ef-calendar', ':host{font-style:normal;font-variant:normal;font-weight:400;line-height:normal;text-align:left;text-indent:0;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;outline:0;font-size:12rem;color:#ccc;min-width:196px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background:#262626;padding:4px 3px}:host [part=navigation]{padding-bottom:3px}:host [part=btn-next],:host [part=btn-prev],:host [part=btn-view]{margin:0}:host [part=btn-view]{background:0 0;margin-left:16px;border:none;color:inherit;padding:0}:host [part=btn-view]:hover,:host [part=btn-view][focused=visible]{opacity:.8}:host [part=table]{width:100%;background:#262626}:host [part~=row]:not(:first-of-type) [part~=cell] [part~=cell-content]{top:1px}:host [part~=day-name-row]{background-color:#333}:host [part~=cell]
|
|
3
|
+
elf.customStyles.define('ef-calendar', ':host{font-style:normal;font-variant:normal;font-weight:400;line-height:normal;text-align:left;text-indent:0;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;outline:0;font-size:12rem;color:#ccc;min-width:196px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background:#262626;padding:4px 3px}:host [part=navigation]{padding-bottom:3px}:host [part=btn-next],:host [part=btn-prev],:host [part=btn-view]{margin:0}:host [part=btn-view]{background:0 0;margin-left:16px;border:none;color:inherit;padding:0}:host [part=btn-view]:hover,:host [part=btn-view][focused=visible]{opacity:.8}:host [part=table]{width:100%;background:#262626}:host [part~=row]:not(:first-of-type) [part~=cell] [part~=cell-content]{top:1px}:host [part~=day-name-row]{background-color:#333}:host [part~=cell][disabled] [part~=selection]{opacity:.4}:host [part~=cell][today]{color:#fff}:host [part~=cell][today] [part~=selection]{background:#404040}:host [part~=cell]:not([selected]):not([range]):not([disabled])[idle] [part~=selection]{opacity:.6}:host [part~=cell]:not([today]):not([range]) [part~=selection]:hover{color:#fff}:host [part~=cell]:not(:active) [part~=selection]:hover{border-color:#334bff}:host [part~=cell]:not([selected]):not([range]):not([today]) [part~=selection]:hover{background:#334bff}:host [part~=cell]:not([selected]):not([range]):not([today]):not(:active) [part~=selection]:hover{border-color:#334bff}:host [part~=cell]:not([selected]):not([range]):not([today]):active [part~=selection]{color:#fff;background-color:#0f1e8a}:host [part~=cell][range]:not(:active) [part~=selection]:hover,:host [part~=cell][selected]:not(:active) [part~=selection]:hover,:host [part~=cell][today]:not(:active) [part~=selection]:hover{border-color:#334bff}:host [part~=cell][range]:active [part~=selection],:host [part~=cell][selected]:active [part~=selection],:host [part~=cell][today]:active [part~=selection]{color:#fff;background-color:#0f1e8a}:host [part~=cell][range] [part~=selection]{background:rgba(51,75,255,.2)}:host [part~=cell][range][today]{color:#fff}:host [part~=cell][selected]{color:#fff}:host [part~=cell][selected] [part~=selection]{background:#334bff}:host [part~=cell]:not(:first-of-type) [part~=cell-content]{left:1px}:host [part~=day-name]{color:#999;font-weight:500}:host [part~=day-name] [part~=cell-content]{background-color:#1a1a1a}:host [part~=cell-content]{background:#0d0d0d;top:0;bottom:0;right:0;left:0}:host [part~=selection]{outline:0;border:1px solid #0d0d0d}:host([focused=visible]) [part~=cell] [part~=selection]:focus{outline:#334bff solid 1px}:host([disabled]){opacity:.4}');
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import '@refinitiv-ui/elements/lib/button/themes/halo/light';
|
|
2
2
|
|
|
3
|
-
elf.customStyles.define('ef-calendar', ':host{font-style:normal;font-variant:normal;font-weight:400;line-height:normal;text-align:left;text-indent:0;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;outline:0;font-size:12rem;color:#0d0d0d;min-width:196px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background:#f2f2f2;padding:4px 3px}:host [part=navigation]{padding-bottom:3px}:host [part=btn-next],:host [part=btn-prev],:host [part=btn-view]{margin:0}:host [part=btn-next]:not(:hover):not(:focus):not(:active),:host [part=btn-prev]:not(:hover):not(:focus):not(:active){color:#595959}:host [part=btn-view]{background:0 0;margin-left:16px;border:none;color:inherit;padding:0}:host [part=btn-view]:hover,:host [part=btn-view][focused=visible]{opacity:.8}:host [part=table]{width:100%;background:#e6e6e6}:host [part~=row]:not(:first-of-type) [part~=cell] [part~=cell-content]{top:1px}:host [part~=day-name-row]{background-color:#e6e6e6}:host [part~=cell]
|
|
3
|
+
elf.customStyles.define('ef-calendar', ':host{font-style:normal;font-variant:normal;font-weight:400;line-height:normal;text-align:left;text-indent:0;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;outline:0;font-size:12rem;color:#0d0d0d;min-width:196px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background:#f2f2f2;padding:4px 3px}:host [part=navigation]{padding-bottom:3px}:host [part=btn-next],:host [part=btn-prev],:host [part=btn-view]{margin:0}:host [part=btn-next]:not(:hover):not(:focus):not(:active),:host [part=btn-prev]:not(:hover):not(:focus):not(:active){color:#595959}:host [part=btn-view]{background:0 0;margin-left:16px;border:none;color:inherit;padding:0}:host [part=btn-view]:hover,:host [part=btn-view][focused=visible]{opacity:.8}:host [part=table]{width:100%;background:#e6e6e6}:host [part~=row]:not(:first-of-type) [part~=cell] [part~=cell-content]{top:1px}:host [part~=day-name-row]{background-color:#e6e6e6}:host [part~=cell][disabled] [part~=selection]{opacity:.4}:host [part~=cell][today]{color:#0d0d0d}:host [part~=cell][today] [part~=selection]{background:#d9d9d9}:host [part~=cell]:not([selected]):not([range]):not([disabled])[idle] [part~=selection]{opacity:.6}:host [part~=cell]:not([today]):not([range]) [part~=selection]:hover{color:#fff}:host [part~=cell]:not(:active) [part~=selection]:hover{border-color:#334bff}:host [part~=cell]:not([selected]):not([range]):not([today]) [part~=selection]:hover{background:#334bff}:host [part~=cell]:not([selected]):not([range]):not([today]):not(:active) [part~=selection]:hover{border-color:#334bff}:host [part~=cell]:not([selected]):not([range]):not([today]):active [part~=selection]{color:#fff;background-color:#0f1e8a}:host [part~=cell][range]:not(:active) [part~=selection]:hover,:host [part~=cell][selected]:not(:active) [part~=selection]:hover,:host [part~=cell][today]:not(:active) [part~=selection]:hover{border-color:#334bff}:host [part~=cell][range]:active [part~=selection],:host [part~=cell][selected]:active [part~=selection],:host [part~=cell][today]:active [part~=selection]{color:#fff;background-color:#0f1e8a}:host [part~=cell][range] [part~=selection]{background:rgba(51,75,255,.2)}:host [part~=cell][range][today]{color:#fff}:host [part~=cell][selected]{color:#fff}:host [part~=cell][selected] [part~=selection]{background:#334bff}:host [part~=cell]:not(:first-of-type) [part~=cell-content]{left:1px}:host [part~=day-name]{color:#737373;font-weight:500}:host [part~=day-name] [part~=cell-content]{background-color:#fafafa}:host [part~=cell-content]{background:#fff;top:0;bottom:0;right:0;left:0}:host [part~=selection]{outline:0;border:1px solid #fff}:host([focused=visible]) [part~=cell] [part~=selection]:focus{outline:#334bff solid 1px}:host([disabled]){opacity:.4}');
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import '@refinitiv-ui/elements/lib/button/themes/solar/charcoal';
|
|
2
2
|
|
|
3
|
-
elf.customStyles.define('ef-calendar', ':host{font-style:normal;font-variant:normal;font-weight:400;line-height:normal;text-align:left;text-indent:0;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;outline:0;font-size:13rem;color:#c2c2c2;min-width:224px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background:#3c3c42;padding:4px}:host [part=navigation]{padding-bottom:4px}:host [part=btn-next],:host [part=btn-prev],:host [part=btn-view]{margin:0}:host [part=btn-view]{background:0 0;color:inherit;box-shadow:none;margin-left:15px;padding:0}:host [part=btn-view]:not([focused=visible]){border:none}:host [part=table]{width:100%;box-shadow:0 0 0 1px #000;background:#212124}:host [part~=row]:not(:last-of-type){box-shadow:0 1px 0 0 #0a0a0a}:host [part~=row]:not(:first-of-type) [part~=cell] [part~=selection]{top:1px}:host [part~=cell]
|
|
3
|
+
elf.customStyles.define('ef-calendar', ':host{font-style:normal;font-variant:normal;font-weight:400;line-height:normal;text-align:left;text-indent:0;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;outline:0;font-size:13rem;color:#c2c2c2;min-width:224px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background:#3c3c42;padding:4px}:host [part=navigation]{padding-bottom:4px}:host [part=btn-next],:host [part=btn-prev],:host [part=btn-view]{margin:0}:host [part=btn-view]{background:0 0;color:inherit;box-shadow:none;margin-left:15px;padding:0}:host [part=btn-view]:not([focused=visible]){border:none}:host [part=table]{width:100%;box-shadow:0 0 0 1px #000;background:#212124}:host [part~=row]:not(:last-of-type){box-shadow:0 1px 0 0 #0a0a0a}:host [part~=row]:not(:first-of-type) [part~=cell] [part~=selection]{top:1px}:host [part~=cell]:not(:last-of-type){box-shadow:1px 0 0 0 #0a0a0a}:host [part~=cell][disabled] [part~=selection]{opacity:.4}:host [part~=cell][today]{color:#f93}:host [part~=cell][today] [part~=selection]{background:#3c3c42}:host [part~=cell]:not([selected]):not([range]):not([disabled])[idle] [part~=selection]{opacity:.6}:host [part~=cell]:not([selected]):not([range]) [part~=selection]:focus,:host [part~=cell]:not([selected]):not([range]) [part~=selection]:hover{background:#3c3c42;color:#e2e2e2}:host [part~=cell]:not([selected]):not([range]) [part~=selection]:focus{outline:#f93 dotted 1px}:host [part~=cell][range] [part~=selection]{background:rgba(255,153,51,.2)}:host [part~=cell][range][today]{color:#f93}:host [part~=cell][selected]{color:#000}:host [part~=cell][selected] [part~=selection]{background:#f93}:host [part~=cell]:not(:first-of-type) [part~=selection]{left:1px}:host [part~=day-name]{background-color:#151516;color:#666570;font-size:10px;font-weight:700}:host [part~=selection]{outline:0;top:0;bottom:0;right:0;left:0}:host([disabled]){opacity:.4}');
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import '@refinitiv-ui/elements/lib/button/themes/solar/pearl';
|
|
2
2
|
|
|
3
|
-
elf.customStyles.define('ef-calendar', ':host{font-style:normal;font-variant:normal;font-weight:400;line-height:normal;text-align:left;text-indent:0;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;outline:0;font-size:13rem;color:#484848;min-width:224px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background:#fff;padding:4px}:host [part=navigation]{padding-bottom:4px}:host [part=btn-next],:host [part=btn-prev],:host [part=btn-view]{margin:0}:host [part=btn-view]{background:0 0;color:inherit;box-shadow:none;margin-left:15px;padding:0}:host [part=btn-view]:not([focused=visible]){border:none}:host [part=table]{width:100%;box-shadow:0 0 0 1px #a9afba;background:#fff}:host [part~=row]:not(:last-of-type){box-shadow:0 1px 0 0 #d5d8db}:host [part~=row]:not(:first-of-type) [part~=cell] [part~=selection]{top:1px}:host [part~=cell]
|
|
3
|
+
elf.customStyles.define('ef-calendar', ':host{font-style:normal;font-variant:normal;font-weight:400;line-height:normal;text-align:left;text-indent:0;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;outline:0;font-size:13rem;color:#484848;min-width:224px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background:#fff;padding:4px}:host [part=navigation]{padding-bottom:4px}:host [part=btn-next],:host [part=btn-prev],:host [part=btn-view]{margin:0}:host [part=btn-view]{background:0 0;color:inherit;box-shadow:none;margin-left:15px;padding:0}:host [part=btn-view]:not([focused=visible]){border:none}:host [part=table]{width:100%;box-shadow:0 0 0 1px #a9afba;background:#fff}:host [part~=row]:not(:last-of-type){box-shadow:0 1px 0 0 #d5d8db}:host [part~=row]:not(:first-of-type) [part~=cell] [part~=selection]{top:1px}:host [part~=cell]:not(:last-of-type){box-shadow:1px 0 0 0 #d5d8db}:host [part~=cell][disabled] [part~=selection]{opacity:.4}:host [part~=cell][today]{color:#fff}:host [part~=cell][today] [part~=selection]{background:#acafb5}:host [part~=cell]:not([selected]):not([range]):not([disabled])[idle] [part~=selection]{opacity:.6}:host [part~=cell]:not([selected]):not([range]) [part~=selection]:focus,:host [part~=cell]:not([selected]):not([range]) [part~=selection]:hover{background:#e4e8ed;color:#000}:host [part~=cell]:not([selected]):not([range]) [part~=selection]:focus{outline:#ee7600 dotted 1px}:host [part~=cell][range] [part~=selection]{background:rgba(255,153,51,.2)}:host [part~=cell][range][today]{color:#f93}:host [part~=cell][selected]{color:#fff}:host [part~=cell][selected] [part~=selection]{background:#f93}:host [part~=cell]:not(:first-of-type) [part~=selection]{left:1px}:host [part~=day-name]{background-color:#e4e8ed;color:#6e6e78;font-size:10px;font-weight:700}:host [part~=selection]{outline:0;top:0;bottom:0;right:0;left:0}:host([disabled]){opacity:.4}');
|
package/lib/calendar/types.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
MONTH = "month",
|
|
4
|
-
YEAR = "year"
|
|
5
|
-
}
|
|
1
|
+
import { CellIndex } from '@refinitiv-ui/utils/lib/navigation.js';
|
|
2
|
+
import { RenderView } from './constants.js';
|
|
6
3
|
export interface CellSelectionModel {
|
|
7
4
|
selected?: boolean;
|
|
8
5
|
range?: boolean;
|
|
@@ -14,20 +11,22 @@ export interface CellSelectionModel {
|
|
|
14
11
|
export interface Cell extends CellSelectionModel {
|
|
15
12
|
view: RenderView;
|
|
16
13
|
text?: string;
|
|
14
|
+
active?: boolean;
|
|
17
15
|
value?: string;
|
|
18
16
|
disabled?: boolean;
|
|
19
17
|
idle?: boolean;
|
|
20
18
|
now?: boolean;
|
|
19
|
+
index: CellIndex;
|
|
21
20
|
}
|
|
22
21
|
export declare type CalendarFilter = (value: string) => boolean;
|
|
23
22
|
export declare type Comparator = (value: string, compare: string) => boolean;
|
|
24
|
-
export interface
|
|
25
|
-
value
|
|
26
|
-
|
|
27
|
-
idle?: boolean;
|
|
28
|
-
selected?: boolean;
|
|
29
|
-
range?: boolean;
|
|
23
|
+
export interface DateButtonElement extends HTMLDivElement {
|
|
24
|
+
value: string;
|
|
25
|
+
index: CellIndex;
|
|
30
26
|
}
|
|
31
|
-
export declare type
|
|
32
|
-
|
|
27
|
+
export declare type NavigationDirection = 'ArrowLeft' | 'ArrowRight' | 'ArrowUp' | 'ArrowDown' | 'Home' | 'End';
|
|
28
|
+
export declare type Row = Cell[];
|
|
29
|
+
export declare type WeekdayName = {
|
|
30
|
+
narrow: string;
|
|
31
|
+
long: string;
|
|
33
32
|
};
|
package/lib/calendar/types.js
CHANGED
package/lib/calendar/utils.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TranslateParams } from '@refinitiv-ui/i18n';
|
|
1
2
|
export declare type MonthInfo = {
|
|
2
3
|
days: number;
|
|
3
4
|
month: number;
|
|
@@ -9,4 +10,33 @@ export declare type MonthInfo = {
|
|
|
9
10
|
* @returns Month information object
|
|
10
11
|
*/
|
|
11
12
|
declare const monthInfo: (value: string) => MonthInfo;
|
|
12
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Get a list of weekday abbreviations based on locale
|
|
15
|
+
* @param locale Locale
|
|
16
|
+
* @param [width='short'] Day width
|
|
17
|
+
* @returns The list of weekdays starting from Sunday
|
|
18
|
+
*/
|
|
19
|
+
declare const weekdaysNames: (locale: string, width?: Intl.DateTimeFormatOptions['weekday']) => string[];
|
|
20
|
+
/**
|
|
21
|
+
* Get a list of months based on locale
|
|
22
|
+
* @param locale Locale
|
|
23
|
+
* @param [width='short'] Month width
|
|
24
|
+
* @returns The list of months starting from January
|
|
25
|
+
*/
|
|
26
|
+
declare const monthsNames: (locale: string, width?: Intl.DateTimeFormatOptions['month']) => string[];
|
|
27
|
+
/**
|
|
28
|
+
* @deprecated
|
|
29
|
+
* Some old browsers (as IE11) do not support formatting of old dates before BC
|
|
30
|
+
* Instead simply convert the date manually to match Translate function
|
|
31
|
+
* @param date Date
|
|
32
|
+
* @param locale locale
|
|
33
|
+
* @param [includeMonth=false] true to include month
|
|
34
|
+
* @param [includeEra=false] tru to include era descriptor
|
|
35
|
+
* @returns formatted dates
|
|
36
|
+
*/
|
|
37
|
+
declare const formatLocaleDate: (date: Date, locale: string, includeMonth?: boolean, includeEra?: boolean) => string;
|
|
38
|
+
/**
|
|
39
|
+
* Used to format views
|
|
40
|
+
*/
|
|
41
|
+
declare const ViewFormatTranslateParams: TranslateParams;
|
|
42
|
+
export { monthInfo, weekdaysNames, monthsNames, formatLocaleDate, ViewFormatTranslateParams };
|
package/lib/calendar/utils.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { toDateSegment, getDaysInMonth } from '@refinitiv-ui/utils';
|
|
1
|
+
import { toDateSegment, getDaysInMonth, utcParse } from '@refinitiv-ui/utils/lib/date.js';
|
|
2
|
+
import { DEFAULT_LOCALE, resolveLocale } from '@refinitiv-ui/i18n';
|
|
3
|
+
import { CalendarLocaleScope } from './constants.js';
|
|
2
4
|
/**
|
|
3
5
|
* Get information about number of days, month number and year from date object
|
|
4
6
|
* @param value Date string
|
|
@@ -14,5 +16,105 @@ const monthInfo = (value) => {
|
|
|
14
16
|
year
|
|
15
17
|
};
|
|
16
18
|
};
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
const calendar = {
|
|
20
|
+
// calendar property is not part of TypeScript Intl.DateTimeFormatOptions,
|
|
21
|
+
// but is supported by all modern browsers and is required by Intl.DateTimeFormat polyfill
|
|
22
|
+
calendar: 'gregory',
|
|
23
|
+
timeZone: 'UTC'
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Custom formats for date formatting
|
|
27
|
+
*/
|
|
28
|
+
const DateMessageFormats = {
|
|
29
|
+
date: {
|
|
30
|
+
calendarMonthEra: Object.assign(Object.assign({}, calendar), { month: 'long', year: 'numeric', era: 'short' }),
|
|
31
|
+
calendarMonth: Object.assign(Object.assign({}, calendar), { month: 'long', year: 'numeric' }),
|
|
32
|
+
calendarYearEra: Object.assign(Object.assign({}, calendar), { year: 'numeric', era: 'short' }),
|
|
33
|
+
calendarYear: Object.assign(Object.assign({}, calendar), { year: 'numeric' })
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Get locale based on provided locale and Phrasebook available locales
|
|
38
|
+
* @param locale locale tag
|
|
39
|
+
* @returns resolved locale
|
|
40
|
+
*/
|
|
41
|
+
const getLocale = (locale) => {
|
|
42
|
+
return resolveLocale(CalendarLocaleScope, locale) || DEFAULT_LOCALE;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Get a list of weekday abbreviations based on locale
|
|
46
|
+
* @param locale Locale
|
|
47
|
+
* @param [width='short'] Day width
|
|
48
|
+
* @returns The list of weekdays starting from Sunday
|
|
49
|
+
*/
|
|
50
|
+
const weekdaysNames = (locale, width = 'narrow') => {
|
|
51
|
+
locale = getLocale(locale);
|
|
52
|
+
// we know that Jan 04 1970 is Sunday
|
|
53
|
+
let day = 4;
|
|
54
|
+
const date = utcParse({
|
|
55
|
+
year: 1970,
|
|
56
|
+
month: 0,
|
|
57
|
+
day: day
|
|
58
|
+
});
|
|
59
|
+
const weekdays = [];
|
|
60
|
+
while (day < 11) {
|
|
61
|
+
weekdays.push(date.toLocaleDateString(locale, { weekday: width, timeZone: 'UTC' }));
|
|
62
|
+
day += 1;
|
|
63
|
+
date.setUTCDate(day);
|
|
64
|
+
}
|
|
65
|
+
return weekdays;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Get a list of months based on locale
|
|
69
|
+
* @param locale Locale
|
|
70
|
+
* @param [width='short'] Month width
|
|
71
|
+
* @returns The list of months starting from January
|
|
72
|
+
*/
|
|
73
|
+
const monthsNames = (locale, width = 'short') => {
|
|
74
|
+
locale = getLocale(locale);
|
|
75
|
+
let month = 0;
|
|
76
|
+
const date = utcParse({
|
|
77
|
+
year: 1970,
|
|
78
|
+
month,
|
|
79
|
+
day: 1
|
|
80
|
+
});
|
|
81
|
+
const months = [];
|
|
82
|
+
while (month < 12) {
|
|
83
|
+
months.push(date.toLocaleDateString(locale, { month: width, timeZone: 'UTC' }));
|
|
84
|
+
month += 1;
|
|
85
|
+
date.setUTCMonth(month);
|
|
86
|
+
}
|
|
87
|
+
return months;
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* @deprecated
|
|
91
|
+
* Some old browsers (as IE11) do not support formatting of old dates before BC
|
|
92
|
+
* Instead simply convert the date manually to match Translate function
|
|
93
|
+
* @param date Date
|
|
94
|
+
* @param locale locale
|
|
95
|
+
* @param [includeMonth=false] true to include month
|
|
96
|
+
* @param [includeEra=false] tru to include era descriptor
|
|
97
|
+
* @returns formatted dates
|
|
98
|
+
*/
|
|
99
|
+
const formatLocaleDate = (date, locale, includeMonth = false, includeEra = false) => {
|
|
100
|
+
locale = getLocale(locale);
|
|
101
|
+
const monthNames = monthsNames(locale, 'long');
|
|
102
|
+
const year = date.getUTCFullYear();
|
|
103
|
+
const month = date.getUTCMonth();
|
|
104
|
+
// BC flags are not supported. Always use English
|
|
105
|
+
return `${includeMonth ? `${monthNames[month]} ` : ''} ${year > 0 ? year : year === 0 ? '1' : Math.abs(year - 1)}${includeEra ? year <= 0 ? ' BC' : ' AD' : ''}`;
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* Used to format views
|
|
109
|
+
*/
|
|
110
|
+
const ViewFormatTranslateParams = {
|
|
111
|
+
unicodeExtensions: {
|
|
112
|
+
// while latest Chrome, FF and Intl.DateTimeFormat polyfill support
|
|
113
|
+
// calendar option to format date,
|
|
114
|
+
// older browsers as Safari and IE11 need this to be provided as
|
|
115
|
+
// unicode extension, e.g. lang="th-u-ca-gregory"
|
|
116
|
+
ca: 'gregory'
|
|
117
|
+
},
|
|
118
|
+
formats: DateMessageFormats
|
|
119
|
+
};
|
|
120
|
+
export { monthInfo, weekdaysNames, monthsNames, formatLocaleDate, ViewFormatTranslateParams };
|
|
@@ -3,12 +3,13 @@
|
|
|
3
3
|
"tags": [
|
|
4
4
|
{
|
|
5
5
|
"name": "ef-canvas",
|
|
6
|
-
"description": "A Component uses
|
|
6
|
+
"description": "A Component uses to draw graphics on a web page,\nit works similarly to the normal HTML5 Canvas element.",
|
|
7
7
|
"attributes": [
|
|
8
8
|
{
|
|
9
9
|
"name": "autoloop",
|
|
10
10
|
"description": "Starts an automatic animation loop.\nEnabling the frame event.",
|
|
11
|
-
"type": "boolean"
|
|
11
|
+
"type": "boolean",
|
|
12
|
+
"default": "false"
|
|
12
13
|
}
|
|
13
14
|
],
|
|
14
15
|
"properties": [
|
|
@@ -16,20 +17,21 @@
|
|
|
16
17
|
"name": "autoloop",
|
|
17
18
|
"attribute": "autoloop",
|
|
18
19
|
"description": "Starts an automatic animation loop.\nEnabling the frame event.",
|
|
19
|
-
"type": "boolean"
|
|
20
|
+
"type": "boolean",
|
|
21
|
+
"default": "false"
|
|
20
22
|
},
|
|
21
23
|
{
|
|
22
|
-
"name": "canvas",
|
|
24
|
+
"name": "canvas (readonly)",
|
|
23
25
|
"description": "Html canvas element",
|
|
24
26
|
"type": "HTMLCanvasElement"
|
|
25
27
|
},
|
|
26
28
|
{
|
|
27
|
-
"name": "ctx",
|
|
29
|
+
"name": "ctx (readonly)",
|
|
28
30
|
"description": "Alias of context",
|
|
29
31
|
"type": "CanvasRenderingContext2D | null"
|
|
30
32
|
},
|
|
31
33
|
{
|
|
32
|
-
"name": "context",
|
|
34
|
+
"name": "context (readonly)",
|
|
33
35
|
"description": "The 2 dimensional context of the canvas, used for drawing",
|
|
34
36
|
"type": "CanvasRenderingContext2D | null"
|
|
35
37
|
},
|
|
@@ -49,7 +51,7 @@
|
|
|
49
51
|
"events": [
|
|
50
52
|
{
|
|
51
53
|
"name": "frame",
|
|
52
|
-
"description": "
|
|
54
|
+
"description": "dispatched when next Frame event occurs when autoloop is set to true"
|
|
53
55
|
}
|
|
54
56
|
],
|
|
55
57
|
"methods": [
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# ef-canvas
|
|
2
|
+
|
|
3
|
+
A Component uses to draw graphics on a web page,
|
|
4
|
+
it works similarly to the normal HTML5 Canvas element.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
| Property | Attribute | Type | Default | Description |
|
|
9
|
+
|----------------------|------------|------------------------------------|---------|--------------------------------------------------|
|
|
10
|
+
| `autoloop` | `autoloop` | `boolean` | false | Starts an automatic animation loop.<br />Enabling the frame event. |
|
|
11
|
+
| `canvas (readonly)` | | `HTMLCanvasElement` | | Html canvas element |
|
|
12
|
+
| `context (readonly)` | | `CanvasRenderingContext2D \| null` | | The 2 dimensional context of the canvas, used for drawing |
|
|
13
|
+
| `ctx (readonly)` | | `CanvasRenderingContext2D \| null` | | Alias of context |
|
|
14
|
+
| `height` | | `number` | 0 | Height of canvas |
|
|
15
|
+
| `width` | | `number` | 0 | Width of canvas |
|
|
16
|
+
|
|
17
|
+
## Methods
|
|
18
|
+
|
|
19
|
+
| Method | Type | Description |
|
|
20
|
+
|--------------|--------------------------|--------------------------------------------------|
|
|
21
|
+
| `getContext` | `(mode: string): string` | Return context of canvas,<br />support only 2D mode<br /><br />**mode**: mode of canvas's context |
|
|
22
|
+
|
|
23
|
+
## Events
|
|
24
|
+
|
|
25
|
+
| Event | Description |
|
|
26
|
+
|---------|--------------------------------------------------|
|
|
27
|
+
| `frame` | dispatched when next Frame event occurs when autoloop is set to true |
|
package/lib/canvas/index.d.ts
CHANGED
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
import { JSXInterface } from '../jsx';
|
|
2
|
-
import { ResponsiveElement, TemplateResult,
|
|
2
|
+
import { ResponsiveElement, TemplateResult, CSSResultGroup, ElementSize } from '@refinitiv-ui/core';
|
|
3
3
|
/**
|
|
4
|
-
* A Component uses
|
|
5
|
-
* to draw graphics on a web page,
|
|
4
|
+
* A Component uses to draw graphics on a web page,
|
|
6
5
|
* it works similarly to the normal HTML5 Canvas element.
|
|
6
|
+
* @fires frame - dispatched when next Frame event occurs when autoloop is set to true
|
|
7
7
|
*/
|
|
8
8
|
export declare class Canvas extends ResponsiveElement {
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Element version number
|
|
11
|
+
* @returns version number
|
|
12
|
+
*/
|
|
13
|
+
static get version(): string;
|
|
14
|
+
/**
|
|
15
|
+
* A `CSSResultGroup` that will be used
|
|
11
16
|
* to style the host, slotted children
|
|
12
17
|
* and the internal template of the element.
|
|
13
18
|
* @return CSS template
|
|
14
19
|
*/
|
|
15
|
-
static get styles():
|
|
20
|
+
static get styles(): CSSResultGroup;
|
|
16
21
|
width: number;
|
|
17
22
|
height: number;
|
|
18
23
|
private frameId;
|
|
@@ -21,6 +26,7 @@ export declare class Canvas extends ResponsiveElement {
|
|
|
21
26
|
/**
|
|
22
27
|
* Starts an automatic animation loop.
|
|
23
28
|
* Enabling the frame event.
|
|
29
|
+
* @default false
|
|
24
30
|
*/
|
|
25
31
|
get autoloop(): boolean;
|
|
26
32
|
set autoloop(val: boolean);
|
|
@@ -90,4 +96,6 @@ declare global {
|
|
|
90
96
|
'ef-canvas': Partial<Canvas> | JSXInterface.HTMLAttributes<Canvas>;
|
|
91
97
|
}
|
|
92
98
|
}
|
|
93
|
-
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export {};
|
package/lib/canvas/index.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
7
|
-
import { ResponsiveElement, html, css, customElement, property } from '@refinitiv-ui/core';
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { ResponsiveElement, html, css } 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 { VERSION } from '../version.js';
|
|
8
6
|
/**
|
|
9
|
-
* A Component uses
|
|
10
|
-
* to draw graphics on a web page,
|
|
7
|
+
* A Component uses to draw graphics on a web page,
|
|
11
8
|
* it works similarly to the normal HTML5 Canvas element.
|
|
9
|
+
* @fires frame - dispatched when next Frame event occurs when autoloop is set to true
|
|
12
10
|
*/
|
|
13
11
|
let Canvas = class Canvas extends ResponsiveElement {
|
|
14
12
|
constructor() {
|
|
@@ -19,7 +17,14 @@ let Canvas = class Canvas extends ResponsiveElement {
|
|
|
19
17
|
this._autoloop = false;
|
|
20
18
|
}
|
|
21
19
|
/**
|
|
22
|
-
*
|
|
20
|
+
* Element version number
|
|
21
|
+
* @returns version number
|
|
22
|
+
*/
|
|
23
|
+
static get version() {
|
|
24
|
+
return VERSION;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* A `CSSResultGroup` that will be used
|
|
23
28
|
* to style the host, slotted children
|
|
24
29
|
* and the internal template of the element.
|
|
25
30
|
* @return CSS template
|
|
@@ -43,6 +48,7 @@ let Canvas = class Canvas extends ResponsiveElement {
|
|
|
43
48
|
/**
|
|
44
49
|
* Starts an automatic animation loop.
|
|
45
50
|
* Enabling the frame event.
|
|
51
|
+
* @default false
|
|
46
52
|
*/
|
|
47
53
|
get autoloop() {
|
|
48
54
|
return this._autoloop;
|
|
@@ -50,7 +56,7 @@ let Canvas = class Canvas extends ResponsiveElement {
|
|
|
50
56
|
set autoloop(val) {
|
|
51
57
|
const oldValue = this._autoloop;
|
|
52
58
|
this._autoloop = val;
|
|
53
|
-
|
|
59
|
+
this.requestUpdate('autoloop', oldValue);
|
|
54
60
|
this.loop();
|
|
55
61
|
}
|
|
56
62
|
/**
|
|
@@ -165,4 +171,3 @@ Canvas = __decorate([
|
|
|
165
171
|
})
|
|
166
172
|
], Canvas);
|
|
167
173
|
export { Canvas };
|
|
168
|
-
//# sourceMappingURL=index.js.map
|