@vonage/vivid 5.3.0 → 5.5.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-item/definition.js +1 -1
- package/alert/definition.cjs +1 -1
- package/alert/definition.js +2 -2
- package/badge/definition.js +1 -1
- package/banner/definition.js +1 -1
- package/bundled/base-color-picker.cjs +18 -13
- package/bundled/base-color-picker.js +98 -81
- package/bundled/calendar-picker.template.cjs +7 -7
- package/bundled/calendar-picker.template.js +102 -102
- package/bundled/char-count.cjs +1 -1
- package/bundled/char-count.js +1 -1
- package/bundled/definition10.cjs +1 -1
- package/bundled/definition10.js +2 -2
- package/bundled/definition11.cjs +12 -19
- package/bundled/definition11.js +87 -66
- package/bundled/definition12.cjs +19 -10
- package/bundled/definition12.js +217 -36
- package/bundled/definition13.cjs +10 -1
- package/bundled/definition13.js +38 -14
- package/bundled/definition14.cjs +1 -5
- package/bundled/definition14.js +15 -24
- package/bundled/definition15.cjs +5 -30
- package/bundled/definition15.js +22 -73
- package/bundled/definition16.cjs +30 -19
- package/bundled/definition16.js +74 -97
- package/bundled/definition17.cjs +19 -13
- package/bundled/definition17.js +83 -117
- package/bundled/definition18.cjs +13 -12
- package/bundled/definition18.js +114 -71
- package/bundled/definition19.cjs +26 -27
- package/bundled/definition19.js +171 -180
- package/bundled/definition2.cjs +9 -9
- package/bundled/definition2.js +84 -129
- package/bundled/definition3.cjs +1 -1
- package/bundled/definition3.js +1 -1
- package/bundled/definition6.cjs +3 -3
- package/bundled/definition6.js +19 -19
- package/bundled/definition9.cjs +5 -5
- package/bundled/definition9.js +394 -392
- package/bundled/listbox.cjs +1 -1
- package/bundled/listbox.js +82 -102
- package/bundled/localized.cjs +1 -1
- package/bundled/localized.js +48 -31
- package/bundled/mixins.cjs +1 -1
- package/bundled/mixins.js +1 -1
- package/bundled/picker-field.template.cjs +14 -14
- package/bundled/picker-field.template.js +35 -56
- package/bundled/time-selection-picker.template.cjs +12 -12
- package/bundled/time-selection-picker.template.js +13 -12
- package/bundled/trapped-focus.cjs +1 -0
- package/bundled/trapped-focus.js +26 -0
- package/bundled/vivid-element.cjs +5 -1
- package/bundled/vivid-element.js +401 -358
- package/calendar/index.cjs +13 -13
- package/calendar/index.js +171 -143
- package/card/definition.cjs +1 -1
- package/card/definition.js +1 -1
- package/color-picker/definition.cjs +209 -113
- package/color-picker/definition.js +209 -113
- package/color-picker/index.cjs +104 -75
- package/color-picker/index.js +412 -326
- package/combobox/definition.cjs +7 -27
- package/combobox/definition.js +8 -28
- package/combobox/index.cjs +6 -6
- package/combobox/index.js +57 -71
- package/contextual-help/index.cjs +1 -1
- package/contextual-help/index.js +1 -1
- package/custom-elements.json +354 -2
- package/data-grid/index.cjs +1 -1
- package/data-grid/index.js +1 -1
- package/date-picker/definition.cjs +1 -1
- package/date-picker/definition.js +1 -1
- package/date-picker/index.cjs +1 -1
- package/date-picker/index.js +2 -2
- package/date-range-picker/definition.cjs +1 -1
- package/date-range-picker/definition.js +1 -1
- package/date-range-picker/index.cjs +1 -1
- package/date-range-picker/index.js +2 -2
- package/date-time-picker/definition.cjs +1 -1
- package/date-time-picker/definition.js +1 -1
- package/date-time-picker/index.cjs +1 -1
- package/date-time-picker/index.js +2 -2
- package/dial-pad/definition.cjs +139 -0
- package/dial-pad/definition.js +139 -0
- package/dial-pad/index.cjs +27 -20
- package/dial-pad/index.js +177 -100
- package/dialog/definition.cjs +2 -2
- package/dialog/definition.js +2 -2
- package/dialog/index.cjs +7 -7
- package/dialog/index.js +6 -6
- package/divider/index.cjs +1 -1
- package/divider/index.js +1 -1
- package/elevation/definition.cjs +1 -1
- package/elevation/definition.js +1 -1
- package/fab/definition.js +1 -1
- package/header/definition.cjs +1 -1
- package/header/definition.js +1 -1
- package/icon/definition.cjs +56 -22
- package/icon/definition.js +56 -22
- package/index.cjs +3 -4
- package/index.js +2 -3
- package/lib/accordion/accordion.d.ts +1 -1
- package/lib/accordion/definition.d.ts +1 -1
- package/lib/audio-player/audio-player.d.ts +1 -1
- package/lib/color-picker/color-picker.d.ts +390 -12
- package/lib/color-picker/locale.d.ts +4 -0
- package/lib/combobox/combobox.d.ts +1 -0
- package/lib/combobox/combobox.options.d.ts +1 -1
- package/lib/date-picker/date-picker.d.ts +38 -38
- package/lib/date-range-picker/date-range-picker.d.ts +20 -20
- package/lib/date-time-picker/date-time-picker.d.ts +40 -40
- package/lib/dial-pad/dial-pad.d.ts +1 -0
- package/lib/divider/divider.d.ts +1 -1
- package/lib/icon/icon.d.ts +1 -0
- package/lib/menu-item/menu-item-role.d.ts +1 -1
- package/lib/popup/popup.d.ts +1 -1
- package/lib/searchable-select/locale.d.ts +4 -0
- package/lib/searchable-select/searchable-select.d.ts +3 -0
- package/lib/select/select.d.ts +3 -1
- package/lib/simple-color-picker/simple-color-picker.d.ts +2 -1
- package/lib/slider/slider.d.ts +1 -1
- package/lib/tabs/tabs.d.ts +2 -2
- package/lib/text-area/text-area.d.ts +1 -1
- package/lib/text-field/text-field.d.ts +1 -1
- package/lib/time-picker/time-picker.d.ts +20 -20
- package/locales/de-DE.cjs +20 -3
- package/locales/de-DE.js +20 -3
- package/locales/en-GB.cjs +21 -4
- package/locales/en-GB.js +21 -4
- package/locales/en-US.cjs +21 -4
- package/locales/en-US.js +21 -4
- package/locales/ja-JP.cjs +20 -3
- package/locales/ja-JP.js +20 -3
- package/locales/zh-CN.cjs +19 -2
- package/locales/zh-CN.js +19 -2
- package/menu/definition.cjs +4 -4
- package/menu/definition.js +4 -4
- package/nav-disclosure/definition.js +1 -1
- package/nav-item/definition.js +1 -1
- package/note/definition.js +1 -1
- package/number-field/definition.js +1 -1
- package/number-field/index.cjs +1 -1
- package/number-field/index.js +3 -3
- package/option/definition.cjs +6 -77
- package/option/definition.js +3 -78
- package/option/index.cjs +1 -1
- package/option/index.js +1 -1
- package/package.json +31 -5
- package/popup/definition.cjs +2 -2
- package/popup/definition.js +2 -2
- 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/definition.cjs +1 -1
- package/range-slider/definition.js +1 -1
- package/rich-text-editor/definition.cjs +2 -3
- package/rich-text-editor/definition.js +1 -2
- package/rich-text-editor/index.cjs +27 -27
- package/rich-text-editor/index.js +1209 -1199
- package/searchable-select/definition.cjs +103 -11
- package/searchable-select/definition.js +103 -11
- package/searchable-select/index.cjs +81 -69
- package/searchable-select/index.js +359 -273
- package/select/definition.cjs +30 -44
- package/select/definition.js +30 -44
- package/selectable-box/definition.cjs +1 -1
- package/selectable-box/definition.js +1 -1
- package/selectable-box/index.cjs +1 -1
- package/selectable-box/index.js +2 -2
- package/shared/aria/aria-mixin.d.ts +1 -1
- package/shared/color-picker/base-color-picker.d.ts +2 -1
- package/shared/foundation/listbox/listbox.d.ts +4 -0
- package/shared/picker-field/mixins/calendar-picker.d.ts +10 -10
- package/shared/picker-field/mixins/calendar-picker.template.d.ts +10 -10
- package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +20 -20
- package/shared/picker-field/mixins/single-date-picker.d.ts +28 -28
- package/shared/picker-field/mixins/single-value-picker.d.ts +8 -8
- package/shared/picker-field/mixins/time-selection-picker.d.ts +20 -20
- package/shared/picker-field/mixins/time-selection-picker.template.d.ts +20 -20
- package/simple-color-picker/definition.cjs +9 -7
- package/simple-color-picker/definition.js +9 -7
- package/simple-color-picker/index.cjs +6 -6
- package/simple-color-picker/index.js +41 -39
- package/slider/definition.cjs +1 -1
- package/slider/definition.js +1 -1
- package/split-button/definition.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/tab/definition.js +1 -1
- package/tag/definition.cjs +34 -14
- package/tag/definition.js +35 -15
- package/tag/index.cjs +25 -12
- package/tag/index.js +64 -47
- package/tag-group/definition.cjs +1 -2
- package/tag-group/definition.js +1 -2
- package/tag-group/index.cjs +1 -1
- package/tag-group/index.js +11 -12
- package/text-area/index.cjs +1 -1
- package/text-area/index.js +2 -2
- package/text-field/definition.js +1 -1
- package/time-picker/definition.cjs +1 -1
- package/time-picker/definition.js +1 -1
- package/time-picker/index.cjs +1 -1
- package/time-picker/index.js +1 -1
- package/toggletip/definition.cjs +1 -1
- package/toggletip/definition.js +1 -1
- package/toggletip/index.cjs +1 -1
- package/toggletip/index.js +1 -1
- package/tooltip/definition.cjs +3 -3
- package/tooltip/definition.js +3 -3
- package/tooltip/index.cjs +1 -1
- package/tooltip/index.js +1 -1
- package/tree-item/definition.cjs +1 -1
- package/tree-item/definition.js +1 -1
- package/tree-view/definition.cjs +1 -1
- package/tree-view/definition.js +1 -1
- package/unbundled/affix.js +1 -1
- package/unbundled/base-color-picker.cjs +36 -18
- package/unbundled/base-color-picker.js +36 -18
- package/unbundled/calendar-picker.template.cjs +2 -2
- package/unbundled/calendar-picker.template.js +2 -2
- package/unbundled/definition.js +1 -1
- package/unbundled/definition2.js +1 -1
- package/unbundled/definition3.cjs +222 -141
- package/unbundled/definition3.js +220 -139
- package/unbundled/definition4.cjs +145 -235
- package/unbundled/definition4.js +143 -233
- package/unbundled/definition5.cjs +269 -27
- package/unbundled/definition5.js +267 -26
- package/unbundled/definition6.cjs +56 -0
- package/unbundled/definition6.js +52 -0
- package/unbundled/listbox.cjs +41 -63
- package/unbundled/listbox.js +39 -61
- package/unbundled/picker-field.template.cjs +3 -36
- package/unbundled/picker-field.template.js +3 -35
- package/unbundled/slider.template.cjs +1 -1
- package/unbundled/slider.template.js +1 -1
- package/unbundled/time-selection-picker.template.cjs +2 -1
- package/unbundled/time-selection-picker.template.js +2 -1
- package/unbundled/trapped-focus.cjs +37 -0
- package/unbundled/trapped-focus.js +34 -0
- package/unbundled/vivid-element.cjs +1 -1
- package/unbundled/vivid-element.js +1 -1
- package/video-player/definition.cjs +56 -16
- package/video-player/definition.js +56 -16
- package/video-player/index.cjs +36 -36
- package/video-player/index.js +2461 -2445
- package/visually-hidden/index.cjs +1 -1
- package/visually-hidden/index.js +1 -1
- package/vivid.api.json +285 -38
- package/bundled/_has.cjs +0 -1
- package/bundled/_has.js +0 -34
- package/bundled/option.cjs +0 -1
- package/bundled/option.js +0 -158
- package/unbundled/option.cjs +0 -217
- package/unbundled/option.js +0 -214
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";const _=require("./index.cjs"),
|
|
2
|
-
<div class='base' @keydown='${(e,{event:
|
|
3
|
-
<${
|
|
1
|
+
"use strict";const _=require("./index.cjs"),f=require("./mixins.cjs"),$=require("./form-associated.cjs"),n=require("./vivid-element.cjs"),v=require("./trapped-focus.cjs"),x=require("./with-contextual-help.cjs"),g=require("./with-error-text.cjs"),m=require("./form-element.cjs"),k=require("./localized.cjs"),C=require("./definition9.cjs"),y=require("./definition10.cjs"),F=require("./definition3.cjs"),p=require("./ref.cjs"),h=require("./slotted.cjs"),b=require("./class-names.cjs"),O=":host{display:inline-block}.base{display:inline-block;inline-size:100%}.control{inline-size:100%}.dialog{display:inline-flex;flex-direction:column}.dialog--padded{padding:12px;gap:12px}.dialog .footer{display:flex;align-items:center;justify-content:flex-end;padding:8px;gap:8px}.dialog .footer--with-separator{border-top:1px solid var(--vvd-color-neutral-200)}";var E=Object.defineProperty,u=(s,t,o,d)=>{for(var i=void 0,a=s.length-1,l;a>=0;a--)(l=s[a])&&(i=l(t,o,i)||i);return i&&E(t,o,i),i};class r extends x.WithContextualHelp(f.WithFeedback(g.WithErrorText(m.FormElement(v.TrappedFocus(k.Localized($.FormAssociated(n.VividElement))))))){constructor(){super(),this.readOnly=!1,this.#e=()=>{this.$emit("focus",void 0,{bubbles:!1})},this.#t=()=>{this.$emit("blur",void 0,{bubbles:!1})},this.proxy=document.createElement("input"),this.#o={handleChange:()=>{this._updatePresentationValue()}},this._popupOpen=!1,this.#l=t=>{if(!this._popupOpen)return;const o=t.composedPath();[this._dialogEl,this._pickerButtonEl].some(i=>o.includes(i))||this._closePopup(!1)},this._presentationValue="",this.value=""}readOnlyChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.readOnly=this.readOnly,this.validate())}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.#l),this.addEventListener("focusin",this.#e),this.addEventListener("focusout",this.#t),this.#s()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.#l),this.removeEventListener("focusin",this.#e),this.removeEventListener("focusout",this.#t),this.#n()}#e;#t;validate(){this.proxy&&this.proxy.setCustomValidity(this._getCustomValidationError()??""),super.validate(this._textFieldEl?.querySelector("input")??void 0)}#o;#i;#s(){this.#i=n.Observable.binding(()=>this.locale,this.#o),this.#i.observe(this,n.ExecutionContext.default)}#n(){this.#i.dispose()}#l;#a(){this.readOnly||(this._popupOpen=!0)}_closePopup(t=!0){this._popupOpen=!1,t&&this._textFieldEl.focus()}_onBaseKeyDown(t){return this._popupOpen&&_.handleEscapeKeyAndStopPropogation(t)?(this._closePopup(),!1):!this._trappedFocus(t,()=>this._focusableElsWithinDialog())}_presentationValueChanged(){this.dirtyValue=!0,this.validate()}_onTextFieldInput(t){const o=t.currentTarget;this._presentationValue=o.value}_onPickerButtonClick(){this._popupOpen?this._closePopup():this.#a()}_onOkClick(){this._closePopup()}_onClearClick(){this.$emit("clear-click")}}u([n.attr({attribute:"readonly",mode:"boolean"})],r.prototype,"readOnly");u([n.observable],r.prototype,"_popupOpen");u([n.observable],r.prototype,"_presentationValue");const T=(s,t,{withSeparator:o,padded:d})=>{const i=s.tagFor(C.Popup),a=s.tagFor(y.TextField),l=s.tagFor(F.Button);return n.html`
|
|
2
|
+
<div class='base' @keydown='${(e,{event:c})=>e._onBaseKeyDown(c)}'>
|
|
3
|
+
<${a} id='text-field'
|
|
4
4
|
${p.ref("_textFieldEl")}
|
|
5
5
|
class='control'
|
|
6
6
|
label='${e=>e.label}'
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
current-value='${e=>e._presentationValue}'
|
|
12
12
|
?disabled='${e=>e.disabled}'
|
|
13
13
|
?readonly='${e=>e.readOnly}'
|
|
14
|
-
@input='${(e,
|
|
14
|
+
@input='${(e,c)=>e._onTextFieldInput(c.event)}'
|
|
15
15
|
@change='${e=>e._onTextFieldChange()}'
|
|
16
16
|
>
|
|
17
17
|
<slot
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
name='contextual-help'
|
|
25
25
|
${h.slotted("_contextualHelpSlottedContent")}
|
|
26
26
|
></slot>
|
|
27
|
-
<${
|
|
27
|
+
<${l}
|
|
28
28
|
id='picker-button'
|
|
29
29
|
${p.ref("_pickerButtonEl")}
|
|
30
30
|
slot='action-items'
|
|
@@ -34,34 +34,34 @@
|
|
|
34
34
|
?disabled='${e=>e.disabled||e.readOnly}'
|
|
35
35
|
aria-label='${e=>e._pickerButtonLabel}'
|
|
36
36
|
@click='${e=>e._onPickerButtonClick()}'
|
|
37
|
-
></${
|
|
38
|
-
</${
|
|
37
|
+
></${l}>
|
|
38
|
+
</${a}>
|
|
39
39
|
<${i}
|
|
40
40
|
?open='${e=>e._popupOpen}'
|
|
41
41
|
:anchor='${e=>e._textFieldEl}'
|
|
42
42
|
offset='${e=>e._helperTextSlottedContent?.length||e.helperText||e.errorValidationMessage?8:null}'
|
|
43
43
|
placement='bottom-start'
|
|
44
44
|
class='popup'>
|
|
45
|
-
<div class="${()=>
|
|
45
|
+
<div class="${()=>b.classNames("dialog",["dialog--padded",d])}" role='dialog' ${p.ref("_dialogEl")} aria-modal='true' aria-label='${e=>e._dialogLabel}'>
|
|
46
46
|
${()=>t}
|
|
47
|
-
<div class="${()=>
|
|
48
|
-
<${
|
|
47
|
+
<div class="${()=>b.classNames("footer",["footer--with-separator",o])}">
|
|
48
|
+
<${l}
|
|
49
49
|
id='clear-button'
|
|
50
50
|
tabindex='3'
|
|
51
51
|
class='vwc-button'
|
|
52
52
|
size='condensed'
|
|
53
53
|
label='${e=>e.locale.pickerField.clearLabel}'
|
|
54
54
|
@click='${e=>e._onClearClick()}'
|
|
55
|
-
></${
|
|
56
|
-
<${
|
|
55
|
+
></${l}>
|
|
56
|
+
<${l}
|
|
57
57
|
tabindex='3'
|
|
58
58
|
class='vwc-button'
|
|
59
59
|
size='condensed'
|
|
60
60
|
appearance='filled'
|
|
61
61
|
label='${e=>e.locale.pickerField.okLabel}'
|
|
62
62
|
@click='${e=>e._onOkClick()}'
|
|
63
|
-
></${
|
|
63
|
+
></${l}>
|
|
64
64
|
</div>
|
|
65
65
|
</div>
|
|
66
66
|
</${i}>
|
|
67
|
-
</div>`};exports.PickerField=
|
|
67
|
+
</div>`};exports.PickerField=r;exports.PickerFieldTemplate=T;exports.pickerFieldStyles=O;
|
|
@@ -1,48 +1,28 @@
|
|
|
1
|
-
import { h as
|
|
1
|
+
import { h as f } from "./index.js";
|
|
2
2
|
import { W as _ } from "./mixins.js";
|
|
3
|
-
import { F as
|
|
4
|
-
import { V as
|
|
3
|
+
import { F as b } from "./form-associated.js";
|
|
4
|
+
import { V as $, O as g, E as v, a as x, o as m, h as k } from "./vivid-element.js";
|
|
5
|
+
import { T as C } from "./trapped-focus.js";
|
|
5
6
|
import { W as y } from "./with-contextual-help.js";
|
|
6
|
-
import { W as
|
|
7
|
-
import { F as
|
|
8
|
-
import { L as
|
|
7
|
+
import { W as F } from "./with-error-text.js";
|
|
8
|
+
import { F as O } from "./form-element.js";
|
|
9
|
+
import { L as E } from "./localized.js";
|
|
9
10
|
import { P as T } from "./definition9.js";
|
|
10
11
|
import { T as P } from "./definition10.js";
|
|
11
12
|
import { B as L } from "./definition3.js";
|
|
12
13
|
import { r as p } from "./ref.js";
|
|
13
14
|
import { s as u } from "./slotted.js";
|
|
14
15
|
import { c as h } from "./class-names.js";
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
* @returns Whether focus was trapped.
|
|
21
|
-
* @internal
|
|
22
|
-
*/
|
|
23
|
-
_trappedFocus(n, o) {
|
|
24
|
-
if (!m.has(n) && n.key === "Tab") {
|
|
25
|
-
const l = o(), i = l[0], e = l[l.length - 1];
|
|
26
|
-
if (n.shiftKey) {
|
|
27
|
-
if (this.shadowRoot.activeElement === i)
|
|
28
|
-
return e.focus(), !0;
|
|
29
|
-
} else if (this.shadowRoot.activeElement === e)
|
|
30
|
-
return i.focus(), !0;
|
|
31
|
-
}
|
|
32
|
-
return !1;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
return t;
|
|
36
|
-
}, J = ":host{display:inline-block}.base{display:inline-block;inline-size:100%}.control{inline-size:100%}.dialog{display:inline-flex;flex-direction:column}.dialog--padded{padding:12px;gap:12px}.dialog .footer{display:flex;align-items:center;justify-content:flex-end;padding:8px;gap:8px}.dialog .footer--with-separator{border-top:1px solid var(--vvd-color-neutral-200)}";
|
|
37
|
-
var w = Object.defineProperty, d = (s, t, a, n) => {
|
|
38
|
-
for (var o = void 0, l = s.length - 1, i; l >= 0; l--)
|
|
39
|
-
(i = s[l]) && (o = i(t, a, o) || o);
|
|
40
|
-
return o && w(t, a, o), o;
|
|
16
|
+
const J = ":host{display:inline-block}.base{display:inline-block;inline-size:100%}.control{inline-size:100%}.dialog{display:inline-flex;flex-direction:column}.dialog--padded{padding:12px;gap:12px}.dialog .footer{display:flex;align-items:center;justify-content:flex-end;padding:8px;gap:8px}.dialog .footer--with-separator{border-top:1px solid var(--vvd-color-neutral-200)}";
|
|
17
|
+
var V = Object.defineProperty, d = (s, t, l, n) => {
|
|
18
|
+
for (var o = void 0, a = s.length - 1, i; a >= 0; a--)
|
|
19
|
+
(i = s[a]) && (o = i(t, l, o) || o);
|
|
20
|
+
return o && V(t, l, o), o;
|
|
41
21
|
};
|
|
42
22
|
class c extends y(
|
|
43
23
|
_(
|
|
44
|
-
|
|
45
|
-
|
|
24
|
+
F(
|
|
25
|
+
O(C(E(b($))))
|
|
46
26
|
)
|
|
47
27
|
)
|
|
48
28
|
) {
|
|
@@ -52,15 +32,15 @@ class c extends y(
|
|
|
52
32
|
this.$emit("focus", void 0, { bubbles: !1 });
|
|
53
33
|
}, this.#t = () => {
|
|
54
34
|
this.$emit("blur", void 0, { bubbles: !1 });
|
|
55
|
-
}, this.proxy = document.createElement("input"), this.#
|
|
35
|
+
}, this.proxy = document.createElement("input"), this.#l = {
|
|
56
36
|
handleChange: () => {
|
|
57
37
|
this._updatePresentationValue();
|
|
58
38
|
}
|
|
59
39
|
}, this._popupOpen = !1, this.#i = (t) => {
|
|
60
40
|
if (!this._popupOpen)
|
|
61
41
|
return;
|
|
62
|
-
const
|
|
63
|
-
[this._dialogEl, this._pickerButtonEl].some((o) =>
|
|
42
|
+
const l = t.composedPath();
|
|
43
|
+
[this._dialogEl, this._pickerButtonEl].some((o) => l.includes(o)) || this._closePopup(!1);
|
|
64
44
|
}, this._presentationValue = "", this.value = "";
|
|
65
45
|
}
|
|
66
46
|
/**
|
|
@@ -73,7 +53,7 @@ class c extends y(
|
|
|
73
53
|
* @internal
|
|
74
54
|
*/
|
|
75
55
|
connectedCallback() {
|
|
76
|
-
super.connectedCallback(), document.addEventListener("click", this.#i), this.addEventListener("focusin", this.#e), this.addEventListener("focusout", this.#t), this.#
|
|
56
|
+
super.connectedCallback(), document.addEventListener("click", this.#i), this.addEventListener("focusin", this.#e), this.addEventListener("focusout", this.#t), this.#s();
|
|
77
57
|
}
|
|
78
58
|
/**
|
|
79
59
|
* @internal
|
|
@@ -89,13 +69,13 @@ class c extends y(
|
|
|
89
69
|
validate() {
|
|
90
70
|
this.proxy && this.proxy.setCustomValidity(this._getCustomValidationError() ?? ""), super.validate(this._textFieldEl?.querySelector("input") ?? void 0);
|
|
91
71
|
}
|
|
92
|
-
#
|
|
72
|
+
#l;
|
|
93
73
|
#o;
|
|
94
|
-
#
|
|
95
|
-
this.#o =
|
|
74
|
+
#s() {
|
|
75
|
+
this.#o = g.binding(
|
|
96
76
|
() => this.locale,
|
|
97
|
-
this.#
|
|
98
|
-
), this.#o.observe(this,
|
|
77
|
+
this.#l
|
|
78
|
+
), this.#o.observe(this, v.default);
|
|
99
79
|
}
|
|
100
80
|
#a() {
|
|
101
81
|
this.#o.dispose();
|
|
@@ -115,7 +95,7 @@ class c extends y(
|
|
|
115
95
|
* @internal
|
|
116
96
|
*/
|
|
117
97
|
_onBaseKeyDown(t) {
|
|
118
|
-
return this._popupOpen &&
|
|
98
|
+
return this._popupOpen && f(t) ? (this._closePopup(), !1) : !this._trappedFocus(t, () => this._focusableElsWithinDialog());
|
|
119
99
|
}
|
|
120
100
|
/**
|
|
121
101
|
* @internal
|
|
@@ -127,8 +107,8 @@ class c extends y(
|
|
|
127
107
|
* @internal
|
|
128
108
|
*/
|
|
129
109
|
_onTextFieldInput(t) {
|
|
130
|
-
const
|
|
131
|
-
this._presentationValue =
|
|
110
|
+
const l = t.currentTarget;
|
|
111
|
+
this._presentationValue = l.value;
|
|
132
112
|
}
|
|
133
113
|
/**
|
|
134
114
|
* @internal
|
|
@@ -151,19 +131,19 @@ class c extends y(
|
|
|
151
131
|
}
|
|
152
132
|
}
|
|
153
133
|
d([
|
|
154
|
-
|
|
134
|
+
x({ attribute: "readonly", mode: "boolean" })
|
|
155
135
|
], c.prototype, "readOnly");
|
|
156
136
|
d([
|
|
157
|
-
|
|
137
|
+
m
|
|
158
138
|
], c.prototype, "_popupOpen");
|
|
159
139
|
d([
|
|
160
|
-
|
|
140
|
+
m
|
|
161
141
|
], c.prototype, "_presentationValue");
|
|
162
|
-
const Q = (s, t, { withSeparator:
|
|
163
|
-
const o = s.tagFor(T),
|
|
164
|
-
return
|
|
142
|
+
const Q = (s, t, { withSeparator: l, padded: n }) => {
|
|
143
|
+
const o = s.tagFor(T), a = s.tagFor(P), i = s.tagFor(L);
|
|
144
|
+
return k`
|
|
165
145
|
<div class='base' @keydown='${(e, { event: r }) => e._onBaseKeyDown(r)}'>
|
|
166
|
-
<${
|
|
146
|
+
<${a} id='text-field'
|
|
167
147
|
${p("_textFieldEl")}
|
|
168
148
|
class='control'
|
|
169
149
|
label='${(e) => e.label}'
|
|
@@ -198,7 +178,7 @@ const Q = (s, t, { withSeparator: a, padded: n }) => {
|
|
|
198
178
|
aria-label='${(e) => e._pickerButtonLabel}'
|
|
199
179
|
@click='${(e) => e._onPickerButtonClick()}'
|
|
200
180
|
></${i}>
|
|
201
|
-
</${
|
|
181
|
+
</${a}>
|
|
202
182
|
<${o}
|
|
203
183
|
?open='${(e) => e._popupOpen}'
|
|
204
184
|
:anchor='${(e) => e._textFieldEl}'
|
|
@@ -212,7 +192,7 @@ const Q = (s, t, { withSeparator: a, padded: n }) => {
|
|
|
212
192
|
"_dialogEl"
|
|
213
193
|
)} aria-modal='true' aria-label='${(e) => e._dialogLabel}'>
|
|
214
194
|
${() => t}
|
|
215
|
-
<div class="${() => h("footer", ["footer--with-separator",
|
|
195
|
+
<div class="${() => h("footer", ["footer--with-separator", l])}">
|
|
216
196
|
<${i}
|
|
217
197
|
id='clear-button'
|
|
218
198
|
tabindex='3'
|
|
@@ -237,6 +217,5 @@ const Q = (s, t, { withSeparator: a, padded: n }) => {
|
|
|
237
217
|
export {
|
|
238
218
|
c as P,
|
|
239
219
|
Q as a,
|
|
240
|
-
G as i,
|
|
241
220
|
J as p
|
|
242
221
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const l=require("./vivid-element.cjs"),
|
|
1
|
+
"use strict";const l=require("./vivid-element.cjs"),A=require("./picker-field.template.cjs"),D=require("./single-value-picker.cjs"),N=require("./scrollIntoView.cjs"),C=require("./when.cjs"),H=require("./trapped-focus.cjs"),R=require("./repeat.cjs"),j=require("./class-names.cjs"),z=require("./localized.cjs"),B=require("./ref.cjs"),S=e=>{const t=e.split(":");if(t.length!==3)return!1;const[o,i,r]=t;if(o.length!==2||i.length!==2||r.length!==2)return!1;const n=parseInt(o,10),s=parseInt(i,10),a=parseInt(r,10);return!(isNaN(n)||isNaN(s)||isNaN(a)||n<0||n>23||s<0||s>59||a<0||a>59)},g=e=>Number.parseInt(e,10),m=e=>e.toString().padStart(2,"0"),c=e=>{const[t,o,i]=e.split(":"),r=g(t),n=g(o),s=g(i);return{hourStr:t,hours:r,minuteStr:o,minutes:n,secondStr:i,seconds:s,meridiem:r<12?"AM":"PM"}},U=(e,t)=>e>t?1:e<t?-1:0,O=e=>e%12||12,W=(e,t)=>e==="AM"&&t<12||e==="PM"&&t>=12,K=(e,t,o)=>{const i=[],r=e?c(e).hours:0,n=t?c(t).hours:23;for(let s=r;s<=n;s++)o&&!W(o,s)||i.push({value:m(s),label:m(o?O(s):s)});return i},G=(e,t,o,i)=>{const r=[];let n=0,s=59;if(o){const{hourStr:a,minutes:p}=c(o);t&&c(t).hourStr===a&&(n=p)}if(i){const{hourStr:a,minutes:p}=c(i);t&&c(t).hourStr===a&&(s=p)}for(let a=n;a<=s;a+=Math.max(1,e??1)){const p=m(a);r.push({value:p,label:p})}return r},J=(e,t,o,i)=>{const r=[];let n=0,s=59;if(o){const a=c(o);t&&(c(t).hourStr===a.hourStr&&c(t).minuteStr)===a.minuteStr&&(n=a.seconds)}if(i){const a=c(i);t&&(c(t).hourStr===a.hourStr&&c(t).minuteStr)===a.minuteStr&&(s=a.seconds)}for(let a=n;a<=s;a+=Math.max(1,e)){const p=m(a);r.push({value:p,label:p})}return r},Q=(e,t)=>{const o=[];return(e?c(e).meridiem==="PM":!1)||o.push({value:"AM",label:"AM"}),(t?c(t).meridiem==="AM":!1)||o.push({value:"PM",label:"PM"}),o},P={id:"hours",getLabel:e=>e.locale.timePicker.hoursLabel,getOptions:e=>K(e.min,e.max,e.clock==="12h"?f.getSelectedOptionValue(e)??f.getOptions(e)[0].value:void 0),getSelectedOptionValue:e=>e.value?c(e.value).hourStr:void 0,updatedValue:(e,t)=>{if(e.value){const{minuteStr:o,secondStr:i}=c(e.value);return`${t}:${o}:${i}`}else return`${t}:00:00`}},w={id:"minutes",getLabel:e=>e.locale.timePicker.minutesLabel,getOptions:e=>G(e.minutesStep,e.value,e.min,e.max),getSelectedOptionValue:e=>e.value?c(e.value).minuteStr:void 0,updatedValue:(e,t)=>{if(e.value){const{hourStr:o,secondStr:i}=c(e.value);return`${o}:${t}:${i}`}else return`00:${t}:00`}},x={id:"seconds",getLabel:e=>e.locale.timePicker.secondsLabel,getOptions:e=>J(e.secondsStep,e.value,e.min,e.max),getSelectedOptionValue:e=>e.value?c(e.value).secondStr:void 0,updatedValue:(e,t)=>{if(e.value){const{hourStr:o,minuteStr:i}=c(e.value);return`${o}:${i}:${t}`}else return`00:00:${t}`}},f={id:"meridies",getLabel:e=>e.locale.timePicker.meridiesLabel,getOptions:e=>Q(e.min,e.max),getSelectedOptionValue:e=>e.value?c(e.value).meridiem:void 0,updatedValue:(e,t)=>{if(e.value){const{hours:o,minuteStr:i,secondStr:r}=c(e.value);let n=o;return t==="AM"&&o>=12?n-=12:t==="PM"&&o<12&&(n+=12),`${m(n)}:${i}:${r}`}else return t==="AM"?"00:00:00":"12:00:00"}},V=e=>e.secondsStep!==void 0,M=e=>e.clock==="12h",X=(e,t,o)=>{E(e,t.updatedValue(e,o)),h(e,t.id,o,"start");const n=e.shadowRoot.querySelector(`#${t.id}`)?.closest(".picker-wrapper")?.nextElementSibling?.querySelector(".picker");n?n.focus():e.$emit("last-column-selected",void 0,{bubbles:!1})},Y=(e,t,o)=>{const i=t.getOptions(e),r=t.getSelectedOptionValue(e),n={ArrowUp:-1,ArrowDown:1}[o.key];if(n){o.preventDefault();const s=i.findIndex(k=>k.value===r),p=((s===-1?0:s+n)+i.length)%i.length,d=i[p].value;E(e,t.updatedValue(e,d)),h(e,t.id,d,"nearest"),e._clearFocusedClasses()}return!0},h=(e,t,o,i)=>{const r=e.shadowRoot.querySelector(`#${t}-${o}`);r&&N.scrollIntoView(r,r.parentElement,i)},Z=(e,t)=>{if(t.key==="Tab"){const o=e.shadowRoot.querySelectorAll(".picker"),i=t.shiftKey?o[0]:o[o.length-1];e.shadowRoot.activeElement!==i&&H.ignoreEventInFocusTraps(t),e._applyFocusedClass()}return!0},E=(e,t)=>{e.$emit("change",t,{bubbles:!1,composed:!1})},_=e=>l.html`<div class="picker-wrapper">
|
|
2
2
|
<ul
|
|
3
3
|
id="${e.id}"
|
|
4
4
|
class="picker"
|
|
@@ -6,31 +6,31 @@
|
|
|
6
6
|
tabindex="0"
|
|
7
7
|
aria-label="${e.getLabel}"
|
|
8
8
|
aria-activedescendant="${t=>e.getSelectedOptionValue(t)?`${e.id}-${e.getSelectedOptionValue(t)}`:void 0}"
|
|
9
|
-
@keydown="${(t,o)=>
|
|
9
|
+
@keydown="${(t,o)=>Y(t,e,o.event)}"
|
|
10
10
|
>
|
|
11
|
-
${
|
|
11
|
+
${R.repeat(t=>e.getOptions(t),l.html`<li
|
|
12
12
|
id="${t=>`${e.id}-${t.value}`}"
|
|
13
|
-
class="${(t,o)=>
|
|
13
|
+
class="${(t,o)=>j.classNames("option",["selected",e.getSelectedOptionValue(o.parent)===t.value])}"
|
|
14
14
|
aria-selected="${(t,o)=>e.getSelectedOptionValue(o.parent)===t.value}"
|
|
15
15
|
role="option"
|
|
16
|
-
@click="${(t,o)=>
|
|
16
|
+
@click="${(t,o)=>X(o.parent,e,t.value)}"
|
|
17
17
|
>
|
|
18
18
|
${t=>t.label}
|
|
19
19
|
</li>`)}
|
|
20
20
|
</ul>
|
|
21
|
-
</div>`,
|
|
21
|
+
</div>`,ee=()=>l.html`<div
|
|
22
22
|
class="time-pickers"
|
|
23
|
-
@keydown="${(e,{event:t})=>
|
|
23
|
+
@keydown="${(e,{event:t})=>Z(e,t)}"
|
|
24
24
|
@focusout="${e=>e._onFocusOut()}"
|
|
25
25
|
@pointerdown="${e=>e._onPointerDown()}"
|
|
26
26
|
>
|
|
27
27
|
${_(P)} ${_(w)}
|
|
28
|
-
${C.when(
|
|
29
|
-
${C.when(
|
|
30
|
-
</div>`;var ee=Object.defineProperty,v=(e,t,o,i)=>{for(var r=void 0,n=e.length-1,s;n>=0;n--)(s=e[n])&&(r=s(t,o,r)||r);return r&&ee(t,o,r),r};class u extends j.Localized(l.VividElement){constructor(){super(...arguments),this.minutesStep=1,this.clock="24h",this.focusedPickerClass="focused",this._onFocusOut=()=>{this._clearFocusedClasses()},this._onPointerDown=()=>{this._clearFocusedClasses()}}valueChanged(t,o){o!==void 0&&!S(o)&&(this.value=void 0)}scrollSelectedOptionsToTop(){P.getSelectedOptionValue(this)&&h(this,"hours",P.getSelectedOptionValue(this),"start"),w.getSelectedOptionValue(this)&&h(this,"minutes",w.getSelectedOptionValue(this),"start"),M(this)&&x.getSelectedOptionValue(this)&&h(this,"seconds",x.getSelectedOptionValue(this),"start"),E(this)&&f.getSelectedOptionValue(this)&&h(this,"meridies",f.getSelectedOptionValue(this),"start")}focus(t){this.shadowRoot.querySelector(".picker").focus(t),this._applyFocusedClass()}_applyFocusedClass(){const t=this.shadowRoot.querySelectorAll(".picker");requestAnimationFrame(()=>{const o=this.shadowRoot.activeElement;t.forEach(i=>{i===o?i.parentElement?.classList.add(this.focusedPickerClass):i.parentElement?.classList.remove(this.focusedPickerClass)})})}_clearFocusedClasses(){this.shadowRoot.querySelectorAll(".picker").forEach(o=>{o.parentElement?.classList.remove(this.focusedPickerClass)})}}v([l.observable],u.prototype,"value");v([l.observable],u.prototype,"minutesStep");v([l.observable],u.prototype,"secondsStep");v([l.observable],u.prototype,"clock");v([l.observable],u.prototype,"min");v([l.observable],u.prototype,"max");const te=':host{display:inline-block}.time-pickers{display:flex;overflow:hidden;justify-content:center;padding:4px;block-size:calc(28px * var(--_inline-time-picker-num-options-visible) + 4px * (var(--_inline-time-picker-num-options-visible) - 1));gap:4px}.time-pickers .picker-wrapper{position:relative;display:flex;flex-direction:column;border-radius:4px}.time-pickers .picker-wrapper.focused:has(.picker:focus-visible){--focus-stroke-gap-color: transparent;--focus-inset: -2px;box-shadow:0 0 0 4px color-mix(in srgb,var(--vvd-color-cta-500),transparent 85%),inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:1px solid var(--focus-stroke-color, var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset, 0px))}.time-pickers .picker{position:relative;display:flex;overflow:hidden scroll;flex-direction:column;padding:0 4px;border-radius:4px;margin:0 -4px;gap:4px;inline-size:50px;list-style:none;scrollbar-width:none}@media (hover: hover){.time-pickers .picker:hover{scrollbar-width:auto}}.time-pickers .picker:after{display:block;flex-shrink:0;block-size:calc(28px * (var(--_inline-time-picker-num-options-visible) - 1) + 4px * (var(--_inline-time-picker-num-options-visible) - 1 - 1));content:""}.time-pickers .picker:focus-visible{outline:none}.time-pickers .option{--_connotation-color-primary: var(--vvd-time-picker-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-firm: var(--vvd-time-picker-accent-firm, var(--vvd-color-canvas-text));--_connotation-color-faint: var(--vvd-time-picker-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-soft: var(--vvd-time-picker-accent-soft, var(--vvd-color-neutral-100));--_connotation-color-dim: var(--vvd-time-picker-accent-dim, var(--vvd-color-neutral-200));--_connotation-color-pale: var(--vvd-time-picker-accent-pale, var(--vvd-color-neutral-300))}.time-pickers .option{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}@media (hover: hover){.time-pickers .option:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}}.time-pickers .option.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}.time-pickers .option:active:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.time-pickers .option.active:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.time-pickers .option.selected:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}@media (hover: hover){.time-pickers .option.selected:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-dim);--_appearance-color-outline: transparent}}.time-pickers .option.selected.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-dim);--_appearance-color-outline: transparent}.time-pickers .option.selected:disabled{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-200);--_appearance-color-outline: transparent}.time-pickers .option.selected.disabled{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-200);--_appearance-color-outline: transparent}.time-pickers .option{display:flex;flex-shrink:0;align-items:center;justify-content:center;border-radius:4px;background-color:var(--_appearance-color-fill);block-size:28px;color:var(--_appearance-color-text);cursor:pointer;font:var(--vvd-typography-base);inline-size:50px}.time-pickers .picker-wrapper:not(.focused) .picker:focus-visible .option.selected{--focus-stroke-gap-color: transparent;box-shadow:0 0 0 4px color-mix(in srgb,var(--vvd-color-cta-500),transparent 85%),inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:1px solid var(--focus-stroke-color, var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset, 0px))}',oe=l.defineVividComponent("inline-time-picker",u,Z,[],{styles:te,shadowOptions:{delegatesFocus:!0}}),L=(e,t,o)=>{const i=c(e);let n=`${m(o?V(i.hours):i.hours)}:${i.minuteStr}`;return t&&(n+=`:${i.secondStr}`),o&&(n+=` ${i.meridiem}`),n},T=e=>e>="0"&&e<="9",F=(e,t)=>{const o=e.toLowerCase(),i=[];let r;for(let p=0;p<o.length;p++){const d=o[p];if(d==="a"&&o[p+1]==="m"&&(p++,r="AM"),d==="p"&&o[p+1]==="m"&&(p++,r="PM"),T(d)){let k=d;for(;T(o[p+1]);)p++,k+=o[p];i.push(Number.parseInt(k,10))}}if(i.length===0||i.length>3)throw new Error("Invalid time format");if(r&&(i[0]<1||i[0]>12))throw new Error("Invalid time format");(r||t)&&i[0]===12&&(i[0]=0),r==="PM"&&(i[0]=i[0]+12);const[n,s=0,a=0]=i;if(n>23||s>59||a>59)throw new Error("Invalid value");return[n,s,a].map(m).join(":")};var ie=Object.defineProperty,re=Object.getOwnPropertyDescriptor,b=(e,t,o,i)=>{for(var r=i>1?void 0:i?re(t,o):t,n=e.length-1,s;n>=0;n--)(s=e[n])&&(r=(i?s(t,o,r):s(r))||r);return i&&r&&ie(t,o,r),r};const q=e=>{class t extends e{constructor(){super(...arguments),this.minutesStep=null,this.secondsStep=null,this.#t={handleChange:()=>{this.value&&(this._presentationValue=this._toPresentationValue(this.value))}}}get _displaySeconds(){return this.secondsStep!==null}get _use12hClock(){return this.clock?this.clock==="12h":this.locale.timePicker.defaultTo12HourClock}get _timePlaceholder(){let i="hh:mm";return this._displaySeconds&&(i+=":ss"),this._use12hClock&&(i+=" aa"),i}#t;#e;#o(){this.#e=l.Observable.binding(()=>this._use12hClock,this.#t),this.#e.observe(this,l.ExecutionContext.default)}#i(){this.#e.dispose()}connectedCallback(){super.connectedCallback(),this.#o()}disconnectedCallback(){super.disconnectedCallback(),this.#i()}_onPickerButtonClick(){super._onPickerButtonClick(),this._popupOpen&&(l.Updates.process(),this._inlineTimePickerEl.scrollSelectedOptionsToTop())}_onInlineTimePickerChange(i){this._updateValueDueToUserInteraction(this._withUpdatedTime(i.detail),!1)}_onInlineTimePickerLastColumnSelected(){this._closePopup()}}return b([l.attr({attribute:"minutes-step",converter:l.nullableNumberConverter})],t.prototype,"minutesStep",2),b([l.attr({attribute:"seconds-step",converter:l.nullableNumberConverter})],t.prototype,"secondsStep",2),b([l.attr],t.prototype,"clock",2),b([l.volatile],t.prototype,"_use12hClock",1),t};var ne=Object.defineProperty,A=(e,t,o,i)=>{for(var r=void 0,n=e.length-1,s;n>=0;n--)(s=e[n])&&(r=s(t,o,r)||r);return r&&ne(t,o,r),r};const y={fromView:e=>e&&S(e)?e:"",toView(e){return e}};class $ extends q(D.SingleValuePicker(O.PickerField)){constructor(){super(),this._isValidValue=S,this.min="",this.max="",this.proxy.type="time",this.proxy.step="1"}_toPresentationValue(t){return L(t,this._displaySeconds,this._use12hClock)}_parsePresentationValue(t){return F(t,this._use12hClock)}get _timeValue(){return this.value}_withUpdatedTime(t){return t}get _resolvedMinTime(){return this.min||null}get _resolvedMaxTime(){return this.max||null}minChanged(t,o){this.proxy instanceof HTMLInputElement&&(this.proxy.min=o,this.validate())}maxChanged(t,o){this.proxy instanceof HTMLInputElement&&(this.proxy.max=o,this.validate())}get _textFieldPlaceholder(){return this._timePlaceholder}get _pickerButtonIcon(){return"clock-line"}get _pickerButtonLabel(){return this.value?this.locale.timePicker.changeTimeLabel(this._toPresentationValue(this.value)):this.locale.timePicker.chooseTimeLabel}_onPickerButtonClick(){super._onPickerButtonClick(),this._popupOpen&&(l.Updates.process(),this._focusableElsWithinDialog()[0]?.focus())}get _dialogLabel(){return this.locale.timePicker.chooseTimeLabel}_focusableElsWithinDialog(){return this._dialogEl.querySelectorAll("#inline-time-picker, .vwc-button")}_getCustomValidationError(){return this._isPresentationValueInvalid()?this.locale.timePicker.invalidTimeError:null}}A([l.attr({converter:y})],$.prototype,"min");A([l.attr({converter:y})],$.prototype,"max");const se=(e,t)=>{const o=e.tagFor(u);return l.html`
|
|
28
|
+
${C.when(V,_(x))}
|
|
29
|
+
${C.when(M,_(f))}
|
|
30
|
+
</div>`;var te=Object.defineProperty,v=(e,t,o,i)=>{for(var r=void 0,n=e.length-1,s;n>=0;n--)(s=e[n])&&(r=s(t,o,r)||r);return r&&te(t,o,r),r};class u extends z.Localized(l.VividElement){constructor(){super(...arguments),this.minutesStep=1,this.clock="24h",this.focusedPickerClass="focused",this._onFocusOut=()=>{this._clearFocusedClasses()},this._onPointerDown=()=>{this._clearFocusedClasses()}}valueChanged(t,o){o!==void 0&&!S(o)&&(this.value=void 0)}scrollSelectedOptionsToTop(){P.getSelectedOptionValue(this)&&h(this,"hours",P.getSelectedOptionValue(this),"start"),w.getSelectedOptionValue(this)&&h(this,"minutes",w.getSelectedOptionValue(this),"start"),V(this)&&x.getSelectedOptionValue(this)&&h(this,"seconds",x.getSelectedOptionValue(this),"start"),M(this)&&f.getSelectedOptionValue(this)&&h(this,"meridies",f.getSelectedOptionValue(this),"start")}focus(t){this.shadowRoot.querySelector(".picker").focus(t),this._applyFocusedClass()}_applyFocusedClass(){const t=this.shadowRoot.querySelectorAll(".picker");requestAnimationFrame(()=>{const o=this.shadowRoot.activeElement;t.forEach(i=>{i===o?i.parentElement?.classList.add(this.focusedPickerClass):i.parentElement?.classList.remove(this.focusedPickerClass)})})}_clearFocusedClasses(){this.shadowRoot.querySelectorAll(".picker").forEach(o=>{o.parentElement?.classList.remove(this.focusedPickerClass)})}}v([l.observable],u.prototype,"value");v([l.observable],u.prototype,"minutesStep");v([l.observable],u.prototype,"secondsStep");v([l.observable],u.prototype,"clock");v([l.observable],u.prototype,"min");v([l.observable],u.prototype,"max");const oe=':host{display:inline-block}.time-pickers{display:flex;overflow:hidden;justify-content:center;padding:4px;block-size:calc(28px * var(--_inline-time-picker-num-options-visible) + 4px * (var(--_inline-time-picker-num-options-visible) - 1));gap:4px}.time-pickers .picker-wrapper{position:relative;display:flex;flex-direction:column;border-radius:4px}.time-pickers .picker-wrapper.focused:has(.picker:focus-visible){--focus-stroke-gap-color: transparent;--focus-inset: -2px;box-shadow:0 0 0 4px color-mix(in srgb,var(--vvd-color-cta-500),transparent 85%),inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:1px solid var(--focus-stroke-color, var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset, 0px))}.time-pickers .picker{position:relative;display:flex;overflow:hidden scroll;flex-direction:column;padding:0 4px;border-radius:4px;margin:0 -4px;gap:4px;inline-size:50px;list-style:none;scrollbar-width:none}@media (hover: hover){.time-pickers .picker:hover{scrollbar-width:auto}}.time-pickers .picker:after{display:block;flex-shrink:0;block-size:calc(28px * (var(--_inline-time-picker-num-options-visible) - 1) + 4px * (var(--_inline-time-picker-num-options-visible) - 1 - 1));content:""}.time-pickers .picker:focus-visible{outline:none}.time-pickers .option{--_connotation-color-primary: var(--vvd-time-picker-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-firm: var(--vvd-time-picker-accent-firm, var(--vvd-color-canvas-text));--_connotation-color-faint: var(--vvd-time-picker-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-soft: var(--vvd-time-picker-accent-soft, var(--vvd-color-neutral-100));--_connotation-color-dim: var(--vvd-time-picker-accent-dim, var(--vvd-color-neutral-200));--_connotation-color-pale: var(--vvd-time-picker-accent-pale, var(--vvd-color-neutral-300))}.time-pickers .option{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}@media (hover: hover){.time-pickers .option:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}}.time-pickers .option.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}.time-pickers .option:active:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.time-pickers .option.active:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.time-pickers .option.selected:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}@media (hover: hover){.time-pickers .option.selected:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-dim);--_appearance-color-outline: transparent}}.time-pickers .option.selected.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-dim);--_appearance-color-outline: transparent}.time-pickers .option.selected:disabled{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-200);--_appearance-color-outline: transparent}.time-pickers .option.selected.disabled{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-200);--_appearance-color-outline: transparent}.time-pickers .option{display:flex;flex-shrink:0;align-items:center;justify-content:center;border-radius:4px;background-color:var(--_appearance-color-fill);block-size:28px;color:var(--_appearance-color-text);cursor:pointer;font:var(--vvd-typography-base);inline-size:50px}.time-pickers .picker-wrapper:not(.focused) .picker:focus-visible .option.selected{--focus-stroke-gap-color: transparent;box-shadow:0 0 0 4px color-mix(in srgb,var(--vvd-color-cta-500),transparent 85%),inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:1px solid var(--focus-stroke-color, var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset, 0px))}',ie=l.defineVividComponent("inline-time-picker",u,ee,[],{styles:oe,shadowOptions:{delegatesFocus:!0}}),I=(e,t,o)=>{const i=c(e);let n=`${m(o?O(i.hours):i.hours)}:${i.minuteStr}`;return t&&(n+=`:${i.secondStr}`),o&&(n+=` ${i.meridiem}`),n},T=e=>e>="0"&&e<="9",L=(e,t)=>{const o=e.toLowerCase(),i=[];let r;for(let p=0;p<o.length;p++){const d=o[p];if(d==="a"&&o[p+1]==="m"&&(p++,r="AM"),d==="p"&&o[p+1]==="m"&&(p++,r="PM"),T(d)){let k=d;for(;T(o[p+1]);)p++,k+=o[p];i.push(Number.parseInt(k,10))}}if(i.length===0||i.length>3)throw new Error("Invalid time format");if(r&&(i[0]<1||i[0]>12))throw new Error("Invalid time format");(r||t)&&i[0]===12&&(i[0]=0),r==="PM"&&(i[0]=i[0]+12);const[n,s=0,a=0]=i;if(n>23||s>59||a>59)throw new Error("Invalid value");return[n,s,a].map(m).join(":")};var re=Object.defineProperty,ne=Object.getOwnPropertyDescriptor,b=(e,t,o,i)=>{for(var r=i>1?void 0:i?ne(t,o):t,n=e.length-1,s;n>=0;n--)(s=e[n])&&(r=(i?s(t,o,r):s(r))||r);return i&&r&&re(t,o,r),r};const F=e=>{class t extends e{constructor(){super(...arguments),this.minutesStep=null,this.secondsStep=null,this.#t={handleChange:()=>{this.value&&(this._presentationValue=this._toPresentationValue(this.value))}}}get _displaySeconds(){return this.secondsStep!==null}get _use12hClock(){return this.clock?this.clock==="12h":this.locale.timePicker.defaultTo12HourClock}get _timePlaceholder(){let i="hh:mm";return this._displaySeconds&&(i+=":ss"),this._use12hClock&&(i+=" aa"),i}#t;#e;#o(){this.#e=l.Observable.binding(()=>this._use12hClock,this.#t),this.#e.observe(this,l.ExecutionContext.default)}#i(){this.#e.dispose()}connectedCallback(){super.connectedCallback(),this.#o()}disconnectedCallback(){super.disconnectedCallback(),this.#i()}_onPickerButtonClick(){super._onPickerButtonClick(),this._popupOpen&&(l.Updates.process(),this._inlineTimePickerEl.scrollSelectedOptionsToTop())}_onInlineTimePickerChange(i){this._updateValueDueToUserInteraction(this._withUpdatedTime(i.detail),!1)}_onInlineTimePickerLastColumnSelected(){this._closePopup()}}return b([l.attr({attribute:"minutes-step",converter:l.nullableNumberConverter})],t.prototype,"minutesStep",2),b([l.attr({attribute:"seconds-step",converter:l.nullableNumberConverter})],t.prototype,"secondsStep",2),b([l.attr],t.prototype,"clock",2),b([l.volatile],t.prototype,"_use12hClock",1),t};var se=Object.defineProperty,q=(e,t,o,i)=>{for(var r=void 0,n=e.length-1,s;n>=0;n--)(s=e[n])&&(r=s(t,o,r)||r);return r&&se(t,o,r),r};const y={fromView:e=>e&&S(e)?e:"",toView(e){return e}};class $ extends F(D.SingleValuePicker(A.PickerField)){constructor(){super(),this._isValidValue=S,this.min="",this.max="",this.proxy.type="time",this.proxy.step="1"}_toPresentationValue(t){return I(t,this._displaySeconds,this._use12hClock)}_parsePresentationValue(t){return L(t,this._use12hClock)}get _timeValue(){return this.value}_withUpdatedTime(t){return t}get _resolvedMinTime(){return this.min||null}get _resolvedMaxTime(){return this.max||null}minChanged(t,o){this.proxy instanceof HTMLInputElement&&(this.proxy.min=o,this.validate())}maxChanged(t,o){this.proxy instanceof HTMLInputElement&&(this.proxy.max=o,this.validate())}get _textFieldPlaceholder(){return this._timePlaceholder}get _pickerButtonIcon(){return"clock-line"}get _pickerButtonLabel(){return this.value?this.locale.timePicker.changeTimeLabel(this._toPresentationValue(this.value)):this.locale.timePicker.chooseTimeLabel}_onPickerButtonClick(){super._onPickerButtonClick(),this._popupOpen&&(l.Updates.process(),this._focusableElsWithinDialog()[0]?.focus())}get _dialogLabel(){return this.locale.timePicker.chooseTimeLabel}_focusableElsWithinDialog(){return this._dialogEl.querySelectorAll("#inline-time-picker, .vwc-button")}_getCustomValidationError(){return this._isPresentationValueInvalid()?this.locale.timePicker.invalidTimeError:null}}q([l.attr({converter:y})],$.prototype,"min");q([l.attr({converter:y})],$.prototype,"max");const ae=(e,t)=>{const o=e.tagFor(u);return l.html`
|
|
31
31
|
<${o}
|
|
32
32
|
id='inline-time-picker'
|
|
33
|
-
${
|
|
33
|
+
${B.ref("_inlineTimePickerEl")}
|
|
34
34
|
style="--_inline-time-picker-num-options-visible: ${()=>t}"
|
|
35
35
|
tabindex='1'
|
|
36
36
|
:value='${i=>i._timeValue||void 0}'
|
|
@@ -43,4 +43,4 @@
|
|
|
43
43
|
@last-column-selected='${i=>i._onInlineTimePickerLastColumnSelected()}'
|
|
44
44
|
>
|
|
45
45
|
</${o}>
|
|
46
|
-
`};exports.TimePicker=$;exports.TimeSelectionPicker=
|
|
46
|
+
`};exports.TimePicker=$;exports.TimeSelectionPicker=F;exports.TimeSelectionPickerTemplate=ae;exports.ValidTimeFilter=y;exports.compareTimeStr=U;exports.formatPresentationTime=I;exports.inlineTimePickerDefinition=ie;exports.isValidTimeStr=S;exports.parsePresentationTime=L;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { h as S, V as N, o as h, d as H, a as f, n as C, O as R, E as q, U as V, v as j } from "./vivid-element.js";
|
|
2
|
-
import {
|
|
3
|
-
import { S as
|
|
4
|
-
import { s as
|
|
2
|
+
import { P as B } from "./picker-field.template.js";
|
|
3
|
+
import { S as z } from "./single-value-picker.js";
|
|
4
|
+
import { s as U } from "./scrollIntoView.js";
|
|
5
5
|
import { w as O } from "./when.js";
|
|
6
|
+
import { i as W } from "./trapped-focus.js";
|
|
6
7
|
import { r as K } from "./repeat.js";
|
|
7
8
|
import { c as G } from "./class-names.js";
|
|
8
9
|
import { L as J } from "./localized.js";
|
|
@@ -27,7 +28,7 @@ const w = (e) => {
|
|
|
27
28
|
seconds: s,
|
|
28
29
|
meridiem: i < 12 ? "AM" : "PM"
|
|
29
30
|
};
|
|
30
|
-
},
|
|
31
|
+
}, ye = (e, t) => e > t ? 1 : e < t ? -1 : 0, M = (e) => e % 12 || 12, X = (e, t) => e === "AM" && t < 12 || e === "PM" && t >= 12, Y = (e, t, o) => {
|
|
31
32
|
const r = [], i = e ? l(e).hours : 0, n = t ? l(t).hours : 23;
|
|
32
33
|
for (let s = i; s <= n; s++)
|
|
33
34
|
o && !X(o, s) || r.push({
|
|
@@ -158,11 +159,11 @@ const w = (e) => {
|
|
|
158
159
|
const i = e.shadowRoot.querySelector(
|
|
159
160
|
`#${t}-${o}`
|
|
160
161
|
);
|
|
161
|
-
i &&
|
|
162
|
+
i && U(i, i.parentElement, r);
|
|
162
163
|
}, ie = (e, t) => {
|
|
163
164
|
if (t.key === "Tab") {
|
|
164
165
|
const o = e.shadowRoot.querySelectorAll(".picker"), r = t.shiftKey ? o[0] : o[o.length - 1];
|
|
165
|
-
e.shadowRoot.activeElement !== r &&
|
|
166
|
+
e.shadowRoot.activeElement !== r && W(t), e._applyFocusedClass();
|
|
166
167
|
}
|
|
167
168
|
return !0;
|
|
168
169
|
}, L = (e, t) => {
|
|
@@ -288,7 +289,7 @@ v([
|
|
|
288
289
|
v([
|
|
289
290
|
h
|
|
290
291
|
], p.prototype, "max");
|
|
291
|
-
const ae = ':host{display:inline-block}.time-pickers{display:flex;overflow:hidden;justify-content:center;padding:4px;block-size:calc(28px * var(--_inline-time-picker-num-options-visible) + 4px * (var(--_inline-time-picker-num-options-visible) - 1));gap:4px}.time-pickers .picker-wrapper{position:relative;display:flex;flex-direction:column;border-radius:4px}.time-pickers .picker-wrapper.focused:has(.picker:focus-visible){--focus-stroke-gap-color: transparent;--focus-inset: -2px;box-shadow:0 0 0 4px color-mix(in srgb,var(--vvd-color-cta-500),transparent 85%),inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:1px solid var(--focus-stroke-color, var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset, 0px))}.time-pickers .picker{position:relative;display:flex;overflow:hidden scroll;flex-direction:column;padding:0 4px;border-radius:4px;margin:0 -4px;gap:4px;inline-size:50px;list-style:none;scrollbar-width:none}@media (hover: hover){.time-pickers .picker:hover{scrollbar-width:auto}}.time-pickers .picker:after{display:block;flex-shrink:0;block-size:calc(28px * (var(--_inline-time-picker-num-options-visible) - 1) + 4px * (var(--_inline-time-picker-num-options-visible) - 1 - 1));content:""}.time-pickers .picker:focus-visible{outline:none}.time-pickers .option{--_connotation-color-primary: var(--vvd-time-picker-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-firm: var(--vvd-time-picker-accent-firm, var(--vvd-color-canvas-text));--_connotation-color-faint: var(--vvd-time-picker-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-soft: var(--vvd-time-picker-accent-soft, var(--vvd-color-neutral-100));--_connotation-color-dim: var(--vvd-time-picker-accent-dim, var(--vvd-color-neutral-200));--_connotation-color-pale: var(--vvd-time-picker-accent-pale, var(--vvd-color-neutral-300))}.time-pickers .option{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}@media (hover: hover){.time-pickers .option:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}}.time-pickers .option.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}.time-pickers .option:active:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.time-pickers .option.active:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.time-pickers .option.selected:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}@media (hover: hover){.time-pickers .option.selected:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-dim);--_appearance-color-outline: transparent}}.time-pickers .option.selected.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-dim);--_appearance-color-outline: transparent}.time-pickers .option.selected:disabled{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-200);--_appearance-color-outline: transparent}.time-pickers .option.selected.disabled{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-200);--_appearance-color-outline: transparent}.time-pickers .option{display:flex;flex-shrink:0;align-items:center;justify-content:center;border-radius:4px;background-color:var(--_appearance-color-fill);block-size:28px;color:var(--_appearance-color-text);cursor:pointer;font:var(--vvd-typography-base);inline-size:50px}.time-pickers .picker-wrapper:not(.focused) .picker:focus-visible .option.selected{--focus-stroke-gap-color: transparent;box-shadow:0 0 0 4px color-mix(in srgb,var(--vvd-color-cta-500),transparent 85%),inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:1px solid var(--focus-stroke-color, var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset, 0px))}',
|
|
292
|
+
const ae = ':host{display:inline-block}.time-pickers{display:flex;overflow:hidden;justify-content:center;padding:4px;block-size:calc(28px * var(--_inline-time-picker-num-options-visible) + 4px * (var(--_inline-time-picker-num-options-visible) - 1));gap:4px}.time-pickers .picker-wrapper{position:relative;display:flex;flex-direction:column;border-radius:4px}.time-pickers .picker-wrapper.focused:has(.picker:focus-visible){--focus-stroke-gap-color: transparent;--focus-inset: -2px;box-shadow:0 0 0 4px color-mix(in srgb,var(--vvd-color-cta-500),transparent 85%),inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:1px solid var(--focus-stroke-color, var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset, 0px))}.time-pickers .picker{position:relative;display:flex;overflow:hidden scroll;flex-direction:column;padding:0 4px;border-radius:4px;margin:0 -4px;gap:4px;inline-size:50px;list-style:none;scrollbar-width:none}@media (hover: hover){.time-pickers .picker:hover{scrollbar-width:auto}}.time-pickers .picker:after{display:block;flex-shrink:0;block-size:calc(28px * (var(--_inline-time-picker-num-options-visible) - 1) + 4px * (var(--_inline-time-picker-num-options-visible) - 1 - 1));content:""}.time-pickers .picker:focus-visible{outline:none}.time-pickers .option{--_connotation-color-primary: var(--vvd-time-picker-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-firm: var(--vvd-time-picker-accent-firm, var(--vvd-color-canvas-text));--_connotation-color-faint: var(--vvd-time-picker-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-soft: var(--vvd-time-picker-accent-soft, var(--vvd-color-neutral-100));--_connotation-color-dim: var(--vvd-time-picker-accent-dim, var(--vvd-color-neutral-200));--_connotation-color-pale: var(--vvd-time-picker-accent-pale, var(--vvd-color-neutral-300))}.time-pickers .option{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}@media (hover: hover){.time-pickers .option:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}}.time-pickers .option.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}.time-pickers .option:active:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.time-pickers .option.active:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.time-pickers .option.selected:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}@media (hover: hover){.time-pickers .option.selected:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-dim);--_appearance-color-outline: transparent}}.time-pickers .option.selected.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-dim);--_appearance-color-outline: transparent}.time-pickers .option.selected:disabled{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-200);--_appearance-color-outline: transparent}.time-pickers .option.selected.disabled{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-200);--_appearance-color-outline: transparent}.time-pickers .option{display:flex;flex-shrink:0;align-items:center;justify-content:center;border-radius:4px;background-color:var(--_appearance-color-fill);block-size:28px;color:var(--_appearance-color-text);cursor:pointer;font:var(--vvd-typography-base);inline-size:50px}.time-pickers .picker-wrapper:not(.focused) .picker:focus-visible .option.selected{--focus-stroke-gap-color: transparent;box-shadow:0 0 0 4px color-mix(in srgb,var(--vvd-color-cta-500),transparent 85%),inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:1px solid var(--focus-stroke-color, var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset, 0px))}', $e = H(
|
|
292
293
|
"inline-time-picker",
|
|
293
294
|
p,
|
|
294
295
|
ne,
|
|
@@ -427,7 +428,7 @@ const F = {
|
|
|
427
428
|
}
|
|
428
429
|
};
|
|
429
430
|
class D extends de(
|
|
430
|
-
|
|
431
|
+
z(B)
|
|
431
432
|
) {
|
|
432
433
|
// --- Core ---
|
|
433
434
|
constructor() {
|
|
@@ -542,7 +543,7 @@ A([
|
|
|
542
543
|
A([
|
|
543
544
|
f({ converter: F })
|
|
544
545
|
], D.prototype, "max");
|
|
545
|
-
const
|
|
546
|
+
const we = (e, t) => {
|
|
546
547
|
const o = e.tagFor(p);
|
|
547
548
|
return S`
|
|
548
549
|
<${o}
|
|
@@ -565,9 +566,9 @@ const $e = (e, t) => {
|
|
|
565
566
|
export {
|
|
566
567
|
de as T,
|
|
567
568
|
F as V,
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
569
|
+
we as a,
|
|
570
|
+
$e as b,
|
|
571
|
+
ye as c,
|
|
571
572
|
D as d,
|
|
572
573
|
le as f,
|
|
573
574
|
w as i,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const c=new WeakSet,u=s=>{c.add(s)},i=s=>{class r extends s{_trappedFocus(e,a){if(!c.has(e)&&e.key==="Tab"){const t=a(),o=t[0],n=t[t.length-1];if(e.shiftKey){if(this.shadowRoot.activeElement===o)return n.focus(),!0}else if(this.shadowRoot.activeElement===n)return o.focus(),!0}return!1}}return r};exports.TrappedFocus=i;exports.ignoreEventInFocusTraps=u;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const n = /* @__PURE__ */ new WeakSet(), l = (s) => {
|
|
2
|
+
n.add(s);
|
|
3
|
+
}, i = (s) => {
|
|
4
|
+
class c extends s {
|
|
5
|
+
/**
|
|
6
|
+
* @returns Whether focus was trapped.
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
_trappedFocus(e, r) {
|
|
10
|
+
if (!n.has(e) && e.key === "Tab") {
|
|
11
|
+
const t = r(), o = t[0], a = t[t.length - 1];
|
|
12
|
+
if (e.shiftKey) {
|
|
13
|
+
if (this.shadowRoot.activeElement === o)
|
|
14
|
+
return a.focus(), !0;
|
|
15
|
+
} else if (this.shadowRoot.activeElement === a)
|
|
16
|
+
return o.focus(), !0;
|
|
17
|
+
}
|
|
18
|
+
return !1;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return c;
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
i as T,
|
|
25
|
+
l as i
|
|
26
|
+
};
|