@persagy2/meri-design
Version:
fork from meri-design and extend it.
7 lines • 50.2 kB
JavaScript
/*!
* @@persagy2/meri-design v1.4.9-extend.2
* (c) 2019-2020 xiongshuang
* Released under the MIT License.
* 2022-12-07 10:31:52
*/
var e,t;e=this,t=function(e){return function(){"use strict";var t={1952:function(e,t,n){var i=n(5064);t.Z={name:"Checkbox",props:{checked:{type:String,default:"uncheck"},disabled:{type:Boolean,default:!1},stopPropagation:{type:Boolean,default:!1}},methods:{TextEllipsis:i.Z,handleChange:function(e){var t,n=this.disabled,i=this.checked;if(this.stopPropagation&&e.stopPropagation(),!n){var a=this.$el.dataset,s="";s="checked"===i?"uncheck":"checked",null!==(t=this._events)&&void 0!==t&&t.change?this.$emit("change",s,a):this.$emit("update:checked",s)}}}}},8349:function(e,t,n){n.d(t,{s:function(){return i},x:function(){return a}});var i=function(){var e=this,t=e._self._c;return t("div",{class:["p-checkbox",e.disabled&&"p-checkbox-disabled"],on:{click:e.handleChange}},[t("i",{class:["p-checkbox-box","p-checkbox-"+e.checked]}),e._v(" "),Object.keys(e.$slots).length?t("span",{staticClass:"p-checkbox-text",on:{mouseenter:e.TextEllipsis}},[e._t("default")],2):e._e()])},a=[]},6875:function(e,t,n){var i=n(3931);i.Z.install=function(e){return e.component(i.Z.name,i.Z)},t.default=i.Z},7488:function(e,t,n){n.d(t,{default:function(){return p}});var i=n(2205),a=n.n(i),s=n(3114),c=n(5171),r={name:"PopoverTip",props:{parent:{type:Object,default:function(){return{}}},show:{type:Boolean,default:!1},content:{type:String,default:""},position:{type:Boolean,default:!0},split:{type:Boolean,default:!0}},computed:{contentArr:function(){var e=this;return this.content.split("、").map((function(t,n){return{id:"content-".concat(n),text:t,scroll:t.length>32?e.getScrollWidth(t):0}}))}},methods:{getScrollWidth:function(e){var t=document.createElement("div");t.innerText=e,t.style.position="absolute",t.style.left="0",t.style.bottom="0",t.style.zIndex="-100",t.style.display="inline-block",t.style.height="0",t.style.opacity="0",t.style.overflow="hidden",t.style.whiteSpace="nowrap",t.style.fontSize="14px",document.body.appendChild(t);var n=t.scrollWidth;return(0,s.Z)()?t.removeNode(!0):t.remove(),n>452?n-452:0},popoverTipHandle:function(e){this.$emit("tipHandle",e)},contentEnter:function(){this.split||(this.show=!1)}}},o=(0,n(1900).Z)(r,(function(){var e=this,t=e._self._c;return t("transition",{attrs:{name:e.position?"selectDownUpExtend":"selectDownUpExtendTop"}},[t("div",{directives:[{name:"show",rawName:"v-show",value:e.show,expression:"show"}],class:["p-popover-tip",e.split?"p-popover-tip-split":"p-popover-tip-words",e.position?"p-popover-tip-bottom":"p-popover-tip-top"],on:{wheel:function(e){e.stopPropagation()},mouseenter:function(t){return e.popoverTipHandle("enter")},mouseleave:function(t){return e.popoverTipHandle("leave")}}},[t("section",{staticClass:"p-popover-tip-content",on:{mouseenter:e.contentEnter}},[e.split?e._l(e.contentArr,(function(n){return t("article",{key:n.id,class:["p-popover-tip-content-item",n.scroll&&"p-popover-tip-content-item-before"]},[t("span",{staticClass:"p-popover-tip-item-text",style:n.scroll&&{transform:"translateX(".concat(-n.scroll,"px)")}},[e._v(e._s(n.text))])])})):[t("article",{staticClass:"p-popover-tip-content-words"},[e._v(e._s(e.content))])]],2),e._v(" "),t("section",{staticClass:"p-popover-tip-triangle"})])])}),[],!1,null,null,null).exports,l=n(4597),d=a().extend(o),h=null,u=function(e){var t=e.propsData;if(t.content){var n=e.tag,i=e.countTag,a=document.body;return(h=(h=new d({propsData:t})).$mount()).tag=n,h.countTag=i,h.dom=a,a.appendChild(h.$el),h}};u.remove=c.Z,u.resetPosition=function(e){if(e.content){var t=window,n=t.innerWidth,i=t.pageXOffset,a=e.tag,c=e.countTag,r=e.dom,o=a.getBoundingClientRect(),d=o.left,h=o.width,u=c.getBoundingClientRect(),p=u.left,f=u.width;if(!(n<=p+f/2||n<=f||p<0)){var m=function(e){var t=e.content,n=e.split,i=t.split("、"),a=document.body,c=document.createElement("div");c.className="p-popover-tip",c.style.left="0",c.style.bottom="0",c.style.opacity="0",c.style.zIndex="-100";var r='<section class="p-popover-tip-content">';n?i.forEach((function(e){r+='<article class="p-popover-tip-content-item"><span class="p-popover-tip-item-text">'.concat(e,"</span></article>")})):r+='<article class="p-popover-tip-content-words">'.concat(t,"</article>"),r+="</section>",c.innerHTML=r,a.appendChild(c);var o=c.getBoundingClientRect(),d=o.width,h=o.height;return(0,s.Z)()?c.removeNode(!0):c.remove(),{width:d,height:h,scrollWidth:(0,l.Z)()}}(e),v=m.width,y=m.height,g=m.scrollWidth,k=function(e,t,n){var i,a=t.clientHeight,s=window.pageYOffset,c=e.getBoundingClientRect(),r=c.top,o=c.height,l=!0,d=r-8;return d>=n?(i=d-n+s,l=!1):i=a-(r+o+8)>=n?r+o+8+s:a-n+s,{Y:i,P:l}}(a,r,y),w=k.Y,x=k.P;e.position=x,e.$el.style.top="".concat(w,"px");var C,b=e.$el.lastChild,I=0;if(v===n)i>0&&(I=0),C=p+f/2-6;else{if(0===d)I=0;else{var _=p+f/2,S=v/2;I=_<S?0:v<=h?v<=n-d?_-S:n-v:_>=S?n-_<=S?n-v-g:_-S:0}C=p-I+f/2-6}e.$el.style.left="".concat(I+i,"px"),b.style.left="".concat(C,"px"),e.show=!0}}};var p=u},4597:function(e,t,n){var i=n(3114);t.Z=function(){var e=document.createElement("div");e.style.cssText="position:absolute;top:-1000px;width:100px;height:100px;overflow:hidden;opacity:0;";var t=document.body.appendChild(e).clientWidth;e.style.overflowY="scroll";var n=e.clientWidth;(0,i.Z)()?e.removeNode(!0):e.remove();var a=t-n;return a<6?6:a}},3114:function(e,t){t.Z=function(){return!!window.ActiveXObject||"ActiveXObject"in window}},5171:function(e,t){t.Z=function(e){if(e&&!e._isDestroyed){e.$destroy();var t=e.$el;t&&t.parentNode.removeChild(t)}}},5064:function(e,t){t.Z=function(e){var t=e.target,n=t.clientWidth,i=t.scrollWidth;t.title=i>n?t.innerText:""}},7021:function(){},3931:function(e,t,n){var i=n(872),a=n(5242),s=(n(6921),(0,n(1900).Z)(a.Z,i.s,i.x,!1,null,null,null));t.Z=s.exports},5242:function(e,t,n){var i=n(1952);t.Z=i.Z},872:function(e,t,n){n.d(t,{s:function(){return i.s},x:function(){return i.x}});var i=n(8349)},6921:function(e,t,n){n(7021)},1900:function(e,t,n){function i(e,t,n,i,a,s,c,r){var o,l="function"==typeof e?e.options:e;if(t&&(l.render=t,l.staticRenderFns=n,l._compiled=!0),i&&(l.functional=!0),s&&(l._scopeId="data-v-"+s),c?(o=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),a&&a.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(c)},l._ssrRegister=o):a&&(o=r?function(){a.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:a),o)if(l.functional){l._injectStyles=o;var d=l.render;l.render=function(e,t){return o.call(t),d(e,t)}}else{var h=l.beforeCreate;l.beforeCreate=h?[].concat(h,o):[o]}return{exports:e,options:l}}n.d(t,{Z:function(){return i}})},2205:function(t){t.exports=e}},n={};function i(e){var a=n[e];if(void 0!==a)return a.exports;var s=n[e]={exports:{}};return t[e](s,s.exports,i),s.exports}i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,{a:t}),t},i.d=function(e,t){for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return function(){i.r(a),i.d(a,{default:function(){return N}});var e=i(7488),t={bind:function(e,t,n){function i(n){if(e.contains(n.target))return!1;t.expression&&t.value(n)}e.__vueClickOutside__=i,document.addEventListener("click",i)},unbind:function(e,t){document.removeEventListener("click",e.__vueClickOutside__),delete e.__vueClickOutside__}},n=i(1900),s=(0,n.Z)({},(function(){var e=this._self._c;return e("svg",{attrs:{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"}},[e("path",{staticClass:"svg-fill-grey-500",attrs:{d:"\r\n M8.3904344,6.48804301\r\n L11.350122,10.1876525\r\n C11.5226268,10.4032834 11.4876661,10.7179296 11.2720351,10.8904344\r\n C11.1833786,10.9613596 11.0732233,11 10.9596876,11\r\n L5.04031242,11\r\n C4.76417005,11 4.54031242,10.7761424 4.54031242,10.5\r\n C4.54031242,10.3864643 4.5789528,10.276309 4.64987802,10.1876525\r\n L7.6095656,6.48804301\r\n C7.78207037,6.27241204 8.09671656,6.23745135 8.31234752,6.40995612\r\n C8.34117988,6.43302201 8.36736852,6.45921065 8.3904344,6.48804301\r\n Z",transform:"translate(0, -0.5)"}})])}),[],!1,null,null,null).exports,c=(0,n.Z)({},(function(){var e=this._self._c;return e("svg",{attrs:{viewBox:"0 0 14 14",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"}},[e("g",{attrs:{transform:"translate(-1.000000, -1.000000)","fill-rule":"nonzero"}},[e("path",{staticClass:"svg-fill-grey-400",attrs:{d:"M8,1 C4.134375,1 1,4.134375 1,8 C1,11.865625 4.134375,15 8,15 C11.865625,15 15,11.865625 15,8 C15,4.134375 11.865625,1 8,1 Z M10.784375,9.6375 C11.040625,9.89375 11.040625,10.309375 10.784375,10.565625 C10.528125,10.821875 10.1125,10.821875 9.85625,10.565625 L8,8.709375 L6.14375,10.565625 C5.8875,10.821875 5.471875,10.821875 5.215625,10.565625 C4.959375,10.309375 4.959375,9.89375 5.215625,9.6375 L7.071875,7.78125 L5.215625,5.925 C4.959375,5.66875 4.959375,5.253125 5.215625,4.996875 C5.471875,4.740625 5.8875,4.740625 6.14375,4.996875 L8,6.853125 L9.85625,4.996875 C10.1125,4.740625 10.528125,4.740625 10.784375,4.996875 C11.040625,5.253125 11.040625,5.66875 10.784375,5.925 L8.928125,7.78125 L10.784375,9.6375 L10.784375,9.6375 Z"}})])])}),[],!1,null,null,null).exports,r=i(2205),o=i.n(r),l=(0,n.Z)({},(function(){var e=this._self._c;return e("svg",{attrs:{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"}},[e("g",{attrs:{stroke:"none",fill:"none",transform:"translate(1, 1)"}},[e("path",{staticClass:"svg-stroke-grey-500",attrs:{d:"M 7 0 A 6 7 0 0 1 14 6","stroke-width":"1"}},[e("animateTransform",{attrs:{attributeName:"transform",type:"rotate",from:"0 8 8",to:"360 8 8",dur:"0.5s",repeatCount:"indefinite"}})],1)])])}),[],!1,null,null,null).exports,d=i(6875),h={methods:{recursiveSetChecked:function(e,t,n){var i=this;e.children&&e.children.length&&e.children.forEach((function(e){e.disabled||(e.checked=t,void 0!==n&&i.$set(e,"forbidden",n),i.recursiveSetChecked(e,t,n))}))},checkParent:function(e){if("normal"===this.type){var t=this.flatData.find((function(t){return e.parentId===t.nodekey}));if(t&&t.children){var n=t.children;if(t&&n&&n.length){var i=n.filter((function(e){return"checked"===e.checked})).length,a=n.filter((function(e){return"notNull"===e.checked})).length,s=n.length;t&&(i===s&&(t.checked="checked"),i||(t.checked="uncheck"),(i&&i<s||a)&&(t.checked="notNull"),this.checkParent(t))}}}},handleItemStatus:function(e,t){t.disabled||("final"===e.type?t.selectCheckbox&&(t.checked="checked",t.active=!0):(t.checked="checked","normal"===e.type&&(e.recursiveSetChecked(t,"checked"),e.checkParent(t)),"forbidden"===e.type&&e.recursiveSetChecked(t,"checked",!0)))}}},u={name:"cascaPanel",components:{loading:l,arrow:(0,n.Z)({},(function(){var e=this._self._c;return e("svg",{attrs:{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"}},[e("g",{attrs:{transform:"translate(2.000000, 2.000000)","fill-rule":"nonzero"}},[e("path",{staticClass:"svg-fill-grey-500",attrs:{d:"M8.85127549,5.97990969 L2.91471326,10.5971422 C2.696738,10.766675 2.65746768,11.0808125 2.82700056,11.2987877 C2.99653344,11.516763 3.31067085,11.5560333 3.52864611,11.3865004 L9.9735924,6.37386614 C10.2312596,6.17346241 10.2309143,5.783911 9.97289228,5.58396435 L3.52794599,0.589640623 C3.30967055,0.420494413 2.99560324,0.460321528 2.82645703,0.678596974 C2.65731082,0.896872421 2.69713793,1.21093973 2.91541338,1.38008594 L8.85127549,5.97990969 Z"}})])])}),[],!1,null,null,null).exports,Checkbox:d.default},mixins:[h],inject:["flatData"],props:{cascaderList:{type:Array,default:function(){return[]}},change:{type:Function,default:function(){return!1}},deepChange:{type:Function,default:function(){return!1}},checkWidth:{type:Function,default:function(){return!1}},loadData:{type:Function},type:{type:String},width:{type:[Number,String]},multiple:{type:Boolean},trigger:{validator:function(e){return["click","hover"].indexOf(e)>-1},default:"click"},all:{type:Boolean,default:!1}},data:function(){return{subListData:[],activeKey:"",initKey:1,currentHandleItem:null,timer:null}},watch:{},computed:{itemWidth:function(){var e=this.width;return e<180&&(e=180),e>600&&(e=600),{width:"".concat(e-56,"px")}},menuWidth:function(){var e=this.width;return e<180&&(e=180),e>600&&(e=600),{width:"".concat(e,"px")}}},mounted:function(){var e=this;this.$on("clear",(function(){e.subListData=[]}))},methods:{itemClass:function(e){return["p-cascader-item",{"p-cascader-item-active":this.activeKey===e.id,"p-cascader-item-disabled":e.disabled}]},handleCheckbox:function(e,t){var n=this.flatData.find((function(e){return e.id===t.id}));n&&("normal"===this.type&&this.handleNormal(n),"forbidden"===this.type&&this.handleForbidden(n),"independent"===this.type&&this.handleIndependent(n),"final"===this.type&&this.handleFinal(n),"function"==typeof this.loadData&&n.children.length&&this.setAttributeOfNode(n),this.deepChange())},handleFinal:function(e){"checked"===e.checked?e.checked="uncheck":e.checked="checked"},handleIndependent:function(e){"checked"===e.checked?e.checked="uncheck":e.checked="checked"},handleForbidden:function(e){"checked"===e.checked?(e.checked="uncheck",this.recursiveSetChecked(e,"uncheck",!1)):(e.checked="checked",this.recursiveSetChecked(e,"checked",!0))},handleNormal:function(e){"checked"===e.checked?(e.checked="uncheck",this.recursiveSetChecked(e,"uncheck"),this.checkParentStatus(this,e)):(e.checked="checked",this.recursiveSetChecked(e,"checked"),this.checkParentStatus(this,e))},handleLeaveItem:function(){this.timer&&clearTimeout(this.timer)},handleHoverItem:function(e){"hover"===this.trigger&&(e.children&&e.children.length?this.activeKey=e.id:this.activeKey=""),"hover"===this.trigger&&this.expandNextPanel(e)},handleClickItem:function(e){"click"===this.trigger&&(e.children&&e.children.length?this.activeKey=e.id:this.activeKey=""),"hover"!==this.trigger||e.disabled||this.change(e,!0),"click"!==this.trigger&&e.children&&e.children.length||this.expandNextPanel(e)},expandNextPanel:function(e){var t=this;this.multiple||e.disabled||"click"!==this.trigger||(this.loadData?e.last&&this.change(e):this.change(e)),this.clearData(),"function"==typeof this.loadData?this.timer=setTimeout((function(){t.loadData(e,(function(){e.children?(t.setAttributeOfNode(e),t.subListData=e.children):t.subListData=[],t.timer=null,t.$nextTick((function(){t.checkWidth()}))}))}),300):(e.children&&e.children.length?this.subListData=e.children:this.subListData=[],this.$nextTick((function(){t.checkWidth()})))},setAttributeOfNode:function(e){var t=this;e.children.forEach((function(n){t.initKey++,t.$set(n,"parentId",e.nodekey),t.$set(n,"loading",!1),t.$set(n,"nodekey","".concat(e.nodekey).concat(Date.now())),n.hasOwnProperty("id")||t.$set(n,"id","".concat(e.nodekey).concat(Date.now()).concat(Math.random())),t.$set(n,"_title","".concat(e.title,"/").concat(n.title)),t.$set(n,"_ids","".concat(e.id,"/").concat(n.id)),t.$set(n,"last",!0),t.multiple&&(t.$set(n,"checked","uncheck"),"forbidden"===t.type&&t.$set(n,"forbidden",!1)),t.flatData.push(n)}))},checkParentStatus:function(e,t){var n=e.cascaderList.filter((function(e){return"checked"===e.checked})).length,i=e.cascaderList.filter((function(e){return"notNull"===e.checked})).length,a=e.cascaderList.length,s=this.flatData.find((function(e){return e.nodekey===t.parentId}));s&&(n===a&&(s.checked="checked"),n||(s.checked="uncheck"),(n&&n<a||i)&&(s.checked="notNull"),e.$parent&&"cascaPanel"===e.$parent.$options.name&&this.checkParentStatus(e.$parent,s))},clearData:function(){this.$children&&this.findChldComponent(this.$children)},findChldComponent:function(e){var t=this;e.forEach((function(e){"cascaPanel"===e.$options.name&&(e.activeKey="",e.$emit("clear"),e.$children&&t.findChldComponent(e.$children))}))}}};function p(e){var t,n=Object.prototype.toString.call(e);if("[object Array]"===n)t=[];else{if("[object Object]"!==n)return e;t={}}if("[object Array]"===n)for(var i=0;i<e.length;i++)t.push(p(e[i]));else if("[object Object]"===n)for(var a in e)t[a]=p(e[a]);return t}var f={provide:function(){return{flatData:this.flatData}},name:"cascaderDrop",components:{cascaPanel:(0,n.Z)(u,(function(){var e=this,t=e._self._c;return t("span",{staticClass:"p-cascader-column",on:{click:function(e){e.stopPropagation()}}},[e.multiple?e._e():t("ul",{staticClass:"p-cascader-menu",style:e.menuWidth},e._l(e.cascaderList,(function(n,i){return t("li",{key:i,class:e.itemClass(n),on:{mouseenter:function(t){return t.stopPropagation(),e.handleHoverItem(n,t)},mouseleave:function(t){return t.stopPropagation(),e.handleLeaveItem(n)},click:function(t){return t.stopPropagation(),e.handleClickItem(n,i)}}},[t("span",{class:["p-cascader-item-text",n.forbidden&&"p-cascader-item-text-disabled"],style:e.itemWidth},[e._v(e._s(n.title))]),e._v(" "),t("span",{staticStyle:{transform:"translate(0px, 4px)"}},[n.children&&n.children.length&&!n.loading?t("i",{staticClass:"p-cascader-next-icon"},[t("arrow",{staticStyle:{width:"16px",height:"16px"}})],1):e._e(),e._v(" "),n.loading?t("i",{staticClass:"p-cascader-item-loading"},[t("loading",{staticStyle:{width:"16px",height:"16px"}})],1):e._e()])])})),0),e._v(" "),e.multiple?t("ul",{staticClass:"p-cascader-menu",style:e.menuWidth,on:{click:function(e){e.stopPropagation()}}},e._l(e.cascaderList,(function(n,i){return t("li",{key:i,class:e.itemClass(n),on:{mouseenter:function(t){return t.stopPropagation(),e.handleHoverItem(n)},click:function(t){return t.stopPropagation(),e.handleClickItem(n)},mouseleave:function(t){return t.stopPropagation(),e.handleLeaveItem(n)}}},[e.type&&"final"!==e.type?t("Checkbox",{attrs:{checked:n.checked,"data-id":n.id,disabled:n.forbidden||n.disabled},on:{change:e.handleCheckbox}}):e._e(),e._v(" "),e.type&&"final"==e.type&&n.selectCheckbox?t("Checkbox",{attrs:{checked:n.checked,disabled:n.forbidden||n.disabled,"data-id":n.id},on:{change:e.handleCheckbox}}):e._e(),e._v(" "),t("span",{class:["p-cascader-item-text",n.forbidden&&"p-cascader-item-text-disabled"],style:e.itemWidth},[e._v(" "+e._s(n.title)+" ")]),e._v(" "),t("span",{staticStyle:{transform:"translate(0px, 4px)"}},[n.children&&n.children.length&&!n.loading?t("i",{staticClass:"p-cascader-next-icon",on:{mouseenter:function(t){return t.stopPropagation(),e.handleHoverItem(n)},click:function(t){return t.stopPropagation(),e.handleClickItem(n)},mouseleave:function(t){return t.stopPropagation(),e.handleLeaveItem(n)}}},[t("arrow",{staticStyle:{width:"16px",height:"16px"}})],1):e._e(),e._v(" "),n.loading?t("i",{staticClass:"p-cascader-item-loading"},[t("loading",{staticStyle:{width:"16px",height:"16px"}})],1):e._e()])],1)})),0):e._e(),e._v(" "),e.subListData.length?t("cascaPanel",{attrs:{change:e.change,deepChange:e.deepChange,checkWidth:e.checkWidth,loadData:e.loadData,multiple:e.multiple,type:e.type,width:e.width,trigger:e.trigger,all:e.all,cascaderList:e.subListData}}):e._e()],1)}),[],!1,null,null,null).exports,clear:c,Checkbox:d.default},data:function(){return{showCascader:!1,queryItems:[],selectedItems:[],storeFlatData:[],confirmedData:[],storeHandleData:[],storeQueryData:[],storeSelectedItems:[],depth:1,selectedItemsCloneStr:null,storeIds:[],initHandle:0,position:!0}},mixins:[h],directives:{clickoutside:t},computed:{itemWidth:function(){return{width:"".concat(this.width-50,"px")}},notFoundStyle:function(){return{height:this.multiple?"222px":"54px",width:"".concat(this.width,"px"),borderRight:this.multiple?"1px solid #eff0f1":"none"}},boxShadowStyle:function(){return{boxShadow:(this.selectedItems.length,"")}},panelClass:function(){return["p-cascader-select-list-footer",this.selectedItems.length>4?"p-cascader-select-list-footer-shadow":""]},cursorStyle:function(){return{cursor:this.selectedItems.length?"pointer":"not-allowed",color:this.selectedItems.length?"rgb(0, 145, 255)":"rgb(195, 199, 203)"}},containerWidth:function(){var e=this.showPanel?1:0;return{width:"".concat((this.depth+e)*Number(this.width),"px")}},controlConfirmBtn:function(){if(!this.selectedItems.length&&0===this.initHandle)return!0;if(this.selectedItemsCloneStr){var e=JSON.parse(this.selectedItemsCloneStr),t=this.selectedItems.every((function(t){return e.findIndex((function(e){return t.id===e.id}))>-1}));return this.selectedItems.length===this.confirmedData.length&&t}return!1}},props:{query:{type:String,default:""},data:{type:Array,default:function(){return[]}},loadData:{type:Function},selectIds:{type:Array},flatData:{type:Array},type:{type:String},multiple:{type:Boolean},showPanel:{type:Boolean},width:{type:[Number,String]},recursionData:{type:Array},trigger:{validator:function(e){return["click","hover"].indexOf(e)>-1},default:"click"},all:{type:Boolean,default:!1},excludeTop:{type:Boolean,default:!1}},mounted:function(){this.checkWidth()},watch:{selectedItems:function(e,t){e!==t&&this.initHandle++},selectIds:{handler:function(e,t){e!==t&&(this.query="",this.queryItems=[],e.length||this.multiple&&(this.clearSelectAll(),this.confirmedData=[]))}},showCascader:{handler:function(e,t){var n=this;e!==t&&(e?(this.multiple?this.selectIds.length?(this.formatPIdsAndFindDeepest(this.selectIds),this.storeHandleData.length&&this.recursiveReset(this.data),this.selectedItemsCloneStr&&(this.selectedItems=JSON.parse(this.selectedItemsCloneStr)),setTimeout((function(){n.checkWidth(),n.$emit("checkWidth",n.depth)}),0)):this.confirmedData.length?(this.recursiveReset(this.data),this.selectedItems=JSON.parse(this.selectedItemsCloneStr),this.query||(this.queryItems=[])):(this.clearSelectAll(),this.clearData()):this.selectIds.length&&this.refillCascader(this.data,this,this.selectIds),this.$nextTick((function(){setTimeout((function(){n.$refs.dropdown.style.pointerEvents="auto"}),300)}))):this.$refs.dropdown.style.pointerEvents="none")}},depth:function(e,t){e!==t&&this.$emit("checkWidth",e)}},methods:{cancelPanel:function(){this.confirmedData.length||(this.query="",this.clearSelectAll(),this.clearData(),this.depth=1,this.$children[0].subListData=[],this.$emit("checkWidth",1)),this.showPanel&&(this.selectedItems=JSON.parse(this.selectedItemsCloneStr)),this.$emit("change",this.confirmedData),this.showCascader=!1},recursiveReset:function(e){var t=this;e.forEach((function(e){var n=t.storeHandleData.find((function(t){return t.id===e.id}));n&&(e.checked=n.checked),"forbidden"===t.type&&(e.forbidden=n.forbidden),e.children&&e.children.length&&t.recursiveReset(e.children)}))},confirmEmit:function(){var e=this;this.controlConfirmBtn||(this.query&&(this.confirmedData.forEach((function(t){e.checkParent(t)})),this.query=""),this.showCascader=!1,this.confirmedData=p(this.selectedItems),this.selectedItemsCloneStr=JSON.stringify(this.selectedItems),this.selectedItems.length||(this.$emit("clearPopover",this.confirmedData),this.$emit("checkWidth",1)),this.storeHandleData=p(this.flatData),this.$emit("confirm",this.confirmedData))},formatPIdsAndFindDeepest:function(e){var t=this;if(Array.isArray(e)&&e.length){var n=[];e.forEach((function(e){var i=t.flatData.find((function(t){return t.id===e}));i&&i._ids&&n.push(i._ids.split("/"))}));var i=Math.max.apply(null,n.map((function(e){return e.length}))),a=n.findIndex((function(e){return e.length===i}));a>-1&&this.refillCascader(this.data,this,n[a]),this.checkWidth()}},emitSelectedData:function(){var e=this;this.selectedItems=[],this.flatData.forEach((function(t){"checked"===t.checked&&e.selectedItems.push(t)})),this.confirmedData=p(this.selectedItems),this.selectedItemsCloneStr=JSON.stringify(this.selectedItems),this.$emit("change",this.selectedItems)},refillCascader:function(e,t,n){var i=this,a=-1,s=this;!function e(t,n,i){a++;for(var c=function(c){var r=t[c];r.id===i[a]&&s.$nextTick((function(){var t=function(e){var t=null;if(e.$children&&e.$children.length)return e.$children.forEach((function(e){"cascaPanel"===e.$options.name&&(t=e)})),t}(n);t&&(t.activeKey=r.id,r.children?(t.subListData=r.children,e(r.children,t,i)):t.subListData=[])}))},r=0;r<t.length;r++)c(r)}(e,t,n),this.multiple&&setTimeout((function(){i.confirmedData=p(i.selectedItems),i.selectedItemsCloneStr=JSON.stringify(i.selectedItems),i.storeHandleData=p(i.flatData)}))},checkWidth:function(){var e=0;!function t(n){n.forEach((function(n){"cascaPanel"===n.$options.name&&(e++,n.$children&&t(n.$children))}))}(this.$children),this.depth=e},clearSelectAll:function(){var e=this;this.flatData.forEach((function(t){"forbidden"===e.type&&(t.forbidden=!1,t.checked="uncheck"),t.active=!1})),this.selectedItems.forEach((function(t){var n=e.flatData.find((function(e){return t.id===e.id}));n&&(n.checked="uncheck",e.checkParent(n))})),this.selectedItemsCloneStr=JSON.stringify(this.selectedItems),this.selectedItems=[]},clearSingleItem:function(e,t){var n=this,i=(e._ids||e.ids).split("/"),a=i[i.length-1],s=this.flatData.find((function(e){return a===e.id}));if(s&&(s.checked="uncheck","normal"===this.type&&(this.checkParent(s),s.children&&s.children.length&&function e(i){i.children.forEach((function(i){i.checked="uncheck",n.selectedItems.some((function(e){return i.id===e.id}))&&n.selectedItems.splice(t,1),i.children&&i.children.length&&e(i)}))}(s)),"forbidden"===this.type&&function e(t,i,a){t.children&&t.children.length&&t.children.forEach((function(t){t.disabled||(t.checked=i,void 0!==a&&n.$set(t,"forbidden",a),e(t,i,a))}))}(s,"uncheck",!1)),this.selectedItems.splice(t,1),this.selectedItems.length||this.$emit("change",[]),"normal"===this.type&&(this.checkParent(s),this.countSelectedNumber()),this.query){var c=this.queryItems.find((function(t){return t.id===e.id}));c&&(c.checked="uncheck")}},handleClose:function(){this.showCascader=!1},handleCheckbox:function(e,t){var n=this.queryItems.find((function(e){return e.id===t.id})),i=this.selectedItems.findIndex((function(e){return e.id===t.id})),a=this.flatData.find((function(e){return e.id===t.id}));a.disabled||n&&a&&("checked"===n.checked?(n.checked="uncheck",a.checked="uncheck",i>-1&&this.selectedItems.splice(i,1)):(n.checked="checked",a.checked="checked",-1===i&&(a.disabled||this.selectedItems.push(n))),"final"!==this.type&&(this.checkParent(n),this.countSelectedNumber()))},handleSelectItem:function(e){var t=this,n=e._ids;if(n){var i=n.split("/")[0],a=this.flatData.find((function(e){return e.id===i}));"function"!=typeof this.loadData||a.children.length?this.$emit("select",a):this.loadData(a,(function(){a.children.length&&(t.setAttributeOfNode(a),t.$emit("select",a)),t.timer=null,t.$nextTick((function(){t.checkWidth()}))}))}},setAttributeOfNode:function(e){var t=this;e.children.forEach((function(n){t.$set(n,"parentId",e.nodekey),t.$set(n,"loading",!1),t.$set(n,"last",!0),t.$set(n,"nodekey","".concat(e.nodekey).concat(Date.now())),n.hasOwnProperty("id")||t.$set(n,"id","".concat(e.nodekey).concat(Date.now()).concat(Math.random())),t.$set(n,"_title","".concat(e.title,"/").concat(n.title)),t.$set(n,"_ids","".concat(e.id,"/").concat(n.id)),t.multiple&&(t.$set(n,"checked","uncheck"),"forbidden"===t.type&&t.$set(n,"forbidden",!1)),t.flatData.push(n)}))},change:function(e,t){this.storeIds=e._ids.split("/"),this.multiple||(t?this.$emit("change",{item:e,flag:t}):this.$emit("change",e))},deepChange:function(){if("final"!==this.type&&this.countSelectedNumber(),"final"===this.type){var e=[];this.flatData.forEach((function(t){"checked"===t.checked&&e.push(t)})),this.selectedItems=e}},countSelectedNumber:function(){var e=this,t=[];this.$nextTick((function(){e.flatData.forEach((function(n){"normal"!==e.type&&"independent"!==e.type||("checked"!==n.checked||n.disabled||t.push(n),"notNull"===n.checked&&"normal"===e.type&&e.all&&!n.disabled&&t.push(n)),"forbidden"===e.type&&("checked"!==n.checked||n.forbidden||t.push(n))})),"normal"===e.type&&e.excludeTop&&(t=t.filter((function(e){return-1!==e.parentId}))),e.selectedItems=t,e.selectedItems.length||e.$emit("change",e.selectedItems),e.checkWidth(),e.$emit("checkWidth",e.depth)}))},clearData:function(){this.$children&&(this.findChildComponent(this.$children),this.$emit("checkWidth",1))},findChildComponent:function(e){var t=this;e.forEach((function(e){"cascaPanel"===e.$options.name&&(e.activeKey="",e.subListData=[],e.$emit("clear"),e.$children&&t.findChildComponent(e.$children))}))}}},m=(0,n.Z)(f,(function(){var e=this,t=e._self._c;return t("transition",{attrs:{name:e.position?"selectDownUpExtend":"selectDownUpExtendTop"}},[t("div",{directives:[{name:"show",rawName:"v-show",value:e.showCascader,expression:"showCascader"}],ref:"dropdown",staticClass:"p-cascader-drop",on:{wheel:function(e){e.stopPropagation()}}},[t("div",{staticClass:"p-cascader-select-container"},[t("div",{staticClass:"p-cascader-select-panel"},[t("div",[t("cascaPanel",{directives:[{name:"show",rawName:"v-show",value:!e.query&&!e.queryItems.length,expression:" !query && !queryItems.length"}],attrs:{cascaderList:e.data,loadData:e.loadData,multiple:e.multiple,type:e.type,width:e.width,deepChange:e.deepChange,checkWidth:e.checkWidth,trigger:e.trigger,change:e.change,all:e.all}}),e._v(" "),t("div",{directives:[{name:"show",rawName:"v-show",value:e.query&&e.queryItems.length,expression:"query && queryItems.length"}],staticClass:"p-cascader-filter",style:{width:e.width+"px",height:"222px"},on:{click:function(e){e.stopPropagation()}}},[t("ul",{staticClass:"p-cascader-filter-menu"},e._l(e.queryItems,(function(n,i){return t("li",{key:i,staticClass:"p-cascader-filter-menu-item",on:{click:function(t){return e.handleSelectItem(n)}}},[e.type&&"final"!==e.type?t("Checkbox",{attrs:{checked:n.checked,disabled:n.forbidden||n.disabled,"data-id":n.id},on:{change:e.handleCheckbox}}):e._e(),e._v(" "),e.type&&"final"===e.type&&n.selectCheckbox?t("Checkbox",{attrs:{checked:n.checked,disabled:n.forbidden||n.disabled,"data-id":n.id},on:{change:e.handleCheckbox}}):e._e(),e._v(" "),t("span",{staticClass:"p-cascader-item-text",style:{width:e.width-50+"px"},attrs:{title:n.title},domProps:{innerHTML:e._s(n.display)}})],1)})),0)]),e._v(" "),t("div",{directives:[{name:"show",rawName:"v-show",value:e.query&&!e.queryItems.length||!e.data.length,expression:" query && !queryItems.length || !data.length"}],ref:"notfound",staticClass:"p-cascader-no-found",style:e.notFoundStyle},[e._v("没有找到任何内容\n ")])],1),e._v(" "),e.multiple&&!e.showPanel?t("div",{staticClass:"p-cascader-select-panel-footer",on:{click:function(e){e.stopPropagation()}}},[t("span",{on:{click:e.cancelPanel}},[e._v("取消")]),e._v(" "),t("span",{class:e.controlConfirmBtn?"disabled-confirm-btn":"",on:{click:e.confirmEmit}},[e._v("确定")])]):e._e()]),e._v(" "),e.showPanel?t("div",{staticClass:"p-cascader-select-list",style:{width:e.width+"px"},on:{click:function(e){e.stopPropagation()}}},[t("div",{staticClass:"p-cascader-select-list-header"},[t("span",{staticClass:"p-cascader-selected"},[e._v("已选"),t("span",{staticClass:"p-cascader-selected-text"},[e._v(e._s(e.selectedItems.length))])]),e._v(" "),t("span",{staticClass:"p-cascader-clear",style:e.cursorStyle,on:{"!click":function(t){return e.clearSelectAll.apply(null,arguments)}}},[e._v("清空")])]),e._v(" "),t("div",{staticClass:"p-cascader-select-list-body"},[t("ul",{staticClass:"p-cascader-select-list-items"},e._l(e.selectedItems,(function(n,i){return t("li",{key:i},[t("span",{style:e.itemWidth},[e._v(" "+e._s(n._title||n.title)+"\n ")]),e._v(" "),t("span",{staticClass:"p-cascader-clear-icon"},[t("i",{on:{click:function(t){return t.stopPropagation(),e.clearSingleItem(n,i)}}},[t("clear",{staticStyle:{width:"14px",height:"14px"}})],1)])])})),0)]),e._v(" "),t("div",{class:e.panelClass,style:e.boxShadowStyle},[t("span",{on:{click:e.cancelPanel}},[e._v("取消")]),e._v(" "),t("span",{class:e.controlConfirmBtn?"disabled-confirm-btn":"",on:{click:e.confirmEmit}},[e._v("确定")])])]):e._e()])])])}),[],!1,null,null,null),v=m.exports,y=function(e,t,n,i,a){var s,c,r=t.clientHeight,o=t.clientWidth,l=window,d=l.pageYOffset,h=l.pageXOffset,u=e.getBoundingClientRect(),p=u.top,f=u.left,m=u.height,v=u.width,y=!0;r-(p+m+8)>=n?s=p+m+8+d:p-8>=n?(s=p-n-8+d,y=!1):s=r-n+d;var g=o-f-v,k=g+v;return c=o<=i?h:f>0?k>=i?f+h:f+v>=i?f+v-i+h+(g>0?0:g):(o-i)/2+h:h,a&&k>=i&&(c=c-i+v),{X:c,Y:s,P:y}},g=7e3,k=o().extend(v),w=null,x=null,C=function(e){var t=e.tag,n=e.props,i=t.getBoundingClientRect().width;i>600&&(i=600),i<180&&(i=180),n.width=i;var a=document.body;w=(w=new k({propsData:n})).$mount();var s=n.showPanel?2:1,c=y(t,a,224,i*s),r=c.X,o=c.Y,l=c.P;return x=i,g++,w.$el.style.top="".concat(o,"px"),w.$el.style.left="".concat(r,"px"),w.$el.style.zIndex=g,w.$el.childNodes.forEach((function(e){1===e.nodeType&&"p-cascader-no-found"===e.className&&(e.style.width="".concat(i,"px"))})),a.appendChild(w.$el),w.position=l,w};C.remove=function(e){if(e&&!e._isDestroyed){e.$destroy();var t=e.$el;t&&t.parentNode.removeChild(t)}},C.resetPosition=function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:x;if(e){var a=y(t,n,224,i),s=a.X,c=a.Y;e.$el.style.top="".concat(c,"px"),e.$el.style.left="".concat(s,"px")}};var b=C;function I(e){return I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},I(e)}function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function S(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function D(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==I(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==I(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===I(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var $={name:"Cascader",data:function(){return{inputText:"",flatData:[],query:"",isFocused:!1,dropInstance:null,popoverTip:null,recursionData:[],storeQueryData:[],showCountNumber:!1,handleData:[],storeSelectData:[],selectedTipStyle:{bottom:0,left:0},clearable:!1,initSelectNum:[],singleSelectedItem:null,selectAll:!1,showFakePlaceholder:!0,tDom:null,captionW:null,leftW:0,timer:null,timer2:null,captionWidth:0}},mixins:[h],computed:{classes:function(){return["p-cascader-triangle",this.dropInstance&&this.dropInstance.showCascader?"p-cascader-triangle-up":"p-cascader-triangle-down"]},widthStyle:function(){return{width:"".concat(this.width,"px")}},inputStyle:function(){return{width:this.caption?"".concat(this.width-(14*this.caption.length+16+28),"px"):"".concat(this.width-32,"px"),paddingLeft:this.caption?0:"12px"}},tipText:{get:function(){var e=JSON.parse(JSON.stringify(this.storeSelectData));if(Array.isArray(e)&&e.length){var t=e.length-1,n="";return e.forEach((function(e,i){n+=i<t?"".concat(e.title,"、"):e.title})),n}return""},set:function(e){return e}},selectedLens:function(){var e=this.storeSelectData,t=this.isShowAllChoice,n=this.flatData,i=this.excludeTop,a=this.type,s=this.allText,c=e.length;if(c&&t){var r=n.filter((function(e){return!e.disabled}));return i&&"normal"===a&&(r=r.filter((function(e){return-1!==e.parentId}))),this.selectAll=c===r.length,c===r.length?s:c}return c}},components:{Triangle:s,Remove:c},props:{value:{type:Array,default:function(){return[]}},data:{type:Array,default:function(){return[]}},width:{type:[String,Number],default:200},loadData:{type:Function},multiple:{type:Boolean,default:!1},showPanel:{type:Boolean,default:!1},caption:{type:String,default:""},placeholder:{type:String,default:"请选择"},tipPlace:{type:String,default:"top"},type:{type:String,default:"normal",validator:function(e){return["normal","independent","final","forbidden"]}},all:{type:Boolean,default:!0},trigger:{validator:function(e){return["click","hover"].indexOf(e)>-1},default:"click"},hideClear:{type:Boolean,default:!1},isShowAllChoice:{type:Boolean,default:!1},allText:{type:String,default:"全部"},excludeTop:{type:Boolean,default:!1},filterable:{type:Boolean,default:!0},transfer:{type:String,default:""}},directives:{clickoutside:t},mounted:function(){if(this.value.length&&this.value&&(this.multiple?this.calcAllCheckStatusByValue(this.value,"init"):this.createPath()),this.transfer){var e=this.transfer;e.startsWith("#")||(e="#".concat(e)),this.scrollDom=document.querySelector(e),this.scrollDom&&(this.scrollDom.addEventListener("mousewheel",this.hidePanel,!1),this.scrollDom.addEventListener("scroll",this.hidePanel,!1))}document.addEventListener("mousewheel",this.hidePanel,!1)},watch:{data:{handler:function(e,t){e!==t&&(this.handleData=p(this.data),this.createFlatData(),this.createRecursionData())},deep:!0,immediate:!0},value:{handler:function(e,t){JSON.stringify(e)!==JSON.stringify(t)&&(this.calcAllCheckStatusByValue(e),this.dropInstance&&(this.dropInstance.selectIds=e))}},query:function(e,t){e!==t&&(this.showFakePlaceholder=!e)},"dropInstance.showCascader":{handler:function(e,t){this.showCountNumber=!e,this.$emit("focusChange",!e),this.popoverTip&&e&&(this.popoverTip.show=!1)}},caption:{handler:function(e,t){var n=this;e!==t&&(e?this.$nextTick((function(){return n.getCaptionWidth()})):this.captionWidth=0)},immediate:!0}},methods:{getCaptionWidth:function(){var e=this;this.caption&&setTimeout((function(){var t=e.$refs.captionDom;if(t){var n=14*t.textContent.length+8;e.captionWidth=n<80?n:80}}))},hidePanel:function(){this.dropInstance&&(this.dropInstance.showCascader=!1,this.dropInstance.query="",this.$refs.cascaderInput&&(this.$refs.cascaderInput.blur(),this.query="",this.inputText=""))},calcAllCheckStatusByValue:function(e,t){var n=this;if(e.length){var i=[];"init"===t?(e.forEach((function(e){var t=n.flatData.find((function(t){return t.id===e}));t&&(n.handleItemStatus(n,t),"forbidden"===n.type&&(t.forbidden||i.push(t)))})),this.flatData.forEach((function(e){"checked"===e.checked&&i.push(e)}))):e.forEach((function(e){var t=n.flatData.find((function(t){return t.id===e}));t&&("forbidden"===n.type&&t.forbidden||i.push(t))})),"normal"===this.type&&this.excludeTop&&(i=i.filter((function(e){return-1!==e.parentId}))),this.inputText="",this.query="",this.initSelectNum=i,this.storeSelectData=i,i.length&&(this.showCountNumber=!0,this.isShowAllChoice&&this.checkAllSelectStatus(i))}else this.flatData.forEach((function(e){e.checked="uncheck"}))},createRecursionData:function(){var e=[];!function t(n,i,a){for(var s=0;s<n.length;s++){var c=n[s];c._title=i?"".concat(i,"/").concat(c.title):c.title,c._ids=a?"".concat(a,"/").concat(c.id):c.id,c.display=c._title,c.children&&c.children.length?t(c.children,c._title,c._ids):e.push(S(S({},c),{},{query:!0}))}}(this.handleData),this.recursionData=e},createFlatData:function(){var e=this,t=this,n=[],i=-1,a=!(!this.loadData||"function"!=typeof this.loadData);function s(e,c){i++,e.nodekey=i,n[i]=e,c&&(n[i].parentId=c.nodekey,e.parentId=c.nodekey),t.type&&(t.$set(e,"checked","uncheck"),t.$set(e,"active",!1)),a&&t.$set(e,"loading",!1),"forbidden"===t.type&&t.$set(e,"forbidden",!1),e.children&&e.children.length?("final"===t.type&&t.$set(e,"selectCheckbox",!1),e.children.forEach((function(t){s(t,e)}))):"final"===t.type&&t.$set(e,"selectCheckbox",!0)}this.handleData.forEach((function(n){n.parentId=-1,e.type&&(t.$set(n,"checked","uncheck"),t.$set(n,"active",!1)),"forbidden"===t.type&&t.$set(n,"forbidden",!1),a&&t.$set(n,"loading",!1),"final"===t.type&&(n.children&&n.children.length?t.$set(n,"selectCheckbox",!1):t.$set(n,"selectCheckbox",!0)),s(n)})),this.flatData=n},createPath:function(){var e=-1,t=[];function n(i,a){e++;for(var s=0;s<i.length;s++){var c=i[s];c.id===a[e]&&(t.push(c.title),c.children&&n(c.children,a))}}this.query="",n(this.handleData,this.value)},handleMouseLeave:function(e){this.selectAll||(this.clearable=!1,this.popoverTip&&(this.popoverTip.show=!1))},handleMouseEnter:function(e){this.selectAll||(this.hideClear||(this.multiple?this.storeSelectData.length&&(this.clearable=!0):this.singleSelectedItem&&(this.clearable=!0)),this.setTipStatus(e))},setTipStatus:function(t){var n=this;this.tipText&&this.multiple&&(this.popoverTip?this.timer?this.clearTimer():this.timerEnter=setTimeout((function(){n.dropInstance&&n.dropInstance.showCascader||(n.popoverTip.content=n.tipText,e.default.resetPosition(n.popoverTip)),clearTimeout(n.timerEnter),n.timerEnter=null}),300):this.timerEnter=setTimeout((function(){if(!n.dropInstance||!n.dropInstance.showCascader){var t=n.$refs,i=t.cascader,a=t.countTag;n.popoverTip=(0,e.default)({tag:i,countTag:a,propsData:{content:n.tipText}}).$on("popoverTipHandle",(function(e){"enter"===e?n.clearTimer():n.setTimer()})),n.popoverTip.$nextTick((function(){e.default.resetPosition(n.popoverTip)}))}clearTimeout(n.timerEnter),n.timerEnter=null}),300))},setTimer:function(){var e=this;this.timer=setTimeout((function(){e.popoverTip.show=!1,e.clearTimer()}),300)},clearTimer:function(){clearTimeout(this.timer),this.timer=null},mouseLeave:function(){if(this.timerEnter)return clearTimeout(this.timerEnter),void(this.clearable=!1);this.clearable=!1,this.popoverTip&&this.setTimer()},clearAll:function(){var t=this;this.multiple?(this.popoverTip&&(this.popoverTip.show=!1,e.default.remove(this.popoverTip)),setTimeout((function(){t.multiple?(t.dropInstance?t.dropInstance.selectIds=[]:t.calcAllCheckStatusByValue([]),t.storeSelectData=[]):t.dropInstance&&t.dropInstance.clearData()}),0),this.clearable=!1,this.tipText="",this.query="",this.inputText="",this.popoverTip&&(e.default.remove(this.popoverTip),this.popoverTip=null),this.$emit("input",[]),this.dropInstance&&(this.dropInstance.showCascader=!1)):(this.singleSelectedItem=null,this.dropInstance&&(this.dropInstance.selectIds=[],this.dropInstance.clearData(),this.dropInstance.showCascader=!1),this.inputText="",this.query="",this.clearable=!1)},handleClose:function(){this.dropInstance&&(this.dropInstance.showCascader=!1,this.multiple?(this.query="",this.inputText="",this.dropInstance.query=""):this.query&&(this.dropInstance.query="",this.inputText="",this.query="",this.dropInstance.queryItems=[],this.dropInstance.selectIds=[]))},handleBlur:function(){this.isFocused=!1},resetPanelPosition:function(){var e=this,t=this.showPanel?1:0,n=0;n=this.width>600?600:this.width<180?180:this.width,this.$nextTick((function(){b.resetPosition(e.dropInstance,e.$refs.cascader,document.body,(e.depth+t)*n)}))},handleOpen:function(t){var n=this;if(this.dropInstance){if(this.dropInstance.showCascader)return this.handleClose(),this.handleBlur(),void this.$refs.cascaderInput.blur();this.dropInstance.showCascader=!0,this.resetPanelPosition(),this.popoverTip&&(this.popoverTip.show=!1)}else this.dropInstance=b({tag:this.$refs.cascader,props:{query:this.query,data:this.handleData,loadData:this.loadData,selectIds:this.value,flatData:this.flatData,type:this.type,multiple:this.multiple,showPanel:this.showPanel,trigger:this.trigger,recursionData:this.recursionData,all:this.all,excludeTop:this.excludeTop}}).$on("change",(function(e){n.multiple?e.length||(n.query="",n.inputText=""):n.change(e)})).$on("select",(function(e){"function"==typeof n.loadData?(n.dropInstance.activeKey=e.id,n.dropInstance.refillCasscader(n.handleData,n.dropInstance,[e.id])):n.multiple||(n.$emit("input",e._ids&&e._ids.split("/")),n.dropInstance.showCascader=!1),n.$emit("change",e._ids&&e._ids.split("/"))})).$on("confirm",(function(e){n.query="",n.inputText="",n.storeSelectData=e,n.isShowAllChoice&&n.checkAllSelectStatus(e);var t=[];e.forEach((function(e){t.push(e.id)})),n.$emit("confirm",e),n.$emit("input",t)})).$on("checkWidth",(function(e){n.depth=e,n.resetPanelPosition()})).$on("clearPopover",(function(){n.popoverTip&&(e.default.remove(n.popoverTip),n.popoverTip=null)})),this.initSelectNum.length&&this.value.length&&(this.dropInstance.confirmedData=p(this.initSelectNum),this.dropInstance.selectedItems=p(this.initSelectNum)),setTimeout((function(){n.checkWidth()}),2e3),this.$nextTick((function(){n.dropInstance.$nextTick((function(){n.resetPanelPosition(),n.dropInstance.showCascader=!0,n.clearTimer()}))}))},checkWidth:function(){var e=0;!function t(n){n.forEach((function(n){"cascaPanel"===n.$options.name&&(e++,n.$children&&t(n.$children))}))}(this.$children),this.depth=e},checkAllSelectStatus:function(e){var t=e.length;if(t){var n=this.flatData.filter((function(e){return!e.disabled}));this.excludeTop&&"normal"===this.type&&(n=n.filter((function(e){return-1!==e.parentId}))),t===n.length?this.selectAll=!0:this.selectAll=!1}},change:function(e){var t=e.flag?e.item:e,n=t._ids.split("/");this.query="",this.singleSelectedItem=e,this.$emit("change",n),this.$emit("input",n),this.dropInstance.selectIds=n,e.flag?this.dropInstance.showCascader=!1:t.children&&t.children.length||(this.dropInstance.showCascader=!1)},handleInput:function(e){this.query=e.target.value||e.data||"",this.dropInstance&&(this.dropInstance.query=this.query,this.query?this.searchContent():(this.dropInstance.queryItems=[],this.dropInstance.data=this.handleData))},searchContent:function(){var e=this;this.createRecursionData();var t=this.recursionData.filter((function(t){return!!t._title&&t._title.indexOf(e.query)>-1})).map((function(t){return t.display=t.display.replace(new RegExp(e.query,"g"),'<span class="p-cascader-highlight">'.concat(e.query,"</span>")),t}));this.dropInstance.selectedItems.forEach((function(e){t.forEach((function(t){t.id===e.id&&(t.checked=e.checked)}))})),this.dropInstance.queryItems=t}},beforeDestroy:function(){b.remove(this.dropInstance),this.popoverTip&&e.default.remove(this.popoverTip),document.removeEventListener("mousewheel",this.hidePanel)}},T=(0,n.Z)($,(function(){var e=this,t=e._self._c;return t("div",[t("div",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:e.handleClose,expression:"handleClose"}],ref:"cascader",class:["p-cascader"],style:e.widthStyle},[t("div",{class:["p-cascader-header",e.isFocused&&"p-cascader-focused"],on:{click:e.handleOpen,mouseenter:function(t){return e.handleMouseEnter(!0)},mouseleave:e.mouseLeave}},[t("Triangle",{directives:[{name:"show",rawName:"v-show",value:!e.clearable,expression:"!clearable"}],class:e.classes}),e._v(" "),t("Remove",{directives:[{name:"show",rawName:"v-show",value:!e.hideClear&&e.clearable,expression:"!hideClear && clearable"}],staticClass:"p-cascader-clear",nativeOn:{click:function(t){return t.stopPropagation(),e.clearAll.apply(null,arguments)}}}),e._v(" "),e.caption?t("span",{ref:"captionDom",staticClass:"p-cascader-caption"},[e._v(e._s(e.caption))]):e._e(),e._v(" "),t("div",{staticClass:"p-cascader-fake-input",style:e.inputStyle},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.inputText,expression:"inputText"}],ref:"cascaderInput",staticClass:"p-cascader-input",style:{left:e.caption&&"4px",paddingLeft:e.caption?0:"12px"},attrs:{readonly:!e.filterable},domProps:{value:e.inputText},on:{blur:e.handleBlur,input:[function(t){t.target.composing||(e.inputText=t.target.value)},e.handleInput]}}),e._v(" "),e.multiple?t("section",{staticClass:"p-cascader-placeholder",style:{left:e.caption&&"4px",paddingLeft:e.caption?0:"12px"}},[t("span",{directives:[{name:"show",rawName:"v-show",value:e.storeSelectData.length&&!e.query,expression:"storeSelectData.length && !query"}],class:[e.showCountNumber?"p-cascader-selected":"p-cascader-normal"]},[t("span",{directives:[{name:"show",rawName:"v-show",value:e.selectAll,expression:"selectAll"}]},[e._v("\r\n "+e._s(e.allText)+"\r\n ")]),e._v(" "),t("span",{directives:[{name:"show",rawName:"v-show",value:!e.selectAll,expression:"!selectAll"}]},[e._v("\r\n 已选择"),t("span",{ref:"countTag",class:[e.showCountNumber?"p-cascader-number":"p-cascader-normal"],style:{margin:"0 4px"}},[e._v(e._s(e.selectedLens))]),e._v("项\r\n ")])]),e._v(" "),t("span",{directives:[{name:"show",rawName:"v-show",value:!e.storeSelectData.length&&!e.query,expression:"!storeSelectData.length && !query"}]},[e._v("\r\n "+e._s(e.placeholder)+"\r\n ")])]):t("section",{staticClass:"p-cascader-placeholder",style:{left:e.caption&&"4px",paddingLeft:e.caption?0:"12px"}},[t("span",{directives:[{name:"show",rawName:"v-show",value:e.singleSelectedItem&&!e.query,expression:"singleSelectedItem && !query"}],class:[e.showCountNumber?"p-cascader-selected":"p-cascader-normal"]},[e._v("\r\n "+e._s(e.singleSelectedItem&&e.singleSelectedItem.item&&e.singleSelectedItem.item._title?e.singleSelectedItem.item._title:e.singleSelectedItem&&e.singleSelectedItem._title?e.singleSelectedItem._title:"")+"\r\n ")]),e._v(" "),t("span",{directives:[{name:"show",rawName:"v-show",value:!e.singleSelectedItem&&!e.query,expression:"!singleSelectedItem && !query"}]},[e._v("\r\n "+e._s(e.placeholder)+"\r\n ")])])])],1)])])}),[],!1,null,null,null),P=T.exports;P.install=function(e){return e.component(P.name,P)};var N=P}(),a}()},"object"==typeof exports&&"object"==typeof module?module.exports=t(require("v