@refinitiv-ui/elements 6.14.2 → 6.15.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,25 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [6.15.0](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@6.14.3...@refinitiv-ui/elements@6.15.0) (2023-12-12)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **combo-box:** cannot set value in free text when data is empty ([#1047](https://github.com/Refinitiv/refinitiv-ui/issues/1047)) ([e696a44](https://github.com/Refinitiv/refinitiv-ui/commit/e696a44f6f2b46b2f49c7ea27fb41ecc164d8bbf))
11
+ - resolve SonarCloud findings ([#1023](https://github.com/Refinitiv/refinitiv-ui/issues/1023)) ([d941eff](https://github.com/Refinitiv/refinitiv-ui/commit/d941eff40612980d1f33aa780000feaf4609d18d))
12
+ - voiceover and safari does not annouce selected value ([#1042](https://github.com/Refinitiv/refinitiv-ui/issues/1042)) ([5cab9bf](https://github.com/Refinitiv/refinitiv-ui/commit/5cab9bf93def30a5e529a5945a53caeb8ecb8413))
13
+
14
+ ### Features
15
+
16
+ - **datetime-picker:** cascade custom cell slot to calendar ([#1035](https://github.com/Refinitiv/refinitiv-ui/issues/1035)) ([2917ad8](https://github.com/Refinitiv/refinitiv-ui/commit/2917ad890a3abcd6683b2ae57dd38433e02820a2))
17
+ - **slider:** support custom label ([#1051](https://github.com/Refinitiv/refinitiv-ui/issues/1051)) ([c35869a](https://github.com/Refinitiv/refinitiv-ui/commit/c35869a76300e9f309697cba9e2789980eb2d589))
18
+
19
+ ## [6.14.3](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@6.14.2...@refinitiv-ui/elements@6.14.3) (2023-11-13)
20
+
21
+ ### Bug Fixes
22
+
23
+ - **time-picker:** remove pre-populate value ([#1011](https://github.com/Refinitiv/refinitiv-ui/issues/1011)) ([8562ef5](https://github.com/Refinitiv/refinitiv-ui/commit/8562ef52f02a4f6826c1e0f0d827d897892bffa9))
24
+
6
25
  ## [6.14.2](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@6.14.1...@refinitiv-ui/elements@6.14.2) (2023-11-06)
7
26
 
8
27
  **Note:** Version bump only for package @refinitiv-ui/elements
@@ -196,7 +196,7 @@
196
196
  ],
197
197
  "slots": [
198
198
  {
199
- "name": "yyyy-mm-dd",
199
+ "name": "yyyy-MM-dd",
200
200
  "description": "Adds slotted content into the specific date which use value in `ISO8601` date string format as a key e.g. `yyyy-MM-dd`, `yyyy-MM` and `yyyy`"
201
201
  },
202
202
  {
@@ -34,4 +34,4 @@ Standard calendar element
34
34
  | Name | Description |
35
35
  |--------------|--------------------------------------------------|
36
36
  | `footer` | Adds slotted content into the footer of the calendar control |
37
- | `yyyy-mm-dd` | Adds slotted content into the specific date which use value in `ISO8601` date string format as a key e.g. `yyyy-MM-dd`, `yyyy-MM` and `yyyy` |
37
+ | `yyyy-MM-dd` | Adds slotted content into the specific date which use value in `ISO8601` date string format as a key e.g. `yyyy-MM-dd`, `yyyy-MM` and `yyyy` |
@@ -22,7 +22,7 @@ export type { CalendarFilter, BeforeCellRenderEvent };
22
22
  * @attr {boolean} disabled - Set disabled state
23
23
  * @prop {boolean} [disabled=false] - Set disabled state
24
24
  *
25
- * @slot yyyy-mm-dd - Adds slotted content into the specific date which use value in `ISO8601` date string format as a key e.g. `yyyy-MM-dd`, `yyyy-MM` and `yyyy`
25
+ * @slot yyyy-MM-dd - Adds slotted content into the specific date which use value in `ISO8601` date string format as a key e.g. `yyyy-MM-dd`, `yyyy-MM` and `yyyy`
26
26
  * @slot footer - Adds slotted content into the footer of the calendar control
27
27
  */
28
28
  export declare class Calendar extends ControlElement implements MultiValue {
@@ -30,7 +30,7 @@ export { CalendarRenderView };
30
30
  * @attr {boolean} disabled - Set disabled state
31
31
  * @prop {boolean} [disabled=false] - Set disabled state
32
32
  *
33
- * @slot yyyy-mm-dd - Adds slotted content into the specific date which use value in `ISO8601` date string format as a key e.g. `yyyy-MM-dd`, `yyyy-MM` and `yyyy`
33
+ * @slot yyyy-MM-dd - Adds slotted content into the specific date which use value in `ISO8601` date string format as a key e.g. `yyyy-MM-dd`, `yyyy-MM` and `yyyy`
34
34
  * @slot footer - Adds slotted content into the footer of the calendar control
35
35
  */
36
36
  let Calendar = class Calendar extends ControlElement {
@@ -1166,7 +1166,8 @@ let Calendar = class Calendar extends ControlElement {
1166
1166
  cancelable: false,
1167
1167
  composed: true,
1168
1168
  detail: {
1169
- cell: calendarCell
1169
+ cell: calendarCell,
1170
+ calendar: this
1170
1171
  }
1171
1172
  });
1172
1173
  this.dispatchEvent(event);
@@ -1,5 +1,6 @@
1
1
  import { CellIndex } from '@refinitiv-ui/utils/navigation.js';
2
2
  import { CalendarRenderView } from './constants.js';
3
+ import type { Calendar } from './index.js';
3
4
  export interface CellSelectionModel {
4
5
  selected?: boolean;
5
6
  range?: boolean;
@@ -48,4 +49,5 @@ export type CalendarCell = {
48
49
  };
49
50
  export type BeforeCellRenderEvent = CustomEvent<{
50
51
  cell: CalendarCell;
52
+ calendar: Calendar;
51
53
  }>;
@@ -243,7 +243,8 @@ let Chart = class Chart extends BasicElement {
243
243
  * @returns {(number|undefined)} The value as a number, or, undefined if NaN.
244
244
  */
245
245
  cssVarAsNumber(...args) {
246
- const result = Number(this.getComputedVariable(...args).replace(/\D+$/, ''));
246
+ const cssComputeVar = this.getComputedVariable(...args);
247
+ const result = parseFloat(cssComputeVar);
247
248
  return isNaN(result) ? undefined : result;
248
249
  }
249
250
  /**
@@ -242,6 +242,10 @@ let ComboBox = class ComboBox extends FormFieldElement {
242
242
  this.values = [value];
243
243
  }
244
244
  else {
245
+ if (this.freeText && this.freeTextValue !== value) {
246
+ this.freeTextValue = value;
247
+ this.requestUpdate();
248
+ }
245
249
  this.cachedValue = value;
246
250
  }
247
251
  }
@@ -348,6 +348,18 @@
348
348
  {
349
349
  "name": "left",
350
350
  "description": "Slot to add custom contents at the left of popup"
351
+ },
352
+ {
353
+ "name": "yyyy-MM-dd",
354
+ "description": "Slot to add custom contents on any date cells e.g. `2023-01-01`. Use `yyyy` or `yyyy-MM` if the cell is year or month."
355
+ },
356
+ {
357
+ "name": "from-yyyy-MM-dd",
358
+ "description": "Slot to add custom contents on any date cells of left calendar in `duplex` mode e.g. `from-2023-01-01`. Use `from-yyyy` or `from-yyyy-MM` if the cell is year or month"
359
+ },
360
+ {
361
+ "name": "to-yyyy-MM-dd",
362
+ "description": "Slot to add custom contents on any date cells of right calendar in `duplex` mode e.g. `to-2023-01-01`. Use `to-yyyy` or `to-yyyy-MM` if the cell is year or month"
351
363
  }
352
364
  ],
353
365
  "methods": [
@@ -355,6 +367,11 @@
355
367
  "name": "validateInput",
356
368
  "description": "Validates the input, marking the element as invalid if its value does not meet the validation criteria.",
357
369
  "params": []
370
+ },
371
+ {
372
+ "name": "updateCalendarSlot",
373
+ "description": "Request to update slot on the calendar while the overlay is open",
374
+ "params": []
358
375
  }
359
376
  ]
360
377
  }
@@ -34,9 +34,10 @@ Control to pick date and time
34
34
 
35
35
  ## Methods
36
36
 
37
- | Method | Type | Description |
38
- |-----------------|------------|--------------------------------------------------|
39
- | `validateInput` | `(): void` | Validates the input, marking the element as invalid if its value does not meet the validation criteria. |
37
+ | Method | Type | Description |
38
+ |----------------------|------------|--------------------------------------------------|
39
+ | `updateCalendarSlot` | `(): void` | Request to update slot on the calendar while the overlay is open |
40
+ | `validateInput` | `(): void` | Validates the input, marking the element as invalid if its value does not meet the validation criteria. |
40
41
 
41
42
  ## Events
42
43
 
@@ -49,9 +50,12 @@ Control to pick date and time
49
50
 
50
51
  ## Slots
51
52
 
52
- | Name | Description |
53
- |----------|--------------------------------------------------|
54
- | `footer` | Slot to add custom contents at the bottom of popup |
55
- | `header` | Slot to add custom contents at the top of popup |
56
- | `left` | Slot to add custom contents at the left of popup |
57
- | `right` | Slot to add custom contents at the right of popup |
53
+ | Name | Description |
54
+ |-------------------|--------------------------------------------------|
55
+ | `footer` | Slot to add custom contents at the bottom of popup |
56
+ | `from-yyyy-MM-dd` | Slot to add custom contents on any date cells of left calendar in `duplex` mode e.g. `from-2023-01-01`. Use `from-yyyy` or `from-yyyy-MM` if the cell is year or month |
57
+ | `header` | Slot to add custom contents at the top of popup |
58
+ | `left` | Slot to add custom contents at the left of popup |
59
+ | `right` | Slot to add custom contents at the right of popup |
60
+ | `to-yyyy-MM-dd` | Slot to add custom contents on any date cells of right calendar in `duplex` mode e.g. `to-2023-01-01`. Use `to-yyyy` or `to-yyyy-MM` if the cell is year or month |
61
+ | `yyyy-MM-dd` | Slot to add custom contents on any date cells e.g. `2023-01-01`. Use `yyyy` or `yyyy-MM` if the cell is year or month. |
@@ -26,6 +26,9 @@ export type { DatetimePickerFilter, DatetimePickerDuplex };
26
26
  * @slot right - Slot to add custom contents at the right of popup
27
27
  * @slot footer - Slot to add custom contents at the bottom of popup
28
28
  * @slot left - Slot to add custom contents at the left of popup
29
+ * @slot yyyy-MM-dd - Slot to add custom contents on any date cells e.g. `2023-01-01`. Use `yyyy` or `yyyy-MM` if the cell is year or month.
30
+ * @slot from-yyyy-MM-dd - Slot to add custom contents on any date cells of left calendar in `duplex` mode e.g. `from-2023-01-01`. Use `from-yyyy` or `from-yyyy-MM` if the cell is year or month
31
+ * @slot to-yyyy-MM-dd - Slot to add custom contents on any date cells of right calendar in `duplex` mode e.g. `to-2023-01-01`. Use `to-yyyy` or `to-yyyy-MM` if the cell is year or month
29
32
  */
30
33
  export declare class DatetimePicker extends ControlElement implements MultiValue {
31
34
  /**
@@ -203,10 +206,13 @@ export declare class DatetimePicker extends ControlElement implements MultiValue
203
206
  private iconEl;
204
207
  private popupEl?;
205
208
  private timepickerEl?;
209
+ private timepickerFromEl?;
206
210
  private timepickerToEl?;
207
211
  private calendarEl?;
212
+ private calendarFromEl?;
208
213
  private calendarToEl?;
209
214
  private inputEl?;
215
+ private inputFromEl?;
210
216
  private inputToEl?;
211
217
  /**
212
218
  * Updates the element
@@ -444,6 +450,11 @@ export declare class DatetimePicker extends ControlElement implements MultiValue
444
450
  * @returns {void}
445
451
  */
446
452
  private resetViews;
453
+ /**
454
+ * Request to update slot on the calendar while the overlay is open
455
+ * @returns void
456
+ */
457
+ updateCalendarSlot(): void;
447
458
  /**
448
459
  * Get time picker template
449
460
  * @param id Timepicker identifier
@@ -451,6 +462,12 @@ export declare class DatetimePicker extends ControlElement implements MultiValue
451
462
  * @returns template result
452
463
  */
453
464
  private getTimepickerTemplate;
465
+ /**
466
+ * Create calendar slot
467
+ * @param calendarId Calendar identifier
468
+ * @returns calendarSlots slots that will cascade to calendar
469
+ */
470
+ private createCalendarSlots;
454
471
  /**
455
472
  * Get calendar template
456
473
  * @param id Calendar identifier
@@ -26,6 +26,16 @@ const INPUT_FORMAT = {
26
26
  DATETIME_SECONDS: 'dd-MMM-yyyy HH:mm:ss',
27
27
  DATETIME_SECONDS_AM_PM: 'dd-MMM-yyyy hh:mm:ss aaa'
28
28
  };
29
+ // public API
30
+ const CALENDAR_ID = 'calendar';
31
+ const CALENDAR_FROM_ID = 'calendar-from';
32
+ const CALENDAR_TO_ID = 'calendar-to';
33
+ const TIMEPICKER_ID = 'timepicker';
34
+ const TIMEPICKER_FROM_ID = 'timepicker-from';
35
+ const TIMEPICKER_TO_ID = 'timepicker-to';
36
+ const INPUT_ID = 'input';
37
+ const INPUT_FROM_ID = 'input-from';
38
+ const INPUT_TO_ID = 'input-to';
29
39
  /**
30
40
  * Control to pick date and time
31
41
  *
@@ -44,6 +54,9 @@ const INPUT_FORMAT = {
44
54
  * @slot right - Slot to add custom contents at the right of popup
45
55
  * @slot footer - Slot to add custom contents at the bottom of popup
46
56
  * @slot left - Slot to add custom contents at the left of popup
57
+ * @slot yyyy-MM-dd - Slot to add custom contents on any date cells e.g. `2023-01-01`. Use `yyyy` or `yyyy-MM` if the cell is year or month.
58
+ * @slot from-yyyy-MM-dd - Slot to add custom contents on any date cells of left calendar in `duplex` mode e.g. `from-2023-01-01`. Use `from-yyyy` or `from-yyyy-MM` if the cell is year or month
59
+ * @slot to-yyyy-MM-dd - Slot to add custom contents on any date cells of right calendar in `duplex` mode e.g. `to-2023-01-01`. Use `to-yyyy` or `to-yyyy-MM` if the cell is year or month
47
60
  */
48
61
  let DatetimePicker = class DatetimePicker extends ControlElement {
49
62
  constructor() {
@@ -755,13 +768,19 @@ let DatetimePicker = class DatetimePicker extends ControlElement {
755
768
  this.submitInterimSegments();
756
769
  // in duplex mode, avoid jumping on views
757
770
  // Therefore if any of values have changed, save the current view
758
- if (this.isDuplex() && this.calendarEl && this.calendarToEl) {
759
- this.notifyViewsChange([this.calendarEl?.view, this.calendarToEl?.view]);
771
+ if (this.isDuplex() && this.calendarFromEl && this.calendarToEl) {
772
+ this.notifyViewsChange([this.calendarFromEl.view, this.calendarToEl.view]);
760
773
  }
761
774
  // Close popup if there is no time picker
762
775
  const newValues = this.values;
763
776
  if (!this.timepicker && newValues[0] && (this.range ? newValues[1] : true)) {
764
777
  this.setOpened(false);
778
+ /**
779
+ * Custom cell selection delegates focus back to the text field when the overlay is closed,
780
+ * causing a sync problem between the calendar and text field.
781
+ * A workaround involves blurring the text field again.
782
+ */
783
+ this.isDuplex() ? this.inputFromEl?.blur() : this.inputEl?.blur();
765
784
  }
766
785
  }
767
786
  /**
@@ -934,6 +953,15 @@ let DatetimePicker = class DatetimePicker extends ControlElement {
934
953
  resetViews() {
935
954
  this.notifyViewsChange([]);
936
955
  }
956
+ /**
957
+ * Request to update slot on the calendar while the overlay is open
958
+ * @returns void
959
+ */
960
+ updateCalendarSlot() {
961
+ if (this.opened) {
962
+ this.requestUpdate();
963
+ }
964
+ }
937
965
  /**
938
966
  * Get time picker template
939
967
  * @param id Timepicker identifier
@@ -950,6 +978,33 @@ let DatetimePicker = class DatetimePicker extends ControlElement {
950
978
  @value-changed=${this.onTimePickerValueChanged}
951
979
  ></ef-time-picker>`;
952
980
  }
981
+ /**
982
+ * Create calendar slot
983
+ * @param calendarId Calendar identifier
984
+ * @returns calendarSlots slots that will cascade to calendar
985
+ */
986
+ createCalendarSlots(calendarId) {
987
+ if (!this.opened) {
988
+ return null;
989
+ }
990
+ const isValidDateSlot = (slot, prefix = '') => {
991
+ return new RegExp(`^${prefix}-?\\d{1,6}(-\\d{2}(-\\d{2})?)?$`).test(slot.slot);
992
+ };
993
+ const querySlots = Array.from(this.querySelectorAll('[slot]'));
994
+ return querySlots
995
+ .filter((slot) => {
996
+ const isToSlot = calendarId === CALENDAR_TO_ID && isValidDateSlot(slot, 'to-');
997
+ const isFromSlot = calendarId === CALENDAR_FROM_ID && isValidDateSlot(slot, 'from-');
998
+ const isISODateSlot = calendarId === CALENDAR_ID && isValidDateSlot(slot);
999
+ return isToSlot || isFromSlot || isISODateSlot;
1000
+ })
1001
+ .map((slot) => {
1002
+ const newSlot = document.createElement('slot');
1003
+ newSlot.name = slot.slot;
1004
+ newSlot.slot = slot.slot.replace(/^(to|from)-/, '');
1005
+ return newSlot;
1006
+ });
1007
+ }
953
1008
  /**
954
1009
  * Get calendar template
955
1010
  * @param id Calendar identifier
@@ -957,6 +1012,7 @@ let DatetimePicker = class DatetimePicker extends ControlElement {
957
1012
  * @returns template result
958
1013
  */
959
1014
  getCalendarTemplate(id, view = '') {
1015
+ const slotContent = this.createCalendarSlots(id);
960
1016
  return html `<ef-calendar
961
1017
  part="calendar"
962
1018
  id=${id}
@@ -975,15 +1031,16 @@ let DatetimePicker = class DatetimePicker extends ControlElement {
975
1031
  @keydown=${this.onCalendarKeyDown}
976
1032
  @view-changed=${this.onCalendarViewChanged}
977
1033
  @value-changed=${this.onCalendarValueChanged}
978
- ></ef-calendar>`;
1034
+ >${slotContent}</ef-calendar
1035
+ >`;
979
1036
  }
980
1037
  /**
981
1038
  * Get calendar templates
982
1039
  */
983
1040
  get calendarsTemplate() {
984
1041
  return html `
985
- ${this.getCalendarTemplate('calendar', this.views[0])}
986
- ${this.isDuplex() ? this.getCalendarTemplate('calendar-to', this.views[1]) : undefined}
1042
+ ${this.getCalendarTemplate(this.isDuplex() ? CALENDAR_FROM_ID : CALENDAR_ID, this.views[0])}
1043
+ ${this.isDuplex() ? this.getCalendarTemplate(CALENDAR_TO_ID, this.views[1]) : undefined}
987
1044
  `;
988
1045
  }
989
1046
  /**
@@ -993,9 +1050,9 @@ let DatetimePicker = class DatetimePicker extends ControlElement {
993
1050
  // TODO: how can we add support timepicker with multiple?
994
1051
  const values = this.timepickerValues;
995
1052
  return html `
996
- ${this.getTimepickerTemplate('timepicker', values[0])}
1053
+ ${this.getTimepickerTemplate(this.range ? TIMEPICKER_FROM_ID : TIMEPICKER_ID, values[0])}
997
1054
  ${this.range ? html `<div part="input-separator"></div>` : undefined}
998
- ${this.range ? this.getTimepickerTemplate('timepicker-to', values[1]) : undefined}
1055
+ ${this.range ? this.getTimepickerTemplate(TIMEPICKER_TO_ID, values[1]) : undefined}
999
1056
  `;
1000
1057
  }
1001
1058
  /**
@@ -1035,9 +1092,9 @@ let DatetimePicker = class DatetimePicker extends ControlElement {
1035
1092
  const values = this.inputValues;
1036
1093
  return html `
1037
1094
  <div part="input-wrapper">
1038
- ${this.getInputTemplate('input', values[0])}
1095
+ ${this.getInputTemplate(this.range ? INPUT_FROM_ID : INPUT_ID, values[0])}
1039
1096
  ${this.range ? html `<div part="input-separator"></div>` : undefined}
1040
- ${this.range ? this.getInputTemplate('input-to', values[1]) : undefined}
1097
+ ${this.range ? this.getInputTemplate(INPUT_TO_ID, values[1]) : undefined}
1041
1098
  </div>
1042
1099
  `;
1043
1100
  }
@@ -1174,18 +1231,27 @@ __decorate([
1174
1231
  __decorate([
1175
1232
  query('#timepicker')
1176
1233
  ], DatetimePicker.prototype, "timepickerEl", void 0);
1234
+ __decorate([
1235
+ query('#timepicker-from')
1236
+ ], DatetimePicker.prototype, "timepickerFromEl", void 0);
1177
1237
  __decorate([
1178
1238
  query('#timepicker-to')
1179
1239
  ], DatetimePicker.prototype, "timepickerToEl", void 0);
1180
1240
  __decorate([
1181
1241
  query('#calendar')
1182
1242
  ], DatetimePicker.prototype, "calendarEl", void 0);
1243
+ __decorate([
1244
+ query('#calendar-from')
1245
+ ], DatetimePicker.prototype, "calendarFromEl", void 0);
1183
1246
  __decorate([
1184
1247
  query('#calendar-to')
1185
1248
  ], DatetimePicker.prototype, "calendarToEl", void 0);
1186
1249
  __decorate([
1187
1250
  query('#input')
1188
1251
  ], DatetimePicker.prototype, "inputEl", void 0);
1252
+ __decorate([
1253
+ query('#input-from')
1254
+ ], DatetimePicker.prototype, "inputFromEl", void 0);
1189
1255
  __decorate([
1190
1256
  query('#input-to')
1191
1257
  ], DatetimePicker.prototype, "inputToEl", void 0);
@@ -997,7 +997,7 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
997
997
  cssVarAsNumber(...args) {
998
998
  args[args.length] = '';
999
999
  const cssComputeVar = this.getComputedVariable(...args);
1000
- const result = parseFloat(cssComputeVar.replace(/\D+$/, ''));
1000
+ const result = parseFloat(cssComputeVar);
1001
1001
  return cssComputeVar && !isNaN(result) ? result : undefined;
1002
1002
  }
1003
1003
  /**
@@ -5,12 +5,6 @@
5
5
  "name": "ef-select",
6
6
  "description": "Expands upon the native select element,\nproviding a fully themeable dropdown element.",
7
7
  "attributes": [
8
- {
9
- "name": "placeholder",
10
- "description": "Placeholder to display when no value is set",
11
- "type": "string",
12
- "default": "\"\""
13
- },
14
8
  {
15
9
  "name": "opened",
16
10
  "description": "Toggles the opened state of the list",
@@ -18,20 +12,26 @@
18
12
  "default": "false"
19
13
  },
20
14
  {
21
- "name": "error",
22
- "description": "Set error state",
15
+ "name": "disabled",
16
+ "description": "Set disabled state",
23
17
  "type": "boolean",
24
18
  "default": "false"
25
19
  },
26
20
  {
27
- "name": "warning",
28
- "description": "Set warning state",
21
+ "name": "placeholder",
22
+ "description": "Set placeholder text",
23
+ "type": "string",
24
+ "default": "\"\""
25
+ },
26
+ {
27
+ "name": "error",
28
+ "description": "Set error state",
29
29
  "type": "boolean",
30
30
  "default": "false"
31
31
  },
32
32
  {
33
- "name": "disabled",
34
- "description": "Set disabled state",
33
+ "name": "warning",
34
+ "description": "Set warning state",
35
35
  "type": "boolean",
36
36
  "default": "false"
37
37
  }
@@ -42,13 +42,6 @@
42
42
  "description": "Current text content of the selected value",
43
43
  "type": "string | undefined"
44
44
  },
45
- {
46
- "name": "placeholder",
47
- "attribute": "placeholder",
48
- "description": "Placeholder to display when no value is set",
49
- "type": "string",
50
- "default": "\"\""
51
- },
52
45
  {
53
46
  "name": "opened",
54
47
  "attribute": "opened",
@@ -56,20 +49,6 @@
56
49
  "type": "boolean",
57
50
  "default": "false"
58
51
  },
59
- {
60
- "name": "error",
61
- "attribute": "error",
62
- "description": "Set error state",
63
- "type": "boolean",
64
- "default": "false"
65
- },
66
- {
67
- "name": "warning",
68
- "attribute": "warning",
69
- "description": "Set warning state",
70
- "type": "boolean",
71
- "default": "false"
72
- },
73
52
  {
74
53
  "name": "data",
75
54
  "description": "Construct the menu from data object. Cannot be used with slotted content",
@@ -87,6 +66,27 @@
87
66
  "description": "Set disabled state",
88
67
  "type": "boolean",
89
68
  "default": "false"
69
+ },
70
+ {
71
+ "name": "placeholder",
72
+ "attribute": "placeholder",
73
+ "description": "Set placeholder text",
74
+ "type": "string",
75
+ "default": "\"\""
76
+ },
77
+ {
78
+ "name": "error",
79
+ "attribute": "error",
80
+ "description": "Set error state",
81
+ "type": "boolean",
82
+ "default": "false"
83
+ },
84
+ {
85
+ "name": "warning",
86
+ "attribute": "warning",
87
+ "description": "Set warning state",
88
+ "type": "boolean",
89
+ "default": "false"
90
90
  }
91
91
  ],
92
92
  "events": [
@@ -12,7 +12,7 @@ providing a fully themeable dropdown element.
12
12
  | `error` | `error` | `boolean` | false | Set error state |
13
13
  | `label (readonly)` | | `string \| undefined` | | Current text content of the selected value |
14
14
  | `opened` | `opened` | `boolean` | false | Toggles the opened state of the list |
15
- | `placeholder` | `placeholder` | `string` | "" | Placeholder to display when no value is set |
15
+ | `placeholder` | `placeholder` | `string` | "" | Set placeholder text |
16
16
  | `value` | | `string` | "" | Value of the element |
17
17
  | `warning` | `warning` | `boolean` | false | Set warning state |
18
18
 
@@ -1,5 +1,5 @@
1
1
  import { JSXInterface } from '../jsx';
2
- import { CSSResultGroup, ControlElement, MultiValue, PropertyValues, TemplateResult } from '@refinitiv-ui/core';
2
+ import { CSSResultGroup, FormFieldElement, MultiValue, PropertyValues, TemplateResult } from '@refinitiv-ui/core';
3
3
  import '../icon/index.js';
4
4
  import '../item/index.js';
5
5
  import '../overlay/index.js';
@@ -12,16 +12,24 @@ export type { SelectData, SelectDataItem };
12
12
  * @attr {boolean} disabled - Set disabled state
13
13
  * @prop {boolean} [disabled=false] - Set disabled state
14
14
  *
15
+ * @attr {string} placeholder - Set placeholder text
16
+ * @prop {string} [placeholder=""] - Set placeholder text
17
+ *
18
+ * @attr {boolean} error - Set error state
19
+ * @prop {boolean} [error=false] - Set error state
20
+ *
21
+ * @attr {boolean} warning - Set warning state
22
+ * @prop {boolean} [warning=false] - Set warning state
23
+ *
15
24
  * @fires value-changed - Fired when the user commits a value change. The event is not triggered if `value` property is changed programmatically.
16
25
  * @fires opened-changed - Fired when the user opens or closes control's popup. The event is not triggered if `opened` property is changed programmatically.
17
26
  */
18
- export declare class Select extends ControlElement implements MultiValue {
27
+ export declare class Select extends FormFieldElement implements MultiValue {
19
28
  /**
20
29
  * Element version number
21
30
  * @returns version number
22
31
  */
23
32
  static get version(): string;
24
- protected readonly defaultRole: string | null;
25
33
  /**
26
34
  * A `CSSResultGroup` that will be used
27
35
  * to style the host, slotted children
@@ -51,22 +59,10 @@ export declare class Select extends ControlElement implements MultiValue {
51
59
  * @readonly
52
60
  */
53
61
  get labels(): string[];
54
- /**
55
- * Placeholder to display when no value is set
56
- */
57
- placeholder: string;
58
62
  /**
59
63
  * Toggles the opened state of the list
60
64
  */
61
65
  opened: boolean;
62
- /**
63
- * Set error state
64
- */
65
- error: boolean;
66
- /**
67
- * Set warning state
68
- */
69
- warning: boolean;
70
66
  /**
71
67
  * Switch to multiple select input
72
68
  * @ignore
@@ -111,11 +107,6 @@ export declare class Select extends ControlElement implements MultiValue {
111
107
  * Reference to the label element
112
108
  */
113
109
  private labelRef;
114
- /**
115
- * Called when connected to DOM
116
- * @returns {void}
117
- */
118
- connectedCallback(): void;
119
110
  /**
120
111
  * Updates the element
121
112
  * @param changedProperties Properties that has changed
@@ -369,10 +360,6 @@ export declare class Select extends ControlElement implements MultiValue {
369
360
  * Template for label
370
361
  */
371
362
  private get labelTemplate();
372
- /**
373
- * Edit template when select is not readonly or disabled
374
- */
375
- private get editTemplate();
376
363
  /**
377
364
  * Get default slot template
378
365
  */
@@ -382,9 +369,17 @@ export declare class Select extends ControlElement implements MultiValue {
382
369
  */
383
370
  private get dataContent();
384
371
  /**
385
- * Edit template when select is not readonly or disabled
372
+ * `ef-items` template generated from slot or `data`
373
+ */
374
+ private get itemsTemplate();
375
+ /**
376
+ * Template of a listbox containing ef-item(s)
377
+ */
378
+ private get listboxTemplate();
379
+ /**
380
+ * Area that allows select to be clickable and toggle between open and close
386
381
  */
387
- private get popupTemplate();
382
+ private get triggerTemplate();
388
383
  /**
389
384
  * A `TemplateResult` that will be used
390
385
  * to render the updated internal template.
@@ -405,7 +400,7 @@ declare global {
405
400
 
406
401
  namespace JSX {
407
402
  interface IntrinsicElements {
408
- 'ef-select': Partial<Select> | JSXInterface.ControlHTMLAttributes<Select>;
403
+ 'ef-select': Partial<Select> | JSXInterface.HTMLAttributes<Select>;
409
404
  }
410
405
  }
411
406
  }