quarkd
Version:
Mobile UI Components built on Web Components.
2 lines (1 loc) • 4.79 kB
JavaScript
import{_ as t,a as e}from"../typeof.js";import{_ as n,a as o,b as r,c as i,H as a,d as c,N as s,B as l}from"../index2.js";import{_ as u}from"../defineProperty.js";import{d as f,a as d,f as h,r as p,w as m,s as y,M as v,h as k}from"../index22.js";import"../overlay/index.js";import"../bodyScrollLock.esm.js";var g=function(t){h(r,t);var e,n,o=(e=r,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,o=f(e);if(n){var r=f(this).constructor;t=Reflect.construct(o,arguments,r)}else t=o.apply(this,arguments);return d(this,t)});function r(){var t;return p(this,r),(t=o.call(this)).attachShadow({mode:"open"}).innerHTML="\n <style>\n ".concat(m,'\n </style>\n <svg class="icon" id="icon" aria-hidden="true" viewBox="0 0 1024 1024">\n ').concat('<path d="M512 85.333333c235.648 0 426.666667 191.018667 426.666667 426.666667s-191.018667 426.666667-426.666667 426.666667S85.333333 747.648 85.333333 512 276.352 85.333333 512 85.333333z m0 85.333334a341.333333 341.333333 0 1 0 0 682.666666 341.333333 341.333333 0 0 0 0-682.666666z m115.498667 225.834666a42.666667 42.666667 0 0 1 3.328 56.618667l-3.328 3.712L572.373333 512l55.125334 55.168a42.666667 42.666667 0 0 1-56.618667 63.658667l-3.712-3.328L512 572.373333l-55.168 55.125334a42.666667 42.666667 0 0 1-63.658667-56.618667l3.328-3.712L451.626667 512l-55.125334-55.168a42.666667 42.666667 0 0 1 56.618667-63.658667l3.712 3.328L512 451.626667l55.168-55.125334a42.666667 42.666667 0 0 1 60.330667 0z" p-id="4230"></path>',"\n </svg>\n "),t.icon=t.shadowRoot.getElementById("icon"),t}return y(r,[{key:"connectedCallback",value:function(){this.upgradeProperty()}},{key:"attributeChangedCallback",value:function(t,e,n){if("color"===t)this.icon.style.color=n;else if("size"===t){var o=this.getFontSize();this.icon.style.fontSize="".concat(o)}}},{key:"upgradeProperty",value:function(){this.size=this.size,this.color=this.color}},{key:"getFontSize",value:function(){return v(this.size)}},{key:"size",get:function(){return this.getAttribute("size")},set:function(t){this.setAttribute("size",t)}},{key:"color",get:function(){return this.getAttribute("color")},set:function(t){this.setAttribute("color",t)}}],[{key:"observedAttributes",get:function(){return["size","color"]}}]),r}(k(HTMLElement));customElements.get("quark-icon-close-o")||customElements.define("quark-icon-close-o",g);function z(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,i=n(t);if(e){var a=n(this).constructor;r=Reflect.construct(i,arguments,a)}else r=i.apply(this,arguments);return o(this,r)}}var R=function(n){r(c,a);var o=z(c);function c(){var e;t(this,c);for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return e=o.call.apply(o,[this].concat(r)),u(i(e),"url",""),u(i(e),"size","32"),u(i(e),"open",!1),u(i(e),"dRemove",!1),u(i(e),"closeIconClick",(function(){e.open=!1,e.$emit("close")})),e}return e(c,[{key:"shouldComponentUpdate",value:function(t,e,n){var o=this;return"open"===t&&n!==e&&!n&&this.dRemove&&setTimeout((function(){return document.body.removeChild(o)}),300),!0}},{key:"render",value:function(){return a.h("quark-overlay",{open:this.open,part:"root"},a.h("div",{class:"quark-market-container",part:"container"},a.h("slot",{name:"market",part:"market"},this.url&&a.h("img",{alt:"error",src:this.url})),a.h("quark-icon-close-o",{part:"market-close",class:"quark-market-close",size:this.size,color:"#fff",onClick:this.closeIconClick})))}}]),c}();function b(t){var e=document.createElement("quark-market-dialog"),n=t.close,o=t.zindex,r=t.url;return e.dRemove=!0,e.close=n,e.zindex=o,e.url=r,e.dRemove=!0,document.body.appendChild(e),setTimeout((function(){e.open=!0})),e}c([s()],R.prototype,"url",void 0),c([s()],R.prototype,"size",void 0),c([s({type:Boolean})],R.prototype,"open",void 0),R=c([l({tag:"quark-market-dialog",style:':host quark-overlay .quark-market-container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n}\n\n:host slot[name="market"] img {\n width: var(--market-dialog-with, 76.8vw);\n border-radius: var(--market-dialog-radius, 3.2vw);\n height: 100%;\n}\n\n:host quark-overlay .quark-market-close {\n margin-top: 10.66667vw;\n text-align: center;\n cursor: pointer;\n}\n'})],R);export{R as QuarkMarketDialog,b as default};