@refinitiv-ui/elements 7.0.0 → 7.0.2

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 (215) hide show
  1. package/CHANGELOG.md +195 -449
  2. package/LICENSE +2 -2
  3. package/README.md +12 -10
  4. package/cli.mjs +5 -3
  5. package/lib/accordion/index.d.ts +1 -1
  6. package/lib/accordion/index.js +4 -7
  7. package/lib/appstate-bar/index.d.ts +2 -2
  8. package/lib/appstate-bar/index.js +10 -4
  9. package/lib/autosuggest/index.d.ts +7 -7
  10. package/lib/autosuggest/index.js +80 -80
  11. package/lib/autosuggest/themes/solar/charcoal/index.js +1 -1
  12. package/lib/autosuggest/themes/solar/pearl/index.js +1 -1
  13. package/lib/button/index.js +7 -10
  14. package/lib/button-bar/index.d.ts +1 -1
  15. package/lib/button-bar/index.js +12 -12
  16. package/lib/calendar/index.d.ts +39 -39
  17. package/lib/calendar/index.js +156 -123
  18. package/lib/calendar/utils.js +1 -1
  19. package/lib/canvas/index.d.ts +1 -1
  20. package/lib/canvas/index.js +2 -4
  21. package/lib/card/helpers/types.d.ts +2 -2
  22. package/lib/card/index.d.ts +5 -5
  23. package/lib/card/index.js +34 -28
  24. package/lib/chart/elements/chart.d.ts +4 -4
  25. package/lib/chart/elements/chart.js +39 -33
  26. package/lib/chart/plugins/doughnut-center-label.d.ts +3 -3
  27. package/lib/chart/plugins/doughnut-center-label.js +13 -9
  28. package/lib/checkbox/index.d.ts +1 -1
  29. package/lib/checkbox/index.js +12 -13
  30. package/lib/clock/index.d.ts +55 -55
  31. package/lib/clock/index.js +84 -95
  32. package/lib/clock/themes/halo/dark/index.js +1 -1
  33. package/lib/clock/themes/halo/light/index.js +1 -1
  34. package/lib/clock/themes/solar/charcoal/index.js +1 -1
  35. package/lib/clock/themes/solar/pearl/index.js +1 -1
  36. package/lib/collapse/index.d.ts +1 -1
  37. package/lib/collapse/index.js +27 -18
  38. package/lib/collapse/themes/halo/dark/index.js +1 -1
  39. package/lib/collapse/themes/halo/light/index.js +1 -1
  40. package/lib/color-dialog/elements/color-palettes.d.ts +1 -1
  41. package/lib/color-dialog/elements/color-palettes.js +5 -6
  42. package/lib/color-dialog/elements/grayscale-palettes.d.ts +1 -1
  43. package/lib/color-dialog/elements/grayscale-palettes.js +9 -9
  44. package/lib/color-dialog/elements/palettes.js +5 -4
  45. package/lib/color-dialog/helpers/value-model.js +7 -9
  46. package/lib/color-dialog/index.d.ts +6 -6
  47. package/lib/color-dialog/index.js +53 -37
  48. package/lib/color-picker/index.d.ts +2 -2
  49. package/lib/color-picker/index.js +40 -34
  50. package/lib/combo-box/helpers/filter.d.ts +2 -2
  51. package/lib/combo-box/helpers/types.d.ts +1 -1
  52. package/lib/combo-box/index.d.ts +9 -9
  53. package/lib/combo-box/index.js +61 -55
  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 +150 -131
  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 +5 -5
  66. package/lib/dialog/index.js +51 -47
  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 +8 -10
  86. package/lib/interactive-chart/helpers/types.d.ts +3 -3
  87. package/lib/interactive-chart/index.d.ts +29 -29
  88. package/lib/interactive-chart/index.js +69 -55
  89. package/lib/item/helpers/types.d.ts +1 -1
  90. package/lib/item/index.d.ts +3 -3
  91. package/lib/item/index.js +24 -20
  92. package/lib/jsx.d.ts +6 -4
  93. package/lib/label/index.d.ts +1 -1
  94. package/lib/label/index.js +10 -7
  95. package/lib/layout/index.d.ts +7 -7
  96. package/lib/layout/index.js +7 -7
  97. package/lib/led-gauge/index.d.ts +1 -1
  98. package/lib/led-gauge/index.js +10 -10
  99. package/lib/list/elements/list.d.ts +3 -3
  100. package/lib/list/elements/list.js +10 -12
  101. package/lib/list/helpers/renderer.js +2 -2
  102. package/lib/list/helpers/types.d.ts +1 -1
  103. package/lib/list/index.d.ts +1 -1
  104. package/lib/list/renderer.d.ts +7 -7
  105. package/lib/loader/index.js +7 -8
  106. package/lib/multi-input/index.d.ts +6 -6
  107. package/lib/multi-input/index.js +39 -45
  108. package/lib/notification/elements/notification-tray.d.ts +2 -2
  109. package/lib/notification/elements/notification-tray.js +3 -3
  110. package/lib/notification/elements/notification.d.ts +2 -2
  111. package/lib/notification/elements/notification.js +14 -13
  112. package/lib/notification/helpers/status.js +1 -1
  113. package/lib/notification/themes/halo/dark/index.js +1 -1
  114. package/lib/notification/themes/halo/light/index.js +1 -1
  115. package/lib/notification/themes/solar/charcoal/index.js +1 -1
  116. package/lib/notification/themes/solar/pearl/index.js +1 -1
  117. package/lib/number-field/index.d.ts +5 -6
  118. package/lib/number-field/index.js +37 -47
  119. package/lib/overlay/elements/overlay-viewport.d.ts +1 -1
  120. package/lib/overlay/elements/overlay.d.ts +2 -2
  121. package/lib/overlay/elements/overlay.js +152 -96
  122. package/lib/overlay/helpers/types.d.ts +1 -1
  123. package/lib/overlay/managers/backdrop-manager.d.ts +1 -1
  124. package/lib/overlay/managers/backdrop-manager.js +2 -2
  125. package/lib/overlay/managers/close-manager.js +2 -1
  126. package/lib/overlay/managers/focus-manager.js +23 -13
  127. package/lib/overlay/managers/interaction-lock-manager.d.ts +4 -4
  128. package/lib/overlay/managers/interaction-lock-manager.js +33 -25
  129. package/lib/overlay/managers/viewport-manager.d.ts +2 -2
  130. package/lib/overlay/managers/viewport-manager.js +3 -2
  131. package/lib/overlay/managers/zindex-manager.js +4 -2
  132. package/lib/overlay-menu/helpers/types.d.ts +2 -2
  133. package/lib/overlay-menu/index.d.ts +1 -1
  134. package/lib/overlay-menu/index.js +44 -33
  135. package/lib/overlay-menu/managers/menu-manager.d.ts +10 -10
  136. package/lib/overlay-menu/managers/menu-manager.js +14 -13
  137. package/lib/pagination/index.d.ts +4 -4
  138. package/lib/pagination/index.js +39 -14
  139. package/lib/panel/index.js +1 -1
  140. package/lib/password-field/index.d.ts +2 -2
  141. package/lib/password-field/index.js +3 -3
  142. package/lib/pill/index.d.ts +1 -1
  143. package/lib/pill/index.js +22 -19
  144. package/lib/progress-bar/index.d.ts +1 -1
  145. package/lib/progress-bar/index.js +38 -37
  146. package/lib/radio-button/index.d.ts +2 -2
  147. package/lib/radio-button/index.js +17 -12
  148. package/lib/radio-button/radio-button-registry.js +8 -5
  149. package/lib/rating/index.d.ts +1 -1
  150. package/lib/rating/index.js +2 -5
  151. package/lib/rating/utils.d.ts +6 -6
  152. package/lib/rating/utils.js +6 -6
  153. package/lib/search-field/index.d.ts +2 -2
  154. package/lib/search-field/index.js +4 -4
  155. package/lib/select/index.d.ts +34 -34
  156. package/lib/select/index.js +68 -81
  157. package/lib/sidebar-layout/index.d.ts +2 -2
  158. package/lib/sidebar-layout/index.js +7 -9
  159. package/lib/slider/index.d.ts +2 -2
  160. package/lib/slider/index.js +57 -45
  161. package/lib/slider/utils.d.ts +10 -10
  162. package/lib/slider/utils.js +10 -10
  163. package/lib/sparkline/index.d.ts +1 -1
  164. package/lib/sparkline/index.js +7 -8
  165. package/lib/swing-gauge/helpers.js +2 -2
  166. package/lib/swing-gauge/index.d.ts +19 -19
  167. package/lib/swing-gauge/index.js +91 -81
  168. package/lib/tab/index.d.ts +1 -1
  169. package/lib/tab/index.js +16 -27
  170. package/lib/tab/themes/halo/dark/index.js +1 -1
  171. package/lib/tab/themes/halo/light/index.js +1 -1
  172. package/lib/tab/themes/solar/charcoal/index.js +1 -1
  173. package/lib/tab/themes/solar/pearl/index.js +1 -1
  174. package/lib/tab-bar/helpers/animate.js +1 -1
  175. package/lib/tab-bar/index.d.ts +1 -1
  176. package/lib/tab-bar/index.js +34 -18
  177. package/lib/tab-bar/themes/halo/dark/index.js +1 -1
  178. package/lib/tab-bar/themes/halo/light/index.js +1 -1
  179. package/lib/text-field/index.d.ts +1 -1
  180. package/lib/text-field/index.js +34 -31
  181. package/lib/time-picker/index.d.ts +6 -6
  182. package/lib/time-picker/index.js +103 -89
  183. package/lib/toggle/index.d.ts +1 -1
  184. package/lib/toggle/index.js +4 -3
  185. package/lib/toggle/themes/halo/dark/index.js +1 -1
  186. package/lib/toggle/themes/halo/light/index.js +1 -1
  187. package/lib/toggle/themes/solar/charcoal/index.js +1 -1
  188. package/lib/toggle/themes/solar/pearl/index.js +1 -1
  189. package/lib/tooltip/elements/title-tooltip.js +2 -2
  190. package/lib/tooltip/index.d.ts +27 -27
  191. package/lib/tooltip/index.js +42 -38
  192. package/lib/tooltip/managers/tooltip-manager.d.ts +1 -1
  193. package/lib/tornado-chart/elements/tornado-chart.d.ts +1 -1
  194. package/lib/tornado-chart/elements/tornado-chart.js +2 -2
  195. package/lib/tornado-chart/elements/tornado-item.d.ts +2 -2
  196. package/lib/tornado-chart/elements/tornado-item.js +12 -10
  197. package/lib/tree/elements/tree-item.d.ts +3 -3
  198. package/lib/tree/elements/tree-item.js +21 -19
  199. package/lib/tree/elements/tree.d.ts +1 -1
  200. package/lib/tree/elements/tree.js +12 -11
  201. package/lib/tree/helpers/renderer.js +4 -3
  202. package/lib/tree/index.d.ts +1 -1
  203. package/lib/tree/managers/tree-manager.d.ts +1 -1
  204. package/lib/tree/managers/tree-manager.js +17 -18
  205. package/lib/tree/themes/solar/charcoal/index.js +1 -1
  206. package/lib/tree/themes/solar/pearl/index.js +1 -1
  207. package/lib/tree-select/index.d.ts +9 -9
  208. package/lib/tree-select/index.js +91 -82
  209. package/lib/tree-select/themes/halo/dark/index.js +1 -1
  210. package/lib/tree-select/themes/halo/light/index.js +1 -1
  211. package/lib/tree-select/themes/solar/charcoal/index.js +1 -1
  212. package/lib/tree-select/themes/solar/pearl/index.js +1 -1
  213. package/lib/version.js +1 -1
  214. package/package.json +17 -17
  215. package/tsconfig.tsbuildinfo +1 -1
package/lib/icon/index.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import { __decorate } from "tslib";
2
- import { BasicElement, svg, css } from '@refinitiv-ui/core';
2
+ import { consume } from '@lit-labs/context';
3
+ import { BasicElement, 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';
6
- import { Deferred, isUrl, isBase64svg } from '@refinitiv-ui/utils/loader.js';
7
+ import { Deferred, isBase64svg, isUrl } from '@refinitiv-ui/utils/loader.js';
8
+ import { efConfig } from '../configuration/index.js';
7
9
  import { VERSION } from '../version.js';
8
10
  import { IconLoader } from './utils/IconLoader.js';
9
- import { consume } from '@lit-labs/context';
10
- import { efConfig } from '../configuration/index.js';
11
11
  import { SpriteLoader } from './utils/SpriteLoader.js';
12
12
  const EmptyTemplate = svg ``;
13
13
  /**
@@ -88,7 +88,7 @@ let Icon = class Icon extends BasicElement {
88
88
  * @returns icon map if exists
89
89
  */
90
90
  get iconMap() {
91
- return this.icon && this.config?.icon.map[this.icon] || null;
91
+ return (this.icon && this.config?.icon.map[this.icon]) || null;
92
92
  }
93
93
  /**
94
94
  * Called after the component is first rendered
@@ -122,7 +122,7 @@ let Icon = class Icon extends BasicElement {
122
122
  if (!this._icon) {
123
123
  return false;
124
124
  }
125
- if (this.iconMap && (!isBase64svg(this.iconMap) && !isUrl(this.iconMap))) {
125
+ if (this.iconMap && !isBase64svg(this.iconMap) && !isUrl(this.iconMap)) {
126
126
  return false;
127
127
  }
128
128
  return true;
@@ -155,8 +155,7 @@ let Icon = class Icon extends BasicElement {
155
155
  async loadAndRenderIcon(src) {
156
156
  const iconTemplateCacheItem = iconTemplateCache.get(src);
157
157
  if (!iconTemplateCacheItem) {
158
- iconTemplateCache.set(src, IconLoader.loadSVG(src)
159
- .then(body => svg `${unsafeSVG(body)}`));
158
+ iconTemplateCache.set(src, IconLoader.loadSVG(src).then((body) => svg `${unsafeSVG(body)}`));
160
159
  return this.loadAndRenderIcon(src); // Load again and await cache result
161
160
  }
162
161
  this.template = await iconTemplateCacheItem;
@@ -170,8 +169,7 @@ let Icon = class Icon extends BasicElement {
170
169
  async loadAndRenderSpriteIcon(iconName) {
171
170
  const iconTemplateCacheItem = iconTemplateCache.get(iconName);
172
171
  if (!iconTemplateCacheItem) {
173
- iconTemplateCache.set(iconName, SpriteLoader.loadSpriteSVG(iconName)
174
- .then(body => svg `${unsafeSVG(body)}`));
172
+ iconTemplateCache.set(iconName, SpriteLoader.loadSpriteSVG(iconName).then((body) => svg `${unsafeSVG(body)}`));
175
173
  return this.loadAndRenderIcon(iconName); // Load again and await cache result
176
174
  }
177
175
  this.template = await iconTemplateCacheItem;
@@ -1,5 +1,5 @@
1
- import type { LineData, BarData, HistogramData, DeepPartial, ChartOptions, SeriesPartialOptions, LineSeriesPartialOptions, AreaSeriesPartialOptions, BarSeriesPartialOptions, CandlestickSeriesPartialOptions, HistogramSeriesPartialOptions, LineStyleOptions, AreaStyleOptions, BarStyleOptions, CandlestickStyleOptions, HistogramStyleOptions, ISeriesApi, SeriesType } from 'lightweight-charts';
2
- import type { RGBColor, HSLColor } from '@refinitiv-ui/utils/color.js';
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
- export type { InteractiveChartConfig, InteractiveChartSeries, LegendStyle };
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
@@ -96,9 +96,9 @@ export declare class InteractiveChart extends ResponsiveElement {
96
96
  */
97
97
  resizedCallback(size: ElementSize): void;
98
98
  /**
99
- * Legend value observer
100
- * @returns {void}
101
- */
99
+ * Legend value observer
100
+ * @returns {void}
101
+ */
102
102
  private onLegendChange;
103
103
  /**
104
104
  * Legend style observer
@@ -108,9 +108,9 @@ export declare class InteractiveChart extends ResponsiveElement {
108
108
  */
109
109
  private onLegendStyleChange;
110
110
  /**
111
- * Jump last value observer
112
- * @returns {void}
113
- */
111
+ * Jump last value observer
112
+ * @returns {void}
113
+ */
114
114
  private onJumpButtonChange;
115
115
  /**
116
116
  * update width and height of chart
@@ -179,15 +179,15 @@ export declare class InteractiveChart extends ResponsiveElement {
179
179
  */
180
180
  private convertColorToString;
181
181
  /**
182
- * Create data configuration from theme
183
- * @returns {void}
184
- */
182
+ * Create data configuration from theme
183
+ * @returns {void}
184
+ */
185
185
  private createSeriesOptions;
186
186
  /**
187
- * Apply Theme to chart
188
- * @param config value config
189
- * @returns {void}
190
- */
187
+ * Apply Theme to chart
188
+ * @param config value config
189
+ * @returns {void}
190
+ */
191
191
  private applyTheme;
192
192
  /**
193
193
  * Apply text color legend from chart options
@@ -253,13 +253,13 @@ export declare class InteractiveChart extends ResponsiveElement {
253
253
  */
254
254
  private createSpanOHLC;
255
255
  /**
256
- * Create text used by several series types such as bars or candlesticks
257
- * @param rowLegend Legend element
258
- * @param rowData Value of series
259
- * @param priceColor color of series
260
- * @param index Series index
261
- * @returns {void}
262
- */
256
+ * Create text used by several series types such as bars or candlesticks
257
+ * @param rowLegend Legend element
258
+ * @param rowData Value of series
259
+ * @param priceColor color of series
260
+ * @param index Series index
261
+ * @returns {void}
262
+ */
263
263
  private createTextOHLC;
264
264
  /**
265
265
  * Create text price used by several series types
@@ -335,11 +335,11 @@ export declare class InteractiveChart extends ResponsiveElement {
335
335
  */
336
336
  colors(): string[];
337
337
  /**
338
- * A `CSSResultGroup` that will be used
339
- * to style the host, slotted children
340
- * and the internal template of the element.
341
- * @return CSS template
342
- */
338
+ * A `CSSResultGroup` that will be used
339
+ * to style the host, slotted children
340
+ * and the internal template of the element.
341
+ * @return CSS template
342
+ */
343
343
  static get styles(): CSSResultGroup;
344
344
  /**
345
345
  * A `TemplateResult` that will be used
@@ -1,15 +1,15 @@
1
1
  var InteractiveChart_1;
2
2
  import { __decorate } from "tslib";
3
- import { ResponsiveElement, html, css } from '@refinitiv-ui/core';
3
+ import { createChart as chart } from 'lightweight-charts';
4
+ import { 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 { LegendStyle } from './helpers/types.js';
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
@@ -185,9 +185,9 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
185
185
  }
186
186
  }
187
187
  /**
188
- * Legend value observer
189
- * @returns {void}
190
- */
188
+ * Legend value observer
189
+ * @returns {void}
190
+ */
191
191
  onLegendChange() {
192
192
  if (!this.disabledLegend) {
193
193
  this.createLegend();
@@ -214,9 +214,9 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
214
214
  }
215
215
  }
216
216
  /**
217
- * Jump last value observer
218
- * @returns {void}
219
- */
217
+ * Jump last value observer
218
+ * @returns {void}
219
+ */
220
220
  onJumpButtonChange() {
221
221
  if (!this.disabledJumpButton) {
222
222
  this.createJumpButton(this.width, this.height);
@@ -410,9 +410,9 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
410
410
  return color || {};
411
411
  }
412
412
  /**
413
- * Create data configuration from theme
414
- * @returns {void}
415
- */
413
+ * Create data configuration from theme
414
+ * @returns {void}
415
+ */
416
416
  createSeriesOptions() {
417
417
  if (this.theme) {
418
418
  let colorIndex = 0;
@@ -464,12 +464,12 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
464
464
  wickDownColor: this.theme.chartDownColor
465
465
  };
466
466
  // Update color index
467
- if (!seriesOptions.upColor
468
- || !seriesOptions.downColor
469
- || !seriesOptions.borderUpColor
470
- || !seriesOptions.borderDownColor
471
- || !seriesOptions.wickUpColor
472
- || !seriesOptions.wickDownColor) {
467
+ if (!seriesOptions.upColor ||
468
+ !seriesOptions.downColor ||
469
+ !seriesOptions.borderUpColor ||
470
+ !seriesOptions.borderDownColor ||
471
+ !seriesOptions.wickUpColor ||
472
+ !seriesOptions.wickDownColor) {
473
473
  colorIndex++;
474
474
  }
475
475
  }
@@ -484,7 +484,8 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
484
484
  }
485
485
  // Update config seriesOptions not have seriesOptions
486
486
  if (!this.internalConfig.series[index].seriesOptions) {
487
- this.internalConfig.series[index].seriesOptions = seriesThemeOptions;
487
+ this.internalConfig.series[index].seriesOptions =
488
+ seriesThemeOptions;
488
489
  }
489
490
  else {
490
491
  merge(seriesOptions, seriesThemeOptions);
@@ -493,10 +494,10 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
493
494
  }
494
495
  }
495
496
  /**
496
- * Apply Theme to chart
497
- * @param config value config
498
- * @returns {void}
499
- */
497
+ * Apply Theme to chart
498
+ * @param config value config
499
+ * @returns {void}
500
+ */
500
501
  applyTheme(config) {
501
502
  if (this.chart && this.theme) {
502
503
  const style = getComputedStyle(this);
@@ -628,7 +629,7 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
628
629
  for (let idx = 0; idx < this.internalConfig.series.length; idx++) {
629
630
  const chartType = this.internalConfig.series[idx].type;
630
631
  const dataSet = this.internalConfig.series[idx].data || [];
631
- const symbol = (this.internalConfig.series[idx].symbolName || this.internalConfig.series[idx].symbol) || '';
632
+ const symbol = this.internalConfig.series[idx].symbolName || this.internalConfig.series[idx].symbol || '';
632
633
  const isLegendVisible = this.internalConfig.series[idx].legendVisible !== false;
633
634
  // Create row legend element
634
635
  if (!rowLegend) {
@@ -650,11 +651,11 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
650
651
  }
651
652
  this.legendContainer.appendChild(rowLegendElem);
652
653
  }
653
- /* Update value legend element on subscribeCrosshairMove.
654
- * Don't need to be updated if chart has no data.
655
- */
656
- /* c8 ignore start */
657
654
  else if (rowLegend && dataSet.length) {
655
+ /* Update value legend element on subscribeCrosshairMove.
656
+ * Don't need to be updated if chart has no data.
657
+ */
658
+ /* c8 ignore start */
658
659
  let value;
659
660
  let priceColor = '';
660
661
  // When have price on event moved on the crosshair
@@ -675,7 +676,10 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
675
676
  const latestData = dataSet[dataSet.length - 1];
676
677
  if (latestData) {
677
678
  priceColor = this.getColorInSeries(latestData, chartType, idx);
678
- value = chartType === 'bar' || chartType === 'candlestick' ? latestData : latestData.value;
679
+ value =
680
+ chartType === 'bar' || chartType === 'candlestick'
681
+ ? latestData
682
+ : latestData.value;
679
683
  this.isCrosshairVisible = false;
680
684
  this.hasDataPoint = true;
681
685
  }
@@ -704,7 +708,7 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
704
708
  if (chartType === 'bar' || chartType === 'candlestick') {
705
709
  if (!this.hasDataPoint && rowLegendElem instanceof NodeList) {
706
710
  const spanElem = rowLegendElem[index].querySelectorAll('span.price,span.ohlc');
707
- spanElem.forEach(span => rowLegendElem[index].removeChild(span));
711
+ spanElem.forEach((span) => rowLegendElem[index].removeChild(span));
708
712
  const span = document.createElement('span');
709
713
  span.className = 'price';
710
714
  span.textContent = value;
@@ -732,16 +736,18 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
732
736
  }
733
737
  }
734
738
  /**
735
- * Create text used by several series types such as bars or candlesticks
736
- * @param rowLegend Legend element
737
- * @param rowData Value of series
738
- * @param priceColor color of series
739
- * @param index Series index
740
- * @returns {void}
741
- */
739
+ * Create text used by several series types such as bars or candlesticks
740
+ * @param rowLegend Legend element
741
+ * @param rowData Value of series
742
+ * @param priceColor color of series
743
+ * @param index Series index
744
+ * @returns {void}
745
+ */
742
746
  createTextOHLC(rowLegend, rowData, priceColor, index) {
743
747
  // Uses price formatter if provided
744
- const formatter = this.internalConfig.series[index].hasOwnProperty('legendPriceFormatter') ? this.internalConfig.series[index].legendPriceFormatter : null;
748
+ const formatter = this.internalConfig.series[index].hasOwnProperty('legendPriceFormatter')
749
+ ? this.internalConfig.series[index].legendPriceFormatter
750
+ : null;
745
751
  if (formatter) {
746
752
  rowData = {
747
753
  open: formatter(rowData.open),
@@ -879,7 +885,9 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
879
885
  return this.getLegendPriceColor(this.seriesList[index].options().color);
880
886
  }
881
887
  else if (chartType === 'candlestick') {
882
- const value = seriesData.hasOwnProperty('seriesPrices') ? seriesData?.seriesPrices.get(this.seriesList[index]) : seriesData;
888
+ const value = seriesData.hasOwnProperty('seriesPrices')
889
+ ? seriesData?.seriesPrices.get(this.seriesList[index])
890
+ : seriesData;
883
891
  const barStyle = this.seriesList[index].options();
884
892
  const colorBar = value.close > value.open ? barStyle.borderUpColor : barStyle.borderDownColor;
885
893
  return colorBar;
@@ -891,7 +899,9 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
891
899
  return this.getLegendPriceColor(this.seriesList[index].options().lineColor);
892
900
  }
893
901
  else if (chartType === 'volume') {
894
- const priceValue = seriesData.hasOwnProperty('seriesPrices') ? seriesData.seriesPrices.get(this.seriesList[index]) : seriesData.value;
902
+ const priceValue = seriesData.hasOwnProperty('seriesPrices')
903
+ ? seriesData.seriesPrices.get(this.seriesList[index])
904
+ : seriesData.value;
895
905
  let dataItem = {};
896
906
  this.internalConfig.series[index].data.forEach((dataConfig) => {
897
907
  const data = dataConfig;
@@ -899,10 +909,10 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
899
909
  const timeSeriesData = seriesData.time;
900
910
  // if via time point data string format 'yyyy-mm-dd' or object '{ year: 2019, month: 6, day: 1 }'
901
911
  if (time.hasOwnProperty('day') && time.hasOwnProperty('month') && time.hasOwnProperty('year')) {
902
- if (time.day === timeSeriesData.day
903
- && time.month === timeSeriesData.month
904
- && time.year === timeSeriesData.year
905
- && data.value === priceValue) {
912
+ if (time.day === timeSeriesData.day &&
913
+ time.month === timeSeriesData.month &&
914
+ time.year === timeSeriesData.year &&
915
+ data.value === priceValue) {
906
916
  dataItem = dataConfig;
907
917
  }
908
918
  }
@@ -936,7 +946,7 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
936
946
  const position = this.getPriceScalePosition();
937
947
  const pricePosition = position === 'left' ? 30 : 0;
938
948
  const buttonTop = `${height - 70}px`;
939
- const buttonLeft = `${(width + pricePosition) - 100}px`;
949
+ const buttonLeft = `${width + pricePosition - 100}px`;
940
950
  this.jumpButtonContainer.style.top = buttonTop;
941
951
  this.jumpButtonContainer.style.left = buttonLeft;
942
952
  // Create subscribeVisibleTimeRangeChange
@@ -995,11 +1005,11 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
995
1005
  return colors;
996
1006
  }
997
1007
  /**
998
- * A `CSSResultGroup` that will be used
999
- * to style the host, slotted children
1000
- * and the internal template of the element.
1001
- * @return CSS template
1002
- */
1008
+ * A `CSSResultGroup` that will be used
1009
+ * to style the host, slotted children
1010
+ * and the internal template of the element.
1011
+ * @return CSS template
1012
+ */
1003
1013
  static get styles() {
1004
1014
  return css `
1005
1015
  :host {
@@ -1009,7 +1019,7 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
1009
1019
  z-index: 0;
1010
1020
  }
1011
1021
 
1012
- [part=legend] {
1022
+ [part='legend'] {
1013
1023
  position: absolute;
1014
1024
  z-index: 1000;
1015
1025
  }
@@ -1029,8 +1039,12 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
1029
1039
  <div part="jump-button"></div>
1030
1040
  </div>
1031
1041
  <div part="branding-container" title="" tooltip="Powered by Trading View">
1032
- <svg width="33" height="19" viewBox="0 0 611 314" part="branding">
1033
- <path fill-rule="evenodd" clip-rule="evenodd" 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"/>
1042
+ <svg width="33" height="19" viewBox="0 0 611 314" part="branding">
1043
+ <path
1044
+ fill-rule="evenodd"
1045
+ clip-rule="evenodd"
1046
+ 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"
1047
+ />
1034
1048
  </svg>
1035
1049
  </div>
1036
1050
  <div part="chart"></div>
@@ -17,7 +17,7 @@ interface CommonLabelItem extends CommonItem {
17
17
  icon?: string;
18
18
  /**
19
19
  * Set the tooltip text
20
- */
20
+ */
21
21
  tooltip?: string;
22
22
  }
23
23
  /**
@@ -1,8 +1,8 @@
1
1
  import { JSXInterface } from '../jsx';
2
- import { ControlElement, CSSResultGroup, PropertyValues, TemplateResult } from '@refinitiv-ui/core';
3
- import '../icon/index.js';
2
+ import { CSSResultGroup, ControlElement, PropertyValues, TemplateResult } from '@refinitiv-ui/core';
4
3
  import '../checkbox/index.js';
5
- import type { ItemType, ItemText, ItemHeader, ItemDivider, ItemData } from './helpers/types';
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 { VERSION } from '../version.js';
6
- import '../icon/index.js';
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 { isElementOverflown } from '@refinitiv-ui/utils/element.js';
10
- import { createRef, ref } from '@refinitiv-ui/core/directives/ref.js';
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 ? html `<ef-icon part="icon" .icon="${this.icon}"></ef-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.map(node => node.textContent).join(' ').trim();
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 ? html `<ef-checkbox part="checkbox" .checked="${this.selected}" tabindex="-1"></ef-checkbox>` : undefined;
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)}>
package/lib/jsx.d.ts CHANGED
@@ -48,9 +48,11 @@ export declare namespace JSXInterface {
48
48
  innerHTML?: string;
49
49
  key?: string | number;
50
50
  accessKey?: string;
51
- class?: string | {
52
- [className: string]: boolean;
53
- };
51
+ class?:
52
+ | string
53
+ | {
54
+ [className: string]: boolean;
55
+ };
54
56
  contentEditable?: boolean | string;
55
57
  contenteditable?: boolean | string;
56
58
  contextMenu?: string;
@@ -220,4 +222,4 @@ export declare namespace JSXInterface {
220
222
  onTransitionEnd?: (event: TransitionEvent) => void;
221
223
  onTransitionEndCapture?: (event: TransitionEvent) => void;
222
224
  }
223
- }
225
+ }
@@ -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
  * Displays a text with alternative truncation
5
5
  */
@@ -1,10 +1,10 @@
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 { styleMap } from '@refinitiv-ui/core/directives/style-map.js';
6
- import { VERSION } from '../version.js';
7
6
  import { addTooltipCondition, removeTooltipCondition } from '../tooltip/index.js';
7
+ import { VERSION } from '../version.js';
8
8
  /**
9
9
  * Configuration object
10
10
  * for mutations observers
@@ -144,7 +144,10 @@ let Label = class Label extends BasicElement {
144
144
  recalculate(mutation = false) {
145
145
  const oldValue = this.text;
146
146
  const raw = this.textContent || '';
147
- this.chunks = raw.split(_).map(chunk => chunk.trim()).filter(chunk => chunk);
147
+ this.chunks = raw
148
+ .split(_)
149
+ .map((chunk) => chunk.trim())
150
+ .filter((chunk) => chunk);
148
151
  const newValue = this.text;
149
152
  if (oldValue !== newValue) {
150
153
  this.requestUpdate('text', oldValue);
@@ -178,7 +181,9 @@ let Label = class Label extends BasicElement {
178
181
  }
179
182
  const leftPart = html `<div class="split left">${left.join(_)}</div>`;
180
183
  const centerPart = isSingleWord ? undefined : html `<div class="split center">&nbsp;</div>`;
181
- const rightPart = right.length ? html `<div class="split right"><span dir="ltr">${right.join(_)}</span></div>` : undefined;
184
+ const rightPart = right.length
185
+ ? html `<div class="split right"><span dir="ltr">${right.join(_)}</span></div>`
186
+ : undefined;
182
187
  return html `${leftPart}${centerPart}${rightPart}`;
183
188
  }
184
189
  /**
@@ -190,9 +195,7 @@ let Label = class Label extends BasicElement {
190
195
  '-webkit-line-clamp': `${this.lineClamp}`,
191
196
  wordBreak: this.lineClamp === 1 ? 'break-all' : ''
192
197
  };
193
- return html `
194
- <span class="clamp" style="${styleMap(styles)}">${this.text}</span>
195
- `;
198
+ return html ` <span class="clamp" style="${styleMap(styles)}">${this.text}</span> `;
196
199
  }
197
200
  /**
198
201
  * A `TemplateResult` that will be used