@refinitiv-ui/elements 5.12.0-dev.0 → 5.12.2-build.1909289434.1.62

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 (137) hide show
  1. package/CHANGELOG.md +40 -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 +10 -11
  6. package/lib/button/index.js +3 -3
  7. package/lib/button-bar/index.js +4 -5
  8. package/lib/calendar/constants.js +1 -1
  9. package/lib/calendar/index.d.ts +1 -1
  10. package/lib/calendar/index.js +38 -15
  11. package/lib/calendar/locales.js +5 -5
  12. package/lib/calendar/types.d.ts +1 -1
  13. package/lib/calendar/utils.js +5 -5
  14. package/lib/canvas/index.js +3 -4
  15. package/lib/card/index.js +6 -7
  16. package/lib/chart/index.js +15 -22
  17. package/lib/chart/plugins/doughnut-center-label.js +6 -11
  18. package/lib/checkbox/index.js +3 -3
  19. package/lib/clock/index.js +6 -6
  20. package/lib/clock/utils/TickManager.js +2 -2
  21. package/lib/collapse/custom-elements.json +4 -2
  22. package/lib/collapse/custom-elements.md +1 -1
  23. package/lib/collapse/index.d.ts +20 -16
  24. package/lib/collapse/index.js +78 -50
  25. package/lib/collapse/themes/halo/dark/index.js +1 -1
  26. package/lib/collapse/themes/halo/light/index.js +1 -1
  27. package/lib/collapse/themes/solar/charcoal/index.js +1 -1
  28. package/lib/collapse/themes/solar/pearl/index.js +1 -1
  29. package/lib/color-dialog/elements/color-palettes.js +1 -1
  30. package/lib/color-dialog/elements/grayscale-palettes.js +2 -2
  31. package/lib/color-dialog/elements/palettes.js +4 -5
  32. package/lib/color-dialog/helpers/value-model.js +1 -1
  33. package/lib/color-dialog/index.d.ts +1 -1
  34. package/lib/color-dialog/index.js +6 -6
  35. package/lib/combo-box/helpers/filter.d.ts +1 -1
  36. package/lib/combo-box/helpers/types.d.ts +1 -1
  37. package/lib/combo-box/index.d.ts +4 -4
  38. package/lib/combo-box/index.js +30 -14
  39. package/lib/counter/index.d.ts +6 -6
  40. package/lib/counter/index.js +8 -8
  41. package/lib/datetime-picker/index.js +6 -7
  42. package/lib/datetime-picker/utils.js +1 -1
  43. package/lib/dialog/custom-elements.json +11 -0
  44. package/lib/dialog/custom-elements.md +4 -3
  45. package/lib/dialog/draggable-element.js +1 -2
  46. package/lib/dialog/index.d.ts +18 -1
  47. package/lib/dialog/index.js +35 -10
  48. package/lib/email-field/index.d.ts +1 -1
  49. package/lib/email-field/index.js +8 -3
  50. package/lib/flag/index.js +3 -3
  51. package/lib/flag/utils/FlagLoader.d.ts +1 -1
  52. package/lib/flag/utils/FlagLoader.js +1 -1
  53. package/lib/header/index.js +2 -2
  54. package/lib/heatmap/helpers/color.d.ts +1 -1
  55. package/lib/heatmap/helpers/color.js +3 -5
  56. package/lib/heatmap/index.js +19 -28
  57. package/lib/icon/index.js +3 -3
  58. package/lib/icon/utils/IconLoader.d.ts +1 -1
  59. package/lib/icon/utils/IconLoader.js +1 -1
  60. package/lib/interactive-chart/helpers/types.d.ts +1 -1
  61. package/lib/interactive-chart/index.js +10 -14
  62. package/lib/item/helpers/types.d.ts +1 -1
  63. package/lib/item/index.js +5 -8
  64. package/lib/label/index.js +4 -4
  65. package/lib/layout/index.js +2 -2
  66. package/lib/led-gauge/index.js +2 -2
  67. package/lib/list/helpers/types.d.ts +1 -1
  68. package/lib/list/index.d.ts +1 -1
  69. package/lib/list/index.js +4 -4
  70. package/lib/list/renderer.d.ts +1 -1
  71. package/lib/loader/index.js +1 -1
  72. package/lib/multi-input/helpers/types.d.ts +1 -1
  73. package/lib/multi-input/index.js +6 -7
  74. package/lib/notification/elements/notification-tray.js +3 -3
  75. package/lib/notification/elements/notification.js +2 -2
  76. package/lib/number-field/index.d.ts +3 -3
  77. package/lib/number-field/index.js +14 -4
  78. package/lib/overlay/elements/overlay-backdrop.js +2 -2
  79. package/lib/overlay/elements/overlay-viewport.js +1 -1
  80. package/lib/overlay/elements/overlay.js +9 -7
  81. package/lib/overlay/managers/focus-manager.js +2 -3
  82. package/lib/overlay/managers/interaction-lock-manager.js +1 -1
  83. package/lib/overlay/managers/viewport-manager.js +4 -5
  84. package/lib/overlay/managers/zindex-manager.js +1 -1
  85. package/lib/overlay-menu/helpers/types.d.ts +1 -1
  86. package/lib/overlay-menu/index.js +12 -15
  87. package/lib/overlay-menu/managers/menu-manager.js +1 -1
  88. package/lib/pagination/index.d.ts +1 -1
  89. package/lib/pagination/index.js +7 -8
  90. package/lib/panel/index.js +2 -2
  91. package/lib/password-field/index.d.ts +2 -2
  92. package/lib/password-field/index.js +7 -4
  93. package/lib/pill/index.d.ts +16 -0
  94. package/lib/pill/index.js +36 -5
  95. package/lib/pill/themes/halo/dark/index.js +1 -1
  96. package/lib/pill/themes/halo/light/index.js +1 -1
  97. package/lib/pill/themes/solar/charcoal/index.js +1 -1
  98. package/lib/pill/themes/solar/pearl/index.js +1 -1
  99. package/lib/progress-bar/index.js +3 -3
  100. package/lib/radio-button/index.d.ts +2 -2
  101. package/lib/radio-button/index.js +6 -6
  102. package/lib/radio-button/radio-button-registry.d.ts +1 -1
  103. package/lib/radio-button/radio-button-registry.js +4 -2
  104. package/lib/rating/index.js +4 -4
  105. package/lib/search-field/index.d.ts +2 -2
  106. package/lib/search-field/index.js +8 -4
  107. package/lib/select/index.js +11 -14
  108. package/lib/sidebar-layout/index.js +4 -4
  109. package/lib/slider/index.js +16 -8
  110. package/lib/sparkline/index.js +9 -10
  111. package/lib/swing-gauge/index.js +14 -8
  112. package/lib/tab/custom-elements.json +13 -0
  113. package/lib/tab/custom-elements.md +1 -0
  114. package/lib/tab/index.d.ts +32 -14
  115. package/lib/tab/index.js +63 -35
  116. package/lib/tab-bar/custom-elements.json +12 -0
  117. package/lib/tab-bar/custom-elements.md +7 -0
  118. package/lib/tab-bar/index.d.ts +97 -7
  119. package/lib/tab-bar/index.js +250 -40
  120. package/lib/text-field/index.d.ts +14 -1
  121. package/lib/text-field/index.js +35 -11
  122. package/lib/time-picker/index.d.ts +1 -1
  123. package/lib/time-picker/index.js +10 -11
  124. package/lib/toggle/index.js +2 -2
  125. package/lib/tooltip/index.js +6 -8
  126. package/lib/tooltip/managers/tooltip-manager.js +2 -2
  127. package/lib/tornado-chart/elements/tornado-chart.js +2 -2
  128. package/lib/tornado-chart/elements/tornado-item.js +3 -3
  129. package/lib/tree/elements/tree-item.js +2 -2
  130. package/lib/tree/elements/tree.d.ts +1 -1
  131. package/lib/tree/elements/tree.js +2 -2
  132. package/lib/tree/helpers/types.d.ts +1 -1
  133. package/lib/tree/managers/tree-manager.d.ts +1 -1
  134. package/lib/tree-select/index.d.ts +3 -3
  135. package/lib/tree-select/index.js +21 -17
  136. package/lib/version.js +1 -1
  137. package/package.json +19 -299
package/CHANGELOG.md CHANGED
@@ -3,6 +3,46 @@
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.2](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@5.12.1...@refinitiv-ui/elements@5.12.2) (2022-02-17)
7
+
8
+ **Note:** Version bump only for package @refinitiv-ui/elements
9
+
10
+
11
+
12
+
13
+
14
+ ## [5.12.1](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@5.12.0...@refinitiv-ui/elements@5.12.1) (2022-02-15)
15
+
16
+ **Note:** Version bump only for package @refinitiv-ui/elements
17
+
18
+
19
+
20
+
21
+
22
+ # [5.12.0](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@5.11.0...@refinitiv-ui/elements@5.12.0) (2022-02-15)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * radio-button not add to group ([#167](https://github.com/Refinitiv/refinitiv-ui/issues/167)) ([fb05273](https://github.com/Refinitiv/refinitiv-ui/commit/fb052730cf8c7eeb376a3a49501b85dc363bf614))
28
+ * **slider:** value-changed event is not fired ([#174](https://github.com/Refinitiv/refinitiv-ui/issues/174)) ([687f244](https://github.com/Refinitiv/refinitiv-ui/commit/687f244b4d848a684dc986158f324974931a3689))
29
+
30
+
31
+ ### Features
32
+
33
+ * **button-bar:** improve screen reader support ([#176](https://github.com/Refinitiv/refinitiv-ui/issues/176)) ([f121ea6](https://github.com/Refinitiv/refinitiv-ui/commit/f121ea62fbdc160823dff386ec937b45d0a131e7))
34
+ * **collapse:** accessibility support ([#203](https://github.com/Refinitiv/refinitiv-ui/issues/203)) ([12ae2f7](https://github.com/Refinitiv/refinitiv-ui/commit/12ae2f7fe036d0351e69f5daca4369fae4097917))
35
+ * **collapse:** add accessibility support ([#161](https://github.com/Refinitiv/refinitiv-ui/issues/161)) ([158f031](https://github.com/Refinitiv/refinitiv-ui/commit/158f0317dd4df9ab76e1bd27d4aa02151787c252))
36
+
37
+
38
+ ### Reverts
39
+
40
+ * Revert "feat(collapse): add accessibility support (#161)" (#179) ([9a0ad70](https://github.com/Refinitiv/refinitiv-ui/commit/9a0ad709d71c243fe68dbc38318a04745ea5b23b)), closes [#161](https://github.com/Refinitiv/refinitiv-ui/issues/161) [#179](https://github.com/Refinitiv/refinitiv-ui/issues/179)
41
+
42
+
43
+
44
+
45
+
6
46
  # [5.11.0](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@5.10.1...@refinitiv-ui/elements@5.11.0) (2022-01-14)
7
47
 
8
48
 
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/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';
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';
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/lib/decorators/custom-element.js';
4
- import { property } from '@refinitiv-ui/core/lib/decorators/property.js';
3
+ import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
4
+ import { property } from '@refinitiv-ui/core/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/lib/decorators/custom-element.js';
4
- import { property } from '@refinitiv-ui/core/lib/decorators/property.js';
3
+ import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
4
+ import { property } from '@refinitiv-ui/core/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/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';
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';
8
8
  import { VERSION } from '../version.js';
9
- import { AnimationTaskRunner, TimeoutTaskRunner } from '@refinitiv-ui/utils/lib/async.js';
9
+ import { AnimationTaskRunner, TimeoutTaskRunner } from '@refinitiv-ui/utils/async.js';
10
10
  import { escapeRegExp, itemHighlightable, itemRenderer, queryWordSelect } from './helpers/utils.js';
11
- import { isIE, isMobile } from '@refinitiv-ui/utils/lib/browser.js';
11
+ import { isIE, isMobile } from '@refinitiv-ui/utils/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 === null || suggestion === void 0 ? void 0 : suggestion.label) || query;
535
+ this.attachTarget.value = suggestion && suggestion?.label || query;
536
536
  }
537
537
  }
538
538
  /**
@@ -1181,13 +1181,12 @@ let Autosuggest = Autosuggest_1 = class Autosuggest extends Overlay {
1181
1181
  */
1182
1182
  /* istanbul ignore next */
1183
1183
  calculateContentMaxHeight(size) {
1184
- var _a, _b, _c;
1185
1184
  if (!isIE) {
1186
1185
  return;
1187
1186
  }
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();
1187
+ const headerRect = this.headerElement?.getBoundingClientRect();
1188
+ const footerRect = this.footerElement?.getBoundingClientRect();
1189
+ const contentRect = this.contentElement?.getBoundingClientRect();
1191
1190
  const dialogHeight = size.height;
1192
1191
  const headerHeight = headerRect ? headerRect.height : 0;
1193
1192
  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/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';
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';
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/lib/decorators/custom-element.js';
5
- import { property } from '@refinitiv-ui/core/lib/decorators/property.js';
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';
6
7
  import { VERSION } from '../version.js';
7
8
  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,8 +256,7 @@ 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
- var _a;
260
- return (_a = this.defaultSlot.value) === null || _a === void 0 ? void 0 : _a.assignedNodes().filter(node => node instanceof Element);
259
+ return this.defaultSlot.value?.assignedNodes().filter(node => node instanceof Element);
261
260
  }
262
261
  /**
263
262
  * Return the array of Buttons which focusable
@@ -1,4 +1,4 @@
1
- import { uuid } from '@refinitiv-ui/utils/lib/uuid.js';
1
+ import { uuid } from '@refinitiv-ui/utils/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/lib/locale/en/calendar.js';
7
+ import '@refinitiv-ui/phrasebook/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/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';
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';
10
10
  import { VERSION } from '../version.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';
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';
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/lib/locale/en/calendar.js';
19
+ import '@refinitiv-ui/phrasebook/locale/en/calendar.js';
20
20
  /**
21
21
  * Standard calendar element
22
22
  *
@@ -925,7 +925,14 @@ 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 = 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));
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
+ };
929
936
  cells.push(cell);
930
937
  years.push(cell);
931
938
  }
@@ -962,7 +969,15 @@ let Calendar = class Calendar extends ControlElement {
962
969
  const segment = { year, month, day: 1 };
963
970
  const value = utcFormat(segment, DateFormat.yyyyMMdd);
964
971
  const idle = i < before || i >= after;
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));
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
+ };
966
981
  cells.push(cell);
967
982
  months.push(cell);
968
983
  }
@@ -1026,8 +1041,16 @@ let Calendar = class Calendar extends ControlElement {
1026
1041
  }
1027
1042
  const value = utcFormat({ year, month, day }, DateFormat.yyyyMMdd);
1028
1043
  const disabled = this.isDateAvailable ? !this.isDateAvailable(value) : false;
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));
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
+ };
1031
1054
  cells.push(dayCell);
1032
1055
  days.push(dayCell);
1033
1056
  }
@@ -9,20 +9,20 @@ const globals = {
9
9
  FIRST_DAY_OF_WEEK: '1'
10
10
  };
11
11
  const en = globals;
12
- const enUS = Object.assign(Object.assign({}, en), { FIRST_DAY_OF_WEEK: '0' });
12
+ const enUS = { ...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 = Object.assign(Object.assign({}, fr), { FIRST_DAY_OF_WEEK: '0' });
17
+ const frCA = { ...fr, FIRST_DAY_OF_WEEK: '0' };
18
18
  const it = globals;
19
19
  const ja = globals;
20
- const ko = Object.assign(Object.assign({}, globals), { FIRST_DAY_OF_WEEK: '0' });
20
+ const ko = { ...globals, FIRST_DAY_OF_WEEK: '0' };
21
21
  const pl = globals;
22
22
  const ru = globals;
23
- const th = Object.assign(Object.assign({}, globals), { FIRST_DAY_OF_WEEK: '0' });
23
+ const th = { ...globals, FIRST_DAY_OF_WEEK: '0' };
24
24
  const zh = globals;
25
- const ar = Object.assign(Object.assign({}, globals), { FIRST_DAY_OF_WEEK: '6' });
25
+ const ar = { ...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,4 +1,4 @@
1
- import { CellIndex } from '@refinitiv-ui/utils/lib/navigation.js';
1
+ import { CellIndex } from '@refinitiv-ui/utils/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/lib/date.js';
1
+ import { toDateSegment, getDaysInMonth, utcParse } from '@refinitiv-ui/utils/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: 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' })
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' }
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/lib/decorators/custom-element.js';
4
- import { property } from '@refinitiv-ui/core/lib/decorators/property.js';
3
+ import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
4
+ import { property } from '@refinitiv-ui/core/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,8 +64,7 @@ let Canvas = class Canvas extends ResponsiveElement {
64
64
  * @type {HTMLCanvasElement}
65
65
  */
66
66
  get canvas() {
67
- var _a;
68
- return (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('canvas');
67
+ return this.shadowRoot?.getElementById('canvas');
69
68
  }
70
69
  /**
71
70
  * 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/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';
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';
7
7
  import { VERSION } from '../version.js';
8
- import { isSlotEmpty } from '@refinitiv-ui/utils/lib/is-slot-empty.js';
8
+ import { isSlotEmpty } from '@refinitiv-ui/utils/is-slot-empty.js';
9
9
  import '../label/index.js';
10
10
  import '../button/index.js';
11
11
  import '../overlay-menu/index.js';
@@ -78,8 +78,7 @@ let Card = class Card extends BasicElement {
78
78
  return this._config;
79
79
  }
80
80
  set config(config) {
81
- var _a;
82
- const data = (_a = config === null || config === void 0 ? void 0 : config.menu) === null || _a === void 0 ? void 0 : _a.data;
81
+ const data = config?.menu?.data;
83
82
  if (data !== this.menuData) {
84
83
  this.menuData = data;
85
84
  }
@@ -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/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';
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
6
  import { VERSION } from '../version.js';
7
- import { color as parseColor } from '@refinitiv-ui/utils/lib/color.js';
7
+ import { color as parseColor } from '@refinitiv-ui/utils/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,8 +54,7 @@ let Chart = class Chart extends BasicElement {
54
54
  * @returns {Chart.ChartLegendLabelItem[]} Array of label configurations
55
55
  */
56
56
  this.generateLegendLabels = (chart) => {
57
- var _a, _b, _c, _d;
58
- if (!((_a = this.config) === null || _a === void 0 ? void 0 : _a.type)) {
57
+ if (!this.config?.type) {
59
58
  return [];
60
59
  }
61
60
  const chartOption = DEFAULT_CHART_CONFIG[this.config.type];
@@ -63,11 +62,11 @@ let Chart = class Chart extends BasicElement {
63
62
  && chartOption.legend
64
63
  && Array.isArray(this.datasets[0].backgroundColor)) {
65
64
  let legends = [];
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);
65
+ if (chartOption.legend.labels?.generateLabels) {
66
+ legends = chartOption.legend.labels?.generateLabels(chart);
68
67
  }
69
68
  // Customize for doughnut chart change border color to background color
70
- if (['pie', 'doughnut'].includes((_d = this.config) === null || _d === void 0 ? void 0 : _d.type) && this.datasets.length > 1) {
69
+ if (['pie', 'doughnut'].includes(this.config?.type) && this.datasets.length > 1) {
71
70
  legends.forEach((label) => {
72
71
  label.strokeStyle = label.fillStyle;
73
72
  });
@@ -75,9 +74,8 @@ let Chart = class Chart extends BasicElement {
75
74
  return legends;
76
75
  }
77
76
  return this.datasets.map((dataset, i) => {
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;
77
+ const solidFill = !CHART_TYPE_OPAQUE.includes(dataset.type || this.config?.type);
78
+ const usePointStyle = chart.options.legend?.labels?.usePointStyle || false;
81
79
  return {
82
80
  text: dataset.label,
83
81
  fillStyle: legendHelper.getLegendFillStyle(dataset, usePointStyle, solidFill),
@@ -122,8 +120,7 @@ let Chart = class Chart extends BasicElement {
122
120
  * @returns chart title
123
121
  */
124
122
  get chartTitle() {
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;
123
+ const title = this.config?.options?.title?.text;
127
124
  if (title) {
128
125
  return typeof title === 'string' ? title : title.join();
129
126
  }
@@ -134,8 +131,7 @@ let Chart = class Chart extends BasicElement {
134
131
  * @returns dataset array
135
132
  */
136
133
  get 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) || [];
134
+ return this.config?.data?.datasets || [];
139
135
  }
140
136
  /**
141
137
  * List of available chart colors
@@ -186,7 +182,6 @@ let Chart = class Chart extends BasicElement {
186
182
  * @returns {ChartConfig} chart config with theme
187
183
  */
188
184
  get themableConfig() {
189
- var _a;
190
185
  const style = getComputedStyle(this);
191
186
  // TODO: Try and remove the need for global object modification.
192
187
  // It's easier to cover all areas by modifying the global object,
@@ -222,7 +217,7 @@ let Chart = class Chart extends BasicElement {
222
217
  displayColors: false
223
218
  },
224
219
  legend: {
225
- position: ['pie', 'doughnut'].includes(((_a = this.config) === null || _a === void 0 ? void 0 : _a.type) || '') ? 'right' : 'top',
220
+ position: ['pie', 'doughnut'].includes(this.config?.type || '') ? 'right' : 'top',
226
221
  labels: {
227
222
  boxWidth: this.cssVarAsNumber('--legend-key-box-width', '10'),
228
223
  generateLabels: this.generateLegendLabels
@@ -291,8 +286,7 @@ let Chart = class Chart extends BasicElement {
291
286
  * @returns {Chart.ChartDataSets} Information about the dataset
292
287
  */
293
288
  datasetInfo(dataset) {
294
- var _a;
295
- const type = dataset.type || ((_a = this.config) === null || _a === void 0 ? void 0 : _a.type);
289
+ const type = dataset.type || this.config?.type;
296
290
  let index = this.datasets.indexOf(dataset);
297
291
  const isColorArray = (!!type && ['pie', 'doughnut', 'polarArea'].includes(type)) || type === 'bar' && this.datasets.length === 1;
298
292
  const isSolidFill = !!type && !CHART_TYPE_OPAQUE.includes(type);
@@ -456,8 +450,7 @@ let Chart = class Chart extends BasicElement {
456
450
  * @returns {void}
457
451
  */
458
452
  onResize() {
459
- var _a;
460
- (_a = this.chart) === null || _a === void 0 ? void 0 : _a.resize();
453
+ this.chart?.resize();
461
454
  }
462
455
  /**
463
456
  * A `TemplateResult` that will be used
@@ -1,7 +1,6 @@
1
1
  const CHART = window.Chart;
2
2
  const getPluginConfig = (chart) => {
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;
3
+ return chart.config.options?.plugins?.centerLabel;
5
4
  };
6
5
  /**
7
6
  * Draw line
@@ -10,18 +9,17 @@ const getPluginConfig = (chart) => {
10
9
  * @returns {void}
11
10
  */
12
11
  const drawItemBorder = function (chart, active) {
13
- var _a, _b, _c;
14
12
  if (!chart.data.datasets) {
15
13
  return;
16
14
  }
17
- if (active === null || active === void 0 ? void 0 : active.length) {
15
+ if (active?.length) {
18
16
  const ctx = chart.ctx;
19
17
  const chartItem = active[0];
20
18
  const vm = chartItem._view;
21
19
  const datasets = chart.data.datasets[chartItem._datasetIndex];
22
20
  vm.backgroundColor = datasets.backgroundColor[chartItem._index];
23
21
  vm.backgroundColor = CHART.helpers.getHoverColor(vm.backgroundColor); // we need to make color bolder
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));
22
+ vm.borderWidth = (datasets.borderWidth || chart.config.options?.elements?.arc?.borderWidth);
25
23
  vm.borderColor = (getComputedStyle(chart.canvas).getPropertyValue('--doughnut-border-color') || CHART.defaults.global.defaultFontColor);
26
24
  const sA = vm.startAngle;
27
25
  const eA = vm.endAngle;
@@ -73,7 +71,6 @@ const plugins = {
73
71
  }
74
72
  },
75
73
  beforeDraw: function (chart) {
76
- var _a;
77
74
  const config = getPluginConfig(chart);
78
75
  if (!config) {
79
76
  return;
@@ -83,7 +80,7 @@ const plugins = {
83
80
  if (chart._select) {
84
81
  active = chart._select;
85
82
  }
86
- if ((_a = chart.active) === null || _a === void 0 ? void 0 : _a.length) {
83
+ if (chart.active?.length) {
87
84
  active = chart.active;
88
85
  }
89
86
  const renderText = config.onRenderLabel(chart, active);
@@ -155,7 +152,6 @@ const plugins = {
155
152
  }
156
153
  },
157
154
  afterDatasetUpdate: function (chart) {
158
- var _a;
159
155
  // Check chart already init selected.
160
156
  if (chart.selected !== undefined) {
161
157
  return;
@@ -165,7 +161,7 @@ const plugins = {
165
161
  if (!config || !config.selected || !chart.data.datasets) {
166
162
  return;
167
163
  }
168
- const selectedIndex = Number((_a = config.selected) === null || _a === void 0 ? void 0 : _a.index);
164
+ const selectedIndex = Number(config.selected?.index);
169
165
  const datasetIndex = Number(config.selected.datasetIndex || 0);
170
166
  const visibleIndexes = chart.getVisibleDatasetCount() - 1;
171
167
  // Validate index and datasetIndex
@@ -177,14 +173,13 @@ const plugins = {
177
173
  chart.selected = items ? [items] : [];
178
174
  },
179
175
  afterDraw: function (chart) {
180
- var _a;
181
176
  if (getPluginConfig(chart)) {
182
177
  // Draw active element
183
178
  // Note: use logic from chart.js - chart.js/src/elements/element.arc.js :draw()
184
179
  // hover
185
180
  drawItemBorder(chart, chart.active);
186
181
  // selected
187
- if ((_a = chart.selected) === null || _a === void 0 ? void 0 : _a.length) {
182
+ if (chart.selected?.length) {
188
183
  chart._select = chart.selected;
189
184
  chart.selected = [];
190
185
  }
@@ -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/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';
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
6
  import { VERSION } from '../version.js';
7
7
  import { registerOverflowTooltip } from '../tooltip/index.js';
8
8
  import '../icon/index.js';
@@ -1,12 +1,12 @@
1
1
  import { __decorate } from "tslib";
2
2
  import { html, css, WarningNotice, ResponsiveElement } from '@refinitiv-ui/core';
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
- import { ifDefined } from '@refinitiv-ui/core/lib/directives/if-defined.js';
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';
7
+ import { ifDefined } from '@refinitiv-ui/core/directives/if-defined.js';
8
8
  import { VERSION } from '../version.js';
9
- import { MILLISECONDS_IN_SECOND, HOURS_OF_NOON, isValidTime, toTimeSegment, TimeFormat, format, padNumber } from '@refinitiv-ui/utils/lib/date.js';
9
+ import { MILLISECONDS_IN_SECOND, HOURS_OF_NOON, isValidTime, toTimeSegment, TimeFormat, format, padNumber } from '@refinitiv-ui/utils/date.js';
10
10
  import { HOURS_IN_DAY, MINUTES_IN_HOUR, SECONDS_IN_DAY, SECONDS_IN_HOUR, SECONDS_IN_MINUTE } from './utils/timestamps.js';
11
11
  import { register, deRegister } from './utils/TickManager.js';
12
12
  const UP = 'Up';
@@ -1,5 +1,5 @@
1
- import { TimeoutTaskRunner } from '@refinitiv-ui/utils/lib/async.js';
2
- import { MILLISECONDS_IN_SECOND } from '@refinitiv-ui/utils/lib/date.js';
1
+ import { TimeoutTaskRunner } from '@refinitiv-ui/utils/async.js';
2
+ import { MILLISECONDS_IN_SECOND } from '@refinitiv-ui/utils/date.js';
3
3
  const tickSet = new Set();
4
4
  let timeout = null;
5
5
  /**
@@ -8,7 +8,8 @@
8
8
  {
9
9
  "name": "header",
10
10
  "description": "Set text on the header",
11
- "type": "string | null"
11
+ "type": "string",
12
+ "default": "\"\""
12
13
  },
13
14
  {
14
15
  "name": "level",
@@ -34,7 +35,8 @@
34
35
  "name": "header",
35
36
  "attribute": "header",
36
37
  "description": "Set text on the header",
37
- "type": "string | null"
38
+ "type": "string",
39
+ "default": "\"\""
38
40
  },
39
41
  {
40
42
  "name": "level",