@refinitiv-ui/elements 7.0.0-next.0 → 7.0.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +115 -0
- package/cli.mjs +21 -0
- package/lib/accordion/index.js +1 -10
- package/lib/appstate-bar/custom-elements.json +2 -2
- package/lib/appstate-bar/custom-elements.md +4 -4
- package/lib/appstate-bar/index.d.ts +2 -2
- package/lib/appstate-bar/index.js +2 -8
- package/lib/appstate-bar/themes/halo/dark/index.js +1 -1
- package/lib/appstate-bar/themes/halo/light/index.js +1 -1
- package/lib/appstate-bar/themes/solar/charcoal/index.js +1 -1
- package/lib/appstate-bar/themes/solar/pearl/index.js +1 -1
- package/lib/autosuggest/custom-elements.json +8 -8
- package/lib/autosuggest/custom-elements.md +8 -8
- package/lib/autosuggest/helpers/types.d.ts +18 -18
- package/lib/autosuggest/index.d.ts +9 -32
- package/lib/autosuggest/index.js +112 -187
- package/lib/autosuggest/themes/halo/dark/index.js +1 -1
- package/lib/autosuggest/themes/halo/light/index.js +1 -1
- package/lib/autosuggest/themes/solar/charcoal/index.js +1 -1
- package/lib/autosuggest/themes/solar/pearl/index.js +1 -1
- package/lib/button/custom-elements.json +1 -1
- package/lib/button/custom-elements.md +1 -1
- package/lib/button/index.d.ts +1 -1
- package/lib/button/index.js +1 -1
- package/lib/button/themes/halo/dark/index.js +2 -1
- package/lib/button/themes/halo/light/index.js +2 -1
- package/lib/button/themes/solar/charcoal/index.js +2 -1
- package/lib/button/themes/solar/pearl/index.js +2 -1
- package/lib/button-bar/index.js +0 -5
- package/lib/calendar/custom-elements.json +2 -2
- package/lib/calendar/custom-elements.md +4 -4
- package/lib/calendar/index.d.ts +9 -2
- package/lib/calendar/index.js +27 -29
- 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 +5 -5
- package/lib/calendar/utils.d.ts +2 -13
- package/lib/calendar/utils.js +2 -20
- package/lib/canvas/custom-elements.json +1 -1
- package/lib/canvas/custom-elements.md +1 -1
- package/lib/canvas/index.d.ts +1 -1
- package/lib/canvas/index.js +10 -9
- package/lib/card/custom-elements.json +1 -1
- package/lib/card/custom-elements.md +3 -3
- package/lib/card/helpers/types.d.ts +1 -1
- package/lib/card/index.d.ts +2 -1
- package/lib/card/index.js +5 -4
- 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/bare.d.ts +1 -0
- package/lib/chart/bare.js +1 -0
- package/lib/chart/custom-elements.json +10 -5
- package/lib/chart/custom-elements.md +9 -8
- package/lib/chart/elements/chart.d.ts +182 -0
- package/lib/chart/elements/chart.js +509 -0
- package/lib/chart/helpers/index.d.ts +1 -1
- package/lib/chart/helpers/index.js +1 -1
- package/lib/chart/helpers/merge.d.ts +3 -3
- package/lib/chart/helpers/merge.js +1 -1
- package/lib/chart/helpers/types.d.ts +1 -66
- package/lib/chart/index.d.ts +1 -192
- package/lib/chart/index.js +5 -485
- package/lib/chart/plugins/doughnut-center-label.d.ts +22 -3
- package/lib/chart/plugins/doughnut-center-label.js +62 -51
- package/lib/chart/plugins/index.d.ts +1 -0
- package/lib/chart/plugins/index.js +1 -0
- package/lib/chart/themes/halo/dark/index.js +1 -1
- package/lib/chart/themes/halo/light/index.js +1 -1
- package/lib/chart/themes/solar/charcoal/index.js +1 -1
- package/lib/chart/themes/solar/pearl/index.js +1 -1
- package/lib/checkbox/custom-elements.json +1 -1
- package/lib/checkbox/custom-elements.md +3 -3
- package/lib/checkbox/index.d.ts +1 -1
- package/lib/checkbox/index.js +1 -2
- package/lib/checkbox/themes/halo/dark/index.js +1 -1
- package/lib/checkbox/themes/halo/light/index.js +1 -1
- package/lib/checkbox/themes/solar/charcoal/index.js +1 -1
- package/lib/checkbox/themes/solar/pearl/index.js +1 -1
- package/lib/clock/custom-elements.json +2 -2
- package/lib/clock/custom-elements.md +2 -2
- package/lib/clock/index.d.ts +2 -2
- package/lib/clock/index.js +2 -6
- package/lib/clock/utils/TickManager.d.ts +1 -1
- package/lib/collapse/custom-elements.json +1 -1
- package/lib/collapse/custom-elements.md +3 -3
- package/lib/collapse/index.d.ts +7 -1
- package/lib/collapse/index.js +27 -30
- package/lib/collapse/themes/halo/dark/index.js +1 -1
- package/lib/collapse/themes/halo/light/index.js +1 -1
- package/lib/collapse/themes/solar/charcoal/index.js +1 -1
- package/lib/collapse/themes/solar/pearl/index.js +1 -1
- package/lib/color-dialog/custom-elements.json +2 -2
- package/lib/color-dialog/custom-elements.md +4 -4
- package/lib/color-dialog/helpers/value-model.js +4 -5
- package/lib/color-dialog/index.d.ts +4 -4
- package/lib/color-dialog/index.js +4 -4
- package/lib/color-picker/custom-elements.json +1 -1
- package/lib/color-picker/custom-elements.md +3 -3
- package/lib/color-picker/index.d.ts +1 -1
- package/lib/color-picker/index.js +3 -5
- package/lib/combo-box/custom-elements.json +3 -6
- package/lib/combo-box/custom-elements.md +5 -6
- package/lib/combo-box/helpers/types.d.ts +2 -2
- package/lib/combo-box/index.d.ts +3 -12
- package/lib/combo-box/index.js +15 -30
- package/lib/combo-box/themes/halo/dark/index.js +2 -1
- package/lib/combo-box/themes/halo/light/index.js +2 -1
- package/lib/combo-box/themes/solar/charcoal/index.js +2 -1
- package/lib/combo-box/themes/solar/pearl/index.js +2 -1
- package/lib/counter/themes/halo/dark/index.js +2 -1
- package/lib/counter/themes/halo/light/index.js +2 -1
- package/lib/counter/themes/solar/charcoal/index.js +2 -1
- package/lib/counter/themes/solar/pearl/index.js +2 -1
- package/lib/datetime-field/index.d.ts +2 -2
- package/lib/datetime-field/index.js +7 -12
- package/lib/datetime-field/types.d.ts +3 -3
- package/lib/datetime-field/utils.d.ts +2 -2
- package/lib/datetime-field/utils.js +2 -2
- package/lib/datetime-picker/custom-elements.json +4 -4
- package/lib/datetime-picker/custom-elements.md +4 -4
- package/lib/datetime-picker/index.d.ts +4 -4
- package/lib/datetime-picker/index.js +9 -13
- package/lib/datetime-picker/themes/halo/dark/index.js +2 -1
- package/lib/datetime-picker/themes/halo/light/index.js +2 -1
- package/lib/datetime-picker/themes/solar/charcoal/index.js +2 -1
- package/lib/datetime-picker/themes/solar/pearl/index.js +2 -1
- package/lib/datetime-picker/types.d.ts +1 -1
- package/lib/dialog/custom-elements.json +2 -13
- package/lib/dialog/custom-elements.md +4 -5
- package/lib/dialog/index.d.ts +11 -43
- package/lib/dialog/index.js +21 -80
- package/lib/dialog/themes/halo/dark/index.js +1 -1
- package/lib/dialog/themes/halo/light/index.js +1 -1
- package/lib/dialog/themes/solar/charcoal/index.js +1 -1
- package/lib/dialog/themes/solar/pearl/index.js +1 -1
- package/lib/email-field/custom-elements.json +3 -3
- package/lib/email-field/custom-elements.md +5 -5
- package/lib/email-field/index.d.ts +3 -3
- package/lib/email-field/index.js +5 -4
- package/lib/email-field/themes/halo/dark/index.js +2 -1
- package/lib/email-field/themes/halo/light/index.js +2 -1
- package/lib/email-field/themes/solar/charcoal/index.js +2 -1
- package/lib/email-field/themes/solar/pearl/index.js +2 -1
- package/lib/events.d.ts +13 -13
- package/lib/flag/custom-elements.json +2 -14
- package/lib/flag/custom-elements.md +3 -6
- package/lib/flag/index.d.ts +21 -9
- package/lib/flag/index.js +43 -24
- package/lib/header/themes/halo/dark/index.js +1 -1
- package/lib/header/themes/halo/light/index.js +1 -1
- package/lib/header/themes/solar/charcoal/index.js +1 -1
- package/lib/header/themes/solar/pearl/index.js +1 -1
- package/lib/heatmap/helpers/color.js +2 -1
- package/lib/heatmap/helpers/text.d.ts +1 -1
- package/lib/heatmap/helpers/text.js +1 -1
- package/lib/heatmap/helpers/types.d.ts +7 -7
- package/lib/heatmap/index.js +156 -140
- package/lib/icon/custom-elements.json +0 -13
- package/lib/icon/custom-elements.md +0 -1
- package/lib/icon/index.d.ts +20 -2
- package/lib/icon/index.js +41 -14
- package/lib/icon/themes/halo/dark/index.js +1 -1
- package/lib/icon/themes/halo/light/index.js +1 -1
- package/lib/icon/themes/solar/charcoal/index.js +1 -1
- package/lib/icon/themes/solar/pearl/index.js +1 -1
- package/lib/interactive-chart/custom-elements.json +1 -1
- package/lib/interactive-chart/custom-elements.md +3 -3
- package/lib/interactive-chart/helpers/merge.d.ts +2 -2
- package/lib/interactive-chart/helpers/types.d.ts +7 -7
- package/lib/interactive-chart/index.d.ts +1 -1
- package/lib/interactive-chart/index.js +5 -3
- package/lib/item/custom-elements.json +4 -4
- package/lib/item/custom-elements.md +2 -2
- package/lib/item/helpers/types.d.ts +2 -2
- package/lib/item/index.d.ts +2 -1
- package/lib/item/index.js +2 -1
- package/lib/item/themes/halo/dark/index.js +1 -1
- package/lib/item/themes/halo/light/index.js +1 -1
- package/lib/item/themes/solar/charcoal/index.js +1 -1
- package/lib/item/themes/solar/pearl/index.js +1 -1
- package/lib/label/index.js +9 -34
- package/lib/layout/index.js +0 -13
- package/lib/led-gauge/index.js +7 -7
- package/lib/list/custom-elements.json +1 -1
- package/lib/list/custom-elements.md +3 -3
- package/lib/list/elements/list.d.ts +1 -1
- package/lib/list/elements/list.js +4 -8
- package/lib/list/helpers/renderer.d.ts +0 -4
- package/lib/list/helpers/renderer.js +5 -5
- package/lib/list/helpers/types.d.ts +1 -1
- package/lib/list/themes/halo/dark/index.js +2 -2
- package/lib/list/themes/halo/light/index.js +2 -2
- package/lib/list/themes/solar/charcoal/index.js +2 -2
- package/lib/list/themes/solar/pearl/index.js +2 -2
- package/lib/multi-input/custom-elements.json +5 -5
- package/lib/multi-input/custom-elements.md +5 -5
- package/lib/multi-input/helpers/types.d.ts +3 -3
- package/lib/multi-input/index.d.ts +5 -17
- package/lib/multi-input/index.js +8 -21
- package/lib/multi-input/themes/halo/dark/index.js +1 -1
- package/lib/multi-input/themes/halo/light/index.js +1 -1
- 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.json +2 -2
- package/lib/notification/custom-elements.md +4 -4
- package/lib/notification/elements/notification.d.ts +2 -2
- package/lib/notification/elements/notification.js +2 -2
- package/lib/notification/helpers/types.d.ts +2 -2
- package/lib/number-field/custom-elements.json +2 -2
- package/lib/number-field/custom-elements.md +4 -4
- package/lib/number-field/index.d.ts +4 -4
- package/lib/number-field/index.js +24 -19
- package/lib/number-field/themes/halo/dark/index.js +2 -1
- package/lib/number-field/themes/halo/light/index.js +2 -1
- package/lib/number-field/themes/solar/charcoal/index.js +2 -1
- package/lib/number-field/themes/solar/pearl/index.js +2 -1
- package/lib/overlay/custom-elements.json +6 -9
- package/lib/overlay/custom-elements.md +7 -8
- package/lib/overlay/elements/overlay-backdrop.d.ts +1 -8
- package/lib/overlay/elements/overlay-backdrop.js +3 -13
- package/lib/overlay/elements/overlay-viewport.d.ts +1 -8
- package/lib/overlay/elements/overlay-viewport.js +3 -13
- package/lib/overlay/elements/overlay.d.ts +7 -15
- package/lib/overlay/elements/overlay.js +13 -55
- package/lib/overlay/helpers/types.d.ts +13 -13
- package/lib/overlay/managers/close-manager.d.ts +1 -1
- package/lib/overlay/managers/close-manager.js +6 -4
- package/lib/overlay/managers/focus-manager.js +2 -1
- package/lib/overlay/managers/interaction-lock-manager.js +1 -1
- package/lib/overlay/managers/viewport-manager.js +3 -0
- package/lib/overlay/managers/zindex-manager.d.ts +1 -1
- package/lib/overlay/managers/zindex-manager.js +1 -1
- package/lib/overlay/themes/halo/dark/index.js +1 -1
- package/lib/overlay/themes/halo/light/index.js +1 -1
- package/lib/overlay/themes/solar/charcoal/index.js +1 -1
- package/lib/overlay/themes/solar/pearl/index.js +1 -1
- package/lib/overlay-menu/custom-elements.json +2 -2
- package/lib/overlay-menu/custom-elements.md +2 -2
- package/lib/overlay-menu/helpers/types.d.ts +2 -2
- package/lib/overlay-menu/index.d.ts +2 -2
- package/lib/overlay-menu/index.js +36 -42
- package/lib/overlay-menu/managers/menu-manager.d.ts +0 -1
- package/lib/overlay-menu/managers/menu-manager.js +1 -5
- package/lib/overlay-menu/themes/halo/dark/index.js +1 -1
- package/lib/overlay-menu/themes/halo/light/index.js +1 -1
- package/lib/overlay-menu/themes/solar/charcoal/index.js +1 -1
- package/lib/overlay-menu/themes/solar/pearl/index.js +1 -1
- package/lib/pagination/custom-elements.json +1 -1
- package/lib/pagination/custom-elements.md +3 -3
- package/lib/pagination/index.d.ts +1 -2
- package/lib/pagination/index.js +3 -7
- 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/password-field/custom-elements.json +2 -6
- package/lib/password-field/custom-elements.md +4 -5
- package/lib/password-field/index.d.ts +2 -3
- package/lib/password-field/index.js +2 -3
- package/lib/password-field/themes/halo/dark/index.js +2 -1
- package/lib/password-field/themes/halo/light/index.js +2 -1
- package/lib/password-field/themes/solar/charcoal/index.js +2 -1
- package/lib/password-field/themes/solar/pearl/index.js +2 -1
- package/lib/pill/custom-elements.json +1 -1
- package/lib/pill/custom-elements.md +3 -3
- package/lib/pill/index.d.ts +1 -1
- package/lib/pill/index.js +2 -2
- package/lib/pill/themes/halo/dark/index.js +2 -1
- package/lib/pill/themes/halo/light/index.js +2 -1
- package/lib/pill/themes/solar/charcoal/index.js +2 -1
- package/lib/pill/themes/solar/pearl/index.js +2 -1
- package/lib/radio-button/custom-elements.json +1 -1
- package/lib/radio-button/custom-elements.md +3 -3
- package/lib/radio-button/index.d.ts +1 -1
- package/lib/radio-button/index.js +1 -6
- package/lib/radio-button/themes/halo/dark/index.js +1 -1
- package/lib/radio-button/themes/halo/light/index.js +1 -1
- package/lib/radio-button/themes/solar/charcoal/index.js +1 -1
- package/lib/radio-button/themes/solar/pearl/index.js +1 -1
- package/lib/rating/custom-elements.json +1 -1
- package/lib/rating/custom-elements.md +3 -3
- package/lib/rating/index.d.ts +1 -1
- package/lib/rating/index.js +1 -5
- package/lib/search-field/custom-elements.json +3 -3
- package/lib/search-field/custom-elements.md +5 -5
- package/lib/search-field/index.d.ts +3 -3
- package/lib/search-field/index.js +6 -7
- package/lib/search-field/themes/halo/dark/index.js +2 -1
- package/lib/search-field/themes/halo/light/index.js +2 -1
- package/lib/search-field/themes/solar/charcoal/index.js +2 -1
- package/lib/search-field/themes/solar/pearl/index.js +2 -1
- package/lib/select/custom-elements.json +2 -2
- package/lib/select/custom-elements.md +4 -4
- package/lib/select/helpers/types.d.ts +2 -2
- package/lib/select/index.d.ts +2 -2
- package/lib/select/index.js +15 -20
- package/lib/select/themes/halo/dark/index.js +2 -1
- package/lib/select/themes/halo/light/index.js +2 -1
- package/lib/select/themes/solar/charcoal/index.js +2 -1
- package/lib/select/themes/solar/pearl/index.js +2 -1
- package/lib/sidebar-layout/index.js +2 -3
- package/lib/sidebar-layout/themes/halo/dark/index.js +1 -1
- package/lib/sidebar-layout/themes/halo/light/index.js +1 -1
- package/lib/sidebar-layout/themes/solar/charcoal/index.js +1 -1
- package/lib/sidebar-layout/themes/solar/pearl/index.js +1 -1
- package/lib/slider/custom-elements.json +3 -3
- package/lib/slider/custom-elements.md +5 -5
- package/lib/slider/index.d.ts +3 -3
- package/lib/slider/index.js +117 -111
- package/lib/swing-gauge/types.d.ts +1 -1
- package/lib/tab/custom-elements.json +1 -1
- package/lib/tab/custom-elements.md +3 -3
- package/lib/tab/index.d.ts +1 -1
- package/lib/tab/index.js +1 -1
- 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 +1 -1
- package/lib/tab-bar/custom-elements.md +3 -3
- package/lib/tab-bar/index.d.ts +1 -1
- package/lib/tab-bar/index.js +1 -5
- package/lib/tab-bar/themes/halo/dark/index.js +1 -1
- package/lib/tab-bar/themes/halo/light/index.js +1 -1
- package/lib/text-field/custom-elements.json +3 -3
- package/lib/text-field/custom-elements.md +5 -5
- package/lib/text-field/index.d.ts +4 -10
- package/lib/text-field/index.js +11 -26
- package/lib/text-field/themes/halo/dark/index.js +2 -1
- package/lib/text-field/themes/halo/light/index.js +2 -1
- package/lib/text-field/themes/solar/charcoal/index.js +2 -1
- package/lib/text-field/themes/solar/pearl/index.js +2 -1
- package/lib/time-picker/custom-elements.json +1 -1
- package/lib/time-picker/custom-elements.md +3 -3
- package/lib/time-picker/index.d.ts +1 -1
- package/lib/time-picker/index.js +19 -20
- package/lib/time-picker/themes/halo/dark/index.js +2 -1
- package/lib/time-picker/themes/halo/light/index.js +2 -1
- package/lib/time-picker/themes/solar/charcoal/index.js +2 -1
- package/lib/time-picker/themes/solar/pearl/index.js +2 -1
- package/lib/toggle/custom-elements.json +1 -1
- package/lib/toggle/custom-elements.md +3 -3
- package/lib/toggle/index.d.ts +1 -1
- package/lib/toggle/index.js +2 -5
- 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/elements/tooltip-element.js +1 -1
- package/lib/tooltip/helpers/types.d.ts +10 -10
- package/lib/tooltip/index.js +5 -4
- package/lib/tooltip/managers/tooltip-manager.js +2 -5
- package/lib/tornado-chart/elements/tornado-item.js +8 -9
- package/lib/tornado-chart/themes/halo/dark/index.js +2 -2
- package/lib/tornado-chart/themes/halo/light/index.js +2 -2
- package/lib/tornado-chart/themes/solar/charcoal/index.js +1 -1
- package/lib/tornado-chart/themes/solar/pearl/index.js +1 -1
- package/lib/tree/custom-elements.json +2 -2
- package/lib/tree/custom-elements.md +2 -2
- package/lib/tree/elements/tree.d.ts +2 -2
- package/lib/tree/elements/tree.js +2 -4
- package/lib/tree/helpers/renderer.d.ts +0 -4
- package/lib/tree/helpers/renderer.js +5 -5
- package/lib/tree/helpers/types.d.ts +2 -2
- package/lib/tree/themes/halo/dark/index.js +2 -2
- package/lib/tree/themes/halo/light/index.js +2 -2
- package/lib/tree/themes/solar/charcoal/index.js +2 -2
- package/lib/tree/themes/solar/pearl/index.js +2 -2
- package/lib/tree-select/custom-elements.json +7 -7
- package/lib/tree-select/custom-elements.md +7 -7
- package/lib/tree-select/helpers/types.d.ts +2 -2
- package/lib/tree-select/index.d.ts +5 -6
- package/lib/tree-select/index.js +23 -23
- package/lib/tree-select/themes/halo/dark/index.js +2 -1
- package/lib/tree-select/themes/halo/light/index.js +2 -1
- package/lib/tree-select/themes/solar/charcoal/index.js +2 -1
- package/lib/tree-select/themes/solar/pearl/index.js +2 -1
- package/lib/version.js +1 -1
- package/package.json +32 -30
- package/lib/chart/helpers/legend.d.ts +0 -5
- package/lib/chart/helpers/legend.js +0 -78
|
@@ -1,3 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { Chart as ChartJS } from 'chart.js';
|
|
2
|
+
import type { Plugin, ChartType, ActiveElement } from 'chart.js';
|
|
3
|
+
interface CenterLabel {
|
|
4
|
+
label: string;
|
|
5
|
+
bold?: boolean;
|
|
6
|
+
}
|
|
7
|
+
interface Selected {
|
|
8
|
+
datasetIndex?: number;
|
|
9
|
+
index: number;
|
|
10
|
+
}
|
|
11
|
+
interface CenterLabelConfig {
|
|
12
|
+
defaultText: CenterLabel[];
|
|
13
|
+
selected: Selected;
|
|
14
|
+
onRenderLabel(chart: ChartJS, chartItems: ActiveElement[]): CenterLabel[];
|
|
15
|
+
}
|
|
16
|
+
declare module 'chart.js' {
|
|
17
|
+
interface PluginOptionsByType<TType extends ChartType> {
|
|
18
|
+
'centerLabel'?: CenterLabelConfig;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
declare const plugins: Plugin;
|
|
22
|
+
export { plugins as doughnutCenterLabelPlugin };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { Chart as ChartJS } from 'chart.js';
|
|
2
|
+
// eslint-disable-next-line import/extensions
|
|
3
|
+
import { getHoverColor } from 'chart.js/helpers';
|
|
2
4
|
const getPluginConfig = (chart) => {
|
|
3
5
|
return chart.config.options?.plugins?.centerLabel;
|
|
4
6
|
};
|
|
@@ -8,63 +10,72 @@ const getPluginConfig = (chart) => {
|
|
|
8
10
|
* @param {MetaData[]} active active data
|
|
9
11
|
* @returns {void}
|
|
10
12
|
*/
|
|
13
|
+
// Note: use logic from chart.js - chart.js/src/elements/element.arc.js :draw()
|
|
11
14
|
const drawItemBorder = function (chart, active) {
|
|
12
15
|
if (!chart.data.datasets) {
|
|
13
16
|
return;
|
|
14
17
|
}
|
|
15
|
-
if (active?.length) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
18
|
+
if (!active?.length) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const ctx = chart.ctx;
|
|
22
|
+
const chartItem = active[0];
|
|
23
|
+
const element = chartItem.element;
|
|
24
|
+
const arcOptions = chartItem.element.options;
|
|
25
|
+
const datasets = chart.data.datasets[chartItem.datasetIndex];
|
|
26
|
+
// Need to make color bolder
|
|
27
|
+
if (Array.isArray(datasets.backgroundColor)) {
|
|
28
|
+
arcOptions.backgroundColor = datasets.backgroundColor[chartItem.index];
|
|
29
|
+
arcOptions.backgroundColor = getHoverColor(arcOptions.backgroundColor);
|
|
30
|
+
}
|
|
31
|
+
arcOptions.borderWidth = arcOptions.borderWidth || (datasets.borderWidth || chart.config.options?.elements?.arc?.borderWidth);
|
|
32
|
+
arcOptions.borderColor = (getComputedStyle(chart.canvas).getPropertyValue('--doughnut-border-color') || ChartJS.defaults.color);
|
|
33
|
+
const sA = element.startAngle;
|
|
34
|
+
const eA = element.endAngle;
|
|
35
|
+
if (ctx) {
|
|
36
|
+
ctx.beginPath();
|
|
37
|
+
ctx.arc(element.x, element.y, element.outerRadius, sA, eA);
|
|
38
|
+
ctx.arc(element.x, element.y, element.innerRadius, eA, sA, true);
|
|
39
|
+
ctx.closePath();
|
|
40
|
+
ctx.strokeStyle = arcOptions.borderColor;
|
|
41
|
+
ctx.lineWidth = arcOptions.borderWidth;
|
|
42
|
+
ctx.fillStyle = arcOptions.backgroundColor;
|
|
43
|
+
ctx.fill();
|
|
44
|
+
ctx.lineJoin = 'bevel';
|
|
45
|
+
if (arcOptions.borderWidth) {
|
|
46
|
+
ctx.stroke();
|
|
39
47
|
}
|
|
40
48
|
}
|
|
41
49
|
};
|
|
42
50
|
const plugins = {
|
|
43
|
-
|
|
51
|
+
id: 'centerLabel',
|
|
52
|
+
beforeEvent: function (chart, args) {
|
|
44
53
|
if (!getPluginConfig(chart)) {
|
|
45
54
|
return;
|
|
46
55
|
}
|
|
47
|
-
switch (event
|
|
56
|
+
switch (args.event?.type) {
|
|
48
57
|
case 'click':
|
|
49
58
|
// chart._select stores a segment that is clicked
|
|
50
59
|
if (!chart._select) {
|
|
51
60
|
chart._select = [];
|
|
52
61
|
}
|
|
53
|
-
if (chart.
|
|
54
|
-
if (chart._select.length && chart._select[0].
|
|
55
|
-
&& chart._select[0].
|
|
62
|
+
if (chart.getActiveElements().length) {
|
|
63
|
+
if (chart._select.length && chart._select[0].datasetIndex === chart.getActiveElements()[0].datasetIndex
|
|
64
|
+
&& chart._select[0].index === chart.getActiveElements()[0].index) {
|
|
56
65
|
// reset value if user clicked on selected segment
|
|
57
66
|
chart._select = [];
|
|
58
67
|
}
|
|
59
68
|
else {
|
|
60
69
|
// set segment that user clicked
|
|
61
|
-
chart._select = chart.
|
|
70
|
+
chart._select = chart.getActiveElements().slice(0);
|
|
62
71
|
}
|
|
63
72
|
}
|
|
64
73
|
else {
|
|
65
74
|
chart._select = [];
|
|
66
75
|
}
|
|
67
|
-
chart
|
|
76
|
+
// Trigger update to re render the chart
|
|
77
|
+
// Cannot use draw() because the chart doesn't redraw border of unselected datasets
|
|
78
|
+
chart.update();
|
|
68
79
|
break;
|
|
69
80
|
default:
|
|
70
81
|
break;
|
|
@@ -80,13 +91,13 @@ const plugins = {
|
|
|
80
91
|
if (chart._select) {
|
|
81
92
|
active = chart._select;
|
|
82
93
|
}
|
|
83
|
-
|
|
84
|
-
|
|
94
|
+
const activeElements = chart.getActiveElements();
|
|
95
|
+
if (activeElements.length > 0) {
|
|
96
|
+
active = activeElements;
|
|
85
97
|
}
|
|
86
98
|
const renderText = config.onRenderLabel(chart, active);
|
|
87
99
|
// Get Texts
|
|
88
|
-
const
|
|
89
|
-
const texts = renderText || centerConfig.defaultText;
|
|
100
|
+
const texts = renderText || config.defaultText;
|
|
90
101
|
if (!texts) {
|
|
91
102
|
return;
|
|
92
103
|
}
|
|
@@ -94,28 +105,29 @@ const plugins = {
|
|
|
94
105
|
const ctx = chart.ctx;
|
|
95
106
|
// Get options from config
|
|
96
107
|
const canvas = chart.canvas;
|
|
97
|
-
const style =
|
|
98
|
-
const globalConfig =
|
|
99
|
-
const defaultFontStyle = globalConfig.
|
|
100
|
-
const defaultColor = style.getPropertyValue('--doughnut-center-text-color') || globalConfig.
|
|
108
|
+
const style = getComputedStyle(canvas);
|
|
109
|
+
const globalConfig = ChartJS.defaults;
|
|
110
|
+
const defaultFontStyle = globalConfig.font.family;
|
|
111
|
+
const defaultColor = style.getPropertyValue('--doughnut-center-text-color') || globalConfig.color;
|
|
101
112
|
const backgroundColor = style.getPropertyValue('--doughnut-center-background-color');
|
|
102
113
|
const customFontSizePercent = parseInt(style.getPropertyValue('--doughnut-center-font-size'), 10) / 100; // font size in percentage
|
|
103
114
|
const centerX = (chart.chartArea.left + chart.chartArea.right) / 2;
|
|
104
115
|
const centerY = (chart.chartArea.top + chart.chartArea.bottom) / 2;
|
|
116
|
+
// Radius of circular hole in the middle of the chart
|
|
117
|
+
const innerRadius = chart.getDatasetMeta(chart.data.datasets.length - 1).data[0].innerRadius;
|
|
105
118
|
// Render center background color
|
|
106
119
|
if (backgroundColor) {
|
|
107
|
-
ctx.arc(centerX, centerY,
|
|
120
|
+
ctx.arc(centerX, centerY, innerRadius, 0, 2 * Math.PI);
|
|
108
121
|
ctx.fillStyle = backgroundColor;
|
|
109
122
|
ctx.fill();
|
|
110
123
|
}
|
|
111
|
-
const textAreaWidth = chart.innerRadius;
|
|
112
124
|
// Base font size is 30% and minus 4% per text lines ( if text has multiple lines ) of text area
|
|
113
|
-
const baseFontSize =
|
|
125
|
+
const baseFontSize = innerRadius * (0.3 - (0.04 * (texts.length - 1)));
|
|
114
126
|
// Keep minimum font size equal 5% of text area
|
|
115
|
-
const computedFontSize = Math.max(
|
|
127
|
+
const computedFontSize = Math.max(innerRadius * 0.05, baseFontSize);
|
|
116
128
|
// Use font size ratio from user if --doughnut-center-font-size CSS variable is provided
|
|
117
|
-
const fontRatio = customFontSizePercent || computedFontSize /
|
|
118
|
-
const fontSizeToUse =
|
|
129
|
+
const fontRatio = customFontSizePercent || computedFontSize / innerRadius;
|
|
130
|
+
const fontSizeToUse = innerRadius * fontRatio;
|
|
119
131
|
// Set font settings to draw it correctly.
|
|
120
132
|
ctx.textAlign = 'center';
|
|
121
133
|
ctx.textBaseline = 'middle';
|
|
@@ -125,7 +137,7 @@ const plugins = {
|
|
|
125
137
|
const fontSizeHeaderRatio = 1.15;
|
|
126
138
|
// Move Y position of text up according to text length
|
|
127
139
|
const offsetY = centerY - (texts.length - 1) * 0.5 * fontLineHeight;
|
|
128
|
-
const containerWidth =
|
|
140
|
+
const containerWidth = innerRadius * 2;
|
|
129
141
|
const circlePadding = containerWidth * (texts.length <= 1 ? 0.4 : 0.5);
|
|
130
142
|
for (let i = 0; i < texts.length; i++) {
|
|
131
143
|
let targetFont;
|
|
@@ -170,14 +182,13 @@ const plugins = {
|
|
|
170
182
|
}
|
|
171
183
|
// Set selected item to the chart
|
|
172
184
|
const items = chart.getDatasetMeta(datasetIndex).data[selectedIndex];
|
|
173
|
-
chart.selected = items ? [items] : [];
|
|
185
|
+
chart.selected = items ? [{ element: items, datasetIndex, index: selectedIndex }] : [];
|
|
174
186
|
},
|
|
175
187
|
afterDatasetsDraw: function (chart) {
|
|
176
188
|
if (getPluginConfig(chart)) {
|
|
177
189
|
// Draw active element
|
|
178
|
-
// Note: use logic from chart.js - chart.js/src/elements/element.arc.js :draw()
|
|
179
190
|
// hover
|
|
180
|
-
drawItemBorder(chart, chart.
|
|
191
|
+
drawItemBorder(chart, chart.getActiveElements());
|
|
181
192
|
// selected
|
|
182
193
|
if (chart.selected?.length) {
|
|
183
194
|
chart._select = chart.selected;
|
|
@@ -188,4 +199,4 @@ const plugins = {
|
|
|
188
199
|
}
|
|
189
200
|
}
|
|
190
201
|
};
|
|
191
|
-
export
|
|
202
|
+
export { plugins as doughnutCenterLabelPlugin };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './doughnut-center-label.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './doughnut-center-label.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '@refinitiv-ui/elements/header/themes/halo/dark';
|
|
2
2
|
import '@refinitiv-ui/elements/layout/themes/halo/dark';
|
|
3
3
|
|
|
4
|
-
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-chart', styles: ':host{
|
|
4
|
+
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-chart', styles: ':host{font-size:12px;--grid-line-color:rgba(38, 38, 38, 0.5);--zero-line-color:rgba(38, 38, 38, 0.5);--animation-duration:1000;--line-width:2px;--line-tension:0;--multi-dataset-border-color:#1A1A1A;--tooltip-background-color:rgba(204, 204, 204, 0.9);--tooltip-title-color:#0D0D0D;--tooltip-body-color:#0D0D0D;--tooltip-border-radius:0px;--tooltip-caret-size:7px;--tooltip-padding-x:7px;--tooltip-padding-y:5px;--tooltip-title-spacing:0;--legend-key-box-width:4px;--chart-color-1:#6678FF;--chart-color-2:#FFFFFF;--chart-color-3:#FFC800;--chart-color-4:#9064CD;--chart-color-5:#00D0D4;--chart-color-6:#FF5000;--chart-color-7:#00C389;--chart-color-8:#EA2E6C;--tooltip-background-color:#FFFFFF;--tooltip-title-color:#0D0D0D;--tooltip-body-color:#0D0D0D;--tooltip-padding-x:8px;--tooltip-padding-y:4px;--chart-color-1:#6678FF;--chart-color-2:#FFFFFF;--chart-color-3:#FFC800;--chart-color-4:#9064CD;--chart-color-5:#00D0D4;--chart-color-6:#FF5000;--chart-color-7:#00C389;--chart-color-8:#EA2E6C;--chart-color-9:#999999;--chart-color-10:#3BBAFF;--chart-color-11:#198C8C;--chart-color-12:#C36241;--chart-color-13:#CCD2FF;--chart-color-14:#808080;--chart-color-15:#FFDE66;--chart-color-16:#BCA2E1;--chart-color-17:#59DFE1;--chart-color-18:#FF9666;--chart-color-19:#6CEFC8;--chart-color-20:#F281A7;--chart-color-21:#CCCCCC;--chart-color-22:#89D5FF;--chart-color-23:#75BABA;--chart-color-24:#DBA08D;--chart-color-25:#F6ABC4}' }}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '@refinitiv-ui/elements/header/themes/halo/light';
|
|
2
2
|
import '@refinitiv-ui/elements/layout/themes/halo/light';
|
|
3
3
|
|
|
4
|
-
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-chart', styles: ':host{
|
|
4
|
+
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-chart', styles: ':host{font-size:12px;--grid-line-color:rgba(242, 242, 242, 0.5);--zero-line-color:rgba(242, 242, 242, 0.5);--animation-duration:1000;--line-width:2px;--line-tension:0;--multi-dataset-border-color:#FAFAFA;--tooltip-background-color:rgba(13, 13, 13, 0.9);--tooltip-title-color:#FFFFFF;--tooltip-body-color:#FFFFFF;--tooltip-border-radius:0px;--tooltip-caret-size:7px;--tooltip-padding-x:7px;--tooltip-padding-y:5px;--tooltip-title-spacing:0;--legend-key-box-width:4px;--chart-color-1:#334BFF;--chart-color-2:#000000;--chart-color-3:#7F6400;--chart-color-4:#71549F;--chart-color-5:#007678;--chart-color-6:#CC4000;--chart-color-7:#007653;--chart-color-8:#D22962;--tooltip-background-color:#FFF4CC;--tooltip-title-color:#0D0D0D;--tooltip-body-color:#0D0D0D;--tooltip-padding-x:8px;--tooltip-padding-y:4px;--chart-color-1:#334BFF;--chart-color-2:#000000;--chart-color-3:#7F6400;--chart-color-4:#71549F;--chart-color-5:#007678;--chart-color-6:#CC4000;--chart-color-7:#007653;--chart-color-8:#D22962;--chart-color-9:#595959;--chart-color-10:#236F99;--chart-color-11:#147070;--chart-color-12:#AF583A;--chart-color-13:#0F1E8A;--chart-color-14:#737373;--chart-color-15:#4C3C00;--chart-color-16:#563F77;--chart-color-17:#004E4F;--chart-color-18:#993000;--chart-color-19:#00432F;--chart-color-20:#A3204C;--chart-color-21:#404040;--chart-color-22:#174A66;--chart-color-23:#116262;--chart-color-24:#88442D;--chart-color-25:#5D122B}' }}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '@refinitiv-ui/elements/header/themes/solar/charcoal';
|
|
2
2
|
import '@refinitiv-ui/elements/layout/themes/solar/charcoal';
|
|
3
3
|
|
|
4
|
-
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-chart', styles: ':host{
|
|
4
|
+
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-chart', styles: ':host{font-size:14px;--grid-line-color:rgba(10, 10, 10, 0.5);--zero-line-color:rgba(10, 10, 10, 0.5);--animation-duration:1000;--line-width:2px;--line-tension:0;--multi-dataset-border-color:#1A1A1C;--tooltip-background-color:rgba(194, 194, 194, 0.9);--tooltip-title-color:#151516;--tooltip-body-color:#151516;--tooltip-border-radius:0px;--tooltip-caret-size:7px;--tooltip-padding-x:7px;--tooltip-padding-y:5px;--tooltip-title-spacing:0;--legend-key-box-width:4px;--chart-color-1:#FF9933;--chart-color-2:#B10CF2;--chart-color-3:#7DE442;--chart-color-4:#3780BF;--chart-color-5:#FA4C11;--chart-color-6:#FFE433;--chart-color-7:#8C8C8C;--chart-color-8:#5A54FF;color:rgba(194,194,194,.8);--legend-key-box-width:12;--grid-line-color:rgba(194, 194, 194, 0.1);--zero-line-color:rgba(194, 194, 194, 0.1);--animation-duration:500;--tooltip-background-color:rgba(74, 74, 82, 0.9);--tooltip-title-color:#C2C2C2;--tooltip-body-color:#C2C2C2;--tooltip-caret-size:8px;--tooltip-padding-x:8px;--tooltip-padding-y:8px;--doughnut-center-text-color:#C2C2C2;--doughnut-border-color:#ffffff;--chart-color-1:#FF9933;--chart-color-2:#B10CF2;--chart-color-3:#7DE442;--chart-color-4:#3780BF;--chart-color-5:#FA4C11;--chart-color-6:#FFE433;--chart-color-7:#8C8C8C;--chart-color-8:#5A54FF;--chart-color-9:#E53766;--chart-color-10:#648608;--chart-color-11:#48CBF7;--chart-color-12:#F3478E;--chart-color-13:#508BF7;--chart-color-14:#EFF748;--chart-color-15:#FF4043;--chart-color-16:#A7DB0B;--chart-color-17:#C2C2C2;--chart-color-18:#1578AD;--chart-color-19:#F2B530;--chart-color-20:#297835;--chart-color-21:#7045FF;--chart-color-22:#DD48F7;--chart-color-23:#09A8C0;--chart-color-24:#60E65C;--chart-color-25:#2960A3}' }}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '@refinitiv-ui/elements/header/themes/solar/pearl';
|
|
2
2
|
import '@refinitiv-ui/elements/layout/themes/solar/pearl';
|
|
3
3
|
|
|
4
|
-
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-chart', styles: ':host{
|
|
4
|
+
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-chart', styles: ':host{font-size:14px;--grid-line-color:rgba(213, 216, 219, 0.5);--zero-line-color:rgba(213, 216, 219, 0.5);--animation-duration:1000;--line-width:2px;--line-tension:0;--multi-dataset-border-color:#FFFFFF;--tooltip-background-color:rgba(72, 72, 72, 0.9);--tooltip-title-color:#C2C2C2;--tooltip-body-color:#C2C2C2;--tooltip-border-radius:0px;--tooltip-caret-size:7px;--tooltip-padding-x:7px;--tooltip-padding-y:5px;--tooltip-title-spacing:0;--legend-key-box-width:4px;--chart-color-1:#EE7600;--chart-color-2:#B10CF2;--chart-color-3:#309054;--chart-color-4:#3780BF;--chart-color-5:#FA4C11;--chart-color-6:#D9B500;--chart-color-7:#8C8C8C;--chart-color-8:#5A54FF;color:rgba(72,72,72,.8);--legend-key-box-width:12;--grid-line-color:rgba(72, 72, 72, 0.1);--zero-line-color:rgba(72, 72, 72, 0.1);--animation-duration:500;--tooltip-background-color:rgba(190, 195, 204, 0.9);--tooltip-title-color:#484848;--tooltip-body-color:#484848;--tooltip-caret-size:8px;--tooltip-padding-x:8px;--tooltip-padding-y:8px;--doughnut-center-text-color:#484848;--doughnut-border-color:#000000;--chart-color-1:#EE7600;--chart-color-2:#B10CF2;--chart-color-3:#309054;--chart-color-4:#3780BF;--chart-color-5:#FA4C11;--chart-color-6:#D9B500;--chart-color-7:#8C8C8C;--chart-color-8:#5A54FF;--chart-color-9:#E53766;--chart-color-10:#648608;--chart-color-11:#40B6DE;--chart-color-12:#F3478E;--chart-color-13:#508BF7;--chart-color-14:#AAB218;--chart-color-15:#FF4043;--chart-color-16:#80A808;--chart-color-17:#707070;--chart-color-18:#1578AC;--chart-color-19:#D9A22B;--chart-color-20:#297835;--chart-color-21:#7045FF;--chart-color-22:#DD48F7;--chart-color-23:#09A8C0;--chart-color-24:#4BB347;--chart-color-25:#2960A3}' }}));
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"events": [
|
|
64
64
|
{
|
|
65
65
|
"name": "checked-changed",
|
|
66
|
-
"description": "Fired when the `checked` property
|
|
66
|
+
"description": "Fired when the user checks or unchecks the checkbox. The event is not fired if the `checked` property is changed programmatically."
|
|
67
67
|
}
|
|
68
68
|
]
|
|
69
69
|
}
|
|
@@ -13,6 +13,6 @@ Form control for selecting one or several options
|
|
|
13
13
|
|
|
14
14
|
## Events
|
|
15
15
|
|
|
16
|
-
| Event | Description
|
|
17
|
-
|
|
18
|
-
| `checked-changed` | Fired when the `checked` property
|
|
16
|
+
| Event | Description |
|
|
17
|
+
|-------------------|--------------------------------------------------|
|
|
18
|
+
| `checked-changed` | Fired when the user checks or unchecks the checkbox. The event is not fired if the `checked` property is changed programmatically. |
|
package/lib/checkbox/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { ControlElement, TemplateResult, CSSResultGroup, PropertyValues } from '
|
|
|
3
3
|
import '../icon/index.js';
|
|
4
4
|
/**
|
|
5
5
|
* Form control for selecting one or several options
|
|
6
|
-
* @fires checked-changed - Fired when the `checked` property
|
|
6
|
+
* @fires checked-changed - Fired when the user checks or unchecks the checkbox. The event is not fired if the `checked` property is changed programmatically.
|
|
7
7
|
*
|
|
8
8
|
* @attr {boolean} readonly - Set readonly state
|
|
9
9
|
* @prop {boolean} [readonly=false] - Set readonly state
|
package/lib/checkbox/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import { registerOverflowTooltip } from '../tooltip/index.js';
|
|
|
8
8
|
import '../icon/index.js';
|
|
9
9
|
/**
|
|
10
10
|
* Form control for selecting one or several options
|
|
11
|
-
* @fires checked-changed - Fired when the `checked` property
|
|
11
|
+
* @fires checked-changed - Fired when the user checks or unchecks the checkbox. The event is not fired if the `checked` property is changed programmatically.
|
|
12
12
|
*
|
|
13
13
|
* @attr {boolean} readonly - Set readonly state
|
|
14
14
|
* @prop {boolean} [readonly=false] - Set readonly state
|
|
@@ -122,7 +122,6 @@ let Checkbox = class Checkbox extends ControlElement {
|
|
|
122
122
|
}
|
|
123
123
|
switch (event.key) {
|
|
124
124
|
case ' ':
|
|
125
|
-
case 'Spacebar':
|
|
126
125
|
this.handleChangeChecked();
|
|
127
126
|
break;
|
|
128
127
|
default:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '@refinitiv-ui/elements/icon/themes/halo/dark';
|
|
2
2
|
import '@refinitiv-ui/elements/tooltip/themes/halo/dark';
|
|
3
3
|
|
|
4
|
-
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-checkbox', styles: ':host{margin:1px 0;vertical-align:middle;display:inline-flex;align-items:center;flex-wrap:nowrap;font-size:inherit;font-weight:inherit;touch-action:manipulation;--check-color:#6678FF;color:#ccc}:host(:focus){outline:0}:host [part=container]{-webkit-appearance:none;-moz-appearance:none;appearance:none;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;border-radius:0;background-color:#0d0d0d;transition:box-shadow 150ms,border-color 150ms;box-shadow:inset 0 0 0 rgba(0,0,0,.5);-webkit-user-select:none;-moz-user-select:none;user-select:none;position:relative;border:1px solid #404040;width:14px;height:14px}:host [part=check]{display:flex;justify-content:center;align-items:center;box-sizing:border-box;color:var(--check-color,#6678ff);width:95%;height:95%}:host [part=label]{margin:0 7px;cursor:default}:host([indeterminate]) [part=check]{border:none;background-color:currentColor;transform:none;border-radius:1px;margin:0;width:70%;height:1px}:host([disabled]) [part=check],:host([readonly]) [part=check]{color:var(--check-color,#ccc)}:host([disabled]) [part=check]{opacity:.5}:host([disabled][checked]) [part=check]{opacity:.5}:host([disabled]) [part=label]{opacity:.65}@media (
|
|
4
|
+
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-checkbox', styles: ':host{margin:1px 0;vertical-align:middle;display:inline-flex;align-items:center;flex-wrap:nowrap;font-size:inherit;font-weight:inherit;touch-action:manipulation;--check-color:#6678FF;color:#ccc}:host(:focus){outline:0}:host [part=container]{-webkit-appearance:none;-moz-appearance:none;appearance:none;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;border-radius:0;background-color:#0d0d0d;transition:box-shadow 150ms,border-color 150ms;box-shadow:inset 0 0 0 rgba(0,0,0,.5);-webkit-user-select:none;-moz-user-select:none;user-select:none;position:relative;border:1px solid #404040;width:14px;height:14px}:host [part=check]{display:flex;justify-content:center;align-items:center;box-sizing:border-box;color:var(--check-color,#6678ff);width:95%;height:95%}:host [part=label]{margin:0 7px;cursor:default}:host([indeterminate]) [part=check]{border:none;background-color:currentColor;transform:none;border-radius:1px;margin:0;width:70%;height:1px}:host([disabled]) [part=check],:host([readonly]) [part=check]{color:var(--check-color,#ccc)}:host([disabled]) [part=check]{opacity:.5}:host([disabled][checked]) [part=check]{opacity:.5}:host([disabled]) [part=label]{opacity:.65}@media (pointer:fine){:host(:focus) [part=container]{border-color:#334bff;box-shadow:0 0 0 #334bff}}:host(:not([readonly])) [part=container]{cursor:pointer}:host(:hover:not([checked]):not([indeterminate]):not([readonly])) [part=container]{border-color:grey}:host(:hover:not([readonly])){color:#fff}:host([disabled]),:host([disabled]) [part=label]{opacity:.5}:host([checked]) [part=container]{border:1px solid #334bff}:host(:focus[readonly]:not([checked])) [part=container]{border-color:#404040}:host([focused=visible]){outline:#334bff solid 1px;outline-offset:2px}:host([indeterminate]) [part=container]{border:1px solid #334bff}:host(:focus[readonly]) [part=container],:host(:focus[readonly][indeterminate]) [part=container]{border-color:#334bff}' }}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '@refinitiv-ui/elements/icon/themes/halo/light';
|
|
2
2
|
import '@refinitiv-ui/elements/tooltip/themes/halo/light';
|
|
3
3
|
|
|
4
|
-
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-checkbox', styles: ':host{margin:1px 0;vertical-align:middle;display:inline-flex;align-items:center;flex-wrap:nowrap;font-size:inherit;font-weight:inherit;touch-action:manipulation;--check-color:#334BFF;color:#404040}:host(:focus){outline:0}:host [part=container]{-webkit-appearance:none;-moz-appearance:none;appearance:none;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;border-radius:0;background-color:#fff;transition:box-shadow 150ms,border-color 150ms;box-shadow:inset 0 0 0 rgba(0,0,0,.25);-webkit-user-select:none;-moz-user-select:none;user-select:none;position:relative;border:1px solid #595959;width:14px;height:14px}:host [part=check]{display:flex;justify-content:center;align-items:center;box-sizing:border-box;color:var(--check-color,#334bff);width:95%;height:95%}:host [part=label]{margin:0 7px;cursor:default}:host([indeterminate]) [part=check]{border:none;background-color:currentColor;transform:none;border-radius:1px;margin:0;width:70%;height:1px}:host([disabled]) [part=check],:host([readonly]) [part=check]{color:var(--check-color,#404040)}:host([disabled]) [part=check]{opacity:.5}:host([disabled][checked]) [part=check]{opacity:.5}:host([disabled]) [part=label]{opacity:.65}@media (
|
|
4
|
+
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-checkbox', styles: ':host{margin:1px 0;vertical-align:middle;display:inline-flex;align-items:center;flex-wrap:nowrap;font-size:inherit;font-weight:inherit;touch-action:manipulation;--check-color:#334BFF;color:#404040}:host(:focus){outline:0}:host [part=container]{-webkit-appearance:none;-moz-appearance:none;appearance:none;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;border-radius:0;background-color:#fff;transition:box-shadow 150ms,border-color 150ms;box-shadow:inset 0 0 0 rgba(0,0,0,.25);-webkit-user-select:none;-moz-user-select:none;user-select:none;position:relative;border:1px solid #595959;width:14px;height:14px}:host [part=check]{display:flex;justify-content:center;align-items:center;box-sizing:border-box;color:var(--check-color,#334bff);width:95%;height:95%}:host [part=label]{margin:0 7px;cursor:default}:host([indeterminate]) [part=check]{border:none;background-color:currentColor;transform:none;border-radius:1px;margin:0;width:70%;height:1px}:host([disabled]) [part=check],:host([readonly]) [part=check]{color:var(--check-color,#404040)}:host([disabled]) [part=check]{opacity:.5}:host([disabled][checked]) [part=check]{opacity:.5}:host([disabled]) [part=label]{opacity:.65}@media (pointer:fine){:host(:focus) [part=container]{border-color:#334bff;box-shadow:0 0 0 #334bff}}:host(:not([readonly])) [part=container]{cursor:pointer}:host(:hover:not([checked]):not([indeterminate]):not([readonly])) [part=container]{border-color:#0d0d0d}:host(:hover:not([readonly])){color:#0d0d0d}:host([disabled]),:host([disabled]) [part=label]{opacity:.5}:host([checked]) [part=container]{border:1px solid #334bff}:host(:focus[readonly]:not([checked])) [part=container]{border-color:#595959}:host([focused=visible]){outline:#334bff solid 1px;outline-offset:2px}:host([indeterminate]) [part=container]{border:1px solid #334bff}:host(:focus[readonly]) [part=container],:host(:focus[readonly][indeterminate]) [part=container]{border-color:#334bff}' }}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '@refinitiv-ui/elements/icon/themes/solar/charcoal';
|
|
2
2
|
import '@refinitiv-ui/elements/tooltip/themes/solar/charcoal';
|
|
3
3
|
|
|
4
|
-
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-checkbox', styles: ':host{margin:1px 0;vertical-align:middle;display:inline-flex;align-items:center;flex-wrap:nowrap;font-size:inherit;font-weight:inherit;touch-action:manipulation}:host(:focus){outline:0}:host [part=container]{-webkit-appearance:none;-moz-appearance:none;appearance:none;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;border-radius:0;background-color:#000;transition:box-shadow 150ms,border-color 150ms;box-shadow:inset 0 0 0 rgba(0,0,0,.6);-webkit-user-select:none;-moz-user-select:none;user-select:none;position:relative;border:1px solid #4a4a52;height:11px;width:11px}:host [part=check]{display:flex;justify-content:center;align-items:center;box-sizing:border-box;color:var(--check-color,#f93);border-width:0 2px 2px 0;width:95%;height:95%}:host [part=label]{cursor:default;margin:0 4px}:host([indeterminate]) [part=check]{border:none;background-color:currentColor;transform:none;border-radius:1px;margin:0;width:5px;height:5px}:host([disabled]) [part=check],:host([readonly]) [part=check]{color:var(--check-color,#e2e2e2)}:host([disabled]) [part=check]{opacity:.5}:host([disabled][checked]) [part=check]{opacity:.5}:host([disabled]) [part=label]{opacity:.65;color:rgba(194,194,194,.6)}:host([disabled][checked]) [part=check],:host([disabled][indeterminate]) [part=check]{color:#c2c2c2}:host([readonly][checked]) [part=check],:host([readonly][indeterminate]) [part=check]{color:rgba(194,194,194,.5)}:host([disabled]) [part=container],:host([readonly]) [part=container]{color:rgba(194,194,194,.6);border-color:rgba(74,74,82,.6);background-color:rgba(0,0,0,.6)}@media (
|
|
4
|
+
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-checkbox', styles: ':host{margin:1px 0;vertical-align:middle;display:inline-flex;align-items:center;flex-wrap:nowrap;font-size:inherit;font-weight:inherit;touch-action:manipulation}:host(:focus){outline:0}:host [part=container]{-webkit-appearance:none;-moz-appearance:none;appearance:none;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;border-radius:0;background-color:#000;transition:box-shadow 150ms,border-color 150ms;box-shadow:inset 0 0 0 rgba(0,0,0,.6);-webkit-user-select:none;-moz-user-select:none;user-select:none;position:relative;border:1px solid #4a4a52;height:11px;width:11px}:host [part=check]{display:flex;justify-content:center;align-items:center;box-sizing:border-box;color:var(--check-color,#f93);border-width:0 2px 2px 0;width:95%;height:95%}:host [part=label]{cursor:default;margin:0 4px}:host([indeterminate]) [part=check]{border:none;background-color:currentColor;transform:none;border-radius:1px;margin:0;width:5px;height:5px}:host([disabled]) [part=check],:host([readonly]) [part=check]{color:var(--check-color,#e2e2e2)}:host([disabled]) [part=check]{opacity:.5}:host([disabled][checked]) [part=check]{opacity:.5}:host([disabled]) [part=label]{opacity:.65;color:rgba(194,194,194,.6)}:host([disabled][checked]) [part=check],:host([disabled][indeterminate]) [part=check]{color:#c2c2c2}:host([readonly][checked]) [part=check],:host([readonly][indeterminate]) [part=check]{color:rgba(194,194,194,.5)}:host([disabled]) [part=container],:host([readonly]) [part=container]{color:rgba(194,194,194,.6);border-color:rgba(74,74,82,.6);background-color:rgba(0,0,0,.6)}@media (pointer:fine){:host(:focus) [part=container]{box-shadow:0 0 0 #f93;border:1px dotted #f93}}' }}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '@refinitiv-ui/elements/icon/themes/solar/pearl';
|
|
2
2
|
import '@refinitiv-ui/elements/tooltip/themes/solar/pearl';
|
|
3
3
|
|
|
4
|
-
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-checkbox', styles: ':host{margin:1px 0;vertical-align:middle;display:inline-flex;align-items:center;flex-wrap:nowrap;font-size:inherit;font-weight:inherit;touch-action:manipulation}:host(:focus){outline:0}:host [part=container]{-webkit-appearance:none;-moz-appearance:none;appearance:none;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;border-radius:0;background-color:#fff;transition:box-shadow 150ms,border-color 150ms;box-shadow:inset 0 0 0 rgba(0,0,0,.3);-webkit-user-select:none;-moz-user-select:none;user-select:none;position:relative;border:1px solid #a9afba;height:11px;width:11px}:host [part=check]{display:flex;justify-content:center;align-items:center;box-sizing:border-box;color:var(--check-color,#ee7600);border-width:0 2px 2px 0;width:95%;height:95%}:host [part=label]{cursor:default;margin:0 4px}:host([indeterminate]) [part=check]{border:none;background-color:currentColor;transform:none;border-radius:1px;margin:0;width:5px;height:5px}:host([disabled]) [part=check],:host([readonly]) [part=check]{color:var(--check-color,#acafb5)}:host([disabled]) [part=check]{opacity:.5}:host([disabled][checked]) [part=check]{opacity:.5}:host([disabled]) [part=label]{opacity:.65;color:rgba(72,72,72,.6)}:host([disabled][checked]) [part=check],:host([disabled][indeterminate]) [part=check]{color:#a9afba}:host([readonly][checked]) [part=check],:host([readonly][indeterminate]) [part=check]{color:rgba(169,175,186,.5)}:host([disabled]) [part=container],:host([readonly]) [part=container]{color:rgba(72,72,72,.6);border-color:rgba(169,175,186,.6);background-color:rgba(255,255,255,.6)}@media (
|
|
4
|
+
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-checkbox', styles: ':host{margin:1px 0;vertical-align:middle;display:inline-flex;align-items:center;flex-wrap:nowrap;font-size:inherit;font-weight:inherit;touch-action:manipulation}:host(:focus){outline:0}:host [part=container]{-webkit-appearance:none;-moz-appearance:none;appearance:none;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;border-radius:0;background-color:#fff;transition:box-shadow 150ms,border-color 150ms;box-shadow:inset 0 0 0 rgba(0,0,0,.3);-webkit-user-select:none;-moz-user-select:none;user-select:none;position:relative;border:1px solid #a9afba;height:11px;width:11px}:host [part=check]{display:flex;justify-content:center;align-items:center;box-sizing:border-box;color:var(--check-color,#ee7600);border-width:0 2px 2px 0;width:95%;height:95%}:host [part=label]{cursor:default;margin:0 4px}:host([indeterminate]) [part=check]{border:none;background-color:currentColor;transform:none;border-radius:1px;margin:0;width:5px;height:5px}:host([disabled]) [part=check],:host([readonly]) [part=check]{color:var(--check-color,#acafb5)}:host([disabled]) [part=check]{opacity:.5}:host([disabled][checked]) [part=check]{opacity:.5}:host([disabled]) [part=label]{opacity:.65;color:rgba(72,72,72,.6)}:host([disabled][checked]) [part=check],:host([disabled][indeterminate]) [part=check]{color:#a9afba}:host([readonly][checked]) [part=check],:host([readonly][indeterminate]) [part=check]{color:rgba(169,175,186,.5)}:host([disabled]) [part=container],:host([readonly]) [part=container]{color:rgba(72,72,72,.6);border-color:rgba(169,175,186,.6);background-color:rgba(255,255,255,.6)}@media (pointer:fine){:host(:focus) [part=container]{box-shadow:0 0 0 #ffb266;border:1px dotted #ffb266}}' }}));
|
|
@@ -100,11 +100,11 @@
|
|
|
100
100
|
"events": [
|
|
101
101
|
{
|
|
102
102
|
"name": "value-changed",
|
|
103
|
-
"description": "Fired when
|
|
103
|
+
"description": "Fired when `value` property changes while ticking."
|
|
104
104
|
},
|
|
105
105
|
{
|
|
106
106
|
"name": "offset-changed",
|
|
107
|
-
"description": "Fired when the
|
|
107
|
+
"description": "Fired when the user offsets the clock in `interactive` mode. The event is not triggered if `offset` property is changed programmatically."
|
|
108
108
|
}
|
|
109
109
|
],
|
|
110
110
|
"methods": [
|
|
@@ -24,5 +24,5 @@ Display hours, minutes and seconds as clock interface
|
|
|
24
24
|
|
|
25
25
|
| Event | Description |
|
|
26
26
|
|------------------|--------------------------------------------------|
|
|
27
|
-
| `offset-changed` | Fired when the
|
|
28
|
-
| `value-changed` | Fired when
|
|
27
|
+
| `offset-changed` | Fired when the user offsets the clock in `interactive` mode. The event is not triggered if `offset` property is changed programmatically. |
|
|
28
|
+
| `value-changed` | Fired when `value` property changes while ticking. |
|
package/lib/clock/index.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ import '@refinitiv-ui/phrasebook/locale/en/clock.js';
|
|
|
4
4
|
import { TranslatePromise } from '@refinitiv-ui/translate';
|
|
5
5
|
/**
|
|
6
6
|
* Display hours, minutes and seconds as clock interface
|
|
7
|
-
* @fires value-changed - Fired when
|
|
8
|
-
* @fires offset-changed - Fired when the
|
|
7
|
+
* @fires value-changed - Fired when `value` property changes while ticking.
|
|
8
|
+
* @fires offset-changed - Fired when the user offsets the clock in `interactive` mode. The event is not triggered if `offset` property is changed programmatically.
|
|
9
9
|
*/
|
|
10
10
|
export declare class Clock extends ResponsiveElement {
|
|
11
11
|
/**
|
package/lib/clock/index.js
CHANGED
|
@@ -23,8 +23,8 @@ var Segment;
|
|
|
23
23
|
})(Segment || (Segment = {}));
|
|
24
24
|
/**
|
|
25
25
|
* Display hours, minutes and seconds as clock interface
|
|
26
|
-
* @fires value-changed - Fired when
|
|
27
|
-
* @fires offset-changed - Fired when the
|
|
26
|
+
* @fires value-changed - Fired when `value` property changes while ticking.
|
|
27
|
+
* @fires offset-changed - Fired when the user offsets the clock in `interactive` mode. The event is not triggered if `offset` property is changed programmatically.
|
|
28
28
|
*/
|
|
29
29
|
let Clock = class Clock extends ResponsiveElement {
|
|
30
30
|
constructor() {
|
|
@@ -406,19 +406,15 @@ let Clock = class Clock extends ResponsiveElement {
|
|
|
406
406
|
return;
|
|
407
407
|
}
|
|
408
408
|
switch (event.key) {
|
|
409
|
-
case 'Up': // IE
|
|
410
409
|
case 'ArrowUp':
|
|
411
410
|
this.handleUpKey();
|
|
412
411
|
break;
|
|
413
|
-
case 'Down': // IE
|
|
414
412
|
case 'ArrowDown':
|
|
415
413
|
this.handleDownKey();
|
|
416
414
|
break;
|
|
417
|
-
case 'Left': // IE
|
|
418
415
|
case 'ArrowLeft':
|
|
419
416
|
this.activeSegment = Segment.HOURS;
|
|
420
417
|
break;
|
|
421
|
-
case 'Right': // IE
|
|
422
418
|
case 'ArrowRight':
|
|
423
419
|
this.activeSegment = Segment.MINUTES;
|
|
424
420
|
break;
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"events": [
|
|
64
64
|
{
|
|
65
65
|
"name": "expanded-changed",
|
|
66
|
-
"description": "Fired when the `expanded` property
|
|
66
|
+
"description": "Fired when the user expands or collapses the control. The event is not triggered if `expanded` property is changed programmatically."
|
|
67
67
|
}
|
|
68
68
|
],
|
|
69
69
|
"slots": [
|
|
@@ -15,9 +15,9 @@ for their primary displays.
|
|
|
15
15
|
|
|
16
16
|
## Events
|
|
17
17
|
|
|
18
|
-
| Event | Description
|
|
19
|
-
|
|
20
|
-
| `expanded-changed` | Fired when the `expanded` property
|
|
18
|
+
| Event | Description |
|
|
19
|
+
|--------------------|--------------------------------------------------|
|
|
20
|
+
| `expanded-changed` | Fired when the user expands or collapses the control. The event is not triggered if `expanded` property is changed programmatically. |
|
|
21
21
|
|
|
22
22
|
## Slots
|
|
23
23
|
|
package/lib/collapse/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import '../icon/index.js';
|
|
|
8
8
|
* or areas of the screen, maximizing the amount of real estate
|
|
9
9
|
* for their primary displays.
|
|
10
10
|
*
|
|
11
|
-
* @fires expanded-changed - Fired when the `expanded` property
|
|
11
|
+
* @fires expanded-changed - Fired when the user expands or collapses the control. The event is not triggered if `expanded` property is changed programmatically.
|
|
12
12
|
*
|
|
13
13
|
* @slot header-left - Slot to add custom contents to the left side of header e.g. ef-icon, ef-checkbox
|
|
14
14
|
* @slot header-right - Slot to add custom contents to the right side of header e.g. ef-icon, ef-checkbox
|
|
@@ -100,6 +100,12 @@ export declare class Collapse extends BasicElement {
|
|
|
100
100
|
* @returns clientHeight of the panel so that the panel holder max-height can be set
|
|
101
101
|
*/
|
|
102
102
|
private getContentHeight;
|
|
103
|
+
/**
|
|
104
|
+
* Prevents expanding collapse when interactive element in slot is tapped
|
|
105
|
+
* @param event Tap event
|
|
106
|
+
* @returns {void}
|
|
107
|
+
*/
|
|
108
|
+
private handleSlotTap;
|
|
103
109
|
/**
|
|
104
110
|
* A `TemplateResult` that will be used
|
|
105
111
|
* to render the updated internal template.
|
package/lib/collapse/index.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { BasicElement, css, html } from '@refinitiv-ui/core';
|
|
2
|
+
import { BasicElement, css, nothing, html } from '@refinitiv-ui/core';
|
|
3
3
|
import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
|
|
4
4
|
import { property } from '@refinitiv-ui/core/decorators/property.js';
|
|
5
|
-
import { ifDefined } from '@refinitiv-ui/core/directives/if-defined.js';
|
|
6
5
|
import { state } from '@refinitiv-ui/core/decorators/state.js';
|
|
7
6
|
import { ref, createRef } from '@refinitiv-ui/core/directives/ref.js';
|
|
8
7
|
import { VERSION } from '../version.js';
|
|
@@ -16,7 +15,7 @@ preload('right'); /* preload calendar icons for faster loading */
|
|
|
16
15
|
* or areas of the screen, maximizing the amount of real estate
|
|
17
16
|
* for their primary displays.
|
|
18
17
|
*
|
|
19
|
-
* @fires expanded-changed - Fired when the `expanded` property
|
|
18
|
+
* @fires expanded-changed - Fired when the user expands or collapses the control. The event is not triggered if `expanded` property is changed programmatically.
|
|
20
19
|
*
|
|
21
20
|
* @slot header-left - Slot to add custom contents to the left side of header e.g. ef-icon, ef-checkbox
|
|
22
21
|
* @slot header-right - Slot to add custom contents to the right side of header e.g. ef-icon, ef-checkbox
|
|
@@ -74,20 +73,6 @@ let Collapse = class Collapse extends BasicElement {
|
|
|
74
73
|
:host(:not([expanded])) [part~=content] {
|
|
75
74
|
visibility: hidden;
|
|
76
75
|
}
|
|
77
|
-
[part~=header] {
|
|
78
|
-
position: relative;
|
|
79
|
-
z-index: 0;
|
|
80
|
-
}
|
|
81
|
-
[part~=header-toggle]::before {
|
|
82
|
-
content: '';
|
|
83
|
-
display: block;
|
|
84
|
-
position: absolute;
|
|
85
|
-
top: 0;
|
|
86
|
-
right: 0;
|
|
87
|
-
bottom: 0;
|
|
88
|
-
left: 0;
|
|
89
|
-
z-index: -1;
|
|
90
|
-
}
|
|
91
76
|
[part~=content] {
|
|
92
77
|
overflow: hidden;
|
|
93
78
|
box-sizing: border-box;
|
|
@@ -173,6 +158,14 @@ let Collapse = class Collapse extends BasicElement {
|
|
|
173
158
|
const panelEl = this.panelRef.value;
|
|
174
159
|
return panelEl ? panelEl.clientHeight : 0;
|
|
175
160
|
}
|
|
161
|
+
/**
|
|
162
|
+
* Prevents expanding collapse when interactive element in slot is tapped
|
|
163
|
+
* @param event Tap event
|
|
164
|
+
* @returns {void}
|
|
165
|
+
*/
|
|
166
|
+
handleSlotTap(event) {
|
|
167
|
+
event.stopPropagation();
|
|
168
|
+
}
|
|
176
169
|
/**
|
|
177
170
|
* A `TemplateResult` that will be used
|
|
178
171
|
* to render the updated internal template.
|
|
@@ -180,21 +173,25 @@ let Collapse = class Collapse extends BasicElement {
|
|
|
180
173
|
*/
|
|
181
174
|
render() {
|
|
182
175
|
return html `
|
|
183
|
-
<ef-header
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
176
|
+
<ef-header
|
|
177
|
+
part="header"
|
|
178
|
+
role="heading"
|
|
179
|
+
level=${this.level}
|
|
180
|
+
aria-level=${this.headingLevel ?? nothing}
|
|
181
|
+
@tap=${this.toggle}>
|
|
182
|
+
<div
|
|
183
|
+
id="header-label"
|
|
184
|
+
role="button"
|
|
185
|
+
tabindex="0"
|
|
186
|
+
aria-expanded="${this.expanded}"
|
|
187
|
+
aria-controls="content">
|
|
188
|
+
${this.header}
|
|
189
|
+
</div>
|
|
193
190
|
<ef-icon icon="right" part="toggle" slot="left" aria-hidden="true"></ef-icon>
|
|
194
|
-
<slot name="header-left" slot="left"></slot>
|
|
195
|
-
<slot name="header-right" slot="right"></slot>
|
|
191
|
+
<slot name="header-left" slot="left" @tap=${this.handleSlotTap}></slot>
|
|
192
|
+
<slot name="header-right" slot="right" @tap=${this.handleSlotTap}></slot>
|
|
196
193
|
</ef-header>
|
|
197
|
-
<div ${ref(this.panelHolderRef)} id="content" part="content" role="region" aria-labelledby="header-
|
|
194
|
+
<div ${ref(this.panelHolderRef)} id="content" part="content" role="region" aria-labelledby="header-label">
|
|
198
195
|
<ef-panel ${ref(this.panelRef)} part="content-data" ?spacing="${this.spacing}" transparent>
|
|
199
196
|
<slot></slot>
|
|
200
197
|
</ef-panel>
|