@refinitiv-ui/elements 5.0.0-beta.3 → 5.0.0-dev.204
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +325 -73
- package/README.md +13 -2
- package/lib/accordion/custom-elements.json +0 -13
- package/lib/accordion/custom-elements.md +18 -0
- package/lib/accordion/index.d.ts +13 -10
- package/lib/accordion/index.js +15 -18
- package/lib/appstate-bar/custom-elements.json +1 -1
- package/lib/appstate-bar/custom-elements.md +22 -0
- package/lib/appstate-bar/index.d.ts +15 -6
- package/lib/appstate-bar/index.js +17 -11
- package/lib/autosuggest/custom-elements.json +24 -4
- package/lib/autosuggest/custom-elements.md +54 -0
- package/lib/autosuggest/helpers/types.d.ts +22 -1
- package/lib/autosuggest/helpers/types.js +0 -1
- package/lib/autosuggest/helpers/utils.d.ts +2 -2
- package/lib/autosuggest/helpers/utils.js +1 -3
- package/lib/autosuggest/index.d.ts +21 -9
- package/lib/autosuggest/index.js +45 -31
- package/lib/button/custom-elements.json +3 -3
- package/lib/button/custom-elements.md +23 -0
- package/lib/button/index.d.ts +27 -20
- package/lib/button/index.js +92 -74
- package/lib/button/themes/halo/dark/index.js +1 -1
- package/lib/button/themes/halo/light/index.js +1 -1
- package/lib/button/themes/solar/charcoal/index.js +1 -1
- package/lib/button/themes/solar/pearl/index.js +1 -1
- package/lib/button-bar/custom-elements.md +9 -0
- package/lib/button-bar/index.d.ts +60 -4
- package/lib/button-bar/index.js +164 -19
- package/lib/calendar/constants.d.ts +26 -0
- package/lib/calendar/constants.js +28 -0
- package/lib/calendar/custom-elements.json +8 -6
- package/lib/calendar/custom-elements.md +35 -0
- package/lib/calendar/index.d.ts +119 -21
- package/lib/calendar/index.js +512 -157
- package/lib/calendar/locales.d.ts +1 -31
- package/lib/calendar/locales.js +3 -107
- package/lib/calendar/themes/halo/dark/index.js +1 -1
- package/lib/calendar/themes/halo/light/index.js +1 -1
- package/lib/calendar/themes/solar/charcoal/index.js +1 -1
- package/lib/calendar/themes/solar/pearl/index.js +1 -1
- package/lib/calendar/types.d.ts +12 -13
- package/lib/calendar/types.js +1 -7
- package/lib/calendar/utils.d.ts +31 -1
- package/lib/calendar/utils.js +105 -3
- package/lib/canvas/custom-elements.json +9 -7
- package/lib/canvas/custom-elements.md +27 -0
- package/lib/canvas/index.d.ts +14 -6
- package/lib/canvas/index.js +17 -12
- package/lib/card/custom-elements.json +21 -9
- package/lib/card/custom-elements.md +24 -0
- package/lib/card/helpers/types.d.ts +1 -1
- package/lib/card/helpers/types.js +0 -1
- package/lib/card/index.d.ts +67 -20
- package/lib/card/index.js +132 -35
- package/lib/card/themes/halo/dark/index.js +1 -1
- package/lib/card/themes/halo/light/index.js +1 -1
- package/lib/card/themes/solar/charcoal/index.js +1 -1
- package/lib/card/themes/solar/pearl/index.js +1 -1
- package/lib/chart/custom-elements.json +3 -3
- package/lib/chart/custom-elements.md +16 -0
- package/lib/chart/helpers/index.d.ts +2 -0
- package/lib/chart/helpers/index.js +2 -0
- package/lib/chart/helpers/legend.d.ts +2 -2
- package/lib/chart/helpers/legend.js +2 -3
- package/lib/chart/helpers/merge.d.ts +15 -0
- package/lib/chart/helpers/merge.js +28 -0
- package/lib/chart/helpers/types.d.ts +40 -12
- package/lib/chart/helpers/types.js +0 -1
- package/lib/chart/index.d.ts +34 -26
- package/lib/chart/index.js +58 -55
- package/lib/chart/plugins/doughnut-center-label.js +4 -5
- package/lib/checkbox/custom-elements.json +4 -4
- package/lib/checkbox/custom-elements.md +18 -0
- package/lib/checkbox/index.d.ts +29 -14
- package/lib/checkbox/index.js +65 -34
- package/lib/checkbox/themes/halo/dark/index.js +1 -1
- package/lib/checkbox/themes/halo/light/index.js +1 -1
- package/lib/clock/custom-elements.json +21 -4
- package/lib/clock/custom-elements.md +28 -0
- package/lib/clock/index.d.ts +25 -6
- package/lib/clock/index.js +44 -18
- package/lib/clock/themes/halo/dark/index.js +1 -1
- package/lib/clock/themes/halo/light/index.js +1 -1
- package/lib/clock/themes/solar/charcoal/index.js +1 -1
- package/lib/clock/themes/solar/pearl/index.js +1 -1
- package/lib/clock/utils/TickManager.js +2 -3
- package/lib/clock/utils/timestamps.js +0 -1
- package/lib/collapse/custom-elements.md +27 -0
- package/lib/collapse/index.d.ts +15 -8
- package/lib/collapse/index.js +18 -13
- package/lib/color-dialog/custom-elements.json +29 -16
- package/lib/color-dialog/custom-elements.md +39 -0
- package/lib/color-dialog/elements/color-palettes.d.ts +13 -6
- package/lib/color-dialog/elements/color-palettes.js +16 -13
- package/lib/color-dialog/elements/grayscale-palettes.d.ts +13 -6
- package/lib/color-dialog/elements/grayscale-palettes.js +17 -13
- package/lib/color-dialog/elements/palettes.d.ts +15 -3
- package/lib/color-dialog/elements/palettes.js +65 -45
- package/lib/color-dialog/helpers/color-helpers.d.ts +7 -53
- package/lib/color-dialog/helpers/color-helpers.js +12 -110
- package/lib/color-dialog/helpers/value-model.d.ts +1 -1
- package/lib/color-dialog/helpers/value-model.js +18 -17
- package/lib/color-dialog/index.d.ts +27 -20
- package/lib/color-dialog/index.js +54 -45
- package/lib/combo-box/custom-elements.json +51 -17
- package/lib/combo-box/custom-elements.md +42 -0
- package/lib/combo-box/helpers/filter.d.ts +4 -4
- package/lib/combo-box/helpers/filter.js +0 -1
- package/lib/combo-box/helpers/keyboard-event.js +0 -1
- package/lib/combo-box/helpers/renderer.d.ts +8 -0
- package/lib/combo-box/helpers/renderer.js +24 -0
- package/lib/combo-box/helpers/types.d.ts +2 -2
- package/lib/combo-box/helpers/types.js +0 -1
- package/lib/combo-box/index.d.ts +63 -32
- package/lib/combo-box/index.js +102 -60
- package/lib/combo-box/themes/halo/dark/index.js +2 -3
- package/lib/combo-box/themes/halo/light/index.js +2 -3
- package/lib/combo-box/themes/solar/charcoal/index.js +2 -3
- package/lib/combo-box/themes/solar/pearl/index.js +2 -3
- package/lib/counter/custom-elements.json +39 -0
- package/lib/counter/custom-elements.md +11 -0
- package/lib/counter/index.d.ts +91 -0
- package/lib/counter/index.js +154 -0
- package/lib/counter/themes/halo/dark/index.js +3 -0
- package/lib/counter/themes/halo/light/index.js +3 -0
- package/lib/counter/themes/solar/charcoal/index.js +3 -0
- package/lib/counter/themes/solar/pearl/index.js +3 -0
- package/lib/counter/utils.d.ts +13 -0
- package/lib/counter/utils.js +52 -0
- package/lib/datetime-picker/custom-elements.json +53 -24
- package/lib/datetime-picker/custom-elements.md +57 -0
- package/lib/datetime-picker/index.d.ts +34 -16
- package/lib/datetime-picker/index.js +56 -38
- package/lib/datetime-picker/locales.d.ts +1 -1
- package/lib/datetime-picker/locales.js +12 -2
- package/lib/datetime-picker/themes/solar/charcoal/index.js +1 -1
- package/lib/datetime-picker/themes/solar/pearl/index.js +1 -1
- package/lib/datetime-picker/types.d.ts +1 -1
- package/lib/datetime-picker/types.js +0 -1
- package/lib/datetime-picker/utils.js +1 -2
- package/lib/dialog/custom-elements.json +34 -12
- package/lib/dialog/custom-elements.md +47 -0
- package/lib/dialog/draggable-element.js +25 -16
- package/lib/dialog/index.d.ts +25 -21
- package/lib/dialog/index.js +36 -32
- package/lib/email-field/custom-elements.json +81 -94
- package/lib/email-field/custom-elements.md +37 -0
- package/lib/email-field/index.d.ts +47 -112
- package/lib/email-field/index.js +48 -241
- package/lib/email-field/themes/halo/dark/index.js +1 -1
- package/lib/email-field/themes/halo/light/index.js +1 -1
- package/lib/email-field/themes/solar/charcoal/index.js +1 -1
- package/lib/email-field/themes/solar/pearl/index.js +1 -1
- package/lib/events.d.ts +121 -0
- package/lib/events.js +1 -0
- package/lib/flag/custom-elements.md +10 -0
- package/lib/flag/index.d.ts +14 -5
- package/lib/flag/index.js +19 -12
- package/lib/flag/utils/FlagLoader.d.ts +1 -1
- package/lib/flag/utils/FlagLoader.js +1 -2
- package/lib/header/custom-elements.md +18 -0
- package/lib/header/index.d.ts +10 -3
- package/lib/header/index.js +12 -8
- package/lib/heatmap/custom-elements.json +13 -0
- package/lib/heatmap/custom-elements.md +26 -0
- package/lib/heatmap/helpers/color.d.ts +1 -1
- package/lib/heatmap/helpers/color.js +1 -2
- package/lib/heatmap/helpers/text.d.ts +1 -1
- package/lib/heatmap/helpers/text.js +0 -1
- package/lib/heatmap/helpers/track.js +2 -3
- package/lib/heatmap/helpers/types.js +0 -1
- package/lib/heatmap/index.d.ts +32 -13
- package/lib/heatmap/index.js +61 -35
- package/lib/icon/custom-elements.json +6 -4
- package/lib/icon/custom-elements.md +8 -0
- package/lib/icon/index.d.ts +17 -7
- package/lib/icon/index.js +36 -18
- package/lib/icon/utils/IconLoader.d.ts +6 -1
- package/lib/icon/utils/IconLoader.js +24 -18
- package/lib/index.d.ts +2 -0
- package/lib/index.js +2 -1
- package/lib/interactive-chart/custom-elements.json +5 -11
- package/lib/interactive-chart/custom-elements.md +31 -0
- package/lib/interactive-chart/helpers/merge.d.ts +15 -0
- package/lib/interactive-chart/helpers/merge.js +28 -0
- package/lib/interactive-chart/helpers/types.d.ts +10 -9
- package/lib/interactive-chart/helpers/types.js +6 -2
- package/lib/interactive-chart/index.d.ts +37 -18
- package/lib/interactive-chart/index.js +61 -51
- package/lib/item/custom-elements.json +4 -4
- package/lib/item/custom-elements.md +29 -0
- package/lib/item/helpers/types.d.ts +1 -1
- package/lib/item/helpers/types.js +0 -1
- package/lib/item/index.d.ts +26 -9
- package/lib/item/index.js +43 -16
- package/lib/label/custom-elements.json +7 -16
- package/lib/label/custom-elements.md +11 -0
- package/lib/label/index.d.ts +41 -73
- package/lib/label/index.js +150 -187
- package/lib/layout/custom-elements.md +26 -0
- package/lib/layout/index.d.ts +11 -4
- package/lib/layout/index.js +13 -9
- package/lib/led-gauge/custom-elements.json +4 -4
- package/lib/led-gauge/custom-elements.md +17 -0
- package/lib/led-gauge/index.d.ts +13 -5
- package/lib/led-gauge/index.js +16 -11
- package/lib/list/custom-elements.json +37 -5
- package/lib/list/custom-elements.md +33 -0
- package/lib/list/extensible-function.js +2 -1
- package/lib/list/helpers/list-renderer.d.ts +2 -2
- package/lib/list/helpers/list-renderer.js +4 -3
- package/lib/list/helpers/types.d.ts +2 -2
- package/lib/list/helpers/types.js +0 -1
- package/lib/list/index.d.ts +47 -12
- package/lib/list/index.js +100 -39
- package/lib/list/renderer.d.ts +2 -2
- package/lib/list/renderer.js +1 -2
- package/lib/loader/custom-elements.md +5 -0
- package/lib/loader/index.d.ts +8 -1
- package/lib/loader/index.js +11 -8
- package/lib/multi-input/custom-elements.json +7 -6
- package/lib/multi-input/custom-elements.md +43 -0
- package/lib/multi-input/helpers/types.d.ts +1 -1
- package/lib/multi-input/helpers/types.js +0 -1
- package/lib/multi-input/index.d.ts +19 -8
- package/lib/multi-input/index.js +28 -18
- package/lib/multi-input/themes/solar/charcoal/index.js +1 -1
- package/lib/multi-input/themes/solar/pearl/index.js +1 -1
- package/lib/notification/custom-elements.md +26 -0
- package/lib/notification/elements/notification-tray.d.ts +10 -4
- package/lib/notification/elements/notification-tray.js +15 -11
- package/lib/notification/elements/notification.d.ts +19 -7
- package/lib/notification/elements/notification.js +25 -13
- package/lib/notification/helpers/status.d.ts +1 -1
- package/lib/notification/helpers/status.js +1 -2
- package/lib/notification/helpers/types.d.ts +1 -1
- package/lib/notification/helpers/types.js +0 -1
- package/lib/notification/index.d.ts +2 -2
- package/lib/notification/index.js +2 -3
- package/lib/number-field/custom-elements.json +99 -54
- package/lib/number-field/custom-elements.md +42 -0
- package/lib/number-field/index.d.ts +104 -52
- package/lib/number-field/index.js +129 -88
- package/lib/number-field/themes/halo/dark/index.js +1 -1
- package/lib/number-field/themes/halo/light/index.js +1 -1
- package/lib/number-field/themes/solar/charcoal/index.js +1 -1
- package/lib/number-field/themes/solar/pearl/index.js +1 -1
- package/lib/overlay/custom-elements.json +26 -13
- package/lib/overlay/custom-elements.md +54 -0
- package/lib/overlay/elements/overlay-backdrop.d.ts +12 -5
- package/lib/overlay/elements/overlay-backdrop.js +13 -9
- package/lib/overlay/elements/overlay-viewport.d.ts +11 -4
- package/lib/overlay/elements/overlay-viewport.js +12 -9
- package/lib/overlay/elements/overlay.d.ts +18 -6
- package/lib/overlay/elements/overlay.js +35 -28
- package/lib/overlay/helpers/functions.js +0 -1
- package/lib/overlay/helpers/types.js +0 -1
- package/lib/overlay/index.d.ts +2 -2
- package/lib/overlay/index.js +1 -2
- package/lib/overlay/managers/backdrop-manager.d.ts +2 -2
- package/lib/overlay/managers/backdrop-manager.js +2 -3
- package/lib/overlay/managers/close-manager.d.ts +1 -1
- package/lib/overlay/managers/close-manager.js +1 -2
- package/lib/overlay/managers/focus-manager.d.ts +1 -1
- package/lib/overlay/managers/focus-manager.js +3 -5
- package/lib/overlay/managers/interaction-lock-manager.js +2 -3
- package/lib/overlay/managers/viewport-manager.d.ts +3 -3
- package/lib/overlay/managers/viewport-manager.js +6 -3
- package/lib/overlay/managers/zindex-manager.d.ts +1 -1
- package/lib/overlay/managers/zindex-manager.js +1 -4
- package/lib/overlay-menu/custom-elements.json +126 -12
- package/lib/overlay-menu/custom-elements.md +44 -0
- package/lib/overlay-menu/helpers/types.d.ts +3 -3
- package/lib/overlay-menu/helpers/types.js +0 -1
- package/lib/overlay-menu/index.d.ts +44 -12
- package/lib/overlay-menu/index.js +66 -35
- package/lib/overlay-menu/managers/menu-manager.d.ts +2 -2
- package/lib/overlay-menu/managers/menu-manager.js +8 -8
- package/lib/pagination/custom-elements.json +16 -33
- package/lib/pagination/custom-elements.md +26 -0
- package/lib/pagination/index.d.ts +156 -81
- package/lib/pagination/index.js +373 -214
- package/lib/pagination/themes/halo/dark/index.js +1 -1
- package/lib/pagination/themes/halo/light/index.js +1 -1
- package/lib/pagination/themes/solar/charcoal/index.js +1 -1
- package/lib/pagination/themes/solar/pearl/index.js +1 -1
- package/lib/panel/custom-elements.md +11 -0
- package/lib/panel/index.d.ts +11 -4
- package/lib/panel/index.js +13 -9
- package/lib/password-field/custom-elements.json +62 -67
- package/lib/password-field/custom-elements.md +39 -0
- package/lib/password-field/index.d.ts +46 -90
- package/lib/password-field/index.js +52 -190
- package/lib/password-field/themes/halo/dark/index.js +1 -1
- package/lib/password-field/themes/halo/light/index.js +1 -1
- package/lib/password-field/themes/solar/charcoal/index.js +1 -1
- package/lib/password-field/themes/solar/pearl/index.js +1 -1
- package/lib/pill/custom-elements.json +9 -7
- package/lib/pill/custom-elements.md +22 -0
- package/lib/pill/index.d.ts +15 -7
- package/lib/pill/index.js +21 -27
- package/lib/pill/themes/halo/dark/index.js +1 -1
- package/lib/pill/themes/halo/light/index.js +1 -1
- package/lib/progress-bar/custom-elements.md +18 -0
- package/lib/progress-bar/index.d.ts +11 -15
- package/lib/progress-bar/index.js +14 -25
- package/lib/radio-button/custom-elements.json +4 -4
- package/lib/radio-button/custom-elements.md +19 -0
- package/lib/radio-button/index.d.ts +33 -9
- package/lib/radio-button/index.js +97 -24
- package/lib/radio-button/radio-button-registry.d.ts +3 -2
- package/lib/radio-button/radio-button-registry.js +57 -5
- package/lib/radio-button/themes/halo/dark/index.js +1 -1
- package/lib/radio-button/themes/halo/light/index.js +1 -1
- package/lib/rating/custom-elements.md +17 -0
- package/lib/rating/index.d.ts +11 -4
- package/lib/rating/index.js +16 -10
- package/lib/search-field/custom-elements.json +70 -74
- package/lib/search-field/custom-elements.md +41 -0
- package/lib/search-field/index.d.ts +47 -97
- package/lib/search-field/index.js +50 -212
- package/lib/search-field/themes/halo/dark/index.js +1 -1
- package/lib/search-field/themes/halo/light/index.js +1 -1
- package/lib/search-field/themes/solar/charcoal/index.js +1 -1
- package/lib/search-field/themes/solar/pearl/index.js +1 -1
- package/lib/select/custom-elements.json +5 -4
- package/lib/select/custom-elements.md +24 -0
- package/lib/select/helpers/types.d.ts +1 -1
- package/lib/select/helpers/types.js +0 -1
- package/lib/select/index.d.ts +26 -11
- package/lib/select/index.js +93 -52
- package/lib/select/themes/halo/dark/index.js +1 -1
- package/lib/select/themes/halo/light/index.js +1 -1
- package/lib/sidebar-layout/custom-elements.json +2 -6
- package/lib/sidebar-layout/custom-elements.md +21 -0
- package/lib/sidebar-layout/index.d.ts +15 -7
- package/lib/sidebar-layout/index.js +16 -10
- package/lib/slider/custom-elements.json +4 -4
- package/lib/slider/custom-elements.md +28 -0
- package/lib/slider/index.d.ts +18 -5
- package/lib/slider/index.js +69 -16
- package/lib/sparkline/custom-elements.json +4 -4
- package/lib/sparkline/custom-elements.md +16 -0
- package/lib/sparkline/index.d.ts +14 -5
- package/lib/sparkline/index.js +17 -10
- package/lib/swing-gauge/const.d.ts +22 -0
- package/lib/swing-gauge/const.js +26 -0
- package/lib/swing-gauge/custom-elements.json +51 -22
- package/lib/swing-gauge/custom-elements.md +17 -0
- package/lib/swing-gauge/helpers.d.ts +8 -0
- package/lib/swing-gauge/helpers.js +105 -0
- package/lib/swing-gauge/index.d.ts +220 -72
- package/lib/swing-gauge/index.js +648 -168
- package/lib/swing-gauge/themes/halo/dark/index.js +1 -1
- package/lib/swing-gauge/themes/halo/light/index.js +1 -1
- package/lib/swing-gauge/themes/solar/charcoal/index.js +1 -1
- package/lib/swing-gauge/themes/solar/pearl/index.js +1 -1
- package/lib/swing-gauge/types.d.ts +34 -0
- package/lib/swing-gauge/types.js +1 -0
- package/lib/tab/custom-elements.json +10 -21
- package/lib/tab/custom-elements.md +22 -0
- package/lib/tab/index.d.ts +19 -14
- package/lib/tab/index.js +31 -40
- package/lib/tab/themes/halo/dark/index.js +1 -1
- package/lib/tab/themes/halo/light/index.js +1 -1
- package/lib/tab/themes/solar/charcoal/index.js +1 -1
- package/lib/tab/themes/solar/pearl/index.js +1 -1
- package/lib/tab-bar/custom-elements.json +0 -6
- package/lib/tab-bar/custom-elements.md +11 -0
- package/lib/tab-bar/helpers/animate.d.ts +1 -1
- package/lib/tab-bar/helpers/animate.js +5 -2
- package/lib/tab-bar/index.d.ts +12 -5
- package/lib/tab-bar/index.js +18 -21
- package/lib/tab-bar/themes/solar/charcoal/index.js +1 -1
- package/lib/tab-bar/themes/solar/pearl/index.js +1 -1
- package/lib/text-field/custom-elements.json +78 -89
- package/lib/text-field/custom-elements.md +35 -0
- package/lib/text-field/index.d.ts +67 -80
- package/lib/text-field/index.js +106 -157
- package/lib/text-field/themes/halo/dark/index.js +1 -1
- package/lib/text-field/themes/halo/light/index.js +1 -1
- package/lib/text-field/themes/solar/charcoal/index.js +1 -1
- package/lib/text-field/themes/solar/pearl/index.js +1 -1
- package/lib/time-picker/custom-elements.json +6 -8
- package/lib/time-picker/custom-elements.md +28 -0
- package/lib/time-picker/index.d.ts +105 -65
- package/lib/time-picker/index.js +297 -169
- package/lib/time-picker/themes/solar/charcoal/index.js +1 -1
- package/lib/time-picker/themes/solar/pearl/index.js +1 -1
- package/lib/toggle/custom-elements.json +4 -4
- package/lib/toggle/custom-elements.md +19 -0
- package/lib/toggle/index.d.ts +22 -5
- package/lib/toggle/index.js +58 -13
- package/lib/toggle/themes/halo/dark/index.js +1 -1
- package/lib/toggle/themes/halo/light/index.js +1 -1
- package/lib/toggle/themes/solar/charcoal/index.js +1 -1
- package/lib/toggle/themes/solar/pearl/index.js +1 -1
- package/lib/tooltip/custom-elements.md +14 -0
- package/lib/tooltip/elements/title-tooltip.js +2 -3
- package/lib/tooltip/elements/tooltip-element.d.ts +2 -3
- package/lib/tooltip/elements/tooltip-element.js +0 -2
- package/lib/tooltip/helpers/overflow-tooltip.d.ts +1 -1
- package/lib/tooltip/helpers/overflow-tooltip.js +1 -2
- package/lib/tooltip/helpers/renderer.d.ts +1 -1
- package/lib/tooltip/helpers/renderer.js +0 -1
- package/lib/tooltip/helpers/types.d.ts +1 -1
- package/lib/tooltip/helpers/types.js +0 -1
- package/lib/tooltip/index.d.ts +18 -11
- package/lib/tooltip/index.js +27 -23
- package/lib/tooltip/managers/tooltip-manager.d.ts +2 -2
- package/lib/tooltip/managers/tooltip-manager.js +17 -11
- package/lib/tornado-chart/custom-elements.md +18 -0
- package/lib/tornado-chart/elements/tornado-chart.d.ts +12 -5
- package/lib/tornado-chart/elements/tornado-chart.js +15 -11
- package/lib/tornado-chart/elements/tornado-item.d.ts +13 -6
- package/lib/tornado-chart/elements/tornado-item.js +17 -12
- package/lib/tornado-chart/index.d.ts +2 -2
- package/lib/tornado-chart/index.js +2 -3
- package/lib/tree/custom-elements.json +30 -2
- package/lib/tree/custom-elements.md +32 -0
- package/lib/tree/elements/tree-item.d.ts +53 -5
- package/lib/tree/elements/tree-item.js +114 -34
- package/lib/tree/elements/tree.d.ts +65 -20
- package/lib/tree/elements/tree.js +151 -34
- package/lib/tree/helpers/filter.d.ts +8 -0
- package/lib/tree/helpers/filter.js +33 -0
- package/lib/tree/helpers/renderer.d.ts +2 -2
- package/lib/tree/helpers/renderer.js +4 -4
- package/lib/tree/helpers/types.d.ts +13 -1
- package/lib/tree/helpers/types.js +0 -1
- package/lib/tree/index.d.ts +4 -4
- package/lib/tree/index.js +3 -4
- package/lib/tree/managers/tree-manager.d.ts +22 -10
- package/lib/tree/managers/tree-manager.js +56 -41
- package/lib/tree/themes/halo/dark/index.js +1 -1
- package/lib/tree/themes/halo/light/index.js +1 -1
- package/lib/tree/themes/solar/charcoal/index.js +1 -1
- package/lib/tree/themes/solar/pearl/index.js +1 -1
- package/lib/tree-select/custom-elements.json +14 -5
- package/lib/tree-select/custom-elements.md +26 -0
- package/lib/tree-select/helpers/types.d.ts +2 -2
- package/lib/tree-select/helpers/types.js +0 -1
- package/lib/tree-select/index.d.ts +55 -27
- package/lib/tree-select/index.js +107 -45
- package/lib/tree-select/themes/halo/dark/index.js +3 -2
- package/lib/tree-select/themes/halo/light/index.js +3 -2
- package/lib/tree-select/themes/solar/charcoal/index.js +3 -2
- package/lib/tree-select/themes/solar/pearl/index.js +3 -2
- package/lib/version.d.ts +1 -0
- package/lib/version.js +1 -0
- package/package.json +601 -25
- package/lib/accordion/index.js.map +0 -1
- package/lib/appstate-bar/index.js.map +0 -1
- package/lib/autosuggest/helpers/const.d.ts +0 -2
- package/lib/autosuggest/helpers/const.js +0 -4
- package/lib/autosuggest/helpers/const.js.map +0 -1
- package/lib/autosuggest/helpers/types.js.map +0 -1
- package/lib/autosuggest/helpers/utils.js.map +0 -1
- package/lib/autosuggest/index.js.map +0 -1
- package/lib/button/index.js.map +0 -1
- package/lib/button-bar/index.js.map +0 -1
- package/lib/calendar/index.js.map +0 -1
- package/lib/calendar/locales.js.map +0 -1
- package/lib/calendar/types.js.map +0 -1
- package/lib/calendar/utils.js.map +0 -1
- package/lib/canvas/index.js.map +0 -1
- package/lib/card/helpers/types.js.map +0 -1
- package/lib/card/index.js.map +0 -1
- package/lib/chart/helpers/legend.js.map +0 -1
- package/lib/chart/helpers/types.js.map +0 -1
- package/lib/chart/index.js.map +0 -1
- package/lib/chart/plugins/doughnut-center-label.js.map +0 -1
- package/lib/checkbox/index.js.map +0 -1
- package/lib/clock/index.js.map +0 -1
- package/lib/clock/utils/TickManager.js.map +0 -1
- package/lib/clock/utils/timestamps.js.map +0 -1
- package/lib/collapse/index.js.map +0 -1
- package/lib/color-dialog/elements/color-palettes.js.map +0 -1
- package/lib/color-dialog/elements/grayscale-palettes.js.map +0 -1
- package/lib/color-dialog/elements/palettes.js.map +0 -1
- package/lib/color-dialog/helpers/color-helpers.js.map +0 -1
- package/lib/color-dialog/helpers/value-model.js.map +0 -1
- package/lib/color-dialog/index.js.map +0 -1
- package/lib/combo-box/helpers/filter.js.map +0 -1
- package/lib/combo-box/helpers/keyboard-event.js.map +0 -1
- package/lib/combo-box/helpers/types.js.map +0 -1
- package/lib/combo-box/index.js.map +0 -1
- package/lib/datetime-picker/index.js.map +0 -1
- package/lib/datetime-picker/locales.js.map +0 -1
- package/lib/datetime-picker/types.js.map +0 -1
- package/lib/datetime-picker/utils.js.map +0 -1
- package/lib/dialog/draggable-element.js.map +0 -1
- package/lib/dialog/index.js.map +0 -1
- package/lib/email-field/index.js.map +0 -1
- package/lib/flag/index.js.map +0 -1
- package/lib/flag/utils/FlagLoader.js.map +0 -1
- package/lib/header/index.js.map +0 -1
- package/lib/heatmap/helpers/color.js.map +0 -1
- package/lib/heatmap/helpers/text.js.map +0 -1
- package/lib/heatmap/helpers/track.js.map +0 -1
- package/lib/heatmap/helpers/types.js.map +0 -1
- package/lib/heatmap/index.js.map +0 -1
- package/lib/icon/index.js.map +0 -1
- package/lib/icon/utils/IconLoader.js.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/interactive-chart/helpers/types.js.map +0 -1
- package/lib/interactive-chart/index.js.map +0 -1
- package/lib/item/helpers/types.js.map +0 -1
- package/lib/item/index.js.map +0 -1
- package/lib/label/helpers/text.d.ts +0 -35
- package/lib/label/helpers/text.js +0 -57
- package/lib/label/helpers/text.js.map +0 -1
- package/lib/label/index.js.map +0 -1
- package/lib/layout/index.js.map +0 -1
- package/lib/led-gauge/index.js.map +0 -1
- package/lib/list/extensible-function.js.map +0 -1
- package/lib/list/helpers/list-renderer.js.map +0 -1
- package/lib/list/helpers/types.js.map +0 -1
- package/lib/list/index.js.map +0 -1
- package/lib/list/renderer.js.map +0 -1
- package/lib/loader/index.js.map +0 -1
- package/lib/multi-input/helpers/types.js.map +0 -1
- package/lib/multi-input/index.js.map +0 -1
- package/lib/notification/elements/notification-tray.js.map +0 -1
- package/lib/notification/elements/notification.js.map +0 -1
- package/lib/notification/helpers/status.js.map +0 -1
- package/lib/notification/helpers/types.js.map +0 -1
- package/lib/notification/index.js.map +0 -1
- package/lib/number-field/index.js.map +0 -1
- package/lib/overlay/elements/overlay-backdrop.js.map +0 -1
- package/lib/overlay/elements/overlay-viewport.js.map +0 -1
- package/lib/overlay/elements/overlay.js.map +0 -1
- package/lib/overlay/helpers/functions.js.map +0 -1
- package/lib/overlay/helpers/types.js.map +0 -1
- package/lib/overlay/index.js.map +0 -1
- package/lib/overlay/managers/backdrop-manager.js.map +0 -1
- package/lib/overlay/managers/close-manager.js.map +0 -1
- package/lib/overlay/managers/focus-manager.js.map +0 -1
- package/lib/overlay/managers/interaction-lock-manager.js.map +0 -1
- package/lib/overlay/managers/viewport-manager.js.map +0 -1
- package/lib/overlay/managers/zindex-manager.js.map +0 -1
- package/lib/overlay-menu/helpers/types.js.map +0 -1
- package/lib/overlay-menu/helpers/uuid.d.ts +0 -7
- package/lib/overlay-menu/helpers/uuid.js +0 -14
- package/lib/overlay-menu/helpers/uuid.js.map +0 -1
- package/lib/overlay-menu/index.js.map +0 -1
- package/lib/overlay-menu/managers/menu-manager.js.map +0 -1
- package/lib/pagination/helpers/types.d.ts +0 -9
- package/lib/pagination/helpers/types.js +0 -2
- package/lib/pagination/helpers/types.js.map +0 -1
- package/lib/pagination/index.js.map +0 -1
- package/lib/panel/index.js.map +0 -1
- package/lib/password-field/index.js.map +0 -1
- package/lib/pill/index.js.map +0 -1
- package/lib/progress-bar/index.js.map +0 -1
- package/lib/radio-button/index.js.map +0 -1
- package/lib/radio-button/radio-button-registry.js.map +0 -1
- package/lib/rating/index.js.map +0 -1
- package/lib/search-field/index.js.map +0 -1
- package/lib/select/helpers/types.js.map +0 -1
- package/lib/select/index.js.map +0 -1
- package/lib/sidebar-layout/index.js.map +0 -1
- package/lib/slider/index.js.map +0 -1
- package/lib/sparkline/index.js.map +0 -1
- package/lib/swing-gauge/helpers/canvas.d.ts +0 -8
- package/lib/swing-gauge/helpers/canvas.js +0 -115
- package/lib/swing-gauge/helpers/canvas.js.map +0 -1
- package/lib/swing-gauge/helpers/types.d.ts +0 -33
- package/lib/swing-gauge/helpers/types.js +0 -2
- package/lib/swing-gauge/helpers/types.js.map +0 -1
- package/lib/swing-gauge/index.js.map +0 -1
- package/lib/tab/index.js.map +0 -1
- package/lib/tab-bar/helpers/animate.js.map +0 -1
- package/lib/tab-bar/index.js.map +0 -1
- package/lib/text-field/index.js.map +0 -1
- package/lib/time-picker/index.js.map +0 -1
- package/lib/toggle/index.js.map +0 -1
- package/lib/tooltip/elements/title-tooltip.js.map +0 -1
- package/lib/tooltip/elements/tooltip-element.js.map +0 -1
- package/lib/tooltip/helpers/overflow-tooltip.js.map +0 -1
- package/lib/tooltip/helpers/renderer.js.map +0 -1
- package/lib/tooltip/helpers/types.js.map +0 -1
- package/lib/tooltip/index.js.map +0 -1
- package/lib/tooltip/managers/tooltip-manager.js.map +0 -1
- package/lib/tornado-chart/elements/tornado-chart.js.map +0 -1
- package/lib/tornado-chart/elements/tornado-item.js.map +0 -1
- package/lib/tornado-chart/index.js.map +0 -1
- package/lib/tree/elements/tree-item.js.map +0 -1
- package/lib/tree/elements/tree.js.map +0 -1
- package/lib/tree/helpers/renderer.js.map +0 -1
- package/lib/tree/helpers/types.js.map +0 -1
- package/lib/tree/index.js.map +0 -1
- package/lib/tree/managers/tree-manager.js.map +0 -1
- package/lib/tree-select/helpers/types.js.map +0 -1
- package/lib/tree-select/index.js.map +0 -1
package/lib/label/index.d.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { JSXInterface } from '../jsx';
|
|
2
|
-
import {
|
|
3
|
-
import '../tooltip';
|
|
2
|
+
import { BasicElement, TemplateResult, CSSResultGroup } from '@refinitiv-ui/core';
|
|
4
3
|
/**
|
|
5
4
|
* Displays a text with alternative truncation
|
|
6
5
|
*/
|
|
7
|
-
export declare class Label extends
|
|
6
|
+
export declare class Label extends BasicElement {
|
|
8
7
|
/**
|
|
9
|
-
*
|
|
8
|
+
* Element version number
|
|
9
|
+
* @returns version number
|
|
10
|
+
*/
|
|
11
|
+
static get version(): string;
|
|
12
|
+
/**
|
|
13
|
+
* A `CSSResultGroup` that will be used
|
|
10
14
|
* to style the host, slotted children
|
|
11
15
|
* and the internal template of the element.
|
|
12
16
|
* @returns CSS template
|
|
13
17
|
*/
|
|
14
|
-
static get styles():
|
|
15
|
-
/**
|
|
16
|
-
* Enable shortening the slot content
|
|
17
|
-
*/
|
|
18
|
-
truncate: 'center' | '' | null | undefined;
|
|
18
|
+
static get styles(): CSSResultGroup;
|
|
19
19
|
/**
|
|
20
20
|
* Limit the number of lines before truncating
|
|
21
21
|
*/
|
|
22
|
-
|
|
22
|
+
lineClamp: number;
|
|
23
23
|
/**
|
|
24
24
|
* Set state to error
|
|
25
25
|
*/
|
|
@@ -29,90 +29,56 @@ export declare class Label extends ResponsiveElement {
|
|
|
29
29
|
*/
|
|
30
30
|
warning: boolean;
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
33
|
-
*/
|
|
34
|
-
private span;
|
|
35
|
-
/**
|
|
36
|
-
* Use to prevent resizes observer in certain use cases
|
|
32
|
+
* Trimmed chunks of textual content
|
|
37
33
|
*/
|
|
38
|
-
private
|
|
34
|
+
private chunks;
|
|
39
35
|
/**
|
|
40
|
-
*
|
|
36
|
+
* Mutation Observer used to detect changes in the Light DOM
|
|
41
37
|
*/
|
|
42
|
-
private
|
|
38
|
+
private mutationObserver;
|
|
43
39
|
/**
|
|
44
|
-
*
|
|
40
|
+
* Render used to display the tooltip
|
|
41
|
+
* @returns Tooltip text
|
|
45
42
|
*/
|
|
46
|
-
|
|
47
|
-
private mutationObserver?;
|
|
43
|
+
protected tooltipRenderer: () => string;
|
|
48
44
|
/**
|
|
49
|
-
*
|
|
50
|
-
* @param
|
|
51
|
-
* @returns
|
|
45
|
+
* Condition used to display the tooltip
|
|
46
|
+
* @param target Tooltip target
|
|
47
|
+
* @returns Whether the tooltip should be shown or not.
|
|
52
48
|
*/
|
|
53
|
-
protected
|
|
49
|
+
protected tooltipCondition: (target: HTMLElement) => boolean;
|
|
54
50
|
/**
|
|
55
|
-
*
|
|
56
|
-
* @param changedProperties Properties that has changed
|
|
57
|
-
* @returns shouldUpdate
|
|
51
|
+
* @override
|
|
58
52
|
*/
|
|
59
|
-
|
|
53
|
+
connectedCallback(): void;
|
|
60
54
|
/**
|
|
61
|
-
*
|
|
55
|
+
* @override
|
|
62
56
|
*/
|
|
63
|
-
|
|
57
|
+
disconnectedCallback(): void;
|
|
64
58
|
/**
|
|
65
|
-
*
|
|
66
|
-
* @
|
|
59
|
+
* Decides whether the tooltip should b shown
|
|
60
|
+
* @param tooltipTarget Target element passed by the tooltip condition
|
|
61
|
+
* @returns True if the tooltip should be shown
|
|
67
62
|
*/
|
|
68
|
-
|
|
63
|
+
protected shouldShowTooltip(tooltipTarget: HTMLElement): boolean;
|
|
69
64
|
/**
|
|
70
|
-
*
|
|
65
|
+
* Handles any modifications to the internal HTML
|
|
66
|
+
* @param [mutation=false] is the request from a mutation event?
|
|
71
67
|
* @returns {void}
|
|
72
68
|
*/
|
|
73
|
-
|
|
69
|
+
protected recalculate(mutation?: boolean): void;
|
|
74
70
|
/**
|
|
75
|
-
*
|
|
76
|
-
* @returns trimmed text content
|
|
71
|
+
* Returns cleaned version of `this.textContent`.
|
|
77
72
|
*/
|
|
78
|
-
|
|
73
|
+
protected get text(): string;
|
|
79
74
|
/**
|
|
80
|
-
*
|
|
81
|
-
* @param node parent node that wrapper text node
|
|
82
|
-
* @returns {number} width minus padding
|
|
83
|
-
*/
|
|
84
|
-
private getElementWidthMinusPadding;
|
|
85
|
-
/**
|
|
86
|
-
* Truncate a long string in the middle and add an ellipsis.
|
|
87
|
-
* @param parentNode parent node
|
|
88
|
-
* @param textNode text node
|
|
89
|
-
* @param fullText string
|
|
90
|
-
* @returns {void}
|
|
75
|
+
* Default template
|
|
91
76
|
*/
|
|
92
|
-
|
|
77
|
+
protected get truncateTemplate(): TemplateResult;
|
|
93
78
|
/**
|
|
94
|
-
*
|
|
95
|
-
* @returns void
|
|
79
|
+
* Template for when line clamp is set
|
|
96
80
|
*/
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Handle tooltip statement when properties changed
|
|
100
|
-
* @returns void
|
|
101
|
-
*/
|
|
102
|
-
private updateTooltip;
|
|
103
|
-
/**
|
|
104
|
-
* private method but can't override
|
|
105
|
-
* access modifiers in typescript.
|
|
106
|
-
* @ignore
|
|
107
|
-
* @param size element dimensions
|
|
108
|
-
* @returns {void}
|
|
109
|
-
*/
|
|
110
|
-
resizedCallback(): void;
|
|
111
|
-
/**
|
|
112
|
-
* Determine show/hide tooltip state
|
|
113
|
-
* @returns {boolean} true if center truncate or the element is smaller than a parent
|
|
114
|
-
*/
|
|
115
|
-
private isShowTooltip;
|
|
81
|
+
protected get clampTemplate(): TemplateResult;
|
|
116
82
|
/**
|
|
117
83
|
* A `TemplateResult` that will be used
|
|
118
84
|
* to render the updated internal template.
|
|
@@ -131,4 +97,6 @@ declare global {
|
|
|
131
97
|
'ef-label': Partial<Label> | JSXInterface.HTMLAttributes<Label>;
|
|
132
98
|
}
|
|
133
99
|
}
|
|
134
|
-
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export {};
|
package/lib/label/index.js
CHANGED
|
@@ -1,32 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
7
|
-
import {
|
|
8
|
-
import '../tooltip';
|
|
9
|
-
|
|
10
|
-
|
|
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 { styleMap } from '@refinitiv-ui/core/lib/directives/style-map.js';
|
|
6
|
+
import { VERSION } from '../version.js';
|
|
7
|
+
import { isIE } from '@refinitiv-ui/utils/lib/browser.js';
|
|
8
|
+
import { addTooltipCondition, removeTooltipCondition } from '../tooltip/index.js';
|
|
9
|
+
/**
|
|
10
|
+
* Configuration object
|
|
11
|
+
* for mutations observers
|
|
12
|
+
*/
|
|
11
13
|
const observerOptions = {
|
|
12
14
|
subtree: true,
|
|
13
15
|
childList: true,
|
|
14
16
|
characterData: true
|
|
15
17
|
};
|
|
18
|
+
/**
|
|
19
|
+
* Reusable SPACE
|
|
20
|
+
*/
|
|
21
|
+
const _ = ' ';
|
|
22
|
+
/**
|
|
23
|
+
* Determines if the browser is legacy or modern.
|
|
24
|
+
*/
|
|
25
|
+
/* istanbul ignore next */
|
|
26
|
+
const browserType = isIE ? 'legacy' : 'modern';
|
|
16
27
|
/**
|
|
17
28
|
* Displays a text with alternative truncation
|
|
18
29
|
*/
|
|
19
|
-
let Label = class Label extends
|
|
30
|
+
let Label = class Label extends BasicElement {
|
|
20
31
|
constructor() {
|
|
21
32
|
super(...arguments);
|
|
22
|
-
/**
|
|
23
|
-
* Enable shortening the slot content
|
|
24
|
-
*/
|
|
25
|
-
this.truncate = null;
|
|
26
33
|
/**
|
|
27
34
|
* Limit the number of lines before truncating
|
|
28
35
|
*/
|
|
29
|
-
this.
|
|
36
|
+
this.lineClamp = 0;
|
|
30
37
|
/**
|
|
31
38
|
* Set state to error
|
|
32
39
|
*/
|
|
@@ -36,20 +43,34 @@ let Label = class Label extends ResponsiveElement {
|
|
|
36
43
|
*/
|
|
37
44
|
this.warning = false;
|
|
38
45
|
/**
|
|
39
|
-
*
|
|
46
|
+
* Trimmed chunks of textual content
|
|
40
47
|
*/
|
|
41
|
-
this.
|
|
48
|
+
this.chunks = [];
|
|
42
49
|
/**
|
|
43
|
-
*
|
|
50
|
+
* Mutation Observer used to detect changes in the Light DOM
|
|
44
51
|
*/
|
|
45
|
-
this.
|
|
52
|
+
this.mutationObserver = new MutationObserver(() => this.recalculate(true));
|
|
46
53
|
/**
|
|
47
|
-
*
|
|
54
|
+
* Render used to display the tooltip
|
|
55
|
+
* @returns Tooltip text
|
|
48
56
|
*/
|
|
49
|
-
this.
|
|
57
|
+
this.tooltipRenderer = () => this.text;
|
|
58
|
+
/**
|
|
59
|
+
* Condition used to display the tooltip
|
|
60
|
+
* @param target Tooltip target
|
|
61
|
+
* @returns Whether the tooltip should be shown or not.
|
|
62
|
+
*/
|
|
63
|
+
this.tooltipCondition = (target) => this.shouldShowTooltip(target);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Element version number
|
|
67
|
+
* @returns version number
|
|
68
|
+
*/
|
|
69
|
+
static get version() {
|
|
70
|
+
return VERSION;
|
|
50
71
|
}
|
|
51
72
|
/**
|
|
52
|
-
* A `
|
|
73
|
+
* A `CSSResultGroup` that will be used
|
|
53
74
|
* to style the host, slotted children
|
|
54
75
|
* and the internal template of the element.
|
|
55
76
|
* @returns CSS template
|
|
@@ -57,192 +78,140 @@ let Label = class Label extends ResponsiveElement {
|
|
|
57
78
|
static get styles() {
|
|
58
79
|
return css `
|
|
59
80
|
:host {
|
|
60
|
-
display: inline-
|
|
81
|
+
display: inline-flex;
|
|
61
82
|
max-width: 100%;
|
|
62
|
-
box-sizing: border-box;
|
|
63
83
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
84
|
+
.split {
|
|
85
|
+
height: 1.2em;
|
|
86
|
+
line-height: 1.2em;
|
|
87
|
+
margin-top: -0.1em;
|
|
88
|
+
flex: 0 1 auto;
|
|
89
|
+
min-width: 0;
|
|
67
90
|
overflow: hidden;
|
|
91
|
+
white-space: nowrap;
|
|
68
92
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
-webkit-line-clamp: var(--max-line);
|
|
93
|
+
.left.modern {
|
|
94
|
+
word-break: break-all;
|
|
72
95
|
white-space: normal;
|
|
73
|
-
|
|
96
|
+
}
|
|
97
|
+
.left.legacy {
|
|
74
98
|
text-overflow: ellipsis;
|
|
75
|
-
overflow: hidden;
|
|
76
99
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
100
|
+
.center {
|
|
101
|
+
flex: 0 100 auto;
|
|
102
|
+
}
|
|
103
|
+
.right.modern {
|
|
104
|
+
direction: rtl;
|
|
105
|
+
text-overflow: ellipsis;
|
|
106
|
+
}
|
|
107
|
+
.right.legacy span {
|
|
108
|
+
float: right;
|
|
109
|
+
}
|
|
110
|
+
.clamp {
|
|
111
|
+
overflow: hidden;
|
|
112
|
+
-webkit-box-orient: vertical;
|
|
113
|
+
display: -webkit-inline-box;
|
|
114
|
+
text-overflow: ellipsis;
|
|
115
|
+
position: relative;
|
|
116
|
+
overflow-wrap: break-word;
|
|
80
117
|
}
|
|
81
118
|
`;
|
|
82
119
|
}
|
|
83
120
|
/**
|
|
84
|
-
*
|
|
85
|
-
* @param changedProperties properties it's the Map object which has the updated properties
|
|
86
|
-
* @returns {void}
|
|
87
|
-
*/
|
|
88
|
-
firstUpdated(changedProperties) {
|
|
89
|
-
super.firstUpdated(changedProperties);
|
|
90
|
-
this.rawText = this.retrieveSlotContent();
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Called when the element’s DOM has been updated and rendered
|
|
94
|
-
* @param changedProperties Properties that has changed
|
|
95
|
-
* @returns shouldUpdate
|
|
121
|
+
* @override
|
|
96
122
|
*/
|
|
97
|
-
|
|
98
|
-
super.
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
this.middleEllipsis(this, this.span, this.rawText);
|
|
103
|
-
}
|
|
104
|
-
else {
|
|
105
|
-
this.restoreTextContent();
|
|
106
|
-
if (this.maxLine) {
|
|
107
|
-
this.style.setProperty('--max-line', this.maxLine);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
this.updateTooltip();
|
|
111
|
-
}
|
|
112
|
-
else if (changedProperties.has('maxLine')) {
|
|
113
|
-
this.style.setProperty('--max-line', this.maxLine);
|
|
114
|
-
this.updateTooltip();
|
|
115
|
-
}
|
|
116
|
-
// we must wait while all elements in the tree are updated before starting the mutation observer
|
|
117
|
-
void this.updateComplete.then(() => {
|
|
118
|
-
if (!this.mutationObserver) {
|
|
119
|
-
// Start watching for any child mutations
|
|
120
|
-
this.mutationObserver = new MutationObserver(this.handleSlotChange.bind(this));
|
|
121
|
-
this.mutationObserver.observe(this, observerOptions);
|
|
122
|
-
}
|
|
123
|
-
});
|
|
123
|
+
connectedCallback() {
|
|
124
|
+
super.connectedCallback();
|
|
125
|
+
addTooltipCondition(this.tooltipCondition, this.tooltipRenderer);
|
|
126
|
+
this.mutationObserver.observe(this, observerOptions);
|
|
127
|
+
!isIE && this.recalculate(); // In IE the mutation will trigger
|
|
124
128
|
}
|
|
125
129
|
/**
|
|
126
|
-
*
|
|
127
|
-
* @returns void
|
|
130
|
+
* @override
|
|
128
131
|
*/
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
this.
|
|
132
|
-
|
|
133
|
-
this.previousContent = this.rawText;
|
|
134
|
-
this.restoreTextContent();
|
|
135
|
-
if (this.truncate === 'center') {
|
|
136
|
-
this.middleEllipsis(this, this.span, this.rawText);
|
|
137
|
-
}
|
|
138
|
-
this.updateTooltip();
|
|
139
|
-
}
|
|
132
|
+
disconnectedCallback() {
|
|
133
|
+
super.disconnectedCallback();
|
|
134
|
+
removeTooltipCondition(this.tooltipCondition);
|
|
135
|
+
this.mutationObserver.disconnect();
|
|
140
136
|
}
|
|
141
137
|
/**
|
|
142
|
-
*
|
|
143
|
-
* @
|
|
138
|
+
* Decides whether the tooltip should b shown
|
|
139
|
+
* @param tooltipTarget Target element passed by the tooltip condition
|
|
140
|
+
* @returns True if the tooltip should be shown
|
|
144
141
|
*/
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
* @returns trimmed text content
|
|
151
|
-
*/
|
|
152
|
-
retrieveSlotContent() {
|
|
153
|
-
let text = this.textContent || '';
|
|
154
|
-
const slot = this.querySelector('slot');
|
|
155
|
-
if (slot) {
|
|
156
|
-
const slotContent = slot.assignedNodes({ flatten: true });
|
|
157
|
-
for (let i = 0; i < slotContent.length; i++) {
|
|
158
|
-
text += slotContent[i].textContent;
|
|
159
|
-
}
|
|
142
|
+
shouldShowTooltip(tooltipTarget) {
|
|
143
|
+
const targetMatches = tooltipTarget === this;
|
|
144
|
+
const part = this.renderRoot.firstElementChild;
|
|
145
|
+
if (targetMatches && part) {
|
|
146
|
+
return part.clientHeight !== part.scrollHeight || part.clientWidth !== part.scrollWidth;
|
|
160
147
|
}
|
|
161
|
-
return
|
|
162
|
-
}
|
|
163
|
-
/**
|
|
164
|
-
* Get element width minus padding
|
|
165
|
-
* @param node parent node that wrapper text node
|
|
166
|
-
* @returns {number} width minus padding
|
|
167
|
-
*/
|
|
168
|
-
getElementWidthMinusPadding(node) {
|
|
169
|
-
const paddingLeft = getComputedStyle(node).paddingLeft;
|
|
170
|
-
const paddingRight = getComputedStyle(node).paddingRight;
|
|
171
|
-
return node.offsetWidth - parseFloat(paddingLeft) - parseFloat(paddingRight);
|
|
148
|
+
return false;
|
|
172
149
|
}
|
|
173
150
|
/**
|
|
174
|
-
*
|
|
175
|
-
* @param
|
|
176
|
-
* @param textNode text node
|
|
177
|
-
* @param fullText string
|
|
151
|
+
* Handles any modifications to the internal HTML
|
|
152
|
+
* @param [mutation=false] is the request from a mutation event?
|
|
178
153
|
* @returns {void}
|
|
179
154
|
*/
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
const
|
|
183
|
-
this.
|
|
184
|
-
|
|
185
|
-
|
|
155
|
+
recalculate(mutation = false) {
|
|
156
|
+
mutation; // keeping here for future use
|
|
157
|
+
const oldValue = this.text;
|
|
158
|
+
const raw = this.textContent || '';
|
|
159
|
+
this.chunks = raw.split(_).map(chunk => chunk.trim()).filter(chunk => chunk);
|
|
160
|
+
const newValue = this.text;
|
|
161
|
+
if (oldValue !== newValue) {
|
|
162
|
+
this.requestUpdate('text', oldValue);
|
|
186
163
|
}
|
|
187
|
-
TextHelpers.middleEllipsis(textNode, parentWidth, fullText);
|
|
188
|
-
this.enableTooltip = true;
|
|
189
|
-
void this.requestUpdate();
|
|
190
164
|
}
|
|
191
165
|
/**
|
|
192
|
-
*
|
|
193
|
-
* @returns void
|
|
166
|
+
* Returns cleaned version of `this.textContent`.
|
|
194
167
|
*/
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
this.restoreTextContent(); // TODO: find a way to remove this to improve performance
|
|
198
|
-
this.middleEllipsis(this, this.span, TextHelpers.trim(this.span.textContent || ''));
|
|
199
|
-
}
|
|
200
|
-
this.updateTooltip();
|
|
168
|
+
get text() {
|
|
169
|
+
return this.chunks.join(_);
|
|
201
170
|
}
|
|
202
171
|
/**
|
|
203
|
-
*
|
|
204
|
-
* @returns void
|
|
172
|
+
* Default template
|
|
205
173
|
*/
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
174
|
+
get truncateTemplate() {
|
|
175
|
+
const words = this.chunks;
|
|
176
|
+
const left = [];
|
|
177
|
+
const right = [];
|
|
178
|
+
const isSingleWord = words.length === 1;
|
|
179
|
+
if (isSingleWord) {
|
|
180
|
+
const word = words[0];
|
|
181
|
+
const split = Math.round(word.length / 2);
|
|
182
|
+
left.push(word.substr(0, split));
|
|
183
|
+
right.push(word.substr(split));
|
|
210
184
|
}
|
|
211
185
|
else {
|
|
212
|
-
|
|
213
|
-
|
|
186
|
+
const split = Math.round(words.length / 2);
|
|
187
|
+
for (let i = 0; i < words.length; i += 1) {
|
|
188
|
+
(i < split ? left : right).push(words[i]);
|
|
189
|
+
}
|
|
214
190
|
}
|
|
191
|
+
const leftPart = html `<div class="split left ${browserType}">${left.join(_)}</div>`;
|
|
192
|
+
const centerPart = isSingleWord ? undefined : html `<div class="split center"> </div>`;
|
|
193
|
+
const rightPart = right.length ? html `<div class="split right ${browserType}"><span dir="ltr">${right.join(_)}</span></div>` : undefined;
|
|
194
|
+
return html `${leftPart}${centerPart}${rightPart}`;
|
|
215
195
|
}
|
|
216
196
|
/**
|
|
217
|
-
*
|
|
218
|
-
* access modifiers in typescript.
|
|
219
|
-
* @ignore
|
|
220
|
-
* @param size element dimensions
|
|
221
|
-
* @returns {void}
|
|
222
|
-
*/
|
|
223
|
-
resizedCallback() {
|
|
224
|
-
clearTimeout(this.updateTimer);
|
|
225
|
-
// split layout updating to another execution-loop
|
|
226
|
-
// to prevents resizeObserver triggers resize-loop-error
|
|
227
|
-
this.updateTimer = setTimeout(() => this.onResize(), 0);
|
|
228
|
-
}
|
|
229
|
-
/**
|
|
230
|
-
* Determine show/hide tooltip state
|
|
231
|
-
* @returns {boolean} true if center truncate or the element is smaller than a parent
|
|
197
|
+
* Template for when line clamp is set
|
|
232
198
|
*/
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
199
|
+
get clampTemplate() {
|
|
200
|
+
const styles = {
|
|
201
|
+
lineClamp: `${this.lineClamp}`,
|
|
202
|
+
'-webkit-line-clamp': `${this.lineClamp}`,
|
|
203
|
+
wordBreak: this.lineClamp === 1 ? 'break-all' : ''
|
|
204
|
+
};
|
|
205
|
+
/* istanbul ignore if */
|
|
206
|
+
if (browserType === 'legacy') {
|
|
207
|
+
const cs = getComputedStyle(this);
|
|
208
|
+
const lineHeight = parseFloat(cs.lineHeight) || 1.2 /* css default */;
|
|
209
|
+
styles.maxHeight = `calc(1em * ${lineHeight} * ${this.lineClamp})`; // faux clamp in legacy browsers
|
|
210
|
+
styles.whiteSpace = this.lineClamp === 1 ? 'nowrap' : ''; // show ellipsis in legacy browsers
|
|
244
211
|
}
|
|
245
|
-
return
|
|
212
|
+
return html `
|
|
213
|
+
<span class="clamp ${browserType}" style="${styleMap(styles)}">${this.text}</span>
|
|
214
|
+
`;
|
|
246
215
|
}
|
|
247
216
|
/**
|
|
248
217
|
* A `TemplateResult` that will be used
|
|
@@ -250,33 +219,27 @@ let Label = class Label extends ResponsiveElement {
|
|
|
250
219
|
* @return Render template
|
|
251
220
|
*/
|
|
252
221
|
render() {
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
222
|
+
const template = this.lineClamp ? this.clampTemplate : this.truncateTemplate;
|
|
223
|
+
/* istanbul ignore if */
|
|
224
|
+
if (browserType === 'legacy') {
|
|
225
|
+
// Mutation observer does not fire in IE11 if slot is not present
|
|
226
|
+
return html `${template}<span style="display: none !important;"><slot></slot></span>`;
|
|
227
|
+
}
|
|
228
|
+
return template;
|
|
259
229
|
}
|
|
260
230
|
};
|
|
261
231
|
__decorate([
|
|
262
|
-
property({ type:
|
|
263
|
-
], Label.prototype, "
|
|
264
|
-
__decorate([
|
|
265
|
-
property({ type: String, reflect: true, attribute: 'max-line' })
|
|
266
|
-
], Label.prototype, "maxLine", void 0);
|
|
232
|
+
property({ type: Number, attribute: 'line-clamp' })
|
|
233
|
+
], Label.prototype, "lineClamp", void 0);
|
|
267
234
|
__decorate([
|
|
268
235
|
property({ type: Boolean, reflect: true })
|
|
269
236
|
], Label.prototype, "error", void 0);
|
|
270
237
|
__decorate([
|
|
271
238
|
property({ type: Boolean, reflect: true })
|
|
272
239
|
], Label.prototype, "warning", void 0);
|
|
273
|
-
__decorate([
|
|
274
|
-
query('span', true)
|
|
275
|
-
], Label.prototype, "span", void 0);
|
|
276
240
|
Label = __decorate([
|
|
277
241
|
customElement('ef-label', {
|
|
278
242
|
alias: 'quartz-label'
|
|
279
243
|
})
|
|
280
244
|
], Label);
|
|
281
245
|
export { Label };
|
|
282
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# ef-layout
|
|
2
|
+
|
|
3
|
+
Layout component for creating responsive applications and components
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
| Property | Attribute | Type | Default | Description |
|
|
8
|
+
|--------------|--------------|------------------|---------|--------------------------------------------------|
|
|
9
|
+
| `basis` | `basis` | `string \| null` | null | Sets the rough size of the element based on other siblings and content.<br />Value could be pixel, percents or auto. |
|
|
10
|
+
| `container` | `container` | `boolean` | false | Tells the element to display as a container,<br />displaying children in a vertical nowrap layout. |
|
|
11
|
+
| `debug` | `debug` | `boolean` | false | Displays debug lines. |
|
|
12
|
+
| `flex` | `flex` | `boolean` | false | Tells the element to display flex,<br />displaying children in a row wrap layout. |
|
|
13
|
+
| `maxHeight` | `max-height` | `string \| null` | null | Prevents the height from expanding past a certain point.<br />Value could be pixel, percents or _empty_. |
|
|
14
|
+
| `maxWidth` | `max-width` | `string \| null` | null | Prevents the width from expanding past a certain point.<br />Value could be pixel, percents or _empty_. |
|
|
15
|
+
| `minHeight` | `min-height` | `string \| null` | null | Allows the height to shrink below its contents.<br />Also prevents the height from shrinking past a certain point.<br />Value could be pixel, percents or _empty_. |
|
|
16
|
+
| `minWidth` | `min-width` | `string \| null` | null | Allows the width to shrink below its contents.<br />Also prevents the width from shrinking past a certain point.<br />Value could be pixel, percents or _empty_. |
|
|
17
|
+
| `noflex` | `noflex` | `boolean` | false | Prevents the element from being flexible,<br />when inside of another flex layout. |
|
|
18
|
+
| `nowrap` | `nowrap` | `boolean` | false | Prevents wrapping flex items,<br />when the parent isn't a container. |
|
|
19
|
+
| `scrollable` | `scrollable` | `boolean` | false | Makes the element a scrollable viewport. |
|
|
20
|
+
| `size` | `size` | `string \| null` | null | Sets the fixed size of the element.<br />Value could be pixel, percents or auto. |
|
|
21
|
+
|
|
22
|
+
## Events
|
|
23
|
+
|
|
24
|
+
| Event | Description |
|
|
25
|
+
|----------|----------------------------------------|
|
|
26
|
+
| `resize` | Fired when the element's size changes. |
|
package/lib/layout/index.d.ts
CHANGED
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
import { JSXInterface } from '../jsx';
|
|
2
|
-
import { ResponsiveElement, TemplateResult,
|
|
2
|
+
import { ResponsiveElement, TemplateResult, CSSResultGroup, PropertyValues } from '@refinitiv-ui/core';
|
|
3
3
|
/**
|
|
4
4
|
* Layout component for creating responsive applications and components
|
|
5
5
|
* @fires resize - Fired when the element's size changes.
|
|
6
6
|
*/
|
|
7
7
|
export declare class Layout extends ResponsiveElement {
|
|
8
8
|
/**
|
|
9
|
-
|
|
9
|
+
* Element version number
|
|
10
|
+
* @returns version number
|
|
11
|
+
*/
|
|
12
|
+
static get version(): string;
|
|
13
|
+
/**
|
|
14
|
+
* A `CSSResultGroup` that will be used
|
|
10
15
|
* to style the host, slotted children
|
|
11
16
|
* and the internal template of the element.
|
|
12
17
|
* @return CSS template
|
|
13
18
|
*/
|
|
14
|
-
static get styles():
|
|
19
|
+
static get styles(): CSSResultGroup;
|
|
15
20
|
/**
|
|
16
21
|
* Displays debug lines.
|
|
17
22
|
* @type {boolean}
|
|
@@ -97,4 +102,6 @@ declare global {
|
|
|
97
102
|
'ef-layout': Partial<Layout> | JSXInterface.HTMLAttributes<Layout>;
|
|
98
103
|
}
|
|
99
104
|
}
|
|
100
|
-
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export {};
|