@refinitiv-ui/elements 7.9.0 → 7.10.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 +19 -0
- package/lib/calendar/custom-elements.json +1 -1
- package/lib/calendar/custom-elements.md +1 -1
- package/lib/calendar/index.d.ts +1 -1
- package/lib/calendar/index.js +3 -2
- package/lib/calendar/types.d.ts +2 -0
- package/lib/chart/elements/chart.js +2 -1
- package/lib/combo-box/index.js +4 -0
- package/lib/datetime-picker/custom-elements.json +17 -0
- package/lib/datetime-picker/custom-elements.md +13 -9
- package/lib/datetime-picker/index.d.ts +17 -0
- package/lib/datetime-picker/index.js +75 -9
- package/lib/interactive-chart/index.js +1 -1
- package/lib/select/custom-elements.json +33 -33
- package/lib/select/custom-elements.md +1 -1
- package/lib/select/index.d.ts +22 -27
- package/lib/select/index.js +69 -95
- package/lib/slider/elements/slider-marker.d.ts +49 -0
- package/lib/slider/elements/slider-marker.js +72 -0
- package/lib/slider/elements/slider.d.ts +508 -0
- package/lib/slider/elements/slider.js +1431 -0
- package/lib/slider/index.d.ts +2 -469
- package/lib/slider/index.js +2 -1309
- package/lib/slider/themes/halo/dark/index.js +2 -1
- package/lib/slider/themes/halo/light/index.js +2 -1
- package/lib/slider/themes/solar/charcoal/index.js +2 -1
- package/lib/slider/themes/solar/pearl/index.js +2 -1
- package/lib/time-picker/index.d.ts +5 -0
- package/lib/time-picker/index.js +34 -28
- package/lib/version.js +1 -1
- package/package.json +9 -9
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
|
+
# [7.10.0](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@7.9.1...@refinitiv-ui/elements@7.10.0) (2023-12-12)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **combo-box:** cannot set value in free text when data is empty ([#1046](https://github.com/Refinitiv/refinitiv-ui/issues/1046)) ([abdc6fc](https://github.com/Refinitiv/refinitiv-ui/commit/abdc6fca9c5f0991d0fdc69697624fabcdb81cdb))
|
|
11
|
+
- resolve SonarCloud findings ([#1020](https://github.com/Refinitiv/refinitiv-ui/issues/1020)) ([81f65f9](https://github.com/Refinitiv/refinitiv-ui/commit/81f65f90f7c2fb69bbf68ec9e0d1f672618ff734))
|
|
12
|
+
- voiceover and safari does not annouce selected value ([#1025](https://github.com/Refinitiv/refinitiv-ui/issues/1025)) ([21a946d](https://github.com/Refinitiv/refinitiv-ui/commit/21a946dfd2e509611364cca4748070b7baedf4dc))
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
- **datetime-picker:** cascade custom cell slot to calendar ([#1037](https://github.com/Refinitiv/refinitiv-ui/issues/1037)) ([a558478](https://github.com/Refinitiv/refinitiv-ui/commit/a55847877f11a8e4d4cf8dae7a8bb97e8d0eb968))
|
|
17
|
+
- **slider:** support custom label ([#1021](https://github.com/Refinitiv/refinitiv-ui/issues/1021)) ([e2004dd](https://github.com/Refinitiv/refinitiv-ui/commit/e2004ddd95be2c62f9957fd6465c18c68f879042)), closes [#1022](https://github.com/Refinitiv/refinitiv-ui/issues/1022)
|
|
18
|
+
|
|
19
|
+
## [7.9.1](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@7.9.0...@refinitiv-ui/elements@7.9.1) (2023-11-13)
|
|
20
|
+
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
|
|
23
|
+
- **time-picker:** remove pre-populate value ([#995](https://github.com/Refinitiv/refinitiv-ui/issues/995)) ([afe008c](https://github.com/Refinitiv/refinitiv-ui/commit/afe008c1059031d28f6a6c6cff79caf8f301acaa))
|
|
24
|
+
|
|
6
25
|
# [7.9.0](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@7.8.0...@refinitiv-ui/elements@7.9.0) (2023-11-06)
|
|
7
26
|
|
|
8
27
|
### Features
|
|
@@ -196,7 +196,7 @@
|
|
|
196
196
|
],
|
|
197
197
|
"slots": [
|
|
198
198
|
{
|
|
199
|
-
"name": "yyyy-
|
|
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-
|
|
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` |
|
package/lib/calendar/index.d.ts
CHANGED
|
@@ -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-
|
|
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 {
|
package/lib/calendar/index.js
CHANGED
|
@@ -29,7 +29,7 @@ export { CalendarRenderView };
|
|
|
29
29
|
* @attr {boolean} disabled - Set disabled state
|
|
30
30
|
* @prop {boolean} [disabled=false] - Set disabled state
|
|
31
31
|
*
|
|
32
|
-
* @slot yyyy-
|
|
32
|
+
* @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
33
|
* @slot footer - Adds slotted content into the footer of the calendar control
|
|
34
34
|
*/
|
|
35
35
|
let Calendar = class Calendar extends ControlElement {
|
|
@@ -1154,7 +1154,8 @@ let Calendar = class Calendar extends ControlElement {
|
|
|
1154
1154
|
cancelable: false,
|
|
1155
1155
|
composed: true,
|
|
1156
1156
|
detail: {
|
|
1157
|
-
cell: calendarCell
|
|
1157
|
+
cell: calendarCell,
|
|
1158
|
+
calendar: this
|
|
1158
1159
|
}
|
|
1159
1160
|
});
|
|
1160
1161
|
this.dispatchEvent(event);
|
package/lib/calendar/types.d.ts
CHANGED
|
@@ -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
|
}>;
|
|
@@ -421,7 +421,8 @@ let Chart = class Chart extends BasicElement {
|
|
|
421
421
|
* @returns The value as a number, or, undefined if NaN.
|
|
422
422
|
*/
|
|
423
423
|
cssVarAsNumber(...args) {
|
|
424
|
-
const
|
|
424
|
+
const cssComputeVar = this.getComputedVariable(...args);
|
|
425
|
+
const result = parseFloat(cssComputeVar);
|
|
425
426
|
return isNaN(result) ? undefined : result;
|
|
426
427
|
}
|
|
427
428
|
/**
|
package/lib/combo-box/index.js
CHANGED
|
@@ -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
|
|
38
|
-
|
|
39
|
-
| `
|
|
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
|
|
53
|
-
|
|
54
|
-
| `footer`
|
|
55
|
-
| `
|
|
56
|
-
| `
|
|
57
|
-
| `
|
|
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
|
|
@@ -24,6 +24,16 @@ const INPUT_FORMAT = {
|
|
|
24
24
|
DATETIME_SECONDS: 'dd-MMM-yyyy HH:mm:ss',
|
|
25
25
|
DATETIME_SECONDS_AM_PM: 'dd-MMM-yyyy hh:mm:ss aaa'
|
|
26
26
|
};
|
|
27
|
+
// public API
|
|
28
|
+
const CALENDAR_ID = 'calendar';
|
|
29
|
+
const CALENDAR_FROM_ID = 'calendar-from';
|
|
30
|
+
const CALENDAR_TO_ID = 'calendar-to';
|
|
31
|
+
const TIMEPICKER_ID = 'timepicker';
|
|
32
|
+
const TIMEPICKER_FROM_ID = 'timepicker-from';
|
|
33
|
+
const TIMEPICKER_TO_ID = 'timepicker-to';
|
|
34
|
+
const INPUT_ID = 'input';
|
|
35
|
+
const INPUT_FROM_ID = 'input-from';
|
|
36
|
+
const INPUT_TO_ID = 'input-to';
|
|
27
37
|
/**
|
|
28
38
|
* Control to pick date and time
|
|
29
39
|
*
|
|
@@ -42,6 +52,9 @@ const INPUT_FORMAT = {
|
|
|
42
52
|
* @slot right - Slot to add custom contents at the right of popup
|
|
43
53
|
* @slot footer - Slot to add custom contents at the bottom of popup
|
|
44
54
|
* @slot left - Slot to add custom contents at the left of popup
|
|
55
|
+
* @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.
|
|
56
|
+
* @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
|
|
57
|
+
* @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
|
|
45
58
|
*/
|
|
46
59
|
let DatetimePicker = class DatetimePicker extends ControlElement {
|
|
47
60
|
constructor() {
|
|
@@ -750,13 +763,19 @@ let DatetimePicker = class DatetimePicker extends ControlElement {
|
|
|
750
763
|
this.submitInterimSegments();
|
|
751
764
|
// in duplex mode, avoid jumping on views
|
|
752
765
|
// Therefore if any of values have changed, save the current view
|
|
753
|
-
if (this.isDuplex() && this.
|
|
754
|
-
this.notifyViewsChange([this.
|
|
766
|
+
if (this.isDuplex() && this.calendarFromEl && this.calendarToEl) {
|
|
767
|
+
this.notifyViewsChange([this.calendarFromEl.view, this.calendarToEl.view]);
|
|
755
768
|
}
|
|
756
769
|
// Close popup if there is no time picker
|
|
757
770
|
const newValues = this.values;
|
|
758
771
|
if (!this.timepicker && newValues[0] && (this.range ? newValues[1] : true)) {
|
|
759
772
|
this.setOpened(false);
|
|
773
|
+
/**
|
|
774
|
+
* Custom cell selection delegates focus back to the text field when the overlay is closed,
|
|
775
|
+
* causing a sync problem between the calendar and text field.
|
|
776
|
+
* A workaround involves blurring the text field again.
|
|
777
|
+
*/
|
|
778
|
+
this.isDuplex() ? this.inputFromEl?.blur() : this.inputEl?.blur();
|
|
760
779
|
}
|
|
761
780
|
}
|
|
762
781
|
/**
|
|
@@ -929,6 +948,15 @@ let DatetimePicker = class DatetimePicker extends ControlElement {
|
|
|
929
948
|
resetViews() {
|
|
930
949
|
this.notifyViewsChange([]);
|
|
931
950
|
}
|
|
951
|
+
/**
|
|
952
|
+
* Request to update slot on the calendar while the overlay is open
|
|
953
|
+
* @returns void
|
|
954
|
+
*/
|
|
955
|
+
updateCalendarSlot() {
|
|
956
|
+
if (this.opened) {
|
|
957
|
+
this.requestUpdate();
|
|
958
|
+
}
|
|
959
|
+
}
|
|
932
960
|
/**
|
|
933
961
|
* Get time picker template
|
|
934
962
|
* @param id Timepicker identifier
|
|
@@ -945,6 +973,33 @@ let DatetimePicker = class DatetimePicker extends ControlElement {
|
|
|
945
973
|
@value-changed=${this.onTimePickerValueChanged}
|
|
946
974
|
></ef-time-picker>`;
|
|
947
975
|
}
|
|
976
|
+
/**
|
|
977
|
+
* Create calendar slot
|
|
978
|
+
* @param calendarId Calendar identifier
|
|
979
|
+
* @returns calendarSlots slots that will cascade to calendar
|
|
980
|
+
*/
|
|
981
|
+
createCalendarSlots(calendarId) {
|
|
982
|
+
if (!this.opened) {
|
|
983
|
+
return null;
|
|
984
|
+
}
|
|
985
|
+
const isValidDateSlot = (slot, prefix = '') => {
|
|
986
|
+
return new RegExp(`^${prefix}-?\\d{1,6}(-\\d{2}(-\\d{2})?)?$`).test(slot.slot);
|
|
987
|
+
};
|
|
988
|
+
const querySlots = Array.from(this.querySelectorAll('[slot]'));
|
|
989
|
+
return querySlots
|
|
990
|
+
.filter((slot) => {
|
|
991
|
+
const isToSlot = calendarId === CALENDAR_TO_ID && isValidDateSlot(slot, 'to-');
|
|
992
|
+
const isFromSlot = calendarId === CALENDAR_FROM_ID && isValidDateSlot(slot, 'from-');
|
|
993
|
+
const isISODateSlot = calendarId === CALENDAR_ID && isValidDateSlot(slot);
|
|
994
|
+
return isToSlot || isFromSlot || isISODateSlot;
|
|
995
|
+
})
|
|
996
|
+
.map((slot) => {
|
|
997
|
+
const newSlot = document.createElement('slot');
|
|
998
|
+
newSlot.name = slot.slot;
|
|
999
|
+
newSlot.slot = slot.slot.replace(/^(to|from)-/, '');
|
|
1000
|
+
return newSlot;
|
|
1001
|
+
});
|
|
1002
|
+
}
|
|
948
1003
|
/**
|
|
949
1004
|
* Get calendar template
|
|
950
1005
|
* @param id Calendar identifier
|
|
@@ -952,6 +1007,7 @@ let DatetimePicker = class DatetimePicker extends ControlElement {
|
|
|
952
1007
|
* @returns template result
|
|
953
1008
|
*/
|
|
954
1009
|
getCalendarTemplate(id, view = '') {
|
|
1010
|
+
const slotContent = this.createCalendarSlots(id);
|
|
955
1011
|
return html `<ef-calendar
|
|
956
1012
|
part="calendar"
|
|
957
1013
|
id=${id}
|
|
@@ -970,15 +1026,16 @@ let DatetimePicker = class DatetimePicker extends ControlElement {
|
|
|
970
1026
|
@keydown=${this.onCalendarKeyDown}
|
|
971
1027
|
@view-changed=${this.onCalendarViewChanged}
|
|
972
1028
|
@value-changed=${this.onCalendarValueChanged}
|
|
973
|
-
|
|
1029
|
+
>${slotContent}</ef-calendar
|
|
1030
|
+
>`;
|
|
974
1031
|
}
|
|
975
1032
|
/**
|
|
976
1033
|
* Get calendar templates
|
|
977
1034
|
*/
|
|
978
1035
|
get calendarsTemplate() {
|
|
979
1036
|
return html `
|
|
980
|
-
${this.getCalendarTemplate(
|
|
981
|
-
${this.isDuplex() ? this.getCalendarTemplate(
|
|
1037
|
+
${this.getCalendarTemplate(this.isDuplex() ? CALENDAR_FROM_ID : CALENDAR_ID, this.views[0])}
|
|
1038
|
+
${this.isDuplex() ? this.getCalendarTemplate(CALENDAR_TO_ID, this.views[1]) : undefined}
|
|
982
1039
|
`;
|
|
983
1040
|
}
|
|
984
1041
|
/**
|
|
@@ -988,9 +1045,9 @@ let DatetimePicker = class DatetimePicker extends ControlElement {
|
|
|
988
1045
|
// TODO: how can we add support timepicker with multiple?
|
|
989
1046
|
const values = this.timepickerValues;
|
|
990
1047
|
return html `
|
|
991
|
-
${this.getTimepickerTemplate(
|
|
1048
|
+
${this.getTimepickerTemplate(this.range ? TIMEPICKER_FROM_ID : TIMEPICKER_ID, values[0])}
|
|
992
1049
|
${this.range ? html `<div part="input-separator"></div>` : undefined}
|
|
993
|
-
${this.range ? this.getTimepickerTemplate(
|
|
1050
|
+
${this.range ? this.getTimepickerTemplate(TIMEPICKER_TO_ID, values[1]) : undefined}
|
|
994
1051
|
`;
|
|
995
1052
|
}
|
|
996
1053
|
/**
|
|
@@ -1030,9 +1087,9 @@ let DatetimePicker = class DatetimePicker extends ControlElement {
|
|
|
1030
1087
|
const values = this.inputValues;
|
|
1031
1088
|
return html `
|
|
1032
1089
|
<div part="input-wrapper">
|
|
1033
|
-
${this.getInputTemplate(
|
|
1090
|
+
${this.getInputTemplate(this.range ? INPUT_FROM_ID : INPUT_ID, values[0])}
|
|
1034
1091
|
${this.range ? html `<div part="input-separator"></div>` : undefined}
|
|
1035
|
-
${this.range ? this.getInputTemplate(
|
|
1092
|
+
${this.range ? this.getInputTemplate(INPUT_TO_ID, values[1]) : undefined}
|
|
1036
1093
|
</div>
|
|
1037
1094
|
`;
|
|
1038
1095
|
}
|
|
@@ -1169,18 +1226,27 @@ __decorate([
|
|
|
1169
1226
|
__decorate([
|
|
1170
1227
|
query('#timepicker')
|
|
1171
1228
|
], DatetimePicker.prototype, "timepickerEl", void 0);
|
|
1229
|
+
__decorate([
|
|
1230
|
+
query('#timepicker-from')
|
|
1231
|
+
], DatetimePicker.prototype, "timepickerFromEl", void 0);
|
|
1172
1232
|
__decorate([
|
|
1173
1233
|
query('#timepicker-to')
|
|
1174
1234
|
], DatetimePicker.prototype, "timepickerToEl", void 0);
|
|
1175
1235
|
__decorate([
|
|
1176
1236
|
query('#calendar')
|
|
1177
1237
|
], DatetimePicker.prototype, "calendarEl", void 0);
|
|
1238
|
+
__decorate([
|
|
1239
|
+
query('#calendar-from')
|
|
1240
|
+
], DatetimePicker.prototype, "calendarFromEl", void 0);
|
|
1178
1241
|
__decorate([
|
|
1179
1242
|
query('#calendar-to')
|
|
1180
1243
|
], DatetimePicker.prototype, "calendarToEl", void 0);
|
|
1181
1244
|
__decorate([
|
|
1182
1245
|
query('#input')
|
|
1183
1246
|
], DatetimePicker.prototype, "inputEl", void 0);
|
|
1247
|
+
__decorate([
|
|
1248
|
+
query('#input-from')
|
|
1249
|
+
], DatetimePicker.prototype, "inputFromEl", void 0);
|
|
1184
1250
|
__decorate([
|
|
1185
1251
|
query('#input-to')
|
|
1186
1252
|
], DatetimePicker.prototype, "inputToEl", void 0);
|
|
@@ -973,7 +973,7 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
|
|
|
973
973
|
cssVarAsNumber(...args) {
|
|
974
974
|
args[args.length] = '';
|
|
975
975
|
const cssComputeVar = this.getComputedVariable(...args);
|
|
976
|
-
const result = parseFloat(cssComputeVar
|
|
976
|
+
const result = parseFloat(cssComputeVar);
|
|
977
977
|
return cssComputeVar && !isNaN(result) ? result : undefined;
|
|
978
978
|
}
|
|
979
979
|
/**
|
|
@@ -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": "
|
|
22
|
-
"description": "Set
|
|
15
|
+
"name": "disabled",
|
|
16
|
+
"description": "Set disabled state",
|
|
23
17
|
"type": "boolean",
|
|
24
18
|
"default": "false"
|
|
25
19
|
},
|
|
26
20
|
{
|
|
27
|
-
"name": "
|
|
28
|
-
"description": "Set
|
|
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": "
|
|
34
|
-
"description": "Set
|
|
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` | "" |
|
|
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
|
|
package/lib/select/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { JSXInterface } from '../jsx';
|
|
2
|
-
import { CSSResultGroup,
|
|
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
|
|
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
|
-
*
|
|
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
|
|
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.
|
|
403
|
+
'ef-select': Partial<Select> | JSXInterface.HTMLAttributes<Select>;
|
|
409
404
|
}
|
|
410
405
|
}
|
|
411
406
|
}
|