eslink-ui-plus
Version:
vue3 component library, css framework
206 lines (205 loc) • 23.8 kB
JavaScript
(function(n,O){typeof exports=="object"&&typeof module!="undefined"?module.exports=O(require("vue"),require("lodash-es")):typeof define=="function"&&define.amd?define(["vue","lodash-es"],O):(n=typeof globalThis!="undefined"?globalThis:n||self,n["es-option-group"]=O(n.Vue,n._))})(this,function(n,O){"use strict";const R={labelKey:"label",valueKey:"value",disabledKey:"disabled",childrenKey:"children"},j={type:Object,default:()=>R},L={type:Boolean,default:!1},H=(t=null)=>{const a=n.ref(t);return[a,b=>{a.value=b},()=>a.value]};var M=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},U={exports:{}};/*!
* clipboard.js v2.0.8
* https://clipboardjs.com/
*
* Licensed MIT © Zeno Rocha
*/(function(t,a){(function(f,b){t.exports=b()})(M,function(){return function(){var s={134:function(p,l,e){e.d(l,{default:function(){return Te}});var i=e(279),c=e.n(i),g=e(370),x=e.n(g),d=e(817),v=e.n(d);function y(u){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?y=function(o){return typeof o}:y=function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},y(u)}function k(u,r){if(!(u instanceof r))throw new TypeError("Cannot call a class as a function")}function _(u,r){for(var o=0;o<r.length;o++){var h=r[o];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(u,h.key,h)}}function E(u,r,o){return r&&_(u.prototype,r),o&&_(u,o),u}var ye=function(){function u(r){k(this,u),this.resolveOptions(r),this.initSelection()}return E(u,[{key:"resolveOptions",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.action=o.action,this.container=o.container,this.emitter=o.emitter,this.target=o.target,this.text=o.text,this.trigger=o.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"createFakeElement",value:function(){var o=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[o?"right":"left"]="-9999px";var h=window.pageYOffset||document.documentElement.scrollTop;return this.fakeElem.style.top="".concat(h,"px"),this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.fakeElem}},{key:"selectFake",value:function(){var o=this,h=this.createFakeElement();this.fakeHandlerCallback=function(){return o.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.container.appendChild(h),this.selectedText=v()(h),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=v()(this.target),this.copyText()}},{key:"copyText",value:function(){var o;try{o=document.execCommand(this.action)}catch(h){o=!1}this.handleResult(o)}},{key:"handleResult",value:function(o){this.emitter.emit(o?"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 o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"copy";if(this._action=o,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(o){if(o!==void 0)if(o&&y(o)==="object"&&o.nodeType===1){if(this.action==="copy"&&o.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(this.action==="cut"&&(o.hasAttribute("readonly")||o.hasAttribute("disabled")))throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`);this._target=o}else throw new Error('Invalid "target" value, use a valid Element')},get:function(){return this._target}}]),u}(),ge=ye;function A(u){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?A=function(o){return typeof o}:A=function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},A(u)}function _e(u,r){if(!(u instanceof r))throw new TypeError("Cannot call a class as a function")}function K(u,r){for(var o=0;o<r.length;o++){var h=r[o];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(u,h.key,h)}}function ve(u,r,o){return r&&K(u.prototype,r),o&&K(u,o),u}function ke(u,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");u.prototype=Object.create(r&&r.prototype,{constructor:{value:u,writable:!0,configurable:!0}}),r&&$(u,r)}function $(u,r){return $=Object.setPrototypeOf||function(h,m){return h.__proto__=m,h},$(u,r)}function xe(u){var r=Se();return function(){var h=P(u),m;if(r){var w=P(this).constructor;m=Reflect.construct(h,arguments,w)}else m=h.apply(this,arguments);return we(this,m)}}function we(u,r){return r&&(A(r)==="object"||typeof r=="function")?r:Ee(u)}function Ee(u){if(u===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u}function Se(){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(u){return!1}}function P(u){return P=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},P(u)}function N(u,r){var o="data-clipboard-".concat(u);if(!!r.hasAttribute(o))return r.getAttribute(o)}var Ce=function(u){ke(o,u);var r=xe(o);function o(h,m){var w;return _e(this,o),w=r.call(this),w.resolveOptions(m),w.listenClick(h),w}return ve(o,[{key:"resolveOptions",value:function(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof m.action=="function"?m.action:this.defaultAction,this.target=typeof m.target=="function"?m.target:this.defaultTarget,this.text=typeof m.text=="function"?m.text:this.defaultText,this.container=A(m.container)==="object"?m.container:document.body}},{key:"listenClick",value:function(m){var w=this;this.listener=x()(m,"click",function(V){return w.onClick(V)})}},{key:"onClick",value:function(m){var w=m.delegateTarget||m.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new ge({action:this.action(w),target:this.target(w),text:this.text(w),container:this.container,trigger:w,emitter:this})}},{key:"defaultAction",value:function(m){return N("action",m)}},{key:"defaultTarget",value:function(m){var w=N("target",m);if(w)return document.querySelector(w)}},{key:"defaultText",value:function(m){return N("text",m)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["copy","cut"],w=typeof m=="string"?[m]:m,V=!!document.queryCommandSupported;return w.forEach(function(Oe){V=V&&!!document.queryCommandSupported(Oe)}),V}}]),o}(c()),Te=Ce},828:function(p){var l=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 i(c,g){for(;c&&c.nodeType!==l;){if(typeof c.matches=="function"&&c.matches(g))return c;c=c.parentNode}}p.exports=i},438:function(p,l,e){var i=e(828);function c(d,v,y,k,_){var E=x.apply(this,arguments);return d.addEventListener(y,E,_),{destroy:function(){d.removeEventListener(y,E,_)}}}function g(d,v,y,k,_){return typeof d.addEventListener=="function"?c.apply(null,arguments):typeof y=="function"?c.bind(null,document).apply(null,arguments):(typeof d=="string"&&(d=document.querySelectorAll(d)),Array.prototype.map.call(d,function(E){return c(E,v,y,k,_)}))}function x(d,v,y,k){return function(_){_.delegateTarget=i(_.target,v),_.delegateTarget&&k.call(d,_)}}p.exports=g},879:function(p,l){l.node=function(e){return e!==void 0&&e instanceof HTMLElement&&e.nodeType===1},l.nodeList=function(e){var i=Object.prototype.toString.call(e);return e!==void 0&&(i==="[object NodeList]"||i==="[object HTMLCollection]")&&"length"in e&&(e.length===0||l.node(e[0]))},l.string=function(e){return typeof e=="string"||e instanceof String},l.fn=function(e){var i=Object.prototype.toString.call(e);return i==="[object Function]"}},370:function(p,l,e){var i=e(879),c=e(438);function g(y,k,_){if(!y&&!k&&!_)throw new Error("Missing required arguments");if(!i.string(k))throw new TypeError("Second argument must be a String");if(!i.fn(_))throw new TypeError("Third argument must be a Function");if(i.node(y))return x(y,k,_);if(i.nodeList(y))return d(y,k,_);if(i.string(y))return v(y,k,_);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function x(y,k,_){return y.addEventListener(k,_),{destroy:function(){y.removeEventListener(k,_)}}}function d(y,k,_){return Array.prototype.forEach.call(y,function(E){E.addEventListener(k,_)}),{destroy:function(){Array.prototype.forEach.call(y,function(E){E.removeEventListener(k,_)})}}}function v(y,k,_){return c(document.body,y,k,_)}p.exports=g},817:function(p){function l(e){var i;if(e.nodeName==="SELECT")e.focus(),i=e.value;else if(e.nodeName==="INPUT"||e.nodeName==="TEXTAREA"){var c=e.hasAttribute("readonly");c||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),c||e.removeAttribute("readonly"),i=e.value}else{e.hasAttribute("contenteditable")&&e.focus();var g=window.getSelection(),x=document.createRange();x.selectNodeContents(e),g.removeAllRanges(),g.addRange(x),i=g.toString()}return i}p.exports=l},279:function(p){function l(){}l.prototype={on:function(e,i,c){var g=this.e||(this.e={});return(g[e]||(g[e]=[])).push({fn:i,ctx:c}),this},once:function(e,i,c){var g=this;function x(){g.off(e,x),i.apply(c,arguments)}return x._=i,this.on(e,x,c)},emit:function(e){var i=[].slice.call(arguments,1),c=((this.e||(this.e={}))[e]||[]).slice(),g=0,x=c.length;for(g;g<x;g++)c[g].fn.apply(c[g].ctx,i);return this},off:function(e,i){var c=this.e||(this.e={}),g=c[e],x=[];if(g&&i)for(var d=0,v=g.length;d<v;d++)g[d].fn!==i&&g[d].fn._!==i&&x.push(g[d]);return x.length?c[e]=x:delete c[e],this}},p.exports=l,p.exports.TinyEmitter=l}},f={};function b(p){if(f[p])return f[p].exports;var l=f[p]={exports:{}};return s[p](l,l.exports,b),l.exports}return function(){b.n=function(p){var l=p&&p.__esModule?function(){return p.default}:function(){return p};return b.d(l,{a:l}),l}}(),function(){b.d=function(p,l){for(var e in l)b.o(l,e)&&!b.o(p,e)&&Object.defineProperty(p,e,{enumerable:!0,get:l[e]})}}(),function(){b.o=function(p,l){return Object.prototype.hasOwnProperty.call(p,l)}}(),b(134)}().default})})(U);var q=Object.defineProperty,G=Object.defineProperties,X=Object.getOwnPropertyDescriptors,I=Object.getOwnPropertySymbols,J=Object.prototype.hasOwnProperty,Q=Object.prototype.propertyIsEnumerable,z=(t,a,s)=>a in t?q(t,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[a]=s,W=(t,a)=>{for(var s in a||(a={}))J.call(a,s)&&z(t,s,a[s]);if(I)for(var s of I(a))Q.call(a,s)&&z(t,s,a[s]);return t},Z=(t,a)=>G(t,X(a)),S=n.defineComponent({props:{modelValue:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},labelText:{type:String,default:""},indeterminate:Boolean},emits:["update:modelValue","change","select"],setup(t,a){const{emit:s}=a,f=n.reactive({checked:t.modelValue,indeterminate:t.indeterminate}),{modelValue:b,disabled:p}=n.toRefs(t),l=e=>{if(p.value)return;const i=!b.value;f.indeterminate?(f.checked=!0,f.indeterminate=!1):(f.checked=!f.checked,f.checked&&(f.indeterminate=!1)),s("select",{e,data:i}),s("update:modelValue",i)};return n.watch(b,(e,i)=>{e!==i&&(f.checked=e,s("change",e))}),n.watch(()=>f.indeterminate,()=>{f.indeterminate&&(f.checked=!1)}),Z(W({},n.toRefs(f)),{toggleChecked:l})}});n.pushScopeId("data-v-ab10b2fe");const ee=["checked"],te={class:"es-checkbox__name"};n.popScopeId();function ne(t,a,s,f,b,p){return n.openBlock(),n.createElementBlock("label",{class:n.normalizeClass(["es-checkbox",{"is-disabled":t.disabled}]),onClick:a[0]||(a[0]=n.withModifiers((...l)=>t.toggleChecked&&t.toggleChecked(...l),["prevent"]))},[n.createElementVNode("span",{class:n.normalizeClass(["es-checkbox__label",{"is-checked":t.checked,"is-disabled":t.disabled,"is-indeterminate":t.indeterminate}])},null,2),n.createElementVNode("input",{class:"es-checkbox__value",type:"checkbox",checked:t.checked},null,8,ee),n.createElementVNode("span",te,[n.renderSlot(t.$slots,"default",{},()=>[n.createTextVNode(n.toDisplayString(t.labelText),1)])])],2)}function B(t,a){a===void 0&&(a={});var s=a.insertAt;if(!(!t||typeof document=="undefined")){var f=document.head||document.getElementsByTagName("head")[0],b=document.createElement("style");b.type="text/css",s==="top"&&f.firstChild?f.insertBefore(b,f.firstChild):f.appendChild(b),b.styleSheet?b.styleSheet.cssText=t:b.appendChild(document.createTextNode(t))}}var oe=`.es-checkbox[data-v-ab10b2fe] {
height: 22px;
line-height: 22px;
-webkit-user-select: none;
-moz-user-select: none;
-o-user-select: none;
-ms-user-select: none;
user-select: none;
cursor: pointer;
display: inline-block;
}
.es-checkbox.is-disabled[data-v-ab10b2fe] {
cursor: not-allowed;
}
.es-checkbox:hover .es-checkbox__label[data-v-ab10b2fe] {
border-color: #1b9dde;
}
.es-checkbox:hover .es-checkbox__label.is-disabled[data-v-ab10b2fe] {
border-color: #e4e7ec;
}
.es-checkbox__label[data-v-ab10b2fe] {
width: 16px;
height: 16px;
background: #ffffff;
border: 1px solid #e4e7ec;
box-sizing: border-box;
border-radius: 2px;
display: inline-block;
position: relative;
vertical-align: middle;
}
.es-checkbox__label[data-v-ab10b2fe]::after {
content: "";
position: absolute;
width: 1px;
height: 9px;
left: 8px;
top: 3px;
background: #ffffff;
border-radius: 1px;
-webkit-transform-origin: center;
transform-origin: center;
}
.es-checkbox__label[data-v-ab10b2fe]::before {
content: "";
position: absolute;
width: 1px;
height: 4px;
left: 4px;
top: 7px;
background: #ffffff;
border-radius: 1px;
-webkit-transform: matrix(-0.74, 0.67, 0.67, 0.74, 0, 0) scaleY(0);
transform: matrix(-0.74, 0.67, 0.67, 0.74, 0, 0) scaleY(0);
-webkit-transform-origin: center;
transform-origin: center;
}
.es-checkbox__label.is-checked[data-v-ab10b2fe] {
background: #148dd2;
border: 0;
}
.es-checkbox__label.is-checked[data-v-ab10b2fe]::before {
-webkit-transform: matrix(-0.74, 0.67, 0.67, 0.74, 0, 0) scaleY(1);
transform: matrix(-0.74, 0.67, 0.67, 0.74, 0, 0) scaleY(1);
}
.es-checkbox__label.is-checked[data-v-ab10b2fe]::after {
-webkit-transform: rotate(42deg) scaleY(1);
transform: rotate(42deg) scaleY(1);
}
.es-checkbox__label.is-indeterminate[data-v-ab10b2fe] {
background-color: #148dd2;
border-color: #148dd2;
}
.es-checkbox__label.is-indeterminate[data-v-ab10b2fe]::before {
content: "";
position: absolute;
display: block;
background-color: #fff;
width: 14px;
height: 3px;
-webkit-transform: scale(0.5);
transform: scale(0.5);
left: 0;
right: 0;
top: 5px;
}
.es-checkbox__label.is-indeterminate[data-v-ab10b2fe]::after {
display: none;
}
.es-checkbox__label.is-disabled[data-v-ab10b2fe] {
background: #f5f7fa;
border: 1px solid #e4e7ec;
}
.es-checkbox__label.is-disabled ~ span.es-checkbox__name[data-v-ab10b2fe] {
color: #a3a9b3;
}
.es-checkbox__label.is-checked.is-disabled[data-v-ab10b2fe]::before {
background: #a3a9b3;
-webkit-transform: matrix(-0.74, 0.67, 0.67, 0.74, 0, 0) scaleY(1);
transform: matrix(-0.74, 0.67, 0.67, 0.74, 0, 0) scaleY(1);
}
.es-checkbox__label.is-checked.is-disabled[data-v-ab10b2fe]::after {
background: #a3a9b3;
-webkit-transform: rotate(42deg) scaleY(1);
transform: rotate(42deg) scaleY(1);
}
.es-checkbox__value[data-v-ab10b2fe] {
opacity: 0;
outline: none;
position: absolute;
margin: 0;
width: 0;
height: 0;
z-index: -1;
}
.es-checkbox__name[data-v-ab10b2fe] {
height: 22px;
color: #515c70;
font-family: PingFangSC;
font-size: 14px;
line-height: 22px;
margin-left: 8px;
vertical-align: middle;
}`;B(oe),S.render=ne,S.__scopeId="data-v-ab10b2fe",S.__file="components/checkbox/index.vue",S.install=t=>{t.component("es-checkbox",S)};var re=Object.defineProperty,F=Object.getOwnPropertySymbols,ie=Object.prototype.hasOwnProperty,ae=Object.prototype.propertyIsEnumerable,Y=(t,a,s)=>a in t?re(t,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[a]=s,D=(t,a)=>{for(var s in a||(a={}))ie.call(a,s)&&Y(t,s,a[s]);if(F)for(var s of F(a))ae.call(a,s)&&Y(t,s,a[s]);return t},C=n.defineComponent({components:{EsCheckbox:S},props:{styles:{type:Object,default:()=>({})},modelValue:{type:[Array,String,Number],default:""},keyConfig:j,source:{type:Object,default:()=>[]},multiple:L,showCheckBox:{type:Boolean,default:!0},maxLen:{type:Number,default:10}},emits:["change","select","update:modelValue"],setup(t,{emit:a}){const{valueKey:s,labelKey:f,disabledKey:b,childrenKey:p}=D(D({},R),t.keyConfig),l=d=>{if(d=n.toRaw(d),!t.multiple)return new Set([d]);const v=Array.isArray(d);return new Set(v?[...d]:[d])},[e]=H(l(t.modelValue)),i=n.computed(()=>t.multiple?[...e.value]:[...e.value][0]);return n.watch(()=>t.modelValue,(d,v)=>{O.isEqual(d,v)||(e.value=l(d))}),{active:e,isActived:d=>e.value.has(d[s]),toggleActived:d=>{const v=d[s];t.multiple?e.value.has(v)?e.value.delete(v):e.value.add(v):e.value=new Set([v]);const y=i.value;a("select",{item:d,value:y}),a("change",i.value),a("update:modelValue",y)},valueKey:s,labelKey:f,disabledKey:b,childrenKey:p,emitValue:i,useShow:d=>Reflect.has(d,"show")?d.show:!0}}});n.pushScopeId("data-v-bfbc4d1a");const le={class:"es-option__content"},se=["onClick"],ce={key:1,class:"es-option__content__item__label"},ue={key:1,class:"es-option__content__no-source"};n.popScopeId();function de(t,a,s,f,b,p){const l=n.resolveComponent("es-checkbox");return n.openBlock(),n.createElementBlock("div",{class:"es-option",style:n.normalizeStyle(t.styles)},[n.createElementVNode("div",le,[t.source&&t.source.length?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList(t.source,(e,i)=>n.withDirectives((n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["es-option__content__item",{active:t.isActived(e)}]),key:e[t.valueKey],onClick:c=>t.toggleActived(e)},[n.renderSlot(t.$slots,"default",{item:e,active:t.emitValue},()=>[t.multiple&&t.showCheckBox?(n.openBlock(),n.createBlock(l,{key:0,class:"es-option__content__item__checkbox",modelValue:t.isActived(e)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e[t.labelKey]),1)]),_:2},1032,["modelValue"])):(n.openBlock(),n.createElementBlock("span",ce,n.toDisplayString(e[t.labelKey]),1))])],10,se)),[[n.vShow,t.useShow(e)&&i+1<=t.maxLen]])),128)):(n.openBlock(),n.createElementBlock("div",ue,"\u6682\u65E0\u6570\u636E"))])],4)}var fe=`.es-option[data-v-bfbc4d1a] {
display: inline-block;
width: 100%;
background: #ffffff;
box-shadow: 0px 6px 12px -6px rgba(24, 39, 75, 0.12), 0px 8px 24px -4px rgba(24, 39, 75, 0.08);
border-radius: 4px;
}
.es-option__content[data-v-bfbc4d1a] {
display: flex;
flex-direction: column;
}
.es-option__content__no-source[data-v-bfbc4d1a] {
display: flex;
align-items: center;
justify-content: center;
color: #bbbcc9;
}
.es-option__content__item[data-v-bfbc4d1a] {
display: flex;
align-items: center;
color: #3e4051;
line-height: 21px;
min-width: 331px;
font-size: 14px;
margin-top: 1px;
cursor: pointer;
padding: 6px 12px 5px 12px;
}
.es-option__content__item.active[data-v-bfbc4d1a] {
background: #eaf1ff;
color: #282934;
font-weight: 600;
}
.es-option__content__item[data-v-bfbc4d1a]:hover {
background: #eaf1ff;
}`;B(fe),C.render=de,C.__scopeId="data-v-bfbc4d1a",C.__file="components/option/index.vue",C.install=t=>{t.component("es-option",C)};var pe=(t,a,s)=>new Promise((f,b)=>{var p=i=>{try{e(s.next(i))}catch(c){b(c)}},l=i=>{try{e(s.throw(i))}catch(c){b(c)}},e=i=>i.done?f(i.value):Promise.resolve(i.value).then(p,l);e((s=s.apply(t,a)).next())}),T=n.defineComponent({components:{EsOption:C},props:{styles:{type:Object,default:()=>({})},modelValue:{type:Array,default:()=>[]},keyConfig:j,source:{type:Object,default:()=>[]},multiple:L,showCheckBox:{type:Boolean,default:!0}},emits:["change","select","update:modelValue"],setup(t,{emit:a}){function s(){var l,e;return Array((e=(l=t.source)==null?void 0:l.length)!=null?e:1).fill([])}const f=n.ref(s());return n.watch(()=>t.modelValue,l=>{f.value=l},{immediate:!0}),{valueChangeEvt:()=>pe(this,null,function*(){yield n.nextTick(),a("change",n.toRaw(f.value)),a("update:modelValue",n.toRaw(f.value))}),groupSelectedValue:f,selectEvt:(l,{item:e})=>{a("select",{item:n.toRaw(e),value:n.toRaw(f.value),index:l})}}}});n.pushScopeId("data-v-6706db65");const he={class:"es-option-group__content__title"};n.popScopeId();function be(t,a,s,f,b,p){const l=n.resolveComponent("es-option");return n.openBlock(),n.createElementBlock("div",{class:"es-option-group",style:n.normalizeStyle(t.styles)},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(t.source,(e,i)=>(n.openBlock(),n.createElementBlock("div",{class:"es-option-group__content",key:e.value},[n.createElementVNode("div",he,n.toDisplayString(e.title),1),n.createVNode(l,{source:e.source,multiple:t.multiple,modelValue:t.groupSelectedValue[i],"onUpdate:modelValue":c=>t.groupSelectedValue[i]=c,onChange:t.valueChangeEvt,onSelect:c=>t.selectEvt(i,c),keyConfig:t.keyConfig,showCheckBox:t.showCheckBox},{default:n.withCtx(({item:c})=>[n.renderSlot(t.$slots,"default",{item:c,value:t.groupSelectedValue})]),_:2},1032,["source","multiple","modelValue","onUpdate:modelValue","onChange","onSelect","keyConfig","showCheckBox"])]))),128))],4)}var me=`.es-option-group[data-v-6706db65] {
display: inline-block;
width: 100%;
background: #ffffff;
box-shadow: 0px 6px 12px -6px rgba(24, 39, 75, 0.12), 0px 8px 24px -4px rgba(24, 39, 75, 0.08);
border-radius: 4px;
padding: 8px 0;
}
.es-option-group__content[data-v-6706db65] {
display: flex;
flex-direction: column;
}
.es-option-group__content:nth-of-type(1) .es-option-group__content__title[data-v-6706db65] {
margin-top: 0;
}
.es-option-group__content__title[data-v-6706db65] {
color: #5c5e70;
font-size: 12px;
padding: 0 12px;
line-height: 18px;
margin-bottom: 8px;
margin-top: 15px;
}
.es-option-group__content__item[data-v-6706db65] {
display: flex;
align-items: center;
color: #3e4051;
line-height: 21px;
min-width: 331px;
font-size: 14px;
margin-top: 1px;
cursor: pointer;
padding: 6px 12px 5px 12px;
}
.es-option-group__content__item.active[data-v-6706db65] {
background: #eaf1ff;
color: #282934;
font-weight: 600;
}
[data-v-6706db65] .es-option {
box-shadow: unset;
}`;return B(me),T.render=be,T.__scopeId="data-v-6706db65",T.__file="components/option-group/index.vue",T.install=t=>{t.component("es-option-group",T)},T});