@refinitiv-ui/elements 6.8.2 → 6.8.4-next.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 CHANGED
@@ -3,6 +3,14 @@
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.8.3](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@6.8.2...@refinitiv-ui/elements@6.8.3) (2023-06-06)
7
+
8
+ **Note:** Version bump only for package @refinitiv-ui/elements
9
+
10
+
11
+
12
+
13
+
6
14
  ## [6.8.2](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@6.8.1...@refinitiv-ui/elements@6.8.2) (2023-05-24)
7
15
 
8
16
 
@@ -0,0 +1,15 @@
1
+ {
2
+ "version": "experimental",
3
+ "tags": [
4
+ {
5
+ "name": "ef-configuration",
6
+ "properties": [
7
+ {
8
+ "name": "config",
9
+ "description": "Configuration data",
10
+ "default": "\"DEFAULT_CONFIG\""
11
+ }
12
+ ]
13
+ }
14
+ ]
15
+ }
@@ -0,0 +1,7 @@
1
+ # ef-configuration
2
+
3
+ ## Properties
4
+
5
+ | Property | Default | Description |
6
+ |----------|------------------|--------------------|
7
+ | `config` | "DEFAULT_CONFIG" | Configuration data |
@@ -0,0 +1,44 @@
1
+ import { JSXInterface } from '../../jsx';
2
+ import { BasicElement, TemplateResult } from '@refinitiv-ui/core';
3
+ import { type Config } from '../helpers/types.js';
4
+ export declare class Configuration extends BasicElement {
5
+ /**
6
+ * Element version number
7
+ * @returns version number
8
+ */
9
+ static get version(): string;
10
+ /**
11
+ * Render slot as light DOM
12
+ * @returns Element
13
+ */
14
+ protected createRenderRoot(): this;
15
+ /**
16
+ * Configuration data
17
+ */
18
+ config: Config;
19
+ /**
20
+ * A `TemplateResult` that will be used
21
+ * to render the updated internal template.
22
+ * @return Render template
23
+ */
24
+ protected render(): TemplateResult;
25
+ }
26
+ declare global {
27
+ interface HTMLElementTagNameMap {
28
+ 'ef-configuration': Configuration;
29
+ }
30
+ }
31
+
32
+ declare global {
33
+ interface HTMLElementTagNameMap {
34
+ 'ef-configuration': Configuration;
35
+ }
36
+
37
+ namespace JSX {
38
+ interface IntrinsicElements {
39
+ 'ef-configuration': Partial<Configuration> | JSXInterface.HTMLAttributes<Configuration>;
40
+ }
41
+ }
42
+ }
43
+
44
+ export {};
@@ -0,0 +1,46 @@
1
+ import { __decorate } from "tslib";
2
+ import { BasicElement, html } from '@refinitiv-ui/core';
3
+ import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
4
+ import { state } from '@refinitiv-ui/core/decorators/state.js';
5
+ import { VERSION } from '../../version.js';
6
+ import { efConfig, DEFAULT_CONFIG } from '../helpers/context.js';
7
+ import { provide } from '@lit-labs/context';
8
+ let Configuration = class Configuration extends BasicElement {
9
+ constructor() {
10
+ super(...arguments);
11
+ /**
12
+ * Configuration data
13
+ */
14
+ this.config = DEFAULT_CONFIG;
15
+ }
16
+ /**
17
+ * Element version number
18
+ * @returns version number
19
+ */
20
+ static get version() {
21
+ return VERSION;
22
+ }
23
+ /**
24
+ * Render slot as light DOM
25
+ * @returns Element
26
+ */
27
+ createRenderRoot() {
28
+ return this;
29
+ }
30
+ /**
31
+ * A `TemplateResult` that will be used
32
+ * to render the updated internal template.
33
+ * @return Render template
34
+ */
35
+ render() {
36
+ return html `<slot></slot>`;
37
+ }
38
+ };
39
+ __decorate([
40
+ provide({ context: efConfig }),
41
+ state()
42
+ ], Configuration.prototype, "config", void 0);
43
+ Configuration = __decorate([
44
+ customElement('ef-configuration', { theme: false })
45
+ ], Configuration);
46
+ export { Configuration };
@@ -0,0 +1,5 @@
1
+ import type { Config } from './types.js';
2
+ export declare const DEFAULT_CONFIG: Config;
3
+ export declare const efConfig: {
4
+ __context__: Config;
5
+ };
@@ -0,0 +1,3 @@
1
+ import { createContext } from '@lit-labs/context';
2
+ export const DEFAULT_CONFIG = { icon: { map: {} } };
3
+ export const efConfig = createContext('ef-configuration');
@@ -0,0 +1,9 @@
1
+ export type IconMap = {
2
+ [key: string]: string;
3
+ };
4
+ export type ConfigIcon = {
5
+ map: IconMap;
6
+ };
7
+ export type Config = {
8
+ icon: ConfigIcon;
9
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ export * from './elements/configuration.js';
2
+ export { efConfig } from './helpers/context.js';
3
+ export type { Config } from './helpers/types.js';
@@ -0,0 +1,2 @@
1
+ export * from './elements/configuration.js';
2
+ export { efConfig } from './helpers/context.js';
@@ -1,12 +1,18 @@
1
1
  import { JSXInterface } from '../jsx';
2
2
  import { BasicElement, CSSResultGroup, TemplateResult, PropertyValues } from '@refinitiv-ui/core';
3
3
  export { preload } from './utils/IconLoader.js';
4
+ import { type Config } from '../configuration/index.js';
4
5
  export declare class Icon extends BasicElement {
5
6
  /**
6
7
  * Element version number
7
8
  * @returns version number
8
9
  */
9
10
  static get version(): string;
11
+ /**
12
+ * Icon map from ef-configuration
13
+ * @ignore
14
+ */
15
+ config?: Config;
10
16
  /**
11
17
  * A `CSSResultGroup` that will be used
12
18
  * to style the host, slotted children
@@ -37,6 +43,11 @@ export declare class Icon extends BasicElement {
37
43
  */
38
44
  private get template();
39
45
  private set template(value);
46
+ /**
47
+ * Check if the icon map configuration has content
48
+ * @returns icon map if exists
49
+ */
50
+ private get iconMap();
40
51
  /**
41
52
  * Called after the component is first rendered
42
53
  * @param changedProperties Properties which have changed
package/lib/icon/index.js CHANGED
@@ -6,6 +6,8 @@ import { unsafeSVG } from '@refinitiv-ui/core/directives/unsafe-svg.js';
6
6
  import { VERSION } from '../version.js';
7
7
  import { IconLoader } from './utils/IconLoader.js';
8
8
  export { preload } from './utils/IconLoader.js';
9
+ import { consume } from '@lit-labs/context';
10
+ import { efConfig } from '../configuration/index.js';
9
11
  const EmptyTemplate = svg ``;
10
12
  /**
11
13
  * Cache for reusing SVG template results across multiple icons.
@@ -76,7 +78,10 @@ let Icon = class Icon extends BasicElement {
76
78
  if (this.src !== value) {
77
79
  this._src = value;
78
80
  this.clearIcon();
79
- if (value) {
81
+ if (this.icon && this.iconMap) {
82
+ void this.loadAndRenderIcon(this.iconMap);
83
+ }
84
+ else if (value) {
80
85
  void this.loadAndRenderIcon(value);
81
86
  }
82
87
  }
@@ -93,6 +98,13 @@ let Icon = class Icon extends BasicElement {
93
98
  this.requestUpdate();
94
99
  }
95
100
  }
101
+ /**
102
+ * Check if the icon map configuration has content
103
+ * @returns icon map if exists
104
+ */
105
+ get iconMap() {
106
+ return this.icon && this.config?.icon.map[this.icon] || null;
107
+ }
96
108
  /**
97
109
  * Called after the component is first rendered
98
110
  * @param changedProperties Properties which have changed
@@ -157,6 +169,9 @@ let Icon = class Icon extends BasicElement {
157
169
  return this.template;
158
170
  }
159
171
  };
172
+ __decorate([
173
+ consume({ context: efConfig, subscribe: true })
174
+ ], Icon.prototype, "config", void 0);
160
175
  __decorate([
161
176
  property({ type: String, reflect: true })
162
177
  ], Icon.prototype, "icon", null);
package/lib/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = '6.8.2';
1
+ export const VERSION = '6.8.4-next.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@refinitiv-ui/elements",
3
- "version": "6.8.2",
3
+ "version": "6.8.4-next.0",
4
4
  "description": "Element Framework Elements",
5
5
  "author": "LSEG",
6
6
  "license": "Apache-2.0",
@@ -105,6 +105,7 @@
105
105
  "./combo-box/themes/halo/light": "./lib/combo-box/themes/halo/light/index.js",
106
106
  "./combo-box/themes/solar/charcoal": "./lib/combo-box/themes/solar/charcoal/index.js",
107
107
  "./combo-box/themes/solar/pearl": "./lib/combo-box/themes/solar/pearl/index.js",
108
+ "./configuration": "./lib/configuration/index.js",
108
109
  "./counter": "./lib/counter/index.js",
109
110
  "./counter/themes/halo/dark": "./lib/counter/themes/halo/dark/index.js",
110
111
  "./counter/themes/halo/light": "./lib/counter/themes/halo/light/index.js",
@@ -336,9 +337,10 @@
336
337
  "version": "node ../../scripts/version"
337
338
  },
338
339
  "dependencies": {
340
+ "@lit-labs/context": "^0.3.1",
339
341
  "@refinitiv-ui/browser-sparkline": "1.1.8",
340
- "@refinitiv-ui/halo-theme": "^6.5.1",
341
- "@refinitiv-ui/solar-theme": "^6.3.3",
342
+ "@refinitiv-ui/halo-theme": "^6.5.2",
343
+ "@refinitiv-ui/solar-theme": "^6.3.4",
342
344
  "@types/chart.js": "^2.9.31",
343
345
  "chart.js": "~2.9.4",
344
346
  "d3-interpolate": "^3.0.1",
@@ -347,24 +349,24 @@
347
349
  "tslib": "^2.3.1"
348
350
  },
349
351
  "devDependencies": {
350
- "@refinitiv-ui/core": "^6.4.1",
351
- "@refinitiv-ui/demo-block": "^6.1.2",
352
+ "@refinitiv-ui/core": "^6.4.3-next.0",
353
+ "@refinitiv-ui/demo-block": "^6.1.4-next.0",
352
354
  "@refinitiv-ui/i18n": "^6.0.12",
353
355
  "@refinitiv-ui/phrasebook": "^6.3.1",
354
356
  "@refinitiv-ui/test-helpers": "^6.0.9",
355
- "@refinitiv-ui/translate": "^6.0.19",
356
- "@refinitiv-ui/utils": "^6.2.3",
357
+ "@refinitiv-ui/translate": "^6.0.21-next.0",
358
+ "@refinitiv-ui/utils": "^6.2.4-next.0",
357
359
  "@types/d3-interpolate": "^3.0.1"
358
360
  },
359
361
  "peerDependencies": {
360
- "@refinitiv-ui/core": "^6.4.1",
362
+ "@refinitiv-ui/core": "^6.4.3-next.0",
361
363
  "@refinitiv-ui/i18n": "^6.0.12",
362
364
  "@refinitiv-ui/phrasebook": "^6.3.1",
363
- "@refinitiv-ui/translate": "^6.0.19",
364
- "@refinitiv-ui/utils": "^6.2.3"
365
+ "@refinitiv-ui/translate": "^6.0.21-next.0",
366
+ "@refinitiv-ui/utils": "^6.2.4-next.0"
365
367
  },
366
368
  "publishConfig": {
367
369
  "access": "public"
368
370
  },
369
- "gitHead": "d67968e7ef1db2fe559c48f4c76be5302041c237"
371
+ "gitHead": "6192c3edb7df40bfd8782cef294c426dbb9ea9ac"
370
372
  }