@vonage/vivid 3.40.0 → 3.42.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/accordion/index.js +2 -2
- package/accordion-item/index.js +2 -2
- package/alert/index.js +6 -5
- package/audio-player/index.js +33 -0
- package/avatar/index.js +2 -2
- package/badge/index.js +2 -2
- package/banner/index.js +8 -5
- package/breadcrumb/index.js +1 -1
- package/breadcrumb-item/index.js +3 -3
- package/button/index.js +4 -4
- package/calendar/index.js +1 -1
- package/calendar-event/index.js +1 -1
- package/card/index.js +4 -3
- package/checkbox/index.js +3 -3
- package/combobox/index.js +8 -8
- package/custom-elements.json +438 -41
- package/data-grid/index.js +2 -2
- package/date-picker/index.js +9 -9
- package/date-range-picker/index.js +8 -8
- package/dialog/index.js +6 -6
- package/divider/index.js +1 -1
- package/elevation/index.js +1 -1
- package/empty-state/index.js +2 -2
- package/fab/index.js +3 -3
- package/file-picker/index.js +5 -5
- package/focus/index.js +1 -1
- package/header/index.js +2 -2
- package/icon/index.js +1 -1
- package/index.js +57 -56
- package/layout/index.js +1 -1
- package/lib/alert/alert.d.ts +3 -1
- package/lib/alert/locale.d.ts +3 -0
- package/lib/audio-player/audio-player.d.ts +17 -0
- package/lib/audio-player/audio-player.template.d.ts +4 -0
- package/lib/audio-player/definition.d.ts +4 -0
- package/lib/audio-player/locale.d.ts +5 -0
- package/lib/banner/banner.d.ts +3 -1
- package/lib/banner/locale.d.ts +3 -0
- package/lib/card/card.d.ts +3 -0
- package/lib/card/card.template.d.ts +1 -1
- package/lib/card/definition.d.ts +1 -0
- package/lib/checkbox/checkbox.d.ts +1 -0
- package/lib/components.d.ts +1 -0
- package/lib/enums.d.ts +2 -1
- package/lib/selectable-box/selectable-box.d.ts +2 -2
- package/lib/split-button/locale.d.ts +3 -0
- package/lib/split-button/split-button.d.ts +4 -2
- package/listbox/index.js +4 -4
- package/locales/en-GB.js +14 -0
- package/locales/en-US.js +14 -0
- package/locales/ja-JP.js +14 -0
- package/locales/zh-CN.js +14 -0
- package/menu/index.js +8 -8
- package/menu-item/index.js +3 -3
- package/nav/index.js +1 -1
- package/nav-disclosure/index.js +3 -3
- package/nav-item/index.js +3 -3
- package/note/index.js +2 -2
- package/number-field/index.js +6 -6
- package/option/index.js +3 -3
- package/package.json +1 -1
- package/pagination/index.js +5 -5
- package/popup/index.js +6 -6
- package/progress/index.js +1 -1
- package/progress-ring/index.js +1 -1
- package/radio/index.js +2 -2
- package/radio-group/index.js +2 -2
- package/select/index.js +8 -8
- package/selectable-box/index.js +5 -5
- package/shared/definition.js +3 -3
- package/shared/definition10.js +90 -159
- package/shared/definition11.js +151 -29
- package/shared/definition12.js +37 -766
- package/shared/definition13.js +747 -106
- package/shared/definition14.js +121 -198
- package/shared/definition15.js +167 -664
- package/shared/definition16.js +576 -1137
- package/shared/definition17.js +1278 -143
- package/shared/definition18.js +68 -306
- package/shared/definition19.js +359 -217
- package/shared/definition2.js +1 -1
- package/shared/definition20.js +259 -67
- package/shared/definition21.js +66 -58
- package/shared/definition22.js +43 -84
- package/shared/definition23.js +76 -2353
- package/shared/definition24.js +2362 -45
- package/shared/definition25.js +63 -27
- package/shared/definition26.js +24 -51
- package/shared/definition27.js +36 -822
- package/shared/definition28.js +837 -49
- package/shared/definition29.js +52 -89
- package/shared/definition3.js +1 -1
- package/shared/definition30.js +88 -24
- package/shared/definition31.js +25 -12
- package/shared/definition32.js +12 -52
- package/shared/definition33.js +28 -502
- package/shared/definition34.js +442 -197
- package/shared/definition35.js +260 -186
- package/shared/definition36.js +186 -75
- package/shared/definition37.js +70 -54
- package/shared/definition38.js +65 -421
- package/shared/definition39.js +437 -38
- package/shared/definition4.js +43 -16
- package/shared/definition40.js +32 -680
- package/shared/definition41.js +654 -105
- package/shared/definition42.js +117 -78
- package/shared/definition43.js +74 -567
- package/shared/definition44.js +567 -98
- package/shared/definition45.js +110 -135
- package/shared/definition46.js +153 -17
- package/shared/definition47.js +16 -79
- package/shared/definition48.js +53 -475
- package/shared/definition49.js +502 -25
- package/shared/definition5.js +160 -44
- package/shared/definition50.js +22 -121
- package/shared/definition51.js +113 -271
- package/shared/definition52.js +249 -243
- package/shared/definition53.js +270 -109
- package/shared/definition54.js +84 -74
- package/shared/definition55.js +114 -69
- package/shared/definition56.js +81 -292
- package/shared/definition57.js +302 -13
- package/shared/definition58.js +11 -41
- package/shared/definition59.js +20 -154
- package/shared/definition6.js +43 -33
- package/shared/definition60.js +181 -0
- package/shared/definition7.js +39 -106
- package/shared/definition8.js +122 -38
- package/shared/definition9.js +56 -89
- package/shared/enums.js +1 -0
- package/shared/icon.js +2 -2
- package/shared/index.js +1 -1
- package/shared/index2.js +1 -1
- package/shared/listbox.js +1 -1
- package/shared/localization/Locale.d.ts +8 -0
- package/shared/patterns/form-elements/form-elements.d.ts +6 -6
- package/shared/presentationDate.js +10 -8
- package/shared/text-field.js +1 -1
- package/side-drawer/index.js +1 -1
- package/slider/index.js +3 -3
- package/split-button/index.js +6 -3
- package/style.css +329 -242
- package/styles/core/all.css +31 -25
- package/styles/core/theme.css +1 -1
- package/styles/core/typography.css +31 -25
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/styles/tokens/vivid-2-compat.css +1 -1
- package/switch/index.js +3 -3
- package/tab/index.js +3 -3
- package/tab-panel/index.js +1 -1
- package/tabs/index.js +5 -5
- package/tag/index.js +3 -3
- package/tag-group/index.js +1 -1
- package/text-area/index.js +3 -3
- package/text-field/index.js +3 -3
- package/toggletip/index.js +7 -7
- package/tooltip/index.js +7 -7
- package/tree-item/index.js +3 -3
- package/tree-view/index.js +1 -1
- package/vivid.api.json +270 -1
package/shared/definition18.js
CHANGED
|
@@ -1,28 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { a as
|
|
5
|
-
import {
|
|
6
|
-
import { a as dividerRegistries } from './
|
|
7
|
-
import {
|
|
1
|
+
import { v as volatile, r as registerFactory } from './index.js';
|
|
2
|
+
import { p as popupRegistries } from './definition60.js';
|
|
3
|
+
import { f as focusRegistries } from './definition58.js';
|
|
4
|
+
import { a as buttonRegistries } from './definition11.js';
|
|
5
|
+
import { a as textFieldRegistries } from './definition53.js';
|
|
6
|
+
import { a as dividerRegistries } from './definition21.js';
|
|
7
|
+
import { D as DatePickerBase, i as isValidDateStr, f as formatPresentationDate, p as parsePresentationDate, a as DatePickerBaseTemplate, s as styles } from './presentationDate.js';
|
|
8
8
|
import './affix.js';
|
|
9
9
|
import { e as errorText, f as formElements } from './index2.js';
|
|
10
10
|
|
|
11
|
-
const formatRange = (from, to) => {
|
|
12
|
-
return `${from} – ${to}`;
|
|
13
|
-
};
|
|
14
|
-
const formatPresentationDateRange = (dateRange, locale) => {
|
|
15
|
-
return formatRange(formatPresentationDate(dateRange.start, locale), formatPresentationDate(dateRange.end, locale));
|
|
16
|
-
};
|
|
17
|
-
const parsePresentationDateRange = (presentationDateRange, locale) => {
|
|
18
|
-
const fragments = presentationDateRange.trim().split(/[\s—–-]+/);
|
|
19
|
-
if (fragments.length !== 2) {
|
|
20
|
-
throw new Error(`Invalid date range: ${presentationDateRange}`);
|
|
21
|
-
}
|
|
22
|
-
const [start, end] = fragments.map((fragment) => parsePresentationDate(fragment, locale));
|
|
23
|
-
return { start, end };
|
|
24
|
-
};
|
|
25
|
-
|
|
26
11
|
var __defProp = Object.defineProperty;
|
|
27
12
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
28
13
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
@@ -34,279 +19,104 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
34
19
|
__defProp(target, key, result);
|
|
35
20
|
return result;
|
|
36
21
|
};
|
|
37
|
-
|
|
38
|
-
function isDefined(value) {
|
|
39
|
-
return !!value;
|
|
40
|
-
}
|
|
41
|
-
let DateRangePicker = class extends DatePickerBase {
|
|
22
|
+
let DatePicker = class extends DatePickerBase {
|
|
42
23
|
constructor() {
|
|
43
|
-
super(
|
|
44
|
-
this.initialStart = "";
|
|
45
|
-
this.initialEnd = "";
|
|
46
|
-
this.#isInternalValueUpdate = false;
|
|
47
|
-
this.start = "";
|
|
48
|
-
this.end = "";
|
|
49
|
-
this.setFormValue = (value, state) => {
|
|
50
|
-
if (isFormAssociatedTryingToSetFormValue(value)) {
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
super.setFormValue(value, state);
|
|
54
|
-
};
|
|
55
|
-
this._numCalendars = 2;
|
|
56
|
-
/**
|
|
57
|
-
* @internal
|
|
58
|
-
*/
|
|
59
|
-
this._hideDatesOutsideMonth = true;
|
|
24
|
+
super();
|
|
60
25
|
/**
|
|
61
26
|
* @internal
|
|
62
27
|
*/
|
|
63
|
-
this._textFieldSize = "
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* @internal
|
|
67
|
-
*/
|
|
68
|
-
initialStartChanged() {
|
|
69
|
-
if (!this.dirtyValue) {
|
|
70
|
-
this.start = this.initialStart;
|
|
71
|
-
this.dirtyValue = false;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* @internal
|
|
76
|
-
*/
|
|
77
|
-
initialEndChanged() {
|
|
78
|
-
if (!this.dirtyValue) {
|
|
79
|
-
this.end = this.initialEnd;
|
|
80
|
-
this.dirtyValue = false;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
#isInternalValueUpdate;
|
|
84
|
-
/**
|
|
85
|
-
* @internal
|
|
86
|
-
*/
|
|
87
|
-
startChanged() {
|
|
88
|
-
if (this.start && !isValidDateStr(this.start)) {
|
|
89
|
-
this.start = "";
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
this.currentStart = this.start;
|
|
93
|
-
this.dirtyValue = true;
|
|
94
|
-
if (!this.#isInternalValueUpdate) {
|
|
95
|
-
this.#handleChangedValues();
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* @internal
|
|
100
|
-
*/
|
|
101
|
-
endChanged() {
|
|
102
|
-
if (this.end && !isValidDateStr(this.end)) {
|
|
103
|
-
this.end = "";
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
this.currentEnd = this.end;
|
|
107
|
-
this.dirtyValue = true;
|
|
108
|
-
if (!this.#isInternalValueUpdate) {
|
|
109
|
-
this.#handleChangedValues();
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* @internal
|
|
114
|
-
*/
|
|
115
|
-
currentStartChanged() {
|
|
116
|
-
this.start = this.currentStart;
|
|
28
|
+
this._textFieldSize = "20";
|
|
29
|
+
this.proxy.type = "date";
|
|
117
30
|
}
|
|
118
31
|
/**
|
|
119
32
|
* @internal
|
|
120
33
|
*/
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
if (range.start !== void 0) {
|
|
127
|
-
this.start = range.start;
|
|
128
|
-
this.$emit("input:start");
|
|
129
|
-
}
|
|
130
|
-
if (range.end !== void 0) {
|
|
131
|
-
this.end = range.end;
|
|
132
|
-
this.$emit("input:end");
|
|
133
|
-
}
|
|
134
|
-
this.#isInternalValueUpdate = false;
|
|
135
|
-
this.$emit("input");
|
|
136
|
-
this.$emit("change");
|
|
137
|
-
this.#handleChangedValues();
|
|
138
|
-
}
|
|
139
|
-
#handleChangedValues() {
|
|
140
|
-
if (this.start && this.end) {
|
|
141
|
-
if (compareDateStr(this.start, this.end) > 0) {
|
|
142
|
-
this.#updateValues({ start: this.end, end: this.start });
|
|
34
|
+
valueChanged(previous, next) {
|
|
35
|
+
super.valueChanged(previous, next);
|
|
36
|
+
if (this.value) {
|
|
37
|
+
if (!isValidDateStr(this.value)) {
|
|
38
|
+
this.value = "";
|
|
143
39
|
return;
|
|
144
40
|
}
|
|
145
|
-
this._presentationValue =
|
|
146
|
-
|
|
147
|
-
start: this.start,
|
|
148
|
-
end: this.end
|
|
149
|
-
},
|
|
41
|
+
this._presentationValue = formatPresentationDate(
|
|
42
|
+
this.value,
|
|
150
43
|
this.locale.datePicker
|
|
151
44
|
);
|
|
152
|
-
this.
|
|
45
|
+
this._adjustSelectedMonthToEnsureVisibilityOf(this.value);
|
|
153
46
|
} else {
|
|
154
|
-
this.value = "";
|
|
155
47
|
this._presentationValue = "";
|
|
156
48
|
}
|
|
157
|
-
const dateToEnsureVisibilityOf = this.start || this.end;
|
|
158
|
-
if (dateToEnsureVisibilityOf) {
|
|
159
|
-
this._adjustSelectedMonthToEnsureVisibilityOf(dateToEnsureVisibilityOf);
|
|
160
|
-
}
|
|
161
|
-
this.#updateFormValue();
|
|
162
49
|
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
super.nameChanged(previous, next);
|
|
168
|
-
this.#updateFormValue();
|
|
50
|
+
#updateValueDueToUserInteraction(newValue) {
|
|
51
|
+
this.value = newValue;
|
|
52
|
+
this.$emit("change");
|
|
53
|
+
this.$emit("input");
|
|
169
54
|
}
|
|
170
|
-
|
|
171
|
-
if (
|
|
172
|
-
this.
|
|
55
|
+
get _calendarButtonLabel() {
|
|
56
|
+
if (this.value) {
|
|
57
|
+
return this.locale.datePicker.changeDateLabel(formatPresentationDate(this.value, this.locale.datePicker));
|
|
173
58
|
} else {
|
|
174
|
-
|
|
175
|
-
formData.append(this.name, this.start);
|
|
176
|
-
formData.append(this.name, this.end);
|
|
177
|
-
this.setFormValue(formData);
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
connectedCallback() {
|
|
181
|
-
super.connectedCallback();
|
|
182
|
-
if (!this.start) {
|
|
183
|
-
this.start = this.initialStart;
|
|
184
|
-
}
|
|
185
|
-
if (!this.end) {
|
|
186
|
-
this.end = this.initialEnd;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
#getVisibleRange() {
|
|
190
|
-
const candidates = [this.start, this.end].filter(isDefined);
|
|
191
|
-
const isPartialRange = candidates.length === 1;
|
|
192
|
-
if (this._hoverDate && isPartialRange) {
|
|
193
|
-
candidates.push(this._hoverDate);
|
|
59
|
+
return this.locale.datePicker.chooseDateLabel;
|
|
194
60
|
}
|
|
195
|
-
const [start, end] = candidates.sort(compareDateStr);
|
|
196
|
-
return { start, end };
|
|
197
61
|
}
|
|
198
62
|
/**
|
|
199
63
|
* @internal
|
|
200
64
|
*/
|
|
201
|
-
|
|
202
|
-
return
|
|
203
|
-
}
|
|
204
|
-
/**
|
|
205
|
-
* @internal
|
|
206
|
-
*/
|
|
207
|
-
_isDateInSelectedRange(date) {
|
|
208
|
-
const { start, end } = this.#getVisibleRange();
|
|
209
|
-
if (start && end) {
|
|
210
|
-
return compareDateStr(date, start) >= 0 && compareDateStr(date, end) <= 0;
|
|
211
|
-
}
|
|
212
|
-
return false;
|
|
213
|
-
}
|
|
214
|
-
/**
|
|
215
|
-
* @internal
|
|
216
|
-
*/
|
|
217
|
-
_isDateRangeStart(date) {
|
|
218
|
-
return date === this.#getVisibleRange().start;
|
|
219
|
-
}
|
|
220
|
-
/**
|
|
221
|
-
* @internal
|
|
222
|
-
*/
|
|
223
|
-
_isDateRangeEnd(date) {
|
|
224
|
-
return date === this.#getVisibleRange().end;
|
|
65
|
+
get _textFieldPlaceholder() {
|
|
66
|
+
return this.locale.datePicker.dateFormatPlaceholder;
|
|
225
67
|
}
|
|
226
68
|
/**
|
|
227
69
|
* @internal
|
|
228
70
|
*/
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
71
|
+
_onTextFieldChange() {
|
|
72
|
+
if (this._presentationValue === "") {
|
|
73
|
+
this.#updateValueDueToUserInteraction("");
|
|
74
|
+
return;
|
|
233
75
|
}
|
|
234
|
-
|
|
235
|
-
|
|
76
|
+
try {
|
|
77
|
+
this.#updateValueDueToUserInteraction(
|
|
78
|
+
parsePresentationDate(this._presentationValue, this.locale.datePicker)
|
|
79
|
+
);
|
|
80
|
+
} catch (_) {
|
|
81
|
+
return;
|
|
236
82
|
}
|
|
237
|
-
return dates;
|
|
238
83
|
}
|
|
239
84
|
/**
|
|
85
|
+
* Handle selecting a date from the calendar.
|
|
240
86
|
* @internal
|
|
241
87
|
*/
|
|
242
88
|
_onDateClick(date) {
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
} else if (this.start) {
|
|
246
|
-
this.#updateValues({ end: date });
|
|
247
|
-
this._closePopup();
|
|
248
|
-
} else if (this.end) {
|
|
249
|
-
this.#updateValues({ start: date });
|
|
250
|
-
this._closePopup();
|
|
251
|
-
} else {
|
|
252
|
-
this.#updateValues({ start: date });
|
|
253
|
-
}
|
|
89
|
+
this.#updateValueDueToUserInteraction(date);
|
|
90
|
+
this._closePopup();
|
|
254
91
|
}
|
|
255
92
|
/**
|
|
256
93
|
* @internal
|
|
257
94
|
*/
|
|
258
|
-
|
|
259
|
-
return
|
|
260
|
-
this.locale.datePicker.dateFormatPlaceholder,
|
|
261
|
-
this.locale.datePicker.dateFormatPlaceholder
|
|
262
|
-
);
|
|
95
|
+
_isDateSelected(date) {
|
|
96
|
+
return date === this.value;
|
|
263
97
|
}
|
|
264
98
|
/**
|
|
265
99
|
* @internal
|
|
266
100
|
*/
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
this.#updateValues({ start: "", end: "" });
|
|
270
|
-
return;
|
|
271
|
-
}
|
|
272
|
-
try {
|
|
273
|
-
const { start, end } = parsePresentationDateRange(
|
|
274
|
-
this._presentationValue,
|
|
275
|
-
this.locale.datePicker
|
|
276
|
-
);
|
|
277
|
-
this.#updateValues({ start, end });
|
|
278
|
-
} catch (_) {
|
|
279
|
-
return;
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
/**
|
|
283
|
-
* @internal
|
|
284
|
-
*/
|
|
285
|
-
_onDateMouseEnter(date) {
|
|
286
|
-
this._hoverDate = date;
|
|
101
|
+
_isDateAriaSelected(date) {
|
|
102
|
+
return this._isDateSelected(date);
|
|
287
103
|
}
|
|
288
104
|
/**
|
|
289
105
|
* @internal
|
|
290
106
|
*/
|
|
291
|
-
|
|
292
|
-
|
|
107
|
+
_getSelectedDates() {
|
|
108
|
+
const dates = [];
|
|
109
|
+
if (this.value) {
|
|
110
|
+
dates.push(this.value);
|
|
111
|
+
}
|
|
112
|
+
return dates;
|
|
293
113
|
}
|
|
294
114
|
/**
|
|
295
115
|
* @internal
|
|
296
116
|
*/
|
|
297
117
|
_getCustomValidationError() {
|
|
298
118
|
if (this._isPresentationValueInvalid()) {
|
|
299
|
-
return this.locale.datePicker.
|
|
300
|
-
}
|
|
301
|
-
if (this.min && this.start && compareDateStr(this.start, this.min) < 0) {
|
|
302
|
-
return this.locale.datePicker.startDateAfterMinDateError(
|
|
303
|
-
formatPresentationDate(this.min, this.locale.datePicker)
|
|
304
|
-
);
|
|
305
|
-
}
|
|
306
|
-
if (this.max && this.end && compareDateStr(this.end, this.max) > 0) {
|
|
307
|
-
return this.locale.datePicker.endDateBeforeMaxDateError(
|
|
308
|
-
formatPresentationDate(this.max, this.locale.datePicker)
|
|
309
|
-
);
|
|
119
|
+
return this.locale.datePicker.invalidDateError;
|
|
310
120
|
}
|
|
311
121
|
return null;
|
|
312
122
|
}
|
|
@@ -318,10 +128,7 @@ let DateRangePicker = class extends DatePickerBase {
|
|
|
318
128
|
return false;
|
|
319
129
|
}
|
|
320
130
|
try {
|
|
321
|
-
|
|
322
|
-
this._presentationValue,
|
|
323
|
-
this.locale.datePicker
|
|
324
|
-
);
|
|
131
|
+
parsePresentationDate(this._presentationValue, this.locale.datePicker);
|
|
325
132
|
return false;
|
|
326
133
|
} catch (_) {
|
|
327
134
|
return true;
|
|
@@ -331,79 +138,34 @@ let DateRangePicker = class extends DatePickerBase {
|
|
|
331
138
|
* @internal
|
|
332
139
|
*/
|
|
333
140
|
_onClearClick() {
|
|
334
|
-
this.#
|
|
141
|
+
this.#updateValueDueToUserInteraction("");
|
|
335
142
|
super._onClearClick();
|
|
336
143
|
}
|
|
337
|
-
/**
|
|
338
|
-
* @internal
|
|
339
|
-
*/
|
|
340
|
-
formResetCallback() {
|
|
341
|
-
this.#updateValues({ start: this.initialStart, end: this.initialEnd });
|
|
342
|
-
super.formResetCallback();
|
|
343
|
-
}
|
|
344
|
-
get _calendarButtonLabel() {
|
|
345
|
-
if (this.start && this.end) {
|
|
346
|
-
return this.locale.datePicker.changeDatesLabel(
|
|
347
|
-
formatPresentationDateRange(
|
|
348
|
-
{
|
|
349
|
-
start: this.start,
|
|
350
|
-
end: this.end
|
|
351
|
-
},
|
|
352
|
-
this.locale.datePicker
|
|
353
|
-
)
|
|
354
|
-
);
|
|
355
|
-
} else {
|
|
356
|
-
return this.locale.datePicker.chooseDatesLabel;
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
144
|
};
|
|
360
|
-
__decorateClass([
|
|
361
|
-
attr({ mode: "fromView", attribute: "start" })
|
|
362
|
-
], DateRangePicker.prototype, "initialStart", 2);
|
|
363
|
-
__decorateClass([
|
|
364
|
-
attr({ mode: "fromView", attribute: "end" })
|
|
365
|
-
], DateRangePicker.prototype, "initialEnd", 2);
|
|
366
|
-
__decorateClass([
|
|
367
|
-
observable
|
|
368
|
-
], DateRangePicker.prototype, "start", 2);
|
|
369
|
-
__decorateClass([
|
|
370
|
-
observable
|
|
371
|
-
], DateRangePicker.prototype, "end", 2);
|
|
372
|
-
__decorateClass([
|
|
373
|
-
attr({ attribute: "current-start" })
|
|
374
|
-
], DateRangePicker.prototype, "currentStart", 2);
|
|
375
|
-
__decorateClass([
|
|
376
|
-
attr({ attribute: "current-end" })
|
|
377
|
-
], DateRangePicker.prototype, "currentEnd", 2);
|
|
378
|
-
__decorateClass([
|
|
379
|
-
observable
|
|
380
|
-
], DateRangePicker.prototype, "_numCalendars", 2);
|
|
381
|
-
__decorateClass([
|
|
382
|
-
observable
|
|
383
|
-
], DateRangePicker.prototype, "_hoverDate", 2);
|
|
384
145
|
__decorateClass([
|
|
385
146
|
volatile
|
|
386
|
-
],
|
|
387
|
-
|
|
147
|
+
], DatePicker.prototype, "_calendarButtonLabel", 1);
|
|
148
|
+
DatePicker = __decorateClass([
|
|
388
149
|
errorText,
|
|
389
150
|
formElements
|
|
390
|
-
],
|
|
151
|
+
], DatePicker);
|
|
391
152
|
|
|
392
|
-
const
|
|
393
|
-
baseName: "date-
|
|
153
|
+
const datePickerDefinition = DatePicker.compose({
|
|
154
|
+
baseName: "date-picker",
|
|
394
155
|
template: DatePickerBaseTemplate,
|
|
395
|
-
styles
|
|
156
|
+
styles,
|
|
157
|
+
shadowOptions: {
|
|
158
|
+
delegatesFocus: true
|
|
159
|
+
}
|
|
396
160
|
});
|
|
397
|
-
const
|
|
398
|
-
|
|
161
|
+
const datePickerRegistries = [
|
|
162
|
+
datePickerDefinition(),
|
|
399
163
|
...buttonRegistries,
|
|
400
164
|
...popupRegistries,
|
|
401
165
|
...textFieldRegistries,
|
|
402
166
|
...focusRegistries,
|
|
403
167
|
...dividerRegistries
|
|
404
168
|
];
|
|
405
|
-
const
|
|
406
|
-
dateRangePickerRegistries
|
|
407
|
-
);
|
|
169
|
+
const registerDatePicker = registerFactory(datePickerRegistries);
|
|
408
170
|
|
|
409
|
-
export {
|
|
171
|
+
export { datePickerRegistries as a, datePickerDefinition as d, registerDatePicker as r };
|