@vonage/vivid 3.51.0 → 3.53.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/README.md +1 -1
- package/accordion/index.cjs +1 -1
- package/accordion/index.js +1 -1
- package/accordion-item/index.cjs +1 -1
- package/accordion-item/index.js +1 -1
- package/alert/index.cjs +3 -3
- package/alert/index.js +3 -3
- package/appearance-ui/index.cjs +19 -11
- package/appearance-ui/index.js +19 -11
- package/audio-player/index.cjs +4 -3
- package/audio-player/index.js +4 -3
- package/avatar/index.cjs +1 -1
- package/avatar/index.js +1 -1
- package/badge/index.cjs +1 -1
- package/badge/index.js +1 -1
- package/banner/index.cjs +2 -2
- package/banner/index.js +2 -2
- package/breadcrumb-item/index.cjs +1 -1
- package/breadcrumb-item/index.js +1 -1
- package/button/index.cjs +2 -2
- package/button/index.js +2 -2
- package/card/index.cjs +2 -2
- package/card/index.js +2 -2
- package/checkbox/index.cjs +3 -2
- package/checkbox/index.js +3 -2
- package/combobox/index.cjs +5 -8
- package/combobox/index.js +5 -8
- package/custom-elements.json +2310 -769
- package/data-grid/index.cjs +1 -1
- package/data-grid/index.js +1 -1
- package/date-picker/index.cjs +7 -9
- package/date-picker/index.js +7 -9
- package/date-range-picker/index.cjs +7 -9
- package/date-range-picker/index.js +7 -9
- package/dial-pad/index.cjs +33 -0
- package/dial-pad/index.js +31 -0
- package/dialog/index.cjs +4 -4
- package/dialog/index.js +4 -4
- 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 +2 -2
- package/empty-state/index.js +2 -2
- package/fab/index.cjs +2 -2
- package/fab/index.js +2 -2
- package/file-picker/index.cjs +4 -5
- package/file-picker/index.js +4 -5
- package/header/index.cjs +2 -2
- package/header/index.js +2 -2
- package/icon/index.cjs +1 -1
- package/icon/index.js +1 -1
- package/index.cjs +135 -123
- package/index.js +48 -46
- package/layout/index.cjs +1 -1
- package/layout/index.js +1 -1
- package/lib/avatar/definition.d.ts +1 -1
- package/lib/button/button.d.ts +1 -0
- package/lib/button/definition.d.ts +1 -1
- package/lib/calendar-event/definition.d.ts +1 -1
- package/lib/components.d.ts +3 -0
- package/lib/dial-pad/definition.d.ts +3 -0
- package/lib/dial-pad/dial-pad.d.ts +14 -0
- package/lib/dial-pad/dial-pad.template.d.ts +4 -0
- package/lib/dial-pad/locale.d.ts +18 -0
- package/lib/enums.d.ts +6 -0
- package/lib/layout/definition.d.ts +1 -1
- package/lib/menu-item/menu-item.d.ts +3 -0
- package/lib/range-slider/definition.d.ts +3 -0
- package/lib/range-slider/locale.d.ts +4 -0
- package/lib/range-slider/range-slider.d.ts +32 -0
- package/lib/range-slider/range-slider.form-associated.d.ts +10 -0
- package/lib/range-slider/range-slider.template.d.ts +4 -0
- package/lib/range-slider/utils/lerp.d.ts +2 -0
- package/lib/range-slider/utils/roundToStepValue.d.ts +1 -0
- package/lib/slider/slider.template.d.ts +1 -0
- package/lib/split-button/definition.d.ts +1 -1
- package/lib/text-anchor/definition.d.ts +1 -0
- package/lib/text-anchor/text-anchor.d.ts +5 -0
- package/lib/video-player/definition.d.ts +3 -0
- package/lib/video-player/locale.d.ts +1 -0
- package/lib/video-player/video-player.d.ts +17 -0
- package/lib/video-player/video-player.template.d.ts +4 -0
- package/listbox/index.cjs +25 -24
- package/listbox/index.js +25 -24
- package/locales/en-GB.cjs +34 -0
- package/locales/en-GB.js +34 -0
- package/locales/en-US.cjs +202 -0
- package/locales/en-US.js +202 -0
- package/locales/ja-JP.cjs +202 -1
- package/locales/ja-JP.js +202 -1
- package/locales/zh-CN.cjs +203 -0
- package/locales/zh-CN.js +203 -0
- package/menu/index.cjs +7 -7
- package/menu/index.js +7 -7
- package/menu-item/index.cjs +4 -4
- package/menu-item/index.js +4 -4
- package/nav/index.cjs +1 -1
- package/nav/index.js +1 -1
- package/nav-disclosure/index.cjs +2 -2
- package/nav-disclosure/index.js +2 -2
- package/nav-item/index.cjs +2 -2
- package/nav-item/index.js +2 -2
- package/note/index.cjs +2 -2
- package/note/index.js +2 -2
- package/number-field/index.cjs +5 -6
- package/number-field/index.js +5 -6
- package/option/index.cjs +2 -2
- package/option/index.js +2 -2
- package/package.json +34 -34
- package/pagination/index.cjs +3 -3
- package/pagination/index.js +3 -3
- package/popup/index.cjs +4 -4
- package/popup/index.js +4 -4
- 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 +22 -0
- package/range-slider/index.js +20 -0
- package/select/index.cjs +7 -6
- package/select/index.js +7 -6
- package/selectable-box/index.cjs +5 -4
- package/selectable-box/index.js +5 -4
- package/shared/Reflector.cjs +5 -1
- package/shared/Reflector.js +5 -1
- package/shared/affix.cjs +11 -4
- package/shared/affix.js +12 -4
- package/shared/anchored.cjs +8 -2
- package/shared/anchored.js +8 -2
- package/shared/applyMixinsWithObservables.cjs +15 -0
- package/shared/applyMixinsWithObservables.js +13 -0
- package/shared/definition.cjs +9 -4
- package/shared/definition.js +9 -4
- package/shared/definition10.cjs +5 -5
- package/shared/definition10.js +5 -5
- package/shared/definition11.cjs +77 -49
- package/shared/definition11.js +78 -50
- package/shared/definition12.cjs +12 -14
- package/shared/definition12.js +12 -14
- package/shared/definition13.cjs +118 -75
- package/shared/definition13.js +118 -75
- package/shared/definition14.cjs +34 -33
- package/shared/definition14.js +34 -33
- package/shared/definition15.cjs +24 -12
- package/shared/definition15.js +24 -12
- package/shared/definition16.cjs +38 -43
- package/shared/definition16.js +38 -43
- package/shared/definition17.cjs +126 -66
- package/shared/definition17.js +127 -67
- package/shared/definition18.cjs +31 -15
- package/shared/definition18.js +31 -15
- package/shared/definition19.cjs +117 -81
- package/shared/definition19.js +117 -81
- package/shared/definition2.cjs +10 -5
- package/shared/definition2.js +10 -5
- package/shared/definition20.cjs +187 -227
- package/shared/definition20.js +183 -223
- package/shared/definition21.cjs +262 -69
- package/shared/definition21.js +261 -67
- package/shared/definition22.cjs +66 -61
- package/shared/definition22.js +64 -60
- package/shared/definition23.cjs +42 -77
- package/shared/definition23.js +41 -76
- package/shared/definition24.cjs +65 -2350
- package/shared/definition24.js +64 -2349
- package/shared/definition25.cjs +2402 -48
- package/shared/definition25.js +2401 -47
- package/shared/definition26.cjs +62 -28
- package/shared/definition26.js +61 -27
- package/shared/definition27.cjs +28 -54
- package/shared/definition27.js +27 -53
- package/shared/definition28.cjs +39 -819
- package/shared/definition28.js +38 -817
- package/shared/definition29.cjs +893 -54
- package/shared/definition29.js +893 -55
- package/shared/definition3.cjs +7 -10
- package/shared/definition3.js +7 -10
- package/shared/definition30.cjs +69 -85
- package/shared/definition30.js +68 -84
- package/shared/definition31.cjs +86 -23
- package/shared/definition31.js +86 -23
- package/shared/definition32.cjs +24 -14
- package/shared/definition32.js +23 -13
- package/shared/definition33.cjs +11 -53
- package/shared/definition33.js +10 -52
- package/shared/definition34.cjs +28 -500
- package/shared/definition34.js +28 -500
- package/shared/definition35.cjs +447 -194
- package/shared/definition35.js +447 -192
- package/shared/definition36.cjs +258 -188
- package/shared/definition36.js +255 -187
- package/shared/definition37.cjs +204 -78
- package/shared/definition37.js +203 -76
- package/shared/definition38.cjs +55 -51
- package/shared/definition38.js +52 -49
- package/shared/definition39.cjs +65 -423
- package/shared/definition39.js +64 -422
- package/shared/definition4.cjs +24 -12
- package/shared/definition4.js +24 -12
- package/shared/definition40.cjs +447 -35
- package/shared/definition40.js +444 -32
- package/shared/definition41.cjs +35 -678
- package/shared/definition41.js +34 -677
- package/shared/definition42.cjs +544 -99
- package/shared/definition42.js +543 -98
- package/shared/definition43.cjs +696 -77
- package/shared/definition43.js +695 -76
- package/shared/definition44.cjs +113 -563
- package/shared/definition44.js +112 -561
- package/shared/definition45.cjs +77 -117
- package/shared/definition45.js +75 -115
- package/shared/definition46.cjs +474 -86
- package/shared/definition46.js +474 -87
- package/shared/definition47.cjs +140 -23
- package/shared/definition47.js +139 -22
- package/shared/definition48.cjs +132 -57
- package/shared/definition48.js +131 -56
- package/shared/definition49.cjs +18 -524
- package/shared/definition49.js +17 -523
- package/shared/definition5.cjs +20 -17
- package/shared/definition5.js +20 -17
- package/shared/definition50.cjs +73 -25
- package/shared/definition50.js +72 -24
- package/shared/definition51.cjs +506 -99
- package/shared/definition51.js +505 -99
- package/shared/definition52.cjs +29 -277
- package/shared/definition52.js +28 -276
- package/shared/definition53.cjs +97 -256
- package/shared/definition53.js +97 -255
- package/shared/definition54.cjs +287 -769
- package/shared/definition54.js +287 -769
- package/shared/definition55.cjs +305 -105
- package/shared/definition55.js +304 -104
- package/shared/definition56.cjs +841 -81
- package/shared/definition56.js +840 -80
- package/shared/definition57.cjs +153 -69
- package/shared/definition57.js +152 -68
- package/shared/definition58.cjs +138 -299
- package/shared/definition58.js +137 -298
- package/shared/definition59.cjs +72 -27
- package/shared/definition59.js +71 -26
- package/shared/definition6.cjs +4 -5
- package/shared/definition6.js +4 -5
- package/shared/definition60.cjs +279 -1780
- package/shared/definition60.js +278 -1779
- package/shared/definition61.cjs +65870 -11
- package/shared/definition61.js +65869 -11
- package/shared/definition62.cjs +50 -0
- package/shared/definition62.js +46 -0
- package/shared/definition63.cjs +1828 -0
- package/shared/definition63.js +1824 -0
- package/shared/definition7.cjs +8 -6
- package/shared/definition7.js +8 -6
- package/shared/definition8.cjs +27 -20
- package/shared/definition8.js +27 -20
- package/shared/definition9.cjs +7 -10
- package/shared/definition9.js +7 -10
- package/shared/enums.cjs +8 -0
- package/shared/enums.js +8 -1
- package/shared/icon.cjs +7 -2
- package/shared/icon.js +7 -2
- package/shared/index2.cjs +67 -38
- package/shared/index2.js +67 -38
- package/shared/key-codes2.cjs +8 -0
- package/shared/key-codes2.js +5 -1
- package/shared/listbox.cjs +1 -1
- package/shared/listbox.js +1 -1
- package/shared/localization/Locale.d.ts +6 -0
- package/shared/patterns/form-elements/form-elements.d.ts +2 -3
- package/shared/patterns/index.d.ts +0 -1
- package/shared/presentationDate.cjs +140 -81
- package/shared/presentationDate.js +140 -81
- package/shared/slider.template.cjs +71 -0
- package/shared/slider.template.js +67 -0
- package/shared/text-anchor.cjs +6 -0
- package/shared/text-anchor.js +6 -0
- package/shared/text-anchor.template.cjs +33 -33
- package/shared/text-anchor.template.js +33 -33
- package/shared/text-field.cjs +1 -1
- package/shared/text-field.js +1 -1
- package/shared/utils/applyMixinsWithObservables.d.ts +1 -0
- package/side-drawer/index.cjs +1 -1
- package/side-drawer/index.js +1 -1
- package/slider/index.cjs +2 -1
- package/slider/index.js +2 -1
- package/split-button/index.cjs +2 -2
- package/split-button/index.js +2 -2
- package/style.css +1 -0
- package/styles/core/all.css +1 -1
- package/styles/core/theme.css +1 -1
- package/styles/core/typography.css +1 -1
- package/styles/fonts/spezia-variable.css +39 -13
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/styles/tokens/vivid-2-compat.css +4 -2
- package/switch/index.cjs +2 -2
- package/switch/index.js +2 -2
- package/tab/index.cjs +2 -2
- package/tab/index.js +2 -2
- package/tab-panel/index.cjs +1 -1
- package/tab-panel/index.js +1 -1
- package/tabs/index.cjs +4 -4
- package/tabs/index.js +4 -4
- package/tag/index.cjs +2 -2
- package/tag/index.js +2 -2
- package/tag-group/index.cjs +1 -1
- package/tag-group/index.js +1 -1
- package/text-area/index.cjs +4 -3
- package/text-area/index.js +4 -3
- package/text-field/index.cjs +4 -6
- package/text-field/index.js +4 -6
- package/time-picker/index.cjs +8 -10
- package/time-picker/index.js +8 -10
- package/toggletip/index.cjs +5 -5
- package/toggletip/index.js +5 -5
- package/tooltip/index.cjs +5 -5
- package/tooltip/index.js +5 -5
- package/tree-item/index.cjs +2 -2
- package/tree-item/index.js +2 -2
- package/tree-view/index.cjs +1 -1
- package/tree-view/index.js +1 -1
- package/video-player/index.cjs +17 -0
- package/video-player/index.js +15 -0
- package/vivid.api.json +428 -1
- package/focus/index.cjs +0 -7
- package/focus/index.js +0 -5
- package/lib/focus/definition.d.ts +0 -3
- package/lib/focus/focus.d.ts +0 -3
- package/lib/focus/focus.template.d.ts +0 -4
- package/lib/popup/popup.d.ts +0 -21
- package/shared/focus.cjs +0 -8
- package/shared/focus.js +0 -6
- package/shared/focus2.cjs +0 -11
- package/shared/focus2.js +0 -9
- package/shared/patterns/focus.d.ts +0 -3
package/shared/index2.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { I as Icon } from './icon.js';
|
|
2
2
|
import { a as attr, o as observable, h as html } from './index.js';
|
|
3
|
+
import { s as slotted } from './slotted.js';
|
|
4
|
+
import { c as classNames } from './class-names.js';
|
|
3
5
|
import { w as when } from './when.js';
|
|
4
6
|
import enUS from '../locales/en-US.js';
|
|
5
7
|
|
|
6
|
-
const messageStyles = ".message{display:
|
|
8
|
+
const messageStyles = ".message{display:none;contain:inline-size;font:var(--vvd-typography-base-condensed);gap:4px;grid-column:1/-1}.message--visible{display:flex}.message-text{color:var(--vvd-color-canvas-text)}.helper-message .message-text{color:var(--_low-ink-color)}.message-icon{font-size:16px}.success-message .message-icon{color:var(--vvd-color-success-500)}.error-message .message-icon{color:var(--vvd-color-alert-500)}\n";
|
|
7
9
|
|
|
8
10
|
var __defProp$1 = Object.defineProperty;
|
|
9
11
|
var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
|
|
@@ -21,6 +23,9 @@ class FormElementHelperText {
|
|
|
21
23
|
__decorateClass$1([
|
|
22
24
|
attr({ attribute: "helper-text" })
|
|
23
25
|
], FormElementHelperText.prototype, "helperText", 2);
|
|
26
|
+
__decorateClass$1([
|
|
27
|
+
observable
|
|
28
|
+
], FormElementHelperText.prototype, "_helperTextSlottedContent", 2);
|
|
24
29
|
class FormElementSuccessText {
|
|
25
30
|
}
|
|
26
31
|
__decorateClass$1([
|
|
@@ -43,7 +48,7 @@ function formElements(constructor) {
|
|
|
43
48
|
const parentPrototype = Object.getPrototypeOf(currentPrototype);
|
|
44
49
|
if (currentPrototype.validate && !parentPrototype.validate) {
|
|
45
50
|
currentPrototype.validate = function(anchor) {
|
|
46
|
-
if (this.proxy instanceof HTMLElement) {
|
|
51
|
+
if (this.proxy instanceof HTMLElement && this.elementInternals) {
|
|
47
52
|
const isValid = this.proxy.validity.valid;
|
|
48
53
|
const controlIsInvalidDueToMinOrMaxLength = this.control && this.control.validity && !this.control.validity.valid && (this.control.validity.tooShort || this.control.validity.tooLong);
|
|
49
54
|
if (isValid && controlIsInvalidDueToMinOrMaxLength) {
|
|
@@ -117,48 +122,72 @@ function formElements(constructor) {
|
|
|
117
122
|
], Decorated.prototype, "errorValidationMessage", 2);
|
|
118
123
|
return Decorated;
|
|
119
124
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
error: {
|
|
128
|
-
messageProperty: "errorValidationMessage",
|
|
129
|
-
className: "error",
|
|
130
|
-
iconType: "info-line"
|
|
131
|
-
},
|
|
132
|
-
success: {
|
|
133
|
-
messageProperty: "successText",
|
|
134
|
-
className: "success",
|
|
135
|
-
iconType: "check-circle-line"
|
|
125
|
+
const feedback = {
|
|
126
|
+
helper: {
|
|
127
|
+
messageProperty: "helperText",
|
|
128
|
+
className: "helper",
|
|
129
|
+
slot: {
|
|
130
|
+
name: "helper-text",
|
|
131
|
+
slottedContentProperty: "_helperTextSlottedContent"
|
|
136
132
|
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
133
|
+
},
|
|
134
|
+
error: {
|
|
135
|
+
messageProperty: "errorValidationMessage",
|
|
136
|
+
className: "error",
|
|
137
|
+
iconType: "info-line"
|
|
138
|
+
},
|
|
139
|
+
success: {
|
|
140
|
+
messageProperty: "successText",
|
|
141
|
+
className: "success",
|
|
142
|
+
iconType: "check-circle-line"
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
const isFeedbackAvailable = (config, x) => Boolean(
|
|
146
|
+
x[config.messageProperty] || config.slot && x[config.slot.slottedContentProperty]?.length
|
|
147
|
+
);
|
|
148
|
+
function getFeedbackTemplate(context) {
|
|
149
|
+
return html`
|
|
150
|
+
<style>
|
|
142
151
|
${messageStyles}
|
|
143
152
|
</style>
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
153
|
+
${getFeedbackTypeTemplate(
|
|
154
|
+
context,
|
|
155
|
+
feedback.helper,
|
|
156
|
+
(x) => isFeedbackAvailable(feedback.helper, x) && !isFeedbackAvailable(feedback.error, x) && !isFeedbackAvailable(feedback.success, x)
|
|
157
|
+
)}
|
|
158
|
+
${getFeedbackTypeTemplate(
|
|
159
|
+
context,
|
|
160
|
+
feedback.error,
|
|
161
|
+
(x) => isFeedbackAvailable(feedback.error, x) && !isFeedbackAvailable(feedback.success, x)
|
|
162
|
+
)}
|
|
163
|
+
${getFeedbackTypeTemplate(
|
|
164
|
+
context,
|
|
165
|
+
feedback.success,
|
|
166
|
+
(x) => isFeedbackAvailable(feedback.success, x)
|
|
149
167
|
)}
|
|
150
|
-
${feedbackMessage({
|
|
151
|
-
messageProperty: MessageTypeMap[messageType].messageProperty
|
|
152
|
-
})}
|
|
153
|
-
</div>`;
|
|
154
|
-
}
|
|
155
|
-
function feedbackMessage({
|
|
156
|
-
messageProperty
|
|
157
|
-
}) {
|
|
158
|
-
return html`
|
|
159
|
-
<span class="message-text">${(x) => x[messageProperty]}</span>
|
|
160
168
|
`;
|
|
161
169
|
}
|
|
170
|
+
function getFeedbackTypeTemplate(context, config, shouldShow) {
|
|
171
|
+
const iconTag = context.tagFor(Icon);
|
|
172
|
+
const messageTemplate = html`${(x) => x[config.messageProperty]}`;
|
|
173
|
+
const innerTemplate = config.slot ? html`<slot
|
|
174
|
+
name="${config.slot.name}"
|
|
175
|
+
${slotted(config.slot.slottedContentProperty)}
|
|
176
|
+
>${messageTemplate}</slot
|
|
177
|
+
>` : messageTemplate;
|
|
178
|
+
return html`<div
|
|
179
|
+
class="${(x) => classNames("message", `${config.className}-message`, [
|
|
180
|
+
"message--visible",
|
|
181
|
+
shouldShow(x)
|
|
182
|
+
])}"
|
|
183
|
+
>
|
|
184
|
+
${when(
|
|
185
|
+
(x) => shouldShow(x) && config.iconType,
|
|
186
|
+
html`<${iconTag} class="message-icon" name="${config.iconType}"></${iconTag}>`
|
|
187
|
+
)}
|
|
188
|
+
<span class="message-text">${innerTemplate}</span>
|
|
189
|
+
</div>`;
|
|
190
|
+
}
|
|
162
191
|
function errorText(constructor) {
|
|
163
192
|
class Decorated extends constructor {
|
|
164
193
|
constructor(...args) {
|
package/shared/key-codes2.cjs
CHANGED
|
@@ -3,12 +3,20 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* String values for use with KeyboardEvent.key
|
|
5
5
|
*/
|
|
6
|
+
const keyArrowDown = "ArrowDown";
|
|
6
7
|
const keyArrowLeft = "ArrowLeft";
|
|
7
8
|
const keyArrowRight = "ArrowRight";
|
|
9
|
+
const keyArrowUp = "ArrowUp";
|
|
10
|
+
const keyEnd = "End";
|
|
8
11
|
const keyEnter = "Enter";
|
|
12
|
+
const keyHome = "Home";
|
|
9
13
|
const keySpace = " ";
|
|
10
14
|
|
|
15
|
+
exports.keyArrowDown = keyArrowDown;
|
|
11
16
|
exports.keyArrowLeft = keyArrowLeft;
|
|
12
17
|
exports.keyArrowRight = keyArrowRight;
|
|
18
|
+
exports.keyArrowUp = keyArrowUp;
|
|
19
|
+
exports.keyEnd = keyEnd;
|
|
13
20
|
exports.keyEnter = keyEnter;
|
|
21
|
+
exports.keyHome = keyHome;
|
|
14
22
|
exports.keySpace = keySpace;
|
package/shared/key-codes2.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* String values for use with KeyboardEvent.key
|
|
3
3
|
*/
|
|
4
|
+
const keyArrowDown = "ArrowDown";
|
|
4
5
|
const keyArrowLeft = "ArrowLeft";
|
|
5
6
|
const keyArrowRight = "ArrowRight";
|
|
7
|
+
const keyArrowUp = "ArrowUp";
|
|
8
|
+
const keyEnd = "End";
|
|
6
9
|
const keyEnter = "Enter";
|
|
10
|
+
const keyHome = "Home";
|
|
7
11
|
const keySpace = " ";
|
|
8
12
|
|
|
9
|
-
export { keyArrowRight as a, keyEnter as b,
|
|
13
|
+
export { keyArrowRight as a, keyEnter as b, keyHome as c, keyEnd as d, keyArrowUp as e, keyArrowDown as f, keySpace as g, keyArrowLeft as k };
|
package/shared/listbox.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const keyCodes$1 = require('./key-codes2.cjs');
|
|
4
4
|
const index = require('./index.cjs');
|
|
5
|
-
const definition = require('./
|
|
5
|
+
const definition = require('./definition36.cjs');
|
|
6
6
|
const ariaGlobal = require('./aria-global.cjs');
|
|
7
7
|
const applyMixins = require('./apply-mixins.cjs');
|
|
8
8
|
const keyCodes = require('./key-codes.cjs');
|
package/shared/listbox.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { k as keyArrowLeft, a as keyArrowRight } from './key-codes2.js';
|
|
2
2
|
import { F as FoundationElement, O as Observable, _ as __decorate, a as attr, o as observable, D as DOM, n as nullableNumberConverter } from './index.js';
|
|
3
|
-
import { i as isListboxOption } from './
|
|
3
|
+
import { i as isListboxOption } from './definition36.js';
|
|
4
4
|
import { A as ARIAGlobalStatesAndProperties } from './aria-global.js';
|
|
5
5
|
import { a as applyMixins } from './apply-mixins.js';
|
|
6
6
|
import { a as keySpace, b as keyEscape, k as keyEnter, c as keyTab, d as keyEnd, e as keyArrowUp, f as keyArrowDown, g as keyHome } from './key-codes.js';
|
|
@@ -6,7 +6,10 @@ import type { DialogLocale } from '../../lib/dialog/locale';
|
|
|
6
6
|
import type { BannerLocale } from '../../lib/banner/locale';
|
|
7
7
|
import type { NumberFieldLocale } from '../../lib/number-field/locale';
|
|
8
8
|
import type { SplitButtonLocale } from '../../lib/split-button/locale';
|
|
9
|
+
import type { VideoPlayerLocale } from '../../lib/video-player/locale';
|
|
9
10
|
import type { TimePickerLocale } from '../../lib/time-picker/locale';
|
|
11
|
+
import type { RangeSliderLocale } from '../../lib/range-slider/locale';
|
|
12
|
+
import type { DialPadLocale } from '../../lib/dial-pad/locale';
|
|
10
13
|
export interface Locale {
|
|
11
14
|
datePicker: DatePickerLocale;
|
|
12
15
|
timePicker: TimePickerLocale;
|
|
@@ -17,4 +20,7 @@ export interface Locale {
|
|
|
17
20
|
banner: BannerLocale;
|
|
18
21
|
numberField: NumberFieldLocale;
|
|
19
22
|
splitButton: SplitButtonLocale;
|
|
23
|
+
videoPlayer: VideoPlayerLocale;
|
|
24
|
+
rangeSlider: RangeSliderLocale;
|
|
25
|
+
dialPad: DialPadLocale;
|
|
20
26
|
}
|
|
@@ -7,6 +7,7 @@ export interface FormElement {
|
|
|
7
7
|
}
|
|
8
8
|
export interface FormElementHelperText {
|
|
9
9
|
helperText?: string;
|
|
10
|
+
_helperTextSlottedContent?: HTMLElement[];
|
|
10
11
|
}
|
|
11
12
|
export interface FormElementSuccessText {
|
|
12
13
|
successText?: string;
|
|
@@ -42,8 +43,7 @@ export declare function formElements<T extends {
|
|
|
42
43
|
validate: () => void;
|
|
43
44
|
};
|
|
44
45
|
} & T;
|
|
45
|
-
|
|
46
|
-
export declare function getFeedbackTemplate(messageType: FeedbackType, context: ElementDefinitionContext): import("@microsoft/fast-element").ViewTemplate<FormElement, any>;
|
|
46
|
+
export declare function getFeedbackTemplate(context: ElementDefinitionContext): import("@microsoft/fast-element").ViewTemplate<Partial<FormElement & FormElementHelperText & FormElementSuccessText & ErrorText>, any>;
|
|
47
47
|
export declare function errorText<T extends {
|
|
48
48
|
new (...args: any[]): Record<string, any>;
|
|
49
49
|
}>(constructor: T): {
|
|
@@ -56,4 +56,3 @@ export declare function errorText<T extends {
|
|
|
56
56
|
"__#2@#clearCustomErrorAndRevalidate"(): void;
|
|
57
57
|
};
|
|
58
58
|
} & T;
|
|
59
|
-
export {};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const definition$2 = require('./definition11.cjs');
|
|
4
|
-
const definition = require('./
|
|
5
|
-
const definition$1 = require('./
|
|
6
|
-
const definition$3 = require('./
|
|
4
|
+
const definition = require('./definition63.cjs');
|
|
5
|
+
const definition$1 = require('./definition55.cjs');
|
|
6
|
+
const definition$3 = require('./definition22.cjs');
|
|
7
7
|
const index = require('./index.cjs');
|
|
8
8
|
const ref = require('./ref.cjs');
|
|
9
|
+
const slotted = require('./slotted.cjs');
|
|
9
10
|
const repeat = require('./repeat.cjs');
|
|
10
11
|
const when = require('./when.cjs');
|
|
11
12
|
const classNames = require('./class-names.cjs');
|
|
@@ -13,10 +14,10 @@ require('./affix.cjs');
|
|
|
13
14
|
const index$1 = require('./index2.cjs');
|
|
14
15
|
const localized = require('./localized.cjs');
|
|
15
16
|
const trappedFocus = require('./trapped-focus.cjs');
|
|
17
|
+
const applyMixinsWithObservables = require('./applyMixinsWithObservables.cjs');
|
|
16
18
|
const formAssociated = require('./form-associated.cjs');
|
|
17
|
-
const applyMixins = require('./apply-mixins.cjs');
|
|
18
19
|
|
|
19
|
-
const styles = ":host{display:inline-block}.base{display:inline-block;inline-size:100%}.control{inline-size:100%}.dialog{display:inline-flex;flex-direction:column;padding:12px;gap:12px}.dialog .footer{display:flex;align-items:center;justify-content:flex-end;padding:8px;gap:8px}.segments{display:flex;gap:24px}.segment{display:flex;flex-direction:column;gap:12px}.segment .header{display:flex;align-items:center;padding-block:8px}.segment .title{display:flex;flex-grow:1;justify-content:center}.segment .title-action{block-size:24px;
|
|
20
|
+
const styles = ":host{display:inline-block}.base{display:inline-block;inline-size:100%}.control{inline-size:100%}.dialog{display:inline-flex;flex-direction:column;padding:12px;gap:12px}.dialog .footer{display:flex;align-items:center;justify-content:flex-end;padding:8px;gap:8px}.segments{display:flex;gap:24px}.segment{display:flex;flex-direction:column;gap:12px}.segment .header{display:flex;align-items:center;padding-block:8px}.segment .title{display:flex;flex-grow:1;justify-content:center}.segment .title-action{border-radius:8px;block-size:24px;font:var(--vvd-typography-base-extended);padding-inline:6px}.calendar{display:flex;flex-direction:column;margin-top:8px;gap:4px}.calendar .calendar-separator{margin-inline:10px}.calendar .calendar-weekdays{display:flex;justify-content:center}.calendar .calendar-weekday{display:inline-flex;align-items:center;justify-content:center;block-size:16px;font:var(--vvd-typography-base-condensed);inline-size:40px}.calendar .calendar-week{display:flex;justify-content:center}.calendar .calendar-day{display:inline-flex;align-items:center;justify-content:center;border-radius:50%;aspect-ratio:1/1;block-size:28px;font:var(--vvd-typography-base);margin-inline:6px;--focus-inset: -2px}.calendar .calendar-day.start,.calendar .calendar-day.end{border:2px solid var(--vvd-color-cta-50);background-color:var(--vvd-color-cta-200)}.calendar .calendar-day:before,.calendar .calendar-day:after{position:absolute;z-index:-1;display:block;width:20px;height:28px}.calendar .calendar-day:before{right:50%}.calendar .calendar-day:after{left:50%}.calendar .calendar-day.range:before,.calendar .calendar-day.range:after{background-color:var(--vvd-color-cta-50)}.calendar .calendar-day.range:not(.start):before,.calendar .calendar-day.range:not(.end):after{content:\"\"}.calendar .calendar-day.outside-month,.calendar .calendar-day:disabled{color:var(--vvd-color-neutral-400)}.months-separator{margin-inline:-12px}.month-grid{display:flex;flex-direction:column;gap:34px}.month-grid .months-row{display:flex;justify-content:center;gap:29px}.month-grid .month{display:inline-flex;align-items:center;justify-content:center;border-radius:50%;aspect-ratio:1/1;block-size:48px;font:var(--vvd-typography-base-extended);text-transform:uppercase}.month-grid .month:disabled{color:var(--vvd-color-neutral-400)}.button{position:relative;padding:0;border:none;background-color:var(--_appearance-color-fill);color:var(--_appearance-color-text);cursor:pointer}.button{--_connotation-color-primary: var(--vvd-date-picker-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-firm: var(--vvd-date-picker-accent-firm, var(--vvd-color-canvas-text));--_connotation-color-faint: var(--vvd-date-picker-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-soft: var(--vvd-date-picker-accent-soft, var(--vvd-color-neutral-100));--_connotation-color-dim: var(--vvd-date-picker-accent-dim, var(--vvd-color-neutral-200));--_connotation-color-pale: var(--vvd-date-picker-accent-pale, var(--vvd-color-neutral-300))}.button{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.button:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}.button:where(.active,:active):where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.button:where(.selected):where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.button:where(.selected):where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-dim);--_appearance-color-outline: transparent}.button:where(.selected):where(.disabled,:disabled){--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-200);--_appearance-color-outline: transparent}.button:focus-visible{--focus-stroke-gap-color: transparent;box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px));color:var(--vvd-color-canvas-text)}.button.current{border:1px solid var(--vvd-color-neutral-200)}.button:disabled{cursor:not-allowed}\n";
|
|
20
21
|
|
|
21
22
|
function _typeof(obj) {
|
|
22
23
|
"@babel/helpers - typeof";
|
|
@@ -5279,26 +5280,32 @@ function renderDialogHeader(context) {
|
|
|
5279
5280
|
`
|
|
5280
5281
|
)}
|
|
5281
5282
|
<div class="title">
|
|
5282
|
-
${when.when(
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
|
|
5286
|
-
|
|
5287
|
-
|
|
5288
|
-
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
|
|
5292
|
-
|
|
5293
|
-
|
|
5294
|
-
|
|
5295
|
-
|
|
5296
|
-
|
|
5297
|
-
|
|
5298
|
-
|
|
5299
|
-
|
|
5300
|
-
|
|
5301
|
-
|
|
5283
|
+
${when.when(
|
|
5284
|
+
(x) => x.titleClickable,
|
|
5285
|
+
index.html`
|
|
5286
|
+
<button
|
|
5287
|
+
tabindex="1"
|
|
5288
|
+
id="${(x) => `grid-label-${x.id}`}"
|
|
5289
|
+
class="title-action button"
|
|
5290
|
+
aria-live="polite"
|
|
5291
|
+
@click="${(_, c) => c.parent._onTitleActionClick()}"
|
|
5292
|
+
>
|
|
5293
|
+
${(x) => x.title}
|
|
5294
|
+
</button>
|
|
5295
|
+
`
|
|
5296
|
+
)}
|
|
5297
|
+
${when.when(
|
|
5298
|
+
(x) => !x.titleClickable,
|
|
5299
|
+
index.html`
|
|
5300
|
+
<div
|
|
5301
|
+
id="${(x) => `grid-label-${x.id}`}"
|
|
5302
|
+
class="title-action"
|
|
5303
|
+
aria-live="polite"
|
|
5304
|
+
>
|
|
5305
|
+
${(x) => x.title}
|
|
5306
|
+
</div>
|
|
5307
|
+
`
|
|
5308
|
+
)}
|
|
5302
5309
|
</div>
|
|
5303
5310
|
|
|
5304
5311
|
${when.when(
|
|
@@ -5355,9 +5362,8 @@ function renderCalendarGrid(context) {
|
|
|
5355
5362
|
<${dividerTag} class="calendar-separator" role="presentation"></${dividerTag}>
|
|
5356
5363
|
${repeat.repeat(
|
|
5357
5364
|
(x) => x.calendar.grid,
|
|
5358
|
-
index.html`
|
|
5359
|
-
|
|
5360
|
-
${repeat.repeat(
|
|
5365
|
+
index.html` <div class="calendar-week" role="row">
|
|
5366
|
+
${repeat.repeat(
|
|
5361
5367
|
(x) => x,
|
|
5362
5368
|
index.html`
|
|
5363
5369
|
${when.when(
|
|
@@ -5366,40 +5372,60 @@ function renderCalendarGrid(context) {
|
|
|
5366
5372
|
)}
|
|
5367
5373
|
${when.when(
|
|
5368
5374
|
(x, c) => !c.parentContext.parentContext.parent._hideDatesOutsideMonth || !x.isOutsideMonth,
|
|
5369
|
-
index.html`
|
|
5370
|
-
|
|
5371
|
-
|
|
5372
|
-
class="${(x, c) => classNames.classNames(
|
|
5375
|
+
index.html` <span role="gridcell">
|
|
5376
|
+
<button
|
|
5377
|
+
class="${(x, c) => classNames.classNames(
|
|
5373
5378
|
"calendar-day",
|
|
5374
5379
|
"button",
|
|
5375
|
-
[
|
|
5376
|
-
|
|
5377
|
-
|
|
5378
|
-
|
|
5379
|
-
[
|
|
5380
|
+
[
|
|
5381
|
+
"current",
|
|
5382
|
+
x.date === c.parentContext.parentContext.parent._currentDate
|
|
5383
|
+
],
|
|
5384
|
+
[
|
|
5385
|
+
"selected",
|
|
5386
|
+
c.parentContext.parentContext.parent._isDateSelected(x.date)
|
|
5387
|
+
],
|
|
5388
|
+
[
|
|
5389
|
+
"range",
|
|
5390
|
+
c.parentContext.parentContext.parent._isDateInSelectedRange(
|
|
5391
|
+
x.date
|
|
5392
|
+
)
|
|
5393
|
+
],
|
|
5394
|
+
[
|
|
5395
|
+
"start",
|
|
5396
|
+
c.parentContext.parentContext.parent._isDateRangeStart(
|
|
5397
|
+
x.date
|
|
5398
|
+
)
|
|
5399
|
+
],
|
|
5400
|
+
[
|
|
5401
|
+
"end",
|
|
5402
|
+
c.parentContext.parentContext.parent._isDateRangeEnd(x.date)
|
|
5403
|
+
],
|
|
5380
5404
|
["outside-month", x.isOutsideMonth]
|
|
5381
5405
|
)}"
|
|
5382
|
-
|
|
5383
|
-
|
|
5384
|
-
|
|
5385
|
-
|
|
5386
|
-
|
|
5387
|
-
|
|
5388
|
-
|
|
5389
|
-
|
|
5390
|
-
|
|
5406
|
+
?disabled="${(x, c) => !c.parentContext.parentContext.parent._isDateInValidRange(
|
|
5407
|
+
x.date
|
|
5408
|
+
)}"
|
|
5409
|
+
tabindex="${(x, c) => x.date === c.parentContext.parentContext.parent._tabbableDate ? 2 : -1}"
|
|
5410
|
+
aria-selected="${(x, c) => c.parentContext.parentContext.parent._isDateAriaSelected(x.date)}"
|
|
5411
|
+
data-date="${(x) => x.date}"
|
|
5412
|
+
@click="${(x, c) => c.parentContext.parentContext.parent._onDateClick(x.date)}"
|
|
5413
|
+
@focus="${(x, c) => c.parentContext.parentContext.parent._onDateFocus(x.date)}"
|
|
5414
|
+
@mouseenter="${(x, c) => c.parentContext.parentContext.parent._onDateMouseEnter(x.date)}"
|
|
5415
|
+
@mouseleave="${(x, c) => c.parentContext.parentContext.parent._onDateMouseLeave(x.date)}"
|
|
5416
|
+
@keydown="${(x, c) => c.parentContext.parentContext.parent._onDateKeydown(
|
|
5391
5417
|
x.date,
|
|
5392
5418
|
c.event
|
|
5393
5419
|
)}"
|
|
5394
|
-
|
|
5395
|
-
|
|
5396
|
-
|
|
5397
|
-
|
|
5420
|
+
>
|
|
5421
|
+
${(x) => x.label}
|
|
5422
|
+
</button>
|
|
5423
|
+
</span>`
|
|
5398
5424
|
)}
|
|
5399
5425
|
</div>
|
|
5400
5426
|
`
|
|
5401
5427
|
)}
|
|
5402
|
-
|
|
5428
|
+
</div>`
|
|
5403
5429
|
)}`;
|
|
5404
5430
|
}
|
|
5405
5431
|
function renderMonthPickerGrid(context) {
|
|
@@ -5421,9 +5447,9 @@ function renderMonthPickerGrid(context) {
|
|
|
5421
5447
|
${repeat.repeat(
|
|
5422
5448
|
(x) => x,
|
|
5423
5449
|
index.html`
|
|
5424
|
-
|
|
5425
|
-
|
|
5426
|
-
|
|
5450
|
+
<span role="gridcell">
|
|
5451
|
+
<button
|
|
5452
|
+
class="${(x, c) => classNames.classNames(
|
|
5427
5453
|
"month",
|
|
5428
5454
|
"button",
|
|
5429
5455
|
[
|
|
@@ -5441,24 +5467,33 @@ function renderMonthPickerGrid(context) {
|
|
|
5441
5467
|
)
|
|
5442
5468
|
]
|
|
5443
5469
|
)}"
|
|
5444
|
-
|
|
5445
|
-
|
|
5446
|
-
|
|
5470
|
+
tabindex="${(x, c) => c.parentContext.parentContext.parent._tabbableMonth && areMonthsEqual(
|
|
5471
|
+
x.month,
|
|
5472
|
+
c.parentContext.parentContext.parent._tabbableMonth
|
|
5473
|
+
) ? 2 : -1}"
|
|
5474
|
+
aria-label="${(x) => x.monthName}"
|
|
5475
|
+
aria-selected="${(x, c) => areMonthsEqual(
|
|
5447
5476
|
x.month,
|
|
5448
5477
|
c.parentContext.parentContext.parent._selectedMonth
|
|
5449
5478
|
)}"
|
|
5450
|
-
|
|
5451
|
-
|
|
5452
|
-
|
|
5453
|
-
|
|
5454
|
-
|
|
5479
|
+
data-month="${(x) => monthToStr(x.month)}"
|
|
5480
|
+
?disabled="${(x, c) => !c.parentContext.parentContext.parent._isMonthInValidRange(
|
|
5481
|
+
x.month
|
|
5482
|
+
)}"
|
|
5483
|
+
@click="${(x, c) => c.parentContext.parentContext.parent._onMonthClick(
|
|
5484
|
+
x.month
|
|
5485
|
+
)}"
|
|
5486
|
+
@focus="${(x, c) => c.parentContext.parentContext.parent._onMonthFocus(
|
|
5487
|
+
x.month
|
|
5488
|
+
)}"
|
|
5489
|
+
@keydown="${(x, c) => c.parentContext.parentContext.parent._onMonthKeydown(
|
|
5455
5490
|
x.month,
|
|
5456
5491
|
c.event
|
|
5457
5492
|
)}"
|
|
5458
|
-
|
|
5459
|
-
|
|
5460
|
-
|
|
5461
|
-
|
|
5493
|
+
>
|
|
5494
|
+
${(x) => x.label}
|
|
5495
|
+
</button>
|
|
5496
|
+
</span>
|
|
5462
5497
|
`
|
|
5463
5498
|
)}
|
|
5464
5499
|
</div>
|
|
@@ -5485,6 +5520,11 @@ const DatePickerBaseTemplate = (context, _) => {
|
|
|
5485
5520
|
@input="${(x, c) => x._onTextFieldInput(c.event)}"
|
|
5486
5521
|
@change="${(x) => x._onTextFieldChange()}"
|
|
5487
5522
|
>
|
|
5523
|
+
<slot
|
|
5524
|
+
slot="${(x) => x._helperTextSlottedContent?.length ? "helper-text" : void 0}"
|
|
5525
|
+
name="helper-text"
|
|
5526
|
+
${slotted.slotted("_helperTextSlottedContent")}
|
|
5527
|
+
></slot>
|
|
5488
5528
|
<${buttonTag}
|
|
5489
5529
|
id="calendar-button"
|
|
5490
5530
|
${ref.ref("_calendarButtonEl")}
|
|
@@ -5508,18 +5548,17 @@ const DatePickerBaseTemplate = (context, _) => {
|
|
|
5508
5548
|
<div class="segments">
|
|
5509
5549
|
${repeat.repeat(
|
|
5510
5550
|
(x) => x._segments,
|
|
5511
|
-
index.html`
|
|
5512
|
-
|
|
5513
|
-
|
|
5514
|
-
${when.when(
|
|
5551
|
+
index.html` <div class="segment">
|
|
5552
|
+
${renderDialogHeader(context)}
|
|
5553
|
+
${when.when(
|
|
5515
5554
|
(x) => x.type === "month-picker",
|
|
5516
5555
|
index.html`${renderMonthPickerGrid(context)}`
|
|
5517
5556
|
)}
|
|
5518
|
-
|
|
5557
|
+
${when.when(
|
|
5519
5558
|
(x) => x.type === "calendar",
|
|
5520
5559
|
index.html`${renderCalendarGrid(context)}`
|
|
5521
5560
|
)}
|
|
5522
|
-
|
|
5561
|
+
</div>`
|
|
5523
5562
|
)}
|
|
5524
5563
|
</div>
|
|
5525
5564
|
<div class="footer">
|
|
@@ -5576,7 +5615,12 @@ const buildDateGrid = ({ month, year }, getDay) => {
|
|
|
5576
5615
|
let week = [];
|
|
5577
5616
|
for (let i = 0; i < totalDaysInCalendar; i++) {
|
|
5578
5617
|
const dayIndexInMonth = i - firstDayInWeek;
|
|
5579
|
-
week.push(
|
|
5618
|
+
week.push(
|
|
5619
|
+
gridDate(
|
|
5620
|
+
addDays$1(firstDay, dayIndexInMonth),
|
|
5621
|
+
isOutsideMonth(dayIndexInMonth, daysInMonth)
|
|
5622
|
+
)
|
|
5623
|
+
);
|
|
5580
5624
|
if (week.length === 7) {
|
|
5581
5625
|
grid.push(week);
|
|
5582
5626
|
week = [];
|
|
@@ -5619,7 +5663,9 @@ const yearOfDate = (dateStr) => {
|
|
|
5619
5663
|
|
|
5620
5664
|
class _DatePickerBase extends index.FoundationElement {
|
|
5621
5665
|
}
|
|
5622
|
-
class FormAssociatedDatePickerBase extends formAssociated.FormAssociated(
|
|
5666
|
+
class FormAssociatedDatePickerBase extends formAssociated.FormAssociated(
|
|
5667
|
+
_DatePickerBase
|
|
5668
|
+
) {
|
|
5623
5669
|
constructor() {
|
|
5624
5670
|
super(...arguments);
|
|
5625
5671
|
this.proxy = document.createElement("input");
|
|
@@ -5724,7 +5770,10 @@ class DatePickerBase extends FormAssociatedDatePickerBase {
|
|
|
5724
5770
|
_adjustSelectedMonthToEnsureVisibilityOf(date) {
|
|
5725
5771
|
const month = monthOfDate(date);
|
|
5726
5772
|
const firstDisplayedMonth = this._selectedMonth;
|
|
5727
|
-
const lastDisplayedMonth = addMonths(
|
|
5773
|
+
const lastDisplayedMonth = addMonths(
|
|
5774
|
+
this._selectedMonth,
|
|
5775
|
+
this._numCalendars - 1
|
|
5776
|
+
);
|
|
5728
5777
|
if (compareMonths(month, firstDisplayedMonth) < 0) {
|
|
5729
5778
|
this._selectedMonth = month;
|
|
5730
5779
|
return true;
|
|
@@ -5834,7 +5883,9 @@ class DatePickerBase extends FormAssociatedDatePickerBase {
|
|
|
5834
5883
|
} else {
|
|
5835
5884
|
this.#openPopupIfPossible();
|
|
5836
5885
|
index.DOM.processUpdates();
|
|
5837
|
-
const tabbableDate = this.shadowRoot.querySelector(
|
|
5886
|
+
const tabbableDate = this.shadowRoot.querySelector(
|
|
5887
|
+
`[data-date="${this._tabbableDate}"]`
|
|
5888
|
+
);
|
|
5838
5889
|
tabbableDate.focus();
|
|
5839
5890
|
}
|
|
5840
5891
|
}
|
|
@@ -6015,9 +6066,9 @@ class DatePickerBase extends FormAssociatedDatePickerBase {
|
|
|
6015
6066
|
this._lastFocussedDate = date;
|
|
6016
6067
|
}
|
|
6017
6068
|
get _tabbableDate() {
|
|
6018
|
-
const datesInSegments = this._segments.filter(
|
|
6019
|
-
(segment) => segment.
|
|
6020
|
-
);
|
|
6069
|
+
const datesInSegments = this._segments.filter(
|
|
6070
|
+
(segment) => segment.type === "calendar"
|
|
6071
|
+
).flatMap((segment) => segment.calendar.grid.flat().map((d) => d.date));
|
|
6021
6072
|
const candidates = [
|
|
6022
6073
|
this._lastFocussedDate,
|
|
6023
6074
|
...this._getSelectedDates(),
|
|
@@ -6025,7 +6076,10 @@ class DatePickerBase extends FormAssociatedDatePickerBase {
|
|
|
6025
6076
|
...datesInSegments
|
|
6026
6077
|
];
|
|
6027
6078
|
const firstVisibleMonth = this._selectedMonth;
|
|
6028
|
-
const lastVisibleMonth = addMonths(
|
|
6079
|
+
const lastVisibleMonth = addMonths(
|
|
6080
|
+
this._selectedMonth,
|
|
6081
|
+
this._numCalendars - 1
|
|
6082
|
+
);
|
|
6029
6083
|
return candidates.find(
|
|
6030
6084
|
(date) => date && compareMonths(monthOfDate(date), firstVisibleMonth) >= 0 && compareMonths(monthOfDate(date), lastVisibleMonth) <= 0 && this._isDateInValidRange(date)
|
|
6031
6085
|
) ?? null;
|
|
@@ -6153,7 +6207,12 @@ __decorateClass([
|
|
|
6153
6207
|
__decorateClass([
|
|
6154
6208
|
index.volatile
|
|
6155
6209
|
], DatePickerBase.prototype, "_tabbableMonth", 1);
|
|
6156
|
-
|
|
6210
|
+
applyMixinsWithObservables.applyMixinsWithObservables(
|
|
6211
|
+
DatePickerBase,
|
|
6212
|
+
localized.Localized,
|
|
6213
|
+
index$1.FormElementHelperText,
|
|
6214
|
+
trappedFocus.TrappedFocus
|
|
6215
|
+
);
|
|
6157
6216
|
|
|
6158
6217
|
const formatPresentationDate = (dateStr, locale) => {
|
|
6159
6218
|
const date = parseDateStr(dateStr);
|