UNPKG

eslink-ui-plus

Version:

vue3 component library, css framework

65 lines (64 loc) 14.1 kB
import{defineComponent as Z,pushScopeId as q,popScopeId as ee,openBlock as L,createElementBlock as N,normalizeStyle as te,Fragment as ne,renderList as re,renderSlot as j,createElementVNode as A,toDisplayString as F}from"vue";const M={labelKey:"label",valueKey:"value",disabledKey:"disabled",childrenKey:"children"},ie={type:Object,default:()=>M};var oe=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},ae={exports:{}};/*! * clipboard.js v2.0.8 * https://clipboardjs.com/ * * Licensed MIT © Zeno Rocha */(function(p,v){(function(E,m){p.exports=m()})(oe,function(){return function(){var g={134:function(c,o,e){e.d(o,{default:function(){return Q}});var a=e(279),s=e.n(a),u=e(370),b=e.n(u),h=e(817),k=e.n(h);function f(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?f=function(t){return typeof t}:f=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(r)}function y(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function")}function d(r,n){for(var t=0;t<n.length;t++){var i=n[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(r,i.key,i)}}function x(r,n,t){return n&&d(r.prototype,n),t&&d(r,t),r}var z=function(){function r(n){y(this,r),this.resolveOptions(n),this.initSelection()}return x(r,[{key:"resolveOptions",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.action=t.action,this.container=t.container,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"createFakeElement",value:function(){var t=document.documentElement.getAttribute("dir")==="rtl";this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[t?"right":"left"]="-9999px";var i=window.pageYOffset||document.documentElement.scrollTop;return this.fakeElem.style.top="".concat(i,"px"),this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.fakeElem}},{key:"selectFake",value:function(){var t=this,i=this.createFakeElement();this.fakeHandlerCallback=function(){return t.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.container.appendChild(i),this.selectedText=k()(i),this.copyText(),this.removeFake()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=k()(this.target),this.copyText()}},{key:"copyText",value:function(){var t;try{t=document.execCommand(this.action)}catch(i){t=!1}this.handleResult(t)}},{key:"handleResult",value:function(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),document.activeElement.blur(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"copy";if(this._action=t,this._action!=="copy"&&this._action!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(t){if(t!==void 0)if(t&&f(t)==="object"&&t.nodeType===1){if(this.action==="copy"&&t.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(this.action==="cut"&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`);this._target=t}else throw new Error('Invalid "target" value, use a valid Element')},get:function(){return this._target}}]),r}(),D=z;function w(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?w=function(t){return typeof t}:w=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},w(r)}function $(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function")}function R(r,n){for(var t=0;t<n.length;t++){var i=n[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(r,i.key,i)}}function B(r,n,t){return n&&R(r.prototype,n),t&&R(r,t),r}function U(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(n&&n.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),n&&C(r,n)}function C(r,n){return C=Object.setPrototypeOf||function(i,l){return i.__proto__=l,i},C(r,n)}function V(r){var n=X();return function(){var i=O(r),l;if(n){var _=O(this).constructor;l=Reflect.construct(i,arguments,_)}else l=i.apply(this,arguments);return Y(this,l)}}function Y(r,n){return n&&(w(n)==="object"||typeof n=="function")?n:G(r)}function G(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function X(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(r){return!1}}function O(r){return O=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},O(r)}function P(r,n){var t="data-clipboard-".concat(r);if(!!n.hasAttribute(t))return n.getAttribute(t)}var J=function(r){U(t,r);var n=V(t);function t(i,l){var _;return $(this,t),_=n.call(this),_.resolveOptions(l),_.listenClick(i),_}return B(t,[{key:"resolveOptions",value:function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof l.action=="function"?l.action:this.defaultAction,this.target=typeof l.target=="function"?l.target:this.defaultTarget,this.text=typeof l.text=="function"?l.text:this.defaultText,this.container=w(l.container)==="object"?l.container:document.body}},{key:"listenClick",value:function(l){var _=this;this.listener=b()(l,"click",function(T){return _.onClick(T)})}},{key:"onClick",value:function(l){var _=l.delegateTarget||l.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new D({action:this.action(_),target:this.target(_),text:this.text(_),container:this.container,trigger:_,emitter:this})}},{key:"defaultAction",value:function(l){return P("action",l)}},{key:"defaultTarget",value:function(l){var _=P("target",l);if(_)return document.querySelector(_)}},{key:"defaultText",value:function(l){return P("text",l)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["copy","cut"],_=typeof l=="string"?[l]:l,T=!!document.queryCommandSupported;return _.forEach(function(W){T=T&&!!document.queryCommandSupported(W)}),T}}]),t}(s()),Q=J},828:function(c){var o=9;if(typeof Element!="undefined"&&!Element.prototype.matches){var e=Element.prototype;e.matches=e.matchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector}function a(s,u){for(;s&&s.nodeType!==o;){if(typeof s.matches=="function"&&s.matches(u))return s;s=s.parentNode}}c.exports=a},438:function(c,o,e){var a=e(828);function s(h,k,f,y,d){var x=b.apply(this,arguments);return h.addEventListener(f,x,d),{destroy:function(){h.removeEventListener(f,x,d)}}}function u(h,k,f,y,d){return typeof h.addEventListener=="function"?s.apply(null,arguments):typeof f=="function"?s.bind(null,document).apply(null,arguments):(typeof h=="string"&&(h=document.querySelectorAll(h)),Array.prototype.map.call(h,function(x){return s(x,k,f,y,d)}))}function b(h,k,f,y){return function(d){d.delegateTarget=a(d.target,k),d.delegateTarget&&y.call(h,d)}}c.exports=u},879:function(c,o){o.node=function(e){return e!==void 0&&e instanceof HTMLElement&&e.nodeType===1},o.nodeList=function(e){var a=Object.prototype.toString.call(e);return e!==void 0&&(a==="[object NodeList]"||a==="[object HTMLCollection]")&&"length"in e&&(e.length===0||o.node(e[0]))},o.string=function(e){return typeof e=="string"||e instanceof String},o.fn=function(e){var a=Object.prototype.toString.call(e);return a==="[object Function]"}},370:function(c,o,e){var a=e(879),s=e(438);function u(f,y,d){if(!f&&!y&&!d)throw new Error("Missing required arguments");if(!a.string(y))throw new TypeError("Second argument must be a String");if(!a.fn(d))throw new TypeError("Third argument must be a Function");if(a.node(f))return b(f,y,d);if(a.nodeList(f))return h(f,y,d);if(a.string(f))return k(f,y,d);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function b(f,y,d){return f.addEventListener(y,d),{destroy:function(){f.removeEventListener(y,d)}}}function h(f,y,d){return Array.prototype.forEach.call(f,function(x){x.addEventListener(y,d)}),{destroy:function(){Array.prototype.forEach.call(f,function(x){x.removeEventListener(y,d)})}}}function k(f,y,d){return s(document.body,f,y,d)}c.exports=u},817:function(c){function o(e){var a;if(e.nodeName==="SELECT")e.focus(),a=e.value;else if(e.nodeName==="INPUT"||e.nodeName==="TEXTAREA"){var s=e.hasAttribute("readonly");s||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),s||e.removeAttribute("readonly"),a=e.value}else{e.hasAttribute("contenteditable")&&e.focus();var u=window.getSelection(),b=document.createRange();b.selectNodeContents(e),u.removeAllRanges(),u.addRange(b),a=u.toString()}return a}c.exports=o},279:function(c){function o(){}o.prototype={on:function(e,a,s){var u=this.e||(this.e={});return(u[e]||(u[e]=[])).push({fn:a,ctx:s}),this},once:function(e,a,s){var u=this;function b(){u.off(e,b),a.apply(s,arguments)}return b._=a,this.on(e,b,s)},emit:function(e){var a=[].slice.call(arguments,1),s=((this.e||(this.e={}))[e]||[]).slice(),u=0,b=s.length;for(u;u<b;u++)s[u].fn.apply(s[u].ctx,a);return this},off:function(e,a){var s=this.e||(this.e={}),u=s[e],b=[];if(u&&a)for(var h=0,k=u.length;h<k;h++)u[h].fn!==a&&u[h].fn._!==a&&b.push(u[h]);return b.length?s[e]=b:delete s[e],this}},c.exports=o,c.exports.TinyEmitter=o}},E={};function m(c){if(E[c])return E[c].exports;var o=E[c]={exports:{}};return g[c](o,o.exports,m),o.exports}return function(){m.n=function(c){var o=c&&c.__esModule?function(){return c.default}:function(){return c};return m.d(o,{a:o}),o}}(),function(){m.d=function(c,o){for(var e in o)m.o(o,e)&&!m.o(c,e)&&Object.defineProperty(c,e,{enumerable:!0,get:o[e]})}}(),function(){m.o=function(c,o){return Object.prototype.hasOwnProperty.call(c,o)}}(),m(134)}().default})})(ae);var se=Object.defineProperty,H=Object.getOwnPropertySymbols,le=Object.prototype.hasOwnProperty,ce=Object.prototype.propertyIsEnumerable,I=(p,v,g)=>v in p?se(p,v,{enumerable:!0,configurable:!0,writable:!0,value:g}):p[v]=g,K=(p,v)=>{for(var g in v||(v={}))le.call(v,g)&&I(p,g,v[g]);if(H)for(var g of H(v))ce.call(v,g)&&I(p,g,v[g]);return p},S=Z({props:{styles:{type:Object,default:()=>({})},source:Array,keyConfig:ie},setup(p){const{labelKey:v,valueKey:g}=K(K({},M),p.keyConfig);return{labelKey:v,valueKey:g}}});q("data-v-686e0b10");const ue={class:"es-process-line__item__label"},fe={class:"es-process-line__item__value"},de=A("div",{class:"es-process-line__item__decoration"},null,-1),pe=A("div",{class:"es-process-line__item__line"},null,-1);ee();function he(p,v,g,E,m,c){return L(),N("div",{class:"es-process-line",style:te(p.styles)},[(L(!0),N(ne,null,re(p.source,(o,e)=>(L(),N("div",{class:"es-process-line__item",key:e},[j(p.$slots,"label",{item:o},()=>[A("div",ue,F(o[p.labelKey]),1)]),j(p.$slots,"value",{item:o},()=>[A("div",fe,F(o[p.valueKey]),1)]),de,pe]))),128))],4)}function ye(p,v){v===void 0&&(v={});var g=v.insertAt;if(!(!p||typeof document=="undefined")){var E=document.head||document.getElementsByTagName("head")[0],m=document.createElement("style");m.type="text/css",g==="top"&&E.firstChild?E.insertBefore(m,E.firstChild):E.appendChild(m),m.styleSheet?m.styleSheet.cssText=p:m.appendChild(document.createTextNode(p))}}var ve=`.es-process-line[data-v-686e0b10] { display: flex; flex-direction: column; } .es-process-line__item[data-v-686e0b10] { flex: 1; font-size: 14px; line-height: 21px; position: relative; margin-left: 24px; } .es-process-line__item__label[data-v-686e0b10] { color: #7a7c90; } .es-process-line__item__value[data-v-686e0b10] { color: #282934; } .es-process-line__item__decoration[data-v-686e0b10] { position: absolute; width: 16px; height: 16px; background: #eaf1ff; border-radius: 50%; left: -24px; top: 0; z-index: 1; } .es-process-line__item__decoration[data-v-686e0b10]::after { position: absolute; content: ""; width: 6px; height: 6px; top: 0; bottom: 0; left: 0; right: 0; margin: auto; background: #a7baf1; border-radius: 50%; z-index: 2; } .es-process-line__item__line[data-v-686e0b10] { width: 16px; position: absolute; top: 0; bottom: 0; left: -23px; margin: auto 0; } .es-process-line__item__line[data-v-686e0b10]::after { content: ""; position: absolute; top: 16px; bottom: 0; margin: auto 0; left: 50%; margin-left: -1px; border-left: 1px dashed #dbe2f9; }`;ye(ve),S.render=he,S.__scopeId="data-v-686e0b10",S.__file="components/process-line/index.vue",S.install=p=>{p.component("es-process-line",S)};export{S as default};