@nuralyui/badge 0.0.2 → 0.0.4
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 +3 -329
- package/package.json +1 -1
package/bundle.js
CHANGED
|
@@ -1,337 +1,11 @@
|
|
|
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,e=Symbol(),s=new WeakMap;class o{constructor(t,i,s){if(this._$cssResult$=!0,s!==e)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=i}get styleSheet(){let t=this.o;const e=this.t;if(i&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=s.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&s.set(e,t))}return t}toString(){return this.cssText}}const r=i?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let i="";for(const e of t.cssRules)i+=e.cssText;return(t=>new o("string"==typeof t?t:t+"",void 0,e))(i)})(t):t
|
|
7
|
-
/**
|
|
8
|
-
* @license
|
|
9
|
-
* Copyright 2017 Google LLC
|
|
10
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
|
-
*/;var n;const a=window,l=a.trustedTypes,h=l?l.emptyScript:"",d=a.reactiveElementPolyfillSupport,c={toAttribute(t,i){switch(i){case Boolean:t=t?h:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,i){let e=t;switch(i){case Boolean:e=null!==t;break;case Number:e=null===t?null:Number(t);break;case Object:case Array:try{e=JSON.parse(t)}catch(t){e=null}}return e}},u=(t,i)=>i!==t&&(i==i||t==t),v={attribute:!0,type:String,converter:c,reflect:!1,hasChanged:u},g="finalized";class b 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,e)=>{const s=this._$Ep(e,i);void 0!==s&&(this._$Ev.set(s,e),t.push(s))})),t}static createProperty(t,i=v){if(i.state&&(i.attribute=!1),this.finalize(),this.elementProperties.set(t,i),!i.noAccessor&&!this.prototype.hasOwnProperty(t)){const e="symbol"==typeof t?Symbol():"__"+t,s=this.getPropertyDescriptor(t,e,i);void 0!==s&&Object.defineProperty(this.prototype,t,s)}}static getPropertyDescriptor(t,i,e){return{get(){return this[i]},set(s){const o=this[t];this[i]=s,this.requestUpdate(t,o,e)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||v}static finalize(){if(this.hasOwnProperty(g))return!1;this[g]=!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 e of i)this.createProperty(e,t[e])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const i=[];if(Array.isArray(t)){const e=new Set(t.flat(1/0).reverse());for(const t of e)i.unshift(r(t))}else void 0!==t&&i.push(r(t));return i}static _$Ep(t,i){const e=i.attribute;return!1===e?void 0:"string"==typeof e?e:"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,e;(null!==(i=this._$ES)&&void 0!==i?i:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(e=t.hostConnected)||void 0===e||e.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 e;const s=null!==(e=this.shadowRoot)&&void 0!==e?e:this.attachShadow(this.constructor.shadowRootOptions);return((e,s)=>{i?e.adoptedStyleSheets=s.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):s.forEach((i=>{const s=document.createElement("style"),o=t.litNonce;void 0!==o&&s.setAttribute("nonce",o),s.textContent=i.cssText,e.appendChild(s)}))})(s,this.constructor.elementStyles),s}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,e){this._$AK(t,e)}_$EO(t,i,e=v){var s;const o=this.constructor._$Ep(t,e);if(void 0!==o&&!0===e.reflect){const r=(void 0!==(null===(s=e.converter)||void 0===s?void 0:s.toAttribute)?e.converter:c).toAttribute(i,e.type);this._$El=t,null==r?this.removeAttribute(o):this.setAttribute(o,r),this._$El=null}}_$AK(t,i){var e;const s=this.constructor,o=s._$Ev.get(t);if(void 0!==o&&this._$El!==o){const t=s.getPropertyOptions(o),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(e=t.converter)||void 0===e?void 0:e.fromAttribute)?t.converter:c;this._$El=o,this[o]=r.fromAttribute(i,t.type),this._$El=null}}requestUpdate(t,i,e){let s=!0;void 0!==t&&(((e=e||this.constructor.getPropertyOptions(t)).hasChanged||u)(this[t],i)?(this._$AL.has(t)||this._$AL.set(t,i),!0===e.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,e))):s=!1),!this.isUpdatePending&&s&&(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 e=this._$AL;try{i=this.shouldUpdate(e),i?(this.willUpdate(e),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(e)):this._$Ek()}catch(t){throw i=!1,this._$Ek(),t}i&&this._$AE(e)}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 f;b[g]=!0,b.elementProperties=new Map,b.elementStyles=[],b.shadowRootOptions={mode:"open"},null==d||d({ReactiveElement:b}),(null!==(n=a.reactiveElementVersions)&&void 0!==n?n:a.reactiveElementVersions=[]).push("1.6.3");const p=window,y=p.trustedTypes,m=y?y.createPolicy("lit-html",{createHTML:t=>t}):void 0,w="$lit$",$=`lit$${(Math.random()+"").slice(9)}$`,x="?"+$,k=`<${x}>`,S=document,A=()=>S.createComment(""),C=t=>null===t||"object"!=typeof t&&"function"!=typeof t,E=Array.isArray,_="[ \t\n\f\r]",j=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,z=/-->/g,O=/>/g,T=RegExp(`>|${_}(?:([^\\s"'>=/]+)(${_}*=${_}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),M=/'/g,R=/"/g,U=/^(?:script|style|textarea|title)$/i,N=Symbol.for("lit-noChange"),D=Symbol.for("lit-nothing"),P=new WeakMap,I=S.createTreeWalker(S,129,null,!1);function B(t,i){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==m?m.createHTML(i):i}class L{constructor({strings:t,_$litType$:i},e){let s;this.parts=[];let o=0,r=0;const n=t.length-1,a=this.parts,[l,h]=((t,i)=>{const e=t.length-1,s=[];let o,r=2===i?"<svg>":"",n=j;for(let i=0;i<e;i++){const e=t[i];let a,l,h=-1,d=0;for(;d<e.length&&(n.lastIndex=d,l=n.exec(e),null!==l);)d=n.lastIndex,n===j?"!--"===l[1]?n=z:void 0!==l[1]?n=O:void 0!==l[2]?(U.test(l[2])&&(o=RegExp("</"+l[2],"g")),n=T):void 0!==l[3]&&(n=T):n===T?">"===l[0]?(n=null!=o?o:j,h=-1):void 0===l[1]?h=-2:(h=n.lastIndex-l[2].length,a=l[1],n=void 0===l[3]?T:'"'===l[3]?R:M):n===R||n===M?n=T:n===z||n===O?n=j:(n=T,o=void 0);const c=n===T&&t[i+1].startsWith("/>")?" ":"";r+=n===j?e+k:h>=0?(s.push(a),e.slice(0,h)+w+e.slice(h)+$+c):e+$+(-2===h?(s.push(void 0),i):c)}return[B(t,r+(t[e]||"<?>")+(2===i?"</svg>":"")),s]})(t,i);if(this.el=L.createElement(l,e),I.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(s=I.nextNode())&&a.length<n;){if(1===s.nodeType){if(s.hasAttributes()){const t=[];for(const i of s.getAttributeNames())if(i.endsWith(w)||i.startsWith($)){const e=h[r++];if(t.push(i),void 0!==e){const t=s.getAttribute(e.toLowerCase()+w).split($),i=/([.?@])?(.*)/.exec(e);a.push({type:1,index:o,name:i[2],strings:t,ctor:"."===i[1]?V:"?"===i[1]?F:"@"===i[1]?J:q})}else a.push({type:6,index:o})}for(const i of t)s.removeAttribute(i)}if(U.test(s.tagName)){const t=s.textContent.split($),i=t.length-1;if(i>0){s.textContent=y?y.emptyScript:"";for(let e=0;e<i;e++)s.append(t[e],A()),I.nextNode(),a.push({type:2,index:++o});s.append(t[i],A())}}}else if(8===s.nodeType)if(s.data===x)a.push({type:2,index:o});else{let t=-1;for(;-1!==(t=s.data.indexOf($,t+1));)a.push({type:7,index:o}),t+=$.length-1}o++}}static createElement(t,i){const e=S.createElement("template");return e.innerHTML=t,e}}function H(t,i,e=t,s){var o,r,n,a;if(i===N)return i;let l=void 0!==s?null===(o=e._$Co)||void 0===o?void 0:o[s]:e._$Cl;const h=C(i)?void 0:i._$litDirective$;return(null==l?void 0:l.constructor)!==h&&(null===(r=null==l?void 0:l._$AO)||void 0===r||r.call(l,!1),void 0===h?l=void 0:(l=new h(t),l._$AT(t,e,s)),void 0!==s?(null!==(n=(a=e)._$Co)&&void 0!==n?n:a._$Co=[])[s]=l:e._$Cl=l),void 0!==l&&(i=H(t,l._$AS(t,i.values),l,s)),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:e},parts:s}=this._$AD,o=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:S).importNode(e,!0);I.currentNode=o;let r=I.nextNode(),n=0,a=0,l=s[0];for(;void 0!==l;){if(n===l.index){let i;2===l.type?i=new Z(r,r.nextSibling,this,t):1===l.type?i=new l.ctor(r,l.name,l.strings,this,t):6===l.type&&(i=new G(r,this,t)),this._$AV.push(i),l=s[++a]}n!==(null==l?void 0:l.index)&&(r=I.nextNode(),n++)}return I.currentNode=S,o}v(t){let i=0;for(const e of this._$AV)void 0!==e&&(void 0!==e.strings?(e._$AI(t,e,i),i+=e.strings.length-2):e._$AI(t[i])),i++}}class Z{constructor(t,i,e,s){var o;this.type=2,this._$AH=D,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=e,this.options=s,this._$Cp=null===(o=null==s?void 0:s.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=H(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=>E(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.$(S.createTextNode(t)),this._$AH=t}g(t){var i;const{values:e,_$litType$:s}=t,o="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=L.createElement(B(s.h,s.h[0]),this.options)),s);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===o)this._$AH.v(e);else{const t=new K(o,this),i=t.u(this.options);t.v(e),this.$(i),this._$AH=t}}_$AC(t){let i=P.get(t.strings);return void 0===i&&P.set(t.strings,i=new L(t)),i}T(t){E(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let e,s=0;for(const o of t)s===i.length?i.push(e=new Z(this.k(A()),this.k(A()),this,this.options)):e=i[s],e._$AI(o),s++;s<i.length&&(this._$AR(e&&e._$AB.nextSibling,s),i.length=s)}_$AR(t=this._$AA.nextSibling,i){var e;for(null===(e=this._$AP)||void 0===e||e.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 q{constructor(t,i,e,s,o){this.type=1,this._$AH=D,this._$AN=void 0,this.element=t,this.name=i,this._$AM=s,this.options=o,e.length>2||""!==e[0]||""!==e[1]?(this._$AH=Array(e.length-1).fill(new String),this.strings=e):this._$AH=D}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,e,s){const o=this.strings;let r=!1;if(void 0===o)t=H(this,t,i,0),r=!C(t)||t!==this._$AH&&t!==N,r&&(this._$AH=t);else{const s=t;let n,a;for(t=o[0],n=0;n<o.length-1;n++)a=H(this,s[e+n],i,n),a===N&&(a=this._$AH[n]),r||(r=!C(a)||a!==this._$AH[n]),a===D?t=D:t!==D&&(t+=(null!=a?a:"")+o[n+1]),this._$AH[n]=a}r&&!s&&this.j(t)}j(t){t===D?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class V extends q{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===D?void 0:t}}const W=y?y.emptyScript:"";class F extends q{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 q{constructor(t,i,e,s,o){super(t,i,e,s,o),this.type=5}_$AI(t,i=this){var e;if((t=null!==(e=H(this,t,i,0))&&void 0!==e?e:D)===N)return;const s=this._$AH,o=t===D&&s!==D||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,r=t!==D&&(s===D||o);o&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var i,e;"function"==typeof this._$AH?this._$AH.call(null!==(e=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==e?e:this.element,t):this._$AH.handleEvent(t)}}class G{constructor(t,i,e){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=e}get _$AU(){return this._$AM._$AU}_$AI(t){H(this,t)}}const Q=p.litHtmlPolyfillSupport;
|
|
18
|
-
/**
|
|
19
|
-
* @license
|
|
20
|
-
* Copyright 2017 Google LLC
|
|
21
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
22
|
-
*/
|
|
23
|
-
var X;null==Q||Q(L,Z),(null!==(f=p.litHtmlVersions)&&void 0!==f?f:p.litHtmlVersions=[]).push("2.8.0");const Y=window,tt=Y.trustedTypes,it=tt?tt.createPolicy("lit-html",{createHTML:t=>t}):void 0,et="$lit$",st=`lit$${(Math.random()+"").slice(9)}$`,ot="?"+st,rt=`<${ot}>`,nt=document,at=()=>nt.createComment(""),lt=t=>null===t||"object"!=typeof t&&"function"!=typeof t,ht=Array.isArray,dt="[ \t\n\f\r]",ct=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ut=/-->/g,vt=/>/g,gt=RegExp(`>|${dt}(?:([^\\s"'>=/]+)(${dt}*=${dt}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),bt=/'/g,ft=/"/g,pt=/^(?:script|style|textarea|title)$/i,yt=(t=>(i,...e)=>({_$litType$:t,strings:i,values:e}))(1),mt=Symbol.for("lit-noChange"),wt=Symbol.for("lit-nothing"),$t=new WeakMap,xt=nt.createTreeWalker(nt,129,null,!1);function kt(t,i){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==it?it.createHTML(i):i}const St=(t,i)=>{const e=t.length-1,s=[];let o,r=2===i?"<svg>":"",n=ct;for(let i=0;i<e;i++){const e=t[i];let a,l,h=-1,d=0;for(;d<e.length&&(n.lastIndex=d,l=n.exec(e),null!==l);)d=n.lastIndex,n===ct?"!--"===l[1]?n=ut:void 0!==l[1]?n=vt:void 0!==l[2]?(pt.test(l[2])&&(o=RegExp("</"+l[2],"g")),n=gt):void 0!==l[3]&&(n=gt):n===gt?">"===l[0]?(n=null!=o?o:ct,h=-1):void 0===l[1]?h=-2:(h=n.lastIndex-l[2].length,a=l[1],n=void 0===l[3]?gt:'"'===l[3]?ft:bt):n===ft||n===bt?n=gt:n===ut||n===vt?n=ct:(n=gt,o=void 0);const c=n===gt&&t[i+1].startsWith("/>")?" ":"";r+=n===ct?e+rt:h>=0?(s.push(a),e.slice(0,h)+et+e.slice(h)+st+c):e+st+(-2===h?(s.push(void 0),i):c)}return[kt(t,r+(t[e]||"<?>")+(2===i?"</svg>":"")),s]};class At{constructor({strings:t,_$litType$:i},e){let s;this.parts=[];let o=0,r=0;const n=t.length-1,a=this.parts,[l,h]=St(t,i);if(this.el=At.createElement(l,e),xt.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(s=xt.nextNode())&&a.length<n;){if(1===s.nodeType){if(s.hasAttributes()){const t=[];for(const i of s.getAttributeNames())if(i.endsWith(et)||i.startsWith(st)){const e=h[r++];if(t.push(i),void 0!==e){const t=s.getAttribute(e.toLowerCase()+et).split(st),i=/([.?@])?(.*)/.exec(e);a.push({type:1,index:o,name:i[2],strings:t,ctor:"."===i[1]?zt:"?"===i[1]?Tt:"@"===i[1]?Mt:jt})}else a.push({type:6,index:o})}for(const i of t)s.removeAttribute(i)}if(pt.test(s.tagName)){const t=s.textContent.split(st),i=t.length-1;if(i>0){s.textContent=tt?tt.emptyScript:"";for(let e=0;e<i;e++)s.append(t[e],at()),xt.nextNode(),a.push({type:2,index:++o});s.append(t[i],at())}}}else if(8===s.nodeType)if(s.data===ot)a.push({type:2,index:o});else{let t=-1;for(;-1!==(t=s.data.indexOf(st,t+1));)a.push({type:7,index:o}),t+=st.length-1}o++}}static createElement(t,i){const e=nt.createElement("template");return e.innerHTML=t,e}}function Ct(t,i,e=t,s){var o,r,n,a;if(i===mt)return i;let l=void 0!==s?null===(o=e._$Co)||void 0===o?void 0:o[s]:e._$Cl;const h=lt(i)?void 0:i._$litDirective$;return(null==l?void 0:l.constructor)!==h&&(null===(r=null==l?void 0:l._$AO)||void 0===r||r.call(l,!1),void 0===h?l=void 0:(l=new h(t),l._$AT(t,e,s)),void 0!==s?(null!==(n=(a=e)._$Co)&&void 0!==n?n:a._$Co=[])[s]=l:e._$Cl=l),void 0!==l&&(i=Ct(t,l._$AS(t,i.values),l,s)),i}class Et{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:e},parts:s}=this._$AD,o=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:nt).importNode(e,!0);xt.currentNode=o;let r=xt.nextNode(),n=0,a=0,l=s[0];for(;void 0!==l;){if(n===l.index){let i;2===l.type?i=new _t(r,r.nextSibling,this,t):1===l.type?i=new l.ctor(r,l.name,l.strings,this,t):6===l.type&&(i=new Rt(r,this,t)),this._$AV.push(i),l=s[++a]}n!==(null==l?void 0:l.index)&&(r=xt.nextNode(),n++)}return xt.currentNode=nt,o}v(t){let i=0;for(const e of this._$AV)void 0!==e&&(void 0!==e.strings?(e._$AI(t,e,i),i+=e.strings.length-2):e._$AI(t[i])),i++}}class _t{constructor(t,i,e,s){var o;this.type=2,this._$AH=wt,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=e,this.options=s,this._$Cp=null===(o=null==s?void 0:s.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),lt(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&<(this._$AH)?this._$AA.nextSibling.data=t:this.$(nt.createTextNode(t)),this._$AH=t}g(t){var i;const{values:e,_$litType$:s}=t,o="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=At.createElement(kt(s.h,s.h[0]),this.options)),s);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===o)this._$AH.v(e);else{const t=new Et(o,this),i=t.u(this.options);t.v(e),this.$(i),this._$AH=t}}_$AC(t){let i=$t.get(t.strings);return void 0===i&&$t.set(t.strings,i=new At(t)),i}T(t){ht(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let e,s=0;for(const o of t)s===i.length?i.push(e=new _t(this.k(at()),this.k(at()),this,this.options)):e=i[s],e._$AI(o),s++;s<i.length&&(this._$AR(e&&e._$AB.nextSibling,s),i.length=s)}_$AR(t=this._$AA.nextSibling,i){var e;for(null===(e=this._$AP)||void 0===e||e.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 jt{constructor(t,i,e,s,o){this.type=1,this._$AH=wt,this._$AN=void 0,this.element=t,this.name=i,this._$AM=s,this.options=o,e.length>2||""!==e[0]||""!==e[1]?(this._$AH=Array(e.length-1).fill(new String),this.strings=e):this._$AH=wt}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,e,s){const o=this.strings;let r=!1;if(void 0===o)t=Ct(this,t,i,0),r=!lt(t)||t!==this._$AH&&t!==mt,r&&(this._$AH=t);else{const s=t;let n,a;for(t=o[0],n=0;n<o.length-1;n++)a=Ct(this,s[e+n],i,n),a===mt&&(a=this._$AH[n]),r||(r=!lt(a)||a!==this._$AH[n]),a===wt?t=wt:t!==wt&&(t+=(null!=a?a:"")+o[n+1]),this._$AH[n]=a}r&&!s&&this.j(t)}j(t){t===wt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class zt extends jt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===wt?void 0:t}}const Ot=tt?tt.emptyScript:"";class Tt extends jt{constructor(){super(...arguments),this.type=4}j(t){t&&t!==wt?this.element.setAttribute(this.name,Ot):this.element.removeAttribute(this.name)}}class Mt extends jt{constructor(t,i,e,s,o){super(t,i,e,s,o),this.type=5}_$AI(t,i=this){var e;if((t=null!==(e=Ct(this,t,i,0))&&void 0!==e?e:wt)===mt)return;const s=this._$AH,o=t===wt&&s!==wt||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,r=t!==wt&&(s===wt||o);o&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var i,e;"function"==typeof this._$AH?this._$AH.call(null!==(e=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==e?e:this.element,t):this._$AH.handleEvent(t)}}class Rt{constructor(t,i,e){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=e}get _$AU(){return this._$AM._$AU}_$AI(t){Ct(this,t)}}const Ut=Y.litHtmlPolyfillSupport;null==Ut||Ut(At,_t),(null!==(X=Y.litHtmlVersions)&&void 0!==X?X:Y.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 Pt extends b{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,i;const e=super.createRenderRoot();return null!==(t=(i=this.renderOptions).renderBefore)&&void 0!==t||(i.renderBefore=e.firstChild),e}update(t){const i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,i,e)=>{var s,o;const r=null!==(s=null==e?void 0:e.renderBefore)&&void 0!==s?s:i;let n=r._$litPart$;if(void 0===n){const t=null!==(o=null==e?void 0:e.renderBefore)&&void 0!==o?o:null;r._$litPart$=n=new _t(i.insertBefore(at(),t),t,void 0,null!=e?e:{})}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
|
-
/**
|
|
31
|
-
* @license
|
|
32
|
-
* Copyright 2017 Google LLC
|
|
33
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
34
|
-
*/
|
|
35
|
-
const Bt=(t,i)=>"method"===i.kind&&i.descriptor&&!("value"in i.descriptor)?{...i,finisher(e){e.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(e){e.createProperty(i.key,t)}};
|
|
36
|
-
/**
|
|
37
|
-
* @license
|
|
38
|
-
* Copyright 2017 Google LLC
|
|
39
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
40
|
-
*/function Lt(t){return(i,e)=>void 0!==e?((t,i,e)=>{i.constructor.createProperty(e,t)})(t,i,e):Bt(t,i)
|
|
41
|
-
/**
|
|
42
|
-
* @license
|
|
43
|
-
* Copyright 2021 Google LLC
|
|
44
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
45
|
-
*/}var Ht;null===(Ht=window.HTMLSlotElement)||void 0===Ht||Ht.prototype.assignedElements;
|
|
46
|
-
/**
|
|
47
|
-
* @license
|
|
48
|
-
* Copyright 2017 Google LLC
|
|
49
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
50
|
-
*/
|
|
51
|
-
const Kt=1,Zt=t=>(...i)=>({_$litDirective$:t,values:i});class qt{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,i,e){this._$Ct=t,this._$AM=i,this._$Ci=e}_$AS(t,i){return this.update(t,i)}update(t,i){return this.render(...i)}}
|
|
52
|
-
/**
|
|
53
|
-
* @license
|
|
54
|
-
* Copyright 2018 Google LLC
|
|
55
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
56
|
-
*/const Vt=Zt(class extends qt{constructor(t){var i;if(super(t),t.type!==Kt||"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 e,s;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===(e=this.nt)||void 0===e?void 0:e.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 e=!!i[t];e===this.it.has(t)||(null===(s=this.nt)||void 0===s?void 0:s.has(t))||(e?(o.add(t),this.it.add(t)):(o.remove(t),this.it.delete(t)))}return N}}),Wt="important",Ft=" !"+Wt,Jt=Zt(class extends qt{constructor(t){var i;if(super(t),t.type!==Kt||"style"!==t.name||(null===(i=t.strings)||void 0===i?void 0:i.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce(((i,e)=>{const s=t[e];return null==s?i:i+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`}),"")}update(t,[i]){const{style:e}=t.element;if(void 0===this.ht){this.ht=new Set;for(const t in i)this.ht.add(t);return this.render(i)}this.ht.forEach((t=>{null==i[t]&&(this.ht.delete(t),t.includes("-")?e.removeProperty(t):e[t]="")}));for(const t in i){const s=i[t];if(null!=s){this.ht.add(t);const i="string"==typeof s&&s.endsWith(Ft);t.includes("-")||i?e.setProperty(t,i?s.slice(0,-11):s,i?Wt:""):e[t]=s}}return N}}),Gt=((t,...i)=>{const s=1===t.length?t[0]:i.reduce(((i,e,s)=>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.")})(e)+t[s+1]),t[0]);return new o(s,t,e)})`
|
|
57
|
-
:host {
|
|
58
|
-
display: inline-block;
|
|
59
|
-
position: relative;
|
|
60
|
-
font-family: var(--nuraly-font-family);
|
|
61
|
-
font-size: var(--nuraly-badge-text-font-size, 12px);
|
|
62
|
-
line-height: 1;
|
|
63
|
-
vertical-align: middle;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/* Badge wrapper for positioning */
|
|
67
|
-
.badge-wrapper {
|
|
68
|
-
position: relative;
|
|
69
|
-
display: inline-block;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/* Main badge indicator (count or dot) */
|
|
73
|
-
.badge-indicator {
|
|
74
|
-
position: absolute;
|
|
75
|
-
top: 0;
|
|
76
|
-
right: 0;
|
|
77
|
-
transform: translate(50%, -50%);
|
|
78
|
-
transform-origin: 100% 0%;
|
|
79
|
-
z-index: var(--nuraly-badge-indicator-z-index, auto);
|
|
80
|
-
display: inline-flex;
|
|
81
|
-
align-items: center;
|
|
82
|
-
justify-content: center;
|
|
83
|
-
min-width: var(--nuraly-badge-indicator-height, 20px);
|
|
84
|
-
height: var(--nuraly-badge-indicator-height, 20px);
|
|
85
|
-
padding: 0 6px;
|
|
86
|
-
font-size: var(--nuraly-badge-text-font-size, 12px);
|
|
87
|
-
font-weight: var(--nuraly-badge-text-font-weight, normal);
|
|
88
|
-
line-height: var(--nuraly-badge-indicator-height, 20px);
|
|
89
|
-
white-space: nowrap;
|
|
90
|
-
text-align: center;
|
|
91
|
-
background-color: var(--nuraly-color-error, #ff4d4f);
|
|
92
|
-
color: #fff;
|
|
93
|
-
border-radius: 10px;
|
|
94
|
-
box-shadow: 0 0 0 1px var(--nuraly-color-background, #fff);
|
|
95
|
-
transition: all var(--nuraly-transition-fast, 0.15s) ease;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/* Small size badge */
|
|
99
|
-
.badge-indicator.small {
|
|
100
|
-
min-width: var(--nuraly-badge-indicator-height-sm, 14px);
|
|
101
|
-
height: var(--nuraly-badge-indicator-height-sm, 14px);
|
|
102
|
-
padding: 0 4px;
|
|
103
|
-
font-size: var(--nuraly-badge-text-font-size-sm, 12px);
|
|
104
|
-
line-height: var(--nuraly-badge-indicator-height-sm, 14px);
|
|
105
|
-
border-radius: 7px;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/* Dot badge (small indicator without count) */
|
|
109
|
-
.badge-indicator.dot {
|
|
110
|
-
min-width: var(--nuraly-badge-dot-size, 6px);
|
|
111
|
-
width: var(--nuraly-badge-dot-size, 6px);
|
|
112
|
-
height: var(--nuraly-badge-dot-size, 6px);
|
|
113
|
-
padding: 0;
|
|
114
|
-
border-radius: 50%;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
/* Standalone badge (no children) */
|
|
118
|
-
.badge-standalone {
|
|
119
|
-
position: relative;
|
|
120
|
-
display: inline-block;
|
|
121
|
-
transform: none;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
/* Status badge styles */
|
|
125
|
-
.badge-status {
|
|
126
|
-
display: inline-flex;
|
|
127
|
-
align-items: center;
|
|
128
|
-
gap: var(--nuraly-spacing-2, 0.5rem);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
.badge-status-dot {
|
|
132
|
-
width: var(--nuraly-badge-status-size, 6px);
|
|
133
|
-
height: var(--nuraly-badge-status-size, 6px);
|
|
134
|
-
border-radius: 50%;
|
|
135
|
-
display: inline-block;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
.badge-status-text {
|
|
139
|
-
color: var(--nuraly-color-text);
|
|
140
|
-
font-size: var(--nuraly-font-size-base, 14px);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
/* Status colors */
|
|
144
|
-
.badge-status-dot.success {
|
|
145
|
-
background-color: var(--nuraly-color-success, #52c41a);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
.badge-status-dot.processing {
|
|
149
|
-
background-color: var(--nuraly-color-primary, #1890ff);
|
|
150
|
-
position: relative;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
.badge-status-dot.processing::after {
|
|
154
|
-
content: '';
|
|
155
|
-
position: absolute;
|
|
156
|
-
top: -1px;
|
|
157
|
-
left: -1px;
|
|
158
|
-
width: 100%;
|
|
159
|
-
height: 100%;
|
|
160
|
-
border: 1px solid var(--nuraly-color-primary, #1890ff);
|
|
161
|
-
border-radius: 50%;
|
|
162
|
-
animation: badge-processing 1.2s infinite ease-in-out;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
@keyframes badge-processing {
|
|
166
|
-
0% {
|
|
167
|
-
transform: scale(0.8);
|
|
168
|
-
opacity: 0.5;
|
|
169
|
-
}
|
|
170
|
-
100% {
|
|
171
|
-
transform: scale(2.4);
|
|
172
|
-
opacity: 0;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
.badge-status-dot.default {
|
|
177
|
-
background-color: var(--nuraly-color-text-secondary, #8c8c8c);
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
.badge-status-dot.error {
|
|
181
|
-
background-color: var(--nuraly-color-error, #ff4d4f);
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
.badge-status-dot.warning {
|
|
185
|
-
background-color: var(--nuraly-color-warning, #faad14);
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
/* Color variants for badge indicator */
|
|
189
|
-
.badge-indicator.pink { background-color: #eb2f96; }
|
|
190
|
-
.badge-indicator.red { background-color: #f5222d; }
|
|
191
|
-
.badge-indicator.yellow { background-color: #fadb14; color: rgba(0, 0, 0, 0.85); }
|
|
192
|
-
.badge-indicator.orange { background-color: #fa8c16; }
|
|
193
|
-
.badge-indicator.cyan { background-color: #13c2c2; }
|
|
194
|
-
.badge-indicator.green { background-color: #52c41a; }
|
|
195
|
-
.badge-indicator.blue { background-color: #1890ff; }
|
|
196
|
-
.badge-indicator.purple { background-color: #722ed1; }
|
|
197
|
-
.badge-indicator.geekblue { background-color: #2f54eb; }
|
|
198
|
-
.badge-indicator.magenta { background-color: #eb2f96; }
|
|
199
|
-
.badge-indicator.volcano { background-color: #fa541c; }
|
|
200
|
-
.badge-indicator.gold { background-color: #faad14; color: rgba(0, 0, 0, 0.85); }
|
|
201
|
-
.badge-indicator.lime { background-color: #a0d911; color: rgba(0, 0, 0, 0.85); }
|
|
202
|
-
|
|
203
|
-
/* Ribbon badge styles */
|
|
204
|
-
.badge-ribbon-wrapper {
|
|
205
|
-
position: relative;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
.badge-ribbon {
|
|
209
|
-
position: absolute;
|
|
210
|
-
top: var(--nuraly-spacing-2, 0.5rem);
|
|
211
|
-
height: 22px;
|
|
212
|
-
padding: 0 var(--nuraly-spacing-2, 0.5rem);
|
|
213
|
-
color: #fff;
|
|
214
|
-
line-height: 22px;
|
|
215
|
-
white-space: nowrap;
|
|
216
|
-
background-color: var(--nuraly-color-primary, #1890ff);
|
|
217
|
-
border-radius: 2px;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
.badge-ribbon.start {
|
|
221
|
-
left: calc(-1 * var(--nuraly-spacing-1, 0.25rem));
|
|
222
|
-
padding-left: var(--nuraly-spacing-2, 0.5rem);
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
.badge-ribbon.end {
|
|
226
|
-
right: calc(-1 * var(--nuraly-spacing-1, 0.25rem));
|
|
227
|
-
padding-right: var(--nuraly-spacing-2, 0.5rem);
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
.badge-ribbon::after {
|
|
231
|
-
content: '';
|
|
232
|
-
position: absolute;
|
|
233
|
-
top: 100%;
|
|
234
|
-
width: 0;
|
|
235
|
-
height: 0;
|
|
236
|
-
border: 4px solid transparent;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
.badge-ribbon.start::after {
|
|
240
|
-
left: 0;
|
|
241
|
-
border-top-color: currentColor;
|
|
242
|
-
border-left-color: currentColor;
|
|
243
|
-
filter: brightness(0.7);
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
.badge-ribbon.end::after {
|
|
247
|
-
right: 0;
|
|
248
|
-
border-top-color: currentColor;
|
|
249
|
-
border-right-color: currentColor;
|
|
250
|
-
filter: brightness(0.7);
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
/* Ribbon color variants */
|
|
254
|
-
.badge-ribbon.pink { background-color: #eb2f96; color: #fff; }
|
|
255
|
-
.badge-ribbon.red { background-color: #f5222d; color: #fff; }
|
|
256
|
-
.badge-ribbon.yellow { background-color: #fadb14; color: rgba(0, 0, 0, 0.85); }
|
|
257
|
-
.badge-ribbon.orange { background-color: #fa8c16; color: #fff; }
|
|
258
|
-
.badge-ribbon.cyan { background-color: #13c2c2; color: #fff; }
|
|
259
|
-
.badge-ribbon.green { background-color: #52c41a; color: #fff; }
|
|
260
|
-
.badge-ribbon.blue { background-color: #1890ff; color: #fff; }
|
|
261
|
-
.badge-ribbon.purple { background-color: #722ed1; color: #fff; }
|
|
262
|
-
.badge-ribbon.geekblue { background-color: #2f54eb; color: #fff; }
|
|
263
|
-
.badge-ribbon.magenta { background-color: #eb2f96; color: #fff; }
|
|
264
|
-
.badge-ribbon.volcano { background-color: #fa541c; color: #fff; }
|
|
265
|
-
.badge-ribbon.gold { background-color: #faad14; color: rgba(0, 0, 0, 0.85); }
|
|
266
|
-
.badge-ribbon.lime { background-color: #a0d911; color: rgba(0, 0, 0, 0.85); }
|
|
267
|
-
|
|
268
|
-
/* Hidden state */
|
|
269
|
-
.badge-hidden {
|
|
270
|
-
display: none;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
/* RTL Support */
|
|
274
|
-
:host([dir="rtl"]) .badge-indicator {
|
|
275
|
-
right: auto;
|
|
276
|
-
left: 0;
|
|
277
|
-
transform: translate(-50%, -50%);
|
|
278
|
-
transform-origin: 0% 0%;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
:host([dir="rtl"]) .badge-ribbon.start {
|
|
282
|
-
left: auto;
|
|
283
|
-
right: calc(-1 * var(--nuraly-spacing-1, 0.25rem));
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
:host([dir="rtl"]) .badge-ribbon.end {
|
|
287
|
-
right: auto;
|
|
288
|
-
left: calc(-1 * var(--nuraly-spacing-1, 0.25rem));
|
|
289
|
-
}
|
|
290
|
-
`
|
|
1
|
+
import{css as r,LitElement as o,html as a,nothing as t}from"lit";import{property as e,customElement as i}from"lit/decorators.js";import{classMap as n}from"lit/directives/class-map.js";import{styleMap as d}from"lit/directives/style-map.js";import{NuralyUIBaseMixin as l}from"@nuralyui/common/mixins";
|
|
291
2
|
/**
|
|
292
3
|
* @license
|
|
293
4
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
294
5
|
* SPDX-License-Identifier: MIT
|
|
295
|
-
|
|
296
|
-
/**
|
|
297
|
-
* @license
|
|
298
|
-
* Copyright 2018 Google LLC
|
|
299
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
300
|
-
*/
|
|
6
|
+
*/const s=r`:host{display:inline-block;position:relative;font-family:var(--nuraly-font-family);font-size:var(--nuraly-badge-text-font-size,12px);line-height:1;vertical-align:middle}.badge-wrapper{position:relative;display:inline-block}.badge-indicator{position:absolute;top:0;right:0;transform:translate(50%,-50%);transform-origin:100% 0;z-index:var(--nuraly-badge-indicator-z-index,auto);display:inline-flex;align-items:center;justify-content:center;min-width:var(--nuraly-badge-indicator-height,20px);height:var(--nuraly-badge-indicator-height,20px);padding:0 6px;font-size:var(--nuraly-badge-text-font-size,12px);font-weight:var(--nuraly-badge-text-font-weight,normal);line-height:var(--nuraly-badge-indicator-height,20px);white-space:nowrap;text-align:center;background-color:var(--nuraly-color-error,#ff4d4f);color:#fff;border-radius:10px;box-shadow:0 0 0 1px var(--nuraly-color-background,#fff);transition:all var(--nuraly-transition-fast,.15s) ease}.badge-indicator.small{min-width:var(--nuraly-badge-indicator-height-sm,14px);height:var(--nuraly-badge-indicator-height-sm,14px);padding:0 4px;font-size:var(--nuraly-badge-text-font-size-sm,12px);line-height:var(--nuraly-badge-indicator-height-sm,14px);border-radius:7px}.badge-indicator.dot{min-width:var(--nuraly-badge-dot-size,6px);width:var(--nuraly-badge-dot-size,6px);height:var(--nuraly-badge-dot-size,6px);padding:0;border-radius:50%}.badge-standalone{position:relative;display:inline-block;transform:none}.badge-status{display:inline-flex;align-items:center;gap:var(--nuraly-spacing-2,.5rem)}.badge-status-dot{width:var(--nuraly-badge-status-size,6px);height:var(--nuraly-badge-status-size,6px);border-radius:50%;display:inline-block}.badge-status-text{color:var(--nuraly-color-text);font-size:var(--nuraly-font-size-base,14px)}.badge-status-dot.success{background-color:var(--nuraly-color-success,#52c41a)}.badge-status-dot.processing{background-color:var(--nuraly-color-primary,#1890ff);position:relative}.badge-status-dot.processing::after{content:'';position:absolute;top:-1px;left:-1px;width:100%;height:100%;border:1px solid var(--nuraly-color-primary,#1890ff);border-radius:50%;animation:badge-processing 1.2s infinite ease-in-out}@keyframes badge-processing{0%{transform:scale(.8);opacity:.5}100%{transform:scale(2.4);opacity:0}}.badge-status-dot.default{background-color:var(--nuraly-color-text-secondary,#8c8c8c)}.badge-status-dot.error{background-color:var(--nuraly-color-error,#ff4d4f)}.badge-status-dot.warning{background-color:var(--nuraly-color-warning,#faad14)}.badge-indicator.pink{background-color:#eb2f96}.badge-indicator.red{background-color:#f5222d}.badge-indicator.yellow{background-color:#fadb14;color:rgba(0,0,0,.85)}.badge-indicator.orange{background-color:#fa8c16}.badge-indicator.cyan{background-color:#13c2c2}.badge-indicator.green{background-color:#52c41a}.badge-indicator.blue{background-color:#1890ff}.badge-indicator.purple{background-color:#722ed1}.badge-indicator.geekblue{background-color:#2f54eb}.badge-indicator.magenta{background-color:#eb2f96}.badge-indicator.volcano{background-color:#fa541c}.badge-indicator.gold{background-color:#faad14;color:rgba(0,0,0,.85)}.badge-indicator.lime{background-color:#a0d911;color:rgba(0,0,0,.85)}.badge-ribbon-wrapper{position:relative}.badge-ribbon{position:absolute;top:var(--nuraly-spacing-2,.5rem);height:22px;padding:0 var(--nuraly-spacing-2,.5rem);color:#fff;line-height:22px;white-space:nowrap;background-color:var(--nuraly-color-primary,#1890ff);border-radius:2px}.badge-ribbon.start{left:calc(-1 * var(--nuraly-spacing-1,.25rem));padding-left:var(--nuraly-spacing-2,.5rem)}.badge-ribbon.end{right:calc(-1 * var(--nuraly-spacing-1,.25rem));padding-right:var(--nuraly-spacing-2,.5rem)}.badge-ribbon::after{content:'';position:absolute;top:100%;width:0;height:0;border:4px solid transparent}.badge-ribbon.start::after{left:0;border-top-color:currentColor;border-left-color:currentColor;filter:brightness(.7)}.badge-ribbon.end::after{right:0;border-top-color:currentColor;border-right-color:currentColor;filter:brightness(.7)}.badge-ribbon.pink{background-color:#eb2f96;color:#fff}.badge-ribbon.red{background-color:#f5222d;color:#fff}.badge-ribbon.yellow{background-color:#fadb14;color:rgba(0,0,0,.85)}.badge-ribbon.orange{background-color:#fa8c16;color:#fff}.badge-ribbon.cyan{background-color:#13c2c2;color:#fff}.badge-ribbon.green{background-color:#52c41a;color:#fff}.badge-ribbon.blue{background-color:#1890ff;color:#fff}.badge-ribbon.purple{background-color:#722ed1;color:#fff}.badge-ribbon.geekblue{background-color:#2f54eb;color:#fff}.badge-ribbon.magenta{background-color:#eb2f96;color:#fff}.badge-ribbon.volcano{background-color:#fa541c;color:#fff}.badge-ribbon.gold{background-color:#faad14;color:rgba(0,0,0,.85)}.badge-ribbon.lime{background-color:#a0d911;color:rgba(0,0,0,.85)}.badge-hidden{display:none}:host([dir=rtl]) .badge-indicator{right:auto;left:0;transform:translate(-50%,-50%);transform-origin:0 0}:host([dir=rtl]) .badge-ribbon.start{left:auto;right:calc(-1 * var(--nuraly-spacing-1,.25rem))}:host([dir=rtl]) .badge-ribbon.end{right:auto;left:calc(-1 * var(--nuraly-spacing-1,.25rem))}`
|
|
301
7
|
/**
|
|
302
8
|
* @license
|
|
303
9
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
304
10
|
* SPDX-License-Identifier: MIT
|
|
305
|
-
|
|
306
|
-
var ii=function(t,i,e,s){for(var o,r=arguments.length,n=r<3?i:null===s?s=Object.getOwnPropertyDescriptor(i,e):s,a=t.length-1;a>=0;a--)(o=t[a])&&(n=(r<3?o(n):r>3?o(i,e,n):o(i,e))||n);return r>3&&n&&Object.defineProperty(i,e,n),n};let ei=class extends((t=>Yt(Qt(ti(t))))(Pt)){constructor(){super(...arguments),this.dot=!1,this.overflowCount=99,this.showZero=!1,this.size="default",this.ribbonPlacement="end"}getDisplayCount(){if(void 0===this.count)return"";const t=Number(this.count);return t>this.overflowCount?`${this.overflowCount}+`:String(t)}shouldHideBadge(){return!this.dot&&(void 0===this.count||0===this.count&&!this.showZero)}getCustomColorStyle(){if(!this.color)return{};return!["pink","red","yellow","orange","cyan","green","blue","purple","geekblue","magenta","volcano","gold","lime"].includes(this.color)?{backgroundColor:this.color,color:"#fff"}:{}}getOffsetStyle(){if(!this.offset)return{};const[t,i]=this.offset;return{right:`calc(0px - ${t}px)`,top:`${i}px`}}renderStatusBadge(){return yt`
|
|
307
|
-
<span class="badge-status">
|
|
308
|
-
<span class="badge-status-dot ${this.status}"></span>
|
|
309
|
-
${this.text?yt`<span class="badge-status-text">${this.text}</span>`:wt}
|
|
310
|
-
</span>
|
|
311
|
-
`}renderRibbonBadge(){const t={"badge-ribbon":!0,[this.ribbonPlacement]:!0,[this.color||""]:!!this.color},i=this.getCustomColorStyle();return yt`
|
|
312
|
-
<div class="badge-ribbon-wrapper">
|
|
313
|
-
<slot></slot>
|
|
314
|
-
<div class=${Vt(t)} style=${Jt(i)}>
|
|
315
|
-
${this.ribbon}
|
|
316
|
-
</div>
|
|
317
|
-
</div>
|
|
318
|
-
`}renderCountBadge(){const t=!(null!==this.querySelector(":not([slot])")),i=this.shouldHideBadge(),e=this.color&&["pink","red","yellow","orange","cyan","green","blue","purple","geekblue","magenta","volcano","gold","lime"].includes(this.color),s=Object.assign({"badge-indicator":!0,"badge-standalone":t,"badge-hidden":i,dot:this.dot,small:"small"===this.size},this.color&&e?{[this.color]:!0}:{}),o=Object.assign(Object.assign({},this.getCustomColorStyle()),this.getOffsetStyle()),r=this.dot?wt:this.getDisplayCount();return t?yt`
|
|
319
|
-
<span
|
|
320
|
-
class=${Vt(s)}
|
|
321
|
-
style=${Jt(o)}
|
|
322
|
-
title=${this.badgeTitle||""}
|
|
323
|
-
>
|
|
324
|
-
${r}
|
|
325
|
-
</span>
|
|
326
|
-
`:yt`
|
|
327
|
-
<span class="badge-wrapper">
|
|
328
|
-
<slot></slot>
|
|
329
|
-
<span
|
|
330
|
-
class=${Vt(s)}
|
|
331
|
-
style=${Jt(o)}
|
|
332
|
-
title=${this.badgeTitle||""}
|
|
333
|
-
>
|
|
334
|
-
${r}
|
|
335
|
-
</span>
|
|
336
|
-
</span>
|
|
337
|
-
`}render(){return this.ribbon?this.renderRibbonBadge():this.status?this.renderStatusBadge():this.renderCountBadge()}};ei.styles=Gt,ii([Lt({type:Number})],ei.prototype,"count",void 0),ii([Lt({type:Boolean})],ei.prototype,"dot",void 0),ii([Lt({type:Number,attribute:"overflow-count"})],ei.prototype,"overflowCount",void 0),ii([Lt({type:Boolean,attribute:"show-zero"})],ei.prototype,"showZero",void 0),ii([Lt({type:Array})],ei.prototype,"offset",void 0),ii([Lt({type:String})],ei.prototype,"color",void 0),ii([Lt({type:String})],ei.prototype,"size",void 0),ii([Lt({type:String})],ei.prototype,"status",void 0),ii([Lt({type:String})],ei.prototype,"text",void 0),ii([Lt({type:String})],ei.prototype,"badgeTitle",void 0),ii([Lt({type:String})],ei.prototype,"ribbon",void 0),ii([Lt({type:String,attribute:"ribbon-placement"})],ei.prototype,"ribbonPlacement",void 0),ei=ii([(t=>i=>"function"==typeof i?((t,i)=>(customElements.define(t,i),i))(t,i):((t,i)=>{const{kind:e,elements:s}=i;return{kind:e,elements:s,finisher(i){customElements.define(t,i)}}})(t,i))("nr-badge")],ei);export{ei as NrBadgeElement};
|
|
11
|
+
*/;var c=function(r,o,a,t){for(var e,i=arguments.length,n=i<3?o:null===t?t=Object.getOwnPropertyDescriptor(o,a):t,d=r.length-1;d>=0;d--)(e=r[d])&&(n=(i<3?e(n):i>3?e(o,a,n):e(o,a))||n);return i>3&&n&&Object.defineProperty(o,a,n),n};let b=class extends(l(o)){constructor(){super(...arguments),this.dot=!1,this.overflowCount=99,this.showZero=!1,this.size="default",this.ribbonPlacement="end"}getDisplayCount(){if(void 0===this.count)return"";const r=Number(this.count);return r>this.overflowCount?`${this.overflowCount}+`:String(r)}shouldHideBadge(){return!this.dot&&(void 0===this.count||0===this.count&&!this.showZero)}getCustomColorStyle(){if(!this.color)return{};return!["pink","red","yellow","orange","cyan","green","blue","purple","geekblue","magenta","volcano","gold","lime"].includes(this.color)?{backgroundColor:this.color,color:"#fff"}:{}}getOffsetStyle(){if(!this.offset)return{};const[r,o]=this.offset;return{right:`calc(0px - ${r}px)`,top:`${o}px`}}renderStatusBadge(){return a`<span class="badge-status"><span class="badge-status-dot ${this.status}"></span> ${this.text?a`<span class="badge-status-text">${this.text}</span>`:t}</span>`}renderRibbonBadge(){const r={"badge-ribbon":!0,[this.ribbonPlacement]:!0,[this.color||""]:!!this.color},o=this.getCustomColorStyle();return a`<div class="badge-ribbon-wrapper"><slot></slot><div class="${n(r)}" style="${d(o)}">${this.ribbon}</div></div>`}renderCountBadge(){const r=!(null!==this.querySelector(":not([slot])")),o=this.shouldHideBadge(),e=this.color&&["pink","red","yellow","orange","cyan","green","blue","purple","geekblue","magenta","volcano","gold","lime"].includes(this.color),i=Object.assign({"badge-indicator":!0,"badge-standalone":r,"badge-hidden":o,dot:this.dot,small:"small"===this.size},this.color&&e?{[this.color]:!0}:{}),l=Object.assign(Object.assign({},this.getCustomColorStyle()),this.getOffsetStyle()),s=this.dot?t:this.getDisplayCount();return r?a`<span class="${n(i)}" style="${d(l)}" title="${this.badgeTitle||""}">${s}</span>`:a`<span class="badge-wrapper"><slot></slot><span class="${n(i)}" style="${d(l)}" title="${this.badgeTitle||""}">${s}</span></span>`}render(){return this.ribbon?this.renderRibbonBadge():this.status?this.renderStatusBadge():this.renderCountBadge()}};b.styles=s,c([e({type:Number})],b.prototype,"count",void 0),c([e({type:Boolean})],b.prototype,"dot",void 0),c([e({type:Number,attribute:"overflow-count"})],b.prototype,"overflowCount",void 0),c([e({type:Boolean,attribute:"show-zero"})],b.prototype,"showZero",void 0),c([e({type:Array})],b.prototype,"offset",void 0),c([e({type:String})],b.prototype,"color",void 0),c([e({type:String})],b.prototype,"size",void 0),c([e({type:String})],b.prototype,"status",void 0),c([e({type:String})],b.prototype,"text",void 0),c([e({type:String})],b.prototype,"badgeTitle",void 0),c([e({type:String})],b.prototype,"ribbon",void 0),c([e({type:String,attribute:"ribbon-placement"})],b.prototype,"ribbonPlacement",void 0),b=c([i("nr-badge")],b);export{b as NrBadgeElement};
|