@refinitiv-ui/elements 6.8.8 → 6.8.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +177 -442
- package/LICENSE +1 -1
- package/README.md +13 -11
- package/lib/accordion/index.d.ts +1 -1
- package/lib/accordion/index.js +4 -7
- package/lib/appstate-bar/index.d.ts +2 -2
- package/lib/appstate-bar/index.js +10 -4
- package/lib/autosuggest/index.d.ts +7 -7
- package/lib/autosuggest/index.js +85 -80
- package/lib/autosuggest/themes/solar/charcoal/index.js +1 -1
- package/lib/autosuggest/themes/solar/pearl/index.js +1 -1
- package/lib/button/index.js +7 -10
- package/lib/button-bar/index.d.ts +1 -1
- package/lib/button-bar/index.js +12 -12
- package/lib/calendar/index.d.ts +39 -39
- package/lib/calendar/index.js +160 -125
- package/lib/calendar/utils.js +2 -2
- package/lib/canvas/index.d.ts +1 -1
- package/lib/canvas/index.js +2 -4
- package/lib/card/helpers/types.d.ts +2 -2
- package/lib/card/index.d.ts +5 -5
- package/lib/card/index.js +34 -28
- package/lib/chart/helpers/legend.js +10 -8
- package/lib/chart/index.d.ts +3 -3
- package/lib/chart/index.js +17 -17
- package/lib/chart/plugins/doughnut-center-label.js +6 -5
- package/lib/checkbox/index.d.ts +1 -1
- package/lib/checkbox/index.js +12 -13
- package/lib/clock/index.d.ts +55 -55
- package/lib/clock/index.js +84 -95
- package/lib/clock/themes/halo/dark/index.js +1 -1
- package/lib/clock/themes/halo/light/index.js +1 -1
- package/lib/clock/themes/solar/charcoal/index.js +1 -1
- package/lib/clock/themes/solar/pearl/index.js +1 -1
- package/lib/collapse/index.d.ts +1 -1
- package/lib/collapse/index.js +28 -19
- package/lib/collapse/themes/halo/dark/index.js +1 -1
- package/lib/collapse/themes/halo/light/index.js +1 -1
- package/lib/color-dialog/elements/color-palettes.d.ts +1 -1
- package/lib/color-dialog/elements/color-palettes.js +5 -6
- package/lib/color-dialog/elements/grayscale-palettes.d.ts +1 -1
- package/lib/color-dialog/elements/grayscale-palettes.js +9 -9
- package/lib/color-dialog/elements/palettes.js +5 -4
- package/lib/color-dialog/helpers/value-model.js +7 -9
- package/lib/color-dialog/index.d.ts +6 -6
- package/lib/color-dialog/index.js +53 -37
- package/lib/color-picker/index.d.ts +2 -2
- package/lib/color-picker/index.js +40 -34
- package/lib/combo-box/helpers/filter.d.ts +2 -2
- package/lib/combo-box/helpers/types.d.ts +1 -1
- package/lib/combo-box/index.d.ts +9 -9
- package/lib/combo-box/index.js +61 -55
- package/lib/configuration/elements/configuration.js +2 -2
- package/lib/counter/index.d.ts +4 -4
- package/lib/counter/index.js +9 -7
- package/lib/datetime-field/index.d.ts +4 -5
- package/lib/datetime-field/index.js +32 -23
- package/lib/datetime-field/utils.js +11 -1
- package/lib/datetime-picker/index.d.ts +75 -75
- package/lib/datetime-picker/index.js +151 -132
- package/lib/datetime-picker/locales.js +5 -5
- package/lib/datetime-picker/utils.js +9 -9
- package/lib/dialog/draggable-element.js +1 -2
- package/lib/dialog/index.d.ts +6 -6
- package/lib/dialog/index.js +48 -38
- package/lib/email-field/index.d.ts +1 -1
- package/lib/email-field/index.js +6 -6
- package/lib/events.d.ts +1 -1
- package/lib/flag/index.d.ts +1 -1
- package/lib/flag/index.js +6 -5
- package/lib/flag/utils/FlagLoader.js +1 -1
- package/lib/header/index.d.ts +1 -1
- package/lib/header/index.js +2 -2
- package/lib/header/themes/halo/dark/index.js +1 -1
- package/lib/header/themes/halo/light/index.js +1 -1
- package/lib/header/themes/solar/charcoal/index.js +1 -1
- package/lib/header/themes/solar/pearl/index.js +1 -1
- package/lib/heatmap/helpers/color.d.ts +1 -1
- package/lib/heatmap/helpers/color.js +11 -5
- package/lib/heatmap/helpers/track.js +3 -3
- package/lib/heatmap/index.d.ts +9 -9
- package/lib/heatmap/index.js +51 -42
- package/lib/icon/index.d.ts +2 -2
- package/lib/icon/index.js +6 -8
- package/lib/icon/utils/IconLoader.d.ts +1 -0
- package/lib/icon/utils/IconLoader.js +9 -1
- package/lib/interactive-chart/helpers/types.d.ts +3 -3
- package/lib/interactive-chart/index.d.ts +34 -34
- package/lib/interactive-chart/index.js +72 -57
- package/lib/item/helpers/types.d.ts +1 -1
- package/lib/item/index.d.ts +3 -3
- package/lib/item/index.js +24 -20
- package/lib/jsx.d.ts +6 -4
- package/lib/label/index.d.ts +1 -1
- package/lib/label/index.js +11 -8
- package/lib/layout/index.d.ts +7 -7
- package/lib/layout/index.js +7 -7
- package/lib/led-gauge/index.d.ts +1 -1
- package/lib/led-gauge/index.js +10 -10
- package/lib/list/elements/list.d.ts +3 -3
- package/lib/list/elements/list.js +10 -12
- package/lib/list/helpers/renderer.js +2 -2
- package/lib/list/helpers/types.d.ts +1 -1
- package/lib/list/index.d.ts +1 -1
- package/lib/list/renderer.d.ts +7 -7
- package/lib/loader/index.js +7 -8
- package/lib/multi-input/index.d.ts +6 -6
- package/lib/multi-input/index.js +39 -45
- package/lib/notification/elements/notification-tray.d.ts +2 -2
- package/lib/notification/elements/notification-tray.js +3 -3
- package/lib/notification/elements/notification.d.ts +2 -2
- package/lib/notification/elements/notification.js +22 -14
- package/lib/notification/helpers/status.js +1 -1
- package/lib/number-field/index.d.ts +5 -6
- package/lib/number-field/index.js +37 -47
- package/lib/overlay/elements/overlay-viewport.d.ts +1 -1
- package/lib/overlay/elements/overlay.d.ts +2 -2
- package/lib/overlay/elements/overlay.js +154 -98
- package/lib/overlay/helpers/types.d.ts +1 -1
- package/lib/overlay/managers/backdrop-manager.d.ts +1 -1
- package/lib/overlay/managers/backdrop-manager.js +2 -2
- package/lib/overlay/managers/close-manager.js +2 -1
- package/lib/overlay/managers/focus-manager.js +23 -13
- package/lib/overlay/managers/interaction-lock-manager.d.ts +4 -4
- package/lib/overlay/managers/interaction-lock-manager.js +33 -25
- package/lib/overlay/managers/viewport-manager.d.ts +2 -2
- package/lib/overlay/managers/viewport-manager.js +3 -2
- package/lib/overlay/managers/zindex-manager.js +4 -2
- package/lib/overlay-menu/helpers/types.d.ts +2 -2
- package/lib/overlay-menu/index.d.ts +1 -1
- package/lib/overlay-menu/index.js +44 -33
- package/lib/overlay-menu/managers/menu-manager.d.ts +10 -10
- package/lib/overlay-menu/managers/menu-manager.js +15 -13
- package/lib/pagination/index.d.ts +4 -4
- package/lib/pagination/index.js +39 -14
- package/lib/panel/index.js +1 -1
- package/lib/password-field/index.d.ts +2 -2
- package/lib/password-field/index.js +4 -4
- package/lib/pill/index.d.ts +1 -1
- package/lib/pill/index.js +22 -19
- package/lib/progress-bar/index.d.ts +1 -1
- package/lib/progress-bar/index.js +38 -37
- package/lib/radio-button/index.d.ts +2 -2
- package/lib/radio-button/index.js +17 -12
- package/lib/radio-button/radio-button-registry.js +8 -5
- package/lib/rating/index.d.ts +1 -1
- package/lib/rating/index.js +2 -5
- package/lib/rating/utils.d.ts +6 -6
- package/lib/rating/utils.js +6 -6
- package/lib/search-field/index.d.ts +2 -2
- package/lib/search-field/index.js +4 -4
- package/lib/select/index.d.ts +34 -34
- package/lib/select/index.js +69 -82
- package/lib/sidebar-layout/index.d.ts +2 -2
- package/lib/sidebar-layout/index.js +7 -9
- package/lib/slider/index.d.ts +2 -2
- package/lib/slider/index.js +57 -45
- package/lib/slider/utils.d.ts +10 -10
- package/lib/slider/utils.js +10 -10
- package/lib/sparkline/index.d.ts +1 -1
- package/lib/sparkline/index.js +7 -8
- package/lib/swing-gauge/helpers.js +2 -2
- package/lib/swing-gauge/index.d.ts +19 -19
- package/lib/swing-gauge/index.js +91 -81
- package/lib/tab/index.d.ts +1 -1
- package/lib/tab/index.js +16 -27
- package/lib/tab/themes/halo/dark/index.js +1 -1
- package/lib/tab/themes/halo/light/index.js +1 -1
- package/lib/tab/themes/solar/charcoal/index.js +1 -1
- package/lib/tab/themes/solar/pearl/index.js +1 -1
- package/lib/tab-bar/helpers/animate.js +1 -1
- package/lib/tab-bar/index.d.ts +1 -1
- package/lib/tab-bar/index.js +34 -18
- package/lib/tab-bar/themes/halo/dark/index.js +1 -1
- package/lib/tab-bar/themes/halo/light/index.js +1 -1
- package/lib/text-field/index.d.ts +1 -1
- package/lib/text-field/index.js +36 -33
- package/lib/time-picker/index.d.ts +6 -6
- package/lib/time-picker/index.js +104 -90
- package/lib/toggle/index.d.ts +1 -1
- package/lib/toggle/index.js +4 -3
- package/lib/tooltip/elements/title-tooltip.js +2 -2
- package/lib/tooltip/index.d.ts +27 -27
- package/lib/tooltip/index.js +42 -38
- package/lib/tooltip/managers/tooltip-manager.d.ts +1 -1
- package/lib/tornado-chart/elements/tornado-chart.d.ts +1 -1
- package/lib/tornado-chart/elements/tornado-chart.js +1 -1
- package/lib/tornado-chart/elements/tornado-item.d.ts +2 -2
- package/lib/tornado-chart/elements/tornado-item.js +12 -10
- package/lib/tree/elements/tree-item.d.ts +3 -3
- package/lib/tree/elements/tree-item.js +21 -19
- package/lib/tree/elements/tree.d.ts +1 -1
- package/lib/tree/elements/tree.js +12 -11
- package/lib/tree/helpers/renderer.js +4 -3
- package/lib/tree/index.d.ts +1 -1
- package/lib/tree/managers/tree-manager.d.ts +1 -1
- package/lib/tree/managers/tree-manager.js +17 -18
- package/lib/tree/themes/solar/charcoal/index.js +1 -1
- package/lib/tree/themes/solar/pearl/index.js +1 -1
- package/lib/tree-select/index.d.ts +9 -9
- package/lib/tree-select/index.js +91 -82
- package/lib/tree-select/themes/halo/dark/index.js +1 -1
- package/lib/tree-select/themes/halo/light/index.js +1 -1
- package/lib/tree-select/themes/solar/charcoal/index.js +1 -1
- package/lib/tree-select/themes/solar/pearl/index.js +1 -1
- package/lib/version.js +1 -1
- package/package.json +16 -16
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { JSXInterface } from '../../jsx';
|
|
2
|
-
import {
|
|
3
|
-
import '../../icon/index.js';
|
|
2
|
+
import { ControlElement, PropertyValues, TemplateResult } from '@refinitiv-ui/core';
|
|
4
3
|
import '../../checkbox/index.js';
|
|
5
|
-
import
|
|
4
|
+
import '../../icon/index.js';
|
|
6
5
|
import { CheckedState } from '../managers/tree-manager.js';
|
|
6
|
+
import type { TreeDataItem } from '../helpers/types';
|
|
7
7
|
/**
|
|
8
8
|
* Displays a tree list item.
|
|
9
9
|
* Groups display expansion arrows.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import {
|
|
2
|
+
import { ControlElement, html } from '@refinitiv-ui/core';
|
|
3
3
|
import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
|
|
4
4
|
import { property } from '@refinitiv-ui/core/decorators/property.js';
|
|
5
|
-
import
|
|
5
|
+
import '../../checkbox/index.js';
|
|
6
6
|
import '../../icon/index.js';
|
|
7
7
|
import { preload } from '../../icon/index.js';
|
|
8
|
-
import '../../
|
|
8
|
+
import { VERSION } from '../../version.js';
|
|
9
9
|
import { CheckedState } from '../managers/tree-manager.js';
|
|
10
10
|
preload('right');
|
|
11
11
|
const emptyTemplate = html ``;
|
|
@@ -75,9 +75,13 @@ let TreeItem = class TreeItem extends ControlElement {
|
|
|
75
75
|
*/
|
|
76
76
|
get toggleTemplate() {
|
|
77
77
|
return html `
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
<div
|
|
79
|
+
expand-toggle
|
|
80
|
+
part="toggle"
|
|
81
|
+
style="pointer-events:all;visibility:${this.parent ? 'visible' : 'hidden'}"
|
|
82
|
+
>
|
|
83
|
+
<ef-icon part="toggle-icon${this.expanded ? ' toggle-icon-expanded' : ''}" icon="right"></ef-icon>
|
|
84
|
+
</div>
|
|
81
85
|
`;
|
|
82
86
|
}
|
|
83
87
|
/**
|
|
@@ -88,14 +92,15 @@ let TreeItem = class TreeItem extends ControlElement {
|
|
|
88
92
|
return emptyTemplate;
|
|
89
93
|
}
|
|
90
94
|
return html `
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
95
|
+
<ef-checkbox
|
|
96
|
+
part="checkbox"
|
|
97
|
+
tabindex="-1"
|
|
98
|
+
.disabled="${this.disabled}"
|
|
99
|
+
.readonly="${this.readonly}"
|
|
100
|
+
.indeterminate="${this.indeterminate}"
|
|
101
|
+
.checked="${this.checked}"
|
|
102
|
+
style="pointer-events:none"
|
|
103
|
+
></ef-checkbox>
|
|
99
104
|
`;
|
|
100
105
|
}
|
|
101
106
|
/**
|
|
@@ -195,14 +200,11 @@ let TreeItem = class TreeItem extends ControlElement {
|
|
|
195
200
|
*/
|
|
196
201
|
render() {
|
|
197
202
|
return html `
|
|
198
|
-
${this.indentTemplate}
|
|
199
|
-
${this.toggleTemplate}
|
|
200
|
-
${this.checkboxTemplate}
|
|
201
|
-
${this.iconTemplate}
|
|
203
|
+
${this.indentTemplate} ${this.toggleTemplate} ${this.checkboxTemplate} ${this.iconTemplate}
|
|
202
204
|
<div part="label">
|
|
203
205
|
<slot>${this.label}</slot>
|
|
204
206
|
</div>
|
|
205
|
-
|
|
207
|
+
`;
|
|
206
208
|
}
|
|
207
209
|
};
|
|
208
210
|
__decorate([
|
|
@@ -3,9 +3,9 @@ import { PropertyValues, TapEvent } from '@refinitiv-ui/core';
|
|
|
3
3
|
import { CollectionComposer } from '@refinitiv-ui/utils/collection.js';
|
|
4
4
|
import { List } from '../../list/index.js';
|
|
5
5
|
import { TreeRenderer } from '../helpers/renderer.js';
|
|
6
|
-
import type { TreeData, TreeDataItem, TreeFilter } from '../helpers/types';
|
|
7
6
|
import { TreeManagerMode } from '../managers/tree-manager.js';
|
|
8
7
|
import './tree-item.js';
|
|
8
|
+
import type { TreeData, TreeDataItem, TreeFilter } from '../helpers/types';
|
|
9
9
|
/**
|
|
10
10
|
* Displays a tree structure
|
|
11
11
|
* to be used for menus and group selections
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
|
|
3
3
|
import { property } from '@refinitiv-ui/core/decorators/property.js';
|
|
4
|
-
import { VERSION } from '../../version.js';
|
|
5
4
|
import { List, valueFormatWarning } from '../../list/index.js';
|
|
6
|
-
import {
|
|
5
|
+
import { VERSION } from '../../version.js';
|
|
7
6
|
import { defaultFilter } from '../helpers/filter.js';
|
|
7
|
+
import { TreeRenderer } from '../helpers/renderer.js';
|
|
8
8
|
import { TreeManager, TreeManagerMode } from '../managers/tree-manager.js';
|
|
9
9
|
import './tree-item.js';
|
|
10
10
|
const EXPAND_TOGGLE_ATTR = 'expand-toggle';
|
|
@@ -109,7 +109,7 @@ let Tree = class Tree extends List {
|
|
|
109
109
|
}
|
|
110
110
|
// Single selection - check item
|
|
111
111
|
if (this.manager.checkItem(item)) {
|
|
112
|
-
this.manager.checkedItems.forEach(checkedItem => {
|
|
112
|
+
this.manager.checkedItems.forEach((checkedItem) => {
|
|
113
113
|
checkedItem !== item && this.forceUncheckItem(checkedItem);
|
|
114
114
|
});
|
|
115
115
|
return true;
|
|
@@ -133,9 +133,9 @@ let Tree = class Tree extends List {
|
|
|
133
133
|
*/
|
|
134
134
|
dispatchExpandedChangedEvent(item) {
|
|
135
135
|
/**
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
136
|
+
* Property `detail.value` is the current expanded state.
|
|
137
|
+
* Property `detail.item` is the original data item of which the property has been modified.
|
|
138
|
+
*/
|
|
139
139
|
const event = new CustomEvent('expanded-changed', {
|
|
140
140
|
bubbles: false,
|
|
141
141
|
cancelable: false,
|
|
@@ -154,7 +154,9 @@ let Tree = class Tree extends List {
|
|
|
154
154
|
* @returns True or False depending if the event was handled
|
|
155
155
|
*/
|
|
156
156
|
handleExpandCollapse(event) {
|
|
157
|
-
const containsToggle = event
|
|
157
|
+
const containsToggle = event
|
|
158
|
+
.composedPath()
|
|
159
|
+
.some((target) => target instanceof HTMLElement && target.hasAttribute(EXPAND_TOGGLE_ATTR));
|
|
158
160
|
const itemElement = containsToggle && this.findItemElementFromTarget(event.target);
|
|
159
161
|
const item = itemElement && this.itemFromElement(itemElement);
|
|
160
162
|
if (item) {
|
|
@@ -323,7 +325,7 @@ let Tree = class Tree extends List {
|
|
|
323
325
|
* @returns {void}
|
|
324
326
|
*/
|
|
325
327
|
addNestedItemsToRender(items, excludeItems, includeHidden = false) {
|
|
326
|
-
items.forEach(item => {
|
|
328
|
+
items.forEach((item) => {
|
|
327
329
|
// Skip hidden and exclude item
|
|
328
330
|
if (!item.hidden && !excludeItems.includes(item)) {
|
|
329
331
|
// Add item and nested children
|
|
@@ -373,7 +375,7 @@ let Tree = class Tree extends List {
|
|
|
373
375
|
* @default []
|
|
374
376
|
*/
|
|
375
377
|
get values() {
|
|
376
|
-
return this.manager.checkedItems.map(item => {
|
|
378
|
+
return this.manager.checkedItems.map((item) => {
|
|
377
379
|
return this.composer.getItemPropertyValue(item, 'value') || '';
|
|
378
380
|
});
|
|
379
381
|
}
|
|
@@ -420,8 +422,7 @@ let Tree = class Tree extends List {
|
|
|
420
422
|
* Mode to use in the tree manager
|
|
421
423
|
*/
|
|
422
424
|
get mode() {
|
|
423
|
-
return !this.multiple || !this.noRelation
|
|
424
|
-
? TreeManagerMode.RELATIONAL : TreeManagerMode.INDEPENDENT;
|
|
425
|
+
return !this.multiple || !this.noRelation ? TreeManagerMode.RELATIONAL : TreeManagerMode.INDEPENDENT;
|
|
425
426
|
}
|
|
426
427
|
};
|
|
427
428
|
__decorate([
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { uuid } from '@refinitiv-ui/utils/uuid.js';
|
|
2
|
-
import { TreeManager, TreeManagerMode, CheckedState } from '../managers/tree-manager.js';
|
|
3
|
-
import { Renderer } from '../../list/renderer.js';
|
|
4
2
|
import { getItemId } from '../../list/helpers/item-id.js';
|
|
3
|
+
import { Renderer } from '../../list/renderer.js';
|
|
4
|
+
import { CheckedState, TreeManager, TreeManagerMode } from '../managers/tree-manager.js';
|
|
5
5
|
export class TreeRenderer extends Renderer {
|
|
6
6
|
constructor(scope) {
|
|
7
7
|
/**
|
|
@@ -26,7 +26,8 @@ export class TreeRenderer extends Renderer {
|
|
|
26
26
|
element.depth = composer.getItemDepth(item);
|
|
27
27
|
element.parent = composer.getItemChildren(item).length > 0;
|
|
28
28
|
element.expanded = manager.isItemExpanded(item);
|
|
29
|
-
element.checkedState =
|
|
29
|
+
element.checkedState =
|
|
30
|
+
!multiple && element.parent ? CheckedState.UNCHECKED : manager.getItemCheckedState(item);
|
|
30
31
|
element.icon = composer.getItemPropertyValue(item, 'icon');
|
|
31
32
|
element.label = composer.getItemPropertyValue(item, 'label');
|
|
32
33
|
element.disabled = composer.getItemPropertyValue(item, 'disabled') === true;
|
package/lib/tree/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { TreeData, TreeDataItem } from './helpers/types';
|
|
1
2
|
export * from './elements/tree.js';
|
|
2
3
|
export * from './elements/tree-item.js';
|
|
3
4
|
export { TreeRenderer } from './helpers/renderer.js';
|
|
4
5
|
export { TreeManager, TreeManagerMode, CheckedState } from './managers/tree-manager.js';
|
|
5
|
-
import type { TreeData, TreeDataItem } from './helpers/types';
|
|
6
6
|
export type { TreeData, TreeDataItem };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { CollectionComposer } from '@refinitiv-ui/utils/collection.js';
|
|
2
1
|
import type { TreeDataItem } from '../helpers/types';
|
|
2
|
+
import type { CollectionComposer } from '@refinitiv-ui/utils/collection.js';
|
|
3
3
|
export declare enum CheckedState {
|
|
4
4
|
CHECKED = 1,
|
|
5
5
|
UNCHECKED = 0,
|
|
@@ -40,7 +40,7 @@ export class TreeManager {
|
|
|
40
40
|
* Return all items which have children
|
|
41
41
|
*/
|
|
42
42
|
get parentItems() {
|
|
43
|
-
return this.items.filter(item => this.isItemParent(item));
|
|
43
|
+
return this.items.filter((item) => this.isItemParent(item));
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
46
46
|
* Returns all checked items.
|
|
@@ -116,7 +116,7 @@ export class TreeManager {
|
|
|
116
116
|
*/
|
|
117
117
|
isItemChecked(item) {
|
|
118
118
|
if (this.manageRelationships && this.isItemParent(item)) {
|
|
119
|
-
return !this.getItemChildren(item).some(child => !this.isItemChecked(child));
|
|
119
|
+
return !this.getItemChildren(item).some((child) => !this.isItemChecked(child));
|
|
120
120
|
}
|
|
121
121
|
return this.composer.getItemPropertyValue(item, 'selected') === true;
|
|
122
122
|
}
|
|
@@ -127,7 +127,7 @@ export class TreeManager {
|
|
|
127
127
|
*/
|
|
128
128
|
isItemCheckedIndeterminate(item) {
|
|
129
129
|
if (this.manageRelationships && this.isItemParent(item)) {
|
|
130
|
-
return this.getItemDescendants(item).some(desc => this.isItemChecked(desc));
|
|
130
|
+
return this.getItemDescendants(item).some((desc) => this.isItemChecked(desc));
|
|
131
131
|
}
|
|
132
132
|
return false;
|
|
133
133
|
}
|
|
@@ -138,7 +138,7 @@ export class TreeManager {
|
|
|
138
138
|
*/
|
|
139
139
|
canCheckItem(item) {
|
|
140
140
|
if (this.manageRelationships && this.isItemParent(item)) {
|
|
141
|
-
return this.getItemChildren(item).some(child => this.canCheckItem(child));
|
|
141
|
+
return this.getItemChildren(item).some((child) => this.canCheckItem(child));
|
|
142
142
|
}
|
|
143
143
|
return this.isItemCheckable(item) && this.composer.getItemPropertyValue(item, 'selected') !== true;
|
|
144
144
|
}
|
|
@@ -149,7 +149,7 @@ export class TreeManager {
|
|
|
149
149
|
*/
|
|
150
150
|
canUncheckItem(item) {
|
|
151
151
|
if (this.manageRelationships && this.isItemParent(item)) {
|
|
152
|
-
return this.getItemChildren(item).some(child => this.canUncheckItem(child));
|
|
152
|
+
return this.getItemChildren(item).some((child) => this.canUncheckItem(child));
|
|
153
153
|
}
|
|
154
154
|
return this.isItemCheckable(item) && this.composer.getItemPropertyValue(item, 'selected') === true;
|
|
155
155
|
}
|
|
@@ -177,7 +177,7 @@ export class TreeManager {
|
|
|
177
177
|
*/
|
|
178
178
|
forceUpdateOnPath(item) {
|
|
179
179
|
const path = [...this.getItemAncestors(item), item];
|
|
180
|
-
path.forEach(item => this.composer.updateItemTimestamp(item));
|
|
180
|
+
path.forEach((item) => this.composer.updateItemTimestamp(item));
|
|
181
181
|
}
|
|
182
182
|
/**
|
|
183
183
|
* Sets the mode (algorithm) the manager should use
|
|
@@ -187,7 +187,7 @@ export class TreeManager {
|
|
|
187
187
|
setMode(mode) {
|
|
188
188
|
this.mode = mode;
|
|
189
189
|
// Force update of all visible parent items, making sure any indeterminate states are remove.
|
|
190
|
-
this.parentItems.forEach(item => this.updateItem(item));
|
|
190
|
+
this.parentItems.forEach((item) => this.updateItem(item));
|
|
191
191
|
}
|
|
192
192
|
/**
|
|
193
193
|
* Updates the data item, forcing a render
|
|
@@ -222,9 +222,9 @@ export class TreeManager {
|
|
|
222
222
|
* @returns `True` if the item is not disabled or readonly
|
|
223
223
|
*/
|
|
224
224
|
isItemCheckable(item) {
|
|
225
|
-
return !this.composer.isItemLocked(item)
|
|
226
|
-
|
|
227
|
-
|
|
225
|
+
return (!this.composer.isItemLocked(item) &&
|
|
226
|
+
this.composer.getItemPropertyValue(item, 'disabled') !== true &&
|
|
227
|
+
this.composer.getItemPropertyValue(item, 'readonly') !== true);
|
|
228
228
|
}
|
|
229
229
|
/**
|
|
230
230
|
* Is the item expanded?
|
|
@@ -232,8 +232,7 @@ export class TreeManager {
|
|
|
232
232
|
* @returns `True` if the item is expanded and its children should be visible
|
|
233
233
|
*/
|
|
234
234
|
isItemExpanded(item) {
|
|
235
|
-
return this.isItemParent(item)
|
|
236
|
-
&& this.composer.getItemPropertyValue(item, 'expanded') === true;
|
|
235
|
+
return this.isItemParent(item) && this.composer.getItemPropertyValue(item, 'expanded') === true;
|
|
237
236
|
}
|
|
238
237
|
/**
|
|
239
238
|
* Is the item a parent?
|
|
@@ -323,14 +322,14 @@ export class TreeManager {
|
|
|
323
322
|
* @returns {void}
|
|
324
323
|
*/
|
|
325
324
|
expandAllItems() {
|
|
326
|
-
this.parentItems.forEach(item => this.expandItem(item));
|
|
325
|
+
this.parentItems.forEach((item) => this.expandItem(item));
|
|
327
326
|
}
|
|
328
327
|
/**
|
|
329
328
|
* Collapses all items in the tree
|
|
330
329
|
* @returns {void}
|
|
331
330
|
*/
|
|
332
331
|
collapseAllItems() {
|
|
333
|
-
this.parentItems.forEach(item => this.collapseItem(item));
|
|
332
|
+
this.parentItems.forEach((item) => this.collapseItem(item));
|
|
334
333
|
}
|
|
335
334
|
/**
|
|
336
335
|
* Checks the item
|
|
@@ -345,7 +344,7 @@ export class TreeManager {
|
|
|
345
344
|
this.composer.setItemPropertyValue(item, 'selected', true);
|
|
346
345
|
if (manageRelationships) {
|
|
347
346
|
this.forceUpdateOnPath(item);
|
|
348
|
-
this.getItemDescendants(item).forEach(descendant => this._checkItem(descendant, false));
|
|
347
|
+
this.getItemDescendants(item).forEach((descendant) => this._checkItem(descendant, false));
|
|
349
348
|
}
|
|
350
349
|
return true;
|
|
351
350
|
}
|
|
@@ -364,7 +363,7 @@ export class TreeManager {
|
|
|
364
363
|
this.composer.setItemPropertyValue(item, 'selected', false);
|
|
365
364
|
if (manageRelationships) {
|
|
366
365
|
this.forceUpdateOnPath(item);
|
|
367
|
-
this.getItemDescendants(item).forEach(descendant => this._uncheckItem(descendant, false));
|
|
366
|
+
this.getItemDescendants(item).forEach((descendant) => this._uncheckItem(descendant, false));
|
|
368
367
|
}
|
|
369
368
|
this.updateItem(item);
|
|
370
369
|
return true;
|
|
@@ -384,7 +383,7 @@ export class TreeManager {
|
|
|
384
383
|
* @returns {void}
|
|
385
384
|
*/
|
|
386
385
|
checkAllItems() {
|
|
387
|
-
this.editableItems.forEach(item => this.checkItem(item));
|
|
386
|
+
this.editableItems.forEach((item) => this.checkItem(item));
|
|
388
387
|
}
|
|
389
388
|
/**
|
|
390
389
|
* Unchecks all items
|
|
@@ -393,6 +392,6 @@ export class TreeManager {
|
|
|
393
392
|
uncheckAllItems() {
|
|
394
393
|
// uncheck items from top levels when manage relationships to avoid redundant re-renders
|
|
395
394
|
const items = this.manageRelationships ? this.composer.queryItems(() => true, 0) : this.checkedItems;
|
|
396
|
-
items.forEach(item => this.uncheckItem(item));
|
|
395
|
+
items.forEach((item) => this.uncheckItem(item));
|
|
397
396
|
}
|
|
398
397
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '@refinitiv-ui/elements/checkbox/themes/solar/charcoal';
|
|
2
2
|
import '@refinitiv-ui/elements/icon/themes/solar/charcoal';
|
|
3
|
-
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-tree-item', styles: '@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}: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=right] ::slotted(*){margin-left:.5em}:host [part=sub-label]{font-size:80%}:host{line-height:normal;outline:0;cursor:pointer;padding:0 7px;min-height:22px;box-sizing:border-box;touch-action:manipulation;min-width:300px;display:flex;align-items:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;min-height:29px;background-color:#151516;border-bottom:1px solid #0a0a0a}:host(:after){content:\'\';min-height:inherit;font-size:0}:host [part=indent]{height:0;width:0;flex:none;font-size:22px}:host [part=toggle]{width:22px;height:22px;margin-top:0;margin-bottom:0;margin-left:0;max-height:100%;display:flex;align-items:center;justify-content:center;flex:none}:host [part~=toggle-icon]{transition:transform .2s}:host [part~=toggle-icon-expanded]{transform:rotate(90deg)}:host [part=checkbox]{flex:none;margin:0 8px 0 0}:host [part=label-icon]{flex-shrink:0;margin:0 4px 0 0}:host [part=label]{width:100%;word-break:break-word;padding:4px 6px 4px 0}:host([depth
|
|
3
|
+
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-tree-item', styles: '@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}: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=right] ::slotted(*){margin-left:.5em}:host [part=sub-label]{font-size:80%}:host{line-height:normal;outline:0;cursor:pointer;padding:0 7px;min-height:22px;box-sizing:border-box;touch-action:manipulation;min-width:300px;display:flex;align-items:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;min-height:29px;background-color:#151516;border-bottom:1px solid #0a0a0a}:host(:after){content:\'\';min-height:inherit;font-size:0}:host [part=indent]{height:0;width:0;flex:none;font-size:22px}:host [part=toggle]{width:22px;height:22px;margin-top:0;margin-bottom:0;margin-left:0;max-height:100%;display:flex;align-items:center;justify-content:center;flex:none}:host [part~=toggle-icon]{transition:transform .2s}:host [part~=toggle-icon-expanded]{transform:rotate(90deg)}:host [part=checkbox]{flex:none;margin:0 8px 0 0}:host [part=label-icon]{flex-shrink:0;margin:0 4px 0 0}:host [part=label]{width:100%;word-break:break-word;padding:4px 6px 4px 0}:host([depth=\'0\']){background-color:#212124}:host([highlighted]){background-color:#2e2d33}:host([focused=visible]){outline:#f93 dotted 1px;outline-offset:-1px;border-color:transparent}:host(:last-of-type){border-color:transparent}' }}));
|
|
4
4
|
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-tree', styles: ':host{overflow-x:auto;--item-indent:7px;--item-height:22px;color:#c2c2c2;background-color:transparent;touch-action:manipulation;scrollbar-face-color:#666570;scrollbar-shadow-color:#666570;scrollbar-highlight-color:#666570;scrollbar-arrow-color:#666570;scrollbar-track-color:#2e2e33;scrollbar-3dlight-color:#2e2e33;scrollbar-darkshadow-color:#2e2e33;scrollbar-color:#666570 #2e2e33}:host(:focus){outline:0}:host([focused=visible]){outline:#f93 solid 1px}:host([readonly]) [part=list-item]{cursor:default}::-webkit-scrollbar{width:13px;height:13px}::-webkit-scrollbar-button{background:0 0/1px 2px no-repeat #2e2e33;height:12px;width:12px;display:block}::-webkit-scrollbar-thumb{background:#666570;border-radius:7px;border:2px solid #2e2e33}::-webkit-scrollbar-thumb:hover{background:#e2e2e2}::-webkit-scrollbar-thumb:active{background:#f93}::-webkit-scrollbar-track{background:#2e2e33}::-webkit-scrollbar-corner{background:#2e2e33}::-webkit-scrollbar-button:end:decrement,::-webkit-scrollbar-button:start:increment{display:none}::-webkit-scrollbar-button:horizontal{background-size:2px 1px}::-webkit-scrollbar-button:vertical:start:decrement{background-image:linear-gradient(#666570,#666570),linear-gradient(#666570,#666570),linear-gradient(#666570,#666570),linear-gradient(#666570,#666570),linear-gradient(#666570,#666570),linear-gradient(#666570,#666570),linear-gradient(#666570,#666570),linear-gradient(#666570,#666570),linear-gradient(#666570,#666570);background-position:10px 6.5px,9px 5.5px,8px 4.5px,7px 3.5px,6px 2.5px,5px 3.5px,4px 4.5px,3px 5.5px,2px 6.5px}::-webkit-scrollbar-button:vertical:start:decrement:hover{background-image:linear-gradient(#e2e2e2,#e2e2e2),linear-gradient(#e2e2e2,#e2e2e2),linear-gradient(#e2e2e2,#e2e2e2),linear-gradient(#e2e2e2,#e2e2e2),linear-gradient(#e2e2e2,#e2e2e2),linear-gradient(#e2e2e2,#e2e2e2),linear-gradient(#e2e2e2,#e2e2e2),linear-gradient(#e2e2e2,#e2e2e2),linear-gradient(#e2e2e2,#e2e2e2);background-position:10px 6.5px,9px 5.5px,8px 4.5px,7px 3.5px,6px 2.5px,5px 3.5px,4px 4.5px,3px 5.5px,2px 6.5px}::-webkit-scrollbar-button:vertical:start:decrement:active{background-image:linear-gradient(#f93,#f93),linear-gradient(#f93,#f93),linear-gradient(#f93,#f93),linear-gradient(#f93,#f93),linear-gradient(#f93,#f93),linear-gradient(#f93,#f93),linear-gradient(#f93,#f93),linear-gradient(#f93,#f93),linear-gradient(#f93,#f93);background-position:10px 6.5px,9px 5.5px,8px 4.5px,7px 3.5px,6px 2.5px,5px 3.5px,4px 4.5px,3px 5.5px,2px 6.5px}::-webkit-scrollbar-button:vertical:end:increment{background-image:linear-gradient(#666570,#666570),linear-gradient(#666570,#666570),linear-gradient(#666570,#666570),linear-gradient(#666570,#666570),linear-gradient(#666570,#666570),linear-gradient(#666570,#666570),linear-gradient(#666570,#666570),linear-gradient(#666570,#666570),linear-gradient(#666570,#666570);background-position:10px 3.5px,9px 4.5px,8px 5.5px,7px 6.5px,6px 7.5px,5px 6.5px,4px 5.5px,3px 4.5px,2px 3.5px}::-webkit-scrollbar-button:vertical:end:increment:hover{background-image:linear-gradient(#e2e2e2,#e2e2e2),linear-gradient(#e2e2e2,#e2e2e2),linear-gradient(#e2e2e2,#e2e2e2),linear-gradient(#e2e2e2,#e2e2e2),linear-gradient(#e2e2e2,#e2e2e2),linear-gradient(#e2e2e2,#e2e2e2),linear-gradient(#e2e2e2,#e2e2e2),linear-gradient(#e2e2e2,#e2e2e2),linear-gradient(#e2e2e2,#e2e2e2);background-position:10px 3.5px,9px 4.5px,8px 5.5px,7px 6.5px,6px 7.5px,5px 6.5px,4px 5.5px,3px 4.5px,2px 3.5px}::-webkit-scrollbar-button:vertical:end:increment:active{background-image:linear-gradient(#f93,#f93),linear-gradient(#f93,#f93),linear-gradient(#f93,#f93),linear-gradient(#f93,#f93),linear-gradient(#f93,#f93),linear-gradient(#f93,#f93),linear-gradient(#f93,#f93),linear-gradient(#f93,#f93),linear-gradient(#f93,#f93);background-position:10px 3.5px,9px 4.5px,8px 5.5px,7px 6.5px,6px 7.5px,5px 6.5px,4px 5.5px,3px 4.5px,2px 3.5px}::-webkit-scrollbar-button:horizontal:start:decrement{background-image:linear-gradient(#666570,#666570),linear-gradient(#666570,#666570),linear-gradient(#666570,#666570),linear-gradient(#666570,#666570),linear-gradient(#666570,#666570),linear-gradient(#666570,#666570),linear-gradient(#666570,#666570),linear-gradient(#666570,#666570),linear-gradient(#666570,#666570);background-position:6.5px 10px,5.5px 9px,4.5px 8px,3.5px 7px,2.5px 6px,3.5px 5px,4.5px 4px,5.5px 3px,6.5px 2px}::-webkit-scrollbar-button:horizontal:start:decrement:hover{background-image:linear-gradient(#e2e2e2,#e2e2e2),linear-gradient(#e2e2e2,#e2e2e2),linear-gradient(#e2e2e2,#e2e2e2),linear-gradient(#e2e2e2,#e2e2e2),linear-gradient(#e2e2e2,#e2e2e2),linear-gradient(#e2e2e2,#e2e2e2),linear-gradient(#e2e2e2,#e2e2e2),linear-gradient(#e2e2e2,#e2e2e2),linear-gradient(#e2e2e2,#e2e2e2);background-position:6.5px 10px,5.5px 9px,4.5px 8px,3.5px 7px,2.5px 6px,3.5px 5px,4.5px 4px,5.5px 3px,6.5px 2px}::-webkit-scrollbar-button:horizontal:start:decrement:active{background-image:linear-gradient(#f93,#f93),linear-gradient(#f93,#f93),linear-gradient(#f93,#f93),linear-gradient(#f93,#f93),linear-gradient(#f93,#f93),linear-gradient(#f93,#f93),linear-gradient(#f93,#f93),linear-gradient(#f93,#f93),linear-gradient(#f93,#f93);background-position:6.5px 10px,5.5px 9px,4.5px 8px,3.5px 7px,2.5px 6px,3.5px 5px,4.5px 4px,5.5px 3px,6.5px 2px}::-webkit-scrollbar-button:horizontal:end:increment{background-image:linear-gradient(#666570,#666570),linear-gradient(#666570,#666570),linear-gradient(#666570,#666570),linear-gradient(#666570,#666570),linear-gradient(#666570,#666570),linear-gradient(#666570,#666570),linear-gradient(#666570,#666570),linear-gradient(#666570,#666570),linear-gradient(#666570,#666570);background-position:3.5px 10px,4.5px 9px,5.5px 8px,6.5px 7px,7.5px 6px,6.5px 5px,5.5px 4px,4.5px 3px,3.5px 2px}::-webkit-scrollbar-button:horizontal:end:increment:hover{background-image:linear-gradient(#e2e2e2,#e2e2e2),linear-gradient(#e2e2e2,#e2e2e2),linear-gradient(#e2e2e2,#e2e2e2),linear-gradient(#e2e2e2,#e2e2e2),linear-gradient(#e2e2e2,#e2e2e2),linear-gradient(#e2e2e2,#e2e2e2),linear-gradient(#e2e2e2,#e2e2e2),linear-gradient(#e2e2e2,#e2e2e2),linear-gradient(#e2e2e2,#e2e2e2);background-position:3.5px 10px,4.5px 9px,5.5px 8px,6.5px 7px,7.5px 6px,6.5px 5px,5.5px 4px,4.5px 3px,3.5px 2px}::-webkit-scrollbar-button:horizontal:end:increment:active{background-image:linear-gradient(#f93,#f93),linear-gradient(#f93,#f93),linear-gradient(#f93,#f93),linear-gradient(#f93,#f93),linear-gradient(#f93,#f93),linear-gradient(#f93,#f93),linear-gradient(#f93,#f93),linear-gradient(#f93,#f93),linear-gradient(#f93,#f93);background-position:3.5px 10px,4.5px 9px,5.5px 8px,6.5px 7px,7.5px 6px,6.5px 5px,5.5px 4px,4.5px 3px,3.5px 2px}' }}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '@refinitiv-ui/elements/checkbox/themes/solar/pearl';
|
|
2
2
|
import '@refinitiv-ui/elements/icon/themes/solar/pearl';
|
|
3
|
-
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-tree-item', styles: '@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}: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=right] ::slotted(*){margin-left:.5em}:host [part=sub-label]{font-size:80%}:host{line-height:normal;outline:0;cursor:pointer;padding:0 7px;min-height:22px;box-sizing:border-box;touch-action:manipulation;min-width:300px;display:flex;align-items:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;min-height:29px;background-color:#fafbfc;border-bottom:1px solid #d5d8db}:host(:after){content:\'\';min-height:inherit;font-size:0}:host [part=indent]{height:0;width:0;flex:none;font-size:22px}:host [part=toggle]{width:22px;height:22px;margin-top:0;margin-bottom:0;margin-left:0;max-height:100%;display:flex;align-items:center;justify-content:center;flex:none}:host [part~=toggle-icon]{transition:transform .2s}:host [part~=toggle-icon-expanded]{transform:rotate(90deg)}:host [part=checkbox]{flex:none;margin:0 8px 0 0}:host [part=label-icon]{flex-shrink:0;margin:0 4px 0 0}:host [part=label]{width:100%;word-break:break-word;padding:4px 6px 4px 0}:host([depth
|
|
3
|
+
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-tree-item', styles: '@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}: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=right] ::slotted(*){margin-left:.5em}:host [part=sub-label]{font-size:80%}:host{line-height:normal;outline:0;cursor:pointer;padding:0 7px;min-height:22px;box-sizing:border-box;touch-action:manipulation;min-width:300px;display:flex;align-items:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;min-height:29px;background-color:#fafbfc;border-bottom:1px solid #d5d8db}:host(:after){content:\'\';min-height:inherit;font-size:0}:host [part=indent]{height:0;width:0;flex:none;font-size:22px}:host [part=toggle]{width:22px;height:22px;margin-top:0;margin-bottom:0;margin-left:0;max-height:100%;display:flex;align-items:center;justify-content:center;flex:none}:host [part~=toggle-icon]{transition:transform .2s}:host [part~=toggle-icon-expanded]{transform:rotate(90deg)}:host [part=checkbox]{flex:none;margin:0 8px 0 0}:host [part=label-icon]{flex-shrink:0;margin:0 4px 0 0}:host [part=label]{width:100%;word-break:break-word;padding:4px 6px 4px 0}:host([depth=\'0\']){background-color:#f2f3f7}:host([highlighted]){background-color:#e4e8ed}:host([focused=visible]){outline:#f93 dotted 1px;outline-offset:-1px;border-color:transparent}:host(:last-of-type){border-color:transparent}' }}));
|
|
4
4
|
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-tree', styles: ':host{overflow-x:auto;--item-indent:7px;--item-height:22px;color:#484848;background-color:transparent;touch-action:manipulation;scrollbar-face-color:#8a8a96;scrollbar-shadow-color:#8a8a96;scrollbar-highlight-color:#8a8a96;scrollbar-arrow-color:#8a8a96;scrollbar-track-color:#fff;scrollbar-3dlight-color:#fff;scrollbar-darkshadow-color:#fff;scrollbar-color:#8a8a96 #fff}:host(:focus){outline:0}:host([focused=visible]){outline:#f93 solid 1px}:host([readonly]) [part=list-item]{cursor:default}::-webkit-scrollbar{width:13px;height:13px}::-webkit-scrollbar-button{background:0 0/1px 2px no-repeat #fff;height:12px;width:12px;display:block}::-webkit-scrollbar-thumb{background:#8a8a96;border-radius:7px;border:2px solid #fff}::-webkit-scrollbar-thumb:hover{background:#a9afba}::-webkit-scrollbar-thumb:active{background:#ee7600}::-webkit-scrollbar-track{background:#fff}::-webkit-scrollbar-corner{background:#fff}::-webkit-scrollbar-button:end:decrement,::-webkit-scrollbar-button:start:increment{display:none}::-webkit-scrollbar-button:horizontal{background-size:2px 1px}::-webkit-scrollbar-button:vertical:start:decrement{background-image:linear-gradient(#8a8a96,#8a8a96),linear-gradient(#8a8a96,#8a8a96),linear-gradient(#8a8a96,#8a8a96),linear-gradient(#8a8a96,#8a8a96),linear-gradient(#8a8a96,#8a8a96),linear-gradient(#8a8a96,#8a8a96),linear-gradient(#8a8a96,#8a8a96),linear-gradient(#8a8a96,#8a8a96),linear-gradient(#8a8a96,#8a8a96);background-position:10px 6.5px,9px 5.5px,8px 4.5px,7px 3.5px,6px 2.5px,5px 3.5px,4px 4.5px,3px 5.5px,2px 6.5px}::-webkit-scrollbar-button:vertical:start:decrement:hover{background-image:linear-gradient(#a9afba,#a9afba),linear-gradient(#a9afba,#a9afba),linear-gradient(#a9afba,#a9afba),linear-gradient(#a9afba,#a9afba),linear-gradient(#a9afba,#a9afba),linear-gradient(#a9afba,#a9afba),linear-gradient(#a9afba,#a9afba),linear-gradient(#a9afba,#a9afba),linear-gradient(#a9afba,#a9afba);background-position:10px 6.5px,9px 5.5px,8px 4.5px,7px 3.5px,6px 2.5px,5px 3.5px,4px 4.5px,3px 5.5px,2px 6.5px}::-webkit-scrollbar-button:vertical:start:decrement:active{background-image:linear-gradient(#ee7600,#ee7600),linear-gradient(#ee7600,#ee7600),linear-gradient(#ee7600,#ee7600),linear-gradient(#ee7600,#ee7600),linear-gradient(#ee7600,#ee7600),linear-gradient(#ee7600,#ee7600),linear-gradient(#ee7600,#ee7600),linear-gradient(#ee7600,#ee7600),linear-gradient(#ee7600,#ee7600);background-position:10px 6.5px,9px 5.5px,8px 4.5px,7px 3.5px,6px 2.5px,5px 3.5px,4px 4.5px,3px 5.5px,2px 6.5px}::-webkit-scrollbar-button:vertical:end:increment{background-image:linear-gradient(#8a8a96,#8a8a96),linear-gradient(#8a8a96,#8a8a96),linear-gradient(#8a8a96,#8a8a96),linear-gradient(#8a8a96,#8a8a96),linear-gradient(#8a8a96,#8a8a96),linear-gradient(#8a8a96,#8a8a96),linear-gradient(#8a8a96,#8a8a96),linear-gradient(#8a8a96,#8a8a96),linear-gradient(#8a8a96,#8a8a96);background-position:10px 3.5px,9px 4.5px,8px 5.5px,7px 6.5px,6px 7.5px,5px 6.5px,4px 5.5px,3px 4.5px,2px 3.5px}::-webkit-scrollbar-button:vertical:end:increment:hover{background-image:linear-gradient(#a9afba,#a9afba),linear-gradient(#a9afba,#a9afba),linear-gradient(#a9afba,#a9afba),linear-gradient(#a9afba,#a9afba),linear-gradient(#a9afba,#a9afba),linear-gradient(#a9afba,#a9afba),linear-gradient(#a9afba,#a9afba),linear-gradient(#a9afba,#a9afba),linear-gradient(#a9afba,#a9afba);background-position:10px 3.5px,9px 4.5px,8px 5.5px,7px 6.5px,6px 7.5px,5px 6.5px,4px 5.5px,3px 4.5px,2px 3.5px}::-webkit-scrollbar-button:vertical:end:increment:active{background-image:linear-gradient(#ee7600,#ee7600),linear-gradient(#ee7600,#ee7600),linear-gradient(#ee7600,#ee7600),linear-gradient(#ee7600,#ee7600),linear-gradient(#ee7600,#ee7600),linear-gradient(#ee7600,#ee7600),linear-gradient(#ee7600,#ee7600),linear-gradient(#ee7600,#ee7600),linear-gradient(#ee7600,#ee7600);background-position:10px 3.5px,9px 4.5px,8px 5.5px,7px 6.5px,6px 7.5px,5px 6.5px,4px 5.5px,3px 4.5px,2px 3.5px}::-webkit-scrollbar-button:horizontal:start:decrement{background-image:linear-gradient(#8a8a96,#8a8a96),linear-gradient(#8a8a96,#8a8a96),linear-gradient(#8a8a96,#8a8a96),linear-gradient(#8a8a96,#8a8a96),linear-gradient(#8a8a96,#8a8a96),linear-gradient(#8a8a96,#8a8a96),linear-gradient(#8a8a96,#8a8a96),linear-gradient(#8a8a96,#8a8a96),linear-gradient(#8a8a96,#8a8a96);background-position:6.5px 10px,5.5px 9px,4.5px 8px,3.5px 7px,2.5px 6px,3.5px 5px,4.5px 4px,5.5px 3px,6.5px 2px}::-webkit-scrollbar-button:horizontal:start:decrement:hover{background-image:linear-gradient(#a9afba,#a9afba),linear-gradient(#a9afba,#a9afba),linear-gradient(#a9afba,#a9afba),linear-gradient(#a9afba,#a9afba),linear-gradient(#a9afba,#a9afba),linear-gradient(#a9afba,#a9afba),linear-gradient(#a9afba,#a9afba),linear-gradient(#a9afba,#a9afba),linear-gradient(#a9afba,#a9afba);background-position:6.5px 10px,5.5px 9px,4.5px 8px,3.5px 7px,2.5px 6px,3.5px 5px,4.5px 4px,5.5px 3px,6.5px 2px}::-webkit-scrollbar-button:horizontal:start:decrement:active{background-image:linear-gradient(#ee7600,#ee7600),linear-gradient(#ee7600,#ee7600),linear-gradient(#ee7600,#ee7600),linear-gradient(#ee7600,#ee7600),linear-gradient(#ee7600,#ee7600),linear-gradient(#ee7600,#ee7600),linear-gradient(#ee7600,#ee7600),linear-gradient(#ee7600,#ee7600),linear-gradient(#ee7600,#ee7600);background-position:6.5px 10px,5.5px 9px,4.5px 8px,3.5px 7px,2.5px 6px,3.5px 5px,4.5px 4px,5.5px 3px,6.5px 2px}::-webkit-scrollbar-button:horizontal:end:increment{background-image:linear-gradient(#8a8a96,#8a8a96),linear-gradient(#8a8a96,#8a8a96),linear-gradient(#8a8a96,#8a8a96),linear-gradient(#8a8a96,#8a8a96),linear-gradient(#8a8a96,#8a8a96),linear-gradient(#8a8a96,#8a8a96),linear-gradient(#8a8a96,#8a8a96),linear-gradient(#8a8a96,#8a8a96),linear-gradient(#8a8a96,#8a8a96);background-position:3.5px 10px,4.5px 9px,5.5px 8px,6.5px 7px,7.5px 6px,6.5px 5px,5.5px 4px,4.5px 3px,3.5px 2px}::-webkit-scrollbar-button:horizontal:end:increment:hover{background-image:linear-gradient(#a9afba,#a9afba),linear-gradient(#a9afba,#a9afba),linear-gradient(#a9afba,#a9afba),linear-gradient(#a9afba,#a9afba),linear-gradient(#a9afba,#a9afba),linear-gradient(#a9afba,#a9afba),linear-gradient(#a9afba,#a9afba),linear-gradient(#a9afba,#a9afba),linear-gradient(#a9afba,#a9afba);background-position:3.5px 10px,4.5px 9px,5.5px 8px,6.5px 7px,7.5px 6px,6.5px 5px,5.5px 4px,4.5px 3px,3.5px 2px}::-webkit-scrollbar-button:horizontal:end:increment:active{background-image:linear-gradient(#ee7600,#ee7600),linear-gradient(#ee7600,#ee7600),linear-gradient(#ee7600,#ee7600),linear-gradient(#ee7600,#ee7600),linear-gradient(#ee7600,#ee7600),linear-gradient(#ee7600,#ee7600),linear-gradient(#ee7600,#ee7600),linear-gradient(#ee7600,#ee7600),linear-gradient(#ee7600,#ee7600);background-position:3.5px 10px,4.5px 9px,5.5px 8px,6.5px 7px,7.5px 6px,6.5px 5px,5.5px 4px,4.5px 3px,3.5px 2px}' }}));
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { JSXInterface } from '../jsx';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
2
|
+
import { CSSResultGroup, TemplateResult } from '@refinitiv-ui/core';
|
|
3
|
+
import '@refinitiv-ui/phrasebook/locale/en/tree-select.js';
|
|
4
|
+
import { TranslateDirective } from '@refinitiv-ui/translate';
|
|
4
5
|
import { TimeoutTaskRunner } from '@refinitiv-ui/utils/async.js';
|
|
5
|
-
import '
|
|
6
|
-
import '../pill/index.js';
|
|
6
|
+
import { CollectionComposer } from '@refinitiv-ui/utils/collection.js';
|
|
7
7
|
import '../button/index.js';
|
|
8
8
|
import '../checkbox/index.js';
|
|
9
|
-
import '../tree/index.js';
|
|
10
|
-
import type { Overlay } from '../overlay';
|
|
11
9
|
import { ComboBox, ComboBoxFilter as TreeSelectFilter } from '../combo-box/index.js';
|
|
12
|
-
import
|
|
10
|
+
import '../icon/index.js';
|
|
11
|
+
import '../pill/index.js';
|
|
12
|
+
import '../tree/index.js';
|
|
13
13
|
import { TreeRenderer as TreeSelectRenderer } from '../tree/index.js';
|
|
14
14
|
import { TreeManager, TreeManagerMode } from '../tree/managers/tree-manager.js';
|
|
15
|
+
import type { CheckChangedEvent } from '../events';
|
|
16
|
+
import type { Overlay } from '../overlay';
|
|
15
17
|
import type { TreeSelectData, TreeSelectDataItem } from './helpers/types';
|
|
16
|
-
import { TranslateDirective } from '@refinitiv-ui/translate';
|
|
17
|
-
import '@refinitiv-ui/phrasebook/locale/en/tree-select.js';
|
|
18
18
|
export { TreeSelectRenderer };
|
|
19
19
|
export type { TreeSelectFilter, TreeSelectDataItem, TreeSelectData };
|
|
20
20
|
/**
|