@warp-ds/elements 2.9.0-next.3 → 2.9.0-next.4
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/dist/custom-elements.json +84 -170
- package/dist/docs/affix/accessibility.md +1 -0
- package/dist/docs/affix/affix.md +6 -4
- package/dist/docs/affix/api.md +0 -4
- package/dist/docs/affix/examples.md +1 -0
- package/dist/docs/affix/usage.md +1 -0
- package/dist/docs/attention/accessibility.md +1 -0
- package/dist/docs/attention/attention.md +6 -0
- package/dist/docs/attention/examples.md +1 -0
- package/dist/docs/attention/usage.md +1 -0
- package/dist/docs/badge/accessibility.md +1 -0
- package/dist/docs/badge/badge.md +6 -0
- package/dist/docs/badge/examples.md +1 -0
- package/dist/docs/badge/usage.md +1 -0
- package/dist/docs/box/accessibility.md +1 -0
- package/dist/docs/box/box.md +6 -0
- package/dist/docs/box/examples.md +1 -0
- package/dist/docs/box/usage.md +1 -0
- package/dist/docs/breadcrumbs/accessibility.md +1 -0
- package/dist/docs/breadcrumbs/breadcrumbs.md +6 -0
- package/dist/docs/breadcrumbs/examples.md +1 -0
- package/dist/docs/breadcrumbs/usage.md +1 -0
- package/dist/docs/button/accessibility.md +1 -0
- package/dist/docs/button/button.md +6 -0
- package/dist/docs/button/examples.md +1 -0
- package/dist/docs/button/usage.md +1 -0
- package/dist/docs/card/accessibility.md +1 -0
- package/dist/docs/card/card.md +6 -0
- package/dist/docs/card/examples.md +1 -0
- package/dist/docs/card/usage.md +1 -0
- package/dist/docs/combobox/accessibility.md +1 -0
- package/dist/docs/combobox/api.md +15 -15
- package/dist/docs/combobox/combobox.md +21 -15
- package/dist/docs/combobox/examples.md +1 -0
- package/dist/docs/combobox/usage.md +1 -0
- package/dist/docs/datepicker/accessibility.md +1 -0
- package/dist/docs/datepicker/api.md +1 -9
- package/dist/docs/datepicker/datepicker.md +7 -9
- package/dist/docs/datepicker/examples.md +1 -0
- package/dist/docs/datepicker/usage.md +1 -0
- package/dist/docs/expandable/accessibility.md +1 -0
- package/dist/docs/expandable/examples.md +1 -0
- package/dist/docs/expandable/expandable.md +6 -0
- package/dist/docs/expandable/usage.md +1 -0
- package/dist/docs/link/accessibility.md +1 -0
- package/dist/docs/link/examples.md +1 -0
- package/dist/docs/link/link.md +6 -0
- package/dist/docs/link/usage.md +1 -0
- package/dist/docs/page-indicator/accessibility.md +1 -0
- package/dist/docs/page-indicator/api.md +2 -2
- package/dist/docs/page-indicator/examples.md +1 -0
- package/dist/docs/page-indicator/page-indicator.md +8 -2
- package/dist/docs/page-indicator/usage.md +1 -0
- package/dist/docs/pagination/accessibility.md +1 -0
- package/dist/docs/pagination/examples.md +1 -0
- package/dist/docs/pagination/pagination.md +6 -0
- package/dist/docs/pagination/usage.md +1 -0
- package/dist/docs/pill/accessibility.md +1 -0
- package/dist/docs/pill/examples.md +1 -0
- package/dist/docs/pill/pill.md +6 -0
- package/dist/docs/pill/usage.md +1 -0
- package/dist/docs/select/accessibility.md +1 -0
- package/dist/docs/select/api.md +19 -11
- package/dist/docs/select/examples.md +1 -0
- package/dist/docs/select/select.md +25 -11
- package/dist/docs/select/usage.md +1 -0
- package/dist/docs/slider/accessibility.md +1 -0
- package/dist/docs/slider/api.md +15 -9
- package/dist/docs/slider/examples.md +1 -0
- package/dist/docs/slider/slider.md +21 -9
- package/dist/docs/slider/usage.md +1 -0
- package/dist/docs/slider-thumb/accessibility.md +1 -0
- package/dist/docs/slider-thumb/api.md +48 -0
- package/dist/docs/slider-thumb/examples.md +1 -0
- package/dist/docs/slider-thumb/slider-thumb.md +54 -0
- package/dist/docs/slider-thumb/usage.md +1 -0
- package/dist/docs/step/accessibility.md +1 -0
- package/dist/docs/step/examples.md +1 -0
- package/dist/docs/step/step.md +6 -0
- package/dist/docs/step/usage.md +1 -0
- package/dist/docs/step-indicator/accessibility.md +1 -0
- package/dist/docs/step-indicator/examples.md +1 -0
- package/dist/docs/step-indicator/step-indicator.md +6 -0
- package/dist/docs/step-indicator/usage.md +1 -0
- package/dist/docs/switch/accessibility.md +1 -0
- package/dist/docs/switch/examples.md +1 -0
- package/dist/docs/switch/switch.md +6 -0
- package/dist/docs/switch/usage.md +1 -0
- package/dist/docs/tab/accessibility.md +1 -0
- package/dist/docs/tab/api.md +16 -0
- package/dist/docs/tab/examples.md +1 -0
- package/dist/docs/tab/tab.md +22 -0
- package/dist/docs/tab/usage.md +1 -0
- package/dist/docs/tab-panel/accessibility.md +1 -0
- package/dist/docs/tab-panel/api.md +16 -0
- package/dist/docs/tab-panel/examples.md +1 -0
- package/dist/docs/tab-panel/tab-panel.md +22 -0
- package/dist/docs/tab-panel/usage.md +1 -0
- package/dist/docs/tabs/accessibility.md +1 -0
- package/dist/docs/tabs/examples.md +1 -0
- package/dist/docs/tabs/tabs.md +6 -0
- package/dist/docs/tabs/usage.md +1 -0
- package/dist/docs/textarea/accessibility.md +1 -0
- package/dist/docs/textarea/examples.md +1 -0
- package/dist/docs/textarea/textarea.md +6 -0
- package/dist/docs/textarea/usage.md +1 -0
- package/dist/docs/textfield/accessibility.md +1 -0
- package/dist/docs/textfield/api.md +16 -6
- package/dist/docs/textfield/examples.md +1 -0
- package/dist/docs/textfield/textfield.md +22 -6
- package/dist/docs/textfield/usage.md +1 -0
- package/dist/docs/toast/accessibility.md +9 -0
- package/dist/docs/toast/api.md +71 -0
- package/dist/docs/toast/examples.md +29 -0
- package/dist/docs/toast/toast.md +150 -0
- package/dist/docs/toast/usage.md +31 -0
- package/dist/index.d.ts +104 -97
- package/dist/packages/affix/affix.d.ts +16 -2
- package/dist/packages/affix/affix.js.map +2 -2
- package/dist/packages/attention/attention.d.ts +52 -0
- package/dist/packages/attention/attention.js.map +2 -2
- package/dist/packages/badge/badge.d.ts +8 -0
- package/dist/packages/badge/badge.js.map +2 -2
- package/dist/packages/box/box.d.ts +20 -0
- package/dist/packages/box/box.js.map +2 -2
- package/dist/packages/button/button.d.ts +60 -2
- package/dist/packages/button/button.js.map +2 -2
- package/dist/packages/card/card.d.ts +12 -0
- package/dist/packages/card/card.js.map +2 -2
- package/dist/packages/combobox/combobox.d.ts +60 -15
- package/dist/packages/combobox/combobox.js.map +2 -2
- package/dist/packages/datepicker/datepicker.d.ts +32 -5
- package/dist/packages/datepicker/datepicker.js.map +2 -2
- package/dist/packages/expandable/expandable.d.ts +44 -0
- package/dist/packages/expandable/expandable.js.map +2 -2
- package/dist/packages/link/link.d.ts +32 -0
- package/dist/packages/link/link.js.map +2 -2
- package/dist/packages/page-indicator/page-indicator.d.ts +8 -2
- package/dist/packages/page-indicator/page-indicator.js.map +2 -2
- package/dist/packages/pagination/pagination.d.ts +16 -0
- package/dist/packages/pagination/pagination.js.map +2 -2
- package/dist/packages/pill/pill.d.ts +24 -2
- package/dist/packages/pill/pill.js.map +2 -2
- package/dist/packages/select/select.d.ts +56 -12
- package/dist/packages/select/select.js.map +2 -2
- package/dist/packages/slider/slider.d.ts +65 -8
- package/dist/packages/slider/slider.js +7 -7
- package/dist/packages/slider/slider.js.map +3 -3
- package/dist/packages/slider/slider.test.js +68 -0
- package/dist/packages/slider-thumb/slider-thumb.d.ts +44 -6
- package/dist/packages/slider-thumb/slider-thumb.js +24 -23
- package/dist/packages/slider-thumb/slider-thumb.js.map +3 -3
- package/dist/packages/step/step.d.ts +8 -0
- package/dist/packages/step/step.js.map +2 -2
- package/dist/packages/step-indicator/step-indicator.d.ts +8 -0
- package/dist/packages/step-indicator/step-indicator.js.map +2 -2
- package/dist/packages/switch/switch.d.ts +16 -0
- package/dist/packages/switch/switch.js.map +2 -2
- package/dist/packages/tab/tab.d.ts +28 -3
- package/dist/packages/tab/tab.js.map +2 -2
- package/dist/packages/tab-panel/tab-panel.d.ts +8 -2
- package/dist/packages/tab-panel/tab-panel.js.map +2 -2
- package/dist/packages/tabs/tabs.d.ts +4 -0
- package/dist/packages/tabs/tabs.js.map +2 -2
- package/dist/packages/textarea/textarea.d.ts +52 -1
- package/dist/packages/textarea/textarea.js.map +2 -2
- package/dist/packages/textfield/textfield.d.ts +92 -4
- package/dist/packages/textfield/textfield.js.map +2 -2
- package/dist/packages/toast-container/toast-container.d.ts +14 -0
- package/dist/packages/toast-container/toast-container.js.map +2 -2
- package/dist/web-types.json +60 -221
- package/package.json +2 -2
- package/dist/docs/toast-container/api.md +0 -14
- package/dist/docs/toast-container/toast-container.md +0 -20
|
@@ -61,6 +61,74 @@ test('can set slider value via the number input', async () => {
|
|
|
61
61
|
const formData = new FormData(page.getByTestId('form').element());
|
|
62
62
|
expect(formData.get('value')).toBe('50');
|
|
63
63
|
});
|
|
64
|
+
test('can increment and decrement the slider values with arrow keys in the number input', async () => {
|
|
65
|
+
const component = html `
|
|
66
|
+
<form data-testid="form">
|
|
67
|
+
<w-slider
|
|
68
|
+
label="Model year"
|
|
69
|
+
min="1950"
|
|
70
|
+
max="2025"
|
|
71
|
+
open-ended
|
|
72
|
+
>
|
|
73
|
+
<w-slider-thumb
|
|
74
|
+
slot="from"
|
|
75
|
+
aria-label="From year"
|
|
76
|
+
name="from-year"
|
|
77
|
+
></w-slider-thumb>
|
|
78
|
+
<w-slider-thumb
|
|
79
|
+
slot="to"
|
|
80
|
+
aria-label="To year"
|
|
81
|
+
name="to-year"
|
|
82
|
+
></w-slider-thumb>
|
|
83
|
+
</w-slider>
|
|
84
|
+
</form>
|
|
85
|
+
`;
|
|
86
|
+
const page = render(component);
|
|
87
|
+
await userEvent.type(page.getByRole('spinbutton').first(), '{ArrowUp}');
|
|
88
|
+
// Go from Min "beyond" 1950 to 1950
|
|
89
|
+
await expect.element(page.getByRole('spinbutton').first()).toHaveValue(1950);
|
|
90
|
+
await expect.element(page.getByLabelText('From year').first()).toHaveValue('1950'); // keeps value in sync between inputs
|
|
91
|
+
await userEvent.type(page.getByRole('spinbutton').last(), '{ArrowDown}');
|
|
92
|
+
// Go from Max "beyond" 2025 to 2025
|
|
93
|
+
await expect.element(page.getByRole('spinbutton').last()).toHaveValue(2025);
|
|
94
|
+
await expect.element(page.getByLabelText('To year').first()).toHaveValue('2025'); // keeps value in sync between inputs
|
|
95
|
+
const formData = new FormData(page.getByTestId('form').element());
|
|
96
|
+
expect(formData.get('from-year')).toBe('1950');
|
|
97
|
+
expect(formData.get('to-year')).toBe('2025');
|
|
98
|
+
});
|
|
99
|
+
test('going down from Min and up from Max sets value to min - 1 and max + a respectively', async () => {
|
|
100
|
+
const component = html `
|
|
101
|
+
<form data-testid="form">
|
|
102
|
+
<w-slider
|
|
103
|
+
label="Model year"
|
|
104
|
+
min="1950"
|
|
105
|
+
max="2025"
|
|
106
|
+
open-ended
|
|
107
|
+
>
|
|
108
|
+
<w-slider-thumb
|
|
109
|
+
slot="from"
|
|
110
|
+
aria-label="From year"
|
|
111
|
+
name="from-year"
|
|
112
|
+
></w-slider-thumb>
|
|
113
|
+
<w-slider-thumb
|
|
114
|
+
slot="to"
|
|
115
|
+
aria-label="To year"
|
|
116
|
+
name="to-year"
|
|
117
|
+
></w-slider-thumb>
|
|
118
|
+
</w-slider>
|
|
119
|
+
</form>
|
|
120
|
+
`;
|
|
121
|
+
const page = render(component);
|
|
122
|
+
await userEvent.type(page.getByRole('spinbutton').first(), '{ArrowDown}');
|
|
123
|
+
await expect.element(page.getByRole('spinbutton').first()).toHaveValue(1949);
|
|
124
|
+
await expect.element(page.getByLabelText('From year').first()).toHaveValue('1949'); // keeps value in sync between inputs
|
|
125
|
+
await userEvent.type(page.getByRole('spinbutton').last(), '{ArrowUp}');
|
|
126
|
+
await expect.element(page.getByRole('spinbutton').last()).toHaveValue(2026);
|
|
127
|
+
await expect.element(page.getByLabelText('To year').first()).toHaveValue('2026'); // keeps value in sync between inputs
|
|
128
|
+
const formData = new FormData(page.getByTestId('form').element());
|
|
129
|
+
expect(formData.get('from-year')).toBe('1949');
|
|
130
|
+
expect(formData.get('to-year')).toBe('2026');
|
|
131
|
+
});
|
|
64
132
|
test('slider without suffix syncs empty suffix to thumb', async () => {
|
|
65
133
|
render(html `
|
|
66
134
|
<w-slider label="Single" min="0" max="100">
|
|
@@ -16,16 +16,45 @@ declare class WarpSliderThumb extends WarpSliderThumb_base {
|
|
|
16
16
|
slotAssignment?: SlotAssignmentMode;
|
|
17
17
|
};
|
|
18
18
|
static styles: import("lit").CSSResult[];
|
|
19
|
+
/**
|
|
20
|
+
* @summary
|
|
21
|
+
* @description
|
|
22
|
+
*/
|
|
19
23
|
ariaLabel: string;
|
|
24
|
+
/**
|
|
25
|
+
* @summary
|
|
26
|
+
* @description
|
|
27
|
+
*/
|
|
20
28
|
ariaDescription: string;
|
|
29
|
+
/**
|
|
30
|
+
* @summary
|
|
31
|
+
* @description
|
|
32
|
+
*/
|
|
21
33
|
name: string;
|
|
34
|
+
/**
|
|
35
|
+
* @summary
|
|
36
|
+
* @description
|
|
37
|
+
*/
|
|
22
38
|
value: string;
|
|
23
|
-
/** @internal Set by `<w-slider>`
|
|
39
|
+
/** @internal Set by `<w-slider>`
|
|
40
|
+
* @summary
|
|
41
|
+
* @description
|
|
42
|
+
*/
|
|
24
43
|
disabled: boolean;
|
|
25
|
-
/** @internal Set by `<w-slider>`
|
|
44
|
+
/** @internal Set by `<w-slider>`
|
|
45
|
+
* @summary
|
|
46
|
+
* @description
|
|
47
|
+
*/
|
|
26
48
|
invalid: boolean;
|
|
27
|
-
/** @internal Set by `<w-slider>`
|
|
49
|
+
/** @internal Set by `<w-slider>`
|
|
50
|
+
* @summary
|
|
51
|
+
* @description
|
|
52
|
+
*/
|
|
28
53
|
openEnded: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* @summary
|
|
56
|
+
* @description
|
|
57
|
+
*/
|
|
29
58
|
placeholder: string;
|
|
30
59
|
/** @internal Set by `<w-slider>` */
|
|
31
60
|
markers: string;
|
|
@@ -39,11 +68,20 @@ declare class WarpSliderThumb extends WarpSliderThumb_base {
|
|
|
39
68
|
max: string;
|
|
40
69
|
/** @internal Set by `<w-slider>` */
|
|
41
70
|
suffix: string;
|
|
42
|
-
/** @internal Formatter for the tooltip and input mask values. Set by `<w-slider>`.
|
|
71
|
+
/** @internal Formatter for the tooltip and input mask values. Set by `<w-slider>`.
|
|
72
|
+
* @summary
|
|
73
|
+
* @description
|
|
74
|
+
*/
|
|
43
75
|
valueFormatter: (value: string, slot: SliderSlot) => string;
|
|
44
|
-
/** @internal Replaces {@link valueFormatter} for the tooltip. Use in open-ended sliders to show for example "300+ hk" instead of "Max" in the tooltip. Set by `<w-slider>`.
|
|
76
|
+
/** @internal Replaces {@link valueFormatter} for the tooltip. Use in open-ended sliders to show for example "300+ hk" instead of "Max" in the tooltip. Set by `<w-slider>`.
|
|
77
|
+
* @summary
|
|
78
|
+
* @description
|
|
79
|
+
*/
|
|
45
80
|
tooltipFormatter: (value: string, slot: SliderSlot) => string;
|
|
46
|
-
/** @internal Formatter for the min and max labels below the range. Set by `<w-slider>`.
|
|
81
|
+
/** @internal Formatter for the min and max labels below the range. Set by `<w-slider>`.
|
|
82
|
+
* @summary
|
|
83
|
+
* @description
|
|
84
|
+
*/
|
|
47
85
|
labelFormatter: (slot: SliderSlot) => string;
|
|
48
86
|
range: HTMLInputElement;
|
|
49
87
|
tooltipTarget: HTMLOutputElement;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var
|
|
2
|
-
`],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function
|
|
1
|
+
var Ue=Object.create;var ie=Object.defineProperty;var we=Object.getOwnPropertyDescriptor;var Re=Object.getOwnPropertyNames;var Xe=Object.getPrototypeOf,He=Object.prototype.hasOwnProperty;var xe=o=>{throw TypeError(o)};var ke=(o,r)=>()=>(r||o((r={exports:{}}).exports,r),r.exports);var qe=(o,r,e,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of Re(r))!He.call(o,a)&&a!==e&&ie(o,a,{get:()=>r[a],enumerable:!(t=we(r,a))||t.enumerable});return o};var Ze=(o,r,e)=>(e=o!=null?Ue(Xe(o)):{},qe(r||!o||!o.__esModule?ie(e,"default",{value:o,enumerable:!0}):e,o));var p=(o,r,e,t)=>{for(var a=t>1?void 0:t?we(r,e):r,i=o.length-1,n;i>=0;i--)(n=o[i])&&(a=(t?n(r,e,a):n(a))||a);return t&&a&&ie(r,e,a),a};var se=(o,r,e)=>r.has(o)||xe("Cannot "+e);var ne=(o,r,e)=>(se(o,r,"read from private field"),e?e.call(o):r.get(o)),le=(o,r,e)=>r.has(o)?xe("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(o):r.set(o,e),de=(o,r,e,t)=>(se(o,r,"write to private field"),t?t.call(o,e):r.set(o,e),e),m=(o,r,e)=>(se(o,r,"access private method"),e);var ye=ke(O=>{"use strict";Object.defineProperty(O,"__esModule",{value:!0});O.errorMessages=O.ErrorType=void 0;var U;(function(o){o.MalformedUnicode="MALFORMED_UNICODE",o.MalformedHexadecimal="MALFORMED_HEXADECIMAL",o.CodePointLimit="CODE_POINT_LIMIT",o.OctalDeprecation="OCTAL_DEPRECATION",o.EndOfString="END_OF_STRING"})(U=O.ErrorType||(O.ErrorType={}));O.errorMessages=new Map([[U.MalformedUnicode,"malformed Unicode character escape sequence"],[U.MalformedHexadecimal,"malformed hexadecimal character escape sequence"],[U.CodePointLimit,"Unicode codepoint must not be greater than 0x10FFFF in escape sequence"],[U.OctalDeprecation,'"0"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead'],[U.EndOfString,"malformed escape sequence at end of string"]])});var ze=ke(T=>{"use strict";Object.defineProperty(T,"__esModule",{value:!0});T.unraw=T.errorMessages=T.ErrorType=void 0;var y=ye();Object.defineProperty(T,"ErrorType",{enumerable:!0,get:function(){return y.ErrorType}});Object.defineProperty(T,"errorMessages",{enumerable:!0,get:function(){return y.errorMessages}});function Be(o){return!o.match(/[^a-f0-9]/i)?parseInt(o,16):NaN}function G(o,r,e){let t=Be(o);if(Number.isNaN(t)||e!==void 0&&e!==o.length)throw new SyntaxError(y.errorMessages.get(r));return t}function Ke(o){let r=G(o,y.ErrorType.MalformedHexadecimal,2);return String.fromCharCode(r)}function _e(o,r){let e=G(o,y.ErrorType.MalformedUnicode,4);if(r!==void 0){let t=G(r,y.ErrorType.MalformedUnicode,4);return String.fromCharCode(e,t)}return String.fromCharCode(e)}function Ge(o){return o.charAt(0)==="{"&&o.charAt(o.length-1)==="}"}function Je(o){if(!Ge(o))throw new SyntaxError(y.errorMessages.get(y.ErrorType.MalformedUnicode));let r=o.slice(1,-1),e=G(r,y.ErrorType.MalformedUnicode);try{return String.fromCodePoint(e)}catch(t){throw t instanceof RangeError?new SyntaxError(y.errorMessages.get(y.ErrorType.CodePointLimit)):t}}function Qe(o,r=!1){if(r)throw new SyntaxError(y.errorMessages.get(y.ErrorType.OctalDeprecation));let e=parseInt(o,8);return String.fromCharCode(e)}var We=new Map([["b","\b"],["f","\f"],["n",`
|
|
2
|
+
`],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function er(o){return We.get(o)||o}var rr=/\\(?:(\\)|x([\s\S]{0,2})|u(\{[^}]*\}?)|u([\s\S]{4})\\u([^{][\s\S]{0,3})|u([\s\S]{0,4})|([0-3]?[0-7]{1,2})|([\s\S])|$)/g;function Ce(o,r=!1){return o.replace(rr,function(e,t,a,i,n,s,d,g,_){if(t!==void 0)return"\\";if(a!==void 0)return Ke(a);if(i!==void 0)return Je(i);if(n!==void 0)return _e(n,s);if(d!==void 0)return _e(d);if(g==="0")return"\0";if(g!==void 0)return Qe(g,!r);if(_!==void 0)return er(_);throw new SyntaxError(y.errorMessages.get(y.ErrorType.EndOfString))})}T.unraw=Ce;T.default=Ce});var Fe=Ze(ze(),1);var L=o=>typeof o=="string",tr=o=>typeof o=="function",Ee=new Map,Se="en";function be(o){return[...Array.isArray(o)?o:[o],Se]}function pe(o,r,e){let t=be(o);e||(e="default");let a;if(typeof e=="string")switch(a={day:"numeric",month:"short",year:"numeric"},e){case"full":a.weekday="long";case"long":a.month="long";break;case"short":a.month="numeric";break}else a=e;return J(()=>Q("date",t,e),()=>new Intl.DateTimeFormat(t,a)).format(L(r)?new Date(r):r)}function or(o,r,e){let t;if(e||(e="default"),typeof e=="string")switch(t={second:"numeric",minute:"numeric",hour:"numeric"},e){case"full":case"long":t.timeZoneName="short";break;case"short":delete t.second}else t=e;return pe(o,r,t)}function ce(o,r,e){let t=be(o);return J(()=>Q("number",t,e),()=>new Intl.NumberFormat(t,e)).format(r)}function Me(o,r,e,{offset:t=0,...a}){var s,d;let i=be(o),n=r?J(()=>Q("plural-ordinal",i),()=>new Intl.PluralRules(i,{type:"ordinal"})):J(()=>Q("plural-cardinal",i),()=>new Intl.PluralRules(i,{type:"cardinal"}));return(d=(s=a[e])!=null?s:a[n.select(e-t)])!=null?d:a.other}function J(o,r){let e=o(),t=Ee.get(e);return t||(t=r(),Ee.set(e,t)),t}function Q(o,r,e){let t=r.join("-");return`${o}-${t}-${JSON.stringify(e)}`}var $e=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,Ve="%__lingui_octothorpe__%",ar=(o,r,e={})=>{let t=r||o,a=n=>typeof n=="object"?n:e[n],i=(n,s)=>{let d=Object.keys(e).length?a("number"):void 0,g=ce(t,n,d);return s.replace(new RegExp(Ve,"g"),g)};return{plural:(n,s)=>{let{offset:d=0}=s,g=Me(t,!1,n,s);return i(n-d,g)},selectordinal:(n,s)=>{let{offset:d=0}=s,g=Me(t,!0,n,s);return i(n-d,g)},select:ir,number:(n,s)=>ce(t,n,a(s)||{style:s}),date:(n,s)=>pe(t,n,a(s)||s),time:(n,s)=>or(t,n,a(s)||s)}},ir=(o,r)=>{var e;return(e=r[o])!=null?e:r.other};function sr(o,r,e){return(t={},a)=>{let i=ar(r,e,a),n=(d,g=!1)=>Array.isArray(d)?d.reduce((_,F)=>{if(F==="#"&&g)return _+Ve;if(L(F))return _+F;let[S,k,C]=F,z={};k==="plural"||k==="selectordinal"||k==="select"?Object.entries(C).forEach(([N,$])=>{z[N]=n($,k==="plural"||k==="selectordinal")}):z=C;let x;if(k){let N=i[k];x=N(t[S],z)}else x=t[S];return x==null?_:_+x},""):d,s=n(o);return L(s)&&$e.test(s)?(0,Fe.unraw)(s):L(s)?s:s?String(s):""}}var nr=Object.defineProperty,lr=(o,r,e)=>r in o?nr(o,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[r]=e,dr=(o,r,e)=>(lr(o,typeof r!="symbol"?r+"":r,e),e),he=class{constructor(){dr(this,"_events",{})}on(r,e){var a;var t;return(a=(t=this._events)[r])!=null||(t[r]=[]),this._events[r].push(e),()=>this.removeListener(r,e)}removeListener(r,e){let t=this._getListeners(r);if(!t)return;let a=t.indexOf(e);~a&&t.splice(a,1)}emit(r,...e){let t=this._getListeners(r);t&&t.map(a=>a.apply(this,e))}_getListeners(r){let e=this._events[r];return Array.isArray(e)?e:!1}},cr=Object.defineProperty,hr=(o,r,e)=>r in o?cr(o,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[r]=e,I=(o,r,e)=>(hr(o,typeof r!="symbol"?r+"":r,e),e),ue=class extends he{constructor(r){var e;super(),I(this,"_locale",""),I(this,"_locales"),I(this,"_localeData",{}),I(this,"_messages",{}),I(this,"_missing"),I(this,"_messageCompiler"),I(this,"t",this._.bind(this)),r.missing!=null&&(this._missing=r.missing),r.messages!=null&&this.load(r.messages),r.localeData!=null&&this.loadLocaleData(r.localeData),(typeof r.locale=="string"||r.locales)&&this.activate((e=r.locale)!=null?e:Se,r.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){var r;return(r=this._messages[this._locale])!=null?r:{}}get localeData(){var r;return(r=this._localeData[this._locale])!=null?r:{}}_loadLocaleData(r,e){let t=this._localeData[r];t?Object.assign(t,e):this._localeData[r]=e}setMessagesCompiler(r){return this._messageCompiler=r,this}loadLocaleData(r,e){typeof r=="string"?this._loadLocaleData(r,e):Object.keys(r).forEach(t=>this._loadLocaleData(t,r[t])),this.emit("change")}_load(r,e){let t=this._messages[r];t?Object.assign(t,e):this._messages[r]=e}load(r,e){typeof r=="string"&&typeof e=="object"?this._load(r,e):Object.entries(r).forEach(([t,a])=>this._load(t,a)),this.emit("change")}loadAndActivate({locale:r,locales:e,messages:t}){this._locale=r,this._locales=e||void 0,this._messages[this._locale]=t,this.emit("change")}activate(r,e){this._locale=r,this._locales=e,this.emit("change")}_(r,e,t){if(!this.locale)throw new Error("Lingui: Attempted to call a translation function without setting a locale.\nMake sure to call `i18n.activate(locale)` before using Lingui functions.\nThis issue may also occur due to a race condition in your initialization logic.");let a=t==null?void 0:t.message;r||(r=""),L(r)||(e=r.values||e,a=r.message,r=r.id);let i=this.messages[r],n=i===void 0,s=this._missing;if(s&&n)return tr(s)?s(this._locale,r):s;n&&this.emit("missing",{id:r,locale:this._locale});let d=i||a||r;return L(d)&&(this._messageCompiler?d=this._messageCompiler(d):console.warn(`Uncompiled message detected! Message:
|
|
3
3
|
|
|
4
4
|
> ${d}
|
|
5
5
|
|
|
@@ -7,7 +7,7 @@ That means you use raw catalog or your catalog doesn't have a translation for th
|
|
|
7
7
|
ICU features such as interpolation and plurals will not work properly for that message.
|
|
8
8
|
|
|
9
9
|
Please compile your catalog first.
|
|
10
|
-
`)),
|
|
10
|
+
`)),L(d)&&$e.test(d)?JSON.parse(`"${d}"`):L(d)?d:sr(d,this._locale,this._locales)(e,t==null?void 0:t.formats)}date(r,e){return pe(this._locales||this._locale,r,e)}number(r,e){return ce(this._locales||this._locale,r,e)}};function ur(o={}){return new ue(o)}var M=ur();var u=function(o,r,e,t){if(e==="a"&&!t)throw new TypeError("Private accessor was defined without a getter");if(typeof r=="function"?o!==r||!t:!r.has(o))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?t:e==="a"?t.call(o):t?t.value:r.get(o)},v=function(o,r,e,t,a){if(t==="m")throw new TypeError("Private method is not writable");if(t==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof r=="function"?o!==r||!a:!r.has(o))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t==="a"?a.call(o,e):a?a.value=e:r.set(o,e),e};function Ne(o){var r,e,t,a,i,n,s,d,g,_,F,S,k,C,z,x,N,$,te;class Ye extends o{constructor(...l){var h,f,w;super(...l),r.add(this),this.internals=this.attachInternals(),e.set(this,!1),t.set(this,!1),a.set(this,!1),i.set(this,void 0),n.set(this,void 0),s.set(this,!0),g.set(this,""),_.set(this,()=>{v(this,a,!0,"f"),v(this,e,!0,"f"),u(this,r,"m",x).call(this)}),F.set(this,()=>{v(this,e,!1,"f"),u(this,r,"m",N).call(this,this.shouldFormValueUpdate()?u(this,g,"f"):""),!this.validity.valid&&u(this,a,"f")&&v(this,t,!0,"f");let P=u(this,r,"m",x).call(this);this.validationMessageCallback&&this.validationMessageCallback(P?this.internals.validationMessage:"")}),S.set(this,()=>{var P;u(this,s,"f")&&this.validationTarget&&(this.internals.setValidity(this.validity,this.validationMessage,this.validationTarget),v(this,s,!1,"f")),v(this,a,!0,"f"),v(this,t,!0,"f"),u(this,r,"m",x).call(this),(P=this===null||this===void 0?void 0:this.validationMessageCallback)===null||P===void 0||P.call(this,this.showError?this.internals.validationMessage:"")}),k.set(this,void 0),C.set(this,!1),z.set(this,Promise.resolve()),(h=this.addEventListener)===null||h===void 0||h.call(this,"focus",u(this,_,"f")),(f=this.addEventListener)===null||f===void 0||f.call(this,"blur",u(this,F,"f")),(w=this.addEventListener)===null||w===void 0||w.call(this,"invalid",u(this,S,"f")),this.setValue(null)}static get formAssociated(){return!0}static get validators(){return this.formControlValidators||[]}static get observedAttributes(){let l=this.validators.map(w=>w.attribute).flat(),h=super.observedAttributes||[];return[...new Set([...h,...l])]}static getValidator(l){return this.validators.find(h=>h.attribute===l)||null}static getValidators(l){return this.validators.filter(h=>{var f;if(h.attribute===l||!((f=h.attribute)===null||f===void 0)&&f.includes(l))return!0})}get form(){return this.internals.form}get showError(){return u(this,r,"m",x).call(this)}checkValidity(){return this.internals.checkValidity()}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}attributeChangedCallback(l,h,f){var w;(w=super.attributeChangedCallback)===null||w===void 0||w.call(this,l,h,f);let H=this.constructor.getValidators(l);H!=null&&H.length&&this.validationTarget&&this.setValue(u(this,g,"f"))}setValue(l){var h;v(this,t,!1,"f"),(h=this.validationMessageCallback)===null||h===void 0||h.call(this,""),v(this,g,l,"f");let w=this.shouldFormValueUpdate()?l:null;this.internals.setFormValue(w),u(this,r,"m",N).call(this,w),this.valueChangedCallback&&this.valueChangedCallback(w),u(this,r,"m",x).call(this)}shouldFormValueUpdate(){return!0}get validationComplete(){return new Promise(l=>l(u(this,z,"f")))}formResetCallback(){var l,h;v(this,a,!1,"f"),v(this,t,!1,"f"),u(this,r,"m",x).call(this),(l=this.resetFormControl)===null||l===void 0||l.call(this),(h=this.validationMessageCallback)===null||h===void 0||h.call(this,u(this,r,"m",x).call(this)?this.validationMessage:"")}}return e=new WeakMap,t=new WeakMap,a=new WeakMap,i=new WeakMap,n=new WeakMap,s=new WeakMap,g=new WeakMap,_=new WeakMap,F=new WeakMap,S=new WeakMap,k=new WeakMap,C=new WeakMap,z=new WeakMap,r=new WeakSet,d=function(){let l=this.getRootNode(),h=`${this.localName}[name="${this.getAttribute("name")}"]`;return l.querySelectorAll(h)},x=function(){if(this.hasAttribute("disabled"))return!1;let l=u(this,t,"f")||u(this,a,"f")&&!this.validity.valid&&!u(this,e,"f");return l&&this.internals.states?this.internals.states.add("--show-error"):this.internals.states&&this.internals.states.delete("--show-error"),l},N=function(l){let h=this.constructor,f={},w=h.validators,P=[],H=w.some(E=>E.isValid instanceof Promise);u(this,C,"f")||(v(this,z,new Promise(E=>{v(this,k,E,"f")}),"f"),v(this,C,!0,"f")),u(this,i,"f")&&(u(this,i,"f").abort(),v(this,n,u(this,i,"f"),"f"));let q=new AbortController;v(this,i,q,"f");let Z,ve=!1;w.length&&(w.forEach(E=>{let oe=E.key||"customError",Y=E.isValid(this,l,q.signal);Y instanceof Promise?(P.push(Y),Y.then(ae=>{ae!=null&&(f[oe]=!ae,Z=u(this,r,"m",te).call(this,E,l),u(this,r,"m",$).call(this,f,Z))})):(f[oe]=!Y,this.validity[oe]!==!Y&&(ve=!0),!Y&&!Z&&(Z=u(this,r,"m",te).call(this,E,l)))}),Promise.allSettled(P).then(()=>{var E;q!=null&&q.signal.aborted||(v(this,C,!1,"f"),(E=u(this,k,"f"))===null||E===void 0||E.call(this))}),(ve||!H)&&u(this,r,"m",$).call(this,f,Z))},$=function(l,h){if(this.validationTarget)this.internals.setValidity(l,h,this.validationTarget),v(this,s,!1,"f");else{if(this.internals.setValidity(l,h),this.internals.validity.valid)return;v(this,s,!0,"f")}},te=function(l,h){if(this.validityCallback){let f=this.validityCallback(l.key||"customError");if(f)return f}return l.message instanceof Function?l.message(this,h):l.message},Ye}import{html as B,LitElement as Le,nothing as D}from"lit";import{property as V,query as me,state as A}from"lit/decorators.js";import{classMap as mr}from"lit/directives/class-map.js";import{ifDefined as W}from"lit/directives/if-defined.js";import{css as br}from"lit";var Pe=br`*,:before,:after{--w-rotate:0;--w-rotate-x:0;--w-rotate-y:0;--w-rotate-z:0;--w-scale-x:1;--w-scale-y:1;--w-scale-z:1;--w-skew-x:0;--w-skew-y:0;--w-translate-x:0;--w-translate-y:0;--w-translate-z:0}.hidden{display:none}.absolute{position:absolute}.relative{position:relative}.static{position:static}.sr-only{clip:rect(0,0,0,0);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}`;import{css as Te}from"lit";var De=Te`
|
|
11
11
|
*,
|
|
12
12
|
:before,
|
|
13
13
|
:after {
|
|
@@ -280,7 +280,7 @@ Please compile your catalog first.
|
|
|
280
280
|
svg {
|
|
281
281
|
pointer-events: none;
|
|
282
282
|
}
|
|
283
|
-
`,
|
|
283
|
+
`,zr=Te`*, :before, :after {
|
|
284
284
|
--w-rotate: 0;
|
|
285
285
|
--w-rotate-x: 0;
|
|
286
286
|
--w-rotate-y: 0;
|
|
@@ -2446,7 +2446,7 @@ Please compile your catalog first.
|
|
|
2446
2446
|
display: none
|
|
2447
2447
|
}
|
|
2448
2448
|
}
|
|
2449
|
-
`;import{css as
|
|
2449
|
+
`;import{css as pr}from"lit";var Ae=pr`
|
|
2450
2450
|
.w-slider-thumb {
|
|
2451
2451
|
position: relative;
|
|
2452
2452
|
display: grid;
|
|
@@ -2637,7 +2637,7 @@ Please compile your catalog first.
|
|
|
2637
2637
|
w-textfield {
|
|
2638
2638
|
--w-textfield-placeholder-color-text: var(--w-s-color-text);
|
|
2639
2639
|
}
|
|
2640
|
-
`;var Oe={};var j,
|
|
2640
|
+
`;var Oe={};var j,c,ee,re,ge,R,K,fe,Ie,je,b=class extends Ne(Le){constructor(){super(...arguments);le(this,c);this.disabled=!1;this.invalid=!1;this.openEnded=!1;this.suffix="";this._showTooltip=!1;this._inputHasFocus=!1;this._hiddenTextfield=!1;le(this,j,null);this.anchorPositioningStyleElement=null}resetFormControl(){this.value=ne(this,j),this.dispatchEvent(new CustomEvent("thumbreset",{bubbles:!0}))}async updateFieldAfterValidation(){let e=this.shadowRoot.querySelector("w-textfield");await m(this,c,K).call(this,e.value,!0)}async connectedCallback(){if(super.connectedCallback(),de(this,j,this.value),this.setValue(this.value),this.slot&&!this.ariaDescription&&(this.slot==="from"?this.ariaDescription=M.t({id:"slider.label.from",comment:"Accessible label for the 'from value' input field in a range slider",message:"From"}):this.slot==="to"&&(this.ariaDescription=M.t({id:"slider.label.to",comment:"Accessible label for the 'to value' input field in a range slider",message:"To"}))),"anchorName"in document.documentElement.style)await this.updateComplete;else{let a=Oe.url.substring(0,Oe.url.lastIndexOf("/"));try{let[{default:i}]=await Promise.all([import(`${a}/oddbird-css-anchor-positioning.js`),this.updateComplete]);this.anchorPositioningStyleElement||(this.anchorPositioningStyleElement=document.createElement("style"),this.shadowRoot.prepend(this.anchorPositioningStyleElement)),this.anchorPositioningStyleElement.textContent=`
|
|
2641
2641
|
/*
|
|
2642
2642
|
* The polyfill can only anchor to ::before and ::after pseudo elements, not the pseudo element slider thumb.
|
|
2643
2643
|
* We work around that by recreating a transparent version of the active range
|
|
@@ -2686,7 +2686,7 @@ Please compile your catalog first.
|
|
|
2686
2686
|
left: anchor(--polyfilled-thumb left);
|
|
2687
2687
|
margin-left: 38px;
|
|
2688
2688
|
}
|
|
2689
|
-
`,await i({roots:[this.shadowRoot],elements:[this.anchorPositioningStyleElement]})}catch(i){console.error(new Error("Error registering the CSS anchor positioning polyfill. The UI will look broken.",{cause:i}))}}let
|
|
2689
|
+
`,await i({roots:[this.shadowRoot],elements:[this.anchorPositioningStyleElement]})}catch(i){console.error(new Error("Error registering the CSS anchor positioning polyfill. The UI will look broken.",{cause:i}))}}let e=window.navigator.userAgent;/WebKit/.test(e)&&!/Chrome/.test(e)&&this.tooltipTarget&&this.tooltipTarget.style.setProperty("--transform-offset","var(--w-slider-thumb-size, 28px)"),m(this,c,ge).call(this)}get boundaryValue(){return this.slot==="from"?this.min:this.max}get textFieldDisplayValue(){var e;return this._inputHasFocus?this.value!==""?this.value:(e=this.range)!=null&&e.value?Math.min(Math.max(Number(this.range.value),Number(this.min)+1),Number(this.max)-1).toString():"":this.value}get tooltipDisplayValue(){var t,a;let e=0;return this.tooltipFormatter?e=this.tooltipFormatter(this.value,this.slot):this.valueFormatter?e=this.valueFormatter(this.value,this.slot):this.value===""?e=(a=(t=this.range)==null?void 0:t.value)!=null?a:this.boundaryValue:e=this.value||0,e}get ariaDescriptionText(){let e="",t=this.ariaDescription||"",a=this.value==="";return this.openEnded&&a&&(e=this.slot==="from"?M.t({id:"slider.placeholder.from",message:"Min"}):M.t({id:"slider.placeholder.to",message:"Max"})),e?`${e}, ${t}`:t}updated(e){e.has("openEnded")&&this.openEnded&&!this.placeholder&&(this.slot==="to"||this.slot===""?this.placeholder=M.t({id:"slider.placeholder.to",message:"Max",comment:"Max as in short for Maximum"}):this.slot==="from"&&(this.placeholder=M.t({id:"slider.placeholder.from",message:"Min",comment:"Min as in short for Minimum"}))),e.has("value")&&(typeof ne(this,j)=="undefined"&&typeof this.value!="undefined"&&de(this,j,this.value),this.setValue(this.value),m(this,c,ge).call(this))}render(){var t,a,i,n;let e=this.placeholder&&!this.value;return B`
|
|
2690
2690
|
<div class="w-slider-thumb">
|
|
2691
2691
|
${"anchorName"in document.documentElement.style?D:B`<div class="polyfill-range">
|
|
2692
2692
|
<div class="polyfill-active-range"></div>
|
|
@@ -2694,22 +2694,22 @@ Please compile your catalog first.
|
|
|
2694
2694
|
<input
|
|
2695
2695
|
id="range"
|
|
2696
2696
|
aria-label="${this.ariaLabel}"
|
|
2697
|
-
aria-describedby="${
|
|
2697
|
+
aria-describedby="${W(this.ariaDescription?"aria-description":void 0)}"
|
|
2698
2698
|
class="w-slider-thumb__range"
|
|
2699
2699
|
type="range"
|
|
2700
2700
|
.value="${this.value}"
|
|
2701
2701
|
min="${this.min}"
|
|
2702
2702
|
max="${this.max}"
|
|
2703
|
-
step="${
|
|
2703
|
+
step="${W(!this.openEnded&&this.step?this.step:void 0)}"
|
|
2704
2704
|
?disabled="${this.disabled}"
|
|
2705
|
-
@mousedown="${
|
|
2706
|
-
@mouseup="${
|
|
2707
|
-
@touchstart="${
|
|
2708
|
-
@touchend="${
|
|
2709
|
-
@focus="${
|
|
2710
|
-
@blur="${
|
|
2711
|
-
@input="${
|
|
2712
|
-
@keydown="${this.openEnded?
|
|
2705
|
+
@mousedown="${m(this,c,ee)}"
|
|
2706
|
+
@mouseup="${m(this,c,re)}"
|
|
2707
|
+
@touchstart="${m(this,c,ee)}"
|
|
2708
|
+
@touchend="${m(this,c,re)}"
|
|
2709
|
+
@focus="${m(this,c,ee)}"
|
|
2710
|
+
@blur="${m(this,c,re)}"
|
|
2711
|
+
@input="${m(this,c,fe)}"
|
|
2712
|
+
@keydown="${this.openEnded?m(this,c,Ie):D}"
|
|
2713
2713
|
/>
|
|
2714
2714
|
|
|
2715
2715
|
${this.slot==="from"||!this.slot?B`
|
|
@@ -2732,18 +2732,19 @@ Please compile your catalog first.
|
|
|
2732
2732
|
|
|
2733
2733
|
<w-textfield
|
|
2734
2734
|
aria-label="${this.ariaLabel}"
|
|
2735
|
-
aria-description="${
|
|
2736
|
-
class="${
|
|
2735
|
+
aria-description="${W(this.ariaDescriptionText)}"
|
|
2736
|
+
class="${mr({"w-slider-thumb__textfield":!0,"sr-only":this._hiddenTextfield})}"
|
|
2737
2737
|
type="number"
|
|
2738
2738
|
tabindex="${this._hiddenTextfield?-1:D}"
|
|
2739
2739
|
placeholder="${this.placeholder}"
|
|
2740
2740
|
.value="${this.textFieldDisplayValue}"
|
|
2741
|
-
.formatter=${this.valueFormatter&&!
|
|
2741
|
+
.formatter=${this.valueFormatter&&!e?s=>this.valueFormatter(s,this.slot):D}
|
|
2742
2742
|
min="${this.openEnded?D:this.min}"
|
|
2743
2743
|
max="${this.openEnded?D:this.max}"
|
|
2744
|
-
step="${
|
|
2744
|
+
step="${W(this.step)}"
|
|
2745
2745
|
?invalid="${!!this.invalid}"
|
|
2746
|
-
@input="${
|
|
2746
|
+
@input="${m(this,c,fe)}"
|
|
2747
|
+
@keydown="${m(this,c,je)}"
|
|
2747
2748
|
?disabled="${this.disabled}"
|
|
2748
2749
|
>
|
|
2749
2750
|
${(t=this.suffix)!=null&&t?B`<w-affix slot="suffix" label="${(a=this.suffix)!=null?a:""}"></w-affix>`:D}
|
|
@@ -2770,5 +2771,5 @@ Please compile your catalog first.
|
|
|
2770
2771
|
${this.ariaDescriptionText}
|
|
2771
2772
|
</span>
|
|
2772
2773
|
</div>
|
|
2773
|
-
`}};j=new WeakMap,
|
|
2774
|
+
`}};j=new WeakMap,c=new WeakSet,ee=function(){this._showTooltip=!0,this.shadowRoot.querySelector("w-attention").handleDone()},re=function(){this._showTooltip=!1},ge=function(){this.range&&(this.value===""?this.range.value=this.boundaryValue:this.value&&(this.range.value=this.value))},R=function(e){this.dispatchEvent(new CustomEvent("slidervalidity",{bubbles:!0,detail:{invalid:e,slot:this.slot}}))},K=async function(e,t){var _;let a=(_=this.suffix)!=null?_:"",i=Number.parseInt(e);if(this.openEnded&&!t&&this.step&&!(this.slot==="to"&&i>=Number(this.max)-1||this.slot==="from"&&i<=Number(this.min)+1)){let S=1/this.step;i=Math.round(i*S)/S,e=i.toString()}let n=Number.parseInt(this.max),s=Number.parseInt(this.min);if(!this.openEnded&&(i>n||i<s))return m(this,c,R).call(this,M.t({id:"slider.error.out_of_bounds",message:"Value must be between {min} and {max}",values:{min:`${this.min} ${a}`.trim(),max:`${this.max} ${a}`.trim()}})),{shouldCancel:!0};e===""&&this.required&&m(this,c,R).call(this,M.t({id:"slider.error.required",message:"This field is required"})),this.value=e;let d=e===this.max||e===this.min,g=!1;if(this.slot){let F=this.parentElement.querySelector('w-slider-thumb[slot="to"]'),S=this.parentElement.querySelector('w-slider-thumb[slot="from"]'),k=F.textfield.value||this.max,C=S.textfield.value||this.min,z=Number.parseInt(k),x=Number.parseInt(C),N=M.t({id:"slider.error.overlap",message:"The maximum value cannot be less than the minimum"});if(this.slot==="from"){let $=this.openEnded&&z>n?z:Math.min(z,this.openEnded?n-1:n);i>$&&(g=!0,this.openEnded&&d?this.value=String($):this.value=k,t&&(m(this,c,R).call(this,N),await this.updateComplete,this.textfield.value=e))}else{let $=this.openEnded&&x<s?x:Math.max(Number.parseInt(C),this.openEnded?s+1:s);i<$&&(g=!0,this.openEnded&&d?this.value=String($):this.value=C,t&&(m(this,c,R).call(this,N),await this.updateComplete,this.textfield.value=e))}}return g?{shouldCancel:!0}:(m(this,c,R).call(this,""),this.range.value=Math.min(Math.max(Number(e),Number(this.min)),Number(this.max)).toString(),this.value=this.openEnded&&!t&&d?"":e,this.shadowRoot.querySelector("w-attention").handleDone(),{shouldCancel:!1})},fe=async function(e){let t=e.currentTarget.tagName==="W-TEXTFIELD";if(e instanceof CustomEvent)return;let a=e.currentTarget.value;return(await m(this,c,K).call(this,a,t)).shouldCancel?(e.preventDefault(),!1):!0},Ie=async function(e){if(e.key!=="ArrowLeft"&&e.key!=="ArrowRight")return;let t=Number(this.range.value),a=this.step||1,i;e.key==="ArrowLeft"?i=t-a:i=t+a,i=Math.min(Math.max(i,Number(this.min)),Number(this.max)),(await m(this,c,K).call(this,i.toString(),!1)).shouldCancel&&e.preventDefault()},je=async function(e){if(this.textfield.value)return;e.preventDefault();let t="";this.slot==="from"?e.key==="ArrowUp"?t=String(Number(this.min)+1)||"1":e.key==="ArrowDown"&&(t=String(Number(this.min))||"0"):e.key==="ArrowUp"?t=String(Number(this.max))||"100":e.key==="ArrowDown"&&(t=String(Number(this.max)-1)||"99"),await m(this,c,K).call(this,t,!0)},b.shadowRootOptions={...Le.shadowRootOptions,delegatesFocus:!0},b.styles=[De,Pe,Ae],p([V({attribute:"aria-label"})],b.prototype,"ariaLabel",2),p([V({attribute:"aria-description"})],b.prototype,"ariaDescription",2),p([V({reflect:!0})],b.prototype,"name",2),p([V({reflect:!0})],b.prototype,"value",2),p([V({type:Boolean,reflect:!0})],b.prototype,"disabled",2),p([V({type:Boolean,reflect:!0})],b.prototype,"invalid",2),p([V({attribute:!1,reflect:!1})],b.prototype,"openEnded",2),p([V({reflect:!0})],b.prototype,"placeholder",2),p([A()],b.prototype,"markers",2),p([A()],b.prototype,"required",2),p([A()],b.prototype,"step",2),p([A()],b.prototype,"min",2),p([A()],b.prototype,"max",2),p([A()],b.prototype,"suffix",2),p([V({attribute:!1})],b.prototype,"valueFormatter",2),p([V({attribute:!1})],b.prototype,"tooltipFormatter",2),p([V({attribute:!1})],b.prototype,"labelFormatter",2),p([me('input[type="range"]')],b.prototype,"range",2),p([me(".w-slider-thumb__tooltip-target")],b.prototype,"tooltipTarget",2),p([me("w-textfield")],b.prototype,"textfield",2),p([A()],b.prototype,"_showTooltip",2),p([A()],b.prototype,"_inputHasFocus",2),p([A()],b.prototype,"_hiddenTextfield",2);customElements.get("w-slider-thumb")||customElements.define("w-slider-thumb",b);export{b as WarpSliderThumb};
|
|
2774
2775
|
//# sourceMappingURL=slider-thumb.js.map
|