@nuralyui/label 0.0.14 → 0.0.16
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/bundle.js +1 -158
- package/package.json +1 -1
package/bundle.js
CHANGED
|
@@ -1,158 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2019 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/
|
|
6
|
-
const t=window,i=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s=Symbol(),e=new WeakMap;class o{constructor(t,i,e){if(this._$cssResult$=!0,e!==s)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=i}get styleSheet(){let t=this.o;const s=this.t;if(i&&void 0===t){const i=void 0!==s&&1===s.length;i&&(t=e.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&e.set(s,t))}return t}toString(){return this.cssText}}const n=(t,...i)=>{const e=1===t.length?t[0]:i.reduce(((i,s,e)=>i+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[e+1]),t[0]);return new o(e,t,s)},l=i?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let i="";for(const s of t.cssRules)i+=s.cssText;return(t=>new o("string"==typeof t?t:t+"",void 0,s))(i)})(t):t
|
|
7
|
-
/**
|
|
8
|
-
* @license
|
|
9
|
-
* Copyright 2017 Google LLC
|
|
10
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
|
-
*/;var r;const a=window,h=a.trustedTypes,c=h?h.emptyScript:"",u=a.reactiveElementPolyfillSupport,d={toAttribute(t,i){switch(i){case Boolean:t=t?c:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,i){let s=t;switch(i){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch(t){s=null}}return s}},v=(t,i)=>i!==t&&(i==i||t==t),f={attribute:!0,type:String,converter:d,reflect:!1,hasChanged:v},y="finalized";class p extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(t){var i;this.finalize(),(null!==(i=this.h)&&void 0!==i?i:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((i,s)=>{const e=this._$Ep(s,i);void 0!==e&&(this._$Ev.set(e,s),t.push(e))})),t}static createProperty(t,i=f){if(i.state&&(i.attribute=!1),this.finalize(),this.elementProperties.set(t,i),!i.noAccessor&&!this.prototype.hasOwnProperty(t)){const s="symbol"==typeof t?Symbol():"__"+t,e=this.getPropertyDescriptor(t,s,i);void 0!==e&&Object.defineProperty(this.prototype,t,e)}}static getPropertyDescriptor(t,i,s){return{get(){return this[i]},set(e){const o=this[t];this[i]=e,this.requestUpdate(t,o,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||f}static finalize(){if(this.hasOwnProperty(y))return!1;this[y]=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,i=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const s of i)this.createProperty(s,t[s])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const i=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const t of s)i.unshift(l(t))}else void 0!==t&&i.push(l(t));return i}static _$Ep(t,i){const s=i.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}_$Eu(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var i,s;(null!==(i=this._$ES)&&void 0!==i?i:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(s=t.hostConnected)||void 0===s||s.call(t))}removeController(t){var i;null===(i=this._$ES)||void 0===i||i.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,i)=>{this.hasOwnProperty(i)&&(this._$Ei.set(i,this[i]),delete this[i])}))}createRenderRoot(){var s;const e=null!==(s=this.shadowRoot)&&void 0!==s?s:this.attachShadow(this.constructor.shadowRootOptions);return((s,e)=>{i?s.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((i=>{const e=document.createElement("style"),o=t.litNonce;void 0!==o&&e.setAttribute("nonce",o),e.textContent=i.cssText,s.appendChild(e)}))})(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostConnected)||void 0===i?void 0:i.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostDisconnected)||void 0===i?void 0:i.call(t)}))}attributeChangedCallback(t,i,s){this._$AK(t,s)}_$EO(t,i,s=f){var e;const o=this.constructor._$Ep(t,s);if(void 0!==o&&!0===s.reflect){const n=(void 0!==(null===(e=s.converter)||void 0===e?void 0:e.toAttribute)?s.converter:d).toAttribute(i,s.type);this._$El=t,null==n?this.removeAttribute(o):this.setAttribute(o,n),this._$El=null}}_$AK(t,i){var s;const e=this.constructor,o=e._$Ev.get(t);if(void 0!==o&&this._$El!==o){const t=e.getPropertyOptions(o),n="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(s=t.converter)||void 0===s?void 0:s.fromAttribute)?t.converter:d;this._$El=o,this[o]=n.fromAttribute(i,t.type),this._$El=null}}requestUpdate(t,i,s){let e=!0;void 0!==t&&(((s=s||this.constructor.getPropertyOptions(t)).hasChanged||v)(this[t],i)?(this._$AL.has(t)||this._$AL.set(t,i),!0===s.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,s))):e=!1),!this.isUpdatePending&&e&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,i)=>this[i]=t)),this._$Ei=void 0);let i=!1;const s=this._$AL;try{i=this.shouldUpdate(s),i?(this.willUpdate(s),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostUpdate)||void 0===i?void 0:i.call(t)})),this.update(s)):this._$Ek()}catch(t){throw i=!1,this._$Ek(),t}i&&this._$AE(s)}willUpdate(t){}_$AE(t){var i;null===(i=this._$ES)||void 0===i||i.forEach((t=>{var i;return null===(i=t.hostUpdated)||void 0===i?void 0:i.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,i)=>this._$EO(i,this[i],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}
|
|
12
|
-
/**
|
|
13
|
-
* @license
|
|
14
|
-
* Copyright 2017 Google LLC
|
|
15
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
16
|
-
*/
|
|
17
|
-
var b;p[y]=!0,p.elementProperties=new Map,p.elementStyles=[],p.shadowRootOptions={mode:"open"},null==u||u({ReactiveElement:p}),(null!==(r=a.reactiveElementVersions)&&void 0!==r?r:a.reactiveElementVersions=[]).push("1.6.3");const g=window,m=g.trustedTypes,w=m?m.createPolicy("lit-html",{createHTML:t=>t}):void 0,$="$lit$",S=`lit$${(Math.random()+"").slice(9)}$`,A="?"+S,x=`<${A}>`,E=document,_=()=>E.createComment(""),C=t=>null===t||"object"!=typeof t&&"function"!=typeof t,k=Array.isArray,z="[ \t\n\f\r]",T=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,j=/-->/g,O=/>/g,U=RegExp(`>|${z}(?:([^\\s"'>=/]+)(${z}*=${z}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),M=/'/g,R=/"/g,q=/^(?:script|style|textarea|title)$/i,N=Symbol.for("lit-noChange"),D=Symbol.for("lit-nothing"),I=new WeakMap,P=E.createTreeWalker(E,129,null,!1);function L(t,i){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==w?w.createHTML(i):i}class K{constructor({strings:t,_$litType$:i},s){let e;this.parts=[];let o=0,n=0;const l=t.length-1,r=this.parts,[a,h]=((t,i)=>{const s=t.length-1,e=[];let o,n=2===i?"<svg>":"",l=T;for(let i=0;i<s;i++){const s=t[i];let r,a,h=-1,c=0;for(;c<s.length&&(l.lastIndex=c,a=l.exec(s),null!==a);)c=l.lastIndex,l===T?"!--"===a[1]?l=j:void 0!==a[1]?l=O:void 0!==a[2]?(q.test(a[2])&&(o=RegExp("</"+a[2],"g")),l=U):void 0!==a[3]&&(l=U):l===U?">"===a[0]?(l=null!=o?o:T,h=-1):void 0===a[1]?h=-2:(h=l.lastIndex-a[2].length,r=a[1],l=void 0===a[3]?U:'"'===a[3]?R:M):l===R||l===M?l=U:l===j||l===O?l=T:(l=U,o=void 0);const u=l===U&&t[i+1].startsWith("/>")?" ":"";n+=l===T?s+x:h>=0?(e.push(r),s.slice(0,h)+$+s.slice(h)+S+u):s+S+(-2===h?(e.push(void 0),i):u)}return[L(t,n+(t[s]||"<?>")+(2===i?"</svg>":"")),e]})(t,i);if(this.el=K.createElement(a,s),P.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(e=P.nextNode())&&r.length<l;){if(1===e.nodeType){if(e.hasAttributes()){const t=[];for(const i of e.getAttributeNames())if(i.endsWith($)||i.startsWith(S)){const s=h[n++];if(t.push(i),void 0!==s){const t=e.getAttribute(s.toLowerCase()+$).split(S),i=/([.?@])?(.*)/.exec(s);r.push({type:1,index:o,name:i[2],strings:t,ctor:"."===i[1]?W:"?"===i[1]?J:"@"===i[1]?G:H})}else r.push({type:6,index:o})}for(const i of t)e.removeAttribute(i)}if(q.test(e.tagName)){const t=e.textContent.split(S),i=t.length-1;if(i>0){e.textContent=m?m.emptyScript:"";for(let s=0;s<i;s++)e.append(t[s],_()),P.nextNode(),r.push({type:2,index:++o});e.append(t[i],_())}}}else if(8===e.nodeType)if(e.data===A)r.push({type:2,index:o});else{let t=-1;for(;-1!==(t=e.data.indexOf(S,t+1));)r.push({type:7,index:o}),t+=S.length-1}o++}}static createElement(t,i){const s=E.createElement("template");return s.innerHTML=t,s}}function V(t,i,s=t,e){var o,n,l,r;if(i===N)return i;let a=void 0!==e?null===(o=s._$Co)||void 0===o?void 0:o[e]:s._$Cl;const h=C(i)?void 0:i._$litDirective$;return(null==a?void 0:a.constructor)!==h&&(null===(n=null==a?void 0:a._$AO)||void 0===n||n.call(a,!1),void 0===h?a=void 0:(a=new h(t),a._$AT(t,s,e)),void 0!==e?(null!==(l=(r=s)._$Co)&&void 0!==l?l:r._$Co=[])[e]=a:s._$Cl=a),void 0!==a&&(i=V(t,a._$AS(t,i.values),a,e)),i}class B{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var i;const{el:{content:s},parts:e}=this._$AD,o=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:E).importNode(s,!0);P.currentNode=o;let n=P.nextNode(),l=0,r=0,a=e[0];for(;void 0!==a;){if(l===a.index){let i;2===a.type?i=new F(n,n.nextSibling,this,t):1===a.type?i=new a.ctor(n,a.name,a.strings,this,t):6===a.type&&(i=new Q(n,this,t)),this._$AV.push(i),a=e[++r]}l!==(null==a?void 0:a.index)&&(n=P.nextNode(),l++)}return P.currentNode=E,o}v(t){let i=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++}}class F{constructor(t,i,s,e){var o;this.type=2,this._$AH=D,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cp=null===(o=null==e?void 0:e.isConnected)||void 0===o||o}get _$AU(){var t,i;return null!==(i=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==i?i:this._$Cp}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===(null==t?void 0:t.nodeType)&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=V(this,t,i),C(t)?t===D||null==t||""===t?(this._$AH!==D&&this._$AR(),this._$AH=D):t!==this._$AH&&t!==N&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):(t=>k(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==D&&C(this._$AH)?this._$AA.nextSibling.data=t:this.$(E.createTextNode(t)),this._$AH=t}g(t){var i;const{values:s,_$litType$:e}=t,o="number"==typeof e?this._$AC(t):(void 0===e.el&&(e.el=K.createElement(L(e.h,e.h[0]),this.options)),e);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===o)this._$AH.v(s);else{const t=new B(o,this),i=t.u(this.options);t.v(s),this.$(i),this._$AH=t}}_$AC(t){let i=I.get(t.strings);return void 0===i&&I.set(t.strings,i=new K(t)),i}T(t){k(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const o of t)e===i.length?i.push(s=new F(this.k(_()),this.k(_()),this,this.options)):s=i[e],s._$AI(o),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e)}_$AR(t=this._$AA.nextSibling,i){var s;for(null===(s=this._$AP)||void 0===s||s.call(this,!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var i;void 0===this._$AM&&(this._$Cp=t,null===(i=this._$AP)||void 0===i||i.call(this,t))}}class H{constructor(t,i,s,e,o){this.type=1,this._$AH=D,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=o,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=D}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,s,e){const o=this.strings;let n=!1;if(void 0===o)t=V(this,t,i,0),n=!C(t)||t!==this._$AH&&t!==N,n&&(this._$AH=t);else{const e=t;let l,r;for(t=o[0],l=0;l<o.length-1;l++)r=V(this,e[s+l],i,l),r===N&&(r=this._$AH[l]),n||(n=!C(r)||r!==this._$AH[l]),r===D?t=D:t!==D&&(t+=(null!=r?r:"")+o[l+1]),this._$AH[l]=r}n&&!e&&this.j(t)}j(t){t===D?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class W extends H{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===D?void 0:t}}const Z=m?m.emptyScript:"";class J extends H{constructor(){super(...arguments),this.type=4}j(t){t&&t!==D?this.element.setAttribute(this.name,Z):this.element.removeAttribute(this.name)}}class G extends H{constructor(t,i,s,e,o){super(t,i,s,e,o),this.type=5}_$AI(t,i=this){var s;if((t=null!==(s=V(this,t,i,0))&&void 0!==s?s:D)===N)return;const e=this._$AH,o=t===D&&e!==D||t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive,n=t!==D&&(e===D||o);o&&this.element.removeEventListener(this.name,this,e),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var i,s;"function"==typeof this._$AH?this._$AH.call(null!==(s=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==s?s:this.element,t):this._$AH.handleEvent(t)}}class Q{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){V(this,t)}}const X=g.litHtmlPolyfillSupport;
|
|
18
|
-
/**
|
|
19
|
-
* @license
|
|
20
|
-
* Copyright 2017 Google LLC
|
|
21
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
22
|
-
*/
|
|
23
|
-
var Y;null==X||X(K,F),(null!==(b=g.litHtmlVersions)&&void 0!==b?b:g.litHtmlVersions=[]).push("2.8.0");const tt=window,it=tt.trustedTypes,st=it?it.createPolicy("lit-html",{createHTML:t=>t}):void 0,et="$lit$",ot=`lit$${(Math.random()+"").slice(9)}$`,nt="?"+ot,lt=`<${nt}>`,rt=document,at=()=>rt.createComment(""),ht=t=>null===t||"object"!=typeof t&&"function"!=typeof t,ct=Array.isArray,ut="[ \t\n\f\r]",dt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,vt=/-->/g,ft=/>/g,yt=RegExp(`>|${ut}(?:([^\\s"'>=/]+)(${ut}*=${ut}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),pt=/'/g,bt=/"/g,gt=/^(?:script|style|textarea|title)$/i,mt=(t=>(i,...s)=>({_$litType$:t,strings:i,values:s}))(1),wt=Symbol.for("lit-noChange"),$t=Symbol.for("lit-nothing"),St=new WeakMap,At=rt.createTreeWalker(rt,129,null,!1);function xt(t,i){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==st?st.createHTML(i):i}const Et=(t,i)=>{const s=t.length-1,e=[];let o,n=2===i?"<svg>":"",l=dt;for(let i=0;i<s;i++){const s=t[i];let r,a,h=-1,c=0;for(;c<s.length&&(l.lastIndex=c,a=l.exec(s),null!==a);)c=l.lastIndex,l===dt?"!--"===a[1]?l=vt:void 0!==a[1]?l=ft:void 0!==a[2]?(gt.test(a[2])&&(o=RegExp("</"+a[2],"g")),l=yt):void 0!==a[3]&&(l=yt):l===yt?">"===a[0]?(l=null!=o?o:dt,h=-1):void 0===a[1]?h=-2:(h=l.lastIndex-a[2].length,r=a[1],l=void 0===a[3]?yt:'"'===a[3]?bt:pt):l===bt||l===pt?l=yt:l===vt||l===ft?l=dt:(l=yt,o=void 0);const u=l===yt&&t[i+1].startsWith("/>")?" ":"";n+=l===dt?s+lt:h>=0?(e.push(r),s.slice(0,h)+et+s.slice(h)+ot+u):s+ot+(-2===h?(e.push(void 0),i):u)}return[xt(t,n+(t[s]||"<?>")+(2===i?"</svg>":"")),e]};class _t{constructor({strings:t,_$litType$:i},s){let e;this.parts=[];let o=0,n=0;const l=t.length-1,r=this.parts,[a,h]=Et(t,i);if(this.el=_t.createElement(a,s),At.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(e=At.nextNode())&&r.length<l;){if(1===e.nodeType){if(e.hasAttributes()){const t=[];for(const i of e.getAttributeNames())if(i.endsWith(et)||i.startsWith(ot)){const s=h[n++];if(t.push(i),void 0!==s){const t=e.getAttribute(s.toLowerCase()+et).split(ot),i=/([.?@])?(.*)/.exec(s);r.push({type:1,index:o,name:i[2],strings:t,ctor:"."===i[1]?jt:"?"===i[1]?Ut:"@"===i[1]?Mt:Tt})}else r.push({type:6,index:o})}for(const i of t)e.removeAttribute(i)}if(gt.test(e.tagName)){const t=e.textContent.split(ot),i=t.length-1;if(i>0){e.textContent=it?it.emptyScript:"";for(let s=0;s<i;s++)e.append(t[s],at()),At.nextNode(),r.push({type:2,index:++o});e.append(t[i],at())}}}else if(8===e.nodeType)if(e.data===nt)r.push({type:2,index:o});else{let t=-1;for(;-1!==(t=e.data.indexOf(ot,t+1));)r.push({type:7,index:o}),t+=ot.length-1}o++}}static createElement(t,i){const s=rt.createElement("template");return s.innerHTML=t,s}}function Ct(t,i,s=t,e){var o,n,l,r;if(i===wt)return i;let a=void 0!==e?null===(o=s._$Co)||void 0===o?void 0:o[e]:s._$Cl;const h=ht(i)?void 0:i._$litDirective$;return(null==a?void 0:a.constructor)!==h&&(null===(n=null==a?void 0:a._$AO)||void 0===n||n.call(a,!1),void 0===h?a=void 0:(a=new h(t),a._$AT(t,s,e)),void 0!==e?(null!==(l=(r=s)._$Co)&&void 0!==l?l:r._$Co=[])[e]=a:s._$Cl=a),void 0!==a&&(i=Ct(t,a._$AS(t,i.values),a,e)),i}class kt{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var i;const{el:{content:s},parts:e}=this._$AD,o=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:rt).importNode(s,!0);At.currentNode=o;let n=At.nextNode(),l=0,r=0,a=e[0];for(;void 0!==a;){if(l===a.index){let i;2===a.type?i=new zt(n,n.nextSibling,this,t):1===a.type?i=new a.ctor(n,a.name,a.strings,this,t):6===a.type&&(i=new Rt(n,this,t)),this._$AV.push(i),a=e[++r]}l!==(null==a?void 0:a.index)&&(n=At.nextNode(),l++)}return At.currentNode=rt,o}v(t){let i=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++}}class zt{constructor(t,i,s,e){var o;this.type=2,this._$AH=$t,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cp=null===(o=null==e?void 0:e.isConnected)||void 0===o||o}get _$AU(){var t,i;return null!==(i=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==i?i:this._$Cp}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===(null==t?void 0:t.nodeType)&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=Ct(this,t,i),ht(t)?t===$t||null==t||""===t?(this._$AH!==$t&&this._$AR(),this._$AH=$t):t!==this._$AH&&t!==wt&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):(t=>ct(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==$t&&ht(this._$AH)?this._$AA.nextSibling.data=t:this.$(rt.createTextNode(t)),this._$AH=t}g(t){var i;const{values:s,_$litType$:e}=t,o="number"==typeof e?this._$AC(t):(void 0===e.el&&(e.el=_t.createElement(xt(e.h,e.h[0]),this.options)),e);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===o)this._$AH.v(s);else{const t=new kt(o,this),i=t.u(this.options);t.v(s),this.$(i),this._$AH=t}}_$AC(t){let i=St.get(t.strings);return void 0===i&&St.set(t.strings,i=new _t(t)),i}T(t){ct(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const o of t)e===i.length?i.push(s=new zt(this.k(at()),this.k(at()),this,this.options)):s=i[e],s._$AI(o),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e)}_$AR(t=this._$AA.nextSibling,i){var s;for(null===(s=this._$AP)||void 0===s||s.call(this,!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var i;void 0===this._$AM&&(this._$Cp=t,null===(i=this._$AP)||void 0===i||i.call(this,t))}}class Tt{constructor(t,i,s,e,o){this.type=1,this._$AH=$t,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=o,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=$t}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,s,e){const o=this.strings;let n=!1;if(void 0===o)t=Ct(this,t,i,0),n=!ht(t)||t!==this._$AH&&t!==wt,n&&(this._$AH=t);else{const e=t;let l,r;for(t=o[0],l=0;l<o.length-1;l++)r=Ct(this,e[s+l],i,l),r===wt&&(r=this._$AH[l]),n||(n=!ht(r)||r!==this._$AH[l]),r===$t?t=$t:t!==$t&&(t+=(null!=r?r:"")+o[l+1]),this._$AH[l]=r}n&&!e&&this.j(t)}j(t){t===$t?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class jt extends Tt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===$t?void 0:t}}const Ot=it?it.emptyScript:"";class Ut extends Tt{constructor(){super(...arguments),this.type=4}j(t){t&&t!==$t?this.element.setAttribute(this.name,Ot):this.element.removeAttribute(this.name)}}class Mt extends Tt{constructor(t,i,s,e,o){super(t,i,s,e,o),this.type=5}_$AI(t,i=this){var s;if((t=null!==(s=Ct(this,t,i,0))&&void 0!==s?s:$t)===wt)return;const e=this._$AH,o=t===$t&&e!==$t||t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive,n=t!==$t&&(e===$t||o);o&&this.element.removeEventListener(this.name,this,e),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var i,s;"function"==typeof this._$AH?this._$AH.call(null!==(s=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==s?s:this.element,t):this._$AH.handleEvent(t)}}class Rt{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){Ct(this,t)}}const qt=tt.litHtmlPolyfillSupport;null==qt||qt(_t,zt),(null!==(Y=tt.litHtmlVersions)&&void 0!==Y?Y:tt.litHtmlVersions=[]).push("2.8.0");
|
|
24
|
-
/**
|
|
25
|
-
* @license
|
|
26
|
-
* Copyright 2017 Google LLC
|
|
27
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
28
|
-
*/
|
|
29
|
-
var Nt,Dt;class It extends p{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,i;const s=super.createRenderRoot();return null!==(t=(i=this.renderOptions).renderBefore)&&void 0!==t||(i.renderBefore=s.firstChild),s}update(t){const i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,i,s)=>{var e,o;const n=null!==(e=null==s?void 0:s.renderBefore)&&void 0!==e?e:i;let l=n._$litPart$;if(void 0===l){const t=null!==(o=null==s?void 0:s.renderBefore)&&void 0!==o?o:null;n._$litPart$=l=new zt(i.insertBefore(at(),t),t,void 0,null!=s?s:{})}return l._$AI(t),l})(i,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return wt}}It.finalized=!0,It._$litElement$=!0,null===(Nt=globalThis.litElementHydrateSupport)||void 0===Nt||Nt.call(globalThis,{LitElement:It});const Pt=globalThis.litElementPolyfillSupport;null==Pt||Pt({LitElement:It}),(null!==(Dt=globalThis.litElementVersions)&&void 0!==Dt?Dt:globalThis.litElementVersions=[]).push("3.3.3");
|
|
30
|
-
/**
|
|
31
|
-
* @license
|
|
32
|
-
* Copyright 2017 Google LLC
|
|
33
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
34
|
-
*/
|
|
35
|
-
const Lt=(t,i)=>"method"===i.kind&&i.descriptor&&!("value"in i.descriptor)?{...i,finisher(s){s.createProperty(i.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:i.key,initializer(){"function"==typeof i.initializer&&(this[i.key]=i.initializer.call(this))},finisher(s){s.createProperty(i.key,t)}};
|
|
36
|
-
/**
|
|
37
|
-
* @license
|
|
38
|
-
* Copyright 2017 Google LLC
|
|
39
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
40
|
-
*/function Kt(t){return(i,s)=>void 0!==s?((t,i,s)=>{i.constructor.createProperty(s,t)})(t,i,s):Lt(t,i)
|
|
41
|
-
/**
|
|
42
|
-
* @license
|
|
43
|
-
* Copyright 2021 Google LLC
|
|
44
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
45
|
-
*/}var Vt;null===(Vt=window.HTMLSlotElement)||void 0===Vt||Vt.prototype.assignedElements;var Bt=n`
|
|
46
|
-
${n`
|
|
47
|
-
:host {
|
|
48
|
-
/* Typography */
|
|
49
|
-
--nuraly-label-local-font-family: var(--nuraly-typograpnr-label-font-family, var(--nuraly-font-family-base, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif));
|
|
50
|
-
--nuraly-label-local-font-weight: var(--nuraly-typograpnr-label-font-weight, var(--nuraly-font-weight-medium, 500));
|
|
51
|
-
--nuraly-label-local-line-height: var(--nuraly-typograpnr-label-line-height, var(--nuraly-line-height-base, 1.5));
|
|
52
|
-
|
|
53
|
-
/* Size variants */
|
|
54
|
-
--nuraly-label-local-small-font-size: var(--nuraly-typograpnr-label-small-font-size, var(--nuraly-font-size-xs, 12px));
|
|
55
|
-
--nuraly-label-local-medium-font-size: var(--nuraly-typograpnr-label-medium-font-size, var(--nuraly-font-size-sm, 14px));
|
|
56
|
-
--nuraly-label-local-large-font-size: var(--nuraly-typograpnr-label-large-font-size, var(--nuraly-font-size-base, 16px));
|
|
57
|
-
|
|
58
|
-
/* Default font size */
|
|
59
|
-
--nuraly-label-local-font-size: var(--nuraly-label-local-medium-font-size);
|
|
60
|
-
|
|
61
|
-
/* Colors */
|
|
62
|
-
--nuraly-label-local-text-color: var(--nuraly-color-label-text, var(--nuraly-color-text-primary, #000000));
|
|
63
|
-
--nuraly-label-local-secondary-color: var(--nuraly-color-label-secondary, var(--nuraly-color-text-secondary, #666666));
|
|
64
|
-
--nuraly-label-local-error-color: var(--nuraly-color-label-error, var(--nuraly-color-error-500, #ff4d4f));
|
|
65
|
-
--nuraly-label-local-warning-color: var(--nuraly-color-label-warning, var(--nuraly-color-warning-500, #faad14));
|
|
66
|
-
--nuraly-label-local-success-color: var(--nuraly-color-label-success, var(--nuraly-color-success-500, #52c41a));
|
|
67
|
-
--nuraly-label-local-required-color: var(--nuraly-color-label-required, var(--nuraly-color-error-500, #ff4d4f));
|
|
68
|
-
--nuraly-label-local-disabled-color: var(--nuraly-color-label-disabled, var(--nuraly-color-text-disabled, #bfbfbf));
|
|
69
|
-
|
|
70
|
-
/* Spacing */
|
|
71
|
-
--nuraly-label-local-margin-bottom: var(--nuraly-spacing-label-margin-bottom, var(--nuraly-spacing-xs, 4px));
|
|
72
|
-
--nuraly-label-local-required-margin: var(--nuraly-spacing-label-required-margin, var(--nuraly-spacing-2xs, 2px));
|
|
73
|
-
|
|
74
|
-
/* Transitions */
|
|
75
|
-
--nuraly-label-local-transition-duration: var(--nuraly-transition-label-duration, var(--nuraly-transition-duration-base, 150ms));
|
|
76
|
-
--nuraly-label-local-transition-timing: var(--nuraly-transition-label-timing, var(--nuraly-transition-timing-ease, ease));
|
|
77
|
-
}
|
|
78
|
-
`}
|
|
79
|
-
|
|
80
|
-
:host {
|
|
81
|
-
display: inline-block;
|
|
82
|
-
width: fit-content;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
label {
|
|
86
|
-
font-family: var(--nuraly-label-local-font-family);
|
|
87
|
-
font-size: var(--nuraly-label-local-font-size);
|
|
88
|
-
font-weight: var(--nuraly-label-local-font-weight);
|
|
89
|
-
line-height: var(--nuraly-label-local-line-height);
|
|
90
|
-
color: var(--nuraly-label-local-text-color);
|
|
91
|
-
margin: 0;
|
|
92
|
-
margin-bottom: var(--nuraly-label-local-margin-bottom);
|
|
93
|
-
display: block;
|
|
94
|
-
user-select: none;
|
|
95
|
-
cursor: pointer;
|
|
96
|
-
transition: color var(--nuraly-label-local-transition-duration) var(--nuraly-label-local-transition-timing);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
/* Size variants */
|
|
100
|
-
:host([size="small"]) label {
|
|
101
|
-
font-size: var(--nuraly-label-local-small-font-size);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
:host([size="large"]) label {
|
|
105
|
-
font-size: var(--nuraly-label-local-large-font-size);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/* Variant colors */
|
|
109
|
-
:host([variant="secondary"]) label {
|
|
110
|
-
color: var(--nuraly-label-local-secondary-color);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
:host([variant="error"]) label {
|
|
114
|
-
color: var(--nuraly-label-local-error-color);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
:host([variant="warning"]) label {
|
|
118
|
-
color: var(--nuraly-label-local-warning-color);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
:host([variant="success"]) label {
|
|
122
|
-
color: var(--nuraly-label-local-success-color);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
/* Disabled state */
|
|
126
|
-
:host([disabled]) label {
|
|
127
|
-
color: var(--nuraly-label-local-disabled-color);
|
|
128
|
-
cursor: not-allowed;
|
|
129
|
-
opacity: 0.6;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
/* Required asterisk */
|
|
133
|
-
.required-asterisk {
|
|
134
|
-
color: var(--nuraly-label-local-required-color);
|
|
135
|
-
margin-left: var(--nuraly-label-local-required-margin);
|
|
136
|
-
font-weight: normal;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
/* Focus-within for accessibility when label is associated with form elements */
|
|
140
|
-
:host(:focus-within) label:not([disabled]) {
|
|
141
|
-
opacity: 0.8;
|
|
142
|
-
}
|
|
143
|
-
`
|
|
144
|
-
/**
|
|
145
|
-
* @license
|
|
146
|
-
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
147
|
-
* SPDX-License-Identifier: MIT
|
|
148
|
-
*/;const Ft=t=>class extends t{constructor(){super(...arguments),this.handleSystemThemeChange=()=>{this.closest("[data-theme]")||document.documentElement.hasAttribute("data-theme")||this.requestUpdate()}}connectedCallback(){super.connectedCallback(),this.setupThemeObserver(),this.setupDesignSystemObserver(),this.setupSystemThemeListener()}disconnectedCallback(){var t,i,s;super.disconnectedCallback(),null===(t=this.themeObserver)||void 0===t||t.disconnect(),null===(i=this.designSystemObserver)||void 0===i||i.disconnect(),null===(s=this.mediaQuery)||void 0===s||s.removeEventListener("change",this.handleSystemThemeChange)}get currentTheme(){var t,i;const s=(null===(t=this.closest("[data-theme]"))||void 0===t?void 0:t.getAttribute("data-theme"))||document.documentElement.getAttribute("data-theme");return s||((null===(i=window.matchMedia)||void 0===i?void 0:i.call(window,"(prefers-color-scheme: dark)").matches)?"dark":"light")}get currentDesignSystem(){var t;const i=(null===(t=this.closest("[design-system]"))||void 0===t?void 0:t.getAttribute("design-system"))||document.documentElement.getAttribute("design-system");return"carbon"===i?i:"default"}setupThemeObserver(){this.themeObserver=new MutationObserver((()=>{this.requestUpdate()})),this.themeObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]})}setupDesignSystemObserver(){this.designSystemObserver=new MutationObserver((()=>{this.requestUpdate()})),this.designSystemObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["design-system"]})}setupSystemThemeListener(){window.matchMedia&&(this.mediaQuery=window.matchMedia("(prefers-color-scheme: dark)"),this.mediaQuery.addEventListener("change",this.handleSystemThemeChange))}},Ht=()=>{var t;return void 0!==globalThis.litElementVersions||"undefined"!=typeof process&&"development"===(null===(t=process.env)||void 0===t?void 0:t.NODE_ENV)||"undefined"!=typeof window&&("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname)},Wt=t=>class extends t{constructor(){super(...arguments),this.requiredComponents=[]}validateDependencies(){if(Ht())for(const t of this.requiredComponents)if(!this.isComponentAvailable(t))throw new Error(`Required component "${t}" is not registered. Please import and register the component before using ${this.tagName.toLowerCase()}. Example: import '@nuralyui/${t}';`)}validateDependenciesWithHandler(t){if(!Ht())return!0;let i=!0;for(const s of this.requiredComponents)if(!this.isComponentAvailable(s)){i=!1;const e=new Error(`Required component "${s}" is not registered. Please import and register the component before using ${this.tagName.toLowerCase()}.`);t?t(s,e):console.error(e.message)}return i}isComponentAvailable(t){return!!customElements.get(t)}getMissingDependencies(){return this.requiredComponents.filter((t=>!this.isComponentAvailable(t)))}areDependenciesAvailable(){return this.requiredComponents.every((t=>this.isComponentAvailable(t)))}addRequiredComponent(t){this.requiredComponents.includes(t)||this.requiredComponents.push(t)}removeRequiredComponent(t){const i=this.requiredComponents.indexOf(t);i>-1&&this.requiredComponents.splice(i,1)}},Zt=t=>class extends t{dispatchCustomEvent(t,i){this.dispatchEvent(new CustomEvent(t,{detail:i,bubbles:!0,composed:!0}))}dispatchEventWithMetadata(t,i){var s;const e=Object.assign(Object.assign({},i),{timestamp:Date.now(),componentName:(null===(s=this.tagName)||void 0===s?void 0:s.toLowerCase())||"unknown"});this.dispatchCustomEvent(t,e)}dispatchInputEvent(t,i){const s=Object.assign({target:i.target||this,value:i.value,originalEvent:i.originalEvent},i);this.dispatchCustomEvent(t,s)}dispatchFocusEvent(t,i){const s=Object.assign({target:i.target||this,value:i.value,focused:i.focused,cursorPosition:i.cursorPosition,selectedText:i.selectedText},i);this.dispatchCustomEvent(t,s)}dispatchValidationEvent(t,i){var s;const e=Object.assign({target:i.target||this,value:i.value,isValid:null!==(s=i.isValid)&&void 0!==s&&s,error:i.error},i);this.dispatchCustomEvent(t,e)}dispatchActionEvent(t,i){const s=Object.assign({target:i.target||this,action:i.action,previousValue:i.previousValue,newValue:i.newValue},i);this.dispatchCustomEvent(t,s)}isReadonlyKeyAllowed(t){if(t.ctrlKey||t.metaKey){return["KeyA","KeyC"].includes(t.code)}return["Tab","Escape","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(t.key)}isActivationKey(t){return"Enter"===t.key||" "===t.key}};
|
|
149
|
-
/**
|
|
150
|
-
* @license
|
|
151
|
-
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
152
|
-
* SPDX-License-Identifier: MIT
|
|
153
|
-
*/var Jt=function(t,i,s,e){for(var o,n=arguments.length,l=n<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,s):e,r=t.length-1;r>=0;r--)(o=t[r])&&(l=(n<3?o(l):n>3?o(i,s,l):o(i,s))||l);return n>3&&l&&Object.defineProperty(i,s,l),l};let Gt=class extends((t=>Wt(Ft(Zt(t))))(It)){constructor(){super(...arguments),this.size="medium",this.variant="default",this.required=!1,this.disabled=!1,this.value=""}connectedCallback(){super.connectedCallback(),this.updateDataTheme()}updated(){this.updateDataTheme()}updateDataTheme(){this.closest("[data-theme]")||this.setAttribute("data-theme",this.currentTheme)}render(){return mt`
|
|
154
|
-
<label for=${this.for||""}>
|
|
155
|
-
<slot></slot>
|
|
156
|
-
${this.required?mt`<span class="required-asterisk">*</span>`:""}
|
|
157
|
-
</label>
|
|
158
|
-
`}};Gt.styles=Bt,Jt([Kt({reflect:!0})],Gt.prototype,"size",void 0),Jt([Kt({reflect:!0})],Gt.prototype,"variant",void 0),Jt([Kt({type:Boolean,reflect:!0})],Gt.prototype,"required",void 0),Jt([Kt({type:Boolean,reflect:!0})],Gt.prototype,"disabled",void 0),Jt([Kt()],Gt.prototype,"for",void 0),Jt([Kt()],Gt.prototype,"value",void 0),Gt=Jt([(t=>i=>"function"==typeof i?((t,i)=>(customElements.define(t,i),i))(t,i):((t,i)=>{const{kind:s,elements:e}=i;return{kind:s,elements:e,finisher(i){customElements.define(t,i)}}})(t,i))("nr-label")],Gt);export{Gt as HyTextLabel};
|
|
1
|
+
import{css as l,LitElement as a,html as r}from"lit";import{property as o,customElement as e}from"lit/decorators.js";import{NuralyUIBaseMixin as n}from"@nuralyui/common/mixins";var t=l`${l`:host{--nuraly-label-local-font-family:var(--nuraly-typograpnr-label-font-family, var(--nuraly-font-family-base, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif));--nuraly-label-local-font-weight:var(--nuraly-typograpnr-label-font-weight, var(--nuraly-font-weight-medium, 500));--nuraly-label-local-line-height:var(--nuraly-typograpnr-label-line-height, var(--nuraly-line-height-base, 1.5));--nuraly-label-local-small-font-size:var(--nuraly-typograpnr-label-small-font-size, var(--nuraly-font-size-xs, 12px));--nuraly-label-local-medium-font-size:var(--nuraly-typograpnr-label-medium-font-size, var(--nuraly-font-size-sm, 14px));--nuraly-label-local-large-font-size:var(--nuraly-typograpnr-label-large-font-size, var(--nuraly-font-size-base, 16px));--nuraly-label-local-font-size:var(--nuraly-label-local-medium-font-size);--nuraly-label-local-text-color:var(--nuraly-color-label-text, var(--nuraly-color-text-primary, #000000));--nuraly-label-local-secondary-color:var(--nuraly-color-label-secondary, var(--nuraly-color-text-secondary, #666666));--nuraly-label-local-error-color:var(--nuraly-color-label-error, var(--nuraly-color-error-500, #ff4d4f));--nuraly-label-local-warning-color:var(--nuraly-color-label-warning, var(--nuraly-color-warning-500, #faad14));--nuraly-label-local-success-color:var(--nuraly-color-label-success, var(--nuraly-color-success-500, #52c41a));--nuraly-label-local-required-color:var(--nuraly-color-label-required, var(--nuraly-color-error-500, #ff4d4f));--nuraly-label-local-disabled-color:var(--nuraly-color-label-disabled, var(--nuraly-color-text-disabled, #bfbfbf));--nuraly-label-local-margin-bottom:var(--nuraly-spacing-label-margin-bottom, var(--nuraly-spacing-xs, 4px));--nuraly-label-local-required-margin:var(--nuraly-spacing-label-required-margin, var(--nuraly-spacing-2xs, 2px));--nuraly-label-local-transition-duration:var(--nuraly-transition-label-duration, var(--nuraly-transition-duration-base, 150ms));--nuraly-label-local-transition-timing:var(--nuraly-transition-label-timing, var(--nuraly-transition-timing-ease, ease))}`}:host{display:inline-block;width:fit-content}label{font-family:var(--nuraly-label-local-font-family);font-size:var(--nuraly-label-local-font-size);font-weight:var(--nuraly-label-local-font-weight);line-height:var(--nuraly-label-local-line-height);color:var(--nuraly-label-local-text-color);margin:0;margin-bottom:var(--nuraly-label-local-margin-bottom);display:block;user-select:none;cursor:pointer;transition:color var(--nuraly-label-local-transition-duration) var(--nuraly-label-local-transition-timing)}:host([size=small]) label{font-size:var(--nuraly-label-local-small-font-size)}:host([size=large]) label{font-size:var(--nuraly-label-local-large-font-size)}:host([variant=secondary]) label{color:var(--nuraly-label-local-secondary-color)}:host([variant=error]) label{color:var(--nuraly-label-local-error-color)}:host([variant=warning]) label{color:var(--nuraly-label-local-warning-color)}:host([variant=success]) label{color:var(--nuraly-label-local-success-color)}:host([disabled]) label{color:var(--nuraly-label-local-disabled-color);cursor:not-allowed;opacity:.6}.required-asterisk{color:var(--nuraly-label-local-required-color);margin-left:var(--nuraly-label-local-required-margin);font-weight:400}:host(:focus-within) label:not([disabled]){opacity:.8}`,i=function(l,a,r,o){for(var e,n=arguments.length,t=n<3?a:null===o?o=Object.getOwnPropertyDescriptor(a,r):o,i=l.length-1;i>=0;i--)(e=l[i])&&(t=(n<3?e(t):n>3?e(a,r,t):e(a,r))||t);return n>3&&t&&Object.defineProperty(a,r,t),t};let s=class extends(n(a)){constructor(){super(...arguments),this.size="medium",this.variant="default",this.required=!1,this.disabled=!1,this.value=""}connectedCallback(){super.connectedCallback(),this.updateDataTheme()}updated(){this.updateDataTheme()}updateDataTheme(){this.closest("[data-theme]")||this.setAttribute("data-theme",this.currentTheme)}render(){return r`<label for="${this.for||""}"><slot></slot>${this.required?r`<span class="required-asterisk">*</span>`:""}</label>`}};s.styles=t,i([o({reflect:!0})],s.prototype,"size",void 0),i([o({reflect:!0})],s.prototype,"variant",void 0),i([o({type:Boolean,reflect:!0})],s.prototype,"required",void 0),i([o({type:Boolean,reflect:!0})],s.prototype,"disabled",void 0),i([o()],s.prototype,"for",void 0),i([o()],s.prototype,"value",void 0),s=i([e("nr-label")],s);export{s as HyTextLabel};
|