@refinitiv-ui/elements 6.0.0-next.3 → 6.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (193) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/README.md +3 -15
  3. package/lib/accordion/index.js +2 -2
  4. package/lib/autosuggest/custom-elements.json +5 -15
  5. package/lib/autosuggest/custom-elements.md +14 -14
  6. package/lib/autosuggest/helpers/renderer.d.ts +8 -0
  7. package/lib/autosuggest/helpers/renderer.js +35 -0
  8. package/lib/autosuggest/helpers/types.d.ts +101 -1
  9. package/lib/autosuggest/helpers/utils.d.ts +1 -8
  10. package/lib/autosuggest/helpers/utils.js +0 -27
  11. package/lib/autosuggest/index.d.ts +34 -32
  12. package/lib/autosuggest/index.js +246 -202
  13. package/lib/autosuggest/themes/halo/dark/index.js +1 -1
  14. package/lib/autosuggest/themes/halo/light/index.js +1 -1
  15. package/lib/autosuggest/themes/solar/charcoal/index.js +1 -1
  16. package/lib/autosuggest/themes/solar/pearl/index.js +1 -1
  17. package/lib/button/index.js +2 -1
  18. package/lib/button/themes/halo/dark/index.js +1 -1
  19. package/lib/button/themes/halo/light/index.js +1 -1
  20. package/lib/button/themes/solar/charcoal/index.js +1 -1
  21. package/lib/button/themes/solar/pearl/index.js +1 -1
  22. package/lib/calendar/index.d.ts +1 -1
  23. package/lib/calendar/themes/halo/dark/index.js +1 -1
  24. package/lib/calendar/themes/halo/light/index.js +1 -1
  25. package/lib/calendar/themes/solar/charcoal/index.js +1 -1
  26. package/lib/calendar/themes/solar/pearl/index.js +1 -1
  27. package/lib/chart/plugins/doughnut-center-label.js +1 -1
  28. package/lib/chart/themes/halo/dark/index.js +1 -1
  29. package/lib/chart/themes/halo/light/index.js +1 -1
  30. package/lib/checkbox/index.d.ts +8 -15
  31. package/lib/checkbox/index.js +19 -41
  32. package/lib/checkbox/themes/halo/dark/index.js +1 -1
  33. package/lib/checkbox/themes/halo/light/index.js +1 -1
  34. package/lib/checkbox/themes/solar/charcoal/index.js +1 -1
  35. package/lib/checkbox/themes/solar/pearl/index.js +1 -1
  36. package/lib/clock/custom-elements.json +10 -10
  37. package/lib/clock/custom-elements.md +1 -1
  38. package/lib/clock/index.d.ts +44 -16
  39. package/lib/clock/index.js +178 -61
  40. package/lib/clock/themes/halo/dark/index.js +1 -1
  41. package/lib/clock/themes/halo/light/index.js +1 -1
  42. package/lib/clock/themes/solar/charcoal/index.js +1 -1
  43. package/lib/clock/themes/solar/pearl/index.js +1 -1
  44. package/lib/combo-box/index.d.ts +4 -3
  45. package/lib/combo-box/index.js +7 -3
  46. package/lib/combo-box/themes/halo/dark/index.js +1 -1
  47. package/lib/combo-box/themes/halo/light/index.js +1 -1
  48. package/lib/combo-box/themes/solar/charcoal/index.js +1 -1
  49. package/lib/combo-box/themes/solar/pearl/index.js +1 -1
  50. package/lib/datetime-field/index.d.ts +1 -1
  51. package/lib/datetime-field/utils.d.ts +1 -1
  52. package/lib/datetime-picker/themes/halo/dark/index.js +1 -1
  53. package/lib/datetime-picker/themes/halo/light/index.js +1 -1
  54. package/lib/datetime-picker/themes/solar/charcoal/index.js +1 -1
  55. package/lib/datetime-picker/themes/solar/pearl/index.js +1 -1
  56. package/lib/email-field/themes/halo/dark/index.js +1 -1
  57. package/lib/email-field/themes/halo/light/index.js +1 -1
  58. package/lib/email-field/themes/solar/charcoal/index.js +1 -1
  59. package/lib/email-field/themes/solar/pearl/index.js +1 -1
  60. package/lib/flag/utils/FlagLoader.d.ts +2 -32
  61. package/lib/flag/utils/FlagLoader.js +2 -69
  62. package/lib/heatmap/index.d.ts +2 -2
  63. package/lib/heatmap/themes/halo/dark/index.js +1 -1
  64. package/lib/heatmap/themes/halo/light/index.js +1 -1
  65. package/lib/icon/utils/IconLoader.d.ts +2 -37
  66. package/lib/icon/utils/IconLoader.js +2 -76
  67. package/lib/index.d.ts +1 -1
  68. package/lib/index.js +1 -1
  69. package/lib/interactive-chart/themes/halo/dark/index.js +1 -1
  70. package/lib/interactive-chart/themes/halo/light/index.js +1 -1
  71. package/lib/item/helpers/types.d.ts +6 -6
  72. package/lib/item/index.d.ts +2 -2
  73. package/lib/item/index.js +0 -1
  74. package/lib/item/themes/halo/dark/index.js +1 -1
  75. package/lib/item/themes/halo/light/index.js +1 -1
  76. package/lib/list/elements/list-item.d.ts +30 -0
  77. package/lib/list/elements/list-item.js +19 -0
  78. package/lib/list/elements/list.d.ts +307 -0
  79. package/lib/list/elements/list.js +632 -0
  80. package/lib/list/helpers/renderer.d.ts +0 -1
  81. package/lib/list/helpers/renderer.js +1 -3
  82. package/lib/list/index.d.ts +3 -317
  83. package/lib/list/index.js +3 -641
  84. package/lib/list/themes/halo/dark/index.js +4 -1
  85. package/lib/list/themes/halo/light/index.js +5 -2
  86. package/lib/list/themes/solar/charcoal/index.js +4 -1
  87. package/lib/list/themes/solar/pearl/index.js +4 -1
  88. package/lib/multi-input/index.d.ts +1 -5
  89. package/lib/multi-input/index.js +17 -18
  90. package/lib/notification/themes/halo/dark/index.js +1 -1
  91. package/lib/notification/themes/halo/light/index.js +1 -1
  92. package/lib/notification/themes/solar/charcoal/index.js +1 -1
  93. package/lib/notification/themes/solar/pearl/index.js +1 -1
  94. package/lib/number-field/themes/halo/dark/index.js +1 -1
  95. package/lib/number-field/themes/halo/light/index.js +1 -1
  96. package/lib/number-field/themes/solar/charcoal/index.js +1 -1
  97. package/lib/number-field/themes/solar/pearl/index.js +1 -1
  98. package/lib/overlay/index.d.ts +2 -1
  99. package/lib/overlay-menu/helpers/constants.d.ts +6 -0
  100. package/lib/overlay-menu/helpers/constants.js +7 -0
  101. package/lib/overlay-menu/helpers/types.d.ts +0 -6
  102. package/lib/overlay-menu/helpers/types.js +1 -7
  103. package/lib/overlay-menu/index.d.ts +1 -1
  104. package/lib/overlay-menu/index.js +1 -1
  105. package/lib/password-field/themes/halo/dark/index.js +1 -1
  106. package/lib/password-field/themes/halo/light/index.js +1 -1
  107. package/lib/password-field/themes/solar/charcoal/index.js +1 -1
  108. package/lib/password-field/themes/solar/pearl/index.js +1 -1
  109. package/lib/pill/index.d.ts +11 -3
  110. package/lib/pill/index.js +25 -11
  111. package/lib/radio-button/index.d.ts +7 -11
  112. package/lib/radio-button/index.js +14 -25
  113. package/lib/radio-button/themes/halo/dark/index.js +1 -1
  114. package/lib/radio-button/themes/halo/light/index.js +1 -1
  115. package/lib/radio-button/themes/solar/charcoal/index.js +1 -1
  116. package/lib/radio-button/themes/solar/pearl/index.js +1 -1
  117. package/lib/rating/custom-elements.json +4 -4
  118. package/lib/rating/custom-elements.md +2 -2
  119. package/lib/rating/index.d.ts +84 -32
  120. package/lib/rating/index.js +209 -80
  121. package/lib/rating/themes/halo/dark/index.js +1 -1
  122. package/lib/rating/themes/halo/light/index.js +1 -1
  123. package/lib/rating/themes/solar/charcoal/index.js +1 -1
  124. package/lib/rating/themes/solar/pearl/index.js +1 -1
  125. package/lib/rating/utils.d.ts +9 -0
  126. package/lib/rating/utils.js +11 -0
  127. package/lib/search-field/themes/halo/dark/index.js +1 -1
  128. package/lib/search-field/themes/halo/light/index.js +1 -1
  129. package/lib/search-field/themes/solar/charcoal/index.js +1 -1
  130. package/lib/search-field/themes/solar/pearl/index.js +1 -1
  131. package/lib/select/index.d.ts +13 -1
  132. package/lib/select/index.js +25 -7
  133. package/lib/select/themes/halo/dark/index.js +1 -1
  134. package/lib/select/themes/halo/light/index.js +1 -1
  135. package/lib/select/themes/solar/charcoal/index.js +1 -1
  136. package/lib/select/themes/solar/pearl/index.js +1 -1
  137. package/lib/slider/constants.d.ts +5 -1
  138. package/lib/slider/constants.js +6 -1
  139. package/lib/slider/index.d.ts +112 -49
  140. package/lib/slider/index.js +331 -182
  141. package/lib/slider/themes/halo/dark/index.js +1 -1
  142. package/lib/slider/themes/halo/light/index.js +1 -1
  143. package/lib/slider/themes/solar/charcoal/index.js +1 -1
  144. package/lib/slider/themes/solar/pearl/index.js +1 -1
  145. package/lib/slider/utils.d.ts +1 -9
  146. package/lib/slider/utils.js +1 -18
  147. package/lib/sparkline/themes/halo/dark/index.js +1 -1
  148. package/lib/sparkline/themes/halo/light/index.js +1 -1
  149. package/lib/tab/themes/halo/dark/index.js +1 -1
  150. package/lib/tab/themes/halo/light/index.js +1 -1
  151. package/lib/tab/themes/solar/charcoal/index.js +1 -1
  152. package/lib/tab/themes/solar/pearl/index.js +1 -1
  153. package/lib/tab-bar/index.d.ts +6 -7
  154. package/lib/tab-bar/index.js +12 -10
  155. package/lib/tab-bar/themes/halo/dark/index.js +1 -0
  156. package/lib/tab-bar/themes/halo/light/index.js +1 -0
  157. package/lib/tab-bar/themes/solar/charcoal/index.js +1 -0
  158. package/lib/tab-bar/themes/solar/pearl/index.js +1 -0
  159. package/lib/text-field/index.js +2 -3
  160. package/lib/text-field/themes/halo/dark/index.js +1 -1
  161. package/lib/text-field/themes/halo/light/index.js +1 -1
  162. package/lib/text-field/themes/solar/charcoal/index.js +1 -1
  163. package/lib/text-field/themes/solar/pearl/index.js +1 -1
  164. package/lib/toggle/index.d.ts +7 -10
  165. package/lib/toggle/index.js +14 -24
  166. package/lib/toggle/themes/halo/dark/index.js +1 -1
  167. package/lib/toggle/themes/halo/light/index.js +1 -1
  168. package/lib/toggle/themes/solar/charcoal/index.js +1 -1
  169. package/lib/toggle/themes/solar/pearl/index.js +1 -1
  170. package/lib/tooltip/helpers/overflow-tooltip.d.ts +11 -4
  171. package/lib/tooltip/helpers/overflow-tooltip.js +34 -6
  172. package/lib/tooltip/index.d.ts +2 -2
  173. package/lib/tooltip/index.js +2 -2
  174. package/lib/tree/elements/tree-item.d.ts +4 -0
  175. package/lib/tree/elements/tree-item.js +5 -2
  176. package/lib/tree/elements/tree.d.ts +7 -0
  177. package/lib/tree/elements/tree.js +12 -1
  178. package/lib/tree/helpers/renderer.d.ts +0 -1
  179. package/lib/tree/helpers/renderer.js +0 -2
  180. package/lib/tree/index.d.ts +2 -1
  181. package/lib/tree/themes/halo/dark/index.js +2 -2
  182. package/lib/tree/themes/halo/light/index.js +3 -3
  183. package/lib/tree/themes/solar/charcoal/index.js +2 -2
  184. package/lib/tree/themes/solar/pearl/index.js +2 -2
  185. package/lib/tree-select/index.js +15 -5
  186. package/lib/tree-select/themes/halo/dark/index.js +1 -1
  187. package/lib/tree-select/themes/halo/light/index.js +1 -1
  188. package/lib/tree-select/themes/solar/charcoal/index.js +1 -1
  189. package/lib/tree-select/themes/solar/pearl/index.js +1 -1
  190. package/lib/version.js +1 -1
  191. package/package.json +20 -19
  192. package/lib/clock/utils/timestamps.d.ts +0 -6
  193. package/lib/clock/utils/timestamps.js +0 -6
@@ -2,9 +2,8 @@ import { __decorate } from "tslib";
2
2
  import { BasicElement, html, css } from '@refinitiv-ui/core';
3
3
  import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
4
4
  import { property } from '@refinitiv-ui/core/decorators/property.js';
5
- import { queryAll } from '@refinitiv-ui/core/decorators/query-all.js';
6
- import { repeat } from '@refinitiv-ui/core/directives/repeat.js';
7
5
  import { VERSION } from '../version.js';
6
+ import { clamp } from './utils.js';
8
7
  /**
9
8
  * Star visualisation component that is generally used for ranking
10
9
  * @fires value-changed - Fired when the `value` changes.
@@ -12,21 +11,22 @@ import { VERSION } from '../version.js';
12
11
  let Rating = class Rating extends BasicElement {
13
12
  constructor() {
14
13
  super(...arguments);
15
- this.items = [];
16
- this.valuePrevious = 0;
14
+ this.MAX_VALUE = '5'; // default max value
15
+ this.MIN_VALUE = 1; // min value of interactive mode
17
16
  /**
18
17
  * Make it possible to interact with rating control and change the value
19
18
  */
20
19
  this.interactive = false;
21
20
  /**
22
- * Set number of total stars
23
- */
24
- this.max = '5';
21
+ * Internal max value of rating.
22
+ * Controlled by public setter and getter
23
+ */
24
+ this._max = this.MAX_VALUE;
25
25
  /**
26
- * Set number of selected stars. Value can be any number between 0 and `max`.
27
- * Decimal values are calculated to empty star (0 - .25); half-star (.25 - .75) and full star (.75 - 1)
28
- */
29
- this.value = '0';
26
+ * Internal value of rating.
27
+ * Controlled by public setter and getter
28
+ */
29
+ this._value = '0';
30
30
  }
31
31
  /**
32
32
  * Element version number
@@ -36,95 +36,226 @@ let Rating = class Rating extends BasicElement {
36
36
  return VERSION;
37
37
  }
38
38
  /**
39
- * Converts value from string to number for calculations
40
- * @returns value of rating as a number
39
+ * A `CSSResultGroup` that will be used
40
+ * to style the host, slotted children
41
+ * and the internal template of the element.
42
+ * @returns CSS template
41
43
  */
42
- get valueNumber() {
43
- const value = parseFloat(this.value);
44
- if (!this.value || isNaN(value)) {
45
- return 0;
44
+ static get styles() {
45
+ return css `
46
+ :host {
47
+ display: inline-block;
48
+ }
49
+ `;
50
+ }
51
+ /**
52
+ * Set number of total stars
53
+ * @param max max value
54
+ * @default '5'
55
+ */
56
+ set max(max) {
57
+ const newMax = max && this.isValidValue(max) ? Math.round(Number(max)).toString() : this.MAX_VALUE;
58
+ const oldMax = this._max;
59
+ if (oldMax !== newMax) {
60
+ this._max = newMax;
61
+ if (this.interactive) {
62
+ this.setAttribute('aria-valuemax', newMax);
63
+ }
64
+ this.requestUpdate('max', oldMax);
46
65
  }
47
- return value;
66
+ }
67
+ get max() {
68
+ return this._max;
48
69
  }
49
70
  /**
50
71
  * Converts max value from string to number for calculations
51
72
  * @returns maximum value of rating as a number
52
73
  */
53
74
  get maxNumber() {
54
- let max = parseFloat(this.max);
55
- if (!this.max || isNaN(max)) {
56
- return 5;
75
+ return Number(this.max);
76
+ }
77
+ /**
78
+ * Set number of selected stars. Value can be any number between 0 and `max`.
79
+ * Decimal values are calculated to empty star (0 - .25); half-star (.25 - .75) and full star (.75 - 1)
80
+ * @param value Element value
81
+ * @default '0'
82
+ */
83
+ set value(value) {
84
+ const newValue = this.isValidValue(value) ? Number(value).toString() : '0';
85
+ const oldValue = this._value;
86
+ if (oldValue !== newValue) {
87
+ this._value = newValue;
88
+ if (this.interactive) {
89
+ this.setAttribute('aria-valuenow', newValue);
90
+ }
91
+ this.requestUpdate('value', oldValue);
92
+ }
93
+ }
94
+ get value() {
95
+ return this._value;
96
+ }
97
+ /**
98
+ * Converts value from string to number for calculations
99
+ * @returns value of rating as a number
100
+ */
101
+ get valueNumber() {
102
+ return Number(this.value);
103
+ }
104
+ /**
105
+ * Called before update() to compute values needed during the update.
106
+ * @param changedProperties Properties that has changed
107
+ * @returns {void}
108
+ */
109
+ willUpdate(changedProperties) {
110
+ super.willUpdate(changedProperties);
111
+ if (changedProperties.has('interactive')) {
112
+ this.interactiveChanged();
57
113
  }
58
- // Prevent decimal max value
59
- max = max % 1 === 0 ? max : Math.round(max);
60
- return max;
61
114
  }
62
115
  /**
63
- * Compute rating based on max number of stars and value.
64
- * Note: to speed up the component, hover state is implemented using CSS only.
65
- * CSS3 specification does not allow to select items preceding the hover, but allows to select the following items.
66
- * Therefore `flex: reverse` style is applied and the items are constructed in the reverse mode to mimic the correct behaviour.
67
- * @param {Number} max Number of stars
68
- * @param {Number} value Value
116
+ * Invoked when the element is first updated
117
+ * @param changedProperties changed properties
118
+ * @returns {void}
119
+ */
120
+ firstUpdated(changedProperties) {
121
+ super.firstUpdated(changedProperties);
122
+ this.addEventListener('keydown', this.onKeyDown.bind(this));
123
+ }
124
+ /**
125
+ * Handles interactive and aria attribute changes
69
126
  * @returns {void}
70
127
  */
71
- computeRating(max, value) {
72
- this.items = [];
73
- for (let i = 0; i < max; i += 1) {
74
- const reverseIdx = value - (max - i) + 1;
75
- const v = reverseIdx > 0 ? Math.min(1, reverseIdx) : 0;
76
- const selected = v >= 0.75 ? 'full' : v >= 0.25 ? 'half' : false;
77
- this.items.push({ item: selected ? `icon icon-${selected}` : 'icon' });
128
+ interactiveChanged() {
129
+ if (this.interactive) {
130
+ this.setAttribute('role', 'slider');
131
+ this.setAttribute('aria-valuemin', this.MIN_VALUE.toString());
132
+ this.setAttribute('aria-valuenow', this.value);
133
+ this.setAttribute('aria-valuemax', this.max);
134
+ this.setAttribute('tabindex', this.getAttribute('tabindex') || '0');
135
+ }
136
+ else {
137
+ if (this.getAttribute('role') === 'slider') {
138
+ this.removeAttribute('role');
139
+ }
140
+ this.removeAttribute('aria-valuemin');
141
+ this.removeAttribute('aria-valuenow');
142
+ this.removeAttribute('aria-valuemax');
78
143
  }
79
- this.valuePrevious = value;
80
- this.requestUpdate();
81
144
  }
82
145
  /**
83
- * Process click event to set the new value
84
- * @param {number} index index of star
146
+ * Handles key input
147
+ * @param event Key down event object
85
148
  * @returns {void}
86
149
  */
87
- handleTap(index) {
88
- if (!this.interactive) {
150
+ onKeyDown(event) {
151
+ if (event.defaultPrevented || !this.interactive) {
89
152
  return;
90
153
  }
91
- const valueIndex = this.maxNumber - index;
92
- if (this.valuePrevious !== valueIndex) {
93
- this.value = valueIndex.toString();
94
- // Dispatch Event when value change
154
+ // Ignore special keys
155
+ if (event.shiftKey || event.ctrlKey || event.altKey || event.metaKey) {
156
+ return;
157
+ }
158
+ switch (event.key) {
159
+ case 'Right':
160
+ case 'Up':
161
+ case 'ArrowRight':
162
+ case 'ArrowUp':
163
+ this.stepUp();
164
+ break;
165
+ case 'Left':
166
+ case 'Down':
167
+ case 'ArrowLeft':
168
+ case 'ArrowDown':
169
+ this.stepDown();
170
+ break;
171
+ case 'Home':
172
+ this.stepDown(this.MIN_VALUE);
173
+ break;
174
+ case 'End':
175
+ this.stepUp(this.maxNumber);
176
+ break;
177
+ default:
178
+ return;
179
+ }
180
+ event.preventDefault();
181
+ }
182
+ /**
183
+ * Update value and fired value-changed event
184
+ * @param value value to updated
185
+ * @returns {void}
186
+ */
187
+ notifyValueChange(value) {
188
+ if (this.value !== value) {
189
+ this.value = value;
95
190
  this.notifyPropertyChange('value', this.value);
96
191
  }
97
192
  }
98
193
  /**
99
- * Invoked whenever the element properties are updated
100
- * @param changedProperties changed properties
194
+ * Check if passed value is a valid value
195
+ * @override
196
+ * @param value Value to check
197
+ * @returns {boolean} false if value is invalid
198
+ */
199
+ isValidValue(value) {
200
+ const number = Number(value);
201
+ return !isNaN(number) && isFinite(number);
202
+ }
203
+ /**
204
+ * Increases the value of rating by half or 1 if not specific amount but not exceed max value
205
+ * @param value step up value to specific number (optional)
101
206
  * @returns {void}
102
207
  */
103
- updated(changedProperties) {
104
- super.updated(changedProperties);
105
- changedProperties.forEach((oldValue, propName) => {
106
- if (propName === 'value') {
107
- this.value = this.valueNumber.toString();
108
- this.computeRating(this.maxNumber, this.valueNumber);
109
- }
110
- else if (propName === 'max') {
111
- this.max = this.maxNumber.toString();
112
- this.computeRating(this.maxNumber, this.valueNumber);
113
- }
114
- });
208
+ stepUp(value) {
209
+ if (this.valueNumber > this.maxNumber) {
210
+ return;
211
+ }
212
+ const newValue = value || clamp(Math.floor(this.valueNumber + 1), this.MIN_VALUE, this.maxNumber);
213
+ this.notifyValueChange(newValue.toString());
115
214
  }
116
215
  /**
117
- * A `CSSResultGroup` that will be used
118
- * to style the host, slotted children
119
- * and the internal template of the element.
120
- * @returns CSS template
216
+ * Decrease the value of rating by half or 1 if not specific amount but not exceed min value
217
+ * @param value step down value to specific number (optional)
218
+ * @returns {void}
121
219
  */
122
- static get styles() {
123
- return css `
124
- :host {
125
- display: inline-block;
126
- }
127
- `;
220
+ stepDown(value) {
221
+ if (this.valueNumber < this.MIN_VALUE) {
222
+ return;
223
+ }
224
+ const newValue = value || clamp(Math.round(this.valueNumber - 1), this.MIN_VALUE, this.maxNumber - 1);
225
+ this.notifyValueChange(newValue.toString());
226
+ }
227
+ /**
228
+ * Process click event to set the new value
229
+ * @param {number} index index of star
230
+ * @returns {void}
231
+ */
232
+ handleTap(index) {
233
+ if (!this.interactive) {
234
+ return;
235
+ }
236
+ const newValue = this.maxNumber - index;
237
+ if (this.valueNumber !== newValue) {
238
+ this.value = newValue.toString();
239
+ this.notifyPropertyChange('value', this.value);
240
+ }
241
+ }
242
+ /**
243
+ * Render rating based on max number of stars and value.
244
+ * Note: to speed up the component, hover state is implemented using CSS only.
245
+ * CSS3 specification does not allow to select items preceding the hover, but allows to select the following items.
246
+ * Therefore `flex: reverse` style is applied and the items are constructed in the reverse mode to mimic the correct behaviour.
247
+ * @returns stars template
248
+ */
249
+ get starsTemplate() {
250
+ const stars = [];
251
+ for (let index = 0; index < this.maxNumber; index += 1) {
252
+ const reverseIndex = this.valueNumber - (this.maxNumber - index) + 1;
253
+ const starValue = reverseIndex > 0 ? Math.min(1, reverseIndex) : 0;
254
+ const selected = starValue >= 0.75 ? 'full' : starValue >= 0.25 ? 'half' : false;
255
+ const className = selected ? `icon icon-${selected}` : 'icon';
256
+ stars.push(html `<div part="${className}" @tap="${() => this.handleTap(index)}"></div>`);
257
+ }
258
+ return stars;
128
259
  }
129
260
  /**
130
261
  * A `TemplateResult` that will be used
@@ -132,9 +263,10 @@ let Rating = class Rating extends BasicElement {
132
263
  * @return Render template
133
264
  */
134
265
  render() {
135
- return html `<div part="container">
136
- ${repeat(this.items, (i, index) => html `<div part="${i.item}" @tap="${() => this.handleTap(index)}"></div>`)}
137
- </div>`;
266
+ return html `
267
+ <div part="container">
268
+ ${this.starsTemplate}
269
+ </div>`;
138
270
  }
139
271
  };
140
272
  __decorate([
@@ -142,13 +274,10 @@ __decorate([
142
274
  ], Rating.prototype, "interactive", void 0);
143
275
  __decorate([
144
276
  property({ type: String })
145
- ], Rating.prototype, "max", void 0);
146
- __decorate([
147
- property({ type: String, reflect: true })
148
- ], Rating.prototype, "value", void 0);
277
+ ], Rating.prototype, "max", null);
149
278
  __decorate([
150
- queryAll('[part~="icon"]')
151
- ], Rating.prototype, "stars", void 0);
279
+ property({ type: String })
280
+ ], Rating.prototype, "value", null);
152
281
  Rating = __decorate([
153
282
  customElement('ef-rating', {
154
283
  alias: 'sapphire-rating'
@@ -1,2 +1,2 @@
1
1
 
2
- elf.customStyles.define('ef-rating', ':host{font-size:16px}:host [part=container]{touch-action:manipulation;display:flex;flex-direction:row-reverse;flex-wrap:nowrap}:host [part^=icon]{margin:0 1px;background:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDI0IDEwMjQiPgogICAgPHBhdGggZD0ibTEwMjQgMzk3LTM1NC01MS0xNTgtMzIxLTE1OCAzMjEtMzU0IDUxIDI1NiAyNTAtNjAgMzUyIDMxNi0xNjYgMzE2IDE2Ni02MC0zNTJ6IG0tNTEyIDM1Ny0yMjQgMTE4IDQzLTI0OS0xODEtMTc2IDI1MC0zNiAxMTItMjI2IDExMiAyMjYgMjUwIDM2LTE4MSAxNzYgNDMgMjQ5eiIgZmlsbD0iIzQwNDA0MCIvPgo8L3N2Zz4K) 0 0/100% no-repeat;width:1em;height:1em}:host [part^=icon]:first-child,:host [part^=icon]:last-child{margin:0}:host(:not([interactive])) [part~=icon-full],:host([interactive]) [part=container]:not(:hover) [part~=icon-full]{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogICAgPHBhdGggZD0ibTEwMjQgMzk3LTM1NC01MS0xNTgtMzIxLTE1OCAzMjEtMzU0IDUxIDI1NiAyNTAtNjAgMzUyIDMxNi0xNjYgMzE2IDE2Ni02MC0zNTJ6IiBmaWxsPSIjMzM0QkZGIi8+Cjwvc3ZnPgo=)}:host(:not([interactive])) [part~=icon-half],:host([interactive]) [part=container]:not(:hover) [part~=icon-half]{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogICAgPHBhdGggaWQ9InJpZ2h0IiBkPSJtMTAyNCAzOTctMzU0LTUxLTE1OS0zMjF2ODA4bDMxNyAxNjYtNjAtMzUyem0tNTEzIDM1N3YtNTcwbDExMyAyMjYgMjUwIDM2LTE4MSAxNzYgNDMgMjQ5eiIgZmlsbD0iIzQwNDA0MCIvPgogICAgPHBhdGggaWQ9ImxlZnQiIGQ9Im01MTIgMjUtMTU4IDMyMS0zNTQgNTEgMjU2IDI1MC02MCAzNTIgMzE2LTE2NnoiIGZpbGw9IiMzMzRCRkYiLz4KPC9zdmc+Cg==)}:host([interactive]) [part^=icon]{cursor:pointer}:host([interactive]) [part^=icon]:hover,:host([interactive]) [part^=icon]:hover~[part^=icon]{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogICAgPHBhdGggZD0ibTEwMjQgMzk3LTM1NC01MS0xNTgtMzIxLTE1OCAzMjEtMzU0IDUxIDI1NiAyNTAtNjAgMzUyIDMxNi0xNjYgMzE2IDE2Ni02MC0zNTJ6IiBmaWxsPSIjMzM0QkZGIi8+Cjwvc3ZnPgo=)}');
2
+ elf.customStyles.define('ef-rating', ':host{font-size:16px}:host [part=container]{touch-action:manipulation;display:flex;flex-direction:row-reverse;flex-wrap:nowrap}:host [part^=icon]{margin:0 1px;background:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDI0IDEwMjQiPgogICAgPHBhdGggZD0ibTEwMjQgMzk3LTM1NC01MS0xNTgtMzIxLTE1OCAzMjEtMzU0IDUxIDI1NiAyNTAtNjAgMzUyIDMxNi0xNjYgMzE2IDE2Ni02MC0zNTJ6IG0tNTEyIDM1Ny0yMjQgMTE4IDQzLTI0OS0xODEtMTc2IDI1MC0zNiAxMTItMjI2IDExMiAyMjYgMjUwIDM2LTE4MSAxNzYgNDMgMjQ5eiIgZmlsbD0iIzQwNDA0MCIvPgo8L3N2Zz4K) 0 0/100% no-repeat;width:1em;height:1em}:host [part^=icon]:first-child,:host [part^=icon]:last-child{margin:0}:host(:not([interactive])) [part~=icon-full],:host([interactive]) [part=container]:not(:hover) [part~=icon-full]{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogICAgPHBhdGggZD0ibTEwMjQgMzk3LTM1NC01MS0xNTgtMzIxLTE1OCAzMjEtMzU0IDUxIDI1NiAyNTAtNjAgMzUyIDMxNi0xNjYgMzE2IDE2Ni02MC0zNTJ6IiBmaWxsPSIjMzM0QkZGIi8+Cjwvc3ZnPgo=)}:host(:not([interactive])) [part~=icon-half],:host([interactive]) [part=container]:not(:hover) [part~=icon-half]{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogICAgPHBhdGggaWQ9InJpZ2h0IiBkPSJtMTAyNCAzOTctMzU0LTUxLTE1OS0zMjF2ODA4bDMxNyAxNjYtNjAtMzUyem0tNTEzIDM1N3YtNTcwbDExMyAyMjYgMjUwIDM2LTE4MSAxNzYgNDMgMjQ5eiIgZmlsbD0iIzQwNDA0MCIvPgogICAgPHBhdGggaWQ9ImxlZnQiIGQ9Im01MTIgMjUtMTU4IDMyMS0zNTQgNTEgMjU2IDI1MC02MCAzNTIgMzE2LTE2NnoiIGZpbGw9IiMzMzRCRkYiLz4KPC9zdmc+Cg==)}:host([interactive]) [part^=icon]{cursor:pointer}:host([interactive]) [part^=icon]:hover,:host([interactive]) [part^=icon]:hover~[part^=icon]{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogICAgPHBhdGggZD0ibTEwMjQgMzk3LTM1NC01MS0xNTgtMzIxLTE1OCAzMjEtMzU0IDUxIDI1NiAyNTAtNjAgMzUyIDMxNi0xNjYgMzE2IDE2Ni02MC0zNTJ6IiBmaWxsPSIjMzM0QkZGIi8+Cjwvc3ZnPgo=)}:host([focused=visible]){outline:#334bff solid 1px;outline-offset:2px}');
@@ -1,2 +1,2 @@
1
1
 
2
- elf.customStyles.define('ef-rating', ':host{font-size:16px}:host [part=container]{touch-action:manipulation;display:flex;flex-direction:row-reverse;flex-wrap:nowrap}:host [part^=icon]{margin:0 1px;background:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDI0IDEwMjQiPgogICAgPHBhdGggZD0ibTEwMjQgMzk3LTM1NC01MS0xNTgtMzIxLTE1OCAzMjEtMzU0IDUxIDI1NiAyNTAtNjAgMzUyIDMxNi0xNjYgMzE2IDE2Ni02MC0zNTJ6IG0tNTEyIDM1Ny0yMjQgMTE4IDQzLTI0OS0xODEtMTc2IDI1MC0zNiAxMTItMjI2IDExMiAyMjYgMjUwIDM2LTE4MSAxNzYgNDMgMjQ5eiIgZmlsbD0iIzU5NTk1OSIvPgo8L3N2Zz4K) 0 0/100% no-repeat;width:1em;height:1em}:host [part^=icon]:first-child,:host [part^=icon]:last-child{margin:0}:host(:not([interactive])) [part~=icon-full],:host([interactive]) [part=container]:not(:hover) [part~=icon-full]{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogICAgPHBhdGggZD0ibTEwMjQgMzk3LTM1NC01MS0xNTgtMzIxLTE1OCAzMjEtMzU0IDUxIDI1NiAyNTAtNjAgMzUyIDMxNi0xNjYgMzE2IDE2Ni02MC0zNTJ6IiBmaWxsPSIjMzM0QkZGIi8+Cjwvc3ZnPgo=)}:host(:not([interactive])) [part~=icon-half],:host([interactive]) [part=container]:not(:hover) [part~=icon-half]{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogICAgPHBhdGggaWQ9InJpZ2h0IiBkPSJtMTAyNCAzOTctMzU0LTUxLTE1OS0zMjF2ODA4bDMxNyAxNjYtNjAtMzUyem0tNTEzIDM1N3YtNTcwbDExMyAyMjYgMjUwIDM2LTE4MSAxNzYgNDMgMjQ5eiIgZmlsbD0iIzU5NTk1OSIvPgogICAgPHBhdGggaWQ9ImxlZnQiIGQ9Im01MTIgMjUtMTU4IDMyMS0zNTQgNTEgMjU2IDI1MC02MCAzNTIgMzE2LTE2NnoiIGZpbGw9IiMzMzRCRkYiLz4KPC9zdmc+Cg==)}:host([interactive]) [part^=icon]{cursor:pointer}:host([interactive]) [part^=icon]:hover,:host([interactive]) [part^=icon]:hover~[part^=icon]{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogICAgPHBhdGggZD0ibTEwMjQgMzk3LTM1NC01MS0xNTgtMzIxLTE1OCAzMjEtMzU0IDUxIDI1NiAyNTAtNjAgMzUyIDMxNi0xNjYgMzE2IDE2Ni02MC0zNTJ6IiBmaWxsPSIjMzM0QkZGIi8+Cjwvc3ZnPgo=)}');
2
+ elf.customStyles.define('ef-rating', ':host{font-size:16px}:host [part=container]{touch-action:manipulation;display:flex;flex-direction:row-reverse;flex-wrap:nowrap}:host [part^=icon]{margin:0 1px;background:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDI0IDEwMjQiPgogICAgPHBhdGggZD0ibTEwMjQgMzk3LTM1NC01MS0xNTgtMzIxLTE1OCAzMjEtMzU0IDUxIDI1NiAyNTAtNjAgMzUyIDMxNi0xNjYgMzE2IDE2Ni02MC0zNTJ6IG0tNTEyIDM1Ny0yMjQgMTE4IDQzLTI0OS0xODEtMTc2IDI1MC0zNiAxMTItMjI2IDExMiAyMjYgMjUwIDM2LTE4MSAxNzYgNDMgMjQ5eiIgZmlsbD0iIzU5NTk1OSIvPgo8L3N2Zz4K) 0 0/100% no-repeat;width:1em;height:1em}:host [part^=icon]:first-child,:host [part^=icon]:last-child{margin:0}:host(:not([interactive])) [part~=icon-full],:host([interactive]) [part=container]:not(:hover) [part~=icon-full]{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogICAgPHBhdGggZD0ibTEwMjQgMzk3LTM1NC01MS0xNTgtMzIxLTE1OCAzMjEtMzU0IDUxIDI1NiAyNTAtNjAgMzUyIDMxNi0xNjYgMzE2IDE2Ni02MC0zNTJ6IiBmaWxsPSIjMzM0QkZGIi8+Cjwvc3ZnPgo=)}:host(:not([interactive])) [part~=icon-half],:host([interactive]) [part=container]:not(:hover) [part~=icon-half]{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogICAgPHBhdGggaWQ9InJpZ2h0IiBkPSJtMTAyNCAzOTctMzU0LTUxLTE1OS0zMjF2ODA4bDMxNyAxNjYtNjAtMzUyem0tNTEzIDM1N3YtNTcwbDExMyAyMjYgMjUwIDM2LTE4MSAxNzYgNDMgMjQ5eiIgZmlsbD0iIzU5NTk1OSIvPgogICAgPHBhdGggaWQ9ImxlZnQiIGQ9Im01MTIgMjUtMTU4IDMyMS0zNTQgNTEgMjU2IDI1MC02MCAzNTIgMzE2LTE2NnoiIGZpbGw9IiMzMzRCRkYiLz4KPC9zdmc+Cg==)}:host([interactive]) [part^=icon]{cursor:pointer}:host([interactive]) [part^=icon]:hover,:host([interactive]) [part^=icon]:hover~[part^=icon]{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogICAgPHBhdGggZD0ibTEwMjQgMzk3LTM1NC01MS0xNTgtMzIxLTE1OCAzMjEtMzU0IDUxIDI1NiAyNTAtNjAgMzUyIDMxNi0xNjYgMzE2IDE2Ni02MC0zNTJ6IiBmaWxsPSIjMzM0QkZGIi8+Cjwvc3ZnPgo=)}:host([focused=visible]){outline:#334bff solid 1px;outline-offset:2px}');
@@ -1,2 +1,2 @@
1
1
 
2
- elf.customStyles.define('ef-rating', ':host [part=container]{touch-action:manipulation;display:flex;flex-direction:row-reverse;flex-wrap:nowrap}:host [part^=icon]{margin:0 1px;background:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogICAgPHBhdGggZD0ibTEwMjQgMzk3LTM1NC01MS0xNTgtMzIxLTE1OCAzMjEtMzU0IDUxIDI1NiAyNTAtNjAgMzUyIDMxNi0xNjYgMzE2IDE2Ni02MC0zNTJ6IiBmaWxsPSIjNjY2NTcwIi8+Cjwvc3ZnPgo=) 0 0/100% no-repeat;width:1em;height:1em}:host [part^=icon]:first-child,:host [part^=icon]:last-child{margin:0}:host([interactive]) [part^=icon]{cursor:pointer}:host{font-size:10px}:host([size=large]){font-size:15px}:host(:not([interactive])) [part~=icon-full],:host([interactive]) [part=container]:not(:hover) [part~=icon-full]{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogICAgPHBhdGggZD0ibTEwMjQgMzk3LTM1NC01MS0xNTgtMzIxLTE1OCAzMjEtMzU0IDUxIDI1NiAyNTAtNjAgMzUyIDMxNi0xNjYgMzE2IDE2Ni02MC0zNTJ6IiBmaWxsPSIjRkY5OTMzIi8+Cjwvc3ZnPgo=)}:host(:not([interactive])) [part~=icon-half],:host([interactive]) [part=container]:not(:hover) [part~=icon-half]{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogICAgPHBhdGggaWQ9ImxlZnQiIGQ9Im01MTIgMjUtMTU4IDMyMS0zNTQgNTEgMjU2IDI1MC02MCAzNTIgMzE2LTE2NnoiIGZpbGw9IiNGRjk5MzMiLz4KICAgIDxwYXRoIGlkPSJyaWdodCIgZD0ibTEwMjQgMzk3LTM1NC01MS0xNTktMzIxdjgwOGwzMTcgMTY2LTYwLTM1MnoiIGZpbGw9IiM2NjY1NzAiLz4KPC9zdmc+Cg==)}:host([interactive]) [part^=icon]:hover,:host([interactive]) [part^=icon]:hover~[part^=icon]{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogICAgPHBhdGggZD0ibTEwMjQgMzk3LTM1NC01MS0xNTgtMzIxLTE1OCAzMjEtMzU0IDUxIDI1NiAyNTAtNjAgMzUyIDMxNi0xNjYgMzE2IDE2Ni02MC0zNTJ6IiBmaWxsPSIjRkY5OTMzIi8+Cjwvc3ZnPgo=)}');
2
+ elf.customStyles.define('ef-rating', ':host [part=container]{touch-action:manipulation;display:flex;flex-direction:row-reverse;flex-wrap:nowrap}:host [part^=icon]{margin:0 1px;background:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogICAgPHBhdGggZD0ibTEwMjQgMzk3LTM1NC01MS0xNTgtMzIxLTE1OCAzMjEtMzU0IDUxIDI1NiAyNTAtNjAgMzUyIDMxNi0xNjYgMzE2IDE2Ni02MC0zNTJ6IiBmaWxsPSIjNjY2NTcwIi8+Cjwvc3ZnPgo=) 0 0/100% no-repeat;width:1em;height:1em}:host [part^=icon]:first-child,:host [part^=icon]:last-child{margin:0}:host([interactive]) [part^=icon]{cursor:pointer}:host([focused=visible]){outline:#f93 solid 1px;outline-offset:2px}:host{font-size:10px}:host([size=large]){font-size:15px}:host(:not([interactive])) [part~=icon-full],:host([interactive]) [part=container]:not(:hover) [part~=icon-full]{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogICAgPHBhdGggZD0ibTEwMjQgMzk3LTM1NC01MS0xNTgtMzIxLTE1OCAzMjEtMzU0IDUxIDI1NiAyNTAtNjAgMzUyIDMxNi0xNjYgMzE2IDE2Ni02MC0zNTJ6IiBmaWxsPSIjRkY5OTMzIi8+Cjwvc3ZnPgo=)}:host(:not([interactive])) [part~=icon-half],:host([interactive]) [part=container]:not(:hover) [part~=icon-half]{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogICAgPHBhdGggaWQ9ImxlZnQiIGQ9Im01MTIgMjUtMTU4IDMyMS0zNTQgNTEgMjU2IDI1MC02MCAzNTIgMzE2LTE2NnoiIGZpbGw9IiNGRjk5MzMiLz4KICAgIDxwYXRoIGlkPSJyaWdodCIgZD0ibTEwMjQgMzk3LTM1NC01MS0xNTktMzIxdjgwOGwzMTcgMTY2LTYwLTM1MnoiIGZpbGw9IiM2NjY1NzAiLz4KPC9zdmc+Cg==)}:host([interactive]) [part^=icon]:hover,:host([interactive]) [part^=icon]:hover~[part^=icon]{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogICAgPHBhdGggZD0ibTEwMjQgMzk3LTM1NC01MS0xNTgtMzIxLTE1OCAzMjEtMzU0IDUxIDI1NiAyNTAtNjAgMzUyIDMxNi0xNjYgMzE2IDE2Ni02MC0zNTJ6IiBmaWxsPSIjRkY5OTMzIi8+Cjwvc3ZnPgo=)}');
@@ -1,2 +1,2 @@
1
1
 
2
- elf.customStyles.define('ef-rating', ':host [part=container]{touch-action:manipulation;display:flex;flex-direction:row-reverse;flex-wrap:nowrap}:host [part^=icon]{margin:0 1px;background:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogICAgPHBhdGggZD0ibTEwMjQgMzk3LTM1NC01MS0xNTgtMzIxLTE1OCAzMjEtMzU0IDUxIDI1NiAyNTAtNjAgMzUyIDMxNi0xNjYgMzE2IDE2Ni02MC0zNTJ6IiBmaWxsPSIjQUNBRkI1Ii8+Cjwvc3ZnPgo=) 0 0/100% no-repeat;width:1em;height:1em}:host [part^=icon]:first-child,:host [part^=icon]:last-child{margin:0}:host([interactive]) [part^=icon]{cursor:pointer}:host{font-size:10px}:host([size=large]){font-size:15px}:host(:not([interactive])) [part~=icon-full],:host([interactive]) [part=container]:not(:hover) [part~=icon-full]{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogICAgPHBhdGggZD0ibTEwMjQgMzk3LTM1NC01MS0xNTgtMzIxLTE1OCAzMjEtMzU0IDUxIDI1NiAyNTAtNjAgMzUyIDMxNi0xNjYgMzE2IDE2Ni02MC0zNTJ6IiBmaWxsPSIjRUU3NjAwIi8+Cjwvc3ZnPgo=)}:host(:not([interactive])) [part~=icon-half],:host([interactive]) [part=container]:not(:hover) [part~=icon-half]{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogICAgPHBhdGggaWQ9ImxlZnQiIGQ9Im01MTIgMjUtMTU4IDMyMS0zNTQgNTEgMjU2IDI1MC02MCAzNTIgMzE2LTE2NnoiIGZpbGw9IiNFRTc2MDAiLz4KICAgIDxwYXRoIGlkPSJyaWdodCIgZD0ibTEwMjQgMzk3LTM1NC01MS0xNTktMzIxdjgwOGwzMTcgMTY2LTYwLTM1MnoiIGZpbGw9IiNBQ0FGQjUiLz4KPC9zdmc+Cg==)}:host([interactive]) [part^=icon]:hover,:host([interactive]) [part^=icon]:hover~[part^=icon]{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogICAgPHBhdGggZD0ibTEwMjQgMzk3LTM1NC01MS0xNTgtMzIxLTE1OCAzMjEtMzU0IDUxIDI1NiAyNTAtNjAgMzUyIDMxNi0xNjYgMzE2IDE2Ni02MC0zNTJ6IiBmaWxsPSIjRUU3NjAwIi8+Cjwvc3ZnPgo=)}');
2
+ elf.customStyles.define('ef-rating', ':host [part=container]{touch-action:manipulation;display:flex;flex-direction:row-reverse;flex-wrap:nowrap}:host [part^=icon]{margin:0 1px;background:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogICAgPHBhdGggZD0ibTEwMjQgMzk3LTM1NC01MS0xNTgtMzIxLTE1OCAzMjEtMzU0IDUxIDI1NiAyNTAtNjAgMzUyIDMxNi0xNjYgMzE2IDE2Ni02MC0zNTJ6IiBmaWxsPSIjQUNBRkI1Ii8+Cjwvc3ZnPgo=) 0 0/100% no-repeat;width:1em;height:1em}:host [part^=icon]:first-child,:host [part^=icon]:last-child{margin:0}:host([interactive]) [part^=icon]{cursor:pointer}:host([focused=visible]){outline:#ffb266 solid 1px;outline-offset:2px}:host{font-size:10px}:host([size=large]){font-size:15px}:host(:not([interactive])) [part~=icon-full],:host([interactive]) [part=container]:not(:hover) [part~=icon-full]{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogICAgPHBhdGggZD0ibTEwMjQgMzk3LTM1NC01MS0xNTgtMzIxLTE1OCAzMjEtMzU0IDUxIDI1NiAyNTAtNjAgMzUyIDMxNi0xNjYgMzE2IDE2Ni02MC0zNTJ6IiBmaWxsPSIjRUU3NjAwIi8+Cjwvc3ZnPgo=)}:host(:not([interactive])) [part~=icon-half],:host([interactive]) [part=container]:not(:hover) [part~=icon-half]{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogICAgPHBhdGggaWQ9ImxlZnQiIGQ9Im01MTIgMjUtMTU4IDMyMS0zNTQgNTEgMjU2IDI1MC02MCAzNTIgMzE2LTE2NnoiIGZpbGw9IiNFRTc2MDAiLz4KICAgIDxwYXRoIGlkPSJyaWdodCIgZD0ibTEwMjQgMzk3LTM1NC01MS0xNTktMzIxdjgwOGwzMTcgMTY2LTYwLTM1MnoiIGZpbGw9IiNBQ0FGQjUiLz4KPC9zdmc+Cg==)}:host([interactive]) [part^=icon]:hover,:host([interactive]) [part^=icon]:hover~[part^=icon]{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogICAgPHBhdGggZD0ibTEwMjQgMzk3LTM1NC01MS0xNTgtMzIxLTE1OCAzMjEtMzU0IDUxIDI1NiAyNTAtNjAgMzUyIDMxNi0xNjYgMzE2IDE2Ni02MC0zNTJ6IiBmaWxsPSIjRUU3NjAwIi8+Cjwvc3ZnPgo=)}');
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Return value that never exceed the maximum boundary
3
+ * @param value value for check clamp
4
+ * @param min max value
5
+ * @param max min value
6
+ * @returns number between two numbers
7
+ */
8
+ declare const clamp: (value: number, min: number, max: number) => number;
9
+ export { clamp };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Return value that never exceed the maximum boundary
3
+ * @param value value for check clamp
4
+ * @param min max value
5
+ * @param max min value
6
+ * @returns number between two numbers
7
+ */
8
+ const clamp = function (value, min, max) {
9
+ return Math.max(min, Math.min(value, max));
10
+ };
11
+ export { clamp };
@@ -1,3 +1,3 @@
1
1
  import '@refinitiv-ui/elements/icon/themes/halo/dark';
2
2
 
3
- elf.customStyles.define('ef-search-field', ':host{display:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-align:left;font-family:inherit;font-size:12rem;font-weight:400;height:24px;width:152px;max-width:100%;padding:0 8px;margin:1px 0;outline:0;box-sizing:border-box;display:inline-flex;align-items:center;position:relative;vertical-align:middle;border-radius:0;background-color:#0d0d0d;text-overflow:ellipsis;border:1px solid #404040;color:#ccc}:host([disabled]){border:1px solid rgba(64,64,64,.5);color:rgba(204,204,204,.5);background-color:rgba(13,13,13,.5)}:host([type=number]){padding-right:0}:host([warning]){border:1px solid #ffc800}:host([warning][disabled]){color:rgba(204,204,204,.5);border:1px solid rgba(127,100,0,.5)}:host([error]),:host([error][warning]){border:1px solid #f5475b}:host([error][disabled]),:host([error][warning][disabled]){color:rgba(204,204,204,.5);border:1px solid rgba(160,28,43,.5)}:host ::-ms-clear{display:none}:host([focused]){background-size:100% 2px,100% 1px!important;background-position:center bottom!important;border-color:#334bff}:host [part=input]{color:inherit;padding:0;margin:0;flex:1 1 auto;min-width:0;width:100%;height:100%;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-overflow:ellipsis;touch-action:manipulation}:host [part=input]::-webkit-clear-button,:host [part=input]::-webkit-inner-spin-button,:host [part=input]::-webkit-search-cancel-button,:host [part=input]::-webkit-search-decoration{-webkit-appearance:none}:host [part=input]:invalid{box-shadow:none}:host [part=icon]{color:#ccc;min-width:1em;padding-left:2px}:host([disabled]) [part=input]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host ::-moz-selection{color:#fff;background-color:#334bff}:host ::selection{color:#fff;background-color:#334bff}:host(:not([readonly]):not([error]):not([warning]):not([focused]):hover){border-color:grey;color:#fff}:host(:not([readonly]):not([error]):not([warning]):not([focused]):hover) [part=icon]{color:#6678ff}:host([warning]:hover:not([readonly]):not([focused])){color:#fff;border-color:#ffe999}:host([warning][disabled]),:host([warning][readonly]:not([focused])){border-color:rgba(255,233,153,.5)}:host([error]:hover:not([readonly]):not([focused])){color:#fff;border-color:#faa8b1}:host([error][disabled]),:host([error][readonly]:not([focused])),:host([error][warning][disabled]){border-color:rgba(250,168,177,.5)}:host([readonly]:not([focused])){border-color:rgba(64,64,64,.5);background-color:rgba(13,13,13,.5)}:host([readonly]:not([focused])) [part=icon]{color:rgba(204,204,204,.5)}:host([focused]),:host([focused][error][warning]){border-color:#334bff;color:#fff}:host([focused]) [part=icon],:host([focused][error][warning]) [part=icon]{color:#6678ff}');
3
+ elf.customStyles.define('ef-search-field', ':host{display:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-align:left;font-family:inherit;font-size:12rem;font-weight:400;height:24px;width:152px;max-width:100%;padding:0 8px;margin:1px 0;outline:0;box-sizing:border-box;display:inline-flex;align-items:center;position:relative;vertical-align:middle;border-radius:0;background-color:#0d0d0d;text-overflow:ellipsis;border:1px solid #404040;color:#ccc}:host([disabled]){border:1px solid rgba(64,64,64,.5);color:rgba(204,204,204,.5);background-color:rgba(13,13,13,.5)}:host([type=number]){padding-right:0}:host([warning]){border:1px solid #ffc800}:host([warning][disabled]){color:rgba(204,204,204,.5);border:1px solid rgba(127,100,0,.5)}:host([error]),:host([error][warning]){border:1px solid #f5475b}:host([error][disabled]),:host([error][warning][disabled]){color:rgba(204,204,204,.5);border:1px solid rgba(160,28,43,.5)}:host ::-ms-clear{display:none}:host([focused]){background-size:100% 2px,100% 1px!important;background-position:center bottom!important;border-color:#334bff}:host [part=input]{color:inherit;padding:0;margin:0;flex:1 1 auto;min-width:0;width:100%;height:100%;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-overflow:ellipsis;touch-action:manipulation}:host [part=input]::-webkit-clear-button,:host [part=input]::-webkit-inner-spin-button,:host [part=input]::-webkit-search-cancel-button,:host [part=input]::-webkit-search-decoration{-webkit-appearance:none}:host [part=input]:invalid{box-shadow:none}:host [part=icon]{color:#ccc;min-width:1em;padding-left:2px}:host([disabled]) [part=input]{-webkit-user-select:none;-moz-user-select:none;user-select:none}:host ::-moz-selection{color:#fff;background-color:#334bff}:host ::selection{color:#fff;background-color:#334bff}:host(:not([readonly]):not([error]):not([warning]):not([focused]):hover){border-color:grey;color:#fff}:host(:not([readonly]):not([error]):not([warning]):not([focused]):hover) [part=icon]{color:#6678ff}:host([warning]:hover:not([readonly]):not([focused])){color:#fff;border-color:#ffe999}:host([warning][disabled]),:host([warning][readonly]:not([focused])){border-color:rgba(255,233,153,.5)}:host([error]:hover:not([readonly]):not([focused])){color:#fff;border-color:#faa8b1}:host([error][disabled]),:host([error][readonly]:not([focused])),:host([error][warning][disabled]){border-color:rgba(250,168,177,.5)}:host([readonly]:not([focused])){border-color:rgba(64,64,64,.5);background-color:rgba(13,13,13,.5)}:host([readonly]:not([focused])) [part=icon]{color:rgba(204,204,204,.5)}:host([focused]),:host([focused][error][warning]){border-color:#334bff;color:#fff}:host([focused]) [part=icon],:host([focused][error][warning]) [part=icon]{color:#6678ff}');
@@ -1,3 +1,3 @@
1
1
  import '@refinitiv-ui/elements/icon/themes/halo/light';
2
2
 
3
- elf.customStyles.define('ef-search-field', ':host{display:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-align:left;font-family:inherit;font-size:12rem;font-weight:400;height:24px;width:152px;max-width:100%;padding:0 8px;margin:1px 0;outline:0;box-sizing:border-box;display:inline-flex;align-items:center;position:relative;vertical-align:middle;border-radius:0;background-color:#fff;text-overflow:ellipsis;border:1px solid #595959;color:#404040}:host([disabled]){border:1px solid rgba(89,89,89,.5);color:rgba(64,64,64,.5);background-color:rgba(255,255,255,.5)}:host([type=number]){padding-right:0}:host([warning]){border:1px solid #cca000}:host([warning][disabled]){color:rgba(64,64,64,.5);border:1px solid rgba(204,160,0,.5)}:host([error]),:host([error][warning]){border:1px solid #d94255}:host([error][disabled]),:host([error][warning][disabled]){color:rgba(64,64,64,.5);border:1px solid rgba(182,50,67,.5)}:host ::-ms-clear{display:none}:host([focused]){background-size:100% 2px,100% 1px!important;background-position:center bottom!important;border-color:#334bff}:host [part=input]{color:inherit;padding:0;margin:0;flex:1 1 auto;min-width:0;width:100%;height:100%;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-overflow:ellipsis;touch-action:manipulation}:host [part=input]::-webkit-clear-button,:host [part=input]::-webkit-inner-spin-button,:host [part=input]::-webkit-search-cancel-button,:host [part=input]::-webkit-search-decoration{-webkit-appearance:none}:host [part=input]:invalid{box-shadow:none}:host [part=icon]{color:#404040;min-width:1em;padding-left:2px}:host([disabled]) [part=input]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host ::-moz-selection{color:#fff;background-color:#334bff}:host ::selection{color:#fff;background-color:#334bff}:host(:not([readonly]):not([error]):not([warning]):not([focused]):hover){border-color:#0d0d0d;color:#0d0d0d}:host(:not([readonly]):not([error]):not([warning]):not([focused]):hover) [part=icon]{color:#334bff}:host([warning]:hover:not([readonly]):not([focused])){color:#0d0d0d;border-color:#ffe999}:host([warning][disabled]),:host([warning][readonly]:not([focused])){border-color:rgba(255,233,153,.5)}:host([error]:hover:not([readonly]):not([focused])){color:#0d0d0d;border-color:#eeacb4}:host([error][disabled]),:host([error][readonly]:not([focused])),:host([error][warning][disabled]){border-color:rgba(238,172,180,.5)}:host([readonly]:not([focused])){border-color:rgba(89,89,89,.5);background-color:rgba(255,255,255,.5)}:host([readonly]:not([focused])) [part=icon]{color:rgba(64,64,64,.5)}:host([focused]),:host([focused][error][warning]){border-color:#334bff;color:#0d0d0d}:host([focused]) [part=icon],:host([focused][error][warning]) [part=icon]{color:#334bff}');
3
+ elf.customStyles.define('ef-search-field', ':host{display:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-align:left;font-family:inherit;font-size:12rem;font-weight:400;height:24px;width:152px;max-width:100%;padding:0 8px;margin:1px 0;outline:0;box-sizing:border-box;display:inline-flex;align-items:center;position:relative;vertical-align:middle;border-radius:0;background-color:#fff;text-overflow:ellipsis;border:1px solid #595959;color:#404040}:host([disabled]){border:1px solid rgba(89,89,89,.5);color:rgba(64,64,64,.5);background-color:rgba(255,255,255,.5)}:host([type=number]){padding-right:0}:host([warning]){border:1px solid #cca000}:host([warning][disabled]){color:rgba(64,64,64,.5);border:1px solid rgba(204,160,0,.5)}:host([error]),:host([error][warning]){border:1px solid #d94255}:host([error][disabled]),:host([error][warning][disabled]){color:rgba(64,64,64,.5);border:1px solid rgba(182,50,67,.5)}:host ::-ms-clear{display:none}:host([focused]){background-size:100% 2px,100% 1px!important;background-position:center bottom!important;border-color:#334bff}:host [part=input]{color:inherit;padding:0;margin:0;flex:1 1 auto;min-width:0;width:100%;height:100%;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-overflow:ellipsis;touch-action:manipulation}:host [part=input]::-webkit-clear-button,:host [part=input]::-webkit-inner-spin-button,:host [part=input]::-webkit-search-cancel-button,:host [part=input]::-webkit-search-decoration{-webkit-appearance:none}:host [part=input]:invalid{box-shadow:none}:host [part=icon]{color:#404040;min-width:1em;padding-left:2px}:host([disabled]) [part=input]{-webkit-user-select:none;-moz-user-select:none;user-select:none}:host ::-moz-selection{color:#fff;background-color:#334bff}:host ::selection{color:#fff;background-color:#334bff}:host(:not([readonly]):not([error]):not([warning]):not([focused]):hover){border-color:#0d0d0d;color:#0d0d0d}:host(:not([readonly]):not([error]):not([warning]):not([focused]):hover) [part=icon]{color:#334bff}:host([warning]:hover:not([readonly]):not([focused])){color:#0d0d0d;border-color:#ffe999}:host([warning][disabled]),:host([warning][readonly]:not([focused])){border-color:rgba(255,233,153,.5)}:host([error]:hover:not([readonly]):not([focused])){color:#0d0d0d;border-color:#eeacb4}:host([error][disabled]),:host([error][readonly]:not([focused])),:host([error][warning][disabled]){border-color:rgba(238,172,180,.5)}:host([readonly]:not([focused])){border-color:rgba(89,89,89,.5);background-color:rgba(255,255,255,.5)}:host([readonly]:not([focused])) [part=icon]{color:rgba(64,64,64,.5)}:host([focused]),:host([focused][error][warning]){border-color:#334bff;color:#0d0d0d}:host([focused]) [part=icon],:host([focused][error][warning]) [part=icon]{color:#334bff}');
@@ -1,3 +1,3 @@
1
1
  import '@refinitiv-ui/elements/icon/themes/solar/charcoal';
2
2
 
3
- elf.customStyles.define('ef-search-field', ':host{display:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-align:left;font-family:inherit;font-size:13rem;font-weight:400;height:23px;width:140px;max-width:100%;padding:0 5px;margin:1px 0;outline:0;box-sizing:border-box;display:inline-flex;align-items:center;position:relative;vertical-align:middle;color:#c2c2c2;border-radius:0;text-overflow:ellipsis;background-color:#000;border:1px solid #4a4a52}:host([type=number]){padding-right:0}:host([error]),:host([error][warning]){border:1px solid #f5475b}:host([error][disabled]),:host([error][warning][disabled]){color:rgba(194,194,194,.6);border:1px solid rgba(245,71,91,.6)}:host ::-ms-clear{display:none}:host [part=input]{color:inherit;padding:0;margin:0;flex:1 1 auto;min-width:0;width:100%;height:100%;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-overflow:ellipsis;touch-action:manipulation}:host [part=input]::-webkit-clear-button,:host [part=input]::-webkit-inner-spin-button,:host [part=input]::-webkit-search-cancel-button,:host [part=input]::-webkit-search-decoration{-webkit-appearance:none}:host [part=input]:invalid{box-shadow:none}:host [part=icon]{color:#e2e2e2;min-width:1em}:host([disabled]) [part=input]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host([disabled]){border:1px solid rgba(74,74,82,.6);color:rgba(194,194,194,.6)}:host([readonly]){border:1px solid rgba(74,74,82,.6)}:host(:not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #77777d}:host([warning]){background-color:#000;border:1px solid #f93}:host([warning][disabled]){border:1px solid rgba(255,153,51,.6);color:rgba(194,194,194,.6)}:host([warning][readonly]){border:1px solid rgba(255,153,51,.6)}:host([warning]:not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #ffb366}:host([error]),:host([error][warning]:not([focused])){background-color:#000;border:1px solid #f5475b}:host([error][disabled]),:host([error][warning]:not([focused])[disabled]){border:1px solid rgba(245,71,91,.6);color:rgba(194,194,194,.6)}:host([error][readonly]),:host([error][warning]:not([focused])[readonly]){border:1px solid rgba(245,71,91,.6)}:host([error]:not([focused]):not(:focus):not([disabled]):not([readonly]):hover),:host([error][warning]:not([focused]):not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #f87584}:host([highlight]){background-color:#1b252f;border:1px solid #4a4a52}:host([highlight][disabled]){border:1px solid rgba(74,74,82,.6);color:rgba(194,194,194,.6);background-color:rgba(27,37,47,.6)}:host([highlight][readonly]){border:1px solid rgba(74,74,82,.6)}:host([highlight]:not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #77777d}:host([indirect]){color:#0fd;background-color:#000;border:1px solid #898623}:host([indirect][disabled]){border:1px solid rgba(137,134,35,.6);color:rgba(0,255,221,.6)}:host([indirect][readonly]){border:1px solid rgba(137,134,35,.6)}:host([indirect]:not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #a7a45a}:host([focused]){background-size:100% 2px,100% 1px!important;background-position:center bottom!important;border-color:#f93;border-style:dotted}:host([disabled]) [part=input]::-webkit-input-placeholder{color:rgba(102,101,112,.6)}:host([disabled]) [part=input]::-moz-placeholder{color:rgba(102,101,112,.6)}:host([disabled]) [part=input]:-ms-input-placeholder{color:rgba(102,101,112,.6)}');
3
+ elf.customStyles.define('ef-search-field', ':host{display:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-align:left;font-family:inherit;font-size:13rem;font-weight:400;height:23px;width:140px;max-width:100%;padding:0 5px;margin:1px 0;outline:0;box-sizing:border-box;display:inline-flex;align-items:center;position:relative;vertical-align:middle;color:#c2c2c2;border-radius:0;text-overflow:ellipsis;background-color:#000;border:1px solid #4a4a52}:host([type=number]){padding-right:0}:host([error]),:host([error][warning]){border:1px solid #f5475b}:host([error][disabled]),:host([error][warning][disabled]){color:rgba(194,194,194,.6);border:1px solid rgba(245,71,91,.6)}:host ::-ms-clear{display:none}:host [part=input]{color:inherit;padding:0;margin:0;flex:1 1 auto;min-width:0;width:100%;height:100%;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-overflow:ellipsis;touch-action:manipulation}:host [part=input]::-webkit-clear-button,:host [part=input]::-webkit-inner-spin-button,:host [part=input]::-webkit-search-cancel-button,:host [part=input]::-webkit-search-decoration{-webkit-appearance:none}:host [part=input]:invalid{box-shadow:none}:host [part=icon]{color:#e2e2e2;min-width:1em}:host([disabled]) [part=input]{-webkit-user-select:none;-moz-user-select:none;user-select:none}:host([disabled]){border:1px solid rgba(74,74,82,.6);color:rgba(194,194,194,.6)}:host([readonly]){border:1px solid rgba(74,74,82,.6)}:host(:not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #77777d}:host([warning]){background-color:#000;border:1px solid #f93}:host([warning][disabled]){border:1px solid rgba(255,153,51,.6);color:rgba(194,194,194,.6)}:host([warning][readonly]){border:1px solid rgba(255,153,51,.6)}:host([warning]:not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #ffb366}:host([error]),:host([error][warning]:not([focused])){background-color:#000;border:1px solid #f5475b}:host([error][disabled]),:host([error][warning]:not([focused])[disabled]){border:1px solid rgba(245,71,91,.6);color:rgba(194,194,194,.6)}:host([error][readonly]),:host([error][warning]:not([focused])[readonly]){border:1px solid rgba(245,71,91,.6)}:host([error]:not([focused]):not(:focus):not([disabled]):not([readonly]):hover),:host([error][warning]:not([focused]):not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #f87584}:host([highlight]){background-color:#1b252f;border:1px solid #4a4a52}:host([highlight][disabled]){border:1px solid rgba(74,74,82,.6);color:rgba(194,194,194,.6);background-color:rgba(27,37,47,.6)}:host([highlight][readonly]){border:1px solid rgba(74,74,82,.6)}:host([highlight]:not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #77777d}:host([indirect]){color:#0fd;background-color:#000;border:1px solid #898623}:host([indirect][disabled]){border:1px solid rgba(137,134,35,.6);color:rgba(0,255,221,.6)}:host([indirect][readonly]){border:1px solid rgba(137,134,35,.6)}:host([indirect]:not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #a7a45a}:host([focused]){background-size:100% 2px,100% 1px!important;background-position:center bottom!important;border-color:#f93;border-style:dotted}:host([disabled]) [part=input]::-webkit-input-placeholder{color:rgba(102,101,112,.6)}:host([disabled]) [part=input]::-moz-placeholder{color:rgba(102,101,112,.6)}:host([disabled]) [part=input]:-ms-input-placeholder{color:rgba(102,101,112,.6)}');
@@ -1,3 +1,3 @@
1
1
  import '@refinitiv-ui/elements/icon/themes/solar/pearl';
2
2
 
3
- elf.customStyles.define('ef-search-field', ':host{display:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-align:left;font-family:inherit;font-size:13rem;font-weight:400;height:23px;width:140px;max-width:100%;padding:0 5px;margin:1px 0;outline:0;box-sizing:border-box;display:inline-flex;align-items:center;position:relative;vertical-align:middle;color:#484848;border-radius:0;text-overflow:ellipsis;background-color:#fff;border:1px solid #a9afba}:host([type=number]){padding-right:0}:host([error]),:host([error][warning]){border:1px solid #d94255}:host([error][disabled]),:host([error][warning][disabled]){color:rgba(72,72,72,.6);border:1px solid rgba(217,66,85,.6)}:host ::-ms-clear{display:none}:host [part=input]{color:inherit;padding:0;margin:0;flex:1 1 auto;min-width:0;width:100%;height:100%;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-overflow:ellipsis;touch-action:manipulation}:host [part=input]::-webkit-clear-button,:host [part=input]::-webkit-inner-spin-button,:host [part=input]::-webkit-search-cancel-button,:host [part=input]::-webkit-search-decoration{-webkit-appearance:none}:host [part=input]:invalid{box-shadow:none}:host [part=icon]{color:#acafb5;min-width:1em}:host([disabled]) [part=input]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host([disabled]){border:1px solid rgba(169,175,186,.6);color:rgba(72,72,72,.6)}:host([readonly]){border:1px solid rgba(169,175,186,.6)}:host(:not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #bfc3cb}:host([warning]){background-color:#fff;border:1px solid #f93}:host([warning][disabled]){border:1px solid rgba(255,153,51,.6);color:rgba(72,72,72,.6)}:host([warning][readonly]){border:1px solid rgba(255,153,51,.6)}:host([warning]:not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #ffb366}:host([error]),:host([error][warning]:not([focused])){background-color:#fff;border:1px solid #d94255}:host([error][disabled]),:host([error][warning]:not([focused])[disabled]){border:1px solid rgba(217,66,85,.6);color:rgba(72,72,72,.6)}:host([error][readonly]),:host([error][warning]:not([focused])[readonly]){border:1px solid rgba(217,66,85,.6)}:host([error]:not([focused]):not(:focus):not([disabled]):not([readonly]):hover),:host([error][warning]:not([focused]):not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #e37180}:host([highlight]){background-color:#b0ffff;border:1px solid #a9afba}:host([highlight][disabled]){border:1px solid rgba(169,175,186,.6);color:rgba(72,72,72,.6);background-color:rgba(176,255,255,.6)}:host([highlight][readonly]){border:1px solid rgba(169,175,186,.6)}:host([highlight]:not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #bfc3cb}:host([indirect]){color:#009494;background-color:#effefe;border:1px solid #898623}:host([indirect][disabled]){border:1px solid rgba(137,134,35,.6);color:rgba(0,148,148,.6)}:host([indirect][readonly]){border:1px solid rgba(137,134,35,.6)}:host([indirect]:not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #a7a45a}:host([focused]){background-size:100% 2px,100% 1px!important;background-position:center bottom!important;border-color:#ffb266;border-style:dotted}:host([disabled]) [part=input]::-webkit-input-placeholder{color:rgba(102,101,112,.6)}:host([disabled]) [part=input]::-moz-placeholder{color:rgba(102,101,112,.6)}:host([disabled]) [part=input]:-ms-input-placeholder{color:rgba(102,101,112,.6)}');
3
+ elf.customStyles.define('ef-search-field', ':host{display:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-align:left;font-family:inherit;font-size:13rem;font-weight:400;height:23px;width:140px;max-width:100%;padding:0 5px;margin:1px 0;outline:0;box-sizing:border-box;display:inline-flex;align-items:center;position:relative;vertical-align:middle;color:#484848;border-radius:0;text-overflow:ellipsis;background-color:#fff;border:1px solid #a9afba}:host([type=number]){padding-right:0}:host([error]),:host([error][warning]){border:1px solid #d94255}:host([error][disabled]),:host([error][warning][disabled]){color:rgba(72,72,72,.6);border:1px solid rgba(217,66,85,.6)}:host ::-ms-clear{display:none}:host [part=input]{color:inherit;padding:0;margin:0;flex:1 1 auto;min-width:0;width:100%;height:100%;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-overflow:ellipsis;touch-action:manipulation}:host [part=input]::-webkit-clear-button,:host [part=input]::-webkit-inner-spin-button,:host [part=input]::-webkit-search-cancel-button,:host [part=input]::-webkit-search-decoration{-webkit-appearance:none}:host [part=input]:invalid{box-shadow:none}:host [part=icon]{color:#acafb5;min-width:1em}:host([disabled]) [part=input]{-webkit-user-select:none;-moz-user-select:none;user-select:none}:host([disabled]){border:1px solid rgba(169,175,186,.6);color:rgba(72,72,72,.6)}:host([readonly]){border:1px solid rgba(169,175,186,.6)}:host(:not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #bfc3cb}:host([warning]){background-color:#fff;border:1px solid #f93}:host([warning][disabled]){border:1px solid rgba(255,153,51,.6);color:rgba(72,72,72,.6)}:host([warning][readonly]){border:1px solid rgba(255,153,51,.6)}:host([warning]:not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #ffb366}:host([error]),:host([error][warning]:not([focused])){background-color:#fff;border:1px solid #d94255}:host([error][disabled]),:host([error][warning]:not([focused])[disabled]){border:1px solid rgba(217,66,85,.6);color:rgba(72,72,72,.6)}:host([error][readonly]),:host([error][warning]:not([focused])[readonly]){border:1px solid rgba(217,66,85,.6)}:host([error]:not([focused]):not(:focus):not([disabled]):not([readonly]):hover),:host([error][warning]:not([focused]):not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #e37180}:host([highlight]){background-color:#b0ffff;border:1px solid #a9afba}:host([highlight][disabled]){border:1px solid rgba(169,175,186,.6);color:rgba(72,72,72,.6);background-color:rgba(176,255,255,.6)}:host([highlight][readonly]){border:1px solid rgba(169,175,186,.6)}:host([highlight]:not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #bfc3cb}:host([indirect]){color:#009494;background-color:#effefe;border:1px solid #898623}:host([indirect][disabled]){border:1px solid rgba(137,134,35,.6);color:rgba(0,148,148,.6)}:host([indirect][readonly]){border:1px solid rgba(137,134,35,.6)}:host([indirect]:not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #a7a45a}:host([focused]){background-size:100% 2px,100% 1px!important;background-position:center bottom!important;border-color:#ffb266;border-style:dotted}:host([disabled]) [part=input]::-webkit-input-placeholder{color:rgba(102,101,112,.6)}:host([disabled]) [part=input]::-moz-placeholder{color:rgba(102,101,112,.6)}:host([disabled]) [part=input]:-ms-input-placeholder{color:rgba(102,101,112,.6)}');
@@ -103,7 +103,14 @@ export declare class Select extends ControlElement implements MultiValue {
103
103
  * @readonly
104
104
  */
105
105
  get values(): string[];
106
- private menuEl?;
106
+ /**
107
+ * Reference to the menu element
108
+ */
109
+ private menuRef;
110
+ /**
111
+ * Reference to the label element
112
+ */
113
+ private labelRef;
107
114
  /**
108
115
  * Called when connected to DOM
109
116
  * @returns {void}
@@ -338,6 +345,11 @@ export declare class Select extends ControlElement implements MultiValue {
338
345
  * @returns Selected data item
339
346
  */
340
347
  private get selectedSlotItems();
348
+ /**
349
+ * Get text for labels
350
+ * @returns Label
351
+ */
352
+ private get labelText();
341
353
  /**
342
354
  * Calculating whether the placeholder should be hidden
343
355
  * @returns result
@@ -2,8 +2,8 @@ import { __decorate } from "tslib";
2
2
  import { ControlElement, html, css, FocusedPropertyKey } from '@refinitiv-ui/core';
3
3
  import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
4
4
  import { property } from '@refinitiv-ui/core/decorators/property.js';
5
- import { query } from '@refinitiv-ui/core/decorators/query.js';
6
5
  import { styleMap } from '@refinitiv-ui/core/directives/style-map.js';
6
+ import { createRef, ref } from '@refinitiv-ui/core/directives/ref.js';
7
7
  import { VERSION } from '../version.js';
8
8
  import '../overlay/index.js';
9
9
  import '../item/index.js';
@@ -11,6 +11,8 @@ import '../icon/index.js';
11
11
  import { Item } from '../item/index.js';
12
12
  import { CollectionComposer } from '@refinitiv-ui/utils/collection.js';
13
13
  import { TimeoutTaskRunner, AnimationTaskRunner } from '@refinitiv-ui/utils/async.js';
14
+ import { isElementOverflown } from '@refinitiv-ui/utils/element.js';
15
+ import { registerOverflowTooltip } from '../tooltip/index.js';
14
16
  // Observer config for items
15
17
  const observerOptions = {
16
18
  subtree: true,
@@ -80,6 +82,14 @@ let Select = class Select extends ControlElement {
80
82
  * Therefore as soon as value has been set externally, selected state in data setter is ignored
81
83
  */
82
84
  this.cachedValue = '';
85
+ /**
86
+ * Reference to the menu element
87
+ */
88
+ this.menuRef = createRef();
89
+ /**
90
+ * Reference to the label element
91
+ */
92
+ this.labelRef = createRef();
83
93
  /**
84
94
  * Handles all mutations and filters out
85
95
  * any Shadow DOM changes in polyfilled browsers
@@ -316,6 +326,7 @@ let Select = class Select extends ControlElement {
316
326
  firstUpdated(changedProperties) {
317
327
  super.firstUpdated(changedProperties);
318
328
  this.addEventListener('keydown', this.onKeyDown); /* keydown when select is closed */
329
+ registerOverflowTooltip(this, () => this.labelText, () => this.labelRef.value ? isElementOverflown(this.labelRef.value) : false);
319
330
  }
320
331
  /**
321
332
  * Called when element finished updating
@@ -513,7 +524,9 @@ let Select = class Select extends ControlElement {
513
524
  * @returns {void}
514
525
  */
515
526
  onPopupMouseMove(event) {
516
- this.menuEl?.focus();
527
+ if (this.menuRef.value) {
528
+ this.menuRef.value.focus();
529
+ }
517
530
  const item = this.findSelectableElement(event);
518
531
  if (item) {
519
532
  this.setItemHighlight(item);
@@ -686,7 +699,7 @@ let Select = class Select extends ControlElement {
686
699
  * @returns A list of selectable HTML elements
687
700
  */
688
701
  getSelectableElements() {
689
- const root = this.hasDataItems() ? this.menuEl : this;
702
+ const root = this.hasDataItems() ? this.menuRef.value : this;
690
703
  /* istanbul ignore next */
691
704
  if (!root) {
692
705
  return [];
@@ -823,6 +836,13 @@ let Select = class Select extends ControlElement {
823
836
  get selectedSlotItems() {
824
837
  return this.getSelectedElements();
825
838
  }
839
+ /**
840
+ * Get text for labels
841
+ * @returns Label
842
+ */
843
+ get labelText() {
844
+ return this.multiple ? this.labels.join(LABEL_SEPARATOR) : this.label;
845
+ }
826
846
  /**
827
847
  * Calculating whether the placeholder should be hidden
828
848
  * @returns result
@@ -866,7 +886,7 @@ let Select = class Select extends ControlElement {
866
886
  * Template for label
867
887
  */
868
888
  get labelTemplate() {
869
- return html `<div part="label">${this.multiple ? this.labels.join(LABEL_SEPARATOR) : this.label}</div>`;
889
+ return html `<div part="label" ${ref(this.labelRef)}>${this.labelText}</div>`;
870
890
  }
871
891
  /**
872
892
  * Edit template when select is not readonly or disabled
@@ -897,6 +917,7 @@ let Select = class Select extends ControlElement {
897
917
  get popupTemplate() {
898
918
  if (this.lazyRendered) {
899
919
  return html `<ef-overlay
920
+ ${ref(this.menuRef)}
900
921
  tabindex="-1"
901
922
  id="menu"
902
923
  part="list"
@@ -967,9 +988,6 @@ __decorate([
967
988
  __decorate([
968
989
  property({ attribute: false })
969
990
  ], Select.prototype, "values", null);
970
- __decorate([
971
- query('#menu')
972
- ], Select.prototype, "menuEl", void 0);
973
991
  Select = __decorate([
974
992
  customElement('ef-select', {
975
993
  alias: 'coral-select'