@vonage/vivid 5.28.1 → 5.29.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/bundled/definition17.cjs +1 -1
- package/bundled/definition17.js +1 -1
- package/bundled/definition18.cjs +1 -1
- package/bundled/definition18.js +1 -1
- package/bundled/definition25.cjs +4 -4
- package/bundled/definition25.js +4 -4
- package/bundled/definition5.cjs +1 -1
- package/bundled/definition5.js +1 -1
- package/bundled/numberConverter.cjs +1 -1
- package/bundled/numberConverter.js +1 -1
- package/bundled/picker-field.template.cjs +5 -3
- package/bundled/picker-field.template.js +20 -17
- package/bundled/vivid-element.cjs +1 -1
- package/bundled/vivid-element.js +1 -1
- package/color-picker/index.cjs +1 -1
- package/color-picker/index.js +1 -1
- package/custom-elements.json +508 -334
- package/empty-state/index.cjs +2 -2
- package/empty-state/index.js +3 -3
- package/lib/date-picker/date-picker.d.ts +4 -0
- package/lib/date-range-picker/date-range-picker.d.ts +2 -0
- package/lib/date-time-picker/date-time-picker.d.ts +4 -0
- package/lib/empty-state/definition.d.ts +1 -1
- package/lib/empty-state/empty-state.d.ts +3 -1
- package/lib/number-field/definition.d.ts +1 -1
- package/lib/number-field/number-field.d.ts +3 -1
- package/lib/rich-text-editor/rte/features/suggest.d.ts +7 -1
- package/lib/time-picker/time-picker.d.ts +2 -0
- package/listbox/index.cjs +1 -1
- package/listbox/index.js +1 -1
- package/locales/de-DE.cjs +1 -1
- package/locales/de-DE.js +1 -1
- package/locales/en-GB.cjs +1 -1
- package/locales/en-GB.js +1 -1
- package/locales/ja-JP.cjs +1 -1
- package/locales/ja-JP.js +1 -1
- package/locales/zh-CN.cjs +1 -1
- package/locales/zh-CN.js +1 -1
- package/number-field/index.cjs +16 -14
- package/number-field/index.js +49 -31
- package/package.json +16 -16
- package/rich-text-editor/index.cjs +14 -14
- package/rich-text-editor/index.js +1818 -1789
- package/shared/picker-field/mixins/calendar-picker.d.ts +1 -0
- package/shared/picker-field/mixins/calendar-picker.template.d.ts +1 -0
- package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +1 -0
- package/shared/picker-field/mixins/single-date-picker.d.ts +1 -0
- package/shared/picker-field/mixins/single-value-picker.d.ts +1 -0
- package/shared/picker-field/mixins/time-selection-picker.d.ts +1 -0
- package/shared/picker-field/mixins/time-selection-picker.template.d.ts +2 -0
- package/shared/picker-field/picker-field.d.ts +38 -31
- package/tabs/index.cjs +1 -1
- package/tabs/index.js +1 -1
- package/unbundled/definition16.cjs +1 -1
- package/unbundled/definition16.js +1 -1
- package/unbundled/definition2.cjs +4 -4
- package/unbundled/definition2.js +4 -4
- package/unbundled/definition28.cjs +5 -1
- package/unbundled/definition28.js +5 -1
- package/unbundled/definition29.cjs +1 -1
- package/unbundled/definition29.js +1 -1
- package/unbundled/definition30.cjs +1 -1
- package/unbundled/definition30.js +1 -1
- package/unbundled/definition42.cjs +3 -2
- package/unbundled/definition42.js +3 -2
- package/unbundled/definition50.cjs +1 -1
- package/unbundled/definition50.js +1 -1
- package/unbundled/definition55.cjs +41 -8
- package/unbundled/definition55.js +41 -8
- package/unbundled/definition6.cjs +1 -1
- package/unbundled/definition6.js +1 -1
- package/unbundled/definition63.cjs +43 -19
- package/unbundled/definition63.js +38 -14
- package/unbundled/definition76.cjs +1 -1
- package/unbundled/definition76.js +1 -1
- package/unbundled/en-US.cjs +1 -1
- package/unbundled/en-US.js +1 -1
- package/unbundled/numberConverter.cjs +1 -1
- package/unbundled/numberConverter.js +1 -1
- package/unbundled/picker-field.template.cjs +6 -1
- package/unbundled/picker-field.template.js +6 -1
- package/unbundled/vivid-element.cjs +1 -1
- package/unbundled/vivid-element.js +1 -1
- package/video-player/index.cjs +1 -1
- package/video-player/index.js +1 -1
- package/vivid.api.json +158 -3
package/empty-state/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const e=require("../bundled/vivid-element.cjs"),t=require("../bundled/slotted.cjs"),n=require("../bundled/when.cjs"),r=require("../bundled/decorate.cjs"),i=require("../bundled/class-names.cjs"),a=require("../bundled/definition2.cjs"),o=require("../bundled/icon.cjs"),s=require("../bundled/component-enum.cjs");var c=`:host{display:block}.base{--_empty-state-icon-container:120px;--_empty-state-icon-
|
|
2
|
-
class="${e=>i.t(`base`,`connotation-${l.parse(e.connotation)}`,[`no-actions`,e.slottedActionItems?.length===0])}"
|
|
1
|
+
const e=require("../bundled/vivid-element.cjs"),t=require("../bundled/slotted.cjs"),n=require("../bundled/when.cjs"),r=require("../bundled/decorate.cjs"),i=require("../bundled/class-names.cjs"),a=require("../bundled/definition2.cjs"),o=require("../bundled/icon.cjs"),s=require("../bundled/component-enum.cjs");var c=`:host{display:block}.base{--_empty-state-icon-container:120px;--_empty-state-icon-font-size:40px;--_empty-state-box-shadow:20px;--_empty-state-icon-padding:20px;--_empty-state-border-width:1px;--_empty-state-gap:24px;box-sizing:border-box;justify-content:center;align-items:center;gap:var(--_empty-state-gap);flex-direction:column;block-size:100%;display:flex}.base.size-condensed{--_empty-state-icon-container:80px;--_empty-state-icon-font-size:28px;--_empty-state-box-shadow:14px;--_empty-state-icon-padding:12px;--_empty-state-border-width:1px;--_empty-state-gap:16px}.base.size-expanded{--_empty-state-icon-container:240px;--_empty-state-icon-font-size:80px;--_empty-state-box-shadow:40px;--_empty-state-icon-padding:38px;--_empty-state-border-width:2px;--_empty-state-gap:24px}.icon-container{block-size:var(--_empty-state-icon-container);box-shadow:inset 0 0 0 var(--_empty-state-box-shadow) color-mix(in sRGB, var(--_connotation-color-primary), transparent 90%);font-size:var(--_empty-state-icon-font-size);inline-size:var(--_empty-state-icon-container);border-radius:50%;justify-content:center;align-items:center;display:flex}.icon-container .icon{padding:var(--_empty-state-icon-padding);border:var(--_empty-state-border-width) solid var(--_connotation-color-dim);border-radius:inherit;color:var(--_connotation-color-firm-all)}.content{color:var(--vvd-color-canvas-text);font:var(--vvd-typography-base);text-align:center;flex-direction:column;gap:8px;display:flex}header{color:var(--_connotation-color-firm-all);font:var(--vvd-typography-base-extended-bold)}.actions{flex-wrap:wrap;justify-content:center;align-items:center;gap:8px;display:flex}.base.no-actions .actions{display:none}`,l=s.t([`accent`,`cta`,`success`,`alert`,`warning`,`information`],`accent`),u=class extends e.t{};r.t([e.m],u.prototype,`connotation`,void 0),r.t([e.m],u.prototype,`headline`,void 0),r.t([e.m],u.prototype,`size`,void 0),r.t([e.m],u.prototype,`icon`,void 0),r.t([e.m({attribute:`icon-decoration`})],u.prototype,`iconDecoration`,void 0),r.t([e.A],u.prototype,`slottedActionItems`,void 0);var d=e.u(`empty-state`,u,r=>{let a=r.tagFor(o.t);return e.p` <div
|
|
2
|
+
class="${e=>i.t(`base`,`connotation-${l.parse(e.connotation)}`,[`no-actions`,e.slottedActionItems?.length===0],[`size-${e.size}`,!!e.size])}"
|
|
3
3
|
aria-labelledby="${e=>e.headline?`empty-state-headline`:null}"
|
|
4
4
|
>
|
|
5
5
|
<slot name="graphic">
|
package/empty-state/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { t as u } from "../bundled/definition2.js";
|
|
|
7
7
|
import { t as d } from "../bundled/icon.js";
|
|
8
8
|
import { t as f } from "../bundled/component-enum.js";
|
|
9
9
|
//#region src/lib/empty-state/empty-state.scss?inline
|
|
10
|
-
var p = ":host{display:block}.base{--_empty-state-icon-container:120px;--_empty-state-icon-
|
|
10
|
+
var p = ":host{display:block}.base{--_empty-state-icon-container:120px;--_empty-state-icon-font-size:40px;--_empty-state-box-shadow:20px;--_empty-state-icon-padding:20px;--_empty-state-border-width:1px;--_empty-state-gap:24px;box-sizing:border-box;justify-content:center;align-items:center;gap:var(--_empty-state-gap);flex-direction:column;block-size:100%;display:flex}.base.size-condensed{--_empty-state-icon-container:80px;--_empty-state-icon-font-size:28px;--_empty-state-box-shadow:14px;--_empty-state-icon-padding:12px;--_empty-state-border-width:1px;--_empty-state-gap:16px}.base.size-expanded{--_empty-state-icon-container:240px;--_empty-state-icon-font-size:80px;--_empty-state-box-shadow:40px;--_empty-state-icon-padding:38px;--_empty-state-border-width:2px;--_empty-state-gap:24px}.icon-container{block-size:var(--_empty-state-icon-container);box-shadow:inset 0 0 0 var(--_empty-state-box-shadow) color-mix(in sRGB, var(--_connotation-color-primary), transparent 90%);font-size:var(--_empty-state-icon-font-size);inline-size:var(--_empty-state-icon-container);border-radius:50%;justify-content:center;align-items:center;display:flex}.icon-container .icon{padding:var(--_empty-state-icon-padding);border:var(--_empty-state-border-width) solid var(--_connotation-color-dim);border-radius:inherit;color:var(--_connotation-color-firm-all)}.content{color:var(--vvd-color-canvas-text);font:var(--vvd-typography-base);text-align:center;flex-direction:column;gap:8px;display:flex}header{color:var(--_connotation-color-firm-all);font:var(--vvd-typography-base-extended-bold)}.actions{flex-wrap:wrap;justify-content:center;align-items:center;gap:8px;display:flex}.base.no-actions .actions{display:none}", m = f([
|
|
11
11
|
"accent",
|
|
12
12
|
"cta",
|
|
13
13
|
"success",
|
|
@@ -15,13 +15,13 @@ var p = ":host{display:block}.base{--_empty-state-icon-container:120px;--_empty-
|
|
|
15
15
|
"warning",
|
|
16
16
|
"information"
|
|
17
17
|
], "accent"), h = class extends i {};
|
|
18
|
-
c([n], h.prototype, "connotation", void 0), c([n], h.prototype, "headline", void 0), c([n], h.prototype, "icon", void 0), c([n({ attribute: "icon-decoration" })], h.prototype, "iconDecoration", void 0), c([e], h.prototype, "slottedActionItems", void 0);
|
|
18
|
+
c([n], h.prototype, "connotation", void 0), c([n], h.prototype, "headline", void 0), c([n], h.prototype, "size", void 0), c([n], h.prototype, "icon", void 0), c([n({ attribute: "icon-decoration" })], h.prototype, "iconDecoration", void 0), c([e], h.prototype, "slottedActionItems", void 0);
|
|
19
19
|
//#endregion
|
|
20
20
|
//#region src/lib/empty-state/definition.ts
|
|
21
21
|
var g = a("empty-state", h, (e) => {
|
|
22
22
|
let t = e.tagFor(d);
|
|
23
23
|
return r` <div
|
|
24
|
-
class="${(e) => l("base", `connotation-${m.parse(e.connotation)}`, ["no-actions", e.slottedActionItems?.length === 0])}"
|
|
24
|
+
class="${(e) => l("base", `connotation-${m.parse(e.connotation)}`, ["no-actions", e.slottedActionItems?.length === 0], [`size-${e.size}`, !!e.size])}"
|
|
25
25
|
aria-labelledby="${(e) => e.headline ? "empty-state-headline" : null}"
|
|
26
26
|
>
|
|
27
27
|
<slot name="graphic">
|
|
@@ -51,6 +51,7 @@ declare const DatePicker_base: (abstract new (...args: any[]) => {
|
|
|
51
51
|
scale?: import('../text-field/text-field').TextFieldSize;
|
|
52
52
|
readOnly: boolean;
|
|
53
53
|
readOnlyChanged(): void;
|
|
54
|
+
appearance?: import('../../shared/picker-field/picker-field').PickerFieldAppearance;
|
|
54
55
|
_textFieldEl: import('../components').VwcTextFieldElement;
|
|
55
56
|
_dialogEl: HTMLElement;
|
|
56
57
|
_pickerButtonEl: import('../components').VwcButtonElement;
|
|
@@ -1011,6 +1012,7 @@ declare const DatePicker_base: (abstract new (...args: any[]) => {
|
|
|
1011
1012
|
scale?: import('../text-field/text-field').TextFieldSize;
|
|
1012
1013
|
readOnly: boolean;
|
|
1013
1014
|
readOnlyChanged(): void;
|
|
1015
|
+
appearance?: import('../../shared/picker-field/picker-field').PickerFieldAppearance;
|
|
1014
1016
|
_textFieldEl: import('../components').VwcTextFieldElement;
|
|
1015
1017
|
_dialogEl: HTMLElement;
|
|
1016
1018
|
_pickerButtonEl: import('../components').VwcButtonElement;
|
|
@@ -2000,6 +2002,7 @@ declare const DatePicker_base: (abstract new (...args: any[]) => {
|
|
|
2000
2002
|
scale?: import('../text-field/text-field').TextFieldSize;
|
|
2001
2003
|
readOnly: boolean;
|
|
2002
2004
|
readOnlyChanged(): void;
|
|
2005
|
+
appearance?: import('../../shared/picker-field/picker-field').PickerFieldAppearance;
|
|
2003
2006
|
_textFieldEl: import('../components').VwcTextFieldElement;
|
|
2004
2007
|
_dialogEl: HTMLElement;
|
|
2005
2008
|
_pickerButtonEl: import('../components').VwcButtonElement;
|
|
@@ -2988,6 +2991,7 @@ declare const DatePicker_base: (abstract new (...args: any[]) => {
|
|
|
2988
2991
|
scale?: import('../text-field/text-field').TextFieldSize;
|
|
2989
2992
|
readOnly: boolean;
|
|
2990
2993
|
readOnlyChanged(): void;
|
|
2994
|
+
appearance?: import('../../shared/picker-field/picker-field').PickerFieldAppearance;
|
|
2991
2995
|
_textFieldEl: import('../components').VwcTextFieldElement;
|
|
2992
2996
|
_dialogEl: HTMLElement;
|
|
2993
2997
|
_pickerButtonEl: import('../components').VwcButtonElement;
|
|
@@ -52,6 +52,7 @@ declare const DateRangePicker_base: (abstract new (...args: any[]) => {
|
|
|
52
52
|
scale?: import('../text-field/text-field').TextFieldSize;
|
|
53
53
|
readOnly: boolean;
|
|
54
54
|
readOnlyChanged(): void;
|
|
55
|
+
appearance?: import('../../shared/picker-field/picker-field').PickerFieldAppearance;
|
|
55
56
|
_textFieldEl: import('../components').VwcTextFieldElement;
|
|
56
57
|
_dialogEl: HTMLElement;
|
|
57
58
|
_pickerButtonEl: import('../components').VwcButtonElement;
|
|
@@ -1040,6 +1041,7 @@ declare const DateRangePicker_base: (abstract new (...args: any[]) => {
|
|
|
1040
1041
|
scale?: import('../text-field/text-field').TextFieldSize;
|
|
1041
1042
|
readOnly: boolean;
|
|
1042
1043
|
readOnlyChanged(): void;
|
|
1044
|
+
appearance?: import('../../shared/picker-field/picker-field').PickerFieldAppearance;
|
|
1043
1045
|
_textFieldEl: import('../components').VwcTextFieldElement;
|
|
1044
1046
|
_dialogEl: HTMLElement;
|
|
1045
1047
|
_pickerButtonEl: import('../components').VwcButtonElement;
|
|
@@ -38,6 +38,7 @@ declare const DateTimePicker_base: (abstract new (...args: any[]) => {
|
|
|
38
38
|
scale?: import('../text-field/text-field').TextFieldSize;
|
|
39
39
|
readOnly: boolean;
|
|
40
40
|
readOnlyChanged(): void;
|
|
41
|
+
appearance?: import('../../shared/picker-field/picker-field').PickerFieldAppearance;
|
|
41
42
|
_textFieldEl: import('../components').VwcTextFieldElement;
|
|
42
43
|
_dialogEl: HTMLElement;
|
|
43
44
|
_pickerButtonEl: import('../components').VwcButtonElement;
|
|
@@ -1023,6 +1024,7 @@ declare const DateTimePicker_base: (abstract new (...args: any[]) => {
|
|
|
1023
1024
|
scale?: import('../text-field/text-field').TextFieldSize;
|
|
1024
1025
|
readOnly: boolean;
|
|
1025
1026
|
readOnlyChanged(): void;
|
|
1027
|
+
appearance?: import('../../shared/picker-field/picker-field').PickerFieldAppearance;
|
|
1026
1028
|
_textFieldEl: import('../components').VwcTextFieldElement;
|
|
1027
1029
|
_dialogEl: HTMLElement;
|
|
1028
1030
|
_pickerButtonEl: import('../components').VwcButtonElement;
|
|
@@ -1983,6 +1985,7 @@ declare const DateTimePicker_base: (abstract new (...args: any[]) => {
|
|
|
1983
1985
|
scale?: import('../text-field/text-field').TextFieldSize;
|
|
1984
1986
|
readOnly: boolean;
|
|
1985
1987
|
readOnlyChanged(): void;
|
|
1988
|
+
appearance?: import('../../shared/picker-field/picker-field').PickerFieldAppearance;
|
|
1986
1989
|
_textFieldEl: import('../components').VwcTextFieldElement;
|
|
1987
1990
|
_dialogEl: HTMLElement;
|
|
1988
1991
|
_pickerButtonEl: import('../components').VwcButtonElement;
|
|
@@ -2968,6 +2971,7 @@ declare const DateTimePicker_base: (abstract new (...args: any[]) => {
|
|
|
2968
2971
|
scale?: import('../text-field/text-field').TextFieldSize;
|
|
2969
2972
|
readOnly: boolean;
|
|
2970
2973
|
readOnlyChanged(): void;
|
|
2974
|
+
appearance?: import('../../shared/picker-field/picker-field').PickerFieldAppearance;
|
|
2971
2975
|
_textFieldEl: import('../components').VwcTextFieldElement;
|
|
2972
2976
|
_dialogEl: HTMLElement;
|
|
2973
2977
|
_pickerButtonEl: import('../components').VwcButtonElement;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { EmptyState } from './empty-state';
|
|
2
|
-
export type { EmptyStateConnotation, EmptyStateIconDecoration, } from './empty-state';
|
|
2
|
+
export type { EmptyStateConnotation, EmptyStateIconDecoration, EmptyStateSize, } from './empty-state';
|
|
3
3
|
export declare const registerEmptyState: (prefix?: string) => void;
|
|
4
4
|
export { EmptyState as VwcEmptyStateElement };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IconDecoration } from '../enums.js';
|
|
1
|
+
import { IconDecoration, Size } from '../enums.js';
|
|
2
2
|
import { VividElement } from '../../shared/foundation/vivid-element/vivid-element';
|
|
3
3
|
import { ExtractFromEnum } from '../../shared/utils/enums';
|
|
4
4
|
import { ComponentEnum } from '../../shared/utils/component-enum.ts';
|
|
@@ -8,9 +8,11 @@ export declare const emptyStateConnotation: {
|
|
|
8
8
|
};
|
|
9
9
|
export type EmptyStateConnotation = ComponentEnum<typeof emptyStateConnotation>;
|
|
10
10
|
export type EmptyStateIconDecoration = ExtractFromEnum<IconDecoration, IconDecoration.Filled | IconDecoration.Outlined>;
|
|
11
|
+
export type EmptyStateSize = ExtractFromEnum<Size, Size.Condensed | Size.Normal | Size.Expanded>;
|
|
11
12
|
export declare class EmptyState extends VividElement {
|
|
12
13
|
connotation?: EmptyStateConnotation;
|
|
13
14
|
headline?: string;
|
|
15
|
+
size?: EmptyStateSize;
|
|
14
16
|
icon?: string;
|
|
15
17
|
iconDecoration?: EmptyStateIconDecoration;
|
|
16
18
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { NumberField } from './number-field';
|
|
2
|
-
export type { NumberFieldAppearance, NumberFieldShape } from './number-field';
|
|
2
|
+
export type { NumberFieldAppearance, NumberFieldShape, NumberFieldStep, } from './number-field';
|
|
3
3
|
export declare const registerNumberField: (prefix?: string) => void;
|
|
4
4
|
export { NumberField as VwcNumberFieldElement };
|
|
@@ -9,6 +9,7 @@ export declare const numberFieldAppearance: {
|
|
|
9
9
|
export type NumberFieldAppearance = ComponentEnum<typeof numberFieldAppearance>;
|
|
10
10
|
export type NumberFieldShape = ExtractFromEnum<Shape, Shape.Rounded | Shape.Pill>;
|
|
11
11
|
export type NumberFieldSize = ExtractFromEnum<Size, Size.Condensed | Size.Normal>;
|
|
12
|
+
export type NumberFieldStep = number | 'any';
|
|
12
13
|
declare const NumberField_base: {
|
|
13
14
|
new (...args: any[]): {
|
|
14
15
|
_contextualHelpSlottedContent?: HTMLElement[];
|
|
@@ -4010,7 +4011,8 @@ export declare class NumberField extends NumberField_base {
|
|
|
4010
4011
|
minlength: number;
|
|
4011
4012
|
size: number;
|
|
4012
4013
|
scale?: NumberFieldSize;
|
|
4013
|
-
step:
|
|
4014
|
+
step: NumberFieldStep;
|
|
4015
|
+
noSteppers: boolean;
|
|
4014
4016
|
max: number;
|
|
4015
4017
|
min: number;
|
|
4016
4018
|
get valueAsNumber(): number;
|
|
@@ -2,11 +2,17 @@ import { RteFragment } from '../document';
|
|
|
2
2
|
export interface Suggestion {
|
|
3
3
|
text: string;
|
|
4
4
|
textSecondary?: string;
|
|
5
|
+
icon?: string;
|
|
5
6
|
data?: unknown;
|
|
6
7
|
}
|
|
8
|
+
export interface SuggestionGroup {
|
|
9
|
+
label: string;
|
|
10
|
+
suggestions: Suggestion[];
|
|
11
|
+
}
|
|
12
|
+
export type SuggestionEntry = Suggestion | SuggestionGroup;
|
|
7
13
|
export interface RteSuggestFeatureOptions {
|
|
8
14
|
pattern: RegExp;
|
|
9
|
-
load: (match: string[]) =>
|
|
15
|
+
load: (match: string[]) => SuggestionEntry[] | Promise<SuggestionEntry[]>;
|
|
10
16
|
select: (suggestion: Suggestion) => RteFragment;
|
|
11
17
|
}
|
|
12
18
|
export declare const RteSuggestFeature: {
|
|
@@ -39,6 +39,7 @@ declare const TimePicker_base: (abstract new (...args: any[]) => {
|
|
|
39
39
|
scale?: import('../text-field/text-field').TextFieldSize;
|
|
40
40
|
readOnly: boolean;
|
|
41
41
|
readOnlyChanged(): void;
|
|
42
|
+
appearance?: import('../../shared/picker-field/picker-field').PickerFieldAppearance;
|
|
42
43
|
_textFieldEl: import('../components').VwcTextFieldElement;
|
|
43
44
|
_dialogEl: HTMLElement;
|
|
44
45
|
_pickerButtonEl: import('../components').VwcButtonElement;
|
|
@@ -988,6 +989,7 @@ declare const TimePicker_base: (abstract new (...args: any[]) => {
|
|
|
988
989
|
scale?: import('../text-field/text-field').TextFieldSize;
|
|
989
990
|
readOnly: boolean;
|
|
990
991
|
readOnlyChanged(): void;
|
|
992
|
+
appearance?: import('../../shared/picker-field/picker-field').PickerFieldAppearance;
|
|
991
993
|
_textFieldEl: import('../components').VwcTextFieldElement;
|
|
992
994
|
_dialogEl: HTMLElement;
|
|
993
995
|
_pickerButtonEl: import('../components').VwcButtonElement;
|
package/listbox/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const e=require("../bundled/vivid-element.cjs"),t=require("../bundled/slotted.cjs"),n=require("../bundled/when.cjs"),r=require("../bundled/decorate.cjs"),i=require("../bundled/aria-binding-directive.cjs"),a=require("../bundled/host-semantics.cjs"),o=require("../bundled/option.cjs"),s=require("../bundled/optgroup.cjs"),c=require("../bundled/extractOptions.cjs");function l(e,t,n,r){let i=[];for(let t of e){t._vvdSearchText=r;let e=!r||n(t,r);t._isNotMatching=!e,!t.hidden&&!t.disabled&&e&&i.push(t)}for(let e of t)if(s.n(e)){let t=Array.from(e.children).some(e=>o.n(e)&&!e._isNotMatching&&!e.hidden);e.style.display=t?``:`none`}return i}var u=t=>{class n extends t{constructor(...e){super(...e),this.searchText=``,this._filteredOptions=[]}_slottedOptionsChanged(){super._slottedOptionsChanged(),this._updateFilter()}searchTextChanged(){this._updateFilter()}optionFilterChanged(){this._updateFilter()}_updateFilter(){this._filteredOptions=l(this._slottedOptions,this._slottedElements,this.optionFilter??((e,t)=>e.text.toLowerCase().includes(t.toLowerCase())),this.searchText)}}return r.t([e.m({attribute:`search-text`,mode:`fromView`})],n.prototype,`searchText`,void 0),r.t([e.A],n.prototype,`optionFilter`,void 0),r.t([e.A],n.prototype,`_filteredOptions`,void 0),n},d=t=>{class n extends t{constructor(...e){super(...e),this._slottedElements=[],this.#e=()=>{this._slottedElementsChanged()},this._slottedOptions=[]}_slottedElementsChanged(){this._slottedOptions=c.t(this._slottedElements)}#e;connectedCallback(){super.connectedCallback(),this.addEventListener(`optgroup-change`,this.#e)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`optgroup-change`,this.#e)}_slottedOptionsChanged(){for(let e of this._slottedOptions)e.id||=i.r(`option-`)}}return r.t([e.A],n.prototype,`_slottedElements`,void 0),r.t([e.A],n.prototype,`_slottedOptions`,void 0),n},f=e.p`<slot
|
|
2
2
|
${t.t({filter:(e=>o.n(e)||s.n(e)),flatten:!0,property:`_slottedElements`})}
|
|
3
3
|
>
|
|
4
|
-
</slot>`,p=e=>{let t=e.ctrlKey||e.metaKey;return e.shiftKey&&t?`ShiftMod`:e.shiftKey?`Shift`:t?`Mod`:null},m=(e,t,n,r)=>{if(n.amount===`step`&&r===`Mod`)return null;if(t.selectionMode===`multiple`){if(n.amount===`step`&&r===`Shift`)return{action:{type:`extend-from-anchor`,anchorIndex:e.rangeAnchorIndex??e.activeIndex},replaceExisting:!1};if(n.amount===`limit`&&r===`ShiftMod`)return{action:{type:`select-from-current`},replaceExisting:!1}}return t.selectionBehavior===`replace`?{action:{type:`select`},replaceExisting:!0}:null},h=(e,t)=>t===`Shift`?{action:{type:`select-from-most-recent`},replaceExisting:e.selectionBehavior===`replace`}:t===`Mod`?{action:{type:`toggle`},replaceExisting:!1}:e.selectionBehavior===`replace`?{action:{type:`select`},replaceExisting:!0}:{action:{type:`toggle`},replaceExisting:!1};function g(e,t,n,r){let i=new Set(e),[a,o]=[n,r].sort((e,t)=>e-t),s=[...e];for(let e=a;e<=o;e++){let n=t.selectable.optionValue(e);i.has(n)||s.push(n)}return s}function _(e,t,n,r,i){let a=new Set(e),[o,,s]=[n,r,i].sort((e,t)=>e-t),c=[...e];for(let e=o;e<=s;e++){let i=t.selectable.optionValue(e);e<n&&e<r||e>n&&e>r?a.has(i)&&(c=c.filter(e=>e!==i)):a.has(i)||c.push(i)}return c}function v(e,t){let n=e.values;for(let e=n.length-1;e>=0;e--){let r=t.selectable.optionIndex(n[e]);if(r!==null)return r}return null}function y(e,t,n){let r=t=>({...e,values:t.values??e.values,activeIndex:t.activeIndex??e.activeIndex,rangeAnchorIndex:t.rangeAnchorIndex??null});if(n.type!==`action`)return r({});let i=e.values,{targetIndex:a,selection:o}=n,s=e=>t.selectionMode===`single`&&e.length>1?[e[e.length-1]]:t.requiredSelection!==`none`&&(e.length===0||t.requiredSelection===`selectable`&&!e.some(e=>t.selectable.optionIndex(e)!==null))?i:e,c=t.selectable.optionValue(a),l=o?.replaceExisting?[]:i;switch(o?.action.type){case void 0:return r({activeIndex:a});case`select`:return r({activeIndex:a,values:s(i.includes(c)?i:[...l,c])});case`toggle`:return r({activeIndex:a,values:s(i.includes(c)?l.filter(e=>e!==c):[...l,c])});case`select-from-current`:return r({activeIndex:a,values:s(g(l,t,e.activeIndex,a))});case`select-from-most-recent`:return r({activeIndex:a,values:s(g(l,t,v(e,t)??0,a))});case`extend-from-anchor`:return r({values:s(_(l,t,o.action.anchorIndex,a,e.activeIndex)),activeIndex:a,rangeAnchorIndex:o.action.anchorIndex})}}var b=2e3;function x(e,t,n,r){let i=e.typeahead&&e.typeahead.lastInputMs>r-b?e.typeahead:null;return n.length===1&&!(n===` `&&!i)?{buffer:(i?.buffer??``)+n,lastInputMs:r}:null}function S(e,t,n){if(n.type!==`typeahead`)return{...e,typeahead:null};let r=n.typeahead;for(let i=(e.activeIndex+1)%t.selectable.numOptions;i!==e.activeIndex;i=(i+1)%t.selectable.numOptions)if(t.selectable.optionText(i).toLowerCase().startsWith(r.buffer.toLowerCase()))return{...y(e,t,{type:`action`,targetIndex:i,selection:n.selection}),typeahead:r};return{...e,typeahead:r}}var C=e=>({numOptions:e.length,optionValue:t=>e[t].value,optionText:t=>e[t].text,optionIndex:t=>{let n=e.findIndex(e=>e.value===t);return n===-1?null:n},isEq:t=>e===t});function w(e,t,n){let r=t.filter(e=>e.selected||n.includes(e.value)).map(e=>e.value),i=e.selectionMode===`single`?1:1/0;return D(e,r.slice(0,i),i)}function T(e){return`activeIndex`in e}function E(e,t,n){let r=n.filter(e=>t.all.optionIndex(e)!==null),i=t.selectionMode===`single`?1:1/0,a=r.slice(0,i);return a=D(t,a,i),{...e,values:a}}function D(e,t,n){return e.requiredSelection===`none`||e.selectable.numOptions===0?t:t.length===0?[e.selectable.optionValue(0)]:e.requiredSelection===`selectable`&&!t.some(t=>e.selectable.optionIndex(t)!==null)?n===1?[e.selectable.optionValue(0)]:[...t,e.selectable.optionValue(0)]:t}function O(e,t,n){let r=w(e,t,n);if(e.selectable.numOptions===0)return k(r);let i=0;for(let t of r){let n=e.selectable.optionIndex(t);if(n!==null){i=n;break}}return{values:r,activeIndex:i,typeahead:null,rangeAnchorIndex:null}}function k(e){return{values:e}}function A(e){switch(e){case`Home`:return{direction:`backward`,amount:`limit`};case`End`:return{direction:`forward`,amount:`limit`};case`PageUp`:return{direction:`backward`,amount:`page`};case`PageDown`:return{direction:`forward`,amount:`page`};case`ArrowUp`:return{direction:`backward`,amount:`step`};case`ArrowDown`:return{direction:`forward`,amount:`step`}}return null}function j(e,t,n,r){let i={backward:0,forward:t-1},a={backward:-1,forward:1},o={step:1,page:n};switch(r.amount){case`limit`:return i[r.direction];case`page`:case`step`:return Math.min(i.forward,Math.max(i.backward,e+a[r.direction]*o[r.amount]))}}var M=10;function N(e,t,n,r){if(!T(e))return null;let i=x(e,t,n.key,r);if(i)return{type:`typeahead`,typeahead:i,selection:t.selectionBehavior===`replace`?{action:{type:`select`},replaceExisting:!0}:null};let a=A(n.key);return a?{type:`action`,targetIndex:j(e.activeIndex,t.selectable.numOptions,M,a),selection:m(e,t,a,p(n))}:n.key===` `?{type:`action`,targetIndex:e.activeIndex,selection:h(t,p(n))}:null}function P(e,t,n,r){return{type:`action`,targetIndex:r,selection:h(t,p(n))}}function F(e,t,n){return e=S(e,t,n),e=y(e,t,n),e}var I=e=>typeof e==`object`&&!!e&&e.nodeType===1,L=(e,t)=>(!t||e!==`hidden`)&&e!==`visible`&&e!==`clip`,R=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let n=getComputedStyle(e,null);return L(n.overflowY,t)||L(n.overflowX,t)||(e=>{let t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch{return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},z=(e,t,n,r,i,a,o,s)=>a<e&&o>t||a>e&&o<t?0:a<=e&&s<=n||o>=t&&s>=n?a-e-r:o>t&&s<n||a<e&&s>n?o-t+i:0,B=e=>e.parentElement??(e.getRootNode().host||null),V=(e,t)=>{if(typeof document>`u`)return[];let{scrollMode:n,block:r,inline:i,boundary:a,skipOverflowHiddenElements:o}=t,s=typeof a==`function`?a:e=>e!==a;if(!I(e))throw TypeError(`Invalid target`);let c=document.scrollingElement||document.documentElement,l=[],u=e;for(;I(u)&&s(u);){if(u=B(u),u===c){l.push(u);break}u!=null&&u===document.body&&R(u)&&!R(document.documentElement)||u!=null&&R(u,o)&&l.push(u)}let d=window.visualViewport?.width??innerWidth,f=window.visualViewport?.height??innerHeight,{scrollX:p,scrollY:m}=window,{height:h,width:g,top:_,right:v,bottom:y,left:b}=e.getBoundingClientRect(),{top:x,right:S,bottom:C,left:w}=(e=>{let t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e),T=r===`start`||r===`nearest`?_-x:r===`end`?y+C:_+h/2-x+C,E=i===`center`?b+g/2-w+S:i===`end`?v+S:b-w,D=[];for(let e=0;e<l.length;e++){let t=l[e],{height:a,width:o,top:s,right:u,bottom:x,left:S}=t.getBoundingClientRect();if(n===`if-needed`&&_>=0&&b>=0&&y<=f&&v<=d&&(t===c&&!R(t)||_>=s&&y<=x&&b>=S&&v<=u))return D;let C=getComputedStyle(t),w=parseInt(C.borderLeftWidth,10),O=parseInt(C.borderTopWidth,10),k=parseInt(C.borderRightWidth,10),A=parseInt(C.borderBottomWidth,10),j=0,M=0,N=`offsetWidth`in t?t.offsetWidth-t.clientWidth-w-k:0,P=`offsetHeight`in t?t.offsetHeight-t.clientHeight-O-A:0,F=`offsetWidth`in t?t.offsetWidth===0?0:o/t.offsetWidth:0,I=`offsetHeight`in t?t.offsetHeight===0?0:a/t.offsetHeight:0;if(c===t)j=r===`start`?T:r===`end`?T-f:r===`nearest`?z(m,m+f,f,O,A,m+T,m+T+h,h):T-f/2,M=i===`start`?E:i===`center`?E-d/2:i===`end`?E-d:z(p,p+d,d,w,k,p+E,p+E+g,g),j=Math.max(0,j+m),M=Math.max(0,M+p);else{j=r===`start`?T-s-O:r===`end`?T-x+A+P:r===`nearest`?z(s,x,a,O,A+P,T,T+h,h):T-(s+a/2)+P/2,M=i===`start`?E-S-w:i===`center`?E-(S+o/2)+N/2:i===`end`?E-u+k+N:z(S,u,o,w,k+N,E,E+g,g);let{scrollLeft:e,scrollTop:n}=t;j=I===0?0:Math.max(0,Math.min(n+j/I,t.scrollHeight-a/I+P)),M=F===0?0:Math.max(0,Math.min(e+M/F,t.scrollWidth-o/F+N)),T+=n-j,E+=e-M}D.push({el:t,top:j,left:M})}return D},H=e=>!1===e?{block:`end`,inline:`nearest`}:(e=>e===Object(e)&&Object.keys(e).length!==0)(e)?e:{block:`start`,inline:`nearest`};function U(e,t){if(!e.isConnected||!(e=>{let t=e;for(;t&&t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}return!1})(e))return;let n=(e=>{let t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);if((e=>typeof e==`object`&&typeof e.behavior==`function`)(t))return t.behavior(V(e,t));let r=typeof t==`boolean`||t==null?void 0:t.behavior;for(let{el:i,top:a,left:o}of V(e,H(t))){let e=a-n.top+n.bottom,t=o-n.left+n.right;i.scroll({top:e,left:t,behavior:r})}}var W=(e,t)=>JSON.stringify(e)===JSON.stringify(t),G=class extends u(d(a.t(e.t))){constructor(...e){super(...e),this.selectionMode=`single`,this.selectionBehavior=`toggle`,this.requiredSelection=`none`,this._hasNoMatches=!1,this._showNoMatchesMessage=!1,this._activeDescendantId=null,this.values=[],this._state=k([]),this._ctx={selectionMode:`single`,selectionBehavior:`toggle`,requiredSelection:`none`,selectable:C([]),all:C([])},this._externalChangeQueued=!1}selectionModeChanged(){this._registerExternalChange()}selectionBehaviorChanged(){this._registerExternalChange()}requiredSelectionChanged(){this._registerExternalChange()}_filteredOptionsChanged(){this._registerExternalChange(),this._updateNoMatchesMessage()}_updateNoMatchesMessage(){this._hasNoMatches=this.searchText!==``&&!this._slottedOptions.some(e=>!e.hidden&&!e._isNotMatching),clearTimeout(this._noMatchesTimer),this._hasNoMatches?this._showNoMatchesMessage||(this._noMatchesTimer=setTimeout(()=>{this._showNoMatchesMessage=!0},10)):this._showNoMatchesMessage=!1}disconnectedCallback(){super.disconnectedCallback(),clearTimeout(this._noMatchesTimer)}valuesChanged(){this._state&&!W(this._state.values,this.values)&&this._registerExternalChange()}get value(){return this.values[0]??null}set value(e){this.values=e===null?[]:[e]}_registerExternalChange(){this._externalChangeQueued||(this._externalChangeQueued=!0,queueMicrotask(()=>this._applyPendingExternalChanges()))}_applyPendingExternalChanges(){if(this._externalChangeQueued=!1,!this._ctx.all.isEq(this._slottedOptions)||!this._ctx.selectable.isEq(this._filteredOptions)){this._initializeState();return}let e={...this._ctx,selectionMode:this.selectionMode,selectionBehavior:this.selectionBehavior,requiredSelection:this.requiredSelection};this._ctx=e,this._applyNewState(E(this._state,e,this.values))}_initializeState(){if(this._ctx={selectionMode:this.selectionMode,selectionBehavior:this.selectionBehavior,requiredSelection:this.requiredSelection,selectable:C(this._filteredOptions),all:C(this._slottedOptions)},!this._slottedOptions?.length){this._state=k([]),this._activeDescendantId=null;return}this._applyNewState(O(this._ctx,this._slottedOptions,this.values))}_applyNewState(e){if(T(e)){let t=this._filteredOptions[e.activeIndex];this._activeDescendantId=t.id,U(t,{block:`nearest`,scrollMode:`if-needed`})}else this._activeDescendantId=null;let t=!W(this.values,e.values);this._state=e,this.values=[...e.values],this._updateSlottedOptions(),t&&this.$emit(`change`,void 0,{bubbles:!1,composed:!1})}_updateSlottedOptions(){for(let e of this._slottedOptions)e.selected=this.values.includes(e.value),e._highlighted=!!(this._activeDescendantId&&e.id===this._activeDescendantId)}_onKeydown(e){let t=N(this._state,this._ctx,e,Date.now());return!t||(this._applyNewState(F(this._state,this._ctx,t)),!1)}_onClick(e){let t=e.target.closest(`[data-vvd-component=option]`),n=t?this._filteredOptions.indexOf(t):-1;if(n===-1)return!0;let r=this._state;return this._applyNewState(F(r,this._ctx,P(r,this._ctx,e,n))),!1}};r.t([e.m({attribute:`selection-mode`,mode:`fromView`})],G.prototype,`selectionMode`,void 0),r.t([e.m({attribute:`selection-behavior`,mode:`fromView`})],G.prototype,`selectionBehavior`,void 0),r.t([e.m({attribute:`required-selection`,mode:`fromView`})],G.prototype,`requiredSelection`,void 0),r.t([e.A],G.prototype,`_hasNoMatches`,void 0),r.t([e.A],G.prototype,`_showNoMatchesMessage`,void 0),r.t([e.A],G.prototype,`_activeDescendantId`,void 0),r.t([e.A],G.prototype,`values`,void 0);var K=`:host{outline:none;flex-direction:column;gap:2px;display:flex}:host(:not(:focus-visible)){--_suppressable-focus-shadow:none;--_suppressable-focus-outline:none;--_suppressable-focus-outline-offset:0}.no-matches{padding:8px 16px}`,q=e=>e._hasNoMatches,J=e.u(`listbox`,G,t=>e.p`<template
|
|
4
|
+
</slot>`,p=e=>{let t=e.ctrlKey||e.metaKey;return e.shiftKey&&t?`ShiftMod`:e.shiftKey?`Shift`:t?`Mod`:null},m=(e,t,n,r)=>{if(n.amount===`step`&&r===`Mod`)return null;if(t.selectionMode===`multiple`){if(n.amount===`step`&&r===`Shift`)return{action:{type:`extend-from-anchor`,anchorIndex:e.rangeAnchorIndex??e.activeIndex},replaceExisting:!1};if(n.amount===`limit`&&r===`ShiftMod`)return{action:{type:`select-from-current`},replaceExisting:!1}}return t.selectionBehavior===`replace`?{action:{type:`select`},replaceExisting:!0}:null},h=(e,t)=>t===`Shift`?{action:{type:`select-from-most-recent`},replaceExisting:e.selectionBehavior===`replace`}:t===`Mod`?{action:{type:`toggle`},replaceExisting:!1}:e.selectionBehavior===`replace`?{action:{type:`select`},replaceExisting:!0}:{action:{type:`toggle`},replaceExisting:!1};function g(e,t,n,r){let i=new Set(e),[a,o]=[n,r].sort((e,t)=>e-t),s=[...e];for(let e=a;e<=o;e++){let n=t.selectable.optionValue(e);i.has(n)||s.push(n)}return s}function _(e,t,n,r,i){let a=new Set(e),[o,,s]=[n,r,i].sort((e,t)=>e-t),c=[...e];for(let e=o;e<=s;e++){let i=t.selectable.optionValue(e);e<n&&e<r||e>n&&e>r?a.has(i)&&(c=c.filter(e=>e!==i)):a.has(i)||c.push(i)}return c}function v(e,t){let n=e.values;for(let e=n.length-1;e>=0;e--){let r=t.selectable.optionIndex(n[e]);if(r!==null)return r}return null}function y(e,t,n){let r=t=>({...e,values:t.values??e.values,activeIndex:t.activeIndex??e.activeIndex,rangeAnchorIndex:t.rangeAnchorIndex??null});if(n.type!==`action`)return r({});let i=e.values,{targetIndex:a,selection:o}=n,s=e=>t.selectionMode===`single`&&e.length>1?[e[e.length-1]]:t.requiredSelection!==`none`&&(e.length===0||t.requiredSelection===`selectable`&&!e.some(e=>t.selectable.optionIndex(e)!==null))?i:e,c=t.selectable.optionValue(a),l=o?.replaceExisting?[]:i;switch(o?.action.type){case void 0:return r({activeIndex:a});case`select`:return r({activeIndex:a,values:s(i.includes(c)?i:[...l,c])});case`toggle`:return r({activeIndex:a,values:s(i.includes(c)?l.filter(e=>e!==c):[...l,c])});case`select-from-current`:return r({activeIndex:a,values:s(g(l,t,e.activeIndex,a))});case`select-from-most-recent`:return r({activeIndex:a,values:s(g(l,t,v(e,t)??0,a))});case`extend-from-anchor`:return r({values:s(_(l,t,o.action.anchorIndex,a,e.activeIndex)),activeIndex:a,rangeAnchorIndex:o.action.anchorIndex})}}var b=2e3;function x(e,t,n,r){let i=e.typeahead&&e.typeahead.lastInputMs>r-b?e.typeahead:null;return n.length===1&&!(n===` `&&!i)?{buffer:(i?.buffer??``)+n,lastInputMs:r}:null}function S(e,t,n){if(n.type!==`typeahead`)return{...e,typeahead:null};let r=n.typeahead;for(let i=(e.activeIndex+1)%t.selectable.numOptions;i!==e.activeIndex;i=(i+1)%t.selectable.numOptions)if(t.selectable.optionText(i).toLowerCase().startsWith(r.buffer.toLowerCase()))return{...y(e,t,{type:`action`,targetIndex:i,selection:n.selection}),typeahead:r};return{...e,typeahead:r}}var C=e=>({numOptions:e.length,optionValue:t=>e[t].value,optionText:t=>e[t].text,optionIndex:t=>{let n=e.findIndex(e=>e.value===t);return n===-1?null:n},isEq:t=>e===t});function w(e,t,n){let r=t.filter(e=>e.selected||n.includes(e.value)).map(e=>e.value),i=e.selectionMode===`single`?1:1/0;return D(e,r.slice(0,i),i)}function T(e){return`activeIndex`in e}function E(e,t,n){let r=n.filter(e=>t.all.optionIndex(e)!==null),i=t.selectionMode===`single`?1:1/0,a=r.slice(0,i);return a=D(t,a,i),{...e,values:a}}function D(e,t,n){return e.requiredSelection===`none`||e.selectable.numOptions===0?t:t.length===0?[e.selectable.optionValue(0)]:e.requiredSelection===`selectable`&&!t.some(t=>e.selectable.optionIndex(t)!==null)?n===1?[e.selectable.optionValue(0)]:[...t,e.selectable.optionValue(0)]:t}function O(e,t,n){let r=w(e,t,n);if(e.selectable.numOptions===0)return k(r);let i=0;for(let t of r){let n=e.selectable.optionIndex(t);if(n!==null){i=n;break}}return{values:r,activeIndex:i,typeahead:null,rangeAnchorIndex:null}}function k(e){return{values:e}}function A(e){switch(e){case`Home`:return{direction:`backward`,amount:`limit`};case`End`:return{direction:`forward`,amount:`limit`};case`PageUp`:return{direction:`backward`,amount:`page`};case`PageDown`:return{direction:`forward`,amount:`page`};case`ArrowUp`:return{direction:`backward`,amount:`step`};case`ArrowDown`:return{direction:`forward`,amount:`step`}}return null}function j(e,t,n,r){let i={backward:0,forward:t-1},a={backward:-1,forward:1},o={step:1,page:n};switch(r.amount){case`limit`:return i[r.direction];case`page`:case`step`:return Math.min(i.forward,Math.max(i.backward,e+a[r.direction]*o[r.amount]))}}var M=10;function N(e,t,n,r){if(!T(e))return null;let i=x(e,t,n.key,r);if(i)return{type:`typeahead`,typeahead:i,selection:t.selectionBehavior===`replace`?{action:{type:`select`},replaceExisting:!0}:null};let a=A(n.key);return a?{type:`action`,targetIndex:j(e.activeIndex,t.selectable.numOptions,M,a),selection:m(e,t,a,p(n))}:n.key===` `?{type:`action`,targetIndex:e.activeIndex,selection:h(t,p(n))}:null}function P(e,t,n,r){return{type:`action`,targetIndex:r,selection:h(t,p(n))}}function F(e,t,n){return e=S(e,t,n),e=y(e,t,n),e}var I=e=>typeof e==`object`&&!!e&&e.nodeType===1,L=(e,t)=>(!t||e!==`hidden`)&&e!==`visible`&&e!==`clip`,R=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let n=getComputedStyle(e,null);return L(n.overflowY,t)||L(n.overflowX,t)||(e=>{let t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch{return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},z=(e,t,n,r,i,a,o,s)=>a<e&&o>t||a>e&&o<t?0:a<=e&&s<=n||o>=t&&s>=n?a-e-r:o>t&&s<n||a<e&&s>n?o-t+i:0,B=e=>e.parentElement??(e.getRootNode().host||null),V=(e,t)=>{if(typeof document>`u`)return[];let{scrollMode:n,block:r,inline:i,boundary:a,skipOverflowHiddenElements:o}=t,s=typeof a==`function`?a:e=>e!==a;if(!I(e))throw TypeError(`Invalid target`);let c=document.scrollingElement||document.documentElement,l=[],u=e;for(;I(u)&&s(u);){if(u=B(u),u===c){l.push(u);break}u!=null&&u===document.body&&R(u)&&!R(document.documentElement)||u!=null&&R(u,o)&&l.push(u)}let d=window.visualViewport?.width??innerWidth,f=window.visualViewport?.height??innerHeight,{scrollX:p,scrollY:m}=window,{height:h,width:g,top:_,right:v,bottom:y,left:b}=e.getBoundingClientRect(),{top:x,right:S,bottom:C,left:w}=(e=>{let t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e),T=r===`start`||r===`nearest`?_-x:r===`end`?y+C:_+h/2-x+C,E=i===`center`?b+g/2-w+S:i===`end`?v+S:b-w,D=[];for(let e=0;e<l.length;e++){let t=l[e],{height:a,width:o,top:s,right:u,bottom:x,left:S}=t.getBoundingClientRect();if(n===`if-needed`&&_>=0&&b>=0&&y<=f&&v<=d&&(t===c&&!R(t)||_>=s&&y<=x&&b>=S&&v<=u))return D;let C=getComputedStyle(t),w=parseInt(C.borderLeftWidth,10),O=parseInt(C.borderTopWidth,10),k=parseInt(C.borderRightWidth,10),A=parseInt(C.borderBottomWidth,10),j=0,M=0,N=`offsetWidth`in t?t.offsetWidth-t.clientWidth-w-k:0,P=`offsetHeight`in t?t.offsetHeight-t.clientHeight-O-A:0,F=`offsetWidth`in t?t.offsetWidth===0?0:o/t.offsetWidth:0,I=`offsetHeight`in t?t.offsetHeight===0?0:a/t.offsetHeight:0;if(c===t)j=r===`start`?T:r===`end`?T-f:r===`nearest`?z(m,m+f,f,O,A,m+T,m+T+h,h):T-f/2,M=i===`start`?E:i===`center`?E-d/2:i===`end`?E-d:z(p,p+d,d,w,k,p+E,p+E+g,g),j=Math.max(0,j+m),M=Math.max(0,M+p);else{j=r===`start`?T-s-O:r===`end`?T-x+A+P:r===`nearest`?z(s,x,a,O,A+P,T,T+h,h):T-(s+a/2)+P/2,M=i===`start`?E-S-w:i===`center`?E-(S+o/2)+N/2:i===`end`?E-u+k+N:z(S,u,o,w,k+N,E,E+g,g);let{scrollLeft:e,scrollTop:n}=t;j=I===0?0:Math.max(0,Math.min(n+j/I,t.scrollHeight-a/I+P)),M=F===0?0:Math.max(0,Math.min(e+M/F,t.scrollWidth-o/F+N)),T+=n-j,E+=e-M}D.push({el:t,top:j,left:M})}return D},H=e=>!1===e?{block:`end`,inline:`nearest`}:(e=>e===Object(e)&&Object.keys(e).length!==0)(e)?e:{block:`start`,inline:`nearest`};function U(e,t){if(!e.isConnected||!(e=>{let t=e;for(;t&&t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}return!1})(e))return;let n=(e=>{let t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);if((e=>typeof e==`object`&&typeof e.behavior==`function`)(t))return t.behavior(V(e,t));let r=typeof t==`boolean`||t==null?void 0:t.behavior;for(let{el:i,top:a,left:o}of V(e,H(t))){let e=a-n.top+n.bottom,t=o-n.left+n.right;i.scroll({top:e,left:t,behavior:r})}}var W=(e,t)=>JSON.stringify(e)===JSON.stringify(t),G=class extends u(d(a.t(e.t))){constructor(...e){super(...e),this.selectionMode=`single`,this.selectionBehavior=`toggle`,this.requiredSelection=`none`,this._hasNoMatches=!1,this._showNoMatchesMessage=!1,this._activeDescendantId=null,this.values=[],this._state=k([]),this._ctx={selectionMode:`single`,selectionBehavior:`toggle`,requiredSelection:`none`,selectable:C([]),all:C([])},this._externalChangeQueued=!1}selectionModeChanged(){this._registerExternalChange()}selectionBehaviorChanged(){this._registerExternalChange()}requiredSelectionChanged(){this._registerExternalChange()}_filteredOptionsChanged(){this._registerExternalChange(),this._updateNoMatchesMessage()}_updateNoMatchesMessage(){this._hasNoMatches=this.searchText!==``&&!this._slottedOptions.some(e=>!e.hidden&&!e._isNotMatching),clearTimeout(this._noMatchesTimer),this._hasNoMatches?this._showNoMatchesMessage||(this._noMatchesTimer=setTimeout(()=>{this._showNoMatchesMessage=!0},10)):this._showNoMatchesMessage=!1}disconnectedCallback(){super.disconnectedCallback(),clearTimeout(this._noMatchesTimer)}valuesChanged(){this._state&&!W(this._state.values,this.values)&&this._registerExternalChange()}get value(){return this.values[0]??null}set value(e){this.values=e===null?[]:[e]}_registerExternalChange(){this._externalChangeQueued||(this._externalChangeQueued=!0,queueMicrotask(()=>this._applyPendingExternalChanges()))}_applyPendingExternalChanges(){if(this._externalChangeQueued=!1,!this._ctx.all.isEq(this._slottedOptions)||!this._ctx.selectable.isEq(this._filteredOptions)){this._initializeState();return}let e={...this._ctx,selectionMode:this.selectionMode,selectionBehavior:this.selectionBehavior,requiredSelection:this.requiredSelection};this._ctx=e,this._applyNewState(E(this._state,e,this.values))}_initializeState(){if(this._ctx={selectionMode:this.selectionMode,selectionBehavior:this.selectionBehavior,requiredSelection:this.requiredSelection,selectable:C(this._filteredOptions),all:C(this._slottedOptions)},!this._slottedOptions?.length){this._state=k([]),this._activeDescendantId=null;return}this._applyNewState(O(this._ctx,this._slottedOptions,this.values))}_applyNewState(e){if(T(e)){let t=this._filteredOptions[e.activeIndex];this._activeDescendantId=t.id,U(t,{block:`nearest`,scrollMode:`if-needed`})}else this._activeDescendantId=null;let t=!W(this.values,e.values);this._state=e,this.values=[...e.values],this._updateSlottedOptions(),t&&this.$emit(`change`,void 0,{bubbles:!1,composed:!1})}_updateSlottedOptions(){for(let e of this._slottedOptions)e.selected=this.values.includes(e.value),e._highlighted=!!(this._activeDescendantId&&e.id===this._activeDescendantId)}_onKeydown(e){let t=N(this._state,this._ctx,e,Date.now());return!t||(this._applyNewState(F(this._state,this._ctx,t)),!1)}_onClick(e){let t=e.target.closest(`[data-vvd-component=option]`),n=t?this._filteredOptions.indexOf(t):-1;if(n===-1)return!0;let r=this._state;return this._applyNewState(F(r,this._ctx,P(r,this._ctx,e,n))),!1}};r.t([e.m({attribute:`selection-mode`,mode:`fromView`})],G.prototype,`selectionMode`,void 0),r.t([e.m({attribute:`selection-behavior`,mode:`fromView`})],G.prototype,`selectionBehavior`,void 0),r.t([e.m({attribute:`required-selection`,mode:`fromView`})],G.prototype,`requiredSelection`,void 0),r.t([e.A],G.prototype,`_hasNoMatches`,void 0),r.t([e.A],G.prototype,`_showNoMatchesMessage`,void 0),r.t([e.A],G.prototype,`_activeDescendantId`,void 0),r.t([e.A],G.prototype,`values`,void 0);var K=`:host{--option-text-line-clamp:1;--option-text-secondary-line-clamp:1;outline:none;flex-direction:column;gap:2px;display:flex}:host(:not(:focus-visible)){--_suppressable-focus-shadow:none;--_suppressable-focus-outline:none;--_suppressable-focus-outline-offset:0}.no-matches{padding:8px 16px}`,q=e=>e._hasNoMatches,J=e.u(`listbox`,G,t=>e.p`<template
|
|
5
5
|
tabindex="0"
|
|
6
6
|
${a.n({role:e=>q(e)?void 0:`listbox`,ariaMultiSelectable:e=>!q(e)&&e.selectionMode===`multiple`?`true`:void 0})}
|
|
7
7
|
aria-activedescendant="${e=>e._activeDescendantId}"
|
package/listbox/index.js
CHANGED
|
@@ -535,7 +535,7 @@ c([n({
|
|
|
535
535
|
})], Z.prototype, "requiredSelection", void 0), c([e], Z.prototype, "_hasNoMatches", void 0), c([e], Z.prototype, "_showNoMatchesMessage", void 0), c([e], Z.prototype, "_activeDescendantId", void 0), c([e], Z.prototype, "values", void 0);
|
|
536
536
|
//#endregion
|
|
537
537
|
//#region src/lib/listbox/listbox.scss?inline
|
|
538
|
-
var Q = ":host{outline:none;flex-direction:column;gap:2px;display:flex}:host(:not(:focus-visible)){--_suppressable-focus-shadow:none;--_suppressable-focus-outline:none;--_suppressable-focus-outline-offset:0}.no-matches{padding:8px 16px}", $ = (e) => e._hasNoMatches, ee = a("listbox", Z, (e) => r`<template
|
|
538
|
+
var Q = ":host{--option-text-line-clamp:1;--option-text-secondary-line-clamp:1;outline:none;flex-direction:column;gap:2px;display:flex}:host(:not(:focus-visible)){--_suppressable-focus-shadow:none;--_suppressable-focus-outline:none;--_suppressable-focus-outline-offset:0}.no-matches{padding:8px 16px}", $ = (e) => e._hasNoMatches, ee = a("listbox", Z, (e) => r`<template
|
|
539
539
|
tabindex="0"
|
|
540
540
|
${u({
|
|
541
541
|
role: (e) => $(e) ? void 0 : "listbox",
|
package/locales/de-DE.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../node_modules/.pnpm/video.js@8.24.
|
|
1
|
+
//#region ../../node_modules/.pnpm/video.js@8.24.1/node_modules/video.js/dist/lang/de.json
|
|
2
2
|
var de_exports = /* @__PURE__ */ require("../unbundled/rolldown-runtime.cjs").__exportAll({
|
|
3
3
|
Background: () => Background,
|
|
4
4
|
Black: () => Black,
|
package/locales/de-DE.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "../unbundled/rolldown-runtime.js";
|
|
2
|
-
//#region ../../node_modules/.pnpm/video.js@8.24.
|
|
2
|
+
//#region ../../node_modules/.pnpm/video.js@8.24.1/node_modules/video.js/dist/lang/de.json
|
|
3
3
|
var de_exports = /* @__PURE__ */ __exportAll({
|
|
4
4
|
Background: () => Background,
|
|
5
5
|
Black: () => Black,
|
package/locales/en-GB.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../node_modules/.pnpm/video.js@8.24.
|
|
1
|
+
//#region ../../node_modules/.pnpm/video.js@8.24.1/node_modules/video.js/dist/lang/en-GB.json
|
|
2
2
|
var en_GB_exports = /* @__PURE__ */ require("../unbundled/rolldown-runtime.cjs").__exportAll({
|
|
3
3
|
Color: () => Color,
|
|
4
4
|
default: () => en_GB_default
|
package/locales/en-GB.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "../unbundled/rolldown-runtime.js";
|
|
2
|
-
//#region ../../node_modules/.pnpm/video.js@8.24.
|
|
2
|
+
//#region ../../node_modules/.pnpm/video.js@8.24.1/node_modules/video.js/dist/lang/en-GB.json
|
|
3
3
|
var en_GB_exports = /* @__PURE__ */ __exportAll({
|
|
4
4
|
Color: () => Color,
|
|
5
5
|
default: () => en_GB_default
|
package/locales/ja-JP.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../node_modules/.pnpm/video.js@8.24.
|
|
1
|
+
//#region ../../node_modules/.pnpm/video.js@8.24.1/node_modules/video.js/dist/lang/ja.json
|
|
2
2
|
var ja_exports = /* @__PURE__ */ require("../unbundled/rolldown-runtime.cjs").__exportAll({
|
|
3
3
|
Background: () => Background,
|
|
4
4
|
Black: () => "黒",
|
package/locales/ja-JP.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "../unbundled/rolldown-runtime.js";
|
|
2
|
-
//#region ../../node_modules/.pnpm/video.js@8.24.
|
|
2
|
+
//#region ../../node_modules/.pnpm/video.js@8.24.1/node_modules/video.js/dist/lang/ja.json
|
|
3
3
|
var ja_exports = /* @__PURE__ */ __exportAll({
|
|
4
4
|
Background: () => Background,
|
|
5
5
|
Black: () => "黒",
|
package/locales/zh-CN.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../node_modules/.pnpm/video.js@8.24.
|
|
1
|
+
//#region ../../node_modules/.pnpm/video.js@8.24.1/node_modules/video.js/dist/lang/zh-CN.json
|
|
2
2
|
var zh_CN_exports = /* @__PURE__ */ require("../unbundled/rolldown-runtime.cjs").__exportAll({
|
|
3
3
|
Background: () => Background,
|
|
4
4
|
Black: () => "黑",
|
package/locales/zh-CN.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "../unbundled/rolldown-runtime.js";
|
|
2
|
-
//#region ../../node_modules/.pnpm/video.js@8.24.
|
|
2
|
+
//#region ../../node_modules/.pnpm/video.js@8.24.1/node_modules/video.js/dist/lang/zh-CN.json
|
|
3
3
|
var zh_CN_exports = /* @__PURE__ */ __exportAll({
|
|
4
4
|
Background: () => Background,
|
|
5
5
|
Black: () => "黑",
|
package/number-field/index.cjs
CHANGED
|
@@ -1,29 +1,31 @@
|
|
|
1
|
-
const e=require("../bundled/localized.cjs"),t=require("../bundled/vivid-element.cjs"),n=require("../bundled/slotted.cjs"),r=require("../bundled/ref.cjs"),i=require("../bundled/when.cjs"),a=require("../bundled/definition.cjs"),o=require("../bundled/enums.cjs"),s=require("../bundled/decorate.cjs"),c=require("../bundled/class-names.cjs"),l=require("../bundled/key-codes.cjs"),u=require("../bundled/definition2.cjs"),d=require("../bundled/affix.cjs"),f=require("../bundled/delegates-aria.cjs"),p=require("../bundled/component-enum.cjs"),m=require("../bundled/form-associated.cjs"),h=require("../bundled/definition5.cjs"),g=require("../bundled/feedback-message.cjs"),_=require("../bundled/definition10.cjs"),v=require("../bundled/form-element.cjs"),y=require("../bundled/with-contextual-help.cjs"),b=require("../bundled/with-error-text.cjs"),x=require("../bundled/with-success-text.cjs"),S=require("../bundled/mixins.cjs"),C=require("../bundled/definition20.cjs"),w=require("../bundled/divider.cjs");var T=`.label-wrapper{align-items:center;gap:var(--label-wrapper-gap,4px);flex-direction:row;display:flex}.label-wrapper[hidden]{display:none}.label:not(slot),.label::slotted(label){flex:0 auto}:host{display:inline-block}.base{--_text-field-gutter-start:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2))) / 2.5);--_text-field-gutter-end:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2))) / 2.5);--_text-field-icon-size:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2))) / 2);--_text-field-block-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2)));--_text-field-border-radius:8px;--_text-field-pill-border-radius:24px;grid-template-columns:min-content 1fr max-content;align-items:center;gap:4px;width:100%;display:inline-grid}.base.size-condensed{--_text-field-gutter-start:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 16)) / 2);--_text-field-gutter-end:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 16)) / 2);--_text-field-icon-size:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 8)) / 2);--_text-field-block-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 8));--_text-field-border-radius:4px}.base{user-select:none}.base:not(.disabled){--_low-ink-color:var(--vvd-color-neutral-600)}.base.disabled{--_low-ink-color:var(--_appearance-color-text)}.label:not(slot),.label::slotted(label){font:var(--vvd-typography-base);grid-area:1/1/auto/4;box-sizing:initial!important;padding:initial!important;margin:initial!important;color:var(--vvd-color-canvas-text)!important}.char-count+.label:not(slot),.char-count+.label::slotted(label){grid-column:1/3}.char-count{color:var(--_low-ink-color);font:var(--vvd-typography-base)}.label-wrapper{grid-area:1/1/auto/4}.char-count+.label-wrapper{grid-column:1/3}.fieldset{background-color:var(--_appearance-color-fill);font:var(--vvd-typography-base);grid-column:1/4;align-items:center;padding-block:0;transition:color .2s,background-color .2s;display:flex;position:relative}.fieldset:after{border-radius:inherit;block-size:100%;box-shadow:inset 0 0 0 1px var(--_appearance-color-outline);content:"";pointer-events:none;inline-size:100%;transition:box-shadow .2s;display:block;position:absolute}.fieldset:focus-visible{outline:none}.base>.fieldset{block-size:var(--_text-field-block-size)}.base:not(.shape-pill) .fieldset{border-radius:var(--_text-field-border-radius)}.base.shape-pill .fieldset{border-radius:var(--_text-field-pill-border-radius)}.wrapper{border-radius:inherit;block-size:100%;inline-size:100%}.control{border-radius:inherit;text-align:start}.control:not(slot),.control::slotted(input){font:inherit;text-align:inherit;outline:#0000;box-sizing:border-box!important;border-radius:inherit!important;width:100%!important;margin:initial!important;appearance:none!important;block-size:100%!important;color:inherit!important;padding-block:0!important;padding-inline:var(--_text-field-gutter-start) var(--_text-field-gutter-end)!important;background-color:#0000!important;border:0!important}.control:not(slot,:focus),.control::slotted(input:not(:focus)){text-overflow:ellipsis!important}.control:not(slot):disabled,.control::slotted(input:disabled){cursor:not-allowed!important;opacity:1!important;-webkit-text-fill-color:var(--_appearance-color-text)!important}.control:not(slot)::placeholder{opacity:1!important;-webkit-text-fill-color:var(--_low-ink-color)!important}.control::slotted(input:-webkit-autofill),.control:not(slot):-webkit-autofill{-webkit-box-shadow:0 0 0 1000px var(--_appearance-color-fill) inset;-webkit-text-fill-color:var(--_appearance-color-text)!important}.control::slotted(input:autofill),.control:not(slot):autofill{-webkit-box-shadow:0 0 0 1000px var(--_appearance-color-fill) inset;-webkit-text-fill-color:var(--_appearance-color-text)!important}.has-icon .control:not(slot),.has-icon .control::slotted(input){padding-inline-start:calc(var(--_text-field-icon-size) + var(--_text-field-gutter-start) * 2)!important}.icon{z-index:1;color:var(--_low-ink-color);font-size:var(--_text-field-icon-size);line-height:1;position:absolute;inset-block-start:50%;inset-inline-start:calc(100% + var(--_text-field-gutter-start));transform:translateY(-50%)}.leading-items-wrapper{position:relative}.base.no-leading .leading-items-wrapper{display:none}.action-items-wrapper{margin-inline-end:4px}.base:not(.action-items) .action-items-wrapper{display:none}@supports selector(:has(*)){.base:not(.has-activedescendant) .fieldset:has(.wrapper .control:focus-within):after{--focus-stroke-gap-color:transparent;box-shadow:0 0 0 4px color-mix(in sRGB, var(--focus-stroke-color,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))}}@supports not selector(:has(*)){.base:not(.has-activedescendant) .wrapper:focus-within:after{box-shadow:0 0 0 4px color-mix(in sRGB, var(--focus-stroke-color,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));--focus-stroke-gap-color:transparent;z-index:1;border-radius:inherit;content:"";pointer-events:none;display:block;position:absolute;inset:0}}:host([internal-part]) .fieldset{font:var(--vvd-typography-heading-4);background-color:#0000;line-height:1.1}:host([internal-part]) .fieldset:not(:focus-within):after{block-size:1px;inset-block-end:0}@supports selector(:has(*)){:host([internal-part]) .fieldset:has(.action-items-wrapper:focus-within):after{block-size:1px;inset-block-end:0}}:host([internal-part]) .control{text-align:center}slot[name=_mirrored-helper-text]{display:none}.base{--_text-field-gutter-end:70px}.control::-webkit-outer-spin-button,.control::-webkit-inner-spin-button{appearance:none}.control-buttons{z-index:1;display:flex;position:absolute;right:3px}.readonly .control-buttons,.disabled .control-buttons{pointer-events:none}.control-buttons .divider{margin-block:8px}.control-buttons>*{flex-shrink:0}`,E=p.t([`fieldset`,`ghost`],`fieldset`),D={up:1,down:-1};function O(e,t){let n=parseFloat(e.value),r=isNaN(n)?e.min>0?e.min:e.max<0?e.max:e.min?0:t*e.step:n+t*e.step;e.value=Number(r.toFixed(12)).toString(),e._updatedValueAnnouncement=e.locale.numberField.updatedValueAnnouncement(e._presentationValue)}var k=e=>{let t=e.source;return{invalidCharacters:RegExp(`[^0-9\\-+e${t}]`,`g`),additionalDecimalSeparators:RegExp(`(?<=${t}.*)${t}`,`g`),trailingDecimalSeparator:RegExp(`${t}$`),decimalSeparator:e}},A=k(/\./),j=k(/,/),M=/^-?((\d*\.\d+)|(\d+))$/,N=class extends y.t(S.t(b.t(x.t(v.t(d.t(e.t(f.t(m.n(t.t))))))))){constructor(...e){super(...e),this.proxy=document.createElement(`input`),this.readOnly=!1,this.autofocus=!1,this.step=1,this.isUserInput=!1,this._presentationValue=``,this._updatedValueAnnouncement=``,this.incrementButtonAriaLabel=null,this.decrementButtonAriaLabel=null}stepChanged(e,t){this.proxy.setAttribute(`step`,Number.isFinite(t)?t.toString():``)}maxChanged(e,t){this.max=Math.max(t,this.min??t),this.proxy.max=this.max.toString(),this.validate()}minChanged(e,t){this.min=Math.min(t,this.max??t),this.proxy.min=this.min.toString(),this.validate()}get valueAsNumber(){return parseFloat(this.value)}set valueAsNumber(e){this.value=e.toString()}valueChanged(e,t){this.value=M.test(t)?t:``,t===this.value&&(this.control&&!this.isUserInput&&(this._presentationValue=this.#e(this.value)),super.valueChanged(e,this.value),e!==void 0&&!this.isUserInput&&(this.$emit(`input`),this.$emit(`change`)))}get _numberPatterns(){return this.locale.common.useCommaAsDecimalSeparator?j:A}#e(e){return e.replace(`.`,this.locale.common.useCommaAsDecimalSeparator?`,`:`.`)}#t(e){return e.replace(this._numberPatterns.invalidCharacters,``).replace(this._numberPatterns.additionalDecimalSeparators,``)}#n(e){let t=e.replace(this._numberPatterns.trailingDecimalSeparator,``).replace(this._numberPatterns.decimalSeparator,`.`);return M.test(t)?t:``}validate(){super.validate(this.control)}stepUp(){O(this,D.up)}stepDown(){O(this,D.down)}connectedCallback(){super.connectedCallback(),this.proxy.setAttribute(`type`,`number`),this.validate(),this._presentationValue=this.#e(this.value),this.autofocus&&t.M.enqueue(()=>{this.focus()})}select(){this.control.select(),this.$emit(`select`)}handleTextInput(){this._presentationValue=this.#t(this.control.value),this.control.value!==this._presentationValue&&(this.control.value=this._presentationValue),this.isUserInput=!0,this.value=this.#n(this._presentationValue),this.isUserInput=!1}handleChange(){this.$emit(`change`)}handleKeyDown(e){switch(e.key){case l.i:return this.stepUp(),!1;case l.t:return this.stepDown(),!1}return!0}};s.t([t.m({attribute:`readonly`,mode:`boolean`})],N.prototype,`readOnly`,void 0),s.t([t.m({mode:`boolean`})],N.prototype,`autofocus`,void 0),s.t([t.m],N.prototype,`placeholder`,void 0),s.t([t.m],N.prototype,`list`,void 0),s.t([t.m({converter:t.h})],N.prototype,`maxlength`,void 0),s.t([t.m({converter:t.h})],N.prototype,`minlength`,void 0),s.t([t.m({converter:t.h})],N.prototype,`size`,void 0),s.t([t.m()],N.prototype,`scale`,void 0),s.t([t.m({converter:t.h})],N.prototype,`step`,void 0),s.t([t.m({converter:t.h})],N.prototype,`max`,void 0),s.t([t.m({converter:t.h})],N.prototype,`min`,void 0),s.t([t.A],N.prototype,`defaultSlottedNodes`,void 0),s.t([t.A],N.prototype,`_presentationValue`,void 0),s.t([t.A],N.prototype,`_updatedValueAnnouncement`,void 0),s.t([t.m({attribute:`increment-button-aria-label`})],N.prototype,`incrementButtonAriaLabel`,void 0),s.t([t.m({attribute:`decrement-button-aria-label`})],N.prototype,`decrementButtonAriaLabel`,void 0),s.t([t.m],N.prototype,`appearance`,void 0),s.t([t.m],N.prototype,`shape`,void 0),s.t([t.m],N.prototype,`autoComplete`,void 0);function P(){return t.p` <label for="control" class="label">
|
|
1
|
+
const e=require("../bundled/localized.cjs"),t=require("../bundled/vivid-element.cjs"),n=require("../bundled/slotted.cjs"),r=require("../bundled/ref.cjs"),i=require("../bundled/when.cjs"),a=require("../bundled/definition.cjs"),o=require("../bundled/enums.cjs"),s=require("../bundled/decorate.cjs"),c=require("../bundled/class-names.cjs"),l=require("../bundled/key-codes.cjs"),u=require("../bundled/definition2.cjs"),d=require("../bundled/affix.cjs"),f=require("../bundled/delegates-aria.cjs"),p=require("../bundled/component-enum.cjs"),m=require("../bundled/form-associated.cjs"),h=require("../bundled/definition5.cjs"),g=require("../bundled/feedback-message.cjs"),_=require("../bundled/definition10.cjs"),v=require("../bundled/form-element.cjs"),y=require("../bundled/with-contextual-help.cjs"),b=require("../bundled/with-error-text.cjs"),x=require("../bundled/with-success-text.cjs"),S=require("../bundled/mixins.cjs"),C=require("../bundled/definition20.cjs"),w=require("../bundled/divider.cjs");var T=`.label-wrapper{align-items:center;gap:var(--label-wrapper-gap,4px);flex-direction:row;display:flex}.label-wrapper[hidden]{display:none}.label:not(slot),.label::slotted(label){flex:0 auto}:host{display:inline-block}.base{--_text-field-gutter-start:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2))) / 2.5);--_text-field-gutter-end:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2))) / 2.5);--_text-field-icon-size:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2))) / 2);--_text-field-block-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2)));--_text-field-border-radius:8px;--_text-field-pill-border-radius:24px;grid-template-columns:min-content 1fr max-content;align-items:center;gap:4px;width:100%;display:inline-grid}.base.size-condensed{--_text-field-gutter-start:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 16)) / 2);--_text-field-gutter-end:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 16)) / 2);--_text-field-icon-size:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 8)) / 2);--_text-field-block-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 8));--_text-field-border-radius:4px}.base{user-select:none}.base:not(.disabled){--_low-ink-color:var(--vvd-color-neutral-600)}.base.disabled{--_low-ink-color:var(--_appearance-color-text)}.label:not(slot),.label::slotted(label){font:var(--vvd-typography-base);grid-area:1/1/auto/4;box-sizing:initial!important;padding:initial!important;margin:initial!important;color:var(--vvd-color-canvas-text)!important}.char-count+.label:not(slot),.char-count+.label::slotted(label){grid-column:1/3}.char-count{color:var(--_low-ink-color);font:var(--vvd-typography-base)}.label-wrapper{grid-area:1/1/auto/4}.char-count+.label-wrapper{grid-column:1/3}.fieldset{background-color:var(--_appearance-color-fill);font:var(--vvd-typography-base);grid-column:1/4;align-items:center;padding-block:0;transition:color .2s,background-color .2s;display:flex;position:relative}.fieldset:after{border-radius:inherit;block-size:100%;box-shadow:inset 0 0 0 1px var(--_appearance-color-outline);content:"";pointer-events:none;inline-size:100%;transition:box-shadow .2s;display:block;position:absolute}.fieldset:focus-visible{outline:none}.base>.fieldset{block-size:var(--_text-field-block-size)}.base:not(.shape-pill) .fieldset{border-radius:var(--_text-field-border-radius)}.base.shape-pill .fieldset{border-radius:var(--_text-field-pill-border-radius)}.wrapper{border-radius:inherit;block-size:100%;inline-size:100%}.control{border-radius:inherit;text-align:start}.control:not(slot),.control::slotted(input){font:inherit;text-align:inherit;outline:#0000;box-sizing:border-box!important;border-radius:inherit!important;width:100%!important;margin:initial!important;appearance:none!important;block-size:100%!important;color:inherit!important;padding-block:0!important;padding-inline:var(--_text-field-gutter-start) var(--_text-field-gutter-end)!important;background-color:#0000!important;border:0!important}.control:not(slot,:focus),.control::slotted(input:not(:focus)){text-overflow:ellipsis!important}.control:not(slot):disabled,.control::slotted(input:disabled){cursor:not-allowed!important;opacity:1!important;-webkit-text-fill-color:var(--_appearance-color-text)!important}.control:not(slot)::placeholder{opacity:1!important;-webkit-text-fill-color:var(--_low-ink-color)!important}.control::slotted(input:-webkit-autofill),.control:not(slot):-webkit-autofill{-webkit-box-shadow:0 0 0 1000px var(--_appearance-color-fill) inset;-webkit-text-fill-color:var(--_appearance-color-text)!important}.control::slotted(input:autofill),.control:not(slot):autofill{-webkit-box-shadow:0 0 0 1000px var(--_appearance-color-fill) inset;-webkit-text-fill-color:var(--_appearance-color-text)!important}.has-icon .control:not(slot),.has-icon .control::slotted(input){padding-inline-start:calc(var(--_text-field-icon-size) + var(--_text-field-gutter-start) * 2)!important}.icon{z-index:1;color:var(--_low-ink-color);font-size:var(--_text-field-icon-size);line-height:1;position:absolute;inset-block-start:50%;inset-inline-start:calc(100% + var(--_text-field-gutter-start));transform:translateY(-50%)}.leading-items-wrapper{position:relative}.base.no-leading .leading-items-wrapper{display:none}.action-items-wrapper{margin-inline-end:4px}.base:not(.action-items) .action-items-wrapper{display:none}@supports selector(:has(*)){.base:not(.has-activedescendant) .fieldset:has(.wrapper .control:focus-within):after{--focus-stroke-gap-color:transparent;box-shadow:0 0 0 4px color-mix(in sRGB, var(--focus-stroke-color,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))}}@supports not selector(:has(*)){.base:not(.has-activedescendant) .wrapper:focus-within:after{box-shadow:0 0 0 4px color-mix(in sRGB, var(--focus-stroke-color,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));--focus-stroke-gap-color:transparent;z-index:1;border-radius:inherit;content:"";pointer-events:none;display:block;position:absolute;inset:0}}:host([internal-part]) .fieldset{font:var(--vvd-typography-heading-4);background-color:#0000;line-height:1.1}:host([internal-part]) .fieldset:not(:focus-within):after{block-size:1px;inset-block-end:0}@supports selector(:has(*)){:host([internal-part]) .fieldset:has(.action-items-wrapper:focus-within):after{block-size:1px;inset-block-end:0}}:host([internal-part]) .control{text-align:center}slot[name=_mirrored-helper-text]{display:none}.base{--_text-field-gutter-end:70px}.base.no-steppers{--_text-field-gutter-end:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2))) / 2.5)}.base.no-steppers.size-condensed{--_text-field-gutter-end:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 16)) / 2)}.control::-webkit-outer-spin-button,.control::-webkit-inner-spin-button{appearance:none}.control-buttons{z-index:1;display:flex;position:absolute;right:3px}.control-buttons[hidden]{display:none}.readonly .control-buttons,.disabled .control-buttons{pointer-events:none}.control-buttons .divider{margin-block:8px}.control-buttons>*{flex-shrink:0}`,E=p.t([`fieldset`,`ghost`],`fieldset`),D={up:1,down:-1},O=1;function k(e,t){let n=e._numericStep,r=parseFloat(e.value),i=isNaN(r)?e.min>0?e.min:e.max<0?e.max:e.min?0:t*n:r+t*n;e.value=Number(i.toFixed(12)).toString(),e._updatedValueAnnouncement=e.locale.numberField.updatedValueAnnouncement(e._presentationValue)}var A={toView(e){return e===`any`?`any`:t.h.toView(e)},fromView(e){return typeof e==`string`&&e.trim().toLowerCase()===`any`?`any`:t.h.fromView(e)}},j=e=>{let t=e.source;return{invalidCharacters:RegExp(`[^0-9\\-+e${t}]`,`g`),additionalDecimalSeparators:RegExp(`(?<=${t}.*)${t}`,`g`),trailingDecimalSeparator:RegExp(`${t}$`),decimalSeparator:e}},M=j(/\./),N=j(/,/),P=/^-?((\d*\.\d+)|(\d+))$/,F=class extends y.t(S.t(b.t(x.t(v.t(d.t(e.t(f.t(m.n(t.t))))))))){constructor(...e){super(...e),this.proxy=document.createElement(`input`),this.readOnly=!1,this.autofocus=!1,this.step=1,this.noSteppers=!1,this.isUserInput=!1,this._presentationValue=``,this._updatedValueAnnouncement=``,this.incrementButtonAriaLabel=null,this.decrementButtonAriaLabel=null}stepChanged(e,t){this.proxy.setAttribute(`step`,t===`any`?`any`:Number.isFinite(t)?t.toString():``),this.validate()}get _hasSteppers(){return!this.noSteppers&&this.step!==`any`}get _numericStep(){return this.step===`any`?O:this.step}maxChanged(e,t){this.max=Math.max(t,this.min??t),this.proxy.max=this.max.toString(),this.validate()}minChanged(e,t){this.min=Math.min(t,this.max??t),this.proxy.min=this.min.toString(),this.validate()}get valueAsNumber(){return parseFloat(this.value)}set valueAsNumber(e){this.value=e.toString()}valueChanged(e,t){this.value=P.test(t)?t:``,t===this.value&&(this.control&&!this.isUserInput&&(this._presentationValue=this.#e(this.value)),super.valueChanged(e,this.value),e!==void 0&&!this.isUserInput&&(this.$emit(`input`),this.$emit(`change`)))}get _numberPatterns(){return this.locale.common.useCommaAsDecimalSeparator?N:M}#e(e){return e.replace(`.`,this.locale.common.useCommaAsDecimalSeparator?`,`:`.`)}#t(e){return e.replace(this._numberPatterns.invalidCharacters,``).replace(this._numberPatterns.additionalDecimalSeparators,``)}#n(e){let t=e.replace(this._numberPatterns.trailingDecimalSeparator,``).replace(this._numberPatterns.decimalSeparator,`.`);return P.test(t)?t:``}validate(){super.validate(this.control)}stepUp(){k(this,D.up)}stepDown(){k(this,D.down)}connectedCallback(){super.connectedCallback(),this.proxy.setAttribute(`type`,`number`),this.validate(),this._presentationValue=this.#e(this.value),this.autofocus&&t.M.enqueue(()=>{this.focus()})}select(){this.control.select(),this.$emit(`select`)}handleTextInput(){this._presentationValue=this.#t(this.control.value),this.control.value!==this._presentationValue&&(this.control.value=this._presentationValue),this.isUserInput=!0,this.value=this.#n(this._presentationValue),this.isUserInput=!1}handleChange(){this.$emit(`change`)}handleKeyDown(e){switch(e.key){case l.i:return this.stepUp(),!1;case l.t:return this.stepDown(),!1}return!0}};s.t([t.m({attribute:`readonly`,mode:`boolean`})],F.prototype,`readOnly`,void 0),s.t([t.m({mode:`boolean`})],F.prototype,`autofocus`,void 0),s.t([t.m],F.prototype,`placeholder`,void 0),s.t([t.m],F.prototype,`list`,void 0),s.t([t.m({converter:t.h})],F.prototype,`maxlength`,void 0),s.t([t.m({converter:t.h})],F.prototype,`minlength`,void 0),s.t([t.m({converter:t.h})],F.prototype,`size`,void 0),s.t([t.m()],F.prototype,`scale`,void 0),s.t([t.m({converter:A})],F.prototype,`step`,void 0),s.t([t.m({attribute:`no-steppers`,mode:`boolean`})],F.prototype,`noSteppers`,void 0),s.t([t.m({converter:t.h})],F.prototype,`max`,void 0),s.t([t.m({converter:t.h})],F.prototype,`min`,void 0),s.t([t.A],F.prototype,`defaultSlottedNodes`,void 0),s.t([t.A],F.prototype,`_presentationValue`,void 0),s.t([t.A],F.prototype,`_updatedValueAnnouncement`,void 0),s.t([t.m({attribute:`increment-button-aria-label`})],F.prototype,`incrementButtonAriaLabel`,void 0),s.t([t.m({attribute:`decrement-button-aria-label`})],F.prototype,`decrementButtonAriaLabel`,void 0),s.t([t.m],F.prototype,`appearance`,void 0),s.t([t.m],F.prototype,`shape`,void 0),s.t([t.m],F.prototype,`autoComplete`,void 0);function I(){return t.p` <label for="control" class="label">
|
|
2
2
|
${e=>e.label}
|
|
3
|
-
</label>`}function
|
|
4
|
-
<div class="control-buttons"
|
|
3
|
+
</label>`}function L(e){return e.shape===o.i.Pill?o.i.Pill:null}function R(e){return e.disabled||e.readOnly?`-1`:null}function z(e){let n=e.tagFor(h.i),r=e.tagFor(w.t);return t.p`
|
|
4
|
+
<div class="control-buttons"
|
|
5
|
+
?hidden="${e=>!e._hasSteppers}"
|
|
6
|
+
?inert="${e=>e.disabled||e.readOnly}">
|
|
5
7
|
<${n} id="subtract" icon="minus-line"
|
|
6
8
|
?disabled="${e=>e.disabled||e.readOnly}"
|
|
7
|
-
aria-label=${e=>e.decrementButtonAriaLabel||e.locale.numberField.decrementButtonLabel(e.
|
|
8
|
-
shape="${
|
|
9
|
+
aria-label=${e=>e.decrementButtonAriaLabel||e.locale.numberField.decrementButtonLabel(e._numericStep)}
|
|
10
|
+
shape="${L}"
|
|
9
11
|
type="button"
|
|
10
12
|
size="${e=>e.scale===`condensed`?`super-condensed`:`condensed`}"
|
|
11
|
-
tabindex="${
|
|
13
|
+
tabindex="${R}"
|
|
12
14
|
@click="${e=>e.stepDown()}"></${n}>
|
|
13
15
|
<${r} class="divider" orientation="vertical"></${r}>
|
|
14
16
|
<${n} id="add" icon="plus-line"
|
|
15
17
|
?disabled="${e=>e.disabled||e.readOnly}"
|
|
16
|
-
aria-label=${e=>e.incrementButtonAriaLabel||e.locale.numberField.incrementButtonLabel(e.
|
|
17
|
-
shape="${
|
|
18
|
+
aria-label=${e=>e.incrementButtonAriaLabel||e.locale.numberField.incrementButtonLabel(e._numericStep)}
|
|
19
|
+
shape="${L}"
|
|
18
20
|
type="button"
|
|
19
21
|
size="${e=>e.scale===`condensed`?`super-condensed`:`condensed`}"
|
|
20
|
-
tabindex="${
|
|
22
|
+
tabindex="${R}"
|
|
21
23
|
@click="${e=>e.stepUp()}"></${n}>
|
|
22
24
|
</div>
|
|
23
|
-
`}var
|
|
24
|
-
<div class="base ${e=>c.t(`connotation-accent`,`appearance-${E.parse(e.appearance)}`,`with-idle`,`with-hover`,`with-disabled`,`with-readonly`,`with-error`,`with-success`,[`error`,!!e.errorValidationMessage],[`disabled`,e.disabled],[`has-value`,!!e.value],[`readonly`,e.readOnly],[`placeholder`,!!e.placeholder],[`shape-${e.shape}`,!!e.shape],[`no-label`,!e.label],[`success`,!!e.successText],[`size-${e.scale}`,!!e.scale])}">
|
|
25
|
+
`}var B=t.u(`number-field`,F,e=>{let o=e.tagFor(a.r);return t.p`
|
|
26
|
+
<div class="base ${e=>c.t(`connotation-accent`,`appearance-${E.parse(e.appearance)}`,`with-idle`,`with-hover`,`with-disabled`,`with-readonly`,`with-error`,`with-success`,[`error`,!!e.errorValidationMessage],[`disabled`,e.disabled],[`has-value`,!!e.value],[`readonly`,e.readOnly],[`placeholder`,!!e.placeholder],[`shape-${e.shape}`,!!e.shape],[`no-label`,!e.label],[`success`,!!e.successText],[`size-${e.scale}`,!!e.scale],[`no-steppers`,!e._hasSteppers])}">
|
|
25
27
|
<div class="label-wrapper" ?hidden=${e=>!e.label&&!e._hasContextualHelp}>
|
|
26
|
-
${i.t(e=>e.label,
|
|
28
|
+
${i.t(e=>e.label,I())}
|
|
27
29
|
<slot name="contextual-help" ${n.t(`_contextualHelpSlottedContent`)}></slot>
|
|
28
30
|
</div>
|
|
29
31
|
<div class="fieldset">
|
|
@@ -52,10 +54,10 @@ const e=require("../bundled/localized.cjs"),t=require("../bundled/vivid-element.
|
|
|
52
54
|
${r.t(`control`)}
|
|
53
55
|
/>
|
|
54
56
|
</div>
|
|
55
|
-
${()=>
|
|
57
|
+
${()=>z(e)}
|
|
56
58
|
</div>
|
|
57
59
|
${t=>t._getFeedbackTemplate(e)}
|
|
58
60
|
<${o} id="value-announcement" role="status" aria-atomic="true">
|
|
59
61
|
${e=>e._updatedValueAnnouncement}</${o}>
|
|
60
62
|
</div>
|
|
61
|
-
`},[h.t,C.t,u.t,g.n,a.n,_.t],{styles:T,shadowOptions:{delegatesFocus:!0}});t.d(
|
|
63
|
+
`},[h.t,C.t,u.t,g.n,a.n,_.t],{styles:T,shadowOptions:{delegatesFocus:!0}});t.d(B)();
|