@refinitiv-ui/elements 5.12.2 → 6.0.0-next.0

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 (160) hide show
  1. package/README.md +4 -4
  2. package/lib/accordion/index.js +2 -2
  3. package/lib/appstate-bar/index.d.ts +6 -0
  4. package/lib/appstate-bar/index.js +8 -3
  5. package/lib/autosuggest/index.js +10 -11
  6. package/lib/button/index.d.ts +2 -13
  7. package/lib/button/index.js +7 -42
  8. package/lib/button-bar/index.js +4 -5
  9. package/lib/calendar/constants.js +1 -1
  10. package/lib/calendar/index.d.ts +1 -1
  11. package/lib/calendar/index.js +39 -15
  12. package/lib/calendar/locales.js +5 -5
  13. package/lib/calendar/types.d.ts +1 -1
  14. package/lib/calendar/utils.js +5 -5
  15. package/lib/canvas/index.js +3 -4
  16. package/lib/card/index.js +6 -7
  17. package/lib/chart/index.js +18 -22
  18. package/lib/chart/plugins/doughnut-center-label.js +6 -11
  19. package/lib/checkbox/index.js +3 -3
  20. package/lib/clock/index.js +6 -6
  21. package/lib/clock/utils/TickManager.js +2 -2
  22. package/lib/collapse/index.js +7 -9
  23. package/lib/color-dialog/elements/color-palettes.js +1 -1
  24. package/lib/color-dialog/elements/grayscale-palettes.js +2 -2
  25. package/lib/color-dialog/elements/palettes.js +4 -5
  26. package/lib/color-dialog/helpers/value-model.js +1 -1
  27. package/lib/color-dialog/index.d.ts +1 -1
  28. package/lib/color-dialog/index.js +6 -6
  29. package/lib/combo-box/helpers/filter.d.ts +1 -1
  30. package/lib/combo-box/helpers/types.d.ts +1 -1
  31. package/lib/combo-box/index.d.ts +4 -4
  32. package/lib/combo-box/index.js +31 -14
  33. package/lib/counter/index.d.ts +6 -6
  34. package/lib/counter/index.js +8 -8
  35. package/lib/datetime-field/constants.d.ts +4 -0
  36. package/lib/datetime-field/constants.js +5 -0
  37. package/lib/datetime-field/custom-elements.json +345 -0
  38. package/lib/datetime-field/custom-elements.md +61 -0
  39. package/lib/datetime-field/index.d.ts +317 -0
  40. package/lib/datetime-field/index.js +660 -0
  41. package/lib/datetime-field/themes/halo/dark/index.js +3 -0
  42. package/lib/datetime-field/themes/halo/light/index.js +3 -0
  43. package/lib/datetime-field/themes/solar/charcoal/index.js +3 -0
  44. package/lib/datetime-field/themes/solar/pearl/index.js +3 -0
  45. package/lib/datetime-field/types.d.ts +10 -0
  46. package/lib/datetime-field/types.js +1 -0
  47. package/lib/datetime-field/utils.d.ts +25 -0
  48. package/lib/datetime-field/utils.js +79 -0
  49. package/lib/datetime-picker/index.js +6 -7
  50. package/lib/datetime-picker/utils.js +1 -1
  51. package/lib/dialog/draggable-element.js +1 -2
  52. package/lib/dialog/index.d.ts +1 -1
  53. package/lib/dialog/index.js +5 -5
  54. package/lib/email-field/index.d.ts +1 -1
  55. package/lib/email-field/index.js +8 -3
  56. package/lib/flag/index.js +3 -3
  57. package/lib/flag/utils/FlagLoader.d.ts +1 -1
  58. package/lib/flag/utils/FlagLoader.js +1 -1
  59. package/lib/header/index.js +2 -2
  60. package/lib/heatmap/helpers/color.d.ts +1 -1
  61. package/lib/heatmap/helpers/color.js +3 -5
  62. package/lib/heatmap/index.js +19 -28
  63. package/lib/icon/index.js +3 -3
  64. package/lib/icon/utils/IconLoader.d.ts +1 -1
  65. package/lib/icon/utils/IconLoader.js +1 -1
  66. package/lib/interactive-chart/helpers/types.d.ts +1 -1
  67. package/lib/interactive-chart/index.js +10 -14
  68. package/lib/item/helpers/types.d.ts +1 -1
  69. package/lib/item/index.d.ts +19 -17
  70. package/lib/item/index.js +45 -48
  71. package/lib/label/index.d.ts +1 -1
  72. package/lib/label/index.js +6 -6
  73. package/lib/layout/index.js +2 -2
  74. package/lib/led-gauge/index.js +2 -2
  75. package/lib/list/custom-elements.json +0 -13
  76. package/lib/list/custom-elements.md +9 -10
  77. package/lib/list/helpers/item-id.d.ts +8 -0
  78. package/lib/list/helpers/item-id.js +13 -0
  79. package/lib/list/helpers/{list-renderer.d.ts → renderer.d.ts} +4 -0
  80. package/lib/list/helpers/{list-renderer.js → renderer.js} +8 -0
  81. package/lib/list/helpers/types.d.ts +1 -1
  82. package/lib/list/index.d.ts +13 -12
  83. package/lib/list/index.js +30 -29
  84. package/lib/list/renderer.d.ts +1 -1
  85. package/lib/list/themes/halo/dark/index.js +1 -1
  86. package/lib/list/themes/halo/light/index.js +1 -1
  87. package/lib/list/themes/solar/charcoal/index.js +1 -1
  88. package/lib/list/themes/solar/pearl/index.js +1 -1
  89. package/lib/loader/index.js +1 -1
  90. package/lib/multi-input/helpers/types.d.ts +1 -1
  91. package/lib/multi-input/index.js +6 -7
  92. package/lib/notification/elements/notification-tray.js +4 -4
  93. package/lib/notification/elements/notification.d.ts +10 -0
  94. package/lib/notification/elements/notification.js +12 -3
  95. package/lib/number-field/index.d.ts +3 -3
  96. package/lib/number-field/index.js +14 -4
  97. package/lib/overlay/elements/overlay-backdrop.js +2 -2
  98. package/lib/overlay/elements/overlay-viewport.js +1 -1
  99. package/lib/overlay/elements/overlay.js +7 -5
  100. package/lib/overlay/managers/focus-manager.js +2 -3
  101. package/lib/overlay/managers/interaction-lock-manager.js +1 -1
  102. package/lib/overlay/managers/viewport-manager.js +4 -5
  103. package/lib/overlay/managers/zindex-manager.js +1 -1
  104. package/lib/overlay-menu/helpers/types.d.ts +1 -1
  105. package/lib/overlay-menu/index.js +12 -15
  106. package/lib/overlay-menu/managers/menu-manager.js +1 -1
  107. package/lib/pagination/index.d.ts +74 -91
  108. package/lib/pagination/index.js +205 -239
  109. package/lib/pagination/themes/halo/dark/index.js +1 -2
  110. package/lib/pagination/themes/halo/light/index.js +1 -2
  111. package/lib/pagination/themes/solar/charcoal/index.js +1 -2
  112. package/lib/pagination/themes/solar/pearl/index.js +1 -2
  113. package/lib/panel/index.js +2 -2
  114. package/lib/password-field/index.d.ts +2 -2
  115. package/lib/password-field/index.js +7 -4
  116. package/lib/pill/index.d.ts +16 -0
  117. package/lib/pill/index.js +36 -5
  118. package/lib/pill/themes/halo/dark/index.js +1 -1
  119. package/lib/pill/themes/halo/light/index.js +1 -1
  120. package/lib/pill/themes/solar/charcoal/index.js +1 -1
  121. package/lib/pill/themes/solar/pearl/index.js +1 -1
  122. package/lib/progress-bar/index.js +3 -3
  123. package/lib/radio-button/index.js +3 -3
  124. package/lib/radio-button/radio-button-registry.d.ts +1 -1
  125. package/lib/radio-button/radio-button-registry.js +4 -2
  126. package/lib/rating/index.js +4 -4
  127. package/lib/search-field/index.d.ts +2 -2
  128. package/lib/search-field/index.js +8 -4
  129. package/lib/select/index.js +11 -14
  130. package/lib/sidebar-layout/index.js +4 -4
  131. package/lib/slider/index.js +6 -8
  132. package/lib/sparkline/index.js +9 -10
  133. package/lib/swing-gauge/index.js +14 -8
  134. package/lib/tab/index.js +4 -4
  135. package/lib/tab-bar/index.js +6 -6
  136. package/lib/text-field/index.d.ts +14 -1
  137. package/lib/text-field/index.js +35 -11
  138. package/lib/time-picker/index.d.ts +1 -1
  139. package/lib/time-picker/index.js +11 -11
  140. package/lib/toggle/index.js +2 -2
  141. package/lib/tooltip/index.js +6 -8
  142. package/lib/tooltip/managers/tooltip-manager.js +2 -2
  143. package/lib/tornado-chart/elements/tornado-chart.js +2 -2
  144. package/lib/tornado-chart/elements/tornado-item.js +3 -3
  145. package/lib/tree/elements/tree-item.d.ts +3 -3
  146. package/lib/tree/elements/tree-item.js +5 -6
  147. package/lib/tree/elements/tree.d.ts +2 -3
  148. package/lib/tree/elements/tree.js +6 -7
  149. package/lib/tree/helpers/renderer.d.ts +4 -0
  150. package/lib/tree/helpers/renderer.js +8 -0
  151. package/lib/tree/helpers/types.d.ts +1 -1
  152. package/lib/tree/managers/tree-manager.d.ts +1 -1
  153. package/lib/tree/themes/halo/dark/index.js +1 -1
  154. package/lib/tree/themes/halo/light/index.js +1 -1
  155. package/lib/tree/themes/solar/charcoal/index.js +1 -1
  156. package/lib/tree/themes/solar/pearl/index.js +1 -1
  157. package/lib/tree-select/index.d.ts +3 -7
  158. package/lib/tree-select/index.js +39 -38
  159. package/lib/version.js +1 -1
  160. package/package.json +35 -295
@@ -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
  /**
@@ -1,10 +1,10 @@
1
1
  import { __decorate } from "tslib";
2
2
  import { BasicElement, css, html } 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 { ifDefined } from '@refinitiv-ui/core/lib/directives/if-defined.js';
6
- import { state } from '@refinitiv-ui/core/lib/decorators/state.js';
7
- 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 { ifDefined } from '@refinitiv-ui/core/directives/if-defined.js';
6
+ import { state } from '@refinitiv-ui/core/decorators/state.js';
7
+ import { ref, createRef } from '@refinitiv-ui/core/directives/ref.js';
8
8
  import { VERSION } from '../version.js';
9
9
  import { preload } from '../icon/index.js';
10
10
  import '../header/index.js';
@@ -123,9 +123,8 @@ let Collapse = class Collapse extends BasicElement {
123
123
  * @returns {void}
124
124
  */
125
125
  firstUpdated(changedProperties) {
126
- var _a;
127
126
  super.firstUpdated(changedProperties);
128
- (_a = this.panelHolderRef.value) === null || _a === void 0 ? void 0 : _a.setAttribute('no-animation', '');
127
+ this.panelHolderRef.value?.setAttribute('no-animation', '');
129
128
  }
130
129
  /**
131
130
  * Invoked whenever the element is updated
@@ -154,8 +153,7 @@ let Collapse = class Collapse extends BasicElement {
154
153
  * @returns {void}
155
154
  */
156
155
  showHide() {
157
- var _a;
158
- (_a = this.panelHolderRef.value) === null || _a === void 0 ? void 0 : _a.removeAttribute(('no-animation'));
156
+ this.panelHolderRef.value?.removeAttribute(('no-animation'));
159
157
  this.setAnimationTargetHeight(this.getContentHeight());
160
158
  }
161
159
  /**
@@ -1,6 +1,6 @@
1
1
  import { __decorate } from "tslib";
2
2
  import { html, css, svg } from '@refinitiv-ui/core';
3
- import { customElement } from '@refinitiv-ui/core/lib/decorators/custom-element.js';
3
+ import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
4
4
  import { VERSION } from '../../version.js';
5
5
  import { Palettes } from './palettes.js';
6
6
  import { COLOR_ITEMS } from '../helpers/color-helpers.js';
@@ -1,7 +1,7 @@
1
1
  import { __decorate } from "tslib";
2
2
  import { html, css, svg } 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 { Palettes } from './palettes.js';
7
7
  import { GRAYSCALE_ITEMS, NOCOLOR_POINTS } from '../helpers/color-helpers.js';
@@ -1,9 +1,9 @@
1
1
  import { __decorate } from "tslib";
2
2
  import { BasicElement, svg } from '@refinitiv-ui/core';
3
- import { property } from '@refinitiv-ui/core/lib/decorators/property.js';
4
- import { query } from '@refinitiv-ui/core/lib/decorators/query.js';
3
+ import { property } from '@refinitiv-ui/core/decorators/property.js';
4
+ import { query } from '@refinitiv-ui/core/decorators/query.js';
5
5
  import { VERSION } from '../../version.js';
6
- import { rgb } from '@refinitiv-ui/utils/lib/color.js';
6
+ import { rgb } from '@refinitiv-ui/utils/color.js';
7
7
  import { isHex } from '../helpers/color-helpers.js';
8
8
  /**
9
9
  * Element base class usually used
@@ -89,14 +89,13 @@ export class Palettes extends BasicElement {
89
89
  * @return {void}
90
90
  */
91
91
  onTouchmove(event) {
92
- var _a;
93
92
  const touchOffsets = event.changedTouches[0];
94
93
  // TODO: it is a bug of TypeScript@4.4 remove ts-ignore once it is fixed
95
94
  // https://github.com/microsoft/TypeScript/issues/45047
96
95
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
97
96
  // @ts-ignore
98
97
  // eslint-disable-next-line @typescript-eslint/no-unsafe-call
99
- const realTarget = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.elementFromPoint(touchOffsets.clientX, touchOffsets.clientY);
98
+ const realTarget = this.shadowRoot?.elementFromPoint(touchOffsets.clientX, touchOffsets.clientY);
100
99
  this.updateValue(realTarget);
101
100
  }
102
101
  /**
@@ -1,4 +1,4 @@
1
- import { rgb } from '@refinitiv-ui/utils/lib/color.js';
1
+ import { rgb } from '@refinitiv-ui/utils/color.js';
2
2
  import { isHex } from './color-helpers.js';
3
3
  const rgbNumberToString = (value) => isNaN(value) ? '' : `${value}`; // replace NaN with empty string
4
4
  /**
@@ -7,7 +7,7 @@ import { Dialog } from '../dialog/index.js';
7
7
  import './elements/color-palettes.js';
8
8
  import './elements/grayscale-palettes.js';
9
9
  import { Translate } from '@refinitiv-ui/translate';
10
- import '@refinitiv-ui/phrasebook/lib/locale/en/color-dialog.js';
10
+ import '@refinitiv-ui/phrasebook/locale/en/color-dialog.js';
11
11
  /**
12
12
  * Displays a colour picker dialog,
13
13
  * for selecting a predefined range of colours.
@@ -1,10 +1,10 @@
1
1
  import { __decorate } from "tslib";
2
2
  import { 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 { query } from '@refinitiv-ui/core/lib/decorators/query.js';
6
- import { styleMap } from '@refinitiv-ui/core/lib/directives/style-map.js';
7
- import { rgb } from '@refinitiv-ui/utils/lib/color.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 { styleMap } from '@refinitiv-ui/core/directives/style-map.js';
7
+ import { rgb } from '@refinitiv-ui/utils/color.js';
8
8
  import { VERSION } from '../version.js';
9
9
  import { ValueModel } from './helpers/value-model.js';
10
10
  import { isHex, removeHashSign } from './helpers/color-helpers.js';
@@ -15,7 +15,7 @@ import { Dialog } from '../dialog/index.js';
15
15
  import './elements/color-palettes.js';
16
16
  import './elements/grayscale-palettes.js';
17
17
  import { translate } from '@refinitiv-ui/translate';
18
- import '@refinitiv-ui/phrasebook/lib/locale/en/color-dialog.js';
18
+ import '@refinitiv-ui/phrasebook/locale/en/color-dialog.js';
19
19
  /**
20
20
  * Displays a colour picker dialog,
21
21
  * for selecting a predefined range of colours.
@@ -1,4 +1,4 @@
1
- import type { DataItem } from '@refinitiv-ui/utils/lib/collection';
1
+ import type { DataItem } from '@refinitiv-ui/utils/collection.js';
2
2
  import type { ComboBox } from '../index';
3
3
  import type { ComboBoxFilter } from './types';
4
4
  import type { ItemData } from '../../item';
@@ -1,4 +1,4 @@
1
- import type { DataItem } from '@refinitiv-ui/utils/lib/collection';
1
+ import type { DataItem } from '@refinitiv-ui/utils/collection.js';
2
2
  import type { ItemData } from '../../item';
3
3
  /**
4
4
  * Predicate callback
@@ -1,8 +1,8 @@
1
1
  import { JSXInterface } from '../jsx';
2
2
  import { FormFieldElement, CSSResultGroup, PropertyValues, TapEvent, TemplateResult, StyleMap } from '@refinitiv-ui/core';
3
- import { TemplateMap } from '@refinitiv-ui/core/lib/directives/template-map.js';
4
- import { CollectionComposer, DataItem } from '@refinitiv-ui/utils/lib/collection.js';
5
- import { AnimationTaskRunner } from '@refinitiv-ui/utils/lib/async.js';
3
+ import { TemplateMap } from '@refinitiv-ui/core/directives/template-map.js';
4
+ import { CollectionComposer, DataItem } from '@refinitiv-ui/utils/collection.js';
5
+ import { AnimationTaskRunner } from '@refinitiv-ui/utils/async.js';
6
6
  import { ItemData } from '../item';
7
7
  import { ComboBoxData, ComboBoxFilter } from './helpers/types';
8
8
  import type { List } from '../list/index.js';
@@ -13,7 +13,7 @@ import '../overlay/index.js';
13
13
  import '../list/index.js';
14
14
  import '../counter/index.js';
15
15
  import { TranslateDirective } from '@refinitiv-ui/translate';
16
- import '@refinitiv-ui/phrasebook/lib/locale/en/combo-box.js';
16
+ import '@refinitiv-ui/phrasebook/locale/en/combo-box.js';
17
17
  export type { ComboBoxFilter, ComboBoxData };
18
18
  export { ComboBoxRenderer };
19
19
  /**
@@ -1,14 +1,14 @@
1
1
  import { __decorate } from "tslib";
2
2
  import { FormFieldElement, css, html, WarningNotice, FocusedPropertyKey } 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 { eventOptions } from '@refinitiv-ui/core/lib/decorators/event-options.js';
7
- import { styleMap } from '@refinitiv-ui/core/lib/directives/style-map.js';
8
- 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 { eventOptions } from '@refinitiv-ui/core/decorators/event-options.js';
7
+ import { styleMap } from '@refinitiv-ui/core/directives/style-map.js';
8
+ import { ifDefined } from '@refinitiv-ui/core/directives/if-defined.js';
9
9
  import { VERSION } from '../version.js';
10
- import { CollectionComposer } from '@refinitiv-ui/utils/lib/collection.js';
11
- import { AnimationTaskRunner, TimeoutTaskRunner } from '@refinitiv-ui/utils/lib/async.js';
10
+ import { CollectionComposer } from '@refinitiv-ui/utils/collection.js';
11
+ import { AnimationTaskRunner, TimeoutTaskRunner } from '@refinitiv-ui/utils/async.js';
12
12
  import { ComboBoxRenderer } from './helpers/renderer.js';
13
13
  import { defaultFilter } from './helpers/filter.js';
14
14
  import { CustomKeyboardEvent } from './helpers/keyboard-event.js';
@@ -17,7 +17,7 @@ import '../overlay/index.js';
17
17
  import '../list/index.js';
18
18
  import '../counter/index.js';
19
19
  import { translate } from '@refinitiv-ui/translate';
20
- import '@refinitiv-ui/phrasebook/lib/locale/en/combo-box.js';
20
+ import '@refinitiv-ui/phrasebook/locale/en/combo-box.js';
21
21
  export { ComboBoxRenderer };
22
22
  const QUERY_DEBOUNCE_RATE = 0;
23
23
  // Maximum number of characters to display in multiple mode
@@ -267,13 +267,19 @@ let ComboBox = class ComboBox extends FormFieldElement {
267
267
  else {
268
268
  // Clone value arrays
269
269
  const newValues = values.slice(0, this.multiple ? values.length : 1);
270
- const oldValues = this.composerValues.slice();
270
+ const oldValues = this.values.slice();
271
271
  // Create comparison strings to check for differences
272
272
  const newComparison = newValues.sort().toString();
273
273
  const oldComparison = oldValues.sort().toString();
274
- // Should we update the selection state?
274
+ // Update the selection state when found new value
275
275
  if (newComparison !== oldComparison) {
276
276
  this.updateComposerValues(newValues);
277
+ if (this.freeText) {
278
+ // free text mode is only supported in single selection mode
279
+ // so if there is no valid selection in the composer, we can assume
280
+ // the first item can be used as the free text item.
281
+ this.freeTextValue = !this.composerValues.length ? newValues[0] : '';
282
+ }
277
283
  this.requestUpdate('values', oldValues);
278
284
  }
279
285
  }
@@ -580,10 +586,9 @@ let ComboBox = class ComboBox extends FormFieldElement {
580
586
  * @returns {void}
581
587
  */
582
588
  scrollToSelected() {
583
- var _a;
584
589
  const item = this.selectedItem;
585
590
  if (item) {
586
- (_a = this.listEl) === null || _a === void 0 ? void 0 : _a.scrollToItem(item);
591
+ this.listEl?.scrollToItem(item);
587
592
  }
588
593
  }
589
594
  /**
@@ -1041,6 +1046,7 @@ let ComboBox = class ComboBox extends FormFieldElement {
1041
1046
  return html `
1042
1047
  <ef-list
1043
1048
  id="internal-list"
1049
+ tabindex="-1"
1044
1050
  @value-changed="${this.onListValueChanged}"
1045
1051
  .data="${this.composer}"
1046
1052
  .multiple="${this.multiple}"
@@ -1087,7 +1093,18 @@ let ComboBox = class ComboBox extends FormFieldElement {
1087
1093
  * @returns template map
1088
1094
  */
1089
1095
  get decorateInputMap() {
1090
- return Object.assign(Object.assign({}, super.decorateInputMap), { 'part': 'input', 'type': 'text', 'role': 'combobox', '.value': this.focused ? this.inputText : this.freeTextValue || this.label, 'aria-expanded': this.opened ? 'true' : 'false', 'aria-haspopup': 'listbox', 'aria-autocomplete': 'list', 'aria-owns': 'internal-list', 'aria-activedescendant': this.highlightedItemValue });
1096
+ return {
1097
+ ...super.decorateInputMap,
1098
+ 'part': 'input',
1099
+ 'type': 'text',
1100
+ 'role': 'combobox',
1101
+ '.value': this.focused ? this.inputText : this.freeTextValue || this.label,
1102
+ 'aria-expanded': this.opened ? 'true' : 'false',
1103
+ 'aria-haspopup': 'listbox',
1104
+ 'aria-autocomplete': 'list',
1105
+ 'aria-owns': 'internal-list',
1106
+ 'aria-activedescendant': this.highlightedItemValue
1107
+ };
1091
1108
  }
1092
1109
  /**
1093
1110
  * Returns a template for input field
@@ -15,14 +15,14 @@ export declare class Counter extends BasicElement {
15
15
  */
16
16
  private _value;
17
17
  /**
18
- * Internal max of the element.
19
- */
18
+ * Internal max of the element.
19
+ */
20
20
  private _max;
21
21
  /**
22
- * The value of counter as string number
23
- * @param value counter value
24
- * @default -
25
- */
22
+ * The value of counter as string number
23
+ * @param value counter value
24
+ * @default -
25
+ */
26
26
  set value(value: string);
27
27
  /**
28
28
  * The value of counter as string number
@@ -1,7 +1,7 @@
1
1
  import { __decorate } from "tslib";
2
2
  import { BasicElement, 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';
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 { truncateDecimal, convertToCompactNotation } from './utils.js';
7
7
  /**
@@ -16,8 +16,8 @@ let Counter = class Counter extends BasicElement {
16
16
  */
17
17
  this._value = '';
18
18
  /**
19
- * Internal max of the element.
20
- */
19
+ * Internal max of the element.
20
+ */
21
21
  this._max = '';
22
22
  }
23
23
  /**
@@ -28,10 +28,10 @@ let Counter = class Counter extends BasicElement {
28
28
  return VERSION;
29
29
  }
30
30
  /**
31
- * The value of counter as string number
32
- * @param value counter value
33
- * @default -
34
- */
31
+ * The value of counter as string number
32
+ * @param value counter value
33
+ * @default -
34
+ */
35
35
  set value(value) {
36
36
  value = this.validateValue(value, 'value');
37
37
  const oldValue = this._value;
@@ -0,0 +1,4 @@
1
+ export declare enum Direction {
2
+ Up = 1,
3
+ Down = -1
4
+ }
@@ -0,0 +1,5 @@
1
+ export var Direction;
2
+ (function (Direction) {
3
+ Direction[Direction["Up"] = 1] = "Up";
4
+ Direction[Direction["Down"] = -1] = "Down";
5
+ })(Direction || (Direction = {}));