@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/icon/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import {
|
|
2
|
+
import { consume } from '@lit-labs/context';
|
|
3
|
+
import { BasicElement, DeprecationNotice, css, svg } from '@refinitiv-ui/core';
|
|
3
4
|
import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
|
|
4
5
|
import { property } from '@refinitiv-ui/core/decorators/property.js';
|
|
5
6
|
import { unsafeSVG } from '@refinitiv-ui/core/directives/unsafe-svg.js';
|
|
7
|
+
import { efConfig } from '../configuration/index.js';
|
|
6
8
|
import { VERSION } from '../version.js';
|
|
7
9
|
import { IconLoader } from './utils/IconLoader.js';
|
|
8
10
|
export { preload } from './utils/IconLoader.js';
|
|
9
|
-
import { consume } from '@lit-labs/context';
|
|
10
|
-
import { efConfig } from '../configuration/index.js';
|
|
11
11
|
const EmptyTemplate = svg ``;
|
|
12
12
|
/**
|
|
13
13
|
* Cache for reusing SVG template results across multiple icons.
|
|
@@ -116,7 +116,7 @@ let Icon = class Icon extends BasicElement {
|
|
|
116
116
|
* @returns icon map if exists
|
|
117
117
|
*/
|
|
118
118
|
get iconMap() {
|
|
119
|
-
return this.icon && this.config?.icon.map[this.icon] || null;
|
|
119
|
+
return (this.icon && this.config?.icon.map[this.icon]) || null;
|
|
120
120
|
}
|
|
121
121
|
/**
|
|
122
122
|
* Called after the component is first rendered
|
|
@@ -147,8 +147,7 @@ let Icon = class Icon extends BasicElement {
|
|
|
147
147
|
async loadAndRenderIcon(src) {
|
|
148
148
|
const iconTemplateCacheItem = iconTemplateCache.get(src);
|
|
149
149
|
if (!iconTemplateCacheItem) {
|
|
150
|
-
iconTemplateCache.set(src, IconLoader.loadSVG(src)
|
|
151
|
-
.then(body => svg `${unsafeSVG(body)}`));
|
|
150
|
+
iconTemplateCache.set(src, IconLoader.loadSVG(src).then((body) => svg `${unsafeSVG(body)}`));
|
|
152
151
|
return this.loadAndRenderIcon(src); // Load again and await cache result
|
|
153
152
|
}
|
|
154
153
|
this.template = await iconTemplateCacheItem;
|
|
@@ -161,8 +160,7 @@ let Icon = class Icon extends BasicElement {
|
|
|
161
160
|
*/
|
|
162
161
|
setPrefix() {
|
|
163
162
|
if (!IconLoader.isPrefixSet) {
|
|
164
|
-
const CDNPrefix = this.getComputedVariable('--cdn-prefix')
|
|
165
|
-
.replace(/^('|")|('|")$/g, '');
|
|
163
|
+
const CDNPrefix = this.getComputedVariable('--cdn-prefix').replace(/^('|")|('|")$/g, '');
|
|
166
164
|
IconLoader.setCdnPrefix(CDNPrefix);
|
|
167
165
|
}
|
|
168
166
|
}
|
|
@@ -8,6 +8,7 @@ declare class IconLoader extends SVGLoader {
|
|
|
8
8
|
declare const iconLoaderInstance: IconLoader;
|
|
9
9
|
export { iconLoaderInstance as IconLoader };
|
|
10
10
|
/**
|
|
11
|
+
* @deprecated Icon `preload()` is deprecated.
|
|
11
12
|
* Helper function to preload set of icons.
|
|
12
13
|
* It could help to reduce icon loading delay when ef-icon has a known set of icons that it can use.
|
|
13
14
|
* @param attrs - list of arguments, representing icons.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DeprecationNotice } from '@refinitiv-ui/core';
|
|
1
2
|
import { SVGLoader } from '@refinitiv-ui/utils/loader.js';
|
|
2
3
|
/**
|
|
3
4
|
* Caches and provides icon SVGs, Loaded either by name from CDN or directly by URL.
|
|
@@ -8,6 +9,12 @@ class IconLoader extends SVGLoader {
|
|
|
8
9
|
const iconLoaderInstance = new IconLoader();
|
|
9
10
|
export { iconLoaderInstance as IconLoader };
|
|
10
11
|
/**
|
|
12
|
+
* Deprecation notice displays a warning message
|
|
13
|
+
* when deprecated features are used.
|
|
14
|
+
*/
|
|
15
|
+
const deprecationNotice = new DeprecationNotice('Icon `preload()` is deprecated.');
|
|
16
|
+
/**
|
|
17
|
+
* @deprecated Icon `preload()` is deprecated.
|
|
11
18
|
* Helper function to preload set of icons.
|
|
12
19
|
* It could help to reduce icon loading delay when ef-icon has a known set of icons that it can use.
|
|
13
20
|
* @param attrs - list of arguments, representing icons.
|
|
@@ -15,5 +22,6 @@ export { iconLoaderInstance as IconLoader };
|
|
|
15
22
|
* @returns Array of promises, which will be resolved with SVG bodies.
|
|
16
23
|
*/
|
|
17
24
|
export const preload = (...attrs) => {
|
|
18
|
-
|
|
25
|
+
deprecationNotice.once();
|
|
26
|
+
return attrs.map((icon) => iconLoaderInstance.loadSVG(icon));
|
|
19
27
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { HSLColor, RGBColor } from '@refinitiv-ui/utils/color.js';
|
|
2
|
+
import type { AreaSeriesPartialOptions, AreaStyleOptions, BarData, BarSeriesPartialOptions, BarStyleOptions, CandlestickSeriesPartialOptions, CandlestickStyleOptions, ChartOptions, DeepPartial, HistogramData, HistogramSeriesPartialOptions, HistogramStyleOptions, ISeriesApi, LineData, LineSeriesPartialOptions, LineStyleOptions, SeriesPartialOptions, SeriesType } from 'lightweight-charts';
|
|
3
3
|
type SeriesOptions = AreaSeriesPartialOptions | BarSeriesPartialOptions | CandlestickSeriesPartialOptions | HistogramSeriesPartialOptions | LineSeriesPartialOptions;
|
|
4
4
|
type SeriesStyleOptions = LineStyleOptions & AreaStyleOptions & BarStyleOptions & CandlestickStyleOptions & HistogramStyleOptions;
|
|
5
5
|
type SeriesData = LineData[] | BarData[] | HistogramData[];
|
|
@@ -43,4 +43,4 @@ interface InteractiveChartSeries {
|
|
|
43
43
|
data: SeriesData;
|
|
44
44
|
seriesOptions?: SeriesPartialOptions<SeriesOptions>;
|
|
45
45
|
}
|
|
46
|
-
export { InteractiveChartConfig, InteractiveChartSeries, Time, Theme, RowLegend, SeriesList, SeriesDataItem, SeriesStyleOptions, ColorToStringFunction, LegendStyle };
|
|
46
|
+
export { InteractiveChartConfig, InteractiveChartSeries, Time, Theme, RowLegend, SeriesList, SeriesData, SeriesDataItem, SeriesOptions, SeriesStyleOptions, ColorToStringFunction, LegendStyle };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { JSXInterface } from '../jsx';
|
|
2
|
-
import { ResponsiveElement, TemplateResult, CSSResultGroup, PropertyValues, ElementSize } from '@refinitiv-ui/core';
|
|
3
2
|
import { IChartApi, MouseEventParams } from 'lightweight-charts';
|
|
3
|
+
import { CSSResultGroup, ElementSize, PropertyValues, ResponsiveElement, TemplateResult } from '@refinitiv-ui/core';
|
|
4
4
|
import '../tooltip/index.js';
|
|
5
|
-
import type { InteractiveChartConfig, InteractiveChartSeries, RowLegend, SeriesList, SeriesDataItem } from './helpers/types';
|
|
6
5
|
import { LegendStyle } from './helpers/types.js';
|
|
7
|
-
|
|
6
|
+
import type { InteractiveChartConfig, InteractiveChartSeries, RowLegend, SeriesData, SeriesDataItem, SeriesList, SeriesOptions, SeriesStyleOptions, Theme, Time } from './helpers/types.js';
|
|
7
|
+
export type { InteractiveChartConfig, InteractiveChartSeries, Time, Theme, RowLegend, SeriesList, SeriesData, SeriesDataItem, SeriesOptions, SeriesStyleOptions, LegendStyle };
|
|
8
8
|
/**
|
|
9
9
|
* A charting component that allows you to create several use cases of financial chart.
|
|
10
10
|
* By lightweight-charts library.
|
|
@@ -26,7 +26,7 @@ export declare class InteractiveChart extends ResponsiveElement {
|
|
|
26
26
|
/**
|
|
27
27
|
* Chart configurations for init chart
|
|
28
28
|
* @type {InteractiveChartConfig}
|
|
29
|
-
|
|
29
|
+
*/
|
|
30
30
|
config: InteractiveChartConfig | null;
|
|
31
31
|
/**
|
|
32
32
|
* Hide legend
|
|
@@ -37,10 +37,10 @@ export declare class InteractiveChart extends ResponsiveElement {
|
|
|
37
37
|
*/
|
|
38
38
|
disabledJumpButton: boolean;
|
|
39
39
|
/**
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
* @deprecated `legendstyle` attribute is deprecated, use `legend-style` instead.
|
|
41
|
+
* @ignore
|
|
42
|
+
* Set legend style i.e. `horizontal`, `vertical`. Default is `vertical`.
|
|
43
|
+
**/
|
|
44
44
|
deprecatedLegendStyle: LegendStyle | undefined;
|
|
45
45
|
/**
|
|
46
46
|
* Set legend style i.e. `horizontal`, `vertical`.
|
|
@@ -53,7 +53,7 @@ export declare class InteractiveChart extends ResponsiveElement {
|
|
|
53
53
|
/**
|
|
54
54
|
* Deprecation notice displays a warning message
|
|
55
55
|
* when deprecated features are used.
|
|
56
|
-
|
|
56
|
+
*/
|
|
57
57
|
private deprecationNotice;
|
|
58
58
|
/**
|
|
59
59
|
* @ignore
|
|
@@ -107,9 +107,9 @@ export declare class InteractiveChart extends ResponsiveElement {
|
|
|
107
107
|
*/
|
|
108
108
|
resizedCallback(size: ElementSize): void;
|
|
109
109
|
/**
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
110
|
+
* Legend value observer
|
|
111
|
+
* @returns {void}
|
|
112
|
+
*/
|
|
113
113
|
private onLegendChange;
|
|
114
114
|
/**
|
|
115
115
|
* Legend style observer
|
|
@@ -119,9 +119,9 @@ export declare class InteractiveChart extends ResponsiveElement {
|
|
|
119
119
|
*/
|
|
120
120
|
private onLegendStyleChange;
|
|
121
121
|
/**
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
122
|
+
* Jump last value observer
|
|
123
|
+
* @returns {void}
|
|
124
|
+
*/
|
|
125
125
|
private onJumpButtonChange;
|
|
126
126
|
/**
|
|
127
127
|
* update width and height of chart
|
|
@@ -190,15 +190,15 @@ export declare class InteractiveChart extends ResponsiveElement {
|
|
|
190
190
|
*/
|
|
191
191
|
private convertColorToString;
|
|
192
192
|
/**
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
193
|
+
* Create data configuration from theme
|
|
194
|
+
* @returns {void}
|
|
195
|
+
*/
|
|
196
196
|
private createSeriesOptions;
|
|
197
197
|
/**
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
198
|
+
* Apply Theme to chart
|
|
199
|
+
* @param config value config
|
|
200
|
+
* @returns {void}
|
|
201
|
+
*/
|
|
202
202
|
private applyTheme;
|
|
203
203
|
/**
|
|
204
204
|
* Apply text color legend from chart options
|
|
@@ -264,13 +264,13 @@ export declare class InteractiveChart extends ResponsiveElement {
|
|
|
264
264
|
*/
|
|
265
265
|
private createSpanOHLC;
|
|
266
266
|
/**
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
267
|
+
* Create text used by several series types such as bars or candlesticks
|
|
268
|
+
* @param rowLegend Legend element
|
|
269
|
+
* @param rowData Value of series
|
|
270
|
+
* @param priceColor color of series
|
|
271
|
+
* @param index Series index
|
|
272
|
+
* @returns {void}
|
|
273
|
+
*/
|
|
274
274
|
private createTextOHLC;
|
|
275
275
|
/**
|
|
276
276
|
* Create text price used by several series types
|
|
@@ -346,11 +346,11 @@ export declare class InteractiveChart extends ResponsiveElement {
|
|
|
346
346
|
*/
|
|
347
347
|
colors(): string[];
|
|
348
348
|
/**
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
349
|
+
* A `CSSResultGroup` that will be used
|
|
350
|
+
* to style the host, slotted children
|
|
351
|
+
* and the internal template of the element.
|
|
352
|
+
* @return CSS template
|
|
353
|
+
*/
|
|
354
354
|
static get styles(): CSSResultGroup;
|
|
355
355
|
/**
|
|
356
356
|
* A `TemplateResult` that will be used
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
var InteractiveChart_1;
|
|
2
2
|
import { __decorate } from "tslib";
|
|
3
|
-
import {
|
|
3
|
+
import { createChart as chart } from 'lightweight-charts';
|
|
4
|
+
import { DeprecationNotice, ResponsiveElement, css, html } from '@refinitiv-ui/core';
|
|
4
5
|
import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
|
|
5
6
|
import { property } from '@refinitiv-ui/core/decorators/property.js';
|
|
6
7
|
import { query } from '@refinitiv-ui/core/decorators/query.js';
|
|
7
|
-
import { VERSION } from '../version.js';
|
|
8
8
|
import { color as parseColor } from '@refinitiv-ui/utils/color.js';
|
|
9
|
-
import { createChart as chart } from 'lightweight-charts';
|
|
10
9
|
import '../tooltip/index.js';
|
|
11
|
-
import {
|
|
10
|
+
import { VERSION } from '../version.js';
|
|
12
11
|
import { merge } from './helpers/merge.js';
|
|
12
|
+
import { LegendStyle } from './helpers/types.js';
|
|
13
13
|
const NOT_AVAILABLE_DATA = 'N/A';
|
|
14
14
|
const NO_DATA_POINT = '--';
|
|
15
15
|
/**
|
|
@@ -24,7 +24,7 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
|
|
|
24
24
|
/**
|
|
25
25
|
* Chart configurations for init chart
|
|
26
26
|
* @type {InteractiveChartConfig}
|
|
27
|
-
|
|
27
|
+
*/
|
|
28
28
|
this.config = null;
|
|
29
29
|
/**
|
|
30
30
|
* Hide legend
|
|
@@ -37,7 +37,7 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
|
|
|
37
37
|
/**
|
|
38
38
|
* Deprecation notice displays a warning message
|
|
39
39
|
* when deprecated features are used.
|
|
40
|
-
|
|
40
|
+
*/
|
|
41
41
|
this.deprecationNotice = new DeprecationNotice('`legendstyle` attribute and property are deprecated. Use `legend-style` for attribute and `legendStyle` property instead.');
|
|
42
42
|
/**
|
|
43
43
|
* @ignore
|
|
@@ -169,7 +169,8 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
|
|
|
169
169
|
if (changedProperties.has('deprecatedLegendStyle')) {
|
|
170
170
|
this.deprecationNotice.show();
|
|
171
171
|
}
|
|
172
|
-
const oldLegendStyle = (changedProperties.get('legend-style') ||
|
|
172
|
+
const oldLegendStyle = (changedProperties.get('legend-style') ||
|
|
173
|
+
changedProperties.get('deprecatedLegendStyle'));
|
|
173
174
|
this.onLegendStyleChange(this.legendStyle, oldLegendStyle);
|
|
174
175
|
}
|
|
175
176
|
}
|
|
@@ -192,9 +193,9 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
|
|
|
192
193
|
}
|
|
193
194
|
}
|
|
194
195
|
/**
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
196
|
+
* Legend value observer
|
|
197
|
+
* @returns {void}
|
|
198
|
+
*/
|
|
198
199
|
onLegendChange() {
|
|
199
200
|
if (!this.disabledLegend) {
|
|
200
201
|
this.createLegend();
|
|
@@ -221,9 +222,9 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
|
|
|
221
222
|
}
|
|
222
223
|
}
|
|
223
224
|
/**
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
225
|
+
* Jump last value observer
|
|
226
|
+
* @returns {void}
|
|
227
|
+
*/
|
|
227
228
|
onJumpButtonChange() {
|
|
228
229
|
if (!this.disabledJumpButton) {
|
|
229
230
|
this.createJumpButton(this.width, this.height);
|
|
@@ -417,9 +418,9 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
|
|
|
417
418
|
return color || {};
|
|
418
419
|
}
|
|
419
420
|
/**
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
421
|
+
* Create data configuration from theme
|
|
422
|
+
* @returns {void}
|
|
423
|
+
*/
|
|
423
424
|
createSeriesOptions() {
|
|
424
425
|
if (this.theme) {
|
|
425
426
|
let colorIndex = 0;
|
|
@@ -471,12 +472,12 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
|
|
|
471
472
|
wickDownColor: this.theme.chartDownColor
|
|
472
473
|
};
|
|
473
474
|
// Update color index
|
|
474
|
-
if (!seriesOptions.upColor
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
475
|
+
if (!seriesOptions.upColor ||
|
|
476
|
+
!seriesOptions.downColor ||
|
|
477
|
+
!seriesOptions.borderUpColor ||
|
|
478
|
+
!seriesOptions.borderDownColor ||
|
|
479
|
+
!seriesOptions.wickUpColor ||
|
|
480
|
+
!seriesOptions.wickDownColor) {
|
|
480
481
|
colorIndex++;
|
|
481
482
|
}
|
|
482
483
|
}
|
|
@@ -491,7 +492,8 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
|
|
|
491
492
|
}
|
|
492
493
|
// Update config seriesOptions not have seriesOptions
|
|
493
494
|
if (!this.internalConfig.series[index].seriesOptions) {
|
|
494
|
-
this.internalConfig.series[index].seriesOptions =
|
|
495
|
+
this.internalConfig.series[index].seriesOptions =
|
|
496
|
+
seriesThemeOptions;
|
|
495
497
|
}
|
|
496
498
|
else {
|
|
497
499
|
merge(seriesOptions, seriesThemeOptions);
|
|
@@ -500,10 +502,10 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
|
|
|
500
502
|
}
|
|
501
503
|
}
|
|
502
504
|
/**
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
505
|
+
* Apply Theme to chart
|
|
506
|
+
* @param config value config
|
|
507
|
+
* @returns {void}
|
|
508
|
+
*/
|
|
507
509
|
applyTheme(config) {
|
|
508
510
|
if (this.chart && this.theme) {
|
|
509
511
|
const style = getComputedStyle(this);
|
|
@@ -635,7 +637,7 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
|
|
|
635
637
|
for (let idx = 0; idx < this.internalConfig.series.length; idx++) {
|
|
636
638
|
const chartType = this.internalConfig.series[idx].type;
|
|
637
639
|
const dataSet = this.internalConfig.series[idx].data || [];
|
|
638
|
-
const symbol =
|
|
640
|
+
const symbol = this.internalConfig.series[idx].symbolName || this.internalConfig.series[idx].symbol || '';
|
|
639
641
|
const isLegendVisible = this.internalConfig.series[idx].legendVisible !== false;
|
|
640
642
|
// Create row legend element
|
|
641
643
|
if (!rowLegend) {
|
|
@@ -657,11 +659,11 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
|
|
|
657
659
|
}
|
|
658
660
|
this.legendContainer.appendChild(rowLegendElem);
|
|
659
661
|
}
|
|
660
|
-
/* Update value legend element on subscribeCrosshairMove.
|
|
661
|
-
* Don't need to be updated if chart has no data.
|
|
662
|
-
*/
|
|
663
|
-
/* istanbul ignore next */
|
|
664
662
|
else if (rowLegend && dataSet.length) {
|
|
663
|
+
/* Update value legend element on subscribeCrosshairMove.
|
|
664
|
+
* Don't need to be updated if chart has no data.
|
|
665
|
+
*/
|
|
666
|
+
/* istanbul ignore next */
|
|
665
667
|
let value;
|
|
666
668
|
let priceColor = '';
|
|
667
669
|
// When have price on event moved on the crosshair
|
|
@@ -682,7 +684,10 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
|
|
|
682
684
|
const latestData = dataSet[dataSet.length - 1];
|
|
683
685
|
if (latestData) {
|
|
684
686
|
priceColor = this.getColorInSeries(latestData, chartType, idx);
|
|
685
|
-
value =
|
|
687
|
+
value =
|
|
688
|
+
chartType === 'bar' || chartType === 'candlestick'
|
|
689
|
+
? latestData
|
|
690
|
+
: latestData.value;
|
|
686
691
|
this.isCrosshairVisible = false;
|
|
687
692
|
this.hasDataPoint = true;
|
|
688
693
|
}
|
|
@@ -710,7 +715,7 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
|
|
|
710
715
|
if (chartType === 'bar' || chartType === 'candlestick') {
|
|
711
716
|
if (!this.hasDataPoint && rowLegendElem instanceof NodeList) {
|
|
712
717
|
const spanElem = rowLegendElem[index].querySelectorAll('span.price,span.ohlc');
|
|
713
|
-
spanElem.forEach(span => rowLegendElem[index].removeChild(span));
|
|
718
|
+
spanElem.forEach((span) => rowLegendElem[index].removeChild(span));
|
|
714
719
|
const span = document.createElement('span');
|
|
715
720
|
span.className = 'price';
|
|
716
721
|
span.textContent = value;
|
|
@@ -738,16 +743,18 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
|
|
|
738
743
|
}
|
|
739
744
|
}
|
|
740
745
|
/**
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
746
|
+
* Create text used by several series types such as bars or candlesticks
|
|
747
|
+
* @param rowLegend Legend element
|
|
748
|
+
* @param rowData Value of series
|
|
749
|
+
* @param priceColor color of series
|
|
750
|
+
* @param index Series index
|
|
751
|
+
* @returns {void}
|
|
752
|
+
*/
|
|
748
753
|
createTextOHLC(rowLegend, rowData, priceColor, index) {
|
|
749
754
|
// Uses price formatter if provided
|
|
750
|
-
const formatter = this.internalConfig.series[index].hasOwnProperty('legendPriceFormatter')
|
|
755
|
+
const formatter = this.internalConfig.series[index].hasOwnProperty('legendPriceFormatter')
|
|
756
|
+
? this.internalConfig.series[index].legendPriceFormatter
|
|
757
|
+
: null;
|
|
751
758
|
if (formatter) {
|
|
752
759
|
rowData = {
|
|
753
760
|
open: formatter(rowData.open),
|
|
@@ -885,7 +892,9 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
|
|
|
885
892
|
return this.getLegendPriceColor(this.seriesList[index].options().color);
|
|
886
893
|
}
|
|
887
894
|
else if (chartType === 'candlestick') {
|
|
888
|
-
const value = seriesData.hasOwnProperty('seriesPrices')
|
|
895
|
+
const value = seriesData.hasOwnProperty('seriesPrices')
|
|
896
|
+
? seriesData?.seriesPrices.get(this.seriesList[index])
|
|
897
|
+
: seriesData;
|
|
889
898
|
const barStyle = this.seriesList[index].options();
|
|
890
899
|
const colorBar = value.close > value.open ? barStyle.borderUpColor : barStyle.borderDownColor;
|
|
891
900
|
return colorBar;
|
|
@@ -897,7 +906,9 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
|
|
|
897
906
|
return this.getLegendPriceColor(this.seriesList[index].options().lineColor);
|
|
898
907
|
}
|
|
899
908
|
else if (chartType === 'volume') {
|
|
900
|
-
const priceValue = seriesData.hasOwnProperty('seriesPrices')
|
|
909
|
+
const priceValue = seriesData.hasOwnProperty('seriesPrices')
|
|
910
|
+
? seriesData.seriesPrices.get(this.seriesList[index])
|
|
911
|
+
: seriesData.value;
|
|
901
912
|
let dataItem = {};
|
|
902
913
|
this.internalConfig.series[index].data.forEach((dataConfig) => {
|
|
903
914
|
const data = dataConfig;
|
|
@@ -905,10 +916,10 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
|
|
|
905
916
|
const timeSeriesData = seriesData.time;
|
|
906
917
|
// if via time point data string format 'yyyy-mm-dd' or object '{ year: 2019, month: 6, day: 1 }'
|
|
907
918
|
if (time.hasOwnProperty('day') && time.hasOwnProperty('month') && time.hasOwnProperty('year')) {
|
|
908
|
-
if (time.day === timeSeriesData.day
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
919
|
+
if (time.day === timeSeriesData.day &&
|
|
920
|
+
time.month === timeSeriesData.month &&
|
|
921
|
+
time.year === timeSeriesData.year &&
|
|
922
|
+
data.value === priceValue) {
|
|
912
923
|
dataItem = dataConfig;
|
|
913
924
|
}
|
|
914
925
|
}
|
|
@@ -942,7 +953,7 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
|
|
|
942
953
|
const position = this.getPriceScalePosition();
|
|
943
954
|
const pricePosition = position === 'left' ? 30 : 0;
|
|
944
955
|
const buttonTop = `${height - 70}px`;
|
|
945
|
-
const buttonLeft = `${
|
|
956
|
+
const buttonLeft = `${width + pricePosition - 100}px`;
|
|
946
957
|
this.jumpButtonContainer.style.top = buttonTop;
|
|
947
958
|
this.jumpButtonContainer.style.left = buttonLeft;
|
|
948
959
|
// Create subscribeVisibleTimeRangeChange
|
|
@@ -1001,11 +1012,11 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
|
|
|
1001
1012
|
return colors;
|
|
1002
1013
|
}
|
|
1003
1014
|
/**
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1015
|
+
* A `CSSResultGroup` that will be used
|
|
1016
|
+
* to style the host, slotted children
|
|
1017
|
+
* and the internal template of the element.
|
|
1018
|
+
* @return CSS template
|
|
1019
|
+
*/
|
|
1009
1020
|
static get styles() {
|
|
1010
1021
|
return css `
|
|
1011
1022
|
:host {
|
|
@@ -1015,7 +1026,7 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
|
|
|
1015
1026
|
z-index: 0;
|
|
1016
1027
|
}
|
|
1017
1028
|
|
|
1018
|
-
[part=legend] {
|
|
1029
|
+
[part='legend'] {
|
|
1019
1030
|
position: absolute;
|
|
1020
1031
|
z-index: 1000;
|
|
1021
1032
|
}
|
|
@@ -1035,8 +1046,12 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
|
|
|
1035
1046
|
<div part="jump-button"></div>
|
|
1036
1047
|
</div>
|
|
1037
1048
|
<div part="branding-container" title="" tooltip="Powered by Trading View">
|
|
1038
|
-
<svg width="33" height="19" viewBox="0 0 611 314"
|
|
1039
|
-
<path
|
|
1049
|
+
<svg width="33" height="19" viewBox="0 0 611 314" part="branding">
|
|
1050
|
+
<path
|
|
1051
|
+
fill-rule="evenodd"
|
|
1052
|
+
clip-rule="evenodd"
|
|
1053
|
+
d="M341 124C375.242 124 403 96.2417 403 62C403 27.7583 375.242 0 341 0C306.758 0 279 27.7583 279 62C279 96.2417 306.758 124 341 124ZM481 314H337L467 4H611L481 314ZM124 4H248V128V314H124V128H0V4H124Z"
|
|
1054
|
+
/>
|
|
1040
1055
|
</svg>
|
|
1041
1056
|
</div>
|
|
1042
1057
|
<div part="chart"></div>
|
package/lib/item/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { JSXInterface } from '../jsx';
|
|
2
|
-
import {
|
|
3
|
-
import '../icon/index.js';
|
|
2
|
+
import { CSSResultGroup, ControlElement, PropertyValues, TemplateResult } from '@refinitiv-ui/core';
|
|
4
3
|
import '../checkbox/index.js';
|
|
5
|
-
import
|
|
4
|
+
import '../icon/index.js';
|
|
5
|
+
import type { ItemData, ItemDivider, ItemHeader, ItemText, ItemType } from './helpers/types';
|
|
6
6
|
export type { ItemType, ItemText, ItemHeader, ItemDivider, ItemData };
|
|
7
7
|
/**
|
|
8
8
|
* Used as a basic building block to compose complex custom elements,
|
package/lib/item/index.js
CHANGED
|
@@ -2,14 +2,13 @@ import { __decorate } from "tslib";
|
|
|
2
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
|
-
import {
|
|
6
|
-
import '
|
|
5
|
+
import { createRef, ref } from '@refinitiv-ui/core/directives/ref.js';
|
|
6
|
+
import { isElementOverflown } from '@refinitiv-ui/utils/element.js';
|
|
7
7
|
import '../checkbox/index.js';
|
|
8
|
+
import '../icon/index.js';
|
|
8
9
|
import { registerOverflowTooltip } from '../tooltip/index.js';
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
const isAllWhitespaceTextNode = (node) => node.nodeType === document.TEXT_NODE
|
|
12
|
-
&& !node.textContent?.trim();
|
|
10
|
+
import { VERSION } from '../version.js';
|
|
11
|
+
const isAllWhitespaceTextNode = (node) => node.nodeType === document.TEXT_NODE && !node.textContent?.trim();
|
|
13
12
|
/**
|
|
14
13
|
* Used as a basic building block to compose complex custom elements,
|
|
15
14
|
* additionally it can be used by applications
|
|
@@ -85,7 +84,7 @@ let Item = class Item extends ControlElement {
|
|
|
85
84
|
*/
|
|
86
85
|
this.checkSlotChildren = (event) => {
|
|
87
86
|
const slot = event.target;
|
|
88
|
-
this.isSlotEmpty = !slot.assignedNodes().filter(node => !this.isIgnorable(node)).length;
|
|
87
|
+
this.isSlotEmpty = !slot.assignedNodes().filter((node) => !this.isIgnorable(node)).length;
|
|
89
88
|
this.requestUpdate();
|
|
90
89
|
};
|
|
91
90
|
}
|
|
@@ -107,18 +106,18 @@ let Item = class Item extends ControlElement {
|
|
|
107
106
|
display: flex;
|
|
108
107
|
align-items: center;
|
|
109
108
|
}
|
|
110
|
-
[part=checkbox] {
|
|
109
|
+
[part='checkbox'] {
|
|
111
110
|
pointer-events: none;
|
|
112
111
|
}
|
|
113
|
-
[part=left],
|
|
114
|
-
[part=right] {
|
|
112
|
+
[part='left'],
|
|
113
|
+
[part='right'] {
|
|
115
114
|
display: flex;
|
|
116
115
|
align-items: center;
|
|
117
116
|
}
|
|
118
|
-
[part=center] {
|
|
117
|
+
[part='center'] {
|
|
119
118
|
flex: 1;
|
|
120
119
|
}
|
|
121
|
-
:host([type=divider]) > * {
|
|
120
|
+
:host([type='divider']) > * {
|
|
122
121
|
display: none;
|
|
123
122
|
}
|
|
124
123
|
`;
|
|
@@ -128,8 +127,7 @@ let Item = class Item extends ControlElement {
|
|
|
128
127
|
* @returns whether node can be ignored.
|
|
129
128
|
*/
|
|
130
129
|
isIgnorable(node) {
|
|
131
|
-
return node.nodeType === document.COMMENT_NODE
|
|
132
|
-
|| isAllWhitespaceTextNode(node);
|
|
130
|
+
return node.nodeType === document.COMMENT_NODE || isAllWhitespaceTextNode(node);
|
|
133
131
|
}
|
|
134
132
|
/**
|
|
135
133
|
* Handles aria-selected or aria-checked when toggle between single and multiple selection mode
|
|
@@ -216,13 +214,15 @@ let Item = class Item extends ControlElement {
|
|
|
216
214
|
* @returns return true if an item is overflown.
|
|
217
215
|
*/
|
|
218
216
|
isItemOverflown() {
|
|
219
|
-
return this.isItemElementOverflown(this.labelRef.value) || this.isItemElementOverflown(this.subLabelRef.value);
|
|
217
|
+
return (this.isItemElementOverflown(this.labelRef.value) || this.isItemElementOverflown(this.subLabelRef.value));
|
|
220
218
|
}
|
|
221
219
|
/**
|
|
222
220
|
* Get icon template if icon attribute is defined
|
|
223
221
|
*/
|
|
224
222
|
get iconTemplate() {
|
|
225
|
-
return this.icon !== null && this.icon !== undefined
|
|
223
|
+
return this.icon !== null && this.icon !== undefined
|
|
224
|
+
? html `<ef-icon part="icon" .icon="${this.icon}"></ef-icon>`
|
|
225
|
+
: undefined;
|
|
226
226
|
}
|
|
227
227
|
/**
|
|
228
228
|
* Get subLabel template if it is defined and no slot content present
|
|
@@ -241,7 +241,10 @@ let Item = class Item extends ControlElement {
|
|
|
241
241
|
*/
|
|
242
242
|
get slotContent() {
|
|
243
243
|
const nodes = this.slotRef.value?.assignedNodes() || [];
|
|
244
|
-
return nodes
|
|
244
|
+
return nodes
|
|
245
|
+
.map((node) => node.textContent)
|
|
246
|
+
.join(' ')
|
|
247
|
+
.trim();
|
|
245
248
|
}
|
|
246
249
|
/**
|
|
247
250
|
* Get template for `for` attribute.
|
|
@@ -256,7 +259,9 @@ let Item = class Item extends ControlElement {
|
|
|
256
259
|
*/
|
|
257
260
|
get multipleTemplate() {
|
|
258
261
|
const multiple = this.multiple && (!this.type || this.type === 'text');
|
|
259
|
-
return multiple
|
|
262
|
+
return multiple
|
|
263
|
+
? html `<ef-checkbox part="checkbox" .checked="${this.selected}" tabindex="-1"></ef-checkbox>`
|
|
264
|
+
: undefined;
|
|
260
265
|
}
|
|
261
266
|
/**
|
|
262
267
|
* Return true if the item can be highlighted. True if not disabled and type is Text
|
|
@@ -274,8 +279,7 @@ let Item = class Item extends ControlElement {
|
|
|
274
279
|
render() {
|
|
275
280
|
return html `
|
|
276
281
|
<div part="left">
|
|
277
|
-
${this.iconTemplate}
|
|
278
|
-
${this.multipleTemplate}
|
|
282
|
+
${this.iconTemplate} ${this.multipleTemplate}
|
|
279
283
|
<slot name="left"></slot>
|
|
280
284
|
</div>
|
|
281
285
|
<div part="center" ${ref(this.labelRef)}>
|