@refinitiv-ui/elements 5.12.2-build.1915284619.1.70 → 5.12.3

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 (125) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +4 -4
  3. package/lib/accordion/index.js +2 -2
  4. package/lib/appstate-bar/index.js +2 -2
  5. package/lib/autosuggest/index.js +11 -10
  6. package/lib/button/index.js +3 -3
  7. package/lib/button-bar/index.js +5 -4
  8. package/lib/calendar/constants.js +1 -1
  9. package/lib/calendar/index.d.ts +1 -1
  10. package/lib/calendar/index.js +15 -38
  11. package/lib/calendar/locales.js +5 -5
  12. package/lib/calendar/themes/halo/dark/index.js +1 -1
  13. package/lib/calendar/themes/halo/light/index.js +1 -1
  14. package/lib/calendar/themes/solar/charcoal/index.js +1 -1
  15. package/lib/calendar/themes/solar/pearl/index.js +1 -1
  16. package/lib/calendar/types.d.ts +1 -1
  17. package/lib/calendar/utils.js +5 -5
  18. package/lib/canvas/index.js +4 -3
  19. package/lib/card/index.js +7 -6
  20. package/lib/chart/index.js +22 -15
  21. package/lib/chart/plugins/doughnut-center-label.js +11 -6
  22. package/lib/checkbox/index.js +3 -3
  23. package/lib/clock/index.js +6 -6
  24. package/lib/clock/utils/TickManager.js +2 -2
  25. package/lib/collapse/index.js +9 -7
  26. package/lib/color-dialog/elements/color-palettes.js +1 -1
  27. package/lib/color-dialog/elements/grayscale-palettes.js +2 -2
  28. package/lib/color-dialog/elements/palettes.js +5 -4
  29. package/lib/color-dialog/helpers/value-model.js +1 -1
  30. package/lib/color-dialog/index.d.ts +1 -1
  31. package/lib/color-dialog/index.js +6 -6
  32. package/lib/combo-box/helpers/filter.d.ts +1 -1
  33. package/lib/combo-box/helpers/types.d.ts +1 -1
  34. package/lib/combo-box/index.d.ts +4 -4
  35. package/lib/combo-box/index.js +14 -30
  36. package/lib/counter/index.d.ts +6 -6
  37. package/lib/counter/index.js +8 -8
  38. package/lib/datetime-picker/index.js +7 -6
  39. package/lib/datetime-picker/utils.js +1 -1
  40. package/lib/dialog/draggable-element.js +2 -1
  41. package/lib/dialog/index.d.ts +1 -1
  42. package/lib/dialog/index.js +5 -5
  43. package/lib/email-field/index.d.ts +1 -1
  44. package/lib/email-field/index.js +3 -8
  45. package/lib/flag/index.js +3 -3
  46. package/lib/flag/utils/FlagLoader.d.ts +1 -1
  47. package/lib/flag/utils/FlagLoader.js +1 -1
  48. package/lib/header/index.js +2 -2
  49. package/lib/heatmap/helpers/color.d.ts +1 -1
  50. package/lib/heatmap/helpers/color.js +5 -3
  51. package/lib/heatmap/index.js +28 -19
  52. package/lib/icon/index.js +3 -3
  53. package/lib/icon/utils/IconLoader.d.ts +1 -1
  54. package/lib/icon/utils/IconLoader.js +1 -1
  55. package/lib/interactive-chart/helpers/types.d.ts +1 -1
  56. package/lib/interactive-chart/index.js +14 -10
  57. package/lib/item/helpers/types.d.ts +1 -1
  58. package/lib/item/index.js +8 -5
  59. package/lib/label/index.js +4 -4
  60. package/lib/layout/index.js +2 -2
  61. package/lib/led-gauge/index.js +2 -2
  62. package/lib/list/helpers/types.d.ts +1 -1
  63. package/lib/list/index.d.ts +1 -1
  64. package/lib/list/index.js +4 -4
  65. package/lib/list/renderer.d.ts +1 -1
  66. package/lib/loader/index.js +1 -1
  67. package/lib/multi-input/helpers/types.d.ts +1 -1
  68. package/lib/multi-input/index.js +7 -6
  69. package/lib/notification/elements/notification-tray.js +3 -3
  70. package/lib/notification/elements/notification.js +2 -2
  71. package/lib/number-field/index.d.ts +3 -3
  72. package/lib/number-field/index.js +4 -14
  73. package/lib/overlay/elements/overlay-backdrop.js +2 -2
  74. package/lib/overlay/elements/overlay-viewport.js +1 -1
  75. package/lib/overlay/elements/overlay.js +5 -7
  76. package/lib/overlay/managers/focus-manager.js +3 -2
  77. package/lib/overlay/managers/interaction-lock-manager.js +1 -1
  78. package/lib/overlay/managers/viewport-manager.js +5 -4
  79. package/lib/overlay/managers/zindex-manager.js +1 -1
  80. package/lib/overlay-menu/helpers/types.d.ts +1 -1
  81. package/lib/overlay-menu/index.js +15 -12
  82. package/lib/overlay-menu/managers/menu-manager.js +1 -1
  83. package/lib/pagination/index.d.ts +1 -1
  84. package/lib/pagination/index.js +8 -7
  85. package/lib/panel/index.js +2 -2
  86. package/lib/password-field/index.d.ts +2 -2
  87. package/lib/password-field/index.js +4 -7
  88. package/lib/pill/index.d.ts +0 -16
  89. package/lib/pill/index.js +5 -36
  90. package/lib/pill/themes/halo/dark/index.js +1 -1
  91. package/lib/pill/themes/halo/light/index.js +1 -1
  92. package/lib/pill/themes/solar/charcoal/index.js +1 -1
  93. package/lib/pill/themes/solar/pearl/index.js +1 -1
  94. package/lib/progress-bar/index.js +3 -3
  95. package/lib/radio-button/index.js +3 -3
  96. package/lib/radio-button/radio-button-registry.d.ts +1 -1
  97. package/lib/radio-button/radio-button-registry.js +2 -4
  98. package/lib/rating/index.js +4 -4
  99. package/lib/search-field/index.d.ts +2 -2
  100. package/lib/search-field/index.js +4 -8
  101. package/lib/select/index.js +14 -11
  102. package/lib/sidebar-layout/index.js +4 -4
  103. package/lib/slider/index.js +8 -6
  104. package/lib/sparkline/index.js +10 -9
  105. package/lib/swing-gauge/index.js +8 -14
  106. package/lib/tab/index.js +4 -4
  107. package/lib/tab-bar/index.js +4 -4
  108. package/lib/text-field/index.d.ts +1 -14
  109. package/lib/text-field/index.js +11 -35
  110. package/lib/time-picker/index.d.ts +1 -1
  111. package/lib/time-picker/index.js +11 -10
  112. package/lib/toggle/index.js +2 -2
  113. package/lib/tooltip/index.js +8 -6
  114. package/lib/tooltip/managers/tooltip-manager.js +2 -2
  115. package/lib/tornado-chart/elements/tornado-chart.js +2 -2
  116. package/lib/tornado-chart/elements/tornado-item.js +3 -3
  117. package/lib/tree/elements/tree-item.js +2 -2
  118. package/lib/tree/elements/tree.d.ts +1 -1
  119. package/lib/tree/elements/tree.js +2 -2
  120. package/lib/tree/helpers/types.d.ts +1 -1
  121. package/lib/tree/managers/tree-manager.d.ts +1 -1
  122. package/lib/tree-select/index.d.ts +3 -3
  123. package/lib/tree-select/index.js +17 -21
  124. package/lib/version.js +1 -1
  125. package/package.json +295 -30
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
+ ## [5.12.3](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@5.12.2...@refinitiv-ui/elements@5.12.3) (2022-05-26)
7
+
8
+ **Note:** Version bump only for package @refinitiv-ui/elements
9
+
10
+
11
+
12
+
13
+
6
14
  ## [5.12.2](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@5.12.1...@refinitiv-ui/elements@5.12.2) (2022-02-17)
7
15
 
8
16
  **Note:** Version bump only for package @refinitiv-ui/elements
package/README.md CHANGED
@@ -29,10 +29,10 @@ Finally, import both elements that you want to use and its themes into your appl
29
29
  import '@refinitiv-ui/halo-theme/dark/imports/native-elements';
30
30
 
31
31
  // import element and its Halo dark theme
32
- import '@refinitiv-ui/elements/button';
33
- import '@refinitiv-ui/elements/panel';
34
- import '@refinitiv-ui/elements/button/themes/halo/dark';
35
- import '@refinitiv-ui/elements/panel/themes/halo/dark';
32
+ import '@refinitiv-ui/elements/lib/button';
33
+ import '@refinitiv-ui/elements/lib/panel';
34
+ import '@refinitiv-ui/elements/lib/button/themes/halo/dark';
35
+ import '@refinitiv-ui/elements/lib/panel/themes/halo/dark';
36
36
  ```
37
37
 
38
38
  Now, you can use the elements in your app.
@@ -1,7 +1,7 @@
1
1
  import { __decorate } from "tslib";
2
2
  import { html, css } from '@refinitiv-ui/core';
3
- import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
4
- import { property } from '@refinitiv-ui/core/decorators/property.js';
3
+ import { customElement } from '@refinitiv-ui/core/lib/decorators/custom-element.js';
4
+ import { property } from '@refinitiv-ui/core/lib/decorators/property.js';
5
5
  import { VERSION } from '../version.js';
6
6
  import { Collapse } from '../collapse/index.js';
7
7
  /**
@@ -1,7 +1,7 @@
1
1
  import { __decorate } from "tslib";
2
2
  import { BasicElement, html, css } from '@refinitiv-ui/core';
3
- import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
4
- import { property } from '@refinitiv-ui/core/decorators/property.js';
3
+ import { customElement } from '@refinitiv-ui/core/lib/decorators/custom-element.js';
4
+ import { property } from '@refinitiv-ui/core/lib/decorators/property.js';
5
5
  import { VERSION } from '../version.js';
6
6
  import '../icon/index.js';
7
7
  /**
@@ -1,14 +1,14 @@
1
1
  var Autosuggest_1;
2
2
  import { __decorate } from "tslib";
3
3
  import { css, html } from '@refinitiv-ui/core';
4
- import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
5
- import { query } from '@refinitiv-ui/core/decorators/query.js';
6
- import { property } from '@refinitiv-ui/core/decorators/property.js';
7
- import { unsafeHTML } from '@refinitiv-ui/core/directives/unsafe-html.js';
4
+ import { customElement } from '@refinitiv-ui/core/lib/decorators/custom-element.js';
5
+ import { query } from '@refinitiv-ui/core/lib/decorators/query.js';
6
+ import { property } from '@refinitiv-ui/core/lib/decorators/property.js';
7
+ import { unsafeHTML } from '@refinitiv-ui/core/lib/directives/unsafe-html.js';
8
8
  import { VERSION } from '../version.js';
9
- import { AnimationTaskRunner, TimeoutTaskRunner } from '@refinitiv-ui/utils/async.js';
9
+ import { AnimationTaskRunner, TimeoutTaskRunner } from '@refinitiv-ui/utils/lib/async.js';
10
10
  import { escapeRegExp, itemHighlightable, itemRenderer, queryWordSelect } from './helpers/utils.js';
11
- import { isIE, isMobile } from '@refinitiv-ui/utils/browser.js';
11
+ import { isIE, isMobile } from '@refinitiv-ui/utils/lib/browser.js';
12
12
  import { Overlay } from '../overlay/index.js';
13
13
  import '../loader/index.js';
14
14
  import '../item/index.js';
@@ -532,7 +532,7 @@ let Autosuggest = Autosuggest_1 = class Autosuggest extends Overlay {
532
532
  const { detail: { query, suggestion } } = event;
533
533
  /* istanbul ignore next */
534
534
  if (this.attachTarget) {
535
- this.attachTarget.value = suggestion && suggestion?.label || query;
535
+ this.attachTarget.value = suggestion && (suggestion === null || suggestion === void 0 ? void 0 : suggestion.label) || query;
536
536
  }
537
537
  }
538
538
  /**
@@ -1181,12 +1181,13 @@ let Autosuggest = Autosuggest_1 = class Autosuggest extends Overlay {
1181
1181
  */
1182
1182
  /* istanbul ignore next */
1183
1183
  calculateContentMaxHeight(size) {
1184
+ var _a, _b, _c;
1184
1185
  if (!isIE) {
1185
1186
  return;
1186
1187
  }
1187
- const headerRect = this.headerElement?.getBoundingClientRect();
1188
- const footerRect = this.footerElement?.getBoundingClientRect();
1189
- const contentRect = this.contentElement?.getBoundingClientRect();
1188
+ const headerRect = (_a = this.headerElement) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
1189
+ const footerRect = (_b = this.footerElement) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect();
1190
+ const contentRect = (_c = this.contentElement) === null || _c === void 0 ? void 0 : _c.getBoundingClientRect();
1190
1191
  const dialogHeight = size.height;
1191
1192
  const headerHeight = headerRect ? headerRect.height : 0;
1192
1193
  const footerHeight = footerRect ? footerRect.height : 0;
@@ -1,8 +1,8 @@
1
1
  import { __decorate } from "tslib";
2
2
  import { ControlElement, html } from '@refinitiv-ui/core';
3
- import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
4
- import { query } from '@refinitiv-ui/core/decorators/query.js';
5
- import { property } from '@refinitiv-ui/core/decorators/property.js';
3
+ import { customElement } from '@refinitiv-ui/core/lib/decorators/custom-element.js';
4
+ import { query } from '@refinitiv-ui/core/lib/decorators/query.js';
5
+ import { property } from '@refinitiv-ui/core/lib/decorators/property.js';
6
6
  import { VERSION } from '../version.js';
7
7
  import { registerOverflowTooltip } from '../tooltip/index.js';
8
8
  import '../icon/index.js';
@@ -1,11 +1,11 @@
1
1
  var ButtonBar_1;
2
2
  import { __decorate } from "tslib";
3
3
  import { BasicElement, html, css } from '@refinitiv-ui/core';
4
- import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
5
- import { property } from '@refinitiv-ui/core/decorators/property.js';
6
- import { ref, createRef } from '@refinitiv-ui/core/directives/ref.js';
4
+ import { customElement } from '@refinitiv-ui/core/lib/decorators/custom-element.js';
5
+ import { property } from '@refinitiv-ui/core/lib/decorators/property.js';
7
6
  import { VERSION } from '../version.js';
8
7
  import { Button } from '../button/index.js';
8
+ import { ref, createRef } from '@refinitiv-ui/core/lib/directives/ref.js';
9
9
  /**
10
10
  * Used to display multiple buttons to create a list of commands bar.
11
11
  */
@@ -256,7 +256,8 @@ let ButtonBar = ButtonBar_1 = class ButtonBar extends BasicElement {
256
256
  * @returns the array of Element of the default slot
257
257
  */
258
258
  getElementsOfSlot() {
259
- return this.defaultSlot.value?.assignedNodes().filter(node => node instanceof Element);
259
+ var _a;
260
+ return (_a = this.defaultSlot.value) === null || _a === void 0 ? void 0 : _a.assignedNodes().filter(node => node instanceof Element);
260
261
  }
261
262
  /**
262
263
  * Return the array of Buttons which focusable
@@ -1,4 +1,4 @@
1
- import { uuid } from '@refinitiv-ui/utils/uuid.js';
1
+ import { uuid } from '@refinitiv-ui/utils/lib/uuid.js';
2
2
  export var RenderView;
3
3
  (function (RenderView) {
4
4
  RenderView["DAY"] = "day";
@@ -4,7 +4,7 @@ import { TranslateDirective, TranslatePromise } from '@refinitiv-ui/translate';
4
4
  import { CalendarFilter } from './types';
5
5
  import './locales.js';
6
6
  import '../button/index.js';
7
- import '@refinitiv-ui/phrasebook/locale/en/calendar.js';
7
+ import '@refinitiv-ui/phrasebook/lib/locale/en/calendar.js';
8
8
  export { CalendarFilter };
9
9
  /**
10
10
  * Standard calendar element
@@ -1,22 +1,22 @@
1
1
  import { __decorate } from "tslib";
2
2
  import { ControlElement, html, css, WarningNotice } from '@refinitiv-ui/core';
3
- import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
4
- import { property } from '@refinitiv-ui/core/decorators/property.js';
5
- import { state } from '@refinitiv-ui/core/decorators/state.js';
6
- import { ifDefined } from '@refinitiv-ui/core/directives/if-defined.js';
7
- import { cache } from '@refinitiv-ui/core/directives/cache.js';
8
- import { guard } from '@refinitiv-ui/core/directives/guard.js';
9
- import { ref, createRef } from '@refinitiv-ui/core/directives/ref.js';
3
+ import { customElement } from '@refinitiv-ui/core/lib/decorators/custom-element.js';
4
+ import { property } from '@refinitiv-ui/core/lib/decorators/property.js';
5
+ import { state } from '@refinitiv-ui/core/lib/decorators/state.js';
6
+ import { ifDefined } from '@refinitiv-ui/core/lib/directives/if-defined.js';
7
+ import { cache } from '@refinitiv-ui/core/lib/directives/cache.js';
8
+ import { guard } from '@refinitiv-ui/core/lib/directives/guard.js';
9
+ import { ref, createRef } from '@refinitiv-ui/core/lib/directives/ref.js';
10
10
  import { VERSION } from '../version.js';
11
- import { isIE } from '@refinitiv-ui/utils/browser.js';
12
- import { DateFormat, format, utcFormat, utcParse, isValidDate, isWeekend, isAfter, isBefore, addMonths, subMonths, isToday, isThisMonth, isThisYear, isSameDay, isSameMonth, isSameYear, toDateSegment, parse } from '@refinitiv-ui/utils/date.js';
13
- import { left, right, up, down, first, last } from '@refinitiv-ui/utils/navigation.js';
11
+ import { isIE } from '@refinitiv-ui/utils/lib/browser.js';
12
+ import { DateFormat, format, utcFormat, utcParse, isValidDate, isWeekend, isAfter, isBefore, addMonths, subMonths, isToday, isThisMonth, isThisYear, isSameDay, isSameMonth, isSameYear, toDateSegment, parse } from '@refinitiv-ui/utils/lib/date.js';
13
+ import { left, right, up, down, first, last } from '@refinitiv-ui/utils/lib/navigation.js';
14
14
  import { monthInfo, weekdaysNames, monthsNames, formatLocaleDate, ViewFormatTranslateParams } from './utils.js';
15
15
  import { translate, getLocale, TranslatePropertyKey } from '@refinitiv-ui/translate';
16
16
  import { RenderView, CalendarLocaleScope, FIRST_DAY_OF_WEEK, YEARS_PER_YEAR_VIEW, DAY_VIEW, YEAR_VIEW, MONTH_VIEW } from './constants.js';
17
17
  import './locales.js';
18
18
  import '../button/index.js';
19
- import '@refinitiv-ui/phrasebook/locale/en/calendar.js';
19
+ import '@refinitiv-ui/phrasebook/lib/locale/en/calendar.js';
20
20
  /**
21
21
  * Standard calendar element
22
22
  *
@@ -925,14 +925,7 @@ let Calendar = class Calendar extends ControlElement {
925
925
  }
926
926
  const year = startIdx + i;
927
927
  const value = utcFormat({ year, month: 0, day: 1 }, DateFormat.yyyyMMdd);
928
- cell = {
929
- view,
930
- text: year > 0 ? `${year}` : year === 0 ? '1' : `${Math.abs(year - 1)}`,
931
- value: `${year}`,
932
- now: isThisYear(value),
933
- index: [cells.length, rows.length - 1],
934
- ...this.getCellSelection(value, isSameYear)
935
- };
928
+ cell = Object.assign({ view, text: year > 0 ? `${year}` : year === 0 ? '1' : `${Math.abs(year - 1)}`, value: `${year}`, now: isThisYear(value), index: [cells.length, rows.length - 1] }, this.getCellSelection(value, isSameYear));
936
929
  cells.push(cell);
937
930
  years.push(cell);
938
931
  }
@@ -969,15 +962,7 @@ let Calendar = class Calendar extends ControlElement {
969
962
  const segment = { year, month, day: 1 };
970
963
  const value = utcFormat(segment, DateFormat.yyyyMMdd);
971
964
  const idle = i < before || i >= after;
972
- cell = {
973
- view,
974
- text: monthsNames[month],
975
- value: utcFormat(segment, DateFormat.yyyyMM),
976
- idle,
977
- now: isThisMonth(value),
978
- index: [cells.length, rows.length - 1],
979
- ...this.getCellSelection(value, isSameMonth)
980
- };
965
+ cell = Object.assign({ view, text: monthsNames[month], value: utcFormat(segment, DateFormat.yyyyMM), idle, now: isThisMonth(value), index: [cells.length, rows.length - 1] }, this.getCellSelection(value, isSameMonth));
981
966
  cells.push(cell);
982
967
  months.push(cell);
983
968
  }
@@ -1041,16 +1026,8 @@ let Calendar = class Calendar extends ControlElement {
1041
1026
  }
1042
1027
  const value = utcFormat({ year, month, day }, DateFormat.yyyyMMdd);
1043
1028
  const disabled = this.isDateAvailable ? !this.isDateAvailable(value) : false;
1044
- const dayCell = {
1045
- view,
1046
- text: day.toString(),
1047
- value,
1048
- disabled,
1049
- idle: month !== viewMonth.month || year !== viewMonth.year,
1050
- now: isToday(value),
1051
- index: [cells.length, rows.length - 1],
1052
- ...this.getCellSelection(value, isSameDay)
1053
- };
1029
+ const dayCell = Object.assign({ view, text: day.toString(), value,
1030
+ disabled, idle: month !== viewMonth.month || year !== viewMonth.year, now: isToday(value), index: [cells.length, rows.length - 1] }, this.getCellSelection(value, isSameDay));
1054
1031
  cells.push(dayCell);
1055
1032
  days.push(dayCell);
1056
1033
  }
@@ -9,20 +9,20 @@ const globals = {
9
9
  FIRST_DAY_OF_WEEK: '1'
10
10
  };
11
11
  const en = globals;
12
- const enUS = { ...en, FIRST_DAY_OF_WEEK: '0' };
12
+ const enUS = Object.assign(Object.assign({}, en), { FIRST_DAY_OF_WEEK: '0' });
13
13
  const enCA = enUS;
14
14
  const de = globals;
15
15
  const es = globals;
16
16
  const fr = globals;
17
- const frCA = { ...fr, FIRST_DAY_OF_WEEK: '0' };
17
+ const frCA = Object.assign(Object.assign({}, fr), { FIRST_DAY_OF_WEEK: '0' });
18
18
  const it = globals;
19
19
  const ja = globals;
20
- const ko = { ...globals, FIRST_DAY_OF_WEEK: '0' };
20
+ const ko = Object.assign(Object.assign({}, globals), { FIRST_DAY_OF_WEEK: '0' });
21
21
  const pl = globals;
22
22
  const ru = globals;
23
- const th = { ...globals, FIRST_DAY_OF_WEEK: '0' };
23
+ const th = Object.assign(Object.assign({}, globals), { FIRST_DAY_OF_WEEK: '0' });
24
24
  const zh = globals;
25
- const ar = { ...globals, FIRST_DAY_OF_WEEK: '6' };
25
+ const ar = Object.assign(Object.assign({}, globals), { FIRST_DAY_OF_WEEK: '6' });
26
26
  const scope = CalendarLocaleScope;
27
27
  Phrasebook.define('en', scope, en);
28
28
  Phrasebook.define('en-CA', scope, enCA);
@@ -1,3 +1,3 @@
1
1
  import '@refinitiv-ui/elements/lib/button/themes/halo/dark';
2
2
 
3
- elf.customStyles.define('ef-calendar', ':host{font-style:normal;font-variant:normal;font-weight:400;line-height:normal;text-align:left;text-indent:0;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;outline:0;font-size:12rem;color:#ccc;min-width:196px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background:#262626;padding:4px 3px}:host [part=navigation]{padding-bottom:3px}:host [part=btn-next],:host [part=btn-prev],:host [part=btn-view]{margin:0}:host [part=btn-view]{background:0 0;margin-left:16px;border:none;color:inherit;padding:0}:host [part=btn-view]:hover,:host [part=btn-view][focused=visible]{opacity:.8}:host [part=table]{width:100%;background:#262626}:host [part~=row]:not(:first-of-type) [part~=cell] [part~=cell-content]{top:1px}:host [part~=day-name-row]{background-color:#333}:host [part~=cell][disabled] [part~=selection]{opacity:.4}:host [part~=cell][today]{color:#fff}:host [part~=cell][today] [part~=selection]{background:#404040}:host [part~=cell]:not([selected]):not([range]):not([disabled])[idle] [part~=selection]{opacity:.6}:host [part~=cell]:not([today]):not([range]) [part~=selection]:hover{color:#fff}:host [part~=cell]:not(:active) [part~=selection]:hover{border-color:#334bff}:host [part~=cell]:not([selected]):not([range]):not([today]) [part~=selection]:hover{background:#334bff}:host [part~=cell]:not([selected]):not([range]):not([today]):not(:active) [part~=selection]:hover{border-color:#334bff}:host [part~=cell]:not([selected]):not([range]):not([today]):active [part~=selection]{color:#fff;background-color:#0f1e8a}:host [part~=cell][range]:not(:active) [part~=selection]:hover,:host [part~=cell][selected]:not(:active) [part~=selection]:hover,:host [part~=cell][today]:not(:active) [part~=selection]:hover{border-color:#334bff}:host [part~=cell][range]:active [part~=selection],:host [part~=cell][selected]:active [part~=selection],:host [part~=cell][today]:active [part~=selection]{color:#fff;background-color:#0f1e8a}:host [part~=cell][range] [part~=selection]{background:rgba(51,75,255,.2)}:host [part~=cell][range][today]{color:#fff}:host [part~=cell][selected]{color:#fff}:host [part~=cell][selected] [part~=selection]{background:#334bff}:host [part~=cell]:not(:first-of-type) [part~=cell-content]{left:1px}:host [part~=day-name]{color:#999;font-weight:500}:host [part~=day-name] [part~=cell-content]{background-color:#1a1a1a}:host [part~=cell-content]{background:#0d0d0d;top:0;bottom:0;right:0;left:0}:host [part~=selection]{outline:0;border:1px solid #0d0d0d}:host([focused=visible]) [part~=cell] [part~=selection]:focus{outline:#334bff solid 1px}:host([disabled]){opacity:.4}');
3
+ elf.customStyles.define('ef-calendar', ':host{font-style:normal;font-variant:normal;font-weight:400;line-height:normal;text-align:left;text-indent:0;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;outline:0;font-size:12rem;color:#ccc;min-width:196px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background:#262626;padding:4px 3px}:host [part=navigation]{padding-bottom:3px}:host [part=btn-next],:host [part=btn-prev],:host [part=btn-view]{margin:0}:host [part=btn-view]{background:0 0;margin-left:16px;border:none;color:inherit;padding:0}:host [part=btn-view]:hover,:host [part=btn-view][focused=visible]{opacity:.8}:host [part=table]{width:100%;background:#262626}:host [part~=row]:not(:first-of-type) [part~=cell] [part~=cell-content]{top:1px}:host [part~=day-name-row]{background-color:#333}:host [part~=cell][disabled]{opacity:.4}:host [part~=cell][today]{color:#fff}:host [part~=cell][today] [part~=selection]{background:#404040}:host [part~=cell]:not([selected]):not([range]):not([disabled])[idle] [part~=selection]{opacity:.6}:host [part~=cell]:not([today]):not([range]) [part~=selection]:hover{color:#fff}:host [part~=cell]:not(:active) [part~=selection]:hover{border-color:#334bff}:host [part~=cell]:not([selected]):not([range]):not([today]) [part~=selection]:hover{background:#334bff}:host [part~=cell]:not([selected]):not([range]):not([today]):not(:active) [part~=selection]:hover{border-color:#334bff}:host [part~=cell]:not([selected]):not([range]):not([today]):active [part~=selection]{color:#fff;background-color:#0f1e8a}:host [part~=cell][range]:not(:active) [part~=selection]:hover,:host [part~=cell][selected]:not(:active) [part~=selection]:hover,:host [part~=cell][today]:not(:active) [part~=selection]:hover{border-color:#334bff}:host [part~=cell][range]:active [part~=selection],:host [part~=cell][selected]:active [part~=selection],:host [part~=cell][today]:active [part~=selection]{color:#fff;background-color:#0f1e8a}:host [part~=cell][range] [part~=selection]{background:rgba(51,75,255,.2)}:host [part~=cell][range][today]{color:#fff}:host [part~=cell][selected]{color:#fff}:host [part~=cell][selected] [part~=selection]{background:#334bff}:host [part~=cell]:not(:first-of-type) [part~=cell-content]{left:1px}:host [part~=day-name]{color:#999;font-weight:500}:host [part~=day-name] [part~=cell-content]{background-color:#1a1a1a}:host [part~=cell-content]{background:#0d0d0d;top:0;bottom:0;right:0;left:0}:host [part~=selection]{outline:0;border:1px solid #0d0d0d}:host([focused=visible]) [part~=cell] [part~=selection]:focus{outline:#334bff solid 1px}:host([disabled]){opacity:.4}');
@@ -1,3 +1,3 @@
1
1
  import '@refinitiv-ui/elements/lib/button/themes/halo/light';
2
2
 
3
- elf.customStyles.define('ef-calendar', ':host{font-style:normal;font-variant:normal;font-weight:400;line-height:normal;text-align:left;text-indent:0;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;outline:0;font-size:12rem;color:#0d0d0d;min-width:196px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background:#f2f2f2;padding:4px 3px}:host [part=navigation]{padding-bottom:3px}:host [part=btn-next],:host [part=btn-prev],:host [part=btn-view]{margin:0}:host [part=btn-next]:not(:hover):not(:focus):not(:active),:host [part=btn-prev]:not(:hover):not(:focus):not(:active){color:#595959}:host [part=btn-view]{background:0 0;margin-left:16px;border:none;color:inherit;padding:0}:host [part=btn-view]:hover,:host [part=btn-view][focused=visible]{opacity:.8}:host [part=table]{width:100%;background:#e6e6e6}:host [part~=row]:not(:first-of-type) [part~=cell] [part~=cell-content]{top:1px}:host [part~=day-name-row]{background-color:#e6e6e6}:host [part~=cell][disabled] [part~=selection]{opacity:.4}:host [part~=cell][today]{color:#0d0d0d}:host [part~=cell][today] [part~=selection]{background:#d9d9d9}:host [part~=cell]:not([selected]):not([range]):not([disabled])[idle] [part~=selection]{opacity:.6}:host [part~=cell]:not([today]):not([range]) [part~=selection]:hover{color:#fff}:host [part~=cell]:not(:active) [part~=selection]:hover{border-color:#334bff}:host [part~=cell]:not([selected]):not([range]):not([today]) [part~=selection]:hover{background:#334bff}:host [part~=cell]:not([selected]):not([range]):not([today]):not(:active) [part~=selection]:hover{border-color:#334bff}:host [part~=cell]:not([selected]):not([range]):not([today]):active [part~=selection]{color:#fff;background-color:#0f1e8a}:host [part~=cell][range]:not(:active) [part~=selection]:hover,:host [part~=cell][selected]:not(:active) [part~=selection]:hover,:host [part~=cell][today]:not(:active) [part~=selection]:hover{border-color:#334bff}:host [part~=cell][range]:active [part~=selection],:host [part~=cell][selected]:active [part~=selection],:host [part~=cell][today]:active [part~=selection]{color:#fff;background-color:#0f1e8a}:host [part~=cell][range] [part~=selection]{background:rgba(51,75,255,.2)}:host [part~=cell][range][today]{color:#fff}:host [part~=cell][selected]{color:#fff}:host [part~=cell][selected] [part~=selection]{background:#334bff}:host [part~=cell]:not(:first-of-type) [part~=cell-content]{left:1px}:host [part~=day-name]{color:#737373;font-weight:500}:host [part~=day-name] [part~=cell-content]{background-color:#fafafa}:host [part~=cell-content]{background:#fff;top:0;bottom:0;right:0;left:0}:host [part~=selection]{outline:0;border:1px solid #fff}:host([focused=visible]) [part~=cell] [part~=selection]:focus{outline:#334bff solid 1px}:host([disabled]){opacity:.4}');
3
+ elf.customStyles.define('ef-calendar', ':host{font-style:normal;font-variant:normal;font-weight:400;line-height:normal;text-align:left;text-indent:0;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;outline:0;font-size:12rem;color:#0d0d0d;min-width:196px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background:#f2f2f2;padding:4px 3px}:host [part=navigation]{padding-bottom:3px}:host [part=btn-next],:host [part=btn-prev],:host [part=btn-view]{margin:0}:host [part=btn-next]:not(:hover):not(:focus):not(:active),:host [part=btn-prev]:not(:hover):not(:focus):not(:active){color:#595959}:host [part=btn-view]{background:0 0;margin-left:16px;border:none;color:inherit;padding:0}:host [part=btn-view]:hover,:host [part=btn-view][focused=visible]{opacity:.8}:host [part=table]{width:100%;background:#e6e6e6}:host [part~=row]:not(:first-of-type) [part~=cell] [part~=cell-content]{top:1px}:host [part~=day-name-row]{background-color:#e6e6e6}:host [part~=cell][disabled]{opacity:.4}:host [part~=cell][today]{color:#0d0d0d}:host [part~=cell][today] [part~=selection]{background:#d9d9d9}:host [part~=cell]:not([selected]):not([range]):not([disabled])[idle] [part~=selection]{opacity:.6}:host [part~=cell]:not([today]):not([range]) [part~=selection]:hover{color:#fff}:host [part~=cell]:not(:active) [part~=selection]:hover{border-color:#334bff}:host [part~=cell]:not([selected]):not([range]):not([today]) [part~=selection]:hover{background:#334bff}:host [part~=cell]:not([selected]):not([range]):not([today]):not(:active) [part~=selection]:hover{border-color:#334bff}:host [part~=cell]:not([selected]):not([range]):not([today]):active [part~=selection]{color:#fff;background-color:#0f1e8a}:host [part~=cell][range]:not(:active) [part~=selection]:hover,:host [part~=cell][selected]:not(:active) [part~=selection]:hover,:host [part~=cell][today]:not(:active) [part~=selection]:hover{border-color:#334bff}:host [part~=cell][range]:active [part~=selection],:host [part~=cell][selected]:active [part~=selection],:host [part~=cell][today]:active [part~=selection]{color:#fff;background-color:#0f1e8a}:host [part~=cell][range] [part~=selection]{background:rgba(51,75,255,.2)}:host [part~=cell][range][today]{color:#fff}:host [part~=cell][selected]{color:#fff}:host [part~=cell][selected] [part~=selection]{background:#334bff}:host [part~=cell]:not(:first-of-type) [part~=cell-content]{left:1px}:host [part~=day-name]{color:#737373;font-weight:500}:host [part~=day-name] [part~=cell-content]{background-color:#fafafa}:host [part~=cell-content]{background:#fff;top:0;bottom:0;right:0;left:0}:host [part~=selection]{outline:0;border:1px solid #fff}:host([focused=visible]) [part~=cell] [part~=selection]:focus{outline:#334bff solid 1px}:host([disabled]){opacity:.4}');
@@ -1,3 +1,3 @@
1
1
  import '@refinitiv-ui/elements/lib/button/themes/solar/charcoal';
2
2
 
3
- elf.customStyles.define('ef-calendar', ':host{font-style:normal;font-variant:normal;font-weight:400;line-height:normal;text-align:left;text-indent:0;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;outline:0;font-size:13rem;color:#c2c2c2;min-width:224px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background:#3c3c42;padding:4px}:host [part=navigation]{padding-bottom:4px}:host [part=btn-next],:host [part=btn-prev],:host [part=btn-view]{margin:0}:host [part=btn-view]{background:0 0;color:inherit;box-shadow:none;margin-left:15px;padding:0}:host [part=btn-view]:not([focused=visible]){border:none}:host [part=table]{width:100%;box-shadow:0 0 0 1px #000;background:#212124}:host [part~=row]:not(:last-of-type){box-shadow:0 1px 0 0 #0a0a0a}:host [part~=row]:not(:first-of-type) [part~=cell] [part~=selection]{top:1px}:host [part~=cell]:not(:last-of-type){box-shadow:1px 0 0 0 #0a0a0a}:host [part~=cell][disabled] [part~=selection]{opacity:.4}:host [part~=cell][today]{color:#f93}:host [part~=cell][today] [part~=selection]{background:#3c3c42}:host [part~=cell]:not([selected]):not([range]):not([disabled])[idle] [part~=selection]{opacity:.6}:host [part~=cell]:not([selected]):not([range]) [part~=selection]:focus,:host [part~=cell]:not([selected]):not([range]) [part~=selection]:hover{background:#3c3c42;color:#e2e2e2}:host [part~=cell]:not([selected]):not([range]) [part~=selection]:focus{outline:#f93 dotted 1px}:host [part~=cell][range] [part~=selection]{background:rgba(255,153,51,.2)}:host [part~=cell][range][today]{color:#f93}:host [part~=cell][selected]{color:#000}:host [part~=cell][selected] [part~=selection]{background:#f93}:host [part~=cell]:not(:first-of-type) [part~=selection]{left:1px}:host [part~=day-name]{background-color:#151516;color:#666570;font-size:10px;font-weight:700}:host [part~=selection]{outline:0;top:0;bottom:0;right:0;left:0}:host([disabled]){opacity:.4}');
3
+ elf.customStyles.define('ef-calendar', ':host{font-style:normal;font-variant:normal;font-weight:400;line-height:normal;text-align:left;text-indent:0;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;outline:0;font-size:13rem;color:#c2c2c2;min-width:224px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background:#3c3c42;padding:4px}:host [part=navigation]{padding-bottom:4px}:host [part=btn-next],:host [part=btn-prev],:host [part=btn-view]{margin:0}:host [part=btn-view]{background:0 0;color:inherit;box-shadow:none;margin-left:15px;padding:0}:host [part=btn-view]:not([focused=visible]){border:none}:host [part=table]{width:100%;box-shadow:0 0 0 1px #000;background:#212124}:host [part~=row]:not(:last-of-type){box-shadow:0 1px 0 0 #0a0a0a}:host [part~=row]:not(:first-of-type) [part~=cell] [part~=selection]{top:1px}:host [part~=cell]:not(:last-of-type){box-shadow:1px 0 0 0 #0a0a0a}:host [part~=cell][disabled]{opacity:.4}:host [part~=cell][today]{color:#f93}:host [part~=cell][today] [part~=selection]{background:#3c3c42}:host [part~=cell]:not([selected]):not([range]):not([disabled])[idle] [part~=selection]{opacity:.6}:host [part~=cell]:not([selected]):not([range]) [part~=selection]:focus,:host [part~=cell]:not([selected]):not([range]) [part~=selection]:hover{background:#3c3c42;color:#e2e2e2}:host [part~=cell]:not([selected]):not([range]) [part~=selection]:focus{outline:#f93 dotted 1px}:host [part~=cell][range] [part~=selection]{background:rgba(255,153,51,.2)}:host [part~=cell][range][today]{color:#f93}:host [part~=cell][selected]{color:#000}:host [part~=cell][selected] [part~=selection]{background:#f93}:host [part~=cell]:not(:first-of-type) [part~=selection]{left:1px}:host [part~=day-name]{background-color:#151516;color:#666570;font-size:10px;font-weight:700}:host [part~=selection]{outline:0;top:0;bottom:0;right:0;left:0}:host([disabled]){opacity:.4}');
@@ -1,3 +1,3 @@
1
1
  import '@refinitiv-ui/elements/lib/button/themes/solar/pearl';
2
2
 
3
- elf.customStyles.define('ef-calendar', ':host{font-style:normal;font-variant:normal;font-weight:400;line-height:normal;text-align:left;text-indent:0;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;outline:0;font-size:13rem;color:#484848;min-width:224px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background:#fff;padding:4px}:host [part=navigation]{padding-bottom:4px}:host [part=btn-next],:host [part=btn-prev],:host [part=btn-view]{margin:0}:host [part=btn-view]{background:0 0;color:inherit;box-shadow:none;margin-left:15px;padding:0}:host [part=btn-view]:not([focused=visible]){border:none}:host [part=table]{width:100%;box-shadow:0 0 0 1px #a9afba;background:#fff}:host [part~=row]:not(:last-of-type){box-shadow:0 1px 0 0 #d5d8db}:host [part~=row]:not(:first-of-type) [part~=cell] [part~=selection]{top:1px}:host [part~=cell]:not(:last-of-type){box-shadow:1px 0 0 0 #d5d8db}:host [part~=cell][disabled] [part~=selection]{opacity:.4}:host [part~=cell][today]{color:#fff}:host [part~=cell][today] [part~=selection]{background:#acafb5}:host [part~=cell]:not([selected]):not([range]):not([disabled])[idle] [part~=selection]{opacity:.6}:host [part~=cell]:not([selected]):not([range]) [part~=selection]:focus,:host [part~=cell]:not([selected]):not([range]) [part~=selection]:hover{background:#e4e8ed;color:#000}:host [part~=cell]:not([selected]):not([range]) [part~=selection]:focus{outline:#ee7600 dotted 1px}:host [part~=cell][range] [part~=selection]{background:rgba(255,153,51,.2)}:host [part~=cell][range][today]{color:#f93}:host [part~=cell][selected]{color:#fff}:host [part~=cell][selected] [part~=selection]{background:#f93}:host [part~=cell]:not(:first-of-type) [part~=selection]{left:1px}:host [part~=day-name]{background-color:#e4e8ed;color:#6e6e78;font-size:10px;font-weight:700}:host [part~=selection]{outline:0;top:0;bottom:0;right:0;left:0}:host([disabled]){opacity:.4}');
3
+ elf.customStyles.define('ef-calendar', ':host{font-style:normal;font-variant:normal;font-weight:400;line-height:normal;text-align:left;text-indent:0;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;outline:0;font-size:13rem;color:#484848;min-width:224px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background:#fff;padding:4px}:host [part=navigation]{padding-bottom:4px}:host [part=btn-next],:host [part=btn-prev],:host [part=btn-view]{margin:0}:host [part=btn-view]{background:0 0;color:inherit;box-shadow:none;margin-left:15px;padding:0}:host [part=btn-view]:not([focused=visible]){border:none}:host [part=table]{width:100%;box-shadow:0 0 0 1px #a9afba;background:#fff}:host [part~=row]:not(:last-of-type){box-shadow:0 1px 0 0 #d5d8db}:host [part~=row]:not(:first-of-type) [part~=cell] [part~=selection]{top:1px}:host [part~=cell]:not(:last-of-type){box-shadow:1px 0 0 0 #d5d8db}:host [part~=cell][disabled]{opacity:.4}:host [part~=cell][today]{color:#fff}:host [part~=cell][today] [part~=selection]{background:#acafb5}:host [part~=cell]:not([selected]):not([range]):not([disabled])[idle] [part~=selection]{opacity:.6}:host [part~=cell]:not([selected]):not([range]) [part~=selection]:focus,:host [part~=cell]:not([selected]):not([range]) [part~=selection]:hover{background:#e4e8ed;color:#000}:host [part~=cell]:not([selected]):not([range]) [part~=selection]:focus{outline:#ee7600 dotted 1px}:host [part~=cell][range] [part~=selection]{background:rgba(255,153,51,.2)}:host [part~=cell][range][today]{color:#f93}:host [part~=cell][selected]{color:#fff}:host [part~=cell][selected] [part~=selection]{background:#f93}:host [part~=cell]:not(:first-of-type) [part~=selection]{left:1px}:host [part~=day-name]{background-color:#e4e8ed;color:#6e6e78;font-size:10px;font-weight:700}:host [part~=selection]{outline:0;top:0;bottom:0;right:0;left:0}:host([disabled]){opacity:.4}');
@@ -1,4 +1,4 @@
1
- import { CellIndex } from '@refinitiv-ui/utils/navigation.js';
1
+ import { CellIndex } from '@refinitiv-ui/utils/lib/navigation.js';
2
2
  import { RenderView } from './constants.js';
3
3
  export interface CellSelectionModel {
4
4
  selected?: boolean;
@@ -1,4 +1,4 @@
1
- import { toDateSegment, getDaysInMonth, utcParse } from '@refinitiv-ui/utils/date.js';
1
+ import { toDateSegment, getDaysInMonth, utcParse } from '@refinitiv-ui/utils/lib/date.js';
2
2
  import { DEFAULT_LOCALE, resolveLocale } from '@refinitiv-ui/i18n';
3
3
  import { CalendarLocaleScope } from './constants.js';
4
4
  /**
@@ -27,10 +27,10 @@ const calendar = {
27
27
  */
28
28
  const DateMessageFormats = {
29
29
  date: {
30
- calendarMonthEra: { ...calendar, month: 'long', year: 'numeric', era: 'short' },
31
- calendarMonth: { ...calendar, month: 'long', year: 'numeric' },
32
- calendarYearEra: { ...calendar, year: 'numeric', era: 'short' },
33
- calendarYear: { ...calendar, year: 'numeric' }
30
+ calendarMonthEra: Object.assign(Object.assign({}, calendar), { month: 'long', year: 'numeric', era: 'short' }),
31
+ calendarMonth: Object.assign(Object.assign({}, calendar), { month: 'long', year: 'numeric' }),
32
+ calendarYearEra: Object.assign(Object.assign({}, calendar), { year: 'numeric', era: 'short' }),
33
+ calendarYear: Object.assign(Object.assign({}, calendar), { year: 'numeric' })
34
34
  }
35
35
  };
36
36
  /**
@@ -1,7 +1,7 @@
1
1
  import { __decorate } from "tslib";
2
2
  import { ResponsiveElement, html, css } from '@refinitiv-ui/core';
3
- import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
4
- import { property } from '@refinitiv-ui/core/decorators/property.js';
3
+ import { customElement } from '@refinitiv-ui/core/lib/decorators/custom-element.js';
4
+ import { property } from '@refinitiv-ui/core/lib/decorators/property.js';
5
5
  import { VERSION } from '../version.js';
6
6
  /**
7
7
  * A Component uses to draw graphics on a web page,
@@ -64,7 +64,8 @@ let Canvas = class Canvas extends ResponsiveElement {
64
64
  * @type {HTMLCanvasElement}
65
65
  */
66
66
  get canvas() {
67
- return this.shadowRoot?.getElementById('canvas');
67
+ var _a;
68
+ return (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('canvas');
68
69
  }
69
70
  /**
70
71
  * Alias of context
package/lib/card/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { __decorate } from "tslib";
2
2
  import { BasicElement, html, css } from '@refinitiv-ui/core';
3
- import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
4
- import { property } from '@refinitiv-ui/core/decorators/property.js';
5
- import { query } from '@refinitiv-ui/core/decorators/query.js';
6
- import { state } from '@refinitiv-ui/core/decorators/state.js';
3
+ import { customElement } from '@refinitiv-ui/core/lib/decorators/custom-element.js';
4
+ import { property } from '@refinitiv-ui/core/lib/decorators/property.js';
5
+ import { query } from '@refinitiv-ui/core/lib/decorators/query.js';
6
+ import { state } from '@refinitiv-ui/core/lib/decorators/state.js';
7
7
  import { VERSION } from '../version.js';
8
- import { isSlotEmpty } from '@refinitiv-ui/utils/is-slot-empty.js';
8
+ import { isSlotEmpty } from '@refinitiv-ui/utils/lib/is-slot-empty.js';
9
9
  import '../label/index.js';
10
10
  import '../button/index.js';
11
11
  import '../overlay-menu/index.js';
@@ -78,7 +78,8 @@ let Card = class Card extends BasicElement {
78
78
  return this._config;
79
79
  }
80
80
  set config(config) {
81
- const data = config?.menu?.data;
81
+ var _a;
82
+ const data = (_a = config === null || config === void 0 ? void 0 : config.menu) === null || _a === void 0 ? void 0 : _a.data;
82
83
  if (data !== this.menuData) {
83
84
  this.menuData = data;
84
85
  }
@@ -1,10 +1,10 @@
1
1
  import { __decorate } from "tslib";
2
2
  import { BasicElement, html, css } from '@refinitiv-ui/core';
3
- import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
4
- import { property } from '@refinitiv-ui/core/decorators/property.js';
5
- import { query } from '@refinitiv-ui/core/decorators/query.js';
3
+ import { customElement } from '@refinitiv-ui/core/lib/decorators/custom-element.js';
4
+ import { property } from '@refinitiv-ui/core/lib/decorators/property.js';
5
+ import { query } from '@refinitiv-ui/core/lib/decorators/query.js';
6
6
  import { VERSION } from '../version.js';
7
- import { color as parseColor } from '@refinitiv-ui/utils/color.js';
7
+ import { color as parseColor } from '@refinitiv-ui/utils/lib/color.js';
8
8
  import 'chart.js/dist/Chart.bundle.min.js';
9
9
  import { legendHelper, merge } from './helpers/index.js';
10
10
  import '../header/index.js';
@@ -54,7 +54,8 @@ let Chart = class Chart extends BasicElement {
54
54
  * @returns {Chart.ChartLegendLabelItem[]} Array of label configurations
55
55
  */
56
56
  this.generateLegendLabels = (chart) => {
57
- if (!this.config?.type) {
57
+ var _a, _b, _c, _d;
58
+ if (!((_a = this.config) === null || _a === void 0 ? void 0 : _a.type)) {
58
59
  return [];
59
60
  }
60
61
  const chartOption = DEFAULT_CHART_CONFIG[this.config.type];
@@ -62,11 +63,11 @@ let Chart = class Chart extends BasicElement {
62
63
  && chartOption.legend
63
64
  && Array.isArray(this.datasets[0].backgroundColor)) {
64
65
  let legends = [];
65
- if (chartOption.legend.labels?.generateLabels) {
66
- legends = chartOption.legend.labels?.generateLabels(chart);
66
+ if ((_b = chartOption.legend.labels) === null || _b === void 0 ? void 0 : _b.generateLabels) {
67
+ legends = (_c = chartOption.legend.labels) === null || _c === void 0 ? void 0 : _c.generateLabels(chart);
67
68
  }
68
69
  // Customize for doughnut chart change border color to background color
69
- if (['pie', 'doughnut'].includes(this.config?.type) && this.datasets.length > 1) {
70
+ if (['pie', 'doughnut'].includes((_d = this.config) === null || _d === void 0 ? void 0 : _d.type) && this.datasets.length > 1) {
70
71
  legends.forEach((label) => {
71
72
  label.strokeStyle = label.fillStyle;
72
73
  });
@@ -74,8 +75,9 @@ let Chart = class Chart extends BasicElement {
74
75
  return legends;
75
76
  }
76
77
  return this.datasets.map((dataset, i) => {
77
- const solidFill = !CHART_TYPE_OPAQUE.includes(dataset.type || this.config?.type);
78
- const usePointStyle = chart.options.legend?.labels?.usePointStyle || false;
78
+ var _a, _b, _c;
79
+ const solidFill = !CHART_TYPE_OPAQUE.includes(dataset.type || ((_a = this.config) === null || _a === void 0 ? void 0 : _a.type));
80
+ const usePointStyle = ((_c = (_b = chart.options.legend) === null || _b === void 0 ? void 0 : _b.labels) === null || _c === void 0 ? void 0 : _c.usePointStyle) || false;
79
81
  return {
80
82
  text: dataset.label,
81
83
  fillStyle: legendHelper.getLegendFillStyle(dataset, usePointStyle, solidFill),
@@ -120,7 +122,8 @@ let Chart = class Chart extends BasicElement {
120
122
  * @returns chart title
121
123
  */
122
124
  get chartTitle() {
123
- const title = this.config?.options?.title?.text;
125
+ var _a, _b, _c;
126
+ const title = (_c = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.title) === null || _c === void 0 ? void 0 : _c.text;
124
127
  if (title) {
125
128
  return typeof title === 'string' ? title : title.join();
126
129
  }
@@ -131,7 +134,8 @@ let Chart = class Chart extends BasicElement {
131
134
  * @returns dataset array
132
135
  */
133
136
  get datasets() {
134
- return this.config?.data?.datasets || [];
137
+ var _a, _b;
138
+ return ((_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.datasets) || [];
135
139
  }
136
140
  /**
137
141
  * List of available chart colors
@@ -182,6 +186,7 @@ let Chart = class Chart extends BasicElement {
182
186
  * @returns {ChartConfig} chart config with theme
183
187
  */
184
188
  get themableConfig() {
189
+ var _a;
185
190
  const style = getComputedStyle(this);
186
191
  // TODO: Try and remove the need for global object modification.
187
192
  // It's easier to cover all areas by modifying the global object,
@@ -217,7 +222,7 @@ let Chart = class Chart extends BasicElement {
217
222
  displayColors: false
218
223
  },
219
224
  legend: {
220
- position: ['pie', 'doughnut'].includes(this.config?.type || '') ? 'right' : 'top',
225
+ position: ['pie', 'doughnut'].includes(((_a = this.config) === null || _a === void 0 ? void 0 : _a.type) || '') ? 'right' : 'top',
221
226
  labels: {
222
227
  boxWidth: this.cssVarAsNumber('--legend-key-box-width', '10'),
223
228
  generateLabels: this.generateLegendLabels
@@ -286,7 +291,8 @@ let Chart = class Chart extends BasicElement {
286
291
  * @returns {Chart.ChartDataSets} Information about the dataset
287
292
  */
288
293
  datasetInfo(dataset) {
289
- const type = dataset.type || this.config?.type;
294
+ var _a;
295
+ const type = dataset.type || ((_a = this.config) === null || _a === void 0 ? void 0 : _a.type);
290
296
  let index = this.datasets.indexOf(dataset);
291
297
  const isColorArray = (!!type && ['pie', 'doughnut', 'polarArea'].includes(type)) || type === 'bar' && this.datasets.length === 1;
292
298
  const isSolidFill = !!type && !CHART_TYPE_OPAQUE.includes(type);
@@ -450,7 +456,8 @@ let Chart = class Chart extends BasicElement {
450
456
  * @returns {void}
451
457
  */
452
458
  onResize() {
453
- this.chart?.resize();
459
+ var _a;
460
+ (_a = this.chart) === null || _a === void 0 ? void 0 : _a.resize();
454
461
  }
455
462
  /**
456
463
  * A `TemplateResult` that will be used
@@ -1,6 +1,7 @@
1
1
  const CHART = window.Chart;
2
2
  const getPluginConfig = (chart) => {
3
- return chart.config.options?.plugins?.centerLabel;
3
+ var _a, _b;
4
+ return (_b = (_a = chart.config.options) === null || _a === void 0 ? void 0 : _a.plugins) === null || _b === void 0 ? void 0 : _b.centerLabel;
4
5
  };
5
6
  /**
6
7
  * Draw line
@@ -9,17 +10,18 @@ const getPluginConfig = (chart) => {
9
10
  * @returns {void}
10
11
  */
11
12
  const drawItemBorder = function (chart, active) {
13
+ var _a, _b, _c;
12
14
  if (!chart.data.datasets) {
13
15
  return;
14
16
  }
15
- if (active?.length) {
17
+ if (active === null || active === void 0 ? void 0 : active.length) {
16
18
  const ctx = chart.ctx;
17
19
  const chartItem = active[0];
18
20
  const vm = chartItem._view;
19
21
  const datasets = chart.data.datasets[chartItem._datasetIndex];
20
22
  vm.backgroundColor = datasets.backgroundColor[chartItem._index];
21
23
  vm.backgroundColor = CHART.helpers.getHoverColor(vm.backgroundColor); // we need to make color bolder
22
- vm.borderWidth = (datasets.borderWidth || chart.config.options?.elements?.arc?.borderWidth);
24
+ vm.borderWidth = (datasets.borderWidth || ((_c = (_b = (_a = chart.config.options) === null || _a === void 0 ? void 0 : _a.elements) === null || _b === void 0 ? void 0 : _b.arc) === null || _c === void 0 ? void 0 : _c.borderWidth));
23
25
  vm.borderColor = (getComputedStyle(chart.canvas).getPropertyValue('--doughnut-border-color') || CHART.defaults.global.defaultFontColor);
24
26
  const sA = vm.startAngle;
25
27
  const eA = vm.endAngle;
@@ -71,6 +73,7 @@ const plugins = {
71
73
  }
72
74
  },
73
75
  beforeDraw: function (chart) {
76
+ var _a;
74
77
  const config = getPluginConfig(chart);
75
78
  if (!config) {
76
79
  return;
@@ -80,7 +83,7 @@ const plugins = {
80
83
  if (chart._select) {
81
84
  active = chart._select;
82
85
  }
83
- if (chart.active?.length) {
86
+ if ((_a = chart.active) === null || _a === void 0 ? void 0 : _a.length) {
84
87
  active = chart.active;
85
88
  }
86
89
  const renderText = config.onRenderLabel(chart, active);
@@ -152,6 +155,7 @@ const plugins = {
152
155
  }
153
156
  },
154
157
  afterDatasetUpdate: function (chart) {
158
+ var _a;
155
159
  // Check chart already init selected.
156
160
  if (chart.selected !== undefined) {
157
161
  return;
@@ -161,7 +165,7 @@ const plugins = {
161
165
  if (!config || !config.selected || !chart.data.datasets) {
162
166
  return;
163
167
  }
164
- const selectedIndex = Number(config.selected?.index);
168
+ const selectedIndex = Number((_a = config.selected) === null || _a === void 0 ? void 0 : _a.index);
165
169
  const datasetIndex = Number(config.selected.datasetIndex || 0);
166
170
  const visibleIndexes = chart.getVisibleDatasetCount() - 1;
167
171
  // Validate index and datasetIndex
@@ -173,13 +177,14 @@ const plugins = {
173
177
  chart.selected = items ? [items] : [];
174
178
  },
175
179
  afterDraw: function (chart) {
180
+ var _a;
176
181
  if (getPluginConfig(chart)) {
177
182
  // Draw active element
178
183
  // Note: use logic from chart.js - chart.js/src/elements/element.arc.js :draw()
179
184
  // hover
180
185
  drawItemBorder(chart, chart.active);
181
186
  // selected
182
- if (chart.selected?.length) {
187
+ if ((_a = chart.selected) === null || _a === void 0 ? void 0 : _a.length) {
183
188
  chart._select = chart.selected;
184
189
  chart.selected = [];
185
190
  }
@@ -1,8 +1,8 @@
1
1
  import { __decorate } from "tslib";
2
2
  import { ControlElement, html, css } from '@refinitiv-ui/core';
3
- import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
4
- import { property } from '@refinitiv-ui/core/decorators/property.js';
5
- import { query } from '@refinitiv-ui/core/decorators/query.js';
3
+ import { customElement } from '@refinitiv-ui/core/lib/decorators/custom-element.js';
4
+ import { property } from '@refinitiv-ui/core/lib/decorators/property.js';
5
+ import { query } from '@refinitiv-ui/core/lib/decorators/query.js';
6
6
  import { VERSION } from '../version.js';
7
7
  import { registerOverflowTooltip } from '../tooltip/index.js';
8
8
  import '../icon/index.js';