@refinitiv-ui/elements 5.12.2 → 6.0.0-next.2
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/README.md +4 -4
- package/lib/accordion/index.d.ts +5 -0
- package/lib/accordion/index.js +2 -2
- package/lib/accordion/themes/halo/dark/index.js +1 -1
- package/lib/accordion/themes/halo/light/index.js +1 -1
- package/lib/accordion/themes/solar/charcoal/index.js +1 -1
- package/lib/accordion/themes/solar/pearl/index.js +1 -1
- package/lib/appstate-bar/index.d.ts +11 -0
- package/lib/appstate-bar/index.js +8 -3
- package/lib/appstate-bar/themes/halo/dark/index.js +1 -1
- package/lib/appstate-bar/themes/halo/light/index.js +1 -1
- package/lib/appstate-bar/themes/solar/charcoal/index.js +1 -1
- package/lib/appstate-bar/themes/solar/pearl/index.js +1 -1
- package/lib/autosuggest/index.d.ts +5 -0
- package/lib/autosuggest/index.js +22 -12
- package/lib/autosuggest/themes/halo/dark/index.js +3 -3
- package/lib/autosuggest/themes/halo/light/index.js +3 -3
- package/lib/autosuggest/themes/solar/charcoal/index.js +3 -3
- package/lib/autosuggest/themes/solar/pearl/index.js +3 -3
- package/lib/button/index.d.ts +7 -13
- package/lib/button/index.js +8 -43
- package/lib/button/themes/halo/dark/index.js +1 -1
- package/lib/button/themes/halo/light/index.js +1 -1
- package/lib/button/themes/solar/charcoal/index.js +1 -1
- package/lib/button/themes/solar/pearl/index.js +1 -1
- package/lib/button-bar/index.d.ts +5 -0
- package/lib/button-bar/index.js +4 -5
- package/lib/button-bar/themes/halo/dark/index.js +1 -1
- package/lib/button-bar/themes/halo/light/index.js +1 -1
- package/lib/button-bar/themes/solar/charcoal/index.js +1 -1
- package/lib/button-bar/themes/solar/pearl/index.js +1 -1
- package/lib/calendar/constants.js +1 -1
- package/lib/calendar/index.d.ts +6 -1
- package/lib/calendar/index.js +39 -15
- package/lib/calendar/locales.js +5 -5
- package/lib/calendar/themes/halo/dark/index.js +1 -1
- package/lib/calendar/themes/halo/light/index.js +1 -1
- package/lib/calendar/themes/solar/charcoal/index.js +1 -1
- package/lib/calendar/themes/solar/pearl/index.js +1 -1
- package/lib/calendar/types.d.ts +1 -1
- package/lib/calendar/utils.js +5 -5
- package/lib/canvas/index.d.ts +5 -0
- package/lib/canvas/index.js +3 -4
- package/lib/card/index.d.ts +21 -0
- package/lib/card/index.js +37 -15
- package/lib/card/themes/halo/dark/index.js +3 -3
- package/lib/card/themes/halo/light/index.js +3 -3
- package/lib/card/themes/solar/charcoal/index.js +3 -3
- package/lib/card/themes/solar/pearl/index.js +3 -3
- package/lib/chart/index.d.ts +5 -0
- package/lib/chart/index.js +18 -22
- package/lib/chart/plugins/doughnut-center-label.js +6 -11
- package/lib/chart/themes/halo/dark/index.js +2 -2
- package/lib/chart/themes/halo/light/index.js +2 -2
- package/lib/chart/themes/solar/charcoal/index.js +2 -2
- package/lib/chart/themes/solar/pearl/index.js +2 -2
- package/lib/checkbox/index.d.ts +5 -0
- package/lib/checkbox/index.js +3 -3
- package/lib/checkbox/themes/halo/dark/index.js +2 -2
- package/lib/checkbox/themes/halo/light/index.js +2 -2
- package/lib/checkbox/themes/solar/charcoal/index.js +2 -2
- package/lib/checkbox/themes/solar/pearl/index.js +2 -2
- package/lib/clock/index.d.ts +5 -0
- package/lib/clock/index.js +6 -6
- package/lib/clock/utils/TickManager.js +2 -2
- package/lib/collapse/index.d.ts +5 -0
- package/lib/collapse/index.js +7 -9
- package/lib/collapse/themes/halo/dark/index.js +3 -3
- package/lib/collapse/themes/halo/light/index.js +3 -3
- package/lib/collapse/themes/solar/charcoal/index.js +3 -3
- package/lib/collapse/themes/solar/pearl/index.js +3 -3
- package/lib/color-dialog/elements/color-palettes.d.ts +5 -0
- package/lib/color-dialog/elements/color-palettes.js +1 -1
- package/lib/color-dialog/elements/grayscale-palettes.d.ts +5 -0
- package/lib/color-dialog/elements/grayscale-palettes.js +2 -2
- package/lib/color-dialog/elements/palettes.js +4 -5
- package/lib/color-dialog/helpers/value-model.js +1 -1
- package/lib/color-dialog/index.d.ts +6 -1
- package/lib/color-dialog/index.js +17 -12
- package/lib/color-dialog/themes/halo/dark/index.js +5 -5
- package/lib/color-dialog/themes/halo/light/index.js +5 -5
- package/lib/color-dialog/themes/solar/charcoal/index.js +5 -5
- package/lib/color-dialog/themes/solar/pearl/index.js +5 -5
- package/lib/combo-box/helpers/filter.d.ts +1 -1
- package/lib/combo-box/helpers/types.d.ts +1 -1
- package/lib/combo-box/index.d.ts +9 -4
- package/lib/combo-box/index.js +31 -14
- package/lib/combo-box/themes/halo/dark/index.js +5 -5
- package/lib/combo-box/themes/halo/light/index.js +5 -5
- package/lib/combo-box/themes/solar/charcoal/index.js +5 -5
- package/lib/combo-box/themes/solar/pearl/index.js +5 -5
- package/lib/counter/index.d.ts +11 -6
- package/lib/counter/index.js +8 -8
- package/lib/counter/themes/halo/dark/index.js +1 -1
- package/lib/counter/themes/halo/light/index.js +1 -1
- package/lib/counter/themes/solar/charcoal/index.js +1 -1
- package/lib/counter/themes/solar/pearl/index.js +1 -1
- package/lib/datetime-field/constants.d.ts +4 -0
- package/lib/datetime-field/constants.js +5 -0
- package/lib/datetime-field/custom-elements.json +345 -0
- package/lib/datetime-field/custom-elements.md +61 -0
- package/lib/datetime-field/index.d.ts +322 -0
- package/lib/datetime-field/index.js +660 -0
- package/lib/datetime-field/themes/halo/dark/index.js +3 -0
- package/lib/datetime-field/themes/halo/light/index.js +3 -0
- package/lib/datetime-field/themes/solar/charcoal/index.js +3 -0
- package/lib/datetime-field/themes/solar/pearl/index.js +3 -0
- package/lib/datetime-field/types.d.ts +10 -0
- package/lib/datetime-field/types.js +1 -0
- package/lib/datetime-field/utils.d.ts +25 -0
- package/lib/datetime-field/utils.js +79 -0
- package/lib/datetime-picker/index.d.ts +5 -0
- package/lib/datetime-picker/index.js +6 -7
- package/lib/datetime-picker/themes/halo/dark/index.js +5 -5
- package/lib/datetime-picker/themes/halo/light/index.js +5 -5
- package/lib/datetime-picker/themes/solar/charcoal/index.js +5 -5
- package/lib/datetime-picker/themes/solar/pearl/index.js +5 -5
- package/lib/datetime-picker/utils.js +1 -1
- package/lib/dialog/draggable-element.js +1 -2
- package/lib/dialog/index.d.ts +6 -1
- package/lib/dialog/index.js +5 -5
- package/lib/dialog/themes/halo/dark/index.js +5 -5
- package/lib/dialog/themes/halo/light/index.js +5 -5
- package/lib/dialog/themes/solar/charcoal/index.js +5 -5
- package/lib/dialog/themes/solar/pearl/index.js +5 -5
- package/lib/email-field/index.d.ts +6 -1
- package/lib/email-field/index.js +8 -3
- package/lib/email-field/themes/halo/dark/index.js +1 -1
- package/lib/email-field/themes/halo/light/index.js +1 -1
- package/lib/email-field/themes/solar/charcoal/index.js +1 -1
- package/lib/email-field/themes/solar/pearl/index.js +1 -1
- package/lib/flag/index.d.ts +5 -0
- package/lib/flag/index.js +3 -3
- package/lib/flag/utils/FlagLoader.d.ts +1 -1
- package/lib/flag/utils/FlagLoader.js +1 -1
- package/lib/header/index.d.ts +5 -0
- package/lib/header/index.js +2 -2
- package/lib/heatmap/helpers/color.d.ts +1 -1
- package/lib/heatmap/helpers/color.js +3 -5
- package/lib/heatmap/helpers/text.d.ts +1 -7
- package/lib/heatmap/helpers/text.js +1 -18
- package/lib/heatmap/index.d.ts +5 -0
- package/lib/heatmap/index.js +22 -30
- package/lib/heatmap/themes/halo/dark/index.js +2 -2
- package/lib/heatmap/themes/halo/light/index.js +2 -2
- package/lib/heatmap/themes/solar/charcoal/index.js +2 -2
- package/lib/heatmap/themes/solar/pearl/index.js +2 -2
- package/lib/icon/index.d.ts +5 -0
- package/lib/icon/index.js +3 -3
- package/lib/icon/utils/IconLoader.d.ts +1 -1
- package/lib/icon/utils/IconLoader.js +1 -1
- package/lib/interactive-chart/helpers/types.d.ts +1 -1
- package/lib/interactive-chart/index.d.ts +5 -12
- package/lib/interactive-chart/index.js +20 -36
- package/lib/interactive-chart/themes/halo/dark/index.js +1 -1
- package/lib/interactive-chart/themes/halo/light/index.js +1 -1
- package/lib/interactive-chart/themes/solar/charcoal/index.js +1 -1
- package/lib/interactive-chart/themes/solar/pearl/index.js +1 -1
- package/lib/item/helpers/types.d.ts +1 -1
- package/lib/item/index.d.ts +24 -17
- package/lib/item/index.js +45 -48
- package/lib/item/themes/halo/dark/index.js +2 -2
- package/lib/item/themes/halo/light/index.js +2 -2
- package/lib/item/themes/solar/charcoal/index.js +2 -2
- package/lib/item/themes/solar/pearl/index.js +2 -2
- package/lib/label/index.d.ts +6 -1
- package/lib/label/index.js +6 -6
- package/lib/label/themes/halo/dark/index.js +1 -1
- package/lib/label/themes/halo/light/index.js +1 -1
- package/lib/label/themes/solar/charcoal/index.js +1 -1
- package/lib/label/themes/solar/pearl/index.js +1 -1
- package/lib/layout/index.d.ts +5 -0
- package/lib/layout/index.js +2 -2
- package/lib/led-gauge/index.d.ts +5 -0
- package/lib/led-gauge/index.js +2 -2
- package/lib/led-gauge/themes/halo/dark/index.js +1 -1
- package/lib/led-gauge/themes/halo/light/index.js +1 -1
- package/lib/led-gauge/themes/solar/charcoal/index.js +1 -1
- package/lib/led-gauge/themes/solar/pearl/index.js +1 -1
- package/lib/list/custom-elements.json +0 -13
- package/lib/list/custom-elements.md +9 -10
- package/lib/list/helpers/item-id.d.ts +8 -0
- package/lib/list/helpers/item-id.js +13 -0
- package/lib/list/helpers/{list-renderer.d.ts → renderer.d.ts} +4 -0
- package/lib/list/helpers/{list-renderer.js → renderer.js} +8 -0
- package/lib/list/helpers/types.d.ts +1 -1
- package/lib/list/index.d.ts +18 -12
- package/lib/list/index.js +30 -29
- package/lib/list/renderer.d.ts +1 -1
- package/lib/list/themes/halo/dark/index.js +2 -2
- package/lib/list/themes/halo/light/index.js +2 -2
- package/lib/list/themes/solar/charcoal/index.js +2 -2
- package/lib/list/themes/solar/pearl/index.js +2 -2
- package/lib/loader/index.d.ts +6 -0
- package/lib/loader/index.js +5 -1
- package/lib/multi-input/helpers/types.d.ts +1 -1
- package/lib/multi-input/index.d.ts +5 -0
- package/lib/multi-input/index.js +6 -7
- package/lib/multi-input/themes/halo/dark/index.js +2 -2
- package/lib/multi-input/themes/halo/light/index.js +2 -2
- package/lib/multi-input/themes/solar/charcoal/index.js +2 -2
- package/lib/multi-input/themes/solar/pearl/index.js +2 -2
- package/lib/notification/elements/notification-tray.d.ts +5 -0
- package/lib/notification/elements/notification-tray.js +4 -4
- package/lib/notification/elements/notification.d.ts +15 -0
- package/lib/notification/elements/notification.js +12 -3
- package/lib/notification/themes/halo/dark/index.js +1 -1
- package/lib/notification/themes/halo/light/index.js +1 -1
- package/lib/notification/themes/solar/charcoal/index.js +1 -1
- package/lib/notification/themes/solar/pearl/index.js +1 -1
- package/lib/number-field/index.d.ts +8 -3
- package/lib/number-field/index.js +14 -4
- package/lib/number-field/themes/halo/dark/index.js +1 -1
- package/lib/number-field/themes/halo/light/index.js +1 -1
- package/lib/number-field/themes/solar/charcoal/index.js +1 -1
- package/lib/number-field/themes/solar/pearl/index.js +1 -1
- package/lib/overlay/elements/overlay-backdrop.d.ts +5 -0
- package/lib/overlay/elements/overlay-backdrop.js +2 -2
- package/lib/overlay/elements/overlay-viewport.d.ts +5 -0
- package/lib/overlay/elements/overlay-viewport.js +1 -1
- package/lib/overlay/elements/overlay.d.ts +5 -0
- package/lib/overlay/elements/overlay.js +7 -5
- package/lib/overlay/managers/focus-manager.js +11 -6
- package/lib/overlay/managers/interaction-lock-manager.js +1 -1
- package/lib/overlay/managers/viewport-manager.js +4 -5
- package/lib/overlay/managers/zindex-manager.js +1 -1
- package/lib/overlay-menu/helpers/types.d.ts +7 -1
- package/lib/overlay-menu/helpers/types.js +7 -1
- package/lib/overlay-menu/index.d.ts +14 -4
- package/lib/overlay-menu/index.js +57 -29
- package/lib/overlay-menu/managers/menu-manager.js +2 -1
- package/lib/overlay-menu/themes/halo/dark/index.js +3 -3
- package/lib/overlay-menu/themes/halo/light/index.js +3 -3
- package/lib/overlay-menu/themes/solar/charcoal/index.js +3 -3
- package/lib/overlay-menu/themes/solar/pearl/index.js +3 -3
- package/lib/pagination/index.d.ts +79 -91
- package/lib/pagination/index.js +205 -239
- package/lib/pagination/themes/halo/dark/index.js +4 -5
- package/lib/pagination/themes/halo/light/index.js +4 -5
- package/lib/pagination/themes/solar/charcoal/index.js +4 -5
- package/lib/pagination/themes/solar/pearl/index.js +4 -5
- package/lib/panel/index.d.ts +5 -0
- package/lib/panel/index.js +2 -2
- package/lib/password-field/index.d.ts +7 -2
- package/lib/password-field/index.js +7 -4
- package/lib/password-field/themes/halo/dark/index.js +1 -1
- package/lib/password-field/themes/halo/light/index.js +1 -1
- package/lib/password-field/themes/solar/charcoal/index.js +1 -1
- package/lib/password-field/themes/solar/pearl/index.js +1 -1
- package/lib/pill/index.d.ts +21 -0
- package/lib/pill/index.js +36 -5
- package/lib/pill/themes/halo/dark/index.js +2 -2
- package/lib/pill/themes/halo/light/index.js +2 -2
- package/lib/pill/themes/solar/charcoal/index.js +2 -2
- package/lib/pill/themes/solar/pearl/index.js +2 -2
- package/lib/progress-bar/index.d.ts +5 -0
- package/lib/progress-bar/index.js +3 -3
- package/lib/radio-button/index.d.ts +5 -0
- package/lib/radio-button/index.js +3 -3
- package/lib/radio-button/radio-button-registry.d.ts +1 -1
- package/lib/radio-button/radio-button-registry.js +4 -2
- package/lib/radio-button/themes/halo/dark/index.js +1 -1
- package/lib/radio-button/themes/halo/light/index.js +1 -1
- package/lib/radio-button/themes/solar/charcoal/index.js +1 -1
- package/lib/radio-button/themes/solar/pearl/index.js +1 -1
- package/lib/rating/index.d.ts +5 -0
- package/lib/rating/index.js +4 -4
- package/lib/search-field/index.d.ts +7 -2
- package/lib/search-field/index.js +8 -4
- package/lib/search-field/themes/halo/dark/index.js +1 -1
- package/lib/search-field/themes/halo/light/index.js +1 -1
- package/lib/search-field/themes/solar/charcoal/index.js +1 -1
- package/lib/search-field/themes/solar/pearl/index.js +1 -1
- package/lib/select/index.d.ts +5 -0
- package/lib/select/index.js +11 -14
- package/lib/select/themes/halo/dark/index.js +3 -3
- package/lib/select/themes/halo/light/index.js +3 -3
- package/lib/select/themes/solar/charcoal/index.js +3 -3
- package/lib/select/themes/solar/pearl/index.js +3 -3
- package/lib/sidebar-layout/index.d.ts +5 -0
- package/lib/sidebar-layout/index.js +4 -4
- package/lib/sidebar-layout/themes/halo/dark/index.js +1 -1
- package/lib/sidebar-layout/themes/halo/light/index.js +1 -1
- package/lib/sidebar-layout/themes/solar/charcoal/index.js +1 -1
- package/lib/sidebar-layout/themes/solar/pearl/index.js +1 -1
- package/lib/slider/constants.d.ts +15 -0
- package/lib/slider/constants.js +18 -0
- package/lib/slider/index.d.ts +55 -80
- package/lib/slider/index.js +365 -460
- package/lib/slider/themes/halo/dark/index.js +1 -1
- package/lib/slider/themes/halo/light/index.js +1 -1
- package/lib/slider/themes/solar/charcoal/index.js +1 -1
- package/lib/slider/themes/solar/pearl/index.js +1 -1
- package/lib/slider/utils.d.ts +35 -0
- package/lib/slider/utils.js +54 -0
- package/lib/sparkline/index.d.ts +5 -0
- package/lib/sparkline/index.js +9 -10
- package/lib/swing-gauge/index.d.ts +5 -0
- package/lib/swing-gauge/index.js +14 -8
- package/lib/swing-gauge/themes/halo/dark/index.js +1 -1
- package/lib/swing-gauge/themes/halo/light/index.js +1 -1
- package/lib/swing-gauge/themes/solar/charcoal/index.js +1 -1
- package/lib/swing-gauge/themes/solar/pearl/index.js +1 -1
- package/lib/tab/index.d.ts +5 -0
- package/lib/tab/index.js +4 -4
- package/lib/tab/themes/halo/dark/index.js +2 -2
- package/lib/tab/themes/halo/light/index.js +2 -2
- package/lib/tab/themes/solar/charcoal/index.js +2 -2
- package/lib/tab/themes/solar/pearl/index.js +2 -2
- package/lib/tab-bar/index.d.ts +5 -0
- package/lib/tab-bar/index.js +6 -6
- package/lib/tab-bar/themes/halo/dark/index.js +2 -2
- package/lib/tab-bar/themes/halo/light/index.js +2 -2
- package/lib/tab-bar/themes/solar/charcoal/index.js +2 -2
- package/lib/tab-bar/themes/solar/pearl/index.js +2 -2
- package/lib/text-field/index.d.ts +19 -1
- package/lib/text-field/index.js +35 -11
- package/lib/text-field/themes/halo/dark/index.js +1 -1
- package/lib/text-field/themes/halo/light/index.js +1 -1
- package/lib/text-field/themes/solar/charcoal/index.js +1 -1
- package/lib/text-field/themes/solar/pearl/index.js +1 -1
- package/lib/time-picker/index.d.ts +6 -1
- package/lib/time-picker/index.js +11 -11
- package/lib/time-picker/themes/halo/dark/index.js +2 -2
- package/lib/time-picker/themes/halo/light/index.js +2 -2
- package/lib/time-picker/themes/solar/charcoal/index.js +2 -2
- package/lib/time-picker/themes/solar/pearl/index.js +2 -2
- package/lib/toggle/index.d.ts +5 -0
- package/lib/toggle/index.js +2 -2
- package/lib/tooltip/elements/tooltip-element.d.ts +1 -2
- package/lib/tooltip/index.d.ts +6 -0
- package/lib/tooltip/index.js +7 -8
- package/lib/tooltip/managers/tooltip-manager.js +2 -2
- package/lib/tooltip/themes/halo/dark/index.js +1 -1
- package/lib/tooltip/themes/halo/light/index.js +1 -1
- package/lib/tooltip/themes/solar/charcoal/index.js +1 -1
- package/lib/tooltip/themes/solar/pearl/index.js +1 -1
- package/lib/tornado-chart/elements/tornado-chart.d.ts +5 -0
- package/lib/tornado-chart/elements/tornado-chart.js +2 -2
- package/lib/tornado-chart/elements/tornado-item.d.ts +5 -0
- package/lib/tornado-chart/elements/tornado-item.js +3 -3
- package/lib/tornado-chart/themes/halo/dark/index.js +2 -2
- package/lib/tornado-chart/themes/halo/light/index.js +2 -2
- package/lib/tornado-chart/themes/solar/charcoal/index.js +2 -2
- package/lib/tornado-chart/themes/solar/pearl/index.js +2 -2
- package/lib/tree/elements/tree-item.d.ts +8 -3
- package/lib/tree/elements/tree-item.js +5 -6
- package/lib/tree/elements/tree.d.ts +7 -3
- package/lib/tree/elements/tree.js +6 -7
- package/lib/tree/helpers/renderer.d.ts +4 -0
- package/lib/tree/helpers/renderer.js +20 -13
- package/lib/tree/helpers/types.d.ts +1 -1
- package/lib/tree/managers/tree-manager.d.ts +1 -1
- package/lib/tree/themes/halo/dark/index.js +4 -4
- package/lib/tree/themes/halo/light/index.js +4 -4
- package/lib/tree/themes/solar/charcoal/index.js +4 -4
- package/lib/tree/themes/solar/pearl/index.js +4 -4
- package/lib/tree-select/index.d.ts +8 -7
- package/lib/tree-select/index.js +39 -38
- package/lib/tree-select/themes/halo/dark/index.js +9 -9
- package/lib/tree-select/themes/halo/light/index.js +9 -9
- package/lib/tree-select/themes/solar/charcoal/index.js +9 -9
- package/lib/tree-select/themes/solar/pearl/index.js +9 -9
- package/lib/version.js +1 -1
- package/package.json +35 -295
package/lib/item/index.js
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { ControlElement, css, html } from '@refinitiv-ui/core';
|
|
3
|
-
import { customElement } from '@refinitiv-ui/core/
|
|
4
|
-
import { property } from '@refinitiv-ui/core/
|
|
5
|
-
import { query } from '@refinitiv-ui/core/
|
|
3
|
+
import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
|
|
4
|
+
import { property } from '@refinitiv-ui/core/decorators/property.js';
|
|
5
|
+
import { query } from '@refinitiv-ui/core/decorators/query.js';
|
|
6
6
|
import { VERSION } from '../version.js';
|
|
7
7
|
import '../icon/index.js';
|
|
8
8
|
import '../checkbox/index.js';
|
|
9
9
|
export * from './helpers/types';
|
|
10
|
-
const isAllWhitespaceTextNode = (node) =>
|
|
11
|
-
|
|
12
|
-
return node.nodeType === document.TEXT_NODE
|
|
13
|
-
&& !((_a = node.textContent) === null || _a === void 0 ? void 0 : _a.trim());
|
|
14
|
-
};
|
|
10
|
+
const isAllWhitespaceTextNode = (node) => node.nodeType === document.TEXT_NODE
|
|
11
|
+
&& !node.textContent?.trim();
|
|
15
12
|
/**
|
|
16
13
|
* Used as a basic building block to compose complex custom elements,
|
|
17
14
|
* additionally it can be used by applications
|
|
@@ -43,12 +40,10 @@ let Item = class Item extends ControlElement {
|
|
|
43
40
|
* Set the icon name from the ef-icon list
|
|
44
41
|
*/
|
|
45
42
|
this.icon = null;
|
|
46
|
-
this._selected = false;
|
|
47
43
|
/**
|
|
48
|
-
*
|
|
49
|
-
* @ignore
|
|
44
|
+
* Indicates that the item is selected
|
|
50
45
|
*/
|
|
51
|
-
this.
|
|
46
|
+
this.selected = false;
|
|
52
47
|
/**
|
|
53
48
|
* Is the item part of a multiple selection
|
|
54
49
|
*/
|
|
@@ -114,22 +109,6 @@ let Item = class Item extends ControlElement {
|
|
|
114
109
|
}
|
|
115
110
|
`;
|
|
116
111
|
}
|
|
117
|
-
/**
|
|
118
|
-
* Indicates that the item is selected
|
|
119
|
-
* @param value selected value
|
|
120
|
-
* @default false
|
|
121
|
-
*/
|
|
122
|
-
set selected(value) {
|
|
123
|
-
const oldValue = this._selected;
|
|
124
|
-
if (oldValue !== value) {
|
|
125
|
-
this._selected = value;
|
|
126
|
-
this.ariaSelected = String(value);
|
|
127
|
-
void this.requestUpdate('selected', oldValue);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
get selected() {
|
|
131
|
-
return this._selected;
|
|
132
|
-
}
|
|
133
112
|
/**
|
|
134
113
|
* @param node that should be checked
|
|
135
114
|
* @returns whether node can be ignored.
|
|
@@ -139,14 +118,48 @@ let Item = class Item extends ControlElement {
|
|
|
139
118
|
|| isAllWhitespaceTextNode(node);
|
|
140
119
|
}
|
|
141
120
|
/**
|
|
142
|
-
*
|
|
121
|
+
* Handles aria-selected or aria-checked when toggle between single and multiple selection mode
|
|
122
|
+
* @returns {void}
|
|
123
|
+
**/
|
|
124
|
+
multipleChanged() {
|
|
125
|
+
this.removeAttribute(this.multiple ? 'aria-selected' : 'aria-checked');
|
|
126
|
+
this.selectedChanged();
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Handles aria when selected state changes
|
|
130
|
+
* @returns {void}
|
|
131
|
+
*/
|
|
132
|
+
selectedChanged() {
|
|
133
|
+
this.setAttribute(this.multiple ? 'aria-checked' : 'aria-selected', String(this.selected));
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Control State behaviour will update tabindex based on the property
|
|
137
|
+
* @returns {void}
|
|
138
|
+
*/
|
|
139
|
+
typeChanged() {
|
|
140
|
+
const noInteraction = this.type === 'header' || this.type === 'divider' || this.disabled;
|
|
141
|
+
if (noInteraction) {
|
|
142
|
+
this.disableFocus();
|
|
143
|
+
}
|
|
144
|
+
else if (!this.disabled) {
|
|
145
|
+
this.enableFocus();
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Invoked before update() to compute values needed during the update.
|
|
150
|
+
* @param changedProperties changed properties
|
|
143
151
|
* @returns {void}
|
|
144
152
|
*/
|
|
145
|
-
|
|
153
|
+
willUpdate(changedProperties) {
|
|
146
154
|
if (changedProperties.has('type')) {
|
|
147
155
|
this.typeChanged();
|
|
148
156
|
}
|
|
149
|
-
|
|
157
|
+
if (changedProperties.has('multiple')) {
|
|
158
|
+
this.multipleChanged();
|
|
159
|
+
}
|
|
160
|
+
else if (changedProperties.has('selected')) {
|
|
161
|
+
this.selectedChanged();
|
|
162
|
+
}
|
|
150
163
|
}
|
|
151
164
|
/**
|
|
152
165
|
* Get icon template if icon attribute is defined
|
|
@@ -197,19 +210,6 @@ let Item = class Item extends ControlElement {
|
|
|
197
210
|
get isTruncated() {
|
|
198
211
|
return !!(this.labelEl && (this.labelEl.offsetWidth < this.labelEl.scrollWidth));
|
|
199
212
|
}
|
|
200
|
-
/**
|
|
201
|
-
* Control State behaviour will update tabindex based on the property
|
|
202
|
-
* @returns {void}
|
|
203
|
-
*/
|
|
204
|
-
typeChanged() {
|
|
205
|
-
const noInteraction = this.type === 'header' || this.type === 'divider' || this.disabled;
|
|
206
|
-
if (noInteraction) {
|
|
207
|
-
this.disableFocus();
|
|
208
|
-
}
|
|
209
|
-
else if (!this.disabled) {
|
|
210
|
-
this.enableFocus();
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
213
|
/**
|
|
214
214
|
* A `TemplateResult` that will be used
|
|
215
215
|
* to render the updated internal template.
|
|
@@ -245,10 +245,7 @@ __decorate([
|
|
|
245
245
|
], Item.prototype, "icon", void 0);
|
|
246
246
|
__decorate([
|
|
247
247
|
property({ type: Boolean, reflect: true })
|
|
248
|
-
], Item.prototype, "selected",
|
|
249
|
-
__decorate([
|
|
250
|
-
property({ type: String, reflect: true, attribute: 'aria-selected' })
|
|
251
|
-
], Item.prototype, "ariaSelected", void 0);
|
|
248
|
+
], Item.prototype, "selected", void 0);
|
|
252
249
|
__decorate([
|
|
253
250
|
property({ type: Boolean, reflect: true })
|
|
254
251
|
], Item.prototype, "multiple", void 0);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import '@refinitiv-ui/elements/
|
|
2
|
-
import '@refinitiv-ui/elements/
|
|
1
|
+
import '@refinitiv-ui/elements/icon/themes/halo/dark';
|
|
2
|
+
import '@refinitiv-ui/elements/checkbox/themes/halo/dark';
|
|
3
3
|
|
|
4
4
|
elf.customStyles.define('ef-item', ':host{outline:0;cursor:pointer;padding:0 8px;min-height:24px;box-sizing:border-box;touch-action:manipulation}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){:host(:after){content:\'\';min-height:inherit;font-size:0}}:host([selected]){color:#fff;font-weight:500}:host([readonly]){cursor:default}:host([focused]),:host([highlighted]){background-color:#334bff;color:#fff}:host([focused]:not([selected])),:host([highlighted]:not([selected])){color:#fff}:host [part=center],:host [part=sub-label]{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}:host([disabled]){color:rgba(204,204,204,.5)}:host([type=divider]),:host([type=header]){pointer-events:none;min-height:auto}:host([type=divider]) [part=sub-label],:host([type=header]) [part=sub-label]{display:none}:host([type=header]){color:#999;background-color:transparent;font-size:83%;font-weight:500;border:none;height:24px;align-items:flex-end;margin:0;min-height:0;text-transform:uppercase;align-items:center}:host([type=divider]){border:none;padding:0;margin:0;height:5px;background:linear-gradient(#404040,#404040) 0 center/calc(100% - (0px * 2)) 1px no-repeat}:host [part=checkbox],:host [part=icon],:host [part=left] ::slotted(*){margin:0 .5em 0 0}:host [part=right] ::slotted(*){margin-left:.5em}:host [part=checkbox]{margin-right:8px}:host [part=sub-label]{font-size:90%}:host([sub-label]){padding:4px 8px}:host([selected]:not([highlighted]):not([focused])){background-color:#333}:host([selected]:not([multiple])){background-image:linear-gradient(#334bff,#334bff);background-size:4px 100%;background-position:left top;background-repeat:no-repeat}:host([selected][focused]),:host([selected][highlighted]){color:#fff}');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import '@refinitiv-ui/elements/
|
|
2
|
-
import '@refinitiv-ui/elements/
|
|
1
|
+
import '@refinitiv-ui/elements/icon/themes/halo/light';
|
|
2
|
+
import '@refinitiv-ui/elements/checkbox/themes/halo/light';
|
|
3
3
|
|
|
4
4
|
elf.customStyles.define('ef-item', ':host{outline:0;cursor:pointer;padding:0 8px;min-height:24px;box-sizing:border-box;touch-action:manipulation}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){:host(:after){content:\'\';min-height:inherit;font-size:0}}:host([selected]){color:#0d0d0d;font-weight:500}:host([readonly]){cursor:default}:host([focused]),:host([highlighted]){background-color:#334bff;color:#fff}:host([focused]:not([selected])),:host([highlighted]:not([selected])){color:#fff}:host [part=center],:host [part=sub-label]{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}:host([disabled]){color:rgba(64,64,64,.5)}:host([type=divider]),:host([type=header]){pointer-events:none;min-height:auto}:host([type=divider]) [part=sub-label],:host([type=header]) [part=sub-label]{display:none}:host([type=header]){color:#737373;background-color:transparent;font-size:83%;font-weight:500;border:none;height:24px;align-items:flex-end;margin:0;min-height:0;text-transform:uppercase;align-items:center}:host([type=divider]){border:none;padding:0;margin:0;height:5px;background:linear-gradient(#d9d9d9,#d9d9d9) 0 center/calc(100% - (0px * 2)) 1px no-repeat}:host [part=checkbox],:host [part=icon],:host [part=left] ::slotted(*){margin:0 .5em 0 0}:host [part=right] ::slotted(*){margin-left:.5em}:host [part=checkbox]{margin-right:8px}:host [part=sub-label]{font-size:90%}:host([sub-label]){padding:4px 8px}:host([selected]:not([highlighted]):not([focused])){background-color:#e6e6e6}:host([selected]:not([multiple])){background-image:linear-gradient(#334bff,#334bff);background-size:4px 100%;background-position:left top;background-repeat:no-repeat}:host([selected][focused]),:host([selected][highlighted]){color:#fff}');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import '@refinitiv-ui/elements/
|
|
2
|
-
import '@refinitiv-ui/elements/
|
|
1
|
+
import '@refinitiv-ui/elements/icon/themes/solar/charcoal';
|
|
2
|
+
import '@refinitiv-ui/elements/checkbox/themes/solar/charcoal';
|
|
3
3
|
|
|
4
4
|
elf.customStyles.define('ef-item', ':host{outline:0;cursor:pointer;padding:0 7px;min-height:22px;box-sizing:border-box;touch-action:manipulation}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){:host(:after){content:\'\';min-height:inherit;font-size:0}}:host([selected]){color:#f93}:host([readonly]){cursor:default}:host([focused]),:host([highlighted]){background-color:rgba(255,255,255,.1)}:host([focused]:not([selected])),:host([highlighted]:not([selected])){color:#fff}:host [part=center],:host [part=sub-label]{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}:host([disabled]){color:rgba(194,194,194,.5)}:host([type=divider]),:host([type=header]){pointer-events:none;min-height:auto}:host([type=divider]) [part=sub-label],:host([type=header]) [part=sub-label]{display:none}:host([type=header]){color:#c2c2c2;background-color:#4a4a52;font-size:100%;font-weight:400;border:1px solid #0a0a0a;height:22px;align-items:flex-end;margin:0;min-height:0;text-transform:uppercase;border:none;border-top:1px solid #0a0a0a;border-bottom:1px solid transparent;text-transform:none;align-items:center}:host([type=divider]){border:none;padding:0;margin:0;height:5px;background:linear-gradient(#2e2e33,#2e2e33) 0 center/calc(100% - (0px * 2)) 1px no-repeat}:host [part=checkbox],:host [part=icon],:host [part=left] ::slotted(*){margin:0 .5em 0 0}:host [part=sub-label]{font-size:80%}:host [part=icon],:host [part=left] ::slotted(*){margin-right:.33em}:host [part=right] ::slotted(*){margin-left:.33em}');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import '@refinitiv-ui/elements/
|
|
2
|
-
import '@refinitiv-ui/elements/
|
|
1
|
+
import '@refinitiv-ui/elements/icon/themes/solar/pearl';
|
|
2
|
+
import '@refinitiv-ui/elements/checkbox/themes/solar/pearl';
|
|
3
3
|
|
|
4
4
|
elf.customStyles.define('ef-item', ':host{outline:0;cursor:pointer;padding:0 7px;min-height:22px;box-sizing:border-box;touch-action:manipulation}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){:host(:after){content:\'\';min-height:inherit;font-size:0}}:host([selected]){color:#ee7600}:host([readonly]){cursor:default}:host([focused]),:host([highlighted]){background-color:rgba(0,0,0,.08)}:host([focused]:not([selected])),:host([highlighted]:not([selected])){color:#000}:host [part=center],:host [part=sub-label]{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}:host([disabled]){color:rgba(72,72,72,.5)}:host([type=divider]),:host([type=header]){pointer-events:none;min-height:auto}:host([type=divider]) [part=sub-label],:host([type=header]) [part=sub-label]{display:none}:host([type=header]){color:#484848;background-color:#f2f3f7;font-size:100%;font-weight:400;border:1px solid #d5d8db;height:22px;align-items:flex-end;margin:0;min-height:0;text-transform:uppercase;border:none;border-top:1px solid #d5d8db;border-bottom:1px solid transparent;text-transform:none;align-items:center}:host([type=divider]){border:none;padding:0;margin:0;height:5px;background:linear-gradient(#a9afba,#a9afba) 0 center/calc(100% - (0px * 2)) 1px no-repeat}:host [part=checkbox],:host [part=icon],:host [part=left] ::slotted(*){margin:0 .5em 0 0}:host [part=sub-label]{font-size:80%}:host [part=icon],:host [part=left] ::slotted(*){margin-right:.33em}:host [part=right] ::slotted(*){margin-left:.33em}');
|
package/lib/label/index.d.ts
CHANGED
|
@@ -63,7 +63,7 @@ export declare class Label extends BasicElement {
|
|
|
63
63
|
protected shouldShowTooltip(tooltipTarget: HTMLElement): boolean;
|
|
64
64
|
/**
|
|
65
65
|
* Handles any modifications to the internal HTML
|
|
66
|
-
* @param [mutation=false] is the request from a mutation event?
|
|
66
|
+
* @param [mutation=false] is the request from a mutation event ? ( reserved for future used )
|
|
67
67
|
* @returns {void}
|
|
68
68
|
*/
|
|
69
69
|
protected recalculate(mutation?: boolean): void;
|
|
@@ -86,6 +86,11 @@ export declare class Label extends BasicElement {
|
|
|
86
86
|
*/
|
|
87
87
|
protected render(): TemplateResult;
|
|
88
88
|
}
|
|
89
|
+
declare global {
|
|
90
|
+
interface HTMLElementTagNameMap {
|
|
91
|
+
'ef-label': Label;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
89
94
|
|
|
90
95
|
declare global {
|
|
91
96
|
interface HTMLElementTagNameMap {
|
package/lib/label/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { BasicElement, html, css } from '@refinitiv-ui/core';
|
|
3
|
-
import { customElement } from '@refinitiv-ui/core/
|
|
4
|
-
import { property } from '@refinitiv-ui/core/
|
|
5
|
-
import { styleMap } from '@refinitiv-ui/core/
|
|
3
|
+
import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
|
|
4
|
+
import { property } from '@refinitiv-ui/core/decorators/property.js';
|
|
5
|
+
import { styleMap } from '@refinitiv-ui/core/directives/style-map.js';
|
|
6
6
|
import { VERSION } from '../version.js';
|
|
7
|
-
import { isIE } from '@refinitiv-ui/utils/
|
|
7
|
+
import { isIE } from '@refinitiv-ui/utils/browser.js';
|
|
8
8
|
import { addTooltipCondition, removeTooltipCondition } from '../tooltip/index.js';
|
|
9
9
|
/**
|
|
10
10
|
* Configuration object
|
|
@@ -149,11 +149,11 @@ let Label = class Label extends BasicElement {
|
|
|
149
149
|
}
|
|
150
150
|
/**
|
|
151
151
|
* Handles any modifications to the internal HTML
|
|
152
|
-
* @param [mutation=false] is the request from a mutation event?
|
|
152
|
+
* @param [mutation=false] is the request from a mutation event ? ( reserved for future used )
|
|
153
153
|
* @returns {void}
|
|
154
154
|
*/
|
|
155
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
155
156
|
recalculate(mutation = false) {
|
|
156
|
-
mutation; // keeping here for future use
|
|
157
157
|
const oldValue = this.text;
|
|
158
158
|
const raw = this.textContent || '';
|
|
159
159
|
this.chunks = raw.split(_).map(chunk => chunk.trim()).filter(chunk => chunk);
|
package/lib/layout/index.d.ts
CHANGED
|
@@ -91,6 +91,11 @@ export declare class Layout extends ResponsiveElement {
|
|
|
91
91
|
*/
|
|
92
92
|
protected render(): TemplateResult;
|
|
93
93
|
}
|
|
94
|
+
declare global {
|
|
95
|
+
interface HTMLElementTagNameMap {
|
|
96
|
+
'ef-layout': Layout;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
94
99
|
|
|
95
100
|
declare global {
|
|
96
101
|
interface HTMLElementTagNameMap {
|
package/lib/layout/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { ResponsiveElement, html, css } from '@refinitiv-ui/core';
|
|
3
|
-
import { customElement } from '@refinitiv-ui/core/
|
|
4
|
-
import { property } from '@refinitiv-ui/core/
|
|
3
|
+
import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
|
|
4
|
+
import { property } from '@refinitiv-ui/core/decorators/property.js';
|
|
5
5
|
import { VERSION } from '../version.js';
|
|
6
6
|
/**
|
|
7
7
|
* Layout component for creating responsive applications and components
|
package/lib/led-gauge/index.d.ts
CHANGED
|
@@ -128,6 +128,11 @@ export declare class LedGauge extends BasicElement {
|
|
|
128
128
|
*/
|
|
129
129
|
protected render(): TemplateResult;
|
|
130
130
|
}
|
|
131
|
+
declare global {
|
|
132
|
+
interface HTMLElementTagNameMap {
|
|
133
|
+
'ef-led-gauge': LedGauge;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
131
136
|
|
|
132
137
|
declare global {
|
|
133
138
|
interface HTMLElementTagNameMap {
|
package/lib/led-gauge/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { BasicElement, html, css } from '@refinitiv-ui/core';
|
|
3
|
-
import { customElement } from '@refinitiv-ui/core/
|
|
4
|
-
import { property } from '@refinitiv-ui/core/
|
|
3
|
+
import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
|
|
4
|
+
import { property } from '@refinitiv-ui/core/decorators/property.js';
|
|
5
5
|
import { VERSION } from '../version.js';
|
|
6
6
|
import '../canvas/index.js';
|
|
7
7
|
const ZERO_MAP = {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import '@refinitiv-ui/elements/
|
|
1
|
+
import '@refinitiv-ui/elements/canvas/themes/halo/dark';
|
|
2
2
|
|
|
3
3
|
elf.customStyles.define('ef-led-gauge', ':host{font-size:12px;--led-width:8px;--led-spacing:3px;--top-selected-color:#6678FF;--bottom-selected-color:#6678FF;--clash-color:#ffffff;--range-color:#c948a2;--neutral-color:#7a7a7a;--left-segment-color:#932b37;--center-left-segment-color:#60111a;--center-segment-color:#7a7a7a;--center-right-segment-color:#144628;--right-segment-color:#227642;height:68px;--led-width:5px;--led-spacing:1px;--left-segment-color:#B72536;--center-left-segment-color:#F5475B;--center-segment-color:#808080;--center-right-segment-color:#39C46E;--right-segment-color:#227542;--range-color:#6678FF;--top-selected-color:#6678FF;--bottom-selected-color:#F5475B}:host [part=label]{padding:3px}');
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import '@refinitiv-ui/elements/
|
|
1
|
+
import '@refinitiv-ui/elements/canvas/themes/halo/light';
|
|
2
2
|
|
|
3
3
|
elf.customStyles.define('ef-led-gauge', ':host{font-size:12px;--led-width:8px;--led-spacing:3px;--top-selected-color:#334BFF;--bottom-selected-color:#334BFF;--clash-color:#000000;--range-color:#fc73d2;--neutral-color:#b8b8b8;--left-segment-color:#B63243;--center-left-segment-color:#f3c5cb;--center-segment-color:#b8b8b8;--center-right-segment-color:#a8e2be;--right-segment-color:#246B3E;height:68px;--led-width:5px;--led-spacing:1px;--left-segment-color:#B63243;--center-left-segment-color:#D94255;--center-segment-color:#808080;--center-right-segment-color:#309054;--right-segment-color:#246B3E;--range-color:#334BFF;--top-selected-color:#334BFF;--bottom-selected-color:#F5475B}:host [part=label]{padding:3px}');
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import '@refinitiv-ui/elements/
|
|
1
|
+
import '@refinitiv-ui/elements/canvas/themes/solar/charcoal';
|
|
2
2
|
|
|
3
3
|
elf.customStyles.define('ef-led-gauge', ':host{--led-width:8px;--led-spacing:3px;--top-selected-color:#FF9933;--bottom-selected-color:#FF9933;--clash-color:#ffffff;--range-color:#c948a2;--neutral-color:#747474;--left-segment-color:#932b37;--center-left-segment-color:#521822;--center-segment-color:#747474;--center-right-segment-color:#11472d;--right-segment-color:#227642;height:68px;font-size:10px;--led-width:5px;--led-spacing:4px;--top-selected-color:#FF9933;--bottom-selected-color:#46A0F0;--range-color:#2277AA}:host [part=label]{padding:2px}');
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import '@refinitiv-ui/elements/
|
|
1
|
+
import '@refinitiv-ui/elements/canvas/themes/solar/pearl';
|
|
2
2
|
|
|
3
3
|
elf.customStyles.define('ef-led-gauge', ':host{--led-width:8px;--led-spacing:3px;--top-selected-color:#EE7600;--bottom-selected-color:#EE7600;--clash-color:#000000;--range-color:#fc73d2;--neutral-color:#e2e4e6;--left-segment-color:#D94255;--center-left-segment-color:#f4b0bc;--center-segment-color:#e2e4e6;--center-right-segment-color:#a7e7c9;--right-segment-color:#309054;height:68px;font-size:10px;--led-width:5px;--led-spacing:4px;--top-selected-color:#EE7600;--bottom-selected-color:#0080F0;--range-color:#00B0FF}:host [part=label]{padding:2px}');
|
|
@@ -11,12 +11,6 @@
|
|
|
11
11
|
"type": "boolean",
|
|
12
12
|
"default": "false"
|
|
13
13
|
},
|
|
14
|
-
{
|
|
15
|
-
"name": "aria-multiselectable",
|
|
16
|
-
"description": "Aria indicating that list supports multiple selection",
|
|
17
|
-
"type": "string",
|
|
18
|
-
"default": "false"
|
|
19
|
-
},
|
|
20
14
|
{
|
|
21
15
|
"name": "multiple",
|
|
22
16
|
"description": "Allow multiple selections",
|
|
@@ -50,13 +44,6 @@
|
|
|
50
44
|
"type": "boolean",
|
|
51
45
|
"default": "false"
|
|
52
46
|
},
|
|
53
|
-
{
|
|
54
|
-
"name": "ariaMultiselectable",
|
|
55
|
-
"attribute": "aria-multiselectable",
|
|
56
|
-
"description": "Aria indicating that list supports multiple selection",
|
|
57
|
-
"type": "string",
|
|
58
|
-
"default": "false"
|
|
59
|
-
},
|
|
60
47
|
{
|
|
61
48
|
"name": "multiple",
|
|
62
49
|
"attribute": "multiple",
|
|
@@ -4,16 +4,15 @@ Provides listing and immutable selection
|
|
|
4
4
|
|
|
5
5
|
## Properties
|
|
6
6
|
|
|
7
|
-
| Property | Attribute
|
|
8
|
-
|
|
9
|
-
| `
|
|
10
|
-
| `
|
|
11
|
-
| `
|
|
12
|
-
| `
|
|
13
|
-
| `
|
|
14
|
-
| `
|
|
15
|
-
| `
|
|
16
|
-
| `values` | | `string[]` | [] | Returns a values collection of the currently<br />selected item values |
|
|
7
|
+
| Property | Attribute | Type | Default | Description |
|
|
8
|
+
|-----------------------------|-------------|----------------|--------------------------|--------------------------------------------------|
|
|
9
|
+
| `data` | | `ListData` | null | The data object, used to render the list. |
|
|
10
|
+
| `delegatesFocus (readonly)` | | `false` | false | Element focus delegation.<br />Set to `false` and relies on native focusing. |
|
|
11
|
+
| `multiple` | `multiple` | `boolean` | false | Allow multiple selections |
|
|
12
|
+
| `renderer` | | `ListRenderer` | "new ListRenderer(this)" | Renderer used to render list item elements |
|
|
13
|
+
| `stateless` | `stateless` | `boolean` | false | Disable selections |
|
|
14
|
+
| `value` | `value` | `string` | "" | Returns the first selected item value.<br />Use `values` when multiple selection mode is enabled. |
|
|
15
|
+
| `values` | | `string[]` | [] | Returns a values collection of the currently<br />selected item values |
|
|
17
16
|
|
|
18
17
|
## Methods
|
|
19
18
|
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Combines prefix and a string to give unique item id used by aria-activedescendant
|
|
3
|
+
* @param prefix a unique randomly generated string
|
|
4
|
+
* @param value a string of valid item value
|
|
5
|
+
* @returns a unique item id
|
|
6
|
+
*/
|
|
7
|
+
declare const getItemId: (prefix: string, value: string | undefined) => string;
|
|
8
|
+
export { getItemId };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Combines prefix and a string to give unique item id used by aria-activedescendant
|
|
3
|
+
* @param prefix a unique randomly generated string
|
|
4
|
+
* @param value a string of valid item value
|
|
5
|
+
* @returns a unique item id
|
|
6
|
+
*/
|
|
7
|
+
const getItemId = (prefix, value) => {
|
|
8
|
+
if (!prefix || !value) {
|
|
9
|
+
return '';
|
|
10
|
+
}
|
|
11
|
+
return `${prefix}-${value}`;
|
|
12
|
+
};
|
|
13
|
+
export { getItemId };
|
|
@@ -5,5 +5,9 @@ import { Renderer } from '../renderer.js';
|
|
|
5
5
|
* This is the default renderer for lists.
|
|
6
6
|
*/
|
|
7
7
|
export declare class ListRenderer extends Renderer {
|
|
8
|
+
/**
|
|
9
|
+
* Renderer key prefix, used in combination with item value to give unique id to each item
|
|
10
|
+
*/
|
|
11
|
+
key: string;
|
|
8
12
|
constructor(context?: unknown);
|
|
9
13
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { uuid } from '@refinitiv-ui/utils/uuid.js';
|
|
1
2
|
import '../../item/index.js';
|
|
3
|
+
import { getItemId } from './item-id.js';
|
|
2
4
|
import { Renderer } from '../renderer.js';
|
|
3
5
|
/**
|
|
4
6
|
* Renders list items as `ef-item` elements.
|
|
@@ -21,6 +23,7 @@ export class ListRenderer extends Renderer {
|
|
|
21
23
|
el.label = composer.getItemPropertyValue(item, 'label');
|
|
22
24
|
el.subLabel = composer.getItemPropertyValue(item, 'subLabel');
|
|
23
25
|
el.value = composer.getItemPropertyValue(item, 'value');
|
|
26
|
+
el.id = getItemId(this.key, el.value);
|
|
24
27
|
el.icon = composer.getItemPropertyValue(item, 'icon');
|
|
25
28
|
el.highlighted = composer.getItemPropertyValue(item, 'highlighted') === true;
|
|
26
29
|
el.selected = composer.getItemPropertyValue(item, 'selected') === true;
|
|
@@ -29,9 +32,14 @@ export class ListRenderer extends Renderer {
|
|
|
29
32
|
el.type = composer.getItemPropertyValue(item, 'type');
|
|
30
33
|
el.multiple = !!context && context.multiple === true;
|
|
31
34
|
const itemRole = el.type === 'text' || !el.type ? 'option' : 'presentation';
|
|
35
|
+
el.tabIndex = -1;
|
|
32
36
|
el.setAttribute('role', itemRole);
|
|
33
37
|
tooltip ? el.setAttribute('title', tooltip) : el.removeAttribute('title');
|
|
34
38
|
return el;
|
|
35
39
|
});
|
|
40
|
+
/**
|
|
41
|
+
* Renderer key prefix, used in combination with item value to give unique id to each item
|
|
42
|
+
*/
|
|
43
|
+
this.key = uuid();
|
|
36
44
|
}
|
|
37
45
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { CollectionComposer, DataItem } from '@refinitiv-ui/utils/
|
|
1
|
+
import type { CollectionComposer, DataItem } from '@refinitiv-ui/utils/collection.js';
|
|
2
2
|
import type { ItemData } from '../../item';
|
|
3
3
|
export declare type ListData<T extends DataItem = ItemData> = T[] | CollectionComposer<T> | null;
|
package/lib/list/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { JSXInterface } from '../jsx';
|
|
2
2
|
import { ControlElement, CSSResultGroup, PropertyValues, TapEvent, TemplateResult } from '@refinitiv-ui/core';
|
|
3
|
-
import { CollectionComposer, DataItem } from '@refinitiv-ui/utils/
|
|
3
|
+
import { CollectionComposer, DataItem } from '@refinitiv-ui/utils/collection.js';
|
|
4
4
|
import type { ItemData } from '../item';
|
|
5
5
|
import type { ListData } from './helpers/types';
|
|
6
|
-
import { ListRenderer } from './helpers/
|
|
6
|
+
import { ListRenderer } from './helpers/renderer.js';
|
|
7
7
|
import '../item/index.js';
|
|
8
8
|
export type { ListData };
|
|
9
9
|
export { ListRenderer };
|
|
@@ -48,10 +48,6 @@ export declare class List<T extends DataItem = ItemData> extends ControlElement
|
|
|
48
48
|
* Composer used to query and modify item state.
|
|
49
49
|
*/
|
|
50
50
|
protected composer: CollectionComposer<T>;
|
|
51
|
-
/**
|
|
52
|
-
* Use default `tabindex` so that items are priority focus targets
|
|
53
|
-
*/
|
|
54
|
-
protected readonly defaultTabIndex: null;
|
|
55
51
|
/**
|
|
56
52
|
* Element focus delegation.
|
|
57
53
|
* Set to `false` and relies on native focusing.
|
|
@@ -66,10 +62,6 @@ export declare class List<T extends DataItem = ItemData> extends ControlElement
|
|
|
66
62
|
* Disable selections
|
|
67
63
|
*/
|
|
68
64
|
stateless: boolean;
|
|
69
|
-
/**
|
|
70
|
-
* Aria indicating that list supports multiple selection
|
|
71
|
-
*/
|
|
72
|
-
ariaMultiselectable: string;
|
|
73
65
|
/**
|
|
74
66
|
* Allow multiple selections
|
|
75
67
|
*/
|
|
@@ -280,9 +272,18 @@ export declare class List<T extends DataItem = ItemData> extends ControlElement
|
|
|
280
272
|
* @returns {void}
|
|
281
273
|
*/
|
|
282
274
|
protected renderLightDOM(): void;
|
|
275
|
+
/**
|
|
276
|
+
* Invoked when the element is first updated. Implement to perform one time work on the element after update.
|
|
277
|
+
* @param changeProperties changed properties
|
|
278
|
+
* @returns {void}
|
|
279
|
+
*/
|
|
283
280
|
protected firstUpdated(changeProperties: PropertyValues): void;
|
|
284
|
-
|
|
285
|
-
|
|
281
|
+
/**
|
|
282
|
+
* Invoked before update() to compute values needed during the update.
|
|
283
|
+
* @param changeProperties changed properties
|
|
284
|
+
* @returns {void}
|
|
285
|
+
*/
|
|
286
|
+
protected willUpdate(changeProperties: PropertyValues): void;
|
|
286
287
|
/**
|
|
287
288
|
* A `CSSResultGroup` that will be used
|
|
288
289
|
* to style the host, slotted children
|
|
@@ -297,6 +298,11 @@ export declare class List<T extends DataItem = ItemData> extends ControlElement
|
|
|
297
298
|
*/
|
|
298
299
|
protected render(): TemplateResult;
|
|
299
300
|
}
|
|
301
|
+
declare global {
|
|
302
|
+
interface HTMLElementTagNameMap {
|
|
303
|
+
'ef-list': List;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
300
306
|
|
|
301
307
|
declare global {
|
|
302
308
|
interface HTMLElementTagNameMap {
|