bkui-vue 0.0.1-beta.119 → 0.0.1-beta.121
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/dist/index.cjs.js +8 -8
- package/dist/index.esm.js +14 -0
- package/dist/index.umd.js +8 -8
- package/dist/style.css +1 -1
- package/lib/affix/affix.variable.css +4 -1
- package/lib/affix/index.js +1 -1
- package/lib/alert/alert.variable.css +4 -1
- package/lib/alert/index.js +1 -1
- package/lib/animate-number/index.js +1 -1
- package/lib/backtop/backtop.variable.css +4 -1
- package/lib/backtop/index.js +1 -1
- package/lib/badge/badge.variable.css +4 -1
- package/lib/badge/index.js +1 -1
- package/lib/breadcrumb/breadcrumb.variable.css +4 -1
- package/lib/breadcrumb/index.js +1 -1
- package/lib/button/button.css +9 -0
- package/lib/button/button.d.ts +10 -0
- package/lib/button/button.less +12 -1
- package/lib/button/button.variable.css +13 -1
- package/lib/button/index.d.ts +16 -1
- package/lib/button/index.js +1 -1
- package/lib/card/card.variable.css +4 -1
- package/lib/card/index.js +1 -1
- package/lib/cascader/cascader.variable.css +4 -1
- package/lib/cascader/index.js +1 -1
- package/lib/checkbox/checkbox.variable.css +4 -1
- package/lib/checkbox/index.js +1 -1
- package/lib/code-diff/code-diff.variable.css +4 -1
- package/lib/code-diff/index.js +1 -1
- package/lib/collapse/collapse.variable.css +4 -1
- package/lib/collapse/index.js +1 -1
- package/lib/components.js +1 -1
- package/lib/container/container.variable.css +4 -1
- package/lib/container/index.js +1 -1
- package/lib/date-picker/date-picker.variable.css +4 -1
- package/lib/date-picker/index.js +1 -1
- package/lib/dialog/dialog.css +5 -1
- package/lib/dialog/dialog.less +6 -1
- package/lib/dialog/dialog.variable.css +5 -1
- package/lib/dialog/index.js +1 -1
- package/lib/directives/index.js +1 -1
- package/lib/dist.index.js +1 -1
- package/lib/divider/divider.variable.css +4 -1
- package/lib/divider/index.js +1 -1
- package/lib/dropdown/dropdown.variable.css +4 -1
- package/lib/dropdown/index.js +1 -1
- package/lib/exception/exception.variable.css +4 -1
- package/lib/exception/index.js +1 -1
- package/lib/fixed-navbar/fixed-navbar.variable.css +4 -1
- package/lib/fixed-navbar/index.js +1 -1
- package/lib/form/form.variable.css +4 -1
- package/lib/form/index.js +1 -1
- package/lib/icon/angle-double-down-line.js +1 -1
- package/lib/icon/angle-double-left-line.js +1 -1
- package/lib/icon/angle-double-left.js +1 -1
- package/lib/icon/angle-double-right-line.js +1 -1
- package/lib/icon/angle-double-right.js +1 -1
- package/lib/icon/angle-double-up-line.js +1 -1
- package/lib/icon/angle-down-fill.js +1 -1
- package/lib/icon/angle-down-line.js +1 -1
- package/lib/icon/angle-down.js +1 -1
- package/lib/icon/angle-left.js +1 -1
- package/lib/icon/angle-right.js +1 -1
- package/lib/icon/angle-up-fill.js +1 -1
- package/lib/icon/angle-up.js +1 -1
- package/lib/icon/archive-fill.js +1 -1
- package/lib/icon/arrows-left.js +1 -1
- package/lib/icon/arrows-right.js +1 -1
- package/lib/icon/audio-fill.js +1 -1
- package/lib/icon/bk.js +1 -1
- package/lib/icon/circle.js +1 -1
- package/lib/icon/close-line.js +1 -1
- package/lib/icon/close.js +1 -1
- package/lib/icon/code.js +1 -1
- package/lib/icon/cog-shape.js +1 -1
- package/lib/icon/collapse-left.js +1 -1
- package/lib/icon/copy.js +1 -1
- package/lib/icon/data-shape.js +1 -1
- package/lib/icon/del.js +1 -1
- package/lib/icon/doc-fill.js +1 -1
- package/lib/icon/done.js +1 -1
- package/lib/icon/down-shape.js +1 -1
- package/lib/icon/down-small.js +1 -1
- package/lib/icon/edit-line.js +1 -1
- package/lib/icon/ellipsis.js +1 -1
- package/lib/icon/error.js +1 -1
- package/lib/icon/excel-fill.js +1 -1
- package/lib/icon/exclamation-circle-shape.js +1 -1
- package/lib/icon/eye.js +1 -1
- package/lib/icon/folder-open.js +1 -1
- package/lib/icon/folder-shape-open.js +1 -1
- package/lib/icon/folder-shape.js +1 -1
- package/lib/icon/funnel.js +1 -1
- package/lib/icon/help-document-fill.js +1 -1
- package/lib/icon/help-fill.js +1 -1
- package/lib/icon/help.js +1 -1
- package/lib/icon/image-fill.js +1 -1
- package/lib/icon/index.js +1 -1
- package/lib/icon/info-line.js +1 -1
- package/lib/icon/info.js +1 -1
- package/lib/icon/left-shape.js +1 -1
- package/lib/icon/pdf-fill.js +1 -1
- package/lib/icon/play-shape.js +1 -1
- package/lib/icon/plus.js +1 -1
- package/lib/icon/ppt-fill.js +1 -1
- package/lib/icon/qq.js +1 -1
- package/lib/icon/right-shape.js +1 -1
- package/lib/icon/search.js +1 -1
- package/lib/icon/share.js +1 -1
- package/lib/icon/spinner.js +1 -1
- package/lib/icon/success.js +1 -1
- package/lib/icon/switcher-loading.js +1 -1
- package/lib/icon/text-file.js +1 -1
- package/lib/icon/text-fill.js +1 -1
- package/lib/icon/tree-application-shape.js +1 -1
- package/lib/icon/unvisible.js +1 -1
- package/lib/icon/up-shape.js +1 -1
- package/lib/icon/upload.js +1 -1
- package/lib/icon/video-fill.js +1 -1
- package/lib/icon/warn.js +1 -1
- package/lib/icon/weixin.js +1 -1
- package/lib/index.js +1 -1
- package/lib/input/index.js +1 -1
- package/lib/input/input.css +99 -15
- package/lib/input/input.less +83 -18
- package/lib/input/input.variable.css +102 -15
- package/lib/link/index.js +1 -1
- package/lib/link/link.variable.css +4 -1
- package/lib/loading/index.js +1 -1
- package/lib/loading/loading.variable.css +4 -1
- package/lib/menu/index.js +1 -1
- package/lib/menu/menu.variable.css +4 -1
- package/lib/menu/submenu.variable.css +4 -1
- package/lib/message/index.js +1 -1
- package/lib/message/message.variable.css +4 -1
- package/lib/modal/index.js +1 -1
- package/lib/navigation/index.js +1 -1
- package/lib/navigation/navigation.variable.css +4 -1
- package/lib/notify/index.js +1 -1
- package/lib/notify/notify.variable.css +4 -1
- package/lib/pagination/index.js +1 -1
- package/lib/pagination/pagination.variable.css +4 -1
- package/lib/popover/index.js +1 -1
- package/lib/popover/popover.variable.css +4 -1
- package/lib/popover2/index.js +1 -1
- package/lib/popover2/popover2.variable.css +4 -1
- package/lib/preset.js +1 -1
- package/lib/process/index.js +1 -1
- package/lib/process/process.variable.css +4 -1
- package/lib/progress/index.js +1 -1
- package/lib/progress/progress.variable.css +4 -1
- package/lib/radio/index.js +1 -1
- package/lib/radio/radio.variable.css +4 -1
- package/lib/rate/index.js +1 -1
- package/lib/resize-layout/index.js +1 -1
- package/lib/resize-layout/resize-layout.variable.css +4 -1
- package/lib/select/index.js +1 -1
- package/lib/select/select.variable.css +4 -1
- package/lib/shared/index.js +1 -1
- package/lib/sideslider/index.js +1 -1
- package/lib/sideslider/sideslider.variable.css +4 -1
- package/lib/slider/index.js +1 -1
- package/lib/slider/slider.variable.css +4 -1
- package/lib/steps/index.js +1 -1
- package/lib/steps/steps.variable.css +4 -1
- package/lib/styles/themes/themes.less +6 -1
- package/lib/swiper/index.js +1 -1
- package/lib/switcher/index.js +1 -1
- package/lib/switcher/switcher.variable.css +4 -1
- package/lib/tab/index.js +1 -1
- package/lib/tab/tab.variable.css +4 -1
- package/lib/table/index.js +1 -1
- package/lib/table/plugins/head-filter.variable.css +4 -1
- package/lib/table/plugins/head-sort.variable.css +4 -1
- package/lib/table/plugins/settings.variable.css +4 -1
- package/lib/table/table.variable.css +4 -1
- package/lib/tag/index.js +1 -1
- package/lib/tag/tag.variable.css +4 -1
- package/lib/tag-input/index.js +1 -1
- package/lib/tag-input/tag-input.variable.css +4 -1
- package/lib/timeline/index.js +1 -1
- package/lib/timeline/timeline.variable.css +4 -1
- package/lib/transfer/index.js +1 -1
- package/lib/transfer/transfer.variable.css +4 -1
- package/lib/tree/index.d.ts +4 -4
- package/lib/tree/index.js +1 -1
- package/lib/tree/tree.d.ts +1 -1
- package/lib/tree/tree.variable.css +4 -1
- package/lib/upload/index.js +1 -1
- package/lib/upload/upload.variable.css +4 -1
- package/lib/virtual-render/index.js +1 -1
- package/package.json +1 -1
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
import*as e from"../shared";import*as t from"vue";import*as a from"../icon";var i={d:(e,t)=>{for(var a in t)i.o(t,a)&&!i.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},l={};i.d(l,{Z:()=>d});const n=(o={PropTypes:()=>e.PropTypes,withInstall:()=>e.withInstall},u={},i.d(u,o),u);var o,u;function s(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const r=(e=>{var t={};return i.d(t,e),t})({computed:()=>t.computed,createVNode:()=>t.createVNode,defineComponent:()=>t.defineComponent,nextTick:()=>t.nextTick,onBeforeUnmount:()=>t.onBeforeUnmount,onMounted:()=>t.onMounted,ref:()=>t.ref,toRefs:()=>t.toRefs,vShow:()=>t.vShow,withDirectives:()=>t.withDirectives,withModifiers:()=>t.withModifiers}),c=(e=>{var t={};return i.d(t,e),t})({AngleLeft:()=>a.AngleLeft}),v=(0,r.defineComponent)({name:"ResizeLayout",props:{placement:n.PropTypes.placement().def("left"),min:n.PropTypes.number.def(3),max:n.PropTypes.number.def(1/0),triggerWidth:n.PropTypes.number.def(5),triggerOffset:n.PropTypes.number.def(3),initialDivide:n.PropTypes.oneOfType([String,Number]).def("20%"),immediate:n.PropTypes.bool,disabled:n.PropTypes.bool,collapsible:n.PropTypes.bool,autoMinimize:n.PropTypes.oneOfType([Boolean,Number]).def(!1),border:n.PropTypes.bool.def(!0)},emits:["before-resize","resizing","after-resize","collapse-change"],setup:function(e,t){var a=t.emit,i=(0,r.toRefs)(e),l=i.placement,n=i.initialDivide,o=i.triggerOffset,u=i.triggerWidth,c=i.max,v=i.min,d=i.immediate,f=i.autoMinimize,p=(0,r.ref)(!1),m=(0,r.ref)(!0),h=(0,r.ref)(!1),b=(0,r.ref)(null),y=(0,r.ref)({}),g=(0,r.ref)(null),z=(0,r.ref)(null),w=(0,r.ref)(null),k=(0,r.ref)(null),x=(0,r.computed)((function(){return["left","right"].includes(l.value)})),P=(0,r.computed)((function(){return x.value?"width":"height"})),R=(0,r.computed)((function(){var e=n.value;return"number"==typeof e&&(e="".concat(e,"px")),s({},P.value,e)})),T=(0,r.computed)((function(){var e;return s(e={},"margin-".concat(l.value),"".concat(o.value-u.value,"px")),s(e,P.value,"".concat(u.value,"px")),e})),M=(0,r.computed)((function(){return f.value?"boolean"==typeof f.value?50:f.value:0})),C=new ResizeObserver((function(){var e=g.value.getBoundingClientRect();b.value=x.value?e.width:e.height})),L=function(){var e=k.value.getBoundingClientRect();N(!p.value),p.value?(k.value.setAttribute("data-".concat(P.value),"".concat(e[P.value],"px")),k.value.style[P.value]="5px"):(m.value=!0,k.value.style[P.value]=k.value.getAttribute("data-".concat(P.value)))},N=function(e){k.value.addEventListener("transitionend",(function t(){m.value=e,k.value.style.transition="",k.value.removeEventListener("transitionend",t)})),k.value.style.transition="".concat(P.value," cubic-bezier(0.4, 0, 0.2, 1) .3s")};return(0,r.onMounted)((function(){C.observe(g.value)})),(0,r.onBeforeUnmount)((function(){C.unobserve(g.value)})),{collapsed:p,asideContentVisible:m,minimized:h,limitMax:b,state:y,vertical:x,cssPropKey:P,bkResizeLayoutRef:g,resizeProxyRef:z,resizeMaskRef:w,asideRef:k,triggerStyle:T,asideStyle:R,handleMousedown:function(e){a("before-resize",e);var t=k.value.getBoundingClientRect();y.value=Object.freeze({mouse:{clientX:e.clientX,clientY:e.clientY},aside:{width:t.width,height:t.height}}),w.value.style.display="block",w.value.style.cursor=x.value?"col-resize":"row-resize",d.value||function(){switch(z.value.style.visibility="visible",l.value){case"left":z.value.style.inset="0 auto auto ".concat(y.value.aside.width,"px");break;case"right":z.value.style.inset="0 ".concat(y.value.aside.width,"px auto auto");break;case"top":z.value.style.inset="".concat(y.value.aside.height,"px auto auto 0");break;case"bottom":z.value.style.inset="auto auto ".concat(y.value.aside.height,"px 0")}}(),document.onselectstart=function(){return!1},document.ondragstart=function(){return!1};var i=function(e){var t;switch(l.value){case"top":t=e.clientY-y.value.mouse.clientY;break;case"right":t=y.value.mouse.clientX-e.clientX;break;case"bottom":t=y.value.mouse.clientY-e.clientY;break;case"left":t=e.clientX-y.value.mouse.clientX}var i,n=(i=y.value.aside[P.value]+t,Math.min(c.value,Math.max(v.value,i),b.value-u.value)+o.value),s="".concat(n,"px");d.value?k.value.style[P.value]=s:z.value.style[l.value]=s,a("resizing",n)};document.addEventListener("mousemove",i),document.addEventListener("mouseup",(function e(){if(z.value.style.visibility="hidden",w.value.style.display="none",document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",e),document.onselectstart=null,document.ondragstart=null,(0,r.nextTick)((function(){(function(){if(!f.value)return!1;var e=k.value.getBoundingClientRect();if(h.value=p.value=e[P.value]<=M.value,!h.value)return m.value=!0,!1;L(),(0,r.nextTick)((function(){k.value.setAttribute("data-".concat(P.value),R.value[P.value])}))})(),a("after-resize",parseFloat(z.value.style[l.value]))})),d.value)return!1;k.value.style[P.value]=z.value.style[l.value]}))},setCollapse:function(e){p.value="boolean"==typeof e?e:!p.value,L(),a("collapse-change",p.value)}}},render:function(){var e,t,a,i,l,n,o=["bk-resize-layout","bk-resize-layout-".concat(this.placement),{"bk-resize-layout-collapsed":this.collapsed,"bk-resize-layout-border":this.border}];return(0,r.createVNode)("div",{ref:"bkResizeLayoutRef",class:o},[(0,r.createVNode)("aside",{class:"bk-resize-layout-aside",ref:"asideRef",style:this.asideStyle},[(0,r.withDirectives)((0,r.createVNode)("div",{class:"bk-resize-layout-aside-content"},[null===(t=(e=this.$slots).aside)||void 0===t?void 0:t.call(e)]),[[r.vShow,this.asideContentVisible]]),(0,r.withDirectives)((0,r.createVNode)("i",{class:"bk-resize-trigger",style:this.triggerStyle,onMousedown:(0,r.withModifiers)(this.handleMousedown,["left"])},null),[[r.vShow,!this.disabled&&(!this.collapsed||this.autoMinimize)]]),(0,r.withDirectives)((0,r.createVNode)("i",{class:["bk-resize-proxy",this.placement],ref:"resizeProxyRef"},null),[[r.vShow,!this.collapsed||this.autoMinimize]]),this.collapsible&&((null===(i=(a=this.$slots)["collapse-trigger"])||void 0===i?void 0:i.call(a))||(0,r.createVNode)(c.AngleLeft,{class:"bk-resize-collapse",onClick:this.setCollapse},null))]),(0,r.createVNode)("main",{class:"bk-resize-layout-main"},[null===(n=(l=this.$slots).main)||void 0===n?void 0:n.call(l)]),(0,r.createVNode)("div",{class:"bk-resize-mask",ref:"resizeMaskRef"},null)])}}),d=(0,n.withInstall)(v);var f=l.Z;export{f as default};
|
@@ -32,7 +32,8 @@
|
|
32
32
|
--input-broder-radius: 3px;
|
33
33
|
--input-shadow-color: #a3c5fd;
|
34
34
|
--input-horizontal-padding: 10px;
|
35
|
-
--input-block-color: #
|
35
|
+
--input-block-color: #f5f7fa;
|
36
|
+
--input-block-hover-color: #eaebf0;
|
36
37
|
--input-icon-size: var(--font-size-large);
|
37
38
|
--input-maxlength-color: #979ba5;
|
38
39
|
--button-primary-hover-color: #5594fa;
|
@@ -44,6 +45,8 @@
|
|
44
45
|
--button-danger-active-color: #db2626;
|
45
46
|
--button-success-active-color: #1ab943;
|
46
47
|
--button-warning-active-color: #eb9000;
|
48
|
+
--button-selected-bg-color: #e1ecff;
|
49
|
+
--button-disabled-selected-bg-color: #f0f1f5;
|
47
50
|
--fixed-navbar-background: #fff;
|
48
51
|
--fixed-navbar-boxshadow-color: rgba(0, 0, 0, 0.1);
|
49
52
|
--switch-default-color: #fff;
|
package/lib/select/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("../shared"),require("vue"),require("../icon"),require("lodash"),require("../directives"),require("../input"),require("../loading"),require("../popover2"),require("../tag"));else if("function"==typeof define&&define.amd)define(["../shared","vue","../icon","lodash","../directives","../input","../loading","../popover2","../tag"],t);else{var n="object"==typeof exports?t(require("../shared"),require("vue"),require("../icon"),require("lodash"),require("../directives"),require("../input"),require("../loading"),require("../popover2"),require("../tag")):t(e["../shared"],e.vue,e["../icon"],e.lodash,e["../directives"],e["../input"],e["../loading"],e["../popover2"],e["../tag"]);for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(self,((e,t,n,r,o,l,i,a,u)=>(()=>{var s={7162:(e,t,n)=>{e.exports=n(5047)},5047:e=>{var t=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},l=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",a=o.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function s(e,t,n,r){var o=t&&t.prototype instanceof g?t:g,l=Object.create(o.prototype),i=new C(r||[]);return l._invoke=function(e,t,n){var r=p;return function(o,l){if(r===v)throw new Error("Generator is already running");if(r===f){if("throw"===o)throw l;return j()}for(n.method=o,n.arg=l;;){var i=n.delegate;if(i){var a=S(i,n);if(a){if(a===h)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===p)throw r=f,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=v;var u=c(e,t,n);if("normal"===u.type){if(r=n.done?f:d,u.arg===h)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=f,n.method="throw",n.arg=u.arg)}}}(e,n,i),l}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=s;var p="suspendedStart",d="suspendedYield",v="executing",f="completed",h={};function g(){}function y(){}function b(){}var m={};u(m,l,(function(){return this}));var w=Object.getPrototypeOf,x=w&&w(w(L([])));x&&x!==n&&r.call(x,l)&&(m=x);var T=b.prototype=g.prototype=Object.create(m);function P(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function O(e,t){function n(o,l,i,a){var u=c(e[o],e,l);if("throw"!==u.type){var s=u.arg,p=s.value;return p&&"object"==typeof p&&r.call(p,"__await")?t.resolve(p.__await).then((function(e){n("next",e,i,a)}),(function(e){n("throw",e,i,a)})):t.resolve(p).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,a)}))}a(u.arg)}var o;this._invoke=function(e,r){function l(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(l,l):l()}}function S(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,S(e,n),"throw"===n.method))return h;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var o=c(r,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,h;var l=o.arg;return l?l.done?(n[e.resultName]=l.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,h):l:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}function V(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(V,this),this.reset(!0)}function L(e){if(e){var n=e[l];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}return{next:j}}function j(){return{value:t,done:!0}}return y.prototype=b,u(T,"constructor",b),u(b,"constructor",y),y.displayName=u(b,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,u(e,a,"GeneratorFunction")),e.prototype=Object.create(T),e},e.awrap=function(e){return{__await:e}},P(O.prototype),u(O.prototype,i,(function(){return this})),e.AsyncIterator=O,e.async=function(t,n,r,o,l){void 0===l&&(l=Promise);var i=new O(s(t,n,r,o),l);return e.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},P(T),u(T,a,"Generator"),u(T,l,(function(){return this})),u(T,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=L,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(k),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return a.type="throw",a.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var l=this.tryEntries.length-1;l>=0;--l){var i=this.tryEntries[l],a=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(u&&s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var l=o;break}}l&&("break"===e||"continue"===e)&&l.tryLoc<=t&&t<=l.finallyLoc&&(l=null);var i=l?l.completion:{};return i.type=e,i.arg=t,l?(this.method="next",this.next=l.finallyLoc,h):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;k(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:L(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),h}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},4061:e=>{"use strict";e.exports=o},6870:e=>{"use strict";e.exports=n},8133:e=>{"use strict";e.exports=l},4870:e=>{"use strict";e.exports=i},6175:e=>{"use strict";e.exports=a},4212:t=>{"use strict";t.exports=e},7739:e=>{"use strict";e.exports=u},467:e=>{"use strict";e.exports=r},748:e=>{"use strict";e.exports=t}},c={};function p(e){var t=c[e];if(void 0!==t)return t.exports;var n=c[e]={exports:{}};return s[e](n,n.exports,p),n.exports}p.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return p.d(t,{a:t}),t},p.d=(e,t)=>{for(var n in t)p.o(t,n)&&!p.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},p.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),p.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var d={};return(()=>{"use strict";p.r(d),p.d(d,{BkOption:()=>c,BkOptionGroup:()=>h,BkSelect:()=>L,default:()=>j});var e=p(4212),t=p(748),n=p(6870),r=p(7162),o=p.n(r);Object.create,Object.create;var l=Symbol("BkSelect"),i=Symbol("BkOptionGroup");function a(e){return{register:function(t,n){if(n){if(!e.value.has(t))return e.value.set(t,n);console.warn("repeat ".concat(t),n)}},unregister:function(t){e.value.delete(t)}}}function u(e,n){var r=this,l=function(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200,o=e;return(0,t.customRef)((function(e,t){return{get:function(){return e(),o},set:function(e){clearTimeout(n),void 0===e||""===e?(o=e,t()):n=setTimeout((function(){o=e,t()}),r)}}}))}(""),i=(0,t.ref)(!1);return(0,t.watch)(l,(function(){return t=r,a=void 0,u=void 0,s=o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,i.value=!0,t.next=4,e(l.value);case 4:i.value=!1,t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),console.error(t.t0);case 10:return t.prev=10,null==n||n(),t.finish(10);case 13:case"end":return t.stop()}}),t,null,[[0,7,10,13]])})),new(u||(u=Promise))((function(e,n){function r(e){try{l(s.next(e))}catch(e){n(e)}}function o(e){try{l(s.throw(e))}catch(e){n(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof u?n:new u((function(e){e(n)}))).then(r,o)}l((s=s.apply(t,a||[])).next())}));var t,a,u,s})),{searchKey:l,searchLoading:i}}function s(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e?String(e).trim().toLowerCase():e}const c=(0,t.defineComponent)({name:"Option",props:{value:e.PropTypes.any,label:e.PropTypes.string.def(""),disabled:e.PropTypes.bool.def(!1)},setup:function(e){var n=(0,t.getCurrentInstance)().proxy,r=(0,t.reactive)({visible:!0}),o=(0,t.toRefs)(e),a=o.disabled,u=o.value,s=(0,t.inject)(l,null),c=(0,t.inject)(i,null),p=(0,t.computed)((function(){var e;return null===(e=null==s?void 0:s.selected)||void 0===e?void 0:e.some((function(e){return e.value===u.value}))})),d=(0,t.computed)((function(){return null==s?void 0:s.multiple})),v=(0,t.computed)((function(){return(null==s?void 0:s.activeOptionValue)===u.value}));return(0,t.onBeforeMount)((function(){null==s||s.register(u.value,n),null==c||c.register(u.value,n)})),(0,t.onBeforeUnmount)((function(){null==s||s.unregister(u.value),null==c||c.unregister(u.value)})),Object.assign(Object.assign({},(0,t.toRefs)(r)),{selected:p,multiple:d,isHover:v,handleOptionClick:function(){a.value||null==s||s.handleOptionSelected(n)},handleMouseEnter:function(){s.activeOptionValue=u.value}})},render:function(){var r,o,l,i=(0,e.classes)({"is-selected":this.selected,"is-disabled":this.disabled,"is-multiple":this.multiple,"is-hover":this.isHover,"bk-select-option":!0});return(0,t.withDirectives)((0,t.createVNode)("li",{class:i,onClick:this.handleOptionClick,onMouseenter:this.handleMouseEnter},[null!==(l=null===(o=(r=this.$slots).default)||void 0===o?void 0:o.call(r))&&void 0!==l?l:(0,t.createVNode)("span",{class:"bk-select-option-item"},[this.label,this.multiple&&this.selected&&(0,t.createVNode)(n.Done,{width:22,height:22},null)])]),[[t.vShow,this.visible]])}});function v(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}function f(e){return function(e){if(Array.isArray(e))return v(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return v(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?v(e,t):void 0}}(e)||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.")}()}const h=(0,t.defineComponent)({name:"Group",props:{label:e.PropTypes.string.def(""),disabled:e.PropTypes.bool.def(!1),collapsible:e.PropTypes.bool.def(!1),collapse:e.PropTypes.bool.def(!1)},setup:function(e,n){var r=n.emit,o=(0,t.getCurrentInstance)(),u=o.proxy,s=(0,t.inject)(l,null),c=(0,t.reactive)({groupCollapse:e.collapse,visible:!0}),p=(0,t.ref)(new Map),d=a(p),v=d.register,h=d.unregister,g=(0,t.computed)((function(){return"".concat(e.label," (").concat(f(p.value.values()).filter((function(e){return e.visible})).length,")")}));return(0,t.provide)(i,(0,t.reactive)(Object.assign(Object.assign({},(0,t.toRefs)(e)),{register:v,unregister:h,groupCollapse:(0,t.toRef)(c,"groupCollapse")}))),(0,t.onBeforeMount)((function(){null==s||s.registerGroup(o.uid,u)})),(0,t.onBeforeUnmount)((function(){null==s||s.unregisterGroup(o.uid)})),Object.assign(Object.assign({},(0,t.toRefs)(c)),{groupLabel:g,handleToggleCollapse:function(){e.collapsible&&!e.disabled&&(c.groupCollapse=!c.groupCollapse,r("update:collapse",c.groupCollapse))}})},render:function(){var r,o,l=(0,e.classes)({"bk-option-group":!0,collapsible:this.collapsible,disabled:this.disabled}),i=(0,e.classes)({"bk-option-group-label":!0,collapsible:this.collapsible}),a=(0,e.classes)({"default-group-label-icon":!0,collapse:this.groupCollapse});return(0,t.withDirectives)((0,t.createVNode)("ul",{class:l},[(0,t.createVNode)("li",{class:i,onClick:this.handleToggleCollapse},[this.$slots.label?this.$slots.label():(0,t.createVNode)("span",{class:"default-group-label"},[this.collapsible&&(0,t.createVNode)(n.AngleUpFill,{class:a},null),(0,t.createVNode)("span",{class:"default-group-label-title"},[this.groupLabel])])]),(0,t.withDirectives)((0,t.createVNode)("ul",{class:"bk-option-group-content"},[null===(o=(r=this.$slots).default)||void 0===o?void 0:o.call(r)]),[[t.vShow,!this.groupCollapse]])]),[[t.vShow,this.visible]])}});function g(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var y=p(467),b=p(4061),m=p(8133),w=p.n(m),x=p(4870),T=p.n(x),P=p(6175),O=p.n(P),S=p(7739),V=p.n(S);const k=(0,t.defineComponent)({name:"SelectTagInput",props:{selected:{type:Array,default:function(){return[]}},tagTheme:e.PropTypes.theme(["success","info","warning","danger"]).def(""),placeholder:e.PropTypes.string.def(""),filterable:e.PropTypes.bool.def(!1),allowCreate:e.PropTypes.bool.def(!1),modelValue:e.PropTypes.any},emits:["update:modelValue","remove","focus","enter"],setup:function(e,n){var r=n.emit,o=(0,t.inject)(l,null),i=(0,t.toRefs)(e).modelValue,a=(0,t.ref)(i.value),u=(0,t.ref)();(0,t.watch)(i,(function(){a.value=i.value}));var s=null==o?void 0:o.handleGetLabelByValue;return{value:a,inputRef:u,handleRemoveTag:function(e){r("remove",e)},handleFocus:function(){r("focus")},focus:function(){var e;null===(e=u.value)||void 0===e||e.focus()},handleInput:function(e){r("update:modelValue",e.target.value)},handleKeydown:function(e){"Enter"===e.code&&r("enter",e.target.value,e)},handleGetLabelByValue:s}},render:function(){var e,n,r,o,l=this;return(0,t.createVNode)("div",{class:"bk-select-tag"},[null===(n=null===(e=this.$slots)||void 0===e?void 0:e.prefix)||void 0===n?void 0:n.call(e),this.selected.map((function(e){var n,r;return(0,t.createVNode)(V(),{closable:!0,theme:l.tagTheme,onClose:function(){return l.handleRemoveTag(e.value)}},"function"==typeof(r=n=l.handleGetLabelByValue(e))||"[object Object]"===Object.prototype.toString.call(r)&&!(0,t.isVNode)(r)?n:{default:function(){return[n]}})})),(0,t.withDirectives)((0,t.createVNode)("input",{class:"bk-select-tag-input",ref:"inputRef",type:"text",placeholder:this.selected.length?"":this.placeholder,readonly:!this.filterable,"onUpdate:modelValue":function(e){return l.value=e},onFocus:this.handleFocus,onInput:this.handleInput,onKeydown:this.handleKeydown},null),[[t.vModelText,l.value]]),null===(o=null===(r=this.$slots)||void 0===r?void 0:r.suffix)||void 0===o?void 0:o.call(r)])}}),C=(0,t.defineComponent)({name:"Select",directives:{clickoutside:b.clickoutside},props:{modelValue:e.PropTypes.any,multiple:e.PropTypes.bool.def(!1),disabled:e.PropTypes.bool.def(!1),size:e.PropTypes.size().def("default"),clearable:e.PropTypes.bool.def(!0),loading:e.PropTypes.bool.def(!1),filterable:e.PropTypes.bool.def(!1),remoteMethod:e.PropTypes.func,scrollHeight:e.PropTypes.number.def(216),showSelectAll:e.PropTypes.bool.def(!1),popoverMinWidth:e.PropTypes.number.def(0),showOnInit:e.PropTypes.bool.def(!1),multipleMode:e.PropTypes.oneOf(["default","tag"]).def("default"),tagTheme:e.PropTypes.theme(["success","info","warning","danger"]).def(""),behavior:e.PropTypes.oneOf(["normal","simplicity"]).def("normal"),collapseTags:e.PropTypes.bool.def(!1),noDataText:e.PropTypes.string.def("无数据"),noMatchText:e.PropTypes.string.def("无匹配数据"),loadingText:e.PropTypes.string.def("加载中..."),placeholder:e.PropTypes.string.def("请选择"),selectAllText:e.PropTypes.string.def("全部"),scrollLoading:e.PropTypes.bool.def(!1),allowCreate:e.PropTypes.bool.def(!1),popoverOptions:e.PropTypes.object.def({}),customContent:e.PropTypes.bool.def(!1)},emits:["update:modelValue","change","toggle","clear","scroll-end","focus","blur"],setup:function(n,r){var o=r.emit,i=(0,t.toRefs)(n),c=i.modelValue,p=i.disabled,d=i.filterable,v=i.multiple,h=i.remoteMethod,g=i.loading,y=i.loadingText,b=i.noDataText,m=i.noMatchText,w=i.popoverMinWidth,x=i.showOnInit,T=i.multipleMode,P=i.allowCreate,O=i.customContent,S=(0,e.useFormItem)(),V=(0,t.ref)(),k=(0,t.ref)(),C=(0,t.ref)(),L=(0,t.ref)(new Map),j=(0,t.computed)((function(){return f(L.value.values())})),N=(0,t.ref)(new Map),E=(0,t.ref)([]),I=(0,t.ref)();(0,t.watch)(c,(function(){he()}),{deep:!0});var M=(0,t.computed)((function(){return p.value||g.value})),A=(0,t.computed)((function(){return E.value.map((function(e){return fe(e)}))})),R=(0,t.computed)((function(){var e=j.value.reduce((function(e,t){return t.disabled||e.push(t.value),e}),[]);return e.length<=E.value.length&&e.every((function(e){return E.value.some((function(t){return t.value===e}))}))})),G=(0,t.computed)((function(){return!!N.value.size})),H=(0,t.computed)((function(){return!j.value.length})),_=(0,t.computed)((function(){return j.value.length&&j.value.every((function(e){return!e.visible}))})),q=(0,t.computed)((function(){return d.value&&"function"==typeof h.value})),F=(0,t.computed)((function(){return!(ce.value||H.value||_.value)||O.value})),D=(0,t.computed)((function(){return ce.value?y.value:H.value?b.value:_.value?m.value:""})),B=a(L),K=B.register,$=B.unregister,z=a(N),U=z.register,W=z.unregister,Y=function(){var e=(0,t.ref)(!1);return{isHover:e,setHover:function(){e.value=!0},cancelHover:function(){e.value=!1}}}(),J=Y.isHover,Q=Y.setHover,X=Y.cancelHover,Z=(0,t.ref)(!1),ee=function(n,r){var o=n.popoverMinWidth,l=null,i=(0,t.ref)("auto"),a=(0,t.ref)(!1),u=function(){var e;i.value=Math.max(null===(e=r.value)||void 0===e?void 0:e.offsetWidth,o)};return(0,t.onMounted)((function(){r.value&&(l=(0,e.observerResize)(r.value,u,60,!0)).start()})),(0,t.onBeforeUnmount)((function(){null==l||l.stop(),l=null})),{isPopoverShow:a,popperWidth:i,togglePopover:function(){a.value=!a.value},hidePopover:function(){a.value=!1},showPopover:function(){a.value=!0}}}({popoverMinWidth:w.value},k),te=ee.popperWidth,ne=ee.isPopoverShow,re=ee.hidePopover,oe=ee.showPopover,le=ee.togglePopover,ie=(0,t.computed)((function(){return(d.value||P.value)&&ne.value}));(0,t.watch)(ne,(function(e){e?(ve(),ae()):se.value=""}));var ae=function(){var e,t=E.value[0],n=L.value.get(null==t?void 0:t.value);n&&!n.disabled&&n.visible?I.value=null==t?void 0:t.value:I.value=null===(e=j.value.find((function(e){return!e.disabled&&e.visible})))||void 0===e?void 0:e.value},ue=u(q.value?h.value:function(e){d.value&&j.value.forEach((function(t){var n;t.visible=null===(n=s(String(t.label)))||void 0===n?void 0:n.includes(s(e))}))},ae),se=ue.searchKey,ce=ue.searchLoading,pe=function(e){var t;e!==c.value&&(o("change",e),o("update:modelValue",e),null===(t=null==S?void 0:S.validate)||void 0===t||t.call(S,"change"))},de=function(e){if(!M.value&&e){if(v.value){var t=E.value.findIndex((function(t){return t.value===e.value}));t>-1?E.value.splice(t,1):E.value.push({value:e.value,label:e.label||e.value}),pe(E.value.map((function(e){return e.value})))}else E.value=[{label:e.label||e.value,value:e.value}],pe(e.value),re();ve()}},ve=function(){var e,t;"tag"===T.value?null===(e=C.value)||void 0===e||e.focus():null===(t=V.value)||void 0===t||t.focus()},fe=function(e){var t,n;return(null===(n=null===(t=L.value)||void 0===t?void 0:t.get(e.value))||void 0===n?void 0:n.label)||e.label||e.value},he=function(){Array.isArray(c.value)?E.value=f(c.value.map((function(e){return{value:e,label:e}}))):void 0!==c.value&&(E.value=[{value:c.value,label:c.value}])};return(0,t.provide)(l,(0,t.reactive)({multiple:v,selected:E,activeOptionValue:I,register:K,unregister:$,registerGroup:U,unregisterGroup:W,handleOptionSelected:de,handleGetLabelByValue:fe})),(0,t.onMounted)((function(){he(),setTimeout((function(){x.value&&oe()}))})),{selected:E,isInput:ie,options:j,isDisabled:M,selectedLabel:A,isPopoverShow:ne,isHover:J,popperWidth:te,inputRef:V,triggerRef:k,selectTagInputRef:C,searchLoading:ce,isOptionsEmpty:H,isSearchEmpty:_,isFocus:Z,isShowSelectContent:F,curContentText:D,isGroup:G,searchKey:se,setHover:Q,cancelHover:X,handleFocus:function(e){Z.value=!0,o("focus",e)},handleTogglePopover:function(){M.value||(le(),o("toggle",ne.value))},handleClear:function(e){e.stopPropagation(),E.value=[],pe(v.value?[]:""),o("clear",v.value?[]:""),re()},hidePopover:re,showPopover:oe,handleToggleAll:function(){R.value?E.value=[]:j.value.forEach((function(e){e.disabled||E.value.find((function(t){return t.value===e.value}))||E.value.push({value:e.value,label:e.label||e.value})})),pe(E.value.map((function(e){return e.value}))),ve()},handleOptionSelected:de,handleClickOutside:function(e){var t,n=e.event.target;(null===(t=k.value)||void 0===t?void 0:t.contains(n))||k.value===n||(re(),Z.value&&o("blur"),Z.value=!1)},handleScroll:function(e){var t=e.target;t.scrollTop+t.clientHeight===t.scrollHeight&&o("scroll-end")},handleDeleteTag:function(e){var t=E.value.findIndex((function(t){return t.value===e}));t>-1&&(E.value.splice(t,1),pe(E.value.map((function(e){return e.value}))))},handleInputChange:function(e){d.value&&(se.value=e)},handleInputEnter:function(e,t){var n=String(e);!P.value||!n||d.value&&j.value.find((function(e){return s(String(e.label))===s(n)}))||L.value.get(n)||(t.stopPropagation(),v.value?(E.value.push({value:n,label:n}),pe(E.value.map((function(e){return e.value})))):(E.value=[{value:n,label:n}],pe(n),re()),se.value="")},handleKeydown:function(e){var t,n,r=j.value.filter((function(e){return!e.disabled&&e.visible})),o=r.findIndex((function(e){return e.value===I.value}));if(r.length&&-1!==o)switch(e.code){case"ArrowDown":e.preventDefault();var l=o>=r.length-1?0:o+1;I.value=null===(t=r[l])||void 0===t?void 0:t.value;break;case"ArrowUp":e.preventDefault();var i=0===o?r.length-1:o-1;I.value=null===(n=r[i])||void 0===n?void 0:n.value;break;case"Backspace":if(!v.value||!E.value.length||se.value.length)return;E.value.pop(),pe(E.value.map((function(e){return e.value})));break;case"Enter":if(ne.value){var a=L.value.get(I.value);de(a)}else ne.value=!0}},handleSelectedAllOptionMouseEnter:function(){I.value=""}}},render:function(){var r,o=this,l=(0,e.classes)((g(r={"bk-select":!0,"popover-show":this.isPopoverShow,"is-disabled":this.isDisabled,"is-focus":this.isFocus,"is-filterable":this.filterable},this.size,!0),g(r,this.behavior,!0),r)),i={theme:"light bk-select-popover",trigger:"manual",width:this.popperWidth,arrow:!1,placement:"bottom",isShow:this.isPopoverShow},a=(0,y.merge)(i,this.popoverOptions),u=function(){return o.loading?(0,t.createVNode)(T(),{loading:!0,theme:"primary",class:"spinner",mode:"spin",size:"mini"},null):o.clearable&&o.isHover&&o.selected.length?(0,t.createVNode)(n.Close,{class:"clear-icon",onClick:o.handleClear},null):(0,t.createVNode)(n.AngleUp,{class:"angle-up"},null)};return(0,t.createVNode)("div",{class:l},[(0,t.createVNode)(O(),(0,t.mergeProps)(a,{onClickoutside:this.handleClickOutside}),{default:function(){return(0,t.createVNode)("div",{class:"bk-select-trigger",ref:"triggerRef",onClick:o.handleTogglePopover,onMouseenter:o.setHover,onMouseleave:o.cancelHover,onKeydown:o.handleKeydown},["tag"===o.multipleMode?(0,t.createVNode)(k,{ref:"selectTagInputRef",modelValue:o.searchKey,"onUpdate:modelValue":function(e){return o.searchKey=e},selected:o.selected,tagTheme:o.tagTheme,placeholder:o.placeholder,filterable:o.isInput,onFocus:o.handleFocus,onRemove:o.handleDeleteTag,onEnter:o.handleInputEnter},{prefix:function(){var e,t;return null===(t=(e=o.$slots).prefix)||void 0===t?void 0:t.call(e)},suffix:function(){return u()}}):(0,t.createVNode)(w(),{ref:"inputRef",type:"text",modelValue:o.isInput?o.searchKey:o.selectedLabel.join(","),placeholder:o.isInput&&o.selectedLabel.join(",")||o.placeholder,readonly:!o.isInput,disabled:o.isDisabled,behavior:o.behavior,size:o.size,onFocus:o.handleFocus,onInput:o.handleInputChange,onEnter:o.handleInputEnter},{prefix:function(){var e,t;return null===(t=(e=o.$slots).prefix)||void 0===t?void 0:t.call(e)},suffix:function(){return u()}})])},content:function(){return(0,t.createVNode)("div",{class:"bk-select-content"},[!o.isShowSelectContent&&(0,t.createVNode)("div",{class:"bk-select-empty"},[o.searchLoading&&(0,t.createVNode)(T(),{class:"mr5",theme:"primary",loading:!0,mode:"spin",size:"mini"},null),(0,t.createVNode)("span",null,[o.curContentText])]),(0,t.createVNode)("div",{class:"bk-select-content"},[(0,t.createVNode)("div",{class:"bk-select-dropdown",style:{maxHeight:"".concat(o.scrollHeight,"px")},onScroll:o.handleScroll},[(0,t.withDirectives)((0,t.createVNode)("ul",{class:"bk-select-options"},[o.multiple&&o.showSelectAll&&(!o.searchKey||!o.filterable)&&(0,t.createVNode)("li",{class:"bk-select-option",onMouseenter:o.handleSelectedAllOptionMouseEnter,onClick:o.handleToggleAll},[o.selectAllText]),null===(n=(e=o.$slots).default)||void 0===n?void 0:n.call(e),o.scrollLoading&&(0,t.createVNode)("li",{class:"bk-select-options-loading"},[(0,t.createVNode)(T(),{class:"spinner mr5",theme:"primary",loading:!0,mode:"spin",size:"mini"},null),(0,t.createVNode)("span",null,[o.loadingText])])]),[[t.vShow,o.isShowSelectContent]])]),o.$slots.extension&&(0,t.createVNode)("div",{class:"bk-select-extension"},[o.$slots.extension()])])]);var e,n}})])}});var L=(0,e.withInstallProps)(C,{Option:c,Group:h});const j=L})(),d})()));
|
1
|
+
import*as e from"../shared";import*as t from"vue";import*as n from"../icon";import*as o from"lodash";import*as r from"../directives";import*as l from"../input";import*as a from"../loading";import*as i from"../popover2";import*as u from"../tag";var s={7162:(e,t,n)=>{e.exports=n(5047)},5047:e=>{var t=function(e){var t,n=Object.prototype,o=n.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},l=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",i=r.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function s(e,t,n,o){var r=t&&t.prototype instanceof g?t:g,l=Object.create(r.prototype),a=new C(o||[]);return l._invoke=function(e,t,n){var o=d;return function(r,l){if(o===v)throw new Error("Generator is already running");if(o===f){if("throw"===r)throw l;return L()}for(n.method=r,n.arg=l;;){var a=n.delegate;if(a){var i=O(a,n);if(i){if(i===h)continue;return i}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=f,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var u=c(e,t,n);if("normal"===u.type){if(o=n.done?f:p,u.arg===h)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=f,n.method="throw",n.arg=u.arg)}}}(e,n,a),l}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=s;var d="suspendedStart",p="suspendedYield",v="executing",f="completed",h={};function g(){}function m(){}function y(){}var b={};u(b,l,(function(){return this}));var w=Object.getPrototypeOf,T=w&&w(w(N([])));T&&T!==n&&o.call(T,l)&&(b=T);var P=y.prototype=g.prototype=Object.create(b);function x(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function V(e,t){function n(r,l,a,i){var u=c(e[r],e,l);if("throw"!==u.type){var s=u.arg,d=s.value;return d&&"object"==typeof d&&o.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,a,i)}),(function(e){n("throw",e,a,i)})):t.resolve(d).then((function(e){s.value=e,a(s)}),(function(e){return n("throw",e,a,i)}))}i(u.arg)}var r;this._invoke=function(e,o){function l(){return new t((function(t,r){n(e,o,t,r)}))}return r=r?r.then(l,l):l()}}function O(e,n){var o=e.iterator[n.method];if(o===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,O(e,n),"throw"===n.method))return h;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var r=c(o,e.iterator,n.arg);if("throw"===r.type)return n.method="throw",n.arg=r.arg,n.delegate=null,h;var l=r.arg;return l?l.done?(n[e.resultName]=l.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,h):l:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function N(e){if(e){var n=e[l];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,a=function n(){for(;++r<e.length;)if(o.call(e,r))return n.value=e[r],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}return{next:L}}function L(){return{value:t,done:!0}}return m.prototype=y,u(P,"constructor",y),u(y,"constructor",m),m.displayName=u(y,i,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,u(e,i,"GeneratorFunction")),e.prototype=Object.create(P),e},e.awrap=function(e){return{__await:e}},x(V.prototype),u(V.prototype,a,(function(){return this})),e.AsyncIterator=V,e.async=function(t,n,o,r,l){void 0===l&&(l=Promise);var a=new V(s(t,n,o,r),l);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},x(P),u(P,i,"Generator"),u(P,l,(function(){return this})),u(P,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var o=t.pop();if(o in e)return n.value=o,n.done=!1,n}return n.done=!0,n}},e.values=N,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(S),!e)for(var n in this)"t"===n.charAt(0)&&o.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(o,r){return i.type="throw",i.arg=e,n.next=o,r&&(n.method="next",n.arg=t),!!r}for(var l=this.tryEntries.length-1;l>=0;--l){var a=this.tryEntries[l],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),s=o.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var l=r;break}}l&&("break"===e||"continue"===e)&&l.tryLoc<=t&&t<=l.finallyLoc&&(l=null);var a=l?l.completion:{};return a.type=e,a.arg=t,l?(this.method="next",this.next=l.finallyLoc,h):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),S(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var o=n.completion;if("throw"===o.type){var r=o.arg;S(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,o){return this.delegate={iterator:N(e),resultName:n,nextLoc:o},"next"===this.method&&(this.arg=t),h}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}},c={};function d(e){var t=c[e];if(void 0!==t)return t.exports;var n=c[e]={exports:{}};return s[e](n,n.exports,d),n.exports}d.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return d.d(t,{a:t}),t},d.d=(e,t)=>{for(var n in t)d.o(t,n)&&!d.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},d.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var p={};(()=>{d.d(p,{T0:()=>x,GE:()=>k,i2:()=>A,ZP:()=>G});const s=(c={PropTypes:()=>e.PropTypes,classes:()=>e.classes,observerResize:()=>e.observerResize,useFormItem:()=>e.useFormItem,withInstallProps:()=>e.withInstallProps},v={},d.d(v,c),v);var c,v;const f=(e=>{var t={};return d.d(t,e),t})({computed:()=>t.computed,createVNode:()=>t.createVNode,customRef:()=>t.customRef,defineComponent:()=>t.defineComponent,getCurrentInstance:()=>t.getCurrentInstance,inject:()=>t.inject,isVNode:()=>t.isVNode,mergeProps:()=>t.mergeProps,onBeforeMount:()=>t.onBeforeMount,onBeforeUnmount:()=>t.onBeforeUnmount,onMounted:()=>t.onMounted,provide:()=>t.provide,reactive:()=>t.reactive,ref:()=>t.ref,toRef:()=>t.toRef,toRefs:()=>t.toRefs,vModelText:()=>t.vModelText,vShow:()=>t.vShow,watch:()=>t.watch,withDirectives:()=>t.withDirectives}),h=(e=>{var t={};return d.d(t,e),t})({AngleUp:()=>n.AngleUp,AngleUpFill:()=>n.AngleUpFill,Close:()=>n.Close,Done:()=>n.Done});var g=d(7162),m=d.n(g);Object.create,Object.create;var y=Symbol("BkSelect"),b=Symbol("BkOptionGroup");function w(e){return{register:function(t,n){if(n){if(!e.value.has(t))return e.value.set(t,n);console.warn("repeat ".concat(t),n)}},unregister:function(t){e.value.delete(t)}}}function T(e,t){var n=this,o=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200,o=e;return(0,f.customRef)((function(e,r){return{get:function(){return e(),o},set:function(e){clearTimeout(t),void 0===e||""===e?(o=e,r()):t=setTimeout((function(){o=e,r()}),n)}}}))}(""),r=(0,f.ref)(!1);return(0,f.watch)(o,(function(){return l=n,a=void 0,i=void 0,u=m().mark((function n(){return m().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,r.value=!0,n.next=4,e(o.value);case 4:r.value=!1,n.next=10;break;case 7:n.prev=7,n.t0=n.catch(0),console.error(n.t0);case 10:return n.prev=10,null==t||t(),n.finish(10);case 13:case"end":return n.stop()}}),n,null,[[0,7,10,13]])})),new(i||(i=Promise))((function(e,t){function n(e){try{r(u.next(e))}catch(e){t(e)}}function o(e){try{r(u.throw(e))}catch(e){t(e)}}function r(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(n,o)}r((u=u.apply(l,a||[])).next())}));var l,a,i,u})),{searchKey:o,searchLoading:r}}function P(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e?String(e).trim().toLowerCase():e}const x=(0,f.defineComponent)({name:"Option",props:{value:s.PropTypes.any,label:s.PropTypes.string.def(""),disabled:s.PropTypes.bool.def(!1)},setup:function(e){var t=(0,f.getCurrentInstance)().proxy,n=(0,f.reactive)({visible:!0}),o=(0,f.toRefs)(e),r=o.disabled,l=o.value,a=(0,f.inject)(y,null),i=(0,f.inject)(b,null),u=(0,f.computed)((function(){var e;return null===(e=null==a?void 0:a.selected)||void 0===e?void 0:e.some((function(e){return e.value===l.value}))})),s=(0,f.computed)((function(){return null==a?void 0:a.multiple})),c=(0,f.computed)((function(){return(null==a?void 0:a.activeOptionValue)===l.value}));return(0,f.onBeforeMount)((function(){null==a||a.register(l.value,t),null==i||i.register(l.value,t)})),(0,f.onBeforeUnmount)((function(){null==a||a.unregister(l.value),null==i||i.unregister(l.value)})),Object.assign(Object.assign({},(0,f.toRefs)(n)),{selected:u,multiple:s,isHover:c,handleOptionClick:function(){r.value||null==a||a.handleOptionSelected(t)},handleMouseEnter:function(){a.activeOptionValue=l.value}})},render:function(){var e,t,n,o=(0,s.classes)({"is-selected":this.selected,"is-disabled":this.disabled,"is-multiple":this.multiple,"is-hover":this.isHover,"bk-select-option":!0});return(0,f.withDirectives)((0,f.createVNode)("li",{class:o,onClick:this.handleOptionClick,onMouseenter:this.handleMouseEnter},[null!==(n=null===(t=(e=this.$slots).default)||void 0===t?void 0:t.call(e))&&void 0!==n?n:(0,f.createVNode)("span",{class:"bk-select-option-item"},[this.label,this.multiple&&this.selected&&(0,f.createVNode)(h.Done,{width:22,height:22},null)])]),[[f.vShow,this.visible]])}});function V(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function O(e){return function(e){if(Array.isArray(e))return V(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return V(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?V(e,t):void 0}}(e)||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.")}()}const k=(0,f.defineComponent)({name:"Group",props:{label:s.PropTypes.string.def(""),disabled:s.PropTypes.bool.def(!1),collapsible:s.PropTypes.bool.def(!1),collapse:s.PropTypes.bool.def(!1)},setup:function(e,t){var n=t.emit,o=(0,f.getCurrentInstance)(),r=o.proxy,l=(0,f.inject)(y,null),a=(0,f.reactive)({groupCollapse:e.collapse,visible:!0}),i=(0,f.ref)(new Map),u=w(i),s=u.register,c=u.unregister,d=(0,f.computed)((function(){return"".concat(e.label," (").concat(O(i.value.values()).filter((function(e){return e.visible})).length,")")}));return(0,f.provide)(b,(0,f.reactive)(Object.assign(Object.assign({},(0,f.toRefs)(e)),{register:s,unregister:c,groupCollapse:(0,f.toRef)(a,"groupCollapse")}))),(0,f.onBeforeMount)((function(){null==l||l.registerGroup(o.uid,r)})),(0,f.onBeforeUnmount)((function(){null==l||l.unregisterGroup(o.uid)})),Object.assign(Object.assign({},(0,f.toRefs)(a)),{groupLabel:d,handleToggleCollapse:function(){e.collapsible&&!e.disabled&&(a.groupCollapse=!a.groupCollapse,n("update:collapse",a.groupCollapse))}})},render:function(){var e,t,n=(0,s.classes)({"bk-option-group":!0,collapsible:this.collapsible,disabled:this.disabled}),o=(0,s.classes)({"bk-option-group-label":!0,collapsible:this.collapsible}),r=(0,s.classes)({"default-group-label-icon":!0,collapse:this.groupCollapse});return(0,f.withDirectives)((0,f.createVNode)("ul",{class:n},[(0,f.createVNode)("li",{class:o,onClick:this.handleToggleCollapse},[this.$slots.label?this.$slots.label():(0,f.createVNode)("span",{class:"default-group-label"},[this.collapsible&&(0,f.createVNode)(h.AngleUpFill,{class:r},null),(0,f.createVNode)("span",{class:"default-group-label-title"},[this.groupLabel])])]),(0,f.withDirectives)((0,f.createVNode)("ul",{class:"bk-option-group-content"},[null===(t=(e=this.$slots).default)||void 0===t?void 0:t.call(e)]),[[f.vShow,!this.groupCollapse]])]),[[f.vShow,this.visible]])}});function S(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const C=(e=>{var t={};return d.d(t,e),t})({merge:()=>o.merge}),N=(e=>{var t={};return d.d(t,e),t})({clickoutside:()=>r.clickoutside}),L=(e=>{var t={};return d.d(t,e),t})({default:()=>l.default}),E=(e=>{var t={};return d.d(t,e),t})({default:()=>a.default}),j=(e=>{var t={};return d.d(t,e),t})({default:()=>i.default}),I=(e=>{var t={};return d.d(t,e),t})({default:()=>u.default}),M=(0,f.defineComponent)({name:"SelectTagInput",props:{selected:{type:Array,default:function(){return[]}},tagTheme:s.PropTypes.theme(["success","info","warning","danger"]).def(""),placeholder:s.PropTypes.string.def(""),filterable:s.PropTypes.bool.def(!1),allowCreate:s.PropTypes.bool.def(!1),modelValue:s.PropTypes.any},emits:["update:modelValue","remove","focus","enter"],setup:function(e,t){var n=t.emit,o=(0,f.inject)(y,null),r=(0,f.toRefs)(e).modelValue,l=(0,f.ref)(r.value),a=(0,f.ref)();(0,f.watch)(r,(function(){l.value=r.value}));var i=null==o?void 0:o.handleGetLabelByValue;return{value:l,inputRef:a,handleRemoveTag:function(e){n("remove",e)},handleFocus:function(){n("focus")},focus:function(){var e;null===(e=a.value)||void 0===e||e.focus()},handleInput:function(e){n("update:modelValue",e.target.value)},handleKeydown:function(e){"Enter"===e.code&&n("enter",e.target.value,e)},handleGetLabelByValue:i}},render:function(){var e,t,n,o,r=this;return(0,f.createVNode)("div",{class:"bk-select-tag"},[null===(t=null===(e=this.$slots)||void 0===e?void 0:e.prefix)||void 0===t?void 0:t.call(e),this.selected.map((function(e){var t,n;return(0,f.createVNode)(I.default,{closable:!0,theme:r.tagTheme,onClose:function(){return r.handleRemoveTag(e.value)}},"function"==typeof(n=t=r.handleGetLabelByValue(e))||"[object Object]"===Object.prototype.toString.call(n)&&!(0,f.isVNode)(n)?t:{default:function(){return[t]}})})),(0,f.withDirectives)((0,f.createVNode)("input",{class:"bk-select-tag-input",ref:"inputRef",type:"text",placeholder:this.selected.length?"":this.placeholder,readonly:!this.filterable,"onUpdate:modelValue":function(e){return r.value=e},onFocus:this.handleFocus,onInput:this.handleInput,onKeydown:this.handleKeydown},null),[[f.vModelText,r.value]]),null===(o=null===(n=this.$slots)||void 0===n?void 0:n.suffix)||void 0===o?void 0:o.call(n)])}}),R=(0,f.defineComponent)({name:"Select",directives:{clickoutside:N.clickoutside},props:{modelValue:s.PropTypes.any,multiple:s.PropTypes.bool.def(!1),disabled:s.PropTypes.bool.def(!1),size:s.PropTypes.size().def("default"),clearable:s.PropTypes.bool.def(!0),loading:s.PropTypes.bool.def(!1),filterable:s.PropTypes.bool.def(!1),remoteMethod:s.PropTypes.func,scrollHeight:s.PropTypes.number.def(216),showSelectAll:s.PropTypes.bool.def(!1),popoverMinWidth:s.PropTypes.number.def(0),showOnInit:s.PropTypes.bool.def(!1),multipleMode:s.PropTypes.oneOf(["default","tag"]).def("default"),tagTheme:s.PropTypes.theme(["success","info","warning","danger"]).def(""),behavior:s.PropTypes.oneOf(["normal","simplicity"]).def("normal"),collapseTags:s.PropTypes.bool.def(!1),noDataText:s.PropTypes.string.def("无数据"),noMatchText:s.PropTypes.string.def("无匹配数据"),loadingText:s.PropTypes.string.def("加载中..."),placeholder:s.PropTypes.string.def("请选择"),selectAllText:s.PropTypes.string.def("全部"),scrollLoading:s.PropTypes.bool.def(!1),allowCreate:s.PropTypes.bool.def(!1),popoverOptions:s.PropTypes.object.def({}),customContent:s.PropTypes.bool.def(!1)},emits:["update:modelValue","change","toggle","clear","scroll-end","focus","blur"],setup:function(e,t){var n=t.emit,o=(0,f.toRefs)(e),r=o.modelValue,l=o.disabled,a=o.filterable,i=o.multiple,u=o.remoteMethod,c=o.loading,d=o.loadingText,p=o.noDataText,v=o.noMatchText,h=o.popoverMinWidth,g=o.showOnInit,m=o.multipleMode,b=o.allowCreate,x=o.customContent,V=(0,s.useFormItem)(),k=(0,f.ref)(),S=(0,f.ref)(),C=(0,f.ref)(),N=(0,f.ref)(new Map),L=(0,f.computed)((function(){return O(N.value.values())})),E=(0,f.ref)(new Map),j=(0,f.ref)([]),I=(0,f.ref)();(0,f.watch)(r,(function(){he()}),{deep:!0});var M=(0,f.computed)((function(){return l.value||c.value})),R=(0,f.computed)((function(){return j.value.map((function(e){return fe(e)}))})),A=(0,f.computed)((function(){var e=L.value.reduce((function(e,t){return t.disabled||e.push(t.value),e}),[]);return e.length<=j.value.length&&e.every((function(e){return j.value.some((function(t){return t.value===e}))}))})),G=(0,f.computed)((function(){return!!E.value.size})),F=(0,f.computed)((function(){return!L.value.length})),D=(0,f.computed)((function(){return L.value.length&&L.value.every((function(e){return!e.visible}))})),B=(0,f.computed)((function(){return a.value&&"function"==typeof u.value})),H=(0,f.computed)((function(){return!(ce.value||F.value||D.value)||x.value})),_=(0,f.computed)((function(){return ce.value?d.value:F.value?p.value:D.value?v.value:""})),U=w(N),K=U.register,z=U.unregister,$=w(E),W=$.register,Y=$.unregister,Z=function(){var e=(0,f.ref)(!1);return{isHover:e,setHover:function(){e.value=!0},cancelHover:function(){e.value=!1}}}(),q=Z.isHover,J=Z.setHover,Q=Z.cancelHover,X=(0,f.ref)(!1),ee=function(e,t){var n=e.popoverMinWidth,o=null,r=(0,f.ref)("auto"),l=(0,f.ref)(!1),a=function(){var e;r.value=Math.max(null===(e=t.value)||void 0===e?void 0:e.offsetWidth,n)};return(0,f.onMounted)((function(){t.value&&(o=(0,s.observerResize)(t.value,a,60,!0)).start()})),(0,f.onBeforeUnmount)((function(){null==o||o.stop(),o=null})),{isPopoverShow:l,popperWidth:r,togglePopover:function(){l.value=!l.value},hidePopover:function(){l.value=!1},showPopover:function(){l.value=!0}}}({popoverMinWidth:h.value},S),te=ee.popperWidth,ne=ee.isPopoverShow,oe=ee.hidePopover,re=ee.showPopover,le=ee.togglePopover,ae=(0,f.computed)((function(){return(a.value||b.value)&&ne.value}));(0,f.watch)(ne,(function(e){e?(ve(),ie()):se.value=""}));var ie=function(){var e,t=j.value[0],n=N.value.get(null==t?void 0:t.value);n&&!n.disabled&&n.visible?I.value=null==t?void 0:t.value:I.value=null===(e=L.value.find((function(e){return!e.disabled&&e.visible})))||void 0===e?void 0:e.value},ue=T(B.value?u.value:function(e){a.value&&L.value.forEach((function(t){var n;t.visible=null===(n=P(String(t.label)))||void 0===n?void 0:n.includes(P(e))}))},ie),se=ue.searchKey,ce=ue.searchLoading,de=function(e){var t;e!==r.value&&(n("change",e),n("update:modelValue",e),null===(t=null==V?void 0:V.validate)||void 0===t||t.call(V,"change"))},pe=function(e){if(!M.value&&e){if(i.value){var t=j.value.findIndex((function(t){return t.value===e.value}));t>-1?j.value.splice(t,1):j.value.push({value:e.value,label:e.label||e.value}),de(j.value.map((function(e){return e.value})))}else j.value=[{label:e.label||e.value,value:e.value}],de(e.value),oe();ve()}},ve=function(){var e,t;"tag"===m.value?null===(e=C.value)||void 0===e||e.focus():null===(t=k.value)||void 0===t||t.focus()},fe=function(e){var t,n;return(null===(n=null===(t=N.value)||void 0===t?void 0:t.get(e.value))||void 0===n?void 0:n.label)||e.label||e.value},he=function(){Array.isArray(r.value)?j.value=O(r.value.map((function(e){return{value:e,label:e}}))):void 0!==r.value&&(j.value=[{value:r.value,label:r.value}])};return(0,f.provide)(y,(0,f.reactive)({multiple:i,selected:j,activeOptionValue:I,register:K,unregister:z,registerGroup:W,unregisterGroup:Y,handleOptionSelected:pe,handleGetLabelByValue:fe})),(0,f.onMounted)((function(){he(),setTimeout((function(){g.value&&re()}))})),{selected:j,isInput:ae,options:L,isDisabled:M,selectedLabel:R,isPopoverShow:ne,isHover:q,popperWidth:te,inputRef:k,triggerRef:S,selectTagInputRef:C,searchLoading:ce,isOptionsEmpty:F,isSearchEmpty:D,isFocus:X,isShowSelectContent:H,curContentText:_,isGroup:G,searchKey:se,setHover:J,cancelHover:Q,handleFocus:function(e){X.value=!0,n("focus",e)},handleTogglePopover:function(){M.value||(le(),n("toggle",ne.value))},handleClear:function(e){e.stopPropagation(),j.value=[],de(i.value?[]:""),n("clear",i.value?[]:""),oe()},hidePopover:oe,showPopover:re,handleToggleAll:function(){A.value?j.value=[]:L.value.forEach((function(e){e.disabled||j.value.find((function(t){return t.value===e.value}))||j.value.push({value:e.value,label:e.label||e.value})})),de(j.value.map((function(e){return e.value}))),ve()},handleOptionSelected:pe,handleClickOutside:function(e){var t,o=e.event.target;(null===(t=S.value)||void 0===t?void 0:t.contains(o))||S.value===o||(oe(),X.value&&n("blur"),X.value=!1)},handleScroll:function(e){var t=e.target;t.scrollTop+t.clientHeight===t.scrollHeight&&n("scroll-end")},handleDeleteTag:function(e){var t=j.value.findIndex((function(t){return t.value===e}));t>-1&&(j.value.splice(t,1),de(j.value.map((function(e){return e.value}))))},handleInputChange:function(e){a.value&&(se.value=e)},handleInputEnter:function(e,t){var n=String(e);!b.value||!n||a.value&&L.value.find((function(e){return P(String(e.label))===P(n)}))||N.value.get(n)||(t.stopPropagation(),i.value?(j.value.push({value:n,label:n}),de(j.value.map((function(e){return e.value})))):(j.value=[{value:n,label:n}],de(n),oe()),se.value="")},handleKeydown:function(e){var t,n,o=L.value.filter((function(e){return!e.disabled&&e.visible})),r=o.findIndex((function(e){return e.value===I.value}));if(o.length&&-1!==r)switch(e.code){case"ArrowDown":e.preventDefault();var l=r>=o.length-1?0:r+1;I.value=null===(t=o[l])||void 0===t?void 0:t.value;break;case"ArrowUp":e.preventDefault();var a=0===r?o.length-1:r-1;I.value=null===(n=o[a])||void 0===n?void 0:n.value;break;case"Backspace":if(!i.value||!j.value.length||se.value.length)return;j.value.pop(),de(j.value.map((function(e){return e.value})));break;case"Enter":if(ne.value){var u=N.value.get(I.value);pe(u)}else ne.value=!0}},handleSelectedAllOptionMouseEnter:function(){I.value=""}}},render:function(){var e,t=this,n=(0,s.classes)((S(e={"bk-select":!0,"popover-show":this.isPopoverShow,"is-disabled":this.isDisabled,"is-focus":this.isFocus,"is-filterable":this.filterable},this.size,!0),S(e,this.behavior,!0),e)),o={theme:"light bk-select-popover",trigger:"manual",width:this.popperWidth,arrow:!1,placement:"bottom",isShow:this.isPopoverShow},r=(0,C.merge)(o,this.popoverOptions),l=function(){return t.loading?(0,f.createVNode)(E.default,{loading:!0,theme:"primary",class:"spinner",mode:"spin",size:"mini"},null):t.clearable&&t.isHover&&t.selected.length?(0,f.createVNode)(h.Close,{class:"clear-icon",onClick:t.handleClear},null):(0,f.createVNode)(h.AngleUp,{class:"angle-up"},null)};return(0,f.createVNode)("div",{class:n},[(0,f.createVNode)(j.default,(0,f.mergeProps)(r,{onClickoutside:this.handleClickOutside}),{default:function(){return(0,f.createVNode)("div",{class:"bk-select-trigger",ref:"triggerRef",onClick:t.handleTogglePopover,onMouseenter:t.setHover,onMouseleave:t.cancelHover,onKeydown:t.handleKeydown},["tag"===t.multipleMode?(0,f.createVNode)(M,{ref:"selectTagInputRef",modelValue:t.searchKey,"onUpdate:modelValue":function(e){return t.searchKey=e},selected:t.selected,tagTheme:t.tagTheme,placeholder:t.placeholder,filterable:t.isInput,onFocus:t.handleFocus,onRemove:t.handleDeleteTag,onEnter:t.handleInputEnter},{prefix:function(){var e,n;return null===(n=(e=t.$slots).prefix)||void 0===n?void 0:n.call(e)},suffix:function(){return l()}}):(0,f.createVNode)(L.default,{ref:"inputRef",type:"text",modelValue:t.isInput?t.searchKey:t.selectedLabel.join(","),placeholder:t.isInput&&t.selectedLabel.join(",")||t.placeholder,readonly:!t.isInput,disabled:t.isDisabled,behavior:t.behavior,size:t.size,onFocus:t.handleFocus,onInput:t.handleInputChange,onEnter:t.handleInputEnter},{prefix:function(){var e,n;return null===(n=(e=t.$slots).prefix)||void 0===n?void 0:n.call(e)},suffix:function(){return l()}})])},content:function(){return(0,f.createVNode)("div",{class:"bk-select-content"},[!t.isShowSelectContent&&(0,f.createVNode)("div",{class:"bk-select-empty"},[t.searchLoading&&(0,f.createVNode)(E.default,{class:"mr5",theme:"primary",loading:!0,mode:"spin",size:"mini"},null),(0,f.createVNode)("span",null,[t.curContentText])]),(0,f.createVNode)("div",{class:"bk-select-content"},[(0,f.createVNode)("div",{class:"bk-select-dropdown",style:{maxHeight:"".concat(t.scrollHeight,"px")},onScroll:t.handleScroll},[(0,f.withDirectives)((0,f.createVNode)("ul",{class:"bk-select-options"},[t.multiple&&t.showSelectAll&&(!t.searchKey||!t.filterable)&&(0,f.createVNode)("li",{class:"bk-select-option",onMouseenter:t.handleSelectedAllOptionMouseEnter,onClick:t.handleToggleAll},[t.selectAllText]),null===(n=(e=t.$slots).default)||void 0===n?void 0:n.call(e),t.scrollLoading&&(0,f.createVNode)("li",{class:"bk-select-options-loading"},[(0,f.createVNode)(E.default,{class:"spinner mr5",theme:"primary",loading:!0,mode:"spin",size:"mini"},null),(0,f.createVNode)("span",null,[t.loadingText])])]),[[f.vShow,t.isShowSelectContent]])]),t.$slots.extension&&(0,f.createVNode)("div",{class:"bk-select-extension"},[t.$slots.extension()])])]);var e,n}})])}});var A=(0,s.withInstallProps)(R,{Option:x,Group:k});const G=A})();var v=p.T0,f=p.GE,h=p.i2,g=p.ZP;export{v as BkOption,f as BkOptionGroup,h as BkSelect,g as default};
|
@@ -32,7 +32,8 @@
|
|
32
32
|
--input-broder-radius: 3px;
|
33
33
|
--input-shadow-color: #a3c5fd;
|
34
34
|
--input-horizontal-padding: 10px;
|
35
|
-
--input-block-color: #
|
35
|
+
--input-block-color: #f5f7fa;
|
36
|
+
--input-block-hover-color: #eaebf0;
|
36
37
|
--input-icon-size: var(--font-size-large);
|
37
38
|
--input-maxlength-color: #979ba5;
|
38
39
|
--button-primary-hover-color: #5594fa;
|
@@ -44,6 +45,8 @@
|
|
44
45
|
--button-danger-active-color: #db2626;
|
45
46
|
--button-success-active-color: #1ab943;
|
46
47
|
--button-warning-active-color: #eb9000;
|
48
|
+
--button-selected-bg-color: #e1ecff;
|
49
|
+
--button-disabled-selected-bg-color: #f0f1f5;
|
47
50
|
--fixed-navbar-background: #fff;
|
48
51
|
--fixed-navbar-boxshadow-color: rgba(0, 0, 0, 0.1);
|
49
52
|
--switch-default-color: #fff;
|
package/lib/shared/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@popperjs/core"),require("lodash"),require("vue-types"),require("vue"));else if("function"==typeof define&&define.amd)define(["@popperjs/core","lodash","vue-types","vue"],t);else{var n="object"==typeof exports?t(require("@popperjs/core"),require("lodash"),require("vue-types"),require("vue")):t(e["@popperjs/core"],e.lodash,e["vue-types"],e.vue);for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(self,((e,t,n,r)=>(()=>{var i={8022:(e,t,n)=>{var r=n(4481),i=n(6426),o=i;o.v1=r,o.v4=i,e.exports=o},8725:e=>{for(var t=[],n=0;n<256;++n)t[n]=(n+256).toString(16).substr(1);e.exports=function(e,n){var r=n||0,i=t;return[i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]]].join("")}},9157:e=>{var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(t){var n=new Uint8Array(16);e.exports=function(){return t(n),n}}else{var r=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),r[t]=e>>>((3&t)<<3)&255;return r}}},4481:(e,t,n)=>{var r,i,o=n(9157),s=n(8725),a=0,u=0;e.exports=function(e,t,n){var c=t&&n||0,l=t||[],p=(e=e||{}).node||r,f=void 0!==e.clockseq?e.clockseq:i;if(null==p||null==f){var d=o();null==p&&(p=r=[1|d[0],d[1],d[2],d[3],d[4],d[5]]),null==f&&(f=i=16383&(d[6]<<8|d[7]))}var h=void 0!==e.msecs?e.msecs:(new Date).getTime(),v=void 0!==e.nsecs?e.nsecs:u+1,y=h-a+(v-u)/1e4;if(y<0&&void 0===e.clockseq&&(f=f+1&16383),(y<0||h>a)&&void 0===e.nsecs&&(v=0),v>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");a=h,u=v,i=f;var g=(1e4*(268435455&(h+=122192928e5))+v)%4294967296;l[c++]=g>>>24&255,l[c++]=g>>>16&255,l[c++]=g>>>8&255,l[c++]=255&g;var m=h/4294967296*1e4&268435455;l[c++]=m>>>8&255,l[c++]=255&m,l[c++]=m>>>24&15|16,l[c++]=m>>>16&255,l[c++]=f>>>8|128,l[c++]=255&f;for(var b=0;b<6;++b)l[c+b]=p[b];return t||s(l)}},6426:(e,t,n)=>{var r=n(9157),i=n(8725);e.exports=function(e,t,n){var o=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var s=(e=e||{}).random||(e.rng||r)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t)for(var a=0;a<16;++a)t[o+a]=s[a];return t||i(s)}},5798:t=>{"use strict";t.exports=e},467:e=>{"use strict";e.exports=t},748:e=>{"use strict";e.exports=r},210:e=>{"use strict";e.exports=n}},o={};function s(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={exports:{}};return i[e](n,n.exports,s),n.exports}s.d=(e,t)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return(()=>{"use strict";function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}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)}}function n(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i,o;s.r(a),s.d(a,{BKLAYERD_INDEX_EFAULT_VALUE:()=>u,BKLAYERTYPE:()=>o,BKPopover:()=>P,BkMaskManager:()=>D,EMPTY_OBJ:()=>ie,Placements:()=>G,PropTypes:()=>Z,Size:()=>K,arrayEqual:()=>de,bKMaskManager:()=>_,bkPopIndexManager:()=>q,bkZIndexManager:()=>c,classes:()=>re,clone:()=>x,debounce:()=>pe,elementsEqual:()=>O,filterProperty:()=>fe,finiteOrDefault:()=>k,formItemKey:()=>Q,formKey:()=>X,getPopContainerId:()=>L,isArray:()=>g,isElement:()=>M,isEmpty:()=>y,isEmptyObj:()=>ae,isFinite:()=>b,isNullOrUndef:()=>v,isObject:()=>m,merge:()=>T,mergeIf:()=>E,mergerFn:()=>w,mergerIfFn:()=>j,noop:()=>oe,observerResize:()=>C,random:()=>U,renderEmptyVNode:()=>se,resolveClassName:()=>le,scrollbarWidth:()=>$,stringEnum:()=>J,useForm:()=>te,useFormItem:()=>ne,valueOrDefault:()=>I,withInstall:()=>ue,withInstallProps:()=>ce}),function(e){e.BOTTOM="bottom",e.CONTENT="content",e.NAVI="navi",e.FULLSCREEN="fullScreen",e.PLUGINS="plugins",e.MODAL="modal",e.MESSAGE="message",e.POPPER="popper"}(o||(o={}));var u=(r(i={},o.BOTTOM,0),r(i,o.CONTENT,1),r(i,o.NAVI,100),r(i,o.FULLSCREEN,1e3),r(i,o.MODAL,3e3),r(i,o.PLUGINS,8e3),r(i,o.MESSAGE,1e4),r(i,o.POPPER,99999),i),c=new(function(){function t(){e(this,t),this.storageLayerIndexValue={},this.copyDefaultValue()}return n(t,[{key:"getNextIndex",value:function(e){return Object.prototype.hasOwnProperty.call(this.storageLayerIndexValue,e)?(this.storageLayerIndexValue[e]=this.storageLayerIndexValue[e]+1,this.storageLayerIndexValue[e]):(this.storageLayerIndexValue[o.MODAL]=this.storageLayerIndexValue[o.MODAL]+1,this.storageLayerIndexValue[o.MODAL])}},{key:"getModalNextIndex",value:function(){return this.getNextIndex(o.MODAL)}},{key:"getMessageNextIndex",value:function(){return this.getNextIndex(o.MESSAGE)}},{key:"getFullScreenNextIndex",value:function(){return this.getNextIndex(o.FULLSCREEN)}},{key:"getNaviNextIndex",value:function(){return this.getNextIndex(o.NAVI)}},{key:"getPopperIndex",value:function(){return u.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__,r({},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,r({},n,e[n]))}))}},{key:"copyDefaultValue",value:function(){var e=Object.keys(u).reduce((function(e,t){return Object.assign(e,r({},t,{value:u[t],writable:!0,configurable:!0}))}),{});this.storageLayerIndexValue=Object.create(u,e)}}]),t}());function l(e){return l="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},l(e)}function p(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}function f(e){return function(e){if(Array.isArray(e))return p(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,t):void 0}}(e)||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.")}()}var d=s(8022),h=s(5798);function v(e){return null==e}function y(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return""===e||!!t&&v(e)}function g(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 m(e){return null!==e&&/^\[object (Object|Module)\]/.test(Object.prototype.toString.call(e))}var b=function(e){return("number"==typeof e||e instanceof Number)&&isFinite(+e)};function k(e,t){return b(e)?e:t}function I(e,t){return void 0===e?t:e}function O(e,t){var n,r,i,o;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(i=e[n],o=t[n],i.datasetIndex!==o.datasetIndex||i.index!==o.index)return!1;return!0}function x(e){if(g(e))return e.map(x);if(m(e)){for(var t=Object.create(null),n=Object.keys(e),r=n.length,i=0;i<r;++i)t[n[i]]=x(e[n[i]]);return t}return e}function S(e){return-1===["__proto__","prototype","constructor"].indexOf(e)}function w(e,t,n,r){if(S(e)){var i=t[e],o=n[e];m(i)&&m(o)?T(i,o,r):t[e]=x(o)}}function T(e,t,n){var r=g(t)?t:[t],i=r.length;if(!m(e))return e;for(var o=(n=n||{}).merger||w,s=0;s<i;++s)if(m(t=r[s]))for(var a=Object.keys(t),u=0,c=a.length;u<c;++u)o(a[u],e,t,n);return e}function E(e,t){return T(e,t,{merger:j})}function j(e,t,n){if(S(e)){var r=t[e],i=n[e];m(r)&&m(i)?E(r,i):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=x(i))}}function M(e){try{return e instanceof HTMLElement}catch(t){return"object"===l(e)&&1===e.nodeType&&"object"===l(e.style)&&"object"===l(e.ownerDocument)}}var P=function(){function t(n,r,i){var o,s;e(this,t),this.isShow=!1,this.trigger=void 0,this.instance=void 0,this.always=!1,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(i),this.reference=this.resolveInputSelectorToHtmlElement(n),this.popperRefer=this.resolveInputSelectorToHtmlElement(r),this.referenceTarget=this.getTargetReferenceElement(),this.container=null===(o=this.popperRefer)||void 0===o?void 0:o.parentElement,this.isShow=!!(null===(s=this.instanceOptions)||void 0===s?void 0:s.isShow),this.always=this.instanceOptions.always,this.trigger=this.instanceOptions.trigger,this.disabled=this.instanceOptions.disabled,this.appendTo=this.instanceOptions.appendTo,this.afterHidden="function"==typeof i.afterHidden?i.afterHidden:function(){},this.afterShow="function"==typeof i.afterShow?i.afterShow:function(){},this.fixOnBoundary=this.instanceOptions.fixOnBoundary,this.initInstance(),this.registerEvents(),(this.isShow||this.always)&&this.show(null)}return n(t,[{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(f(this.instanceOptions.modifiers||[]),[{name:"eventListeners",enabled:!0}])}),this.update(),this.isShow=!0,this.afterShow(),this.fixOnBoundary||this.appendToTarget())}},{key:"hide",value:function(){var e;this.always||(null===(e=this.popperRefer)||void 0===e||e.removeAttribute("data-show"),this.setOptions({modifiers:[].concat(f(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();M(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();M(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=T({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=(0,h.createPopper)(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"===l(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 M(e)}},{key:"registerEvents",value:function(){var e=this;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()}))}))),"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.popperRefer.contains(t.target)||e.hide()}))}))}},{key:"isSameElement",value:function(e,t){return e&&(e===t||e===t.firstElementChild)}}]),t}(),A=null,L=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"#";if(null===A){A="id_".concat((0,d.v4)());var t=document.createElement("div");t.setAttribute("id",A),t.setAttribute("data-popper-id",A),document.body.append(t)}return"".concat(e).concat(A)},R=s(467),N="abcdefghijklmnopqrstuvwxyz0123456789",U=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:N,n="",r=0;r<e;r++)n+=t[parseInt((Math.random()*t.length).toString(),10)];return n},C=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:60,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=(0,R.throttle)((function(){"function"==typeof t&&t()}),n),o=new ResizeObserver((function(){i()}));return r&&"function"==typeof t&&t(),{start:function(){o.observe(e)},stop:function(){o.disconnect(),o.unobserve(e)}}},D=function(){function t(n){e(this,t),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 r=n||{},i=r.multiInstance,o=void 0!==i&&i,s=r.maskAttrTag,a=void 0===s?"auto":s,u=r.parentNode,c=void 0===u?document.body:u,l=r.maskStyle,p=void 0===l?{}:l;this.activeInstance=void 0,this.multiInstance=o,this.uniqueMaskAttrTag=this.getMaskAttrTag(a),this.parentNode=c||document,this.mask=this.getMask(),this.backupMask=this.createMask("data-bk-backup-uid"),this.setMaskStyle(Object.assign({},this.maskStyle,p))}return n(t,[{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]:{},i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,o=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=null!=i?i:U(16),a=/-?\d+/.test("".concat(t))?t:c.getModalNextIndex(),u=Object.assign({},this.maskStyle,r||{});if(!n&&this.lastUUID){var l=this.zIndexStore.get(this.lastUUID);u=l.style}this.storeMaskInsCfg({zIndex:a,style:Object.assign({},u),uuid:s,preUID:this.lastUUID}),this.setMaskStyle(u),this.mask.style.setProperty("display","block"),this.mask.style.setProperty("z-index","".concat(a)),this.backupMask.style.setProperty("z-index","".concat(a-1)),e&&(o&&e.style.setProperty("z-index","".concat(a+1)),this.activeInstance=e,o||this.appendContentToMask(e))}},{key:"hide",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=null!=r?r:this.lastUUID;this.mask.style.setProperty("display","none"),t||(null==n||n.remove(),null===(e=this.activeInstance)||void 0===e||e.remove()),this.activeInstance=void 0,this.popIndexStore(i)}},{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(U(16)):e}},{key:"appendContentToMask",value:function(e){this.mask.append(e)}}]),t}(),_=new D({}),V=function(){function t(){e(this,t),this.popInstanceList=[],this.uuidAttrName="data-bk-pop-uuid"}return n(t,[{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]:{},r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;if(e){var o="number"==typeof i?i:c.getModalNextIndex(),s=U(16);e.setAttribute(this.uuidAttrName,s),this.popInstanceList.push({uuid:s,zIndex:o,content:e,showMask:t,appendStyle:n}),t&&_.backupActiveInstance(),_.show(e,o,t,n,s,r)}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();_.popIndexStore(t.uuid),t.remove()}if(this.popInstanceList.length){var n=this.popInstanceList.slice(-1)[0],r=n.zIndex,i=n.content,o=n.showMask,s=n.appendStyle,a=n.uuid;_.show(i,r,o,s,a)}else _.hide()}}},{key:"hide",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=null==e?void 0:e.getAttribute(this.uuidAttrName);if(n){var r=this.popInstanceList.findIndex((function(e){return e.uuid===n}));r>=0&&(t||this.popInstanceList[r].content.remove(),this.popInstanceList.splice(r,1),_.popIndexStore(n),this.popInstanceList.length?this.popHide(!1):_.hide(t))}else null==e||e.remove()}}]),t}(),q=new V;function z(e,t){return z=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},z(e,t)}function B(e,t){if(t&&("object"===l(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function F(e){return F=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},F(e)}var H=s(210);var K,G,Y=(0,H.createTypes)({});function J(e){return e.reduce((function(e,t){return e[t]=t,e}),Object.create(null))}!function(e){e.Small="small",e.Large="large"}(K||(K={})),function(e){e.Top="top",e.Left="left",e.Right="right",e.Bottom="bottom"}(G||(G={}));var W,Z=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&z(e,t)}(s,t);var r,i,o=(r=s,i=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}}(),function(){var e,t=F(r);if(i){var n=F(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return B(this,e)});function s(){return e(this,s),o.apply(this,arguments)}return n(s,null,[{key:"size",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["small","default","large"];return(0,H.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(0,H.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(0,H.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]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"commonType";return(0,H.toType)(t.replace(/^\S/,(function(e){return e.toUpperCase()})),{type:String,validator:function(n){var r=e.includes(n);return r||console.error("invalid ".concat(t,", ").concat(n,", the ").concat(t," must be one of 【").concat(e.join(" | "),"】")),r},default:e[0]})}},{key:"style",value:function(){return(0,H.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(0,H.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"})}}]),s}(Y);function $(){if(void 0!==W)return W;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),W=t-r}var X=Symbol("form"),Q=Symbol("formItem"),ee=s(748),te=function(){return(0,ee.inject)(X)},ne=function(){return(0,ee.inject)(Q,ie)};function re(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):"")}var ie=Object.create({}),oe=function(){},se=function(){return null},ae=function(e){return Object.keys(e).length<1},ue=function(e){return e.install=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.prefix,i=t.config.globalProperties.bkUIPrefix||r||"Bk";t.component(i+e.name,e)},e},ce=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return e.install=function(r){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=i.prefix,s=r.config.globalProperties.bkUIPrefix||o||"Bk";r.component(s+e.name,e),!n&&Object.values(t).forEach((function(e){r.component(s+e.name,e)}))},Object.keys(t).forEach((function(n){e[n]=t[n]})),e};function le(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"bk";return"".concat(t,"-").concat(e)}function pe(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:300,r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=function(){var o=this,s=arguments;if(e&&clearTimeout(e),i){var a=!e;e=setTimeout((function(){e=null}),n),a&&(t=r.apply(o,s))}else e=setTimeout((function(){r.apply(o,s)}),n);return t};return o.cancel=function(){clearTimeout(e),e=null},o}function fe(e,t){return JSON.parse(JSON.stringify(e,(function(e,n){if(!t.includes(e))return n})))}function de(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}})(),a})()));
|
1
|
+
import*as e from"@popperjs/core";import*as t from"lodash";import*as n from"vue-types";import*as r from"vue";var i={8022:(e,t,n)=>{var r=n(4481),i=n(6426),o=i;o.v1=r,o.v4=i,e.exports=o},8725:e=>{for(var t=[],n=0;n<256;++n)t[n]=(n+256).toString(16).substr(1);e.exports=function(e,n){var r=n||0,i=t;return[i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]]].join("")}},9157:e=>{var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(t){var n=new Uint8Array(16);e.exports=function(){return t(n),n}}else{var r=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),r[t]=e>>>((3&t)<<3)&255;return r}}},4481:(e,t,n)=>{var r,i,o=n(9157),a=n(8725),s=0,u=0;e.exports=function(e,t,n){var c=t&&n||0,l=t||[],p=(e=e||{}).node||r,f=void 0!==e.clockseq?e.clockseq:i;if(null==p||null==f){var d=o();null==p&&(p=r=[1|d[0],d[1],d[2],d[3],d[4],d[5]]),null==f&&(f=i=16383&(d[6]<<8|d[7]))}var h=void 0!==e.msecs?e.msecs:(new Date).getTime(),v=void 0!==e.nsecs?e.nsecs:u+1,y=h-s+(v-u)/1e4;if(y<0&&void 0===e.clockseq&&(f=f+1&16383),(y<0||h>s)&&void 0===e.nsecs&&(v=0),v>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");s=h,u=v,i=f;var g=(1e4*(268435455&(h+=122192928e5))+v)%4294967296;l[c++]=g>>>24&255,l[c++]=g>>>16&255,l[c++]=g>>>8&255,l[c++]=255&g;var m=h/4294967296*1e4&268435455;l[c++]=m>>>8&255,l[c++]=255&m,l[c++]=m>>>24&15|16,l[c++]=m>>>16&255,l[c++]=f>>>8|128,l[c++]=255&f;for(var b=0;b<6;++b)l[c+b]=p[b];return t||a(l)}},6426:(e,t,n)=>{var r=n(9157),i=n(8725);e.exports=function(e,t,n){var o=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var a=(e=e||{}).random||(e.rng||r)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,t)for(var s=0;s<16;++s)t[o+s]=a[s];return t||i(a)}}},o={};function a(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={exports:{}};return i[e](n,n.exports,a),n.exports}a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var s={};(()=>{function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(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)}}function u(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var l,p;a.d(s,{p3:()=>f,Ql:()=>p,mZ:()=>D,Wg:()=>q,kT:()=>le,_h:()=>X,ng:()=>ne,$u:()=>Y,h6:()=>be,Lx:()=>H,aR:()=>Z,ue:()=>d,Sh:()=>ce,d9:()=>A,Ds:()=>ge,cA:()=>j,w$:()=>me,b_:()=>w,xE:()=>oe,vh:()=>ie,ks:()=>C,kJ:()=>x,kK:()=>U,xb:()=>O,SI:()=>de,xV:()=>T,_D:()=>I,Kn:()=>S,TS:()=>L,NG:()=>R,WC:()=>P,Zd:()=>N,ZT:()=>pe,z3:()=>F,MX:()=>B,Ay:()=>fe,h5:()=>ye,LF:()=>re,b:()=>ee,cI:()=>se,A9:()=>ue,Be:()=>E,nz:()=>he,B:()=>ve}),function(e){e.BOTTOM="bottom",e.CONTENT="content",e.NAVI="navi",e.FULLSCREEN="fullScreen",e.PLUGINS="plugins",e.MODAL="modal",e.MESSAGE="message",e.POPPER="popper"}(p||(p={}));var f=(c(l={},p.BOTTOM,0),c(l,p.CONTENT,1),c(l,p.NAVI,100),c(l,p.FULLSCREEN,1e3),c(l,p.MODAL,3e3),c(l,p.PLUGINS,8e3),c(l,p.MESSAGE,1e4),c(l,p.POPPER,99999),l),d=new(function(){function e(){i(this,e),this.storageLayerIndexValue={},this.copyDefaultValue()}return u(e,[{key:"getNextIndex",value:function(e){return Object.prototype.hasOwnProperty.call(this.storageLayerIndexValue,e)?(this.storageLayerIndexValue[e]=this.storageLayerIndexValue[e]+1,this.storageLayerIndexValue[e]):(this.storageLayerIndexValue[p.MODAL]=this.storageLayerIndexValue[p.MODAL]+1,this.storageLayerIndexValue[p.MODAL])}},{key:"getModalNextIndex",value:function(){return this.getNextIndex(p.MODAL)}},{key:"getMessageNextIndex",value:function(){return this.getNextIndex(p.MESSAGE)}},{key:"getFullScreenNextIndex",value:function(){return this.getNextIndex(p.FULLSCREEN)}},{key:"getNaviNextIndex",value:function(){return this.getNextIndex(p.NAVI)}},{key:"getPopperIndex",value:function(){return f.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__,c({},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,c({},n,e[n]))}))}},{key:"copyDefaultValue",value:function(){var e=Object.keys(f).reduce((function(e,t){return Object.assign(e,c({},t,{value:f[t],writable:!0,configurable:!0}))}),{});this.storageLayerIndexValue=Object.create(f,e)}}]),e}());function h(e){return h="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},h(e)}function v(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}function y(e){return function(e){if(Array.isArray(e))return v(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return v(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?v(e,t):void 0}}(e)||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.")}()}var g=a(8022);const m=(b={createPopper:()=>e.createPopper},k={},a.d(k,b),k);var b,k;function I(e){return null==e}function O(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return""===e||!!t&&I(e)}function x(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 S(e){return null!==e&&/^\[object (Object|Module)\]/.test(Object.prototype.toString.call(e))}var T=function(e){return("number"==typeof e||e instanceof Number)&&isFinite(+e)};function w(e,t){return T(e)?e:t}function E(e,t){return void 0===e?t:e}function j(e,t){var n,r,i,o;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(i=e[n],o=t[n],i.datasetIndex!==o.datasetIndex||i.index!==o.index)return!1;return!0}function A(e){if(x(e))return e.map(A);if(S(e)){for(var t=Object.create(null),n=Object.keys(e),r=n.length,i=0;i<r;++i)t[n[i]]=A(e[n[i]]);return t}return e}function M(e){return-1===["__proto__","prototype","constructor"].indexOf(e)}function P(e,t,n,r){if(M(e)){var i=t[e],o=n[e];S(i)&&S(o)?L(i,o,r):t[e]=A(o)}}function L(e,t,n){var r=x(t)?t:[t],i=r.length;if(!S(e))return e;for(var o=(n=n||{}).merger||P,a=0;a<i;++a)if(S(t=r[a]))for(var s=Object.keys(t),u=0,c=s.length;u<c;++u)o(s[u],e,t,n);return e}function R(e,t){return L(e,t,{merger:N})}function N(e,t,n){if(M(e)){var r=t[e],i=n[e];S(r)&&S(i)?R(r,i):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=A(i))}}function U(e){try{return e instanceof HTMLElement}catch(t){return"object"===h(e)&&1===e.nodeType&&"object"===h(e.style)&&"object"===h(e.ownerDocument)}}var D=function(){function e(t,n,r){var o,a;i(this,e),this.isShow=!1,this.trigger=void 0,this.instance=void 0,this.always=!1,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=null===(o=this.popperRefer)||void 0===o?void 0:o.parentElement,this.isShow=!!(null===(a=this.instanceOptions)||void 0===a?void 0:a.isShow),this.always=this.instanceOptions.always,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.always)&&this.show(null)}return u(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(y(this.instanceOptions.modifiers||[]),[{name:"eventListeners",enabled:!0}])}),this.update(),this.isShow=!0,this.afterShow(),this.fixOnBoundary||this.appendToTarget())}},{key:"hide",value:function(){var e;this.always||(null===(e=this.popperRefer)||void 0===e||e.removeAttribute("data-show"),this.setOptions({modifiers:[].concat(y(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();U(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();U(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=L({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=(0,m.createPopper)(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 U(e)}},{key:"registerEvents",value:function(){var e=this;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()}))}))),"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.popperRefer.contains(t.target)||e.hide()}))}))}},{key:"isSameElement",value:function(e,t){return e&&(e===t||e===t.firstElementChild)}}]),e}(),_=null,C=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"#";if(null===_){_="id_".concat((0,g.v4)());var t=document.createElement("div");t.setAttribute("id",_),t.setAttribute("data-popper-id",_),document.body.append(t)}return"".concat(e).concat(_)};const V=(e=>{var t={};return a.d(t,e),t})({throttle:()=>t.throttle});var z="abcdefghijklmnopqrstuvwxyz0123456789",B=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:z,n="",r=0;r<e;r++)n+=t[parseInt((Math.random()*t.length).toString(),10)];return n},F=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:60,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=(0,V.throttle)((function(){"function"==typeof t&&t()}),n),o=new ResizeObserver((function(){i()}));return r&&"function"==typeof t&&t(),{start:function(){o.observe(e)},stop:function(){o.disconnect(),o.unobserve(e)}}},q=function(){function e(t){i(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,o=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=o,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 u(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]:{},i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,o=arguments.length>5&&void 0!==arguments[5]&&arguments[5],a=null!=i?i:B(16),s=/-?\d+/.test("".concat(t))?t:d.getModalNextIndex(),u=Object.assign({},this.maskStyle,r||{});if(!n&&this.lastUUID){var c=this.zIndexStore.get(this.lastUUID);u=c.style}this.storeMaskInsCfg({zIndex:s,style:Object.assign({},u),uuid:a,preUID:this.lastUUID}),this.setMaskStyle(u),this.mask.style.setProperty("display","block"),this.mask.style.setProperty("z-index","".concat(s)),this.backupMask.style.setProperty("z-index","".concat(s-1)),e&&(o&&e.style.setProperty("z-index","".concat(s+1)),this.activeInstance=e,o||this.appendContentToMask(e))}},{key:"hide",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=null!=r?r:this.lastUUID;this.mask.style.setProperty("display","none"),t||(null==n||n.remove(),null===(e=this.activeInstance)||void 0===e||e.remove()),this.activeInstance=void 0,this.popIndexStore(i)}},{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(B(16)):e}},{key:"appendContentToMask",value:function(e){this.mask.append(e)}}]),e}(),H=new q({}),K=function(){function e(){i(this,e),this.popInstanceList=[],this.uuidAttrName="data-bk-pop-uuid"}return u(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]:{},r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;if(e){var o="number"==typeof i?i:d.getModalNextIndex(),a=B(16);e.setAttribute(this.uuidAttrName,a),this.popInstanceList.push({uuid:a,zIndex:o,content:e,showMask:t,appendStyle:n}),t&&H.backupActiveInstance(),H.show(e,o,t,n,a,r)}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();H.popIndexStore(t.uuid),t.remove()}if(this.popInstanceList.length){var n=this.popInstanceList.slice(-1)[0],r=n.zIndex,i=n.content,o=n.showMask,a=n.appendStyle,s=n.uuid;H.show(i,r,o,a,s)}else H.hide()}}},{key:"hide",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=null==e?void 0:e.getAttribute(this.uuidAttrName);if(n){var r=this.popInstanceList.findIndex((function(e){return e.uuid===n}));r>=0&&(t||this.popInstanceList[r].content.remove(),this.popInstanceList.splice(r,1),H.popIndexStore(n),this.popInstanceList.length?this.popHide(!1):H.hide(t))}else null==e||e.remove()}}]),e}(),Z=new K;function G(e,t){return G=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},G(e,t)}function W(e,t){if(t&&("object"===h(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function $(e){return $=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},$(e)}const J=(e=>{var t={};return a.d(t,e),t})({createTypes:()=>n.createTypes,toType:()=>n.toType});var Y,X,Q=(0,J.createTypes)({});function ee(e){return e.reduce((function(e,t){return e[t]=t,e}),Object.create(null))}!function(e){e.Small="small",e.Large="large"}(Y||(Y={})),function(e){e.Top="top",e.Left="left",e.Right="right",e.Bottom="bottom"}(X||(X={}));var te,ne=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&G(e,t)}(o,e);var t,n,r=(t=o,n=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}}(),function(){var e,r=$(t);if(n){var i=$(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return W(this,e)});function o(){return i(this,o),r.apply(this,arguments)}return u(o,null,[{key:"size",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["small","default","large"];return(0,J.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(0,J.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(0,J.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]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"commonType";return(0,J.toType)(t.replace(/^\S/,(function(e){return e.toUpperCase()})),{type:String,validator:function(n){var r=e.includes(n);return r||console.error("invalid ".concat(t,", ").concat(n,", the ").concat(t," must be one of 【").concat(e.join(" | "),"】")),r},default:e[0]})}},{key:"style",value:function(){return(0,J.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(0,J.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"})}}]),o}(Q);function re(){if(void 0!==te)return te;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),te=t-r}var ie=Symbol("form"),oe=Symbol("formItem");const ae=(e=>{var t={};return a.d(t,e),t})({inject:()=>r.inject});var se=function(){return(0,ae.inject)(ie)},ue=function(){return(0,ae.inject)(oe,le)};function ce(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):"")}var le=Object.create({}),pe=function(){},fe=function(){return null},de=function(e){return Object.keys(e).length<1},he=function(e){return e.install=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.prefix,i=t.config.globalProperties.bkUIPrefix||r||"Bk";t.component(i+e.name,e)},e},ve=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return e.install=function(r){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=i.prefix,a=r.config.globalProperties.bkUIPrefix||o||"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};function ye(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"bk";return"".concat(t,"-").concat(e)}function ge(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:300,r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=function(){var o=this,a=arguments;if(e&&clearTimeout(e),i){var s=!e;e=setTimeout((function(){e=null}),n),s&&(t=r.apply(o,a))}else e=setTimeout((function(){r.apply(o,a)}),n);return t};return o.cancel=function(){clearTimeout(e),e=null},o}function me(e,t){return JSON.parse(JSON.stringify(e,(function(e,n){if(!t.includes(e))return n})))}function be(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}})();var u=s.p3,c=s.Ql,l=s.mZ,p=s.Wg,f=s.kT,d=s._h,h=s.ng,v=s.$u,y=s.h6,g=s.Lx,m=s.aR,b=s.ue,k=s.Sh,I=s.d9,O=s.Ds,x=s.cA,S=s.w$,T=s.b_,w=s.xE,E=s.vh,j=s.ks,A=s.kJ,M=s.kK,P=s.xb,L=s.SI,R=s.xV,N=s._D,U=s.Kn,D=s.TS,_=s.NG,C=s.WC,V=s.Zd,z=s.ZT,B=s.z3,F=s.MX,q=s.Ay,H=s.h5,K=s.LF,Z=s.b,G=s.cI,W=s.A9,$=s.Be,J=s.nz,Y=s.B;export{u as BKLAYERD_INDEX_EFAULT_VALUE,c as BKLAYERTYPE,l as BKPopover,p as BkMaskManager,f as EMPTY_OBJ,d as Placements,h as PropTypes,v as Size,y as arrayEqual,g as bKMaskManager,m as bkPopIndexManager,b as bkZIndexManager,k as classes,I as clone,O as debounce,x as elementsEqual,S as filterProperty,T as finiteOrDefault,w as formItemKey,E as formKey,j as getPopContainerId,A as isArray,M as isElement,P as isEmpty,L as isEmptyObj,R as isFinite,N as isNullOrUndef,U as isObject,D as merge,_ as mergeIf,C as mergerFn,V as mergerIfFn,z as noop,B as observerResize,F as random,q as renderEmptyVNode,H as resolveClassName,K as scrollbarWidth,Z as stringEnum,G as useForm,W as useFormItem,$ as valueOrDefault,J as withInstall,Y as withInstallProps};
|
package/lib/sideslider/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("../shared"),require("vue"),require("../button"),require("../modal"));else if("function"==typeof define&&define.amd)define(["../shared","vue","../button","../modal"],e);else{var r="object"==typeof exports?e(require("../shared"),require("vue"),require("../button"),require("../modal")):e(t["../shared"],t.vue,t["../button"],t["../modal"]);for(var n in r)("object"==typeof exports?exports:t)[n]=r[n]}}(self,((t,e,r,n)=>(()=>{var o={7162:(t,e,r)=>{t.exports=r(5047)},5047:t=>{var e=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=e&&e.prototype instanceof y?e:y,i=Object.create(o.prototype),a=new k(n||[]);return i._invoke=function(t,e,r){var n=f;return function(o,i){if(n===d)throw new Error("Generator is already running");if(n===p){if("throw"===o)throw i;return P()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=E(a,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=d;var u=l(t,e,r);if("normal"===u.type){if(n=r.done?p:h,u.arg===v)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=p,r.method="throw",r.arg=u.arg)}}}(t,r,a),i}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var f="suspendedStart",h="suspendedYield",d="executing",p="completed",v={};function y(){}function g(){}function m(){}var b={};u(b,i,(function(){return this}));var w=Object.getPrototypeOf,x=w&&w(w(N([])));x&&x!==r&&n.call(x,i)&&(b=x);var j=m.prototype=y.prototype=Object.create(b);function L(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(o,i,a,c){var u=l(t[o],t,i);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==typeof f&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function E(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,E(t,r),"throw"===r.method))return v;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var o=l(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,v):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function N(t){if(t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}return{next:P}}function P(){return{value:e,done:!0}}return g.prototype=m,u(j,"constructor",m),u(m,"constructor",g),g.displayName=u(m,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,u(t,c,"GeneratorFunction")),t.prototype=Object.create(j),t},t.awrap=function(t){return{__await:t}},L(O.prototype),u(O.prototype,a,(function(){return this})),t.AsyncIterator=O,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new O(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},L(j),u(j,c,"Generator"),u(j,i,(function(){return this})),u(j,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=N,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(_),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),_(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;_(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}(t.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}},4976:t=>{"use strict";t.exports=r},8014:t=>{"use strict";t.exports=n},4212:e=>{"use strict";e.exports=t},748:t=>{"use strict";t.exports=e}},i={};function a(t){var e=i[t];if(void 0!==e)return e.exports;var r=i[t]={exports:{}};return o[t](r,r.exports,a),r.exports}a.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return a.d(e,{a:e}),e},a.d=(t,e)=>{for(var r in e)a.o(e,r)&&!a.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),a.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var c={};return(()=>{"use strict";a.r(c),a.d(c,{default:()=>d});var t=a(4212),e=a(748),r=a(7162),n=a.n(r);Object.create,Object.create;var o=a(4976),i=a.n(o),u=a(8014),s=a.n(u),l=s().propsMixin,f=Object.assign({},l);f.width.default="400",f.height.default="100%";const h=(0,e.defineComponent)({name:"Sideslider",components:{BkModal:s(),BkButton:i()},props:Object.assign(Object.assign({},f),{title:{type:String,default:""},extCls:{type:String,default:""},direction:{type:String,default:"right",validator:function(t){var e=["left","right"];return!(e.indexOf(t)<0&&(console.error("direction property is not valid: '".concat(t,"',【").concat(e.join(" | "),"】")),1))}}}),emits:["closed","update:isShow","shown","hidden","animation-end"],setup:function(t,r){var o=this,i=r.slots,a=r.emit,c=function(){return e=o,r=void 0,i=void 0,c=n().mark((function e(){var r;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=!0,"function"!=typeof t.beforeClose){e.next=5;break}return e.next=4,t.beforeClose();case 4:r=e.sent;case 5:r&&(a("update:isShow",!1),a("closed"),setTimeout((function(){a("animation-end")}),250));case 6:case"end":return e.stop()}}),e)})),new(i||(i=Promise))((function(t,n){function o(t){try{u(c.next(t))}catch(t){n(t)}}function a(t){try{u(c.throw(t))}catch(t){n(t)}}function u(e){var r;e.done?t(e.value):(r=e.value,r instanceof i?r:new i((function(t){t(r)}))).then(o,a)}u((c=c.apply(e,r||[])).next())}));var e,r,i,c},u=function(){setTimeout((function(){a("shown")}),200)},l=function(){setTimeout((function(){a("hidden")}),200)};return function(){var r,n={header:function(){var r,n;return(0,e.createVNode)(e.Fragment,null,[(0,e.createVNode)("div",{class:"bk-sideslider-header"},[(0,e.createVNode)("div",{class:"bk-sideslider-close ".concat(t.direction),onClick:function(){c()}},null),(0,e.createVNode)("div",{class:"bk-sideslider-title ".concat(t.direction)},[null!==(n=null===(r=i.header)||void 0===r?void 0:r.call(i))&&void 0!==n?n:t.title])])])},default:function(){var t,e;return null!==(e=null===(t=i.default)||void 0===t?void 0:t.call(i))&&void 0!==e?e:"Content"},footer:function(){var t,r;return(0,e.createVNode)("div",{class:"bk-sideslider-footer"},[null!==(r=null===(t=i.footer)||void 0===t?void 0:t.call(i))&&void 0!==r?r:""])}},o="bk-sideslider-wrapper ".concat(t.scrollable?"scroll-able":""," ").concat(t.extCls),a=i.footer?"calc(100vh - 114px)":"calc(100vh - 60px)";return(0,e.createVNode)(s(),(0,e.mergeProps)(t,{maxHeight:a,extCls:o,style:"".concat(t.direction,": 0;"),onHidden:l,onShown:u,onClose:c}),"function"==typeof(r=n)||"[object Object]"===Object.prototype.toString.call(r)&&!(0,e.isVNode)(r)?n:{default:function(){return[n]}})}}}),d=(0,t.withInstall)(h)})(),c})()));
|
1
|
+
import*as t from"../shared";import*as e from"vue";import*as r from"../button";import*as n from"../modal";var o={7162:(t,e,r)=>{t.exports=r(5047)},5047:t=>{var e=function(t){var e,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var o=e&&e.prototype instanceof y?e:y,i=Object.create(o.prototype),a=new _(n||[]);return i._invoke=function(t,e,r){var n=f;return function(o,i){if(n===d)throw new Error("Generator is already running");if(n===p){if("throw"===o)throw i;return P()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=E(a,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=d;var u=s(t,e,r);if("normal"===u.type){if(n=r.done?p:h,u.arg===v)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=p,r.method="throw",r.arg=u.arg)}}}(t,r,a),i}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f="suspendedStart",h="suspendedYield",d="executing",p="completed",v={};function y(){}function g(){}function m(){}var w={};u(w,i,(function(){return this}));var b=Object.getPrototypeOf,x=b&&b(b(S([])));x&&x!==r&&n.call(x,i)&&(w=x);var L=m.prototype=y.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==typeof f&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function E(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,E(t,r),"throw"===r.method))return v;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var o=s(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,v):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function N(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function _(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function S(t){if(t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}return{next:P}}function P(){return{value:e,done:!0}}return g.prototype=m,u(L,"constructor",m),u(m,"constructor",g),g.displayName=u(m,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,u(t,c,"GeneratorFunction")),t.prototype=Object.create(L),t},t.awrap=function(t){return{__await:t}},j(O.prototype),u(O.prototype,a,(function(){return this})),t.AsyncIterator=O,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new O(l(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(L),u(L,c,"Generator"),u(L,i,(function(){return this})),u(L,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=S,_.prototype={constructor:_,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(k),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:S(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}(t.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}}},i={};function a(t){var e=i[t];if(void 0!==e)return e.exports;var r=i[t]={exports:{}};return o[t](r,r.exports,a),r.exports}a.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return a.d(e,{a:e}),e},a.d=(t,e)=>{for(var r in e)a.o(e,r)&&!a.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var c={};(()=>{a.d(c,{Z:()=>g});const o=(i={withInstall:()=>t.withInstall},u={},a.d(u,i),u);var i,u;const l=(t=>{var e={};return a.d(e,t),e})({Fragment:()=>e.Fragment,createVNode:()=>e.createVNode,defineComponent:()=>e.defineComponent,isVNode:()=>e.isVNode,mergeProps:()=>e.mergeProps});var s=a(7162),f=a.n(s);Object.create,Object.create;const h=(t=>{var e={};return a.d(e,t),e})({default:()=>r.default}),d=(t=>{var e={};return a.d(e,t),e})({default:()=>n.default});var p=d.default.propsMixin,v=Object.assign({},p);v.width.default="400",v.height.default="100%";const y=(0,l.defineComponent)({name:"Sideslider",components:{BkModal:d.default,BkButton:h.default},props:Object.assign(Object.assign({},v),{title:{type:String,default:""},extCls:{type:String,default:""},direction:{type:String,default:"right",validator:function(t){var e=["left","right"];return!(e.indexOf(t)<0&&(console.error("direction property is not valid: '".concat(t,"',【").concat(e.join(" | "),"】")),1))}}}),emits:["closed","update:isShow","shown","hidden","animation-end"],setup:function(t,e){var r=this,n=e.slots,o=e.emit,i=function(){return e=r,n=void 0,i=void 0,a=f().mark((function e(){var r;return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=!0,"function"!=typeof t.beforeClose){e.next=5;break}return e.next=4,t.beforeClose();case 4:r=e.sent;case 5:r&&(o("update:isShow",!1),o("closed"),setTimeout((function(){o("animation-end")}),250));case 6:case"end":return e.stop()}}),e)})),new(i||(i=Promise))((function(t,r){function o(t){try{u(a.next(t))}catch(t){r(t)}}function c(t){try{u(a.throw(t))}catch(t){r(t)}}function u(e){var r;e.done?t(e.value):(r=e.value,r instanceof i?r:new i((function(t){t(r)}))).then(o,c)}u((a=a.apply(e,n||[])).next())}));var e,n,i,a},a=function(){setTimeout((function(){o("shown")}),200)},c=function(){setTimeout((function(){o("hidden")}),200)};return function(){var e,r={header:function(){var e,r;return(0,l.createVNode)(l.Fragment,null,[(0,l.createVNode)("div",{class:"bk-sideslider-header"},[(0,l.createVNode)("div",{class:"bk-sideslider-close ".concat(t.direction),onClick:function(){i()}},null),(0,l.createVNode)("div",{class:"bk-sideslider-title ".concat(t.direction)},[null!==(r=null===(e=n.header)||void 0===e?void 0:e.call(n))&&void 0!==r?r:t.title])])])},default:function(){var t,e;return null!==(e=null===(t=n.default)||void 0===t?void 0:t.call(n))&&void 0!==e?e:"Content"},footer:function(){var t,e;return(0,l.createVNode)("div",{class:"bk-sideslider-footer"},[null!==(e=null===(t=n.footer)||void 0===t?void 0:t.call(n))&&void 0!==e?e:""])}},o="bk-sideslider-wrapper ".concat(t.scrollable?"scroll-able":""," ").concat(t.extCls),u=n.footer?"calc(100vh - 114px)":"calc(100vh - 60px)";return(0,l.createVNode)(d.default,(0,l.mergeProps)(t,{maxHeight:u,extCls:o,style:"".concat(t.direction,": 0;"),onHidden:c,onShown:a,onClose:i}),"function"==typeof(e=r)||"[object Object]"===Object.prototype.toString.call(e)&&!(0,l.isVNode)(e)?r:{default:function(){return[r]}})}}}),g=(0,o.withInstall)(y)})();var u=c.Z;export{u as default};
|
@@ -32,7 +32,8 @@
|
|
32
32
|
--input-broder-radius: 3px;
|
33
33
|
--input-shadow-color: #a3c5fd;
|
34
34
|
--input-horizontal-padding: 10px;
|
35
|
-
--input-block-color: #
|
35
|
+
--input-block-color: #f5f7fa;
|
36
|
+
--input-block-hover-color: #eaebf0;
|
36
37
|
--input-icon-size: var(--font-size-large);
|
37
38
|
--input-maxlength-color: #979ba5;
|
38
39
|
--button-primary-hover-color: #5594fa;
|
@@ -44,6 +45,8 @@
|
|
44
45
|
--button-danger-active-color: #db2626;
|
45
46
|
--button-success-active-color: #1ab943;
|
46
47
|
--button-warning-active-color: #eb9000;
|
48
|
+
--button-selected-bg-color: #e1ecff;
|
49
|
+
--button-disabled-selected-bg-color: #f0f1f5;
|
47
50
|
--fixed-navbar-background: #fff;
|
48
51
|
--fixed-navbar-boxshadow-color: rgba(0, 0, 0, 0.1);
|
49
52
|
--switch-default-color: #fff;
|
package/lib/slider/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("../shared"),require("vue"),require("../input"),require("../popover"));else if("function"==typeof define&&define.amd)define(["../shared","vue","../input","../popover"],t);else{var a="object"==typeof exports?t(require("../shared"),require("vue"),require("../input"),require("../popover")):t(e["../shared"],e.vue,e["../input"],e["../popover"]);for(var r in a)("object"==typeof exports?exports:e)[r]=a[r]}}(self,((e,t,a,r)=>(()=>{var n={7162:(e,t,a)=>{e.exports=a(5047)},5047:e=>{var t=function(e){"use strict";var t,a=Object.prototype,r=a.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",u=n.asyncIterator||"@@asyncIterator",l=n.toStringTag||"@@toStringTag";function i(e,t,a){return Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{i({},"")}catch(e){i=function(e,t,a){return e[t]=a}}function c(e,t,a,r){var n=t&&t.prototype instanceof h?t:h,o=Object.create(n.prototype),u=new j(r||[]);return o._invoke=function(e,t,a){var r=v;return function(n,o){if(r===d)throw new Error("Generator is already running");if(r===f){if("throw"===n)throw o;return T()}for(a.method=n,a.arg=o;;){var u=a.delegate;if(u){var l=k(u,a);if(l){if(l===p)continue;return l}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(r===v)throw r=f,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);r=d;var i=s(e,t,a);if("normal"===i.type){if(r=a.done?f:m,i.arg===p)continue;return{value:i.arg,done:a.done}}"throw"===i.type&&(r=f,a.method="throw",a.arg=i.arg)}}}(e,a,u),o}function s(e,t,a){try{return{type:"normal",arg:e.call(t,a)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var v="suspendedStart",m="suspendedYield",d="executing",f="completed",p={};function h(){}function V(){}function y(){}var b={};i(b,o,(function(){return this}));var g=Object.getPrototypeOf,w=g&&g(g(B([])));w&&w!==a&&r.call(w,o)&&(b=w);var x=y.prototype=h.prototype=Object.create(b);function L(e){["next","throw","return"].forEach((function(t){i(e,t,(function(e){return this._invoke(t,e)}))}))}function N(e,t){function a(n,o,u,l){var i=s(e[n],e,o);if("throw"!==i.type){var c=i.arg,v=c.value;return v&&"object"==typeof v&&r.call(v,"__await")?t.resolve(v.__await).then((function(e){a("next",e,u,l)}),(function(e){a("throw",e,u,l)})):t.resolve(v).then((function(e){c.value=e,u(c)}),(function(e){return a("throw",e,u,l)}))}l(i.arg)}var n;this._invoke=function(e,r){function o(){return new t((function(t,n){a(e,r,t,n)}))}return n=n?n.then(o,o):o()}}function k(e,a){var r=e.iterator[a.method];if(r===t){if(a.delegate=null,"throw"===a.method){if(e.iterator.return&&(a.method="return",a.arg=t,k(e,a),"throw"===a.method))return p;a.method="throw",a.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var n=s(r,e.iterator,a.arg);if("throw"===n.type)return a.method="throw",a.arg=n.arg,a.delegate=null,p;var o=n.arg;return o?o.done?(a[e.resultName]=o.value,a.next=e.nextLoc,"return"!==a.method&&(a.method="next",a.arg=t),a.delegate=null,p):o:(a.method="throw",a.arg=new TypeError("iterator result is not an object"),a.delegate=null,p)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function B(e){if(e){var a=e[o];if(a)return a.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,u=function a(){for(;++n<e.length;)if(r.call(e,n))return a.value=e[n],a.done=!1,a;return a.value=t,a.done=!0,a};return u.next=u}}return{next:T}}function T(){return{value:t,done:!0}}return V.prototype=y,i(x,"constructor",y),i(y,"constructor",V),V.displayName=i(y,l,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===V||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,i(e,l,"GeneratorFunction")),e.prototype=Object.create(x),e},e.awrap=function(e){return{__await:e}},L(N.prototype),i(N.prototype,u,(function(){return this})),e.AsyncIterator=N,e.async=function(t,a,r,n,o){void 0===o&&(o=Promise);var u=new N(c(t,a,r,n),o);return e.isGeneratorFunction(a)?u:u.next().then((function(e){return e.done?e.value:u.next()}))},L(x),i(x,l,"Generator"),i(x,o,(function(){return this})),i(x,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var a in e)t.push(a);return t.reverse(),function a(){for(;t.length;){var r=t.pop();if(r in e)return a.value=r,a.done=!1,a}return a.done=!0,a}},e.values=B,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(E),!e)for(var a in this)"t"===a.charAt(0)&&r.call(this,a)&&!isNaN(+a.slice(1))&&(this[a]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var a=this;function n(r,n){return l.type="throw",l.arg=e,a.next=r,n&&(a.method="next",a.arg=t),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var u=this.tryEntries[o],l=u.completion;if("root"===u.tryLoc)return n("end");if(u.tryLoc<=this.prev){var i=r.call(u,"catchLoc"),c=r.call(u,"finallyLoc");if(i&&c){if(this.prev<u.catchLoc)return n(u.catchLoc,!0);if(this.prev<u.finallyLoc)return n(u.finallyLoc)}else if(i){if(this.prev<u.catchLoc)return n(u.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return n(u.finallyLoc)}}}},abrupt:function(e,t){for(var a=this.tryEntries.length-1;a>=0;--a){var n=this.tryEntries[a];if(n.tryLoc<=this.prev&&r.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var u=o?o.completion:{};return u.type=e,u.arg=t,o?(this.method="next",this.next=o.finallyLoc,p):this.complete(u)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var a=this.tryEntries[t];if(a.finallyLoc===e)return this.complete(a.completion,a.afterLoc),E(a),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var a=this.tryEntries[t];if(a.tryLoc===e){var r=a.completion;if("throw"===r.type){var n=r.arg;E(a)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(e,a,r){return this.delegate={iterator:B(e),resultName:a,nextLoc:r},"next"===this.method&&(this.arg=t),p}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},8133:e=>{"use strict";e.exports=a},5537:e=>{"use strict";e.exports=r},4212:t=>{"use strict";t.exports=e},748:e=>{"use strict";e.exports=t}},o={};function u(e){var t=o[e];if(void 0!==t)return t.exports;var a=o[e]={exports:{}};return n[e](a,a.exports,u),a.exports}u.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return u.d(t,{a:t}),t},u.d=(e,t)=>{for(var a in t)u.o(t,a)&&!u.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},u.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),u.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var l={};return(()=>{"use strict";u.r(l),u.d(l,{default:()=>f});var e=u(4212),t=u(748),a=u(7162),r=u.n(a);Object.create,Object.create;var n=u(8133),o=u.n(n),i=u(5537),c=u.n(i);const s=(0,t.defineComponent)({name:"SliderButton",props:{modelValue:{type:Number,default:0},params:{type:Object,default:function(){return{}}}},emits:["emitChange","resetSize","update:modelValue"],setup:function(e,a){var r=a.emit,n=(0,t.ref)(!1),o=(0,t.ref)(!1),u=(0,t.ref)(0),l=(0,t.ref)(0),i=(0,t.ref)(0),s=(0,t.ref)(null),d=(0,t.ref)(e.modelValue),f=(0,t.ref)(0),p=(0,t.ref)(0),h=(0,t.ref)(!1),V=(0,t.ref)(null),y=(0,t.computed)((function(){var t,a,r="";if(null===(t=e.params.customContent)||void 0===t?void 0:t[e.modelValue]){var n=e.params.customContent[e.modelValue];r=n.tip||n.label||""}var o=e.params.vertical?"right":"top";return(null===(a=e.params)||void 0===a?void 0:a.showTip)?{content:e.params.formatterTipLabel("".concat(r||(null==e?void 0:e.modelValue)||"0")),placement:o}:{content:"",placement:o}})),b=(0,t.computed)((function(){return"".concat((e.modelValue-e.params.minValue)/(e.params.maxValue-e.params.minValue)*100,"%")})),g=(0,t.computed)((function(){return e.params.vertical?{bottom:b.value}:{left:b.value}})),w=(0,t.computed)((function(){return e.params.formatterButtonLabel(e.modelValue)})),x=function(t){e.params.disable||(t.preventDefault(),L(t),v(window,"mousemove",N),v(window,"touchmove",N),v(window,"mouseup",k),v(window,"touchend",k))},L=function(t){n.value=!0,o.value=!0,e.params.vertical?u.value=t.clientY:l.value=t.clientX,i.value=parseFloat(b.value),s.value=i.value},N=function(t){if(n.value){o.value=!1,r("resetSize");var a=0;e.params.vertical?(f.value=t.clientY,a=(u.value-f.value)/e.params.sliderSize*100):(p.value=t.clientX,a=(p.value-l.value)/e.params.sliderSize*100),s.value=i.value+a,C(s.value)}},k=function e(){h.value=!1,n.value&&(setTimeout((function(){n.value=!1,o.value||(C(s.value),r("emitChange"))}),0),m(window,"mousemove",N),m(window,"touchmove",N),m(window,"mouseup",e),m(window,"touchend",e))},C=function(t){if(null!==t&&!isNaN(t)){t<0?s.value=0:t>100&&(s.value=100);var a=100/((e.params.maxValue-e.params.minValue)/e.params.step),o=Math.round(t/a)*a*(e.params.maxValue-e.params.minValue)*.01+e.params.minValue;o=parseFloat(o.toFixed(e.params.precision)),r("update:modelValue",o),n.value||e.modelValue===d.value||(d.value=e.modelValue)}};return{renderDom:function(){return(0,t.createVNode)("div",{class:["bk-slider-button",e.params.vertical?"vertical":"horizontal",{grabbing:n.value}],ref:V,tabindex:"0",style:g.value,onClick:function(e){return e.stopPropagation()},onMousedown:x},[Boolean(y.value.content)?(0,t.createVNode)(c(),{content:y.value.content,theme:"dark",placement:y.value.placement,boundary:document.body},{default:function(){return[(0,t.createVNode)("div",{class:["slider-button",{"slider-button-disable":e.params.disable}]},null)]}}):(0,t.createVNode)("div",{class:["slider-button",{"slider-button-disable":e.params.disable}]},null),e.params.showButtonLabel&&!e.params.showIntervalLabel?(0,t.createVNode)("div",{class:["slider-button-label",e.params.vertical?"vertical":"horizontal"]},[w.value]):void 0])},setPosition:C,tip:y}},render:function(){return this.renderDom()}});var v=function(e,t,a){e&&t&&a&&e.addEventListener(t,a,!1)},m=function(e,t,a){e&&t&&a&&e.removeEventListener(t,a,!1)};const d=(0,t.defineComponent)({name:"Slider",props:{modelValue:e.PropTypes.oneOfType([e.PropTypes.array,e.PropTypes.number]),extCls:{type:String,default:""},vertical:{type:Boolean,default:!1},height:{type:String,default:"200px"},disable:{type:Boolean,default:!1},showTip:{type:Boolean,default:!1},maxValue:{type:[Number],default:100},minValue:{type:[Number],default:0},step:{type:[Number],default:1},range:{type:Boolean,default:!1},showInterval:{type:Boolean,default:!1},showIntervalLabel:{type:Boolean,default:!1},showButtonLabel:{type:Boolean,default:!1},showBetweenLabel:{type:Boolean,default:!1},showInput:{type:Boolean,default:!1},customContent:{type:Object,default:null},formatterLabel:{type:Function,default:function(e){return e}},formatterButtonLabel:{type:Function,default:function(e){return e}},formatterTipLabel:{type:Function,default:function(e){return e}}},emits:["update:modelValue","change"],setup:function(e,a){var n=this,u=a.slots,l=a.emit,i=(0,t.ref)(1),c=(0,t.ref)(null),m=(0,t.ref)(null),d=(0,t.ref)(null),f=(0,t.ref)(0),p=(0,t.ref)(0),h=(0,t.ref)(null),V=(0,t.ref)(null),y=(0,t.ref)(null),b=(0,t.ref)(null),g=(0,t.computed)((function(){var t=[e.minValue,e.maxValue,e.step].map((function(e){var t="".concat(e).split(".")[1];return t?t.length:0}));return Math.max.apply(null,t)})),w=(0,t.computed)((function(){return Math.min(c.value,m.value)})),x=(0,t.computed)((function(){return Math.max(c.value,m.value)})),L=(0,t.computed)((function(){return e.range?"".concat(100*(x.value-w.value)/(e.maxValue-e.minValue),"%"):"".concat(100*(c.value-e.minValue)/(e.maxValue-e.minValue),"%")})),N=(0,t.computed)((function(){return e.range?"".concat(100*(w.value-e.minValue)/(e.maxValue-e.minValue),"%"):"0%"})),k=(0,t.computed)((function(){return e.vertical?{height:L.value,bottom:N.value}:{width:L.value,left:N.value}})),C=(0,t.computed)((function(){if(!e.showInterval||e.minValue>e.maxValue)return[];if(0===e.step)return console.warn("WARNNING:step should not be 0"),[];for(var t=(e.maxValue-e.minValue)/e.step,a=100*e.step/(e.maxValue-e.minValue),r=[],n=1;n<t;n++)r.push(n*a);return e.range?r.filter((function(t){return t<100*(w.value-e.minValue)/(e.maxValue-e.minValue)||t>100*(x.value-e.minValue)/(e.maxValue-e.minValue)})):r.filter((function(t){return t>100*(c.value-e.minValue)/(e.maxValue-e.minValue)}))})),E=(0,t.computed)((function(){return e.vertical?{height:e.height,width:"4px"}:{}})),j=(0,t.computed)((function(){if(!e.showIntervalLabel)return[];if(0===e.step)return console.warn("WARNNING:step should not be 0"),[];for(var t=100*e.step/(e.maxValue-e.minValue),a=[],r=e.minValue,n=0;r<=e.maxValue;r+=e.step,n++){var o={stepWidth:n*t,stepLabel:e.formatterLabel(r)};a.push(o)}return a})),B=(0,t.computed)((function(){return Array.isArray(e.modelValue)})),T=(0,t.computed)((function(){return e.customContent?Object.keys(e.customContent).sort((function(e,t){return Number(e)-Number(t)})).filter((function(t){return Number(t)>=e.minValue&&Number(t)<=e.maxValue})).map((function(t){var a=e.customContent[t].tip,r=e.customContent[t].label;return{tip:a||r||"",label:r||"",percent:(Number(t)-e.minValue)/(e.maxValue-e.minValue)*100}})):[]})),O=(0,t.computed)((function(){return{vertical:e.vertical,showTip:e.showTip,disable:e.disable,maxValue:e.maxValue,minValue:e.minValue,step:e.step,precision:g.value,showButtonLabel:e.showButtonLabel,formatterButtonLabel:e.formatterButtonLabel,showIntervalLabel:e.showIntervalLabel,customContent:e.customContent,sliderSize:i.value,formatterTipLabel:e.formatterTipLabel}}));(0,t.watch)((function(){return e.modelValue}),(function(){I()})),(0,t.watch)((function(){return c.value}),(function(t){e.range?l("update:modelValue",[w.value,x.value]):l("update:modelValue",t),f.value=t})),(0,t.watch)((function(){return m.value}),(function(e){l("update:modelValue",[w.value,x.value]),p.value=e})),(0,t.onMounted)((function(){e.range?(Array.isArray(e.modelValue)?(c.value=Math.max(e.minValue,Number(e.modelValue[0])),m.value=Math.min(e.maxValue,Number(e.modelValue[1]))):(c.value=e.minValue,m.value=e.maxValue),d.value=[c.value,m.value]):("number"!=typeof e.modelValue||isNaN(e.modelValue)?c.value=e.minValue:c.value=Math.min(e.maxValue,Math.max(e.minValue,e.modelValue)),d.value=c.value),S(),v(window,"resize",S())}));var S=function(){h.value&&(i.value=h.value["client".concat(e.vertical?"Height":"Width")])},P=function(t){var a,r;if(t.stopPropagation(),!e.disable){if(S(),e.vertical){var n=null===(a=h.value)||void 0===a?void 0:a.getBoundingClientRect().bottom;F((n-t.clientY)/i.value*100)}else{var o=null===(r=h.value)||void 0===r?void 0:r.getBoundingClientRect().left;F((t.clientX-o)/i.value*100)}M()}},_=function(){return e.range?![w.value,x.value].every((function(e,t){return e===d.value[t]})):e.modelValue!==d.value},I=function(){if(e.minValue>e.maxValue)console.error("min should not be greater than max.");else{var t=e.modelValue;e.range&&Array.isArray(t)?t[1]<e.minValue?l("update:modelValue",[e.minValue,e.minValue]):t[0]>e.maxValue?l("update:modelValue",[e.maxValue,e.maxValue]):t[0]<e.minValue?l("update:modelValue",[e.minValue,t[1]]):t[1]>e.maxValue?l("update:modelValue",[t[0],e.maxValue]):(c.value=Number(t[0]),m.value=Number(t[1]),_()&&(d.value=t.slice())):e.range||"number"!=typeof t||isNaN(t)||(t<e.minValue?l("update:modelValue",e.minValue):t>e.maxValue?l("update:modelValue",e.maxValue):(c.value=t,_()&&(d.value=t)))}},M=function(){return a=n,o=void 0,u=void 0,i=r().mark((function a(){return r().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,(0,t.nextTick)();case 2:l("change",e.range?[w.value,x.value]:e.modelValue);case 3:case"end":return a.stop()}}),a)})),new(u||(u=Promise))((function(e,t){function r(e){try{l(i.next(e))}catch(e){t(e)}}function n(e){try{l(i.throw(e))}catch(e){t(e)}}function l(t){var a;t.done?e(t.value):(a=t.value,a instanceof u?a:new u((function(e){e(a)}))).then(r,n)}l((i=i.apply(a,o||[])).next())}));var a,o,u,i},z=function(t){return e.vertical?{bottom:"".concat(t,"%")}:{left:"".concat(t,"%")}},F=function(t){if(e.range){var a=e.minValue+t*(e.maxValue-e.minValue)/100;Math.abs(w.value-a)<Math.abs(x.value-a)?b.value=c.value<m.value?V.value:y.value:b.value=c.value>m.value?V.value:y.value,b.value.setPosition(t)}else V.value.setPosition(t)},A=function(t){if(""!==t){var a=parseFloat(t);a<e.minValue?(f.value=e.minValue,c.value=e.minValue):a>e.maxValue?(f.value=e.maxValue,c.value=e.maxValue):c.value=a}},G=function(t){if(""!==t&&"number"!=typeof t){var a=parseFloat(t);a<e.minValue?(p.value=e.minValue,m.value=e.minValue):a>e.maxValue?(p.value=e.maxValue,m.value=e.maxValue):m.value=a}},R=function(t){var a;return a="start"===t?e.vertical?e.maxValue:e.minValue:e.vertical?e.minValue:e.maxValue,e.showButtonLabel&&[c.value,m.value].includes(a)?"0":"1"};return{renderDom:function(){var a,r;return(0,t.createVNode)("div",{class:["bk-slider",e.extCls]},[null===(a=u.start)||void 0===a?void 0:a.call(u),(0,t.createVNode)("div",{class:"bk-slider-runway",ref:h,style:E.value,onClick:P},[(0,t.createVNode)("div",{class:["bk-slider-bar",e.vertical?"vertical":"horizontal",{disable:e.disable}],style:k.value},null),e.showInterval?C.value.map((function(a,r){return(0,t.createVNode)("div",{key:r,class:["bk-slider-interval",{vertical:e.vertical}],style:z(a)},null)})):void 0,e.customContent?T.value.map((function(a,r){return(0,t.createVNode)("div",{key:r,class:["bk-slider-interval",{vertical:e.vertical}],style:z(a.percent)},null)})):void 0,e.showBetweenLabel||e.showIntervalLabel||e.customContent?(0,t.createVNode)("div",{class:["bk-slider-labels",e.vertical?"vertical":"horizontal"]},[e.showBetweenLabel?[(0,t.createVNode)("div",{class:"label-start",style:[{opacity:R("start")}]},[e.formatterLabel(e.minValue)]),(0,t.createVNode)("div",{class:"label-end",style:[{opacity:R("end")}]},[e.formatterLabel(e.maxValue)])]:e.showIntervalLabel?j.value.map((function(a,r){return(0,t.createVNode)("div",{class:["bk-slider-label",e.vertical?"vertical":"horizontal"],key:r,style:z(a.stepWidth)},[a.stepLabel])})):e.customContent?T.value.map((function(a,r){return(0,t.createVNode)("div",{class:["bk-slider-label",e.vertical?"vertical":"horizontal"],key:r,style:z(a.percent)},[a.label])})):void 0]):void 0,(0,t.createVNode)(s,{modelValue:c.value,"onUpdate:modelValue":function(e){return c.value=e},ref:V,params:O.value,onEmitChange:M,onResetSize:S},null),e.range?(0,t.createVNode)(s,{modelValue:m.value,"onUpdate:modelValue":function(e){return m.value=e},ref:y,params:O.value,onEmitChange:M,onResetSize:S},null):void 0]),e.showInput&&!e.vertical?(0,t.createVNode)("div",{class:"bk-slider-input"},[(0,t.createVNode)("div",{class:"input-item"},[(0,t.createVNode)(o(),{type:"number",modelValue:f.value,max:e.maxValue,min:e.minValue,onChange:A},null)]),B.value&&m.value?[(0,t.createVNode)("div",{class:"input-center"},[(0,t.createTextVNode)("~")]),(0,t.createVNode)("div",{class:"input-item"},[(0,t.createVNode)(o(),{type:"number",modelValue:p.value,max:e.maxValue,min:e.minValue,onChange:G},null)])]:void 0]):void 0,null===(r=u.end)||void 0===r?void 0:r.call(u)])}}},render:function(){return this.renderDom()}}),f=(0,e.withInstall)(d)})(),l})()));
|
1
|
+
import*as e from"../shared";import*as t from"vue";import*as a from"../input";import*as n from"../popover";var r={7162:(e,t,a)=>{e.exports=a(5047)},5047:e=>{var t=function(e){var t,a=Object.prototype,n=a.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",l=r.asyncIterator||"@@asyncIterator",u=r.toStringTag||"@@toStringTag";function i(e,t,a){return Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{i({},"")}catch(e){i=function(e,t,a){return e[t]=a}}function c(e,t,a,n){var r=t&&t.prototype instanceof h?t:h,o=Object.create(r.prototype),l=new E(n||[]);return o._invoke=function(e,t,a){var n=m;return function(r,o){if(n===d)throw new Error("Generator is already running");if(n===f){if("throw"===r)throw o;return O()}for(a.method=r,a.arg=o;;){var l=a.delegate;if(l){var u=k(l,a);if(u){if(u===p)continue;return u}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(n===m)throw n=f,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);n=d;var i=s(e,t,a);if("normal"===i.type){if(n=a.done?f:v,i.arg===p)continue;return{value:i.arg,done:a.done}}"throw"===i.type&&(n=f,a.method="throw",a.arg=i.arg)}}}(e,a,l),o}function s(e,t,a){try{return{type:"normal",arg:e.call(t,a)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var m="suspendedStart",v="suspendedYield",d="executing",f="completed",p={};function h(){}function V(){}function y(){}var b={};i(b,o,(function(){return this}));var w=Object.getPrototypeOf,g=w&&w(w(B([])));g&&g!==a&&n.call(g,o)&&(b=g);var x=y.prototype=h.prototype=Object.create(b);function N(e){["next","throw","return"].forEach((function(t){i(e,t,(function(e){return this._invoke(t,e)}))}))}function L(e,t){function a(r,o,l,u){var i=s(e[r],e,o);if("throw"!==i.type){var c=i.arg,m=c.value;return m&&"object"==typeof m&&n.call(m,"__await")?t.resolve(m.__await).then((function(e){a("next",e,l,u)}),(function(e){a("throw",e,l,u)})):t.resolve(m).then((function(e){c.value=e,l(c)}),(function(e){return a("throw",e,l,u)}))}u(i.arg)}var r;this._invoke=function(e,n){function o(){return new t((function(t,r){a(e,n,t,r)}))}return r=r?r.then(o,o):o()}}function k(e,a){var n=e.iterator[a.method];if(n===t){if(a.delegate=null,"throw"===a.method){if(e.iterator.return&&(a.method="return",a.arg=t,k(e,a),"throw"===a.method))return p;a.method="throw",a.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var r=s(n,e.iterator,a.arg);if("throw"===r.type)return a.method="throw",a.arg=r.arg,a.delegate=null,p;var o=r.arg;return o?o.done?(a[e.resultName]=o.value,a.next=e.nextLoc,"return"!==a.method&&(a.method="next",a.arg=t),a.delegate=null,p):o:(a.method="throw",a.arg=new TypeError("iterator result is not an object"),a.delegate=null,p)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function B(e){if(e){var a=e[o];if(a)return a.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,l=function a(){for(;++r<e.length;)if(n.call(e,r))return a.value=e[r],a.done=!1,a;return a.value=t,a.done=!0,a};return l.next=l}}return{next:O}}function O(){return{value:t,done:!0}}return V.prototype=y,i(x,"constructor",y),i(y,"constructor",V),V.displayName=i(y,u,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===V||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,i(e,u,"GeneratorFunction")),e.prototype=Object.create(x),e},e.awrap=function(e){return{__await:e}},N(L.prototype),i(L.prototype,l,(function(){return this})),e.AsyncIterator=L,e.async=function(t,a,n,r,o){void 0===o&&(o=Promise);var l=new L(c(t,a,n,r),o);return e.isGeneratorFunction(a)?l:l.next().then((function(e){return e.done?e.value:l.next()}))},N(x),i(x,u,"Generator"),i(x,o,(function(){return this})),i(x,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var a in e)t.push(a);return t.reverse(),function a(){for(;t.length;){var n=t.pop();if(n in e)return a.value=n,a.done=!1,a}return a.done=!0,a}},e.values=B,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var a in this)"t"===a.charAt(0)&&n.call(this,a)&&!isNaN(+a.slice(1))&&(this[a]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var a=this;function r(n,r){return u.type="throw",u.arg=e,a.next=n,r&&(a.method="next",a.arg=t),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var l=this.tryEntries[o],u=l.completion;if("root"===l.tryLoc)return r("end");if(l.tryLoc<=this.prev){var i=n.call(l,"catchLoc"),c=n.call(l,"finallyLoc");if(i&&c){if(this.prev<l.catchLoc)return r(l.catchLoc,!0);if(this.prev<l.finallyLoc)return r(l.finallyLoc)}else if(i){if(this.prev<l.catchLoc)return r(l.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return r(l.finallyLoc)}}}},abrupt:function(e,t){for(var a=this.tryEntries.length-1;a>=0;--a){var r=this.tryEntries[a];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var l=o?o.completion:{};return l.type=e,l.arg=t,o?(this.method="next",this.next=o.finallyLoc,p):this.complete(l)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var a=this.tryEntries[t];if(a.finallyLoc===e)return this.complete(a.completion,a.afterLoc),T(a),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var a=this.tryEntries[t];if(a.tryLoc===e){var n=a.completion;if("throw"===n.type){var r=n.arg;T(a)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,a,n){return this.delegate={iterator:B(e),resultName:a,nextLoc:n},"next"===this.method&&(this.arg=t),p}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}},o={};function l(e){var t=o[e];if(void 0!==t)return t.exports;var a=o[e]={exports:{}};return r[e](a,a.exports,l),a.exports}l.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return l.d(t,{a:t}),t},l.d=(e,t)=>{for(var a in t)l.o(t,a)&&!l.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var u={};(()=>{l.d(u,{Z:()=>y});const r=(o={PropTypes:()=>e.PropTypes,withInstall:()=>e.withInstall},i={},l.d(i,o),i);var o,i;const c=(e=>{var t={};return l.d(t,e),t})({computed:()=>t.computed,createTextVNode:()=>t.createTextVNode,createVNode:()=>t.createVNode,defineComponent:()=>t.defineComponent,nextTick:()=>t.nextTick,onMounted:()=>t.onMounted,ref:()=>t.ref,watch:()=>t.watch});var s=l(7162),m=l.n(s);Object.create,Object.create;const v=(e=>{var t={};return l.d(t,e),t})({default:()=>a.default}),d=(e=>{var t={};return l.d(t,e),t})({default:()=>n.default}),f=(0,c.defineComponent)({name:"SliderButton",props:{modelValue:{type:Number,default:0},params:{type:Object,default:function(){return{}}}},emits:["emitChange","resetSize","update:modelValue"],setup:function(e,t){var a=t.emit,n=(0,c.ref)(!1),r=(0,c.ref)(!1),o=(0,c.ref)(0),l=(0,c.ref)(0),u=(0,c.ref)(0),i=(0,c.ref)(null),s=(0,c.ref)(e.modelValue),m=(0,c.ref)(0),v=(0,c.ref)(0),f=(0,c.ref)(!1),V=(0,c.ref)(null),y=(0,c.computed)((function(){var t,a,n="";if(null===(t=e.params.customContent)||void 0===t?void 0:t[e.modelValue]){var r=e.params.customContent[e.modelValue];n=r.tip||r.label||""}var o=e.params.vertical?"right":"top";return(null===(a=e.params)||void 0===a?void 0:a.showTip)?{content:e.params.formatterTipLabel("".concat(n||(null==e?void 0:e.modelValue)||"0")),placement:o}:{content:"",placement:o}})),b=(0,c.computed)((function(){return"".concat((e.modelValue-e.params.minValue)/(e.params.maxValue-e.params.minValue)*100,"%")})),w=(0,c.computed)((function(){return e.params.vertical?{bottom:b.value}:{left:b.value}})),g=(0,c.computed)((function(){return e.params.formatterButtonLabel(e.modelValue)})),x=function(t){e.params.disable||(t.preventDefault(),N(t),p(window,"mousemove",L),p(window,"touchmove",L),p(window,"mouseup",k),p(window,"touchend",k))},N=function(t){n.value=!0,r.value=!0,e.params.vertical?o.value=t.clientY:l.value=t.clientX,u.value=parseFloat(b.value),i.value=u.value},L=function(t){if(n.value){r.value=!1,a("resetSize");var c=0;e.params.vertical?(m.value=t.clientY,c=(o.value-m.value)/e.params.sliderSize*100):(v.value=t.clientX,c=(v.value-l.value)/e.params.sliderSize*100),i.value=u.value+c,C(i.value)}},k=function e(){f.value=!1,n.value&&(setTimeout((function(){n.value=!1,r.value||(C(i.value),a("emitChange"))}),0),h(window,"mousemove",L),h(window,"touchmove",L),h(window,"mouseup",e),h(window,"touchend",e))},C=function(t){if(null!==t&&!isNaN(t)){t<0?i.value=0:t>100&&(i.value=100);var r=100/((e.params.maxValue-e.params.minValue)/e.params.step),o=Math.round(t/r)*r*(e.params.maxValue-e.params.minValue)*.01+e.params.minValue;o=parseFloat(o.toFixed(e.params.precision)),a("update:modelValue",o),n.value||e.modelValue===s.value||(s.value=e.modelValue)}};return{renderDom:function(){return(0,c.createVNode)("div",{class:["bk-slider-button",e.params.vertical?"vertical":"horizontal",{grabbing:n.value}],ref:V,tabindex:"0",style:w.value,onClick:function(e){return e.stopPropagation()},onMousedown:x},[Boolean(y.value.content)?(0,c.createVNode)(d.default,{content:y.value.content,theme:"dark",placement:y.value.placement,boundary:document.body},{default:function(){return[(0,c.createVNode)("div",{class:["slider-button",{"slider-button-disable":e.params.disable}]},null)]}}):(0,c.createVNode)("div",{class:["slider-button",{"slider-button-disable":e.params.disable}]},null),e.params.showButtonLabel&&!e.params.showIntervalLabel?(0,c.createVNode)("div",{class:["slider-button-label",e.params.vertical?"vertical":"horizontal"]},[g.value]):void 0])},setPosition:C,tip:y}},render:function(){return this.renderDom()}});var p=function(e,t,a){e&&t&&a&&e.addEventListener(t,a,!1)},h=function(e,t,a){e&&t&&a&&e.removeEventListener(t,a,!1)};const V=(0,c.defineComponent)({name:"Slider",props:{modelValue:r.PropTypes.oneOfType([r.PropTypes.array,r.PropTypes.number]),extCls:{type:String,default:""},vertical:{type:Boolean,default:!1},height:{type:String,default:"200px"},disable:{type:Boolean,default:!1},showTip:{type:Boolean,default:!1},maxValue:{type:[Number],default:100},minValue:{type:[Number],default:0},step:{type:[Number],default:1},range:{type:Boolean,default:!1},showInterval:{type:Boolean,default:!1},showIntervalLabel:{type:Boolean,default:!1},showButtonLabel:{type:Boolean,default:!1},showBetweenLabel:{type:Boolean,default:!1},showInput:{type:Boolean,default:!1},customContent:{type:Object,default:null},formatterLabel:{type:Function,default:function(e){return e}},formatterButtonLabel:{type:Function,default:function(e){return e}},formatterTipLabel:{type:Function,default:function(e){return e}}},emits:["update:modelValue","change"],setup:function(e,t){var a=this,n=t.slots,r=t.emit,o=(0,c.ref)(1),l=(0,c.ref)(null),u=(0,c.ref)(null),i=(0,c.ref)(null),s=(0,c.ref)(0),d=(0,c.ref)(0),h=(0,c.ref)(null),V=(0,c.ref)(null),y=(0,c.ref)(null),b=(0,c.ref)(null),w=(0,c.computed)((function(){var t=[e.minValue,e.maxValue,e.step].map((function(e){var t="".concat(e).split(".")[1];return t?t.length:0}));return Math.max.apply(null,t)})),g=(0,c.computed)((function(){return Math.min(l.value,u.value)})),x=(0,c.computed)((function(){return Math.max(l.value,u.value)})),N=(0,c.computed)((function(){return e.range?"".concat(100*(x.value-g.value)/(e.maxValue-e.minValue),"%"):"".concat(100*(l.value-e.minValue)/(e.maxValue-e.minValue),"%")})),L=(0,c.computed)((function(){return e.range?"".concat(100*(g.value-e.minValue)/(e.maxValue-e.minValue),"%"):"0%"})),k=(0,c.computed)((function(){return e.vertical?{height:N.value,bottom:L.value}:{width:N.value,left:L.value}})),C=(0,c.computed)((function(){if(!e.showInterval||e.minValue>e.maxValue)return[];if(0===e.step)return console.warn("WARNNING:step should not be 0"),[];for(var t=(e.maxValue-e.minValue)/e.step,a=100*e.step/(e.maxValue-e.minValue),n=[],r=1;r<t;r++)n.push(r*a);return e.range?n.filter((function(t){return t<100*(g.value-e.minValue)/(e.maxValue-e.minValue)||t>100*(x.value-e.minValue)/(e.maxValue-e.minValue)})):n.filter((function(t){return t>100*(l.value-e.minValue)/(e.maxValue-e.minValue)}))})),T=(0,c.computed)((function(){return e.vertical?{height:e.height,width:"4px"}:{}})),E=(0,c.computed)((function(){if(!e.showIntervalLabel)return[];if(0===e.step)return console.warn("WARNNING:step should not be 0"),[];for(var t=100*e.step/(e.maxValue-e.minValue),a=[],n=e.minValue,r=0;n<=e.maxValue;n+=e.step,r++){var o={stepWidth:r*t,stepLabel:e.formatterLabel(n)};a.push(o)}return a})),B=(0,c.computed)((function(){return Array.isArray(e.modelValue)})),O=(0,c.computed)((function(){return e.customContent?Object.keys(e.customContent).sort((function(e,t){return Number(e)-Number(t)})).filter((function(t){return Number(t)>=e.minValue&&Number(t)<=e.maxValue})).map((function(t){var a=e.customContent[t].tip,n=e.customContent[t].label;return{tip:a||n||"",label:n||"",percent:(Number(t)-e.minValue)/(e.maxValue-e.minValue)*100}})):[]})),I=(0,c.computed)((function(){return{vertical:e.vertical,showTip:e.showTip,disable:e.disable,maxValue:e.maxValue,minValue:e.minValue,step:e.step,precision:w.value,showButtonLabel:e.showButtonLabel,formatterButtonLabel:e.formatterButtonLabel,showIntervalLabel:e.showIntervalLabel,customContent:e.customContent,sliderSize:o.value,formatterTipLabel:e.formatterTipLabel}}));(0,c.watch)((function(){return e.modelValue}),(function(){_()})),(0,c.watch)((function(){return l.value}),(function(t){e.range?r("update:modelValue",[g.value,x.value]):r("update:modelValue",t),s.value=t})),(0,c.watch)((function(){return u.value}),(function(e){r("update:modelValue",[g.value,x.value]),d.value=e})),(0,c.onMounted)((function(){e.range?(Array.isArray(e.modelValue)?(l.value=Math.max(e.minValue,Number(e.modelValue[0])),u.value=Math.min(e.maxValue,Number(e.modelValue[1]))):(l.value=e.minValue,u.value=e.maxValue),i.value=[l.value,u.value]):("number"!=typeof e.modelValue||isNaN(e.modelValue)?l.value=e.minValue:l.value=Math.min(e.maxValue,Math.max(e.minValue,e.modelValue)),i.value=l.value),j(),p(window,"resize",j())}));var j=function(){h.value&&(o.value=h.value["client".concat(e.vertical?"Height":"Width")])},P=function(t){var a,n;if(t.stopPropagation(),!e.disable){if(j(),e.vertical){var r=null===(a=h.value)||void 0===a?void 0:a.getBoundingClientRect().bottom;F((r-t.clientY)/o.value*100)}else{var l=null===(n=h.value)||void 0===n?void 0:n.getBoundingClientRect().left;F((t.clientX-l)/o.value*100)}M()}},S=function(){return e.range?![g.value,x.value].every((function(e,t){return e===i.value[t]})):e.modelValue!==i.value},_=function(){if(e.minValue>e.maxValue)console.error("min should not be greater than max.");else{var t=e.modelValue;e.range&&Array.isArray(t)?t[1]<e.minValue?r("update:modelValue",[e.minValue,e.minValue]):t[0]>e.maxValue?r("update:modelValue",[e.maxValue,e.maxValue]):t[0]<e.minValue?r("update:modelValue",[e.minValue,t[1]]):t[1]>e.maxValue?r("update:modelValue",[t[0],e.maxValue]):(l.value=Number(t[0]),u.value=Number(t[1]),S()&&(i.value=t.slice())):e.range||"number"!=typeof t||isNaN(t)||(t<e.minValue?r("update:modelValue",e.minValue):t>e.maxValue?r("update:modelValue",e.maxValue):(l.value=t,S()&&(i.value=t)))}},M=function(){return t=a,n=void 0,o=void 0,l=m().mark((function t(){return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,c.nextTick)();case 2:r("change",e.range?[g.value,x.value]:e.modelValue);case 3:case"end":return t.stop()}}),t)})),new(o||(o=Promise))((function(e,a){function r(e){try{i(l.next(e))}catch(e){a(e)}}function u(e){try{i(l.throw(e))}catch(e){a(e)}}function i(t){var a;t.done?e(t.value):(a=t.value,a instanceof o?a:new o((function(e){e(a)}))).then(r,u)}i((l=l.apply(t,n||[])).next())}));var t,n,o,l},z=function(t){return e.vertical?{bottom:"".concat(t,"%")}:{left:"".concat(t,"%")}},F=function(t){if(e.range){var a=e.minValue+t*(e.maxValue-e.minValue)/100;Math.abs(g.value-a)<Math.abs(x.value-a)?b.value=l.value<u.value?V.value:y.value:b.value=l.value>u.value?V.value:y.value,b.value.setPosition(t)}else V.value.setPosition(t)},A=function(t){if(""!==t){var a=parseFloat(t);a<e.minValue?(s.value=e.minValue,l.value=e.minValue):a>e.maxValue?(s.value=e.maxValue,l.value=e.maxValue):l.value=a}},G=function(t){if(""!==t&&"number"!=typeof t){var a=parseFloat(t);a<e.minValue?(d.value=e.minValue,u.value=e.minValue):a>e.maxValue?(d.value=e.maxValue,u.value=e.maxValue):u.value=a}},R=function(t){var a;return a="start"===t?e.vertical?e.maxValue:e.minValue:e.vertical?e.minValue:e.maxValue,e.showButtonLabel&&[l.value,u.value].includes(a)?"0":"1"};return{renderDom:function(){var t,a;return(0,c.createVNode)("div",{class:["bk-slider",e.extCls]},[null===(t=n.start)||void 0===t?void 0:t.call(n),(0,c.createVNode)("div",{class:"bk-slider-runway",ref:h,style:T.value,onClick:P},[(0,c.createVNode)("div",{class:["bk-slider-bar",e.vertical?"vertical":"horizontal",{disable:e.disable}],style:k.value},null),e.showInterval?C.value.map((function(t,a){return(0,c.createVNode)("div",{key:a,class:["bk-slider-interval",{vertical:e.vertical}],style:z(t)},null)})):void 0,e.customContent?O.value.map((function(t,a){return(0,c.createVNode)("div",{key:a,class:["bk-slider-interval",{vertical:e.vertical}],style:z(t.percent)},null)})):void 0,e.showBetweenLabel||e.showIntervalLabel||e.customContent?(0,c.createVNode)("div",{class:["bk-slider-labels",e.vertical?"vertical":"horizontal"]},[e.showBetweenLabel?[(0,c.createVNode)("div",{class:"label-start",style:[{opacity:R("start")}]},[e.formatterLabel(e.minValue)]),(0,c.createVNode)("div",{class:"label-end",style:[{opacity:R("end")}]},[e.formatterLabel(e.maxValue)])]:e.showIntervalLabel?E.value.map((function(t,a){return(0,c.createVNode)("div",{class:["bk-slider-label",e.vertical?"vertical":"horizontal"],key:a,style:z(t.stepWidth)},[t.stepLabel])})):e.customContent?O.value.map((function(t,a){return(0,c.createVNode)("div",{class:["bk-slider-label",e.vertical?"vertical":"horizontal"],key:a,style:z(t.percent)},[t.label])})):void 0]):void 0,(0,c.createVNode)(f,{modelValue:l.value,"onUpdate:modelValue":function(e){return l.value=e},ref:V,params:I.value,onEmitChange:M,onResetSize:j},null),e.range?(0,c.createVNode)(f,{modelValue:u.value,"onUpdate:modelValue":function(e){return u.value=e},ref:y,params:I.value,onEmitChange:M,onResetSize:j},null):void 0]),e.showInput&&!e.vertical?(0,c.createVNode)("div",{class:"bk-slider-input"},[(0,c.createVNode)("div",{class:"input-item"},[(0,c.createVNode)(v.default,{type:"number",modelValue:s.value,max:e.maxValue,min:e.minValue,onChange:A},null)]),B.value&&u.value?[(0,c.createVNode)("div",{class:"input-center"},[(0,c.createTextVNode)("~")]),(0,c.createVNode)("div",{class:"input-item"},[(0,c.createVNode)(v.default,{type:"number",modelValue:d.value,max:e.maxValue,min:e.minValue,onChange:G},null)])]:void 0]):void 0,null===(a=n.end)||void 0===a?void 0:a.call(n)])}}},render:function(){return this.renderDom()}}),y=(0,r.withInstall)(V)})();var i=u.Z;export{i as default};
|
@@ -32,7 +32,8 @@
|
|
32
32
|
--input-broder-radius: 3px;
|
33
33
|
--input-shadow-color: #a3c5fd;
|
34
34
|
--input-horizontal-padding: 10px;
|
35
|
-
--input-block-color: #
|
35
|
+
--input-block-color: #f5f7fa;
|
36
|
+
--input-block-hover-color: #eaebf0;
|
36
37
|
--input-icon-size: var(--font-size-large);
|
37
38
|
--input-maxlength-color: #979ba5;
|
38
39
|
--button-primary-hover-color: #5594fa;
|
@@ -44,6 +45,8 @@
|
|
44
45
|
--button-danger-active-color: #db2626;
|
45
46
|
--button-success-active-color: #1ab943;
|
46
47
|
--button-warning-active-color: #eb9000;
|
48
|
+
--button-selected-bg-color: #e1ecff;
|
49
|
+
--button-disabled-selected-bg-color: #f0f1f5;
|
47
50
|
--fixed-navbar-background: #fff;
|
48
51
|
--fixed-navbar-boxshadow-color: rgba(0, 0, 0, 0.1);
|
49
52
|
--switch-default-color: #fff;
|