@warp-ds/elements 2.9.2-next.1 → 2.10.0-next.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/api.js +1 -1
- package/dist/api.js.map +1 -1
- package/dist/custom-elements.json +508 -145
- package/dist/docs/affix/affix.md +2 -2
- package/dist/docs/affix/styling.md +1 -0
- package/dist/docs/alert/alert.md +2 -2
- package/dist/docs/alert/styling.md +1 -0
- package/dist/docs/attention/attention.md +2 -0
- package/dist/docs/attention/styling.md +1 -0
- package/dist/docs/badge/badge.md +2 -0
- package/dist/docs/badge/styling.md +1 -0
- package/dist/docs/box/box.md +22 -40
- package/dist/docs/box/examples.md +20 -38
- package/dist/docs/box/styling.md +1 -0
- package/dist/docs/breadcrumbs/breadcrumbs.md +8 -2
- package/dist/docs/breadcrumbs/examples.md +7 -1
- package/dist/docs/breadcrumbs/styling.md +1 -0
- package/dist/docs/button/accessibility.md +42 -0
- package/dist/docs/button/api.md +63 -39
- package/dist/docs/button/button.md +395 -42
- package/dist/docs/button/examples.md +126 -0
- package/dist/docs/button/styling.md +72 -0
- package/dist/docs/button/usage.md +89 -0
- package/dist/docs/card/accessibility.md +74 -0
- package/dist/docs/card/api.md +9 -3
- package/dist/docs/card/card.md +236 -5
- package/dist/docs/card/examples.md +75 -0
- package/dist/docs/card/styling.md +1 -0
- package/dist/docs/card/usage.md +76 -0
- package/dist/docs/checkbox/api.md +128 -0
- package/dist/docs/checkbox/checkbox.md +134 -0
- package/dist/docs/checkbox-group/accessibility.md +71 -0
- package/dist/docs/checkbox-group/api.md +79 -0
- package/dist/docs/checkbox-group/checkbox-group.md +492 -0
- package/dist/docs/checkbox-group/examples.md +105 -0
- package/dist/docs/checkbox-group/styling.md +132 -0
- package/dist/docs/checkbox-group/usage.md +95 -0
- package/dist/docs/combobox/accessibility.md +71 -0
- package/dist/docs/combobox/api.md +60 -30
- package/dist/docs/combobox/combobox.md +205 -32
- package/dist/docs/combobox/examples.md +44 -0
- package/dist/docs/combobox/styling.md +1 -0
- package/dist/docs/combobox/usage.md +28 -0
- package/dist/docs/datepicker/accessibility.md +25 -0
- package/dist/docs/datepicker/api.md +22 -14
- package/dist/docs/datepicker/datepicker.md +208 -16
- package/dist/docs/datepicker/examples.md +75 -0
- package/dist/docs/datepicker/styling.md +1 -0
- package/dist/docs/datepicker/usage.md +84 -0
- package/dist/docs/expandable/api.md +20 -32
- package/dist/docs/expandable/examples.md +54 -0
- package/dist/docs/expandable/expandable.md +74 -32
- package/dist/docs/expandable/styling.md +1 -0
- package/dist/docs/icon/accessibility.md +5 -0
- package/dist/docs/icon/api.md +43 -0
- package/dist/docs/icon/examples.md +45 -0
- package/dist/docs/icon/icon.md +115 -0
- package/dist/docs/icon/styling.md +1 -0
- package/dist/docs/icon/usage.md +11 -0
- package/dist/docs/index.md +46 -0
- package/dist/docs/link/api.md +18 -22
- package/dist/docs/link/examples.md +75 -0
- package/dist/docs/link/link.md +113 -24
- package/dist/docs/link/styling.md +1 -0
- package/dist/docs/link/usage.md +18 -0
- package/dist/docs/modal/api.md +51 -0
- package/dist/docs/modal/examples.md +67 -0
- package/dist/docs/modal/modal.md +240 -0
- package/dist/docs/modal/styling.md +1 -0
- package/dist/docs/modal/usage.md +110 -0
- package/dist/docs/modal-footer/api.md +11 -0
- package/dist/docs/modal-footer/modal-footer.md +17 -0
- package/dist/docs/modal-header/api.md +42 -0
- package/dist/docs/modal-header/modal-header.md +48 -0
- package/dist/docs/page-indicator/api.md +6 -6
- package/dist/docs/page-indicator/examples.md +8 -0
- package/dist/docs/page-indicator/page-indicator.md +25 -6
- package/dist/docs/page-indicator/styling.md +1 -0
- package/dist/docs/page-indicator/usage.md +8 -0
- package/dist/docs/pagination/api.md +12 -10
- package/dist/docs/pagination/examples.md +20 -0
- package/dist/docs/pagination/pagination.md +52 -12
- package/dist/docs/pagination/styling.md +1 -0
- package/dist/docs/pagination/usage.md +18 -0
- package/dist/docs/pill/accessibility.md +2 -0
- package/dist/docs/pill/api.md +10 -26
- package/dist/docs/pill/examples.md +23 -0
- package/dist/docs/pill/pill.md +45 -28
- package/dist/docs/pill/styling.md +1 -0
- package/dist/docs/pill/usage.md +8 -0
- package/dist/docs/radio/radio.md +1 -7
- package/dist/docs/select/select.md +2 -0
- package/dist/docs/select/styling.md +1 -0
- package/dist/docs/slider/slider.md +2 -0
- package/dist/docs/slider/styling.md +1 -0
- package/dist/docs/slider-thumb/slider-thumb.md +2 -0
- package/dist/docs/slider-thumb/styling.md +1 -0
- package/dist/docs/step-indicator/step-indicator.md +2 -0
- package/dist/docs/step-indicator/styling.md +1 -0
- package/dist/docs/switch/styling.md +1 -0
- package/dist/docs/switch/switch.md +2 -0
- package/dist/docs/tabs/styling.md +1 -0
- package/dist/docs/tabs/tabs.md +2 -0
- package/dist/docs/textarea/styling.md +1 -0
- package/dist/docs/textarea/textarea.md +2 -0
- package/dist/docs/textfield/styling.md +1 -0
- package/dist/docs/textfield/textfield.md +2 -0
- package/dist/index.d.ts +950 -602
- package/dist/packages/affix/affix.hydration.test.js +1 -1
- package/dist/packages/affix/affix.js +4 -4
- package/dist/packages/affix/affix.js.map +4 -4
- package/dist/packages/alert/alert.hydration.test.js +1 -1
- package/dist/packages/alert/alert.js +3 -3
- package/dist/packages/alert/alert.js.map +3 -3
- package/dist/packages/attention/attention.hydration.test.js +1 -1
- package/dist/packages/attention/attention.js +397 -444
- package/dist/packages/attention/attention.js.map +4 -4
- package/dist/packages/attention/attention.test.js +1 -1
- package/dist/packages/badge/badge.hydration.test.js +1 -1
- package/dist/packages/box/box.hydration.test.js +1 -1
- package/dist/packages/box/box.js +1 -1
- package/dist/packages/box/box.js.map +1 -1
- package/dist/packages/breadcrumbs/breadcrumbs.hydration.test.js +3 -2
- package/dist/packages/breadcrumbs/breadcrumbs.js +4 -4
- package/dist/packages/breadcrumbs/breadcrumbs.js.map +3 -3
- package/dist/packages/button/button.d.ts +54 -37
- package/dist/packages/button/button.hydration.test.js +1 -1
- package/dist/packages/button/button.js +385 -432
- package/dist/packages/button/button.js.map +4 -4
- package/dist/packages/button/button.react.stories.d.ts +2 -2
- package/dist/packages/button/button.stories.d.ts +29 -0
- package/dist/packages/button/button.stories.js +176 -2
- package/dist/packages/button/react.d.ts +1 -1
- package/dist/packages/button/styles.d.ts +22 -1
- package/dist/packages/button/styles.js +390 -1
- package/dist/packages/card/card.d.ts +9 -6
- package/dist/packages/card/card.hydration.test.js +1 -1
- package/dist/packages/card/card.js +3 -3
- package/dist/packages/card/card.js.map +4 -4
- package/dist/packages/checkbox/checkbox.d.ts +45 -14
- package/dist/packages/checkbox/checkbox.hydration.test.js +1 -1
- package/dist/packages/checkbox/checkbox.js +3 -3
- package/dist/packages/checkbox/checkbox.js.map +3 -3
- package/dist/packages/checkbox/checkbox.react.stories.d.ts +1 -1
- package/dist/packages/checkbox/checkbox.stories.d.ts +2 -2
- package/dist/packages/checkbox/checkbox.test.js +1 -1
- package/dist/packages/checkbox/react.d.ts +2 -2
- package/dist/packages/checkbox-group/checkbox-group.a11y.test.js +1 -1
- package/dist/packages/checkbox-group/checkbox-group.d.ts +35 -8
- package/dist/packages/checkbox-group/checkbox-group.hydration.test.js +1 -1
- package/dist/packages/checkbox-group/checkbox-group.js +6 -6
- package/dist/packages/checkbox-group/checkbox-group.js.map +4 -4
- package/dist/packages/checkbox-group/react.d.ts +3 -3
- package/dist/packages/combobox/combobox.a11y.test.js +24 -0
- package/dist/packages/combobox/combobox.d.ts +65 -45
- package/dist/packages/combobox/combobox.hydration.test.js +39 -1
- package/dist/packages/combobox/combobox.js +21 -21
- package/dist/packages/combobox/combobox.js.map +4 -4
- package/dist/packages/combobox/combobox.stories.js +28 -15
- package/dist/packages/combobox/combobox.test.js +110 -0
- package/dist/packages/datepicker/DatePicker.test.js +1 -1
- package/dist/packages/datepicker/datepicker.d.ts +22 -30
- package/dist/packages/datepicker/datepicker.hydration.test.js +1 -1
- package/dist/packages/datepicker/datepicker.js +49 -49
- package/dist/packages/datepicker/datepicker.js.map +4 -4
- package/dist/packages/datepicker/datepicker.test.js +1 -1
- package/dist/packages/expandable/expandable.d.ts +11 -32
- package/dist/packages/expandable/expandable.hydration.test.js +1 -1
- package/dist/packages/expandable/expandable.js +11 -11
- package/dist/packages/expandable/expandable.js.map +3 -3
- package/dist/packages/expandable/expandable.react.stories.d.ts +2 -2
- package/dist/packages/expandable/react.d.ts +1 -1
- package/dist/packages/icon/icon.d.ts +16 -4
- package/dist/packages/icon/icon.hydration.test.js +1 -1
- package/dist/packages/icon/icon.js +2 -2
- package/dist/packages/icon/icon.js.map +3 -3
- package/dist/packages/icon/icon.react.stories.d.ts +1 -1
- package/dist/packages/icon/react.d.ts +2 -2
- package/dist/packages/link/link.d.ts +15 -16
- package/dist/packages/link/link.hydration.test.js +1 -1
- package/dist/packages/link/link.js +420 -190
- package/dist/packages/link/link.js.map +4 -4
- package/dist/packages/link/link.test.js +1 -1
- package/dist/packages/link/styles.d.ts +5 -0
- package/dist/packages/link/styles.js +80 -0
- package/dist/packages/modal/index.d.ts +4 -4
- package/dist/packages/modal/index.js +4 -4
- package/dist/packages/modal/modal.d.ts +22 -12
- package/dist/packages/modal/modal.hydration.test.js +1 -1
- package/dist/packages/modal/modal.js +5 -5
- package/dist/packages/modal/modal.js.map +3 -3
- package/dist/packages/modal/modal.react.stories.d.ts +3 -3
- package/dist/packages/modal/modal.stories.d.ts +2 -1
- package/dist/packages/modal/modal.stories.js +85 -3
- package/dist/packages/modal/react.d.ts +2 -2
- package/dist/packages/modal-footer/modal-footer.d.ts +5 -3
- package/dist/packages/modal-footer/modal-footer.js +4 -4
- package/dist/packages/modal-footer/modal-footer.js.map +3 -3
- package/dist/packages/modal-footer/react.d.ts +1 -1
- package/dist/packages/modal-header/modal-header.d.ts +21 -11
- package/dist/packages/modal-header/modal-header.js +11 -9
- package/dist/packages/modal-header/modal-header.js.map +4 -4
- package/dist/packages/modal-header/react.d.ts +2 -2
- package/dist/packages/page-indicator/page-indicator.d.ts +9 -14
- package/dist/packages/page-indicator/page-indicator.hydration.test.js +1 -1
- package/dist/packages/page-indicator/page-indicator.js +5 -5
- package/dist/packages/page-indicator/page-indicator.js.map +4 -4
- package/dist/packages/pagination/pagination.d.ts +11 -11
- package/dist/packages/pagination/pagination.hydration.test.js +1 -1
- package/dist/packages/pagination/pagination.js +4 -4
- package/dist/packages/pagination/pagination.js.map +4 -4
- package/dist/packages/pagination/pagination.test.js +1 -1
- package/dist/packages/pill/pill.d.ts +14 -29
- package/dist/packages/pill/pill.hydration.test.js +1 -1
- package/dist/packages/pill/pill.js +3 -3
- package/dist/packages/pill/pill.js.map +4 -4
- package/dist/packages/pill/pill.react.stories.d.ts +2 -2
- package/dist/packages/pill/react.d.ts +1 -1
- package/dist/packages/radio/radio.hydration.test.js +1 -1
- package/dist/packages/radio/radio.js +3 -3
- package/dist/packages/radio/radio.js.map +3 -3
- package/dist/packages/radio/radio.test.js +1 -1
- package/dist/packages/radio-group/radio-group.a11y.test.js +7 -3
- package/dist/packages/radio-group/radio-group.hydration.test.js +6 -2
- package/dist/packages/radio-group/radio-group.js +11 -11
- package/dist/packages/radio-group/radio-group.js.map +4 -4
- package/dist/packages/select/select.a11y.test.js +6 -2
- package/dist/packages/select/select.hydration.test.js +1 -1
- package/dist/packages/select/select.js +7 -7
- package/dist/packages/select/select.js.map +4 -4
- package/dist/packages/select/select.test.js +4 -2
- package/dist/packages/slider/slider.hydration.test.js +7 -2
- package/dist/packages/slider/slider.js +5 -5
- package/dist/packages/slider/slider.js.map +4 -4
- package/dist/packages/slider/slider.react.stories.js +2 -2
- package/dist/packages/slider/slider.test.js +1 -1
- package/dist/packages/slider-thumb/slider-thumb.hydration.test.js +1 -1
- package/dist/packages/slider-thumb/slider-thumb.js +20 -20
- package/dist/packages/slider-thumb/slider-thumb.js.map +4 -4
- package/dist/packages/step/step.hydration.test.js +1 -1
- package/dist/packages/step/step.js +8 -8
- package/dist/packages/step/step.js.map +4 -4
- package/dist/packages/step-indicator/step-indicator.hydration.test.js +1 -1
- package/dist/packages/switch/switch.a11y.test.js +1 -1
- package/dist/packages/switch/switch.hydration.test.js +1 -1
- package/dist/packages/switch/switch.js +1 -1
- package/dist/packages/switch/switch.js.map +1 -1
- package/dist/packages/tab/tab.hydration.test.js +1 -1
- package/dist/packages/tab/tab.js +10 -10
- package/dist/packages/tab/tab.js.map +2 -2
- package/dist/packages/tab-panel/tab-panel.hydration.test.js +1 -1
- package/dist/packages/tab-panel/tab-panel.js +3 -3
- package/dist/packages/tab-panel/tab-panel.js.map +2 -2
- package/dist/packages/tabs/tabs.a11y.test.js +2 -2
- package/dist/packages/tabs/tabs.hydration.test.js +1 -1
- package/dist/packages/tabs/tabs.js +1 -1
- package/dist/packages/tabs/tabs.js.map +2 -2
- package/dist/packages/tabs/tabs.test.js +4 -4
- package/dist/packages/textarea/textarea.hydration.test.js +1 -1
- package/dist/packages/textarea/textarea.js +4 -4
- package/dist/packages/textarea/textarea.js.map +3 -3
- package/dist/packages/textarea/textarea.test.js +1 -1
- package/dist/packages/textfield/textfield.hydration.test.js +1 -1
- package/dist/packages/textfield/textfield.js +1 -1
- package/dist/packages/textfield/textfield.js.map +1 -1
- package/dist/packages/textfield/textfield.test.js +1 -1
- package/dist/packages/toast/toast.js +6 -6
- package/dist/packages/toast/toast.js.map +4 -4
- package/dist/packages/toast/toast.stories.d.ts +1 -5
- package/dist/packages/toast/toast.stories.js +0 -17
- package/dist/packages/toast-container/toast-container.js +2 -2
- package/dist/packages/toast-container/toast-container.js.map +2 -2
- package/dist/web-types.json +509 -172
- package/eik/index.js +2536 -0
- package/package.json +18 -12
- package/dist/docs/radio/examples.md +0 -1
- package/dist/docs/radio/usage.md +0 -1
- package/dist/packages/button/styles/w-button.styles.d.ts +0 -1
- package/dist/packages/button/styles/w-button.styles.js +0 -282
- package/dist/packages/link/styles/w-link.styles.d.ts +0 -1
- package/dist/packages/link/styles/w-link.styles.js +0 -213
- /package/dist/docs/{radio → modal}/accessibility.md +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { describe, expect, test, beforeEach, afterEach } from 'vitest';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import { hydrateRoot } from 'react-dom/client';
|
|
3
|
+
import { afterEach, beforeEach, describe, expect, test } from 'vitest';
|
|
4
4
|
import { setupHydrationWarningCapture, testHydration } from '../../tests/react-hydration';
|
|
5
5
|
import './combobox.js';
|
|
6
6
|
describe('w-combobox React SSR hydration', () => {
|
|
@@ -97,4 +97,42 @@ describe('w-combobox React SSR hydration', () => {
|
|
|
97
97
|
document.body.removeChild(container);
|
|
98
98
|
}
|
|
99
99
|
});
|
|
100
|
+
test('declarative option children hydrate without attribute mismatch warnings', async () => {
|
|
101
|
+
const container = document.createElement('div');
|
|
102
|
+
container.id = 'hydration-options-root';
|
|
103
|
+
document.body.appendChild(container);
|
|
104
|
+
const innerHtml = [
|
|
105
|
+
'<w-combobox id="demo-combobox" label="Search">',
|
|
106
|
+
'<option value="apple">Apple</option>',
|
|
107
|
+
'<option value="banana">Banana</option>',
|
|
108
|
+
'</w-combobox>',
|
|
109
|
+
].join('');
|
|
110
|
+
try {
|
|
111
|
+
container.innerHTML = `<section class="example">${innerHtml}</section>`;
|
|
112
|
+
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
113
|
+
function App() {
|
|
114
|
+
return React.createElement('section', {
|
|
115
|
+
className: 'example',
|
|
116
|
+
// biome-ignore lint/security/noDangerouslySetInnerHtml: test reproduces React hydration mismatch path
|
|
117
|
+
dangerouslySetInnerHTML: { __html: innerHtml },
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
hydrateRoot(container, React.createElement(App), {
|
|
121
|
+
onRecoverableError: (error) => {
|
|
122
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
123
|
+
if (msg.includes('Hydration') ||
|
|
124
|
+
msg.includes('hydrat') ||
|
|
125
|
+
msg.includes('did not match') ||
|
|
126
|
+
msg.includes("didn't match")) {
|
|
127
|
+
window.__HYDRATION_WARNINGS__.push(msg);
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
});
|
|
131
|
+
await new Promise((resolve) => setTimeout(resolve, 200));
|
|
132
|
+
expect(window.__HYDRATION_WARNINGS__).toEqual([]);
|
|
133
|
+
}
|
|
134
|
+
finally {
|
|
135
|
+
document.body.removeChild(container);
|
|
136
|
+
}
|
|
137
|
+
});
|
|
100
138
|
});
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Ie=Object.defineProperty;var De=Object.getOwnPropertyDescriptor;var de=o=>{throw TypeError(o)};var p=(o,r,e,t)=>{for(var a=t>1?void 0:t?De(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 Q=(o,r,e)=>r.has(o)||de("Cannot "+e);var B=(o,r,e)=>(Q(o,r,"read from private field"),e?e.call(o):r.get(o)),X=(o,r,e)=>r.has(o)?de("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(o):r.set(o,e),ee=(o,r,e,t)=>(Q(o,r,"write to private field"),t?t.call(o,e):r.set(o,e),e),Z=(o,r,e)=>(Q(o,r,"access private method"),e);var Y=function(){for(var o=[],r=arguments.length;r--;)o[r]=arguments[r];return o.reduce(function(e,t){return e.concat(typeof t=="string"?t:Array.isArray(t)?Y.apply(void 0,t):typeof t=="object"&&t?Object.keys(t).map(function(a){return t[a]?a:""}):"")},[]).join(" ")};var M=o=>typeof o=="string",$e=o=>typeof o=="function",ue=new Map,pe="en";function ae(o){return[...Array.isArray(o)?o:[o],pe]}function ie(o,r,e){let t=ae(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 q(()=>K("date",t,e),()=>new Intl.DateTimeFormat(t,a)).format(M(r)?new Date(r):r)}function Te(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 ie(o,r,t)}function re(o,r,e){let t=ae(o);return q(()=>K("number",t,e),()=>new Intl.NumberFormat(t,e)).format(r)}function he(o,r,e,{offset:t=0,...a}){let i=ae(o),n=r?q(()=>K("plural-ordinal",i),()=>new Intl.PluralRules(i,{type:"ordinal"})):q(()=>K("plural-cardinal",i),()=>new Intl.PluralRules(i,{type:"cardinal"}));return a[e]??a[n.select(e-t)]??a.other}function q(o,r){let e=o(),t=ue.get(e);return t||(t=r(),ue.set(e,t)),t}function K(o,r,e){let t=r.join("-");return`${o}-${t}-${JSON.stringify(e)}`}var ge=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,be=o=>o.replace(/\\u([a-fA-F0-9]{4})|\\x([a-fA-F0-9]{2})/g,(r,e,t)=>{if(e){let a=parseInt(e,16);return String.fromCharCode(a)}else{let a=parseInt(t,16);return String.fromCharCode(a)}}),ve="%__lingui_octothorpe__%",Ne=(o,r,e={})=>{let t=r||o,a=n=>typeof n=="object"?n:e[n],i=(n,s)=>{let u=Object.keys(e).length?a("number"):void 0,f=re(t,n,u);return s.replace(new RegExp(ve,"g"),f)};return{plural:(n,s)=>{let{offset:u=0}=s,f=he(t,!1,n,s);return i(n-u,f)},selectordinal:(n,s)=>{let{offset:u=0}=s,f=he(t,!0,n,s);return i(n-u,f)},select:Pe,number:(n,s)=>re(t,n,a(s)||{style:s}),date:(n,s)=>ie(t,n,a(s)||s),time:(n,s)=>Te(t,n,a(s)||s)}},Pe=(o,r)=>r[o]??r.other;function Re(o,r,e){return(t={},a)=>{let i=Ne(r,e,a),n=(u,f=!1)=>Array.isArray(u)?u.reduce((O,C)=>{if(C==="#"&&f)return O+ve;if(M(C))return O+C;let[L,x,z]=C,E={};x==="plural"||x==="selectordinal"||x==="select"?Object.entries(z).forEach(([S,T])=>{E[S]=n(T,x==="plural"||x==="selectordinal")}):E=z;let w;if(x){let S=i[x];w=S(t[L],E)}else w=t[L];return w==null?O:O+w},""):u,s=n(o);return M(s)&&ge.test(s)?be(s):M(s)?s:s?String(s):""}}var je=Object.defineProperty,Ye=(o,r,e)=>r in o?je(o,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[r]=e,Ue=(o,r,e)=>(Ye(o,typeof r!="symbol"?r+"":r,e),e),te=class{constructor(){Ue(this,"_events",{})}on(r,e){var t;return(t=this._events)[r]??(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}},Be=Object.defineProperty,Xe=(o,r,e)=>r in o?Be(o,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[r]=e,A=(o,r,e)=>(Xe(o,typeof r!="symbol"?r+"":r,e),e),oe=class extends te{constructor(r){super(),A(this,"_locale",""),A(this,"_locales"),A(this,"_localeData",{}),A(this,"_messages",{}),A(this,"_missing"),A(this,"_messageCompiler"),A(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(r.locale??pe,r.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){return this._messages[this._locale]??{}}get localeData(){return this._localeData[this._locale]??{}}_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?.message;r||(r=""),M(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 $e(s)?s(this._locale,r):s;n&&this.emit("missing",{id:r,locale:this._locale});let u=i||a||r;return M(u)&&(this._messageCompiler?u=this._messageCompiler(u):console.warn(`Uncompiled message detected! Message:
|
|
2
2
|
|
|
3
|
-
> ${
|
|
3
|
+
> ${u}
|
|
4
4
|
|
|
5
5
|
That means you use raw catalog or your catalog doesn't have a translation for the message and fallback was used.
|
|
6
6
|
ICU features such as interpolation and plurals will not work properly for that message.
|
|
7
7
|
|
|
8
8
|
Please compile your catalog first.
|
|
9
|
-
`)),M(
|
|
9
|
+
`)),M(u)&&ge.test(u)?be(u):M(u)?u:Re(u,this._locale,this._locales)(e,t?.formats)}date(r,e){return ie(this._locales||this._locale,r,e)}number(r,e){return re(this._locales||this._locale,r,e)}};function Ze(o={}){return new oe(o)}var y=Ze();var d=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)},b=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 me(o){var r,e,t,a,i,n,s,u,f,O,C,L,x,z,E,w,S,T,H;class Le extends o{constructor(...l){var c,g,v;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),f.set(this,""),O.set(this,()=>{b(this,a,!0,"f"),b(this,e,!0,"f"),d(this,r,"m",w).call(this)}),C.set(this,()=>{b(this,e,!1,"f"),d(this,r,"m",S).call(this,this.shouldFormValueUpdate()?d(this,f,"f"):""),!this.validity.valid&&d(this,a,"f")&&b(this,t,!0,"f");let _=d(this,r,"m",w).call(this);this.validationMessageCallback&&this.validationMessageCallback(_?this.internals.validationMessage:"")}),L.set(this,()=>{var _;d(this,s,"f")&&this.validationTarget&&(this.internals.setValidity(this.validity,this.validationMessage,this.validationTarget),b(this,s,!1,"f")),b(this,a,!0,"f"),b(this,t,!0,"f"),d(this,r,"m",w).call(this),(_=this===null||this===void 0?void 0:this.validationMessageCallback)===null||_===void 0||_.call(this,this.showError?this.internals.validationMessage:"")}),x.set(this,void 0),z.set(this,!1),E.set(this,Promise.resolve()),(c=this.addEventListener)===null||c===void 0||c.call(this,"focus",d(this,O,"f")),(g=this.addEventListener)===null||g===void 0||g.call(this,"blur",d(this,C,"f")),(v=this.addEventListener)===null||v===void 0||v.call(this,"invalid",d(this,L,"f")),this.setValue(null)}static get formAssociated(){return!0}static get validators(){return this.formControlValidators||[]}static get observedAttributes(){let l=this.validators.map(v=>v.attribute).flat(),c=super.observedAttributes||[];return[...new Set([...c,...l])]}static getValidator(l){return this.validators.find(c=>c.attribute===l)||null}static getValidators(l){return this.validators.filter(c=>{var g;if(c.attribute===l||!((g=c.attribute)===null||g===void 0)&&g.includes(l))return!0})}get form(){return this.internals.form}get showError(){return d(this,r,"m",w).call(this)}checkValidity(){return this.internals.checkValidity()}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}attributeChangedCallback(l,c,g){var v;(v=super.attributeChangedCallback)===null||v===void 0||v.call(this,l,c,g);let P=this.constructor.getValidators(l);P?.length&&this.validationTarget&&this.setValue(d(this,f,"f"))}setValue(l){var c;b(this,t,!1,"f"),(c=this.validationMessageCallback)===null||c===void 0||c.call(this,""),b(this,f,l,"f");let v=this.shouldFormValueUpdate()?l:null;this.internals.setFormValue(v),d(this,r,"m",S).call(this,v),this.valueChangedCallback&&this.valueChangedCallback(v),d(this,r,"m",w).call(this)}shouldFormValueUpdate(){return!0}get validationComplete(){return new Promise(l=>l(d(this,E,"f")))}formResetCallback(){var l,c;b(this,a,!1,"f"),b(this,t,!1,"f"),d(this,r,"m",w).call(this),(l=this.resetFormControl)===null||l===void 0||l.call(this),(c=this.validationMessageCallback)===null||c===void 0||c.call(this,d(this,r,"m",w).call(this)?this.validationMessage:"")}}return e=new WeakMap,t=new WeakMap,a=new WeakMap,i=new WeakMap,n=new WeakMap,s=new WeakMap,f=new WeakMap,O=new WeakMap,C=new WeakMap,L=new WeakMap,x=new WeakMap,z=new WeakMap,E=new WeakMap,r=new WeakSet,u=function(){let l=this.getRootNode(),c=`${this.localName}[name="${this.getAttribute("name")}"]`;return l.querySelectorAll(c)},w=function(){if(this.hasAttribute("disabled"))return!1;let l=d(this,t,"f")||d(this,a,"f")&&!this.validity.valid&&!d(this,e,"f");return l&&this.internals.states?this.internals.states.add("--show-error"):this.internals.states&&this.internals.states.delete("--show-error"),l},S=function(l){let c=this.constructor,g={},v=c.validators,_=[],P=v.some(k=>k.isValid instanceof Promise);d(this,z,"f")||(b(this,E,new Promise(k=>{b(this,x,k,"f")}),"f"),b(this,z,!0,"f")),d(this,i,"f")&&(d(this,i,"f").abort(),b(this,n,d(this,i,"f"),"f"));let R=new AbortController;b(this,i,R,"f");let j,ce=!1;v.length&&(v.forEach(k=>{let J=k.key||"customError",I=k.isValid(this,l,R.signal);I instanceof Promise?(_.push(I),I.then(W=>{W!=null&&(g[J]=!W,j=d(this,r,"m",H).call(this,k,l),d(this,r,"m",T).call(this,g,j))})):(g[J]=!I,this.validity[J]!==!I&&(ce=!0),!I&&!j&&(j=d(this,r,"m",H).call(this,k,l)))}),Promise.allSettled(_).then(()=>{var k;R?.signal.aborted||(b(this,z,!1,"f"),(k=d(this,x,"f"))===null||k===void 0||k.call(this))}),(ce||!P)&&d(this,r,"m",T).call(this,g,j))},T=function(l,c){if(this.validationTarget)this.internals.setValidity(l,c,this.validationTarget),b(this,s,!1,"f");else{if(this.internals.setValidity(l,c),this.internals.validity.valid)return;b(this,s,!0,"f")}},H=function(l,c){if(this.validityCallback){let g=this.validityCallback(l.key||"customError");if(g)return g}return l.message instanceof Function?l.message(this,c):l.message},Le}import{html as se,LitElement as Qe}from"lit";import{property as m,state as D}from"lit/decorators.js";import{repeat as er}from"lit/directives/repeat.js";var qe=["en","nb","fi","da","sv"],ne="en",G=o=>qe.find(r=>o===r||o.toLowerCase().includes(r))||ne;function xe(){if(typeof window>"u"){let o=process.env.NMP_LANGUAGE||Intl.DateTimeFormat().resolvedOptions().locale;return G(o)}try{let o=we(document);if(o)return G(o);let r=Je();if(r)return G(r);let e=we(_e());return e?G(e):ne}catch(o){return console.warn("could not detect locale, falling back to source locale",o),ne}}var ke=(o,r,e,t,a)=>{y.load("en",o),y.load("nb",r),y.load("fi",e),y.load("da",t),y.load("sv",a);let i=xe();y.activate(i),ye(),Ge()},Ke="warp-i18n-change";function ye(){typeof window>"u"||window.dispatchEvent(new Event(Ke))}var fe=!1;function Ge(){if(fe||typeof window>"u"||!document?.documentElement)return;fe=!0;let o=()=>{let a=xe();y.locale!==a&&(y.activate(a),ye())},r=new MutationObserver(a=>{for(let i of a)if(i.type==="attributes"&&i.attributeName==="lang"){o();break}});r.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"]});let e=_e();e&&e.documentElement&&e!==document&&r.observe(e.documentElement,{attributes:!0,attributeFilter:["lang"]});let t=He();t&&r.observe(t,{attributes:!0,attributeFilter:["lang"]})}function _e(){try{return window.parent?.document??null}catch{return null}}function we(o){try{return o?.documentElement?.lang??""}catch{return""}}function He(){try{return window.frameElement??null}catch{return null}}function Je(){try{return window.frameElement?.getAttribute?.("lang")??""}catch{return""}}import{css as Oe}from"lit";var Ce=Oe`
|
|
10
10
|
*,
|
|
11
11
|
:before,
|
|
12
12
|
:after {
|
|
@@ -279,7 +279,7 @@ Please compile your catalog first.
|
|
|
279
279
|
svg {
|
|
280
280
|
pointer-events: none;
|
|
281
281
|
}
|
|
282
|
-
`,
|
|
282
|
+
`,dr=Oe`*, :before, :after {
|
|
283
283
|
--w-rotate: 0;
|
|
284
284
|
--w-rotate-x: 0;
|
|
285
285
|
--w-rotate-y: 0;
|
|
@@ -2445,13 +2445,13 @@ Please compile your catalog first.
|
|
|
2445
2445
|
display: none
|
|
2446
2446
|
}
|
|
2447
2447
|
}
|
|
2448
|
-
`;var
|
|
2449
|
-
.z-0{z-index:0;}.z-20{z-index:20;}`;var
|
|
2450
|
-
class="${
|
|
2448
|
+
`;var ze=JSON.parse('{"combobox.aria.noResults":["Ingen resultater"],"combobox.aria.noSuggestions":["Ingen forslag"],"combobox.aria.pluralResults":[["numResults","plural",{"one":["#"," resultat"],"other":["#"," resultater"]}]],"combobox.aria.pluralSuggestions":[["numSuggestions","plural",{"one":["#"," forslag"],"other":["#"," forslag"]}]]}');var Ee=JSON.parse('{"combobox.aria.noResults":["No results"],"combobox.aria.noSuggestions":["No suggestions"],"combobox.aria.pluralResults":[["numResults","plural",{"one":["#"," result"],"other":["#"," results"]}]],"combobox.aria.pluralSuggestions":[["numSuggestions","plural",{"one":["#"," suggestion"],"other":["#"," suggestions"]}]]}');var Me=JSON.parse('{"combobox.aria.noResults":["Ei tuloksia"],"combobox.aria.noSuggestions":["Ei ehdotuksia"],"combobox.aria.pluralResults":[["numResults","plural",{"one":["#"," tulos"],"other":["#"," tulosta"]}]],"combobox.aria.pluralSuggestions":[["numSuggestions","plural",{"one":["#"," ehdotus"],"other":["#"," ehdotusta"]}]]}');var Fe=JSON.parse('{"combobox.aria.noResults":["Ingen resultater"],"combobox.aria.noSuggestions":["Ingen forslag"],"combobox.aria.pluralResults":[["numResults","plural",{"one":["#"," resultat"],"other":["#"," resultater"]}]],"combobox.aria.pluralSuggestions":[["numSuggestions","plural",{"one":["#"," forslag"],"other":["#"," forslag"]}]]}');var Se=JSON.parse('{"combobox.aria.noResults":["Inga resultat"],"combobox.aria.noSuggestions":["Inga f\xF6rslag"],"combobox.aria.pluralResults":[["numResults","plural",{"one":["#"," resultat"],"other":["#"," resultat"]}]],"combobox.aria.pluralSuggestions":[["numSuggestions","plural",{"one":["#"," f\xF6rslag"],"other":["#"," f\xF6rslag"]}]]}');import{css as We}from"lit";var Ae=We`*,: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}.rounded-8{border-radius:8px}.block{display:block}.overflow-hidden{overflow:hidden}.list-none{list-style-type:none}.left-0{left:0}.right-0{right:0}.absolute{position:absolute}.relative{position:relative}.static{position:static}.s-bg{background-color:var(--w-s-color-background)}.s-bg-selected{background-color:var(--w-s-color-background-selected)}.hover\\:s-bg-hover:hover{background-color:var(--w-s-color-background-hover)}.hover\\:s-bg-selected-hover:hover{background-color:var(--w-s-color-background-selected-hover)}.shadow-m{box-shadow:var(--w-shadow-m)}.m-0{margin:0}.p-0{padding:0}.p-8{padding:.8rem}.pb-4{padding-bottom:.4rem}.cursor-pointer{cursor:pointer}.font-bold{font-weight:700}.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}.select-none{-webkit-user-select:none;user-select:none};
|
|
2449
|
+
.z-0{z-index:0;}.z-20{z-index:20;}`;var F={wrapper:"relative z-0",base:"absolute z-20 left-0 right-0 s-bg pb-4 rounded-8 overflow-hidden shadow-m",listbox:"m-0 p-0 select-none list-none",option:"block cursor-pointer p-8",optionUnselected:"hover:s-bg-hover",optionSelected:"s-bg-selected hover:s-bg-selected-hover",textMatch:"font-bold",a11y:"sr-only"},U,$,V,Ve,le,h=class extends me(Qe){constructor(){super();X(this,V);this.options=[];this.label="";this.placeholder="";this.value="";this.openOnFocus=!1;this.selectOnBlur=!0;this.matchTextSegments=!1;this.disableStaticFiltering=!1;this.invalid=!1;this.helpText="";this.disabled=!1;this.required=!1;this.optional=!1;this.name="";this.autocomplete="off";this._isOpen=!1;this._navigationOption=null;this._currentOptions=[];this._lightDomOptions=[];this._optionIdCounter=0;this._displayValue="";X(this,U,null);X(this,$);ke(Ee,Fe,Me,ze,Se)}firstUpdated(e){ee(this,U,this.value)}updated(e){e.has("value")&&this.setValue(this.value)}resetFormControl(){this.value=B(this,U)}connectedCallback(){super.connectedCallback(),Z(this,V,le).call(this),ee(this,$,new MutationObserver(()=>{Z(this,V,le).call(this)})),B(this,$).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["label","value"]})}disconnectedCallback(){super.disconnectedCallback(),B(this,$)?.disconnect()}get _listboxId(){return`${this._id}-listbox`}get _id(){return"combobox"}get _helpId(){return this.helpText?`${this._id}__hint`:void 0}get _sourceOptions(){return Array.isArray(this.options)&&this.options.length?this.options:this._lightDomOptions}get _navigationLabelOrDisplayValue(){return this._navigationOption?this._navigationOption.label||this._navigationOption.value:this._displayValue}get _navigationValueOrInputValue(){return this._navigationOption?.value||this.value}_createOptionsWithIdAndMatch(e,t){return e.map((a,i)=>({...a,id:`${this._id}-option-${this._optionIdCounter+i}`,key:a.key||a.value,currentInputValue:t}))}_getAriaText(e,t,a){if(!e||!a)return"";let i=e.filter(u=>(u.label||u.value).toLowerCase().includes(t.toLowerCase())),n=y._({id:"combobox.aria.pluralSuggestions",message:"{numSuggestions, plural, one {# suggestion} other {# suggestions}}",comment:"Aria text for combobox when there are one or more suggestions",values:{numSuggestions:i.length}}),s=y._({id:"combobox.aria.noSuggestions",message:"No suggestions",comment:"Aria text for combobox when no suggestions"});return i.length?n:s}_getOptionClasses(e){return Y(F.option,this._navigationOption?.id===e?.id?F.optionSelected:F.optionUnselected)}_handleKeyDown(e){let t=["ArrowDown","ArrowUp","PageUp","PageDown","Home","End"].includes(e.key),a=["ArrowDown","ArrowLeft","ArrowUp","ArrowRight"];if(t&&!this._isOpen){this._isOpen=!0;return}if(t&&this._isOpen){this._findAndSetActiveOption(e);return}if(!(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey))switch(e.key){case"Enter":this._navigationOption&&(e.preventDefault(),this._handleSelect(this._navigationOption),requestAnimationFrame(()=>{let n=this.shadowRoot?.querySelector("w-textfield")?.shadowRoot?.querySelector("input");n&&(n.value=this._displayValue)})),this._isOpen=!1;break;case"Tab":case"Delete":this._isOpen=!1;break;case"Escape":this._isOpen?this._isOpen=!1:this._handleChange(""),this._navigationOption=null;break;case"Backspace":this._handleChange(this._navigationLabelOrDisplayValue),this._navigationOption=null,this._isOpen=!0;break;default:if(a.includes(e.key))break;this._isOpen=!0,this._navigationOption?(this._handleChange(this._navigationOption.value),this._navigationOption=null):this._handleChange(this.value);break}}_findAndSetActiveOption(e){e.preventDefault();let t=this._currentOptions.findIndex(n=>n.id===this._navigationOption?.id),a=t+1,i=t-1;switch(e.key){case"ArrowDown":this._navigationOption=a>this._currentOptions.length-1?null:this._currentOptions[a];break;case"ArrowUp":this._navigationOption=i===-2?this._currentOptions[this._currentOptions.length-1]:i<0?null:this._currentOptions[i];break;case"PageUp":this._navigationOption=t-10<0?this._currentOptions[0]:this._currentOptions[t-10];break;case"PageDown":this._navigationOption=t+10>this._currentOptions.length-1?this._currentOptions[this._currentOptions.length-1]:this._currentOptions[t+10];break;case"Home":this._navigationOption=this._currentOptions[0];break;case"End":this._navigationOption=this._currentOptions[this._currentOptions.length-1];break}}_handleSelect(e){this.value=e.value,this._displayValue=e.label||e.value,this.setValue(this.value);let t=new CustomEvent("select",{detail:{value:e.value},bubbles:!0,composed:!0});this.dispatchEvent(t),this._isOpen=!1,this._navigationOption=null,this.disableStaticFiltering&&(this._currentOptions=[])}_handleChange(e){if(e===void 0)return;this.value=e,this._displayValue=e;let t=new CustomEvent("change",{detail:{value:e},bubbles:!0,composed:!0});this.dispatchEvent(t)}_handleFocus(){if(!this.openOnFocus)return;let e=new CustomEvent("focus",{bubbles:!0,composed:!0});this.dispatchEvent(e),this._isOpen=!0}_handleBlur(e){let t=e.relatedTarget;if(t&&this.shadowRoot?.contains(t))return;if(this._isOpen=!1,this.selectOnBlur&&(this._navigationOption||!this._navigationOption&&this._currentOptions.findIndex(i=>i.value===this.value)!==-1)){let i=this._navigationOption?.value||this.value;this.value=i;let n=new CustomEvent("select",{detail:{value:i},bubbles:!0,composed:!0});this.dispatchEvent(n)}this._navigationOption=null;let a=new CustomEvent("blur",{detail:{value:this._navigationValueOrInputValue},bubbles:!0,composed:!0});this.dispatchEvent(a)}_handleOptionClick(e,t){this._handleSelect(t),requestAnimationFrame(()=>{let i=this.shadowRoot?.querySelector("w-textfield")?.shadowRoot?.querySelector("input");i&&(i.value=t.label||t.value)})}_handleContainerBlur(e){(!e.currentTarget||!e.currentTarget.contains(e.relatedTarget))&&(this._isOpen=!1)}_renderTextMatch(e,t){if(!this.matchTextSegments)return e;let a=e.toLowerCase().indexOf(t.currentInputValue.toLowerCase());if(a!==-1){let i=a+t.currentInputValue.length;return se`${e.substring(0,a)}<span
|
|
2450
|
+
class="${F.textMatch}"
|
|
2451
2451
|
>${e.substring(a,i)}</span
|
|
2452
|
-
>${e.substring(i)}`}return e}willUpdate(e){let t=
|
|
2452
|
+
>${e.substring(i)}`}return e}willUpdate(e){let t=this._sourceOptions,a=e.has("_lightDomOptions");if(e.has("value")||e.has("options")||a){let i=t.find(s=>s.value===this.value),n=i?i.label||i.value:this.value;this._displayValue!==n&&this._displayValue!==this.value&&(this._displayValue=n),!this._displayValue&&this.value&&(this._displayValue=n)}(e.has("options")||a||e.has("value")||e.has("disableStaticFiltering")||e.has("_displayValue"))&&(this._optionIdCounter+=t.length,this._currentOptions=this._createOptionsWithIdAndMatch(t,this._displayValue).filter(i=>this.disableStaticFiltering?!0:(i.label||i.value).toLowerCase().includes(this._displayValue.toLowerCase()))),this.disableStaticFiltering&&this._currentOptions.length&&this._currentOptions.length===1&&!this._currentOptions.some(i=>i.value===this.value)&&!this._isOpen&&(this._isOpen=!0)}render(){return se`
|
|
2453
2453
|
<div
|
|
2454
|
-
class=${
|
|
2454
|
+
class=${Y(F.wrapper)}
|
|
2455
2455
|
@blur=${this._handleContainerBlur}
|
|
2456
2456
|
>
|
|
2457
2457
|
<w-textfield
|
|
@@ -2469,41 +2469,41 @@ Please compile your catalog first.
|
|
|
2469
2469
|
role="combobox"
|
|
2470
2470
|
aria-autocomplete="list"
|
|
2471
2471
|
aria-expanded=${this._isOpen&&this._currentOptions.length!==0}
|
|
2472
|
-
aria-activedescendant=${this._isOpen?
|
|
2472
|
+
aria-activedescendant=${this._isOpen?this._navigationOption?.id:void 0}
|
|
2473
2473
|
aria-controls=${this._listboxId}
|
|
2474
|
-
@input=${
|
|
2474
|
+
@input=${e=>this._handleChange(e?.detail?.value)}
|
|
2475
2475
|
@focus=${this._handleFocus}
|
|
2476
2476
|
@blur=${this._handleBlur}
|
|
2477
2477
|
@keydown=${this._handleKeyDown}
|
|
2478
2478
|
></w-textfield>
|
|
2479
2479
|
|
|
2480
|
-
<span class="${
|
|
2480
|
+
<span class="${F.a11y}" role="status">
|
|
2481
2481
|
${this._getAriaText(this._currentOptions,this._displayValue,this._isOpen)}
|
|
2482
2482
|
</span>
|
|
2483
2483
|
|
|
2484
2484
|
<div
|
|
2485
2485
|
?hidden=${!this._isOpen||!this._currentOptions.length}
|
|
2486
|
-
class=${
|
|
2486
|
+
class=${Y(F.base)}
|
|
2487
2487
|
>
|
|
2488
2488
|
<ul
|
|
2489
2489
|
id=${this._listboxId}
|
|
2490
2490
|
role="listbox"
|
|
2491
|
-
class="${
|
|
2491
|
+
class="${F.listbox}"
|
|
2492
2492
|
>
|
|
2493
|
-
${
|
|
2493
|
+
${er(this._currentOptions,e=>e.key,e=>{let t=e.label||e.value;return se`
|
|
2494
2494
|
<li
|
|
2495
|
-
id=${
|
|
2495
|
+
id=${e.id}
|
|
2496
2496
|
role="option"
|
|
2497
|
-
aria-selected=${
|
|
2497
|
+
aria-selected=${this._navigationOption?.id===e.id}
|
|
2498
2498
|
tabindex="-1"
|
|
2499
|
-
class=${this._getOptionClasses(
|
|
2500
|
-
@mousedown=${
|
|
2499
|
+
class=${this._getOptionClasses(e)}
|
|
2500
|
+
@mousedown=${a=>this._handleOptionClick(a,e)}
|
|
2501
2501
|
>
|
|
2502
|
-
${this._renderTextMatch(
|
|
2502
|
+
${this._renderTextMatch(t,e)}
|
|
2503
2503
|
</li>
|
|
2504
2504
|
`})}
|
|
2505
2505
|
</ul>
|
|
2506
2506
|
</div>
|
|
2507
2507
|
</div>
|
|
2508
|
-
`}};
|
|
2508
|
+
`}};U=new WeakMap,$=new WeakMap,V=new WeakSet,Ve=function(){return Array.from(this.children).filter(e=>e.tagName.toLowerCase()==="option")},le=function(){this._lightDomOptions=Z(this,V,Ve).call(this).map(e=>{let t=e.getAttribute("value")??"",a=e.hasAttribute("label")?e.getAttribute("label")??"":e.textContent??"";return{value:t,label:a,key:t}})},h.styles=[Ce,Ae],p([m({type:Array})],h.prototype,"options",2),p([m({type:String,reflect:!0,useDefault:!0})],h.prototype,"label",2),p([m({type:String,reflect:!0,useDefault:!0})],h.prototype,"placeholder",2),p([m({type:String,reflect:!0,useDefault:!0})],h.prototype,"value",2),p([m({type:Boolean,attribute:"open-on-focus",reflect:!0})],h.prototype,"openOnFocus",2),p([m({type:Boolean,attribute:"select-on-blur",reflect:!0,useDefault:!0})],h.prototype,"selectOnBlur",2),p([m({type:Boolean,attribute:"match-text-segments",reflect:!0})],h.prototype,"matchTextSegments",2),p([m({type:Boolean,attribute:"disable-static-filtering",reflect:!0})],h.prototype,"disableStaticFiltering",2),p([m({type:Boolean,reflect:!0})],h.prototype,"invalid",2),p([m({type:String,attribute:"help-text",reflect:!0,useDefault:!0})],h.prototype,"helpText",2),p([m({type:Boolean,reflect:!0})],h.prototype,"disabled",2),p([m({type:Boolean,reflect:!0})],h.prototype,"required",2),p([m({type:Boolean,reflect:!0})],h.prototype,"optional",2),p([m({type:String,reflect:!0,useDefault:!0})],h.prototype,"name",2),p([m({type:String,reflect:!0,useDefault:!0})],h.prototype,"autocomplete",2),p([D()],h.prototype,"_isOpen",2),p([D()],h.prototype,"_navigationOption",2),p([D()],h.prototype,"_currentOptions",2),p([D()],h.prototype,"_lightDomOptions",2),p([D()],h.prototype,"_optionIdCounter",2),p([D()],h.prototype,"_displayValue",2);customElements.get("w-combobox")||customElements.define("w-combobox",h);export{h as WarpCombobox};
|
|
2509
2509
|
//# sourceMappingURL=combobox.js.map
|