bkui-vue 0.0.1-beta.20 → 0.0.1-beta.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -3
- package/README_EN.md +7 -3
- package/dist/bkui-vue.cjs.js +230 -208
- package/dist/bkui-vue.esm.js +230 -208
- package/dist/bkui-vue.umd.js +230 -208
- package/dist/style.css +127 -85
- package/lib/button/button.css +9 -0
- package/lib/button/button.d.ts +25 -1
- package/lib/button/button.less +18 -10
- package/lib/button/button.variable.css +9 -0
- package/lib/button/index.d.ts +42 -4
- package/lib/button/index.js +1 -1
- package/lib/code-diff/code-diff.css +114 -0
- package/lib/code-diff/code-diff.d.ts +71 -0
- package/lib/code-diff/code-diff.less +144 -0
- package/lib/code-diff/code-diff.variable.css +207 -0
- package/lib/code-diff/index.d.ts +6 -0
- package/lib/date-picker/date-picker.d.ts +20 -130
- package/lib/date-picker/index.js +1 -1
- package/lib/date-picker/interface.d.ts +1 -1
- package/lib/date-picker/props.d.ts +111 -0
- package/lib/directives/clickoutside.d.ts +3 -23
- package/lib/directives/index.js +2 -2
- package/lib/input/index.d.ts +58 -4
- package/lib/input/index.js +2 -2
- package/lib/input/input.css +19 -2
- package/lib/input/input.d.ts +31 -1
- package/lib/input/input.less +25 -3
- package/lib/input/input.variable.css +19 -2
- package/lib/loading/index.d.ts +31 -9
- package/lib/loading/index.js +1 -1
- package/lib/loading/loading.css +98 -71
- package/lib/loading/loading.d.ts +23 -8
- package/lib/loading/loading.less +62 -49
- package/lib/loading/loading.variable.css +98 -71
- package/lib/shared/index.js +1 -1
- package/lib/shared/vue-types.d.ts +4 -0
- package/lib/tree/index.d.ts +17 -24
- package/lib/tree/index.js +1 -1
- package/lib/tree/props.d.ts +9 -8
- package/lib/tree/tree.css +1 -12
- package/lib/tree/tree.d.ts +8 -11
- package/lib/tree/tree.less +10 -24
- package/lib/tree/tree.variable.css +1 -12
- package/lib/tree/util.d.ts +9 -1
- package/package.json +1 -1
package/lib/shared/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue-types")):"function"==typeof define&&define.amd?define(["exports","vue-types"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).bkuiVue={},e["vue-types"])}(this,(function(e,t){"use strict";function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var r={exports:{}};!function(e){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports}(r);var o=n(r.exports),i={exports:{}};!function(e){function t(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports}(i);var a=n(i.exports),s={exports:{}};!function(e){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports}(s);var u,c,l=n(s.exports);e.BKLAYERTYPE=void 0,(c=e.BKLAYERTYPE||(e.BKLAYERTYPE={})).BOTTOM="bottom",c.CONTENT="content",c.NAVI="navi",c.FULLSCREEN="fullScreen",c.PLUGINS="plugins",c.MODAL="modal",c.MESSAGE="message",c.POPPER="popper";var p=(l(u={},e.BKLAYERTYPE.BOTTOM,0),l(u,e.BKLAYERTYPE.CONTENT,1),l(u,e.BKLAYERTYPE.NAVI,100),l(u,e.BKLAYERTYPE.FULLSCREEN,1e3),l(u,e.BKLAYERTYPE.MODAL,3e3),l(u,e.BKLAYERTYPE.PLUGINS,8e3),l(u,e.BKLAYERTYPE.MESSAGE,1e4),l(u,e.BKLAYERTYPE.POPPER,99999),u),f=new(function(){function t(){o(this,t),this.storageLayerIndexValue={},this.copyDefaultValue()}return a(t,[{key:"getNextIndex",value:function(t){return Object.prototype.hasOwnProperty.call(this.storageLayerIndexValue,t)?(this.storageLayerIndexValue[t]=this.storageLayerIndexValue[t]+1,this.storageLayerIndexValue[t]):(this.storageLayerIndexValue[e.BKLAYERTYPE.MODAL]=this.storageLayerIndexValue[e.BKLAYERTYPE.MODAL]+1,this.storageLayerIndexValue[e.BKLAYERTYPE.MODAL])}},{key:"getModalNextIndex",value:function(){return this.getNextIndex(e.BKLAYERTYPE.MODAL)}},{key:"getMessageNextIndex",value:function(){return this.getNextIndex(e.BKLAYERTYPE.MESSAGE)}},{key:"getFullScreenNextIndex",value:function(){return this.getNextIndex(e.BKLAYERTYPE.FULLSCREEN)}},{key:"getNaviNextIndex",value:function(){return this.getNextIndex(e.BKLAYERTYPE.NAVI)}},{key:"getPopperIndex",value:function(){return p.popper}},{key:"setDefaultZIndex",value:function(e){var t=this;Object.keys(e||{}).forEach((function(n){Object.prototype.hasOwnProperty.call(t.storageLayerIndexValue.__proto__,n)&&Object.assign(t.storageLayerIndexValue.__proto__,l({},n,e[n]))})),this.copyDefaultValue()}},{key:"resetZIndex",value:function(e){var t=this;Object.keys(e||{}).forEach((function(n){Object.prototype.hasOwnProperty.call(t.storageLayerIndexValue,n)&&Object.assign(t.storageLayerIndexValue,l({},n,e[n]))}))}},{key:"copyDefaultValue",value:function(){var e=Object.keys(p).reduce((function(e,t){return Object.assign(e,l({},t,{value:p[t],writable:!0,configurable:!0}))}),{});this.storageLayerIndexValue=Object.create(p,e)}}]),t}()),d={exports:{}};!function(e){function t(n){return e.exports=t="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},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(d);var h=n(d.exports),v={exports:{}},m={exports:{}},y={exports:{}};!function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},e.exports.__esModule=!0,e.exports.default=e.exports}(y),function(e){var t=y.exports;e.exports=function(e){if(Array.isArray(e))return t(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(m);var g={exports:{}};!function(e){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(g);var b={exports:{}};!function(e){var t=y.exports;e.exports=function(e,n){if(e){if("string"==typeof e)return t(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports}(b);var x={exports:{}};!function(e){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports}(x),function(e){var t=m.exports,n=g.exports,r=b.exports,o=x.exports;e.exports=function(e){return t(e)||n(e)||r(e)||o()},e.exports.__esModule=!0,e.exports.default=e.exports}(v);var O=n(v.exports),w="top",k="bottom",E="right",I="left",S="auto",T=[w,k,E,I],j="start",P="end",A="viewport",M="popper",L=T.reduce((function(e,t){return e.concat([t+"-"+j,t+"-"+P])}),[]),_=[].concat(T,[S]).reduce((function(e,t){return e.concat([t,t+"-"+j,t+"-"+P])}),[]),D=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function R(e){return e?(e.nodeName||"").toLowerCase():null}function N(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function B(e){return e instanceof N(e).Element||e instanceof Element}function U(e){return e instanceof N(e).HTMLElement||e instanceof HTMLElement}function V(e){return"undefined"!=typeof ShadowRoot&&(e instanceof N(e).ShadowRoot||e instanceof ShadowRoot)}var C={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},o=t.elements[e];U(o)&&R(o)&&(Object.assign(o.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],o=t.attributes[e]||{},i=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});U(r)&&R(r)&&(Object.assign(r.style,i),Object.keys(o).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};function Y(e){return e.split("-")[0]}var q=Math.max,H=Math.min,z=Math.round;function W(e,t){void 0===t&&(t=!1);var n=e.getBoundingClientRect(),r=1,o=1;if(U(e)&&t){var i=e.offsetHeight,a=e.offsetWidth;a>0&&(r=z(n.width)/a||1),i>0&&(o=z(n.height)/i||1)}return{width:n.width/r,height:n.height/o,top:n.top/o,right:n.right/r,bottom:n.bottom/o,left:n.left/r,x:n.left/r,y:n.top/o}}function K(e){var t=W(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function F(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&V(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function G(e){return N(e).getComputedStyle(e)}function X(e){return["table","td","th"].indexOf(R(e))>=0}function Z(e){return((B(e)?e.ownerDocument:e.document)||window.document).documentElement}function J(e){return"html"===R(e)?e:e.assignedSlot||e.parentNode||(V(e)?e.host:null)||Z(e)}function $(e){return U(e)&&"fixed"!==G(e).position?e.offsetParent:null}function Q(e){for(var t=N(e),n=$(e);n&&X(n)&&"static"===G(n).position;)n=$(n);return n&&("html"===R(n)||"body"===R(n)&&"static"===G(n).position)?t:n||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&U(e)&&"fixed"===G(e).position)return null;var n=J(e);for(V(n)&&(n=n.host);U(n)&&["html","body"].indexOf(R(n))<0;){var r=G(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}function ee(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function te(e,t,n){return q(e,H(t,n))}function ne(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function re(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}var oe={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=Y(n.placement),u=ee(s),c=[I,E].indexOf(s)>=0?"height":"width";if(i&&a){var l=function(e,t){return ne("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:re(e,T))}(o.padding,n),p=K(i),f="y"===u?w:I,d="y"===u?k:E,h=n.rects.reference[c]+n.rects.reference[u]-a[u]-n.rects.popper[c],v=a[u]-n.rects.reference[u],m=Q(i),y=m?"y"===u?m.clientHeight||0:m.clientWidth||0:0,g=h/2-v/2,b=l[f],x=y-p[c]-l[d],O=y/2-p[c]/2+g,S=te(b,O,x),j=u;n.modifiersData[r]=((t={})[j]=S,t.centerOffset=S-O,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&("production"!==process.env.NODE_ENV&&(U(r)||console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).',"To use an SVG arrow, wrap it in an HTMLElement that will be used as","the arrow."].join(" "))),F(t.elements.popper,r)?t.elements.arrow=r:"production"!==process.env.NODE_ENV&&console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper',"element."].join(" ")))},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ie(e){return e.split("-")[1]}var ae={top:"auto",right:"auto",bottom:"auto",left:"auto"};function se(e){var t,n=e.popper,r=e.popperRect,o=e.placement,i=e.variation,a=e.offsets,s=e.position,u=e.gpuAcceleration,c=e.adaptive,l=e.roundOffsets,p=e.isFixed,f=a.x,d=void 0===f?0:f,h=a.y,v=void 0===h?0:h,m="function"==typeof l?l({x:d,y:v}):{x:d,y:v};d=m.x,v=m.y;var y=a.hasOwnProperty("x"),g=a.hasOwnProperty("y"),b=I,x=w,O=window;if(c){var S=Q(n),T="clientHeight",j="clientWidth";if(S===N(n)&&"static"!==G(S=Z(n)).position&&"absolute"===s&&(T="scrollHeight",j="scrollWidth"),S=S,o===w||(o===I||o===E)&&i===P)x=k,v-=(p&&S===O&&O.visualViewport?O.visualViewport.height:S[T])-r.height,v*=u?1:-1;if(o===I||(o===w||o===k)&&i===P)b=E,d-=(p&&S===O&&O.visualViewport?O.visualViewport.width:S[j])-r.width,d*=u?1:-1}var A,M=Object.assign({position:s},c&&ae),L=!0===l?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:z(t*r)/r||0,y:z(n*r)/r||0}}({x:d,y:v}):{x:d,y:v};return d=L.x,v=L.y,u?Object.assign({},M,((A={})[x]=g?"0":"",A[b]=y?"0":"",A.transform=(O.devicePixelRatio||1)<=1?"translate("+d+"px, "+v+"px)":"translate3d("+d+"px, "+v+"px, 0)",A)):Object.assign({},M,((t={})[x]=g?v+"px":"",t[b]=y?d+"px":"",t.transform="",t))}var ue={passive:!0};var ce={left:"right",right:"left",bottom:"top",top:"bottom"};function le(e){return e.replace(/left|right|bottom|top/g,(function(e){return ce[e]}))}var pe={start:"end",end:"start"};function fe(e){return e.replace(/start|end/g,(function(e){return pe[e]}))}function de(e){var t=N(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function he(e){return W(Z(e)).left+de(e).scrollLeft}function ve(e){var t=G(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function me(e){return["html","body","#document"].indexOf(R(e))>=0?e.ownerDocument.body:U(e)&&ve(e)?e:me(J(e))}function ye(e,t){var n;void 0===t&&(t=[]);var r=me(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=N(r),a=o?[i].concat(i.visualViewport||[],ve(r)?r:[]):r,s=t.concat(a);return o?s:s.concat(ye(J(a)))}function ge(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function be(e,t){return t===A?ge(function(e){var t=N(e),n=Z(e),r=t.visualViewport,o=n.clientWidth,i=n.clientHeight,a=0,s=0;return r&&(o=r.width,i=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=r.offsetLeft,s=r.offsetTop)),{width:o,height:i,x:a+he(e),y:s}}(e)):B(t)?function(e){var t=W(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):ge(function(e){var t,n=Z(e),r=de(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=q(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=q(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-r.scrollLeft+he(e),u=-r.scrollTop;return"rtl"===G(o||n).direction&&(s+=q(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:u}}(Z(e)))}function xe(e,t,n){var r="clippingParents"===t?function(e){var t=ye(J(e)),n=["absolute","fixed"].indexOf(G(e).position)>=0&&U(e)?Q(e):e;return B(n)?t.filter((function(e){return B(e)&&F(e,n)&&"body"!==R(e)})):[]}(e):[].concat(t),o=[].concat(r,[n]),i=o[0],a=o.reduce((function(t,n){var r=be(e,n);return t.top=q(r.top,t.top),t.right=H(r.right,t.right),t.bottom=H(r.bottom,t.bottom),t.left=q(r.left,t.left),t}),be(e,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Oe(e){var t,n=e.reference,r=e.element,o=e.placement,i=o?Y(o):null,a=o?ie(o):null,s=n.x+n.width/2-r.width/2,u=n.y+n.height/2-r.height/2;switch(i){case w:t={x:s,y:n.y-r.height};break;case k:t={x:s,y:n.y+n.height};break;case E:t={x:n.x+n.width,y:u};break;case I:t={x:n.x-r.width,y:u};break;default:t={x:n.x,y:n.y}}var c=i?ee(i):null;if(null!=c){var l="y"===c?"height":"width";switch(a){case j:t[c]=t[c]-(n[l]/2-r[l]/2);break;case P:t[c]=t[c]+(n[l]/2-r[l]/2)}}return t}function we(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=void 0===r?e.placement:r,i=n.boundary,a=void 0===i?"clippingParents":i,s=n.rootBoundary,u=void 0===s?A:s,c=n.elementContext,l=void 0===c?M:c,p=n.altBoundary,f=void 0!==p&&p,d=n.padding,h=void 0===d?0:d,v=ne("number"!=typeof h?h:re(h,T)),m=l===M?"reference":M,y=e.rects.popper,g=e.elements[f?m:l],b=xe(B(g)?g:g.contextElement||Z(e.elements.popper),a,u),x=W(e.elements.reference),O=Oe({reference:x,element:y,strategy:"absolute",placement:o}),I=ge(Object.assign({},y,O)),S=l===M?I:x,j={top:b.top-S.top+v.top,bottom:S.bottom-b.bottom+v.bottom,left:b.left-S.left+v.left,right:S.right-b.right+v.right},P=e.modifiersData.offset;if(l===M&&P){var L=P[o];Object.keys(j).forEach((function(e){var t=[E,k].indexOf(e)>=0?1:-1,n=[w,k].indexOf(e)>=0?"y":"x";j[e]+=L[n]*t}))}return j}function ke(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,u=n.allowedAutoPlacements,c=void 0===u?_:u,l=ie(r),p=l?s?L:L.filter((function(e){return ie(e)===l})):T,f=p.filter((function(e){return c.indexOf(e)>=0}));0===f.length&&(f=p,"production"!==process.env.NODE_ENV&&console.error(["Popper: The `allowedAutoPlacements` option did not allow any","placements. Ensure the `placement` option matches the variation","of the allowed placements.",'For example, "auto" cannot be used to allow "bottom-start".','Use "auto-start" instead.'].join(" ")));var d=f.reduce((function(t,n){return t[n]=we(e,{placement:n,boundary:o,rootBoundary:i,padding:a})[Y(n)],t}),{});return Object.keys(d).sort((function(e,t){return d[e]-d[t]}))}var Ee={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=void 0===o||o,a=n.altAxis,s=void 0===a||a,u=n.fallbackPlacements,c=n.padding,l=n.boundary,p=n.rootBoundary,f=n.altBoundary,d=n.flipVariations,h=void 0===d||d,v=n.allowedAutoPlacements,m=t.options.placement,y=Y(m),g=u||(y===m||!h?[le(m)]:function(e){if(Y(e)===S)return[];var t=le(e);return[fe(e),t,fe(t)]}(m)),b=[m].concat(g).reduce((function(e,n){return e.concat(Y(n)===S?ke(t,{placement:n,boundary:l,rootBoundary:p,padding:c,flipVariations:h,allowedAutoPlacements:v}):n)}),[]),x=t.rects.reference,O=t.rects.popper,T=new Map,P=!0,A=b[0],M=0;M<b.length;M++){var L=b[M],_=Y(L),D=ie(L)===j,R=[w,k].indexOf(_)>=0,N=R?"width":"height",B=we(t,{placement:L,boundary:l,rootBoundary:p,altBoundary:f,padding:c}),U=R?D?E:I:D?k:w;x[N]>O[N]&&(U=le(U));var V=le(U),C=[];if(i&&C.push(B[_]<=0),s&&C.push(B[U]<=0,B[V]<=0),C.every((function(e){return e}))){A=L,P=!1;break}T.set(L,C)}if(P)for(var q=function(e){var t=b.find((function(t){var n=T.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return A=t,"break"},H=h?3:1;H>0;H--){if("break"===q(H))break}t.placement!==A&&(t.modifiersData[r]._skip=!0,t.placement=A,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function Ie(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Se(e){return[w,E,k,I].some((function(t){return e[t]>=0}))}var Te={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=void 0===o?[0,0]:o,a=_.reduce((function(e,n){return e[n]=function(e,t,n){var r=Y(e),o=[I,w].indexOf(r)>=0?-1:1,i="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=i[0],s=i[1];return a=a||0,s=(s||0)*o,[I,E].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,i),e}),{}),s=a[t.placement],u=s.x,c=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=a}};var je={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=void 0===o||o,a=n.altAxis,s=void 0!==a&&a,u=n.boundary,c=n.rootBoundary,l=n.altBoundary,p=n.padding,f=n.tether,d=void 0===f||f,h=n.tetherOffset,v=void 0===h?0:h,m=we(t,{boundary:u,rootBoundary:c,padding:p,altBoundary:l}),y=Y(t.placement),g=ie(t.placement),b=!g,x=ee(y),O="x"===x?"y":"x",S=t.modifiersData.popperOffsets,T=t.rects.reference,P=t.rects.popper,A="function"==typeof v?v(Object.assign({},t.rects,{placement:t.placement})):v,M="number"==typeof A?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),L=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,_={x:0,y:0};if(S){if(i){var D,R="y"===x?w:I,N="y"===x?k:E,B="y"===x?"height":"width",U=S[x],V=U+m[R],C=U-m[N],z=d?-P[B]/2:0,W=g===j?T[B]:P[B],F=g===j?-P[B]:-T[B],G=t.elements.arrow,X=d&&G?K(G):{width:0,height:0},Z=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},J=Z[R],$=Z[N],ne=te(0,T[B],X[B]),re=b?T[B]/2-z-ne-J-M.mainAxis:W-ne-J-M.mainAxis,oe=b?-T[B]/2+z+ne+$+M.mainAxis:F+ne+$+M.mainAxis,ae=t.elements.arrow&&Q(t.elements.arrow),se=ae?"y"===x?ae.clientTop||0:ae.clientLeft||0:0,ue=null!=(D=null==L?void 0:L[x])?D:0,ce=U+oe-ue,le=te(d?H(V,U+re-ue-se):V,U,d?q(C,ce):C);S[x]=le,_[x]=le-U}if(s){var pe,fe="x"===x?w:I,de="x"===x?k:E,he=S[O],ve="y"===O?"height":"width",me=he+m[fe],ye=he-m[de],ge=-1!==[w,I].indexOf(y),be=null!=(pe=null==L?void 0:L[O])?pe:0,xe=ge?me:he-T[ve]-P[ve]-be+M.altAxis,Oe=ge?he+T[ve]+P[ve]-be-M.altAxis:ye,ke=d&&ge?function(e,t,n){var r=te(e,t,n);return r>n?n:r}(xe,he,Oe):te(d?xe:me,he,d?Oe:ye);S[O]=ke,_[O]=ke-he}t.modifiersData[r]=_}},requiresIfExists:["offset"]};function Pe(e,t,n){void 0===n&&(n=!1);var r,o,i=U(t),a=U(t)&&function(e){var t=e.getBoundingClientRect(),n=z(t.width)/e.offsetWidth||1,r=z(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),s=Z(t),u=W(e,a),c={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!n)&&(("body"!==R(t)||ve(s))&&(c=(r=t)!==N(r)&&U(r)?{scrollLeft:(o=r).scrollLeft,scrollTop:o.scrollTop}:de(r)),U(t)?((l=W(t,!0)).x+=t.clientLeft,l.y+=t.clientTop):s&&(l.x=he(s))),{x:u.left+c.scrollLeft-l.x,y:u.top+c.scrollTop-l.y,width:u.width,height:u.height}}function Ae(e){var t=new Map,n=new Set,r=[];function o(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&o(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||o(e)})),r}function Me(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return[].concat(n).reduce((function(e,t){return e.replace(/%s/,t)}),e)}var Le='Popper: modifier "%s" provided an invalid %s property, expected %s but got %s',_e=["name","enabled","phase","fn","effect","requires","options"];var De="Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.",Re={placement:"bottom",modifiers:[],strategy:"absolute"};function Ne(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function Be(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,r=void 0===n?[]:n,o=t.defaultOptions,i=void 0===o?Re:o;return function(e,t,n){void 0===n&&(n=i);var o,a,s={placement:"bottom",orderedModifiers:[],options:Object.assign({},Re,i),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},u=[],c=!1,l={state:s,setOptions:function(n){var o="function"==typeof n?n(s.options):n;p(),s.options=Object.assign({},i,s.options,o),s.scrollParents={reference:B(e)?ye(e):e.contextElement?ye(e.contextElement):[],popper:ye(t)};var a,c,f,d=function(e){var t=Ae(e);return D.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}(function(e){var t=e.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}([].concat(r,s.options.modifiers)));if(s.orderedModifiers=d.filter((function(e){return e.enabled})),"production"!==process.env.NODE_ENV){if(function(e){e.forEach((function(t){[].concat(Object.keys(t),_e).filter((function(e,t,n){return n.indexOf(e)===t})).forEach((function(n){switch(n){case"name":"string"!=typeof t.name&&console.error(Me(Le,String(t.name),'"name"','"string"','"'+String(t.name)+'"'));break;case"enabled":"boolean"!=typeof t.enabled&&console.error(Me(Le,t.name,'"enabled"','"boolean"','"'+String(t.enabled)+'"'));break;case"phase":D.indexOf(t.phase)<0&&console.error(Me(Le,t.name,'"phase"',"either "+D.join(", "),'"'+String(t.phase)+'"'));break;case"fn":"function"!=typeof t.fn&&console.error(Me(Le,t.name,'"fn"','"function"','"'+String(t.fn)+'"'));break;case"effect":null!=t.effect&&"function"!=typeof t.effect&&console.error(Me(Le,t.name,'"effect"','"function"','"'+String(t.fn)+'"'));break;case"requires":null==t.requires||Array.isArray(t.requires)||console.error(Me(Le,t.name,'"requires"','"array"','"'+String(t.requires)+'"'));break;case"requiresIfExists":Array.isArray(t.requiresIfExists)||console.error(Me(Le,t.name,'"requiresIfExists"','"array"','"'+String(t.requiresIfExists)+'"'));break;case"options":case"data":break;default:console.error('PopperJS: an invalid property has been provided to the "'+t.name+'" modifier, valid properties are '+_e.map((function(e){return'"'+e+'"'})).join(", ")+'; but "'+n+'" was provided.')}t.requires&&t.requires.forEach((function(n){null==e.find((function(e){return e.name===n}))&&console.error(Me('Popper: modifier "%s" requires "%s", but "%s" modifier is not available',String(t.name),n,n))}))}))}))}((a=[].concat(d,s.options.modifiers),c=function(e){return e.name},f=new Set,a.filter((function(e){var t=c(e);if(!f.has(t))return f.add(t),!0})))),Y(s.options.placement)===S)s.orderedModifiers.find((function(e){return"flip"===e.name}))||console.error(['Popper: "auto" placements require the "flip" modifier be',"present and enabled to work."].join(" "));var h=G(t);[h.marginTop,h.marginRight,h.marginBottom,h.marginLeft].some((function(e){return parseFloat(e)}))&&console.warn(['Popper: CSS "margin" styles cannot be used to apply padding',"between the popper and its reference element or boundary.","To replicate margin, use the `offset` modifier, as well as","the `padding` option in the `preventOverflow` and `flip`","modifiers."].join(" "))}return s.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,r=void 0===n?{}:n,o=e.effect;if("function"==typeof o){var i=o({state:s,name:t,instance:l,options:r}),a=function(){};u.push(i||a)}})),l.update()},forceUpdate:function(){if(!c){var e=s.elements,t=e.reference,n=e.popper;if(Ne(t,n)){s.rects={reference:Pe(t,Q(n),"fixed"===s.options.strategy),popper:K(n)},s.reset=!1,s.placement=s.options.placement,s.orderedModifiers.forEach((function(e){return s.modifiersData[e.name]=Object.assign({},e.data)}));for(var r=0,o=0;o<s.orderedModifiers.length;o++){if("production"!==process.env.NODE_ENV&&(r+=1)>100){console.error("Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.");break}if(!0!==s.reset){var i=s.orderedModifiers[o],a=i.fn,u=i.options,p=void 0===u?{}:u,f=i.name;"function"==typeof a&&(s=a({state:s,options:p,name:f,instance:l})||s)}else s.reset=!1,o=-1}}else"production"!==process.env.NODE_ENV&&console.error(De)}},update:(o=function(){return new Promise((function(e){l.forceUpdate(),e(s)}))},function(){return a||(a=new Promise((function(e){Promise.resolve().then((function(){a=void 0,e(o())}))}))),a}),destroy:function(){p(),c=!0}};if(!Ne(e,t))return"production"!==process.env.NODE_ENV&&console.error(De),l;function p(){u.forEach((function(e){return e()})),u=[]}return l.setOptions(n).then((function(e){!c&&n.onFirstUpdate&&n.onFirstUpdate(e)})),l}}var Ue=Be({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,i=void 0===o||o,a=r.resize,s=void 0===a||a,u=N(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&c.forEach((function(e){e.addEventListener("scroll",n.update,ue)})),s&&u.addEventListener("resize",n.update,ue),function(){i&&c.forEach((function(e){e.removeEventListener("scroll",n.update,ue)})),s&&u.removeEventListener("resize",n.update,ue)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=Oe({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=void 0===r||r,i=n.adaptive,a=void 0===i||i,s=n.roundOffsets,u=void 0===s||s;if("production"!==process.env.NODE_ENV){var c=G(t.elements.popper).transitionProperty||"";a&&["transform","top","right","bottom","left"].some((function(e){return c.indexOf(e)>=0}))&&console.warn(["Popper: Detected CSS transitions on at least one of the following",'CSS properties: "transform", "top", "right", "bottom", "left".',"\n\n",'Disable the "computeStyles" modifier\'s `adaptive` option to allow',"for smooth transitions, or remove these properties from the CSS","transition declaration on the popper element if only transitioning","opacity or background-color for example.","\n\n","We recommend using the popper element as a wrapper around an inner","element that can have any CSS property transitioned for animations."].join(" "))}var l={placement:Y(t.placement),variation:ie(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,se(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:u})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,se(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},C,Te,Ee,je,oe,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=we(t,{elementContext:"reference"}),s=we(t,{altBoundary:!0}),u=Ie(a,r),c=Ie(s,o,i),l=Se(u),p=Se(c);t.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:c,isReferenceHidden:l,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":l,"data-popper-escaped":p})}}]});function Ve(e){return null==e}function Ce(e){if(Array.isArray(e))return!0;var t=Object.prototype.toString.call(e);return"[object"===t.substr(0,7)&&"Array]"===t.substr(-6)}function Ye(e){return null!==e&&/^\[object (Object|Module)\]/.test(Object.prototype.toString.call(e))}var qe=function(e){return("number"==typeof e||e instanceof Number)&&isFinite(+e)};function He(e){if(Ce(e))return e.map(He);if(Ye(e)){for(var t=Object.create(null),n=Object.keys(e),r=n.length,o=0;o<r;++o)t[n[o]]=He(e[n[o]]);return t}return e}function ze(e){return-1===["__proto__","prototype","constructor"].indexOf(e)}function We(e,t,n,r){if(ze(e)){var o=t[e],i=n[e];Ye(o)&&Ye(i)?Ke(o,i,r):t[e]=He(i)}}function Ke(e,t,n){var r=Ce(t)?t:[t],o=r.length;if(!Ye(e))return e;for(var i=(n=n||{}).merger||We,a=0;a<o;++a)if(Ye(t=r[a]))for(var s=Object.keys(t),u=0,c=s.length;u<c;++u)i(s[u],e,t,n);return e}function Fe(e,t){return Ke(e,t,{merger:Ge})}function Ge(e,t,n){if(ze(e)){var r=t[e],o=n[e];Ye(r)&&Ye(o)?Fe(r,o):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=He(o))}}function Xe(e){try{return e instanceof HTMLElement}catch(t){return"object"===h(e)&&1===e.nodeType&&"object"===h(e.style)&&"object"===h(e.ownerDocument)}}var Ze=function(){function e(t,n,r){var i;o(this,e),this.isShow=!1,this.trigger=void 0,this.instance=void 0,this.reference=void 0,this.referenceTarget=void 0,this.popperRefer=void 0,this.delay=50,this.isInnerPopper=!1,this.disabled=!1,this.afterShow=null,this.afterHidden=null,this.appendTo="parent",this.container=null,this.fixOnBoundary=!1,this.instanceOptions=this.initDefaultOptions(r),this.reference=this.resolveInputSelectorToHtmlElement(t),this.popperRefer=this.resolveInputSelectorToHtmlElement(n),this.referenceTarget=this.getTargetReferenceElement(),this.container=(this.popperRefer||{}).parentElement,this.isShow=!!(null===(i=this.instanceOptions)||void 0===i?void 0:i.isShow),this.trigger=this.instanceOptions.trigger,this.disabled=this.instanceOptions.disabled,this.appendTo=this.instanceOptions.appendTo,this.afterHidden="function"==typeof r.afterHidden?r.afterHidden:function(){},this.afterShow="function"==typeof r.afterShow?r.afterShow:function(){},this.fixOnBoundary=this.instanceOptions.fixOnBoundary,this.initInstance(),this.registerEvents(),this.isShow&&this.show(null)}return a(e,[{key:"forceUpdate",value:function(){var e;null===(e=this.instance)||void 0===e||e.forceUpdate()}},{key:"update",value:function(){var e;null===(e=this.instance)||void 0===e||e.update()}},{key:"updateOptions",value:function(e){var t;this.instanceOptions=this.initDefaultOptions(e),this.isShow=!!(null===(t=this.instanceOptions)||void 0===t?void 0:t.isShow),this.trigger=this.instanceOptions.trigger,this.disabled=this.instanceOptions.disabled,this.setOptions(this.instanceOptions)}},{key:"setOptions",value:function(e){var t;null===(t=this.instance)||void 0===t||t.setOptions(e)}},{key:"destroy",value:function(){var e;null===(e=this.instance)||void 0===e||e.destroy()}},{key:"updateDisabled",value:function(e){this.disabled=null!=e?e:!this.disabled,this.disabled&&this.hide()}},{key:"show",value:function(e){var t;this.disabled||(null===(t=this.popperRefer)||void 0===t||t.setAttribute("data-show",""),this.setOptions({modifiers:[].concat(O(this.instanceOptions.modifiers||[]),[{name:"eventListeners",enabled:!0}])}),this.update(),this.isShow=!0,this.afterShow(),this.fixOnBoundary||this.appendToTarget())}},{key:"hide",value:function(){var e;null===(e=this.popperRefer)||void 0===e||e.removeAttribute("data-show"),this.setOptions({modifiers:[].concat(O(this.instanceOptions.modifiers||[]),[{name:"eventListeners",enabled:!1}])}),this.isShow=!1,this.isInnerPopper=!1,this.afterHidden(),this.fixOnBoundary||this.restorePopContent()}},{key:"restorePopContent",value:function(){var e=this.getAppendToTarget();Xe(e)&&e.contains(this.popperRefer)&&this.container&&!this.container.contains(this.popperRefer)&&this.container.append(this.popperRefer)}},{key:"appendToTarget",value:function(){var e=this.getAppendToTarget();Xe(e)&&e.contains(this.popperRefer)&&e.append(this.popperRefer)}},{key:"getAppendToTarget",value:function(){var e=this.appendTo,t=e;return"parent"!==e&&"string"==typeof e&&(t=document.querySelector(e)),t}},{key:"initDefaultOptions",value:function(e){var t=this,n=Ke({placement:"top",modifiers:[{name:"offset",options:{offset:[0,8]}}],strategy:"absolute",onFirstUpdate:void 0,isShow:!1,theme:"dark",trigger:"hover",disabled:!1},e||{}),r=n.onFirstUpdate;return n.onFirstUpdate=function(e){"function"==typeof r&&(r.call(t,e),t.handleFirstUpdate())},n}},{key:"handleFirstUpdate",value:function(){this.fixOnBoundary&&this.appendToTarget()}},{key:"getTargetReferenceElement",value:function(){return this.isElement(this.reference)&&1===this.reference.childElementCount?this.reference.firstElementChild:this.reference}},{key:"initInstance",value:function(){var e,t;this.referenceTarget&&(this.referenceTarget&&this.popperRefer?(this.instance=Ue(this.referenceTarget,this.popperRefer,this.instanceOptions),null===(e=this.popperRefer)||void 0===e||e.setAttribute("data-theme",null!==(t=this.instanceOptions.theme)&&void 0!==t?t:"dark")):console.error("reference or popperRefer is null, please check html element."))}},{key:"resolveInputSelectorToHtmlElement",value:function(e){if(this.isElement(e))return e;if("string"==typeof e)return document.querySelector(e);if("object"===h(e)){if(Object.prototype.hasOwnProperty.call(e,"getBoundingClientRect"))return e}else console.error("'getBoundingClientRect' is needed when use virtual elements");return null}},{key:"isElement",value:function(e){return Xe(e)}},{key:"registerEvents",value:function(){var e=this;if(this.isElement(this.referenceTarget)&&"hover"===this.trigger){["mouseenter","focus"].forEach((function(t){e.referenceTarget.addEventListener(t,(function(n){"mouseenter"===t&&(e.isInnerPopper=!0),e.show(n)}))})),["mouseleave","blur"].forEach((function(t){e.referenceTarget.addEventListener(t,(function(){e.isInnerPopper=!1,setTimeout((function(){!e.isInnerPopper&&e.hide()}),e.delay)}))})),this.isElement(this.popperRefer)&&["mouseenter","mouseleave"].forEach((function(t){e.popperRefer.addEventListener(t,(function(){"mouseenter"===t&&(e.isInnerPopper=!0),"mouseleave"===t&&e.hide()}))}))}if("click"===this.trigger){["click"].forEach((function(t){document.body.addEventListener(t,(function(t){e.isSameElement(t.target,e.reference)||e.reference.contains(t.target)?e.show(t):e.isShow&&!e.isSameElement(t.target,e.popperRefer)&&e.hide()}))}))}}},{key:"isSameElement",value:function(e,t){return e&&(e===t||e===t.firstElementChild)}}]),e}(),Je="abcdefghijklmnopqrstuvwxyz0123456789",$e=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Je,n="",r=0;r<e;r++)n+=t[parseInt((Math.random()*t.length).toString(),10)];return n},Qe=function(){function e(t){o(this,e),this.multiInstance=!1,this.uniqueMaskAttrTag="",this.parentNode=document.body,this.activeInstance=void 0,this.zIndexStore=new Map,this.lastUUID=null,this.maskStyle={position:"absolute",left:0,top:0,bottom:0,right:0,display:"none","background-color":"rgba(0,0,0,.6)"};var n=t||{},r=n.multiInstance,i=void 0!==r&&r,a=n.maskAttrTag,s=void 0===a?"auto":a,u=n.parentNode,c=void 0===u?document.body:u,l=n.maskStyle,p=void 0===l?{}:l;this.activeInstance=void 0,this.multiInstance=i,this.uniqueMaskAttrTag=this.getMaskAttrTag(s),this.parentNode=c||document,this.mask=this.getMask(),this.backupMask=this.createMask("data-bk-backup-uid"),this.setMaskStyle(Object.assign({},this.maskStyle,p))}return a(e,[{key:"show",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i=null!=o?o:$e(16),a=/-?\d+/.test("".concat(t))?t:f.getModalNextIndex(),s=Object.assign({},this.maskStyle,r||{});if(!n&&this.lastUUID){var u=this.zIndexStore.get(this.lastUUID);s=u.style}this.storeMaskInsCfg({zIndex:a,style:Object.assign({},s),uuid:i,preUID:this.lastUUID}),this.setMaskStyle(s),this.mask.style.setProperty("display","block"),this.mask.style.setProperty("z-index","".concat(a)),this.backupMask.style.setProperty("z-index","".concat(a-1)),e&&(this.activeInstance=e,this.appendContentToMask(e))}},{key:"hide",value:function(e,t){var n,r=null!=t?t:this.lastUUID;this.mask.style.setProperty("display","none"),null==e||e.remove(),null===(n=this.activeInstance)||void 0===n||n.remove(),this.activeInstance=void 0,this.popIndexStore(r)}},{key:"storeMaskInsCfg",value:function(e){return this.zIndexStore.set(e.uuid,e),this.lastUUID=e.uuid,this.zIndexStore.get(e.uuid)}},{key:"popIndexStore",value:function(e){if(this.zIndexStore.has(e)){var t=this.zIndexStore.get(e);return this.lastUUID=t.preUID,this.zIndexStore.delete(e)}return this.lastUUID=null,!1}},{key:"backupActiveInstance",value:function(){this.activeInstance&&this.backupMask.append(this.activeInstance)}},{key:"backupContentElement",value:function(e){e&&this.backupMask.append(e)}},{key:"getActiveContentInstance",value:function(){return this.activeInstance}},{key:"getMask",value:function(){if(this.multiInstance)return this.createMask();var e=this.parentNode.querySelector("[data-bkmask-uid='".concat(this.uniqueMaskAttrTag,"']"));return e||(e=this.createMask()),e}},{key:"createMask",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"data-bk-mask-uid",t=document.createElement("div");return t.setAttribute(e,this.uniqueMaskAttrTag),this.parentNode.append(t),t}},{key:"setMaskStyle",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.mask&&Object.entries(t).forEach((function(t){return e.mask.style.setProperty(t[0],t[1])}))}},{key:"getMaskAttrTag",value:function(e){return/^(auto|\s+)$/i.test(e)||null==e||""===e?"__bk_mask_".concat($e(16)):e}},{key:"appendContentToMask",value:function(e){this.mask.append(e)}}]),e}(),et=new Qe({}),tt=function(){function e(){o(this,e),this.popInstanceList=[],this.uuidAttrName="data-bk-pop-uuid"}return a(e,[{key:"show",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e){var r=f.getModalNextIndex(),o=$e(16);e.setAttribute(this.uuidAttrName,o),this.popInstanceList.push({uuid:o,zIndex:r,content:e,showMask:t,appendStyle:n}),t&&et.backupActiveInstance(),et.show(e,r,t,n,o)}else console.warn("pop show error: content is null or undefined")}},{key:"popHide",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.popInstanceList.length){if(e){var t=this.popInstanceList.pop();et.popIndexStore(t.uuid),t.remove()}if(this.popInstanceList.length){var n=this.popInstanceList.slice(-1)[0],r=n.zIndex,o=n.content,i=n.showMask,a=n.appendStyle,s=n.uuid;et.show(o,r,i,a,s)}else et.hide()}}},{key:"hide",value:function(e){var t=null==e?void 0:e.getAttribute(this.uuidAttrName);if(t){var n=this.popInstanceList.findIndex((function(e){return e.uuid===t}));n>=0&&(this.popInstanceList[n].content.remove(),this.popInstanceList.splice(n,1),et.popIndexStore(t),this.popInstanceList.length?this.popHide(!1):et.hide())}else null==e||e.remove()}}]),e}(),nt=new tt,rt={exports:{}},ot={exports:{}};!function(e){function t(n,r){return e.exports=t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n,r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(ot),function(e){var t=ot.exports;e.exports=function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),n&&t(e,n)},e.exports.__esModule=!0,e.exports.default=e.exports}(rt);var it=n(rt.exports),at={exports:{}},st={exports:{}};!function(e){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports}(st),function(e){var t=d.exports.default,n=st.exports;e.exports=function(e,r){if(r&&("object"===t(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return n(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(at);var ut=n(at.exports),ct={exports:{}};!function(e){function t(n){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(ct);var lt=n(ct.exports);function pt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=lt(e);if(t){var o=lt(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return ut(this,n)}}var ft,dt,ht=t.createTypes({});e.Size=void 0,(ft=e.Size||(e.Size={})).Small="small",ft.Large="large",e.Placements=void 0,(dt=e.Placements||(e.Placements={})).Top="top",dt.Left="left",dt.Right="right",dt.Bottom="bottom";var vt,mt=function(e){it(r,e);var n=pt(r);function r(){return o(this,r),n.apply(this,arguments)}return a(r,null,[{key:"size",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["small","default","large"];return t.toType("Size",{type:String,validator:function(t){return!(t&&!e.includes(t))||(console.error("invalid size, ".concat(t,", the size must be one of 【").concat(e.join(" | "),"】")),!1)},default:"default"})}},{key:"theme",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["primary","warning","success","danger"];return t.toType("Theme",{type:String,validator:function(t){return!(t&&!e.includes(t))||(console.error("invalid theme, ".concat(t,", the theme must be one of 【").concat(e.join(" | "),"】")),!1)},default:"primary"})}},{key:"placement",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["top","left","right","bottom"];return t.toType("Placements",{type:String,validator:function(t){return!(t&&!e.includes(t))||(console.error("invalid placements, ".concat(t,", the placement must be one of 【").concat(e.join(" | "),"】")),!1)},default:"top"})}},{key:"commonType",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"commonType";return t.toType(n.replace(/^\S/,(function(e){return e.toUpperCase()})),{type:String,validator:function(t){var r=e.includes(t);return r||console.error("invalid ".concat(n,", ").concat(t,", the ").concat(n," must be one of 【").concat(e.join(" | "),"】")),r},default:e[0]})}},{key:"style",value:function(){return t.toType("Style",{type:[String,Object]})}},{key:"position",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["top-left","top-right","bottom-left","bottom-right"];return t.toType("positions",{type:String,validator:function(t){return!(t&&!e.includes(t))||(console.error("invalid positions, ".concat(t,", the position must be one of 【").concat(e.join(" | "),"】")),!1)},default:"top-center"})}}]),r}(ht);var yt=Object.create({});e.BKLAYERD_INDEX_EFAULT_VALUE=p,e.BKPopover=Ze,e.BkMaskManager=Qe,e.EMPTY_OBJ=yt,e.PropTypes=mt,e.bKMaskManager=et,e.bkPopIndexManager=nt,e.bkZIndexManager=f,e.classes=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.entries(e).filter((function(e){return e[1]})).map((function(e){return e[0]})).join(" ").concat(t?" ".concat(t):"")},e.clone=He,e.debounce=function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:300,r=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=function(){var i=this,a=arguments;if(e&&clearTimeout(e),o){var s=!e;e=setTimeout((function(){e=null}),n),s&&(t=r.apply(i,a))}else e=setTimeout((function(){r.apply(i,a)}),n);return t};return i.cancel=function(){clearTimeout(e),e=null},i},e.elementsEqual=function(e,t){var n,r,o,i;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(o=e[n],i=t[n],o.datasetIndex!==i.datasetIndex||o.index!==i.index)return!1;return!0},e.finiteOrDefault=function(e,t){return qe(e)?e:t},e.isArray=Ce,e.isElement=Xe,e.isEmpty=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return""===e||!!t&&Ve(e)},e.isEmptyObj=function(e){return Object.keys(e).length<1},e.isFinite=qe,e.isNullOrUndef=Ve,e.isObject=Ye,e.merge=Ke,e.mergeIf=Fe,e.mergerFn=We,e.mergerIfFn=Ge,e.noop=function(){},e.renderEmptyVNode=function(){return null},e.resolveClassName=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"bk";return"".concat(t,"-").concat(e)},e.scrollbarWidth=function(){if(void 0!==vt)return vt;var e=document.createElement("div");e.className="bk-scrollbar-wrap",e.style.visibility="hidden",e.style.width="100px",e.style.position="absolute",e.style.top="-9999px",document.body.appendChild(e);var t=e.offsetWidth;e.style.overflow="scroll";var n=document.createElement("div");n.style.width="100%",e.appendChild(n);var r=n.offsetWidth;return e.parentNode.removeChild(e),vt=t-r},e.throttle=function(e,t,n){var r,o,i,a=null,s=0;n||(n={});var u=function(){s=!1===n.leading?0:(new Date).getTime(),a=null,i=e.apply(r,o),a||(r=o=null)};return function(){var c=(new Date).getTime();s||!1!==n.leading||(s=c);var l=t-(c-s);return r=this,o=arguments,l<=0||l>t?(a&&(clearTimeout(a),a=null),s=c,i=e.apply(r,o),a||(r=o=null)):a||!1===n.trailing||(a=setTimeout(u,l)),i}},e.valueOrDefault=function(e,t){return void 0===e?t:e},e.withInstall=function(e){return e.install=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.prefix,o=t.config.globalProperties.bkUIPrefix||r||"Bk";t.component(o+e.name,e)},e},e.withInstallProps=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return e.install=function(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=o.prefix,a=r.config.globalProperties.bkUIPrefix||i||"Bk";r.component(a+e.name,e),!n&&Object.values(t).forEach((function(e){r.component(a+e.name,e)}))},Object.keys(t).forEach((function(n){e[n]=t[n]})),e},Object.defineProperty(e,"__esModule",{value:!0})}));
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue-types")):"function"==typeof define&&define.amd?define(["exports","vue-types"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).bkuiVue={},e["vue-types"])}(this,(function(e,t){"use strict";function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var r={exports:{}};!function(e){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports}(r);var o=n(r.exports),i={exports:{}};!function(e){function t(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports}(i);var a=n(i.exports),s={exports:{}};!function(e){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports}(s);var u,c,l=n(s.exports);e.BKLAYERTYPE=void 0,(c=e.BKLAYERTYPE||(e.BKLAYERTYPE={})).BOTTOM="bottom",c.CONTENT="content",c.NAVI="navi",c.FULLSCREEN="fullScreen",c.PLUGINS="plugins",c.MODAL="modal",c.MESSAGE="message",c.POPPER="popper";var p=(l(u={},e.BKLAYERTYPE.BOTTOM,0),l(u,e.BKLAYERTYPE.CONTENT,1),l(u,e.BKLAYERTYPE.NAVI,100),l(u,e.BKLAYERTYPE.FULLSCREEN,1e3),l(u,e.BKLAYERTYPE.MODAL,3e3),l(u,e.BKLAYERTYPE.PLUGINS,8e3),l(u,e.BKLAYERTYPE.MESSAGE,1e4),l(u,e.BKLAYERTYPE.POPPER,99999),u),f=new(function(){function t(){o(this,t),this.storageLayerIndexValue={},this.copyDefaultValue()}return a(t,[{key:"getNextIndex",value:function(t){return Object.prototype.hasOwnProperty.call(this.storageLayerIndexValue,t)?(this.storageLayerIndexValue[t]=this.storageLayerIndexValue[t]+1,this.storageLayerIndexValue[t]):(this.storageLayerIndexValue[e.BKLAYERTYPE.MODAL]=this.storageLayerIndexValue[e.BKLAYERTYPE.MODAL]+1,this.storageLayerIndexValue[e.BKLAYERTYPE.MODAL])}},{key:"getModalNextIndex",value:function(){return this.getNextIndex(e.BKLAYERTYPE.MODAL)}},{key:"getMessageNextIndex",value:function(){return this.getNextIndex(e.BKLAYERTYPE.MESSAGE)}},{key:"getFullScreenNextIndex",value:function(){return this.getNextIndex(e.BKLAYERTYPE.FULLSCREEN)}},{key:"getNaviNextIndex",value:function(){return this.getNextIndex(e.BKLAYERTYPE.NAVI)}},{key:"getPopperIndex",value:function(){return p.popper}},{key:"setDefaultZIndex",value:function(e){var t=this;Object.keys(e||{}).forEach((function(n){Object.prototype.hasOwnProperty.call(t.storageLayerIndexValue.__proto__,n)&&Object.assign(t.storageLayerIndexValue.__proto__,l({},n,e[n]))})),this.copyDefaultValue()}},{key:"resetZIndex",value:function(e){var t=this;Object.keys(e||{}).forEach((function(n){Object.prototype.hasOwnProperty.call(t.storageLayerIndexValue,n)&&Object.assign(t.storageLayerIndexValue,l({},n,e[n]))}))}},{key:"copyDefaultValue",value:function(){var e=Object.keys(p).reduce((function(e,t){return Object.assign(e,l({},t,{value:p[t],writable:!0,configurable:!0}))}),{});this.storageLayerIndexValue=Object.create(p,e)}}]),t}()),d={exports:{}};!function(e){function t(n){return e.exports=t="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},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(d);var h=n(d.exports),v={exports:{}},m={exports:{}},y={exports:{}};!function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},e.exports.__esModule=!0,e.exports.default=e.exports}(y),function(e){var t=y.exports;e.exports=function(e){if(Array.isArray(e))return t(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(m);var g={exports:{}};!function(e){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(g);var b={exports:{}};!function(e){var t=y.exports;e.exports=function(e,n){if(e){if("string"==typeof e)return t(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports}(b);var x={exports:{}};!function(e){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports}(x),function(e){var t=m.exports,n=g.exports,r=b.exports,o=x.exports;e.exports=function(e){return t(e)||n(e)||r(e)||o()},e.exports.__esModule=!0,e.exports.default=e.exports}(v);var O=n(v.exports),w="top",E="bottom",k="right",I="left",S="auto",T=[w,E,k,I],j="start",P="end",A="viewport",M="popper",L=T.reduce((function(e,t){return e.concat([t+"-"+j,t+"-"+P])}),[]),_=[].concat(T,[S]).reduce((function(e,t){return e.concat([t,t+"-"+j,t+"-"+P])}),[]),D=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function R(e){return e?(e.nodeName||"").toLowerCase():null}function N(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function B(e){return e instanceof N(e).Element||e instanceof Element}function U(e){return e instanceof N(e).HTMLElement||e instanceof HTMLElement}function V(e){return"undefined"!=typeof ShadowRoot&&(e instanceof N(e).ShadowRoot||e instanceof ShadowRoot)}var C={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},o=t.elements[e];U(o)&&R(o)&&(Object.assign(o.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],o=t.attributes[e]||{},i=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});U(r)&&R(r)&&(Object.assign(r.style,i),Object.keys(o).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};function Y(e){return e.split("-")[0]}var q=Math.max,H=Math.min,z=Math.round;function W(e,t){void 0===t&&(t=!1);var n=e.getBoundingClientRect(),r=1,o=1;if(U(e)&&t){var i=e.offsetHeight,a=e.offsetWidth;a>0&&(r=z(n.width)/a||1),i>0&&(o=z(n.height)/i||1)}return{width:n.width/r,height:n.height/o,top:n.top/o,right:n.right/r,bottom:n.bottom/o,left:n.left/r,x:n.left/r,y:n.top/o}}function K(e){var t=W(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function F(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&V(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function G(e){return N(e).getComputedStyle(e)}function X(e){return["table","td","th"].indexOf(R(e))>=0}function Z(e){return((B(e)?e.ownerDocument:e.document)||window.document).documentElement}function J(e){return"html"===R(e)?e:e.assignedSlot||e.parentNode||(V(e)?e.host:null)||Z(e)}function $(e){return U(e)&&"fixed"!==G(e).position?e.offsetParent:null}function Q(e){for(var t=N(e),n=$(e);n&&X(n)&&"static"===G(n).position;)n=$(n);return n&&("html"===R(n)||"body"===R(n)&&"static"===G(n).position)?t:n||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&U(e)&&"fixed"===G(e).position)return null;var n=J(e);for(V(n)&&(n=n.host);U(n)&&["html","body"].indexOf(R(n))<0;){var r=G(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}function ee(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function te(e,t,n){return q(e,H(t,n))}function ne(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function re(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}var oe={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=Y(n.placement),u=ee(s),c=[I,k].indexOf(s)>=0?"height":"width";if(i&&a){var l=function(e,t){return ne("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:re(e,T))}(o.padding,n),p=K(i),f="y"===u?w:I,d="y"===u?E:k,h=n.rects.reference[c]+n.rects.reference[u]-a[u]-n.rects.popper[c],v=a[u]-n.rects.reference[u],m=Q(i),y=m?"y"===u?m.clientHeight||0:m.clientWidth||0:0,g=h/2-v/2,b=l[f],x=y-p[c]-l[d],O=y/2-p[c]/2+g,S=te(b,O,x),j=u;n.modifiersData[r]=((t={})[j]=S,t.centerOffset=S-O,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&("production"!==process.env.NODE_ENV&&(U(r)||console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).',"To use an SVG arrow, wrap it in an HTMLElement that will be used as","the arrow."].join(" "))),F(t.elements.popper,r)?t.elements.arrow=r:"production"!==process.env.NODE_ENV&&console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper',"element."].join(" ")))},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ie(e){return e.split("-")[1]}var ae={top:"auto",right:"auto",bottom:"auto",left:"auto"};function se(e){var t,n=e.popper,r=e.popperRect,o=e.placement,i=e.variation,a=e.offsets,s=e.position,u=e.gpuAcceleration,c=e.adaptive,l=e.roundOffsets,p=e.isFixed,f=a.x,d=void 0===f?0:f,h=a.y,v=void 0===h?0:h,m="function"==typeof l?l({x:d,y:v}):{x:d,y:v};d=m.x,v=m.y;var y=a.hasOwnProperty("x"),g=a.hasOwnProperty("y"),b=I,x=w,O=window;if(c){var S=Q(n),T="clientHeight",j="clientWidth";if(S===N(n)&&"static"!==G(S=Z(n)).position&&"absolute"===s&&(T="scrollHeight",j="scrollWidth"),S=S,o===w||(o===I||o===k)&&i===P)x=E,v-=(p&&S===O&&O.visualViewport?O.visualViewport.height:S[T])-r.height,v*=u?1:-1;if(o===I||(o===w||o===E)&&i===P)b=k,d-=(p&&S===O&&O.visualViewport?O.visualViewport.width:S[j])-r.width,d*=u?1:-1}var A,M=Object.assign({position:s},c&&ae),L=!0===l?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:z(t*r)/r||0,y:z(n*r)/r||0}}({x:d,y:v}):{x:d,y:v};return d=L.x,v=L.y,u?Object.assign({},M,((A={})[x]=g?"0":"",A[b]=y?"0":"",A.transform=(O.devicePixelRatio||1)<=1?"translate("+d+"px, "+v+"px)":"translate3d("+d+"px, "+v+"px, 0)",A)):Object.assign({},M,((t={})[x]=g?v+"px":"",t[b]=y?d+"px":"",t.transform="",t))}var ue={passive:!0};var ce={left:"right",right:"left",bottom:"top",top:"bottom"};function le(e){return e.replace(/left|right|bottom|top/g,(function(e){return ce[e]}))}var pe={start:"end",end:"start"};function fe(e){return e.replace(/start|end/g,(function(e){return pe[e]}))}function de(e){var t=N(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function he(e){return W(Z(e)).left+de(e).scrollLeft}function ve(e){var t=G(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function me(e){return["html","body","#document"].indexOf(R(e))>=0?e.ownerDocument.body:U(e)&&ve(e)?e:me(J(e))}function ye(e,t){var n;void 0===t&&(t=[]);var r=me(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=N(r),a=o?[i].concat(i.visualViewport||[],ve(r)?r:[]):r,s=t.concat(a);return o?s:s.concat(ye(J(a)))}function ge(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function be(e,t){return t===A?ge(function(e){var t=N(e),n=Z(e),r=t.visualViewport,o=n.clientWidth,i=n.clientHeight,a=0,s=0;return r&&(o=r.width,i=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=r.offsetLeft,s=r.offsetTop)),{width:o,height:i,x:a+he(e),y:s}}(e)):B(t)?function(e){var t=W(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):ge(function(e){var t,n=Z(e),r=de(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=q(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=q(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-r.scrollLeft+he(e),u=-r.scrollTop;return"rtl"===G(o||n).direction&&(s+=q(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:u}}(Z(e)))}function xe(e,t,n){var r="clippingParents"===t?function(e){var t=ye(J(e)),n=["absolute","fixed"].indexOf(G(e).position)>=0&&U(e)?Q(e):e;return B(n)?t.filter((function(e){return B(e)&&F(e,n)&&"body"!==R(e)})):[]}(e):[].concat(t),o=[].concat(r,[n]),i=o[0],a=o.reduce((function(t,n){var r=be(e,n);return t.top=q(r.top,t.top),t.right=H(r.right,t.right),t.bottom=H(r.bottom,t.bottom),t.left=q(r.left,t.left),t}),be(e,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Oe(e){var t,n=e.reference,r=e.element,o=e.placement,i=o?Y(o):null,a=o?ie(o):null,s=n.x+n.width/2-r.width/2,u=n.y+n.height/2-r.height/2;switch(i){case w:t={x:s,y:n.y-r.height};break;case E:t={x:s,y:n.y+n.height};break;case k:t={x:n.x+n.width,y:u};break;case I:t={x:n.x-r.width,y:u};break;default:t={x:n.x,y:n.y}}var c=i?ee(i):null;if(null!=c){var l="y"===c?"height":"width";switch(a){case j:t[c]=t[c]-(n[l]/2-r[l]/2);break;case P:t[c]=t[c]+(n[l]/2-r[l]/2)}}return t}function we(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=void 0===r?e.placement:r,i=n.boundary,a=void 0===i?"clippingParents":i,s=n.rootBoundary,u=void 0===s?A:s,c=n.elementContext,l=void 0===c?M:c,p=n.altBoundary,f=void 0!==p&&p,d=n.padding,h=void 0===d?0:d,v=ne("number"!=typeof h?h:re(h,T)),m=l===M?"reference":M,y=e.rects.popper,g=e.elements[f?m:l],b=xe(B(g)?g:g.contextElement||Z(e.elements.popper),a,u),x=W(e.elements.reference),O=Oe({reference:x,element:y,strategy:"absolute",placement:o}),I=ge(Object.assign({},y,O)),S=l===M?I:x,j={top:b.top-S.top+v.top,bottom:S.bottom-b.bottom+v.bottom,left:b.left-S.left+v.left,right:S.right-b.right+v.right},P=e.modifiersData.offset;if(l===M&&P){var L=P[o];Object.keys(j).forEach((function(e){var t=[k,E].indexOf(e)>=0?1:-1,n=[w,E].indexOf(e)>=0?"y":"x";j[e]+=L[n]*t}))}return j}function Ee(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,u=n.allowedAutoPlacements,c=void 0===u?_:u,l=ie(r),p=l?s?L:L.filter((function(e){return ie(e)===l})):T,f=p.filter((function(e){return c.indexOf(e)>=0}));0===f.length&&(f=p,"production"!==process.env.NODE_ENV&&console.error(["Popper: The `allowedAutoPlacements` option did not allow any","placements. Ensure the `placement` option matches the variation","of the allowed placements.",'For example, "auto" cannot be used to allow "bottom-start".','Use "auto-start" instead.'].join(" ")));var d=f.reduce((function(t,n){return t[n]=we(e,{placement:n,boundary:o,rootBoundary:i,padding:a})[Y(n)],t}),{});return Object.keys(d).sort((function(e,t){return d[e]-d[t]}))}var ke={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=void 0===o||o,a=n.altAxis,s=void 0===a||a,u=n.fallbackPlacements,c=n.padding,l=n.boundary,p=n.rootBoundary,f=n.altBoundary,d=n.flipVariations,h=void 0===d||d,v=n.allowedAutoPlacements,m=t.options.placement,y=Y(m),g=u||(y===m||!h?[le(m)]:function(e){if(Y(e)===S)return[];var t=le(e);return[fe(e),t,fe(t)]}(m)),b=[m].concat(g).reduce((function(e,n){return e.concat(Y(n)===S?Ee(t,{placement:n,boundary:l,rootBoundary:p,padding:c,flipVariations:h,allowedAutoPlacements:v}):n)}),[]),x=t.rects.reference,O=t.rects.popper,T=new Map,P=!0,A=b[0],M=0;M<b.length;M++){var L=b[M],_=Y(L),D=ie(L)===j,R=[w,E].indexOf(_)>=0,N=R?"width":"height",B=we(t,{placement:L,boundary:l,rootBoundary:p,altBoundary:f,padding:c}),U=R?D?k:I:D?E:w;x[N]>O[N]&&(U=le(U));var V=le(U),C=[];if(i&&C.push(B[_]<=0),s&&C.push(B[U]<=0,B[V]<=0),C.every((function(e){return e}))){A=L,P=!1;break}T.set(L,C)}if(P)for(var q=function(e){var t=b.find((function(t){var n=T.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return A=t,"break"},H=h?3:1;H>0;H--){if("break"===q(H))break}t.placement!==A&&(t.modifiersData[r]._skip=!0,t.placement=A,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function Ie(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Se(e){return[w,k,E,I].some((function(t){return e[t]>=0}))}var Te={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=void 0===o?[0,0]:o,a=_.reduce((function(e,n){return e[n]=function(e,t,n){var r=Y(e),o=[I,w].indexOf(r)>=0?-1:1,i="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=i[0],s=i[1];return a=a||0,s=(s||0)*o,[I,k].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,i),e}),{}),s=a[t.placement],u=s.x,c=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=a}};var je={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=void 0===o||o,a=n.altAxis,s=void 0!==a&&a,u=n.boundary,c=n.rootBoundary,l=n.altBoundary,p=n.padding,f=n.tether,d=void 0===f||f,h=n.tetherOffset,v=void 0===h?0:h,m=we(t,{boundary:u,rootBoundary:c,padding:p,altBoundary:l}),y=Y(t.placement),g=ie(t.placement),b=!g,x=ee(y),O="x"===x?"y":"x",S=t.modifiersData.popperOffsets,T=t.rects.reference,P=t.rects.popper,A="function"==typeof v?v(Object.assign({},t.rects,{placement:t.placement})):v,M="number"==typeof A?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),L=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,_={x:0,y:0};if(S){if(i){var D,R="y"===x?w:I,N="y"===x?E:k,B="y"===x?"height":"width",U=S[x],V=U+m[R],C=U-m[N],z=d?-P[B]/2:0,W=g===j?T[B]:P[B],F=g===j?-P[B]:-T[B],G=t.elements.arrow,X=d&&G?K(G):{width:0,height:0},Z=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},J=Z[R],$=Z[N],ne=te(0,T[B],X[B]),re=b?T[B]/2-z-ne-J-M.mainAxis:W-ne-J-M.mainAxis,oe=b?-T[B]/2+z+ne+$+M.mainAxis:F+ne+$+M.mainAxis,ae=t.elements.arrow&&Q(t.elements.arrow),se=ae?"y"===x?ae.clientTop||0:ae.clientLeft||0:0,ue=null!=(D=null==L?void 0:L[x])?D:0,ce=U+oe-ue,le=te(d?H(V,U+re-ue-se):V,U,d?q(C,ce):C);S[x]=le,_[x]=le-U}if(s){var pe,fe="x"===x?w:I,de="x"===x?E:k,he=S[O],ve="y"===O?"height":"width",me=he+m[fe],ye=he-m[de],ge=-1!==[w,I].indexOf(y),be=null!=(pe=null==L?void 0:L[O])?pe:0,xe=ge?me:he-T[ve]-P[ve]-be+M.altAxis,Oe=ge?he+T[ve]+P[ve]-be-M.altAxis:ye,Ee=d&&ge?function(e,t,n){var r=te(e,t,n);return r>n?n:r}(xe,he,Oe):te(d?xe:me,he,d?Oe:ye);S[O]=Ee,_[O]=Ee-he}t.modifiersData[r]=_}},requiresIfExists:["offset"]};function Pe(e,t,n){void 0===n&&(n=!1);var r,o,i=U(t),a=U(t)&&function(e){var t=e.getBoundingClientRect(),n=z(t.width)/e.offsetWidth||1,r=z(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),s=Z(t),u=W(e,a),c={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!n)&&(("body"!==R(t)||ve(s))&&(c=(r=t)!==N(r)&&U(r)?{scrollLeft:(o=r).scrollLeft,scrollTop:o.scrollTop}:de(r)),U(t)?((l=W(t,!0)).x+=t.clientLeft,l.y+=t.clientTop):s&&(l.x=he(s))),{x:u.left+c.scrollLeft-l.x,y:u.top+c.scrollTop-l.y,width:u.width,height:u.height}}function Ae(e){var t=new Map,n=new Set,r=[];function o(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&o(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||o(e)})),r}function Me(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return[].concat(n).reduce((function(e,t){return e.replace(/%s/,t)}),e)}var Le='Popper: modifier "%s" provided an invalid %s property, expected %s but got %s',_e=["name","enabled","phase","fn","effect","requires","options"];var De="Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.",Re={placement:"bottom",modifiers:[],strategy:"absolute"};function Ne(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function Be(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,r=void 0===n?[]:n,o=t.defaultOptions,i=void 0===o?Re:o;return function(e,t,n){void 0===n&&(n=i);var o,a,s={placement:"bottom",orderedModifiers:[],options:Object.assign({},Re,i),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},u=[],c=!1,l={state:s,setOptions:function(n){var o="function"==typeof n?n(s.options):n;p(),s.options=Object.assign({},i,s.options,o),s.scrollParents={reference:B(e)?ye(e):e.contextElement?ye(e.contextElement):[],popper:ye(t)};var a,c,f,d=function(e){var t=Ae(e);return D.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}(function(e){var t=e.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}([].concat(r,s.options.modifiers)));if(s.orderedModifiers=d.filter((function(e){return e.enabled})),"production"!==process.env.NODE_ENV){if(function(e){e.forEach((function(t){[].concat(Object.keys(t),_e).filter((function(e,t,n){return n.indexOf(e)===t})).forEach((function(n){switch(n){case"name":"string"!=typeof t.name&&console.error(Me(Le,String(t.name),'"name"','"string"','"'+String(t.name)+'"'));break;case"enabled":"boolean"!=typeof t.enabled&&console.error(Me(Le,t.name,'"enabled"','"boolean"','"'+String(t.enabled)+'"'));break;case"phase":D.indexOf(t.phase)<0&&console.error(Me(Le,t.name,'"phase"',"either "+D.join(", "),'"'+String(t.phase)+'"'));break;case"fn":"function"!=typeof t.fn&&console.error(Me(Le,t.name,'"fn"','"function"','"'+String(t.fn)+'"'));break;case"effect":null!=t.effect&&"function"!=typeof t.effect&&console.error(Me(Le,t.name,'"effect"','"function"','"'+String(t.fn)+'"'));break;case"requires":null==t.requires||Array.isArray(t.requires)||console.error(Me(Le,t.name,'"requires"','"array"','"'+String(t.requires)+'"'));break;case"requiresIfExists":Array.isArray(t.requiresIfExists)||console.error(Me(Le,t.name,'"requiresIfExists"','"array"','"'+String(t.requiresIfExists)+'"'));break;case"options":case"data":break;default:console.error('PopperJS: an invalid property has been provided to the "'+t.name+'" modifier, valid properties are '+_e.map((function(e){return'"'+e+'"'})).join(", ")+'; but "'+n+'" was provided.')}t.requires&&t.requires.forEach((function(n){null==e.find((function(e){return e.name===n}))&&console.error(Me('Popper: modifier "%s" requires "%s", but "%s" modifier is not available',String(t.name),n,n))}))}))}))}((a=[].concat(d,s.options.modifiers),c=function(e){return e.name},f=new Set,a.filter((function(e){var t=c(e);if(!f.has(t))return f.add(t),!0})))),Y(s.options.placement)===S)s.orderedModifiers.find((function(e){return"flip"===e.name}))||console.error(['Popper: "auto" placements require the "flip" modifier be',"present and enabled to work."].join(" "));var h=G(t);[h.marginTop,h.marginRight,h.marginBottom,h.marginLeft].some((function(e){return parseFloat(e)}))&&console.warn(['Popper: CSS "margin" styles cannot be used to apply padding',"between the popper and its reference element or boundary.","To replicate margin, use the `offset` modifier, as well as","the `padding` option in the `preventOverflow` and `flip`","modifiers."].join(" "))}return s.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,r=void 0===n?{}:n,o=e.effect;if("function"==typeof o){var i=o({state:s,name:t,instance:l,options:r}),a=function(){};u.push(i||a)}})),l.update()},forceUpdate:function(){if(!c){var e=s.elements,t=e.reference,n=e.popper;if(Ne(t,n)){s.rects={reference:Pe(t,Q(n),"fixed"===s.options.strategy),popper:K(n)},s.reset=!1,s.placement=s.options.placement,s.orderedModifiers.forEach((function(e){return s.modifiersData[e.name]=Object.assign({},e.data)}));for(var r=0,o=0;o<s.orderedModifiers.length;o++){if("production"!==process.env.NODE_ENV&&(r+=1)>100){console.error("Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.");break}if(!0!==s.reset){var i=s.orderedModifiers[o],a=i.fn,u=i.options,p=void 0===u?{}:u,f=i.name;"function"==typeof a&&(s=a({state:s,options:p,name:f,instance:l})||s)}else s.reset=!1,o=-1}}else"production"!==process.env.NODE_ENV&&console.error(De)}},update:(o=function(){return new Promise((function(e){l.forceUpdate(),e(s)}))},function(){return a||(a=new Promise((function(e){Promise.resolve().then((function(){a=void 0,e(o())}))}))),a}),destroy:function(){p(),c=!0}};if(!Ne(e,t))return"production"!==process.env.NODE_ENV&&console.error(De),l;function p(){u.forEach((function(e){return e()})),u=[]}return l.setOptions(n).then((function(e){!c&&n.onFirstUpdate&&n.onFirstUpdate(e)})),l}}var Ue=Be({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,i=void 0===o||o,a=r.resize,s=void 0===a||a,u=N(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&c.forEach((function(e){e.addEventListener("scroll",n.update,ue)})),s&&u.addEventListener("resize",n.update,ue),function(){i&&c.forEach((function(e){e.removeEventListener("scroll",n.update,ue)})),s&&u.removeEventListener("resize",n.update,ue)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=Oe({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=void 0===r||r,i=n.adaptive,a=void 0===i||i,s=n.roundOffsets,u=void 0===s||s;if("production"!==process.env.NODE_ENV){var c=G(t.elements.popper).transitionProperty||"";a&&["transform","top","right","bottom","left"].some((function(e){return c.indexOf(e)>=0}))&&console.warn(["Popper: Detected CSS transitions on at least one of the following",'CSS properties: "transform", "top", "right", "bottom", "left".',"\n\n",'Disable the "computeStyles" modifier\'s `adaptive` option to allow',"for smooth transitions, or remove these properties from the CSS","transition declaration on the popper element if only transitioning","opacity or background-color for example.","\n\n","We recommend using the popper element as a wrapper around an inner","element that can have any CSS property transitioned for animations."].join(" "))}var l={placement:Y(t.placement),variation:ie(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,se(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:u})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,se(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},C,Te,ke,je,oe,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=we(t,{elementContext:"reference"}),s=we(t,{altBoundary:!0}),u=Ie(a,r),c=Ie(s,o,i),l=Se(u),p=Se(c);t.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:c,isReferenceHidden:l,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":l,"data-popper-escaped":p})}}]});function Ve(e){return null==e}function Ce(e){if(Array.isArray(e))return!0;var t=Object.prototype.toString.call(e);return"[object"===t.substr(0,7)&&"Array]"===t.substr(-6)}function Ye(e){return null!==e&&/^\[object (Object|Module)\]/.test(Object.prototype.toString.call(e))}var qe=function(e){return("number"==typeof e||e instanceof Number)&&isFinite(+e)};function He(e){if(Ce(e))return e.map(He);if(Ye(e)){for(var t=Object.create(null),n=Object.keys(e),r=n.length,o=0;o<r;++o)t[n[o]]=He(e[n[o]]);return t}return e}function ze(e){return-1===["__proto__","prototype","constructor"].indexOf(e)}function We(e,t,n,r){if(ze(e)){var o=t[e],i=n[e];Ye(o)&&Ye(i)?Ke(o,i,r):t[e]=He(i)}}function Ke(e,t,n){var r=Ce(t)?t:[t],o=r.length;if(!Ye(e))return e;for(var i=(n=n||{}).merger||We,a=0;a<o;++a)if(Ye(t=r[a]))for(var s=Object.keys(t),u=0,c=s.length;u<c;++u)i(s[u],e,t,n);return e}function Fe(e,t){return Ke(e,t,{merger:Ge})}function Ge(e,t,n){if(ze(e)){var r=t[e],o=n[e];Ye(r)&&Ye(o)?Fe(r,o):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=He(o))}}function Xe(e){try{return e instanceof HTMLElement}catch(t){return"object"===h(e)&&1===e.nodeType&&"object"===h(e.style)&&"object"===h(e.ownerDocument)}}var Ze=function(){function e(t,n,r){var i;o(this,e),this.isShow=!1,this.trigger=void 0,this.instance=void 0,this.reference=void 0,this.referenceTarget=void 0,this.popperRefer=void 0,this.delay=50,this.isInnerPopper=!1,this.disabled=!1,this.afterShow=null,this.afterHidden=null,this.appendTo="parent",this.container=null,this.fixOnBoundary=!1,this.instanceOptions=this.initDefaultOptions(r),this.reference=this.resolveInputSelectorToHtmlElement(t),this.popperRefer=this.resolveInputSelectorToHtmlElement(n),this.referenceTarget=this.getTargetReferenceElement(),this.container=(this.popperRefer||{}).parentElement,this.isShow=!!(null===(i=this.instanceOptions)||void 0===i?void 0:i.isShow),this.trigger=this.instanceOptions.trigger,this.disabled=this.instanceOptions.disabled,this.appendTo=this.instanceOptions.appendTo,this.afterHidden="function"==typeof r.afterHidden?r.afterHidden:function(){},this.afterShow="function"==typeof r.afterShow?r.afterShow:function(){},this.fixOnBoundary=this.instanceOptions.fixOnBoundary,this.initInstance(),this.registerEvents(),this.isShow&&this.show(null)}return a(e,[{key:"forceUpdate",value:function(){var e;null===(e=this.instance)||void 0===e||e.forceUpdate()}},{key:"update",value:function(){var e;null===(e=this.instance)||void 0===e||e.update()}},{key:"updateOptions",value:function(e){var t;this.instanceOptions=this.initDefaultOptions(e),this.isShow=!!(null===(t=this.instanceOptions)||void 0===t?void 0:t.isShow),this.trigger=this.instanceOptions.trigger,this.disabled=this.instanceOptions.disabled,this.setOptions(this.instanceOptions)}},{key:"setOptions",value:function(e){var t;null===(t=this.instance)||void 0===t||t.setOptions(e)}},{key:"destroy",value:function(){var e;null===(e=this.instance)||void 0===e||e.destroy()}},{key:"updateDisabled",value:function(e){this.disabled=null!=e?e:!this.disabled,this.disabled&&this.hide()}},{key:"show",value:function(e){var t;this.disabled||(null===(t=this.popperRefer)||void 0===t||t.setAttribute("data-show",""),this.setOptions({modifiers:[].concat(O(this.instanceOptions.modifiers||[]),[{name:"eventListeners",enabled:!0}])}),this.update(),this.isShow=!0,this.afterShow(),this.fixOnBoundary||this.appendToTarget())}},{key:"hide",value:function(){var e;null===(e=this.popperRefer)||void 0===e||e.removeAttribute("data-show"),this.setOptions({modifiers:[].concat(O(this.instanceOptions.modifiers||[]),[{name:"eventListeners",enabled:!1}])}),this.isShow=!1,this.isInnerPopper=!1,this.afterHidden(),this.fixOnBoundary||this.restorePopContent()}},{key:"restorePopContent",value:function(){var e=this.getAppendToTarget();Xe(e)&&e.contains(this.popperRefer)&&this.container&&!this.container.contains(this.popperRefer)&&this.container.append(this.popperRefer)}},{key:"appendToTarget",value:function(){var e=this.getAppendToTarget();Xe(e)&&e.contains(this.popperRefer)&&e.append(this.popperRefer)}},{key:"getAppendToTarget",value:function(){var e=this.appendTo,t=e;return"parent"!==e&&"string"==typeof e&&(t=document.querySelector(e)),t}},{key:"initDefaultOptions",value:function(e){var t=this,n=Ke({placement:"top",modifiers:[{name:"offset",options:{offset:[0,8]}}],strategy:"absolute",onFirstUpdate:void 0,isShow:!1,theme:"dark",trigger:"hover",disabled:!1},e||{}),r=n.onFirstUpdate;return n.onFirstUpdate=function(e){"function"==typeof r&&(r.call(t,e),t.handleFirstUpdate())},n}},{key:"handleFirstUpdate",value:function(){this.fixOnBoundary&&this.appendToTarget()}},{key:"getTargetReferenceElement",value:function(){return this.isElement(this.reference)&&1===this.reference.childElementCount?this.reference.firstElementChild:this.reference}},{key:"initInstance",value:function(){var e,t;this.referenceTarget&&(this.referenceTarget&&this.popperRefer?(this.instance=Ue(this.referenceTarget,this.popperRefer,this.instanceOptions),null===(e=this.popperRefer)||void 0===e||e.setAttribute("data-theme",null!==(t=this.instanceOptions.theme)&&void 0!==t?t:"dark")):console.error("reference or popperRefer is null, please check html element."))}},{key:"resolveInputSelectorToHtmlElement",value:function(e){if(this.isElement(e))return e;if("string"==typeof e)return document.querySelector(e);if("object"===h(e)){if(Object.prototype.hasOwnProperty.call(e,"getBoundingClientRect"))return e}else console.error("'getBoundingClientRect' is needed when use virtual elements");return null}},{key:"isElement",value:function(e){return Xe(e)}},{key:"registerEvents",value:function(){var e=this;if(this.isElement(this.referenceTarget)&&"hover"===this.trigger){["mouseenter","focus"].forEach((function(t){e.referenceTarget.addEventListener(t,(function(n){"mouseenter"===t&&(e.isInnerPopper=!0),e.show(n)}))})),["mouseleave","blur"].forEach((function(t){e.referenceTarget.addEventListener(t,(function(){e.isInnerPopper=!1,setTimeout((function(){!e.isInnerPopper&&e.hide()}),e.delay)}))})),this.isElement(this.popperRefer)&&["mouseenter","mouseleave"].forEach((function(t){e.popperRefer.addEventListener(t,(function(){"mouseenter"===t&&(e.isInnerPopper=!0),"mouseleave"===t&&e.hide()}))}))}if("click"===this.trigger){["click"].forEach((function(t){document.body.addEventListener(t,(function(t){e.isSameElement(t.target,e.reference)||e.reference.contains(t.target)?e.show(t):e.isShow&&!e.isSameElement(t.target,e.popperRefer)&&e.hide()}))}))}}},{key:"isSameElement",value:function(e,t){return e&&(e===t||e===t.firstElementChild)}}]),e}(),Je="abcdefghijklmnopqrstuvwxyz0123456789",$e=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Je,n="",r=0;r<e;r++)n+=t[parseInt((Math.random()*t.length).toString(),10)];return n},Qe=function(){function e(t){o(this,e),this.multiInstance=!1,this.uniqueMaskAttrTag="",this.parentNode=document.body,this.activeInstance=void 0,this.zIndexStore=new Map,this.lastUUID=null,this.maskStyle={position:"absolute",left:0,top:0,bottom:0,right:0,display:"none","background-color":"rgba(0,0,0,.6)"};var n=t||{},r=n.multiInstance,i=void 0!==r&&r,a=n.maskAttrTag,s=void 0===a?"auto":a,u=n.parentNode,c=void 0===u?document.body:u,l=n.maskStyle,p=void 0===l?{}:l;this.activeInstance=void 0,this.multiInstance=i,this.uniqueMaskAttrTag=this.getMaskAttrTag(s),this.parentNode=c||document,this.mask=this.getMask(),this.backupMask=this.createMask("data-bk-backup-uid"),this.setMaskStyle(Object.assign({},this.maskStyle,p))}return a(e,[{key:"show",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i=null!=o?o:$e(16),a=/-?\d+/.test("".concat(t))?t:f.getModalNextIndex(),s=Object.assign({},this.maskStyle,r||{});if(!n&&this.lastUUID){var u=this.zIndexStore.get(this.lastUUID);s=u.style}this.storeMaskInsCfg({zIndex:a,style:Object.assign({},s),uuid:i,preUID:this.lastUUID}),this.setMaskStyle(s),this.mask.style.setProperty("display","block"),this.mask.style.setProperty("z-index","".concat(a)),this.backupMask.style.setProperty("z-index","".concat(a-1)),e&&(this.activeInstance=e,this.appendContentToMask(e))}},{key:"hide",value:function(e,t){var n,r=null!=t?t:this.lastUUID;this.mask.style.setProperty("display","none"),null==e||e.remove(),null===(n=this.activeInstance)||void 0===n||n.remove(),this.activeInstance=void 0,this.popIndexStore(r)}},{key:"storeMaskInsCfg",value:function(e){return this.zIndexStore.set(e.uuid,e),this.lastUUID=e.uuid,this.zIndexStore.get(e.uuid)}},{key:"popIndexStore",value:function(e){if(this.zIndexStore.has(e)){var t=this.zIndexStore.get(e);return this.lastUUID=t.preUID,this.zIndexStore.delete(e)}return this.lastUUID=null,!1}},{key:"backupActiveInstance",value:function(){this.activeInstance&&this.backupMask.append(this.activeInstance)}},{key:"backupContentElement",value:function(e){e&&this.backupMask.append(e)}},{key:"getActiveContentInstance",value:function(){return this.activeInstance}},{key:"getMask",value:function(){if(this.multiInstance)return this.createMask();var e=this.parentNode.querySelector("[data-bkmask-uid='".concat(this.uniqueMaskAttrTag,"']"));return e||(e=this.createMask()),e}},{key:"createMask",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"data-bk-mask-uid",t=document.createElement("div");return t.setAttribute(e,this.uniqueMaskAttrTag),this.parentNode.append(t),t}},{key:"setMaskStyle",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.mask&&Object.entries(t).forEach((function(t){return e.mask.style.setProperty(t[0],t[1])}))}},{key:"getMaskAttrTag",value:function(e){return/^(auto|\s+)$/i.test(e)||null==e||""===e?"__bk_mask_".concat($e(16)):e}},{key:"appendContentToMask",value:function(e){this.mask.append(e)}}]),e}(),et=new Qe({}),tt=function(){function e(){o(this,e),this.popInstanceList=[],this.uuidAttrName="data-bk-pop-uuid"}return a(e,[{key:"show",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e){var r=f.getModalNextIndex(),o=$e(16);e.setAttribute(this.uuidAttrName,o),this.popInstanceList.push({uuid:o,zIndex:r,content:e,showMask:t,appendStyle:n}),t&&et.backupActiveInstance(),et.show(e,r,t,n,o)}else console.warn("pop show error: content is null or undefined")}},{key:"popHide",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.popInstanceList.length){if(e){var t=this.popInstanceList.pop();et.popIndexStore(t.uuid),t.remove()}if(this.popInstanceList.length){var n=this.popInstanceList.slice(-1)[0],r=n.zIndex,o=n.content,i=n.showMask,a=n.appendStyle,s=n.uuid;et.show(o,r,i,a,s)}else et.hide()}}},{key:"hide",value:function(e){var t=null==e?void 0:e.getAttribute(this.uuidAttrName);if(t){var n=this.popInstanceList.findIndex((function(e){return e.uuid===t}));n>=0&&(this.popInstanceList[n].content.remove(),this.popInstanceList.splice(n,1),et.popIndexStore(t),this.popInstanceList.length?this.popHide(!1):et.hide())}else null==e||e.remove()}}]),e}(),nt=new tt,rt={exports:{}},ot={exports:{}};!function(e){function t(n,r){return e.exports=t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n,r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(ot),function(e){var t=ot.exports;e.exports=function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),n&&t(e,n)},e.exports.__esModule=!0,e.exports.default=e.exports}(rt);var it=n(rt.exports),at={exports:{}},st={exports:{}};!function(e){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports}(st),function(e){var t=d.exports.default,n=st.exports;e.exports=function(e,r){if(r&&("object"===t(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return n(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(at);var ut=n(at.exports),ct={exports:{}};!function(e){function t(n){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(ct);var lt=n(ct.exports);function pt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=lt(e);if(t){var o=lt(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return ut(this,n)}}var ft,dt,ht=t.createTypes({});e.Size=void 0,(ft=e.Size||(e.Size={})).Small="small",ft.Large="large",e.Placements=void 0,(dt=e.Placements||(e.Placements={})).Top="top",dt.Left="left",dt.Right="right",dt.Bottom="bottom";var vt,mt=function(e){it(r,e);var n=pt(r);function r(){return o(this,r),n.apply(this,arguments)}return a(r,null,[{key:"size",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["small","default","large"];return t.toType("Size",{type:String,validator:function(t){return!(t&&!e.includes(t))||(console.error("invalid size, ".concat(t,", the size must be one of 【").concat(e.join(" | "),"】")),!1)},default:"default"})}},{key:"theme",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["primary","warning","success","danger"];return t.toType("Theme",{type:String,validator:function(t){return!(t&&!e.includes(t))||(console.error("invalid theme, ".concat(t,", the theme must be one of 【").concat(e.join(" | "),"】")),!1)}})}},{key:"placement",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["top","left","right","bottom"];return t.toType("Placements",{type:String,validator:function(t){return!(t&&!e.includes(t))||(console.error("invalid placements, ".concat(t,", the placement must be one of 【").concat(e.join(" | "),"】")),!1)},default:"top"})}},{key:"commonType",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"commonType";return t.toType(n.replace(/^\S/,(function(e){return e.toUpperCase()})),{type:String,validator:function(t){var r=e.includes(t);return r||console.error("invalid ".concat(n,", ").concat(t,", the ").concat(n," must be one of 【").concat(e.join(" | "),"】")),r},default:e[0]})}},{key:"style",value:function(){return t.toType("Style",{type:[String,Object]})}},{key:"position",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["top-left","top-right","bottom-left","bottom-right"];return t.toType("positions",{type:String,validator:function(t){return!(t&&!e.includes(t))||(console.error("invalid positions, ".concat(t,", the position must be one of 【").concat(e.join(" | "),"】")),!1)},default:"top-center"})}}]),r}(ht);var yt=Object.create({});e.BKLAYERD_INDEX_EFAULT_VALUE=p,e.BKPopover=Ze,e.BkMaskManager=Qe,e.EMPTY_OBJ=yt,e.PropTypes=mt,e.bKMaskManager=et,e.bkPopIndexManager=nt,e.bkZIndexManager=f,e.classes=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.entries(e).filter((function(e){return e[1]})).map((function(e){return e[0]})).join(" ").concat(t?" ".concat(t):"")},e.clone=He,e.debounce=function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:300,r=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=function(){var i=this,a=arguments;if(e&&clearTimeout(e),o){var s=!e;e=setTimeout((function(){e=null}),n),s&&(t=r.apply(i,a))}else e=setTimeout((function(){r.apply(i,a)}),n);return t};return i.cancel=function(){clearTimeout(e),e=null},i},e.elementsEqual=function(e,t){var n,r,o,i;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(o=e[n],i=t[n],o.datasetIndex!==i.datasetIndex||o.index!==i.index)return!1;return!0},e.finiteOrDefault=function(e,t){return qe(e)?e:t},e.isArray=Ce,e.isElement=Xe,e.isEmpty=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return""===e||!!t&&Ve(e)},e.isEmptyObj=function(e){return Object.keys(e).length<1},e.isFinite=qe,e.isNullOrUndef=Ve,e.isObject=Ye,e.merge=Ke,e.mergeIf=Fe,e.mergerFn=We,e.mergerIfFn=Ge,e.noop=function(){},e.renderEmptyVNode=function(){return null},e.resolveClassName=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"bk";return"".concat(t,"-").concat(e)},e.scrollbarWidth=function(){if(void 0!==vt)return vt;var e=document.createElement("div");e.className="bk-scrollbar-wrap",e.style.visibility="hidden",e.style.width="100px",e.style.position="absolute",e.style.top="-9999px",document.body.appendChild(e);var t=e.offsetWidth;e.style.overflow="scroll";var n=document.createElement("div");n.style.width="100%",e.appendChild(n);var r=n.offsetWidth;return e.parentNode.removeChild(e),vt=t-r},e.stringEnum=function(e){return e.reduce((function(e,t){return e[t]=t,e}),Object.create(null))},e.throttle=function(e,t,n){var r,o,i,a=null,s=0;n||(n={});var u=function(){s=!1===n.leading?0:(new Date).getTime(),a=null,i=e.apply(r,o),a||(r=o=null)};return function(){var c=(new Date).getTime();s||!1!==n.leading||(s=c);var l=t-(c-s);return r=this,o=arguments,l<=0||l>t?(a&&(clearTimeout(a),a=null),s=c,i=e.apply(r,o),a||(r=o=null)):a||!1===n.trailing||(a=setTimeout(u,l)),i}},e.valueOrDefault=function(e,t){return void 0===e?t:e},e.withInstall=function(e){return e.install=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.prefix,o=t.config.globalProperties.bkUIPrefix||r||"Bk";t.component(o+e.name,e)},e},e.withInstallProps=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return e.install=function(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=o.prefix,a=r.config.globalProperties.bkUIPrefix||i||"Bk";r.component(a+e.name,e),!n&&Object.values(t).forEach((function(e){r.component(a+e.name,e)}))},Object.keys(t).forEach((function(n){e[n]=t[n]})),e},Object.defineProperty(e,"__esModule",{value:!0})}));
|
@@ -90,6 +90,10 @@ declare const propTypesNS: {
|
|
90
90
|
};
|
91
91
|
};
|
92
92
|
export declare type VueNode = VNodeChild | JSX.Element;
|
93
|
+
export declare type ElementType<T extends ReadonlyArray<unknown>> = T extends ReadonlyArray<infer ElementType> ? ElementType : never;
|
94
|
+
export declare function stringEnum<T extends string>(o: Array<T>): {
|
95
|
+
[K in T]: K;
|
96
|
+
};
|
93
97
|
export declare enum Size {
|
94
98
|
Small = "small",
|
95
99
|
Large = "large"
|
package/lib/tree/index.d.ts
CHANGED
@@ -10,7 +10,6 @@ declare const BkTree: {
|
|
10
10
|
indent: number;
|
11
11
|
levelLine: any;
|
12
12
|
virtualRender: boolean;
|
13
|
-
asyncLoad: (...args: any[]) => any;
|
14
13
|
}> & Omit<Readonly<import("vue").ExtractPropTypes<{
|
15
14
|
data: import("vue-types").VueTypeDef<any[]> & {
|
16
15
|
default: () => any[];
|
@@ -42,12 +41,11 @@ declare const BkTree: {
|
|
42
41
|
prefixIcon: import("vue-types").VueTypeDef<any> & {
|
43
42
|
default: any;
|
44
43
|
};
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
}>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "data" | "lineHeight" | "prefixIcon" | "children" | "indent" | "levelLine" | "virtualRender" | "asyncLoad">;
|
44
|
+
async: import("vue-types").VueTypeShape<{
|
45
|
+
callback: (item: any, cb: any) => Promise<any>;
|
46
|
+
cache: Boolean;
|
47
|
+
}>;
|
48
|
+
}>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "data" | "lineHeight" | "prefixIcon" | "children" | "indent" | "levelLine" | "virtualRender">;
|
51
49
|
$attrs: {
|
52
50
|
[x: string]: unknown;
|
53
51
|
};
|
@@ -92,11 +90,10 @@ declare const BkTree: {
|
|
92
90
|
prefixIcon: import("vue-types").VueTypeDef<any> & {
|
93
91
|
default: any;
|
94
92
|
};
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
};
|
93
|
+
async: import("vue-types").VueTypeShape<{
|
94
|
+
callback: (item: any, cb: any) => Promise<any>;
|
95
|
+
cache: Boolean;
|
96
|
+
}>;
|
100
97
|
}>>, {
|
101
98
|
renderData: import("vue").ComputedRef<any[]>;
|
102
99
|
flatData: {
|
@@ -118,7 +115,6 @@ declare const BkTree: {
|
|
118
115
|
indent: number;
|
119
116
|
levelLine: any;
|
120
117
|
virtualRender: boolean;
|
121
|
-
asyncLoad: (...args: any[]) => any;
|
122
118
|
}> & {
|
123
119
|
beforeCreate?: (() => void) | (() => void)[];
|
124
120
|
created?: (() => void) | (() => void)[];
|
@@ -170,11 +166,10 @@ declare const BkTree: {
|
|
170
166
|
prefixIcon: import("vue-types").VueTypeDef<any> & {
|
171
167
|
default: any;
|
172
168
|
};
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
};
|
169
|
+
async: import("vue-types").VueTypeShape<{
|
170
|
+
callback: (item: any, cb: any) => Promise<any>;
|
171
|
+
cache: Boolean;
|
172
|
+
}>;
|
178
173
|
}>> & import("vue").ShallowUnwrapRef<{
|
179
174
|
renderData: import("vue").ComputedRef<any[]>;
|
180
175
|
flatData: {
|
@@ -223,11 +218,10 @@ declare const BkTree: {
|
|
223
218
|
prefixIcon: import("vue-types").VueTypeDef<any> & {
|
224
219
|
default: any;
|
225
220
|
};
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
};
|
221
|
+
async: import("vue-types").VueTypeShape<{
|
222
|
+
callback: (item: any, cb: any) => Promise<any>;
|
223
|
+
cache: Boolean;
|
224
|
+
}>;
|
231
225
|
}>>, {
|
232
226
|
renderData: import("vue").ComputedRef<any[]>;
|
233
227
|
flatData: {
|
@@ -249,6 +243,5 @@ declare const BkTree: {
|
|
249
243
|
indent: number;
|
250
244
|
levelLine: any;
|
251
245
|
virtualRender: boolean;
|
252
|
-
asyncLoad: (...args: any[]) => any;
|
253
246
|
}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("@vue/runtime-core").Plugin;
|
254
247
|
export default BkTree;
|
package/lib/tree/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("vue"),require("crypto"),require("../icon/"),require("../shared"),require("../virtual-render")):"function"==typeof define&&define.amd?define(["exports","vue","crypto","../icon/","../shared","../virtual-render"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).bkuiVue={},e.Vue,e.require$$0,e._,e.Shared,e["@bkui-vue/virtual-render"])}(this,(function(e,n,t,r,o,i){"use strict";function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=u(t),a=u(i);function c(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var s={exports:{}};!function(e){function n(t){return e.exports=n="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},e.exports.__esModule=!0,e.exports.default=e.exports,n(t)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}(s);var d=c(s.exports),f={exports:{}};!function(e){e.exports=function(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e},e.exports.__esModule=!0,e.exports.default=e.exports}(f);var p=c(f.exports),v={exports:{}},y={exports:{}},h={exports:{}};!function(e){e.exports=function(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r},e.exports.__esModule=!0,e.exports.default=e.exports}(h),function(e){var n=h.exports;e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(y);var _={exports:{}};!function(e){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(_);var g={exports:{}};!function(e){var n=h.exports;e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports}(g);var x={exports:{}};!function(e){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports}(x),function(e){var n=y.exports,t=_.exports,r=g.exports,o=x.exports;e.exports=function(e){return n(e)||t(e)||r(e)||o()},e.exports.__esModule=!0,e.exports.default=e.exports}(v);for(var b=c(v.exports),m=l.default,O=function(){return m.randomBytes(16)},j=[],N=0;N<256;++N)j[N]=(N+256).toString(16).substr(1);var T,P,I=function(e,n){var t=n||0,r=j;return[r[e[t++]],r[e[t++]],r[e[t++]],r[e[t++]],"-",r[e[t++]],r[e[t++]],"-",r[e[t++]],r[e[t++]],"-",r[e[t++]],r[e[t++]],"-",r[e[t++]],r[e[t++]],r[e[t++]],r[e[t++]],r[e[t++]],r[e[t++]]].join("")},w=O,L=I,S=0,A=0;var C=function(e,n,t){var r=n&&t||0,o=n||[],i=(e=e||{}).node||T,u=void 0!==e.clockseq?e.clockseq:P;if(null==i||null==u){var l=w();null==i&&(i=T=[1|l[0],l[1],l[2],l[3],l[4],l[5]]),null==u&&(u=P=16383&(l[6]<<8|l[7]))}var a=void 0!==e.msecs?e.msecs:(new Date).getTime(),c=void 0!==e.nsecs?e.nsecs:A+1,s=a-S+(c-A)/1e4;if(s<0&&void 0===e.clockseq&&(u=u+1&16383),(s<0||a>S)&&void 0===e.nsecs&&(c=0),c>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");S=a,A=c,P=u;var d=(1e4*(268435455&(a+=122192928e5))+c)%4294967296;o[r++]=d>>>24&255,o[r++]=d>>>16&255,o[r++]=d>>>8&255,o[r++]=255&d;var f=a/4294967296*1e4&268435455;o[r++]=f>>>8&255,o[r++]=255&f,o[r++]=f>>>24&15|16,o[r++]=f>>>16&255,o[r++]=u>>>8|128,o[r++]=255&u;for(var p=0;p<6;++p)o[r+p]=i[p];return n||L(o)},k=O,M=I;var V=function(e,n,t){var r=n&&t||0;"string"==typeof e&&(n="binary"===e?new Array(16):null,e=null);var o=(e=e||{}).random||(e.rng||k)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,n)for(var i=0;i<16;++i)n[r+i]=o[i];return n||M(o)},q=C,R=V,D=R;D.v1=q,D.v4=R;var H=D,$=void 0,F="1px dashed #c3cdd7",E=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=e.data,o=e.children,i=[],u=0,l=new Map;function a(e){return(t||[]).some((function(n){return n.__uuid===e&&n.__isOpen}))}function c(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,s=0;s<e.length;s++){var f=e[s];if(Array.isArray(f))c(f,n,t,r);else if("object"===d(f)&&null!==f){var v=f.__uuid||H.v4(),y=a(v),h=null!==r?"".concat(r,"-").concat(s):"".concat(s),_=p({__depth:n,__index:s,__uuid:v,__parentId:t,__parentPath:r,__hasChild:!!(f[o]||[]).length,__path:h,__isRoot:null===t,__order:u,__isOpen:y},o,null);Object.assign(f,{__uuid:v}),l.set(v,_),u+=1,i.push(Object.assign(Object.assign({},f),p({},o,null))),Object.prototype.hasOwnProperty.call(f,o)&&c(f[o]||[],n+1,v,h)}}}return c(n||r),[i,l]},B=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[],u=e[n];return"boolean"==typeof u?u?r:o:U(t,e,n,i)},U=function(e,n,t){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=n[t];if("string"==typeof o)return"object"===d(e)&&null!==e?(Object.prototype.hasOwnProperty.call(e,o)||console.error("cannot find node label with key ".concat(o)),e[o]):o;if("function"==typeof o){var i=o.apply($,[e].concat(b(r)));return"string"==typeof i?i:void console.error("props label with function return value is not string, please check and return string")}},z=function(e,n){return U(e,n,"label")},G=function(e,n){return e.get(n)||{}},J=function(e,n,t){return(G(e,n)||{})[t]},K=function(e,n){return{"--level-line":B(n,"levelLine",e,F,null,["tree"]),"--lineHeight":"".concat(n.lineHeight,"px"),"--indent":"".concat(n.indent,"px"),padding:0}},Q=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t.levelLineSchema,o=t.schema,i=r[e.__uuid]||{},u=i.childNodeCount,l=void 0===u?0:u,a=i.isLeaf,c=void 0!==a&&a,s=i.lastNode,d=void 0===s?null:s,f=c?0:(r[d]||{childNodeCount:0}).childNodeCount,p=J(o,e.__uuid,"__depth");return Object.assign({"--depth":p,paddingLeft:0,"--lines":l-f},"function"==typeof n.levelLine?{"--level-line":B(n,"levelLine",e,F,null,["node"])}:{})},W=function(e,n,t){var r=G(n,e.__uuid)||{};return{"is-root":r.__isRoot,"bk-tree-node":!0,"is-open":r.__isOpen,"is-virtual-render":t.virtualRender}},X=function(e,n,t,r,o){var i=e.split("-").reduce((function(e,n){var r=Number(n);return Array.isArray(e)?e[r]:e[t][r]}),n);Object.assign(i,p({},r,o))},Y={data:o.PropTypes.arrayOf(o.PropTypes.any).def([]),label:o.PropTypes.oneOfType([o.PropTypes.func.def(void 0),o.PropTypes.string.def("label")]),children:o.PropTypes.string.def("children"),indent:o.PropTypes.number.def(18),lineHeight:o.PropTypes.number.def(32),levelLine:o.PropTypes.oneOfType([o.PropTypes.bool.def(!1),o.PropTypes.func.def(void 0),o.PropTypes.string.def("1px dashed #c3cdd7")]).def(!1),virtualRender:o.PropTypes.bool.def(!1),prefixIcon:o.PropTypes.oneOfType([o.PropTypes.func.def((function(){})),o.PropTypes.bool.def(!1)]).def(!0),asyncLoad:o.PropTypes.func.def(null)},Z=n.defineComponent({name:"Tree",props:Y,setup:function(e){var t=E(e),o=n.reactive({data:t[0],schema:t[1],levelLineSchema:{}});n.watch((function(){return[e.data]}),(function(n){console.log("props.data changed");var t=E(e,n,i.value);o.data=t[0],o.schema=t[1],b()}),{deep:!0}),n.watch((function(){return[e.levelLine]}),(function(){b()}));var i=n.computed((function(){return Array.from(o.schema.values())})),u=function(e){return o.schema.get(e)},l=function(e,n){var t;return null===(t=u(e.__uuid))||void 0===t?void 0:t[n]},a=function(e,n,t){return o.schema.set(e.__uuid,Object.assign(Object.assign({},u(e.__uuid)),p({},n,t)))},c=function(e){return l(e,"__path")},s=function(e){return l(e,"__isRoot")},f=function(e){return l(e,"__hasChild")},v=n.computed((function(){return o.data.filter((function(e){return m(e)}))})),y=n.computed((function(){return v.value.map((function(e){return c(e)}))})),h=function(e){var n;return"object"===d(e)?l(e,"__isOpen"):"string"==typeof e&&(null===(n=u(e))||void 0===n?void 0:n.__isOpen)},_=function(e){return h(e)?n.createVNode(r.FolderShapeOpen,{class:"bk-tree-icon"},null):n.createVNode(r.Folder,{class:"bk-tree-icon"},null)},g=function(e){if("string"==typeof e)return e;if("object"===d(e)&&null!==e){var t=e.node,r=e.className,o=e.text,i=e.style;return n.h(t,{class:r,style:i},o)}return null},x=function(n,t){if("object"===d(n)&&null!==n){a(t,"__isOpen",!0);var r=Array.isArray(n)?n:[n];X(c(t),e.data,e.children,e.children,r)}},b=function(){e.levelLine?setTimeout((function(){for(var e=v.value.length,n={},t=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];Object.prototype.hasOwnProperty.call(n,e)||Object.assign(n,p({},e,Object.assign(Object.assign({childNodeCount:0,isLastNode:!1},null!==t?{lastNode:t}:{}),null!==r?{isLeaf:r}:{})))};e>0;e--){var r=v.value[e-1],i=l(r,"__parentId"),u=c(r),a=!y.value.includes("".concat(u,"-0"));t(r.__uuid,null,a),t(i,r.__uuid);var s=n[i],d=n[r.__uuid],f=d.childNodeCount,h=void 0===f?0:f;d.childNodeCount=h+1,d.isLastNode=s.lastNode===r.__uuid,s.childNodeCount+=d.childNodeCount}o.levelLineSchema=n})):o.levelLineSchema={}},m=function(e){return s(e)||h(e)||h(l(e,"__parentId"))};return b(),{renderData:v,flatData:o,hanldeTreeNodeClick:function(n){n.async&&("function"==typeof e.asyncLoad?(Object.assign(n,{loading:!0}),e.asyncLoad(n,(function(e){return x(e,n)})).then((function(e){return x(e,n)})).catch((function(e){return console.error("load remote data error:",e)})).finally((function(){X(c(n),e.data,e.children,"loading",!1)}))):console.error("async need to set prop: asyncLoad with function wich will return promise object")),f(n)&&function(e){var n=!h(e);a(e,"__isOpen",n),b()}(n)},getActionIcon:function(t){var o=null;return"function"==typeof e.prefixIcon&&"default"!==(o=e.prefixIcon(s(t),f(t)||t.async,h(t),"action",t))?g(o):("default"===o||"boolean"==typeof e.prefixIcon&&e.prefixIcon)&&(f(t)||t.async)?h(t)?n.createVNode(r.DownShape,null,null):n.createVNode(r.RightShape,null,null):null},getRootIcon:_,getVirtualLines:function(t){if(!e.virtualRender)return null;var r=l(t,"__depth")+1;return new Array(r).fill("").map((function(e,n){return n})).filter((function(e){return function(e,n){if(s(n))return!1;var t=c(n),r="".concat(t).split("-").slice(0,e+1);if(r.join("-")===t)return!0;var o=r.pop(),u=parseInt(o,10);r.push("".concat(u+1));var l=r.join("-");return i.value.some((function(e){return e.__path===l}))}(e,t)})).filter((function(e){return e>0})).map((function(e){return n.createVNode("span",{class:"node-virtual-line",style:(t=r-e,{"--depth":t})},null);var t}))},getNodePrefixIcon:function(t){var o=null;return"function"==typeof e.prefixIcon&&"default"!==(o=e.prefixIcon(s(t),f(t)||t.async,h(t),"node_type",t))?g(o):"default"===o||"boolean"==typeof e.prefixIcon&&e.prefixIcon?s(t)?_(t):n.createVNode(r.TextFile,{class:"bk-tree-icon"},null):null},getLoadingIcon:function(e){return e.loading?n.createVNode(r.Spinner,null,null):""}}},render:function(){var e=this,t=this.$props,r=function(r){return n.createVNode("div",{class:W(r,e.flatData.schema,t),style:Q(r,t,e.flatData),onClick:function(){return e.hanldeTreeNodeClick(r)}},[[e.getActionIcon(r),e.getNodePrefixIcon(r),e.getLoadingIcon(r)],n.createVNode("span",null,[z(r,t)]),e.getVirtualLines(r)])};return n.createVNode(a.default,{class:"bk-tree",style:K(null,t),list:this.renderData,lineHeight:t.lineHeight,enabled:t.virtualRender},{default:function(e){return(e.data||[]).map(r)}})}}),ee=o.withInstall(Z);e.default=ee,Object.defineProperty(e,"__esModule",{value:!0})}));
|
1
|
+
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("vue"),require("crypto"),require("../icon/"),require("../shared"),require("../virtual-render")):"function"==typeof define&&define.amd?define(["exports","vue","crypto","../icon/","../shared","../virtual-render"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).bkuiVue={},e.Vue,e.require$$0,e._,e.Shared,e["@bkui-vue/virtual-render"])}(this,(function(e,n,t,r,o,i){"use strict";function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=u(t),a=u(i);function c(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var s={exports:{}};!function(e){function n(t){return e.exports=n="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},e.exports.__esModule=!0,e.exports.default=e.exports,n(t)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}(s);var f=c(s.exports),p={exports:{}};!function(e){e.exports=function(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e},e.exports.__esModule=!0,e.exports.default=e.exports}(p);var d=c(p.exports),v={exports:{}},y={exports:{}},h={exports:{}};!function(e){e.exports=function(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r},e.exports.__esModule=!0,e.exports.default=e.exports}(h),function(e){var n=h.exports;e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(y);var _={exports:{}};!function(e){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(_);var x={exports:{}};!function(e){var n=h.exports;e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports}(x);var b={exports:{}};!function(e){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports}(b),function(e){var n=y.exports,t=_.exports,r=x.exports,o=b.exports;e.exports=function(e){return n(e)||t(e)||r(e)||o()},e.exports.__esModule=!0,e.exports.default=e.exports}(v);for(var g=c(v.exports),m=l.default,O=function(){return m.randomBytes(16)},T=[],j=0;j<256;++j)T[j]=(j+256).toString(16).substr(1);var P,I,w=function(e,n){var t=n||0,r=T;return[r[e[t++]],r[e[t++]],r[e[t++]],r[e[t++]],"-",r[e[t++]],r[e[t++]],"-",r[e[t++]],r[e[t++]],"-",r[e[t++]],r[e[t++]],"-",r[e[t++]],r[e[t++]],r[e[t++]],r[e[t++]],r[e[t++]],r[e[t++]]].join("")},A=O,S=w,k=0,N=0;var M=function(e,n,t){var r=n&&t||0,o=n||[],i=(e=e||{}).node||P,u=void 0!==e.clockseq?e.clockseq:I;if(null==i||null==u){var l=A();null==i&&(i=P=[1|l[0],l[1],l[2],l[3],l[4],l[5]]),null==u&&(u=I=16383&(l[6]<<8|l[7]))}var a=void 0!==e.msecs?e.msecs:(new Date).getTime(),c=void 0!==e.nsecs?e.nsecs:N+1,s=a-k+(c-N)/1e4;if(s<0&&void 0===e.clockseq&&(u=u+1&16383),(s<0||a>k)&&void 0===e.nsecs&&(c=0),c>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");k=a,N=c,I=u;var f=(1e4*(268435455&(a+=122192928e5))+c)%4294967296;o[r++]=f>>>24&255,o[r++]=f>>>16&255,o[r++]=f>>>8&255,o[r++]=255&f;var p=a/4294967296*1e4&268435455;o[r++]=p>>>8&255,o[r++]=255&p,o[r++]=p>>>24&15|16,o[r++]=p>>>16&255,o[r++]=u>>>8|128,o[r++]=255&u;for(var d=0;d<6;++d)o[r+d]=i[d];return n||S(o)},V=O,L=w;var q=function(e,n,t){var r=n&&t||0;"string"==typeof e&&(n="binary"===e?new Array(16):null,e=null);var o=(e=e||{}).random||(e.rng||V)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,n)for(var i=0;i<16;++i)n[r+i]=o[i];return n||L(o)},C=M,D=q,R=D;R.v1=C,R.v4=D;var H=R,$=void 0,E="1px dashed #c3cdd7",F=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=e.data,o=e.children,i=[],u=0,l=new Map;function a(e){return(t||[]).some((function(n){return n.__uuid===e&&n.__isOpen}))}function c(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,s=0;s<e.length;s++){var p=e[s];if(Array.isArray(p))c(p,n,t,r);else if("object"===f(p)&&null!==p){var v=p.__uuid||H.v4(),y=a(v),h=null!==r?"".concat(r,"-").concat(s):"".concat(s),_=d({__depth:n,__index:s,__uuid:v,__parentId:t,__parentPath:r,__hasChild:!!(p[o]||[]).length,__path:h,__isRoot:null===t,__order:u,__isOpen:y},o,null);Object.assign(p,{__uuid:v}),l.set(v,_),u+=1,i.push(Object.assign(Object.assign({},p),d({},o,null))),Object.prototype.hasOwnProperty.call(p,o)&&c(p[o]||[],n+1,v,h)}}}return c(n||r),[i,l]},B=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[],u=e[n];return"boolean"==typeof u?u?r:o:U(t,e,n,i)},U=function(e,n,t){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=n[t];if("string"==typeof o)return"object"===f(e)&&null!==e?(Object.prototype.hasOwnProperty.call(e,o)||console.error("cannot find node label with key ".concat(o)),e[o]):o;if("function"==typeof o){var i=o.apply($,[e].concat(g(r)));return"string"==typeof i?i:void console.error("props label with function return value is not string, please check and return string")}},W=function(e,n){return U(e,n,"label")},z=function(e,n){return e.get(n)||{}},G=function(e,n,t){var r;return null===(r=z(e,n))||void 0===r?void 0:r[t]},J=function(e,n){return{"--level-line":B(n,"levelLine",e,E,null,["tree"]),"--lineHeight":"".concat(n.lineHeight,"px"),"--indent":"".concat(n.indent,"px"),padding:0}},K=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t.schema,o=G(r,e.__uuid,"__depth");return Object.assign({"--depth":o,paddingLeft:0},"function"==typeof n.levelLine?{"--level-line":B(n,"levelLine",e,E,null,["node"])}:{})},Q=function(e,n,t){var r=z(n,e.__uuid)||{};return{"is-root":r.__isRoot,"bk-tree-node":!0,"is-open":r.__isOpen,"is-virtual-render":t.virtualRender,"level-line":t.levelLine}},X=function(e,n,t,r){var o=e.split("-").reduce((function(e,n){var r=Number(n);return Array.isArray(e)?e[r]:e[t][r]}),n);Object.assign(o,r||{})},Y={data:o.PropTypes.arrayOf(o.PropTypes.any).def([]),label:o.PropTypes.oneOfType([o.PropTypes.func.def(void 0),o.PropTypes.string.def("label")]),children:o.PropTypes.string.def("children"),indent:o.PropTypes.number.def(18),lineHeight:o.PropTypes.number.def(32),levelLine:o.PropTypes.oneOfType([o.PropTypes.bool.def(!1),o.PropTypes.func.def(void 0),o.PropTypes.string.def("1px dashed #c3cdd7")]).def(!1),virtualRender:o.PropTypes.bool.def(!1),prefixIcon:o.PropTypes.oneOfType([o.PropTypes.func.def((function(){})),o.PropTypes.bool.def(!1)]).def(!0),async:o.PropTypes.shape({callback:o.PropTypes.func.def(null),cache:o.PropTypes.bool.def(!0)})},Z=n.defineComponent({name:"Tree",props:Y,setup:function(e){var t=F(e),o=n.reactive({data:t[0],schema:t[1],levelLineSchema:{}});n.watch((function(){return[e.data]}),(function(n){console.log("props.data changed");var t=F(e,n,i.value);o.data=t[0],o.schema=t[1]}),{deep:!0});var i=n.computed((function(){return Array.from(o.schema.values())})),u=function(e){return o.schema.get(e)},l=function(e,n){var t;return null===(t=u(e.__uuid))||void 0===t?void 0:t[n]},a=function(e,n,t){return o.schema.set(e.__uuid,Object.assign(Object.assign({},u(e.__uuid)),d({},n,t)))},c=function(e){return l(e,"__path")},s=function(e){return l(e,"__isRoot")},p=function(e){return l(e,"__hasChild")},v=n.computed((function(){return o.data.filter((function(e){return b(e)}))})),y=function(e){var n;return"object"===f(e)?l(e,"__isOpen"):"string"==typeof e&&(null===(n=u(e))||void 0===n?void 0:n.__isOpen)},h=function(e){return y(e)?n.createVNode(r.FolderShapeOpen,{class:"bk-tree-icon"},null):n.createVNode(r.Folder,{class:"bk-tree-icon"},null)},_=function(e){if("string"==typeof e)return e;if("object"===f(e)&&null!==e){var t=e.node,r=e.className,o=e.text,i=e.style;return n.h(t,{class:r,style:i},o)}return null},x=function(n,t){if("object"===f(n)&&null!==n){a(t,"__isOpen",!0);var r=Array.isArray(n)?n:[n];!function(e,n,t,r,o){X(e,n,t,d({},r,o))}(c(t),e.data,e.children,e.children,r)}},b=function(e){return s(e)||y(e)||y(l(e,"__parentId"))};return{renderData:v,flatData:o,hanldeTreeNodeClick:function(n){if(n.async){var t=e.async||{},r=t.callback,o=void 0===r?null:r,i=t.cache,u=void 0===i||i;"function"!=typeof o||n.cached?console.error("async need to set prop: asyncLoad with function wich will return promise object"):(Object.assign(n,{loading:!0}),o(n,(function(e){return x(e,n)})).then((function(e){return x(e,n)})).catch((function(e){return console.error("load remote data error:",e)})).finally((function(){X(c(n),e.data,e.children,Object.assign({loading:!1},u?{cached:!0}:{}))})))}p(n)&&function(e){var n=!y(e);a(e,"__isOpen",n),n||v.value.filter((function(n){return String.prototype.startsWith.call(c(n),c(e))})).forEach((function(e){return a(e,"__isOpen",n)}))}(n)},getActionIcon:function(t){var o=null;return"function"==typeof e.prefixIcon&&"default"!==(o=e.prefixIcon(s(t),p(t)||t.async,y(t),"action",t))?_(o):("default"===o||"boolean"==typeof e.prefixIcon&&e.prefixIcon)&&(p(t)||t.async)?y(t)?n.createVNode(r.DownShape,null,null):n.createVNode(r.RightShape,null,null):null},getRootIcon:h,getVirtualLines:function(t){if(!e.levelLine)return null;var r=l(t,"__depth")+1;return new Array(r).fill("").map((function(e,n){return n})).filter((function(e){return function(e,n){if(s(n))return!1;var t=c(n),r="".concat(t).split("-").slice(0,e+1);if(r.join("-")===t)return!0;var o=r.pop(),u=parseInt(o,10);r.push("".concat(u+1));var l=r.join("-");return i.value.some((function(e){return e.__path===l}))}(e,t)})).filter((function(e){return e>0})).map((function(e){return n.createVNode("span",{class:"node-virtual-line",style:(t=r-e,{"--depth":t})},null);var t}))},getNodePrefixIcon:function(t){var o=null;return"function"==typeof e.prefixIcon&&"default"!==(o=e.prefixIcon(s(t),p(t)||t.async,y(t),"node_type",t))?_(o):"default"===o||"boolean"==typeof e.prefixIcon&&e.prefixIcon?s(t)?h(t):n.createVNode(r.TextFile,{class:"bk-tree-icon"},null):null},getLoadingIcon:function(e){return e.loading?n.createVNode(r.Spinner,null,null):""}}},render:function(){var e=this,t=this.$props,r=function(r){return n.createVNode("div",{class:Q(r,e.flatData.schema,t),style:K(r,t,e.flatData),onClick:function(){return e.hanldeTreeNodeClick(r)}},[[e.getActionIcon(r),e.getNodePrefixIcon(r),e.getLoadingIcon(r)],n.createVNode("span",null,[W(r,t)]),e.getVirtualLines(r)])};return n.createVNode(a.default,{class:"bk-tree",style:J(null,t),list:this.renderData,lineHeight:t.lineHeight,enabled:t.virtualRender,throttleDelay:0},{default:function(e){return(e.data||[]).map(r)}})}}),ee=o.withInstall(Z);e.default=ee,Object.defineProperty(e,"__esModule",{value:!0})}));
|
package/lib/tree/props.d.ts
CHANGED
@@ -67,14 +67,15 @@ export declare const treeProps: {
|
|
67
67
|
default: any;
|
68
68
|
};
|
69
69
|
/**
|
70
|
-
*
|
71
|
-
*
|
72
|
-
*
|
70
|
+
* 异步加载节点数据配置
|
71
|
+
* @param callback 请求数据回调函数,函数返回 Promise
|
72
|
+
* @param cache 是否缓存请求结果,默认为True,只有在第一次才会发起请求,若设置为false则每次都会发起请求
|
73
73
|
*/
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
74
|
+
async: import("vue-types").VueTypeShape<AsyncOption>;
|
75
|
+
};
|
76
|
+
declare type AsyncOption = {
|
77
|
+
callback: (item: any, cb: any) => Promise<any>;
|
78
|
+
cache: Boolean;
|
79
79
|
};
|
80
80
|
export declare type TreePropTypes = Readonly<ExtractPropTypes<typeof treeProps>>;
|
81
|
+
export {};
|
package/lib/tree/tree.css
CHANGED
@@ -5,21 +5,10 @@
|
|
5
5
|
line-height: var(--lineHeight);
|
6
6
|
cursor: pointer;
|
7
7
|
}
|
8
|
-
.bk-tree .bk-tree-node.is-open:not(.is-virtual-render)::after {
|
9
|
-
position: absolute;
|
10
|
-
top: calc(var(--lineHeight) / 2 + 6px);
|
11
|
-
left: 6px;
|
12
|
-
z-index: 1;
|
13
|
-
width: 0;
|
14
|
-
height: calc(var(--lines) * var(--lineHeight) - 6px);
|
15
|
-
pointer-events: none;
|
16
|
-
border-left: var(--level-line);
|
17
|
-
content: '';
|
18
|
-
}
|
19
8
|
.bk-tree .bk-tree-node:not(.is-root) {
|
20
9
|
margin-left: calc(var(--depth)*var(--indent));
|
21
10
|
}
|
22
|
-
.bk-tree .bk-tree-node:not(.is-root)::before {
|
11
|
+
.bk-tree .bk-tree-node:not(.is-root).level-line::before {
|
23
12
|
position: absolute;
|
24
13
|
top: calc(50% + 1px);
|
25
14
|
left: calc(0px - var(--indent) + 6px);
|
package/lib/tree/tree.d.ts
CHANGED
@@ -31,11 +31,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
31
31
|
prefixIcon: import("vue-types").VueTypeDef<any> & {
|
32
32
|
default: any;
|
33
33
|
};
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
};
|
34
|
+
async: import("vue-types").VueTypeShape<{
|
35
|
+
callback: (item: any, cb: any) => Promise<any>;
|
36
|
+
cache: Boolean;
|
37
|
+
}>;
|
39
38
|
}, {
|
40
39
|
renderData: import("vue").ComputedRef<any[]>;
|
41
40
|
flatData: {
|
@@ -80,11 +79,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
80
79
|
prefixIcon: import("vue-types").VueTypeDef<any> & {
|
81
80
|
default: any;
|
82
81
|
};
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
};
|
82
|
+
async: import("vue-types").VueTypeShape<{
|
83
|
+
callback: (item: any, cb: any) => Promise<any>;
|
84
|
+
cache: Boolean;
|
85
|
+
}>;
|
88
86
|
}>>, {
|
89
87
|
data: any[];
|
90
88
|
lineHeight: number;
|
@@ -93,6 +91,5 @@ declare const _default: import("vue").DefineComponent<{
|
|
93
91
|
indent: number;
|
94
92
|
levelLine: any;
|
95
93
|
virtualRender: boolean;
|
96
|
-
asyncLoad: (...args: any[]) => any;
|
97
94
|
}>;
|
98
95
|
export default _default;
|
package/lib/tree/tree.less
CHANGED
@@ -6,38 +6,24 @@
|
|
6
6
|
line-height: var(--lineHeight);
|
7
7
|
cursor: pointer;
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
&:not(.is-root) {
|
10
|
+
margin-left: calc(var(--depth)*var(--indent));
|
11
|
+
|
12
|
+
&.level-line {
|
13
|
+
&::before {
|
12
14
|
position: absolute;
|
13
|
-
top: calc(
|
14
|
-
left: 6px;
|
15
|
+
top: calc(50% + 1px);
|
16
|
+
left: calc(0px - var(--indent) + 6px);
|
15
17
|
z-index: 1;
|
16
|
-
width:
|
17
|
-
height:
|
18
|
+
width: calc(var(--indent) - 6px);
|
19
|
+
height: 0;
|
18
20
|
pointer-events: none;
|
19
|
-
border-
|
21
|
+
border-bottom: var(--level-line);
|
20
22
|
content: '';
|
21
23
|
}
|
22
24
|
}
|
23
25
|
}
|
24
26
|
|
25
|
-
&:not(.is-root) {
|
26
|
-
margin-left: calc(var(--depth)*var(--indent));
|
27
|
-
|
28
|
-
&::before {
|
29
|
-
position: absolute;
|
30
|
-
top: calc(50% + 1px);
|
31
|
-
left: calc(0px - var(--indent) + 6px);
|
32
|
-
z-index: 1;
|
33
|
-
width: calc(var(--indent) - 6px);
|
34
|
-
height: 0;
|
35
|
-
pointer-events: none;
|
36
|
-
border-bottom: var(--level-line);
|
37
|
-
content: '';
|
38
|
-
}
|
39
|
-
}
|
40
|
-
|
41
27
|
.node-virtual-line {
|
42
28
|
display: inline-block;
|
43
29
|
position: absolute;
|
@@ -5,21 +5,10 @@
|
|
5
5
|
line-height: var(--lineHeight);
|
6
6
|
cursor: pointer;
|
7
7
|
}
|
8
|
-
.bk-tree .bk-tree-node.is-open:not(.is-virtual-render)::after {
|
9
|
-
position: absolute;
|
10
|
-
top: calc(var(--lineHeight) / 2 + 6px);
|
11
|
-
left: 6px;
|
12
|
-
z-index: 1;
|
13
|
-
width: 0;
|
14
|
-
height: calc(var(--lines) * var(--lineHeight) - 6px);
|
15
|
-
pointer-events: none;
|
16
|
-
border-left: var(--level-line);
|
17
|
-
content: '';
|
18
|
-
}
|
19
8
|
.bk-tree .bk-tree-node:not(.is-root) {
|
20
9
|
margin-left: calc(var(--depth)*var(--indent));
|
21
10
|
}
|
22
|
-
.bk-tree .bk-tree-node:not(.is-root)::before {
|
11
|
+
.bk-tree .bk-tree-node:not(.is-root).level-line::before {
|
23
12
|
position: absolute;
|
24
13
|
top: calc(50% + 1px);
|
25
14
|
left: calc(0px - var(--indent) + 6px);
|
package/lib/tree/util.d.ts
CHANGED
@@ -33,7 +33,6 @@ export declare const getNodeItemStyle: (item: any, props: TreePropTypes, flatDat
|
|
33
33
|
'--level-line'?: any;
|
34
34
|
'--depth': any;
|
35
35
|
paddingLeft: number;
|
36
|
-
'--lines': number;
|
37
36
|
};
|
38
37
|
/**
|
39
38
|
* 获取当前渲染节点Class List
|
@@ -45,6 +44,7 @@ export declare const getNodeItemClass: (item: any, schema: any, props: TreePropT
|
|
45
44
|
'bk-tree-node': boolean;
|
46
45
|
'is-open': any;
|
47
46
|
'is-virtual-render': boolean;
|
47
|
+
'level-line': any;
|
48
48
|
};
|
49
49
|
/**
|
50
50
|
* 根据路径更新指定节点Child-Data
|
@@ -55,3 +55,11 @@ export declare const getNodeItemClass: (item: any, schema: any, props: TreePropT
|
|
55
55
|
* @param nodeValue 节点值
|
56
56
|
*/
|
57
57
|
export declare const updateTreeNode: (path: string, treeData: any[], childKey: string, nodekey: string, nodeValue: any) => void;
|
58
|
+
/**
|
59
|
+
* 根据路径更新指定节点Child-Data
|
60
|
+
* @param path 节点路径
|
61
|
+
* @param treeData Tree Data
|
62
|
+
* @param childKey Child Key
|
63
|
+
* @param assignVal value
|
64
|
+
*/
|
65
|
+
export declare const assignTreeNode: (path: string, treeData: any[], childKey: string, assignVal: any) => void;
|