@warp-ds/elements 2.2.0-next.30 → 2.2.0-next.32
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 +0 -17
- package/dist/custom-elements.json +94 -240
- package/dist/index.d.ts +9 -9
- package/dist/packages/affix/index.d.ts +0 -12
- package/dist/packages/affix/index.js +1 -1
- package/dist/packages/affix/index.js.map +2 -2
- package/dist/packages/attention/index.d.ts +0 -26
- package/dist/packages/attention/index.js +1 -1
- package/dist/packages/attention/index.js.map +2 -2
- package/dist/packages/breadcrumbs/index.d.ts +0 -7
- package/dist/packages/breadcrumbs/index.js +1 -1
- package/dist/packages/breadcrumbs/index.js.map +2 -2
- package/dist/packages/button/index.d.ts +0 -61
- package/dist/packages/button/index.js +1 -1
- package/dist/packages/button/index.js.map +2 -2
- package/dist/packages/card/index.d.ts +0 -12
- package/dist/packages/card/index.js +1 -1
- package/dist/packages/card/index.js.map +2 -2
- package/dist/packages/expandable/index.d.ts +0 -28
- package/dist/packages/expandable/index.js +1 -1
- package/dist/packages/expandable/index.js.map +2 -2
- package/dist/packages/modal/index.js +2717 -5
- package/dist/packages/modal/index.js.map +7 -0
- package/dist/packages/pill/index.d.ts +0 -12
- package/dist/packages/pill/index.js +1 -1
- package/dist/packages/pill/index.js.map +2 -2
- package/dist/packages/select/index.d.ts +0 -20
- package/dist/packages/select/index.js +4 -4
- package/dist/packages/select/index.js.map +2 -2
- package/dist/packages/textfield/index.d.ts +0 -20
- package/dist/packages/textfield/index.js +1 -1
- package/dist/packages/textfield/index.js.map +2 -2
- package/dist/packages/toast/index.js +2483 -3
- package/dist/packages/toast/index.js.map +7 -0
- package/dist/web-types.json +1 -1
- package/package.json +4 -4
- package/dist/vscode.css-custom-data.json +0 -6
- package/dist/vscode.html-custom-data.json +0 -296
|
@@ -1,25 +1,5 @@
|
|
|
1
1
|
import { LitElement, TemplateResult } from 'lit';
|
|
2
2
|
import '@warp-ds/icons/elements/chevron-down-16';
|
|
3
|
-
export declare const ccSelect: {
|
|
4
|
-
base: string;
|
|
5
|
-
default: string;
|
|
6
|
-
disabled: string;
|
|
7
|
-
invalid: string;
|
|
8
|
-
readOnly: string;
|
|
9
|
-
wrapper: string;
|
|
10
|
-
selectWrapper: string;
|
|
11
|
-
chevron: string;
|
|
12
|
-
chevronDisabled: string;
|
|
13
|
-
};
|
|
14
|
-
export declare const ccLabel: {
|
|
15
|
-
base: string;
|
|
16
|
-
optional: string;
|
|
17
|
-
};
|
|
18
|
-
export declare const ccHelpText: {
|
|
19
|
-
base: string;
|
|
20
|
-
color: string;
|
|
21
|
-
colorInvalid: string;
|
|
22
|
-
};
|
|
23
3
|
declare const WarpSelect_base: import("@open-wc/form-control").Constructor<import("@open-wc/form-control").FormControlInterface> & typeof LitElement;
|
|
24
4
|
/**
|
|
25
5
|
* A dropdown component for selecting a single value.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var Xe=Object.create;var re=Object.defineProperty;var he=Object.getOwnPropertyDescriptor;var Ze=Object.getOwnPropertyNames;var Je=Object.getPrototypeOf,qe=Object.prototype.hasOwnProperty;var
|
|
2
|
-
`],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function ir(r){return ar.get(r)||r}var nr=/\\(?:(\\)|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 fe(r,e=!1){return r.replace(nr,function(o,t,a,s,i,n,c,h,v){if(t!==void 0)return"\\";if(a!==void 0)return er(a);if(s!==void 0)return or(s);if(i!==void 0)return me(i,n);if(c!==void 0)return me(c);if(h==="0")return"\0";if(h!==void 0)return tr(h,!e);if(v!==void 0)return ir(v);throw new SyntaxError(f.errorMessages.get(f.ErrorType.EndOfString))})}O.unraw=fe;O.default=fe});import{css as Sr,html as I,LitElement as Pr}from"lit";var X=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];return r.reduce(function(o,t){return o.concat(typeof t=="string"?t:Array.isArray(t)?X.apply(void 0,t):typeof t=="object"&&t?Object.keys(t).map(function(a){return t[a]?a:""}):"")},[]).join(" ")};var ye=Ke(we(),1);var $=r=>typeof r=="string",sr=r=>typeof r=="function",xe=new Map,_e="en";function ie(r){return[...Array.isArray(r)?r:[r],_e]}function ne(r,e,o){let t=ie(r);o||(o="default");let a;if(typeof o=="string")switch(a={day:"numeric",month:"short",year:"numeric"},o){case"full":a.weekday="long";case"long":a.month="long";break;case"short":a.month="numeric";break}else a=o;return J(()=>q("date",t,o),()=>new Intl.DateTimeFormat(t,a)).format($(e)?new Date(e):e)}function lr(r,e,o){let t;if(o||(o="default"),typeof o=="string")switch(t={second:"numeric",minute:"numeric",hour:"numeric"},o){case"full":case"long":t.timeZoneName="short";break;case"short":delete t.second}else t=o;return ne(r,e,t)}function oe(r,e,o){let t=ie(r);return J(()=>q("number",t,o),()=>new Intl.NumberFormat(t,o)).format(e)}function ke(r,e,o,{offset:t=0,...a}){var n,c;let s=ie(r),i=e?J(()=>q("plural-ordinal",s),()=>new Intl.PluralRules(s,{type:"ordinal"})):J(()=>q("plural-cardinal",s),()=>new Intl.PluralRules(s,{type:"cardinal"}));return(c=(n=a[o])!=null?n:a[i.select(o-t)])!=null?c:a.other}function J(r,e){let o=r(),t=xe.get(o);return t||(t=e(),xe.set(o,t)),t}function q(r,e,o){let t=e.join("-");return`${r}-${t}-${JSON.stringify(o)}`}var Ce=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,ze="%__lingui_octothorpe__%",cr=(r,e,o={})=>{let t=e||r,a=i=>typeof i=="object"?i:o[i],s=(i,n)=>{let c=Object.keys(o).length?a("number"):void 0,h=oe(t,i,c);return n.replace(new RegExp(ze,"g"),h)};return{plural:(i,n)=>{let{offset:c=0}=n,h=ke(t,!1,i,n);return s(i-c,h)},selectordinal:(i,n)=>{let{offset:c=0}=n,h=ke(t,!0,i,n);return s(i-c,h)},select:dr,number:(i,n)=>oe(t,i,a(n)||{style:n}),date:(i,n)=>ne(t,i,a(n)||n),time:(i,n)=>lr(t,i,a(n)||n)}},dr=(r,e)=>{var o;return(o=e[r])!=null?o:e.other};function br(r,e,o){return(t={},a)=>{let s=cr(e,o,a),i=(c,h=!1)=>Array.isArray(c)?c.reduce((v,C)=>{if(C==="#"&&h)return v+ze;if($(C))return v+C;let[F,k,A]=C,T={};k==="plural"||k==="selectordinal"||k==="select"?Object.entries(A).forEach(([S,Y])=>{T[S]=i(Y,k==="plural"||k==="selectordinal")}):T=A;let x;if(k){let S=s[k];x=S(t[F],T)}else x=t[F];return x==null?v:v+x},""):c,n=i(r);return $(n)&&Ce.test(n)?(0,ye.unraw)(n):$(n)?n:n?String(n):""}}var hr=Object.defineProperty,
|
|
1
|
+
var Xe=Object.create;var re=Object.defineProperty;var he=Object.getOwnPropertyDescriptor;var Ze=Object.getOwnPropertyNames;var Je=Object.getPrototypeOf,qe=Object.prototype.hasOwnProperty;var ue=r=>{throw TypeError(r)};var pe=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var Ge=(r,e,o,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Ze(e))!qe.call(r,a)&&a!==o&&re(r,a,{get:()=>e[a],enumerable:!(t=he(e,a))||t.enumerable});return r};var Ke=(r,e,o)=>(o=r!=null?Xe(Je(r)):{},Ge(e||!r||!r.__esModule?re(o,"default",{value:r,enumerable:!0}):o,r));var _=(r,e,o,t)=>{for(var a=t>1?void 0:t?he(e,o):e,s=r.length-1,i;s>=0;s--)(i=r[s])&&(a=(t?i(e,o,a):i(a))||a);return t&&a&&re(e,o,a),a};var We=(r,e,o)=>e.has(r)||ue("Cannot "+o);var M=(r,e,o)=>(We(r,e,"read from private field"),o?o.call(r):e.get(r)),ge=(r,e,o)=>e.has(r)?ue("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,o);var ve=pe(P=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});P.errorMessages=P.ErrorType=void 0;var j;(function(r){r.MalformedUnicode="MALFORMED_UNICODE",r.MalformedHexadecimal="MALFORMED_HEXADECIMAL",r.CodePointLimit="CODE_POINT_LIMIT",r.OctalDeprecation="OCTAL_DEPRECATION",r.EndOfString="END_OF_STRING"})(j=P.ErrorType||(P.ErrorType={}));P.errorMessages=new Map([[j.MalformedUnicode,"malformed Unicode character escape sequence"],[j.MalformedHexadecimal,"malformed hexadecimal character escape sequence"],[j.CodePointLimit,"Unicode codepoint must not be greater than 0x10FFFF in escape sequence"],[j.OctalDeprecation,'"0"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead'],[j.EndOfString,"malformed escape sequence at end of string"]])});var we=pe(O=>{"use strict";Object.defineProperty(O,"__esModule",{value:!0});O.unraw=O.errorMessages=O.ErrorType=void 0;var f=ve();Object.defineProperty(O,"ErrorType",{enumerable:!0,get:function(){return f.ErrorType}});Object.defineProperty(O,"errorMessages",{enumerable:!0,get:function(){return f.errorMessages}});function Qe(r){return!r.match(/[^a-f0-9]/i)?parseInt(r,16):NaN}function Z(r,e,o){let t=Qe(r);if(Number.isNaN(t)||o!==void 0&&o!==r.length)throw new SyntaxError(f.errorMessages.get(e));return t}function er(r){let e=Z(r,f.ErrorType.MalformedHexadecimal,2);return String.fromCharCode(e)}function me(r,e){let o=Z(r,f.ErrorType.MalformedUnicode,4);if(e!==void 0){let t=Z(e,f.ErrorType.MalformedUnicode,4);return String.fromCharCode(o,t)}return String.fromCharCode(o)}function rr(r){return r.charAt(0)==="{"&&r.charAt(r.length-1)==="}"}function or(r){if(!rr(r))throw new SyntaxError(f.errorMessages.get(f.ErrorType.MalformedUnicode));let e=r.slice(1,-1),o=Z(e,f.ErrorType.MalformedUnicode);try{return String.fromCodePoint(o)}catch(t){throw t instanceof RangeError?new SyntaxError(f.errorMessages.get(f.ErrorType.CodePointLimit)):t}}function tr(r,e=!1){if(e)throw new SyntaxError(f.errorMessages.get(f.ErrorType.OctalDeprecation));let o=parseInt(r,8);return String.fromCharCode(o)}var ar=new Map([["b","\b"],["f","\f"],["n",`
|
|
2
|
+
`],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function ir(r){return ar.get(r)||r}var nr=/\\(?:(\\)|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 fe(r,e=!1){return r.replace(nr,function(o,t,a,s,i,n,c,h,v){if(t!==void 0)return"\\";if(a!==void 0)return er(a);if(s!==void 0)return or(s);if(i!==void 0)return me(i,n);if(c!==void 0)return me(c);if(h==="0")return"\0";if(h!==void 0)return tr(h,!e);if(v!==void 0)return ir(v);throw new SyntaxError(f.errorMessages.get(f.ErrorType.EndOfString))})}O.unraw=fe;O.default=fe});import{css as Sr,html as I,LitElement as Pr}from"lit";var X=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];return r.reduce(function(o,t){return o.concat(typeof t=="string"?t:Array.isArray(t)?X.apply(void 0,t):typeof t=="object"&&t?Object.keys(t).map(function(a){return t[a]?a:""}):"")},[]).join(" ")};var ye=Ke(we(),1);var $=r=>typeof r=="string",sr=r=>typeof r=="function",xe=new Map,_e="en";function ie(r){return[...Array.isArray(r)?r:[r],_e]}function ne(r,e,o){let t=ie(r);o||(o="default");let a;if(typeof o=="string")switch(a={day:"numeric",month:"short",year:"numeric"},o){case"full":a.weekday="long";case"long":a.month="long";break;case"short":a.month="numeric";break}else a=o;return J(()=>q("date",t,o),()=>new Intl.DateTimeFormat(t,a)).format($(e)?new Date(e):e)}function lr(r,e,o){let t;if(o||(o="default"),typeof o=="string")switch(t={second:"numeric",minute:"numeric",hour:"numeric"},o){case"full":case"long":t.timeZoneName="short";break;case"short":delete t.second}else t=o;return ne(r,e,t)}function oe(r,e,o){let t=ie(r);return J(()=>q("number",t,o),()=>new Intl.NumberFormat(t,o)).format(e)}function ke(r,e,o,{offset:t=0,...a}){var n,c;let s=ie(r),i=e?J(()=>q("plural-ordinal",s),()=>new Intl.PluralRules(s,{type:"ordinal"})):J(()=>q("plural-cardinal",s),()=>new Intl.PluralRules(s,{type:"cardinal"}));return(c=(n=a[o])!=null?n:a[i.select(o-t)])!=null?c:a.other}function J(r,e){let o=r(),t=xe.get(o);return t||(t=e(),xe.set(o,t)),t}function q(r,e,o){let t=e.join("-");return`${r}-${t}-${JSON.stringify(o)}`}var Ce=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,ze="%__lingui_octothorpe__%",cr=(r,e,o={})=>{let t=e||r,a=i=>typeof i=="object"?i:o[i],s=(i,n)=>{let c=Object.keys(o).length?a("number"):void 0,h=oe(t,i,c);return n.replace(new RegExp(ze,"g"),h)};return{plural:(i,n)=>{let{offset:c=0}=n,h=ke(t,!1,i,n);return s(i-c,h)},selectordinal:(i,n)=>{let{offset:c=0}=n,h=ke(t,!0,i,n);return s(i-c,h)},select:dr,number:(i,n)=>oe(t,i,a(n)||{style:n}),date:(i,n)=>ne(t,i,a(n)||n),time:(i,n)=>lr(t,i,a(n)||n)}},dr=(r,e)=>{var o;return(o=e[r])!=null?o:e.other};function br(r,e,o){return(t={},a)=>{let s=cr(e,o,a),i=(c,h=!1)=>Array.isArray(c)?c.reduce((v,C)=>{if(C==="#"&&h)return v+ze;if($(C))return v+C;let[F,k,A]=C,T={};k==="plural"||k==="selectordinal"||k==="select"?Object.entries(A).forEach(([S,Y])=>{T[S]=i(Y,k==="plural"||k==="selectordinal")}):T=A;let x;if(k){let S=s[k];x=S(t[F],T)}else x=t[F];return x==null?v:v+x},""):c,n=i(r);return $(n)&&Ce.test(n)?(0,ye.unraw)(n):$(n)?n:n?String(n):""}}var hr=Object.defineProperty,ur=(r,e,o)=>e in r?hr(r,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[e]=o,pr=(r,e,o)=>(ur(r,typeof e!="symbol"?e+"":e,o),o),te=class{constructor(){pr(this,"_events",{})}on(e,o){var a;var t;return(a=(t=this._events)[e])!=null||(t[e]=[]),this._events[e].push(o),()=>this.removeListener(e,o)}removeListener(e,o){let t=this._getListeners(e);if(!t)return;let a=t.indexOf(o);~a&&t.splice(a,1)}emit(e,...o){let t=this._getListeners(e);t&&t.map(a=>a.apply(this,o))}_getListeners(e){let o=this._events[e];return Array.isArray(o)?o:!1}},gr=Object.defineProperty,vr=(r,e,o)=>e in r?gr(r,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[e]=o,D=(r,e,o)=>(vr(r,typeof e!="symbol"?e+"":e,o),o),ae=class extends te{constructor(e){var o;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)),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((o=e.locale)!=null?o:_e,e.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){var e;return(e=this._messages[this._locale])!=null?e:{}}get localeData(){var e;return(e=this._localeData[this._locale])!=null?e:{}}_loadLocaleData(e,o){let t=this._localeData[e];t?Object.assign(t,o):this._localeData[e]=o}setMessagesCompiler(e){return this._messageCompiler=e,this}loadLocaleData(e,o){typeof e=="string"?this._loadLocaleData(e,o):Object.keys(e).forEach(t=>this._loadLocaleData(t,e[t])),this.emit("change")}_load(e,o){let t=this._messages[e];t?Object.assign(t,o):this._messages[e]=o}load(e,o){typeof e=="string"&&typeof o=="object"?this._load(e,o):Object.entries(e).forEach(([t,a])=>this._load(t,a)),this.emit("change")}loadAndActivate({locale:e,locales:o,messages:t}){this._locale=e,this._locales=o||void 0,this._messages[this._locale]=t,this.emit("change")}activate(e,o){this._locale=e,this._locales=o,this.emit("change")}_(e,o,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;e||(e=""),$(e)||(o=e.values||o,a=e.message,e=e.id);let s=this.messages[e],i=s===void 0,n=this._missing;if(n&&i)return sr(n)?n(this._locale,e):n;i&&this.emit("missing",{id:e,locale:this._locale});let c=s||a||e;return $(c)&&(this._messageCompiler?c=this._messageCompiler(c):console.warn(`Uncompiled message detected! Message:
|
|
3
3
|
|
|
4
4
|
> ${c}
|
|
5
5
|
|
|
@@ -7,7 +7,7 @@ That means you use raw catalog or your catalog doesn't have a translation for th
|
|
|
7
7
|
ICU features such as interpolation and plurals will not work properly for that message.
|
|
8
8
|
|
|
9
9
|
Please compile your catalog first.
|
|
10
|
-
`)),$(c)&&Ce.test(c)?JSON.parse(`"${c}"`):$(c)?c:br(c,this._locale,this._locales)(o,t==null?void 0:t.formats)}date(e,o){return ne(this._locales||this._locale,e,o)}number(e,o){return oe(this._locales||this._locale,e,o)}};function mr(r={}){return new ae(r)}var E=mr();var b=function(r,e,o,t){if(o==="a"&&!t)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!t:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return o==="m"?t:o==="a"?t.call(r):t?t.value:e.get(r)},
|
|
10
|
+
`)),$(c)&&Ce.test(c)?JSON.parse(`"${c}"`):$(c)?c:br(c,this._locale,this._locales)(o,t==null?void 0:t.formats)}date(e,o){return ne(this._locales||this._locale,e,o)}number(e,o){return oe(this._locales||this._locale,e,o)}};function mr(r={}){return new ae(r)}var E=mr();var b=function(r,e,o,t){if(o==="a"&&!t)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!t:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return o==="m"?t:o==="a"?t.call(r):t?t.value:e.get(r)},p=function(r,e,o,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 e=="function"?r!==e||!a:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t==="a"?a.call(r,o):a?a.value=o:e.set(r,o),o};function Me(r){var e,o,t,a,s,i,n,c,h,v,C,F,k,A,T,x,S,Y,W;class He extends r{constructor(...l){var d,u,g;super(...l),e.add(this),this.internals=this.attachInternals(),o.set(this,!1),t.set(this,!1),a.set(this,!1),s.set(this,void 0),i.set(this,void 0),n.set(this,!0),h.set(this,""),v.set(this,()=>{p(this,a,!0,"f"),p(this,o,!0,"f"),b(this,e,"m",x).call(this)}),C.set(this,()=>{p(this,o,!1,"f"),b(this,e,"m",S).call(this,this.shouldFormValueUpdate()?b(this,h,"f"):""),!this.validity.valid&&b(this,a,"f")&&p(this,t,!0,"f");let L=b(this,e,"m",x).call(this);this.validationMessageCallback&&this.validationMessageCallback(L?this.internals.validationMessage:"")}),F.set(this,()=>{var L;b(this,n,"f")&&this.validationTarget&&(this.internals.setValidity(this.validity,this.validationMessage,this.validationTarget),p(this,n,!1,"f")),p(this,a,!0,"f"),p(this,t,!0,"f"),b(this,e,"m",x).call(this),(L=this===null||this===void 0?void 0:this.validationMessageCallback)===null||L===void 0||L.call(this,this.showError?this.internals.validationMessage:"")}),k.set(this,void 0),A.set(this,!1),T.set(this,Promise.resolve()),(d=this.addEventListener)===null||d===void 0||d.call(this,"focus",b(this,v,"f")),(u=this.addEventListener)===null||u===void 0||u.call(this,"blur",b(this,C,"f")),(g=this.addEventListener)===null||g===void 0||g.call(this,"invalid",b(this,F,"f")),this.setValue(null)}static get formAssociated(){return!0}static get validators(){return this.formControlValidators||[]}static get observedAttributes(){let l=this.validators.map(g=>g.attribute).flat(),d=super.observedAttributes||[];return[...new Set([...d,...l])]}static getValidator(l){return this.validators.find(d=>d.attribute===l)||null}static getValidators(l){return this.validators.filter(d=>{var u;if(d.attribute===l||!((u=d.attribute)===null||u===void 0)&&u.includes(l))return!0})}get form(){return this.internals.form}get showError(){return b(this,e,"m",x).call(this)}checkValidity(){return this.internals.checkValidity()}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}attributeChangedCallback(l,d,u){var g;(g=super.attributeChangedCallback)===null||g===void 0||g.call(this,l,d,u);let R=this.constructor.getValidators(l);R!=null&&R.length&&this.validationTarget&&this.setValue(b(this,h,"f"))}setValue(l){var d;p(this,t,!1,"f"),(d=this.validationMessageCallback)===null||d===void 0||d.call(this,""),p(this,h,l,"f");let g=this.shouldFormValueUpdate()?l:null;this.internals.setFormValue(g),b(this,e,"m",S).call(this,g),this.valueChangedCallback&&this.valueChangedCallback(g),b(this,e,"m",x).call(this)}shouldFormValueUpdate(){return!0}get validationComplete(){return new Promise(l=>l(b(this,T,"f")))}formResetCallback(){var l,d;p(this,a,!1,"f"),p(this,t,!1,"f"),b(this,e,"m",x).call(this),(l=this.resetFormControl)===null||l===void 0||l.call(this),(d=this.validationMessageCallback)===null||d===void 0||d.call(this,b(this,e,"m",x).call(this)?this.validationMessage:"")}}return o=new WeakMap,t=new WeakMap,a=new WeakMap,s=new WeakMap,i=new WeakMap,n=new WeakMap,h=new WeakMap,v=new WeakMap,C=new WeakMap,F=new WeakMap,k=new WeakMap,A=new WeakMap,T=new WeakMap,e=new WeakSet,c=function(){let l=this.getRootNode(),d=`${this.localName}[name="${this.getAttribute("name")}"]`;return l.querySelectorAll(d)},x=function(){if(this.hasAttribute("disabled"))return!1;let l=b(this,t,"f")||b(this,a,"f")&&!this.validity.valid&&!b(this,o,"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 d=this.constructor,u={},g=d.validators,L=[],R=g.some(y=>y.isValid instanceof Promise);b(this,A,"f")||(p(this,T,new Promise(y=>{p(this,k,y,"f")}),"f"),p(this,A,!0,"f")),b(this,s,"f")&&(b(this,s,"f").abort(),p(this,i,b(this,s,"f"),"f"));let B=new AbortController;p(this,s,B,"f");let H,be=!1;g.length&&(g.forEach(y=>{let Q=y.key||"customError",V=y.isValid(this,l,B.signal);V instanceof Promise?(L.push(V),V.then(ee=>{ee!=null&&(u[Q]=!ee,H=b(this,e,"m",W).call(this,y,l),b(this,e,"m",Y).call(this,u,H))})):(u[Q]=!V,this.validity[Q]!==!V&&(be=!0),!V&&!H&&(H=b(this,e,"m",W).call(this,y,l)))}),Promise.allSettled(L).then(()=>{var y;B!=null&&B.signal.aborted||(p(this,A,!1,"f"),(y=b(this,k,"f"))===null||y===void 0||y.call(this))}),(be||!R)&&b(this,e,"m",Y).call(this,u,H))},Y=function(l,d){if(this.validationTarget)this.internals.setValidity(l,d,this.validationTarget),p(this,n,!1,"f");else{if(this.internals.setValidity(l,d),this.internals.validity.valid)return;p(this,n,!0,"f")}},W=function(l,d){if(this.validityCallback){let u=this.validityCallback(l.key||"customError");if(u)return u}return l.message instanceof Function?l.message(this,d):l.message},He}import{property as z}from"lit/decorators.js";import{ifDefined as le}from"lit/directives/if-defined.js";import{when as ce}from"lit/directives/when.js";var fr=["en","nb","fi","da","sv"],Fe="en",Ee=r=>fr.find(e=>r===e||r.toLowerCase().includes(e))||Fe;function wr(){if(typeof window=="undefined"){let r=process.env.NMP_LANGUAGE||Intl.DateTimeFormat().resolvedOptions().locale;return Ee(r)}try{let r=document.documentElement.lang;return Ee(r)}catch(r){return console.warn("could not detect locale, falling back to source locale",r),Fe}}var xr=(r,e,o,t,a,s)=>r==="nb"?o:r==="fi"?t:r==="da"?a:r==="sv"?s:e,Le=(r,e,o,t,a)=>{let s=wr(),i=xr(s,r,e,o,t,a);E.load(s,i),E.activate(s)};import{css as Oe}from"lit";var Ne=Oe`
|
|
11
11
|
*,
|
|
12
12
|
:before,
|
|
13
13
|
:after {
|
|
@@ -2477,5 +2477,5 @@ Please compile your catalog first.
|
|
|
2477
2477
|
select:has(option[value=""]):not(:has(option[selected])) {
|
|
2478
2478
|
color: var(--w-s-color-text-placeholder);
|
|
2479
2479
|
}
|
|
2480
|
-
`],_([z({attribute:"auto-focus",type:Boolean,reflect:!0})],w.prototype,"autoFocus",2),_([z({type:Boolean,reflect:!0})],w.prototype,"invalid",2),_([z({type:Boolean,reflect:!0})],w.prototype,"always",2),_([z({reflect:!0})],w.prototype,"hint",2),_([z({reflect:!0})],w.prototype,"label",2),_([z({type:Boolean,reflect:!0})],w.prototype,"optional",2),_([z({type:Boolean,reflect:!0})],w.prototype,"disabled",2),_([z({attribute:"read-only",type:Boolean,reflect:!0})],w.prototype,"readOnly",2),_([z({attribute:!1,state:!0})],w.prototype,"_options",2),_([z({reflect:!0})],w.prototype,"name",2),_([z({reflect:!0})],w.prototype,"value",2);customElements.get("w-select")||customElements.define("w-select",w);export{w as WarpSelect
|
|
2480
|
+
`],_([z({attribute:"auto-focus",type:Boolean,reflect:!0})],w.prototype,"autoFocus",2),_([z({type:Boolean,reflect:!0})],w.prototype,"invalid",2),_([z({type:Boolean,reflect:!0})],w.prototype,"always",2),_([z({reflect:!0})],w.prototype,"hint",2),_([z({reflect:!0})],w.prototype,"label",2),_([z({type:Boolean,reflect:!0})],w.prototype,"optional",2),_([z({type:Boolean,reflect:!0})],w.prototype,"disabled",2),_([z({attribute:"read-only",type:Boolean,reflect:!0})],w.prototype,"readOnly",2),_([z({attribute:!1,state:!0})],w.prototype,"_options",2),_([z({reflect:!0})],w.prototype,"name",2),_([z({reflect:!0})],w.prototype,"value",2);customElements.get("w-select")||customElements.define("w-select",w);export{w as WarpSelect};
|
|
2481
2481
|
//# sourceMappingURL=index.js.map
|