@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.
Files changed (209) hide show
  1. package/CHANGELOG.md +180 -433
  2. package/LICENSE +1 -1
  3. package/README.md +13 -11
  4. package/lib/accordion/index.d.ts +1 -1
  5. package/lib/accordion/index.js +4 -7
  6. package/lib/appstate-bar/index.d.ts +2 -2
  7. package/lib/appstate-bar/index.js +10 -4
  8. package/lib/autosuggest/index.d.ts +7 -7
  9. package/lib/autosuggest/index.js +85 -80
  10. package/lib/autosuggest/themes/solar/charcoal/index.js +1 -1
  11. package/lib/autosuggest/themes/solar/pearl/index.js +1 -1
  12. package/lib/button/index.js +7 -10
  13. package/lib/button-bar/index.d.ts +1 -1
  14. package/lib/button-bar/index.js +12 -12
  15. package/lib/calendar/index.d.ts +39 -39
  16. package/lib/calendar/index.js +160 -125
  17. package/lib/calendar/utils.js +2 -2
  18. package/lib/canvas/index.d.ts +1 -1
  19. package/lib/canvas/index.js +2 -4
  20. package/lib/card/helpers/types.d.ts +2 -2
  21. package/lib/card/index.d.ts +5 -5
  22. package/lib/card/index.js +34 -28
  23. package/lib/chart/helpers/legend.js +10 -8
  24. package/lib/chart/index.d.ts +3 -3
  25. package/lib/chart/index.js +17 -17
  26. package/lib/chart/plugins/doughnut-center-label.js +6 -5
  27. package/lib/checkbox/index.d.ts +1 -1
  28. package/lib/checkbox/index.js +12 -13
  29. package/lib/clock/index.d.ts +55 -55
  30. package/lib/clock/index.js +84 -95
  31. package/lib/clock/themes/halo/dark/index.js +1 -1
  32. package/lib/clock/themes/halo/light/index.js +1 -1
  33. package/lib/clock/themes/solar/charcoal/index.js +1 -1
  34. package/lib/clock/themes/solar/pearl/index.js +1 -1
  35. package/lib/collapse/index.d.ts +1 -1
  36. package/lib/collapse/index.js +28 -19
  37. package/lib/collapse/themes/halo/dark/index.js +1 -1
  38. package/lib/collapse/themes/halo/light/index.js +1 -1
  39. package/lib/color-dialog/elements/color-palettes.d.ts +1 -1
  40. package/lib/color-dialog/elements/color-palettes.js +5 -6
  41. package/lib/color-dialog/elements/grayscale-palettes.d.ts +1 -1
  42. package/lib/color-dialog/elements/grayscale-palettes.js +9 -9
  43. package/lib/color-dialog/elements/palettes.js +5 -4
  44. package/lib/color-dialog/helpers/value-model.js +7 -9
  45. package/lib/color-dialog/index.d.ts +6 -6
  46. package/lib/color-dialog/index.js +53 -37
  47. package/lib/color-picker/index.d.ts +2 -2
  48. package/lib/color-picker/index.js +40 -34
  49. package/lib/combo-box/helpers/filter.d.ts +2 -2
  50. package/lib/combo-box/helpers/types.d.ts +1 -1
  51. package/lib/combo-box/index.d.ts +9 -9
  52. package/lib/combo-box/index.js +61 -55
  53. package/lib/configuration/elements/configuration.d.ts +1 -1
  54. package/lib/configuration/elements/configuration.js +2 -2
  55. package/lib/counter/index.d.ts +4 -4
  56. package/lib/counter/index.js +9 -7
  57. package/lib/datetime-field/index.d.ts +4 -5
  58. package/lib/datetime-field/index.js +32 -23
  59. package/lib/datetime-field/utils.js +11 -1
  60. package/lib/datetime-picker/index.d.ts +75 -75
  61. package/lib/datetime-picker/index.js +151 -132
  62. package/lib/datetime-picker/locales.js +5 -5
  63. package/lib/datetime-picker/utils.js +9 -9
  64. package/lib/dialog/draggable-element.js +1 -2
  65. package/lib/dialog/index.d.ts +6 -6
  66. package/lib/dialog/index.js +48 -38
  67. package/lib/email-field/index.d.ts +1 -1
  68. package/lib/email-field/index.js +6 -6
  69. package/lib/events.d.ts +1 -1
  70. package/lib/flag/index.d.ts +1 -1
  71. package/lib/flag/index.js +6 -5
  72. package/lib/flag/utils/FlagLoader.js +1 -1
  73. package/lib/header/index.d.ts +1 -1
  74. package/lib/header/index.js +2 -2
  75. package/lib/header/themes/halo/dark/index.js +1 -1
  76. package/lib/header/themes/halo/light/index.js +1 -1
  77. package/lib/header/themes/solar/charcoal/index.js +1 -1
  78. package/lib/header/themes/solar/pearl/index.js +1 -1
  79. package/lib/heatmap/helpers/color.d.ts +1 -1
  80. package/lib/heatmap/helpers/color.js +11 -5
  81. package/lib/heatmap/helpers/track.js +3 -3
  82. package/lib/heatmap/index.d.ts +9 -9
  83. package/lib/heatmap/index.js +51 -42
  84. package/lib/icon/index.d.ts +2 -2
  85. package/lib/icon/index.js +6 -8
  86. package/lib/icon/utils/IconLoader.d.ts +1 -0
  87. package/lib/icon/utils/IconLoader.js +9 -1
  88. package/lib/interactive-chart/helpers/types.d.ts +3 -3
  89. package/lib/interactive-chart/index.d.ts +34 -34
  90. package/lib/interactive-chart/index.js +72 -57
  91. package/lib/item/helpers/types.d.ts +1 -1
  92. package/lib/item/index.d.ts +3 -3
  93. package/lib/item/index.js +24 -20
  94. package/lib/jsx.d.ts +6 -4
  95. package/lib/label/index.d.ts +1 -1
  96. package/lib/label/index.js +11 -8
  97. package/lib/layout/index.d.ts +7 -7
  98. package/lib/layout/index.js +7 -7
  99. package/lib/led-gauge/index.d.ts +1 -1
  100. package/lib/led-gauge/index.js +10 -10
  101. package/lib/list/elements/list.d.ts +3 -3
  102. package/lib/list/elements/list.js +10 -12
  103. package/lib/list/helpers/renderer.js +2 -2
  104. package/lib/list/helpers/types.d.ts +1 -1
  105. package/lib/list/index.d.ts +1 -1
  106. package/lib/list/renderer.d.ts +7 -7
  107. package/lib/loader/index.js +7 -8
  108. package/lib/multi-input/index.d.ts +6 -6
  109. package/lib/multi-input/index.js +39 -45
  110. package/lib/notification/elements/notification-tray.d.ts +2 -2
  111. package/lib/notification/elements/notification-tray.js +3 -3
  112. package/lib/notification/elements/notification.d.ts +2 -2
  113. package/lib/notification/elements/notification.js +22 -14
  114. package/lib/notification/helpers/status.js +1 -1
  115. package/lib/number-field/index.d.ts +5 -6
  116. package/lib/number-field/index.js +37 -47
  117. package/lib/overlay/elements/overlay-viewport.d.ts +1 -1
  118. package/lib/overlay/elements/overlay.d.ts +2 -2
  119. package/lib/overlay/elements/overlay.js +154 -98
  120. package/lib/overlay/helpers/types.d.ts +1 -1
  121. package/lib/overlay/managers/backdrop-manager.d.ts +1 -1
  122. package/lib/overlay/managers/backdrop-manager.js +2 -2
  123. package/lib/overlay/managers/close-manager.js +2 -1
  124. package/lib/overlay/managers/focus-manager.js +23 -13
  125. package/lib/overlay/managers/interaction-lock-manager.d.ts +4 -4
  126. package/lib/overlay/managers/interaction-lock-manager.js +33 -25
  127. package/lib/overlay/managers/viewport-manager.d.ts +2 -2
  128. package/lib/overlay/managers/viewport-manager.js +3 -2
  129. package/lib/overlay/managers/zindex-manager.js +4 -2
  130. package/lib/overlay-menu/helpers/types.d.ts +2 -2
  131. package/lib/overlay-menu/index.d.ts +1 -1
  132. package/lib/overlay-menu/index.js +44 -33
  133. package/lib/overlay-menu/managers/menu-manager.d.ts +10 -10
  134. package/lib/overlay-menu/managers/menu-manager.js +15 -13
  135. package/lib/pagination/index.d.ts +4 -4
  136. package/lib/pagination/index.js +39 -14
  137. package/lib/panel/index.js +1 -1
  138. package/lib/password-field/index.d.ts +2 -2
  139. package/lib/password-field/index.js +4 -4
  140. package/lib/pill/index.d.ts +1 -1
  141. package/lib/pill/index.js +22 -19
  142. package/lib/progress-bar/index.d.ts +1 -1
  143. package/lib/progress-bar/index.js +38 -37
  144. package/lib/radio-button/index.d.ts +2 -2
  145. package/lib/radio-button/index.js +17 -12
  146. package/lib/radio-button/radio-button-registry.js +8 -5
  147. package/lib/rating/index.d.ts +1 -1
  148. package/lib/rating/index.js +2 -5
  149. package/lib/rating/utils.d.ts +6 -6
  150. package/lib/rating/utils.js +6 -6
  151. package/lib/search-field/index.d.ts +2 -2
  152. package/lib/search-field/index.js +4 -4
  153. package/lib/select/index.d.ts +34 -34
  154. package/lib/select/index.js +70 -83
  155. package/lib/sidebar-layout/index.d.ts +2 -2
  156. package/lib/sidebar-layout/index.js +7 -9
  157. package/lib/slider/index.d.ts +2 -2
  158. package/lib/slider/index.js +57 -45
  159. package/lib/slider/utils.d.ts +10 -10
  160. package/lib/slider/utils.js +10 -10
  161. package/lib/sparkline/index.d.ts +1 -1
  162. package/lib/sparkline/index.js +7 -8
  163. package/lib/swing-gauge/helpers.js +2 -2
  164. package/lib/swing-gauge/index.d.ts +19 -19
  165. package/lib/swing-gauge/index.js +91 -81
  166. package/lib/tab/index.d.ts +1 -1
  167. package/lib/tab/index.js +16 -27
  168. package/lib/tab/themes/halo/dark/index.js +1 -1
  169. package/lib/tab/themes/halo/light/index.js +1 -1
  170. package/lib/tab/themes/solar/charcoal/index.js +1 -1
  171. package/lib/tab/themes/solar/pearl/index.js +1 -1
  172. package/lib/tab-bar/helpers/animate.js +1 -1
  173. package/lib/tab-bar/index.d.ts +1 -1
  174. package/lib/tab-bar/index.js +34 -18
  175. package/lib/tab-bar/themes/halo/dark/index.js +1 -1
  176. package/lib/tab-bar/themes/halo/light/index.js +1 -1
  177. package/lib/text-field/index.d.ts +1 -1
  178. package/lib/text-field/index.js +36 -33
  179. package/lib/time-picker/index.d.ts +6 -6
  180. package/lib/time-picker/index.js +104 -90
  181. package/lib/toggle/index.d.ts +1 -1
  182. package/lib/toggle/index.js +4 -3
  183. package/lib/tooltip/elements/title-tooltip.js +2 -2
  184. package/lib/tooltip/index.d.ts +27 -27
  185. package/lib/tooltip/index.js +42 -38
  186. package/lib/tooltip/managers/tooltip-manager.d.ts +1 -1
  187. package/lib/tornado-chart/elements/tornado-chart.d.ts +1 -1
  188. package/lib/tornado-chart/elements/tornado-chart.js +1 -1
  189. package/lib/tornado-chart/elements/tornado-item.d.ts +2 -2
  190. package/lib/tornado-chart/elements/tornado-item.js +12 -10
  191. package/lib/tree/elements/tree-item.d.ts +3 -3
  192. package/lib/tree/elements/tree-item.js +21 -19
  193. package/lib/tree/elements/tree.d.ts +1 -1
  194. package/lib/tree/elements/tree.js +12 -11
  195. package/lib/tree/helpers/renderer.js +4 -3
  196. package/lib/tree/index.d.ts +1 -1
  197. package/lib/tree/managers/tree-manager.d.ts +1 -1
  198. package/lib/tree/managers/tree-manager.js +17 -18
  199. package/lib/tree/themes/solar/charcoal/index.js +1 -1
  200. package/lib/tree/themes/solar/pearl/index.js +1 -1
  201. package/lib/tree-select/index.d.ts +9 -9
  202. package/lib/tree-select/index.js +91 -82
  203. package/lib/tree-select/themes/halo/dark/index.js +1 -1
  204. package/lib/tree-select/themes/halo/light/index.js +1 -1
  205. package/lib/tree-select/themes/solar/charcoal/index.js +1 -1
  206. package/lib/tree-select/themes/solar/pearl/index.js +1 -1
  207. package/lib/version.js +1 -1
  208. package/package.json +16 -16
  209. package/tsconfig.tsbuildinfo +1 -1
@@ -3,16 +3,16 @@ import { 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 { query } from '@refinitiv-ui/core/decorators/query.js';
6
- import { VERSION } from '../version.js';
6
+ import '@refinitiv-ui/phrasebook/locale/en/dialog.js';
7
+ import { TranslatePropertyKey, translate } from '@refinitiv-ui/translate';
7
8
  import { isIE } from '@refinitiv-ui/utils/browser.js';
8
- import { deregister as draggableDeregister, register as draggableRegister } from './draggable-element.js';
9
- import { Overlay } from '../overlay/index.js';
9
+ import '../button/index.js';
10
+ import '../header/index.js';
10
11
  import '../icon/index.js';
12
+ import { Overlay } from '../overlay/index.js';
11
13
  import '../panel/index.js';
12
- import '../header/index.js';
13
- import '../button/index.js';
14
- import { translate, TranslatePropertyKey } from '@refinitiv-ui/translate';
15
- import '@refinitiv-ui/phrasebook/locale/en/dialog.js';
14
+ import { VERSION } from '../version.js';
15
+ import { deregister as draggableDeregister, register as draggableRegister } from './draggable-element.js';
16
16
  /**
17
17
  * Popup window, designed to contain and show any HTML content.
18
18
  * It provides modal and dragging functionality,
@@ -95,38 +95,38 @@ let Dialog = class Dialog extends Overlay {
95
95
  return [
96
96
  super.styles,
97
97
  css `
98
- :host {
99
- width: 400px;
100
- display: flex;
101
- flex-flow: column nowrap;
102
- flex-grow: 1;
103
- flex-shrink: 1;
104
- flex-basis: auto;
105
- }
98
+ :host {
99
+ width: 400px;
100
+ display: flex;
101
+ flex-flow: column nowrap;
102
+ flex-grow: 1;
103
+ flex-shrink: 1;
104
+ flex-basis: auto;
105
+ }
106
106
 
107
- [part=content] {
108
- flex: 1 1 auto;
109
- overflow-x: hidden;
110
- overflow-y: auto;
111
- -webkit-overflow-scrolling: touch;
112
- }
107
+ [part='content'] {
108
+ flex: 1 1 auto;
109
+ overflow-x: hidden;
110
+ overflow-y: auto;
111
+ -webkit-overflow-scrolling: touch;
112
+ }
113
113
 
114
- [part="default-buttons"] {
115
- display: flex;
116
- justify-content: flex-end;
117
- align-items: center;
118
- }
114
+ [part='default-buttons'] {
115
+ display: flex;
116
+ justify-content: flex-end;
117
+ align-items: center;
118
+ }
119
119
 
120
- [part=header],
121
- [part=footer] {
122
- flex: none;
123
- }
120
+ [part='header'],
121
+ [part='footer'] {
122
+ flex: none;
123
+ }
124
124
 
125
- [part=close] {
126
- flex: none;
127
- cursor: pointer;
128
- }
129
- `
125
+ [part='close'] {
126
+ flex: none;
127
+ cursor: pointer;
128
+ }
129
+ `
130
130
  ];
131
131
  }
132
132
  disconnectedCallback() {
@@ -159,8 +159,12 @@ let Dialog = class Dialog extends Overlay {
159
159
  */
160
160
  shouldUpdate(changedProperties) {
161
161
  const shouldUpdate = super.shouldUpdate(changedProperties);
162
- return shouldUpdate
163
- || ((changedProperties.has('draggable') || changedProperties.has('header') || changedProperties.has('noInteractionLock') || changedProperties.has(TranslatePropertyKey)) && this.opened);
162
+ return (shouldUpdate ||
163
+ ((changedProperties.has('draggable') ||
164
+ changedProperties.has('header') ||
165
+ changedProperties.has('noInteractionLock') ||
166
+ changedProperties.has(TranslatePropertyKey)) &&
167
+ this.opened));
164
168
  }
165
169
  /**
166
170
  * Compute property values that depend on other properties
@@ -331,7 +335,13 @@ let Dialog = class Dialog extends Overlay {
331
335
  get headerRegion() {
332
336
  return html `
333
337
  ${this.header === null ? this.t('HEADER') : this.header}
334
- <ef-icon aria-hidden="true" part="close" icon="cross" slot="right" @tap="${this.defaultCancel}"></ef-icon>
338
+ <ef-icon
339
+ aria-hidden="true"
340
+ part="close"
341
+ icon="cross"
342
+ slot="right"
343
+ @tap="${this.defaultCancel}"
344
+ ></ef-icon>
335
345
  `;
336
346
  }
337
347
  /**
@@ -1,8 +1,8 @@
1
1
  import { JSXInterface } from '../jsx';
2
2
  import { PropertyValues } from '@refinitiv-ui/core';
3
+ import { TemplateMap } from '@refinitiv-ui/core/directives/template-map.js';
3
4
  import '../icon/index.js';
4
5
  import { TextField } from '../text-field/index.js';
5
- import { TemplateMap } from '@refinitiv-ui/core/directives/template-map.js';
6
6
  /**
7
7
  * A form control element for email.
8
8
  *
@@ -62,9 +62,9 @@ let EmailField = class EmailField extends TextField {
62
62
  get decorateInputMap() {
63
63
  return {
64
64
  ...super.decorateInputMap,
65
- 'type': 'email',
66
- 'inputmode': 'email',
67
- 'multiple': this.multiple
65
+ type: 'email',
66
+ inputmode: 'email',
67
+ multiple: this.multiple
68
68
  };
69
69
  }
70
70
  /**
@@ -75,9 +75,9 @@ let EmailField = class EmailField extends TextField {
75
75
  /* istanbul ignore next */
76
76
  shouldValidateInput(changedProperties) {
77
77
  // TODO: This validation should be refactored
78
- return changedProperties.has('value')
79
- || changedProperties.has('multiple')
80
- || super.shouldValidateInput(changedProperties);
78
+ return (changedProperties.has('value') ||
79
+ changedProperties.has('multiple') ||
80
+ super.shouldValidateInput(changedProperties));
81
81
  }
82
82
  };
83
83
  __decorate([
package/lib/events.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { TapEvent, ResizeEvent, FocusedChangedEvent } from '@refinitiv-ui/core';
1
+ import type { FocusedChangedEvent, ResizeEvent, TapEvent } from '@refinitiv-ui/core';
2
2
  /**
3
3
  * Dispatched when `opened` state changes
4
4
  * Prevent default to stop opening/closing pipeline
@@ -1,5 +1,5 @@
1
1
  import { JSXInterface } from '../jsx';
2
- import { BasicElement, CSSResultGroup, TemplateResult, PropertyValues } from '@refinitiv-ui/core';
2
+ import { BasicElement, CSSResultGroup, PropertyValues, TemplateResult } from '@refinitiv-ui/core';
3
3
  export { preload } from './utils/FlagLoader.js';
4
4
  export declare class Flag extends BasicElement {
5
5
  /**
package/lib/flag/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { __decorate } from "tslib";
2
- import { BasicElement, svg, css, DeprecationNotice } from '@refinitiv-ui/core';
2
+ import { BasicElement, DeprecationNotice, css, svg } 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 { unsafeHTML } from '@refinitiv-ui/core/directives/unsafe-html.js';
@@ -57,9 +57,11 @@ let Flag = class Flag extends BasicElement {
57
57
  return this._flag;
58
58
  }
59
59
  set flag(value) {
60
- if (this.flag !== value) {
60
+ const oldValue = this._flag;
61
+ if (oldValue !== value) {
61
62
  this._flag = value;
62
63
  void this.setFlagSrc();
64
+ this.requestUpdate('flag', oldValue);
63
65
  }
64
66
  }
65
67
  /**
@@ -140,8 +142,7 @@ let Flag = class Flag extends BasicElement {
140
142
  */
141
143
  setPrefix() {
142
144
  if (!FlagLoader.isPrefixSet) {
143
- const CDNPrefix = this.getComputedVariable('--cdn-prefix')
144
- .replace(/^('|")|('|")$/g, '');
145
+ const CDNPrefix = this.getComputedVariable('--cdn-prefix').replace(/^('|")|('|")$/g, '');
145
146
  FlagLoader.setCdnPrefix(CDNPrefix);
146
147
  }
147
148
  }
@@ -162,7 +163,7 @@ let Flag = class Flag extends BasicElement {
162
163
  }
163
164
  };
164
165
  __decorate([
165
- property({ type: String })
166
+ property({ type: String, reflect: true })
166
167
  ], Flag.prototype, "flag", null);
167
168
  __decorate([
168
169
  property({ type: String })
@@ -15,5 +15,5 @@ export { flagLoaderInstance as FlagLoader };
15
15
  * @returns Array of promises, which will be resolved with SVG bodies.
16
16
  */
17
17
  export const preload = (...attrs) => {
18
- return attrs.map(flag => flagLoaderInstance.loadSVG(flag));
18
+ return attrs.map((flag) => flagLoaderInstance.loadSVG(flag));
19
19
  };
@@ -1,5 +1,5 @@
1
1
  import { JSXInterface } from '../jsx';
2
- import { BasicElement, TemplateResult, CSSResultGroup } from '@refinitiv-ui/core';
2
+ import { BasicElement, CSSResultGroup, TemplateResult } from '@refinitiv-ui/core';
3
3
  /**
4
4
  * Use to identify and separate different sections of a page.
5
5
  * Headers helps to organize the page layout content into
@@ -1,5 +1,5 @@
1
1
  import { __decorate } from "tslib";
2
- import { BasicElement, html, css } from '@refinitiv-ui/core';
2
+ import { BasicElement, 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';
@@ -40,7 +40,7 @@ let Header = class Header extends BasicElement {
40
40
  margin-bottom: 0;
41
41
  vertical-align: middle;
42
42
  }
43
- [part="label"] {
43
+ [part='label'] {
44
44
  text-align: inherit;
45
45
  }
46
46
  `;
@@ -1 +1 @@
1
- dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-header', styles: ':host{color:#ccc;padding:0 0 0 4px;height:28px;font-size:12px;font-family:inherit;white-space:nowrap;box-sizing:border-box;display:flex;align-items:center;overflow:hidden;background-color:#333;text-transform:uppercase}:host [part=spacer]{flex:none;width:4px}:host [part=label]{flex:1 1 auto;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin-right:8px}:host ::slotted(ef-button[transparent]){color:inherit!important}:host([level="1"]){background-color:#404040}:host([level="3"]){background-color:#262626}:host([level="4"]){background-color:#1a1a1a}' }}));
1
+ dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-header', styles: ':host{color:#ccc;padding:0 0 0 4px;height:28px;font-size:12px;font-family:inherit;white-space:nowrap;box-sizing:border-box;display:flex;align-items:center;overflow:hidden;background-color:#333;text-transform:uppercase}:host [part=spacer]{flex:none;width:4px}:host [part=label]{flex:1 1 auto;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin-right:8px}:host ::slotted(ef-button[transparent]){color:inherit!important}:host([level=\'1\']){background-color:#404040}:host([level=\'3\']){background-color:#262626}:host([level=\'4\']){background-color:#1a1a1a}' }}));
@@ -1 +1 @@
1
- dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-header', styles: ':host{color:#0d0d0d;padding:0 0 0 4px;height:28px;font-size:12px;font-family:inherit;white-space:nowrap;box-sizing:border-box;display:flex;align-items:center;overflow:hidden;background-color:#e6e6e6;text-transform:uppercase}:host [part=spacer]{flex:none;width:4px}:host [part=label]{flex:1 1 auto;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin-right:8px}:host ::slotted(ef-button[transparent]){color:inherit!important}:host([level="1"]){background-color:#d9d9d9}:host([level="3"]){background-color:#f2f2f2}:host([level="4"]){background-color:#fafafa}' }}));
1
+ dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-header', styles: ':host{color:#0d0d0d;padding:0 0 0 4px;height:28px;font-size:12px;font-family:inherit;white-space:nowrap;box-sizing:border-box;display:flex;align-items:center;overflow:hidden;background-color:#e6e6e6;text-transform:uppercase}:host [part=spacer]{flex:none;width:4px}:host [part=label]{flex:1 1 auto;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin-right:8px}:host ::slotted(ef-button[transparent]){color:inherit!important}:host([level=\'1\']){background-color:#d9d9d9}:host([level=\'3\']){background-color:#f2f2f2}:host([level=\'4\']){background-color:#fafafa}' }}));
@@ -1 +1 @@
1
- dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-header', styles: ':host{padding:0 0 0 5px;height:27px;font-size:14px;font-family:inherit;white-space:nowrap;box-sizing:border-box;display:flex;align-items:center;overflow:hidden;position:relative;color:#c2c2c2;background-color:#2e2e33}:host [part=spacer]{flex:none;width:5px}:host [part=label]{flex:1 1 auto;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin-right:10px;font-weight:600;text-transform:uppercase}:host ::slotted(ef-button[transparent]){color:inherit!important}:host([level="3"]) [part=label]{text-transform:none}:host([level="1"]){color:#e2e2e2;background-color:#4a4a52;background-image:linear-gradient(rgba(255,255,255,.03) 0,rgba(255,255,255,0) 100%)}:host([level="3"]){color:#8c8c8c;background-color:#212124}' }}));
1
+ dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-header', styles: ':host{padding:0 0 0 5px;height:27px;font-size:14px;font-family:inherit;white-space:nowrap;box-sizing:border-box;display:flex;align-items:center;overflow:hidden;position:relative;color:#c2c2c2;background-color:#2e2e33}:host [part=spacer]{flex:none;width:5px}:host [part=label]{flex:1 1 auto;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin-right:10px;font-weight:600;text-transform:uppercase}:host ::slotted(ef-button[transparent]){color:inherit!important}:host([level=\'3\']) [part=label]{text-transform:none}:host([level=\'1\']){color:#e2e2e2;background-color:#4a4a52;background-image:linear-gradient(rgba(255,255,255,.03) 0,rgba(255,255,255,0) 100%)}:host([level=\'3\']){color:#8c8c8c;background-color:#212124}' }}));
@@ -1 +1 @@
1
- dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-header', styles: ':host{padding:0 0 0 5px;height:27px;font-size:14px;font-family:inherit;white-space:nowrap;box-sizing:border-box;display:flex;align-items:center;overflow:hidden;position:relative;color:#505050;background-color:#d0d4db}:host [part=spacer]{flex:none;width:5px}:host [part=label]{flex:1 1 auto;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin-right:10px;font-weight:600;text-transform:uppercase}:host ::slotted(ef-button[transparent]){color:inherit!important}:host([level="3"]) [part=label]{text-transform:none}:host([level="1"]){color:#484848;background-color:#bec3cc;background-image:linear-gradient(rgba(255,255,255,.18) 0,rgba(255,255,255,0) 100%)}:host([level="3"]){color:#6e6e78;background-color:#e4e8ed}' }}));
1
+ dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-header', styles: ':host{padding:0 0 0 5px;height:27px;font-size:14px;font-family:inherit;white-space:nowrap;box-sizing:border-box;display:flex;align-items:center;overflow:hidden;position:relative;color:#505050;background-color:#d0d4db}:host [part=spacer]{flex:none;width:5px}:host [part=label]{flex:1 1 auto;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin-right:10px;font-weight:600;text-transform:uppercase}:host ::slotted(ef-button[transparent]){color:inherit!important}:host([level=\'3\']) [part=label]{text-transform:none}:host([level=\'1\']){color:#484848;background-color:#bec3cc;background-image:linear-gradient(rgba(255,255,255,.18) 0,rgba(255,255,255,0) 100%)}:host([level=\'3\']){color:#6e6e78;background-color:#e4e8ed}' }}));
@@ -1,5 +1,5 @@
1
- import { ColorCommonInstance } from '@refinitiv-ui/utils/color.js';
2
1
  import { interpolate } from 'd3-interpolate';
2
+ import { ColorCommonInstance } from '@refinitiv-ui/utils/color.js';
3
3
  /**
4
4
  * Check if the color is a light color
5
5
  * @param col color to check
@@ -1,6 +1,6 @@
1
1
  /* istanbul ignore file */
2
- import { color, rgb, hsl } from '@refinitiv-ui/utils/color.js';
3
2
  import { interpolate } from 'd3-interpolate';
3
+ import { color, hsl, rgb } from '@refinitiv-ui/utils/color.js';
4
4
  /**
5
5
  * Check if the color is a light color
6
6
  * @param col color to check
@@ -8,7 +8,7 @@ import { interpolate } from 'd3-interpolate';
8
8
  */
9
9
  const isLight = (col) => {
10
10
  const { r, g, b } = rgb(col);
11
- return ((r * 299 + g * 587 + b * 114) / 1000) > 128;
11
+ return (r * 299 + g * 587 + b * 114) / 1000 > 128;
12
12
  };
13
13
  /**
14
14
  * Brightens a color
@@ -58,9 +58,15 @@ const blend = (color1, color2, backgroundColor, amount) => {
58
58
  mixBlueComponent = !mixBlueComponent;
59
59
  }
60
60
  const factor = 1 - Math.abs(amount);
61
- const red = mixRedComponent ? Math.round(interpolate(primaryColor.r, secondaryColor.r)(factor)) : primaryColor.r;
62
- const green = mixGreenComponent ? Math.round(interpolate(primaryColor.g, secondaryColor.g)(factor)) : primaryColor.g;
63
- const blue = mixBlueComponent ? Math.round(interpolate(primaryColor.b, secondaryColor.b)(factor)) : primaryColor.b;
61
+ const red = mixRedComponent
62
+ ? Math.round(interpolate(primaryColor.r, secondaryColor.r)(factor))
63
+ : primaryColor.r;
64
+ const green = mixGreenComponent
65
+ ? Math.round(interpolate(primaryColor.g, secondaryColor.g)(factor))
66
+ : primaryColor.g;
67
+ const blue = mixBlueComponent
68
+ ? Math.round(interpolate(primaryColor.b, secondaryColor.b)(factor))
69
+ : primaryColor.b;
64
70
  return color(`rgb(${red}, ${green}, ${blue})`)?.toString() || '';
65
71
  };
66
72
  export { blend, brighten, darken, isLight, interpolate };
@@ -67,10 +67,10 @@ export class Track {
67
67
  this._laneStarts[0] = 0;
68
68
  if (trackSize && laneCount) {
69
69
  let start = 0;
70
- const laneSize = (trackSize / laneCount);
70
+ const laneSize = trackSize / laneCount;
71
71
  for (let i = 0; i < laneCount; ++i) {
72
72
  const end = start + laneSize;
73
- this._laneStarts[i] = (start | 0);
73
+ this._laneStarts[i] = start | 0;
74
74
  this._laneSizes[i] = (end | 0) - (start | 0);
75
75
  start = end;
76
76
  }
@@ -121,7 +121,7 @@ export class Track {
121
121
  */
122
122
  getContentSize(index) {
123
123
  const contentSize = this.getLaneSize(index) - this._margin - this._margin;
124
- return (contentSize > 0) ? contentSize : 0;
124
+ return contentSize > 0 ? contentSize : 0;
125
125
  }
126
126
  /**
127
127
  * Get content start position
@@ -1,8 +1,8 @@
1
1
  import { JSXInterface } from '../jsx';
2
- import { ResponsiveElement, TemplateResult, CSSResultGroup, PropertyValues } from '@refinitiv-ui/core';
2
+ import { CSSResultGroup, PropertyValues, ResponsiveElement, TemplateResult } from '@refinitiv-ui/core';
3
3
  import '../canvas/index.js';
4
4
  import '../tooltip/index.js';
5
- import type { HeatmapXAxis, HeatmapCell, HeatmapConfig, HeatmapYAxis, HeatmapCustomisableProperties, HeatmapTooltipCallback, HeatmapRenderCallback } from './helpers/types';
5
+ import type { HeatmapCell, HeatmapConfig, HeatmapCustomisableProperties, HeatmapRenderCallback, HeatmapTooltipCallback, HeatmapXAxis, HeatmapYAxis } from './helpers/types';
6
6
  export type { HeatmapXAxis, HeatmapCell, HeatmapConfig, HeatmapYAxis, HeatmapCustomisableProperties, HeatmapTooltipCallback, HeatmapRenderCallback };
7
7
  /**
8
8
  * A graphical representation of data where the individual
@@ -239,9 +239,9 @@ export declare class Heatmap extends ResponsiveElement {
239
239
  */
240
240
  private initialiseRowTrack;
241
241
  /**
242
- * Initialize column track
243
- * @returns {void}
244
- */
242
+ * Initialize column track
243
+ * @returns {void}
244
+ */
245
245
  private initialiseColumnTrack;
246
246
  /**
247
247
  * Hit testing on heatmap
@@ -404,10 +404,10 @@ export declare class Heatmap extends ResponsiveElement {
404
404
  */
405
405
  private paintAllCellBackground;
406
406
  /**
407
- * Paints a single cell background colour
408
- * @param {HeatmapCell} cell cell to paint
409
- * @returns {void}
410
- */
407
+ * Paints a single cell background colour
408
+ * @param {HeatmapCell} cell cell to paint
409
+ * @returns {void}
410
+ */
411
411
  private paintCellBackground;
412
412
  /**
413
413
  * Construct and renders x-axis
@@ -1,16 +1,16 @@
1
1
  import { __decorate } from "tslib";
2
- import { ResponsiveElement, html, css } from '@refinitiv-ui/core';
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 { query } from '@refinitiv-ui/core/decorators/query.js';
6
- import { VERSION } from '../version.js';
7
6
  import { MicroTaskRunner } from '@refinitiv-ui/utils/async.js';
8
7
  import { color } from '@refinitiv-ui/utils/color.js';
9
8
  import '../canvas/index.js';
10
9
  import '../tooltip/index.js';
10
+ import { VERSION } from '../version.js';
11
+ import { blend, brighten, darken, interpolate, isLight } from './helpers/color.js';
12
+ import { MIN_FONT_SIZE, getMaximumTextWidth, getResponsiveFontSize } from './helpers/text.js';
11
13
  import { Track } from './helpers/track.js';
12
- import { blend, brighten, darken, isLight, interpolate } from './helpers/color.js';
13
- import { getResponsiveFontSize, getMaximumTextWidth, MIN_FONT_SIZE } from './helpers/text.js';
14
14
  const CELL_PADDING = 0.12;
15
15
  const CELL_MAX_TEXT_WIDTH = 1 - CELL_PADDING;
16
16
  const DEFAULT_CANVAS_RATIO = 0.75; // ratio — 4:3
@@ -37,13 +37,13 @@ let Heatmap = class Heatmap extends ResponsiveElement {
37
37
  :host {
38
38
  display: block;
39
39
  }
40
- #container{
40
+ #container {
41
41
  width: 100%;
42
42
  height: 100%;
43
43
  display: flex;
44
44
  }
45
45
  #canvas-container {
46
- min-width:0;
46
+ min-width: 0;
47
47
  display: flex;
48
48
  width: 100%;
49
49
  flex-direction: column;
@@ -52,14 +52,14 @@ let Heatmap = class Heatmap extends ResponsiveElement {
52
52
  #tooltip-overlay {
53
53
  position: absolute;
54
54
  }
55
- [part=canvas] {
55
+ [part='canvas'] {
56
56
  flex-grow: 1;
57
57
  }
58
- [part=x-axis] {
58
+ [part='x-axis'] {
59
59
  display: flex;
60
60
  align-items: center;
61
61
  }
62
- [part=y-axis]{
62
+ [part='y-axis'] {
63
63
  display: flex;
64
64
  flex-direction: column;
65
65
  }
@@ -134,7 +134,7 @@ let Heatmap = class Heatmap extends ResponsiveElement {
134
134
  */
135
135
  get columnCount() {
136
136
  let result = 0;
137
- this.rows?.forEach(columns => {
137
+ this.rows?.forEach((columns) => {
138
138
  if (columns.length > result) {
139
139
  result = columns.length;
140
140
  }
@@ -268,14 +268,14 @@ let Heatmap = class Heatmap extends ResponsiveElement {
268
268
  this.labelHiddenChanged();
269
269
  }
270
270
  // Re-paints whole canvas when at least one of the following properties changes
271
- if (changedProperties.has('config')
272
- || changedProperties.has('blend')
273
- || changedProperties.has('minPoint')
274
- || changedProperties.has('midPoint')
275
- || changedProperties.has('maxPoint')
276
- || changedProperties.has('saturation')
277
- || changedProperties.has('axisHidden')
278
- || changedProperties.has('labelWidth')) {
271
+ if (changedProperties.has('config') ||
272
+ changedProperties.has('blend') ||
273
+ changedProperties.has('minPoint') ||
274
+ changedProperties.has('midPoint') ||
275
+ changedProperties.has('maxPoint') ||
276
+ changedProperties.has('saturation') ||
277
+ changedProperties.has('axisHidden') ||
278
+ changedProperties.has('labelWidth')) {
279
279
  this.prepareAndPaint();
280
280
  }
281
281
  }
@@ -293,7 +293,8 @@ let Heatmap = class Heatmap extends ResponsiveElement {
293
293
  */
294
294
  /* istanbul ignore next */
295
295
  onMouseMove(event) {
296
- if (event.composedPath().includes(this.canvas) || this.tooltipCallback && this.tooltipOverlay === event.target) {
296
+ if (event.composedPath().includes(this.canvas) ||
297
+ (this.tooltipCallback && this.tooltipOverlay === event.target)) {
297
298
  this.hoverCell = this.hitTest(event);
298
299
  }
299
300
  else {
@@ -348,9 +349,9 @@ let Heatmap = class Heatmap extends ResponsiveElement {
348
349
  this.rowTrack.margin = this.cellMargin;
349
350
  }
350
351
  /**
351
- * Initialize column track
352
- * @returns {void}
353
- */
352
+ * Initialize column track
353
+ * @returns {void}
354
+ */
354
355
  initialiseColumnTrack() {
355
356
  this.colTrack.init(this.offsetWidth, this.columnCount);
356
357
  this.colTrack.margin = this.cellMargin;
@@ -635,7 +636,7 @@ let Heatmap = class Heatmap extends ResponsiveElement {
635
636
  const label = typeof cell.customLabel === 'string' ? cell.customLabel : cell.label;
636
637
  if (this.canvasContext) {
637
638
  this.canvasContext.fillStyle = cell.customForegroundColor || cell.foregroundColor;
638
- this.canvasContext.fillText(label || '', cell.x + cell.width / 2, (cell.y + 1 + cell.height / 2) + margin);
639
+ this.canvasContext.fillText(label || '', cell.x + cell.width / 2, cell.y + 1 + cell.height / 2 + margin);
639
640
  }
640
641
  }
641
642
  /**
@@ -660,12 +661,15 @@ let Heatmap = class Heatmap extends ResponsiveElement {
660
661
  canvas.textAlign = 'center';
661
662
  canvas.textBaseline = 'middle';
662
663
  canvas.font = `${fontSize}px ${fontFamily}`;
663
- let isWithinMinCellWidth = ((this.labelWidth || getMaximumTextWidth(canvas, this.cells, this.hasCellHeader)) / contentWidth) <= CELL_MAX_TEXT_WIDTH;
664
+ let isWithinMinCellWidth = (this.labelWidth || getMaximumTextWidth(canvas, this.cells, this.hasCellHeader)) / contentWidth <=
665
+ CELL_MAX_TEXT_WIDTH;
664
666
  // Tries to get the largest possible font size that is within `CELL_MAX_TEXT_WIDTH`
665
667
  if (!isWithinMinCellWidth && fontSize !== MIN_FONT_SIZE) {
666
668
  while (!isWithinMinCellWidth) {
667
669
  canvas.font = `${fontSize}px ${fontFamily}`; // Should assigned new font size to canvas before calculated again.
668
- isWithinMinCellWidth = ((this.labelWidth || getMaximumTextWidth(canvas, this.cells, this.hasCellHeader)) / contentWidth) <= CELL_MAX_TEXT_WIDTH;
670
+ isWithinMinCellWidth =
671
+ (this.labelWidth || getMaximumTextWidth(canvas, this.cells, this.hasCellHeader)) / contentWidth <=
672
+ CELL_MAX_TEXT_WIDTH;
669
673
  // Stops when reaches minimum font-size
670
674
  if (fontSize === MIN_FONT_SIZE) {
671
675
  break;
@@ -675,7 +679,9 @@ let Heatmap = class Heatmap extends ResponsiveElement {
675
679
  }
676
680
  }
677
681
  }
678
- const isWithinMinCellHeight = this.hasCellHeader ? (fontSize * 2) < contentHeight : fontSize < contentHeight;
682
+ const isWithinMinCellHeight = this.hasCellHeader
683
+ ? fontSize * 2 < contentHeight
684
+ : fontSize < contentHeight;
679
685
  this.contentWithinCellBoundary = isWithinMinCellWidth && isWithinMinCellHeight;
680
686
  return this.contentWithinCellBoundary;
681
687
  }
@@ -727,10 +733,10 @@ let Heatmap = class Heatmap extends ResponsiveElement {
727
733
  }
728
734
  const saturateRatio = 1 - saturation;
729
735
  if (value > this.midPoint) {
730
- return ((value - this.midPoint) / (this.maxPoint - this.midPoint) * saturateRatio) + saturation;
736
+ return ((value - this.midPoint) / (this.maxPoint - this.midPoint)) * saturateRatio + saturation;
731
737
  }
732
738
  else {
733
- return ((value - this.midPoint) / (this.midPoint - this.minPoint) * saturateRatio) - saturation;
739
+ return ((value - this.midPoint) / (this.midPoint - this.minPoint)) * saturateRatio - saturation;
734
740
  }
735
741
  }
736
742
  /**
@@ -783,7 +789,7 @@ let Heatmap = class Heatmap extends ResponsiveElement {
783
789
  const margin = this.labelHidden ? 0 : this.calculateHeaderMargin(cell.height);
784
790
  this.canvasContext.font = 'bold ' + labelFontStyle;
785
791
  this.canvasContext.fillStyle = cell.customForegroundColor || cell.foregroundColor;
786
- this.canvasContext.fillText(cell.header || '', cell.x + cell.width / 2, (cell.y + 1 + cell.height / 2) - margin);
792
+ this.canvasContext.fillText(cell.header || '', cell.x + cell.width / 2, cell.y + 1 + cell.height / 2 - margin);
787
793
  // Reverts font style to paint label correctly
788
794
  this.canvasContext.font = labelFontStyle;
789
795
  }
@@ -823,10 +829,10 @@ let Heatmap = class Heatmap extends ResponsiveElement {
823
829
  }
824
830
  }
825
831
  /**
826
- * Paints a single cell background colour
827
- * @param {HeatmapCell} cell cell to paint
828
- * @returns {void}
829
- */
832
+ * Paints a single cell background colour
833
+ * @param {HeatmapCell} cell cell to paint
834
+ * @returns {void}
835
+ */
830
836
  paintCellBackground(cell) {
831
837
  if (this.canvasContext) {
832
838
  this.canvasContext.fillStyle = cell.customBackgroundColor || cell.backgroundColor;
@@ -947,7 +953,7 @@ let Heatmap = class Heatmap extends ResponsiveElement {
947
953
  yAxisElement.removeChild(yAxisElement.lastChild);
948
954
  }
949
955
  }
950
- this.rowTrack.init(this.offsetHeight - (this.crossBox.offsetHeight + (this.cellMargin * 2)), this.rowCount);
956
+ this.rowTrack.init(this.offsetHeight - (this.crossBox.offsetHeight + this.cellMargin * 2), this.rowCount);
951
957
  // Clear yAxis element before re-create yAxis
952
958
  while (yAxisElement.children.length > laneCount) {
953
959
  if (yAxisElement.lastChild) {
@@ -1011,20 +1017,23 @@ let Heatmap = class Heatmap extends ResponsiveElement {
1011
1017
  render() {
1012
1018
  return html `
1013
1019
  <div id="container" @mousemove=${this.onMouseMove} @mouseleave=${this.onMouseLeave}>
1014
- ${this.config?.yAxis && !this.axisHidden ? html `
1015
- <div id="y-axis-container">
1016
- <div part="cross-box"></div>
1017
- <div part="y-axis"></div>
1018
- </div>` : null}
1020
+ ${this.config?.yAxis && !this.axisHidden
1021
+ ? html ` <div id="y-axis-container">
1022
+ <div part="cross-box"></div>
1023
+ <div part="y-axis"></div>
1024
+ </div>`
1025
+ : null}
1019
1026
  <div id="canvas-container">
1020
1027
  ${this.config?.xAxis && !this.axisHidden ? html `<div part="x-axis"></div>` : null}
1021
1028
  <ef-canvas part="canvas" @resize=${this.onCanvasResize}></ef-canvas>
1022
1029
  ${this.tooltipCallback ? html `<div id="tooltip-overlay"></div>` : null}
1023
1030
  </div>
1024
1031
  </div>
1025
- ${this.tooltipCallback ? html `
1026
- <ef-tooltip .condition=${this.tooltipCondition} .renderer=${this.tooltipRenderer}></ef-tooltip>
1027
- ` : null}
1032
+ ${this.tooltipCallback
1033
+ ? html `
1034
+ <ef-tooltip .condition=${this.tooltipCondition} .renderer=${this.tooltipRenderer}></ef-tooltip>
1035
+ `
1036
+ : null}
1028
1037
  `;
1029
1038
  }
1030
1039
  };
@@ -1,7 +1,7 @@
1
1
  import { JSXInterface } from '../jsx';
2
- import { BasicElement, CSSResultGroup, TemplateResult, PropertyValues } from '@refinitiv-ui/core';
2
+ import { BasicElement, CSSResultGroup, PropertyValues, TemplateResult } from '@refinitiv-ui/core';
3
+ import type { Config } from '../configuration/index.js';
3
4
  export { preload } from './utils/IconLoader.js';
4
- import { type Config } from '../configuration/index.js';
5
5
  export declare class Icon extends BasicElement {
6
6
  /**
7
7
  * Element version number