@vonage/vivid 4.17.0 → 4.18.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/custom-elements.json +3903 -3860
- package/date-time-picker/index.cjs +5 -0
- package/date-time-picker/index.js +3 -0
- package/dial-pad/index.cjs +1 -1
- package/dial-pad/index.js +1 -1
- package/dialog/index.cjs +1 -1
- package/dialog/index.js +1 -1
- package/divider/index.cjs +1 -1
- package/divider/index.js +1 -1
- package/elevation/index.cjs +1 -1
- package/elevation/index.js +1 -1
- package/empty-state/index.cjs +1 -1
- package/empty-state/index.js +1 -1
- package/fab/index.cjs +1 -1
- package/fab/index.js +1 -1
- package/file-picker/index.cjs +1 -1
- package/file-picker/index.js +1 -1
- package/header/index.cjs +1 -1
- package/header/index.js +1 -1
- package/icon/index.cjs +1 -1
- package/icon/index.js +1 -1
- package/index.cjs +136 -133
- package/index.js +45 -44
- package/layout/index.cjs +1 -1
- package/layout/index.js +1 -1
- package/lib/action-group/action-group.d.ts +449 -3
- package/lib/banner/banner.d.ts +449 -3
- package/lib/breadcrumb-item/breadcrumb-item.d.ts +449 -1
- package/lib/checkbox/checkbox.d.ts +449 -4
- package/lib/components.d.ts +1 -0
- package/lib/date-picker/date-picker.d.ts +2182 -4
- package/lib/date-picker/date-picker.template.d.ts +2 -0
- package/lib/date-range-picker/date-range-picker.d.ts +1110 -4
- package/lib/date-range-picker/date-range-picker.template.d.ts +2 -0
- package/lib/date-time-picker/date-time-picker.d.ts +2175 -0
- package/lib/date-time-picker/date-time-picker.template.d.ts +2 -0
- package/lib/date-time-picker/definition.d.ts +1 -0
- package/lib/date-time-picker/locale.d.ts +9 -0
- package/lib/dialog/dialog.d.ts +449 -2
- package/lib/divider/divider.d.ts +448 -1
- package/lib/menu/menu.d.ts +446 -1
- package/lib/nav-disclosure/nav-disclosure.d.ts +449 -2
- package/lib/number-field/number-field.d.ts +450 -3
- package/lib/option/option.d.ts +1 -11
- package/lib/progress/progress.d.ts +449 -2
- package/lib/progress-ring/progress-ring.d.ts +449 -2
- package/lib/rich-text-editor/facades/vivid-prose-mirror.facade.d.ts +1 -0
- package/lib/rich-text-editor/rich-text-editor.d.ts +7 -4
- package/lib/select/select.d.ts +1 -5
- package/lib/selectable-box/selectable-box.d.ts +449 -2
- package/lib/slider/slider.d.ts +449 -3
- package/lib/split-button/split-button.d.ts +449 -3
- package/lib/switch/switch.d.ts +449 -2
- package/lib/tag-group/tag-group.d.ts +449 -2
- package/lib/text-anchor/text-anchor.d.ts +449 -1
- package/lib/text-area/text-area.d.ts +450 -3
- package/lib/text-field/text-field.d.ts +450 -7
- package/lib/time-picker/locale.d.ts +0 -2
- package/lib/time-picker/time-picker.d.ts +1053 -9
- package/lib/time-picker/time-picker.template.d.ts +2 -1
- package/locales/de-DE.cjs +29 -5
- package/locales/de-DE.js +29 -5
- package/locales/en-GB.cjs +29 -5
- package/locales/en-GB.js +29 -5
- package/locales/en-US.cjs +29 -5
- package/locales/en-US.js +29 -5
- package/locales/ja-JP.cjs +29 -5
- package/locales/ja-JP.js +29 -5
- package/locales/zh-CN.cjs +29 -5
- package/locales/zh-CN.js +29 -5
- package/menu/index.cjs +1 -1
- package/menu/index.js +1 -1
- package/menu-item/index.cjs +1 -1
- package/menu-item/index.js +1 -1
- package/nav/index.cjs +1 -1
- package/nav/index.js +1 -1
- package/nav-disclosure/index.cjs +1 -1
- package/nav-disclosure/index.js +1 -1
- package/nav-item/index.cjs +1 -1
- package/nav-item/index.js +1 -1
- package/note/index.cjs +1 -1
- package/note/index.js +1 -1
- package/number-field/index.cjs +1 -1
- package/number-field/index.js +1 -1
- package/option/index.cjs +1 -1
- package/option/index.js +1 -1
- package/package.json +1 -1
- package/pagination/index.cjs +1 -1
- package/pagination/index.js +1 -1
- package/popup/index.cjs +1 -1
- package/popup/index.js +1 -1
- package/progress/index.cjs +1 -1
- package/progress/index.js +1 -1
- package/progress-ring/index.cjs +1 -1
- package/progress-ring/index.js +1 -1
- package/radio/index.cjs +1 -1
- package/radio/index.js +1 -1
- package/radio-group/index.cjs +1 -1
- package/radio-group/index.js +1 -1
- package/range-slider/index.cjs +1 -1
- package/range-slider/index.js +1 -1
- package/rich-text-editor/index.cjs +1 -1
- package/rich-text-editor/index.js +1 -1
- package/searchable-select/index.cjs +1 -1
- package/searchable-select/index.js +1 -1
- package/select/index.cjs +1 -1
- package/select/index.js +1 -1
- package/selectable-box/index.cjs +1 -1
- package/selectable-box/index.js +1 -1
- package/shared/Reflector.cjs +71 -0
- package/shared/Reflector.js +69 -0
- package/shared/affix.cjs +1 -1
- package/shared/affix.js +1 -1
- package/shared/anchor.cjs +0 -10
- package/shared/anchor.js +0 -10
- package/shared/aria/delegates-aria.d.ts +454 -0
- package/shared/base-progress.js +1 -1
- package/shared/breadcrumb-item.cjs +2 -1
- package/shared/breadcrumb-item.js +2 -1
- package/shared/button.cjs +2 -13
- package/shared/button.js +2 -13
- package/shared/{presentationDate.cjs → calendar-picker.template.cjs} +730 -900
- package/shared/{presentationDate.js → calendar-picker.template.js} +672 -845
- package/shared/datetime/dateTimeStr.d.ts +6 -0
- package/shared/datetime/presentationDate.d.ts +4 -0
- package/shared/{date-picker/calendar → datetime}/presentationDateRange.d.ts +3 -3
- package/shared/datetime/presentationDateTime.d.ts +4 -0
- package/{lib/time-picker/time → shared/datetime}/time.d.ts +1 -0
- package/shared/definition.cjs +1 -1
- package/shared/definition.js +1 -1
- package/shared/definition11.cjs +8 -11
- package/shared/definition11.js +8 -11
- package/shared/definition14.cjs +2 -2
- package/shared/definition14.js +2 -2
- package/shared/definition15.cjs +3 -10
- package/shared/definition15.js +3 -10
- package/shared/definition16.cjs +29 -33
- package/shared/definition16.js +29 -33
- package/shared/definition17.cjs +1 -1
- package/shared/definition17.js +1 -1
- package/shared/definition18.cjs +56 -91
- package/shared/definition18.js +56 -91
- package/shared/definition19.cjs +68 -32
- package/shared/definition19.js +58 -22
- package/shared/definition20.cjs +253 -220
- package/shared/definition20.js +254 -220
- package/shared/definition21.cjs +200 -286
- package/shared/definition21.js +198 -284
- package/shared/definition22.cjs +302 -31
- package/shared/definition22.js +301 -30
- package/shared/definition23.cjs +37 -58
- package/shared/definition23.js +36 -57
- package/shared/definition24.cjs +50 -70
- package/shared/definition24.js +49 -69
- package/shared/definition25.cjs +75 -2475
- package/shared/definition25.js +74 -2475
- package/shared/definition26.cjs +2480 -50
- package/shared/definition26.js +2479 -48
- package/shared/definition27.cjs +53 -271
- package/shared/definition27.js +52 -269
- package/shared/definition28.cjs +271 -48
- package/shared/definition28.js +269 -47
- package/shared/definition29.cjs +37 -764
- package/shared/definition29.js +36 -758
- package/shared/definition3.cjs +2 -9
- package/shared/definition3.js +2 -9
- package/shared/definition30.cjs +739 -57
- package/shared/definition30.js +733 -56
- package/shared/definition31.cjs +93 -22
- package/shared/definition31.js +92 -21
- package/shared/definition32.cjs +28 -10
- package/shared/definition32.js +27 -9
- package/shared/definition33.cjs +10 -52
- package/shared/definition33.js +9 -51
- package/shared/definition34.cjs +30 -411
- package/shared/definition34.js +30 -412
- package/shared/definition35.cjs +422 -52
- package/shared/definition35.js +423 -53
- package/shared/definition36.cjs +53 -216
- package/shared/definition36.js +53 -215
- package/shared/definition37.cjs +201 -71
- package/shared/definition37.js +200 -70
- package/shared/definition38.cjs +53 -48
- package/shared/definition38.js +51 -46
- package/shared/definition39.cjs +57 -263
- package/shared/definition39.js +56 -262
- package/shared/definition4.cjs +2 -2
- package/shared/definition4.js +2 -2
- package/shared/definition40.cjs +220 -148
- package/shared/definition40.js +220 -148
- package/shared/definition41.cjs +143 -567
- package/shared/definition41.js +143 -568
- package/shared/definition42.cjs +596 -12573
- package/shared/definition42.js +596 -12573
- package/shared/definition43.cjs +13489 -1058
- package/shared/definition43.js +13489 -1059
- package/shared/definition44.cjs +936 -698
- package/shared/definition44.js +937 -698
- package/shared/definition45.cjs +850 -105
- package/shared/definition45.js +850 -104
- package/shared/definition46.cjs +110 -90
- package/shared/definition46.js +108 -88
- package/shared/definition47.cjs +88 -464
- package/shared/definition47.js +87 -463
- package/shared/definition48.cjs +457 -111
- package/shared/definition48.js +456 -110
- package/shared/definition49.cjs +103 -109
- package/shared/definition49.js +102 -108
- package/shared/definition5.cjs +3 -3
- package/shared/definition5.js +3 -3
- package/shared/definition50.cjs +136 -14
- package/shared/definition50.js +135 -13
- package/shared/definition51.cjs +16 -115
- package/shared/definition51.js +15 -114
- package/shared/definition52.cjs +79 -486
- package/shared/definition52.js +78 -485
- package/shared/definition53.cjs +503 -24
- package/shared/definition53.js +502 -23
- package/shared/definition54.cjs +23 -137
- package/shared/definition54.js +22 -136
- package/shared/definition55.cjs +96 -241
- package/shared/definition55.js +95 -241
- package/shared/definition56.cjs +261 -61
- package/shared/definition56.js +260 -60
- package/shared/definition57.cjs +419 -788
- package/shared/definition57.js +420 -789
- package/shared/definition58.cjs +27 -144
- package/shared/definition58.js +27 -143
- package/shared/definition59.cjs +83 -54
- package/shared/definition59.js +82 -53
- package/shared/definition6.cjs +1 -1
- package/shared/definition6.js +1 -1
- package/shared/definition60.cjs +80 -165
- package/shared/definition60.js +79 -163
- package/shared/definition61.cjs +143 -230
- package/shared/definition61.js +141 -229
- package/shared/definition62.cjs +233 -69344
- package/shared/definition62.js +232 -69343
- package/shared/definition63.cjs +69381 -28
- package/shared/definition63.js +69379 -26
- package/shared/definition64.cjs +28 -2168
- package/shared/definition64.js +27 -2166
- package/shared/definition65.cjs +2195 -0
- package/shared/definition65.js +2190 -0
- package/shared/definition7.cjs +1 -1
- package/shared/definition7.js +1 -1
- package/shared/definition8.cjs +3 -9
- package/shared/definition8.js +3 -9
- package/shared/definition9.cjs +1 -1
- package/shared/definition9.js +1 -1
- package/shared/delegates-aria.cjs +69 -0
- package/shared/delegates-aria.js +67 -0
- package/shared/form-associated.js +1 -1
- package/shared/form-elements.cjs +1 -1
- package/shared/form-elements.js +1 -1
- package/shared/foundation/anchor/anchor.d.ts +0 -8
- package/shared/foundation/button/button.d.ts +449 -7
- package/shared/foundation/listbox/listbox.d.ts +0 -9
- package/shared/listbox.cjs +4 -30
- package/shared/listbox.js +4 -30
- package/shared/localization/Locale.d.ts +6 -2
- package/shared/option.cjs +1 -38
- package/shared/option.js +1 -38
- package/shared/picker-field/locale.d.ts +4 -0
- package/shared/picker-field/mixins/calendar-picker.d.ts +558 -0
- package/shared/{date-picker/locale.d.ts → picker-field/mixins/calendar-picker.locale.d.ts} +1 -3
- package/shared/picker-field/mixins/calendar-picker.template.d.ts +555 -0
- package/shared/picker-field/mixins/calendar-segments/calendarGrid.d.ts +17 -0
- package/shared/{date-picker/calendar → picker-field/mixins/calendar-segments}/monthPickerGrid.d.ts +3 -3
- package/{lib/time-picker → shared/picker-field/mixins}/inline-time-picker/columns.d.ts +1 -1
- package/{lib/time-picker → shared/picker-field/mixins}/inline-time-picker/inline-time-picker.d.ts +2 -2
- package/{lib/time-picker/time/picker.d.ts → shared/picker-field/mixins/inline-time-picker/picker-option.d.ts} +1 -1
- package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +1110 -0
- package/shared/picker-field/mixins/single-date-picker.d.ts +1626 -0
- package/shared/picker-field/mixins/single-value-picker.d.ts +518 -0
- package/shared/picker-field/mixins/time-selection-picker.d.ts +1053 -0
- package/shared/picker-field/mixins/time-selection-picker.template.d.ts +1050 -0
- package/shared/picker-field/picker-field.d.ts +11 -0
- package/shared/picker-field/picker-field.form-associated.d.ts +11 -0
- package/shared/picker-field/picker-field.template.d.ts +7 -0
- package/shared/picker-field.template.cjs +315 -0
- package/shared/picker-field.template.js +310 -0
- package/shared/single-date-picker.cjs +46 -0
- package/shared/single-date-picker.js +44 -0
- package/shared/single-value-picker.cjs +77 -0
- package/shared/single-value-picker.js +75 -0
- package/shared/slider.template.cjs +3 -3
- package/shared/slider.template.js +3 -3
- package/shared/text-anchor.cjs +2 -1
- package/shared/text-anchor.js +2 -1
- package/shared/text-anchor.template.cjs +3 -5
- package/shared/text-anchor.template.js +3 -5
- package/shared/text-field.cjs +2 -555
- package/shared/text-field.js +2 -554
- package/shared/time-selection-picker.template.cjs +776 -0
- package/shared/time-selection-picker.template.js +767 -0
- package/shared/vivid-element.cjs +1 -1
- package/shared/vivid-element.js +1 -1
- package/side-drawer/index.cjs +1 -1
- package/side-drawer/index.js +1 -1
- package/slider/index.cjs +1 -1
- package/slider/index.js +1 -1
- package/split-button/index.cjs +1 -1
- package/split-button/index.js +1 -1
- package/styles/core/all.css +1 -1
- package/styles/core/theme.css +1 -1
- package/styles/core/typography.css +1 -1
- 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.cjs +1 -1
- package/switch/index.js +1 -1
- package/tab/index.cjs +1 -1
- package/tab/index.js +1 -1
- package/tab-panel/index.cjs +1 -1
- package/tab-panel/index.js +1 -1
- package/tabs/index.cjs +1 -1
- package/tabs/index.js +1 -1
- package/tag/index.cjs +1 -1
- package/tag/index.js +1 -1
- package/tag-group/index.cjs +1 -1
- package/tag-group/index.js +1 -1
- package/text-anchor/index.cjs +1 -1
- package/text-anchor/index.js +1 -1
- package/text-area/index.cjs +1 -1
- package/text-area/index.js +1 -1
- package/text-field/index.cjs +1 -1
- package/text-field/index.js +1 -1
- package/time-picker/index.cjs +1 -1
- package/time-picker/index.js +1 -1
- package/toggletip/index.cjs +1 -1
- package/toggletip/index.js +1 -1
- package/tooltip/index.cjs +1 -1
- package/tooltip/index.js +1 -1
- package/tree-item/index.cjs +1 -1
- package/tree-item/index.js +1 -1
- package/tree-view/index.cjs +1 -1
- package/tree-view/index.js +1 -1
- package/video-player/index.cjs +1 -1
- package/video-player/index.js +1 -1
- package/vivid.api.json +105 -1152
- package/lib/time-picker/time-picker.form-associated.d.ts +0 -11
- package/shared/aria-global.cjs +0 -93
- package/shared/aria-global.js +0 -91
- package/shared/date-picker/calendar/calendarGrid.d.ts +0 -17
- package/shared/date-picker/calendar/presentationDate.d.ts +0 -4
- package/shared/date-picker/date-picker-base.d.ts +0 -21
- package/shared/date-picker/date-picker-base.form-associated.d.ts +0 -11
- package/shared/date-picker/date-picker-base.template.d.ts +0 -3
- package/shared/foundation/patterns/aria-global.d.ts +0 -21
- package/shared/foundation/patterns/index.d.ts +0 -1
- package/shared/text-field2.cjs +0 -5
- package/shared/text-field2.js +0 -3
- package/shared/trapped-focus.cjs +0 -35
- package/shared/trapped-focus.js +0 -33
- /package/shared/{date-picker/calendar → datetime}/dateRange.d.ts +0 -0
- /package/shared/{date-picker/calendar → datetime}/dateStr.d.ts +0 -0
- /package/shared/{date-picker/calendar → datetime}/month.d.ts +0 -0
- /package/{lib/time-picker/time → shared/datetime}/presentationTime.d.ts +0 -0
- /package/shared/{date-picker/calendar → datetime}/year.d.ts +0 -0
- /package/shared/{date-picker/calendar → picker-field/mixins/calendar-segments}/segment.d.ts +0 -0
- /package/{lib/time-picker → shared/picker-field/mixins}/inline-time-picker/definition.d.ts +0 -0
- /package/{lib/time-picker → shared/picker-field/mixins}/inline-time-picker/inline-time-picker.template.d.ts +0 -0
package/shared/definition20.cjs
CHANGED
|
@@ -1,252 +1,285 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
const definition$1 = require('./definition65.cjs');
|
|
3
4
|
const definition = require('./definition11.cjs');
|
|
4
|
-
const definition$2 = require('./
|
|
5
|
+
const definition$2 = require('./definition57.cjs');
|
|
6
|
+
const definition$3 = require('./definition23.cjs');
|
|
7
|
+
const pickerField_template = require('./picker-field.template.cjs');
|
|
8
|
+
const calendarPicker_template = require('./calendar-picker.template.cjs');
|
|
5
9
|
const vividElement = require('./vivid-element.cjs');
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const classNames = require('./class-names.cjs');
|
|
11
|
-
const when = require('./when.cjs');
|
|
12
|
-
const repeat = require('./repeat.cjs');
|
|
13
|
-
const ref = require('./ref.cjs');
|
|
14
|
-
const keyCodes = require('./key-codes.cjs');
|
|
10
|
+
const timeSelectionPicker_template = require('./time-selection-picker.template.cjs');
|
|
11
|
+
const singleValuePicker = require('./single-value-picker.cjs');
|
|
12
|
+
const singleDatePicker = require('./single-date-picker.cjs');
|
|
13
|
+
const formElements = require('./form-elements.cjs');
|
|
15
14
|
|
|
16
|
-
const styles = "
|
|
15
|
+
const styles = ".date-time-picker{display:flex;gap:28px;padding-inline-start:12px}.time-picker{padding-block:4px 12px}";
|
|
16
|
+
|
|
17
|
+
const extractDatePart = (dateTimeStr) => dateTimeStr.split("T")[0] || "";
|
|
18
|
+
const extractTimePart = (dateTimeStr) => dateTimeStr.split("T")[1] || "";
|
|
19
|
+
const isValidDateTimeStr = (string) => {
|
|
20
|
+
const [dateStr = "", timeStr = ""] = string.split("T");
|
|
21
|
+
return calendarPicker_template.isValidDateStr(dateStr) && timeSelectionPicker_template.isValidTimeStr(timeStr);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const formatPresentationDateTime = (dateTimeStr, locale, includeSeconds, use12HourClock) => {
|
|
25
|
+
const [dateStr, timeStr] = dateTimeStr.split("T");
|
|
26
|
+
return `${calendarPicker_template.formatPresentationDate(dateStr, locale)} ${timeSelectionPicker_template.formatPresentationTime(
|
|
27
|
+
timeStr,
|
|
28
|
+
includeSeconds,
|
|
29
|
+
use12HourClock
|
|
30
|
+
)}`;
|
|
31
|
+
};
|
|
32
|
+
const parsePresentationDateTime = (presentationDateTime, locale, use12HourClock) => {
|
|
33
|
+
const [datePart, ...timeParts] = presentationDateTime.split(" ");
|
|
34
|
+
const dateStr = calendarPicker_template.parsePresentationDate(datePart, locale);
|
|
35
|
+
const timeStr = timeSelectionPicker_template.parsePresentationTime(timeParts.join(" "), use12HourClock);
|
|
36
|
+
return `${dateStr}T${timeStr}`;
|
|
37
|
+
};
|
|
17
38
|
|
|
18
39
|
var __defProp = Object.defineProperty;
|
|
40
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
19
41
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
20
|
-
var result = void 0 ;
|
|
42
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
21
43
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
22
44
|
if (decorator = decorators[i])
|
|
23
|
-
result = (decorator(target, key, result) ) || result;
|
|
24
|
-
if (result) __defProp(target, key, result);
|
|
45
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
46
|
+
if (kind && result) __defProp(target, key, result);
|
|
25
47
|
return result;
|
|
26
48
|
};
|
|
27
|
-
|
|
49
|
+
const ValidDateTimeFilter = {
|
|
50
|
+
fromView: (value) => {
|
|
51
|
+
if (value && isValidDateTimeStr(value)) {
|
|
52
|
+
return value;
|
|
53
|
+
}
|
|
54
|
+
return "";
|
|
55
|
+
},
|
|
56
|
+
toView(value) {
|
|
57
|
+
return value;
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
let DateTimePicker = class extends timeSelectionPicker_template.TimeSelectionPicker(
|
|
61
|
+
singleDatePicker.SingleDatePickerMixin(singleValuePicker.SingleValuePicker(calendarPicker_template.CalendarPicker(pickerField_template.PickerField)))
|
|
62
|
+
) {
|
|
28
63
|
constructor() {
|
|
29
|
-
super(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
this.
|
|
34
|
-
this.disabled = false;
|
|
35
|
-
this.pending = false;
|
|
36
|
-
this.callActive = false;
|
|
37
|
-
this.noCall = false;
|
|
38
|
-
this.noInput = false;
|
|
39
|
-
this.endCallButtonLabel = null;
|
|
40
|
-
this.callButtonLabel = null;
|
|
64
|
+
super();
|
|
65
|
+
/**
|
|
66
|
+
* @internal
|
|
67
|
+
*/
|
|
68
|
+
this._isValidValue = isValidDateTimeStr;
|
|
41
69
|
/**
|
|
42
|
-
*
|
|
43
70
|
* @internal
|
|
44
71
|
*/
|
|
45
|
-
this.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
72
|
+
this._textFieldSize = "30";
|
|
73
|
+
this.proxy.type = "datetime-local";
|
|
74
|
+
this.proxy.step = "1";
|
|
75
|
+
this.min = "";
|
|
76
|
+
this.minDate = "";
|
|
77
|
+
this.minTime = "";
|
|
78
|
+
this.max = "";
|
|
79
|
+
this.maxDate = "";
|
|
80
|
+
this.maxTime = "";
|
|
81
|
+
}
|
|
82
|
+
get _resolvedMinDate() {
|
|
83
|
+
return this.minDate || extractDatePart(this.min);
|
|
84
|
+
}
|
|
85
|
+
get _resolvedMaxDate() {
|
|
86
|
+
return this.maxDate || extractDatePart(this.max);
|
|
87
|
+
}
|
|
88
|
+
get _resolvedMinTime() {
|
|
89
|
+
return this.minTime || this.min && extractDatePart(this.min) === this._dateValue() && extractTimePart(this.min) || "";
|
|
90
|
+
}
|
|
91
|
+
get _resolvedMaxTime() {
|
|
92
|
+
return this.maxTime || this.max && extractDatePart(this.max) === this._dateValue() && extractTimePart(this.max) || "";
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* @internal
|
|
96
|
+
*/
|
|
97
|
+
_toPresentationValue(value) {
|
|
98
|
+
return formatPresentationDateTime(
|
|
99
|
+
value,
|
|
100
|
+
this.locale.calendarPicker,
|
|
101
|
+
this._displaySeconds,
|
|
102
|
+
this._use12hClock
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* @internal
|
|
107
|
+
*/
|
|
108
|
+
_parsePresentationValue(presentationValue) {
|
|
109
|
+
return parsePresentationDateTime(
|
|
110
|
+
presentationValue,
|
|
111
|
+
this.locale.calendarPicker,
|
|
112
|
+
this._use12hClock
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* @internal
|
|
117
|
+
*/
|
|
118
|
+
_dateValue() {
|
|
119
|
+
return extractDatePart(this.value);
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* @internal
|
|
123
|
+
*/
|
|
124
|
+
_withUpdatedDate(dateStr) {
|
|
125
|
+
return `${dateStr}T${extractTimePart(this.value) || "00:00:00"}`;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* @internal
|
|
129
|
+
*/
|
|
130
|
+
get _timeValue() {
|
|
131
|
+
return extractTimePart(this.value);
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* @internal
|
|
135
|
+
*/
|
|
136
|
+
_withUpdatedTime(timeStr) {
|
|
137
|
+
return `${extractDatePart(this.value) || calendarPicker_template.currentDateStr()}T${timeStr}`;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* @internal
|
|
141
|
+
*/
|
|
142
|
+
_getCustomValidationError() {
|
|
143
|
+
if (this._isPresentationValueInvalid()) {
|
|
144
|
+
return this.locale.dateTimePicker.invalidDateTimeError;
|
|
53
145
|
}
|
|
146
|
+
if (this._dateValue() && this._resolvedMinDate && calendarPicker_template.compareDateStr(this._dateValue(), this._resolvedMinDate) < 0) {
|
|
147
|
+
return this.locale.dateTimePicker.dateBeforeMinDateError(
|
|
148
|
+
calendarPicker_template.formatPresentationDate(
|
|
149
|
+
this._resolvedMinDate,
|
|
150
|
+
this.locale.calendarPicker
|
|
151
|
+
)
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
if (this._dateValue() && this._resolvedMaxDate && calendarPicker_template.compareDateStr(this._dateValue(), this._resolvedMaxDate) > 0) {
|
|
155
|
+
return this.locale.dateTimePicker.dateAfterMaxDateError(
|
|
156
|
+
calendarPicker_template.formatPresentationDate(
|
|
157
|
+
this._resolvedMaxDate,
|
|
158
|
+
this.locale.calendarPicker
|
|
159
|
+
)
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
if (this._timeValue && this._resolvedMinTime && timeSelectionPicker_template.compareTimeStr(this._timeValue, this._resolvedMinTime) < 0) {
|
|
163
|
+
return this.locale.dateTimePicker.timeBeforeMinTimeError(
|
|
164
|
+
timeSelectionPicker_template.formatPresentationTime(
|
|
165
|
+
this._resolvedMinTime,
|
|
166
|
+
this._displaySeconds,
|
|
167
|
+
this._use12hClock
|
|
168
|
+
)
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
if (this._timeValue && this._resolvedMaxTime && timeSelectionPicker_template.compareTimeStr(this._timeValue, this._resolvedMaxTime) > 0) {
|
|
172
|
+
return this.locale.dateTimePicker.timeAfterMaxTimeError(
|
|
173
|
+
timeSelectionPicker_template.formatPresentationTime(
|
|
174
|
+
this._resolvedMaxTime,
|
|
175
|
+
this._displaySeconds,
|
|
176
|
+
this._use12hClock
|
|
177
|
+
)
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
return null;
|
|
54
181
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
182
|
+
/**
|
|
183
|
+
* @internal
|
|
184
|
+
*/
|
|
185
|
+
get _textFieldPlaceholder() {
|
|
186
|
+
return `${this.locale.calendarPicker.dateFormatPlaceholder} ${this._timePlaceholder}`;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* @internal
|
|
190
|
+
*/
|
|
191
|
+
get _pickerButtonLabel() {
|
|
192
|
+
if (this.value) {
|
|
193
|
+
return this.locale.dateTimePicker.changeDateTimeLabel(
|
|
194
|
+
this._toPresentationValue(this.value)
|
|
195
|
+
);
|
|
196
|
+
} else {
|
|
197
|
+
return this.locale.dateTimePicker.chooseDateTimeLabel;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* @internal
|
|
202
|
+
*/
|
|
203
|
+
_focusableElsWithinDialog() {
|
|
204
|
+
return this._dialogEl.querySelectorAll(
|
|
205
|
+
"#inline-time-picker, button, .vwc-button"
|
|
206
|
+
);
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* @internal
|
|
210
|
+
*/
|
|
211
|
+
get _pickerButtonIcon() {
|
|
212
|
+
return "calendar-clock-line";
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* @internal
|
|
216
|
+
*/
|
|
217
|
+
get _dialogLabel() {
|
|
218
|
+
return this.locale.dateTimePicker.chooseDateTimeLabel;
|
|
219
|
+
}
|
|
220
|
+
};
|
|
71
221
|
__decorateClass([
|
|
72
|
-
vividElement.attr({
|
|
73
|
-
],
|
|
222
|
+
vividElement.attr({ converter: ValidDateTimeFilter })
|
|
223
|
+
], DateTimePicker.prototype, "min", 2);
|
|
74
224
|
__decorateClass([
|
|
75
|
-
vividElement.attr({
|
|
76
|
-
],
|
|
225
|
+
vividElement.attr({ converter: timeSelectionPicker_template.ValidTimeFilter, attribute: "min-time" })
|
|
226
|
+
], DateTimePicker.prototype, "minTime", 2);
|
|
77
227
|
__decorateClass([
|
|
78
|
-
vividElement.attr({
|
|
79
|
-
],
|
|
228
|
+
vividElement.attr({ converter: calendarPicker_template.ValidDateFilter, attribute: "min-date" })
|
|
229
|
+
], DateTimePicker.prototype, "minDate", 2);
|
|
80
230
|
__decorateClass([
|
|
81
|
-
vividElement.attr({
|
|
82
|
-
],
|
|
231
|
+
vividElement.attr({ converter: ValidDateTimeFilter })
|
|
232
|
+
], DateTimePicker.prototype, "max", 2);
|
|
83
233
|
__decorateClass([
|
|
84
|
-
vividElement.attr({ attribute: "
|
|
85
|
-
],
|
|
234
|
+
vividElement.attr({ converter: timeSelectionPicker_template.ValidTimeFilter, attribute: "max-time" })
|
|
235
|
+
], DateTimePicker.prototype, "maxTime", 2);
|
|
86
236
|
__decorateClass([
|
|
87
|
-
vividElement.attr({ attribute: "
|
|
88
|
-
],
|
|
89
|
-
|
|
237
|
+
vividElement.attr({ converter: calendarPicker_template.ValidDateFilter, attribute: "max-date" })
|
|
238
|
+
], DateTimePicker.prototype, "maxDate", 2);
|
|
239
|
+
DateTimePicker = __decorateClass([
|
|
240
|
+
formElements.errorText,
|
|
241
|
+
formElements.formElements
|
|
242
|
+
], DateTimePicker);
|
|
90
243
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
this.label = label;
|
|
95
|
-
this.ariaLabel = ariaLabel;
|
|
96
|
-
this.icon = icon;
|
|
97
|
-
this.id = id;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
const DIAL_PAD_BUTTONS = [
|
|
101
|
-
new DialPadButton("1", " ", "digitOneLabel", "one-solid", "btn1"),
|
|
102
|
-
new DialPadButton("2", "ABC", "digitTwoLabel", "two-solid", "btn2"),
|
|
103
|
-
new DialPadButton("3", "DEF", "digitThreeLabel", "three-solid", "btn3"),
|
|
104
|
-
new DialPadButton("4", "GHI", "digitFourLabel", "four-solid", "btn4"),
|
|
105
|
-
new DialPadButton("5", "JKL", "digitFiveLabel", "five-solid", "btn5"),
|
|
106
|
-
new DialPadButton("6", "MNO", "digitSixLabel", "six-solid", "btn6"),
|
|
107
|
-
new DialPadButton("7", "PQRS", "digitSevenLabel", "seven-solid", "btn7"),
|
|
108
|
-
new DialPadButton("8", "TUV", "digitEightLabel", "eight-solid", "btn8"),
|
|
109
|
-
new DialPadButton("9", "WXYZ", "digitNineLabel", "nine-solid", "btn9"),
|
|
110
|
-
new DialPadButton(
|
|
111
|
-
"*",
|
|
112
|
-
null,
|
|
113
|
-
"digitAsteriskLabel",
|
|
114
|
-
"asterisk-2-solid",
|
|
115
|
-
"btnAsterisk"
|
|
116
|
-
),
|
|
117
|
-
new DialPadButton("0", "+", "digitZeroLabel", "zero-solid", "btn0"),
|
|
118
|
-
new DialPadButton(
|
|
119
|
-
"#",
|
|
120
|
-
null,
|
|
121
|
-
"digitHashtagLabel",
|
|
122
|
-
"hashtag-solid",
|
|
123
|
-
"btnHashtag"
|
|
124
|
-
)
|
|
125
|
-
];
|
|
126
|
-
const getClasses = ({ noInput }) => classNames.classNames("base", ["no-input", Boolean(noInput)]);
|
|
127
|
-
function handleKeyDown(x, e) {
|
|
128
|
-
if (e.key === keyCodes.keyEnter && !x.pending && !x.disabled && !x.callActive && !x.noCall && x.value.length > 0 && e.target instanceof HTMLInputElement) {
|
|
129
|
-
x._onDial();
|
|
130
|
-
} else {
|
|
131
|
-
const elementIndex = DIAL_PAD_BUTTONS.findIndex((x2) => x2.value === e.key);
|
|
132
|
-
if (elementIndex > -1) {
|
|
133
|
-
const digit = x.shadowRoot.querySelector(".digits").children[elementIndex];
|
|
134
|
-
if (digit) {
|
|
135
|
-
digit.active = true;
|
|
136
|
-
setTimeout(() => {
|
|
137
|
-
digit.active = false;
|
|
138
|
-
}, 200);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
return true;
|
|
143
|
-
}
|
|
144
|
-
function syncFieldAndPadValues(x) {
|
|
145
|
-
x.value = x._textFieldEl.value;
|
|
146
|
-
}
|
|
147
|
-
function stopPropagation(_, { event: e }) {
|
|
148
|
-
e.stopImmediatePropagation();
|
|
149
|
-
}
|
|
150
|
-
function deleteLastCharacter(dialPad) {
|
|
151
|
-
dialPad.value = dialPad.value.slice(0, -1);
|
|
152
|
-
dialPad.$emit("input");
|
|
153
|
-
dialPad.$emit("change");
|
|
154
|
-
if (dialPad.value === "") {
|
|
155
|
-
dialPad._textFieldEl.focus();
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
function renderTextField(textFieldTag, buttonTag) {
|
|
159
|
-
return vividElement.html`<${textFieldTag} ${ref.ref(
|
|
160
|
-
"_textFieldEl"
|
|
161
|
-
)} class="phone-field" internal-part type="tel"
|
|
162
|
-
value="${(x) => x.value}" placeholder="${(x) => x.placeholder}"
|
|
163
|
-
?disabled="${(x) => x.disabled}" helper-text="${(x) => x.helperText}" pattern="${(x) => x.pattern}"
|
|
164
|
-
aria-label="${(x) => x.locale.dialPad.inputLabel}"
|
|
165
|
-
@keydown="${(x, c) => handleKeyDown(x, c.event)}"
|
|
166
|
-
@input="${syncFieldAndPadValues}"
|
|
167
|
-
@change="${syncFieldAndPadValues}"
|
|
168
|
-
@focus="${stopPropagation}"
|
|
169
|
-
@blur="${stopPropagation}"
|
|
170
|
-
>
|
|
171
|
-
${when.when(
|
|
172
|
-
(x) => x.value && x.value.length && x.value.length > 0,
|
|
173
|
-
vividElement.html`<${buttonTag}
|
|
174
|
-
slot="action-items"
|
|
175
|
-
size='super-condensed'
|
|
176
|
-
icon="backspace-line"
|
|
177
|
-
aria-label="${(x) => x.deleteAriaLabel || x.locale.dialPad.deleteLabel}"
|
|
178
|
-
appearance='ghost'
|
|
179
|
-
?disabled="${(x) => x.disabled || x.callActive}"
|
|
180
|
-
@click="${(x) => deleteLastCharacter(x)}">
|
|
181
|
-
</${buttonTag}>`
|
|
182
|
-
)}
|
|
183
|
-
</${textFieldTag}>`;
|
|
184
|
-
}
|
|
185
|
-
function onDigitClick(digit, { parent: dialPad, event }) {
|
|
186
|
-
dialPad.value += digit.value;
|
|
187
|
-
dialPad.$emit("keypad-click", event.currentTarget);
|
|
188
|
-
dialPad.$emit("input");
|
|
189
|
-
dialPad.$emit("change");
|
|
190
|
-
}
|
|
191
|
-
function renderDigits(buttonTag, iconTag) {
|
|
192
|
-
return vividElement.html`
|
|
193
|
-
${repeat.repeat(
|
|
194
|
-
(_) => DIAL_PAD_BUTTONS,
|
|
244
|
+
const DateTimePickerTemplate = (context) => {
|
|
245
|
+
return pickerField_template.PickerFieldTemplate(
|
|
246
|
+
context,
|
|
195
247
|
vividElement.html`
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
<${iconTag} slot="icon"
|
|
209
|
-
name="${(x) => x.icon}"
|
|
210
|
-
class="digit-btn-num"></${iconTag}>
|
|
211
|
-
</${buttonTag}>
|
|
212
|
-
`
|
|
213
|
-
)}
|
|
214
|
-
`;
|
|
215
|
-
}
|
|
216
|
-
function renderDialButton(buttonTag) {
|
|
217
|
-
return vividElement.html`<${buttonTag} class="call-btn"
|
|
218
|
-
size="expanded"
|
|
219
|
-
appearance="filled"
|
|
220
|
-
icon="${(x) => x.callActive ? "disable-call-line" : "call-line"}"
|
|
221
|
-
connotation="${(x) => x.callActive ? "alert" : "cta"}"
|
|
222
|
-
?disabled="${(x) => x.disabled}"
|
|
223
|
-
?pending="${(x) => x.pending}"
|
|
224
|
-
@click="${(x) => x._onDial()}"
|
|
225
|
-
label="${(x) => x.callActive ? x.endCallButtonLabel || x.locale.dialPad.endCallButtonLabel : x.callButtonLabel || x.locale.dialPad.callButtonLabel}">
|
|
226
|
-
</${buttonTag}>`;
|
|
227
|
-
}
|
|
228
|
-
const DialPadTemplate = (context) => {
|
|
229
|
-
const buttonTag = context.tagFor(definition.Button);
|
|
230
|
-
const iconTag = context.tagFor(definition$1.Icon);
|
|
231
|
-
const textFieldTag = context.tagFor(textField.TextField);
|
|
232
|
-
return vividElement.html` <div class="${getClasses}">
|
|
233
|
-
${when.when((x) => !x.noInput, renderTextField(textFieldTag, buttonTag))}
|
|
234
|
-
<div class="digits">${renderDigits(buttonTag, iconTag)}</div>
|
|
235
|
-
${when.when((x) => !x.noCall, renderDialButton(buttonTag))}
|
|
236
|
-
</div>`;
|
|
248
|
+
<div class="date-time-picker">
|
|
249
|
+
${() => calendarPicker_template.CalendarPickerTemplate(context)}
|
|
250
|
+
<div class="time-picker">
|
|
251
|
+
${() => timeSelectionPicker_template.TimeSelectionPickerTemplate(context, 9)}
|
|
252
|
+
</div>
|
|
253
|
+
</div>
|
|
254
|
+
`,
|
|
255
|
+
{
|
|
256
|
+
withSeparator: false,
|
|
257
|
+
padded: false
|
|
258
|
+
}
|
|
259
|
+
);
|
|
237
260
|
};
|
|
238
261
|
|
|
239
|
-
const
|
|
240
|
-
"
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
[
|
|
262
|
+
const dateTimePickerDefinition = vividElement.defineVividComponent(
|
|
263
|
+
"date-time-picker",
|
|
264
|
+
DateTimePicker,
|
|
265
|
+
DateTimePickerTemplate,
|
|
266
|
+
[
|
|
267
|
+
definition.buttonDefinition,
|
|
268
|
+
definition$1.popupDefinition,
|
|
269
|
+
definition$2.textFieldDefinition,
|
|
270
|
+
definition$3.dividerDefinition,
|
|
271
|
+
timeSelectionPicker_template.inlineTimePickerDefinition
|
|
272
|
+
],
|
|
244
273
|
{
|
|
245
|
-
styles
|
|
274
|
+
styles: [pickerField_template.pickerFieldStyles, calendarPicker_template.calendarStyles, styles],
|
|
275
|
+
shadowOptions: {
|
|
276
|
+
delegatesFocus: true
|
|
277
|
+
}
|
|
246
278
|
}
|
|
247
279
|
);
|
|
248
|
-
const
|
|
280
|
+
const registerDateTimePicker = vividElement.createRegisterFunction(
|
|
281
|
+
dateTimePickerDefinition
|
|
282
|
+
);
|
|
249
283
|
|
|
250
|
-
exports.
|
|
251
|
-
exports.
|
|
252
|
-
exports.registerDialPad = registerDialPad;
|
|
284
|
+
exports.dateTimePickerDefinition = dateTimePickerDefinition;
|
|
285
|
+
exports.registerDateTimePicker = registerDateTimePicker;
|