@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
|
@@ -71,9 +71,8 @@ const getLegendFillStyle = (dataset, usePointStyle, solidFill = false) => {
|
|
|
71
71
|
return getLegendColorDontUsePointStyle(dataset, solidFill);
|
|
72
72
|
}
|
|
73
73
|
};
|
|
74
|
-
const
|
|
74
|
+
const legendHelper = {
|
|
75
75
|
getLegendFillStyle,
|
|
76
76
|
getLegendStrokeStyle
|
|
77
77
|
};
|
|
78
|
-
export {
|
|
79
|
-
//# sourceMappingURL=legend.js.map
|
|
78
|
+
export { legendHelper };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare type UnknownObject = {
|
|
2
|
+
[key: string]: unknown;
|
|
3
|
+
};
|
|
4
|
+
declare type MergeObject = UnknownObject | Array<unknown>;
|
|
5
|
+
/**
|
|
6
|
+
* Merge objects recursively
|
|
7
|
+
*
|
|
8
|
+
* @param {MergeObject} object The destination object.
|
|
9
|
+
* @param {MergeObject} sources The source objects.
|
|
10
|
+
* @param {boolean} force Force merge if a key of destination object is already exists and a value is not object
|
|
11
|
+
* @param {MergeObject[]} record The record object which record merged objects recursively
|
|
12
|
+
* @returns voids
|
|
13
|
+
*/
|
|
14
|
+
declare const merge: (object: MergeObject, sources: MergeObject, force?: boolean, record?: Array<unknown>) => void;
|
|
15
|
+
export { merge, MergeObject };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Merge objects recursively
|
|
3
|
+
*
|
|
4
|
+
* @param {MergeObject} object The destination object.
|
|
5
|
+
* @param {MergeObject} sources The source objects.
|
|
6
|
+
* @param {boolean} force Force merge if a key of destination object is already exists and a value is not object
|
|
7
|
+
* @param {MergeObject[]} record The record object which record merged objects recursively
|
|
8
|
+
* @returns voids
|
|
9
|
+
*/
|
|
10
|
+
const merge = (object, sources, force = false, record = []) => {
|
|
11
|
+
let value;
|
|
12
|
+
let isObject;
|
|
13
|
+
Object.keys(sources).forEach((key, i) => {
|
|
14
|
+
// Get value and info from merging object
|
|
15
|
+
value = Array.isArray(sources) ? sources[i] : sources[key];
|
|
16
|
+
isObject = (value && typeof value === 'object' && value.toString() === '[object Object]');
|
|
17
|
+
// Merge if found a new key from source or has a force command
|
|
18
|
+
if (!(key in object) || (force && !isObject)) {
|
|
19
|
+
object[key] = value;
|
|
20
|
+
}
|
|
21
|
+
// Deep merge objects
|
|
22
|
+
if (isObject && !record.includes(value)) {
|
|
23
|
+
record.push(value);
|
|
24
|
+
merge(object[key], value, force, record);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
export { merge };
|
|
@@ -1,25 +1,45 @@
|
|
|
1
1
|
/// <reference types="chart.js" />
|
|
2
|
-
import type { ElementSize } from '@refinitiv-ui/core';
|
|
3
|
-
export interface ResizeEvent extends CustomEvent {
|
|
4
|
-
detail: ElementSize;
|
|
5
|
-
}
|
|
6
|
-
export declare type MergeObject = {
|
|
7
|
-
[key: string]: any;
|
|
8
|
-
};
|
|
9
2
|
export declare type DatasetColors = {
|
|
10
3
|
solid: string | string[];
|
|
11
4
|
opaque: string | string[];
|
|
12
5
|
};
|
|
13
6
|
export declare type ChartDataSetsColor = Chart.ChartColor | Chart.ChartColor[] | Chart.Scriptable<Chart.ChartColor> | undefined;
|
|
14
|
-
export
|
|
15
|
-
|
|
16
|
-
export interface ChartUpdateProps extends Chart.ChartUpdateProps {
|
|
17
|
-
}
|
|
7
|
+
export declare type ChartConfig = Chart.ChartConfiguration;
|
|
8
|
+
export declare type ChartUpdateProps = Chart.ChartUpdateProps;
|
|
18
9
|
export interface MetaData {
|
|
19
10
|
_chart: Chart;
|
|
20
11
|
_datasetIndex: number;
|
|
21
12
|
_index: number;
|
|
22
|
-
|
|
13
|
+
_model: Model;
|
|
14
|
+
_view: Model;
|
|
15
|
+
_xScale: Chart.ChartScales;
|
|
16
|
+
_yScale: Chart.ChartScales;
|
|
17
|
+
hidden?: boolean;
|
|
18
|
+
}
|
|
19
|
+
interface Model {
|
|
20
|
+
backgroundColor: string;
|
|
21
|
+
borderAlign?: Chart.BorderAlignment;
|
|
22
|
+
borderColor: string;
|
|
23
|
+
borderWidth?: number;
|
|
24
|
+
circumference?: number;
|
|
25
|
+
controlPointNextX: number;
|
|
26
|
+
controlPointNextY: number;
|
|
27
|
+
controlPointPreviousX: number;
|
|
28
|
+
controlPointPreviousY: number;
|
|
29
|
+
endAngle?: number;
|
|
30
|
+
hitRadius: number;
|
|
31
|
+
innerRadius?: number;
|
|
32
|
+
outerRadius?: number;
|
|
33
|
+
pointStyle: string;
|
|
34
|
+
radius: string;
|
|
35
|
+
skip?: boolean;
|
|
36
|
+
startAngle?: number;
|
|
37
|
+
steppedLine?: undefined;
|
|
38
|
+
tension: number;
|
|
39
|
+
x: number;
|
|
40
|
+
y: number;
|
|
41
|
+
base: number;
|
|
42
|
+
head: number;
|
|
23
43
|
}
|
|
24
44
|
export interface ChartHelpers {
|
|
25
45
|
draw(): void;
|
|
@@ -32,10 +52,18 @@ export interface ChartJS extends Chart {
|
|
|
32
52
|
defaultColor: string;
|
|
33
53
|
defaultLineHeight: number;
|
|
34
54
|
};
|
|
55
|
+
scale: {
|
|
56
|
+
gridLines: {
|
|
57
|
+
color: string;
|
|
58
|
+
zeroLineColor: string;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
35
61
|
[key: string]: any;
|
|
36
62
|
};
|
|
37
63
|
helpers: {
|
|
64
|
+
getHoverColor(value: string): string;
|
|
38
65
|
[key: string]: any;
|
|
39
66
|
};
|
|
40
67
|
isDatasetVisible(isDatasetVisible: number): boolean;
|
|
41
68
|
}
|
|
69
|
+
export {};
|
package/lib/chart/index.d.ts
CHANGED
|
@@ -1,16 +1,26 @@
|
|
|
1
1
|
import { JSXInterface } from '../jsx';
|
|
2
2
|
/// <reference types="chart.js" />
|
|
3
|
-
import { BasicElement, PropertyValues, TemplateResult,
|
|
3
|
+
import { BasicElement, PropertyValues, TemplateResult, CSSResultGroup } from '@refinitiv-ui/core';
|
|
4
4
|
import 'chart.js/dist/Chart.bundle.min.js';
|
|
5
|
-
import {
|
|
6
|
-
import '../header';
|
|
7
|
-
import '../
|
|
8
|
-
import
|
|
9
|
-
|
|
5
|
+
import type { ChartJS, ChartConfig, ChartUpdateProps, DatasetColors } from './helpers/types';
|
|
6
|
+
import type { Header } from '../header';
|
|
7
|
+
import '../header/index.js';
|
|
8
|
+
import '../layout/index.js';
|
|
9
|
+
declare global {
|
|
10
|
+
interface Window {
|
|
11
|
+
Chart: ChartJS;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export type { ChartConfig, ChartUpdateProps };
|
|
10
15
|
/**
|
|
11
|
-
* Charting component that use
|
|
16
|
+
* Charting component that use ChartJS library
|
|
12
17
|
*/
|
|
13
18
|
export declare class Chart extends BasicElement {
|
|
19
|
+
/**
|
|
20
|
+
* Element version number
|
|
21
|
+
* @returns version number
|
|
22
|
+
*/
|
|
23
|
+
static get version(): string;
|
|
14
24
|
/**
|
|
15
25
|
* Chart.js object
|
|
16
26
|
*/
|
|
@@ -31,21 +41,21 @@ export declare class Chart extends BasicElement {
|
|
|
31
41
|
protected titleElement: Header;
|
|
32
42
|
/**
|
|
33
43
|
* Required properties, needed for chart to work correctly.
|
|
34
|
-
* @returns
|
|
44
|
+
* @returns config
|
|
35
45
|
*/
|
|
36
46
|
protected get requiredConfig(): ChartConfig;
|
|
37
47
|
/**
|
|
38
48
|
* Safely returns the chart title
|
|
39
|
-
* @returns
|
|
49
|
+
* @returns chart title
|
|
40
50
|
*/
|
|
41
51
|
protected get chartTitle(): string;
|
|
42
52
|
/**
|
|
43
53
|
* Safely returns a dataset array
|
|
44
|
-
* @returns
|
|
54
|
+
* @returns dataset array
|
|
45
55
|
*/
|
|
46
56
|
protected get datasets(): Chart.ChartDataSets[];
|
|
47
57
|
/**
|
|
48
|
-
* List of
|
|
58
|
+
* List of available chart colors
|
|
49
59
|
* @type {string[]}
|
|
50
60
|
* @returns {string[]} List of available chart colors
|
|
51
61
|
*/
|
|
@@ -83,7 +93,7 @@ export declare class Chart extends BasicElement {
|
|
|
83
93
|
* Get as CSS variable and tries to convert it into a usable number
|
|
84
94
|
* @returns {(number|undefined)} The value as a number, or, undefined if NaN.
|
|
85
95
|
*/
|
|
86
|
-
protected cssVarAsNumber(...args: string[]
|
|
96
|
+
protected cssVarAsNumber(...args: string[]): number | undefined;
|
|
87
97
|
/**
|
|
88
98
|
* Generates the legend labels on a given chart
|
|
89
99
|
* @param {ChartJS} chart Chart.js instance
|
|
@@ -95,15 +105,6 @@ export declare class Chart extends BasicElement {
|
|
|
95
105
|
* @returns {void}
|
|
96
106
|
*/
|
|
97
107
|
protected mergeConfigs(): void;
|
|
98
|
-
/**
|
|
99
|
-
* Merges properties of one object into another.
|
|
100
|
-
* @param {MergeObject} a Object to merge into
|
|
101
|
-
* @param {MergeObject} b Object to merge from
|
|
102
|
-
* @param {boolean} force Force apply the change
|
|
103
|
-
* @param {object[]} record Record of objects, to check for circular references
|
|
104
|
-
* @returns {void}
|
|
105
|
-
*/
|
|
106
|
-
protected mergeObjects(a: MergeObject, b: MergeObject, force?: boolean, record?: object[]): void;
|
|
107
108
|
/**
|
|
108
109
|
* Themes the passed-in configuration object
|
|
109
110
|
* @returns {void}
|
|
@@ -136,9 +137,9 @@ export declare class Chart extends BasicElement {
|
|
|
136
137
|
protected createChart(): void;
|
|
137
138
|
/**
|
|
138
139
|
* Destroys the chart.js object
|
|
139
|
-
* @returns
|
|
140
|
+
* @returns True if a chart object has been destroyed
|
|
140
141
|
*/
|
|
141
|
-
protected destroyChart():
|
|
142
|
+
protected destroyChart(): boolean;
|
|
142
143
|
/**
|
|
143
144
|
* Re-renders the chart based on its config
|
|
144
145
|
* @param {ChartUpdateProps} config Additional configuration object for the update process.
|
|
@@ -152,12 +153,17 @@ export declare class Chart extends BasicElement {
|
|
|
152
153
|
*/
|
|
153
154
|
updateChart(config?: ChartUpdateProps): void;
|
|
154
155
|
/**
|
|
155
|
-
* A `
|
|
156
|
+
* A `CSSResultGroup` that will be used
|
|
156
157
|
* to style the host, slotted children
|
|
157
158
|
* and the internal template of the element.
|
|
158
159
|
* @return CSS template
|
|
159
160
|
*/
|
|
160
|
-
static get styles():
|
|
161
|
+
static get styles(): CSSResultGroup;
|
|
162
|
+
/**
|
|
163
|
+
* Handles resize event of the chart region
|
|
164
|
+
* @returns {void}
|
|
165
|
+
*/
|
|
166
|
+
protected onResize(): void;
|
|
161
167
|
/**
|
|
162
168
|
* A `TemplateResult` that will be used
|
|
163
169
|
* to render the updated internal template.
|
|
@@ -176,4 +182,6 @@ declare global {
|
|
|
176
182
|
'ef-chart': Partial<Chart> | JSXInterface.HTMLAttributes<Chart>;
|
|
177
183
|
}
|
|
178
184
|
}
|
|
179
|
-
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export {};
|
package/lib/chart/index.js
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
7
|
-
import {
|
|
8
|
-
import { color as parseColor } from '@refinitiv-ui/utils';
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { BasicElement, 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 { query } from '@refinitiv-ui/core/lib/decorators/query.js';
|
|
6
|
+
import { VERSION } from '../version.js';
|
|
7
|
+
import { color as parseColor } from '@refinitiv-ui/utils/lib/color.js';
|
|
9
8
|
import 'chart.js/dist/Chart.bundle.min.js';
|
|
10
|
-
import '
|
|
11
|
-
import '../
|
|
12
|
-
import
|
|
9
|
+
import { legendHelper, merge } from './helpers/index.js';
|
|
10
|
+
import '../header/index.js';
|
|
11
|
+
import '../layout/index.js';
|
|
13
12
|
// Register plugins
|
|
14
|
-
import doughnutCenterPlugin from './plugins/doughnut-center-label';
|
|
13
|
+
import doughnutCenterPlugin from './plugins/doughnut-center-label.js';
|
|
15
14
|
window.Chart.pluginService.register(doughnutCenterPlugin);
|
|
16
15
|
const CSS_COLOR_PREFIX = '--chart-color-';
|
|
17
16
|
const CHART_TYPE_OPAQUE = ['line', 'bubble', 'radar', 'polarArea'];
|
|
@@ -32,9 +31,10 @@ const ELF_CHART_CONFIG = {
|
|
|
32
31
|
}
|
|
33
32
|
}
|
|
34
33
|
};
|
|
34
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
35
35
|
window.Chart.helpers.merge(DEFAULT_CHART_CONFIG, ELF_CHART_CONFIG);
|
|
36
36
|
/**
|
|
37
|
-
* Charting component that use
|
|
37
|
+
* Charting component that use ChartJS library
|
|
38
38
|
*/
|
|
39
39
|
let Chart = class Chart extends BasicElement {
|
|
40
40
|
constructor() {
|
|
@@ -54,16 +54,20 @@ let Chart = class Chart extends BasicElement {
|
|
|
54
54
|
* @returns {Chart.ChartLegendLabelItem[]} Array of label configurations
|
|
55
55
|
*/
|
|
56
56
|
this.generateLegendLabels = (chart) => {
|
|
57
|
-
var _a, _b;
|
|
57
|
+
var _a, _b, _c, _d;
|
|
58
58
|
if (!((_a = this.config) === null || _a === void 0 ? void 0 : _a.type)) {
|
|
59
59
|
return [];
|
|
60
60
|
}
|
|
61
|
+
const chartOption = DEFAULT_CHART_CONFIG[this.config.type];
|
|
61
62
|
if (this.datasets.length
|
|
62
|
-
&&
|
|
63
|
+
&& chartOption.legend
|
|
63
64
|
&& Array.isArray(this.datasets[0].backgroundColor)) {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
let legends = [];
|
|
66
|
+
if ((_b = chartOption.legend.labels) === null || _b === void 0 ? void 0 : _b.generateLabels) {
|
|
67
|
+
legends = (_c = chartOption.legend.labels) === null || _c === void 0 ? void 0 : _c.generateLabels(chart);
|
|
68
|
+
}
|
|
69
|
+
// Customize for doughnut chart change border color to background color
|
|
70
|
+
if (['pie', 'doughnut'].includes((_d = this.config) === null || _d === void 0 ? void 0 : _d.type) && this.datasets.length > 1) {
|
|
67
71
|
legends.forEach((label) => {
|
|
68
72
|
label.strokeStyle = label.fillStyle;
|
|
69
73
|
});
|
|
@@ -91,14 +95,21 @@ let Chart = class Chart extends BasicElement {
|
|
|
91
95
|
});
|
|
92
96
|
};
|
|
93
97
|
}
|
|
98
|
+
/**
|
|
99
|
+
* Element version number
|
|
100
|
+
* @returns version number
|
|
101
|
+
*/
|
|
102
|
+
static get version() {
|
|
103
|
+
return VERSION;
|
|
104
|
+
}
|
|
94
105
|
/**
|
|
95
106
|
* Required properties, needed for chart to work correctly.
|
|
96
|
-
* @returns
|
|
107
|
+
* @returns config
|
|
97
108
|
*/
|
|
98
109
|
get requiredConfig() {
|
|
99
110
|
return {
|
|
100
111
|
options: {
|
|
101
|
-
responsive:
|
|
112
|
+
responsive: false,
|
|
102
113
|
maintainAspectRatio: false,
|
|
103
114
|
title: {
|
|
104
115
|
display: false
|
|
@@ -108,7 +119,7 @@ let Chart = class Chart extends BasicElement {
|
|
|
108
119
|
}
|
|
109
120
|
/**
|
|
110
121
|
* Safely returns the chart title
|
|
111
|
-
* @returns
|
|
122
|
+
* @returns chart title
|
|
112
123
|
*/
|
|
113
124
|
get chartTitle() {
|
|
114
125
|
var _a, _b, _c;
|
|
@@ -120,14 +131,14 @@ let Chart = class Chart extends BasicElement {
|
|
|
120
131
|
}
|
|
121
132
|
/**
|
|
122
133
|
* Safely returns a dataset array
|
|
123
|
-
* @returns
|
|
134
|
+
* @returns dataset array
|
|
124
135
|
*/
|
|
125
136
|
get datasets() {
|
|
126
137
|
var _a, _b;
|
|
127
138
|
return ((_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.datasets) || [];
|
|
128
139
|
}
|
|
129
140
|
/**
|
|
130
|
-
* List of
|
|
141
|
+
* List of available chart colors
|
|
131
142
|
* @type {string[]}
|
|
132
143
|
* @returns {string[]} List of available chart colors
|
|
133
144
|
*/
|
|
@@ -135,7 +146,7 @@ let Chart = class Chart extends BasicElement {
|
|
|
135
146
|
let color;
|
|
136
147
|
let index = 0;
|
|
137
148
|
const colors = [];
|
|
138
|
-
while ((color = this.getComputedVariable(CSS_COLOR_PREFIX
|
|
149
|
+
while ((color = this.getComputedVariable(`${CSS_COLOR_PREFIX}${++index}`))) {
|
|
139
150
|
colors.push(color);
|
|
140
151
|
}
|
|
141
152
|
return colors;
|
|
@@ -247,31 +258,8 @@ let Chart = class Chart extends BasicElement {
|
|
|
247
258
|
if (!this.config) {
|
|
248
259
|
return;
|
|
249
260
|
}
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
}
|
|
253
|
-
/**
|
|
254
|
-
* Merges properties of one object into another.
|
|
255
|
-
* @param {MergeObject} a Object to merge into
|
|
256
|
-
* @param {MergeObject} b Object to merge from
|
|
257
|
-
* @param {boolean} force Force apply the change
|
|
258
|
-
* @param {object[]} record Record of objects, to check for circular references
|
|
259
|
-
* @returns {void}
|
|
260
|
-
*/
|
|
261
|
-
mergeObjects(a, b, force = false, record = []) {
|
|
262
|
-
let value;
|
|
263
|
-
let isObject;
|
|
264
|
-
Object.keys(b).forEach(key => {
|
|
265
|
-
value = b[key];
|
|
266
|
-
isObject = value && value.toString() === '[object Object]';
|
|
267
|
-
if (!(key in a) || (force && !isObject)) {
|
|
268
|
-
a[key] = b[key];
|
|
269
|
-
}
|
|
270
|
-
if (isObject && !record.includes(value)) {
|
|
271
|
-
record.push(b[key]);
|
|
272
|
-
this.mergeObjects(a[key], b[key], force, record);
|
|
273
|
-
}
|
|
274
|
-
});
|
|
261
|
+
merge(this.config, this.themableConfig);
|
|
262
|
+
merge(this.config, this.requiredConfig, true);
|
|
275
263
|
}
|
|
276
264
|
/**
|
|
277
265
|
* Themes the passed-in configuration object
|
|
@@ -281,7 +269,7 @@ let Chart = class Chart extends BasicElement {
|
|
|
281
269
|
this.mergeConfigs();
|
|
282
270
|
const extendColorsIfRequired = (currentColors, infoColors) => {
|
|
283
271
|
if (Array.isArray(currentColors) && Array.isArray(infoColors) && currentColors.length < infoColors.length) {
|
|
284
|
-
|
|
272
|
+
merge(currentColors, infoColors);
|
|
285
273
|
}
|
|
286
274
|
};
|
|
287
275
|
this.datasets.forEach((dataset) => {
|
|
@@ -371,24 +359,32 @@ let Chart = class Chart extends BasicElement {
|
|
|
371
359
|
createChart() {
|
|
372
360
|
const ctx = this.canvas.getContext('2d');
|
|
373
361
|
if (ctx && this.config) {
|
|
362
|
+
// Are we reusing an old chart canvas?
|
|
363
|
+
const isReusingCanvas = this.destroyChart();
|
|
374
364
|
// Preparing the resources before create chart
|
|
375
|
-
this.destroyChart();
|
|
376
365
|
this.decorateConfig();
|
|
377
366
|
this.manageTitle();
|
|
378
367
|
// Create chart
|
|
379
368
|
this.chart = new window.Chart(ctx, this.config);
|
|
369
|
+
if (isReusingCanvas) {
|
|
370
|
+
// If we're reusing an old chart canvas, we need to resize it.
|
|
371
|
+
// Destroying a chart has some strange side-effects on the canvas.
|
|
372
|
+
this.chart.resize();
|
|
373
|
+
}
|
|
380
374
|
}
|
|
381
375
|
}
|
|
382
376
|
/**
|
|
383
377
|
* Destroys the chart.js object
|
|
384
|
-
* @returns
|
|
378
|
+
* @returns True if a chart object has been destroyed
|
|
385
379
|
*/
|
|
386
380
|
destroyChart() {
|
|
387
381
|
if (this.chart) {
|
|
388
382
|
// Destroy the chart
|
|
389
383
|
this.chart.destroy();
|
|
390
384
|
this.chart = null;
|
|
385
|
+
return true;
|
|
391
386
|
}
|
|
387
|
+
return false;
|
|
392
388
|
}
|
|
393
389
|
/**
|
|
394
390
|
* Re-renders the chart based on its config
|
|
@@ -417,7 +413,7 @@ let Chart = class Chart extends BasicElement {
|
|
|
417
413
|
this.renderChart(config);
|
|
418
414
|
}
|
|
419
415
|
/**
|
|
420
|
-
* A `
|
|
416
|
+
* A `CSSResultGroup` that will be used
|
|
421
417
|
* to style the host, slotted children
|
|
422
418
|
* and the internal template of the element.
|
|
423
419
|
* @return CSS template
|
|
@@ -455,6 +451,14 @@ let Chart = class Chart extends BasicElement {
|
|
|
455
451
|
}
|
|
456
452
|
`;
|
|
457
453
|
}
|
|
454
|
+
/**
|
|
455
|
+
* Handles resize event of the chart region
|
|
456
|
+
* @returns {void}
|
|
457
|
+
*/
|
|
458
|
+
onResize() {
|
|
459
|
+
var _a;
|
|
460
|
+
(_a = this.chart) === null || _a === void 0 ? void 0 : _a.resize();
|
|
461
|
+
}
|
|
458
462
|
/**
|
|
459
463
|
* A `TemplateResult` that will be used
|
|
460
464
|
* to render the updated internal template.
|
|
@@ -464,7 +468,7 @@ let Chart = class Chart extends BasicElement {
|
|
|
464
468
|
return html `
|
|
465
469
|
<ef-layout flex container>
|
|
466
470
|
<ef-header></ef-header>
|
|
467
|
-
<ef-layout part="chart">
|
|
471
|
+
<ef-layout part="chart" @resize="${this.onResize}">
|
|
468
472
|
<canvas id="canvas"></canvas>
|
|
469
473
|
</ef-layout>
|
|
470
474
|
</ef-layout>`;
|
|
@@ -485,4 +489,3 @@ Chart = __decorate([
|
|
|
485
489
|
})
|
|
486
490
|
], Chart);
|
|
487
491
|
export { Chart };
|
|
488
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -21,8 +21,8 @@ const drawItemBorder = function (chart, active) {
|
|
|
21
21
|
const datasets = chart.data.datasets[chartItem._datasetIndex];
|
|
22
22
|
vm.backgroundColor = datasets.backgroundColor[chartItem._index];
|
|
23
23
|
vm.backgroundColor = CHART.helpers.getHoverColor(vm.backgroundColor); // we need to make color bolder
|
|
24
|
-
vm.borderWidth = datasets.borderWidth || ((_c = (_b = (_a = chart.config.options) === null || _a === void 0 ? void 0 : _a.elements) === null || _b === void 0 ? void 0 : _b.arc) === null || _c === void 0 ? void 0 : _c.borderWidth);
|
|
25
|
-
vm.borderColor = getComputedStyle(chart.canvas).getPropertyValue('--doughnut-border-color') || CHART.defaults.global.defaultFontColor;
|
|
24
|
+
vm.borderWidth = (datasets.borderWidth || ((_c = (_b = (_a = chart.config.options) === null || _a === void 0 ? void 0 : _a.elements) === null || _b === void 0 ? void 0 : _b.arc) === null || _c === void 0 ? void 0 : _c.borderWidth));
|
|
25
|
+
vm.borderColor = (getComputedStyle(chart.canvas).getPropertyValue('--doughnut-border-color') || CHART.defaults.global.defaultFontColor);
|
|
26
26
|
const sA = vm.startAngle;
|
|
27
27
|
const eA = vm.endAngle;
|
|
28
28
|
if (ctx) {
|
|
@@ -133,10 +133,10 @@ const plugins = {
|
|
|
133
133
|
for (let i = 0; i < texts.length; i++) {
|
|
134
134
|
let targetFont;
|
|
135
135
|
if (texts[i].bold) {
|
|
136
|
-
targetFont =
|
|
136
|
+
targetFont = `bold ${fontSizeToUse * fontSizeHeaderRatio}px ${defaultFontStyle || ''}`;
|
|
137
137
|
}
|
|
138
138
|
else {
|
|
139
|
-
targetFont = fontSizeToUse
|
|
139
|
+
targetFont = `${fontSizeToUse}px ${defaultFontStyle || ''}`;
|
|
140
140
|
}
|
|
141
141
|
ctx.font = targetFont;
|
|
142
142
|
let targetText = texts[i].label;
|
|
@@ -194,4 +194,3 @@ const plugins = {
|
|
|
194
194
|
}
|
|
195
195
|
};
|
|
196
196
|
export default plugins;
|
|
197
|
-
//# sourceMappingURL=doughnut-center-label.js.map
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
"name": "readonly",
|
|
22
22
|
"description": "Set readonly state",
|
|
23
23
|
"type": "boolean",
|
|
24
|
-
"default": "
|
|
24
|
+
"default": "false"
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
27
|
"name": "disabled",
|
|
28
28
|
"description": "Set disabled state",
|
|
29
29
|
"type": "boolean",
|
|
30
|
-
"default": "
|
|
30
|
+
"default": "false"
|
|
31
31
|
}
|
|
32
32
|
],
|
|
33
33
|
"properties": [
|
|
@@ -50,14 +50,14 @@
|
|
|
50
50
|
"attribute": "readonly",
|
|
51
51
|
"description": "Set readonly state",
|
|
52
52
|
"type": "boolean",
|
|
53
|
-
"default": "
|
|
53
|
+
"default": "false"
|
|
54
54
|
},
|
|
55
55
|
{
|
|
56
56
|
"name": "disabled",
|
|
57
57
|
"attribute": "disabled",
|
|
58
58
|
"description": "Set disabled state",
|
|
59
59
|
"type": "boolean",
|
|
60
|
-
"default": "
|
|
60
|
+
"default": "false"
|
|
61
61
|
}
|
|
62
62
|
],
|
|
63
63
|
"events": [
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# ef-checkbox
|
|
2
|
+
|
|
3
|
+
Form control for selecting one or several options
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
| Property | Attribute | Type | Default | Description |
|
|
8
|
+
|-----------------|-----------------|-----------|---------|----------------------------|
|
|
9
|
+
| `checked` | `checked` | `boolean` | false | Value of checkbox |
|
|
10
|
+
| `disabled` | `disabled` | `boolean` | false | Set disabled state |
|
|
11
|
+
| `indeterminate` | `indeterminate` | `boolean` | false | Set state to indeterminate |
|
|
12
|
+
| `readonly` | `readonly` | `boolean` | false | Set readonly state |
|
|
13
|
+
|
|
14
|
+
## Events
|
|
15
|
+
|
|
16
|
+
| Event | Description |
|
|
17
|
+
|-------------------|--------------------------------------------|
|
|
18
|
+
| `checked-changed` | Fired when the `checked` property changes. |
|
package/lib/checkbox/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { JSXInterface } from '../jsx';
|
|
2
|
-
import { ControlElement, TemplateResult,
|
|
3
|
-
import '../icon';
|
|
2
|
+
import { ControlElement, TemplateResult, CSSResultGroup, PropertyValues } from '@refinitiv-ui/core';
|
|
3
|
+
import '../icon/index.js';
|
|
4
4
|
/**
|
|
5
5
|
* Form control for selecting one or several options
|
|
6
6
|
* @fires checked-changed - Fired when the `checked` property changes.
|
|
@@ -13,30 +13,43 @@ import '../icon';
|
|
|
13
13
|
*/
|
|
14
14
|
export declare class Checkbox extends ControlElement {
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* Element version number
|
|
17
|
+
* @returns version number
|
|
18
|
+
*/
|
|
19
|
+
static get version(): string;
|
|
20
|
+
protected readonly defaultRole: string | null;
|
|
21
|
+
/**
|
|
22
|
+
* A `CSSResultGroup` that will be used
|
|
17
23
|
* to style the host, slotted children
|
|
18
24
|
* and the internal template of the element.
|
|
19
|
-
* @return
|
|
25
|
+
* @return CSS template
|
|
20
26
|
*/
|
|
21
|
-
static get styles():
|
|
27
|
+
static get styles(): CSSResultGroup;
|
|
28
|
+
private _checked;
|
|
22
29
|
/**
|
|
23
30
|
* Value of checkbox
|
|
31
|
+
* @param value new checked value
|
|
32
|
+
* @default false
|
|
24
33
|
*/
|
|
25
|
-
checked: boolean;
|
|
34
|
+
set checked(value: boolean);
|
|
35
|
+
get checked(): boolean;
|
|
36
|
+
private _indeterminate;
|
|
26
37
|
/**
|
|
27
38
|
* Set state to indeterminate
|
|
39
|
+
* @param value new indeterminate value
|
|
40
|
+
* @default false
|
|
28
41
|
*/
|
|
29
|
-
indeterminate: boolean;
|
|
42
|
+
set indeterminate(value: boolean);
|
|
43
|
+
get indeterminate(): boolean;
|
|
30
44
|
/**
|
|
31
|
-
*
|
|
45
|
+
* Indicates current state of checkbox
|
|
46
|
+
* @ignore
|
|
32
47
|
*/
|
|
33
|
-
|
|
48
|
+
ariaChecked: string;
|
|
34
49
|
/**
|
|
35
|
-
*
|
|
36
|
-
* @param changedProperties Properties that has changed
|
|
37
|
-
* @returns {void}
|
|
50
|
+
* Getter for label
|
|
38
51
|
*/
|
|
39
|
-
|
|
52
|
+
private labelEl;
|
|
40
53
|
/**
|
|
41
54
|
* Called once after the component is first rendered
|
|
42
55
|
* @param changedProperties map of changed properties with old values
|
|
@@ -79,4 +92,6 @@ declare global {
|
|
|
79
92
|
'ef-checkbox': Partial<Checkbox> | JSXInterface.ControlHTMLAttributes<Checkbox>;
|
|
80
93
|
}
|
|
81
94
|
}
|
|
82
|
-
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export {};
|