@refinitiv-ui/elements 5.12.0-alpha.0 → 5.12.0
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 +24 -0
- package/README.md +4 -4
- package/lib/accordion/index.d.ts +76 -0
- package/lib/accordion/index.js +136 -0
- package/lib/accordion/themes/halo/dark/index.js +3 -0
- package/lib/accordion/themes/halo/light/index.js +3 -0
- package/lib/accordion/themes/solar/charcoal/index.js +3 -0
- package/lib/accordion/themes/solar/pearl/index.js +3 -0
- package/lib/appstate-bar/index.d.ts +65 -0
- package/lib/appstate-bar/index.js +100 -0
- package/lib/appstate-bar/themes/halo/dark/index.js +3 -0
- package/lib/appstate-bar/themes/halo/light/index.js +3 -0
- package/lib/appstate-bar/themes/solar/charcoal/index.js +3 -0
- package/lib/appstate-bar/themes/solar/pearl/index.js +3 -0
- package/lib/autosuggest/helpers/types.d.ts +54 -0
- package/lib/autosuggest/helpers/types.js +1 -0
- package/lib/autosuggest/helpers/utils.d.ts +39 -0
- package/lib/autosuggest/helpers/utils.js +75 -0
- package/lib/autosuggest/index.d.ts +538 -0
- package/lib/autosuggest/index.js +1255 -0
- package/lib/autosuggest/themes/halo/dark/index.js +5 -0
- package/lib/autosuggest/themes/halo/light/index.js +5 -0
- package/lib/autosuggest/themes/solar/charcoal/index.js +5 -0
- package/lib/autosuggest/themes/solar/pearl/index.js +5 -0
- package/lib/button/index.d.ts +138 -0
- package/lib/button/index.js +241 -0
- package/lib/button/themes/halo/dark/index.js +3 -0
- package/lib/button/themes/halo/light/index.js +3 -0
- package/lib/button/themes/solar/charcoal/index.js +3 -0
- package/lib/button/themes/solar/pearl/index.js +3 -0
- package/lib/button-bar/index.d.ts +125 -0
- package/lib/button-bar/index.js +295 -0
- package/lib/button-bar/themes/halo/dark/index.js +3 -0
- package/lib/button-bar/themes/halo/light/index.js +3 -0
- package/lib/button-bar/themes/solar/charcoal/index.js +3 -0
- package/lib/button-bar/themes/solar/pearl/index.js +3 -0
- package/lib/calendar/constants.d.ts +26 -0
- package/lib/calendar/constants.js +28 -0
- package/lib/calendar/index.d.ts +412 -0
- package/lib/calendar/index.js +1274 -0
- package/lib/calendar/locales.d.ts +1 -0
- package/lib/calendar/locales.js +41 -0
- package/lib/calendar/themes/halo/dark/index.js +3 -0
- package/lib/calendar/themes/halo/light/index.js +3 -0
- package/lib/calendar/themes/solar/charcoal/index.js +3 -0
- package/lib/calendar/themes/solar/pearl/index.js +3 -0
- package/lib/calendar/types.d.ts +32 -0
- package/lib/calendar/types.js +1 -0
- package/lib/calendar/utils.d.ts +42 -0
- package/lib/calendar/utils.js +120 -0
- package/lib/canvas/index.d.ts +101 -0
- package/lib/canvas/index.js +173 -0
- package/lib/canvas/themes/halo/dark/index.js +2 -0
- package/lib/canvas/themes/halo/light/index.js +2 -0
- package/lib/canvas/themes/solar/charcoal/index.js +2 -0
- package/lib/canvas/themes/solar/pearl/index.js +2 -0
- package/lib/card/helpers/types.d.ts +12 -0
- package/lib/card/helpers/types.js +1 -0
- package/lib/card/index.d.ts +142 -0
- package/lib/card/index.js +248 -0
- package/lib/card/themes/halo/dark/index.js +5 -0
- package/lib/card/themes/halo/light/index.js +5 -0
- package/lib/card/themes/solar/charcoal/index.js +5 -0
- package/lib/card/themes/solar/pearl/index.js +5 -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 +5 -0
- package/lib/chart/helpers/legend.js +78 -0
- package/lib/chart/helpers/merge.d.ts +15 -0
- package/lib/chart/helpers/merge.js +28 -0
- package/lib/chart/helpers/types.d.ts +69 -0
- package/lib/chart/helpers/types.js +1 -0
- package/lib/chart/index.d.ts +187 -0
- package/lib/chart/index.js +491 -0
- package/lib/chart/plugins/doughnut-center-label.d.ts +3 -0
- package/lib/chart/plugins/doughnut-center-label.js +196 -0
- package/lib/chart/themes/halo/dark/index.js +4 -0
- package/lib/chart/themes/halo/light/index.js +4 -0
- package/lib/chart/themes/solar/charcoal/index.js +4 -0
- package/lib/chart/themes/solar/pearl/index.js +4 -0
- package/lib/checkbox/index.d.ts +97 -0
- package/lib/checkbox/index.js +194 -0
- package/lib/checkbox/themes/halo/dark/index.js +4 -0
- package/lib/checkbox/themes/halo/light/index.js +4 -0
- package/lib/checkbox/themes/solar/charcoal/index.js +4 -0
- package/lib/checkbox/themes/solar/pearl/index.js +4 -0
- package/lib/clock/index.d.ts +321 -0
- package/lib/clock/index.js +583 -0
- package/lib/clock/themes/halo/dark/index.js +2 -0
- package/lib/clock/themes/halo/light/index.js +2 -0
- package/lib/clock/themes/solar/charcoal/index.js +2 -0
- package/lib/clock/themes/solar/pearl/index.js +2 -0
- package/lib/clock/utils/TickManager.d.ts +14 -0
- package/lib/clock/utils/TickManager.js +66 -0
- package/lib/clock/utils/timestamps.d.ts +6 -0
- package/lib/clock/utils/timestamps.js +6 -0
- package/lib/collapse/custom-elements.json +4 -2
- package/lib/collapse/custom-elements.md +1 -1
- package/lib/collapse/index.d.ts +123 -0
- package/lib/collapse/index.js +227 -0
- package/lib/collapse/themes/halo/dark/index.js +5 -0
- package/lib/collapse/themes/halo/light/index.js +5 -0
- package/lib/collapse/themes/solar/charcoal/index.js +5 -0
- package/lib/collapse/themes/solar/pearl/index.js +5 -0
- package/lib/color-dialog/elements/color-palettes.d.ts +52 -0
- package/lib/color-dialog/elements/color-palettes.js +101 -0
- package/lib/color-dialog/elements/grayscale-palettes.d.ts +67 -0
- package/lib/color-dialog/elements/grayscale-palettes.js +161 -0
- package/lib/color-dialog/elements/palettes.d.ts +65 -0
- package/lib/color-dialog/elements/palettes.js +132 -0
- package/lib/color-dialog/helpers/color-helpers.d.ts +16 -0
- package/lib/color-dialog/helpers/color-helpers.js +161 -0
- package/lib/color-dialog/helpers/value-model.d.ts +75 -0
- package/lib/color-dialog/helpers/value-model.js +141 -0
- package/lib/color-dialog/index.d.ts +232 -0
- package/lib/color-dialog/index.js +459 -0
- package/lib/color-dialog/themes/halo/dark/index.js +7 -0
- package/lib/color-dialog/themes/halo/light/index.js +7 -0
- package/lib/color-dialog/themes/solar/charcoal/index.js +7 -0
- package/lib/color-dialog/themes/solar/pearl/index.js +7 -0
- package/lib/combo-box/helpers/filter.d.ts +10 -0
- package/lib/combo-box/helpers/filter.js +29 -0
- package/lib/combo-box/helpers/keyboard-event.d.ts +17 -0
- package/lib/combo-box/helpers/keyboard-event.js +19 -0
- 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 +11 -0
- package/lib/combo-box/helpers/types.js +1 -0
- package/lib/combo-box/index.d.ts +551 -0
- package/lib/combo-box/index.js +1183 -0
- package/lib/combo-box/themes/halo/dark/index.js +7 -0
- package/lib/combo-box/themes/halo/light/index.js +7 -0
- package/lib/combo-box/themes/solar/charcoal/index.js +7 -0
- package/lib/combo-box/themes/solar/pearl/index.js +7 -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/index.d.ts +509 -0
- package/lib/datetime-picker/index.js +1175 -0
- package/lib/datetime-picker/locales.d.ts +8 -0
- package/lib/datetime-picker/locales.js +57 -0
- package/lib/datetime-picker/themes/halo/dark/index.js +7 -0
- package/lib/datetime-picker/themes/halo/light/index.js +7 -0
- package/lib/datetime-picker/themes/solar/charcoal/index.js +7 -0
- package/lib/datetime-picker/themes/solar/pearl/index.js +7 -0
- package/lib/datetime-picker/types.d.ts +3 -0
- package/lib/datetime-picker/types.js +1 -0
- package/lib/datetime-picker/utils.d.ts +55 -0
- package/lib/datetime-picker/utils.js +92 -0
- package/lib/dialog/custom-elements.json +11 -0
- package/lib/dialog/custom-elements.md +4 -3
- package/lib/dialog/draggable-element.d.ts +14 -0
- package/lib/dialog/draggable-element.js +221 -0
- package/lib/dialog/index.d.ts +213 -0
- package/lib/dialog/index.js +353 -0
- package/lib/dialog/themes/halo/dark/index.js +7 -0
- package/lib/dialog/themes/halo/light/index.js +7 -0
- package/lib/dialog/themes/solar/charcoal/index.js +7 -0
- package/lib/dialog/themes/solar/pearl/index.js +7 -0
- package/lib/email-field/index.d.ts +80 -0
- package/lib/email-field/index.js +86 -0
- package/lib/email-field/themes/halo/dark/index.js +3 -0
- package/lib/email-field/themes/halo/light/index.js +3 -0
- package/lib/email-field/themes/solar/charcoal/index.js +3 -0
- package/lib/email-field/themes/solar/pearl/index.js +3 -0
- package/lib/events.d.ts +121 -0
- package/lib/events.js +1 -0
- package/lib/flag/index.d.ts +96 -0
- package/lib/flag/index.js +168 -0
- package/lib/flag/themes/halo/dark/index.js +2 -0
- package/lib/flag/themes/halo/light/index.js +2 -0
- package/lib/flag/themes/solar/charcoal/index.js +2 -0
- package/lib/flag/themes/solar/pearl/index.js +2 -0
- package/lib/flag/utils/FlagLoader.d.ts +47 -0
- package/lib/flag/utils/FlagLoader.js +86 -0
- package/lib/header/index.d.ts +46 -0
- package/lib/header/index.js +73 -0
- package/lib/header/themes/halo/dark/index.js +2 -0
- package/lib/header/themes/halo/light/index.js +2 -0
- package/lib/header/themes/solar/charcoal/index.js +2 -0
- package/lib/header/themes/solar/pearl/index.js +2 -0
- package/lib/heatmap/helpers/color.d.ts +30 -0
- package/lib/heatmap/helpers/color.js +68 -0
- package/lib/heatmap/helpers/text.d.ts +26 -0
- package/lib/heatmap/helpers/text.js +91 -0
- package/lib/heatmap/helpers/track.d.ts +102 -0
- package/lib/heatmap/helpers/track.js +160 -0
- package/lib/heatmap/helpers/types.d.ts +40 -0
- package/lib/heatmap/helpers/types.js +1 -0
- package/lib/heatmap/index.d.ts +453 -0
- package/lib/heatmap/index.js +1103 -0
- package/lib/heatmap/themes/halo/dark/index.js +4 -0
- package/lib/heatmap/themes/halo/light/index.js +4 -0
- package/lib/heatmap/themes/solar/charcoal/index.js +4 -0
- package/lib/heatmap/themes/solar/pearl/index.js +4 -0
- package/lib/icon/index.d.ts +90 -0
- package/lib/icon/index.js +171 -0
- package/lib/icon/themes/halo/dark/index.js +2 -0
- package/lib/icon/themes/halo/light/index.js +2 -0
- package/lib/icon/themes/solar/charcoal/index.js +2 -0
- package/lib/icon/themes/solar/pearl/index.js +2 -0
- package/lib/icon/utils/IconLoader.d.ts +52 -0
- package/lib/icon/utils/IconLoader.js +93 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.js +3 -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 +45 -0
- package/lib/interactive-chart/helpers/types.js +6 -0
- package/lib/interactive-chart/index.d.ts +383 -0
- package/lib/interactive-chart/index.js +1093 -0
- package/lib/interactive-chart/themes/halo/dark/index.js +3 -0
- package/lib/interactive-chart/themes/halo/light/index.js +3 -0
- package/lib/interactive-chart/themes/solar/charcoal/index.js +3 -0
- package/lib/interactive-chart/themes/solar/pearl/index.js +3 -0
- package/lib/item/helpers/types.d.ts +57 -0
- package/lib/item/helpers/types.js +1 -0
- package/lib/item/index.d.ts +159 -0
- package/lib/item/index.js +272 -0
- package/lib/item/themes/halo/dark/index.js +4 -0
- package/lib/item/themes/halo/light/index.js +4 -0
- package/lib/item/themes/solar/charcoal/index.js +4 -0
- package/lib/item/themes/solar/pearl/index.js +4 -0
- package/lib/label/index.d.ts +102 -0
- package/lib/label/index.js +245 -0
- package/lib/label/themes/halo/dark/index.js +3 -0
- package/lib/label/themes/halo/light/index.js +3 -0
- package/lib/label/themes/solar/charcoal/index.js +3 -0
- package/lib/label/themes/solar/pearl/index.js +3 -0
- package/lib/layout/index.d.ts +107 -0
- package/lib/layout/index.js +212 -0
- package/lib/layout/themes/halo/dark/index.js +2 -0
- package/lib/layout/themes/halo/light/index.js +2 -0
- package/lib/layout/themes/solar/charcoal/index.js +2 -0
- package/lib/layout/themes/solar/pearl/index.js +2 -0
- package/lib/led-gauge/index.d.ts +144 -0
- package/lib/led-gauge/index.js +438 -0
- package/lib/led-gauge/themes/halo/dark/index.js +3 -0
- package/lib/led-gauge/themes/halo/light/index.js +3 -0
- package/lib/led-gauge/themes/solar/charcoal/index.js +3 -0
- package/lib/led-gauge/themes/solar/pearl/index.js +3 -0
- package/lib/list/extensible-function.d.ts +8 -0
- package/lib/list/extensible-function.js +13 -0
- package/lib/list/helpers/list-renderer.d.ts +9 -0
- package/lib/list/helpers/list-renderer.js +37 -0
- package/lib/list/helpers/types.d.ts +3 -0
- package/lib/list/helpers/types.js +1 -0
- package/lib/list/index.d.ts +313 -0
- package/lib/list/index.js +640 -0
- package/lib/list/renderer.d.ts +36 -0
- package/lib/list/renderer.js +9 -0
- package/lib/list/themes/halo/dark/index.js +3 -0
- package/lib/list/themes/halo/light/index.js +3 -0
- package/lib/list/themes/solar/charcoal/index.js +3 -0
- package/lib/list/themes/solar/pearl/index.js +3 -0
- package/lib/loader/index.d.ts +41 -0
- package/lib/loader/index.js +61 -0
- package/lib/loader/themes/halo/dark/index.js +2 -0
- package/lib/loader/themes/halo/light/index.js +2 -0
- package/lib/loader/themes/solar/charcoal/index.js +2 -0
- package/lib/loader/themes/solar/pearl/index.js +2 -0
- package/lib/multi-input/helpers/types.d.ts +11 -0
- package/lib/multi-input/helpers/types.js +1 -0
- package/lib/multi-input/index.d.ts +301 -0
- package/lib/multi-input/index.js +594 -0
- package/lib/multi-input/themes/halo/dark/index.js +4 -0
- package/lib/multi-input/themes/halo/light/index.js +4 -0
- package/lib/multi-input/themes/solar/charcoal/index.js +4 -0
- package/lib/multi-input/themes/solar/pearl/index.js +4 -0
- package/lib/notification/elements/notification-tray.d.ts +97 -0
- package/lib/notification/elements/notification-tray.js +167 -0
- package/lib/notification/elements/notification.d.ts +90 -0
- package/lib/notification/elements/notification.js +154 -0
- package/lib/notification/helpers/status.d.ts +30 -0
- package/lib/notification/helpers/status.js +130 -0
- package/lib/notification/helpers/types.d.ts +10 -0
- package/lib/notification/helpers/types.js +1 -0
- package/lib/notification/index.d.ts +2 -0
- package/lib/notification/index.js +2 -0
- package/lib/notification/themes/halo/dark/index.js +5 -0
- package/lib/notification/themes/halo/light/index.js +5 -0
- package/lib/notification/themes/solar/charcoal/index.js +5 -0
- package/lib/notification/themes/solar/pearl/index.js +5 -0
- package/lib/number-field/index.d.ts +339 -0
- package/lib/number-field/index.js +741 -0
- package/lib/number-field/themes/halo/dark/index.js +3 -0
- package/lib/number-field/themes/halo/light/index.js +3 -0
- package/lib/number-field/themes/solar/charcoal/index.js +3 -0
- package/lib/number-field/themes/solar/pearl/index.js +3 -0
- package/lib/overlay/elements/overlay-backdrop.d.ts +46 -0
- package/lib/overlay/elements/overlay-backdrop.js +64 -0
- package/lib/overlay/elements/overlay-viewport.d.ts +40 -0
- package/lib/overlay/elements/overlay-viewport.js +52 -0
- package/lib/overlay/elements/overlay.d.ts +408 -0
- package/lib/overlay/elements/overlay.js +1426 -0
- package/lib/overlay/helpers/functions.d.ts +13 -0
- package/lib/overlay/helpers/functions.js +16 -0
- package/lib/overlay/helpers/types.d.ts +97 -0
- package/lib/overlay/helpers/types.js +16 -0
- package/lib/overlay/index.d.ts +2 -0
- package/lib/overlay/index.js +1 -0
- package/lib/overlay/managers/backdrop-manager.d.ts +45 -0
- package/lib/overlay/managers/backdrop-manager.js +96 -0
- package/lib/overlay/managers/close-manager.d.ts +54 -0
- package/lib/overlay/managers/close-manager.js +138 -0
- package/lib/overlay/managers/focus-manager.d.ts +71 -0
- package/lib/overlay/managers/focus-manager.js +228 -0
- package/lib/overlay/managers/interaction-lock-manager.d.ts +138 -0
- package/lib/overlay/managers/interaction-lock-manager.js +375 -0
- package/lib/overlay/managers/viewport-manager.d.ts +93 -0
- package/lib/overlay/managers/viewport-manager.js +211 -0
- package/lib/overlay/managers/zindex-manager.d.ts +80 -0
- package/lib/overlay/managers/zindex-manager.js +195 -0
- package/lib/overlay/themes/halo/dark/index.js +4 -0
- package/lib/overlay/themes/halo/light/index.js +4 -0
- package/lib/overlay/themes/solar/charcoal/index.js +4 -0
- package/lib/overlay/themes/solar/pearl/index.js +4 -0
- package/lib/overlay-menu/helpers/types.d.ts +8 -0
- package/lib/overlay-menu/helpers/types.js +1 -0
- package/lib/overlay-menu/index.d.ts +387 -0
- package/lib/overlay-menu/index.js +935 -0
- package/lib/overlay-menu/managers/menu-manager.d.ts +98 -0
- package/lib/overlay-menu/managers/menu-manager.js +240 -0
- package/lib/overlay-menu/themes/halo/dark/index.js +5 -0
- package/lib/overlay-menu/themes/halo/light/index.js +5 -0
- package/lib/overlay-menu/themes/solar/charcoal/index.js +5 -0
- package/lib/overlay-menu/themes/solar/pearl/index.js +5 -0
- package/lib/pagination/index.d.ts +275 -0
- package/lib/pagination/index.js +552 -0
- package/lib/pagination/themes/halo/dark/index.js +6 -0
- package/lib/pagination/themes/halo/light/index.js +6 -0
- package/lib/pagination/themes/solar/charcoal/index.js +6 -0
- package/lib/pagination/themes/solar/pearl/index.js +6 -0
- package/lib/panel/index.d.ts +48 -0
- package/lib/panel/index.js +74 -0
- package/lib/panel/themes/halo/dark/index.js +2 -0
- package/lib/panel/themes/halo/light/index.js +2 -0
- package/lib/panel/themes/solar/charcoal/index.js +2 -0
- package/lib/panel/themes/solar/pearl/index.js +2 -0
- package/lib/password-field/index.d.ts +89 -0
- package/lib/password-field/index.js +112 -0
- package/lib/password-field/themes/halo/dark/index.js +3 -0
- package/lib/password-field/themes/halo/light/index.js +3 -0
- package/lib/password-field/themes/solar/charcoal/index.js +3 -0
- package/lib/password-field/themes/solar/pearl/index.js +3 -0
- package/lib/pill/index.d.ts +97 -0
- package/lib/pill/index.js +160 -0
- package/lib/pill/themes/halo/dark/index.js +3 -0
- package/lib/pill/themes/halo/light/index.js +3 -0
- package/lib/pill/themes/solar/charcoal/index.js +3 -0
- package/lib/pill/themes/solar/pearl/index.js +3 -0
- package/lib/progress-bar/index.d.ts +82 -0
- package/lib/progress-bar/index.js +157 -0
- package/lib/progress-bar/themes/halo/dark/index.js +2 -0
- package/lib/progress-bar/themes/halo/light/index.js +2 -0
- package/lib/progress-bar/themes/solar/charcoal/index.js +2 -0
- package/lib/progress-bar/themes/solar/pearl/index.js +2 -0
- package/lib/radio-button/index.d.ts +123 -0
- package/lib/radio-button/index.js +261 -0
- package/lib/radio-button/radio-button-registry.d.ts +22 -0
- package/lib/radio-button/radio-button-registry.js +93 -0
- package/lib/radio-button/themes/halo/dark/index.js +3 -0
- package/lib/radio-button/themes/halo/light/index.js +3 -0
- package/lib/radio-button/themes/solar/charcoal/index.js +3 -0
- package/lib/radio-button/themes/solar/pearl/index.js +3 -0
- package/lib/rating/index.d.ts +91 -0
- package/lib/rating/index.js +157 -0
- package/lib/rating/themes/halo/dark/index.js +2 -0
- package/lib/rating/themes/halo/light/index.js +2 -0
- package/lib/rating/themes/solar/charcoal/index.js +2 -0
- package/lib/rating/themes/solar/pearl/index.js +2 -0
- package/lib/search-field/index.d.ts +77 -0
- package/lib/search-field/index.js +84 -0
- package/lib/search-field/themes/halo/dark/index.js +3 -0
- package/lib/search-field/themes/halo/light/index.js +3 -0
- package/lib/search-field/themes/solar/charcoal/index.js +3 -0
- package/lib/search-field/themes/solar/pearl/index.js +3 -0
- package/lib/select/helpers/types.d.ts +3 -0
- package/lib/select/helpers/types.js +1 -0
- package/lib/select/index.d.ts +396 -0
- package/lib/select/index.js +981 -0
- package/lib/select/themes/halo/dark/index.js +5 -0
- package/lib/select/themes/halo/light/index.js +5 -0
- package/lib/select/themes/solar/charcoal/index.js +5 -0
- package/lib/select/themes/solar/pearl/index.js +5 -0
- package/lib/sidebar-layout/index.d.ts +70 -0
- package/lib/sidebar-layout/index.js +134 -0
- package/lib/sidebar-layout/themes/halo/dark/index.js +3 -0
- package/lib/sidebar-layout/themes/halo/light/index.js +3 -0
- package/lib/sidebar-layout/themes/solar/charcoal/index.js +3 -0
- package/lib/sidebar-layout/themes/solar/pearl/index.js +3 -0
- package/lib/slider/index.d.ts +409 -0
- package/lib/slider/index.js +1197 -0
- package/lib/slider/themes/halo/dark/index.js +3 -0
- package/lib/slider/themes/halo/light/index.js +3 -0
- package/lib/slider/themes/solar/charcoal/index.js +3 -0
- package/lib/slider/themes/solar/pearl/index.js +3 -0
- package/lib/sparkline/index.d.ts +109 -0
- package/lib/sparkline/index.js +188 -0
- package/lib/sparkline/themes/halo/dark/index.js +2 -0
- package/lib/sparkline/themes/halo/light/index.js +2 -0
- package/lib/sparkline/themes/solar/charcoal/index.js +2 -0
- package/lib/sparkline/themes/solar/pearl/index.js +2 -0
- package/lib/swing-gauge/const.d.ts +22 -0
- package/lib/swing-gauge/const.js +26 -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 +296 -0
- package/lib/swing-gauge/index.js +764 -0
- package/lib/swing-gauge/themes/halo/dark/index.js +3 -0
- package/lib/swing-gauge/themes/halo/light/index.js +3 -0
- package/lib/swing-gauge/themes/solar/charcoal/index.js +3 -0
- package/lib/swing-gauge/themes/solar/pearl/index.js +3 -0
- package/lib/swing-gauge/types.d.ts +34 -0
- package/lib/swing-gauge/types.js +1 -0
- package/lib/tab/custom-elements.json +13 -0
- package/lib/tab/custom-elements.md +1 -0
- package/lib/tab/index.d.ts +136 -0
- package/lib/tab/index.js +236 -0
- package/lib/tab/themes/halo/dark/index.js +4 -0
- package/lib/tab/themes/halo/light/index.js +4 -0
- package/lib/tab/themes/solar/charcoal/index.js +4 -0
- package/lib/tab/themes/solar/pearl/index.js +4 -0
- package/lib/tab-bar/custom-elements.json +12 -0
- package/lib/tab-bar/custom-elements.md +7 -0
- package/lib/tab-bar/helpers/animate.d.ts +16 -0
- package/lib/tab-bar/helpers/animate.js +53 -0
- package/lib/tab-bar/index.d.ts +198 -0
- package/lib/tab-bar/index.js +428 -0
- package/lib/tab-bar/themes/halo/dark/index.js +4 -0
- package/lib/tab-bar/themes/halo/light/index.js +4 -0
- package/lib/tab-bar/themes/solar/charcoal/index.js +4 -0
- package/lib/tab-bar/themes/solar/pearl/index.js +4 -0
- package/lib/text-field/index.d.ts +151 -0
- package/lib/text-field/index.js +260 -0
- package/lib/text-field/themes/halo/dark/index.js +3 -0
- package/lib/text-field/themes/halo/light/index.js +3 -0
- package/lib/text-field/themes/solar/charcoal/index.js +3 -0
- package/lib/text-field/themes/solar/pearl/index.js +3 -0
- package/lib/time-picker/index.d.ts +412 -0
- package/lib/time-picker/index.js +898 -0
- package/lib/time-picker/themes/halo/dark/index.js +4 -0
- package/lib/time-picker/themes/halo/light/index.js +4 -0
- package/lib/time-picker/themes/solar/charcoal/index.js +4 -0
- package/lib/time-picker/themes/solar/pearl/index.js +4 -0
- package/lib/toggle/index.d.ts +87 -0
- package/lib/toggle/index.js +153 -0
- package/lib/toggle/themes/halo/dark/index.js +2 -0
- package/lib/toggle/themes/halo/light/index.js +2 -0
- package/lib/toggle/themes/solar/charcoal/index.js +2 -0
- package/lib/toggle/themes/solar/pearl/index.js +2 -0
- package/lib/tooltip/elements/title-tooltip.d.ts +1 -0
- package/lib/tooltip/elements/title-tooltip.js +18 -0
- package/lib/tooltip/elements/tooltip-element.d.ts +21 -0
- package/lib/tooltip/elements/tooltip-element.js +54 -0
- package/lib/tooltip/helpers/overflow-tooltip.d.ts +9 -0
- package/lib/tooltip/helpers/overflow-tooltip.js +19 -0
- package/lib/tooltip/helpers/renderer.d.ts +8 -0
- package/lib/tooltip/helpers/renderer.js +11 -0
- package/lib/tooltip/helpers/types.d.ts +23 -0
- package/lib/tooltip/helpers/types.js +1 -0
- package/lib/tooltip/index.d.ts +232 -0
- package/lib/tooltip/index.js +477 -0
- package/lib/tooltip/managers/tooltip-manager.d.ts +15 -0
- package/lib/tooltip/managers/tooltip-manager.js +140 -0
- package/lib/tooltip/themes/halo/dark/index.js +3 -0
- package/lib/tooltip/themes/halo/light/index.js +3 -0
- package/lib/tooltip/themes/solar/charcoal/index.js +3 -0
- package/lib/tooltip/themes/solar/pearl/index.js +3 -0
- package/lib/tornado-chart/elements/tornado-chart.d.ts +78 -0
- package/lib/tornado-chart/elements/tornado-chart.js +122 -0
- package/lib/tornado-chart/elements/tornado-item.d.ts +110 -0
- package/lib/tornado-chart/elements/tornado-item.js +207 -0
- package/lib/tornado-chart/index.d.ts +2 -0
- package/lib/tornado-chart/index.js +2 -0
- package/lib/tornado-chart/themes/halo/dark/index.js +6 -0
- package/lib/tornado-chart/themes/halo/light/index.js +6 -0
- package/lib/tornado-chart/themes/solar/charcoal/index.js +6 -0
- package/lib/tornado-chart/themes/solar/pearl/index.js +6 -0
- package/lib/tree/elements/tree-item.d.ts +129 -0
- package/lib/tree/elements/tree-item.js +238 -0
- package/lib/tree/elements/tree.d.ts +203 -0
- package/lib/tree/elements/tree.js +414 -0
- package/lib/tree/helpers/filter.d.ts +8 -0
- package/lib/tree/helpers/filter.js +33 -0
- package/lib/tree/helpers/renderer.d.ts +5 -0
- package/lib/tree/helpers/renderer.js +33 -0
- package/lib/tree/helpers/types.d.ts +25 -0
- package/lib/tree/helpers/types.js +1 -0
- package/lib/tree/index.d.ts +4 -0
- package/lib/tree/index.js +3 -0
- package/lib/tree/managers/tree-manager.d.ts +248 -0
- package/lib/tree/managers/tree-manager.js +395 -0
- package/lib/tree/themes/halo/dark/index.js +7 -0
- package/lib/tree/themes/halo/light/index.js +7 -0
- package/lib/tree/themes/solar/charcoal/index.js +7 -0
- package/lib/tree/themes/solar/pearl/index.js +7 -0
- package/lib/tree-select/helpers/types.d.ts +4 -0
- package/lib/tree-select/helpers/types.js +1 -0
- package/lib/tree-select/index.d.ts +404 -0
- package/lib/tree-select/index.js +891 -0
- package/lib/tree-select/themes/halo/dark/index.js +11 -0
- package/lib/tree-select/themes/halo/light/index.js +11 -0
- package/lib/tree-select/themes/solar/charcoal/index.js +11 -0
- package/lib/tree-select/themes/solar/pearl/index.js +11 -0
- package/lib/version.d.ts +1 -0
- package/lib/version.js +1 -0
- package/package.json +293 -24
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import '@refinitiv-ui/elements/lib/canvas/themes/halo/dark';
|
|
2
|
+
|
|
3
|
+
elf.customStyles.define('ef-swing-gauge', ':host{--primary-color:#6678FF;--secondary-color:#FFFFFF;--border-color:#000000;--center-line:solid;--center-line-color:#000000;--center-line-opacity:0.6;--secondary-color:#0D0D0D;--center-line-color:#FFFFFF;--border-color:#6678FF;--center-line:dotted}:host [part=legend-container-outer]{padding-bottom:30px}:host [part=primary-legend],:host [part=secondary-legend]{margin-top:4px;align-items:center}:host [part=primary-legend-symbol],:host [part=secondary-legend-symbol]{border-radius:50%;margin-right:10px;align-self:baseline;margin-top:1px;border:1px solid var(--border-color,#6678ff);height:10px;width:10px}:host [part=primary-legend-symbol]{background-color:var(--primary-color)}:host [part=secondary-legend-symbol]{background-color:var(--secondary-color)}:host [part=primary-value],:host [part=secondary-value]{font-weight:500}');
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import '@refinitiv-ui/elements/lib/canvas/themes/halo/light';
|
|
2
|
+
|
|
3
|
+
elf.customStyles.define('ef-swing-gauge', ':host{--primary-color:#334BFF;--secondary-color:#0D0D0D;--border-color:#000000;--center-line:solid;--center-line-color:#000000;--center-line-opacity:0.6;--secondary-color:#0D0D0D;--center-line-color:#FFFFFF;--border-color:#334BFF;--center-line:dotted}:host [part=legend-container-outer]{padding-bottom:30px}:host [part=primary-legend],:host [part=secondary-legend]{margin-top:4px;align-items:center}:host [part=primary-legend-symbol],:host [part=secondary-legend-symbol]{border-radius:50%;margin-right:10px;align-self:baseline;margin-top:1px;height:12px;width:12px}:host [part=primary-legend-symbol]{background-color:var(--primary-color)}:host [part=secondary-legend-symbol]{background-color:var(--secondary-color)}:host [part=primary-value],:host [part=secondary-value]{font-weight:500}');
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import '@refinitiv-ui/elements/lib/canvas/themes/solar/charcoal';
|
|
2
|
+
|
|
3
|
+
elf.customStyles.define('ef-swing-gauge', ':host{--primary-color:#FF9933;--secondary-color:#3780BF;--border-color:#000000;--center-line:solid;--center-line-color:#000000;--center-line-opacity:0.6;--primary-color:#2EB4C9;--secondary-color:#C93C4B;--border-color:#000000;--center-line:solid;--center-line-color:#000000;--center-line-opacity:0.6}:host [part=legend-container-outer]{padding-bottom:30px}:host [part=primary-legend],:host [part=secondary-legend]{margin-top:4px;align-items:center}:host [part=primary-legend-symbol],:host [part=secondary-legend-symbol]{height:12px;width:12px;border-radius:50%;margin-right:10px;align-self:baseline;margin-top:1px}:host [part=primary-legend-symbol]{background-color:var(--primary-color)}:host [part=secondary-legend-symbol]{background-color:var(--secondary-color)}:host [part=primary-value],:host [part=secondary-value]{font-weight:500}');
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import '@refinitiv-ui/elements/lib/canvas/themes/solar/pearl';
|
|
2
|
+
|
|
3
|
+
elf.customStyles.define('ef-swing-gauge', ':host{--primary-color:#EE7600;--secondary-color:#3780BF;--border-color:#000000;--center-line:solid;--center-line-color:#000000;--center-line-opacity:0.6;--primary-color:#2EB4C9;--secondary-color:#C93C4B;--border-color:#000000;--center-line:solid;--center-line-color:#000000;--center-line-opacity:0.6}:host [part=legend-container-outer]{padding-bottom:30px}:host [part=primary-legend],:host [part=secondary-legend]{margin-top:4px;align-items:center}:host [part=primary-legend-symbol],:host [part=secondary-legend-symbol]{height:12px;width:12px;border-radius:50%;margin-right:10px;align-self:baseline;margin-top:1px}:host [part=primary-legend-symbol]{background-color:var(--primary-color)}:host [part=secondary-legend-symbol]{background-color:var(--secondary-color)}:host [part=primary-value],:host [part=secondary-value]{font-weight:500}');
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
declare type SwingGaugeValueFormatter = (value: number, rawValue?: number) => string | number | undefined;
|
|
2
|
+
interface SwingGaugeData {
|
|
3
|
+
size: number;
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
fillPercentage?: number;
|
|
7
|
+
gaugeWidthScale: number;
|
|
8
|
+
gaugeHeightScale: number;
|
|
9
|
+
gaugeUpperBound: number;
|
|
10
|
+
gaugeLowerBound: number;
|
|
11
|
+
lineLength: number;
|
|
12
|
+
offsetLeftPrimaryLine: number;
|
|
13
|
+
offsetTopPrimaryLine: number;
|
|
14
|
+
offsetLeftPrimaryPoint: number;
|
|
15
|
+
offsetTopPrimaryPoint: number;
|
|
16
|
+
offsetLeftSecondaryLine: number;
|
|
17
|
+
offsetTopSecondaryLine: number;
|
|
18
|
+
offsetLeftSecondaryPoint: number;
|
|
19
|
+
offsetTopSecondaryPoint: number;
|
|
20
|
+
}
|
|
21
|
+
interface SwingGaugeStyle {
|
|
22
|
+
strokeWidth: number;
|
|
23
|
+
primaryColor: string;
|
|
24
|
+
secondaryColor: string;
|
|
25
|
+
borderColor: string;
|
|
26
|
+
centerline: string;
|
|
27
|
+
centerlineOpacity: string;
|
|
28
|
+
centerlineColor: string;
|
|
29
|
+
}
|
|
30
|
+
interface SwingGaugeCanvasSize {
|
|
31
|
+
width: number;
|
|
32
|
+
height: number;
|
|
33
|
+
}
|
|
34
|
+
export { SwingGaugeData, SwingGaugeStyle, SwingGaugeCanvasSize, SwingGaugeValueFormatter };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -52,6 +52,12 @@
|
|
|
52
52
|
"description": "Set disabled state",
|
|
53
53
|
"type": "boolean",
|
|
54
54
|
"default": "false"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"name": "value",
|
|
58
|
+
"description": "Tab's value",
|
|
59
|
+
"type": "string",
|
|
60
|
+
"default": "\"\""
|
|
55
61
|
}
|
|
56
62
|
],
|
|
57
63
|
"properties": [
|
|
@@ -110,6 +116,13 @@
|
|
|
110
116
|
"description": "Set disabled state",
|
|
111
117
|
"type": "boolean",
|
|
112
118
|
"default": "false"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"name": "value",
|
|
122
|
+
"attribute": "value",
|
|
123
|
+
"description": "Tab's value",
|
|
124
|
+
"type": "string",
|
|
125
|
+
"default": "\"\""
|
|
113
126
|
}
|
|
114
127
|
],
|
|
115
128
|
"events": [
|
|
@@ -14,6 +14,7 @@ A building block for individual tab
|
|
|
14
14
|
| `label` | `label` | `string` | "" | Specify tab's label text |
|
|
15
15
|
| `lineClamp` | `line-clamp` | `number` | 1 | Limit the number of lines before truncating |
|
|
16
16
|
| `subLabel` | `sub-label` | `string` | "" | Specify tab's sub-label text |
|
|
17
|
+
| `value` | `value` | `string` | "" | Tab's value |
|
|
17
18
|
|
|
18
19
|
## Events
|
|
19
20
|
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { JSXInterface } from '../jsx';
|
|
2
|
+
import { TemplateResult, CSSResultGroup, ControlElement, PropertyValues } from '@refinitiv-ui/core';
|
|
3
|
+
import '../icon/index.js';
|
|
4
|
+
import '../label/index.js';
|
|
5
|
+
/**
|
|
6
|
+
* A building block for individual tab
|
|
7
|
+
* @attr {boolean} disabled - Set disabled state
|
|
8
|
+
* @prop {boolean} [disabled=false] - Set disabled state
|
|
9
|
+
*
|
|
10
|
+
* @attr {string} value - Tab's value
|
|
11
|
+
* @prop {string} [value=""] - Tab's value
|
|
12
|
+
*
|
|
13
|
+
* @fires clear - Dispatched when click on cross button occurs
|
|
14
|
+
*/
|
|
15
|
+
export declare class Tab extends ControlElement {
|
|
16
|
+
/**
|
|
17
|
+
* Element version number
|
|
18
|
+
* @returns version number
|
|
19
|
+
*/
|
|
20
|
+
static get version(): string;
|
|
21
|
+
protected readonly defaultRole = "tab";
|
|
22
|
+
/**
|
|
23
|
+
* A `CSSResultGroup` that will be used
|
|
24
|
+
* to style the host, slotted children
|
|
25
|
+
* and the internal template of the element.
|
|
26
|
+
* @returns CSS template
|
|
27
|
+
*/
|
|
28
|
+
static get styles(): CSSResultGroup;
|
|
29
|
+
/**
|
|
30
|
+
* Specify icon name to display in tab
|
|
31
|
+
*/
|
|
32
|
+
icon: string;
|
|
33
|
+
/**
|
|
34
|
+
* Specify tab's label text
|
|
35
|
+
*/
|
|
36
|
+
label: string;
|
|
37
|
+
/**
|
|
38
|
+
* Specify tab's sub-label text
|
|
39
|
+
*/
|
|
40
|
+
subLabel: string;
|
|
41
|
+
/**
|
|
42
|
+
* Specify tab's active status
|
|
43
|
+
*/
|
|
44
|
+
active: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Set tab to clearable
|
|
47
|
+
*/
|
|
48
|
+
clears: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Limit the number of lines before truncating
|
|
51
|
+
*/
|
|
52
|
+
lineClamp: number;
|
|
53
|
+
/**
|
|
54
|
+
* Set tab to clearable on hover
|
|
55
|
+
*/
|
|
56
|
+
clearsOnHover: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Use level styling from theme
|
|
59
|
+
* @ignore
|
|
60
|
+
*/
|
|
61
|
+
level: '1' | '2' | '3';
|
|
62
|
+
/**
|
|
63
|
+
* True, if there is slotted content
|
|
64
|
+
*/
|
|
65
|
+
private isSlotHasContent;
|
|
66
|
+
/**
|
|
67
|
+
* Called after the element’s DOM has been updated the first time.
|
|
68
|
+
* @param changedProperties Properties that has changed
|
|
69
|
+
* @returns {void}
|
|
70
|
+
*/
|
|
71
|
+
protected firstUpdated(changedProperties: PropertyValues): void;
|
|
72
|
+
/**
|
|
73
|
+
* Compute property values that depend on other properties
|
|
74
|
+
* and are used in the rest of the update process.
|
|
75
|
+
* @param changedProperties Properties that has changed
|
|
76
|
+
* @returns {void}
|
|
77
|
+
*/
|
|
78
|
+
protected willUpdate(changedProperties: PropertyValues): void;
|
|
79
|
+
/**
|
|
80
|
+
* Run on default slot slotchange
|
|
81
|
+
* @param event slotchange
|
|
82
|
+
* @returns {void}
|
|
83
|
+
*/
|
|
84
|
+
private onSlotChange;
|
|
85
|
+
/**
|
|
86
|
+
* Omitted lineClamp if subLabel is provided
|
|
87
|
+
* @returns line Clamp value
|
|
88
|
+
*/
|
|
89
|
+
private getLineClamp;
|
|
90
|
+
/**
|
|
91
|
+
* Handles key down event
|
|
92
|
+
* @param event Key down event object
|
|
93
|
+
* @returns {void}
|
|
94
|
+
*/
|
|
95
|
+
private onKeyDown;
|
|
96
|
+
/**
|
|
97
|
+
* @param event event from close button
|
|
98
|
+
* @returns {void}
|
|
99
|
+
*/
|
|
100
|
+
private handleClickClear;
|
|
101
|
+
/**
|
|
102
|
+
* Show Close Button if allow clears
|
|
103
|
+
* @returns close button template
|
|
104
|
+
*/
|
|
105
|
+
private get CloseTemplate();
|
|
106
|
+
/**
|
|
107
|
+
* Create ef-label template when label is true
|
|
108
|
+
* @returns Label template
|
|
109
|
+
*/
|
|
110
|
+
private get LabelTemplate();
|
|
111
|
+
/**
|
|
112
|
+
* Create ef-label template when subLabel is true
|
|
113
|
+
* @returns SubLabel template
|
|
114
|
+
*/
|
|
115
|
+
private get SubLabelTemplate();
|
|
116
|
+
/**
|
|
117
|
+
* A `TemplateResult` that will be used
|
|
118
|
+
* to render the updated internal template.
|
|
119
|
+
* @return Render template
|
|
120
|
+
*/
|
|
121
|
+
protected render(): TemplateResult;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
declare global {
|
|
125
|
+
interface HTMLElementTagNameMap {
|
|
126
|
+
'ef-tab': Tab;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
namespace JSX {
|
|
130
|
+
interface IntrinsicElements {
|
|
131
|
+
'ef-tab': Partial<Tab> | JSXInterface.ControlHTMLAttributes<Tab>;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export {};
|
package/lib/tab/index.js
ADDED
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { html, css, ControlElement } 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 { state } from '@refinitiv-ui/core/lib/decorators/state.js';
|
|
6
|
+
import { isSlotEmpty } from '@refinitiv-ui/utils/lib/is-slot-empty.js';
|
|
7
|
+
import { VERSION } from '../version.js';
|
|
8
|
+
import '../icon/index.js';
|
|
9
|
+
import '../label/index.js';
|
|
10
|
+
/**
|
|
11
|
+
* A building block for individual tab
|
|
12
|
+
* @attr {boolean} disabled - Set disabled state
|
|
13
|
+
* @prop {boolean} [disabled=false] - Set disabled state
|
|
14
|
+
*
|
|
15
|
+
* @attr {string} value - Tab's value
|
|
16
|
+
* @prop {string} [value=""] - Tab's value
|
|
17
|
+
*
|
|
18
|
+
* @fires clear - Dispatched when click on cross button occurs
|
|
19
|
+
*/
|
|
20
|
+
let Tab = class Tab extends ControlElement {
|
|
21
|
+
constructor() {
|
|
22
|
+
super(...arguments);
|
|
23
|
+
this.defaultRole = 'tab';
|
|
24
|
+
/**
|
|
25
|
+
* Specify icon name to display in tab
|
|
26
|
+
*/
|
|
27
|
+
this.icon = '';
|
|
28
|
+
/**
|
|
29
|
+
* Specify tab's label text
|
|
30
|
+
*/
|
|
31
|
+
this.label = '';
|
|
32
|
+
/**
|
|
33
|
+
* Specify tab's sub-label text
|
|
34
|
+
*/
|
|
35
|
+
this.subLabel = '';
|
|
36
|
+
/**
|
|
37
|
+
* Specify tab's active status
|
|
38
|
+
*/
|
|
39
|
+
this.active = false;
|
|
40
|
+
/**
|
|
41
|
+
* Set tab to clearable
|
|
42
|
+
*/
|
|
43
|
+
this.clears = false;
|
|
44
|
+
/**
|
|
45
|
+
* Limit the number of lines before truncating
|
|
46
|
+
*/
|
|
47
|
+
this.lineClamp = 1;
|
|
48
|
+
/**
|
|
49
|
+
* Set tab to clearable on hover
|
|
50
|
+
*/
|
|
51
|
+
this.clearsOnHover = false;
|
|
52
|
+
/**
|
|
53
|
+
* Use level styling from theme
|
|
54
|
+
* @ignore
|
|
55
|
+
*/
|
|
56
|
+
this.level = '1';
|
|
57
|
+
/**
|
|
58
|
+
* True, if there is slotted content
|
|
59
|
+
*/
|
|
60
|
+
this.isSlotHasContent = false;
|
|
61
|
+
/**
|
|
62
|
+
* Run on default slot slotchange
|
|
63
|
+
* @param event slotchange
|
|
64
|
+
* @returns {void}
|
|
65
|
+
*/
|
|
66
|
+
this.onSlotChange = (event) => {
|
|
67
|
+
const slot = event.target;
|
|
68
|
+
this.isSlotHasContent = !!slot.assignedNodes().length && isSlotEmpty(slot);
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Element version number
|
|
73
|
+
* @returns version number
|
|
74
|
+
*/
|
|
75
|
+
static get version() {
|
|
76
|
+
return VERSION;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* A `CSSResultGroup` that will be used
|
|
80
|
+
* to style the host, slotted children
|
|
81
|
+
* and the internal template of the element.
|
|
82
|
+
* @returns CSS template
|
|
83
|
+
*/
|
|
84
|
+
static get styles() {
|
|
85
|
+
return css `
|
|
86
|
+
:host {
|
|
87
|
+
display: inline-flex;
|
|
88
|
+
flex-shrink: 0;
|
|
89
|
+
}
|
|
90
|
+
`;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Called after the element’s DOM has been updated the first time.
|
|
94
|
+
* @param changedProperties Properties that has changed
|
|
95
|
+
* @returns {void}
|
|
96
|
+
*/
|
|
97
|
+
firstUpdated(changedProperties) {
|
|
98
|
+
super.firstUpdated(changedProperties);
|
|
99
|
+
this.addEventListener('keydown', this.onKeyDown);
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Compute property values that depend on other properties
|
|
103
|
+
* and are used in the rest of the update process.
|
|
104
|
+
* @param changedProperties Properties that has changed
|
|
105
|
+
* @returns {void}
|
|
106
|
+
*/
|
|
107
|
+
willUpdate(changedProperties) {
|
|
108
|
+
super.willUpdate(changedProperties);
|
|
109
|
+
if (changedProperties.has('active')) {
|
|
110
|
+
this.setAttribute('aria-selected', this.active ? 'true' : 'false');
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Omitted lineClamp if subLabel is provided
|
|
115
|
+
* @returns line Clamp value
|
|
116
|
+
*/
|
|
117
|
+
getLineClamp() {
|
|
118
|
+
return !this.lineClamp ? 0 : this.subLabel ? 1 : this.lineClamp;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Handles key down event
|
|
122
|
+
* @param event Key down event object
|
|
123
|
+
* @returns {void}
|
|
124
|
+
*/
|
|
125
|
+
onKeyDown(event) {
|
|
126
|
+
if (event.defaultPrevented) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
if (event.key === 'Delete' && (this.clears || this.clearsOnHover)) {
|
|
130
|
+
this.dispatchEvent(new CustomEvent('clear'));
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* @param event event from close button
|
|
135
|
+
* @returns {void}
|
|
136
|
+
*/
|
|
137
|
+
handleClickClear(event) {
|
|
138
|
+
event.stopPropagation();
|
|
139
|
+
/**
|
|
140
|
+
* Fires when click on cross occurs
|
|
141
|
+
*/
|
|
142
|
+
this.dispatchEvent(new CustomEvent('clear'));
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Show Close Button if allow clears
|
|
146
|
+
* @returns close button template
|
|
147
|
+
*/
|
|
148
|
+
get CloseTemplate() {
|
|
149
|
+
return this.clears || this.clearsOnHover ? html `
|
|
150
|
+
<div part="close-container">
|
|
151
|
+
<ef-icon part="close" icon="cross" @tap="${this.handleClickClear}"></ef-icon>
|
|
152
|
+
</div>
|
|
153
|
+
` : null;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Create ef-label template when label is true
|
|
157
|
+
* @returns Label template
|
|
158
|
+
*/
|
|
159
|
+
get LabelTemplate() {
|
|
160
|
+
if (!this.label || this.isSlotHasContent) {
|
|
161
|
+
return null;
|
|
162
|
+
}
|
|
163
|
+
return html `
|
|
164
|
+
<ef-label
|
|
165
|
+
part="label"
|
|
166
|
+
.lineClamp=${this.getLineClamp()}>
|
|
167
|
+
${this.label}
|
|
168
|
+
</ef-label>
|
|
169
|
+
`;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Create ef-label template when subLabel is true
|
|
173
|
+
* @returns SubLabel template
|
|
174
|
+
*/
|
|
175
|
+
get SubLabelTemplate() {
|
|
176
|
+
if (!this.subLabel || this.isSlotHasContent) {
|
|
177
|
+
return null;
|
|
178
|
+
}
|
|
179
|
+
return html `
|
|
180
|
+
<ef-label
|
|
181
|
+
part="sub-label"
|
|
182
|
+
.lineClamp=${this.getLineClamp()}>
|
|
183
|
+
${this.subLabel}
|
|
184
|
+
</ef-label>
|
|
185
|
+
`;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* A `TemplateResult` that will be used
|
|
189
|
+
* to render the updated internal template.
|
|
190
|
+
* @return Render template
|
|
191
|
+
*/
|
|
192
|
+
render() {
|
|
193
|
+
return html `
|
|
194
|
+
${this.icon ? html `<ef-icon icon=${this.icon} part="icon"></ef-icon>` : null}
|
|
195
|
+
<div part="label-container">
|
|
196
|
+
${this.LabelTemplate}
|
|
197
|
+
${this.SubLabelTemplate}
|
|
198
|
+
<slot @slotchange="${this.onSlotChange}"></slot>
|
|
199
|
+
</div>
|
|
200
|
+
${this.CloseTemplate}
|
|
201
|
+
`;
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
__decorate([
|
|
205
|
+
property({ type: String })
|
|
206
|
+
], Tab.prototype, "icon", void 0);
|
|
207
|
+
__decorate([
|
|
208
|
+
property({ type: String })
|
|
209
|
+
], Tab.prototype, "label", void 0);
|
|
210
|
+
__decorate([
|
|
211
|
+
property({ type: String, attribute: 'sub-label' })
|
|
212
|
+
], Tab.prototype, "subLabel", void 0);
|
|
213
|
+
__decorate([
|
|
214
|
+
property({ type: Boolean, reflect: true })
|
|
215
|
+
], Tab.prototype, "active", void 0);
|
|
216
|
+
__decorate([
|
|
217
|
+
property({ type: Boolean, reflect: true })
|
|
218
|
+
], Tab.prototype, "clears", void 0);
|
|
219
|
+
__decorate([
|
|
220
|
+
property({ type: Number, reflect: true, attribute: 'line-clamp' })
|
|
221
|
+
], Tab.prototype, "lineClamp", void 0);
|
|
222
|
+
__decorate([
|
|
223
|
+
property({ type: Boolean, reflect: true, attribute: 'clears-on-hover' })
|
|
224
|
+
], Tab.prototype, "clearsOnHover", void 0);
|
|
225
|
+
__decorate([
|
|
226
|
+
property({ type: String, reflect: true })
|
|
227
|
+
], Tab.prototype, "level", void 0);
|
|
228
|
+
__decorate([
|
|
229
|
+
state()
|
|
230
|
+
], Tab.prototype, "isSlotHasContent", void 0);
|
|
231
|
+
Tab = __decorate([
|
|
232
|
+
customElement('ef-tab', {
|
|
233
|
+
alias: 'coral-tab'
|
|
234
|
+
})
|
|
235
|
+
], Tab);
|
|
236
|
+
export { Tab };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import '@refinitiv-ui/elements/lib/icon/themes/halo/dark';
|
|
2
|
+
import '@refinitiv-ui/elements/lib/label/themes/halo/dark';
|
|
3
|
+
|
|
4
|
+
elf.customStyles.define('ef-tab', ':host{cursor:pointer;background-color:#404040;color:#ccc;height:36px;padding:9px 12px;outline:0;font-size:12rem;font-weight:500;transition:120ms;position:relative;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;align-items:center;justify-content:center;touch-action:manipulation}:host [part=icon]{min-width:1em;font-size:1.5em}:host [part=label-container]{display:flex;align-items:flex-start;flex-direction:column;width:100%;min-width:0}:host(:not([sub-label])) [part=label-container]{align-items:center}:host([icon]) [part=label-container]{padding-left:.3em}:host [part=sub-label]{font-weight:400;font-size:.875em}:host(:not([active]):not(:active):not(:hover)) [part=sub-label]{opacity:.7}:host([sub-label]){height:46px}:host([sub-label]) [part=icon]{font-size:1.8em}:host([sub-label]) [part=close]{font-size:1.25em}:host([sub-label][clears]){padding-right:2.5em}:host([line-clamp="2"]),:host([line-clamp="3"]){height:46px}:host([icon][sub-label]) [part=label-container]{padding-left:.5em}:host([clears]){padding-right:2em}:host [part=close-container]{position:absolute;top:0;right:0;bottom:0;display:flex;justify-content:center;align-items:center}:host [part=close]{margin-right:.5em;min-width:1em;font-size:1em}:host([clears-on-hover]) [part=close]{color:#fff}:host([clears-on-hover]) [part=close-container]{width:2em;opacity:0;transition:120ms;background:#334bff;box-shadow:-1em 0 .75em -.5em #334bff}:host([active]){color:#fff;background-color:#334bff}:host([active]:hover){background-color:#4158ff}:host([active]:hover[clears-on-hover]) [part=close-container]{background-color:#4158ff;box-shadow:-1em 0 .75em -.5em #4158ff}:host([active]:active){background-color:#0f1e8a}:host([active]:active[clears-on-hover]) [part=close-container]{background-color:#0f1e8a;box-shadow:-1em 0 .75em -.5em #0f1e8a}:host([active][disabled]){color:rgba(255,255,255,.5);background-color:rgba(51,75,255,.5)}:host([disabled]){pointer-events:none;color:rgba(204,204,204,.5);background-color:rgba(64,64,64,.5)}:host(:focus:not([focused])),:host([focused=visible]){box-shadow:none;background-color:#4158ff}:host(:focus:not([focused]):not([active]):not(:hover)),:host([focused=visible]:not([active]):not(:hover)){color:#6678ff;background-color:#404040}:host(:hover){color:#fff;box-shadow:0 0 0 0 rgba(0,0,0,.8);background-color:#334bff}:host(:hover[clears-on-hover]) [part=close-container]{opacity:1}:host(:active){color:#fff;background-color:#0f1e8a}:host(:active[clears-on-hover]) [part=close-container]{background-color:#0f1e8a;box-shadow:-1em 0 .75em -.5em #0f1e8a}:host([level="1"]){border-right:1px solid #0d0d0d}:host([level="2"]:not(:last-child)){border-right:none}:host([level="2"]:not(:last-child)) [part=label-container]::after{content:\'\';position:absolute;margin:auto;width:1px;background:#404040;height:70%;right:0;top:0;bottom:0;z-index:1}:host([level="2"]:not(:active):not([active]):not(:hover)){background-color:#262626}:host([level="2"][active]:not(:active):not(:hover)){color:#6678ff;background-color:#0d0d0d}:host([level="2"][active]:focus:not([focused])),:host([level="2"][focused=visible]:not(:active):not(:hover)){color:#6678ff}:host([level="3"]){border-bottom:2px solid transparent;color:#ccc;background-color:#0d0d0d}:host([level="3"][clears-on-hover]) [part=close-container]{background:#0d0d0d;box-shadow:-1em 0 .75em -.5em #0d0d0d}:host([level="3"]:focus:not([focused])),:host([level="3"][focused=visible]){color:#fff;background-color:#262626}:host([level="3"]:active),:host([level="3"]:hover),:host([level="3"][active]){color:#fff;background-color:#0d0d0d;border-color:#334bff}:host([level="3"]:active) [part=close-container],:host([level="3"]:hover) [part=close-container],:host([level="3"][active]) [part=close-container]{background:#0d0d0d;box-shadow:-1em 0 .75em -.5em #0d0d0d}:host([level="3"]:active) [part=close],:host([level="3"]:hover) [part=close],:host([level="3"][active]) [part=close]{color:#fff}:host([level="3"]:active){border-color:#0f1e8a}');
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import '@refinitiv-ui/elements/lib/icon/themes/halo/light';
|
|
2
|
+
import '@refinitiv-ui/elements/lib/label/themes/halo/light';
|
|
3
|
+
|
|
4
|
+
elf.customStyles.define('ef-tab', ':host{cursor:pointer;background-color:#e6e6e6;color:#0d0d0d;height:36px;padding:9px 12px;outline:0;font-size:12rem;font-weight:500;transition:120ms;position:relative;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;align-items:center;justify-content:center;touch-action:manipulation}:host [part=icon]{min-width:1em;font-size:1.5em}:host [part=label-container]{display:flex;align-items:flex-start;flex-direction:column;width:100%;min-width:0}:host(:not([sub-label])) [part=label-container]{align-items:center}:host([icon]) [part=label-container]{padding-left:.3em}:host [part=sub-label]{font-weight:400;font-size:.875em}:host(:not([active]):not(:active):not(:hover)) [part=sub-label]{opacity:.7}:host([sub-label]){height:46px}:host([sub-label]) [part=icon]{font-size:1.8em}:host([sub-label]) [part=close]{font-size:1.25em}:host([sub-label][clears]){padding-right:2.5em}:host([line-clamp="2"]),:host([line-clamp="3"]){height:46px}:host([icon][sub-label]) [part=label-container]{padding-left:.5em}:host([clears]){padding-right:2em}:host [part=close-container]{position:absolute;top:0;right:0;bottom:0;display:flex;justify-content:center;align-items:center}:host [part=close]{margin-right:.5em;min-width:1em;font-size:1em}:host([clears-on-hover]) [part=close]{color:#fff}:host([clears-on-hover]) [part=close-container]{width:2em;opacity:0;transition:120ms;background:#334bff;box-shadow:-1em 0 .75em -.5em #334bff}:host([active]){color:#fff;background-color:#334bff}:host([active]:hover){background-color:#4158ff}:host([active]:hover[clears-on-hover]) [part=close-container]{background-color:#4158ff;box-shadow:-1em 0 .75em -.5em #4158ff}:host([active]:active){background-color:#0f1e8a}:host([active]:active[clears-on-hover]) [part=close-container]{background-color:#0f1e8a;box-shadow:-1em 0 .75em -.5em #0f1e8a}:host([active][disabled]){color:rgba(255,255,255,.5);background-color:rgba(51,75,255,.5)}:host([disabled]){pointer-events:none;color:rgba(13,13,13,.5);background-color:rgba(230,230,230,.5)}:host(:focus:not([focused])),:host([focused=visible]){box-shadow:none;background-color:#4158ff}:host(:focus:not([focused]):not([active]):not(:hover)),:host([focused=visible]:not([active]):not(:hover)){color:#6678ff;background-color:#e6e6e6}:host(:hover){color:#fff;box-shadow:0 0 0 0 rgba(0,0,0,.55);background-color:#334bff}:host(:hover[clears-on-hover]) [part=close-container]{opacity:1}:host(:active){color:#fff;background-color:#0f1e8a}:host(:active[clears-on-hover]) [part=close-container]{background-color:#0f1e8a;box-shadow:-1em 0 .75em -.5em #0f1e8a}:host([level="1"]){border-right:1px solid #fff}:host([level="2"]:not(:last-child)){border-right:none}:host([level="2"]:not(:last-child)) [part=label-container]::after{content:\'\';position:absolute;margin:auto;width:1px;background:#d9d9d9;height:70%;right:0;top:0;bottom:0;z-index:1}:host([level="2"]:not(:active):not([active]):not(:hover)){background-color:#f2f2f2}:host([level="2"][active]:not(:active):not(:hover)){color:#334bff;background-color:#fff}:host([level="2"][active]:focus:not([focused])),:host([level="2"][focused=visible]:not(:active):not(:hover)){color:#6678ff}:host([level="3"]){border-bottom:2px solid transparent;color:#404040;background-color:#fff}:host([level="3"][clears-on-hover]) [part=close-container]{background:#fff;box-shadow:-1em 0 .75em -.5em #fff}:host([level="3"]:focus:not([focused])),:host([level="3"][focused=visible]){color:#0d0d0d;background-color:#f2f2f2}:host([level="3"]:active),:host([level="3"]:hover),:host([level="3"][active]){color:#0d0d0d;background-color:#fff;border-color:#334bff}:host([level="3"]:active) [part=close-container],:host([level="3"]:hover) [part=close-container],:host([level="3"][active]) [part=close-container]{background:#fff;box-shadow:-1em 0 .75em -.5em #fff}:host([level="3"]:active) [part=close],:host([level="3"]:hover) [part=close],:host([level="3"][active]) [part=close]{color:#0d0d0d}:host([level="3"]:active){border-color:#0f1e8a}');
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import '@refinitiv-ui/elements/lib/icon/themes/solar/charcoal';
|
|
2
|
+
import '@refinitiv-ui/elements/lib/label/themes/solar/charcoal';
|
|
3
|
+
|
|
4
|
+
elf.customStyles.define('ef-tab', ':host{cursor:pointer;background-color:#3c3c42;color:#c2c2c2;height:23px;padding:7px 15px;outline:0;font-size:13rem;font-weight:500;transition:70ms;position:relative;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;align-items:center;justify-content:center;touch-action:manipulation;border:1px solid #000;border-left:none}:host [part=label-container]{display:flex;align-items:flex-start;flex-direction:column;width:100%;min-width:0}:host(:not([sub-label])) [part=label-container]{align-items:center}:host([icon]) [part=label-container]{padding-left:.3em}:host [part=sub-label]{font-weight:400;font-size:.875em}:host(:not([active]):not(:active):not(:hover)) [part=sub-label]{opacity:.7}:host([sub-label]){height:33px}:host([sub-label]) [part=close]{font-size:1.25em}:host([sub-label][clears]){padding-right:2.5em}:host([line-clamp="2"]),:host([line-clamp="3"]){height:33px}:host([icon][sub-label]) [part=label-container]{padding-left:.5em}:host([clears]){padding-right:2em}:host [part=close-container]{position:absolute;top:0;right:0;bottom:0;display:flex;justify-content:center;align-items:center}:host [part=close]{margin-right:.5em;min-width:1em;font-size:1em}:host([clears-on-hover]) [part=close]{color:#e2e2e2}:host([clears-on-hover]) [part=close-container]{width:2em;opacity:0;transition:70ms;background:#4a4a4f;box-shadow:-1em 0 .75em -.5em #4a4a4f}:host([active]){color:#0a0a0a;background-color:#f93}:host([active]:hover[clears-on-hover]) [part=close-container]{background-color:#ffa041;box-shadow:-1em 0 .75em -.5em #ffa041}:host([active]:active){background-color:#ed8e2f}:host([active]:active[clears-on-hover]) [part=close-container]{background-color:#ed8e2f;box-shadow:-1em 0 .75em -.5em #ed8e2f}:host([active][disabled]){background-color:#ffad5c;color:rgba(10,10,10,.7)}:host([disabled]){pointer-events:none;color:#c2c2c2;background-color:#636368}:host(:focus:not([focused])),:host([focused=visible]){box-shadow:none;background-color:#ffa041}:host(:focus:not([focused]):not([active]):not(:hover)),:host([focused=visible]:not([active]):not(:hover)){color:#e2e2e2;background-color:#3c3c42}:host(:hover){color:#e2e2e2;box-shadow:0 0 0 0 rgba(0,0,0,.9);background-color:#4a4a4f}:host(:hover[clears-on-hover]) [part=close-container]{opacity:1}:host(:active){color:#c2c2c2;background-color:#38383d}:host(:active[clears-on-hover]) [part=close-container]{background-color:#38383d;box-shadow:-1em 0 .75em -.5em #38383d}:host [part=icon]{min-width:1em;font-size:1em}:host([sub-label]) [part=icon]{font-size:1.2em}:host([active]:hover){color:#0a0a0a;background-color:#ffb366}');
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import '@refinitiv-ui/elements/lib/icon/themes/solar/pearl';
|
|
2
|
+
import '@refinitiv-ui/elements/lib/label/themes/solar/pearl';
|
|
3
|
+
|
|
4
|
+
elf.customStyles.define('ef-tab', ':host{cursor:pointer;background-color:#fafbfc;color:#505050;height:23px;padding:7px 15px;outline:0;font-size:13rem;font-weight:500;transition:70ms;position:relative;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;align-items:center;justify-content:center;touch-action:manipulation;border:1px solid #a9afba;border-left:none}:host [part=label-container]{display:flex;align-items:flex-start;flex-direction:column;width:100%;min-width:0}:host(:not([sub-label])) [part=label-container]{align-items:center}:host([icon]) [part=label-container]{padding-left:.3em}:host [part=sub-label]{font-weight:400;font-size:.875em}:host(:not([active]):not(:active):not(:hover)) [part=sub-label]{opacity:.7}:host([sub-label]){height:33px}:host([sub-label]) [part=close]{font-size:1.25em}:host([sub-label][clears]){padding-right:2.5em}:host([line-clamp="2"]),:host([line-clamp="3"]){height:33px}:host([icon][sub-label]) [part=label-container]{padding-left:.5em}:host([clears]){padding-right:2em}:host [part=close-container]{position:absolute;top:0;right:0;bottom:0;display:flex;justify-content:center;align-items:center}:host [part=close]{margin-right:.5em;min-width:1em;font-size:1em}:host([clears-on-hover]) [part=close]{color:#1d1d1d}:host([clears-on-hover]) [part=close-container]{width:2em;opacity:0;transition:70ms;background:#fafbfc;box-shadow:-1em 0 .75em -.5em #fafbfc}:host([active]){color:#505050;background-color:#ffb266}:host([active]:hover[clears-on-hover]) [part=close-container]{background-color:#ffb771;box-shadow:-1em 0 .75em -.5em #ffb771}:host([active]:active){background-color:#eda65f}:host([active]:active[clears-on-hover]) [part=close-container]{background-color:#eda65f;box-shadow:-1em 0 .75em -.5em #eda65f}:host([active][disabled]){color:#a8896a;background-color:#ffc185}:host([disabled]){pointer-events:none;color:#505050;background-color:#fbfcfd}:host(:focus:not([focused])),:host([focused=visible]){box-shadow:none;background-color:#ffb771}:host(:focus:not([focused]):not([active]):not(:hover)),:host([focused=visible]:not([active]):not(:hover)){color:#1d1d1d;background-color:#fafbfc}:host(:hover){color:#1d1d1d;box-shadow:0 0 0 0 rgba(0,0,0,.6);background-color:#fafbfc}:host(:hover[clears-on-hover]) [part=close-container]{opacity:1}:host(:active){color:#505050;background-color:#e8e9ea}:host(:active[clears-on-hover]) [part=close-container]{background-color:#e8e9ea;box-shadow:-1em 0 .75em -.5em #e8e9ea}:host [part=icon]{min-width:1em;font-size:1em}:host([sub-label]) [part=icon]{font-size:1.2em}:host([active]:hover){color:#505050;background-color:#fc9}');
|
|
@@ -45,6 +45,18 @@
|
|
|
45
45
|
"description": "Use to switch from horizontal to vertical layout.",
|
|
46
46
|
"type": "boolean",
|
|
47
47
|
"default": "false"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"name": "value",
|
|
51
|
+
"description": "Value of tab-bar, derived from value of an active tab.",
|
|
52
|
+
"type": "string",
|
|
53
|
+
"default": "\"\""
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
"events": [
|
|
57
|
+
{
|
|
58
|
+
"name": "value-changed",
|
|
59
|
+
"description": "Fired when the `value` changes."
|
|
48
60
|
}
|
|
49
61
|
]
|
|
50
62
|
}
|
|
@@ -8,4 +8,11 @@ Container for tabs
|
|
|
8
8
|
|-------------|-------------|---------------------------------|---------|--------------------------------------------------|
|
|
9
9
|
| `alignment` | `alignment` | `"left" \| "center" \| "right"` | "left" | Specify tab's horizontal alignment |
|
|
10
10
|
| `level` | `level` | `"1" \| "2" \| "3"` | "1" | Use level styling from theme |
|
|
11
|
+
| `value` | | `string` | "" | Value of tab-bar, derived from value of an active tab. |
|
|
11
12
|
| `vertical` | `vertical` | `boolean` | false | Use to switch from horizontal to vertical layout. |
|
|
13
|
+
|
|
14
|
+
## Events
|
|
15
|
+
|
|
16
|
+
| Event | Description |
|
|
17
|
+
|-----------------|---------------------------------|
|
|
18
|
+
| `value-changed` | Fired when the `value` changes. |
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
interface Configs {
|
|
2
|
+
target: HTMLElement;
|
|
3
|
+
startPosition: number;
|
|
4
|
+
endPosition: number;
|
|
5
|
+
duration?: number;
|
|
6
|
+
easing?: string;
|
|
7
|
+
complete?: () => void;
|
|
8
|
+
}
|
|
9
|
+
declare const ANIMATION_DURATION = 100;
|
|
10
|
+
/**
|
|
11
|
+
* Common easing equations from https://easings.net
|
|
12
|
+
* @param configs animate config
|
|
13
|
+
* @returns {void}
|
|
14
|
+
*/
|
|
15
|
+
declare const tweenAnimate: (configs: Configs) => void;
|
|
16
|
+
export { tweenAnimate, ANIMATION_DURATION };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
var Easings;
|
|
2
|
+
(function (Easings) {
|
|
3
|
+
Easings["EaseOutQuad"] = "easeOutQuad";
|
|
4
|
+
})(Easings || (Easings = {}));
|
|
5
|
+
const ANIMATION_DURATION = 100; // specifies the length of time an animation should take to complete
|
|
6
|
+
const DEFAULT_EASING = Easings.EaseOutQuad;
|
|
7
|
+
/**
|
|
8
|
+
* Common easing equations from https://easings.net
|
|
9
|
+
* @param name type of easing
|
|
10
|
+
* @returns easing function
|
|
11
|
+
*/
|
|
12
|
+
const functionEasings = {
|
|
13
|
+
/**
|
|
14
|
+
* Decelerating to zero velocity
|
|
15
|
+
* @param time current time or position
|
|
16
|
+
* @returns easing value
|
|
17
|
+
*/
|
|
18
|
+
easeOutQuad: (time) => {
|
|
19
|
+
return time * (2 - time);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Common easing equations from https://easings.net
|
|
24
|
+
* @param configs animate config
|
|
25
|
+
* @returns {void}
|
|
26
|
+
*/
|
|
27
|
+
const tweenAnimate = (configs) => {
|
|
28
|
+
let animate;
|
|
29
|
+
const { target, startPosition, endPosition, duration = ANIMATION_DURATION, easing = DEFAULT_EASING, complete } = configs;
|
|
30
|
+
if (!target) {
|
|
31
|
+
throw new TypeError('No target argument passed');
|
|
32
|
+
}
|
|
33
|
+
const startTime = 'now' in window.performance ? performance.now() : new Date().getTime();
|
|
34
|
+
const delta = endPosition - startPosition;
|
|
35
|
+
const tweenLoop = () => {
|
|
36
|
+
const currentTime = 'now' in window.performance ? performance.now() : new Date().getTime();
|
|
37
|
+
const step = Math.min(1, ((currentTime - startTime) / duration));
|
|
38
|
+
const factor = functionEasings[easing](step); // factor can be a decimal
|
|
39
|
+
configs.target.scrollLeft = startPosition + delta * factor;
|
|
40
|
+
if (step < 1 && configs.target.scrollLeft !== endPosition) {
|
|
41
|
+
animate = requestAnimationFrame(tweenLoop);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
cancelAnimationFrame(animate);
|
|
45
|
+
if (typeof complete === 'function') {
|
|
46
|
+
complete();
|
|
47
|
+
}
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
tweenLoop();
|
|
52
|
+
};
|
|
53
|
+
export { tweenAnimate, ANIMATION_DURATION };
|