@nuralyui/popconfirm 0.0.3 → 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 +2 -316
- package/bundle.js.gz +0 -0
- package/package.json +1 -1
package/bundle.js
CHANGED
|
@@ -1,320 +1,6 @@
|
|
|
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,o=Symbol(),s=new WeakMap;class e{constructor(t,i,s){if(this._$cssResult$=!0,s!==o)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=i}get styleSheet(){let t=this.o;const o=this.t;if(i&&void 0===t){const i=void 0!==o&&1===o.length;i&&(t=s.get(o)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&s.set(o,t))}return t}toString(){return this.cssText}}const n=i?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let i="";for(const o of t.cssRules)i+=o.cssText;return(t=>new e("string"==typeof t?t:t+"",void 0,o))(i)})(t):t
|
|
7
|
-
/**
|
|
8
|
-
* @license
|
|
9
|
-
* Copyright 2017 Google LLC
|
|
10
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
|
-
*/;var r;const l=window,h=l.trustedTypes,c=h?h.emptyScript:"",a=l.reactiveElementPolyfillSupport,d={toAttribute(t,i){switch(i){case Boolean:t=t?c:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,i){let o=t;switch(i){case Boolean:o=null!==t;break;case Number:o=null===t?null:Number(t);break;case Object:case Array:try{o=JSON.parse(t)}catch(t){o=null}}return o}},u=(t,i)=>i!==t&&(i==i||t==t),v={attribute:!0,type:String,converter:d,reflect:!1,hasChanged:u},p="finalized";class f 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,o)=>{const s=this._$Ep(o,i);void 0!==s&&(this._$Ev.set(s,o),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 o="symbol"==typeof t?Symbol():"__"+t,s=this.getPropertyDescriptor(t,o,i);void 0!==s&&Object.defineProperty(this.prototype,t,s)}}static getPropertyDescriptor(t,i,o){return{get(){return this[i]},set(s){const e=this[t];this[i]=s,this.requestUpdate(t,e,o)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||v}static finalize(){if(this.hasOwnProperty(p))return!1;this[p]=!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 o of i)this.createProperty(o,t[o])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const i=[];if(Array.isArray(t)){const o=new Set(t.flat(1/0).reverse());for(const t of o)i.unshift(n(t))}else void 0!==t&&i.push(n(t));return i}static _$Ep(t,i){const o=i.attribute;return!1===o?void 0:"string"==typeof o?o:"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,o;(null!==(i=this._$ES)&&void 0!==i?i:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(o=t.hostConnected)||void 0===o||o.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 o;const s=null!==(o=this.shadowRoot)&&void 0!==o?o:this.attachShadow(this.constructor.shadowRootOptions);return((o,s)=>{i?o.adoptedStyleSheets=s.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):s.forEach((i=>{const s=document.createElement("style"),e=t.litNonce;void 0!==e&&s.setAttribute("nonce",e),s.textContent=i.cssText,o.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,o){this._$AK(t,o)}_$EO(t,i,o=v){var s;const e=this.constructor._$Ep(t,o);if(void 0!==e&&!0===o.reflect){const n=(void 0!==(null===(s=o.converter)||void 0===s?void 0:s.toAttribute)?o.converter:d).toAttribute(i,o.type);this._$El=t,null==n?this.removeAttribute(e):this.setAttribute(e,n),this._$El=null}}_$AK(t,i){var o;const s=this.constructor,e=s._$Ev.get(t);if(void 0!==e&&this._$El!==e){const t=s.getPropertyOptions(e),n="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(o=t.converter)||void 0===o?void 0:o.fromAttribute)?t.converter:d;this._$El=e,this[e]=n.fromAttribute(i,t.type),this._$El=null}}requestUpdate(t,i,o){let s=!0;void 0!==t&&(((o=o||this.constructor.getPropertyOptions(t)).hasChanged||u)(this[t],i)?(this._$AL.has(t)||this._$AL.set(t,i),!0===o.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,o))):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 o=this._$AL;try{i=this.shouldUpdate(o),i?(this.willUpdate(o),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(o)):this._$Ek()}catch(t){throw i=!1,this._$Ek(),t}i&&this._$AE(o)}willUpdate(t){}_$AE(t){var i;null===(i=this._$ES)||void 0===i||i.forEach((t=>{var i;return null===(i=t.hostUpdated)||void 0===i?void 0:i.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,i)=>this._$EO(i,this[i],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}
|
|
12
|
-
/**
|
|
13
|
-
* @license
|
|
14
|
-
* Copyright 2017 Google LLC
|
|
15
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
16
|
-
*/
|
|
17
|
-
var b;f[p]=!0,f.elementProperties=new Map,f.elementStyles=[],f.shadowRootOptions={mode:"open"},null==a||a({ReactiveElement:f}),(null!==(r=l.reactiveElementVersions)&&void 0!==r?r:l.reactiveElementVersions=[]).push("1.6.3");const m=window,g=m.trustedTypes,y=g?g.createPolicy("lit-html",{createHTML:t=>t}):void 0,w="$lit$",$=`lit$${(Math.random()+"").slice(9)}$`,x="?"+$,k=`<${x}>`,S=document,A=()=>S.createComment(""),E=t=>null===t||"object"!=typeof t&&"function"!=typeof t,C=Array.isArray,_="[ \t\n\f\r]",T=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,j=/-->/g,O=/>/g,U=RegExp(`>|${_}(?:([^\\s"'>=/]+)(${_}*=${_}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),M=/'/g,R=/"/g,z=/^(?:script|style|textarea|title)$/i,N=Symbol.for("lit-noChange"),D=Symbol.for("lit-nothing"),I=new WeakMap,P=S.createTreeWalker(S,129,null,!1);function L(t,i){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==y?y.createHTML(i):i}class q{constructor({strings:t,_$litType$:i},o){let s;this.parts=[];let e=0,n=0;const r=t.length-1,l=this.parts,[h,c]=((t,i)=>{const o=t.length-1,s=[];let e,n=2===i?"<svg>":"",r=T;for(let i=0;i<o;i++){const o=t[i];let l,h,c=-1,a=0;for(;a<o.length&&(r.lastIndex=a,h=r.exec(o),null!==h);)a=r.lastIndex,r===T?"!--"===h[1]?r=j:void 0!==h[1]?r=O:void 0!==h[2]?(z.test(h[2])&&(e=RegExp("</"+h[2],"g")),r=U):void 0!==h[3]&&(r=U):r===U?">"===h[0]?(r=null!=e?e:T,c=-1):void 0===h[1]?c=-2:(c=r.lastIndex-h[2].length,l=h[1],r=void 0===h[3]?U:'"'===h[3]?R:M):r===R||r===M?r=U:r===j||r===O?r=T:(r=U,e=void 0);const d=r===U&&t[i+1].startsWith("/>")?" ":"";n+=r===T?o+k:c>=0?(s.push(l),o.slice(0,c)+w+o.slice(c)+$+d):o+$+(-2===c?(s.push(void 0),i):d)}return[L(t,n+(t[o]||"<?>")+(2===i?"</svg>":"")),s]})(t,i);if(this.el=q.createElement(h,o),P.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(s=P.nextNode())&&l.length<r;){if(1===s.nodeType){if(s.hasAttributes()){const t=[];for(const i of s.getAttributeNames())if(i.endsWith(w)||i.startsWith($)){const o=c[n++];if(t.push(i),void 0!==o){const t=s.getAttribute(o.toLowerCase()+w).split($),i=/([.?@])?(.*)/.exec(o);l.push({type:1,index:e,name:i[2],strings:t,ctor:"."===i[1]?W:"?"===i[1]?F:"@"===i[1]?J:V})}else l.push({type:6,index:e})}for(const i of t)s.removeAttribute(i)}if(z.test(s.tagName)){const t=s.textContent.split($),i=t.length-1;if(i>0){s.textContent=g?g.emptyScript:"";for(let o=0;o<i;o++)s.append(t[o],A()),P.nextNode(),l.push({type:2,index:++e});s.append(t[i],A())}}}else if(8===s.nodeType)if(s.data===x)l.push({type:2,index:e});else{let t=-1;for(;-1!==(t=s.data.indexOf($,t+1));)l.push({type:7,index:e}),t+=$.length-1}e++}}static createElement(t,i){const o=S.createElement("template");return o.innerHTML=t,o}}function K(t,i,o=t,s){var e,n,r,l;if(i===N)return i;let h=void 0!==s?null===(e=o._$Co)||void 0===e?void 0:e[s]:o._$Cl;const c=E(i)?void 0:i._$litDirective$;return(null==h?void 0:h.constructor)!==c&&(null===(n=null==h?void 0:h._$AO)||void 0===n||n.call(h,!1),void 0===c?h=void 0:(h=new c(t),h._$AT(t,o,s)),void 0!==s?(null!==(r=(l=o)._$Co)&&void 0!==r?r:l._$Co=[])[s]=h:o._$Cl=h),void 0!==h&&(i=K(t,h._$AS(t,i.values),h,s)),i}class B{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var i;const{el:{content:o},parts:s}=this._$AD,e=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:S).importNode(o,!0);P.currentNode=e;let n=P.nextNode(),r=0,l=0,h=s[0];for(;void 0!==h;){if(r===h.index){let i;2===h.type?i=new H(n,n.nextSibling,this,t):1===h.type?i=new h.ctor(n,h.name,h.strings,this,t):6===h.type&&(i=new G(n,this,t)),this._$AV.push(i),h=s[++l]}r!==(null==h?void 0:h.index)&&(n=P.nextNode(),r++)}return P.currentNode=S,e}v(t){let i=0;for(const o of this._$AV)void 0!==o&&(void 0!==o.strings?(o._$AI(t,o,i),i+=o.strings.length-2):o._$AI(t[i])),i++}}class H{constructor(t,i,o,s){var e;this.type=2,this._$AH=D,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=o,this.options=s,this._$Cp=null===(e=null==s?void 0:s.isConnected)||void 0===e||e}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=K(this,t,i),E(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&&E(this._$AH)?this._$AA.nextSibling.data=t:this.$(S.createTextNode(t)),this._$AH=t}g(t){var i;const{values:o,_$litType$:s}=t,e="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=q.createElement(L(s.h,s.h[0]),this.options)),s);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===e)this._$AH.v(o);else{const t=new B(e,this),i=t.u(this.options);t.v(o),this.$(i),this._$AH=t}}_$AC(t){let i=I.get(t.strings);return void 0===i&&I.set(t.strings,i=new q(t)),i}T(t){C(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let o,s=0;for(const e of t)s===i.length?i.push(o=new H(this.k(A()),this.k(A()),this,this.options)):o=i[s],o._$AI(e),s++;s<i.length&&(this._$AR(o&&o._$AB.nextSibling,s),i.length=s)}_$AR(t=this._$AA.nextSibling,i){var o;for(null===(o=this._$AP)||void 0===o||o.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 V{constructor(t,i,o,s,e){this.type=1,this._$AH=D,this._$AN=void 0,this.element=t,this.name=i,this._$AM=s,this.options=e,o.length>2||""!==o[0]||""!==o[1]?(this._$AH=Array(o.length-1).fill(new String),this.strings=o):this._$AH=D}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,o,s){const e=this.strings;let n=!1;if(void 0===e)t=K(this,t,i,0),n=!E(t)||t!==this._$AH&&t!==N,n&&(this._$AH=t);else{const s=t;let r,l;for(t=e[0],r=0;r<e.length-1;r++)l=K(this,s[o+r],i,r),l===N&&(l=this._$AH[r]),n||(n=!E(l)||l!==this._$AH[r]),l===D?t=D:t!==D&&(t+=(null!=l?l:"")+e[r+1]),this._$AH[r]=l}n&&!s&&this.j(t)}j(t){t===D?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class W extends V{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===D?void 0:t}}const Z=g?g.emptyScript:"";class F extends V{constructor(){super(...arguments),this.type=4}j(t){t&&t!==D?this.element.setAttribute(this.name,Z):this.element.removeAttribute(this.name)}}class J extends V{constructor(t,i,o,s,e){super(t,i,o,s,e),this.type=5}_$AI(t,i=this){var o;if((t=null!==(o=K(this,t,i,0))&&void 0!==o?o:D)===N)return;const s=this._$AH,e=t===D&&s!==D||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==D&&(s===D||e);e&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var i,o;"function"==typeof this._$AH?this._$AH.call(null!==(o=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==o?o:this.element,t):this._$AH.handleEvent(t)}}class G{constructor(t,i,o){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=o}get _$AU(){return this._$AM._$AU}_$AI(t){K(this,t)}}const Q=m.litHtmlPolyfillSupport;
|
|
18
|
-
/**
|
|
19
|
-
* @license
|
|
20
|
-
* Copyright 2017 Google LLC
|
|
21
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
22
|
-
*/
|
|
23
|
-
var X;null==Q||Q(q,H),(null!==(b=m.litHtmlVersions)&&void 0!==b?b:m.litHtmlVersions=[]).push("2.8.0");const Y=window,tt=Y.trustedTypes,it=tt?tt.createPolicy("lit-html",{createHTML:t=>t}):void 0,ot="$lit$",st=`lit$${(Math.random()+"").slice(9)}$`,et="?"+st,nt=`<${et}>`,rt=document,lt=()=>rt.createComment(""),ht=t=>null===t||"object"!=typeof t&&"function"!=typeof t,ct=Array.isArray,at="[ \t\n\f\r]",dt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ut=/-->/g,vt=/>/g,pt=RegExp(`>|${at}(?:([^\\s"'>=/]+)(${at}*=${at}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),ft=/'/g,bt=/"/g,mt=/^(?:script|style|textarea|title)$/i,gt=(t=>(i,...o)=>({_$litType$:t,strings:i,values:o}))(1),yt=Symbol.for("lit-noChange"),wt=Symbol.for("lit-nothing"),$t=new WeakMap,xt=rt.createTreeWalker(rt,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 o=t.length-1,s=[];let e,n=2===i?"<svg>":"",r=dt;for(let i=0;i<o;i++){const o=t[i];let l,h,c=-1,a=0;for(;a<o.length&&(r.lastIndex=a,h=r.exec(o),null!==h);)a=r.lastIndex,r===dt?"!--"===h[1]?r=ut:void 0!==h[1]?r=vt:void 0!==h[2]?(mt.test(h[2])&&(e=RegExp("</"+h[2],"g")),r=pt):void 0!==h[3]&&(r=pt):r===pt?">"===h[0]?(r=null!=e?e:dt,c=-1):void 0===h[1]?c=-2:(c=r.lastIndex-h[2].length,l=h[1],r=void 0===h[3]?pt:'"'===h[3]?bt:ft):r===bt||r===ft?r=pt:r===ut||r===vt?r=dt:(r=pt,e=void 0);const d=r===pt&&t[i+1].startsWith("/>")?" ":"";n+=r===dt?o+nt:c>=0?(s.push(l),o.slice(0,c)+ot+o.slice(c)+st+d):o+st+(-2===c?(s.push(void 0),i):d)}return[kt(t,n+(t[o]||"<?>")+(2===i?"</svg>":"")),s]};class At{constructor({strings:t,_$litType$:i},o){let s;this.parts=[];let e=0,n=0;const r=t.length-1,l=this.parts,[h,c]=St(t,i);if(this.el=At.createElement(h,o),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())&&l.length<r;){if(1===s.nodeType){if(s.hasAttributes()){const t=[];for(const i of s.getAttributeNames())if(i.endsWith(ot)||i.startsWith(st)){const o=c[n++];if(t.push(i),void 0!==o){const t=s.getAttribute(o.toLowerCase()+ot).split(st),i=/([.?@])?(.*)/.exec(o);l.push({type:1,index:e,name:i[2],strings:t,ctor:"."===i[1]?jt:"?"===i[1]?Ut:"@"===i[1]?Mt:Tt})}else l.push({type:6,index:e})}for(const i of t)s.removeAttribute(i)}if(mt.test(s.tagName)){const t=s.textContent.split(st),i=t.length-1;if(i>0){s.textContent=tt?tt.emptyScript:"";for(let o=0;o<i;o++)s.append(t[o],lt()),xt.nextNode(),l.push({type:2,index:++e});s.append(t[i],lt())}}}else if(8===s.nodeType)if(s.data===et)l.push({type:2,index:e});else{let t=-1;for(;-1!==(t=s.data.indexOf(st,t+1));)l.push({type:7,index:e}),t+=st.length-1}e++}}static createElement(t,i){const o=rt.createElement("template");return o.innerHTML=t,o}}function Et(t,i,o=t,s){var e,n,r,l;if(i===yt)return i;let h=void 0!==s?null===(e=o._$Co)||void 0===e?void 0:e[s]:o._$Cl;const c=ht(i)?void 0:i._$litDirective$;return(null==h?void 0:h.constructor)!==c&&(null===(n=null==h?void 0:h._$AO)||void 0===n||n.call(h,!1),void 0===c?h=void 0:(h=new c(t),h._$AT(t,o,s)),void 0!==s?(null!==(r=(l=o)._$Co)&&void 0!==r?r:l._$Co=[])[s]=h:o._$Cl=h),void 0!==h&&(i=Et(t,h._$AS(t,i.values),h,s)),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:o},parts:s}=this._$AD,e=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:rt).importNode(o,!0);xt.currentNode=e;let n=xt.nextNode(),r=0,l=0,h=s[0];for(;void 0!==h;){if(r===h.index){let i;2===h.type?i=new _t(n,n.nextSibling,this,t):1===h.type?i=new h.ctor(n,h.name,h.strings,this,t):6===h.type&&(i=new Rt(n,this,t)),this._$AV.push(i),h=s[++l]}r!==(null==h?void 0:h.index)&&(n=xt.nextNode(),r++)}return xt.currentNode=rt,e}v(t){let i=0;for(const o of this._$AV)void 0!==o&&(void 0!==o.strings?(o._$AI(t,o,i),i+=o.strings.length-2):o._$AI(t[i])),i++}}class _t{constructor(t,i,o,s){var e;this.type=2,this._$AH=wt,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=o,this.options=s,this._$Cp=null===(e=null==s?void 0:s.isConnected)||void 0===e||e}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=Et(this,t,i),ht(t)?t===wt||null==t||""===t?(this._$AH!==wt&&this._$AR(),this._$AH=wt):t!==this._$AH&&t!==yt&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):(t=>ct(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==wt&&ht(this._$AH)?this._$AA.nextSibling.data=t:this.$(rt.createTextNode(t)),this._$AH=t}g(t){var i;const{values:o,_$litType$:s}=t,e="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)===e)this._$AH.v(o);else{const t=new Ct(e,this),i=t.u(this.options);t.v(o),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){ct(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let o,s=0;for(const e of t)s===i.length?i.push(o=new _t(this.k(lt()),this.k(lt()),this,this.options)):o=i[s],o._$AI(e),s++;s<i.length&&(this._$AR(o&&o._$AB.nextSibling,s),i.length=s)}_$AR(t=this._$AA.nextSibling,i){var o;for(null===(o=this._$AP)||void 0===o||o.call(this,!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var i;void 0===this._$AM&&(this._$Cp=t,null===(i=this._$AP)||void 0===i||i.call(this,t))}}class Tt{constructor(t,i,o,s,e){this.type=1,this._$AH=wt,this._$AN=void 0,this.element=t,this.name=i,this._$AM=s,this.options=e,o.length>2||""!==o[0]||""!==o[1]?(this._$AH=Array(o.length-1).fill(new String),this.strings=o):this._$AH=wt}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,o,s){const e=this.strings;let n=!1;if(void 0===e)t=Et(this,t,i,0),n=!ht(t)||t!==this._$AH&&t!==yt,n&&(this._$AH=t);else{const s=t;let r,l;for(t=e[0],r=0;r<e.length-1;r++)l=Et(this,s[o+r],i,r),l===yt&&(l=this._$AH[r]),n||(n=!ht(l)||l!==this._$AH[r]),l===wt?t=wt:t!==wt&&(t+=(null!=l?l:"")+e[r+1]),this._$AH[r]=l}n&&!s&&this.j(t)}j(t){t===wt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class jt extends Tt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===wt?void 0:t}}const Ot=tt?tt.emptyScript:"";class Ut extends Tt{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 Tt{constructor(t,i,o,s,e){super(t,i,o,s,e),this.type=5}_$AI(t,i=this){var o;if((t=null!==(o=Et(this,t,i,0))&&void 0!==o?o:wt)===yt)return;const s=this._$AH,e=t===wt&&s!==wt||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==wt&&(s===wt||e);e&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var i,o;"function"==typeof this._$AH?this._$AH.call(null!==(o=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==o?o:this.element,t):this._$AH.handleEvent(t)}}class Rt{constructor(t,i,o){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=o}get _$AU(){return this._$AM._$AU}_$AI(t){Et(this,t)}}const zt=Y.litHtmlPolyfillSupport;null==zt||zt(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 It extends f{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,i;const o=super.createRenderRoot();return null!==(t=(i=this.renderOptions).renderBefore)&&void 0!==t||(i.renderBefore=o.firstChild),o}update(t){const i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,i,o)=>{var s,e;const n=null!==(s=null==o?void 0:o.renderBefore)&&void 0!==s?s:i;let r=n._$litPart$;if(void 0===r){const t=null!==(e=null==o?void 0:o.renderBefore)&&void 0!==e?e:null;n._$litPart$=r=new _t(i.insertBefore(lt(),t),t,void 0,null!=o?o:{})}return r._$AI(t),r})(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 yt}}It.finalized=!0,It._$litElement$=!0,null===(Nt=globalThis.litElementHydrateSupport)||void 0===Nt||Nt.call(globalThis,{LitElement:It});const Pt=globalThis.litElementPolyfillSupport;null==Pt||Pt({LitElement:It}),(null!==(Dt=globalThis.litElementVersions)&&void 0!==Dt?Dt:globalThis.litElementVersions=[]).push("3.3.3");
|
|
30
|
-
/**
|
|
31
|
-
* @license
|
|
32
|
-
* Copyright 2017 Google LLC
|
|
33
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
34
|
-
*/
|
|
35
|
-
const Lt=(t,i)=>"method"===i.kind&&i.descriptor&&!("value"in i.descriptor)?{...i,finisher(o){o.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(o){o.createProperty(i.key,t)}},qt=(t,i,o)=>{i.constructor.createProperty(o,t)};
|
|
36
|
-
/**
|
|
37
|
-
* @license
|
|
38
|
-
* Copyright 2017 Google LLC
|
|
39
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
40
|
-
*/function Kt(t){return(i,o)=>void 0!==o?qt(t,i,o):Lt(t,i)
|
|
41
|
-
/**
|
|
42
|
-
* @license
|
|
43
|
-
* Copyright 2017 Google LLC
|
|
44
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
45
|
-
*/}
|
|
46
|
-
/**
|
|
47
|
-
* @license
|
|
48
|
-
* Copyright 2021 Google LLC
|
|
49
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
50
|
-
*/
|
|
51
|
-
var Bt;null===(Bt=window.HTMLSlotElement)||void 0===Bt||Bt.prototype.assignedElements;
|
|
52
|
-
/**
|
|
53
|
-
* @license
|
|
54
|
-
* Copyright 2017 Google LLC
|
|
55
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
56
|
-
*/
|
|
57
|
-
const Ht=1;class Vt{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,i,o){this._$Ct=t,this._$AM=i,this._$Ci=o}_$AS(t,i){return this.update(t,i)}update(t,i){return this.render(...i)}}
|
|
58
|
-
/**
|
|
59
|
-
* @license
|
|
60
|
-
* Copyright 2018 Google LLC
|
|
61
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
62
|
-
*/const Wt=(t=>(...i)=>({_$litDirective$:t,values:i}))(class extends Vt{constructor(t){var i;if(super(t),t.type!==Ht||"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 o,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===(o=this.nt)||void 0===o?void 0:o.has(t))&&this.it.add(t);return this.render(i)}const e=t.element.classList;this.it.forEach((t=>{t in i||(e.remove(t),this.it.delete(t))}));for(const t in i){const o=!!i[t];o===this.it.has(t)||(null===(s=this.nt)||void 0===s?void 0:s.has(t))||(o?(e.add(t),this.it.add(t)):(e.remove(t),this.it.delete(t)))}return N}}),Zt=((t,...i)=>{const s=1===t.length?t[0]:i.reduce(((i,o,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.")})(o)+t[s+1]),t[0]);return new e(s,t,o)})`
|
|
63
|
-
:host {
|
|
64
|
-
display: inline-block;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.popconfirm-content {
|
|
68
|
-
display: flex;
|
|
69
|
-
flex-direction: column;
|
|
70
|
-
gap: 12px;
|
|
71
|
-
padding: 12px 16px;
|
|
72
|
-
min-width: 200px;
|
|
73
|
-
max-width: 400px;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.popconfirm-message {
|
|
77
|
-
display: flex;
|
|
78
|
-
gap: 8px;
|
|
79
|
-
align-items: flex-start;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.popconfirm-icon {
|
|
83
|
-
flex-shrink: 0;
|
|
84
|
-
font-size: 16px;
|
|
85
|
-
line-height: 1.5;
|
|
86
|
-
margin-top: 2px;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.popconfirm-icon--warning {
|
|
90
|
-
color: var(--nuraly-color-warning);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.popconfirm-icon--question {
|
|
94
|
-
color: var(--nuraly-color-info);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.popconfirm-icon--info {
|
|
98
|
-
color: var(--nuraly-color-info);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.popconfirm-icon--error {
|
|
102
|
-
color: var(--nuraly-color-error);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.popconfirm-icon--success {
|
|
106
|
-
color: var(--nuraly-color-success);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
.popconfirm-icon--custom {
|
|
110
|
-
color: var(--nuraly-popconfirm-icon-color, var(--nuraly-color-text));
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
.popconfirm-text {
|
|
114
|
-
flex: 1;
|
|
115
|
-
display: flex;
|
|
116
|
-
flex-direction: column;
|
|
117
|
-
gap: 4px;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
.popconfirm-title {
|
|
121
|
-
color: var(--nuraly-color-text);
|
|
122
|
-
font-size: var(--nuraly-font-size-base);
|
|
123
|
-
font-weight: 600;
|
|
124
|
-
line-height: 1.5;
|
|
125
|
-
margin: 0;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
.popconfirm-description {
|
|
129
|
-
color: var(--nuraly-color-text-secondary);
|
|
130
|
-
font-size: var(--nuraly-font-size-sm);
|
|
131
|
-
line-height: 1.5;
|
|
132
|
-
margin: 0;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
.popconfirm-buttons {
|
|
136
|
-
display: flex;
|
|
137
|
-
gap: 8px;
|
|
138
|
-
justify-content: flex-end;
|
|
139
|
-
align-items: center;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
.popconfirm-button {
|
|
143
|
-
padding: 4px 15px;
|
|
144
|
-
font-size: var(--nuraly-font-size-sm);
|
|
145
|
-
border-radius: var(--nuraly-border-radius);
|
|
146
|
-
border: 1px solid transparent;
|
|
147
|
-
cursor: pointer;
|
|
148
|
-
transition: all 0.2s;
|
|
149
|
-
font-weight: 400;
|
|
150
|
-
line-height: 1.5;
|
|
151
|
-
white-space: nowrap;
|
|
152
|
-
user-select: none;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
.popconfirm-button:focus-visible {
|
|
156
|
-
outline: 2px solid var(--nuraly-color-primary);
|
|
157
|
-
outline-offset: 2px;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
.popconfirm-button--cancel {
|
|
161
|
-
background: var(--nuraly-button-default-background);
|
|
162
|
-
color: var(--nuraly-button-default-text-color);
|
|
163
|
-
border-color: var(--nuraly-button-default-border-color);
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
.popconfirm-button--cancel:hover:not(:disabled) {
|
|
167
|
-
background: var(--nuraly-button-default-hover-background);
|
|
168
|
-
color: var(--nuraly-button-default-hover-text-color);
|
|
169
|
-
border-color: var(--nuraly-button-default-hover-border-color);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
.popconfirm-button--ok-primary {
|
|
173
|
-
background: var(--nuraly-button-primary-background);
|
|
174
|
-
color: var(--nuraly-button-primary-text-color);
|
|
175
|
-
border-color: var(--nuraly-button-primary-border-color);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
.popconfirm-button--ok-primary:hover:not(:disabled) {
|
|
179
|
-
background: var(--nuraly-button-primary-hover-background);
|
|
180
|
-
color: var(--nuraly-button-primary-hover-text-color);
|
|
181
|
-
border-color: var(--nuraly-button-primary-hover-border-color);
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
.popconfirm-button--ok-danger {
|
|
185
|
-
background: var(--nuraly-button-danger-background);
|
|
186
|
-
color: var(--nuraly-button-danger-text-color);
|
|
187
|
-
border-color: var(--nuraly-button-danger-border-color);
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
.popconfirm-button--ok-danger:hover:not(:disabled) {
|
|
191
|
-
background: var(--nuraly-button-danger-hover-background);
|
|
192
|
-
color: var(--nuraly-button-danger-hover-text-color);
|
|
193
|
-
border-color: var(--nuraly-button-danger-hover-border-color);
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
.popconfirm-button--ok-secondary {
|
|
197
|
-
background: var(--nuraly-button-secondary-background);
|
|
198
|
-
color: var(--nuraly-button-secondary-text-color);
|
|
199
|
-
border-color: var(--nuraly-button-secondary-border-color);
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
.popconfirm-button--ok-secondary:hover:not(:disabled) {
|
|
203
|
-
background: var(--nuraly-button-secondary-hover-background);
|
|
204
|
-
color: var(--nuraly-button-secondary-hover-text-color);
|
|
205
|
-
border-color: var(--nuraly-button-secondary-hover-border-color);
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
.popconfirm-button--ok-default {
|
|
209
|
-
background: var(--nuraly-button-default-background);
|
|
210
|
-
color: var(--nuraly-button-default-text-color);
|
|
211
|
-
border-color: var(--nuraly-button-default-border-color);
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
.popconfirm-button--ok-default:hover:not(:disabled) {
|
|
215
|
-
background: var(--nuraly-button-default-hover-background);
|
|
216
|
-
color: var(--nuraly-button-default-hover-text-color);
|
|
217
|
-
border-color: var(--nuraly-button-default-hover-border-color);
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
.popconfirm-button:disabled {
|
|
221
|
-
opacity: 0.5;
|
|
222
|
-
cursor: not-allowed;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
.popconfirm-button--loading {
|
|
226
|
-
position: relative;
|
|
227
|
-
pointer-events: none;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
.popconfirm-button--loading::before {
|
|
231
|
-
content: '';
|
|
232
|
-
position: absolute;
|
|
233
|
-
left: 50%;
|
|
234
|
-
top: 50%;
|
|
235
|
-
width: 14px;
|
|
236
|
-
height: 14px;
|
|
237
|
-
margin-left: -7px;
|
|
238
|
-
margin-top: -7px;
|
|
239
|
-
border: 2px solid currentColor;
|
|
240
|
-
border-right-color: transparent;
|
|
241
|
-
border-radius: 50%;
|
|
242
|
-
animation: popconfirm-spin 0.6s linear infinite;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
.popconfirm-button--loading > * {
|
|
246
|
-
visibility: hidden;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
@keyframes popconfirm-spin {
|
|
250
|
-
0% {
|
|
251
|
-
transform: rotate(0deg);
|
|
252
|
-
}
|
|
253
|
-
100% {
|
|
254
|
-
transform: rotate(360deg);
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
/* RTL Support */
|
|
259
|
-
:host([dir='rtl']) .popconfirm-message {
|
|
260
|
-
direction: rtl;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
:host([dir='rtl']) .popconfirm-buttons {
|
|
264
|
-
flex-direction: row-reverse;
|
|
265
|
-
}
|
|
266
|
-
`
|
|
267
|
-
/**
|
|
268
|
-
* @license
|
|
269
|
-
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
270
|
-
* SPDX-License-Identifier: MIT
|
|
271
|
-
*/,Ft=t=>class extends t{constructor(){super(...arguments),this.handleSystemThemeChange=()=>{this.closest("[data-theme]")||document.documentElement.hasAttribute("data-theme")||this.requestUpdate()}}connectedCallback(){super.connectedCallback(),this.setupThemeObserver(),this.setupDesignSystemObserver(),this.setupSystemThemeListener()}disconnectedCallback(){var t,i,o;super.disconnectedCallback(),null===(t=this.themeObserver)||void 0===t||t.disconnect(),null===(i=this.designSystemObserver)||void 0===i||i.disconnect(),null===(o=this.mediaQuery)||void 0===o||o.removeEventListener("change",this.handleSystemThemeChange)}get currentTheme(){var t,i;const o=(null===(t=this.closest("[data-theme]"))||void 0===t?void 0:t.getAttribute("data-theme"))||document.documentElement.getAttribute("data-theme");return o||((null===(i=window.matchMedia)||void 0===i?void 0:i.call(window,"(prefers-color-scheme: dark)").matches)?"dark":"light")}get currentDesignSystem(){var t;const i=(null===(t=this.closest("[design-system]"))||void 0===t?void 0:t.getAttribute("design-system"))||document.documentElement.getAttribute("design-system");return"carbon"===i?i:"default"}setupThemeObserver(){this.themeObserver=new MutationObserver((()=>{this.requestUpdate()})),this.themeObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]})}setupDesignSystemObserver(){this.designSystemObserver=new MutationObserver((()=>{this.requestUpdate()})),this.designSystemObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["design-system"]})}setupSystemThemeListener(){window.matchMedia&&(this.mediaQuery=window.matchMedia("(prefers-color-scheme: dark)"),this.mediaQuery.addEventListener("change",this.handleSystemThemeChange))}},Jt=()=>{var t;return void 0!==globalThis.litElementVersions||"undefined"!=typeof process&&"development"===(null===(t=process.env)||void 0===t?void 0:t.NODE_ENV)||"undefined"!=typeof window&&("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname)},Gt=t=>class extends t{constructor(){super(...arguments),this.requiredComponents=[]}validateDependencies(){if(Jt())for(const t of this.requiredComponents)if(!this.isComponentAvailable(t))throw new Error(`Required component "${t}" is not registered. Please import and register the component before using ${this.tagName.toLowerCase()}. Example: import '@nuralyui/${t}';`)}validateDependenciesWithHandler(t){if(!Jt())return!0;let i=!0;for(const o of this.requiredComponents)if(!this.isComponentAvailable(o)){i=!1;const s=new Error(`Required component "${o}" is not registered. Please import and register the component before using ${this.tagName.toLowerCase()}.`);t?t(o,s):console.error(s.message)}return i}isComponentAvailable(t){return!!customElements.get(t)}getMissingDependencies(){return this.requiredComponents.filter((t=>!this.isComponentAvailable(t)))}areDependenciesAvailable(){return this.requiredComponents.every((t=>this.isComponentAvailable(t)))}addRequiredComponent(t){this.requiredComponents.includes(t)||this.requiredComponents.push(t)}removeRequiredComponent(t){const i=this.requiredComponents.indexOf(t);i>-1&&this.requiredComponents.splice(i,1)}},Qt=t=>class extends t{dispatchCustomEvent(t,i){this.dispatchEvent(new CustomEvent(t,{detail:i,bubbles:!0,composed:!0}))}dispatchEventWithMetadata(t,i){var o;const s=Object.assign(Object.assign({},i),{timestamp:Date.now(),componentName:(null===(o=this.tagName)||void 0===o?void 0:o.toLowerCase())||"unknown"});this.dispatchCustomEvent(t,s)}dispatchInputEvent(t,i){const o=Object.assign({target:i.target||this,value:i.value,originalEvent:i.originalEvent},i);this.dispatchCustomEvent(t,o)}dispatchFocusEvent(t,i){const o=Object.assign({target:i.target||this,value:i.value,focused:i.focused,cursorPosition:i.cursorPosition,selectedText:i.selectedText},i);this.dispatchCustomEvent(t,o)}dispatchValidationEvent(t,i){var o;const s=Object.assign({target:i.target||this,value:i.value,isValid:null!==(o=i.isValid)&&void 0!==o&&o,error:i.error},i);this.dispatchCustomEvent(t,s)}dispatchActionEvent(t,i){const o=Object.assign({target:i.target||this,action:i.action,previousValue:i.previousValue,newValue:i.newValue},i);this.dispatchCustomEvent(t,o)}isReadonlyKeyAllowed(t){if(t.ctrlKey||t.metaKey){return["KeyA","KeyC"].includes(t.code)}return["Tab","Escape","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(t.key)}isActivationKey(t){return"Enter"===t.key||" "===t.key}};
|
|
1
|
+
import{css as o,LitElement as r,html as t}from"lit";import{property as n,state as i,customElement as e}from"lit/decorators.js";import{classMap as c}from"lit/directives/class-map.js";import{NuralyUIBaseMixin as a}from"@nuralyui/common/mixins";const l=o`:host{display:inline-block}.popconfirm-content{display:flex;flex-direction:column;gap:12px;padding:12px 16px;min-width:200px;max-width:400px}.popconfirm-message{display:flex;gap:8px;align-items:flex-start}.popconfirm-icon{flex-shrink:0;font-size:16px;line-height:1.5;margin-top:2px}.popconfirm-icon--warning{color:var(--nuraly-color-warning)}.popconfirm-icon--question{color:var(--nuraly-color-info)}.popconfirm-icon--info{color:var(--nuraly-color-info)}.popconfirm-icon--error{color:var(--nuraly-color-error)}.popconfirm-icon--success{color:var(--nuraly-color-success)}.popconfirm-icon--custom{color:var(--nuraly-popconfirm-icon-color,var(--nuraly-color-text))}.popconfirm-text{flex:1;display:flex;flex-direction:column;gap:4px}.popconfirm-title{color:var(--nuraly-color-text);font-size:var(--nuraly-font-size-base);font-weight:600;line-height:1.5;margin:0}.popconfirm-description{color:var(--nuraly-color-text-secondary);font-size:var(--nuraly-font-size-sm);line-height:1.5;margin:0}.popconfirm-buttons{display:flex;gap:8px;justify-content:flex-end;align-items:center}.popconfirm-button{padding:4px 15px;font-size:var(--nuraly-font-size-sm);border-radius:var(--nuraly-border-radius);border:1px solid transparent;cursor:pointer;transition:all .2s;font-weight:400;line-height:1.5;white-space:nowrap;user-select:none}.popconfirm-button:focus-visible{outline:2px solid var(--nuraly-color-primary);outline-offset:2px}.popconfirm-button--cancel{background:var(--nuraly-button-default-background);color:var(--nuraly-button-default-text-color);border-color:var(--nuraly-button-default-border-color)}.popconfirm-button--cancel:hover:not(:disabled){background:var(--nuraly-button-default-hover-background);color:var(--nuraly-button-default-hover-text-color);border-color:var(--nuraly-button-default-hover-border-color)}.popconfirm-button--ok-primary{background:var(--nuraly-button-primary-background);color:var(--nuraly-button-primary-text-color);border-color:var(--nuraly-button-primary-border-color)}.popconfirm-button--ok-primary:hover:not(:disabled){background:var(--nuraly-button-primary-hover-background);color:var(--nuraly-button-primary-hover-text-color);border-color:var(--nuraly-button-primary-hover-border-color)}.popconfirm-button--ok-danger{background:var(--nuraly-button-danger-background);color:var(--nuraly-button-danger-text-color);border-color:var(--nuraly-button-danger-border-color)}.popconfirm-button--ok-danger:hover:not(:disabled){background:var(--nuraly-button-danger-hover-background);color:var(--nuraly-button-danger-hover-text-color);border-color:var(--nuraly-button-danger-hover-border-color)}.popconfirm-button--ok-secondary{background:var(--nuraly-button-secondary-background);color:var(--nuraly-button-secondary-text-color);border-color:var(--nuraly-button-secondary-border-color)}.popconfirm-button--ok-secondary:hover:not(:disabled){background:var(--nuraly-button-secondary-hover-background);color:var(--nuraly-button-secondary-hover-text-color);border-color:var(--nuraly-button-secondary-hover-border-color)}.popconfirm-button--ok-default{background:var(--nuraly-button-default-background);color:var(--nuraly-button-default-text-color);border-color:var(--nuraly-button-default-border-color)}.popconfirm-button--ok-default:hover:not(:disabled){background:var(--nuraly-button-default-hover-background);color:var(--nuraly-button-default-hover-text-color);border-color:var(--nuraly-button-default-hover-border-color)}.popconfirm-button:disabled{opacity:.5;cursor:not-allowed}.popconfirm-button--loading{position:relative;pointer-events:none}.popconfirm-button--loading::before{content:'';position:absolute;left:50%;top:50%;width:14px;height:14px;margin-left:-7px;margin-top:-7px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:popconfirm-spin .6s linear infinite}.popconfirm-button--loading>*{visibility:hidden}@keyframes popconfirm-spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}:host([dir=rtl]) .popconfirm-message{direction:rtl}:host([dir=rtl]) .popconfirm-buttons{flex-direction:row-reverse}`
|
|
272
2
|
/**
|
|
273
3
|
* @license
|
|
274
4
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
275
5
|
* SPDX-License-Identifier: MIT
|
|
276
|
-
|
|
277
|
-
var Xt=function(t,i,o,s){for(var e,n=arguments.length,r=n<3?i:null===s?s=Object.getOwnPropertyDescriptor(i,o):s,l=t.length-1;l>=0;l--)(e=t[l])&&(r=(n<3?e(r):n>3?e(i,o,r):e(i,o))||r);return n>3&&r&&Object.defineProperty(i,o,r),r},Yt=function(t,i,o,s){return new(o||(o=Promise))((function(e,n){function r(t){try{h(s.next(t))}catch(t){n(t)}}function l(t){try{h(s.throw(t))}catch(t){n(t)}}function h(t){var i;t.done?e(t.value):(i=t.value,i instanceof o?i:new o((function(t){t(i)}))).then(r,l)}h((s=s.apply(t,i||[])).next())}))};let ti=class extends((t=>Gt(Ft(Qt(t))))(It)){constructor(){super(...arguments),this.requiredComponents=["nr-dropdown","nr-icon"],this.title="",this.description="",this.okText="OK",this.cancelText="Cancel",this.okType="primary",this.showCancel=!0,this.icon="exclamation-circle",this.iconColor="",this.placement="top",this.trigger="click",this.disabled=!1,this.arrow=!0,this.open=!1,this.okLoading=!1,this.handleConfirm=t=>Yt(this,void 0,void 0,(function*(){t.stopPropagation();const i=new CustomEvent("nr-confirm",{bubbles:!0,composed:!0,cancelable:!0,detail:{originalEvent:t}});if(this.dispatchEvent(i)&&!i.defaultPrevented){const i=this.onConfirm;if(i&&"function"==typeof i){const o=i(t);if(o&&"function"==typeof o.then){this.okLoading=!0;try{yield o,this.closePopconfirm()}catch(t){console.error("Confirmation failed:",t)}finally{this.okLoading=!1}return}}this.closePopconfirm()}})),this.handleCancel=t=>{t.stopPropagation(),this.dispatchEvent(new CustomEvent("nr-cancel",{bubbles:!0,composed:!0,detail:{originalEvent:t}})),this.closePopconfirm()},this.handleOpenChange=t=>{this.open=t.detail.open,this.dispatchEvent(new CustomEvent("nr-open-change",{bubbles:!0,composed:!0,detail:{open:this.open}}))}}get dropdownElement(){var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("nr-dropdown")}closePopconfirm(){this.open=!1,this.dropdownElement&&(this.dropdownElement.open=!1)}getIconColor(){return this.iconColor?this.iconColor:""}getIconClass(){const t={"exclamation-circle":"warning","question-circle":"question","info-circle":"info","close-circle":"error","check-circle":"success"};return this.iconColor?"custom":t[this.icon]||"warning"}renderContent(){const t=this.getIconClass(),i=this.getIconColor(),o=`ok-${this.okType}`;return gt`
|
|
278
|
-
<div class="popconfirm-content">
|
|
279
|
-
<div class="popconfirm-message">
|
|
280
|
-
<div
|
|
281
|
-
class="popconfirm-icon popconfirm-icon--${t}"
|
|
282
|
-
style=${i?`color: ${i}`:""}>
|
|
283
|
-
<nr-icon name=${this.icon}></nr-icon>
|
|
284
|
-
</div>
|
|
285
|
-
<div class="popconfirm-text">
|
|
286
|
-
${this.title?gt`<div class="popconfirm-title">${this.title}</div>`:""}
|
|
287
|
-
${this.description?gt`<div class="popconfirm-description">${this.description}</div>`:""}
|
|
288
|
-
</div>
|
|
289
|
-
</div>
|
|
290
|
-
<div class="popconfirm-buttons">
|
|
291
|
-
${this.showCancel?gt`
|
|
292
|
-
<button
|
|
293
|
-
class="popconfirm-button popconfirm-button--cancel"
|
|
294
|
-
@click=${this.handleCancel}
|
|
295
|
-
type="button">
|
|
296
|
-
${this.cancelText}
|
|
297
|
-
</button>
|
|
298
|
-
`:""}
|
|
299
|
-
<button
|
|
300
|
-
class=${Wt({"popconfirm-button":!0,[`popconfirm-button--${o}`]:!0,"popconfirm-button--loading":this.okLoading})}
|
|
301
|
-
@click=${this.handleConfirm}
|
|
302
|
-
?disabled=${this.okLoading}
|
|
303
|
-
type="button">
|
|
304
|
-
${this.okText}
|
|
305
|
-
</button>
|
|
306
|
-
</div>
|
|
307
|
-
</div>
|
|
308
|
-
`}render(){return gt`
|
|
309
|
-
<nr-dropdown
|
|
310
|
-
.open=${this.open}
|
|
311
|
-
.placement=${this.placement}
|
|
312
|
-
.trigger=${this.trigger}
|
|
313
|
-
?disabled=${this.disabled}
|
|
314
|
-
?arrow=${this.arrow}
|
|
315
|
-
@nr-dropdown-open=${this.handleOpenChange}
|
|
316
|
-
@nr-dropdown-close=${this.handleOpenChange}>
|
|
317
|
-
<slot name="trigger" slot="trigger"></slot>
|
|
318
|
-
<div slot="content">${this.renderContent()}</div>
|
|
319
|
-
</nr-dropdown>
|
|
320
|
-
`}};ti.styles=Zt,Xt([Kt({type:String})],ti.prototype,"title",void 0),Xt([Kt({type:String})],ti.prototype,"description",void 0),Xt([Kt({type:String,attribute:"ok-text"})],ti.prototype,"okText",void 0),Xt([Kt({type:String,attribute:"cancel-text"})],ti.prototype,"cancelText",void 0),Xt([Kt({type:String,attribute:"ok-type"})],ti.prototype,"okType",void 0),Xt([Kt({type:Boolean,attribute:"show-cancel"})],ti.prototype,"showCancel",void 0),Xt([Kt({type:String})],ti.prototype,"icon",void 0),Xt([Kt({type:String,attribute:"icon-color"})],ti.prototype,"iconColor",void 0),Xt([Kt({type:String})],ti.prototype,"placement",void 0),Xt([Kt({type:String})],ti.prototype,"trigger",void 0),Xt([Kt({type:Boolean})],ti.prototype,"disabled",void 0),Xt([Kt({type:Boolean})],ti.prototype,"arrow",void 0),Xt([Kt({type:Boolean,reflect:!0})],ti.prototype,"open",void 0),Xt([function(t){return Kt({...t,state:!0})}()],ti.prototype,"okLoading",void 0),ti=Xt([(t=>i=>"function"==typeof i?((t,i)=>(customElements.define(t,i),i))(t,i):((t,i)=>{const{kind:o,elements:s}=i;return{kind:o,elements:s,finisher(i){customElements.define(t,i)}}})(t,i))("nr-popconfirm")],ti);export{ti as NrPopconfirmElement};
|
|
6
|
+
*/;var s=function(o,r,t,n){for(var i,e=arguments.length,c=e<3?r:null===n?n=Object.getOwnPropertyDescriptor(r,t):n,a=o.length-1;a>=0;a--)(i=o[a])&&(c=(e<3?i(c):e>3?i(r,t,c):i(r,t))||c);return e>3&&c&&Object.defineProperty(r,t,c),c},p=function(o,r,t,n){return new(t||(t=Promise))((function(i,e){function c(o){try{l(n.next(o))}catch(o){e(o)}}function a(o){try{l(n.throw(o))}catch(o){e(o)}}function l(o){var r;o.done?i(o.value):(r=o.value,r instanceof t?r:new t((function(o){o(r)}))).then(c,a)}l((n=n.apply(o,r||[])).next())}))};let u=class extends(a(r)){constructor(){super(...arguments),this.requiredComponents=["nr-dropdown","nr-icon"],this.title="",this.description="",this.okText="OK",this.cancelText="Cancel",this.okType="primary",this.showCancel=!0,this.icon="exclamation-circle",this.iconColor="",this.placement="top",this.trigger="click",this.disabled=!1,this.arrow=!0,this.open=!1,this.okLoading=!1,this.handleConfirm=o=>p(this,void 0,void 0,(function*(){o.stopPropagation();const r=new CustomEvent("nr-confirm",{bubbles:!0,composed:!0,cancelable:!0,detail:{originalEvent:o}});if(this.dispatchEvent(r)&&!r.defaultPrevented){const r=this.onConfirm;if(r&&"function"==typeof r){const t=r(o);if(t&&"function"==typeof t.then){this.okLoading=!0;try{yield t,this.closePopconfirm()}catch(o){console.error("Confirmation failed:",o)}finally{this.okLoading=!1}return}}this.closePopconfirm()}})),this.handleCancel=o=>{o.stopPropagation(),this.dispatchEvent(new CustomEvent("nr-cancel",{bubbles:!0,composed:!0,detail:{originalEvent:o}})),this.closePopconfirm()},this.handleOpenChange=o=>{this.open=o.detail.open,this.dispatchEvent(new CustomEvent("nr-open-change",{bubbles:!0,composed:!0,detail:{open:this.open}}))}}get dropdownElement(){var o;return null===(o=this.shadowRoot)||void 0===o?void 0:o.querySelector("nr-dropdown")}closePopconfirm(){this.open=!1,this.dropdownElement&&(this.dropdownElement.open=!1)}getIconColor(){return this.iconColor?this.iconColor:""}getIconClass(){const o={"exclamation-circle":"warning","question-circle":"question","info-circle":"info","close-circle":"error","check-circle":"success"};return this.iconColor?"custom":o[this.icon]||"warning"}renderContent(){const o=this.getIconClass(),r=this.getIconColor(),n=`ok-${this.okType}`;return t`<div class="popconfirm-content"><div class="popconfirm-message"><div class="popconfirm-icon popconfirm-icon--${o}" style="${r?`color: ${r}`:""}"><nr-icon name="${this.icon}"></nr-icon></div><div class="popconfirm-text">${this.title?t`<div class="popconfirm-title">${this.title}</div>`:""} ${this.description?t`<div class="popconfirm-description">${this.description}</div>`:""}</div></div><div class="popconfirm-buttons">${this.showCancel?t`<button class="popconfirm-button popconfirm-button--cancel" @click="${this.handleCancel}" type="button">${this.cancelText}</button>`:""} <button class="${c({"popconfirm-button":!0,[`popconfirm-button--${n}`]:!0,"popconfirm-button--loading":this.okLoading})}" @click="${this.handleConfirm}" ?disabled="${this.okLoading}" type="button">${this.okText}</button></div></div>`}render(){return t`<nr-dropdown .open="${this.open}" .placement="${this.placement}" .trigger="${this.trigger}" ?disabled="${this.disabled}" ?arrow="${this.arrow}" @nr-dropdown-open="${this.handleOpenChange}" @nr-dropdown-close="${this.handleOpenChange}"><slot name="trigger" slot="trigger"></slot><div slot="content">${this.renderContent()}</div></nr-dropdown>`}};u.styles=l,s([n({type:String})],u.prototype,"title",void 0),s([n({type:String})],u.prototype,"description",void 0),s([n({type:String,attribute:"ok-text"})],u.prototype,"okText",void 0),s([n({type:String,attribute:"cancel-text"})],u.prototype,"cancelText",void 0),s([n({type:String,attribute:"ok-type"})],u.prototype,"okType",void 0),s([n({type:Boolean,attribute:"show-cancel"})],u.prototype,"showCancel",void 0),s([n({type:String})],u.prototype,"icon",void 0),s([n({type:String,attribute:"icon-color"})],u.prototype,"iconColor",void 0),s([n({type:String})],u.prototype,"placement",void 0),s([n({type:String})],u.prototype,"trigger",void 0),s([n({type:Boolean})],u.prototype,"disabled",void 0),s([n({type:Boolean})],u.prototype,"arrow",void 0),s([n({type:Boolean,reflect:!0})],u.prototype,"open",void 0),s([i()],u.prototype,"okLoading",void 0),u=s([e("nr-popconfirm")],u);export{u as NrPopconfirmElement};
|
package/bundle.js.gz
ADDED
|
Binary file
|