@warp-ds/elements 2.10.0-next.12 → 2.10.0-next.13
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/packages/affix/affix.js +8 -8
- package/dist/packages/affix/affix.js.map +3 -3
- package/dist/packages/alert/alert.js +7 -7
- package/dist/packages/alert/alert.js.map +3 -3
- package/dist/packages/attention/attention.js +42 -21
- package/dist/packages/attention/attention.js.map +3 -3
- package/dist/packages/badge/badge.js +6 -6
- package/dist/packages/badge/badge.js.map +3 -3
- package/dist/packages/box/box.js +6 -6
- package/dist/packages/box/box.js.map +3 -3
- package/dist/packages/breadcrumbs/breadcrumbs.js +7 -7
- package/dist/packages/breadcrumbs/breadcrumbs.js.map +3 -3
- package/dist/packages/button/button.js +37 -16
- package/dist/packages/button/button.js.map +3 -3
- package/dist/packages/button/styles.js +18 -2
- package/dist/packages/card/card.js +8 -8
- package/dist/packages/card/card.js.map +3 -3
- package/dist/packages/checkbox/checkbox.js +9 -9
- package/dist/packages/checkbox/checkbox.js.map +3 -3
- package/dist/packages/combobox/combobox.js +9 -9
- package/dist/packages/combobox/combobox.js.map +3 -3
- package/dist/packages/datepicker/datepicker.js +22 -22
- package/dist/packages/datepicker/datepicker.js.map +3 -3
- package/dist/packages/expandable/expandable.js +14 -14
- package/dist/packages/expandable/expandable.js.map +3 -3
- package/dist/packages/link/link.js +40 -19
- package/dist/packages/link/link.js.map +3 -3
- package/dist/packages/link/styles.js +5 -0
- package/dist/packages/modal/modal.js +7 -7
- package/dist/packages/modal/modal.js.map +3 -3
- package/dist/packages/modal-footer/modal-footer.js +7 -7
- package/dist/packages/modal-footer/modal-footer.js.map +3 -3
- package/dist/packages/modal-header/modal-header.js +10 -10
- package/dist/packages/modal-header/modal-header.js.map +3 -3
- package/dist/packages/pagination/pagination.js +8 -8
- package/dist/packages/pagination/pagination.js.map +3 -3
- package/dist/packages/pill/pill.js +9 -9
- package/dist/packages/pill/pill.js.map +3 -3
- package/dist/packages/radio/radio.js +8 -8
- package/dist/packages/radio/radio.js.map +3 -3
- package/dist/packages/radio-group/radio-group.js +11 -11
- package/dist/packages/radio-group/radio-group.js.map +3 -3
- package/dist/packages/select/select.js +13 -13
- package/dist/packages/select/select.js.map +3 -3
- package/dist/packages/slider/slider.js +13 -13
- package/dist/packages/slider/slider.js.map +3 -3
- package/dist/packages/slider/styles.js +2 -2
- package/dist/packages/slider-thumb/slider-thumb.js +11 -11
- package/dist/packages/slider-thumb/slider-thumb.js.map +3 -3
- package/dist/packages/step/step.js +10 -10
- package/dist/packages/step/step.js.map +3 -3
- package/dist/packages/step-indicator/step-indicator.js +6 -6
- package/dist/packages/step-indicator/step-indicator.js.map +3 -3
- package/dist/packages/styles.js +4 -2
- package/dist/packages/switch/switch.js +6 -6
- package/dist/packages/switch/switch.js.map +3 -3
- package/dist/packages/tab/tab.js +7 -7
- package/dist/packages/tab/tab.js.map +3 -3
- package/dist/packages/tab-panel/tab-panel.js +5 -5
- package/dist/packages/tab-panel/tab-panel.js.map +3 -3
- package/dist/packages/tabs/tabs.js +6 -6
- package/dist/packages/tabs/tabs.js.map +3 -3
- package/dist/packages/textarea/textarea.js +10 -10
- package/dist/packages/textarea/textarea.js.map +3 -3
- package/dist/packages/textfield/textfield.js +10 -10
- package/dist/packages/textfield/textfield.js.map +3 -3
- package/dist/packages/toast/styles.js +2 -2
- package/dist/packages/toast/toast.js +12 -12
- package/dist/packages/toast/toast.js.map +3 -3
- package/dist/packages/toast-container/toast-container.js +8 -8
- package/dist/packages/toast-container/toast-container.js.map +3 -3
- package/dist/web-types.json +1 -1
- package/eik/index.js +16 -2455
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var me=Object.defineProperty;var ve=Object.getOwnPropertyDescriptor;var w=(t,e,r,o)=>{for(var a=o>1?void 0:o?ve(e,r):e,d=t.length-1,s;d>=0;d--)(s=t[d])&&(a=(o?s(e,r,a):s(a))||a);return o&&a&&me(e,r,a),a};var B=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return t.reduce(function(r,o){return r.concat(typeof o=="string"?o:Array.isArray(o)?B.apply(void 0,o):typeof o=="object"&&o?Object.keys(o).map(function(a){return o[a]?a:""}):"")},[]).join(" ")};var F=t=>typeof t=="string",fe=t=>typeof t=="function",te=new Map,ie="en";function H(t){return[...Array.isArray(t)?t:[t],ie]}function K(t,e,r){let o=H(t);r||(r="default");let a;if(typeof r=="string")switch(a={day:"numeric",month:"short",year:"numeric"},r){case"full":a.weekday="long";case"long":a.month="long";break;case"short":a.month="numeric";break}else a=r;return O(()=>N("date",o,r),()=>new Intl.DateTimeFormat(o,a)).format(F(e)?new Date(e):e)}function we(t,e,r){let o;if(r||(r="default"),typeof r=="string")switch(o={second:"numeric",minute:"numeric",hour:"numeric"},r){case"full":case"long":o.timeZoneName="short";break;case"short":delete o.second}else o=r;return K(t,e,o)}function G(t,e,r){let o=H(t);return O(()=>N("number",o,r),()=>new Intl.NumberFormat(o,r)).format(e)}function ae(t,e,r,{offset:o=0,...a}){let d=H(t),s=e?O(()=>N("plural-ordinal",d),()=>new Intl.PluralRules(d,{type:"ordinal"})):O(()=>N("plural-cardinal",d),()=>new Intl.PluralRules(d,{type:"cardinal"}));return a[r]??a[s.select(r-o)]??a.other}function O(t,e){let r=t(),o=te.get(r);return o||(o=e(),te.set(r,o)),o}function N(t,e,r){let o=e.join("-");return`${t}-${o}-${JSON.stringify(r)}`}var ne=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,se=t=>t.replace(/\\u([a-fA-F0-9]{4})|\\x([a-fA-F0-9]{2})/g,(e,r,o)=>{if(r){let a=parseInt(r,16);return String.fromCharCode(a)}else{let a=parseInt(o,16);return String.fromCharCode(a)}}),le="%__lingui_octothorpe__%",xe=(t,e,r={})=>{let o=e||t,a=s=>typeof s=="object"?s:r[s],d=(s,n)=>{let b=Object.keys(r).length?a("number"):void 0,g=G(o,s,b);return n.replace(new RegExp(le,"g"),g)};return{plural:(s,n)=>{let{offset:b=0}=n,g=ae(o,!1,s,n);return d(s-b,g)},selectordinal:(s,n)=>{let{offset:b=0}=n,g=ae(o,!0,s,n);return d(s-b,g)},select:ke,number:(s,n)=>G(o,s,a(n)||{style:n}),date:(s,n)=>K(o,s,a(n)||n),time:(s,n)=>we(o,s,a(n)||n)}},ke=(t,e)=>e[t]??e.other;function ye(t,e,r){return(o={},a)=>{let d=xe(e,r,a),s=(b,g=!1)=>Array.isArray(b)?b.reduce((y,_)=>{if(_==="#"&&g)return y+le;if(F(_))return y+_;let[P,v,z]=_,C={};v==="plural"||v==="selectordinal"||v==="select"?Object.entries(z).forEach(([M,V])=>{C[M]=s(V,v==="plural"||v==="selectordinal")}):C=z;let m;if(v){let M=d[v];m=M(o[P],C)}else m=o[P];return m==null?y:y+m},""):b,n=s(t);return F(n)&&ne.test(n)?se(n):F(n)?n:n?String(n):""}}var _e=Object.defineProperty,ze=(t,e,r)=>e in t?_e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ce=(t,e,r)=>(ze(t,typeof e!="symbol"?e+"":e,r),r),U=class{constructor(){Ce(this,"_events",{})}on(e,r){var o;return(o=this._events)[e]??(o[e]=[]),this._events[e].push(r),()=>this.removeListener(e,r)}removeListener(e,r){let o=this._getListeners(e);if(!o)return;let a=o.indexOf(r);~a&&o.splice(a,1)}emit(e,...r){let o=this._getListeners(e);o&&o.map(a=>a.apply(this,r))}_getListeners(e){let r=this._events[e];return Array.isArray(r)?r:!1}},Fe=Object.defineProperty,Ee=(t,e,r)=>e in t?Fe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,L=(t,e,r)=>(Ee(t,typeof e!="symbol"?e+"":e,r),r),q=class extends U{constructor(e){super(),L(this,"_locale",""),L(this,"_locales"),L(this,"_localeData",{}),L(this,"_messages",{}),L(this,"_missing"),L(this,"_messageCompiler"),L(this,"t",this._.bind(this)),e.missing!=null&&(this._missing=e.missing),e.messages!=null&&this.load(e.messages),e.localeData!=null&&this.loadLocaleData(e.localeData),(typeof e.locale=="string"||e.locales)&&this.activate(e.locale??ie,e.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(e,r){let o=this._localeData[e];o?Object.assign(o,r):this._localeData[e]=r}setMessagesCompiler(e){return this._messageCompiler=e,this}loadLocaleData(e,r){typeof e=="string"?this._loadLocaleData(e,r):Object.keys(e).forEach(o=>this._loadLocaleData(o,e[o])),this.emit("change")}_load(e,r){let o=this._messages[e];o?Object.assign(o,r):this._messages[e]=r}load(e,r){typeof e=="string"&&typeof r=="object"?this._load(e,r):Object.entries(e).forEach(([o,a])=>this._load(o,a)),this.emit("change")}loadAndActivate({locale:e,locales:r,messages:o}){this._locale=e,this._locales=r||void 0,this._messages[this._locale]=o,this.emit("change")}activate(e,r){this._locale=e,this._locales=r,this.emit("change")}_(e,r,o){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=o?.message;e||(e=""),F(e)||(r=e.values||r,a=e.message,e=e.id);let d=this.messages[e],s=d===void 0,n=this._missing;if(n&&s)return fe(n)?n(this._locale,e):n;s&&this.emit("missing",{id:e,locale:this._locale});let b=d||a||e;return F(b)&&(this._messageCompiler?b=this._messageCompiler(b):console.warn(`Uncompiled message detected! Message:
|
|
2
2
|
|
|
3
3
|
> ${b}
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@ That means you use raw catalog or your catalog doesn't have a translation for th
|
|
|
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
|
-
`)),F(b)&&ne.test(b)?se(b):F(b)?b:
|
|
9
|
+
`)),F(b)&&ne.test(b)?se(b):F(b)?b:ye(b,this._locale,this._locales)(r,o?.formats)}date(e,r){return K(this._locales||this._locale,e,r)}number(e,r){return G(this._locales||this._locale,e,r)}};function Me(t={}){return new q(t)}var J=Me();import{html as Y,LitElement as Re}from"lit";import{property as A}from"lit/decorators.js";var c=function(t,e,r,o){if(r==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?o:r==="a"?o.call(t):o?o.value:e.get(t)},h=function(t,e,r,o,a){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!a:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?a.call(t,r):a?a.value=r:e.set(t,r),r};function ce(t){var e,r,o,a,d,s,n,b,g,y,_,P,v,z,C,m,M,V,X;class ge extends t{constructor(...i){var l,u,p;super(...i),e.add(this),this.internals=this.attachInternals(),r.set(this,!1),o.set(this,!1),a.set(this,!1),d.set(this,void 0),s.set(this,void 0),n.set(this,!0),g.set(this,""),y.set(this,()=>{h(this,a,!0,"f"),h(this,r,!0,"f"),c(this,e,"m",m).call(this)}),_.set(this,()=>{h(this,r,!1,"f"),c(this,e,"m",M).call(this,this.shouldFormValueUpdate()?c(this,g,"f"):""),!this.validity.valid&&c(this,a,"f")&&h(this,o,!0,"f");let x=c(this,e,"m",m).call(this);this.validationMessageCallback&&this.validationMessageCallback(x?this.internals.validationMessage:"")}),P.set(this,()=>{var x;c(this,n,"f")&&this.validationTarget&&(this.internals.setValidity(this.validity,this.validationMessage,this.validationTarget),h(this,n,!1,"f")),h(this,a,!0,"f"),h(this,o,!0,"f"),c(this,e,"m",m).call(this),(x=this===null||this===void 0?void 0:this.validationMessageCallback)===null||x===void 0||x.call(this,this.showError?this.internals.validationMessage:"")}),v.set(this,void 0),z.set(this,!1),C.set(this,Promise.resolve()),(l=this.addEventListener)===null||l===void 0||l.call(this,"focus",c(this,y,"f")),(u=this.addEventListener)===null||u===void 0||u.call(this,"blur",c(this,_,"f")),(p=this.addEventListener)===null||p===void 0||p.call(this,"invalid",c(this,P,"f")),this.setValue(null)}static get formAssociated(){return!0}static get validators(){return this.formControlValidators||[]}static get observedAttributes(){let i=this.validators.map(p=>p.attribute).flat(),l=super.observedAttributes||[];return[...new Set([...l,...i])]}static getValidator(i){return this.validators.find(l=>l.attribute===i)||null}static getValidators(i){return this.validators.filter(l=>{var u;if(l.attribute===i||!((u=l.attribute)===null||u===void 0)&&u.includes(i))return!0})}get form(){return this.internals.form}get showError(){return c(this,e,"m",m).call(this)}checkValidity(){return this.internals.checkValidity()}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}attributeChangedCallback(i,l,u){var p;(p=super.attributeChangedCallback)===null||p===void 0||p.call(this,i,l,u);let $=this.constructor.getValidators(i);$?.length&&this.validationTarget&&this.setValue(c(this,g,"f"))}setValue(i){var l;h(this,o,!1,"f"),(l=this.validationMessageCallback)===null||l===void 0||l.call(this,""),h(this,g,i,"f");let p=this.shouldFormValueUpdate()?i:null;this.internals.setFormValue(p),c(this,e,"m",M).call(this,p),this.valueChangedCallback&&this.valueChangedCallback(p),c(this,e,"m",m).call(this)}shouldFormValueUpdate(){return!0}get validationComplete(){return new Promise(i=>i(c(this,C,"f")))}formResetCallback(){var i,l;h(this,a,!1,"f"),h(this,o,!1,"f"),c(this,e,"m",m).call(this),(i=this.resetFormControl)===null||i===void 0||i.call(this),(l=this.validationMessageCallback)===null||l===void 0||l.call(this,c(this,e,"m",m).call(this)?this.validationMessage:"")}}return r=new WeakMap,o=new WeakMap,a=new WeakMap,d=new WeakMap,s=new WeakMap,n=new WeakMap,g=new WeakMap,y=new WeakMap,_=new WeakMap,P=new WeakMap,v=new WeakMap,z=new WeakMap,C=new WeakMap,e=new WeakSet,b=function(){let i=this.getRootNode(),l=`${this.localName}[name="${this.getAttribute("name")}"]`;return i.querySelectorAll(l)},m=function(){if(this.hasAttribute("disabled"))return!1;let i=c(this,o,"f")||c(this,a,"f")&&!this.validity.valid&&!c(this,r,"f");return i&&this.internals.states?this.internals.states.add("--show-error"):this.internals.states&&this.internals.states.delete("--show-error"),i},M=function(i){let l=this.constructor,u={},p=l.validators,x=[],$=p.some(f=>f.isValid instanceof Promise);c(this,z,"f")||(h(this,C,new Promise(f=>{h(this,v,f,"f")}),"f"),h(this,z,!0,"f")),c(this,d,"f")&&(c(this,d,"f").abort(),h(this,s,c(this,d,"f"),"f"));let j=new AbortController;h(this,d,j,"f");let D,oe=!1;p.length&&(p.forEach(f=>{let W=f.key||"customError",S=f.isValid(this,i,j.signal);S instanceof Promise?(x.push(S),S.then(Z=>{Z!=null&&(u[W]=!Z,D=c(this,e,"m",X).call(this,f,i),c(this,e,"m",V).call(this,u,D))})):(u[W]=!S,this.validity[W]!==!S&&(oe=!0),!S&&!D&&(D=c(this,e,"m",X).call(this,f,i)))}),Promise.allSettled(x).then(()=>{var f;j?.signal.aborted||(h(this,z,!1,"f"),(f=c(this,v,"f"))===null||f===void 0||f.call(this))}),(oe||!$)&&c(this,e,"m",V).call(this,u,D))},V=function(i,l){if(this.validationTarget)this.internals.setValidity(i,l,this.validationTarget),h(this,n,!1,"f");else{if(this.internals.setValidity(i,l),this.internals.validity.valid)return;h(this,n,!0,"f")}},X=function(i,l){if(this.validityCallback){let u=this.validityCallback(i.key||"customError");if(u)return u}return i.message instanceof Function?i.message(this,l):i.message},ge}import{css as Le}from"lit";import{unsafeCSS as Pe}from"lit";var de=Le`
|
|
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
|
+
`,Je=Pe(`*, :before, :after {
|
|
283
283
|
--w-rotate: 0;
|
|
284
284
|
--w-rotate-x: 0;
|
|
285
285
|
--w-rotate-y: 0;
|
|
@@ -2144,8 +2144,8 @@ Please compile your catalog first.
|
|
|
2144
2144
|
overflow-wrap: break-word
|
|
2145
2145
|
}
|
|
2146
2146
|
|
|
2147
|
-
.before\\:content-\\[\\"
|
|
2148
|
-
content: "
|
|
2147
|
+
.before\\:content-\\[\\"\xE2\u20AC\u201C\\"\\]:before {
|
|
2148
|
+
content: "\xE2\u20AC\u201C"
|
|
2149
2149
|
}
|
|
2150
2150
|
|
|
2151
2151
|
.before\\:content-\\[\\"\\"\\]:before {
|
|
@@ -2445,7 +2445,7 @@ Please compile your catalog first.
|
|
|
2445
2445
|
display: none
|
|
2446
2446
|
}
|
|
2447
2447
|
}
|
|
2448
|
-
|
|
2448
|
+
`);import{unsafeCSS as Se}from"lit";var be=Se("*,: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}.focus\\:\\[--w-outline-offset\\:-2px\\]:focus{--w-outline-offset:-2px}.bg-transparent{background-color:#0000}.rounded-4{border-radius:4px}.block{display:block}.flex{display:flex}.focusable:focus{outline:2px solid var(--w-s-color-border-focus);outline-offset:var(--w-outline-offset,1px)}.focusable:focus-visible{outline:2px solid var(--w-s-color-border-focus);outline-offset:var(--w-outline-offset,1px)}.focusable:not(:focus-visible){outline:none}.items-center{align-items:center}.bottom-0{bottom:0}.left-0{left:0}.right-0{right:0}.top-0{top:0}.justify-center{justify-content:center}.absolute{position:absolute}.relative{position:relative}.static{position:static}.s-text{color:var(--w-s-color-text)}.w-40{width:4rem}.w-max{width:max-content}.pb-0{padding-bottom:0}.pl-12{padding-left:1.2rem}.pr-12{padding-right:1.2rem}.cursor-default{cursor:default}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-smoothing:grayscale}.font-bold{font-weight:700}.text-xs{font-size:var(--w-font-size-xs);line-height:var(--w-line-height-xs)}");import{html as Te,LitElement as $e}from"lit";import{property as Q,state as je}from"lit/decorators.js";import{classMap as De}from"lit/directives/class-map.js";import{css as Ve}from"lit";var ue=Ve`
|
|
2449
2449
|
:host {
|
|
2450
2450
|
display: inline-block;
|
|
2451
2451
|
}
|
|
@@ -2470,7 +2470,7 @@ Please compile your catalog first.
|
|
|
2470
2470
|
--w-icon-size: 32px;
|
|
2471
2471
|
}
|
|
2472
2472
|
|
|
2473
|
-
`;var ee=new Map,
|
|
2473
|
+
`;var ee=new Map,Ye='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>';function Ae(t,e={}){let r=e.responseParser??(o=>o.text());return ee.has(t)||ee.set(t,fetch(t).then(r)),ee.get(t)}var E=class extends $e{constructor(){super(...arguments);this.locale=document.documentElement.lang||"en";this.svg=null}async fetchIcon(r){let o=`https://assets.finn.no/pkg/eikons/v1/${this.locale}/${r}.svg`;try{let a=await Ae(o);return new DOMParser().parseFromString(a,"text/html").body.querySelector("svg")}catch{return null}}firstUpdated(){this.loadIcon()}updated(r){(r.has("name")||r.has("locale"))&&this.loadIcon()}async loadIcon(){if(!this.name){this.svg=null;return}let r=await this.fetchIcon(this.name);r||(r=new DOMParser().parseFromString(Ye,"text/html").body.firstElementChild),this.svg=r}render(){let r=this.size||"medium",o=this.name||"",a={"w-icon":!0,"w-icon--s":r==="small","w-icon--m":r==="medium","w-icon--l":r==="large"},d=typeof r=="string"&&r.endsWith("px")?`--w-icon-size: ${r};`:"";return Te`<div class="${De(a)}" style="${d}" part="w-${o.toLowerCase()}">${this.svg}</div>`}};E.styles=[ue],w([Q({type:String,reflect:!0})],E.prototype,"name",2),w([Q({type:String,reflect:!0})],E.prototype,"size",2),w([Q({type:String,reflect:!0,useDefault:!0})],E.prototype,"locale",2),w([je()],E.prototype,"svg",2);customElements.get("w-icon")||customElements.define("w-icon",E);var Oe=["en","nb","fi","da","sv"],re="en",I=t=>Oe.find(e=>t===e||t.toLowerCase().includes(e))||re;function R(){if(typeof window>"u"){let t=process.env.NMP_LANGUAGE||Intl.DateTimeFormat().resolvedOptions().locale;return I(t)}try{let t=he(document);if(t)return I(t);let e=Ie();if(e)return I(e);let r=he(Ne());return r?I(r):re}catch(t){return console.warn("could not detect locale, falling back to source locale",t),re}}function Ne(){try{return window.parent?.document??null}catch{return null}}function he(t){try{return t?.documentElement?.lang??""}catch{return""}}function Ie(){try{return window.frameElement?.getAttribute?.("lang")??""}catch{return""}}var pe="absolute top-0 bottom-0 flex justify-center items-center focusable rounded-4 focus:[--w-outline-offset:-2px] bg-transparent ",Xe={wrapper:pe+"right-0",wrapperWithLabel:"w-max pr-12",wrapperWithIcon:"w-40",label:"antialiased block relative cursor-default pb-0 font-bold text-xs s-text"},We={wrapper:pe+"left-0",wrapperWithLabel:"w-max pl-12",wrapperWithIcon:"w-40",label:"antialiased block relative cursor-default pb-0 font-bold text-xs s-text"},k=class extends ce(Re){constructor(){super(...arguments);this.ariaLabel=null;this.clear=!1;this.search=!1;this.label="";this.icon=null}get _classBase(){return this.slot==="suffix"?Xe:We}get _classes(){return B([this._classBase.wrapper,this.label?this._classBase.wrapperWithLabel:this._classBase.wrapperWithIcon])}resetContainingTextField(r){let o=this.closest("w-textfield");o&&o.resetFormControl(),r.stopPropagation()}submitContainingForm(r){let o=this.internals.form;o&&o.submit(),r.stopPropagation()}get _searchButton(){let r=this.ariaLabel||J._({id:"affix.aria.search",message:"Search",comment:"Aria label for the search button in affix"});return Y`
|
|
2474
2474
|
<button aria-label="${r}" class="${this._classes}" type="submit" @click="${this.submitContainingForm.bind(this)}">
|
|
2475
2475
|
<w-icon name="Search" size="small" locale="${R()}" class="flex"></w-icon>
|
|
2476
2476
|
</button>
|
|
@@ -2486,5 +2486,5 @@ Please compile your catalog first.
|
|
|
2486
2486
|
<div class="${this._classes}">
|
|
2487
2487
|
<span class="${this._classBase.label}">${this.label}</span>
|
|
2488
2488
|
</div>
|
|
2489
|
-
`}get _markup(){if(this.label)return this._text;if(this.icon)return this._icon;if(this.search)return this._searchButton;if(this.clear)return this._clearButton}render(){return Y`${this._markup}`}};k.styles=[be
|
|
2489
|
+
`}get _markup(){if(this.label)return this._text;if(this.icon)return this._icon;if(this.search)return this._searchButton;if(this.clear)return this._clearButton}render(){return Y`${this._markup}`}};k.styles=[de,be],w([A({attribute:"aria-label",reflect:!0,useDefault:!0})],k.prototype,"ariaLabel",2),w([A({type:Boolean})],k.prototype,"clear",2),w([A({type:Boolean})],k.prototype,"search",2),w([A({reflect:!0,useDefault:!0})],k.prototype,"label",2),w([A({reflect:!0,useDefault:!0})],k.prototype,"icon",2);customElements.get("w-affix")||customElements.define("w-affix",k);export{k as WarpAffix};
|
|
2490
2490
|
//# sourceMappingURL=affix.js.map
|