@refinitiv-ui/elements 6.18.5 → 6.19.0
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 +10 -0
- package/lib/chart/themes/halo/dark/index.js +1 -1
- package/lib/collapse/index.js +0 -2
- package/lib/datetime-picker/index.js +0 -2
- package/lib/flag/index.js +1 -1
- package/lib/icon/index.d.ts +36 -3
- package/lib/icon/index.js +88 -25
- package/lib/icon/themes/halo/dark/index.js +1 -1
- package/lib/icon/themes/halo/light/index.js +1 -1
- package/lib/icon/themes/solar/charcoal/index.js +1 -1
- package/lib/icon/themes/solar/pearl/index.js +1 -1
- package/lib/icon/utils/SpriteLoader.d.ts +23 -0
- package/lib/icon/utils/SpriteLoader.js +42 -0
- package/lib/interactive-chart/themes/halo/dark/index.js +1 -1
- package/lib/password-field/index.js +0 -6
- package/lib/tornado-chart/themes/halo/dark/index.js +1 -1
- package/lib/tree/elements/tree-item.js +0 -2
- package/lib/version.js +1 -1
- package/package.json +14 -14
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [6.19.0](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@6.18.6...@refinitiv-ui/elements@6.19.0) (2025-04-23)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- **icon:** add icon sprites ([#1274](https://github.com/Refinitiv/refinitiv-ui/issues/1274)) ([be7f5d7](https://github.com/Refinitiv/refinitiv-ui/commit/be7f5d71b5e0c071eee08c01c9bfc1c9cb146f53))
|
|
11
|
+
|
|
12
|
+
## [6.18.6](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@6.18.5...@refinitiv-ui/elements@6.18.6) (2024-11-14)
|
|
13
|
+
|
|
14
|
+
**Note:** Version bump only for package @refinitiv-ui/elements
|
|
15
|
+
|
|
6
16
|
## [6.18.5](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@6.18.4...@refinitiv-ui/elements@6.18.5) (2024-09-23)
|
|
7
17
|
|
|
8
18
|
### Bug Fixes
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import '@refinitiv-ui/elements/header/themes/halo/dark';
|
|
2
2
|
import '@refinitiv-ui/elements/layout/themes/halo/dark';
|
|
3
|
-
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-chart', styles: ':host{font-size:12px;--grid-line-color:rgba(38, 38, 38, 0.5);--zero-line-color:rgba(38, 38, 38, 0.5);--animation-duration:1000;--line-width:2px;--line-tension:0;--multi-dataset-border-color:#1A1A1A;--tooltip-background-color:rgba(204, 204, 204, 0.9);--tooltip-title-color:#0D0D0D;--tooltip-body-color:#0D0D0D;--tooltip-border-radius:0px;--tooltip-caret-size:7px;--tooltip-padding-x:7px;--tooltip-padding-y:5px;--tooltip-title-spacing:0;--legend-key-box-width:4px;--chart-color-1:#6678FF;--chart-color-2:#
|
|
3
|
+
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-chart', styles: ':host{font-size:12px;--grid-line-color:rgba(38, 38, 38, 0.5);--zero-line-color:rgba(38, 38, 38, 0.5);--animation-duration:1000;--line-width:2px;--line-tension:0;--multi-dataset-border-color:#1A1A1A;--tooltip-background-color:rgba(204, 204, 204, 0.9);--tooltip-title-color:#0D0D0D;--tooltip-body-color:#0D0D0D;--tooltip-border-radius:0px;--tooltip-caret-size:7px;--tooltip-padding-x:7px;--tooltip-padding-y:5px;--tooltip-title-spacing:0;--legend-key-box-width:4px;--chart-color-1:#6678FF;--chart-color-2:#E6E6E6;--chart-color-3:#FFC800;--chart-color-4:#9064CD;--chart-color-5:#00D0D4;--chart-color-6:#FF5000;--chart-color-7:#00C389;--chart-color-8:#EA2E6C;--tooltip-background-color:#FFFFFF;--tooltip-title-color:#0D0D0D;--tooltip-body-color:#0D0D0D;--tooltip-padding-x:8px;--tooltip-padding-y:4px;--chart-color-1:#6678FF;--chart-color-2:#E6E6E6;--chart-color-3:#FFC800;--chart-color-4:#9064CD;--chart-color-5:#00D0D4;--chart-color-6:#FF5000;--chart-color-7:#00C389;--chart-color-8:#EA2E6C;--chart-color-9:#999999;--chart-color-10:#3BBAFF;--chart-color-11:#198C8C;--chart-color-12:#C36241;--chart-color-13:#CCD2FF;--chart-color-14:#808080;--chart-color-15:#FFDE66;--chart-color-16:#BCA2E1;--chart-color-17:#59DFE1;--chart-color-18:#FF9666;--chart-color-19:#6CEFC8;--chart-color-20:#F281A7;--chart-color-21:#CCCCCC;--chart-color-22:#89D5FF;--chart-color-23:#75BABA;--chart-color-24:#DBA08D;--chart-color-25:#F6ABC4}' }}));
|
package/lib/collapse/index.js
CHANGED
|
@@ -5,11 +5,9 @@ import { property } from '@refinitiv-ui/core/decorators/property.js';
|
|
|
5
5
|
import { state } from '@refinitiv-ui/core/decorators/state.js';
|
|
6
6
|
import { createRef, ref } from '@refinitiv-ui/core/directives/ref.js';
|
|
7
7
|
import '../header/index.js';
|
|
8
|
-
import { preload } from '../icon/index.js';
|
|
9
8
|
import '../icon/index.js';
|
|
10
9
|
import '../panel/index.js';
|
|
11
10
|
import { VERSION } from '../version.js';
|
|
12
|
-
preload('right'); /* preload calendar icons for faster loading */
|
|
13
11
|
/**
|
|
14
12
|
* Allows users to hide non-critical information
|
|
15
13
|
* or areas of the screen, maximizing the amount of real estate
|
|
@@ -11,7 +11,6 @@ import { TranslatePropertyKey, getLocale, translate } from '@refinitiv-ui/transl
|
|
|
11
11
|
import { DateFormat, DateTimeFormat, addMonths, format, isAfter, isBefore, isValidDate, isValidDateTime, isWeekend, parse, subMonths } from '@refinitiv-ui/utils/date.js';
|
|
12
12
|
import '../calendar/index.js';
|
|
13
13
|
import '../icon/index.js';
|
|
14
|
-
import { preload } from '../icon/index.js';
|
|
15
14
|
import '../overlay/index.js';
|
|
16
15
|
import '../text-field/index.js';
|
|
17
16
|
import '../time-picker/index.js';
|
|
@@ -19,7 +18,6 @@ import { VERSION } from '../version.js';
|
|
|
19
18
|
import { CALENDAR_FROM_ID, CALENDAR_ID, CALENDAR_TO_ID, INPUT_FORMAT, INPUT_FROM_ID, INPUT_ID, INPUT_TO_ID, POPUP_POSITION, TIMEPICKER_FROM_ID, TIMEPICKER_ID, TIMEPICKER_TO_ID, TRANSLATION_KEYS } from './constants.js';
|
|
20
19
|
import { getDateFNSLocale } from './locales.js';
|
|
21
20
|
import { DateTimeSegment, formatToView, getCurrentTime } from './utils.js';
|
|
22
|
-
preload('calendar', 'down', 'left', 'right'); /* preload calendar icons for faster loading */
|
|
23
21
|
/**
|
|
24
22
|
* Control to pick date and time
|
|
25
23
|
*
|
package/lib/flag/index.js
CHANGED
|
@@ -15,7 +15,7 @@ let Flag = class Flag extends BasicElement {
|
|
|
15
15
|
* Deprecation notice displays a warning message
|
|
16
16
|
* when deprecated features are used.
|
|
17
17
|
*/
|
|
18
|
-
this.deprecationNotice = new DeprecationNotice('`src` attribute and property are deprecated. Use `flag`
|
|
18
|
+
this.deprecationNotice = new DeprecationNotice('`src` attribute and property are deprecated. Use `flag` attribute and property instead.');
|
|
19
19
|
this._src = null;
|
|
20
20
|
this._template = EmptyTemplate;
|
|
21
21
|
}
|
package/lib/icon/index.d.ts
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import { JSXInterface } from '../jsx';
|
|
2
|
-
import { BasicElement, CSSResultGroup, PropertyValues, TemplateResult } from '@refinitiv-ui/core';
|
|
2
|
+
import { BasicElement, CSSResultGroup, PropertyValues, SVGTemplateResult, TemplateResult } from '@refinitiv-ui/core';
|
|
3
3
|
import type { Config } from '../configuration/index.js';
|
|
4
|
+
export { IconLoader } from './utils/IconLoader.js';
|
|
5
|
+
export { SpriteLoader } from './utils/SpriteLoader.js';
|
|
4
6
|
export { preload } from './utils/IconLoader.js';
|
|
7
|
+
/**
|
|
8
|
+
* Cache for reusing SVG template results across multiple icons.
|
|
9
|
+
* Reusing these templates increases performance dramatically when many icons are rendered.
|
|
10
|
+
* As the cache key is an absolute URL, we can assume no clashes will occur.
|
|
11
|
+
*/
|
|
12
|
+
export declare const iconTemplateCache: Map<string, Promise<SVGTemplateResult>>;
|
|
5
13
|
export declare class Icon extends BasicElement {
|
|
6
14
|
/**
|
|
7
15
|
* Element version number
|
|
@@ -53,6 +61,13 @@ export declare class Icon extends BasicElement {
|
|
|
53
61
|
*/
|
|
54
62
|
private get template();
|
|
55
63
|
private set template(value);
|
|
64
|
+
/**
|
|
65
|
+
* A deferred promise representing icon ready.
|
|
66
|
+
* It would be resolved when the icon svg has been fetched and parsed, or
|
|
67
|
+
* when the icon svg is unavailable/invalid.
|
|
68
|
+
*/
|
|
69
|
+
private iconReady;
|
|
70
|
+
constructor();
|
|
56
71
|
/**
|
|
57
72
|
* Check if the icon map configuration has content
|
|
58
73
|
* @returns icon map if exists
|
|
@@ -64,11 +79,22 @@ export declare class Icon extends BasicElement {
|
|
|
64
79
|
* @returns {void}
|
|
65
80
|
*/
|
|
66
81
|
protected firstUpdated(changedProperties: PropertyValues): void;
|
|
82
|
+
protected getUpdateComplete(): Promise<boolean>;
|
|
67
83
|
/**
|
|
68
|
-
*
|
|
84
|
+
* instantiate a new deferred promise for icon ready if it's not pending already
|
|
69
85
|
* @returns {void}
|
|
70
86
|
*/
|
|
71
|
-
private
|
|
87
|
+
private deferIconReady;
|
|
88
|
+
/**
|
|
89
|
+
* Check if the icon is valid to render
|
|
90
|
+
* @returns false if icon value or icon map value is invalid
|
|
91
|
+
*/
|
|
92
|
+
private isIconValid;
|
|
93
|
+
/**
|
|
94
|
+
* Update the icon renderer
|
|
95
|
+
* @returns {void}
|
|
96
|
+
*/
|
|
97
|
+
private updateRenderer;
|
|
72
98
|
/**
|
|
73
99
|
* Tries to load an icon from the url provided
|
|
74
100
|
* and the renders this into the icon template.
|
|
@@ -76,6 +102,13 @@ export declare class Icon extends BasicElement {
|
|
|
76
102
|
* @returns {void}
|
|
77
103
|
*/
|
|
78
104
|
private loadAndRenderIcon;
|
|
105
|
+
/**
|
|
106
|
+
* Tries to load get an icon from the sprite url provided
|
|
107
|
+
* and the renders this into the icon template.
|
|
108
|
+
* @param iconName Name of the svg icon.
|
|
109
|
+
* @returns {void}
|
|
110
|
+
*/
|
|
111
|
+
private loadAndRenderSpriteIcon;
|
|
79
112
|
/**
|
|
80
113
|
* Get and cache CDN prefix
|
|
81
114
|
* This is a private URL which is set in the theme
|
package/lib/icon/index.js
CHANGED
|
@@ -4,9 +4,13 @@ import { BasicElement, DeprecationNotice, css, svg } 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 { unsafeSVG } from '@refinitiv-ui/core/directives/unsafe-svg.js';
|
|
7
|
+
import { Deferred, isBase64svg, isUrl } from '@refinitiv-ui/utils/loader.js';
|
|
7
8
|
import { efConfig } from '../configuration/index.js';
|
|
8
9
|
import { VERSION } from '../version.js';
|
|
9
10
|
import { IconLoader } from './utils/IconLoader.js';
|
|
11
|
+
import { SpriteLoader } from './utils/SpriteLoader.js';
|
|
12
|
+
export { IconLoader } from './utils/IconLoader.js';
|
|
13
|
+
export { SpriteLoader } from './utils/SpriteLoader.js';
|
|
10
14
|
export { preload } from './utils/IconLoader.js';
|
|
11
15
|
const EmptyTemplate = svg ``;
|
|
12
16
|
/**
|
|
@@ -14,19 +18,8 @@ const EmptyTemplate = svg ``;
|
|
|
14
18
|
* Reusing these templates increases performance dramatically when many icons are rendered.
|
|
15
19
|
* As the cache key is an absolute URL, we can assume no clashes will occur.
|
|
16
20
|
*/
|
|
17
|
-
const iconTemplateCache = new Map();
|
|
21
|
+
export const iconTemplateCache = new Map();
|
|
18
22
|
let Icon = class Icon extends BasicElement {
|
|
19
|
-
constructor() {
|
|
20
|
-
super(...arguments);
|
|
21
|
-
this._icon = null;
|
|
22
|
-
/**
|
|
23
|
-
* Deprecation notice displays a warning message
|
|
24
|
-
* when deprecated features are used.
|
|
25
|
-
*/
|
|
26
|
-
this.deprecationNotice = new DeprecationNotice('`src` attribute and property are deprecated. Use `icon` for attribute and property instead.');
|
|
27
|
-
this._src = null;
|
|
28
|
-
this._template = EmptyTemplate;
|
|
29
|
-
}
|
|
30
23
|
/**
|
|
31
24
|
* Element version number
|
|
32
25
|
* @returns version number
|
|
@@ -65,8 +58,9 @@ let Icon = class Icon extends BasicElement {
|
|
|
65
58
|
set icon(value) {
|
|
66
59
|
const oldValue = this._icon;
|
|
67
60
|
if (oldValue !== value) {
|
|
61
|
+
this.deferIconReady();
|
|
68
62
|
this._icon = value;
|
|
69
|
-
|
|
63
|
+
requestAnimationFrame(() => this.updateRenderer());
|
|
70
64
|
this.requestUpdate('icon', oldValue);
|
|
71
65
|
}
|
|
72
66
|
}
|
|
@@ -87,13 +81,7 @@ let Icon = class Icon extends BasicElement {
|
|
|
87
81
|
set src(value) {
|
|
88
82
|
if (this.src !== value) {
|
|
89
83
|
this._src = value;
|
|
90
|
-
this.
|
|
91
|
-
if (this.icon && this.iconMap) {
|
|
92
|
-
void this.loadAndRenderIcon(this.iconMap);
|
|
93
|
-
}
|
|
94
|
-
else if (value) {
|
|
95
|
-
void this.loadAndRenderIcon(value);
|
|
96
|
-
}
|
|
84
|
+
this.icon = value;
|
|
97
85
|
}
|
|
98
86
|
if (value && !this.icon) {
|
|
99
87
|
this.deprecationNotice.once();
|
|
@@ -110,6 +98,22 @@ let Icon = class Icon extends BasicElement {
|
|
|
110
98
|
this._template = value;
|
|
111
99
|
this.requestUpdate();
|
|
112
100
|
}
|
|
101
|
+
this.iconReady.resolve();
|
|
102
|
+
}
|
|
103
|
+
constructor() {
|
|
104
|
+
super();
|
|
105
|
+
this._icon = null;
|
|
106
|
+
/**
|
|
107
|
+
* Deprecation notice displays a warning message
|
|
108
|
+
* when deprecated features are used.
|
|
109
|
+
*/
|
|
110
|
+
this.deprecationNotice = new DeprecationNotice('`src` attribute and property are deprecated. Use `icon` attribute and property instead.');
|
|
111
|
+
this._src = null;
|
|
112
|
+
this._template = EmptyTemplate;
|
|
113
|
+
this.iconReady = new Deferred();
|
|
114
|
+
// `iconReady` resolves at this stage so that `updateComplete` would be resolvable
|
|
115
|
+
// even in the case that `icon` attribute is missing.
|
|
116
|
+
this.iconReady.resolve();
|
|
113
117
|
}
|
|
114
118
|
/**
|
|
115
119
|
* Check if the icon map configuration has content
|
|
@@ -131,12 +135,52 @@ let Icon = class Icon extends BasicElement {
|
|
|
131
135
|
*/
|
|
132
136
|
this.setPrefix();
|
|
133
137
|
}
|
|
138
|
+
async getUpdateComplete() {
|
|
139
|
+
const result = await super.getUpdateComplete();
|
|
140
|
+
await this.iconReady.promise;
|
|
141
|
+
return result;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* instantiate a new deferred promise for icon ready if it's not pending already
|
|
145
|
+
* @returns {void}
|
|
146
|
+
*/
|
|
147
|
+
deferIconReady() {
|
|
148
|
+
if (this.iconReady.isPending()) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
this.iconReady = new Deferred();
|
|
152
|
+
}
|
|
134
153
|
/**
|
|
135
|
-
*
|
|
154
|
+
* Check if the icon is valid to render
|
|
155
|
+
* @returns false if icon value or icon map value is invalid
|
|
156
|
+
*/
|
|
157
|
+
isIconValid() {
|
|
158
|
+
if (!this._icon) {
|
|
159
|
+
return false;
|
|
160
|
+
}
|
|
161
|
+
if (this.iconMap && !isBase64svg(this.iconMap) && !isUrl(this.iconMap)) {
|
|
162
|
+
return false;
|
|
163
|
+
}
|
|
164
|
+
return true;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Update the icon renderer
|
|
136
168
|
* @returns {void}
|
|
137
169
|
*/
|
|
138
|
-
|
|
139
|
-
|
|
170
|
+
updateRenderer() {
|
|
171
|
+
if (!this.isIconValid()) {
|
|
172
|
+
return this.clearIcon();
|
|
173
|
+
}
|
|
174
|
+
const iconProperty = this._icon;
|
|
175
|
+
if (this.iconMap) {
|
|
176
|
+
void this.loadAndRenderIcon(this.iconMap);
|
|
177
|
+
}
|
|
178
|
+
else if (isUrl(iconProperty) || IconLoader.isPrefixResolved) {
|
|
179
|
+
void this.loadAndRenderIcon(iconProperty);
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
void this.loadAndRenderSpriteIcon(iconProperty);
|
|
183
|
+
}
|
|
140
184
|
}
|
|
141
185
|
/**
|
|
142
186
|
* Tries to load an icon from the url provided
|
|
@@ -152,6 +196,20 @@ let Icon = class Icon extends BasicElement {
|
|
|
152
196
|
}
|
|
153
197
|
this.template = await iconTemplateCacheItem;
|
|
154
198
|
}
|
|
199
|
+
/**
|
|
200
|
+
* Tries to load get an icon from the sprite url provided
|
|
201
|
+
* and the renders this into the icon template.
|
|
202
|
+
* @param iconName Name of the svg icon.
|
|
203
|
+
* @returns {void}
|
|
204
|
+
*/
|
|
205
|
+
async loadAndRenderSpriteIcon(iconName) {
|
|
206
|
+
const iconTemplateCacheItem = iconTemplateCache.get(iconName);
|
|
207
|
+
if (!iconTemplateCacheItem) {
|
|
208
|
+
iconTemplateCache.set(iconName, SpriteLoader.loadSpriteSVG(iconName).then((body) => svg `${unsafeSVG(body)}`));
|
|
209
|
+
return this.loadAndRenderIcon(iconName); // Load again and await cache result
|
|
210
|
+
}
|
|
211
|
+
this.template = await iconTemplateCacheItem;
|
|
212
|
+
}
|
|
155
213
|
/**
|
|
156
214
|
* Get and cache CDN prefix
|
|
157
215
|
* This is a private URL which is set in the theme
|
|
@@ -159,10 +217,15 @@ let Icon = class Icon extends BasicElement {
|
|
|
159
217
|
* @returns {void}
|
|
160
218
|
*/
|
|
161
219
|
setPrefix() {
|
|
162
|
-
|
|
163
|
-
|
|
220
|
+
// This prefix for individual icons allows supporting custom prefix of self-managed icons.
|
|
221
|
+
if (IconLoader.isPrefixPending) {
|
|
222
|
+
const CDNPrefix = this.getComputedVariable('--cdn-prefix');
|
|
164
223
|
IconLoader.setCdnPrefix(CDNPrefix);
|
|
165
224
|
}
|
|
225
|
+
if (SpriteLoader.isPrefixPending) {
|
|
226
|
+
const CDNSpritePrefix = this.getComputedVariable('--cdn-sprite-prefix');
|
|
227
|
+
SpriteLoader.setCdnPrefix(CDNSpritePrefix);
|
|
228
|
+
}
|
|
166
229
|
}
|
|
167
230
|
/**
|
|
168
231
|
* Clears SVG body from the icon template
|
|
@@ -1 +1 @@
|
|
|
1
|
-
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-icon', styles: ':host{--cdn-prefix:\'https://cdn.refinitiv.net/public/libs/elf/assets/elf-theme-halo/resources/icons
|
|
1
|
+
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-icon', styles: ':host{--cdn-sprite-prefix:\'https://cdn.refinitiv.net/public/libs/elf/assets/elf-theme-halo/resources/sprites/icons.svg\';--cdn-sprite-prefix:\'https://cdn.refinitiv.net/public/libs/elf/assets/elf-theme-halo/resources/sprites/icons.svg\';font-size:16px}:host svg{pointer-events:none}:host circle[fill]:not([fill=none]),:host ellipse[fill]:not([fill=none]),:host g[fill]:not([fill=none]),:host line[fill]:not([fill=none]),:host path[fill]:not([fill=none]),:host polygon[fill]:not([fill=none]),:host polyline[fill]:not([fill=none]),:host rect[fill]:not([fill=none]){fill:currentColor}:host circle[stroke]:not([stroke=none]),:host ellipse[stroke]:not([stroke=none]),:host g[stroke]:not([stroke=none]),:host line[stroke]:not([stroke=none]),:host path[stroke]:not([stroke=none]),:host polygon[stroke]:not([stroke=none]),:host polyline[stroke]:not([stroke=none]),:host rect[stroke]:not([stroke=none]){stroke:currentColor}:host([icon=powerpoint]){color:#ff3535}:host([icon=excel]){color:#00a626}:host([icon=pdf]){color:#ff3535}:host([icon=word]){color:#0094c4}:host([icon=twitter]){color:#1da1f2}:host([focused=visible]){outline:#334bff solid 1px}:host([icon]) circle,:host([icon]) ellipse,:host([icon]) g,:host([icon]) line,:host([icon]) path,:host([icon]) polygon,:host([icon]) polyline,:host([icon]) rect{vector-effect:non-scaling-stroke}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){:host([icon]) circle,:host([icon]) ellipse,:host([icon]) g,:host([icon]) line,:host([icon]) path,:host([icon]) polygon,:host([icon]) polyline,:host([icon]) rect{vector-effect:none;stroke-width:calc(16px/.01em)}}' }}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-icon', styles: ':host{--cdn-prefix:\'https://cdn.refinitiv.net/public/libs/elf/assets/elf-theme-halo/resources/icons
|
|
1
|
+
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-icon', styles: ':host{--cdn-sprite-prefix:\'https://cdn.refinitiv.net/public/libs/elf/assets/elf-theme-halo/resources/sprites/icons.svg\';--cdn-sprite-prefix:\'https://cdn.refinitiv.net/public/libs/elf/assets/elf-theme-halo/resources/sprites/icons.svg\';font-size:16px}:host svg{pointer-events:none}:host circle[fill]:not([fill=none]),:host ellipse[fill]:not([fill=none]),:host g[fill]:not([fill=none]),:host line[fill]:not([fill=none]),:host path[fill]:not([fill=none]),:host polygon[fill]:not([fill=none]),:host polyline[fill]:not([fill=none]),:host rect[fill]:not([fill=none]){fill:currentColor}:host circle[stroke]:not([stroke=none]),:host ellipse[stroke]:not([stroke=none]),:host g[stroke]:not([stroke=none]),:host line[stroke]:not([stroke=none]),:host path[stroke]:not([stroke=none]),:host polygon[stroke]:not([stroke=none]),:host polyline[stroke]:not([stroke=none]),:host rect[stroke]:not([stroke=none]){stroke:currentColor}:host([icon=powerpoint]){color:#ff3535}:host([icon=excel]){color:#00a626}:host([icon=pdf]){color:#ff3535}:host([icon=word]){color:#0094c4}:host([icon=twitter]){color:#1da1f2}:host([focused=visible]){outline:#334bff solid 1px}:host([icon]) circle,:host([icon]) ellipse,:host([icon]) g,:host([icon]) line,:host([icon]) path,:host([icon]) polygon,:host([icon]) polyline,:host([icon]) rect{vector-effect:non-scaling-stroke}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){:host([icon]) circle,:host([icon]) ellipse,:host([icon]) g,:host([icon]) line,:host([icon]) path,:host([icon]) polygon,:host([icon]) polyline,:host([icon]) rect{vector-effect:none;stroke-width:calc(16px/.01em)}}' }}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-icon', styles: ':host{--cdn-prefix:\'https://cdn.refinitiv.net/public/libs/elf/assets/elf-theme-halo/resources/icons
|
|
1
|
+
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-icon', styles: ':host{--cdn-sprite-prefix:\'https://cdn.refinitiv.net/public/libs/elf/assets/elf-theme-halo/resources/sprites/icons.svg\';--cdn-sprite-prefix:\'https://cdn.refinitiv.net/public/libs/elf/assets/elf-theme-solar/resources/sprites/icons.svg\'}:host svg{pointer-events:none}:host circle[fill]:not([fill=none]),:host ellipse[fill]:not([fill=none]),:host g[fill]:not([fill=none]),:host line[fill]:not([fill=none]),:host path[fill]:not([fill=none]),:host polygon[fill]:not([fill=none]),:host polyline[fill]:not([fill=none]),:host rect[fill]:not([fill=none]){fill:currentColor}:host circle[stroke]:not([stroke=none]),:host ellipse[stroke]:not([stroke=none]),:host g[stroke]:not([stroke=none]),:host line[stroke]:not([stroke=none]),:host path[stroke]:not([stroke=none]),:host polygon[stroke]:not([stroke=none]),:host polyline[stroke]:not([stroke=none]),:host rect[stroke]:not([stroke=none]){stroke:currentColor}:host([icon=powerpoint]){color:#ff3535}:host([icon=excel]){color:#00a626}:host([icon=pdf]){color:#ff3535}:host([icon=word]){color:#0094c4}:host([icon=twitter]){color:#1da1f2}:host([focused=visible]){outline:#f93 solid 1px}' }}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-icon', styles: ':host{--cdn-prefix:\'https://cdn.refinitiv.net/public/libs/elf/assets/elf-theme-halo/resources/icons
|
|
1
|
+
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-icon', styles: ':host{--cdn-sprite-prefix:\'https://cdn.refinitiv.net/public/libs/elf/assets/elf-theme-halo/resources/sprites/icons.svg\';--cdn-sprite-prefix:\'https://cdn.refinitiv.net/public/libs/elf/assets/elf-theme-solar/resources/sprites/icons.svg\'}:host svg{pointer-events:none}:host circle[fill]:not([fill=none]),:host ellipse[fill]:not([fill=none]),:host g[fill]:not([fill=none]),:host line[fill]:not([fill=none]),:host path[fill]:not([fill=none]),:host polygon[fill]:not([fill=none]),:host polyline[fill]:not([fill=none]),:host rect[fill]:not([fill=none]){fill:currentColor}:host circle[stroke]:not([stroke=none]),:host ellipse[stroke]:not([stroke=none]),:host g[stroke]:not([stroke=none]),:host line[stroke]:not([stroke=none]),:host path[stroke]:not([stroke=none]),:host polygon[stroke]:not([stroke=none]),:host polyline[stroke]:not([stroke=none]),:host rect[stroke]:not([stroke=none]){stroke:currentColor}:host([icon=powerpoint]){color:#ff3535}:host([icon=excel]){color:#00a626}:host([icon=pdf]){color:#ff3535}:host([icon=word]){color:#0094c4}:host([icon=twitter]){color:#1da1f2}:host([focused=visible]){outline:#ffb266 solid 1px}' }}));
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SVGLoader } from '@refinitiv-ui/utils/loader.js';
|
|
2
|
+
/**
|
|
3
|
+
* Caches and provides sprite icon SVG
|
|
4
|
+
* Uses singleton pattern
|
|
5
|
+
*/
|
|
6
|
+
declare class SpriteLoader extends SVGLoader {
|
|
7
|
+
getSrc(): Promise<string>;
|
|
8
|
+
/**
|
|
9
|
+
* Load and Create DOM sprite SVG
|
|
10
|
+
* @returns returns the DOM sprite SVG
|
|
11
|
+
*/
|
|
12
|
+
private loadSprite;
|
|
13
|
+
/**
|
|
14
|
+
* Load and cache the DOM sprite svg
|
|
15
|
+
* Get an svg fragment of DOM sprite svg
|
|
16
|
+
* @param iconName Name of svg to load
|
|
17
|
+
* @returns returns the svg fragment body
|
|
18
|
+
*/
|
|
19
|
+
loadSpriteSVG(iconName: string): Promise<string | undefined>;
|
|
20
|
+
reset(): void;
|
|
21
|
+
}
|
|
22
|
+
declare const instance: SpriteLoader;
|
|
23
|
+
export { instance as SpriteLoader };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { SVGLoader } from '@refinitiv-ui/utils/loader.js';
|
|
2
|
+
let spriteCache;
|
|
3
|
+
/**
|
|
4
|
+
* Caches and provides sprite icon SVG
|
|
5
|
+
* Uses singleton pattern
|
|
6
|
+
*/
|
|
7
|
+
class SpriteLoader extends SVGLoader {
|
|
8
|
+
async getSrc() {
|
|
9
|
+
return await this.getCdnPrefix();
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Load and Create DOM sprite SVG
|
|
13
|
+
* @returns returns the DOM sprite SVG
|
|
14
|
+
*/
|
|
15
|
+
async loadSprite() {
|
|
16
|
+
const sprite = await this.loadSVG('sprite/icons');
|
|
17
|
+
if (!sprite) {
|
|
18
|
+
throw new Error("SpriteLoader: couldn't load SVG sprite source");
|
|
19
|
+
}
|
|
20
|
+
return new DOMParser().parseFromString(sprite, 'image/svg+xml');
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Load and cache the DOM sprite svg
|
|
24
|
+
* Get an svg fragment of DOM sprite svg
|
|
25
|
+
* @param iconName Name of svg to load
|
|
26
|
+
* @returns returns the svg fragment body
|
|
27
|
+
*/
|
|
28
|
+
async loadSpriteSVG(iconName) {
|
|
29
|
+
if (!spriteCache) {
|
|
30
|
+
spriteCache = this.loadSprite();
|
|
31
|
+
}
|
|
32
|
+
const sprite = await spriteCache;
|
|
33
|
+
const icon = sprite.getElementById(iconName);
|
|
34
|
+
return icon ? icon.outerHTML : undefined;
|
|
35
|
+
}
|
|
36
|
+
reset() {
|
|
37
|
+
super.reset();
|
|
38
|
+
spriteCache = undefined;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
const instance = new SpriteLoader();
|
|
42
|
+
export { instance as SpriteLoader };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import '@refinitiv-ui/elements/tooltip/themes/halo/dark';
|
|
2
|
-
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-interactive-chart', styles: ':host{--chart-color-1:#6678FF;--chart-color-2:#
|
|
2
|
+
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-interactive-chart', styles: ':host{--chart-color-1:#6678FF;--chart-color-2:#E6E6E6;--chart-color-3:#FFC800;--chart-color-4:#9064CD;--chart-color-5:#00D0D4;--chart-color-6:#FF5000;--chart-color-7:#00C389;--chart-color-8:#EA2E6C;--chart-color-9:#999999;--chart-color-10:#3BBAFF;--line-width:2;--fill-opacity:0.4;--text-color:rgba(204, 204, 204, 0.8);--background-color:#1A1A1A;--chart-up-color:#39C46E;--chart-down-color:#F5475B;--cross-hair-color:#CCCCCC;--grid-vert-line-color:rgba(38, 38, 38, 0.5);--grid-horz-line-color:rgba(38, 38, 38, 0.5);--scale-price-border-color:rgba(38, 38, 38, 0.5);--scale-times-border-color:rgba(38, 38, 38, 0.5)}:host [part=legend]{top:15px;color:var(--text-color);font-size:90%}:host [part=legend] .row{margin:1px 5px}:host [part=legend] .price{margin-right:5px}:host [part=legend] .ohlc{margin-right:2px}:host [part=legend].horizontal{display:flex;max-width:calc(100% - 75px);flex-wrap:wrap}:host [part=jump-button-container]{display:none;position:absolute;transition:background-color .1s;width:23px;height:23px;color:#ccc;border:1px solid #0d0d0d;box-shadow:0 0 0 0 rgba(0,0,0,.5);border-radius:100%;z-index:1000;cursor:pointer;background-color:#1a1a1a}:host [part=jump-button-container]:hover{color:#fff;border-color:#1429bd;box-shadow:0 0 0 0 rgba(0,0,0,.8);background-color:#343434}:host [part=jump-button-container]:active{color:#fff;box-shadow:0 0 0 0 rgba(0,0,0,.5);background-color:#1a1a1a}:host [part=jump-button]{position:relative;display:inline-block;width:5px;height:5px;border-top:2px solid #ccc;border-right:2px solid #ccc;transform:rotate(45deg) skew(0);margin-top:8px;margin-left:7px}:host [part=branding-container]{position:absolute;opacity:.6;bottom:3px;z-index:1000}:host [part=branding-container].left{left:10px}:host [part=branding-container].right{right:10px}:host [part=branding-container].none{top:13px;right:13px}:host [part=branding]{height:22px;width:22px;fill:rgba(204,204,204,.8)}:host [part=jump-button-container],:host [part=jump-button-container]:hover,:host [part=jump-button]{border-color:grey}' }}));
|
|
@@ -5,11 +5,9 @@ import { state } from '@refinitiv-ui/core/decorators/state.js';
|
|
|
5
5
|
import '@refinitiv-ui/phrasebook/locale/en/password-field.js';
|
|
6
6
|
import { translate } from '@refinitiv-ui/translate';
|
|
7
7
|
import { VISUALLY_HIDDEN_STYLE } from '@refinitiv-ui/utils/accessibility.js';
|
|
8
|
-
import { preload } from '../icon/index.js';
|
|
9
8
|
import '../icon/index.js';
|
|
10
9
|
import { TextField } from '../text-field/index.js';
|
|
11
10
|
import { deregisterOverflowTooltip } from '../tooltip/index.js';
|
|
12
|
-
let isEyeOffPreloadRequested = false;
|
|
13
11
|
/**
|
|
14
12
|
* A form control element for password.
|
|
15
13
|
*
|
|
@@ -75,10 +73,6 @@ let PasswordField = class PasswordField extends TextField {
|
|
|
75
73
|
*/
|
|
76
74
|
firstUpdated(changedProperties) {
|
|
77
75
|
super.firstUpdated(changedProperties);
|
|
78
|
-
if (!isEyeOffPreloadRequested) {
|
|
79
|
-
preload('eye-off');
|
|
80
|
-
isEyeOffPreloadRequested = true;
|
|
81
|
-
}
|
|
82
76
|
// password shouldn't display value on tooltip when value is overflow
|
|
83
77
|
deregisterOverflowTooltip(this);
|
|
84
78
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '@refinitiv-ui/elements/layout/themes/halo/dark';
|
|
2
2
|
import '@refinitiv-ui/elements/progress-bar/themes/halo/dark';
|
|
3
|
-
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-tornado-chart', styles: ':host{--primary-color:#6678FF;--secondary-color:#6678FF;--responsive-width:450;font-size:12px;--primary-color:#6678FF;--secondary-color:#
|
|
3
|
+
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-tornado-chart', styles: ':host{--primary-color:#6678FF;--secondary-color:#6678FF;--responsive-width:450;font-size:12px;--primary-color:#6678FF;--secondary-color:#E6E6E6}:host [part=legend]{display:flex;justify-content:flex-end;margin-bottom:25px}:host [part=legend-item]{display:inline-flex;overflow:hidden;align-items:center;margin-right:10px}:host [part=legend][vertical]{justify-content:flex-start;flex-wrap:wrap}:host [part=primary-symbol],:host [part=secondary-symbol]{flex:none;width:15px;height:15px;border-radius:1px;margin-right:5px}:host [part=primary-symbol]{background-color:var(--primary-color)}:host [part=secondary-symbol]{background-color:var(--secondary-color)}:host [part=primary-label],:host [part=secondary-label]{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}' }}));
|
|
4
4
|
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-tornado-item', styles: ':host{margin:0;padding:0 5px;--primary-color:var(\'--primary-color\', #6678FF);--secondary-color:var(\'--secondary-color\', #6678FF)}:host(:hover),:host([highlighted]){background-color:rgba(204,204,204,.05)}:host [part=label]{text-align:left;margin:0;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}:host [part=primary-bar],:host [part=secondary-bar]{width:100%;height:20px}:host [part=primary-bar]{color:var(--primary-color);margin-left:50px}:host [part=secondary-bar]{color:var(--secondary-color);margin-right:50px}:host [part=seperator]{height:30px;border-left:2px solid #404040}:host([vertical]){border-left:2px solid #404040;padding-bottom:5px}:host([vertical]) [part=label]{margin:3px}:host([vertical]) [part=seperator]{display:none}:host([vertical]) [part=container]{align-items:inherit}:host([vertical]) [part=primary-bar]{margin:0 50px 0 0}:host([vertical]) [part=secondary-bar]{margin:3px 50px 0 0}:host([highlighted]) [part=label],:host([highlighted]) [part=primary-bar],:host([highlighted]) [part=secondary-bar]{font-weight:600}' }}));
|
|
@@ -4,10 +4,8 @@ import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
|
|
|
4
4
|
import { property } from '@refinitiv-ui/core/decorators/property.js';
|
|
5
5
|
import '../../checkbox/index.js';
|
|
6
6
|
import '../../icon/index.js';
|
|
7
|
-
import { preload } from '../../icon/index.js';
|
|
8
7
|
import { VERSION } from '../../version.js';
|
|
9
8
|
import { CheckedState } from '../managers/tree-manager.js';
|
|
10
|
-
preload('right');
|
|
11
9
|
const emptyTemplate = html ``;
|
|
12
10
|
/**
|
|
13
11
|
* Displays a tree list item.
|
package/lib/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '6.
|
|
1
|
+
export const VERSION = '6.19.0';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@refinitiv-ui/elements",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.19.0",
|
|
4
4
|
"description": "Element Framework Elements",
|
|
5
5
|
"author": "LSEG",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -339,8 +339,8 @@
|
|
|
339
339
|
},
|
|
340
340
|
"dependencies": {
|
|
341
341
|
"@lit-labs/context": "^0.3.1",
|
|
342
|
-
"@refinitiv-ui/halo-theme": "^6.
|
|
343
|
-
"@refinitiv-ui/solar-theme": "^6.
|
|
342
|
+
"@refinitiv-ui/halo-theme": "^6.10.0",
|
|
343
|
+
"@refinitiv-ui/solar-theme": "^6.6.0",
|
|
344
344
|
"@types/chart.js": "^2.9.31",
|
|
345
345
|
"chart.js": "~2.9.4",
|
|
346
346
|
"d3-interpolate": "^3.0.1",
|
|
@@ -350,25 +350,25 @@
|
|
|
350
350
|
"tslib": "^2.3.1"
|
|
351
351
|
},
|
|
352
352
|
"devDependencies": {
|
|
353
|
-
"@refinitiv-ui/core": "^6.6.
|
|
354
|
-
"@refinitiv-ui/demo-block": "^6.1.
|
|
355
|
-
"@refinitiv-ui/i18n": "^6.0.
|
|
353
|
+
"@refinitiv-ui/core": "^6.6.1",
|
|
354
|
+
"@refinitiv-ui/demo-block": "^6.1.30",
|
|
355
|
+
"@refinitiv-ui/i18n": "^6.0.22",
|
|
356
356
|
"@refinitiv-ui/phrasebook": "^6.3.9",
|
|
357
|
-
"@refinitiv-ui/test-helpers": "^6.0
|
|
358
|
-
"@refinitiv-ui/translate": "^6.0.
|
|
359
|
-
"@refinitiv-ui/utils": "^6.
|
|
357
|
+
"@refinitiv-ui/test-helpers": "^6.1.0",
|
|
358
|
+
"@refinitiv-ui/translate": "^6.0.36",
|
|
359
|
+
"@refinitiv-ui/utils": "^6.4.0",
|
|
360
360
|
"@types/d3-interpolate": "^3.0.1"
|
|
361
361
|
},
|
|
362
362
|
"peerDependencies": {
|
|
363
363
|
"@refinitiv-ui/browser-sparkline": "^1.0.0 || ^2.0.0",
|
|
364
|
-
"@refinitiv-ui/core": "^6.6.
|
|
365
|
-
"@refinitiv-ui/i18n": "^6.0.
|
|
364
|
+
"@refinitiv-ui/core": "^6.6.1",
|
|
365
|
+
"@refinitiv-ui/i18n": "^6.0.22",
|
|
366
366
|
"@refinitiv-ui/phrasebook": "^6.3.9",
|
|
367
|
-
"@refinitiv-ui/translate": "^6.0.
|
|
368
|
-
"@refinitiv-ui/utils": "^6.
|
|
367
|
+
"@refinitiv-ui/translate": "^6.0.36",
|
|
368
|
+
"@refinitiv-ui/utils": "^6.4.0"
|
|
369
369
|
},
|
|
370
370
|
"publishConfig": {
|
|
371
371
|
"access": "public"
|
|
372
372
|
},
|
|
373
|
-
"gitHead": "
|
|
373
|
+
"gitHead": "1d093a683a9b34ed8d0cbfcf3c8e4e14361b787a"
|
|
374
374
|
}
|