@warp-ds/elements 2.9.1-next.2 → 2.9.1-next.3
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 +8 -23
- package/dist/docs/attention/api.md +6 -3
- package/dist/docs/attention/attention.md +6 -3
- package/dist/docs/slider-thumb/api.md +0 -24
- package/dist/docs/slider-thumb/slider-thumb.md +0 -24
- package/dist/index.d.ts +0 -18
- package/dist/packages/affix/affix.js +11 -12
- package/dist/packages/affix/affix.js.map +4 -4
- package/dist/packages/alert/alert.d.ts +1 -1
- package/dist/packages/alert/alert.js.map +1 -1
- package/dist/packages/attention/attention.d.ts +3 -2
- package/dist/packages/attention/attention.js +27 -28
- package/dist/packages/attention/attention.js.map +4 -4
- package/dist/packages/breadcrumbs/breadcrumbs.js +7 -8
- package/dist/packages/breadcrumbs/breadcrumbs.js.map +4 -4
- package/dist/packages/button/button.d.ts +4 -2
- package/dist/packages/button/button.js +14 -15
- package/dist/packages/button/button.js.map +4 -4
- package/dist/packages/card/card.js +8 -9
- package/dist/packages/card/card.js.map +4 -4
- package/dist/packages/checkbox/checkbox.d.ts +2 -0
- package/dist/packages/checkbox-group/checkbox-group.d.ts +2 -0
- package/dist/packages/checkbox-group/checkbox-group.js +15 -16
- package/dist/packages/checkbox-group/checkbox-group.js.map +4 -4
- package/dist/packages/checkbox-group/locales/da/messages.mjs +1 -1
- package/dist/packages/checkbox-group/locales/en/messages.mjs +1 -1
- package/dist/packages/checkbox-group/locales/fi/messages.mjs +1 -1
- package/dist/packages/checkbox-group/locales/nb/messages.mjs +1 -1
- package/dist/packages/checkbox-group/locales/sv/messages.mjs +1 -1
- package/dist/packages/combobox/combobox.js +13 -14
- package/dist/packages/combobox/combobox.js.map +4 -4
- package/dist/packages/combobox/locales/da/messages.mjs +1 -1
- package/dist/packages/combobox/locales/en/messages.mjs +1 -1
- package/dist/packages/combobox/locales/fi/messages.mjs +1 -1
- package/dist/packages/combobox/locales/nb/messages.mjs +1 -1
- package/dist/packages/combobox/locales/sv/messages.mjs +1 -1
- package/dist/packages/datepicker/datepicker.d.ts +2 -0
- package/dist/packages/datepicker/datepicker.js +51 -52
- package/dist/packages/datepicker/datepicker.js.map +4 -4
- package/dist/packages/datepicker/locales/da/messages.mjs +1 -1
- package/dist/packages/datepicker/locales/en/messages.mjs +1 -1
- package/dist/packages/datepicker/locales/fi/messages.mjs +1 -1
- package/dist/packages/datepicker/locales/nb/messages.mjs +1 -1
- package/dist/packages/datepicker/locales/sv/messages.mjs +1 -1
- package/dist/packages/link/link.d.ts +2 -0
- package/dist/packages/modal-header/modal-header.js +13 -14
- package/dist/packages/modal-header/modal-header.js.map +4 -4
- package/dist/packages/page-indicator/page-indicator.js +7 -8
- package/dist/packages/page-indicator/page-indicator.js.map +4 -4
- package/dist/packages/pagination/locales/da/messages.mjs +1 -1
- package/dist/packages/pagination/locales/en/messages.mjs +1 -1
- package/dist/packages/pagination/locales/fi/messages.mjs +1 -1
- package/dist/packages/pagination/locales/nb/messages.mjs +1 -1
- package/dist/packages/pagination/locales/sv/messages.mjs +1 -1
- package/dist/packages/pagination/pagination.js +31 -32
- package/dist/packages/pagination/pagination.js.map +4 -4
- package/dist/packages/pill/pill.js +11 -12
- package/dist/packages/pill/pill.js.map +4 -4
- package/dist/packages/radio/radio.d.ts +2 -0
- package/dist/packages/radio-group/radio-group.d.ts +2 -0
- package/dist/packages/radio-group/radio-group.js +17 -18
- package/dist/packages/radio-group/radio-group.js.map +4 -4
- package/dist/packages/select/select.js +19 -20
- package/dist/packages/select/select.js.map +4 -4
- package/dist/packages/slider/locales/da/messages.mjs +1 -1
- package/dist/packages/slider/locales/en/messages.mjs +1 -1
- package/dist/packages/slider/locales/fi/messages.mjs +1 -1
- package/dist/packages/slider/locales/nb/messages.mjs +1 -1
- package/dist/packages/slider/locales/sv/messages.mjs +1 -1
- package/dist/packages/slider/slider.d.ts +2 -0
- package/dist/packages/slider/slider.js +22 -23
- package/dist/packages/slider/slider.js.map +4 -4
- package/dist/packages/slider-thumb/slider-thumb.d.ts +5 -0
- package/dist/packages/slider-thumb/slider-thumb.js +33 -34
- package/dist/packages/slider-thumb/slider-thumb.js.map +4 -4
- package/dist/packages/step/locales/da/messages.mjs +1 -1
- package/dist/packages/step/locales/en/messages.mjs +1 -1
- package/dist/packages/step/locales/fi/messages.mjs +1 -1
- package/dist/packages/step/locales/nb/messages.mjs +1 -1
- package/dist/packages/step/locales/sv/messages.mjs +1 -1
- package/dist/packages/step/step.js +11 -12
- package/dist/packages/step/step.js.map +4 -4
- package/dist/packages/switch/switch.d.ts +2 -0
- package/dist/packages/tab/tab.d.ts +2 -0
- package/dist/packages/tabs/tabs.js +1 -1
- package/dist/packages/tabs/tabs.js.map +3 -3
- package/dist/packages/textarea/textarea.d.ts +2 -0
- package/dist/packages/textarea/textarea.js +20 -21
- package/dist/packages/textarea/textarea.js.map +4 -4
- package/dist/packages/textfield/textfield.d.ts +2 -0
- package/dist/packages/toast/toast.js +13 -14
- package/dist/packages/toast/toast.js.map +4 -4
- package/dist/web-types.json +6 -6
- package/package.json +19 -19
|
@@ -11,6 +11,8 @@ declare class WarpSliderThumb extends WarpSliderThumb_base {
|
|
|
11
11
|
#private;
|
|
12
12
|
static shadowRootOptions: {
|
|
13
13
|
delegatesFocus: boolean;
|
|
14
|
+
clonable?: boolean;
|
|
15
|
+
customElementRegistry?: CustomElementRegistry;
|
|
14
16
|
mode: ShadowRootMode;
|
|
15
17
|
serializable?: boolean;
|
|
16
18
|
slotAssignment?: SlotAssignmentMode;
|
|
@@ -83,8 +85,11 @@ declare class WarpSliderThumb extends WarpSliderThumb_base {
|
|
|
83
85
|
* @description
|
|
84
86
|
*/
|
|
85
87
|
labelFormatter: (slot: SliderSlot) => string;
|
|
88
|
+
/** @internal */
|
|
86
89
|
range: HTMLInputElement;
|
|
90
|
+
/** @internal */
|
|
87
91
|
tooltipTarget: HTMLOutputElement;
|
|
92
|
+
/** @internal */
|
|
88
93
|
textfield: WarpTextField;
|
|
89
94
|
/** @internal */
|
|
90
95
|
_showTooltip: boolean;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
var
|
|
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))})}P.unraw=Ce;P.default=Ce});var Fe=Ze(Ee(),1);var L=o=>typeof o=="string",tr=o=>typeof o=="function",ze=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=ze.get(e);return t||(t=r(),ze.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,E={};k==="plural"||k==="selectordinal"||k==="select"?Object.entries(C).forEach(([T,$])=>{E[T]=n($,k==="plural"||k==="selectordinal")}):E=C;let x;if(k){let T=i[k];x=T(t[S],E)}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:
|
|
1
|
+
var $e=Object.defineProperty;var Se=Object.getOwnPropertyDescriptor;var be=o=>{throw TypeError(o)};var p=(o,r,e,t)=>{for(var a=t>1?void 0:t?Se(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&&$e(r,e,a),a};var ee=(o,r,e)=>r.has(o)||be("Cannot "+e);var re=(o,r,e)=>(ee(o,r,"read from private field"),e?e.call(o):r.get(o)),te=(o,r,e)=>r.has(o)?be("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(o):r.set(o,e),oe=(o,r,e,t)=>(ee(o,r,"write to private field"),t?t.call(o,e):r.set(o,e),e),m=(o,r,e)=>(ee(o,r,"access private method"),e);var A=o=>typeof o=="string",Pe=o=>typeof o=="function",pe=new Map,ge="en";function ne(o){return[...Array.isArray(o)?o:[o],ge]}function le(o,r,e){let t=ne(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 H(()=>Z("date",t,e),()=>new Intl.DateTimeFormat(t,a)).format(A(r)?new Date(r):r)}function Ne(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 le(o,r,t)}function ae(o,r,e){let t=ne(o);return H(()=>Z("number",t,e),()=>new Intl.NumberFormat(t,e)).format(r)}function me(o,r,e,{offset:t=0,...a}){var s,c;let i=ne(o),n=r?H(()=>Z("plural-ordinal",i),()=>new Intl.PluralRules(i,{type:"ordinal"})):H(()=>Z("plural-cardinal",i),()=>new Intl.PluralRules(i,{type:"cardinal"}));return(c=(s=a[e])!=null?s:a[n.select(e-t)])!=null?c:a.other}function H(o,r){let e=o(),t=pe.get(e);return t||(t=r(),pe.set(e,t)),t}function Z(o,r,e){let t=r.join("-");return`${o}-${t}-${JSON.stringify(e)}`}var ve=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,fe=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)}}),we="%__lingui_octothorpe__%",Ae=(o,r,e={})=>{let t=r||o,a=n=>typeof n=="object"?n:e[n],i=(n,s)=>{let c=Object.keys(e).length?a("number"):void 0,f=ae(t,n,c);return s.replace(new RegExp(we,"g"),f)};return{plural:(n,s)=>{let{offset:c=0}=s,f=me(t,!1,n,s);return i(n-c,f)},selectordinal:(n,s)=>{let{offset:c=0}=s,f=me(t,!0,n,s);return i(n-c,f)},select:Le,number:(n,s)=>ae(t,n,a(s)||{style:s}),date:(n,s)=>le(t,n,a(s)||s),time:(n,s)=>Ne(t,n,a(s)||s)}},Le=(o,r)=>{var e;return(e=r[o])!=null?e:r.other};function De(o,r,e){return(t={},a)=>{let i=Ae(r,e,a),n=(c,f=!1)=>Array.isArray(c)?c.reduce((E,F)=>{if(F==="#"&&f)return E+we;if(A(F))return E+F;let[M,k,y]=F,_={};k==="plural"||k==="selectordinal"||k==="select"?Object.entries(y).forEach(([S,V])=>{_[S]=n(V,k==="plural"||k==="selectordinal")}):_=y;let x;if(k){let S=i[k];x=S(t[M],_)}else x=t[M];return x==null?E:E+x},""):c,s=n(o);return A(s)&&ve.test(s)?fe(s):A(s)?s:s?String(s):""}}var Te=Object.defineProperty,je=(o,r,e)=>r in o?Te(o,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[r]=e,Ye=(o,r,e)=>(je(o,typeof r!="symbol"?r+"":r,e),e),ie=class{constructor(){Ye(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}},Ie=Object.defineProperty,Xe=(o,r,e)=>r in o?Ie(o,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[r]=e,D=(o,r,e)=>(Xe(o,typeof r!="symbol"?r+"":r,e),e),se=class extends ie{constructor(r){var e;super(),D(this,"_locale",""),D(this,"_locales"),D(this,"_localeData",{}),D(this,"_messages",{}),D(this,"_missing"),D(this,"_messageCompiler"),D(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:ge,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=""),A(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 Pe(s)?s(this._locale,r):s;n&&this.emit("missing",{id:r,locale:this._locale});let c=i||a||r;return A(c)&&(this._messageCompiler?c=this._messageCompiler(c):console.warn(`Uncompiled message detected! Message:
|
|
3
2
|
|
|
4
|
-
> ${
|
|
3
|
+
> ${c}
|
|
5
4
|
|
|
6
5
|
That means you use raw catalog or your catalog doesn't have a translation for the message and fallback was used.
|
|
7
6
|
ICU features such as interpolation and plurals will not work properly for that message.
|
|
8
7
|
|
|
9
8
|
Please compile your catalog first.
|
|
10
|
-
`)),
|
|
9
|
+
`)),A(c)&&ve.test(c)?fe(c):A(c)?c:De(c,this._locale,this._locales)(e,t==null?void 0:t.formats)}date(r,e){return le(this._locales||this._locale,r,e)}number(r,e){return ae(this._locales||this._locale,r,e)}};function Re(o={}){return new se(o)}var C=Re();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 xe(o){var r,e,t,a,i,n,s,c,f,E,F,M,k,y,_,x,S,V,J;class Ve extends o{constructor(...l){var h,g,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),f.set(this,""),E.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",S).call(this,this.shouldFormValueUpdate()?u(this,f,"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:"")}),M.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),y.set(this,!1),_.set(this,Promise.resolve()),(h=this.addEventListener)===null||h===void 0||h.call(this,"focus",u(this,E,"f")),(g=this.addEventListener)===null||g===void 0||g.call(this,"blur",u(this,F,"f")),(w=this.addEventListener)===null||w===void 0||w.call(this,"invalid",u(this,M,"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 g;if(h.attribute===l||!((g=h.attribute)===null||g===void 0)&&g.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,g){var w;(w=super.attributeChangedCallback)===null||w===void 0||w.call(this,l,h,g);let X=this.constructor.getValidators(l);X!=null&&X.length&&this.validationTarget&&this.setValue(u(this,f,"f"))}setValue(l){var h;v(this,t,!1,"f"),(h=this.validationMessageCallback)===null||h===void 0||h.call(this,""),v(this,f,l,"f");let w=this.shouldFormValueUpdate()?l:null;this.internals.setFormValue(w),u(this,r,"m",S).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,_,"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,f=new WeakMap,E=new WeakMap,F=new WeakMap,M=new WeakMap,k=new WeakMap,y=new WeakMap,_=new WeakMap,r=new WeakSet,c=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},S=function(l){let h=this.constructor,g={},w=h.validators,P=[],X=w.some(z=>z.isValid instanceof Promise);u(this,y,"f")||(v(this,_,new Promise(z=>{v(this,k,z,"f")}),"f"),v(this,y,!0,"f")),u(this,i,"f")&&(u(this,i,"f").abort(),v(this,n,u(this,i,"f"),"f"));let R=new AbortController;v(this,i,R,"f");let O,ue=!1;w.length&&(w.forEach(z=>{let Q=z.key||"customError",j=z.isValid(this,l,R.signal);j instanceof Promise?(P.push(j),j.then(W=>{W!=null&&(g[Q]=!W,O=u(this,r,"m",J).call(this,z,l),u(this,r,"m",V).call(this,g,O))})):(g[Q]=!j,this.validity[Q]!==!j&&(ue=!0),!j&&!O&&(O=u(this,r,"m",J).call(this,z,l)))}),Promise.allSettled(P).then(()=>{var z;R!=null&&R.signal.aborted||(v(this,y,!1,"f"),(z=u(this,k,"f"))===null||z===void 0||z.call(this))}),(ue||!X)&&u(this,r,"m",V).call(this,g,O))},V=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")}},J=function(l,h){if(this.validityCallback){let g=this.validityCallback(l.key||"customError");if(g)return g}return l.message instanceof Function?l.message(this,h):l.message},Ve}import{html as q,LitElement as Ce,nothing as L}from"lit";import{property as $,query as de,state as N}from"lit/decorators.js";import{classMap as Ue}from"lit/directives/class-map.js";import{ifDefined as K}from"lit/directives/if-defined.js";import{css as Oe}from"lit";var ke=Oe`*,: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 ye}from"lit";var _e=ye`
|
|
11
10
|
*,
|
|
12
11
|
:before,
|
|
13
12
|
:after {
|
|
@@ -280,7 +279,7 @@ Please compile your catalog first.
|
|
|
280
279
|
svg {
|
|
281
280
|
pointer-events: none;
|
|
282
281
|
}
|
|
283
|
-
`,
|
|
282
|
+
`,We=ye`*, :before, :after {
|
|
284
283
|
--w-rotate: 0;
|
|
285
284
|
--w-rotate-x: 0;
|
|
286
285
|
--w-rotate-y: 0;
|
|
@@ -2446,7 +2445,7 @@ Please compile your catalog first.
|
|
|
2446
2445
|
display: none
|
|
2447
2446
|
}
|
|
2448
2447
|
}
|
|
2449
|
-
`;import{css as
|
|
2448
|
+
`;import{css as qe}from"lit";var ze=qe`
|
|
2450
2449
|
.w-slider-thumb {
|
|
2451
2450
|
position: relative;
|
|
2452
2451
|
display: grid;
|
|
@@ -2637,7 +2636,7 @@ Please compile your catalog first.
|
|
|
2637
2636
|
w-textfield {
|
|
2638
2637
|
--w-textfield-placeholder-color-text: var(--w-s-color-text);
|
|
2639
2638
|
}
|
|
2640
|
-
`;var
|
|
2639
|
+
`;var Ee={};var T,d,B,G,ce,Y,U,he,Fe,Me,b=class extends xe(Ce){constructor(){super(...arguments);te(this,d);this.disabled=!1;this.invalid=!1;this.openEnded=!1;this.suffix="";this._showTooltip=!1;this._inputHasFocus=!1;this._hiddenTextfield=!1;te(this,T,null);this.anchorPositioningStyleElement=null}resetFormControl(){this.value=re(this,T),this.dispatchEvent(new CustomEvent("thumbreset",{bubbles:!0}))}async updateFieldAfterValidation(){let e=this.shadowRoot.querySelector("w-textfield");await m(this,d,U).call(this,e.value,!0)}async connectedCallback(){if(super.connectedCallback(),oe(this,T,this.value),this.setValue(this.value),this.slot&&!this.ariaDescription&&(this.slot==="from"?this.ariaDescription=C.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=C.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=Ee.url.substring(0,Ee.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
2640
|
/*
|
|
2642
2641
|
* The polyfill can only anchor to ::before and ::after pseudo elements, not the pseudo element slider thumb.
|
|
2643
2642
|
* We work around that by recreating a transparent version of the active range
|
|
@@ -2686,36 +2685,36 @@ Please compile your catalog first.
|
|
|
2686
2685
|
left: anchor(--polyfilled-thumb left);
|
|
2687
2686
|
margin-left: 38px;
|
|
2688
2687
|
}
|
|
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,
|
|
2688
|
+
`,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,d,ce).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"?C.t({id:"slider.placeholder.from",message:"Min"}):C.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=C.t({id:"slider.placeholder.to",message:"Max",comment:"Max as in short for Maximum"}):this.slot==="from"&&(this.placeholder=C.t({id:"slider.placeholder.from",message:"Min",comment:"Min as in short for Minimum"}))),e.has("value")&&(typeof re(this,T)=="undefined"&&typeof this.value!="undefined"&&oe(this,T,this.value),this.setValue(this.value),m(this,d,ce).call(this))}render(){var t,a,i,n;let e=this.placeholder&&!this.value;return q`
|
|
2690
2689
|
<div class="w-slider-thumb">
|
|
2691
|
-
${"anchorName"in document.documentElement.style?
|
|
2690
|
+
${"anchorName"in document.documentElement.style?L:q`<div class="polyfill-range">
|
|
2692
2691
|
<div class="polyfill-active-range"></div>
|
|
2693
2692
|
</div>`}
|
|
2694
2693
|
<input
|
|
2695
2694
|
id="range"
|
|
2696
2695
|
aria-label="${this.ariaLabel}"
|
|
2697
|
-
aria-describedby="${
|
|
2696
|
+
aria-describedby="${K(this.ariaDescription?"aria-description":void 0)}"
|
|
2698
2697
|
class="w-slider-thumb__range"
|
|
2699
2698
|
type="range"
|
|
2700
2699
|
.value="${this.value}"
|
|
2701
2700
|
min="${this.min}"
|
|
2702
2701
|
max="${this.max}"
|
|
2703
|
-
step="${
|
|
2702
|
+
step="${K(!this.openEnded&&this.step?this.step:void 0)}"
|
|
2704
2703
|
?disabled="${this.disabled}"
|
|
2705
|
-
@mousedown="${m(this,
|
|
2706
|
-
@mouseup="${m(this,
|
|
2707
|
-
@touchstart="${m(this,
|
|
2708
|
-
@touchend="${m(this,
|
|
2709
|
-
@focus="${m(this,
|
|
2710
|
-
@blur="${m(this,
|
|
2711
|
-
@input="${m(this,
|
|
2712
|
-
@keydown="${m(this,
|
|
2704
|
+
@mousedown="${m(this,d,B)}"
|
|
2705
|
+
@mouseup="${m(this,d,G)}"
|
|
2706
|
+
@touchstart="${m(this,d,B)}"
|
|
2707
|
+
@touchend="${m(this,d,G)}"
|
|
2708
|
+
@focus="${m(this,d,B)}"
|
|
2709
|
+
@blur="${m(this,d,G)}"
|
|
2710
|
+
@input="${m(this,d,he)}"
|
|
2711
|
+
@keydown="${m(this,d,Fe)}"
|
|
2713
2712
|
/>
|
|
2714
2713
|
|
|
2715
|
-
${this.slot==="from"||!this.slot?
|
|
2714
|
+
${this.slot==="from"||!this.slot?q`
|
|
2716
2715
|
<span class="sr-only">
|
|
2717
|
-
${
|
|
2718
|
-
</span>`:
|
|
2716
|
+
${C.t({id:"slider.label.from",message:"From"})+" "+(this.labelFormatter?this.labelFormatter("from"):this.min)+", "+C.t({id:"slider.label.to",message:"To"})+" "+(this.labelFormatter?this.labelFormatter("to"):this.max)}
|
|
2717
|
+
</span>`:L}
|
|
2719
2718
|
|
|
2720
2719
|
<span
|
|
2721
2720
|
aria-hidden="true"
|
|
@@ -2732,22 +2731,22 @@ Please compile your catalog first.
|
|
|
2732
2731
|
|
|
2733
2732
|
<w-textfield
|
|
2734
2733
|
aria-label="${this.ariaLabel}"
|
|
2735
|
-
aria-description="${
|
|
2736
|
-
class="${
|
|
2734
|
+
aria-description="${K(this.ariaDescriptionText)}"
|
|
2735
|
+
class="${Ue({"w-slider-thumb__textfield":!0,"sr-only":this._hiddenTextfield})}"
|
|
2737
2736
|
type="number"
|
|
2738
|
-
tabindex="${this._hiddenTextfield?-1:
|
|
2737
|
+
tabindex="${this._hiddenTextfield?-1:L}"
|
|
2739
2738
|
placeholder="${this.placeholder}"
|
|
2740
2739
|
.value="${this.textFieldDisplayValue}"
|
|
2741
|
-
.formatter=${this.valueFormatter&&!e?s=>this.valueFormatter(s,this.slot):
|
|
2742
|
-
min="${this.openEnded?
|
|
2743
|
-
max="${this.openEnded?
|
|
2744
|
-
step="${
|
|
2740
|
+
.formatter=${this.valueFormatter&&!e?s=>this.valueFormatter(s,this.slot):L}
|
|
2741
|
+
min="${this.openEnded?L:this.min}"
|
|
2742
|
+
max="${this.openEnded?L:this.max}"
|
|
2743
|
+
step="${K(this.step)}"
|
|
2745
2744
|
?invalid="${!!this.invalid}"
|
|
2746
|
-
@input="${m(this,
|
|
2747
|
-
@keydown="${m(this,
|
|
2745
|
+
@input="${m(this,d,he)}"
|
|
2746
|
+
@keydown="${m(this,d,Me)}"
|
|
2748
2747
|
?disabled="${this.disabled}"
|
|
2749
2748
|
>
|
|
2750
|
-
${(t=this.suffix)!=null&&t?
|
|
2749
|
+
${(t=this.suffix)!=null&&t?q`<w-affix slot="suffix" label="${(a=this.suffix)!=null?a:""}"></w-affix>`:L}
|
|
2751
2750
|
</w-textfield>
|
|
2752
2751
|
<w-attention
|
|
2753
2752
|
tooltip
|
|
@@ -2762,7 +2761,7 @@ Please compile your catalog first.
|
|
|
2762
2761
|
slot="target"
|
|
2763
2762
|
></output>
|
|
2764
2763
|
<span slot="message">
|
|
2765
|
-
${this.tooltipDisplayValue}${(i=this.suffix)!=null&&i?
|
|
2764
|
+
${this.tooltipDisplayValue}${(i=this.suffix)!=null&&i?q` ${(n=this.suffix)!=null?n:""}`:L}
|
|
2766
2765
|
</span>
|
|
2767
2766
|
</w-attention>
|
|
2768
2767
|
|
|
@@ -2771,5 +2770,5 @@ Please compile your catalog first.
|
|
|
2771
2770
|
${this.ariaDescriptionText}
|
|
2772
2771
|
</span>
|
|
2773
2772
|
</div>
|
|
2774
|
-
`}};
|
|
2773
|
+
`}};T=new WeakMap,d=new WeakSet,B=function(){this._showTooltip=!0,this.shadowRoot.querySelector("w-attention").handleDone()},G=function(){this._showTooltip=!1},ce=function(){this.range&&(this.value===""?this.range.value=this.boundaryValue:this.value&&(this.range.value=this.value))},Y=function(e){this.dispatchEvent(new CustomEvent("slidervalidity",{bubbles:!0,detail:{invalid:e,slot:this.slot}}))},U=async function(e,t){var E;let a=(E=this.suffix)!=null?E:"",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 M=1/this.step;i=Math.round(i*M)/M,e=i.toString()}let n=Number.parseInt(this.max),s=Number.parseInt(this.min);if(!this.openEnded&&(i>n||i<s))return m(this,d,Y).call(this,C.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,d,Y).call(this,C.t({id:"slider.error.required",message:"This field is required"})),this.value=e;let c=e===this.max||e===this.min,f=!1;if(this.slot){let F=this.parentElement.querySelector('w-slider-thumb[slot="to"]'),M=this.parentElement.querySelector('w-slider-thumb[slot="from"]'),k=F.textfield.value||this.max,y=M.textfield.value||this.min,_=Number.parseInt(k),x=Number.parseInt(y),S=C.t({id:"slider.error.overlap",message:"The maximum value cannot be less than the minimum"});if(this.slot==="from"){let V=this.openEnded&&_>n?_:Math.min(_,this.openEnded?n-1:n);i>V&&(f=!0,this.openEnded&&c?this.value=String(V):this.value=k,t&&(m(this,d,Y).call(this,S),await this.updateComplete,this.textfield.value=e))}else{let V=this.openEnded&&x<s?x:Math.max(Number.parseInt(y),this.openEnded?s+1:s);i<V&&(f=!0,this.openEnded&&c?this.value=String(V):this.value=y,t&&(m(this,d,Y).call(this,S),await this.updateComplete,this.textfield.value=e))}}return f?{shouldCancel:!0}:(m(this,d,Y).call(this,""),this.range.value=Math.min(Math.max(Number(e),Number(this.min)),Number(this.max)).toString(),this.value=this.openEnded&&!t&&c?"":e,this.shadowRoot.querySelector("w-attention").handleDone(),{shouldCancel:!1})},he=async function(e){let t=e.currentTarget.tagName==="W-TEXTFIELD";if(e instanceof CustomEvent)return;let a=e.currentTarget.value;return(await m(this,d,U).call(this,a,t)).shouldCancel?(e.preventDefault(),!1):!0},Fe=async function(e){if(e.key==="Enter"&&this.internals.form){this.internals.form.requestSubmit();return}if(!this.openEnded||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,d,U).call(this,i.toString(),!1)).shouldCancel&&e.preventDefault()},Me=async function(e){if(e.key==="Enter"&&this.internals.form){this.internals.form.requestSubmit();return}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,d,U).call(this,t,!0)},b.shadowRootOptions={...Ce.shadowRootOptions,delegatesFocus:!0},b.styles=[_e,ke,ze],p([$({attribute:"aria-label"})],b.prototype,"ariaLabel",2),p([$({attribute:"aria-description"})],b.prototype,"ariaDescription",2),p([$({reflect:!0})],b.prototype,"name",2),p([$({reflect:!0})],b.prototype,"value",2),p([$({type:Boolean,reflect:!0})],b.prototype,"disabled",2),p([$({type:Boolean,reflect:!0})],b.prototype,"invalid",2),p([$({attribute:!1,reflect:!1})],b.prototype,"openEnded",2),p([$({reflect:!0})],b.prototype,"placeholder",2),p([N()],b.prototype,"markers",2),p([N()],b.prototype,"required",2),p([N()],b.prototype,"step",2),p([N()],b.prototype,"min",2),p([N()],b.prototype,"max",2),p([N()],b.prototype,"suffix",2),p([$({attribute:!1})],b.prototype,"valueFormatter",2),p([$({attribute:!1})],b.prototype,"tooltipFormatter",2),p([$({attribute:!1})],b.prototype,"labelFormatter",2),p([de('input[type="range"]')],b.prototype,"range",2),p([de(".w-slider-thumb__tooltip-target")],b.prototype,"tooltipTarget",2),p([de("w-textfield")],b.prototype,"textfield",2),p([N()],b.prototype,"_showTooltip",2),p([N()],b.prototype,"_inputHasFocus",2),p([N()],b.prototype,"_hiddenTextfield",2);customElements.get("w-slider-thumb")||customElements.define("w-slider-thumb",b);export{b as WarpSliderThumb};
|
|
2775
2774
|
//# sourceMappingURL=slider-thumb.js.map
|