quarkd
Version:
Mobile UI Components built on Web Components.
2 lines (1 loc) • 5.79 kB
JavaScript
import{_ as t,a as e}from"../typeof.js";import{_ as o,a as n,b as r,c as i,P as a,H as c,d as l,N as s,B as u}from"../index2.js";import{_ as h}from"../defineProperty.js";import{d as f,a as d,f as p,r as y,w as g,s as v,M as b,h as k}from"../index22.js";import"../index5.js";var m=function(t){p(r,t);var e,o,n=(e=r,o=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,n=f(e);if(o){var r=f(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return d(this,t)});function r(){var t;return y(this,r),(t=n.call(this)).attachShadow({mode:"open"}).innerHTML="\n <style>\n ".concat(g,'\n </style>\n <svg class="icon" id="icon" aria-hidden="true" viewBox="0 0 1024 1024">\n ').concat('<path d="M819.456 300.544a42.666667 42.666667 0 0 1 53.333333 28.245333C888.32 379.477333 896 440.490667 896 512c0 71.509333-7.637333 132.522667-23.210667 183.210667a42.666667 42.666667 0 0 1-81.578666-25.088c12.842667-41.813333 19.456-94.549333 19.456-158.122667 0-63.573333-6.613333-116.352-19.456-158.122667a42.666667 42.666667 0 0 1 28.245333-53.333333zM578.986667 153.002667a85.333333 85.333333 0 0 1 105.344 58.922666A1102.08 1102.08 0 0 1 725.333333 512.426667c0 103.253333-13.653333 203.392-41.045333 300.458666a85.290667 85.290667 0 0 1-133.845333 44.672l-5.674667-4.693333-127.232-115.754667a42.666667 42.666667 0 0 0-23.466667-10.794666l-5.248-0.298667H213.333333a85.376 85.376 0 0 1-85.12-79.061333L128 640.554667V384.256c0-45.013333 34.816-81.92 78.933333-85.162667L213.333333 298.837333h175.488a42.666667 42.666667 0 0 0 24.618667-7.808l4.096-3.285333 127.232-115.754667a85.333333 85.333333 0 0 1 34.133333-18.986666z m23.253333 82.218666L474.88 350.976a127.914667 127.914667 0 0 1-76.586667 32.938667l-9.514666 0.341333H213.333333v256.298667h175.488c28.672 0 56.405333 9.642667 78.848 27.178666l7.253334 6.144 127.232 115.754667c25.216-89.386667 37.845333-181.76 37.845333-277.205333 0-86.784-10.410667-171.008-31.274667-252.757334l-6.528-24.448z" p-id="3372"></path>',"\n </svg>\n "),t.icon=t.shadowRoot.getElementById("icon"),t}return v(r,[{key:"connectedCallback",value:function(){this.upgradeProperty()}},{key:"attributeChangedCallback",value:function(t,e,o){if("color"===t)this.icon.style.color=o;else if("size"===t){var n=this.getFontSize();this.icon.style.fontSize="".concat(n)}}},{key:"upgradeProperty",value:function(){this.size=this.size,this.color=this.color}},{key:"getFontSize",value:function(){return b(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-notify")||customElements.define("quark-icon-notify",m);function x(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=o(t);if(e){var a=o(this).constructor;r=Reflect.construct(i,arguments,a)}else r=i.apply(this,arguments);return n(this,r)}}var R=function(o){r(l,c);var n=x(l);function l(){var e;t(this,l);for(var o=arguments.length,r=new Array(o),c=0;c<o;c++)r[c]=arguments[c];return e=n.call.apply(n,[this].concat(r)),h(i(e),"text",""),h(i(e),"bgcolor",""),h(i(e),"color",""),h(i(e),"lefthide",!1),h(i(e),"righthide",!1),h(i(e),"multiple",1),h(i(e),"rightSlotRef",a()),h(i(e),"handleRightClick",(function(){e.$emit("rightclick")})),h(i(e),"handleRightSlotChange",(function(){var t=e.rightSlotRef.current;if(t){var o=t.assignedNodes().length;t.style.paddingRight=o?"0px":"11px"}})),e}return e(l,[{key:"render",value:function(){return c.h("div",{style:{backgroundColor:this.bgcolor,color:this.color},part:"root"},c.h("slot",{name:"left",class:"quark-noticebar-left"},!this.lefthide&&c.h("quark-icon-notify",{part:"notify-icon",size:"15"})),c.h("slot",{name:"text"},c.h("span",{class:"quark-noticebar-text",part:"text",style:{WebkitLineClamp:this.multiple}},this.text)),c.h("slot",{name:"right",class:"quark-noticebar-right",ref:this.rightSlotRef,onslotchange:this.handleRightSlotChange},!this.righthide&&c.h("quark-icon-arrow-right",{part:"arrow-right-icon",size:"15",onClick:this.handleRightClick})))}}]),l}();l([s()],R.prototype,"text",void 0),l([s()],R.prototype,"bgcolor",void 0),l([s()],R.prototype,"color",void 0),l([s({type:Boolean})],R.prototype,"lefthide",void 0),l([s({type:Boolean})],R.prototype,"righthide",void 0),l([s()],R.prototype,"multiple",void 0);var z=R=l([u({tag:"quark-noticebar",style:":host {\n display: block;\n font-size: 3.46667vw;\n}\n\n:host div {\n position: relative;\n display: flex;\n align-items: center;\n padding: var(--noticebar-padding, 2.66667vw);\n border-radius: var(--noticebar-border-radius, 0);\n color: #ee8c02;\n background: #fef4e7;\n}\n\n:host .quark-noticebar-left quark-icon-notify {\n margin-right: 1.86667vw;\n color: var(--noticebar-left-color);\n}\n\n:host .quark-noticebar-right quark-icon-notify {\n color: var(--noticebar-right-color);\n}\n\n:host .quark-noticebar-text {\n -webkit-line-clamp: 1;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n text-overflow: ellipsis;\n word-break: break-all;\n overflow: hidden;\n flex: 1;\n display: block;\n}\n"})],R);export{z as default};