@nuralyui/tag 0.0.1 → 0.0.2
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 +15 -15
- package/package.json +20 -7
- package/tag.component.d.ts +5 -1
- package/tag.component.js +18 -2
- package/tag.component.js.map +1 -1
package/bundle.js
CHANGED
|
@@ -14,30 +14,30 @@ const t=window,i=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"
|
|
|
14
14
|
* Copyright 2017 Google LLC
|
|
15
15
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
16
16
|
*/
|
|
17
|
-
var p;f[g]=!0,f.elementProperties=new Map,f.elementStyles=[],f.shadowRootOptions={mode:"open"},null==c||c({ReactiveElement:f}),(null!==(n=l.reactiveElementVersions)&&void 0!==n?n:l.reactiveElementVersions=[]).push("1.6.3");const b=window,y=b.trustedTypes,m=y?y.createPolicy("lit-html",{createHTML:t=>t}):void 0,w="$lit$",$=`lit$${(Math.random()+"").slice(9)}$`,k="?"+$,_=`<${k}>`,A=document,S=()=>A.createComment(""),x=t=>null===t||"object"!=typeof t&&"function"!=typeof t,
|
|
17
|
+
var p;f[g]=!0,f.elementProperties=new Map,f.elementStyles=[],f.shadowRootOptions={mode:"open"},null==c||c({ReactiveElement:f}),(null!==(n=l.reactiveElementVersions)&&void 0!==n?n:l.reactiveElementVersions=[]).push("1.6.3");const b=window,y=b.trustedTypes,m=y?y.createPolicy("lit-html",{createHTML:t=>t}):void 0,w="$lit$",$=`lit$${(Math.random()+"").slice(9)}$`,k="?"+$,_=`<${k}>`,A=document,S=()=>A.createComment(""),x=t=>null===t||"object"!=typeof t&&"function"!=typeof t,C=Array.isArray,E="[ \t\n\f\r]",O=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,j=/-->/g,T=/>/g,M=RegExp(`>|${E}(?:([^\\s"'>=/]+)(${E}*=${E}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),U=/'/g,R=/"/g,z=/^(?:script|style|textarea|title)$/i,N=Symbol.for("lit-noChange"),D=Symbol.for("lit-nothing"),P=new WeakMap,I=A.createTreeWalker(A,129,null,!1);function L(t,i){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==m?m.createHTML(i):i}class B{constructor({strings:t,_$litType$:i},s){let e;this.parts=[];let o=0,r=0;const n=t.length-1,l=this.parts,[a,h]=((t,i)=>{const s=t.length-1,e=[];let o,r=2===i?"<svg>":"",n=O;for(let i=0;i<s;i++){const s=t[i];let l,a,h=-1,c=0;for(;c<s.length&&(n.lastIndex=c,a=n.exec(s),null!==a);)c=n.lastIndex,n===O?"!--"===a[1]?n=j:void 0!==a[1]?n=T:void 0!==a[2]?(z.test(a[2])&&(o=RegExp("</"+a[2],"g")),n=M):void 0!==a[3]&&(n=M):n===M?">"===a[0]?(n=null!=o?o:O,h=-1):void 0===a[1]?h=-2:(h=n.lastIndex-a[2].length,l=a[1],n=void 0===a[3]?M:'"'===a[3]?R:U):n===R||n===U?n=M:n===j||n===T?n=O:(n=M,o=void 0);const d=n===M&&t[i+1].startsWith("/>")?" ":"";r+=n===O?s+_:h>=0?(e.push(l),s.slice(0,h)+w+s.slice(h)+$+d):s+$+(-2===h?(e.push(void 0),i):d)}return[L(t,r+(t[s]||"<?>")+(2===i?"</svg>":"")),e]})(t,i);if(this.el=B.createElement(a,s),I.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(e=I.nextNode())&&l.length<n;){if(1===e.nodeType){if(e.hasAttributes()){const t=[];for(const i of e.getAttributeNames())if(i.endsWith(w)||i.startsWith($)){const s=h[r++];if(t.push(i),void 0!==s){const t=e.getAttribute(s.toLowerCase()+w).split($),i=/([.?@])?(.*)/.exec(s);l.push({type:1,index:o,name:i[2],strings:t,ctor:"."===i[1]?V:"?"===i[1]?Z:"@"===i[1]?J:H})}else l.push({type:6,index:o})}for(const i of t)e.removeAttribute(i)}if(z.test(e.tagName)){const t=e.textContent.split($),i=t.length-1;if(i>0){e.textContent=y?y.emptyScript:"";for(let s=0;s<i;s++)e.append(t[s],S()),I.nextNode(),l.push({type:2,index:++o});e.append(t[i],S())}}}else if(8===e.nodeType)if(e.data===k)l.push({type:2,index:o});else{let t=-1;for(;-1!==(t=e.data.indexOf($,t+1));)l.push({type:7,index:o}),t+=$.length-1}o++}}static createElement(t,i){const s=A.createElement("template");return s.innerHTML=t,s}}function F(t,i,s=t,e){var o,r,n,l;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=x(i)?void 0:i._$litDirective$;return(null==a?void 0:a.constructor)!==h&&(null===(r=null==a?void 0:a._$AO)||void 0===r||r.call(a,!1),void 0===h?a=void 0:(a=new h(t),a._$AT(t,s,e)),void 0!==e?(null!==(n=(l=s)._$Co)&&void 0!==n?n:l._$Co=[])[e]=a:s._$Cl=a),void 0!==a&&(i=F(t,a._$AS(t,i.values),a,e)),i}class K{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:A).importNode(s,!0);I.currentNode=o;let r=I.nextNode(),n=0,l=0,a=e[0];for(;void 0!==a;){if(n===a.index){let i;2===a.type?i=new q(r,r.nextSibling,this,t):1===a.type?i=new a.ctor(r,a.name,a.strings,this,t):6===a.type&&(i=new G(r,this,t)),this._$AV.push(i),a=e[++l]}n!==(null==a?void 0:a.index)&&(r=I.nextNode(),n++)}return I.currentNode=A,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 q{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=F(this,t,i),x(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=>C(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&&x(this._$AH)?this._$AA.nextSibling.data=t:this.$(A.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=B.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 K(o,this),i=t.u(this.options);t.v(s),this.$(i),this._$AH=t}}_$AC(t){let i=P.get(t.strings);return void 0===i&&P.set(t.strings,i=new B(t)),i}T(t){C(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 q(this.k(S()),this.k(S()),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 r=!1;if(void 0===o)t=F(this,t,i,0),r=!x(t)||t!==this._$AH&&t!==N,r&&(this._$AH=t);else{const e=t;let n,l;for(t=o[0],n=0;n<o.length-1;n++)l=F(this,e[s+n],i,n),l===N&&(l=this._$AH[n]),r||(r=!x(l)||l!==this._$AH[n]),l===D?t=D:t!==D&&(t+=(null!=l?l:"")+o[n+1]),this._$AH[n]=l}r&&!e&&this.j(t)}j(t){t===D?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class V extends H{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===D?void 0:t}}const W=y?y.emptyScript:"";class Z extends H{constructor(){super(...arguments),this.type=4}j(t){t&&t!==D?this.element.setAttribute(this.name,W):this.element.removeAttribute(this.name)}}class J 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=F(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,r=t!==D&&(e===D||o);o&&this.element.removeEventListener(this.name,this,e),r&&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 G{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){F(this,t)}}const Q=b.litHtmlPolyfillSupport;
|
|
18
18
|
/**
|
|
19
19
|
* @license
|
|
20
20
|
* Copyright 2017 Google LLC
|
|
21
21
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
22
22
|
*/
|
|
23
|
-
var X;null==Q||Q(
|
|
23
|
+
var X;null==Q||Q(B,q),(null!==(p=b.litHtmlVersions)&&void 0!==p?p:b.litHtmlVersions=[]).push("2.8.0");const Y=window,tt=Y.trustedTypes,it=tt?tt.createPolicy("lit-html",{createHTML:t=>t}):void 0,st="$lit$",et=`lit$${(Math.random()+"").slice(9)}$`,ot="?"+et,rt=`<${ot}>`,nt=document,lt=()=>nt.createComment(""),at=t=>null===t||"object"!=typeof t&&"function"!=typeof t,ht=Array.isArray,ct="[ \t\n\f\r]",dt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ut=/-->/g,vt=/>/g,gt=RegExp(`>|${ct}(?:([^\\s"'>=/]+)(${ct}*=${ct}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),ft=/'/g,pt=/"/g,bt=/^(?:script|style|textarea|title)$/i,yt=(t=>(i,...s)=>({_$litType$:t,strings:i,values:s}))(1),mt=Symbol.for("lit-noChange"),wt=Symbol.for("lit-nothing"),$t=new WeakMap,kt=nt.createTreeWalker(nt,129,null,!1);function _t(t,i){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==it?it.createHTML(i):i}const At=(t,i)=>{const s=t.length-1,e=[];let o,r=2===i?"<svg>":"",n=dt;for(let i=0;i<s;i++){const s=t[i];let l,a,h=-1,c=0;for(;c<s.length&&(n.lastIndex=c,a=n.exec(s),null!==a);)c=n.lastIndex,n===dt?"!--"===a[1]?n=ut:void 0!==a[1]?n=vt:void 0!==a[2]?(bt.test(a[2])&&(o=RegExp("</"+a[2],"g")),n=gt):void 0!==a[3]&&(n=gt):n===gt?">"===a[0]?(n=null!=o?o:dt,h=-1):void 0===a[1]?h=-2:(h=n.lastIndex-a[2].length,l=a[1],n=void 0===a[3]?gt:'"'===a[3]?pt:ft):n===pt||n===ft?n=gt:n===ut||n===vt?n=dt:(n=gt,o=void 0);const d=n===gt&&t[i+1].startsWith("/>")?" ":"";r+=n===dt?s+rt:h>=0?(e.push(l),s.slice(0,h)+st+s.slice(h)+et+d):s+et+(-2===h?(e.push(void 0),i):d)}return[_t(t,r+(t[s]||"<?>")+(2===i?"</svg>":"")),e]};class St{constructor({strings:t,_$litType$:i},s){let e;this.parts=[];let o=0,r=0;const n=t.length-1,l=this.parts,[a,h]=At(t,i);if(this.el=St.createElement(a,s),kt.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(e=kt.nextNode())&&l.length<n;){if(1===e.nodeType){if(e.hasAttributes()){const t=[];for(const i of e.getAttributeNames())if(i.endsWith(st)||i.startsWith(et)){const s=h[r++];if(t.push(i),void 0!==s){const t=e.getAttribute(s.toLowerCase()+st).split(et),i=/([.?@])?(.*)/.exec(s);l.push({type:1,index:o,name:i[2],strings:t,ctor:"."===i[1]?jt:"?"===i[1]?Mt:"@"===i[1]?Ut:Ot})}else l.push({type:6,index:o})}for(const i of t)e.removeAttribute(i)}if(bt.test(e.tagName)){const t=e.textContent.split(et),i=t.length-1;if(i>0){e.textContent=tt?tt.emptyScript:"";for(let s=0;s<i;s++)e.append(t[s],lt()),kt.nextNode(),l.push({type:2,index:++o});e.append(t[i],lt())}}}else if(8===e.nodeType)if(e.data===ot)l.push({type:2,index:o});else{let t=-1;for(;-1!==(t=e.data.indexOf(et,t+1));)l.push({type:7,index:o}),t+=et.length-1}o++}}static createElement(t,i){const s=nt.createElement("template");return s.innerHTML=t,s}}function xt(t,i,s=t,e){var o,r,n,l;if(i===mt)return i;let a=void 0!==e?null===(o=s._$Co)||void 0===o?void 0:o[e]:s._$Cl;const h=at(i)?void 0:i._$litDirective$;return(null==a?void 0:a.constructor)!==h&&(null===(r=null==a?void 0:a._$AO)||void 0===r||r.call(a,!1),void 0===h?a=void 0:(a=new h(t),a._$AT(t,s,e)),void 0!==e?(null!==(n=(l=s)._$Co)&&void 0!==n?n:l._$Co=[])[e]=a:s._$Cl=a),void 0!==a&&(i=xt(t,a._$AS(t,i.values),a,e)),i}class Ct{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:nt).importNode(s,!0);kt.currentNode=o;let r=kt.nextNode(),n=0,l=0,a=e[0];for(;void 0!==a;){if(n===a.index){let i;2===a.type?i=new Et(r,r.nextSibling,this,t):1===a.type?i=new a.ctor(r,a.name,a.strings,this,t):6===a.type&&(i=new Rt(r,this,t)),this._$AV.push(i),a=e[++l]}n!==(null==a?void 0:a.index)&&(r=kt.nextNode(),n++)}return kt.currentNode=nt,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 Et{constructor(t,i,s,e){var o;this.type=2,this._$AH=wt,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=xt(this,t,i),at(t)?t===wt||null==t||""===t?(this._$AH!==wt&&this._$AR(),this._$AH=wt):t!==this._$AH&&t!==mt&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):(t=>ht(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!==wt&&at(this._$AH)?this._$AA.nextSibling.data=t:this.$(nt.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=St.createElement(_t(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 Ct(o,this),i=t.u(this.options);t.v(s),this.$(i),this._$AH=t}}_$AC(t){let i=$t.get(t.strings);return void 0===i&&$t.set(t.strings,i=new St(t)),i}T(t){ht(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 Et(this.k(lt()),this.k(lt()),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 Ot{constructor(t,i,s,e,o){this.type=1,this._$AH=wt,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=wt}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,s,e){const o=this.strings;let r=!1;if(void 0===o)t=xt(this,t,i,0),r=!at(t)||t!==this._$AH&&t!==mt,r&&(this._$AH=t);else{const e=t;let n,l;for(t=o[0],n=0;n<o.length-1;n++)l=xt(this,e[s+n],i,n),l===mt&&(l=this._$AH[n]),r||(r=!at(l)||l!==this._$AH[n]),l===wt?t=wt:t!==wt&&(t+=(null!=l?l:"")+o[n+1]),this._$AH[n]=l}r&&!e&&this.j(t)}j(t){t===wt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class jt extends Ot{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===wt?void 0:t}}const Tt=tt?tt.emptyScript:"";class Mt extends Ot{constructor(){super(...arguments),this.type=4}j(t){t&&t!==wt?this.element.setAttribute(this.name,Tt):this.element.removeAttribute(this.name)}}class Ut extends Ot{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=xt(this,t,i,0))&&void 0!==s?s:wt)===mt)return;const e=this._$AH,o=t===wt&&e!==wt||t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive,r=t!==wt&&(e===wt||o);o&&this.element.removeEventListener(this.name,this,e),r&&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){xt(this,t)}}const zt=Y.litHtmlPolyfillSupport;null==zt||zt(St,Et),(null!==(X=Y.litHtmlVersions)&&void 0!==X?X:Y.litHtmlVersions=[]).push("2.8.0");
|
|
24
24
|
/**
|
|
25
25
|
* @license
|
|
26
26
|
* Copyright 2017 Google LLC
|
|
27
27
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
28
28
|
*/
|
|
29
|
-
var Nt,Dt;class Pt extends f{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 r=null!==(e=null==s?void 0:s.renderBefore)&&void 0!==e?e:i;let n=r._$litPart$;if(void 0===n){const t=null!==(o=null==s?void 0:s.renderBefore)&&void 0!==o?o:null;r._$litPart$=n=new
|
|
29
|
+
var Nt,Dt;class Pt extends f{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 r=null!==(e=null==s?void 0:s.renderBefore)&&void 0!==e?e:i;let n=r._$litPart$;if(void 0===n){const t=null!==(o=null==s?void 0:s.renderBefore)&&void 0!==o?o:null;r._$litPart$=n=new Et(i.insertBefore(lt(),t),t,void 0,null!=s?s:{})}return n._$AI(t),n})(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 mt}}Pt.finalized=!0,Pt._$litElement$=!0,null===(Nt=globalThis.litElementHydrateSupport)||void 0===Nt||Nt.call(globalThis,{LitElement:Pt});const It=globalThis.litElementPolyfillSupport;null==It||It({LitElement:Pt}),(null!==(Dt=globalThis.litElementVersions)&&void 0!==Dt?Dt:globalThis.litElementVersions=[]).push("3.3.3");
|
|
30
30
|
/**
|
|
31
31
|
* @license
|
|
32
32
|
* Copyright 2017 Google LLC
|
|
33
33
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
34
34
|
*/
|
|
35
|
-
const
|
|
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)}},Bt=(t,i,s)=>{i.constructor.createProperty(s,t)};
|
|
36
36
|
/**
|
|
37
37
|
* @license
|
|
38
38
|
* Copyright 2017 Google LLC
|
|
39
39
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
40
|
-
*/function
|
|
40
|
+
*/function Ft(t){return(i,s)=>void 0!==s?Bt(t,i,s):Lt(t,i)
|
|
41
41
|
/**
|
|
42
42
|
* @license
|
|
43
43
|
* Copyright 2017 Google LLC
|
|
@@ -48,18 +48,18 @@ const Bt=(t,i)=>"method"===i.kind&&i.descriptor&&!("value"in i.descriptor)?{...i
|
|
|
48
48
|
* Copyright 2021 Google LLC
|
|
49
49
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
50
50
|
*/
|
|
51
|
-
var
|
|
51
|
+
var Kt;null===(Kt=window.HTMLSlotElement)||void 0===Kt||Kt.prototype.assignedElements;
|
|
52
52
|
/**
|
|
53
53
|
* @license
|
|
54
54
|
* Copyright 2017 Google LLC
|
|
55
55
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
56
56
|
*/
|
|
57
|
-
const
|
|
57
|
+
const qt=1;class Ht{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,i,s){this._$Ct=t,this._$AM=i,this._$Ci=s}_$AS(t,i){return this.update(t,i)}update(t,i){return this.render(...i)}}
|
|
58
58
|
/**
|
|
59
59
|
* @license
|
|
60
60
|
* Copyright 2018 Google LLC
|
|
61
61
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
62
|
-
*/const Vt=(t=>(...i)=>({_$litDirective$:t,values:i}))(class extends Ht{constructor(t){var i;if(super(t),t.type!==
|
|
62
|
+
*/const Vt=(t=>(...i)=>({_$litDirective$:t,values:i}))(class extends Ht{constructor(t){var i;if(super(t),t.type!==qt||"class"!==t.name||(null===(i=t.strings)||void 0===i?void 0:i.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((i=>t[i])).join(" ")+" "}update(t,[i]){var s,e;if(void 0===this.it){this.it=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in i)i[t]&&!(null===(s=this.nt)||void 0===s?void 0:s.has(t))&&this.it.add(t);return this.render(i)}const o=t.element.classList;this.it.forEach((t=>{t in i||(o.remove(t),this.it.delete(t))}));for(const t in i){const s=!!i[t];s===this.it.has(t)||(null===(e=this.nt)||void 0===e?void 0:e.has(t))||(s?(o.add(t),this.it.add(t)):(o.remove(t),this.it.delete(t)))}return N}}),Wt=((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)})`
|
|
63
63
|
:host { display: inline-block; }
|
|
64
64
|
|
|
65
65
|
.tag {
|
|
@@ -155,21 +155,21 @@ const Ft=1;class Ht{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,i,s)
|
|
|
155
155
|
* Copyright 2025 Nuraly
|
|
156
156
|
* SPDX-License-Identifier: MIT
|
|
157
157
|
*/
|
|
158
|
-
var Xt=function(t,i,s,e){for(var o,r=arguments.length,n=r<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,s):e,l=t.length-1;l>=0;l--)(o=t[l])&&(n=(r<3?o(n):r>3?o(i,s,n):o(i,s))||n);return r>3&&n&&Object.defineProperty(i,s,n),n};let Yt=class extends((t=>Gt(Zt(Qt(t))))(Pt)){constructor(){super(...arguments),this.bordered=!0,this.size="default",this.closable=!1,this.checkable=!1,this.checked=!1,this.disabled=!1,this.closing=!1}onCloseClick(t){t.stopPropagation(),this.closable&&!this.disabled&&(this.closing=!0,setTimeout((()=>{this.dispatchEvent(new CustomEvent("nr-tag-close",{bubbles:!0,composed:!0})),this.closing=!1}),200))}onToggleChecked(){this.checkable&&!this.disabled&&(this.checked=!this.checked,this.dispatchEvent(new CustomEvent("nr-tag-checked-change",{detail:{checked:this.checked},bubbles:!0,composed:!0})))}isPreset(t){return!!t&&ti.has(t)}render(){const t=!!this.color&&!this.isPreset(this.color),
|
|
158
|
+
var Xt=function(t,i,s,e){for(var o,r=arguments.length,n=r<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,s):e,l=t.length-1;l>=0;l--)(o=t[l])&&(n=(r<3?o(n):r>3?o(i,s,n):o(i,s))||n);return r>3&&n&&Object.defineProperty(i,s,n),n};let Yt=class extends((t=>Gt(Zt(Qt(t))))(Pt)){constructor(){super(...arguments),this.bordered=!0,this.size="default",this.closable=!1,this.checkable=!1,this.checked=!1,this.disabled=!1,this.closing=!1}connectedCallback(){super.connectedCallback(),this.lightDomObserver=new MutationObserver((()=>{this.requestUpdate()})),this.lightDomObserver.observe(this,{childList:!0,subtree:!1,attributes:!0,attributeFilter:["slot"]})}disconnectedCallback(){var t;null===(t=this.lightDomObserver)||void 0===t||t.disconnect(),this.lightDomObserver=void 0,super.disconnectedCallback()}onCloseClick(t){t.stopPropagation(),this.closable&&!this.disabled&&(this.closing=!0,setTimeout((()=>{this.dispatchEvent(new CustomEvent("nr-tag-close",{bubbles:!0,composed:!0})),this.closing=!1}),200))}onToggleChecked(){this.checkable&&!this.disabled&&(this.checked=!this.checked,this.dispatchEvent(new CustomEvent("nr-tag-checked-change",{detail:{checked:this.checked},bubbles:!0,composed:!0})))}isPreset(t){return!!t&&ti.has(t)}render(){const t=!!this.querySelector('[slot="icon"]'),i=!!this.color&&!this.isPreset(this.color),s=Object.assign(Object.assign({tag:!0,"tag--small":"small"===this.size,"tag--borderless":!this.bordered,"tag--closable":this.closable,"tag--checkable":this.checkable,"tag--checked":this.checkable&&this.checked,"tag--disabled":this.disabled,"tag--closing":this.closing},this.color&&this.isPreset(this.color)?{[`tag--${this.color}`]:!0}:{}),{"tag--custom":i}),e={};i&&this.color&&(e["--nr-tag-custom-bg"]=this.color);const o=this.checkable?"switch":"button",r=this.checkable?this.checked?"true":"false":void 0;return yt`
|
|
159
159
|
<span
|
|
160
|
-
class=${Vt(
|
|
161
|
-
style=${Object.entries(
|
|
162
|
-
role=${
|
|
160
|
+
class=${Vt(s)}
|
|
161
|
+
style=${Object.entries(e).map((([t,i])=>`${t}: ${i}`)).join(";")}
|
|
162
|
+
role=${o}
|
|
163
163
|
aria-pressed=${(t=>null!=t?t:D)
|
|
164
164
|
/**
|
|
165
165
|
* @license
|
|
166
166
|
* Copyright 2025 Nuraly
|
|
167
167
|
* SPDX-License-Identifier: MIT
|
|
168
|
-
*/(
|
|
168
|
+
*/(r)}
|
|
169
169
|
aria-disabled=${this.disabled?"true":"false"}
|
|
170
170
|
@click=${this.checkable?this.onToggleChecked:void 0}
|
|
171
171
|
>
|
|
172
|
-
|
|
172
|
+
${t?yt`<span class="tag__icon"><slot name="icon"></slot></span>`:wt}
|
|
173
173
|
<span class="tag__content"><slot></slot></span>
|
|
174
174
|
${this.closable?yt`
|
|
175
175
|
<button class="tag__close" part="close" aria-label="close" ?disabled=${this.disabled} @click=${this.onCloseClick}>
|
|
@@ -177,4 +177,4 @@ var Xt=function(t,i,s,e){for(var o,r=arguments.length,n=r<3?i:null===e?e=Object.
|
|
|
177
177
|
</button>
|
|
178
178
|
`:wt}
|
|
179
179
|
</span>
|
|
180
|
-
`}};Yt.styles=Wt,Xt([
|
|
180
|
+
`}};Yt.styles=Wt,Xt([Ft({type:String})],Yt.prototype,"color",void 0),Xt([Ft({type:Boolean,reflect:!0})],Yt.prototype,"bordered",void 0),Xt([Ft({type:String})],Yt.prototype,"size",void 0),Xt([Ft({type:Boolean})],Yt.prototype,"closable",void 0),Xt([Ft({type:Boolean})],Yt.prototype,"checkable",void 0),Xt([Ft({type:Boolean,reflect:!0})],Yt.prototype,"checked",void 0),Xt([Ft({type:Boolean,reflect:!0})],Yt.prototype,"disabled",void 0),Xt([function(t){return Ft({...t,state:!0})}()],Yt.prototype,"closing",void 0),Yt=Xt([(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-tag")],Yt);const ti=new Set(["magenta","red","volcano","orange","gold","lime","green","cyan","blue","geekblue","purple"]);export{Yt as NrTagElement};
|
package/package.json
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuralyui/tag",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "Tag component for NuralyUI library",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
8
|
-
".": {
|
|
9
|
-
|
|
8
|
+
".": {
|
|
9
|
+
"import": "./index.js"
|
|
10
|
+
},
|
|
11
|
+
"./bundle": {
|
|
12
|
+
"import": "./bundle.js"
|
|
13
|
+
}
|
|
10
14
|
},
|
|
11
15
|
"files": [
|
|
12
16
|
"*.js",
|
|
@@ -17,12 +21,21 @@
|
|
|
17
21
|
],
|
|
18
22
|
"repository": {
|
|
19
23
|
"type": "git",
|
|
20
|
-
"url": "https://github.com/
|
|
24
|
+
"url": "https://github.com/Nuralyio/NuralyUI.git",
|
|
21
25
|
"directory": "src/components/tag"
|
|
22
26
|
},
|
|
23
|
-
"keywords": [
|
|
27
|
+
"keywords": [
|
|
28
|
+
"tag",
|
|
29
|
+
"label",
|
|
30
|
+
"chip",
|
|
31
|
+
"web-components",
|
|
32
|
+
"lit",
|
|
33
|
+
"nuralyui"
|
|
34
|
+
],
|
|
24
35
|
"author": "Nuraly",
|
|
25
36
|
"license": "MIT",
|
|
26
|
-
"bugs": {
|
|
27
|
-
|
|
37
|
+
"bugs": {
|
|
38
|
+
"url": "https://github.com/Nuralyio/NuralyUI/issues"
|
|
39
|
+
},
|
|
40
|
+
"homepage": "https://github.com/Nuralyio/NuralyUI#readme"
|
|
28
41
|
}
|
package/tag.component.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { LitElement } from 'lit';
|
|
7
7
|
import { TagSize } from './tag.types.js';
|
|
8
|
-
declare const NrTagElement_base: (new (...args: any[]) => import("
|
|
8
|
+
declare const NrTagElement_base: (new (...args: any[]) => import("@nuralyui/common/mixins").DependencyAware) & (new (...args: any[]) => import("@nuralyui/common/mixins").ThemeAware) & (new (...args: any[]) => import("@nuralyui/common/mixins").EventHandlerCapable) & typeof LitElement;
|
|
9
9
|
/**
|
|
10
10
|
* Tag component
|
|
11
11
|
* Inspired by Ant Design Tag: https://ant.design/components/tag
|
|
@@ -41,6 +41,10 @@ export declare class NrTagElement extends NrTagElement_base {
|
|
|
41
41
|
disabled: boolean;
|
|
42
42
|
/** Internal closing anim state */
|
|
43
43
|
private closing;
|
|
44
|
+
/** Track if an icon is actually provided via slot */
|
|
45
|
+
private lightDomObserver?;
|
|
46
|
+
connectedCallback(): void;
|
|
47
|
+
disconnectedCallback(): void;
|
|
44
48
|
private onCloseClick;
|
|
45
49
|
private onToggleChecked;
|
|
46
50
|
private isPreset;
|
package/tag.component.js
CHANGED
|
@@ -14,7 +14,7 @@ import { customElement, property, state } from 'lit/decorators.js';
|
|
|
14
14
|
import { classMap } from 'lit/directives/class-map.js';
|
|
15
15
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
16
16
|
import { styles } from './tag.style.js';
|
|
17
|
-
import { NuralyUIBaseMixin } from '
|
|
17
|
+
import { NuralyUIBaseMixin } from '@nuralyui/common/mixins';
|
|
18
18
|
/**
|
|
19
19
|
* Tag component
|
|
20
20
|
* Inspired by Ant Design Tag: https://ant.design/components/tag
|
|
@@ -50,6 +50,21 @@ let NrTagElement = class NrTagElement extends NuralyUIBaseMixin(LitElement) {
|
|
|
50
50
|
/** Internal closing anim state */
|
|
51
51
|
this.closing = false;
|
|
52
52
|
}
|
|
53
|
+
connectedCallback() {
|
|
54
|
+
super.connectedCallback();
|
|
55
|
+
// Observe light DOM children to detect when an icon slot is added/removed dynamically
|
|
56
|
+
this.lightDomObserver = new MutationObserver(() => {
|
|
57
|
+
// Trigger re-render so we can recompute hasIcon in render()
|
|
58
|
+
this.requestUpdate();
|
|
59
|
+
});
|
|
60
|
+
this.lightDomObserver.observe(this, { childList: true, subtree: false, attributes: true, attributeFilter: ['slot'] });
|
|
61
|
+
}
|
|
62
|
+
disconnectedCallback() {
|
|
63
|
+
var _a;
|
|
64
|
+
(_a = this.lightDomObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
65
|
+
this.lightDomObserver = undefined;
|
|
66
|
+
super.disconnectedCallback();
|
|
67
|
+
}
|
|
53
68
|
onCloseClick(e) {
|
|
54
69
|
e.stopPropagation();
|
|
55
70
|
if (!this.closable || this.disabled)
|
|
@@ -78,6 +93,7 @@ let NrTagElement = class NrTagElement extends NuralyUIBaseMixin(LitElement) {
|
|
|
78
93
|
return PRESET_COLOR_SET.has(color);
|
|
79
94
|
}
|
|
80
95
|
render() {
|
|
96
|
+
const hasIcon = !!this.querySelector('[slot="icon"]');
|
|
81
97
|
const isCustom = !!this.color && !this.isPreset(this.color);
|
|
82
98
|
const classes = Object.assign(Object.assign({ tag: true, 'tag--small': this.size === "small" /* TagSize.Small */, 'tag--borderless': !this.bordered, 'tag--closable': this.closable, 'tag--checkable': this.checkable, 'tag--checked': this.checkable && this.checked, 'tag--disabled': this.disabled, 'tag--closing': this.closing }, (this.color && this.isPreset(this.color) ? { [`tag--${this.color}`]: true } : {})), {
|
|
83
99
|
// custom color modifier
|
|
@@ -97,7 +113,7 @@ let NrTagElement = class NrTagElement extends NuralyUIBaseMixin(LitElement) {
|
|
|
97
113
|
aria-disabled=${this.disabled ? 'true' : 'false'}
|
|
98
114
|
@click=${this.checkable ? this.onToggleChecked : undefined}
|
|
99
115
|
>
|
|
100
|
-
|
|
116
|
+
${hasIcon ? html `<span class="tag__icon"><slot name="icon"></slot></span>` : nothing}
|
|
101
117
|
<span class="tag__content"><slot></slot></span>
|
|
102
118
|
${this.closable ? html `
|
|
103
119
|
<button class="tag__close" part="close" aria-label="close" ?disabled=${this.disabled} @click=${this.onCloseClick}>
|
package/tag.component.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tag.component.js","sourceRoot":"","sources":["../../../src/components/tag/tag.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;;;;;;AAEH,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAG/D;;;;;;;;;;;;;;;;GAgBG;AAEH,IAAa,YAAY,GAAzB,MAAa,YAAa,SAAQ,iBAAiB,CAAC,UAAU,CAAC;IAA/D;;QAOE,qBAAqB;QAErB,aAAQ,GAAG,IAAI,CAAC;QAEhB,iBAAiB;QAEjB,SAAI,mCAA4B;QAEhC,eAAe;QAEf,aAAQ,GAAG,KAAK,CAAC;QAEjB,gBAAgB;QAEhB,cAAS,GAAG,KAAK,CAAC;QAElB,8BAA8B;QAE9B,YAAO,GAAG,KAAK,CAAC;QAEhB,eAAe;QAEf,aAAQ,GAAG,KAAK,CAAC;QAEjB,kCAAkC;QACjB,YAAO,GAAG,KAAK,CAAC;IA0EnC,CAAC;IAxES,YAAY,CAAC,CAAQ;QAC3B,CAAC,CAAC,eAAe,EAAE,CAAC;QACpB,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ;YAAE,OAAO;QAC5C,IAAI,CAAC,OAAO,GAAG,IAAI,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,CAAC,QAAQ,WAAW,IAAI,CAAC,YAAY;;;SAGjH,CAAC,CAAC,CAAC,OAAO;;KAEd,CAAC;IACJ,CAAC;CACF,CAAA;AAzGiB,mBAAM,GAAG,MAAO,CAAA;AAIhC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CACZ;AAIf;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8CAC3B;AAIhB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CACK;AAIhC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;8CACX;AAIjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;+CACV;AAIlB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;6CAC3B;AAIhB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8CAC1B;AAGR;IAAR,KAAK,EAAE;6CAAyB;AAhCtB,YAAY;IADxB,aAAa,CAAC,QAAQ,CAAC;GACX,YAAY,CA0GxB;SA1GY,YAAY;AA4GzB,MAAM,gBAAgB,GAAgB,IAAI,GAAG,CAAC;IAC5C,SAAS,EAAC,KAAK,EAAC,SAAS,EAAC,QAAQ,EAAC,MAAM,EAAC,MAAM,EAAC,OAAO,EAAC,MAAM,EAAC,MAAM,EAAC,UAAU,EAAC,QAAQ;CAC3F,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2025 Nuraly\n * SPDX-License-Identifier: MIT\n */\n\nimport { LitElement, html, nothing } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { styles } from './tag.style.js';\nimport { NuralyUIBaseMixin } from '../../shared/base-mixin.js';\nimport { TagSize, type TagCheckedChangeDetail } from './tag.types.js';\n\n/**\n * Tag component\n * Inspired by Ant Design Tag: https://ant.design/components/tag\n *\n * Features:\n * - Preset colors and custom color support\n * - Closable tags with onClose event\n * - Checkable tags with checked state and change event\n * - Small size variant\n * - Disabled state\n * - Theme-aware through CSS variables\n *\n * @slot - Tag content\n * @slot icon - Optional leading icon\n * @fires nr-tag-close - when the close icon is clicked\n * @fires nr-tag-checked-change - when a checkable tag toggles\n */\n@customElement('nr-tag')\nexport class NrTagElement extends NuralyUIBaseMixin(LitElement) {\n static override styles = styles;\n\n /** Tag color preset or custom color string (hex/rgb) */\n @property({ type: String })\n color?: string;\n\n /** Bordered style */\n @property({ type: Boolean, reflect: true })\n bordered = true;\n\n /** Small size */\n @property({ type: String })\n size: TagSize = TagSize.Default;\n\n /** Closable */\n @property({ type: Boolean })\n closable = false;\n\n /** Checkable */\n @property({ type: Boolean })\n checkable = false;\n\n /** Checked (for checkable) */\n @property({ type: Boolean, reflect: true })\n checked = false;\n\n /** Disabled */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /** Internal closing anim state */\n @state() private closing = false;\n\n private onCloseClick(e: Event) {\n e.stopPropagation();\n if (!this.closable || this.disabled) return;\n this.closing = true;\n // match CSS animation duration ~200ms\n setTimeout(() => {\n this.dispatchEvent(new CustomEvent('nr-tag-close', { bubbles: true, composed: true }));\n // Consumers can remove the element on event; keep visible otherwise\n this.closing = false;\n }, 200);\n }\n\n private onToggleChecked() {\n if (!this.checkable || this.disabled) return;\n this.checked = !this.checked;\n this.dispatchEvent(new CustomEvent<TagCheckedChangeDetail>('nr-tag-checked-change', {\n detail: { checked: this.checked },\n bubbles: true,\n composed: true,\n }));\n }\n\n private isPreset(color?: string): boolean {\n if (!color) return false;\n return PRESET_COLOR_SET.has(color as string);\n }\n\n override render() {\n const isCustom = !!this.color && !this.isPreset(this.color as string);\n\n const classes = {\n tag: true,\n 'tag--small': this.size === TagSize.Small,\n 'tag--borderless': !this.bordered,\n 'tag--closable': this.closable,\n 'tag--checkable': this.checkable,\n 'tag--checked': this.checkable && this.checked,\n 'tag--disabled': this.disabled,\n 'tag--closing': this.closing,\n // preset color class e.g., tag--red\n ...(this.color && this.isPreset(this.color as string) ? { [`tag--${this.color}`]: true } : {}),\n // custom color modifier\n 'tag--custom': isCustom,\n };\n\n const styleMap: Record<string, string> = {};\n if (isCustom && this.color) {\n styleMap['--nr-tag-custom-bg'] = this.color as string;\n }\n\n const role = this.checkable ? 'switch' : 'button';\n const ariaPressed: 'true' | 'false' | undefined = this.checkable ? (this.checked ? 'true' : 'false') : undefined;\n\n return html`\n <span\n class=${classMap(classes)}\n style=${Object.entries(styleMap).map(([k, v]) => `${k}: ${v}`).join(';')}\n role=${role}\n aria-pressed=${ifDefined(ariaPressed)}\n aria-disabled=${this.disabled ? 'true' : 'false'}\n @click=${this.checkable ? this.onToggleChecked : undefined}\n >\n <span class=\"tag__icon\"><slot name=\"icon\"></slot></span>\n <span class=\"tag__content\"><slot></slot></span>\n ${this.closable ? html`\n <button class=\"tag__close\" part=\"close\" aria-label=\"close\" ?disabled=${this.disabled} @click=${this.onCloseClick}>\n ×\n </button>\n ` : nothing}\n </span>\n `;\n }\n}\n\nconst PRESET_COLOR_SET: Set<string> = new Set([\n 'magenta','red','volcano','orange','gold','lime','green','cyan','blue','geekblue','purple'\n]);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nr-tag': NrTagElement;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"tag.component.js","sourceRoot":"","sources":["../../../src/components/tag/tag.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;;;;;;AAEH,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAA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AAU,EAAC,QAAQ;CAC3F,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2025 Nuraly\n * SPDX-License-Identifier: MIT\n */\n\nimport { LitElement, html, nothing } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { styles } from './tag.style.js';\nimport { NuralyUIBaseMixin } from '@nuralyui/common/mixins';\nimport { TagSize, type TagCheckedChangeDetail } from './tag.types.js';\n\n/**\n * Tag component\n * Inspired by Ant Design Tag: https://ant.design/components/tag\n *\n * Features:\n * - Preset colors and custom color support\n * - Closable tags with onClose event\n * - Checkable tags with checked state and change event\n * - Small size variant\n * - Disabled state\n * - Theme-aware through CSS variables\n *\n * @slot - Tag content\n * @slot icon - Optional leading icon\n * @fires nr-tag-close - when the close icon is clicked\n * @fires nr-tag-checked-change - when a checkable tag toggles\n */\n@customElement('nr-tag')\nexport class NrTagElement extends NuralyUIBaseMixin(LitElement) {\n static override styles = styles;\n\n /** Tag color preset or custom color string (hex/rgb) */\n @property({ type: String })\n color?: string;\n\n /** Bordered style */\n @property({ type: Boolean, reflect: true })\n bordered = true;\n\n /** Small size */\n @property({ type: String })\n size: TagSize = TagSize.Default;\n\n /** Closable */\n @property({ type: Boolean })\n closable = false;\n\n /** Checkable */\n @property({ type: Boolean })\n checkable = false;\n\n /** Checked (for checkable) */\n @property({ type: Boolean, reflect: true })\n checked = false;\n\n /** Disabled */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /** Internal closing anim state */\n @state() private closing = false;\n\n /** Track if an icon is actually provided via slot */\n private lightDomObserver?: MutationObserver;\n\n override connectedCallback(): void {\n super.connectedCallback();\n // Observe light DOM children to detect when an icon slot is added/removed dynamically\n this.lightDomObserver = new MutationObserver(() => {\n // Trigger re-render so we can recompute hasIcon in render()\n this.requestUpdate();\n });\n this.lightDomObserver.observe(this, { childList: true, subtree: false, attributes: true, attributeFilter: ['slot'] });\n }\n\n override disconnectedCallback(): void {\n this.lightDomObserver?.disconnect();\n this.lightDomObserver = undefined;\n super.disconnectedCallback();\n }\n\n private onCloseClick(e: Event) {\n e.stopPropagation();\n if (!this.closable || this.disabled) return;\n this.closing = true;\n // match CSS animation duration ~200ms\n setTimeout(() => {\n this.dispatchEvent(new CustomEvent('nr-tag-close', { bubbles: true, composed: true }));\n // Consumers can remove the element on event; keep visible otherwise\n this.closing = false;\n }, 200);\n }\n\n private onToggleChecked() {\n if (!this.checkable || this.disabled) return;\n this.checked = !this.checked;\n this.dispatchEvent(new CustomEvent<TagCheckedChangeDetail>('nr-tag-checked-change', {\n detail: { checked: this.checked },\n bubbles: true,\n composed: true,\n }));\n }\n\n private isPreset(color?: string): boolean {\n if (!color) return false;\n return PRESET_COLOR_SET.has(color as string);\n }\n\n override render() {\n const hasIcon = !!this.querySelector('[slot=\"icon\"]');\n const isCustom = !!this.color && !this.isPreset(this.color as string);\n\n const classes = {\n tag: true,\n 'tag--small': this.size === TagSize.Small,\n 'tag--borderless': !this.bordered,\n 'tag--closable': this.closable,\n 'tag--checkable': this.checkable,\n 'tag--checked': this.checkable && this.checked,\n 'tag--disabled': this.disabled,\n 'tag--closing': this.closing,\n // preset color class e.g., tag--red\n ...(this.color && this.isPreset(this.color as string) ? { [`tag--${this.color}`]: true } : {}),\n // custom color modifier\n 'tag--custom': isCustom,\n };\n\n const styleMap: Record<string, string> = {};\n if (isCustom && this.color) {\n styleMap['--nr-tag-custom-bg'] = this.color as string;\n }\n\n const role = this.checkable ? 'switch' : 'button';\n const ariaPressed: 'true' | 'false' | undefined = this.checkable ? (this.checked ? 'true' : 'false') : undefined;\n\n return html`\n <span\n class=${classMap(classes)}\n style=${Object.entries(styleMap).map(([k, v]) => `${k}: ${v}`).join(';')}\n role=${role}\n aria-pressed=${ifDefined(ariaPressed)}\n aria-disabled=${this.disabled ? 'true' : 'false'}\n @click=${this.checkable ? this.onToggleChecked : undefined}\n >\n ${hasIcon ? html`<span class=\"tag__icon\"><slot name=\"icon\"></slot></span>` : nothing}\n <span class=\"tag__content\"><slot></slot></span>\n ${this.closable ? html`\n <button class=\"tag__close\" part=\"close\" aria-label=\"close\" ?disabled=${this.disabled} @click=${this.onCloseClick}>\n ×\n </button>\n ` : nothing}\n </span>\n `;\n }\n}\n\nconst PRESET_COLOR_SET: Set<string> = new Set([\n 'magenta','red','volcano','orange','gold','lime','green','cyan','blue','geekblue','purple'\n]);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nr-tag': NrTagElement;\n }\n}\n"]}
|