@refinitiv-ui/elements 6.8.7 → 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 +180 -433
- 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.d.ts +1 -1
- 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 +70 -83
- 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
package/lib/toggle/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { ControlElement,
|
|
2
|
+
import { ControlElement, css, 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
5
|
import { VERSION } from '../version.js';
|
|
@@ -110,8 +110,9 @@ let Toggle = class Toggle extends ControlElement {
|
|
|
110
110
|
* @return Render template
|
|
111
111
|
*/
|
|
112
112
|
render() {
|
|
113
|
-
return html `
|
|
114
|
-
|
|
113
|
+
return html ` <div part="toggle">
|
|
114
|
+
${this.checked && this.checkedLabel ? this.checkedLabel : this.label}
|
|
115
|
+
</div>`;
|
|
115
116
|
}
|
|
116
117
|
};
|
|
117
118
|
__decorate([
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { matches } from '@refinitiv-ui/core';
|
|
2
|
-
import { addTooltipCondition } from './tooltip-element.js';
|
|
3
2
|
import { tooltipRenderer } from '../helpers/renderer.js';
|
|
3
|
+
import { addTooltipCondition } from './tooltip-element.js';
|
|
4
4
|
// Support title attribute
|
|
5
5
|
Object.defineProperty(HTMLElement.prototype, 'title', {
|
|
6
6
|
get: function () {
|
|
@@ -15,4 +15,4 @@ Object.defineProperty(HTMLElement.prototype, 'title', {
|
|
|
15
15
|
this.setAttribute('tooltip', value);
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
addTooltipCondition(element => matches(element, '[title]'), tooltipRenderer);
|
|
18
|
+
addTooltipCondition((element) => matches(element, '[title]'), tooltipRenderer);
|
package/lib/tooltip/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { JSXInterface } from '../jsx';
|
|
2
|
-
import { BasicElement,
|
|
2
|
+
import { BasicElement, CSSResultGroup, PropertyValues, TemplateResult } from '@refinitiv-ui/core';
|
|
3
3
|
import '../overlay/index.js';
|
|
4
|
-
import type { OverlayTransitionStyle as TooltipTransitionStyle } from '../overlay';
|
|
5
4
|
import './elements/title-tooltip.js';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { deregister as deregisterOverflowTooltip, register as registerOverflowTooltip } from './helpers/overflow-tooltip.js';
|
|
6
|
+
import { TooltipCondition, TooltipPosition, TooltipRenderer } from './helpers/types.js';
|
|
7
|
+
import type { OverlayTransitionStyle as TooltipTransitionStyle } from '../overlay';
|
|
8
8
|
/**
|
|
9
9
|
* Tooltip displays extra information when the
|
|
10
10
|
* user hovers the pointer over an item.
|
|
@@ -44,37 +44,37 @@ declare class Tooltip extends BasicElement {
|
|
|
44
44
|
*/
|
|
45
45
|
private static elementHasMoved;
|
|
46
46
|
/**
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
* CSS selector to match the tooltip
|
|
48
|
+
*/
|
|
49
49
|
selector: string;
|
|
50
50
|
/**
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
* Provide a function to test against the target.
|
|
52
|
+
* Return `true` if the target matches
|
|
53
|
+
* @type {TooltipCondition}
|
|
54
|
+
*/
|
|
55
55
|
condition: TooltipCondition | undefined;
|
|
56
56
|
/**
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
* A renderer to define tooltip internal content.
|
|
58
|
+
* Return undefined, `String`, `HTMLElement` or `DocumentFragment`.
|
|
59
|
+
* If the content is not present, tooltip will not be displayed
|
|
60
|
+
* @type {TooltipRenderer}
|
|
61
|
+
*/
|
|
62
62
|
renderer: TooltipRenderer | undefined;
|
|
63
63
|
/**
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
64
|
+
* The position of the tooltip. Use the following values:
|
|
65
|
+
* `auto` (default) - display based on mouse enter coordinates
|
|
66
|
+
* `above` - display above the element
|
|
67
|
+
* `right` - display to the right of the element
|
|
68
|
+
* `below` - display beneath the element
|
|
69
|
+
* `left` - display to the left of the element
|
|
70
|
+
*/
|
|
71
71
|
position: 'auto' | 'above' | 'right' | 'below' | 'left';
|
|
72
72
|
/**
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
73
|
+
* Set the transition style.
|
|
74
|
+
* Value can be `fade`, `zoom`, `slide-down`, `slide-up`, `slide-right`,
|
|
75
|
+
* `slide-left`, `slide-right-down`, `slide-right-up`, `slide-left-down`, `slide-left-up`, or null in case of no transition
|
|
76
|
+
* @type {TooltipTransitionStyle}
|
|
77
|
+
*/
|
|
78
78
|
transitionStyle: TooltipTransitionStyle | null;
|
|
79
79
|
/**
|
|
80
80
|
* Get tooltip popup window
|
package/lib/tooltip/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
var Tooltip_1;
|
|
2
2
|
import { __decorate } from "tslib";
|
|
3
|
-
import { BasicElement,
|
|
3
|
+
import { BasicElement, css, html, matches } from '@refinitiv-ui/core';
|
|
4
4
|
import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
|
|
5
5
|
import { property } from '@refinitiv-ui/core/decorators/property.js';
|
|
6
6
|
import { query } from '@refinitiv-ui/core/decorators/query.js';
|
|
7
|
-
import { VERSION } from '../version.js';
|
|
8
7
|
import { isSlotEmpty } from '@refinitiv-ui/utils/is-slot-empty.js';
|
|
9
8
|
import '../overlay/index.js';
|
|
9
|
+
import { VERSION } from '../version.js';
|
|
10
10
|
import './elements/title-tooltip.js';
|
|
11
|
-
import {
|
|
11
|
+
import { deregister as deregisterOverflowTooltip, register as registerOverflowTooltip } from './helpers/overflow-tooltip.js';
|
|
12
12
|
import { tooltipRenderer } from './helpers/renderer.js';
|
|
13
|
-
import {
|
|
13
|
+
import { deregister, register } from './managers/tooltip-manager.js';
|
|
14
14
|
const PositionMap = {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
auto: ['bottom-start', 'top-start'],
|
|
16
|
+
above: ['top-middle'],
|
|
17
|
+
right: ['right-middle'],
|
|
18
|
+
below: ['bottom-middle'],
|
|
19
|
+
left: ['left-middle']
|
|
20
20
|
};
|
|
21
21
|
/**
|
|
22
22
|
* Tooltip displays extra information when the
|
|
@@ -32,24 +32,24 @@ let Tooltip = Tooltip_1 = class Tooltip extends BasicElement {
|
|
|
32
32
|
this.clicked = false;
|
|
33
33
|
this.defaultRole = 'tooltip';
|
|
34
34
|
/**
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
* CSS selector to match the tooltip
|
|
36
|
+
*/
|
|
37
37
|
this.selector = '';
|
|
38
38
|
/**
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
39
|
+
* The position of the tooltip. Use the following values:
|
|
40
|
+
* `auto` (default) - display based on mouse enter coordinates
|
|
41
|
+
* `above` - display above the element
|
|
42
|
+
* `right` - display to the right of the element
|
|
43
|
+
* `below` - display beneath the element
|
|
44
|
+
* `left` - display to the left of the element
|
|
45
|
+
*/
|
|
46
46
|
this.position = 'auto';
|
|
47
47
|
/**
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
* Set the transition style.
|
|
49
|
+
* Value can be `fade`, `zoom`, `slide-down`, `slide-up`, `slide-right`,
|
|
50
|
+
* `slide-left`, `slide-right-down`, `slide-right-up`, `slide-left-down`, `slide-left-up`, or null in case of no transition
|
|
51
|
+
* @type {TooltipTransitionStyle}
|
|
52
|
+
*/
|
|
53
53
|
this.transitionStyle = 'fade';
|
|
54
54
|
this._x = 0;
|
|
55
55
|
this._y = 0;
|
|
@@ -124,11 +124,11 @@ let Tooltip = Tooltip_1 = class Tooltip extends BasicElement {
|
|
|
124
124
|
flex: none;
|
|
125
125
|
visibility: hidden;
|
|
126
126
|
}
|
|
127
|
-
[part=tooltip] {
|
|
127
|
+
[part='tooltip'] {
|
|
128
128
|
visibility: visible;
|
|
129
129
|
overflow: visible;
|
|
130
130
|
}
|
|
131
|
-
[part=position-adjuster] {
|
|
131
|
+
[part='position-adjuster'] {
|
|
132
132
|
position: fixed;
|
|
133
133
|
z-index: -1;
|
|
134
134
|
top: 0;
|
|
@@ -357,7 +357,8 @@ let Tooltip = Tooltip_1 = class Tooltip extends BasicElement {
|
|
|
357
357
|
return;
|
|
358
358
|
}
|
|
359
359
|
const matchTargetRect = matchTarget.getBoundingClientRect();
|
|
360
|
-
if (lastMatchTarget === matchTarget &&
|
|
360
|
+
if (lastMatchTarget === matchTarget &&
|
|
361
|
+
!Tooltip_1.elementHasMoved(matchTargetRect, this.matchTargetRect)) {
|
|
361
362
|
return;
|
|
362
363
|
}
|
|
363
364
|
this.matchTargetRect = matchTargetRect;
|
|
@@ -422,18 +423,21 @@ let Tooltip = Tooltip_1 = class Tooltip extends BasicElement {
|
|
|
422
423
|
*/
|
|
423
424
|
render() {
|
|
424
425
|
return html `<ef-overlay
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
426
|
+
part="tooltip"
|
|
427
|
+
.noCancelOnEscKey=${true}
|
|
428
|
+
.noCancelOnOutsideClick=${true}
|
|
429
|
+
.withShadow=${true}
|
|
430
|
+
.noInteractionLock=${true}
|
|
431
|
+
.noFocusManagement=${true}
|
|
432
|
+
?opened=${this._opened}
|
|
433
|
+
.position=${this.tipPosition}
|
|
434
|
+
.transitionStyle=${this.transitionStyle}
|
|
435
|
+
.positionTarget=${this._positionTarget}
|
|
436
|
+
.x=${this._x}
|
|
437
|
+
.y=${this._y}
|
|
438
|
+
><slot id="contentSlot"></slot
|
|
439
|
+
></ef-overlay>
|
|
440
|
+
<div part="position-adjuster"></div>`;
|
|
437
441
|
}
|
|
438
442
|
/**
|
|
439
443
|
* true if tooltip is opened, false otherwise
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { JSXInterface } from '../../jsx';
|
|
2
|
-
import {
|
|
2
|
+
import { CSSResultGroup, ElementSize, ResponsiveElement, TemplateResult } from '@refinitiv-ui/core';
|
|
3
3
|
import './tornado-item.js';
|
|
4
4
|
/**
|
|
5
5
|
* A data visualization that helps to
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { ResponsiveElement,
|
|
2
|
+
import { ResponsiveElement, css, 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
5
|
import { VERSION } from '../../version.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { JSXInterface } from '../../jsx';
|
|
2
|
-
import { BasicElement,
|
|
3
|
-
import '../../progress-bar/index.js';
|
|
2
|
+
import { BasicElement, CSSResultGroup, TemplateResult } from '@refinitiv-ui/core';
|
|
4
3
|
import '../../layout/index.js';
|
|
4
|
+
import '../../progress-bar/index.js';
|
|
5
5
|
/**
|
|
6
6
|
* A part of <ef-tornado-chart />,
|
|
7
7
|
* consists mainly of primary, secondary ef-progress-bar and labels.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { BasicElement,
|
|
2
|
+
import { BasicElement, css, html, nothing } 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 { VERSION } from '../../version.js';
|
|
6
|
-
import '../../progress-bar/index.js';
|
|
7
5
|
import '../../layout/index.js';
|
|
6
|
+
import '../../progress-bar/index.js';
|
|
7
|
+
import { VERSION } from '../../version.js';
|
|
8
8
|
/**
|
|
9
9
|
* A part of <ef-tornado-chart />,
|
|
10
10
|
* consists mainly of primary, secondary ef-progress-bar and labels.
|
|
@@ -132,18 +132,18 @@ let TornadoItem = class TornadoItem extends BasicElement {
|
|
|
132
132
|
:host {
|
|
133
133
|
display: block;
|
|
134
134
|
}
|
|
135
|
-
:host([vertical]) [part=seperator] {
|
|
135
|
+
:host([vertical]) [part='seperator'] {
|
|
136
136
|
display: none;
|
|
137
137
|
}
|
|
138
|
-
:host([vertical]) [part=container] {
|
|
138
|
+
:host([vertical]) [part='container'] {
|
|
139
139
|
align-items: inherit;
|
|
140
140
|
}
|
|
141
|
-
[part=container] {
|
|
141
|
+
[part='container'] {
|
|
142
142
|
padding: 0;
|
|
143
143
|
align-items: center;
|
|
144
144
|
}
|
|
145
|
-
[part=primary-bar],
|
|
146
|
-
[part=secondary-bar] {
|
|
145
|
+
[part='primary-bar'],
|
|
146
|
+
[part='secondary-bar'] {
|
|
147
147
|
width: 100%;
|
|
148
148
|
}
|
|
149
149
|
`;
|
|
@@ -166,7 +166,8 @@ let TornadoItem = class TornadoItem extends BasicElement {
|
|
|
166
166
|
part="primary-bar"
|
|
167
167
|
alignment=${this.primaryBarAlignment}
|
|
168
168
|
label="${this.primaryLabel || nothing}"
|
|
169
|
-
value="${this.primaryValue || nothing}"
|
|
169
|
+
value="${this.primaryValue || nothing}"
|
|
170
|
+
>
|
|
170
171
|
</ef-progress-bar>
|
|
171
172
|
</ef-layout>
|
|
172
173
|
<div part="seperator"></div>
|
|
@@ -175,7 +176,8 @@ let TornadoItem = class TornadoItem extends BasicElement {
|
|
|
175
176
|
part="secondary-bar"
|
|
176
177
|
alignment="${this.secondaryBarAlignment}"
|
|
177
178
|
label="${this.secondaryLabel || nothing}"
|
|
178
|
-
value="${this.secondaryValue || nothing}"
|
|
179
|
+
value="${this.secondaryValue || nothing}"
|
|
180
|
+
>
|
|
179
181
|
</ef-progress-bar>
|
|
180
182
|
</ef-layout>
|
|
181
183
|
</ef-layout>
|
|
@@ -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,
|