@refinitiv-ui/elements 5.3.3 → 5.3.4
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/lib/accordion/custom-elements.json +49 -0
- package/lib/accordion/index.d.ts +76 -0
- package/lib/accordion/index.js +139 -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/custom-elements.json +49 -0
- package/lib/appstate-bar/index.d.ts +65 -0
- package/lib/appstate-bar/index.js +103 -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/custom-elements.json +223 -0
- package/lib/autosuggest/helpers/const.d.ts +2 -0
- package/lib/autosuggest/helpers/const.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 +76 -0
- package/lib/autosuggest/index.d.ts +533 -0
- package/lib/autosuggest/index.js +1248 -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/custom-elements.json +119 -0
- package/lib/button/index.d.ts +132 -0
- package/lib/button/index.js +213 -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/custom-elements.json +26 -0
- package/lib/button-bar/index.d.ts +76 -0
- package/lib/button-bar/index.js +157 -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/custom-elements.json +199 -0
- package/lib/calendar/index.d.ts +321 -0
- package/lib/calendar/index.js +926 -0
- package/lib/calendar/locales.d.ts +31 -0
- package/lib/calendar/locales.js +144 -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 +33 -0
- package/lib/calendar/types.js +6 -0
- package/lib/calendar/utils.d.ts +12 -0
- package/lib/calendar/utils.js +17 -0
- package/lib/canvas/custom-elements.json +69 -0
- package/lib/canvas/index.d.ts +100 -0
- package/lib/canvas/index.js +175 -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/custom-elements.json +59 -0
- package/lib/card/helpers/types.d.ts +12 -0
- package/lib/card/helpers/types.js +1 -0
- package/lib/card/index.d.ts +140 -0
- package/lib/card/index.js +247 -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/custom-elements.json +42 -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 +493 -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/custom-elements.json +71 -0
- package/lib/checkbox/index.d.ts +89 -0
- package/lib/checkbox/index.js +170 -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/custom-elements.json +108 -0
- package/lib/clock/index.d.ts +309 -0
- package/lib/clock/index.js +564 -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 +79 -0
- package/lib/collapse/index.d.ts +119 -0
- package/lib/collapse/index.js +199 -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/custom-elements.json +193 -0
- package/lib/color-dialog/elements/color-palettes.d.ts +52 -0
- package/lib/color-dialog/elements/color-palettes.js +105 -0
- package/lib/color-dialog/elements/grayscale-palettes.d.ts +67 -0
- package/lib/color-dialog/elements/grayscale-palettes.js +164 -0
- package/lib/color-dialog/elements/palettes.d.ts +58 -0
- package/lib/color-dialog/elements/palettes.js +119 -0
- package/lib/color-dialog/helpers/color-helpers.d.ts +62 -0
- package/lib/color-dialog/helpers/color-helpers.js +258 -0
- package/lib/color-dialog/helpers/value-model.d.ts +75 -0
- package/lib/color-dialog/helpers/value-model.js +139 -0
- package/lib/color-dialog/index.d.ts +232 -0
- package/lib/color-dialog/index.js +457 -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/custom-elements.json +207 -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/types.d.ts +11 -0
- package/lib/combo-box/helpers/types.js +1 -0
- package/lib/combo-box/index.d.ts +523 -0
- package/lib/combo-box/index.js +1146 -0
- package/lib/combo-box/themes/halo/dark/index.js +8 -0
- package/lib/combo-box/themes/halo/light/index.js +8 -0
- package/lib/combo-box/themes/solar/charcoal/index.js +8 -0
- package/lib/combo-box/themes/solar/pearl/index.js +8 -0
- package/lib/counter/custom-elements.json +35 -0
- package/lib/counter/index.d.ts +89 -0
- package/lib/counter/index.js +155 -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 +333 -0
- package/lib/datetime-picker/index.d.ts +498 -0
- package/lib/datetime-picker/index.js +1164 -0
- package/lib/datetime-picker/locales.d.ts +8 -0
- package/lib/datetime-picker/locales.js +46 -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 +136 -0
- package/lib/dialog/draggable-element.d.ts +14 -0
- package/lib/dialog/draggable-element.js +221 -0
- package/lib/dialog/index.d.ts +199 -0
- package/lib/dialog/index.js +331 -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/custom-elements.json +199 -0
- package/lib/email-field/index.d.ts +152 -0
- package/lib/email-field/index.js +287 -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 +2 -0
- package/lib/flag/custom-elements.json +35 -0
- package/lib/flag/index.d.ts +94 -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/custom-elements.json +36 -0
- package/lib/header/index.d.ts +46 -0
- package/lib/header/index.js +76 -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/custom-elements.json +151 -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 +1104 -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/custom-elements.json +34 -0
- package/lib/icon/index.d.ts +87 -0
- package/lib/icon/index.js +161 -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 +47 -0
- package/lib/icon/utils/IconLoader.js +86 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +2 -0
- package/lib/interactive-chart/custom-elements.json +86 -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 +380 -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/custom-elements.json +153 -0
- package/lib/item/helpers/types.d.ts +57 -0
- package/lib/item/helpers/types.js +1 -0
- package/lib/item/index.d.ts +149 -0
- package/lib/item/index.js +252 -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/jsx.d.ts +223 -0
- package/lib/label/custom-elements.json +52 -0
- package/lib/label/index.d.ts +102 -0
- package/lib/label/index.js +252 -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/custom-elements.json +163 -0
- package/lib/layout/index.d.ts +107 -0
- package/lib/layout/index.js +215 -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/custom-elements.json +113 -0
- package/lib/led-gauge/index.d.ts +143 -0
- package/lib/led-gauge/index.js +440 -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/custom-elements.json +111 -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 +35 -0
- package/lib/list/helpers/types.d.ts +3 -0
- package/lib/list/helpers/types.js +1 -0
- package/lib/list/index.d.ts +292 -0
- package/lib/list/index.js +604 -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/custom-elements.json +9 -0
- package/lib/loader/index.d.ts +41 -0
- package/lib/loader/index.js +65 -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/custom-elements.json +238 -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 +297 -0
- package/lib/multi-input/index.js +591 -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/custom-elements.json +95 -0
- package/lib/notification/elements/notification-tray.d.ts +97 -0
- package/lib/notification/elements/notification-tray.js +170 -0
- package/lib/notification/elements/notification.d.ts +90 -0
- package/lib/notification/elements/notification.js +157 -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/custom-elements.json +200 -0
- package/lib/number-field/index.d.ts +294 -0
- package/lib/number-field/index.js +708 -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/custom-elements.json +342 -0
- package/lib/overlay/elements/overlay-backdrop.d.ts +46 -0
- package/lib/overlay/elements/overlay-backdrop.js +67 -0
- package/lib/overlay/elements/overlay-viewport.d.ts +40 -0
- package/lib/overlay/elements/overlay-viewport.js +56 -0
- package/lib/overlay/elements/overlay.d.ts +403 -0
- package/lib/overlay/elements/overlay.js +1427 -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 +207 -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/custom-elements.json +196 -0
- package/lib/overlay-menu/helpers/types.d.ts +8 -0
- package/lib/overlay-menu/helpers/types.js +1 -0
- package/lib/overlay-menu/helpers/uuid.d.ts +7 -0
- package/lib/overlay-menu/helpers/uuid.js +13 -0
- package/lib/overlay-menu/index.d.ts +380 -0
- package/lib/overlay-menu/index.js +921 -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/custom-elements.json +93 -0
- package/lib/pagination/helpers/types.d.ts +9 -0
- package/lib/pagination/helpers/types.js +1 -0
- package/lib/pagination/index.d.ts +207 -0
- package/lib/pagination/index.js +400 -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/custom-elements.json +39 -0
- package/lib/panel/index.d.ts +48 -0
- package/lib/panel/index.js +77 -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/custom-elements.json +156 -0
- package/lib/password-field/index.d.ts +140 -0
- package/lib/password-field/index.js +258 -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/custom-elements.json +95 -0
- package/lib/pill/index.d.ts +97 -0
- package/lib/pill/index.js +162 -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/custom-elements.json +58 -0
- package/lib/progress-bar/index.d.ts +82 -0
- package/lib/progress-bar/index.js +159 -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/custom-elements.json +84 -0
- package/lib/radio-button/index.d.ts +106 -0
- package/lib/radio-button/index.js +195 -0
- package/lib/radio-button/radio-button-registry.d.ts +21 -0
- package/lib/radio-button/radio-button-registry.js +40 -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/custom-elements.json +58 -0
- package/lib/rating/index.d.ts +91 -0
- package/lib/rating/index.js +158 -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/custom-elements.json +173 -0
- package/lib/search-field/index.d.ts +134 -0
- package/lib/search-field/index.js +254 -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/custom-elements.json +103 -0
- package/lib/select/helpers/types.d.ts +3 -0
- package/lib/select/helpers/types.js +1 -0
- package/lib/select/index.d.ts +388 -0
- package/lib/select/index.js +942 -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/custom-elements.json +72 -0
- package/lib/sidebar-layout/index.d.ts +69 -0
- package/lib/sidebar-layout/index.js +135 -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/custom-elements.json +181 -0
- package/lib/slider/index.d.ts +409 -0
- package/lib/slider/index.js +1188 -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/custom-elements.json +59 -0
- package/lib/sparkline/index.d.ts +107 -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/custom-elements.json +109 -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 +294 -0
- package/lib/swing-gauge/index.js +762 -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 +123 -0
- package/lib/tab/index.d.ts +118 -0
- package/lib/tab/index.js +211 -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 +52 -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 +108 -0
- package/lib/tab-bar/index.js +220 -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/custom-elements.json +210 -0
- package/lib/text-field/index.d.ts +171 -0
- package/lib/text-field/index.js +319 -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/custom-elements.json +124 -0
- package/lib/time-picker/index.d.ts +379 -0
- package/lib/time-picker/index.js +777 -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/custom-elements.json +84 -0
- package/lib/toggle/index.d.ts +77 -0
- package/lib/toggle/index.js +134 -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/custom-elements.json +62 -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 +479 -0
- package/lib/tooltip/managers/tooltip-manager.d.ts +15 -0
- package/lib/tooltip/managers/tooltip-manager.js +144 -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/custom-elements.json +45 -0
- package/lib/tornado-chart/elements/tornado-chart.d.ts +78 -0
- package/lib/tornado-chart/elements/tornado-chart.js +125 -0
- package/lib/tornado-chart/elements/tornado-item.d.ts +110 -0
- package/lib/tornado-chart/elements/tornado-item.js +209 -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/custom-elements.json +100 -0
- package/lib/tree/elements/tree-item.d.ts +96 -0
- package/lib/tree/elements/tree-item.js +182 -0
- package/lib/tree/elements/tree.d.ts +156 -0
- package/lib/tree/elements/tree.js +286 -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 +17 -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 +236 -0
- package/lib/tree/managers/tree-manager.js +379 -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/custom-elements.json +107 -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 +400 -0
- package/lib/tree-select/index.js +881 -0
- package/lib/tree-select/themes/halo/dark/index.js +12 -0
- package/lib/tree-select/themes/halo/light/index.js +12 -0
- package/lib/tree-select/themes/solar/charcoal/index.js +12 -0
- package/lib/tree-select/themes/solar/pearl/index.js +12 -0
- package/package.json +9 -9
|
@@ -0,0 +1,881 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { customElement, html, property, styleMap, css, repeat, query, ifDefined } from '@refinitiv-ui/core';
|
|
8
|
+
import { translate } from '@refinitiv-ui/translate';
|
|
9
|
+
import { CollectionComposer, TimeoutTaskRunner } from '@refinitiv-ui/utils';
|
|
10
|
+
import '@refinitiv-ui/phrasebook/lib/locale/en/tree-select';
|
|
11
|
+
import '../icon';
|
|
12
|
+
import '../text-field';
|
|
13
|
+
import '../pill';
|
|
14
|
+
import '../button';
|
|
15
|
+
import '../checkbox';
|
|
16
|
+
import '../tree';
|
|
17
|
+
import { ComboBox } from '../combo-box';
|
|
18
|
+
import { TreeRenderer as TreeSelectRenderer } from '../tree';
|
|
19
|
+
import { CheckedState, TreeManager, TreeManagerMode } from '../tree/managers/tree-manager';
|
|
20
|
+
import { VERSION } from '..';
|
|
21
|
+
export { TreeSelectRenderer };
|
|
22
|
+
const MEMO_THROTTLE = 16;
|
|
23
|
+
const POPUP_POSITION = ['bottom-start', 'top-start'];
|
|
24
|
+
/**
|
|
25
|
+
* Dropdown control that allows selection from the tree list
|
|
26
|
+
*
|
|
27
|
+
* @attr {boolean} [opened=false] - Set dropdown to open
|
|
28
|
+
* @prop {boolean} [opened=false] - Set dropdown to open
|
|
29
|
+
* @attr {string} placeholder - Set placeholder text
|
|
30
|
+
* @prop {string} placeholder - Set placeholder text
|
|
31
|
+
* @prop {TreeSelectData[]} data - Data object to be used for creating tree
|
|
32
|
+
* @fires confirm - Fired when selection is confirmed
|
|
33
|
+
* @fires cancel - Fired when selection is cancelled
|
|
34
|
+
* @fires query-changed - Fired when query in input box changed
|
|
35
|
+
* @fires value-changed - Fired when value of control changed
|
|
36
|
+
* @fires opened-changed - Fires when opened state changes
|
|
37
|
+
*/
|
|
38
|
+
let TreeSelect = class TreeSelect extends ComboBox {
|
|
39
|
+
constructor() {
|
|
40
|
+
super();
|
|
41
|
+
/**
|
|
42
|
+
* Tracks the number of filter matches
|
|
43
|
+
*
|
|
44
|
+
* Only needed if internal filtering is unused
|
|
45
|
+
*/
|
|
46
|
+
this.filterCount = 0;
|
|
47
|
+
/**
|
|
48
|
+
* Memoized selection and expansion stats
|
|
49
|
+
* Used for displaying counts and calculating control visibility/content
|
|
50
|
+
*/
|
|
51
|
+
this.memo = {
|
|
52
|
+
selected: 0,
|
|
53
|
+
selectable: 0,
|
|
54
|
+
expanded: 0,
|
|
55
|
+
expandable: 0
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Extracted values from {@link this.checkedGroupedItems}
|
|
59
|
+
*/
|
|
60
|
+
this.pillsData = [];
|
|
61
|
+
/**
|
|
62
|
+
* Are there pills visible
|
|
63
|
+
*/
|
|
64
|
+
this.hasPills = false;
|
|
65
|
+
/**
|
|
66
|
+
* Store references to items selected and visible at point of selection filter being applied
|
|
67
|
+
* Allow for items to be removed from the selection, but still be visible
|
|
68
|
+
*/
|
|
69
|
+
this.editSelectionItems = new Set();
|
|
70
|
+
/**
|
|
71
|
+
* Composer used for live changes
|
|
72
|
+
*/
|
|
73
|
+
this.composer = new CollectionComposer([]);
|
|
74
|
+
/**
|
|
75
|
+
* Provide access to tree interface
|
|
76
|
+
*/
|
|
77
|
+
this.treeManager = new TreeManager(this.composer);
|
|
78
|
+
/**
|
|
79
|
+
* Modification updates are called a lot
|
|
80
|
+
*
|
|
81
|
+
* This throttles the memo updates to reduce lookups
|
|
82
|
+
*/
|
|
83
|
+
this.memoUpdateThrottle = new TimeoutTaskRunner(MEMO_THROTTLE);
|
|
84
|
+
/**
|
|
85
|
+
* Breaks the relationship when multiple
|
|
86
|
+
* selection mode is enabled
|
|
87
|
+
*/
|
|
88
|
+
this.noRelation = false;
|
|
89
|
+
/**
|
|
90
|
+
* Should the control show pills
|
|
91
|
+
*/
|
|
92
|
+
this.showPills = false;
|
|
93
|
+
this._values = [];
|
|
94
|
+
/**
|
|
95
|
+
* Renderer used to render tree item elements
|
|
96
|
+
* @type {TreeSelectRenderer}
|
|
97
|
+
*/
|
|
98
|
+
this.renderer = new TreeSelectRenderer(this);
|
|
99
|
+
/**
|
|
100
|
+
* TODO:
|
|
101
|
+
* @ignore
|
|
102
|
+
*/
|
|
103
|
+
this.multiple = true;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Element version number
|
|
107
|
+
* @returns version number
|
|
108
|
+
*/
|
|
109
|
+
static get version() {
|
|
110
|
+
return VERSION;
|
|
111
|
+
}
|
|
112
|
+
static get styles() {
|
|
113
|
+
return css `
|
|
114
|
+
[part=list] {
|
|
115
|
+
display: flex;
|
|
116
|
+
flex-direction: row;
|
|
117
|
+
box-sizing: content-box;
|
|
118
|
+
cursor: default;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
[part=section] {
|
|
122
|
+
display: flex;
|
|
123
|
+
flex-direction: column;
|
|
124
|
+
width: inherit;
|
|
125
|
+
height: inherit;
|
|
126
|
+
max-height: inherit;
|
|
127
|
+
min-height: inherit;
|
|
128
|
+
max-width: inherit;
|
|
129
|
+
min-width: inherit;
|
|
130
|
+
overflow: hidden;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
[part=selection-area] {
|
|
134
|
+
min-height: 0;
|
|
135
|
+
flex-grow: 1;
|
|
136
|
+
flex-shrink: 1;
|
|
137
|
+
flex-basis: auto;
|
|
138
|
+
display: flex;
|
|
139
|
+
flex-direction: column;
|
|
140
|
+
overflow: hidden;
|
|
141
|
+
outline: none;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
[part~=control-container] {
|
|
145
|
+
box-sizing: border-box;
|
|
146
|
+
display: flex;
|
|
147
|
+
flex-shrink: 0;
|
|
148
|
+
flex-basis: auto;
|
|
149
|
+
flex-grow: 0;
|
|
150
|
+
align-items: center;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
[part=pills] {
|
|
154
|
+
flex: none;
|
|
155
|
+
}
|
|
156
|
+
`;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Returns a values collection of the currently
|
|
160
|
+
* selected item values
|
|
161
|
+
* @type {string[]}
|
|
162
|
+
*/
|
|
163
|
+
get values() {
|
|
164
|
+
return this._values;
|
|
165
|
+
}
|
|
166
|
+
set values(values) {
|
|
167
|
+
super.values = values;
|
|
168
|
+
this._values = values;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Set resolved data
|
|
172
|
+
* @param value resolved data
|
|
173
|
+
*/
|
|
174
|
+
set resolvedData(value) {
|
|
175
|
+
const oldValue = this.resolvedData;
|
|
176
|
+
if (value !== oldValue) {
|
|
177
|
+
super.resolvedData = value;
|
|
178
|
+
this.treeManager = new TreeManager(this.composer, this.mode);
|
|
179
|
+
// keep the original values
|
|
180
|
+
// do not use values setter to avoid unnecessary calls
|
|
181
|
+
this._values = this.composerValues;
|
|
182
|
+
this.listenToComposer();
|
|
183
|
+
this.updateMemo();
|
|
184
|
+
this.updatePills();
|
|
185
|
+
void this.requestUpdate('data', oldValue);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
get resolvedData() {
|
|
189
|
+
return super.resolvedData;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* The the values from composer ignoring freeTextValue
|
|
193
|
+
* @override
|
|
194
|
+
*/
|
|
195
|
+
get composerValues() {
|
|
196
|
+
return this.treeManager.checkedItems.map(item => item.value || '').slice();
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Provide list of currently selected items
|
|
200
|
+
*/
|
|
201
|
+
get selection() {
|
|
202
|
+
return this.treeManager.checkedItems.slice();
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Get a list of selected item labels
|
|
206
|
+
* @returns Has selection
|
|
207
|
+
* @override
|
|
208
|
+
*/
|
|
209
|
+
get selectedLabels() {
|
|
210
|
+
return this.checkedGroupedItems.map(selected => this.getItemPropertyValue(selected, 'label') || '');
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Returns memoized selected state
|
|
214
|
+
* @returns Has selection
|
|
215
|
+
*/
|
|
216
|
+
get hasActiveSelection() {
|
|
217
|
+
return this.memo.selected > 0;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Returns memoized all selected count
|
|
221
|
+
* @returns Is all selected
|
|
222
|
+
*/
|
|
223
|
+
get allSelected() {
|
|
224
|
+
return this.memo.selected === this.memo.selectable;
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Returns memoized expansion state
|
|
228
|
+
* @returns Are all expanded
|
|
229
|
+
*/
|
|
230
|
+
get hasExpansion() {
|
|
231
|
+
return this.memo.expanded > 0;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Determines if the expansion controls should be displayed
|
|
235
|
+
*
|
|
236
|
+
* @returns Control visible state
|
|
237
|
+
*/
|
|
238
|
+
get expansionControlVisible() {
|
|
239
|
+
// could be a static prop and updated via CC
|
|
240
|
+
return this.memo.expandable > 0;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Determine if the selection filter is active
|
|
244
|
+
* @returns Selection filter on/off
|
|
245
|
+
*/
|
|
246
|
+
get selectionFilterState() {
|
|
247
|
+
return this.editSelectionItems.size > 0;
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Mode to use in the tree manager
|
|
251
|
+
*/
|
|
252
|
+
get mode() {
|
|
253
|
+
return !this.noRelation ? TreeManagerMode.RELATIONAL : TreeManagerMode.INDEPENDENT;
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Get a list of selected items.
|
|
257
|
+
* If all leaves are selected, a parent becomes selected
|
|
258
|
+
* If mode is INDEPENDENT, grouping is not applied
|
|
259
|
+
*/
|
|
260
|
+
get checkedGroupedItems() {
|
|
261
|
+
const treeManager = this.treeManager;
|
|
262
|
+
const checkedItems = treeManager.checkedItems;
|
|
263
|
+
if (this.mode === TreeManagerMode.INDEPENDENT) {
|
|
264
|
+
return checkedItems;
|
|
265
|
+
}
|
|
266
|
+
const checkedGroupItems = [];
|
|
267
|
+
const unchecked = []; // need for performance to not double check same ancestors
|
|
268
|
+
checkedItems.forEach(item => {
|
|
269
|
+
const ancestors = treeManager.getItemAncestors(item);
|
|
270
|
+
for (let i = 0; i < ancestors.length; i += 1) {
|
|
271
|
+
const ancestor = ancestors[i];
|
|
272
|
+
// An ancestor is already included. No need to continue
|
|
273
|
+
if (checkedGroupItems.includes(ancestor)) {
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
// An ancestor has been already checked. Do not check again
|
|
277
|
+
if (unchecked.includes(ancestor)) {
|
|
278
|
+
continue;
|
|
279
|
+
}
|
|
280
|
+
// Ancestor is checked. No need to check any other ancestors
|
|
281
|
+
if (treeManager.getItemCheckedState(ancestor) === CheckedState.CHECKED) {
|
|
282
|
+
checkedGroupItems.push(ancestor);
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
// Do not check again this ancestor for performance
|
|
286
|
+
unchecked.push(ancestor);
|
|
287
|
+
}
|
|
288
|
+
checkedGroupItems.push(item);
|
|
289
|
+
});
|
|
290
|
+
return checkedGroupItems;
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Persist the current selection
|
|
294
|
+
* Takes the current selection and uses it for {@link TreeSelect.values}
|
|
295
|
+
* Also uses current selection as a revert position for future changes
|
|
296
|
+
* @returns {void}
|
|
297
|
+
*/
|
|
298
|
+
persistSelection() {
|
|
299
|
+
const oldValues = this.values.slice();
|
|
300
|
+
const newValues = this.composerValues;
|
|
301
|
+
const oldComparison = oldValues.sort().toString();
|
|
302
|
+
const newComparison = newValues.sort().toString();
|
|
303
|
+
if (oldComparison !== newComparison) {
|
|
304
|
+
this.values = newValues;
|
|
305
|
+
this.notifyPropertyChange('value', this.value);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Reverse selection. Run on Esc or Cancel
|
|
310
|
+
* @returns {void}
|
|
311
|
+
*/
|
|
312
|
+
cancelSelection() {
|
|
313
|
+
// values setter updates the collection composer if required
|
|
314
|
+
this.values = this._values;
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Update memoized track
|
|
318
|
+
*
|
|
319
|
+
* Update states for expansion and selection
|
|
320
|
+
*
|
|
321
|
+
* @returns {void}
|
|
322
|
+
*/
|
|
323
|
+
updateMemo() {
|
|
324
|
+
this.memo = {
|
|
325
|
+
expanded: 0,
|
|
326
|
+
expandable: 0,
|
|
327
|
+
selected: 0,
|
|
328
|
+
selectable: 0
|
|
329
|
+
};
|
|
330
|
+
this.queryItems((item, composer) => {
|
|
331
|
+
const hasChildren = composer.getItemChildren(item);
|
|
332
|
+
if (hasChildren.length) {
|
|
333
|
+
this.memo.expandable += 1;
|
|
334
|
+
if (this.treeManager.isItemExpanded(item) && this.treeManager.isItemCheckable(item)) {
|
|
335
|
+
this.memo.expanded += 1;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
else if (this.treeManager.isItemCheckable(item)) {
|
|
339
|
+
this.memo.selectable += 1;
|
|
340
|
+
if (this.getItemPropertyValue(item, 'selected') === true) {
|
|
341
|
+
this.memo.selected += 1;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
return false;
|
|
345
|
+
});
|
|
346
|
+
void this.requestUpdate();
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Utility method - closes and resets changes such as query
|
|
350
|
+
* @returns {void}
|
|
351
|
+
*/
|
|
352
|
+
closeAndReset() {
|
|
353
|
+
this.resetInput();
|
|
354
|
+
this.setOpened(false);
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Save the current selection
|
|
358
|
+
* @returns {void}
|
|
359
|
+
*/
|
|
360
|
+
save() {
|
|
361
|
+
const event = new CustomEvent('confirm');
|
|
362
|
+
this.dispatchEvent(event);
|
|
363
|
+
if (!event.defaultPrevented) {
|
|
364
|
+
this.persistSelection();
|
|
365
|
+
this.closeAndReset();
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* Discard the current selection
|
|
370
|
+
* @returns {void}
|
|
371
|
+
*/
|
|
372
|
+
cancel() {
|
|
373
|
+
const event = new CustomEvent('cancel');
|
|
374
|
+
this.dispatchEvent(event);
|
|
375
|
+
if (!event.defaultPrevented) {
|
|
376
|
+
this.closeAndReset();
|
|
377
|
+
// reset always happens on popup close action
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
/**
|
|
381
|
+
* Toggle tree level expansion action
|
|
382
|
+
* @returns {void}
|
|
383
|
+
*/
|
|
384
|
+
expansionToggleClickHandler() {
|
|
385
|
+
if (this.hasExpansion) {
|
|
386
|
+
this.treeManager.collapseAllItems();
|
|
387
|
+
}
|
|
388
|
+
else {
|
|
389
|
+
this.treeManager.expandAllItems();
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Toggle Selection of all tree items
|
|
394
|
+
* @param event checked-change event
|
|
395
|
+
* @returns {void}
|
|
396
|
+
*/
|
|
397
|
+
selectionToggleHandler(event) {
|
|
398
|
+
if (event.detail.value) {
|
|
399
|
+
this.treeManager.checkAllItems();
|
|
400
|
+
}
|
|
401
|
+
else {
|
|
402
|
+
this.treeManager.uncheckAllItems();
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* Remove selection filter
|
|
407
|
+
* @returns {void}
|
|
408
|
+
*/
|
|
409
|
+
fullClickHandler() {
|
|
410
|
+
this.exitEditSelection();
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* Apply selection filter
|
|
414
|
+
* @returns {void}
|
|
415
|
+
*/
|
|
416
|
+
selectedClickHandler() {
|
|
417
|
+
if (this.hasActiveSelection) {
|
|
418
|
+
this.enterEditSelection();
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* Apply the selection filter by entering edit selection mode
|
|
423
|
+
* @returns {void}
|
|
424
|
+
*/
|
|
425
|
+
enterEditSelection() {
|
|
426
|
+
this.editSelectionItems = new Set(this.treeManager.checkedItems);
|
|
427
|
+
this.filterItems();
|
|
428
|
+
}
|
|
429
|
+
/**
|
|
430
|
+
* Remove selection filtering by exiting edit selection mode
|
|
431
|
+
* @returns {void}
|
|
432
|
+
*/
|
|
433
|
+
exitEditSelection() {
|
|
434
|
+
this.clearSelectionFilter();
|
|
435
|
+
this.filterItems();
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* Executed when the popup is fully opened
|
|
439
|
+
* @returns {void}
|
|
440
|
+
*/
|
|
441
|
+
onPopupOpened() {
|
|
442
|
+
super.onPopupOpened();
|
|
443
|
+
this.clearSelectionFilter();
|
|
444
|
+
this.updatePills();
|
|
445
|
+
this.updateMemo();
|
|
446
|
+
}
|
|
447
|
+
/**
|
|
448
|
+
* Clear selection filter
|
|
449
|
+
* @returns {void}
|
|
450
|
+
*/
|
|
451
|
+
clearSelectionFilter() {
|
|
452
|
+
this.editSelectionItems.clear();
|
|
453
|
+
}
|
|
454
|
+
/**
|
|
455
|
+
* Executed when the popup is fully closed
|
|
456
|
+
* @returns {void}
|
|
457
|
+
*/
|
|
458
|
+
onPopupClosed() {
|
|
459
|
+
super.onPopupClosed();
|
|
460
|
+
this.updateMemo();
|
|
461
|
+
this.cancelSelection();
|
|
462
|
+
this.exitEditSelection();
|
|
463
|
+
}
|
|
464
|
+
/**
|
|
465
|
+
* Filter the internal items by query
|
|
466
|
+
* Changes items' hidden state
|
|
467
|
+
*
|
|
468
|
+
* @returns {void}
|
|
469
|
+
*/
|
|
470
|
+
filterItems() {
|
|
471
|
+
// if filter is null, it is off and external app is responsible
|
|
472
|
+
if (this.filter) {
|
|
473
|
+
const filter = this.filter;
|
|
474
|
+
const items = this.queryItems((item, composer) => {
|
|
475
|
+
// do not filter hidden items
|
|
476
|
+
if (item.hidden) {
|
|
477
|
+
return false;
|
|
478
|
+
}
|
|
479
|
+
// does item match the selection filter
|
|
480
|
+
let result = true;
|
|
481
|
+
if (this.editSelectionItems.size && !this.editSelectionItems.has(item)) {
|
|
482
|
+
result = false;
|
|
483
|
+
}
|
|
484
|
+
// item matches selection, can have conventional filter applied
|
|
485
|
+
if (result) {
|
|
486
|
+
result = filter(item);
|
|
487
|
+
}
|
|
488
|
+
if (result) {
|
|
489
|
+
composer.updateItemTimestamp(item);
|
|
490
|
+
this.treeManager.includeItem(item);
|
|
491
|
+
}
|
|
492
|
+
else {
|
|
493
|
+
this.treeManager.excludeItem(item);
|
|
494
|
+
}
|
|
495
|
+
return result;
|
|
496
|
+
}).slice();
|
|
497
|
+
// do not expand EMS if there is no filter applied
|
|
498
|
+
if (this.query || this.editSelectionItems.size) {
|
|
499
|
+
this.addItemDescendantsToRender(items);
|
|
500
|
+
this.addExpandedAncestorsToRender(items);
|
|
501
|
+
}
|
|
502
|
+
this.filterCount = items.length;
|
|
503
|
+
// unlike CCB, we do not close EMS when there is no matches for filter
|
|
504
|
+
}
|
|
505
|
+
this.forcePopupLayout();
|
|
506
|
+
}
|
|
507
|
+
/**
|
|
508
|
+
* Utility method
|
|
509
|
+
* Adds descendants for each item passed
|
|
510
|
+
* @param items List of child items
|
|
511
|
+
* @returns {void}
|
|
512
|
+
*/
|
|
513
|
+
addItemDescendantsToRender(items) {
|
|
514
|
+
items.forEach((item) => {
|
|
515
|
+
// all items will be collapsed by default
|
|
516
|
+
if (this.treeManager.isItemExpanded(item)) {
|
|
517
|
+
this.treeManager.collapseItem(item);
|
|
518
|
+
}
|
|
519
|
+
/**
|
|
520
|
+
* show all descendants of items to make them all are selectable
|
|
521
|
+
* and user can navigate into nested data
|
|
522
|
+
*/
|
|
523
|
+
const children = this.treeManager.getItemChildren(item);
|
|
524
|
+
if (children.length) {
|
|
525
|
+
this.addNestedItemsToRender(children, items);
|
|
526
|
+
}
|
|
527
|
+
});
|
|
528
|
+
}
|
|
529
|
+
/**
|
|
530
|
+
* Utility method
|
|
531
|
+
* Add nested children of item list
|
|
532
|
+
* @param items List of items
|
|
533
|
+
* @param excludeItems List of exclude items
|
|
534
|
+
* @returns void
|
|
535
|
+
*/
|
|
536
|
+
addNestedItemsToRender(items, excludeItems) {
|
|
537
|
+
items.forEach(item => {
|
|
538
|
+
// Skip excluding item
|
|
539
|
+
if (!excludeItems.includes(item)) {
|
|
540
|
+
// Add item and nested children
|
|
541
|
+
this.treeManager.includeItem(item);
|
|
542
|
+
const children = this.treeManager.getItemChildren(item);
|
|
543
|
+
if (children.length) {
|
|
544
|
+
this.addNestedItemsToRender(children, excludeItems);
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
});
|
|
548
|
+
}
|
|
549
|
+
/**
|
|
550
|
+
* Utility method
|
|
551
|
+
* @param items List of child items
|
|
552
|
+
* Adds ancestors for each item passed and expand
|
|
553
|
+
*
|
|
554
|
+
* @returns {void}
|
|
555
|
+
*/
|
|
556
|
+
addExpandedAncestorsToRender(items) {
|
|
557
|
+
// establish unique ancestors set
|
|
558
|
+
const ancestors = new Set();
|
|
559
|
+
// we iterate each item match so as to find ancestors
|
|
560
|
+
items.forEach((item) => {
|
|
561
|
+
// get the ancestors
|
|
562
|
+
const parent = this.treeManager.getItemParent(item);
|
|
563
|
+
if (parent && !ancestors.has(parent)) {
|
|
564
|
+
this.treeManager.getItemAncestors(item).forEach((ancestor) => {
|
|
565
|
+
ancestors.add(ancestor); // track ancestors
|
|
566
|
+
this.addExpandedAncestorToRender(ancestor);
|
|
567
|
+
});
|
|
568
|
+
}
|
|
569
|
+
});
|
|
570
|
+
}
|
|
571
|
+
/**
|
|
572
|
+
* Utility method
|
|
573
|
+
* @param ancestor parent item
|
|
574
|
+
* Adds parent and expands
|
|
575
|
+
*
|
|
576
|
+
* @returns {void}
|
|
577
|
+
*/
|
|
578
|
+
addExpandedAncestorToRender(ancestor) {
|
|
579
|
+
this.treeManager.includeItem(ancestor);
|
|
580
|
+
this.treeManager.expandItem(ancestor);
|
|
581
|
+
}
|
|
582
|
+
/**
|
|
583
|
+
* Reacts to pill removal by de-selecting the related item
|
|
584
|
+
* @param event Event containing the pill item
|
|
585
|
+
*
|
|
586
|
+
* @returns {void}
|
|
587
|
+
*/
|
|
588
|
+
onPillRemoved(event) {
|
|
589
|
+
const pill = event.target;
|
|
590
|
+
const item = this.queryItemsByPropertyValue('value', pill.value)[0];
|
|
591
|
+
if (item) {
|
|
592
|
+
this.treeManager.uncheckItem(item);
|
|
593
|
+
// Focus must be shifted as otherwise focus is shifted to body once the item is removed and popup gets closed
|
|
594
|
+
this.shiftFocus();
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
/**
|
|
598
|
+
* Handles key input
|
|
599
|
+
* @param event Key down event object
|
|
600
|
+
* @returns {void}
|
|
601
|
+
*/
|
|
602
|
+
/* istanbul ignore next */
|
|
603
|
+
onKeyDown(event) {
|
|
604
|
+
var _a, _b;
|
|
605
|
+
// There are three areas, which have different reaction on key press:
|
|
606
|
+
// 1) search field
|
|
607
|
+
// 2) tree selection
|
|
608
|
+
// 3) popup panel
|
|
609
|
+
if (((_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.activeElement) === this.selectionAreaEl && this.listEl) {
|
|
610
|
+
// Focus within selection area. Propagate all events
|
|
611
|
+
this.reTargetEvent(event, this.listEl);
|
|
612
|
+
}
|
|
613
|
+
else if (!((_b = this.popupEl) === null || _b === void 0 ? void 0 : _b.focused)) {
|
|
614
|
+
// search field is in focus
|
|
615
|
+
// combo box logic should take care
|
|
616
|
+
super.onKeyDown(event);
|
|
617
|
+
}
|
|
618
|
+
else {
|
|
619
|
+
// up/down to selection area
|
|
620
|
+
switch (event.key) {
|
|
621
|
+
case 'Up':
|
|
622
|
+
case 'ArrowUp':
|
|
623
|
+
case 'Down':
|
|
624
|
+
case 'ArrowDown':
|
|
625
|
+
super.onKeyDown(event);
|
|
626
|
+
break;
|
|
627
|
+
// no default
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
/**
|
|
632
|
+
* Navigates up the list.
|
|
633
|
+
* Opens the list if closed.
|
|
634
|
+
* @param event keyboard event
|
|
635
|
+
* @returns {void}
|
|
636
|
+
*/
|
|
637
|
+
/* istanbul ignore next */
|
|
638
|
+
up(event) {
|
|
639
|
+
super.up(event);
|
|
640
|
+
this.focusOnSelectionArea();
|
|
641
|
+
}
|
|
642
|
+
/**
|
|
643
|
+
* Navigates down the list.
|
|
644
|
+
* Opens the list if closed.
|
|
645
|
+
* @param event keyboard event
|
|
646
|
+
* @returns {void}
|
|
647
|
+
*/
|
|
648
|
+
/* istanbul ignore next */
|
|
649
|
+
down(event) {
|
|
650
|
+
super.down(event);
|
|
651
|
+
this.focusOnSelectionArea();
|
|
652
|
+
}
|
|
653
|
+
/**
|
|
654
|
+
* Make sure that after up/down keys the focus gracefully moves to selection area
|
|
655
|
+
* so the user can then use left/right/Enter keys for keyboard navigation
|
|
656
|
+
* @returns {void}
|
|
657
|
+
*/
|
|
658
|
+
/* istanbul ignore next */
|
|
659
|
+
focusOnSelectionArea() {
|
|
660
|
+
// The logic needs to happen after the update cycle
|
|
661
|
+
// as otherwise focus logic may contradict with other components
|
|
662
|
+
// and the focus is not moved
|
|
663
|
+
void this.updateComplete.then(() => {
|
|
664
|
+
var _a;
|
|
665
|
+
(_a = this.selectionAreaEl) === null || _a === void 0 ? void 0 : _a.focus();
|
|
666
|
+
});
|
|
667
|
+
}
|
|
668
|
+
/**
|
|
669
|
+
* Adds a throttled update for pills and memo
|
|
670
|
+
* @returns {void}
|
|
671
|
+
*/
|
|
672
|
+
modificationUpdate() {
|
|
673
|
+
super.modificationUpdate();
|
|
674
|
+
this.memoUpdateThrottle.schedule(() => {
|
|
675
|
+
this.updatePills();
|
|
676
|
+
this.updateMemo();
|
|
677
|
+
});
|
|
678
|
+
}
|
|
679
|
+
/**
|
|
680
|
+
* Update pills if {@link TreeSelect.showPills} showPills is applied
|
|
681
|
+
*
|
|
682
|
+
* @returns {void}
|
|
683
|
+
*/
|
|
684
|
+
updatePills() {
|
|
685
|
+
if (this.showPills) {
|
|
686
|
+
this.pillsData = this.checkedGroupedItems.slice();
|
|
687
|
+
this.hasPills = !!this.pillsData.length;
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
/**
|
|
691
|
+
* Queries the composer for data items. Uses Infinity depth
|
|
692
|
+
* @param engine Composer query engine
|
|
693
|
+
* @returns Collection of matched items
|
|
694
|
+
* @override
|
|
695
|
+
*/
|
|
696
|
+
queryItems(engine) {
|
|
697
|
+
return this.composer.queryItems(engine, Infinity);
|
|
698
|
+
}
|
|
699
|
+
/**
|
|
700
|
+
* Queries the composer for data items,
|
|
701
|
+
* matching by property value. Uses Infinity depth
|
|
702
|
+
* @param property Property name to query
|
|
703
|
+
* @param value Property value to match against
|
|
704
|
+
* @returns Collection of matched items
|
|
705
|
+
* @override
|
|
706
|
+
*/
|
|
707
|
+
queryItemsByPropertyValue(property, value) {
|
|
708
|
+
return this.composer.queryItemsByPropertyValue(property, value, Infinity);
|
|
709
|
+
}
|
|
710
|
+
/**
|
|
711
|
+
* Filter template
|
|
712
|
+
* @returns Render template
|
|
713
|
+
*/
|
|
714
|
+
get filtersTemplate() {
|
|
715
|
+
return html `
|
|
716
|
+
<div part="control-container filter-control">
|
|
717
|
+
<div part="match-count-wrapper">
|
|
718
|
+
${this.matchCountTemplate}
|
|
719
|
+
</div>
|
|
720
|
+
<div part="filter-wrapper">
|
|
721
|
+
<div
|
|
722
|
+
role="button"
|
|
723
|
+
tabindex="0"
|
|
724
|
+
active
|
|
725
|
+
part="control full-filter${!this.selectionFilterState ? ' active' : ''}"
|
|
726
|
+
@tap="${this.fullClickHandler}">${this.t('FULL_LIST')}</div>
|
|
727
|
+
<div
|
|
728
|
+
role="button"
|
|
729
|
+
tabindex="${ifDefined(this.hasActiveSelection ? 0 : undefined)}"
|
|
730
|
+
part="control selected-filter${this.selectionFilterState ? ' active' : ''}${!this.hasActiveSelection ? ' disabled' : ''}"
|
|
731
|
+
@tap="${this.selectedClickHandler}">${this.t('SELECTED')}</div>
|
|
732
|
+
</div>
|
|
733
|
+
</div>
|
|
734
|
+
`;
|
|
735
|
+
}
|
|
736
|
+
/**
|
|
737
|
+
* Tree control template
|
|
738
|
+
* @returns Render template
|
|
739
|
+
*/
|
|
740
|
+
get treeControlsTemplate() {
|
|
741
|
+
let expansionControl = html ``;
|
|
742
|
+
if (this.expansionControlVisible) {
|
|
743
|
+
expansionControl = html `
|
|
744
|
+
<div part="filter-wrapper">
|
|
745
|
+
<div
|
|
746
|
+
role="button"
|
|
747
|
+
tabindex="0"
|
|
748
|
+
part="control expand-toggle"
|
|
749
|
+
@tap="${this.expansionToggleClickHandler}">${this.t('EXPAND_COLLAPSE', { expansion: this.hasExpansion })}</div>
|
|
750
|
+
</div>
|
|
751
|
+
`;
|
|
752
|
+
}
|
|
753
|
+
return html `
|
|
754
|
+
<div part="control-container tree-control">
|
|
755
|
+
<ef-checkbox
|
|
756
|
+
part="selection-toggle"
|
|
757
|
+
.checked="${this.allSelected}"
|
|
758
|
+
.indeterminate="${this.hasActiveSelection && !this.allSelected}"
|
|
759
|
+
@checked-changed="${this.selectionToggleHandler}">${this.t('SELECT_CONTROL', { selected: this.allSelected })}</ef-checkbox>
|
|
760
|
+
${expansionControl}
|
|
761
|
+
</div>
|
|
762
|
+
`;
|
|
763
|
+
}
|
|
764
|
+
/**
|
|
765
|
+
* Conditional filter matches template
|
|
766
|
+
* @returns Render template
|
|
767
|
+
*/
|
|
768
|
+
get matchCountTemplate() {
|
|
769
|
+
return this.query ? html `
|
|
770
|
+
<span part="match-count">${this.t('MATCHES_NUM', { numMatched: this.filterCount })}</span>
|
|
771
|
+
` : html ``;
|
|
772
|
+
}
|
|
773
|
+
/**
|
|
774
|
+
* Commit controls template
|
|
775
|
+
* @returns Render template
|
|
776
|
+
*/
|
|
777
|
+
get commitControlsTemplate() {
|
|
778
|
+
return html `
|
|
779
|
+
<ef-button
|
|
780
|
+
id="done"
|
|
781
|
+
part="done-button"
|
|
782
|
+
cta
|
|
783
|
+
@tap="${this.save}">${this.t('DONE')}</ef-button>
|
|
784
|
+
<ef-button
|
|
785
|
+
id="cancel"
|
|
786
|
+
part="cancel-button"
|
|
787
|
+
@tap="${this.cancel}">${this.t('CANCEL')}</ef-button>
|
|
788
|
+
`;
|
|
789
|
+
}
|
|
790
|
+
/**
|
|
791
|
+
* Pills template
|
|
792
|
+
* @returns Render template
|
|
793
|
+
*/
|
|
794
|
+
get pillsTemplate() {
|
|
795
|
+
// always injected when we have show pills vs injecting and re-injecting partial
|
|
796
|
+
// visibility will typically be controlled by styling: display: none / block or similar
|
|
797
|
+
if (this.showPills && this.hasPills) {
|
|
798
|
+
return html `<div part="pills">
|
|
799
|
+
${repeat(this.pillsData, pill => pill.value, pill => html `
|
|
800
|
+
<ef-pill
|
|
801
|
+
tabindex="-1"
|
|
802
|
+
clears
|
|
803
|
+
.readonly="${pill.readonly || this.readonly}"
|
|
804
|
+
.disabled="${pill.disabled || this.disabled}"
|
|
805
|
+
.value="${pill.value}"
|
|
806
|
+
@clear="${this.onPillRemoved}">${pill.label}</ef-pill>`)}
|
|
807
|
+
</div>`;
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
/**
|
|
811
|
+
* Returns template for popup
|
|
812
|
+
* Lazy loads the popup
|
|
813
|
+
* @returns Popup template or undefined
|
|
814
|
+
*/
|
|
815
|
+
get popupTemplate() {
|
|
816
|
+
if (this.lazyRendered) {
|
|
817
|
+
return html `
|
|
818
|
+
<ef-overlay
|
|
819
|
+
part="list"
|
|
820
|
+
style=${styleMap(this.popupDynamicStyles)}
|
|
821
|
+
@opened="${this.onPopupOpened}"
|
|
822
|
+
@closed="${this.onPopupClosed}"
|
|
823
|
+
.focusBoundary="${this}"
|
|
824
|
+
.opened="${this.opened}"
|
|
825
|
+
.positionTarget="${this}"
|
|
826
|
+
.position="${POPUP_POSITION}"
|
|
827
|
+
.delegatesFocus=${true}
|
|
828
|
+
no-cancel-on-outside-click
|
|
829
|
+
tabindex="0"
|
|
830
|
+
with-shadow
|
|
831
|
+
no-overlap
|
|
832
|
+
no-autofocus>
|
|
833
|
+
<div part="section">
|
|
834
|
+
${this.filtersTemplate}
|
|
835
|
+
${this.treeControlsTemplate}
|
|
836
|
+
<div part="selection-area" tabindex="-1">
|
|
837
|
+
<ef-tree
|
|
838
|
+
id="internal-list"
|
|
839
|
+
@focusin="${this.shiftFocus}"
|
|
840
|
+
tabindex="-1"
|
|
841
|
+
part="tree"
|
|
842
|
+
.noRelation=${this.noRelation}
|
|
843
|
+
.renderer=${this.renderer}
|
|
844
|
+
.data="${this.composer}"
|
|
845
|
+
.multiple="${this.multiple}"></ef-tree>
|
|
846
|
+
${this.pillsTemplate}
|
|
847
|
+
</div>
|
|
848
|
+
<div part="control-container footer" id="footer">${this.commitControlsTemplate}</div>
|
|
849
|
+
</div>
|
|
850
|
+
</ef-overlay>
|
|
851
|
+
`;
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
};
|
|
855
|
+
__decorate([
|
|
856
|
+
translate()
|
|
857
|
+
], TreeSelect.prototype, "t", void 0);
|
|
858
|
+
__decorate([
|
|
859
|
+
property({ attribute: 'no-relation', type: Boolean })
|
|
860
|
+
], TreeSelect.prototype, "noRelation", void 0);
|
|
861
|
+
__decorate([
|
|
862
|
+
property({ type: Boolean, attribute: 'show-pills' })
|
|
863
|
+
], TreeSelect.prototype, "showPills", void 0);
|
|
864
|
+
__decorate([
|
|
865
|
+
property({ type: Array, attribute: false })
|
|
866
|
+
], TreeSelect.prototype, "values", null);
|
|
867
|
+
__decorate([
|
|
868
|
+
property({ type: Function, attribute: false })
|
|
869
|
+
], TreeSelect.prototype, "renderer", void 0);
|
|
870
|
+
__decorate([
|
|
871
|
+
query('[part=selection-area]')
|
|
872
|
+
], TreeSelect.prototype, "selectionAreaEl", void 0);
|
|
873
|
+
__decorate([
|
|
874
|
+
query('[part=list]')
|
|
875
|
+
], TreeSelect.prototype, "popupEl", void 0);
|
|
876
|
+
TreeSelect = __decorate([
|
|
877
|
+
customElement('ef-tree-select', {
|
|
878
|
+
alias: 'emerald-multi-select'
|
|
879
|
+
})
|
|
880
|
+
], TreeSelect);
|
|
881
|
+
export { TreeSelect };
|