@nuralyui/popconfirm 0.0.3 → 0.0.5
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 +10 -77
- package/bundle.js.gz +0 -0
- package/package.json +1 -1
package/bundle.js
CHANGED
|
@@ -1,65 +1,4 @@
|
|
|
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)})`
|
|
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`
|
|
63
2
|
:host {
|
|
64
3
|
display: inline-block;
|
|
65
4
|
}
|
|
@@ -268,27 +207,21 @@ const Ht=1;class Vt{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,i,o)
|
|
|
268
207
|
* @license
|
|
269
208
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
270
209
|
* SPDX-License-Identifier: MIT
|
|
271
|
-
|
|
272
|
-
/**
|
|
273
|
-
* @license
|
|
274
|
-
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
275
|
-
* 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`
|
|
210
|
+
*/;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`
|
|
278
211
|
<div class="popconfirm-content">
|
|
279
212
|
<div class="popconfirm-message">
|
|
280
213
|
<div
|
|
281
|
-
class="popconfirm-icon popconfirm-icon--${
|
|
282
|
-
style=${
|
|
214
|
+
class="popconfirm-icon popconfirm-icon--${o}"
|
|
215
|
+
style=${r?`color: ${r}`:""}>
|
|
283
216
|
<nr-icon name=${this.icon}></nr-icon>
|
|
284
217
|
</div>
|
|
285
218
|
<div class="popconfirm-text">
|
|
286
|
-
${this.title?
|
|
287
|
-
${this.description?
|
|
219
|
+
${this.title?t`<div class="popconfirm-title">${this.title}</div>`:""}
|
|
220
|
+
${this.description?t`<div class="popconfirm-description">${this.description}</div>`:""}
|
|
288
221
|
</div>
|
|
289
222
|
</div>
|
|
290
223
|
<div class="popconfirm-buttons">
|
|
291
|
-
${this.showCancel?
|
|
224
|
+
${this.showCancel?t`
|
|
292
225
|
<button
|
|
293
226
|
class="popconfirm-button popconfirm-button--cancel"
|
|
294
227
|
@click=${this.handleCancel}
|
|
@@ -297,7 +230,7 @@ var Xt=function(t,i,o,s){for(var e,n=arguments.length,r=n<3?i:null===s?s=Object.
|
|
|
297
230
|
</button>
|
|
298
231
|
`:""}
|
|
299
232
|
<button
|
|
300
|
-
class=${
|
|
233
|
+
class=${c({"popconfirm-button":!0,[`popconfirm-button--${n}`]:!0,"popconfirm-button--loading":this.okLoading})}
|
|
301
234
|
@click=${this.handleConfirm}
|
|
302
235
|
?disabled=${this.okLoading}
|
|
303
236
|
type="button">
|
|
@@ -305,7 +238,7 @@ var Xt=function(t,i,o,s){for(var e,n=arguments.length,r=n<3?i:null===s?s=Object.
|
|
|
305
238
|
</button>
|
|
306
239
|
</div>
|
|
307
240
|
</div>
|
|
308
|
-
`}render(){return
|
|
241
|
+
`}render(){return t`
|
|
309
242
|
<nr-dropdown
|
|
310
243
|
.open=${this.open}
|
|
311
244
|
.placement=${this.placement}
|
|
@@ -317,4 +250,4 @@ var Xt=function(t,i,o,s){for(var e,n=arguments.length,r=n<3?i:null===s?s=Object.
|
|
|
317
250
|
<slot name="trigger" slot="trigger"></slot>
|
|
318
251
|
<div slot="content">${this.renderContent()}</div>
|
|
319
252
|
</nr-dropdown>
|
|
320
|
-
`}};
|
|
253
|
+
`}};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
|