@refinitiv-ui/elements 6.8.7 → 6.8.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (209) hide show
  1. package/CHANGELOG.md +180 -433
  2. package/LICENSE +1 -1
  3. package/README.md +13 -11
  4. package/lib/accordion/index.d.ts +1 -1
  5. package/lib/accordion/index.js +4 -7
  6. package/lib/appstate-bar/index.d.ts +2 -2
  7. package/lib/appstate-bar/index.js +10 -4
  8. package/lib/autosuggest/index.d.ts +7 -7
  9. package/lib/autosuggest/index.js +85 -80
  10. package/lib/autosuggest/themes/solar/charcoal/index.js +1 -1
  11. package/lib/autosuggest/themes/solar/pearl/index.js +1 -1
  12. package/lib/button/index.js +7 -10
  13. package/lib/button-bar/index.d.ts +1 -1
  14. package/lib/button-bar/index.js +12 -12
  15. package/lib/calendar/index.d.ts +39 -39
  16. package/lib/calendar/index.js +160 -125
  17. package/lib/calendar/utils.js +2 -2
  18. package/lib/canvas/index.d.ts +1 -1
  19. package/lib/canvas/index.js +2 -4
  20. package/lib/card/helpers/types.d.ts +2 -2
  21. package/lib/card/index.d.ts +5 -5
  22. package/lib/card/index.js +34 -28
  23. package/lib/chart/helpers/legend.js +10 -8
  24. package/lib/chart/index.d.ts +3 -3
  25. package/lib/chart/index.js +17 -17
  26. package/lib/chart/plugins/doughnut-center-label.js +6 -5
  27. package/lib/checkbox/index.d.ts +1 -1
  28. package/lib/checkbox/index.js +12 -13
  29. package/lib/clock/index.d.ts +55 -55
  30. package/lib/clock/index.js +84 -95
  31. package/lib/clock/themes/halo/dark/index.js +1 -1
  32. package/lib/clock/themes/halo/light/index.js +1 -1
  33. package/lib/clock/themes/solar/charcoal/index.js +1 -1
  34. package/lib/clock/themes/solar/pearl/index.js +1 -1
  35. package/lib/collapse/index.d.ts +1 -1
  36. package/lib/collapse/index.js +28 -19
  37. package/lib/collapse/themes/halo/dark/index.js +1 -1
  38. package/lib/collapse/themes/halo/light/index.js +1 -1
  39. package/lib/color-dialog/elements/color-palettes.d.ts +1 -1
  40. package/lib/color-dialog/elements/color-palettes.js +5 -6
  41. package/lib/color-dialog/elements/grayscale-palettes.d.ts +1 -1
  42. package/lib/color-dialog/elements/grayscale-palettes.js +9 -9
  43. package/lib/color-dialog/elements/palettes.js +5 -4
  44. package/lib/color-dialog/helpers/value-model.js +7 -9
  45. package/lib/color-dialog/index.d.ts +6 -6
  46. package/lib/color-dialog/index.js +53 -37
  47. package/lib/color-picker/index.d.ts +2 -2
  48. package/lib/color-picker/index.js +40 -34
  49. package/lib/combo-box/helpers/filter.d.ts +2 -2
  50. package/lib/combo-box/helpers/types.d.ts +1 -1
  51. package/lib/combo-box/index.d.ts +9 -9
  52. package/lib/combo-box/index.js +61 -55
  53. package/lib/configuration/elements/configuration.d.ts +1 -1
  54. package/lib/configuration/elements/configuration.js +2 -2
  55. package/lib/counter/index.d.ts +4 -4
  56. package/lib/counter/index.js +9 -7
  57. package/lib/datetime-field/index.d.ts +4 -5
  58. package/lib/datetime-field/index.js +32 -23
  59. package/lib/datetime-field/utils.js +11 -1
  60. package/lib/datetime-picker/index.d.ts +75 -75
  61. package/lib/datetime-picker/index.js +151 -132
  62. package/lib/datetime-picker/locales.js +5 -5
  63. package/lib/datetime-picker/utils.js +9 -9
  64. package/lib/dialog/draggable-element.js +1 -2
  65. package/lib/dialog/index.d.ts +6 -6
  66. package/lib/dialog/index.js +48 -38
  67. package/lib/email-field/index.d.ts +1 -1
  68. package/lib/email-field/index.js +6 -6
  69. package/lib/events.d.ts +1 -1
  70. package/lib/flag/index.d.ts +1 -1
  71. package/lib/flag/index.js +6 -5
  72. package/lib/flag/utils/FlagLoader.js +1 -1
  73. package/lib/header/index.d.ts +1 -1
  74. package/lib/header/index.js +2 -2
  75. package/lib/header/themes/halo/dark/index.js +1 -1
  76. package/lib/header/themes/halo/light/index.js +1 -1
  77. package/lib/header/themes/solar/charcoal/index.js +1 -1
  78. package/lib/header/themes/solar/pearl/index.js +1 -1
  79. package/lib/heatmap/helpers/color.d.ts +1 -1
  80. package/lib/heatmap/helpers/color.js +11 -5
  81. package/lib/heatmap/helpers/track.js +3 -3
  82. package/lib/heatmap/index.d.ts +9 -9
  83. package/lib/heatmap/index.js +51 -42
  84. package/lib/icon/index.d.ts +2 -2
  85. package/lib/icon/index.js +6 -8
  86. package/lib/icon/utils/IconLoader.d.ts +1 -0
  87. package/lib/icon/utils/IconLoader.js +9 -1
  88. package/lib/interactive-chart/helpers/types.d.ts +3 -3
  89. package/lib/interactive-chart/index.d.ts +34 -34
  90. package/lib/interactive-chart/index.js +72 -57
  91. package/lib/item/helpers/types.d.ts +1 -1
  92. package/lib/item/index.d.ts +3 -3
  93. package/lib/item/index.js +24 -20
  94. package/lib/jsx.d.ts +6 -4
  95. package/lib/label/index.d.ts +1 -1
  96. package/lib/label/index.js +11 -8
  97. package/lib/layout/index.d.ts +7 -7
  98. package/lib/layout/index.js +7 -7
  99. package/lib/led-gauge/index.d.ts +1 -1
  100. package/lib/led-gauge/index.js +10 -10
  101. package/lib/list/elements/list.d.ts +3 -3
  102. package/lib/list/elements/list.js +10 -12
  103. package/lib/list/helpers/renderer.js +2 -2
  104. package/lib/list/helpers/types.d.ts +1 -1
  105. package/lib/list/index.d.ts +1 -1
  106. package/lib/list/renderer.d.ts +7 -7
  107. package/lib/loader/index.js +7 -8
  108. package/lib/multi-input/index.d.ts +6 -6
  109. package/lib/multi-input/index.js +39 -45
  110. package/lib/notification/elements/notification-tray.d.ts +2 -2
  111. package/lib/notification/elements/notification-tray.js +3 -3
  112. package/lib/notification/elements/notification.d.ts +2 -2
  113. package/lib/notification/elements/notification.js +22 -14
  114. package/lib/notification/helpers/status.js +1 -1
  115. package/lib/number-field/index.d.ts +5 -6
  116. package/lib/number-field/index.js +37 -47
  117. package/lib/overlay/elements/overlay-viewport.d.ts +1 -1
  118. package/lib/overlay/elements/overlay.d.ts +2 -2
  119. package/lib/overlay/elements/overlay.js +154 -98
  120. package/lib/overlay/helpers/types.d.ts +1 -1
  121. package/lib/overlay/managers/backdrop-manager.d.ts +1 -1
  122. package/lib/overlay/managers/backdrop-manager.js +2 -2
  123. package/lib/overlay/managers/close-manager.js +2 -1
  124. package/lib/overlay/managers/focus-manager.js +23 -13
  125. package/lib/overlay/managers/interaction-lock-manager.d.ts +4 -4
  126. package/lib/overlay/managers/interaction-lock-manager.js +33 -25
  127. package/lib/overlay/managers/viewport-manager.d.ts +2 -2
  128. package/lib/overlay/managers/viewport-manager.js +3 -2
  129. package/lib/overlay/managers/zindex-manager.js +4 -2
  130. package/lib/overlay-menu/helpers/types.d.ts +2 -2
  131. package/lib/overlay-menu/index.d.ts +1 -1
  132. package/lib/overlay-menu/index.js +44 -33
  133. package/lib/overlay-menu/managers/menu-manager.d.ts +10 -10
  134. package/lib/overlay-menu/managers/menu-manager.js +15 -13
  135. package/lib/pagination/index.d.ts +4 -4
  136. package/lib/pagination/index.js +39 -14
  137. package/lib/panel/index.js +1 -1
  138. package/lib/password-field/index.d.ts +2 -2
  139. package/lib/password-field/index.js +4 -4
  140. package/lib/pill/index.d.ts +1 -1
  141. package/lib/pill/index.js +22 -19
  142. package/lib/progress-bar/index.d.ts +1 -1
  143. package/lib/progress-bar/index.js +38 -37
  144. package/lib/radio-button/index.d.ts +2 -2
  145. package/lib/radio-button/index.js +17 -12
  146. package/lib/radio-button/radio-button-registry.js +8 -5
  147. package/lib/rating/index.d.ts +1 -1
  148. package/lib/rating/index.js +2 -5
  149. package/lib/rating/utils.d.ts +6 -6
  150. package/lib/rating/utils.js +6 -6
  151. package/lib/search-field/index.d.ts +2 -2
  152. package/lib/search-field/index.js +4 -4
  153. package/lib/select/index.d.ts +34 -34
  154. package/lib/select/index.js +70 -83
  155. package/lib/sidebar-layout/index.d.ts +2 -2
  156. package/lib/sidebar-layout/index.js +7 -9
  157. package/lib/slider/index.d.ts +2 -2
  158. package/lib/slider/index.js +57 -45
  159. package/lib/slider/utils.d.ts +10 -10
  160. package/lib/slider/utils.js +10 -10
  161. package/lib/sparkline/index.d.ts +1 -1
  162. package/lib/sparkline/index.js +7 -8
  163. package/lib/swing-gauge/helpers.js +2 -2
  164. package/lib/swing-gauge/index.d.ts +19 -19
  165. package/lib/swing-gauge/index.js +91 -81
  166. package/lib/tab/index.d.ts +1 -1
  167. package/lib/tab/index.js +16 -27
  168. package/lib/tab/themes/halo/dark/index.js +1 -1
  169. package/lib/tab/themes/halo/light/index.js +1 -1
  170. package/lib/tab/themes/solar/charcoal/index.js +1 -1
  171. package/lib/tab/themes/solar/pearl/index.js +1 -1
  172. package/lib/tab-bar/helpers/animate.js +1 -1
  173. package/lib/tab-bar/index.d.ts +1 -1
  174. package/lib/tab-bar/index.js +34 -18
  175. package/lib/tab-bar/themes/halo/dark/index.js +1 -1
  176. package/lib/tab-bar/themes/halo/light/index.js +1 -1
  177. package/lib/text-field/index.d.ts +1 -1
  178. package/lib/text-field/index.js +36 -33
  179. package/lib/time-picker/index.d.ts +6 -6
  180. package/lib/time-picker/index.js +104 -90
  181. package/lib/toggle/index.d.ts +1 -1
  182. package/lib/toggle/index.js +4 -3
  183. package/lib/tooltip/elements/title-tooltip.js +2 -2
  184. package/lib/tooltip/index.d.ts +27 -27
  185. package/lib/tooltip/index.js +42 -38
  186. package/lib/tooltip/managers/tooltip-manager.d.ts +1 -1
  187. package/lib/tornado-chart/elements/tornado-chart.d.ts +1 -1
  188. package/lib/tornado-chart/elements/tornado-chart.js +1 -1
  189. package/lib/tornado-chart/elements/tornado-item.d.ts +2 -2
  190. package/lib/tornado-chart/elements/tornado-item.js +12 -10
  191. package/lib/tree/elements/tree-item.d.ts +3 -3
  192. package/lib/tree/elements/tree-item.js +21 -19
  193. package/lib/tree/elements/tree.d.ts +1 -1
  194. package/lib/tree/elements/tree.js +12 -11
  195. package/lib/tree/helpers/renderer.js +4 -3
  196. package/lib/tree/index.d.ts +1 -1
  197. package/lib/tree/managers/tree-manager.d.ts +1 -1
  198. package/lib/tree/managers/tree-manager.js +17 -18
  199. package/lib/tree/themes/solar/charcoal/index.js +1 -1
  200. package/lib/tree/themes/solar/pearl/index.js +1 -1
  201. package/lib/tree-select/index.d.ts +9 -9
  202. package/lib/tree-select/index.js +91 -82
  203. package/lib/tree-select/themes/halo/dark/index.js +1 -1
  204. package/lib/tree-select/themes/halo/light/index.js +1 -1
  205. package/lib/tree-select/themes/solar/charcoal/index.js +1 -1
  206. package/lib/tree-select/themes/solar/pearl/index.js +1 -1
  207. package/lib/version.js +1 -1
  208. package/package.json +16 -16
  209. package/tsconfig.tsbuildinfo +1 -1
@@ -1,21 +1,21 @@
1
1
  import { __decorate } from "tslib";
2
- import { ControlElement, html, css, nothing, WarningNotice } from '@refinitiv-ui/core';
2
+ import { ControlElement, WarningNotice, css, html, nothing } from '@refinitiv-ui/core';
3
3
  import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
4
4
  import { property } from '@refinitiv-ui/core/decorators/property.js';
5
5
  import { state } from '@refinitiv-ui/core/decorators/state.js';
6
6
  import { cache } from '@refinitiv-ui/core/directives/cache.js';
7
7
  import { guard } from '@refinitiv-ui/core/directives/guard.js';
8
- import { ref, createRef } from '@refinitiv-ui/core/directives/ref.js';
9
- import { VERSION } from '../version.js';
8
+ import { createRef, ref } from '@refinitiv-ui/core/directives/ref.js';
9
+ import '@refinitiv-ui/phrasebook/locale/en/calendar.js';
10
+ import { TranslatePropertyKey, getLocale, translate } from '@refinitiv-ui/translate';
10
11
  import { isIE } from '@refinitiv-ui/utils/browser.js';
11
- 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';
12
- import { left, right, up, down, first, last } from '@refinitiv-ui/utils/navigation.js';
13
- import { monthInfo, weekdaysNames, monthsNames, formatLocaleDate, ViewFormatTranslateParams } from './utils.js';
14
- import { translate, getLocale, TranslatePropertyKey } from '@refinitiv-ui/translate';
15
- import { RenderView, CalendarLocaleScope, FIRST_DAY_OF_WEEK, YEARS_PER_YEAR_VIEW, DAY_VIEW, YEAR_VIEW, MONTH_VIEW } from './constants.js';
16
- import './locales.js';
12
+ import { DateFormat, addMonths, format, isAfter, isBefore, isSameDay, isSameMonth, isSameYear, isThisMonth, isThisYear, isToday, isValidDate, isWeekend, parse, subMonths, toDateSegment, utcFormat, utcParse } from '@refinitiv-ui/utils/date.js';
13
+ import { down, first, last, left, right, up } from '@refinitiv-ui/utils/navigation.js';
17
14
  import '../button/index.js';
18
- import '@refinitiv-ui/phrasebook/locale/en/calendar.js';
15
+ import { VERSION } from '../version.js';
16
+ import { CalendarLocaleScope, DAY_VIEW, FIRST_DAY_OF_WEEK, MONTH_VIEW, RenderView, YEARS_PER_YEAR_VIEW, YEAR_VIEW } from './constants.js';
17
+ import './locales.js';
18
+ import { ViewFormatTranslateParams, formatLocaleDate, monthInfo, monthsNames, weekdaysNames } from './utils.js';
19
19
  /**
20
20
  * Standard calendar element
21
21
  *
@@ -41,28 +41,28 @@ let Calendar = class Calendar extends ControlElement {
41
41
  this._min = '';
42
42
  this._max = '';
43
43
  /**
44
- * Only enable weekdays
45
- */
44
+ * Only enable weekdays
45
+ */
46
46
  this.weekdaysOnly = false;
47
47
  /**
48
- * Only enable weekends
49
- */
48
+ * Only enable weekends
49
+ */
50
50
  this.weekendsOnly = false;
51
51
  /**
52
- * Custom filter, used for enabling/disabling certain dates
53
- * @type {CalendarFilter | null}
54
- */
52
+ * Custom filter, used for enabling/disabling certain dates
53
+ * @type {CalendarFilter | null}
54
+ */
55
55
  this.filter = null;
56
56
  this._view = '';
57
57
  this.localFirstDayOfWeek = FIRST_DAY_OF_WEEK; // used from locales. 0 stands for Sunday
58
58
  this._firstDayOfWeek = null; // used from setter
59
59
  /**
60
- * Set to switch to range select mode
61
- */
60
+ * Set to switch to range select mode
61
+ */
62
62
  this.range = false;
63
63
  /**
64
- * Set to switch to multiple select mode
65
- */
64
+ * Set to switch to multiple select mode
65
+ */
66
66
  this.multiple = false;
67
67
  this._values = [];
68
68
  /**
@@ -105,19 +105,20 @@ let Calendar = class Calendar extends ControlElement {
105
105
  :host {
106
106
  display: inline-block;
107
107
  }
108
- [part~=navigation], [part~=navigation] section {
108
+ [part~='navigation'],
109
+ [part~='navigation'] section {
109
110
  display: flex;
110
111
  flex-flow: row nowrap;
111
112
  }
112
- [part~=navigation] {
113
+ [part~='navigation'] {
113
114
  justify-content: space-between;
114
115
  }
115
- [part~=navigation] > div {
116
+ [part~='navigation'] > div {
116
117
  display: flex;
117
118
  flex: 1;
118
119
  justify-content: center;
119
120
  }
120
- [part~=cell-content] {
121
+ [part~='cell-content'] {
121
122
  position: absolute;
122
123
  top: 0;
123
124
  bottom: 0;
@@ -127,44 +128,45 @@ let Calendar = class Calendar extends ControlElement {
127
128
  align-items: center;
128
129
  justify-content: center;
129
130
  }
130
- [part=navigation] [part] {
131
+ [part='navigation'] [part] {
131
132
  flex: none;
132
133
  }
133
- [part=table] {
134
+ [part='table'] {
134
135
  width: 100%;
135
136
  }
136
- [part~=row] {
137
+ [part~='row'] {
137
138
  display: flex;
138
139
  width: 100%;
139
140
  }
140
- [part~=cell] {
141
+ [part~='cell'] {
141
142
  position: relative;
142
143
  }
143
- [part~=cell][part~=year] {
144
+ [part~='cell'][part~='year'] {
144
145
  width: calc(100% / ${YEAR_VIEW.columnCount});
145
146
  padding-top: calc(100% / ${YEAR_VIEW.columnCount});
146
147
  }
147
- [part~=cell][part~=month] {
148
+ [part~='cell'][part~='month'] {
148
149
  width: calc(100% / ${MONTH_VIEW.columnCount});
149
150
  padding-top: calc(100% / ${MONTH_VIEW.columnCount});
150
151
  }
151
- [part~=cell][part~=day], [part~=cell][part~=day-name] {
152
+ [part~='cell'][part~='day'],
153
+ [part~='cell'][part~='day-name'] {
152
154
  width: calc(100% / ${DAY_VIEW.columnCount});
153
155
  padding-top: calc(100% / ${DAY_VIEW.columnCount});
154
156
  }
155
- [part~=cell-content]:not([tabindex]) {
157
+ [part~='cell-content']:not([tabindex]) {
156
158
  pointer-events: none;
157
159
  }
158
- [part~=selectable] {
160
+ [part~='selectable'] {
159
161
  cursor: pointer;
160
162
  }
161
163
  `;
162
164
  }
163
165
  /**
164
- * Set minimum date
165
- * @param min min date
166
- * @default -
167
- */
166
+ * Set minimum date
167
+ * @param min min date
168
+ * @default -
169
+ */
168
170
  set min(min) {
169
171
  const oldMin = this._min;
170
172
  if (!this.isValidValue(min)) {
@@ -180,10 +182,10 @@ let Calendar = class Calendar extends ControlElement {
180
182
  return this._min;
181
183
  }
182
184
  /**
183
- * Set maximum date
184
- * @param max max date
185
- * @default -
186
- */
185
+ * Set maximum date
186
+ * @param max max date
187
+ * @default -
188
+ */
187
189
  set max(max) {
188
190
  const oldMax = this._max;
189
191
  if (!this.isValidValue(max)) {
@@ -199,10 +201,10 @@ let Calendar = class Calendar extends ControlElement {
199
201
  return this._max;
200
202
  }
201
203
  /**
202
- * Current calendar view date
203
- * @param view view date
204
- * @default -
205
- */
204
+ * Current calendar view date
205
+ * @param view view date
206
+ * @default -
207
+ */
206
208
  set view(view) {
207
209
  if (view && !isValidDate(view, DateFormat.yyyyMM)) {
208
210
  this.warnInvalidView(view);
@@ -217,7 +219,10 @@ let Calendar = class Calendar extends ControlElement {
217
219
  }
218
220
  get view() {
219
221
  /* as soon as user interaction has happened, always rely on view */
220
- return this._view || (this.value ? utcFormat(toDateSegment(this.value), DateFormat.yyyyMM) : format(new Date(), DateFormat.yyyyMM));
222
+ return (this._view ||
223
+ (this.value
224
+ ? utcFormat(toDateSegment(this.value), DateFormat.yyyyMM)
225
+ : format(new Date(), DateFormat.yyyyMM)));
221
226
  }
222
227
  /**
223
228
  * Set the first day of the week.
@@ -238,10 +243,10 @@ let Calendar = class Calendar extends ControlElement {
238
243
  return this._firstDayOfWeek === null ? this.localFirstDayOfWeek : this._firstDayOfWeek;
239
244
  }
240
245
  /**
241
- * Current date time value
242
- * @param value Calendar value
243
- * @default -
244
- */
246
+ * Current date time value
247
+ * @param value Calendar value
248
+ * @default -
249
+ */
245
250
  set value(value) {
246
251
  this.values = [value];
247
252
  }
@@ -341,7 +346,7 @@ let Calendar = class Calendar extends ControlElement {
341
346
  */
342
347
  async performUpdate() {
343
348
  const localFirstDayOfWeek = Number(await this.dateTPromise('FIRST_DAY_OF_WEEK'));
344
- this.localFirstDayOfWeek = isNaN(localFirstDayOfWeek) ? FIRST_DAY_OF_WEEK : (localFirstDayOfWeek % 7);
349
+ this.localFirstDayOfWeek = isNaN(localFirstDayOfWeek) ? FIRST_DAY_OF_WEEK : localFirstDayOfWeek % 7;
345
350
  void super.performUpdate();
346
351
  }
347
352
  /**
@@ -354,15 +359,18 @@ let Calendar = class Calendar extends ControlElement {
354
359
  super.willUpdate(changedProperties);
355
360
  // This code is here to ensure that focus is not lost
356
361
  // while navigating through the render views using keyboard
357
- if (this.focused && changedProperties.has('renderView') && this.viewBtnRef.value && this.activeElement !== this.viewBtnRef.value) {
362
+ if (this.focused &&
363
+ changedProperties.has('renderView') &&
364
+ this.viewBtnRef.value &&
365
+ this.activeElement !== this.viewBtnRef.value) {
358
366
  this.viewBtnRef.value.focus();
359
367
  }
360
368
  }
361
369
  /**
362
- * Updates the element
363
- * @param changedProperties Properties that has changed
364
- * @returns {void}
365
- */
370
+ * Updates the element
371
+ * @param changedProperties Properties that has changed
372
+ * @returns {void}
373
+ */
366
374
  update(changedProperties) {
367
375
  if (!this.localMonthsNames || changedProperties.has(TranslatePropertyKey)) {
368
376
  const locale = getLocale(this);
@@ -400,7 +408,7 @@ let Calendar = class Calendar extends ControlElement {
400
408
  */
401
409
  firstUpdated(changedProperties) {
402
410
  super.firstUpdated(changedProperties);
403
- this.renderRoot.addEventListener('keydown', event => this.onKeyDown(event));
411
+ this.renderRoot.addEventListener('keydown', (event) => this.onKeyDown(event));
404
412
  }
405
413
  /**
406
414
  * Show invalid view message
@@ -419,10 +427,10 @@ let Calendar = class Calendar extends ControlElement {
419
427
  new WarningNotice(`The specified value "${value}" does not conform to the required format. The format is "yyyy-MM-dd".`).once();
420
428
  }
421
429
  /**
422
- * Validate that the value confirms the control type
423
- * @param value Value to check
424
- * @returns false if value is invalid
425
- */
430
+ * Validate that the value confirms the control type
431
+ * @param value Value to check
432
+ * @returns false if value is invalid
433
+ */
426
434
  isValidValue(value) {
427
435
  return value === '' || isValidDate(value);
428
436
  }
@@ -434,7 +442,7 @@ let Calendar = class Calendar extends ControlElement {
434
442
  */
435
443
  filterAndWarnInvalidValues(values) {
436
444
  const filtered = [];
437
- values.forEach(value => {
445
+ values.forEach((value) => {
438
446
  if (this.isValidValue(value)) {
439
447
  value && filtered.push(value);
440
448
  }
@@ -450,11 +458,11 @@ let Calendar = class Calendar extends ControlElement {
450
458
  * @returns true if filter needs to be constructed
451
459
  */
452
460
  shouldConstructFilters(changedProperties) {
453
- return changedProperties.has('min')
454
- || changedProperties.has('max')
455
- || changedProperties.has('weekdaysOnly')
456
- || changedProperties.has('weekendsOnly')
457
- || changedProperties.has('filter');
461
+ return (changedProperties.has('min') ||
462
+ changedProperties.has('max') ||
463
+ changedProperties.has('weekdaysOnly') ||
464
+ changedProperties.has('weekendsOnly') ||
465
+ changedProperties.has('filter'));
458
466
  }
459
467
  /**
460
468
  * Construct and store a collection of filters
@@ -463,13 +471,13 @@ let Calendar = class Calendar extends ControlElement {
463
471
  */
464
472
  constructFilters() {
465
473
  const filters = [];
466
- this.min && filters.push(date => isSameDay(date, this.min) || isAfter(date, this.min));
467
- this.max && filters.push(date => isSameDay(date, this.max) || isBefore(date, this.max));
474
+ this.min && filters.push((date) => isSameDay(date, this.min) || isAfter(date, this.min));
475
+ this.max && filters.push((date) => isSameDay(date, this.max) || isBefore(date, this.max));
468
476
  if (this.weekdaysOnly) {
469
- filters.push(date => !isWeekend(date));
477
+ filters.push((date) => !isWeekend(date));
470
478
  }
471
479
  if (this.weekendsOnly) {
472
- filters.push(date => isWeekend(date));
480
+ filters.push((date) => isWeekend(date));
473
481
  }
474
482
  if (this.filter) {
475
483
  filters.push(this.filter);
@@ -538,7 +546,7 @@ let Calendar = class Calendar extends ControlElement {
538
546
  * @returns {void}
539
547
  */
540
548
  setNavigationMap(rows) {
541
- this.navigationGrid = rows.map(row => row.map(cell => cell.value && !cell.disabled ? 1 : 0));
549
+ this.navigationGrid = rows.map((row) => row.map((cell) => (cell.value && !cell.disabled ? 1 : 0)));
542
550
  }
543
551
  /**
544
552
  * Run when next button is tapped.
@@ -632,14 +640,16 @@ let Calendar = class Calendar extends ControlElement {
632
640
  this.activeCellIndex = cell.index;
633
641
  const cellSegment = toDateSegment(cell.value);
634
642
  const viewSegment = toDateSegment(this.view);
635
- if (this.renderView === RenderView.YEAR) { /* YEAR -> MONTH */
643
+ if (this.renderView === RenderView.YEAR) {
644
+ /* YEAR -> MONTH */
636
645
  viewSegment.year = cellSegment.year;
637
646
  if (this.notifyViewChange(viewSegment)) {
638
647
  this.renderView = RenderView.MONTH;
639
648
  }
640
649
  return;
641
650
  }
642
- if (this.renderView === RenderView.MONTH) { /* MONTH -> DAY */
651
+ if (this.renderView === RenderView.MONTH) {
652
+ /* MONTH -> DAY */
643
653
  viewSegment.year = cellSegment.year;
644
654
  viewSegment.month = cellSegment.month;
645
655
  if (this.notifyViewChange(viewSegment)) {
@@ -785,7 +795,8 @@ let Calendar = class Calendar extends ControlElement {
785
795
  if (!this.values.length) {
786
796
  values = [value];
787
797
  }
788
- else if (this.values.length === 1) { /* from is populated */
798
+ else if (this.values.length === 1) {
799
+ /* from is populated */
789
800
  const from = this.values[0];
790
801
  const to = value;
791
802
  if (isAfter(to, from) || isSameDay(to, from)) {
@@ -860,7 +871,9 @@ let Calendar = class Calendar extends ControlElement {
860
871
  const day = segment.day;
861
872
  const fromYear = Math.floor(segment.year / YEARS_PER_YEAR_VIEW) * YEARS_PER_YEAR_VIEW;
862
873
  const toYear = fromYear + YEARS_PER_YEAR_VIEW - 1;
863
- return html `${this.viewFormattedDate({ year: fromYear, month, day })} - ${this.viewFormattedDate({ year: toYear, month, day })}`;
874
+ const fromView = this.viewFormattedDate({ year: fromYear, month, day });
875
+ const toView = this.viewFormattedDate({ year: toYear, month, day });
876
+ return html `${fromView} - ${toView}`;
864
877
  case RenderView.DAY:
865
878
  default:
866
879
  return this.viewFormattedDate(segment, true);
@@ -957,7 +970,7 @@ let Calendar = class Calendar extends ControlElement {
957
970
  const totalCount = MONTH_VIEW.totalCount;
958
971
  const monthsNames = this.localMonthsNames;
959
972
  const before = (totalCount - monthCount) / 2;
960
- const startIdx = monthCount - before % monthCount;
973
+ const startIdx = monthCount - (before % monthCount);
961
974
  const after = before + monthCount;
962
975
  const months = [];
963
976
  const rows = [];
@@ -1063,8 +1076,7 @@ let Calendar = class Calendar extends ControlElement {
1063
1076
  this.setActiveCell(rows);
1064
1077
  this.setNavigationMap(rows);
1065
1078
  return html `
1066
- ${guard([this.firstDayOfWeek, this.lang], () => this.renderWeekdayNames)}
1067
- ${this.renderRows(rows)}
1079
+ ${guard([this.firstDayOfWeek, this.lang], () => this.renderWeekdayNames)} ${this.renderRows(rows)}
1068
1080
  `;
1069
1081
  }
1070
1082
  /**
@@ -1072,14 +1084,16 @@ let Calendar = class Calendar extends ControlElement {
1072
1084
  */
1073
1085
  get renderWeekdayNames() {
1074
1086
  const firstDayOfWeek = this.firstDayOfWeek;
1075
- const weekdaysNames = this.localWeekdaysNames.slice(firstDayOfWeek).concat(this.localWeekdaysNames.slice(0, firstDayOfWeek));
1076
- return html `
1077
- <div role="row"
1078
- part="row day-name-row">${weekdaysNames.map(day => html `
1079
- <div scope="col" role="columnheader" part="cell day-name" abbr="${day.long}">
1080
- <div part="cell-content">${day.narrow}</div>
1081
- </div>
1082
- `)}</div>`;
1087
+ const weekdaysNames = this.localWeekdaysNames
1088
+ .slice(firstDayOfWeek)
1089
+ .concat(this.localWeekdaysNames.slice(0, firstDayOfWeek));
1090
+ return html ` <div role="row" part="row day-name-row">
1091
+ ${weekdaysNames.map((day) => html `
1092
+ <div scope="col" role="columnheader" part="cell day-name" abbr="${day.long}">
1093
+ <div part="cell-content">${day.narrow}</div>
1094
+ </div>
1095
+ `)}
1096
+ </div>`;
1083
1097
  }
1084
1098
  /**
1085
1099
  * Render a view based on the current render view
@@ -1139,17 +1153,25 @@ let Calendar = class Calendar extends ControlElement {
1139
1153
  ?selected=${cell.selected}
1140
1154
  ?range=${cell.range}
1141
1155
  ?range-from=${cell.rangeFrom}
1142
- ?range-to=${cell.rangeTo}>
1143
- <div role="${cell.value ? 'button' : nothing}"
1144
- tabindex=${isSelectable ? isActive : nothing}
1145
- aria-label="${isSelectable && !isIE ? this.t(this.getCellLabelKey(cell), {
1146
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
1147
- value: parse(cell.value),
1148
- view: this.renderView
1149
- }) : nothing}"
1150
- part="cell-content${isSelection ? ' selection' : ''}${isSelectable ? ' selectable' : ''}"
1151
- .value=${cell.value}
1152
- .index=${cell.index}>${cell.text}</div>
1156
+ ?range-to=${cell.rangeTo}
1157
+ >
1158
+ <div
1159
+ role="${cell.value ? 'button' : nothing}"
1160
+ tabindex=${isSelectable ? isActive : nothing}
1161
+ aria-label="${isSelectable && !isIE
1162
+ ? this.t(this.getCellLabelKey(cell), {
1163
+ /* IE11 has significant performance hit, disable */
1164
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
1165
+ value: parse(cell.value),
1166
+ view: this.renderView
1167
+ })
1168
+ : nothing}"
1169
+ part="cell-content${isSelection ? ' selection' : ''}${isSelectable ? ' selectable' : ''}"
1170
+ .value=${cell.value}
1171
+ .index=${cell.index}
1172
+ >
1173
+ ${cell.text}
1174
+ </div>
1153
1175
  </div>`;
1154
1176
  }
1155
1177
  /**
@@ -1158,7 +1180,7 @@ let Calendar = class Calendar extends ControlElement {
1158
1180
  * @returns template result
1159
1181
  */
1160
1182
  renderRows(rows) {
1161
- return rows.map(row => html `<div role="row" part="row">${row.map(cell => this.renderCell(cell))}</div>`);
1183
+ return rows.map((row) => html `<div role="row" part="row">${row.map((cell) => this.renderCell(cell))}</div>`);
1162
1184
  }
1163
1185
  /**
1164
1186
  * Render button navigation template
@@ -1183,31 +1205,36 @@ let Calendar = class Calendar extends ControlElement {
1183
1205
  // no default
1184
1206
  }
1185
1207
  return html `<div part="navigation">
1186
- <ef-button
1187
- part="btn-prev"
1188
- aria-label="${prevBtnAriaLabel}"
1189
- icon="left"
1190
- @tap=${this.onPreviousTap}></ef-button>
1191
- <ef-button
1192
- ${ref(this.viewBtnRef)}
1193
- aria-description="${viewBtnAriaLabel}"
1194
- part="btn-view"
1195
- textpos="before"
1196
- .icon="${this.renderView === RenderView.DAY ? 'down' : 'up'}"
1197
- @tap="${this.onRenderViewTap}">${this.formattedViewRender}</ef-button>
1198
- <ef-button
1199
- part="btn-next"
1200
- aria-label="${nextBtnAriaLabel}"
1201
- icon="right"
1202
- @tap=${this.onNextTap}></ef-button>
1203
- </div>`;
1208
+ <ef-button
1209
+ part="btn-prev"
1210
+ aria-label="${prevBtnAriaLabel}"
1211
+ icon="left"
1212
+ @tap=${this.onPreviousTap}
1213
+ ></ef-button>
1214
+ <ef-button
1215
+ ${ref(this.viewBtnRef)}
1216
+ aria-description="${viewBtnAriaLabel}"
1217
+ part="btn-view"
1218
+ textpos="before"
1219
+ .icon="${this.renderView === RenderView.DAY ? 'down' : 'up'}"
1220
+ @tap="${this.onRenderViewTap}"
1221
+ >${this.formattedViewRender}</ef-button
1222
+ >
1223
+ <ef-button
1224
+ part="btn-next"
1225
+ aria-label="${nextBtnAriaLabel}"
1226
+ icon="right"
1227
+ @tap=${this.onNextTap}
1228
+ ></ef-button>
1229
+ </div>`;
1204
1230
  }
1205
1231
  /**
1206
1232
  * A template used to notify currently selected value for screen readers
1207
1233
  * @returns template result
1208
1234
  */
1209
1235
  get selectionTemplate() {
1210
- if (isIE || !this.announceValues) { /* IE11 has significant performance complications */
1236
+ if (isIE || !this.announceValues) {
1237
+ /* IE11 has significant performance complications */
1211
1238
  return;
1212
1239
  }
1213
1240
  return html `<div
@@ -1216,9 +1243,13 @@ let Calendar = class Calendar extends ControlElement {
1216
1243
  aria-live="polite"
1217
1244
  aria-label="${this.value
1218
1245
  ? this.range
1219
- ? this.t('SELECTED_RANGE', { from: parse(this.values[0]), to: this.values[1] ? parse(this.values[1]) : null })
1246
+ ? this.t('SELECTED_RANGE', {
1247
+ from: parse(this.values[0]),
1248
+ to: this.values[1] ? parse(this.values[1]) : null
1249
+ })
1220
1250
  : this.t('SELECTED_DATE', { value: parse(this.value), count: this.values.length })
1221
- : this.t('SELECTED_NONE', { multiple: this.multiple, range: this.range })}"></div>`;
1251
+ : this.t('SELECTED_NONE', { multiple: this.multiple, range: this.range })}"
1252
+ ></div>`;
1222
1253
  }
1223
1254
  /**
1224
1255
  * A `TemplateResult` that will be used
@@ -1229,10 +1260,14 @@ let Calendar = class Calendar extends ControlElement {
1229
1260
  return html `
1230
1261
  ${guard([this.values, this.lang, this.range, this.multiple, this.announceValues], () => this.selectionTemplate)}
1231
1262
  ${guard([this.view, this.renderView, this.lang], () => this.buttonNavigationTemplate)}
1232
- <div role="grid"
1233
- aria-multiselectable="${this.range || this.multiple}"
1234
- part="table"
1235
- @tap=${this.onTableTap}>${this.viewRender}</div>
1263
+ <div
1264
+ role="grid"
1265
+ aria-multiselectable="${this.range || this.multiple}"
1266
+ part="table"
1267
+ @tap=${this.onTableTap}
1268
+ >
1269
+ ${this.viewRender}
1270
+ </div>
1236
1271
  <div part="footer"><slot name="footer"></slot></div>
1237
1272
  `;
1238
1273
  }
@@ -1,5 +1,5 @@
1
- import { toDateSegment, getDaysInMonth, utcParse } from '@refinitiv-ui/utils/date.js';
2
1
  import { DEFAULT_LOCALE, resolveLocale } from '@refinitiv-ui/i18n';
2
+ import { getDaysInMonth, toDateSegment, utcParse } from '@refinitiv-ui/utils/date.js';
3
3
  import { CalendarLocaleScope } from './constants.js';
4
4
  /**
5
5
  * Get information about number of days, month number and year from date object
@@ -102,7 +102,7 @@ const formatLocaleDate = (date, locale, includeMonth = false, includeEra = false
102
102
  const year = date.getUTCFullYear();
103
103
  const month = date.getUTCMonth();
104
104
  // BC flags are not supported. Always use English
105
- return `${includeMonth ? `${monthNames[month]} ` : ''} ${year > 0 ? year : year === 0 ? '1' : Math.abs(year - 1)}${includeEra ? year <= 0 ? ' BC' : ' AD' : ''}`;
105
+ return `${includeMonth ? `${monthNames[month]} ` : ''} ${year > 0 ? year : year === 0 ? '1' : Math.abs(year - 1)}${includeEra ? (year <= 0 ? ' BC' : ' AD') : ''}`;
106
106
  };
107
107
  /**
108
108
  * Used to format views
@@ -1,5 +1,5 @@
1
1
  import { JSXInterface } from '../jsx';
2
- import { ResponsiveElement, TemplateResult, CSSResultGroup, ElementSize } from '@refinitiv-ui/core';
2
+ import { CSSResultGroup, ElementSize, ResponsiveElement, TemplateResult } from '@refinitiv-ui/core';
3
3
  /**
4
4
  * A Component uses to draw graphics on a web page,
5
5
  * it works similarly to the normal HTML5 Canvas element.
@@ -1,5 +1,5 @@
1
1
  import { __decorate } from "tslib";
2
- import { ResponsiveElement, html, css } from '@refinitiv-ui/core';
2
+ import { ResponsiveElement, css, html } from '@refinitiv-ui/core';
3
3
  import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
4
4
  import { property } from '@refinitiv-ui/core/decorators/property.js';
5
5
  import { VERSION } from '../version.js';
@@ -156,9 +156,7 @@ let Canvas = class Canvas extends ResponsiveElement {
156
156
  * @return Render template
157
157
  */
158
158
  render() {
159
- return html `
160
- <canvas id="canvas"></canvas>
161
- `;
159
+ return html ` <canvas id="canvas"></canvas> `;
162
160
  }
163
161
  };
164
162
  __decorate([
@@ -1,8 +1,8 @@
1
1
  import type { OverlayMenuData } from '../../overlay-menu';
2
2
  export type CardConfig = {
3
3
  /**
4
- * Configuration for side menu
5
- */
4
+ * Configuration for side menu
5
+ */
6
6
  menu?: {
7
7
  /**
8
8
  * Menu data object as defined in `overlay-menu`
@@ -1,11 +1,11 @@
1
1
  import { JSXInterface } from '../jsx';
2
- import { BasicElement, TemplateResult, CSSResultGroup, PropertyValues } from '@refinitiv-ui/core';
3
- import type { CardConfig } from './helpers/types';
4
- import '../label/index.js';
5
- import '../button/index.js';
6
- import '../overlay-menu/index.js';
2
+ import { BasicElement, CSSResultGroup, PropertyValues, TemplateResult } from '@refinitiv-ui/core';
7
3
  import '@refinitiv-ui/phrasebook/locale/en/card.js';
8
4
  import { Translate } from '@refinitiv-ui/translate';
5
+ import '../button/index.js';
6
+ import '../label/index.js';
7
+ import '../overlay-menu/index.js';
8
+ import type { CardConfig } from './helpers/types';
9
9
  export type { CardConfig };
10
10
  /**
11
11
  * A card frame component.