UNPKG

@persagy2/meri-design

Version:

fork from meri-design and extend it.

7 lines 47 kB
/*! * @@persagy2/meri-design v1.4.9-extend.2 * (c) 2019-2020 xiongshuang * Released under the MIT License. * 2022-12-07 10:32:51 */ var t,e;t=this,e=function(t){return function(){"use strict";var e={1952:function(t,e,n){var r=n(5064);e.Z={name:"Checkbox",props:{checked:{type:String,default:"uncheck"},disabled:{type:Boolean,default:!1},stopPropagation:{type:Boolean,default:!1}},methods:{TextEllipsis:r.Z,handleChange:function(t){var e,n=this.disabled,r=this.checked;if(this.stopPropagation&&t.stopPropagation(),!n){var i=this.$el.dataset,o="";o="checked"===r?"uncheck":"checked",null!==(e=this._events)&&void 0!==e&&e.change?this.$emit("change",o,i):this.$emit("update:checked",o)}}}}},9361:function(t,e,n){n.d(e,{s:function(){return r},x:function(){return i}});var r=function(){var t=this._self._c;return t("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"}},[t("g",{attrs:{transform:"translate(-1.000000, -1.000000)","fill-rule":"nonzero"}},[t("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"}})])])},i=[]},8437:function(t,e,n){n.d(e,{s:function(){return r},x:function(){return i}});var r=function(){var t=this._self._c;return t("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"}},[t("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)"}})])},i=[]},8349:function(t,e,n){n.d(e,{s:function(){return r},x:function(){return i}});var r=function(){var t=this,e=t._self._c;return e("div",{class:["p-checkbox",t.disabled&&"p-checkbox-disabled"],on:{click:t.handleChange}},[e("i",{class:["p-checkbox-box","p-checkbox-"+t.checked]}),t._v(" "),Object.keys(t.$slots).length?e("span",{staticClass:"p-checkbox-text",on:{mouseenter:t.TextEllipsis}},[t._t("default")],2):t._e()])},i=[]},6875:function(t,e,n){var r=n(3931);r.Z.install=function(t){return t.component(r.Z.name,r.Z)},e.default=r.Z},3350:function(t,e){e.Z=function(t,e,n,r,i){var o,a,c=e.clientHeight,s=e.clientWidth,u=window,l=u.pageYOffset,d=u.pageXOffset,h=t.getBoundingClientRect(),f=h.top,p=h.left,v=h.height,m=h.width,g=!0;c-(f+v+8)>=n?o=f+v+8+l:f-8>=n?(o=f-n-8+l,g=!1):o=c-n+l;var y=s-p-m,b=y+m;return a=s<=r?d:p>0?b>=r?p+d:p+m>=r?p+m-r+d+(y>0?0:y):(s-r)/2+d:d,i&&b>=r&&(a=a-r+m),{X:a,Y:o,P:g}}},6333:function(t,e){e.Z=function(t,e,n){var r=n?t.reverse():t,i={},o=r.reduce((function(t,n){return i[n[e]]||(i[n[e]]=t.push(n)),t}),[]);return n?o.reverse():o}},3114:function(t,e){e.Z=function(){return!!window.ActiveXObject||"ActiveXObject"in window}},5171:function(t,e){e.Z=function(t){if(t&&!t._isDestroyed){t.$destroy();var e=t.$el;e&&e.parentNode.removeChild(e)}}},5064:function(t,e){e.Z=function(t){var e=t.target,n=e.clientWidth,r=e.scrollWidth;e.title=r>n?e.innerText:""}},7021:function(){},5747:function(t,e,n){var r=n(9361),i=(0,n(1900).Z)({},r.s,r.x,!1,null,null,null);e.Z=i.exports},7375:function(t,e,n){var r=n(8437),i=(0,n(1900).Z)({},r.s,r.x,!1,null,null,null);e.Z=i.exports},3931:function(t,e,n){var r=n(872),i=n(5242),o=(n(6921),(0,n(1900).Z)(i.Z,r.s,r.x,!1,null,null,null));e.Z=o.exports},5242:function(t,e,n){var r=n(1952);e.Z=r.Z},872:function(t,e,n){n.d(e,{s:function(){return r.s},x:function(){return r.x}});var r=n(8349)},6921:function(t,e,n){n(7021)},1900:function(t,e,n){function r(t,e,n,r,i,o,a,c){var s,u="function"==typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=n,u._compiled=!0),r&&(u.functional=!0),o&&(u._scopeId="data-v-"+o),a?(s=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},u._ssrRegister=s):i&&(s=c?function(){i.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:i),s)if(u.functional){u._injectStyles=s;var l=u.render;u.render=function(t,e){return s.call(e),l(t,e)}}else{var d=u.beforeCreate;u.beforeCreate=d?[].concat(d,s):[s]}return{exports:t,options:u}}n.d(e,{Z:function(){return r}})},2205:function(e){e.exports=t}},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var o=n[t]={exports:{}};return e[t](o,o.exports,r),o.exports}r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,{a:e}),e},r.d=function(t,e){for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};return function(){r.r(i),r.d(i,{default:function(){return ct}});var t=r(1900),e=(0,t.Z)({},(function(){var t=this._self._c;return t("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"}},[t("path",{staticClass:"svg-fill-grey-500",attrs:{d:"\r\n M7.36397105,6.47904167\r\n C7.71544566,6.05570759 8.29167643,6.06338938 8.63677321,6.47904167\r\n L10.9236602,9.23348584\r\n C11.2751348,9.65681992 11.1147123,10 10.555128,10\r\n L5.44561621,10 C4.89060692,10 4.7319873,9.64913813 5.07708407,9.23348584\r\n L7.36397105,6.47904167\r\n Z"}})])}),[],!1,null,null,null).exports,n=(0,t.Z)({},(function(){var t=this,e=t._self._c;return e("svg",{attrs:{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"}},[e("path",{staticClass:"svg-fill-grey-800",attrs:{d:"M213.312 525.376m-85.312 0a85.312 85.312 0 1 0 170.624 0 85.312 85.312 0 1 0-170.624 0Z"}}),t._v(" "),e("path",{staticClass:"svg-fill-grey-500",attrs:{d:"M495.744 525.376m-85.312 0a85.312 85.312 0 1 0 170.624 0 85.312 85.312 0 1 0-170.624 0Z"}}),t._v(" "),e("path",{staticClass:"svg-fill-grey-800",attrs:{d:"M778.176 525.376m-85.312 0a85.312 85.312 0 1 0 170.624 0 85.312 85.312 0 1 0-170.624 0Z"}})])}),[],!1,null,null,null).exports,o=r(6875),a=r(7375),c=r(2205),s=r.n(c),u=r(3350),l=r(5171),d=r(5747),h=r(5064),f={name:"DOption",components:{ClearSvg:d.Z},props:{parent:{type:Object,default:function(){return{}}},data:{type:Array,default:function(){return[]},require:!0},value:{type:[String,Number],default:""},minWidth:{type:[String,Number],default:""},maxWidth:{type:[String,Number],default:""},theme:{type:String,default:"light"},trigger:{type:String,default:"hover"},openSearch:{type:Boolean,default:!1},placeholder:{type:String,default:"请搜索"},alignRight:{type:Boolean,default:!1},arrow:{type:Boolean,default:!1},translateX:{type:[String,Number],default:0},maxCount:{type:[String,Number],default:5}},data:function(){return{position:!0,optionStatus:!1,activeClose:!0,inputVal:"",optionData:[],scrollTop:0}},watch:{optionStatus:function(t){var e=this;t?setTimeout((function(){e.$el.style.pointerEvents="auto",e.$el.focus()}),300):this.$el.style.pointerEvents="none"},data:{handler:function(t,e){var n=JSON.stringify(t);n!==JSON.stringify(e)&&(this.optionData=JSON.parse(n))},deep:!0},inputVal:function(t,e){var n=this;t!==e&&(this.timer&&clearTimeout(this.timer),this.timer=setTimeout((function(){n.searchHandle(t)}),300))}},mounted:function(){this.optionData=JSON.parse(JSON.stringify(this.data))},methods:{TextEllipsis:h.Z,inputDown:function(){this.activeClose=!1},searchHandle:function(t){var e=JSON.parse(JSON.stringify(this.data));this.optionData=t?e.filter((function(e){return e.name.includes(t)?e:null})):e},clearInput:function(){this.inputVal=""},optionClick:function(t,e,n){n||this.$emit("change",t,e)},dropClose:function(){this.activeClose&&(this.optionStatus=!1,this.parent.optionStatus=!1)},dropEnter:function(){this.activeClose=!1,this.parent.dropTimer&&clearTimeout(this.parent.dropTimer),this.dropTimer&&clearTimeout(this.dropTimer)},dropLeave:function(){this.activeClose=!0,this.$el.focus(),"hover"===this.trigger&&(this.dropTimer=setTimeout(this.dropClose,300))},scrollTopHandle:function(t){this.scrollTop=t.target.scrollTop}}},p=(0,t.Z)(f,(function(){var t=this,e=t._self._c;return e("transition",{attrs:{name:t.position?"selectDownUpExtend":"selectDownUpExtendTop"}},[e("div",{directives:[{name:"show",rawName:"v-show",value:t.optionStatus,expression:"optionStatus"}],class:["p-drop-content","p-drop-content-".concat(t.theme),t.arrow&&(t.position?"p-drop-content-top-arrow":"p-drop-content-bottom-arrow")],style:{minWidth:"".concat(t.minWidth,"px"),maxWidth:"".concat(t.maxWidth,"px")},attrs:{tabindex:"-1"},on:{wheel:function(t){t.stopPropagation()},blur:t.dropClose,mouseenter:t.dropEnter,mouseleave:t.dropLeave}},[t.openSearch?e("label",{staticClass:"p-drop-search",class:{"p-drop-search-shadow":t.scrollTop>12}},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.inputVal,expression:"inputVal"}],staticClass:"p-drop-input",attrs:{type:"text",placeholder:t.placeholder},domProps:{value:t.inputVal},on:{mousedown:t.inputDown,input:function(e){e.target.composing||(t.inputVal=e.target.value)}}}),t._v(" "),e("i",{directives:[{name:"show",rawName:"v-show",value:t.inputVal,expression:"inputVal"}],staticClass:"p-drop-clear",on:{click:t.clearInput}},[e("ClearSvg")],1)]):t._e(),t._v(" "),e("div",{ref:"dropOption",staticClass:"p-drop-option",on:{scroll:t.scrollTopHandle}},t._l(t.optionData,(function(n,r){return e("section",{key:"".concat(r,"-").concat(n.id),class:["p-drop-option-item",t.value===n.id&&"p-drop-option-selected",n.disabled&&"p-drop-option-disable"],on:{click:function(e){return e.stopPropagation(),t.optionClick(n.id,n.name,n.disabled)},mouseenter:t.TextEllipsis}},[n.icon?e("i",{staticClass:"p-drop-option-svg",domProps:{innerHTML:t._s(n.icon)}}):t._e(),t._v(" "),e("span",[t._v(t._s(n.name))])])})),0)])])}),[],!1,null,null,null).exports,v=s().extend(p),m=null,g=function(t){var e=t.tag,n=t.propsData,r=document.body;return(m=(m=new v({propsData:n})).$mount()).tag=e,m.dom=r,r.appendChild(m.$el),m};g.remove=l.Z,g.resetPosition=function(t){var e,n=t.data,r=void 0===n?[]:n,i=t.minWidth,o=t.maxWidth,a=t.alignRight,c=t.translateX,s=t.maxCount,l=void 0===s?5:s,d=t.$refs.dropOption,h=i&&o&&i===o?o:function(t,e,n){var r=document.body,i=document.createElement("div");i.className="p-drop-content",e&&(i.style.minWidth="".concat(e,"px")),n&&(i.style.maxWidth="".concat(n,"px")),i.style.height="0",i.style.zIndex="-100";var o='<div class="p-drop-option">';t.forEach((function(t){o+='<section class="p-drop-option-item"><span>'.concat(t.name,"</span></section>")})),o+="</div>",i.innerHTML=o,r.appendChild(i);var a=i.getBoundingClientRect().width;return r.removeChild(i),a}(r,i,o),f=38*r.length,p=38*l;e=f<p?f:p;var v=(0,u.Z)(t.tag,t.dom,e,h,a),m=v.X,g=v.Y,y=v.P;t.position=y,t.$el.style.top="".concat(g,"px"),t.$el.style.left="".concat(m+Number(c),"px"),d.style.maxHeight="".concat(p,"px")};var y=g,b={name:"Dropdown",components:{Triangle:a.Z},props:{data:{type:Array,default:function(){return[]},require:!0},value:{type:[String,Number],default:""},minWidth:{type:[String,Number],default:""},maxWidth:{type:[String,Number],default:""},triangle:{type:Boolean,default:!0},transfer:{type:String,default:"parent"},theme:{type:String,default:"light"},trigger:{type:String,default:"hover"},openSearch:{type:Boolean,default:!1},placeholder:{type:String,default:"请搜索"},alignRight:{type:Boolean,default:!1},arrow:{type:Boolean,default:!1},translateX:{type:[String,Number],default:0},disabled:{type:Boolean,default:!1},maxCount:{type:[String,Number],default:5}},data:function(){return{optionStatus:!1,dropShow:!1}},watch:{value:function(t,e){t!==e&&this.dOption&&(this.dOption.value=t)},data:function(t,e){t!==e&&this.dOption&&(this.dOption.data=t)},optionStatus:function(t,e){var n=this;t!==e&&(t?this.dropShow=!0:setTimeout((function(){n.dropShow=!1}),300))},dropShow:function(t,e){t!==e&&this.$emit("getStatus",t)}},methods:{openDrop:function(){var t=this,e=this.data;if(!(JSON.stringify(e).length<=4))if(this.dOption)this.setDropdownStatus(!0);else{var n=this.value,r=this.minWidth,i=this.maxWidth,o=this.trigger,a=this.theme,c=this.openSearch,s=this.placeholder,u=this.alignRight,l=this.arrow,d=this.translateX,h=this.maxCount,f=this.$refs.pDrop;this.dOption=y({tag:f,propsData:{parent:this,value:n,data:e,minWidth:r,maxWidth:i,trigger:o,theme:a,openSearch:c,placeholder:s,alignRight:u,arrow:l,translateX:d,maxCount:h}}).$on("change",(function(e,n){t.optionClick(e,n)})),this.dOption.$nextTick((function(){t.setDropdownStatus(!0)}))}},dropClick:function(){var t=this.disabled,e=this.trigger,n=this.optionStatus,r=this.dropShow;t||r||"click"!==e||n||this.openDrop()},dropEnter:function(){var t=this.disabled,e=this.trigger,n=this.optionStatus;t||"hover"!==e||n||this.openDrop()},dropLeave:function(){this.disabled||"hover"===this.trigger&&this.dOption&&(this.dropTimer=setTimeout(this.dOption.dropClose,300))},setDropdownStatus:function(t){this.optionStatus=t,this.dOption&&(this.dOption.optionStatus=t,t&&y.resetPosition(this.dOption))},optionClick:function(t,e){this.$emit("input",t),this.$emit("change",t,e),this.setDropdownStatus(!1)},listenScroll:function(){this.setDropdownStatus(!1)}},beforeDestroy:function(){this.setDropdownStatus(!1),this.dOption&&y.remove(this.dOption)}},w=(0,t.Z)(b,(function(){var t=this,e=t._self._c;return e("div",{ref:"pDrop",class:["p-drop","p-drop-".concat(t.theme),t.dropShow&&"p-drop-show",t.disabled&&"p-drop-disabled"],on:{mouseenter:t.dropEnter,mouseleave:t.dropLeave,click:function(e){return e.stopPropagation(),t.dropClick.apply(null,arguments)}}},[e("section",{staticClass:"p-drop-title"},[e("article",{staticClass:"p-drop-title-content"},[t._t("default")],2),t._v(" "),t.triangle?e("article",{class:["p-drop-triangle",!t.optionStatus&&"p-drop-triangle-rotate"]},[e("Triangle")],1):t._e()])])}),[],!1,null,null,null),k=w.exports,x=r(3114),S=r(6333);function D(t){return D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},D(t)}function O(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */O=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(E){s=function(t,e,n){return t[e]=n}}function u(t,e,n,i){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),c=new C(i||[]);return r(a,"_invoke",{value:k(t,n,c)}),a}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(E){return{type:"throw",arg:E}}}t.wrap=u;var d={};function h(){}function f(){}function p(){}var v={};s(v,o,(function(){return this}));var m=Object.getPrototypeOf,g=m&&m(m(_([])));g&&g!==e&&n.call(g,o)&&(v=g);var y=p.prototype=h.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function i(r,o,a,c){var s=l(t[r],t,o);if("throw"!==s.type){var u=s.arg,d=u.value;return d&&"object"==D(d)&&n.call(d,"__await")?e.resolve(d.__await).then((function(t){i("next",t,a,c)}),(function(t){i("throw",t,a,c)})):e.resolve(d).then((function(t){u.value=t,a(u)}),(function(t){return i("throw",t,a,c)}))}c(s.arg)}var o;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){i(t,n,e,r)}))}return o=o?o.then(r,r):r()}})}function k(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return{value:void 0,done:!0}}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var c=x(a,n);if(c){if(c===d)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var s=l(t,e,n);if("normal"===s.type){if(r=n.done?"completed":"suspendedYield",s.arg===d)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r="completed",n.method="throw",n.arg=s.arg)}}}function x(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var i=l(r,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,d;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,d):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function _(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:N}}function N(){return{value:void 0,done:!0}}return f.prototype=p,r(y,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:f,configurable:!0}),f.displayName=s(p,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,s(t,c,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},b(w.prototype),s(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new w(u(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(y),s(y,c,"Generator"),s(y,o,(function(){return this})),s(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=_,C.prototype={constructor:C,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(L),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var c=n.call(o,"catchLoc"),s=n.call(o,"finallyLoc");if(c&&s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),L(n),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;L(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:_(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),d}},t}function L(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function C(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?L(Object(n),!0).forEach((function(e){_(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):L(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function _(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==D(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!==D(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===D(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function N(t,e,n,r,i,o,a){try{var c=t[o](a),s=c.value}catch(u){return void n(u)}c.done?e(s):Promise.resolve(s).then(r,i)}function E(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){N(o,r,i,a,c,"next",t)}function c(t){N(o,r,i,a,c,"throw",t)}a(void 0)}))}}var P=function(t){return 24*(t.split("-").length-1)+12},T=function(t){return!(t.hasOwnProperty("children")&&t.children instanceof Array&&JSON.stringify(t.children).length>4)},j=function(t,e){var n=e.multiple,r=void 0!==n&&n,i=e.allCheckboxShow,o=void 0===i||i,a=e.lastStage,c=void 0!==a&&a,s=t.showCheckbox,u=void 0===s||s;return!!r&&(o?u?!(c&&!T(t)):u:o)},I=function(t,e){var n=t.id,r=e.value;return e.multiple?r instanceof Array&&r.includes(n)?"checked":"uncheck":r===n?"checked":"uncheck"},Z=function(t){var e=t.name,n=document.createElement("span");n.style.position="absolute",n.style.top="100%",n.style.left="0",n.style.zIndex="-1",n.style.opacity="0",n.style.fontSize="12px",n.style.paddingLeft="8px",n.style.paddingRight="8px",n.innerText=e,document.body.appendChild(n);var r=n.getBoundingClientRect().width;return(0,x.Z)()?n.removeNode(!0):n.remove(),t.width=Math.ceil(r),t},$=function(){var t=E(O().mark((function t(e,n,r){var i,o,a,c=arguments;return O().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=c.length>3&&void 0!==c[3]?c[3]:null,o=c.length>4&&void 0!==c[4]&&c[4],a=c.length>5?c[5]:void 0,t.abrupt("return",new Promise((function(t){var c=a.omit;n.forEach((function(t,n){var s=i?"".concat(i,"-").concat(n):"".concat(n),u=T(t),l=c&&t.tag?Z(t.tag):{},d=C(C({},t),{index:s,parentId:r,checked:I(t,a),open:!!t.open,defaultDisabled:!!t.defaultDisabled,disabled:t.hasOwnProperty("defaultDisabled")&&t.defaultDisabled?t.defaultDisabled:!!t.disabled,paddingLeft:i?P(s):12,show:!i||o,lastNode:u,omit:c&&!u,tag:l,showCheckbox:j(t,a)});delete d.children,e.push(d),t.children&&t.children instanceof Array&&JSON.stringify(t.children).length>4&&$(e,t.children,t.id,s,t.open,a)})),t(e)})));case 4:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}(),B=function t(e){var n=e.id,r=e.tileData,i=e.status,o=e.childDisable,a=void 0!==o&&o,c=e.sameParams,s=void 0!==c&&c,u=e.init,l=e.checkedData,d=void 0===l?[]:l,h=e.linkage,f=void 0===h||h,p=e.includeParent,v=void 0===p||p,m=e.lastStage,g=void 0!==m&&m;r.forEach((function(e){e.parentId===n&&(e.defaultDisabled||(e.checked=i),a?(e.disabled=e.defaultDisabled||"checked"===i,e.disabled||"checked"!==e.checked||!d||d.some((function(t){return t.id===e.id}))||d.push(e)):e.disabled||"checked"!==e.checked||d&&(!d||d.some((function(t){return t.id===e.id})))||(g?e.lastNode&&d.push(e):f?(v||e.lastNode)&&d.push(e):d.push(e)),e.lastNode||t({id:e.id,tileData:r,status:e.checked,childDisable:a,sameParams:s,init:u,checkedData:d,linkage:f,includeParent:v,lastStage:g}))}))},A=function t(e){var n=e.parentId,r=e.tileData,i=e.checkedData,o=e.thisObj,a=o.notNull,c=o.includeParent;r.forEach((function(e){e.defaultDisabled||e.id===n&&(e.checked=function(t){var e=t.every((function(t){return"checked"===t.checked})),n=t.some((function(t){return"checked"===t.checked})),r=t.some((function(t){return"notNull"===t.checked}));return e&&n?"checked":!e&&n||r?"notNull":e||n||r?void 0:"uncheck"}(function(t,e){return e.filter((function(e){return e.parentId===t&&!e.defaultDisabled}))}(n,r)),i&&!i.some((function(t){return t.id===e.id}))&&"uncheck"!==e.checked&&("checked"===e.checked?c&&i.push(e):a&&i.push(e)),"-1"!==e.id&&t({parentId:e.parentId,tileData:r,checkedData:i,thisObj:o}))}))},J=function t(e,n,r){for(var i=e.length,o=0;o<i;o++){var a=e[o],c=a.id,s=a.parentId,u=a.name;if(c===n){r.unshift(u),"-1"!==s&&t(e,s,r);break}}},W=function(t,e){return e.forEach((function(e){var n=[e.name];J(t,e.parentId,n),e.biasName=n.join("/")})),e},H=function(t,e){var n,r=e.notNull,i=e.childDisable,o=e.includeParent,a=e.jointParent;if(i){var c=t.filter((function(t){return"checked"===t.checked})),s=c.every((function(t){return t.lastNode})),u=c.some((function(t){return t.lastNode})),l=c.map((function(t){return t.id}));n=s?c:u?c.filter((function(t){return!t.disabled||t.defaultDisabled&&!l.includes(t.parentId)})):c.filter((function(t){return!t.disabled}))}else n=r&&o?t.filter((function(t){return"checked"===t.checked||"notNull"===t.checked})):r&&!o?t.filter((function(t){return"checked"===t.checked&&t.lastNode})):!r&&o?t.filter((function(t){return"checked"===t.checked})):t.filter((function(t){return"checked"===t.checked&&t.lastNode}));return a&&W(t,n),n},G=function(t,e){if(!e||!e.length)return t.map((function(t){return t.sameId&&!t.defaultDisabled&&(t.disabled=!1),t}));if(1===e.length&&"-1"===e[0].parentId)return t;var n=null==e?void 0:e.filter((function(t){return t.sameId})),r=(0,S.Z)(n,"sameId",!0),i=e.map((function(t){return t.id}))||[],o=(null==r?void 0:r.map((function(t){return t.sameId})))||[];return t.map((function(e){var n,r;return e.sameId&&!i.includes(e.parentId)&&(e.disabled=(n=e.parentId,"checked"===(null===(r=t.find((function(t){return t.id===n})))||void 0===r?void 0:r.checked)||!i.includes(e.id)&&o.includes(e.sameId))),e}))},M=function t(e,n,r,i){n.forEach((function(t){t.id!==r||i.includes(t.id)||i.push(t.id)}));var o=e.filter((function(t){return t.id===r}));o&&o.length&&o.forEach((function(r){t(e,n,r.parentId,i)}))},R=function t(e,n,r,i){n.forEach((function(t){t.id!==r||i.includes(t.id)||i.push(t.id)}));var o=e.filter((function(t){return t.parentId===r}));o&&o.length&&o.forEach((function(r){t(e,n,r.id,i)}))},V=function t(e,n,r){e.forEach((function(i){i.parentId===n&&(r.push(i.id),i.lastNode||t(e,i.id,r))}))},X=function(t,e,n){var r=n.linkage,i=n.includeParent,o=n.lastStage,a=n.childDisable,c=n.jointParent,s=n.sameParams,u=n.checkedData,l=void 0===u?[]:u,d=t.id,h=t.parentId,f=(t.sameId,{checked:"uncheck",uncheck:"checked",notNull:"checked"}[t.checked]),p=function(t,e,n){for(var r=t.length,i=0;i<r;i++){var o=t[i];if(o.id===n){o.checked=e;break}}return t}(e,f,d);t.checked=f;var v=function(t){var e=t.tileData,n=t.checkedData,r=t.status,i=t.item,o=t.thisObj,a=o.linkage,c=o.lastStage,s=o.includeParent,u=o.childDisable,l=JSON.parse(JSON.stringify(n)),d=i.id,h=i.parentId,f=l;if("checked"===r)if(u){l.push(i);var p=[d];V(e,d,p),f=l.filter((function(t){return!p.includes(t.parentId)}))}else c?!n.some((function(t){return t.id===i.id}))&&i.lastNode&&f.push(i):a?s?n.some((function(t){return t.id===i.id}))||f.push(i):!n.some((function(t){return t.id===i.id}))&&i.lastNode&&f.push(i):n.some((function(t){return t.id===i.id}))||f.push(i);else if(n&&n.length){var v=[d];a&&(R(e,n,d,v),M(e,n,h,v)),f=l.filter((function(t){return!v.includes(t.id)}))}return f}({tileData:p,checkedData:l,status:f,item:t,thisObj:n});return r&&(a?B({id:d,tileData:p,status:f,childDisable:a,sameParams:s,init:!1,checkedData:v}):(B({id:d,tileData:p,status:f,childDisable:a,init:!1,checkedData:v,linkage:r,includeParent:i,lastStage:o}),(r||i)&&A({parentId:h,tileData:p,checkedData:v,thisObj:n}))),s&&(p=G(p,v)),c&&W(p,v),{tileData:p,checkedIds:v.map((function(t){return t.id})),checkedData:JSON.parse(JSON.stringify(v))}},F=function t(e,n,r){return r.forEach((function(i){i.parentId===e&&(i.show=n,!n&&i.open&&(i.open=!1,t(i.id,!1,r)))})),r},Y=function(){var t=E(O().mark((function t(e,n){return O().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){var r=n.value,i=n.multiple,o=n.linkage,a=n.lastStage,c=n.childDisable,s=n.sameParams,u=e;if(i&&r instanceof Array){var l=e.filter((function(t){return r.includes(t.id)}));u=s?G(e,l):e,c?l.filter((function(t){return!t.lastNode})).forEach((function(t){B({id:t.id,tileData:u,status:"checked",childDisable:c,init:!0})})):l.forEach((function(t){(o||a)&&B({id:t.id,tileData:u,status:"checked",init:!0,linkage:o,lastStage:a}),o&&A({parentId:t.parentId,tileData:u,thisObj:n})}))}if(i){var d=H(e,n),h=d.map((function(t){return t.id}));t({tileData:u,checkedIds:h,checkedData:d})}else{var f=u.find((function(t){return t.id===r})),p=f?f.id:"";t({tileData:u,checkedIds:p,checkedData:f})}})));case 1:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),U=function(){var t=E(O().mark((function t(e){var n,r,i,o,a=arguments;return O().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:[],r=a.length>2?a[2]:void 0,i=r.linkage,o=r.childDisable,t.abrupt("return",new Promise((function(t){t(n.map((function(t){if(!t.defaultDisabled)if("-1"===t.parentId)t.checked=e,t.disabled=!1;else if(o){var r=n.find((function(e){return e.id===t.parentId})),a=r.checked,c=r.disabled;t.checked=a,t.disabled=c}else if(i){var s=n.find((function(e){return e.id===t.parentId})).checked;t.checked="checked"===s?s:e}else t.checked=e;return t})))})));case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),q=function t(e,n,r,i){return n.forEach((function(o){o.parentId===e&&(o.defaultDisabled||o.disabled||(o.checked=r),i&&t(o.id,n,r,i))})),n};function z(t){return z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},z(t)}function K(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,c=[],s=!0,u=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(c.push(r.value),c.length!==e);s=!0);}catch(l){u=!0,i=l}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Q(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Q(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Q(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function tt(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */tt=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(_){s=function(t,e,n){return t[e]=n}}function u(t,e,n,i){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),c=new O(i||[]);return r(a,"_invoke",{value:k(t,n,c)}),a}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(_){return{type:"throw",arg:_}}}t.wrap=u;var d={};function h(){}function f(){}function p(){}var v={};s(v,o,(function(){return this}));var m=Object.getPrototypeOf,g=m&&m(m(L([])));g&&g!==e&&n.call(g,o)&&(v=g);var y=p.prototype=h.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function i(r,o,a,c){var s=l(t[r],t,o);if("throw"!==s.type){var u=s.arg,d=u.value;return d&&"object"==z(d)&&n.call(d,"__await")?e.resolve(d.__await).then((function(t){i("next",t,a,c)}),(function(t){i("throw",t,a,c)})):e.resolve(d).then((function(t){u.value=t,a(u)}),(function(t){return i("throw",t,a,c)}))}c(s.arg)}var o;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){i(t,n,e,r)}))}return o=o?o.then(r,r):r()}})}function k(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return{value:void 0,done:!0}}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var c=x(a,n);if(c){if(c===d)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var s=l(t,e,n);if("normal"===s.type){if(r=n.done?"completed":"suspendedYield",s.arg===d)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r="completed",n.method="throw",n.arg=s.arg)}}}function x(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var i=l(r,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,d;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,d):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function D(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function L(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:C}}function C(){return{value:void 0,done:!0}}return f.prototype=p,r(y,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:f,configurable:!0}),f.displayName=s(p,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,s(t,c,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},b(w.prototype),s(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new w(u(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(y),s(y,c,"Generator"),s(y,o,(function(){return this})),s(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=L,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(D),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var c=n.call(o,"catchLoc"),s=n.call(o,"finallyLoc");if(c&&s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),D(n),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;D(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:L(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),d}},t}function et(t,e,n,r,i,o,a){try{var c=t[o](a),s=c.value}catch(u){return void n(u)}c.done?e(s):Promise.resolve(s).then(r,i)}function nt(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){et(o,r,i,a,c,"next",t)}function c(t){et(o,r,i,a,c,"throw",t)}a(void 0)}))}}var rt={name:"PTree",components:{ArrowTriangle:e,MorePointSvg:n,Checkbox:o.default,Dropdown:k},props:{value:{type:[String,Number,Array],default:""},data:{type:Array,default:function(){return[]}},multiple:{type:Boolean,default:!1},allCheckboxShow:{type:Boolean,default:!0},notNull:{type:Boolean,default:!1},linkage:{type:Boolean,default:!0},lastStage:{type:Boolean,default:!1},childDisable:{type:Boolean,default:!1},includeParent:{type:Boolean,default:!0},jointParent:{type:Boolean,default:!1},sameParams:{type:Boolean,default:!1},render:{type:String,default:""},omit:{type:Boolean,default:!1},sortByTree:{type:Boolean,default:!1}},data:function(){return{tileList:[],tileListHistory:[],currentId:null,checkedData:[],dropDownData:[{id:"allChild",name:"选择所有子级"},{id:"nextChild",name:"选择下一级"},{id:"cancelAll",name:"取消所有子级"}]}},watch:{data:{handler:function(t){this.setTileList(t,this.value)},deep:!0,immediate:!0},value:{handler:function(t){this.currentId=t,this.setTileList(this.data,t)},deep:!0}},methods:{TextEllipsis:h.Z,setTileList:function(t){var e=arguments,n=this;return nt(tt().mark((function r(){var i,o,a,c,s,u,l;return tt().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(i=e.length>1&&void 0!==e[1]?e[1]:null,n.currentId=i,!((o=JSON.stringify(t)).length<=4)){r.next=7;break}n.tileList=[],r.next=21;break;case 7:return a=JSON.parse(o),r.next=10,$([],a,"-1",null,!1,n);case 10:return c=r.sent,r.next=13,Y(c,n);case 13:s=r.sent,u=s.tileData,l=s.checkedData,n.tileList=u,n.checkedData=l,n.treeShowHandle(u),n.resetTileList("setHistory"),n.$emit("changeTileData",u,!0);case 21:case"end":return r.stop()}}),r)})))()},itemClick:function(t,e){var n=this,r=this.multiple,i=this.tileList,o=this.sameParams,a=this.sortByTree,c=JSON.parse(JSON.stringify(t)),s=c.id,u=c.sameId,l=c.disabled,d=c.showCheckbox,h=c.checked;if(!(l||r&&!d)){var f={true:function(){var t=o?i.map((function(t){var e=t.sameId,n=t.defaultDisabled,r=t.disabled,i=t.id;return u&&e&&!n&&!r&&i!==s&&e===u&&(t.disabled="checked"!==h),t})):i,r=a?function(t,e,n){var r=n.linkage,i=n.lastStage,o=n.childDisable,a=t.id,c=t.parentId,s={checked:"uncheck",uncheck:"checked",notNull:"checked"}[t.checked];t.checked=s,o?B({id:a,tileData:e,status:s,childDisable:o}):(r||i)&&(B({id:a,tileData:e,status:s}),A({parentId:c,tileData:e}));var u=H(e,n);return{tileData:e,checkedIds:u.map((function(t){return t.id})),checkedData:JSON.parse(JSON.stringify(u))}}(c,t,n):X(c,t,n),l=r.tileData,d=r.checkedIds,f=r.checkedData;n.tileList=l,n.checkedData=f,n.$emit("change",{item:c,checkedIds:d,checkedData:f},e)},false:function(){n.currentId=s,n.$emit("change",c)}};f["".concat(r)]()}},openNode:function(t){var e=this.tileList,n=t.id,r=!t.open;if(!t.lastNode){t.open=r;var i=F(n,r,e);this.tileList=i,this.$emit("openNode",JSON.parse(JSON.stringify(t))),this.treeShowHandle(i)}},treeShowHandle:function(t){var e=null==t?void 0:t.filter((function(t){return t.show})).length;this.$emit("treeShowHandle",e)},setTileListStatus:function(t){var e=this;return nt(tt().mark((function n(){var r,i,o,a;return tt().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=e.tileList,i=e.linkage,o=e.childDisable,n.next=3,U(t,r,{linkage:i,childDisable:o});case 3:a=n.sent,e.tileList=a,"uncheck"===t&&(e.checkedData=[]),e.$emit("changeTileData",a);case 7:case"end":return n.stop()}}),n)})))()},changeTileList:function(t,e){this.itemClick(t,e)},resetTileList:function(t){var e=this,n=this.tileList,r=this.tileListHistory;({setHistory:function(){e.tileListHistory=JSON.parse(JSON.stringify(n))},recoverHistory:function(){var t=JSON.parse(JSON.stringify(r));e.tileList=t,e.$emit("changeTileData",t)}})[t]()},getStatus:function(t){var e=K(t,2),n=e[0],r=e[1],i=this.tileList;this.tileList=i.map((function(t){return t.id===r.id&&(t.omitStatus=n),t}))},dropdownChange:function(t){var e=K(t,3),n=e[0],r=(e[1],e[2]);this.strategyChange(n,r)},strategyChange:function(t,e){var n=function(t,e,n){var r=e.id,i=n.tileList,o={allChild:function(){return q(r,i,"checked",!0)},nextChild:function(){return q(r,i,"checked",!1)},cancelAll:function(){return q(r,i,"uncheck",!0)}}[t](),a=H(o,n);return{tileData:o,checkedIds:a.map((function(t){return t.id})),checkedData:a}}(t,e,this),r=n.tileData,i=n.checkedIds,o=n.checkedData;this.checkedData=o,this.tileList=r,this.$emit("changeTileData",r),this.$emit("change",{item:e,checkedIds:i,checkedData:o},!0)}}},it=rt,ot=(0,t.Z)(it,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"p-tree-com"},[t._l(t.tileList,(function(n,r){return[n.show?e("div",{key:"".concat(n.id,"-").concat(r),class:["p-tree-com-item",!t.multiple&&t.currentId===n.id&&"p-tree-com-current",n.disabled&&"p-tree-com-disabled"],style:{paddingLeft:"".concat(n.paddingLeft,"px")}},[e("section",{staticClass:"p-tree-com-arrow",on:{click:function(e){return e.stopPropagation(),t.openNode(n)}}},[n.lastNode?t._e():e("ArrowTriangle",{class:[n.open&&"p-tree-com-triangle"]})],1),t._v(" "),e("div",{class:["p-tree-com-main",t.multiple?"p-tree-com-multiple":"p-tree-com-single"],on:{click:function(e){return e.stopPropagation(),t.itemClick(n)}}},[n.showCheckbox?e("section",{staticClass:"p-tree-com-checkbox"},[e("Checkbox",{attrs:{disabled:n.disabled,checked:n.checked}})],1):t._e(),t._v(" "),e("section",{staticClass:"p-tree-com-content",class:{"p-tree-com-omit":n.omit}},["custom"===t.render?t._t(n.id,null,{item:n}):[e("article",{staticClass:"p-tree-com-text",on:{mouseenter:t.TextEllipsis}},[t._v(t._s(n.name))]),t._v(" "),n.omit?e("span",{staticClass:"p-tree-com-point-svg",class:{"p-tree-com-point-svg-active":n.omitStatus},on:{click:function(t){t.stopPropagation()}}},[e("Dropdown",{attrs:{trigger:"click",triangle:!1,data:t.dropDownData},on:{getStatus:function(e){return t.getStatus([].concat(Array.prototype.slice.call(arguments),[n]))},change:function(e){return t.dropdownChange([].concat(Array.prototype.slice.call(arguments),[n]))}}},[e("MorePointSvg")],1)],1):t._e()]],2)])]):t._e()]}))],2)}),[],!1,null,null,null),at=ot.exports;at.install=function(t){return t.component(at.name,at)};var ct=at}(),i}()},"object"==typeof exports&&"object"==typeof module?module.exports=e(require("vue")):"function"==typeof define&&define.amd?define("PTree",["vue"],e):"object"==typeof exports?exports.PTree=e(require("vue")):t.PTree=e(t.Vue);