bkui-vue 0.0.2-beta.8 → 0.0.2-table-refactor.1
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 +70 -62
- package/dist/index.esm.js +16711 -16319
- package/dist/index.umd.js +72 -64
- package/dist/locale/en.esm.js +1 -1
- package/dist/locale/en.esm.js.map +1 -1
- package/dist/locale/en.umd.js +1 -1
- package/dist/locale/en.umd.js.map +1 -1
- package/dist/locale/zh-cn.esm.js +1 -1
- package/dist/locale/zh-cn.esm.js.map +1 -1
- package/dist/locale/zh-cn.umd.js +1 -1
- package/dist/locale/zh-cn.umd.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/style.variable.css +1 -1
- package/lib/affix/affix.d.ts +1 -1
- package/lib/affix/index.d.ts +4 -4
- package/lib/alert/alert.css +7 -0
- package/lib/alert/alert.d.ts +5 -5
- package/lib/alert/alert.less +16 -6
- package/lib/alert/alert.variable.css +7 -0
- package/lib/alert/index.d.ts +10 -10
- package/lib/animate-number/index.d.ts +1 -1
- package/lib/backtop/index.d.ts +1 -1
- package/lib/badge/badge.d.ts +2 -2
- package/lib/badge/index.d.ts +7 -7
- package/lib/breadcrumb/index.d.ts +2 -2
- package/lib/button/button.css +20 -0
- package/lib/button/button.less +105 -94
- package/lib/button/button.variable.css +20 -0
- package/lib/button/index.d.ts +2 -2
- package/lib/card/card.d.ts +1 -1
- package/lib/card/index.d.ts +4 -4
- package/lib/cascader/cascader.d.ts +1 -0
- package/lib/cascader/index.d.ts +5 -2
- package/lib/cascader/index.js +1 -1
- package/lib/cascader/interface.d.ts +1 -1
- package/lib/checkbox/checkbox-group.d.ts +6 -3
- package/lib/checkbox/checkbox.d.ts +4 -4
- package/lib/checkbox/index.d.ts +22 -19
- package/lib/checkbox/index.js +1 -1
- package/lib/code-diff/index.d.ts +1 -1
- package/lib/collapse/index.d.ts +2 -2
- package/lib/collapse-transition/index.d.ts +128 -2
- package/lib/collapse-transition/index.js +1 -1
- package/lib/color-picker/color-picker.d.ts +16 -0
- package/lib/color-picker/components/recommend-colors.d.ts +16 -0
- package/lib/color-picker/index.d.ts +19 -1
- package/lib/color-picker/index.js +1 -1
- package/lib/components.d.ts +1 -1
- package/lib/config-provider/config-provider.d.ts +3 -0
- package/lib/config-provider/index.d.ts +5 -1
- package/lib/config-provider/index.js +1 -1
- package/lib/config-provider/token.d.ts +1 -0
- package/lib/config-provider/use-global-config.d.ts +2 -0
- package/lib/config-provider/use-prefix.d.ts +2 -0
- package/lib/container/index.d.ts +2 -2
- package/lib/container/index.js +1 -1
- package/lib/date-picker/date-picker.d.ts +3 -1
- package/lib/date-picker/index.d.ts +12 -5
- package/lib/date-picker/index.js +1 -1
- package/lib/date-picker/panel/date-range.d.ts +2 -1
- package/lib/dialog/index.d.ts +1 -1
- package/lib/directives/index.js +1 -1
- package/lib/directives/tooltips.d.ts +3 -2
- package/lib/divider/index.d.ts +1 -1
- package/lib/dropdown/dropdown.css +1 -0
- package/lib/dropdown/dropdown.d.ts +1 -1
- package/lib/dropdown/dropdown.variable.css +1 -0
- package/lib/dropdown/index.d.ts +7 -7
- package/lib/exception/index.d.ts +2 -2
- package/lib/fixed-navbar/index.d.ts +1 -1
- package/lib/form/index.d.ts +3 -3
- package/lib/form/index.js +1 -1
- package/lib/hooks.d.ts +1 -1
- package/lib/hooks.js +1 -1
- package/lib/icon/assistant.d.ts +4 -0
- package/lib/icon/assistant.js +1 -0
- package/lib/icon/index.d.ts +1 -0
- package/lib/icon/index.js +1 -1
- package/lib/image/index.d.ts +1 -1
- package/lib/image/index.js +1 -1
- package/lib/info-box/index.js +1 -1
- package/lib/input/index.d.ts +146 -50
- package/lib/input/index.js +2 -1
- package/lib/input/index.js.LICENSE.txt +1 -0
- package/lib/input/input.css +34 -6
- package/lib/input/input.d.ts +100 -11
- package/lib/input/input.less +53 -14
- package/lib/input/input.variable.css +34 -6
- package/lib/input/util.d.ts +6 -0
- package/lib/link/index.d.ts +4 -4
- package/lib/link/link.d.ts +1 -1
- package/lib/loading/index.d.ts +2 -2
- package/lib/locale/index.js +1 -1
- package/lib/locale/lang/en.d.ts +1 -0
- package/lib/menu/index.d.ts +2 -2
- package/lib/message/index.js +1 -1
- package/lib/message/message.css +33 -9
- package/lib/message/message.less +78 -54
- package/lib/message/message.variable.css +33 -9
- package/lib/message/messageConstructor.d.ts +30 -8
- package/lib/modal/index.d.ts +2 -2
- package/lib/modal/index.js +1 -1
- package/lib/navigation/index.d.ts +4 -1
- package/lib/navigation/index.js +1 -1
- package/lib/navigation/navigation.d.ts +1 -0
- package/lib/notify/index.js +1 -1
- package/lib/notify/notifyConstructor.d.ts +1 -1
- package/lib/overflow-title/components/overflow-title.d.ts +257 -1
- package/lib/overflow-title/index.d.ts +387 -2
- package/lib/overflow-title/index.js +1 -1
- package/lib/overflow-title/props.d.ts +129 -0
- package/lib/pagination/index.d.ts +2 -2
- package/lib/plugin-popover/index.js +1 -1
- package/lib/pop-confirm/index.d.ts +1 -1
- package/lib/popover/const.d.ts +22 -9
- package/lib/popover/content.d.ts +33 -0
- package/lib/popover/index.d.ts +154 -61
- package/lib/popover/index.js +1 -1
- package/lib/popover/popover.css +1 -0
- package/lib/popover/popover.d.ts +64 -23
- package/lib/popover/popover.less +3 -2
- package/lib/popover/popover.variable.css +1 -0
- package/lib/popover/props.d.ts +29 -4
- package/lib/popover/use-floating.d.ts +2 -2
- package/lib/popover/use-popover-init.d.ts +2 -1
- package/lib/popover2/index.d.ts +1 -1
- package/lib/preset.d.ts +2 -0
- package/lib/process/index.d.ts +1 -1
- package/lib/progress/index.d.ts +1 -1
- package/lib/radio/index.d.ts +23 -23
- package/lib/radio/radio-button.d.ts +4 -4
- package/lib/radio/radio-group.d.ts +4 -4
- package/lib/radio/radio.d.ts +4 -4
- package/lib/rate/index.d.ts +8 -4
- package/lib/rate/index.js +1 -1
- package/lib/rate/rate.d.ts +2 -1
- package/lib/resize-layout/index.d.ts +4 -4
- package/lib/resize-layout/index.js +1 -1
- package/lib/resize-layout/resize-layout.css +12 -0
- package/lib/resize-layout/resize-layout.d.ts +1 -1
- package/lib/resize-layout/resize-layout.less +12 -0
- package/lib/resize-layout/resize-layout.variable.css +12 -0
- package/lib/search-select/index.d.ts +62 -29
- package/lib/search-select/index.js +1 -1
- package/lib/search-select/input.d.ts +5 -1
- package/lib/search-select/menu.d.ts +33 -2
- package/lib/search-select/search-select.css +31 -11
- package/lib/search-select/search-select.d.ts +23 -20
- package/lib/search-select/search-select.less +29 -10
- package/lib/search-select/search-select.variable.css +31 -11
- package/lib/search-select/selected.d.ts +5 -1
- package/lib/search-select/utils.d.ts +13 -5
- package/lib/select/index.d.ts +180 -84
- package/lib/select/index.js +1 -1
- package/lib/select/option.d.ts +11 -0
- package/lib/select/select.css +9 -1
- package/lib/select/select.d.ts +75 -37
- package/lib/select/select.less +11 -1
- package/lib/select/select.variable.css +9 -1
- package/lib/select/selectTagInput.d.ts +8 -5
- package/lib/shared/helper.d.ts +1 -1
- package/lib/shared/index.js +1 -1
- package/lib/shared/mask-manager.d.ts +3 -4
- package/lib/shared/pop-manager.d.ts +6 -2
- package/lib/shared/popover.d.ts +2 -2
- package/lib/shared/vue-types.d.ts +3 -2
- package/lib/sideslider/index.d.ts +1 -1
- package/lib/slider/index.d.ts +1 -1
- package/lib/slider/index.js +1 -1
- package/lib/steps/index.d.ts +1 -1
- package/lib/steps/index.js +1 -1
- package/lib/styles/mixins/popper.less +6 -5
- package/lib/swiper/index.d.ts +1 -1
- package/lib/swiper/index.js +1 -1
- package/lib/swiper/swiper.css +0 -6
- package/lib/swiper/swiper.less +0 -8
- package/lib/swiper/swiper.variable.css +0 -6
- package/lib/switcher/index.d.ts +30 -16
- package/lib/switcher/index.js +1 -1
- package/lib/switcher/switcher.d.ts +74 -5
- package/lib/tab/index.d.ts +3 -3
- package/lib/tab/tab-nav.d.ts +12 -2
- package/lib/tab/tab-panel.d.ts +1 -1
- package/lib/table/components/table-cell.d.ts +22 -15
- package/lib/table/components/table-column.d.ts +154 -219
- package/lib/table/const.d.ts +34 -56
- package/lib/table/events.d.ts +180 -0
- package/lib/table/index.d.ts +746 -440
- package/lib/table/index.js +1 -1
- package/lib/table/plugins/head-filter.css +3 -0
- package/lib/table/plugins/head-filter.d.ts +3 -7
- package/lib/table/plugins/head-filter.less +3 -0
- package/lib/table/plugins/head-filter.variable.css +3 -0
- package/lib/table/plugins/head-sort.d.ts +3 -7
- package/lib/table/plugins/settings.d.ts +12 -26
- package/lib/table/plugins/use-column-resize.d.ts +30 -10
- package/lib/table/plugins/use-fixed-column.d.ts +7 -5
- package/lib/table/plugins/use-pagination.d.ts +7 -4
- package/lib/table/props.d.ts +219 -181
- package/lib/table/render.d.ts +12 -20
- package/lib/table/table.css +85 -5
- package/lib/table/table.d.ts +227 -104
- package/lib/table/table.less +75 -8
- package/lib/table/table.variable.css +85 -5
- package/lib/table/use-attributes.d.ts +55 -0
- package/lib/table/use-column.d.ts +175 -3
- package/lib/table/use-common.d.ts +1609 -76
- package/lib/table/use-render.d.ts +11 -0
- package/lib/table/utils.d.ts +30 -28
- package/lib/table-column/index.d.ts +237 -527
- package/lib/table-column/index.js +1 -1
- package/lib/tag/index.d.ts +10 -10
- package/lib/tag/index.js +1 -1
- package/lib/tag/tag.d.ts +5 -5
- package/lib/tag-input/index.d.ts +49 -13
- package/lib/tag-input/index.js +1 -1
- package/lib/tag-input/tag-input.css +6 -1
- package/lib/tag-input/tag-input.d.ts +46 -10
- package/lib/tag-input/tag-input.less +9 -4
- package/lib/tag-input/tag-input.variable.css +6 -1
- package/lib/tag-input/tag-props.d.ts +16 -4
- package/lib/time-picker/index.d.ts +1 -1
- package/lib/timeline/index.d.ts +1 -1
- package/lib/transfer/index.d.ts +1 -1
- package/lib/tree/constant.d.ts +2 -2
- package/lib/tree/index.d.ts +37 -7
- package/lib/tree/index.js +1 -1
- package/lib/tree/props.d.ts +8 -1
- package/lib/tree/tree.d.ts +20 -2
- package/lib/tree/use-node-action.d.ts +3 -2
- package/lib/tree/use-node-attribute.d.ts +15 -8
- package/lib/tree/use-tree-init.d.ts +1 -2
- package/lib/tree/util.d.ts +7 -2
- package/lib/upload/index.d.ts +1 -1
- package/lib/virtual-render/index.d.ts +43 -1
- package/lib/virtual-render/index.js +1 -1
- package/lib/virtual-render/props.d.ts +15 -0
- package/lib/virtual-render/v-virtual-render.d.ts +1 -0
- package/lib/virtual-render/virtual-render.d.ts +27 -2
- package/lib/volar.components.d.ts +24 -24
- package/package.json +17 -16
@@ -1,2 +1,2 @@
|
|
1
1
|
/*! For license information please see index.js.LICENSE.txt */
|
2
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("../shared"),require("vue"),require("../config-provider"),require("../directives"),require("../icon"),require("../popover"));else if("function"==typeof define&&define.amd)define(["../shared","vue","../config-provider","../directives","../icon","../popover"],t);else{var n="object"==typeof exports?t(require("../shared"),require("vue"),require("../config-provider"),require("../directives"),require("../icon"),require("../popover")):t(e["../shared"],e.vue,e["../config-provider"],e["../directives"],e["../icon"],e["../popover"]);for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(self,((e,t,n,r,i,o)=>(()=>{var a={2717:e=>{"use strict";e.exports=n},4061:e=>{"use strict";e.exports=r},6870:e=>{"use strict";e.exports=i},5537:e=>{"use strict";e.exports=o},4212:t=>{"use strict";t.exports=e},748:e=>{"use strict";e.exports=t},7609:(e,t,n)=>{var r=n(7425).default;function i(){"use strict";e.exports=i=function(){return t},e.exports.__esModule=!0,e.exports.default=e.exports;var t={},n=Object.prototype,o=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},l="function"==typeof Symbol?Symbol:{},u=l.iterator||"@@iterator",s=l.asyncIterator||"@@asyncIterator",c=l.toStringTag||"@@toStringTag";function d(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(e,t,n){return e[t]=n}}function v(e,t,n,r){var i=t&&t.prototype instanceof p?t:p,o=Object.create(i.prototype),l=new I(r||[]);return a(o,"_invoke",{value:E(e,n,l)}),o}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=v;var h={};function p(){}function m(){}function y(){}var g={};d(g,u,(function(){return this}));var _=Object.getPrototypeOf,b=_&&_(_(N([])));b&&b!==n&&o.call(b,u)&&(g=b);var w=y.prototype=p.prototype=Object.create(g);function x(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function n(i,a,l,u){var s=f(e[i],e,a);if("throw"!==s.type){var c=s.arg,d=c.value;return d&&"object"==r(d)&&o.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,l,u)}),(function(e){n("throw",e,l,u)})):t.resolve(d).then((function(e){c.value=e,l(c)}),(function(e){return n("throw",e,l,u)}))}u(s.arg)}var i;a(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(o,o):o()}})}function E(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return{value:void 0,done:!0}}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var l=S(a,n);if(l){if(l===h)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=f(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function S(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var i=f(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,h;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function L(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 C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function N(e){if(e){var t=e[u];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(o.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:V}}function V(){return{value:void 0,done:!0}}return m.prototype=y,a(w,"constructor",{value:y,configurable:!0}),a(y,"constructor",{value:m,configurable:!0}),m.displayName=d(y,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,d(e,c,"GeneratorFunction")),e.prototype=Object.create(w),e},t.awrap=function(e){return{__await:e}},x(k.prototype),d(k.prototype,s,(function(){return this})),t.AsyncIterator=k,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new k(v(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},x(w),d(w,c,"Generator"),d(w,u,(function(){return this})),d(w,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=N,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!e)for(var t in this)"t"===t.charAt(0)&&o.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},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 t=this;function n(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var l=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(l&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.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 i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.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),C(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 i=r.arg;C(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:N(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},t}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},7425:e=>{function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},2841:(e,t,n)=>{var r=n(7609)();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}},l={};function u(e){var t=l[e];if(void 0!==t)return t.exports;var n=l[e]={exports:{}};return a[e](n,n.exports,u),n.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 n in t)u.o(t,n)&&!u.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},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 s={};return(()=>{"use strict";u.r(s),u.d(s,{BkSearchSelect:()=>A,default:()=>M});var e=u(4212);function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function n(e){var n=function(e,n){if("object"!==t(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,"string");if("object"!==t(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===t(n)?n:String(n)}function r(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var i=u(748),o=null,a=null;function l(e,t){void 0===t&&(t={});var n=document.createElement(e);return Object.keys(t).forEach((function(e){n[e]=t[e]})),n}function c(e,t,n){return(window.getComputedStyle(e,n||null)||{display:"none"})[t]}function d(e){if(!document.documentElement.contains(e))return{detached:!0,rendered:!1};for(var t=e;t!==document;){if("none"===c(t,"display"))return{detached:!1,rendered:!1};t=t.parentNode}return{detached:!1,rendered:!0}}var v=0,f=null;function h(e,t){if(e.__resize_mutation_handler__||(e.__resize_mutation_handler__=p.bind(e)),!e.__resize_listeners__)if(e.__resize_listeners__=[],window.ResizeObserver){var n=e.offsetWidth,r=e.offsetHeight,i=new ResizeObserver((function(){(e.__resize_observer_triggered__||(e.__resize_observer_triggered__=!0,e.offsetWidth!==n||e.offsetHeight!==r))&&y(e)})),o=d(e),a=o.detached,u=o.rendered;e.__resize_observer_triggered__=!1===a&&!1===u,e.__resize_observer__=i,i.observe(e)}else if(e.attachEvent&&e.addEventListener)e.__resize_legacy_resize_handler__=function(){y(e)},e.attachEvent("onresize",e.__resize_legacy_resize_handler__),document.addEventListener("DOMSubtreeModified",e.__resize_mutation_handler__);else if(v||(f=function(e){var t=document.createElement("style");return t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e)),(document.querySelector("head")||document.body).appendChild(t),t}('.resize-triggers{visibility:hidden;opacity:0;pointer-events:none}.resize-contract-trigger,.resize-contract-trigger:before,.resize-expand-trigger,.resize-triggers{content:"";position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden}.resize-contract-trigger,.resize-expand-trigger{background:#eee;overflow:auto}.resize-contract-trigger:before{width:200%;height:200%}')),function(e){var t=c(e,"position");t&&"static"!==t||(e.style.position="relative"),e.__resize_old_position__=t,e.__resize_last__={};var n=l("div",{className:"resize-triggers"}),r=l("div",{className:"resize-expand-trigger"}),i=l("div"),o=l("div",{className:"resize-contract-trigger"});r.appendChild(i),n.appendChild(r),n.appendChild(o),e.appendChild(n),e.__resize_triggers__={triggers:n,expand:r,expandChild:i,contract:o},g(e),e.addEventListener("scroll",m,!0),e.__resize_last__={width:e.offsetWidth,height:e.offsetHeight}}(e),e.__resize_rendered__=d(e).rendered,window.MutationObserver){var s=new MutationObserver(e.__resize_mutation_handler__);s.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0}),e.__resize_mutation_observer__=s}e.__resize_listeners__.push(t),v++}function p(){var e=d(this),t=e.rendered,n=e.detached;t!==this.__resize_rendered__&&(!n&&this.__resize_triggers__&&(g(this),this.addEventListener("scroll",m,!0)),this.__resize_rendered__=t,y(this))}function m(){var e,t,n=this;g(this),this.__resize_raf__&&(e=this.__resize_raf__,a||(a=(window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||function(e){clearTimeout(e)}).bind(window)),a(e)),this.__resize_raf__=(t=function(){var e,t,r,i,o,a,l=(r=(t=(e=n).__resize_last__).width,i=t.height,o=e.offsetWidth,a=e.offsetHeight,o!==r||a!==i?{width:o,height:a}:null);l&&(n.__resize_last__=l,y(n))},o||(o=(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){return setTimeout(e,16)}).bind(window)),o(t))}function y(e){e&&e.__resize_listeners__&&e.__resize_listeners__.forEach((function(t){t.call(e,e)}))}function g(e){var t=e.__resize_triggers__,n=t.expand,r=t.expandChild,i=t.contract,o=i.scrollWidth,a=i.scrollHeight,l=n.offsetWidth,u=n.offsetHeight,s=n.scrollWidth,c=n.scrollHeight;i.scrollLeft=o,i.scrollTop=a,r.style.width=l+1+"px",r.style.height=u+1+"px",n.scrollLeft=s,n.scrollTop=c}var _=u(2717),b=u(4061),w=u(6870),x=u(2841),k=u.n(x);function E(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function l(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}u((r=r.apply(e,t||[])).next())}))}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;var S=u(5537),L=u.n(S);const C=(0,i.defineComponent)({name:"SearchSelectMenu",props:{list:{type:Array},hoverId:String,keyword:{type:String,default:""},multiple:{type:Boolean,default:!1},selected:{type:Array,default:function(){return[]}},conditions:{type:Array},footerBtns:{type:Array,default:function(){return[]}}},emits:["selectItem","selectCondition","footerClick"],setup:function(e,t){var n=t.emit,r=(0,_.useLocale)("searchSelect"),o=(0,_.usePrefix)().resolveClassName,a=(0,i.computed)((function(){return void 0===e.footerBtns||0===e.footerBtns.length?[{id:"confirm",name:r.value.ok},{id:"cancel",name:r.value.cancel,disabled:!1}]:e.footerBtns}));return{handleClick:function(e){n("selectItem",e)},handleClickCondition:function(e){n("selectCondition",e)},handleClickFooterBtn:function(e){n("footerClick",e)},filterList:(0,i.computed)((function(){var t,n;return(null===(t=e.list)||void 0===t?void 0:t.length)?(null===(n=e.keyword)||void 0===n?void 0:n.length)?e.list.filter((function(t){return t.name.toLocaleLowerCase().includes(e.keyword.toLocaleLowerCase())})):e.list:[]})),getSearchNode:function(t){var n;return(null===(n=t.value)||void 0===n?void 0:n.name)?[(0,i.createVNode)("span",{class:"menu-name"},[t.name,(0,i.createTextVNode)(":")]),t.value.name]:function(t){if(!t)return t;var n=e.keyword,r=n.length;if(!(null==n?void 0:n.trim().length)||!t.toLocaleLowerCase().includes(n.toLocaleLowerCase()))return t;var o=[],a=-1;return n=n.replace(/([.*/]{1})/gim,"\\$1"),t.replace(new RegExp("".concat(n),"igm"),(function(e,n){return 0===o.length&&0!==n?o.push(t.slice(0,n)):a>=0&&o.push(t.slice(a+e.length,n)),o.push((0,i.createVNode)("span",{class:"is-keyword"},[e])),a=n,e})),a>=0&&o.push(t.slice(a+r)),o.length?o:t}(t.name)},localFooterBtns:a,resolveClassName:o}},render:function(){var e,t,n,r=this;return(0,i.createVNode)("div",{class:this.resolveClassName("search-select-menu")},[!!(null===(e=this.conditions)||void 0===e?void 0:e.length)&&(0,i.createVNode)("ul",{class:"menu-header"},[this.conditions.map((function(e){return(0,i.createVNode)("li",{key:e.id,class:"menu-header-item ".concat(e.disabled?"is-disabled":""),onClick:function(){return!e.disabled&&r.handleClickCondition(e)}},[e.name])}))]),(0,i.createVNode)("ul",{class:"menu-content"},[null===(t=this.list)||void 0===t?void 0:t.map((function(e){return(0,i.createVNode)("li",{class:"menu-item ".concat(e.disabled?"is-disabled":""," ").concat(r.hoverId!==e.id||e.disabled?"":"is-hover"),key:e.id,id:e.id,tabindex:"-1",onClick:function(){return!e.disabled&&r.handleClick(e)}},[r.$slots.default?r.$slots.default({item:e,list:r.list,multiple:!!r.multiple,hoverId:r.hoverId,getSearchNode:r.getSearchNode}):(0,i.createVNode)(i.Fragment,null,[r.getSearchNode(e),r.multiple&&r.selected.includes(e.id)&&(0,i.createVNode)(w.Done,{class:"is-selected"},null)])])}))]),this.multiple&&(null===(n=this.localFooterBtns)||void 0===n?void 0:n.length)&&(0,i.createVNode)("div",{class:"menu-footer"},[this.localFooterBtns.map((function(e){return(0,i.createVNode)("span",{class:"menu-footer-btn ".concat(e.disabled?"is-disabled":""),key:e.id,onClick:function(){return!e.disabled&&r.handleClickFooterBtn(e)}},[e.name])}))])])}});function I(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,n(i.key),i)}}var N;!function(e){e.ALL="all",e.NEEDKEY="need-key"}(N||(N={}));var V,O=Symbol("SEARCH_SLECT_PROVIDER_KEY"),z=function(){return(0,i.inject)(O)};!function(e){e.DEFAULT="default",e.EDIT="edit"}(V||(V={}));var T=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"|";!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.searchItem=t,this.type=n,this.splitCode=r,this.values=[],this.id=t.id,this.name=t.name}var t,n;return t=e,(n=[{key:"multiple",get:function(){return!!this.searchItem.multiple}},{key:"placeholder",get:function(){return this.searchItem.placeholder||""}},{key:"children",get:function(){return this.searchItem.children||[]}},{key:"validate",get:function(){return!this.searchItem.noValidate}},{key:"inputInnerHtml",get:function(){var e;return this.isSpecialType()?this.name:"".concat(this.keyInnerHtml).concat((null===(e=this.values)||void 0===e?void 0:e.map((function(e){return e.name})).join(this.splitCode))||"")}},{key:"inputInnerText",get:function(){var e;return this.isSpecialType()?this.name:"".concat(this.keyInnerText).concat((null===(e=this.values)||void 0===e?void 0:e.map((function(e){return e.name})).join(this.splitCode))||"")}},{key:"keyInnerHtml",get:function(){return this.isSpecialType()?this.name:this.name?"".concat(this.name,": "):""}},{key:"keyInnerText",get:function(){return this.isSpecialType()?this.name:this.name?"".concat(this.name,": "):""}},{key:"isSpecialType",value:function(){return["text","condition"].includes(this.type)}},{key:"addValue",value:function(e){if(this.multiple){var t=this.values.findIndex((function(t){return t.id===e.id}));return t>-1?void this.values.splice(t,1):void this.values.push(e)}this.values=[e]}},{key:"toValue",value:function(){var e,t={id:this.id,name:this.name};return(null===(e=this.values)||void 0===e?void 0:e.length)&&(t.values=this.values.map((function(e){return{id:e.id,name:e.name}}))),this.type&&"default"!==this.type&&(t.type=this.type),t}},{key:"toValueKey",value:function(){return JSON.stringify(this.toValue())}},{key:"isInValueList",value:function(e){return this.children.some((function(t){return t.id===(null==e?void 0:e.id)}))}}])&&I(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();const j=(0,i.defineComponent)({name:"SearchSelectInput",directives:{clickoutside:b.clickoutside},props:{data:{type:Array,required:!0},showInputBefore:Boolean,showCondition:Boolean,clickOutside:Function,placeholder:String,conditions:{type:Array,default:function(){return[]}},defautUsingItem:Object,mode:{type:String,default:V.DEFAULT},getMenuList:Function,validateValues:Function,valueBehavior:String},emits:["focus","add","delete"],setup:function(t,n){var r=n.emit,o=n.expose,a=(0,_.useLocale)("searchSelect"),l=(0,_.usePrefix)().resolveClassName,u=(0,i.ref)(null),s=(0,i.ref)(null),c=(0,i.ref)(""),d=(0,i.ref)(!1),v=(0,i.ref)(!1),f=(0,i.ref)(!1),h=(0,i.ref)(t.defautUsingItem),p=(0,i.ref)(""),m=(0,i.ref)(!1),y=(0,e.debounce)(300,q),g=!1,b=(0,i.ref)([]),w=(0,i.ref)([]),x=z(),S=x.editKey,L=x.onValidate,C=x.valueSplitCode;function I(e){switch(e.code){case"ArrowDown":case"ArrowUp":O(e);break;case"Enter":case"NumpadEnter":!function(e){if(g){e.preventDefault();var t=w.value.find((function(e){return e.id===p.value}));t&&B(t)}}(e)}}function O(e){var t;e.preventDefault(),null===(t=u.value)||void 0===t||t.blur();for(var n=w.value.length,r=n,i=w.value.findIndex((function(e){return e.id===p.value}));r>=0;){i=(i="ArrowDown"===e.code?i+1:i-1)>n-1?0:i<0?n-1:i;var o=w.value[i];if(o&&!o.disabled){r=-1;var a=document.getElementById(o.id);return null==a||a.focus(),void(p.value=o.id)}r-=1}}function j(e){M(),e&&q()}function F(e){var n;return E(this,void 0,void 0,k().mark((function i(){var o,a,l,u,s;return k().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return null==e||e.preventDefault(),i.next=3,new Promise((function(e){return setTimeout(e,0)}));case 3:if(h.value){i.next=16;break}if(c.value&&t.valueBehavior!==N.NEEDKEY){i.next=6;break}return i.abrupt("return");case 6:return o={id:c.value,name:c.value},i.next=9,D(o);case 9:if(i.sent){i.next=12;break}return i.abrupt("return");case 12:return r("add",new T(o,"text",C.value)),c.value="",q(),i.abrupt("return");case 16:if(null==(a=h.value.values)?void 0:a.length){i.next=43;break}if(!(null===(n=c.value)||void 0===n?void 0:n.length)){i.next=41;break}if(!c.value.includes(C.value)){i.next=29;break}return l=c.value.split(C.value),i.next=23,D({id:c.value,name:c.value});case 23:if(i.sent){i.next=26;break}return i.abrupt("return");case 26:l.forEach((function(e){return h.value.addValue({id:e,name:e})})),i.next=36;break;case 29:return u={id:c.value,name:c.value},i.next=32,D(u);case 32:if(i.sent){i.next=35;break}return i.abrupt("return");case 35:h.value.addValue(u);case 36:return r("add",h.value),c.value="",h.value=null,M(!0),i.abrupt("return");case 41:return d.value=!0,i.abrupt("return");case 43:if(!c.value){i.next=56;break}return s={id:c.value,name:c.value},i.next=47,D(s);case 47:if(i.sent){i.next=50;break}return i.abrupt("return");case 50:return h.value.addValue(s),r("add",h.value),c.value="",h.value=null,M(!0),i.abrupt("return");case 56:return i.next=58,D();case 58:if(i.sent){i.next=61;break}return i.abrupt("return");case 61:K();case 62:case"end":return i.stop()}}),i)})))}function B(e,n){var r,i,o,a,l,s;return E(this,void 0,void 0,k().mark((function d(){var v,m;return k().wrap((function(d){for(;;)switch(d.prev=d.next){case 0:if(!(null===(r=e.value)||void 0===r?void 0:r.id)){d.next=21;break}if((t.valueBehavior!==N.NEEDKEY||!e.value)&&t.validateValues){d.next=8;break}return(v=new T(Object.assign(Object.assign({},e),{id:null!==(i=e.realId)&&void 0!==i?i:e.id}),n,C.value)).addValue(e.value),K(v),t.valueBehavior===N.NEEDKEY&&p.value&&M(!0),p.value="",d.abrupt("return");case 8:return h.value=new T(Object.assign(Object.assign({},e),{id:null!==(o=e.realId)&&void 0!==o?o:e.id}),n,C.value),h.value.addValue(e.value),d.next=12,D(e.value);case 12:if(d.sent){d.next=16;break}return h.value=null,d.abrupt("return");case 16:return K(h.value),p.value="",M(!0),d.abrupt("return");case 21:if(h.value&&(null===(a=null==u?void 0:u.value)||void 0===a?void 0:a.innerText)){d.next=29;break}return h.value=new T(e,n,C.value),c.value="",(m="condition"===n)&&K(),f.value=m||!!h.value.children.length,M(t.valueBehavior===N.NEEDKEY&&!!p.value),d.abrupt("return");case 29:if("condition"!==(null===(l=h.value)||void 0===l?void 0:l.type)){d.next=33;break}return h.value=new T(e,n,C.value),K(),d.abrupt("return");case 33:return h.value.addValue(e),d.next=36,D(e);case 36:if(d.sent){d.next=39;break}return d.abrupt("return");case 39:h.value.multiple||K(),t.valueBehavior===N.NEEDKEY&&(null===(s=h.value)||void 0===s?void 0:s.multiple)&&M();case 41:case"end":return d.stop()}}),d)})))}function D(e){return E(this,void 0,void 0,k().mark((function n(){var r,i,o,a;return k().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(h.value){n.next=4;break}return n.next=3,A(null,[e]);case 3:case 8:return n.abrupt("return",n.sent);case 4:if(r=h.value,i=r.searchItem,o=r.validate,a=r.values,!o||"function"!=typeof t.validateValues){n.next=9;break}return n.next=8,A(i,e?[e]:a);case 9:return L(""),n.abrupt("return",!0);case 11:case"end":return n.stop()}}),n)})))}function A(e,n){var r;return E(this,void 0,void 0,k().mark((function i(){var o;return k().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,null===(r=t.validateValues)||void 0===r?void 0:r.call(t,null!=e?e:null,n).catch((function(){return!1}));case 2:if("string"!=typeof(o=i.sent)&&!1!==o){i.next=6;break}return L(o||"校验错误"),i.abrupt("return",!1);case 6:return L(""),i.abrupt("return",!0);case 8:case"end":return i.stop()}}),i)})))}function M(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&(0,i.nextTick)().then((function(){q()})),v.value=!0,f.value=!0,d.value=!1;var e=setTimeout((function(){if(u.value){u.value.focus();var t=window.getSelection();0===t.focusOffset&&(t.selectAllChildren(u.value),t.collapseToEnd())}window.clearTimeout(e)}),0);r("focus",v.value)}function q(){var n,r,i,o,a;return E(this,void 0,void 0,k().mark((function l(){var u,s;return k().wrap((function(l){for(;;)switch(l.prev=l.next){case 0:if(u=[],"function"!=typeof t.getMenuList||void 0!==(null===(r=null===(n=h.value)||void 0===n?void 0:n.searchItem)||void 0===r?void 0:r.async)&&!0!==h.value.searchItem.async){l.next=9;break}return m.value=!0,l.next=5,t.getMenuList(null===(i=h.value)||void 0===i?void 0:i.searchItem,c.value).catch((function(){return[]}));case 5:u=l.sent,m.value=!1,l.next=10;break;case 9:(null==h?void 0:h.value)?"condition"===h.value.type?u=t.conditions:(null===(a=h.value.values)||void 0===a?void 0:a.length)&&!h.value.multiple&&t.mode!==V.EDIT||(u=h.value.children.filter((function(e){return e.name.toLocaleLowerCase().includes(c.value.toLocaleLowerCase())}))):(null===(o=c.value)||void 0===o?void 0:o.length)?t.data.filter((function(e){return!e.isSelected})).forEach((function(t){var n,r;t.name.toLocaleLowerCase().includes(c.value.toLocaleLowerCase())?(u.push(t),null===(n=t.children)||void 0===n||n.forEach((function(n){u.push(Object.assign(Object.assign({},t),{realId:t.id,id:(0,e.random)(10),value:n}))})),u.push(Object.assign(Object.assign({},t),{realId:t.id,id:(0,e.random)(10),value:{id:c.value,name:c.value}}))):(null===(r=t.children)||void 0===r||r.forEach((function(n){n.name.toLocaleLowerCase().includes(c.value.toLocaleLowerCase())&&u.push(Object.assign(Object.assign({},t),{realId:t.id,id:(0,e.random)(10),value:n}))})),u.push(Object.assign(Object.assign({},t),{value:{id:c.value,name:c.value}})))})):u=t.data.filter((function(e){return!e.isSelected})).slice();case 10:w.value=u,t.valueBehavior===N.NEEDKEY&&(s=u.find((function(e){return!e.disabled})))&&(!p.value||p.value&&!u.some((function(e){return e.id===p.value})))&&(p.value=s.id);case 12:case"end":return l.stop()}}),l)})))}function K(e){r("add",null!=e?e:h.value),h.value=null,c.value="",M(t.valueBehavior===N.NEEDKEY)}function P(){var e=u.value.innerText;"\n"===e[e.length-1]||"\r"===e[0]?(H(e.slice(0,-1)),P()):"\n"!==e[0]&&"\r"!==e[0]||(H(e.slice(1)),P())}function H(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";u.value&&(u.value.innerHTML=t||(null===(e=h.value)||void 0===e?void 0:e.inputInnerHtml)||"")}return(0,i.watch)(S,(function(){t.mode===V.DEFAULT&&S.value&&(f.value=!1)})),(0,i.watchEffect)((function(){c.value||H()}),{flush:"pre"}),(0,i.watch)([w,f],(function(){var e;(null===(e=w.value)||void 0===e?void 0:e.some((function(e){return!e.disabled})))&&f.value?g||(t.valueBehavior===N.NEEDKEY?p.value=w.value.find((function(e){return!e.disabled})).id:p.value="",g=!0,document.addEventListener("keydown",I)):(document.removeEventListener("keydown",I),g=!1,t.valueBehavior!==N.NEEDKEY&&(p.value=""))})),o({handleInputFocus:j,isFocus:v}),{popoverRef:s,inputRef:u,keyword:c,loading:m,remoteMenuList:b,menuList:w,menuHoverId:p,isFocus:v,usingItem:h,showPopover:f,showNoSelectValueError:d,debounceSetMenuList:y,documentArrowEvent:O,handleClickOutside:function(e){var n,i;!(null===(n=s.value)||void 0===n?void 0:n.contains(e.target))&&(null===(i=t.clickOutside)||void 0===i?void 0:i.call(t,e.target,s.value))&&(f.value=!1,v.value=!1,r("focus",v.value))},handleInputFocus:j,handleInputChange:function(e){var t,n,r,i,o,a,l,s,d;P();var v=e.target.innerText;if(/(\r|\n)/gm.test(v)||/\s{2}/gm.test(v))e.preventDefault(),v=v.replace(/(\r|\n)/gm,C.value).replace(/\s{2}/gm,""),u.value.innerText=v,M(),c.value=v.replace((null===(t=h.value)||void 0===t?void 0:t.keyInnerText)||"","").trim(),y();else if(!c.value&&v.length<((null===(r=null===(n=h.value)||void 0===n?void 0:n.inputInnerText)||void 0===r?void 0:r.length)||1)){var f=v.replace(" "," ").replace((null===(i=h.value)||void 0===i?void 0:i.keyInnerText.replace(" "," ").trim())||"","").trim();if(v&&(null===(o=h.value)||void 0===o?void 0:o.keyInnerText)&&v.replace(" "," ").includes(h.value.keyInnerText.replace(" "," ").trim())&&f&&(null===(a=h.value.values)||void 0===a?void 0:a.length))return c.value=f,console.info("outerText",f),void y();!f&&(null==v?void 0:v.length)||(h.value=null),c.value=f?v:"",y()}else(null===(s=null===(l=h.value)||void 0===l?void 0:l.values)||void 0===s?void 0:s.length)||(c.value=v.replace(" "," ").replace((null===(d=h.value)||void 0===d?void 0:d.keyInnerText.replace(" "," "))||"","").trim(),M(),y())},handleInputKeyup:function(e){switch(e.code){case"Enter":case"NumpadEnter":if(t.valueBehavior===N.NEEDKEY&&w.value.some((function(e){return e.id===p.value})))return;F(e);break;case"Backspace":!function(){var e,n;if(!h.value&&!c.value)return r("delete"),void(0,i.nextTick)(q);if(null===(e=h.value)||void 0===e?void 0:e.values.length){if((null===(n=h.value)||void 0===n?void 0:n.multiple)||h.value.isInValueList(h.value.values[0])||t.mode===V.EDIT&&!c.value)return h.value.values.splice(-1,1),c.value="",void M()}else c.value||(h.value=null,c.value="",q());L("")}();default:d.value=!1}},handleSelectItem:B,handleSelectCondtionItem:function(e){B(e,"condition")},handleMenuFooterClick:function(e){var t;switch(e.id){case"confirm":if(!(null===(t=h.value)||void 0===t?void 0:t.values.length))return;c.value="",F();break;case"cancel":h.value.values=[],f.value=!1}},resolveClassName:l,t:a}},render:function(){var e,t,n=this,r=this.usingItem||{},o=r.multiple,a=r.values,l=r.placeholder,u=r.inputInnerHtml,s=!(null===(e=this.keyword)||void 0===e?void 0:e.length)&&!(null==a?void 0:a.length)&&l,c=this.loading||this.showNoSelectValueError||this.showPopover&&!!(null===(t=this.menuList)||void 0===t?void 0:t.length),d=!this.usingItem&&this.showCondition,v=Object.assign({},this.$slots.menu?{default:function(e){var t,r;return null===(r=(t=n.$slots).menu)||void 0===r?void 0:r.call(t,e)}}:{});return(0,i.createVNode)(L(),{trigger:"manual",theme:"light",placement:"bottom-start",arrow:!1,disableOutsideClick:!0,isShow:c},{default:function(){var e;return(0,i.withDirectives)((0,i.createVNode)("div",{ref:"inputRef",class:{"div-input":!0,"input-before":n.showInputBefore&&!(null===(e=n.keyword)||void 0===e?void 0:e.length),"input-after":s},contenteditable:!0,"data-placeholder":u||n.keyword?"":n.placeholder,"data-tips":l||"",spellcheck:"false",onFocus:n.handleInputFocus,onInput:n.handleInputChange,onKeydown:n.handleInputKeyup},null),[[(0,i.resolveDirective)("clickoutside"),n.handleClickOutside]])},content:function(){var e;return n.loading?(0,i.createVNode)("div",null,[n.t.loading]):n.showNoSelectValueError?(0,i.createVNode)("div",null,[n.t.filterQueryMustHasValue]):(null===(e=n.menuList)||void 0===e?void 0:e.length)?(0,i.createVNode)("div",{ref:"popoverRef",class:n.resolveClassName("search-select-popover")},[(0,i.createVNode)(C,{list:n.menuList,keyword:n.keyword,multiple:!!o,hoverId:n.menuHoverId,selected:(null==a?void 0:a.map((function(e){return e.id})))||[],conditions:d?n.conditions:[],onSelectItem:n.handleSelectItem,onSelectCondition:n.handleSelectCondtionItem,onFooterClick:n.handleMenuFooterClick},Object.assign({},v))]):void 0}})}}),F=(0,i.defineComponent)({name:"SearchSelected",props:{data:{type:Array,required:!0},selectedList:{type:Array,required:!0},overflowIndex:{type:Number,default:-1},conditions:{type:Array,default:function(){return[]}},getMenuList:Function,validateValues:Function,valueBehavior:String},emits:["delete"],setup:function(e,t){var n=t.emit,r=(0,i.ref)(null),o=z(),a=o.onEditClick,l=o.onEditEnter,u=o.onEditBlur,s=o.editKey,c=o.valueSplitCode;return{inputRef:r,editKey:s,copySeletedItem:function(e){var t=new T(e.searchItem,e.type,c.value);return t.values=e.values.slice(),t},handleDeleteSelected:function(e){n("delete",e)},handleEditSeleted:function(e,t,n){e.preventDefault(),e.stopPropagation(),a(t,n),setTimeout((function(){return r.value.handleInputFocus()}),200)},handleInputOutside:function(){return!0},handleAddSelected:function(e,t){l(e,t)},handleInputFocus:function(e){e||u()}}},render:function(){var e=this,t=function(t,n){return e.editKey==="".concat(t.id,"_").concat(n)?(0,i.createVNode)("div",{class:"selected-input",key:e.editKey.toString()},[(0,i.createVNode)(j,{ref:"inputRef",key:e.editKey.toString(),mode:V.EDIT,data:e.data,showCondition:!1,conditions:e.conditions,defautUsingItem:e.copySeletedItem(t),clickOutside:e.handleInputOutside,getMenuList:e.getMenuList,validateValues:e.validateValues,valueBehavior:e.valueBehavior,onAdd:function(t){return e.handleAddSelected(t,n)},onFocus:e.handleInputFocus},null)]):(0,i.createVNode)("li",{class:"search-container-selected ".concat((e.overflowIndex>=0?n<e.overflowIndex:n>=0)?"":"hidden-selected"),key:"".concat(t.id,"_").concat(n)},[(0,i.createVNode)("span",{class:"selected-name",onClick:function(r){return e.handleEditSeleted(r,t,n)}},[t.inputInnerText]),(0,i.createVNode)(w.Error,{class:"selected-clear",onClick:function(){return e.handleDeleteSelected(n)}},null)])};return(0,i.createVNode)(i.Fragment,null,[this.selectedList.map((function(n,r){return[e.overflowIndex>=0&&r===e.overflowIndex&&(0,i.createVNode)("div",{class:"search-container-selected overflow-selected"},[(0,i.createTextVNode)("+"),e.selectedList.length-e.overflowIndex]),t(n,r)]}))])}});var B={data:{type:Array,default:function(){return[]}},modelValue:{type:Array,default:function(){return[]}},shrink:{type:Boolean,default:!0},maxHeight:{type:Number,default:120},minHeight:{type:Number,default:26},conditions:{type:Array,default:function(){return[]}},clearable:{type:Boolean,default:!0},placeholder:String,getMenuList:Function,validateValues:Function,valueSplitCode:{type:String,default:"|"},uniqueSelect:{type:Boolean,default:!1},valueBehavior:{type:String,default:N.ALL,validator:function(e){return[N.ALL,N.NEEDKEY].includes(e)}}};const D=(0,i.defineComponent)({name:"SearchSelect",directives:{clickoutside:b.clickoutside},props:B,emits:["update:modelValue","search"],setup:function(t,n){var r,o=n.emit,a=(0,_.useLocale)("searchSelect"),l=(0,_.usePrefix)().resolveClassName,u=(0,i.computed)((function(){return void 0===t.conditions?[{id:"or",name:a.value.or},{id:"and",name:a.value.and}]:t.conditions})),s=(0,i.ref)(null),c=(0,i.ref)(null),d=(0,i.ref)(!1),p=(0,i.ref)([]),y=(0,i.ref)(-1),g=(0,e.debounce)(32,C),b=(0,i.ref)(""),w=(0,i.ref)(""),x=(0,i.computed)((function(){return t.valueSplitCode})),k=(0,i.shallowRef)([]);function E(e,t){b.value="".concat(e.id,"_").concat(t)}function S(e,t){var n=p.value.slice();n.splice(t,1,e),o("update:modelValue",n.map((function(e){return e.toValue()}))),b.value=""}function L(e){w.value=e||""}function C(){if(d.value||p.value.length<1)y.value=-1;else{for(var e=c.value.querySelector(".".concat(l("search-select-container"))),n=c.value.querySelector(".search-container").clientWidth-6-2,r=e.querySelectorAll(".search-container-selected:not(.overflow-selected)"),i=0,o=0,a=0;0===o&&i<=n-40&&a<=r.length-1;){var u=r[a];if(u.clientHeight>t.minHeight)return void(y.value=a);(i+=u?u.clientWidth+6:0)>=n-40&&(o=a),a+=1}o===r.length-1&&i<=n?y.value=-1:y.value=i>=n-40?o:o-1}}return(0,i.watch)((function(){return t.data}),(function(){var e;k.value=JSON.parse(JSON.stringify(t.data)),null===(e=k.value)||void 0===e||e.forEach((function(e){e.isSelected=t.uniqueSelect&&!!t.modelValue.some((function(t){return t.id===e.id}))}))}),{immediate:!0}),(0,i.watch)((function(){return t.modelValue}),(function(e){var n,r;if(!(null==e?void 0:e.length))return p.value=[],void(null===(n=k.value)||void 0===n||n.forEach((function(e){e.isSelected=!1})));var i=[];e.forEach((function(e){var n,r=p.value.find((function(t){return t.id===e.id&&t.name===e.name}));if((null==r?void 0:r.toValueKey())===JSON.stringify(e))r.values=e.values||[],i.push(r);else{var o=t.data.find((function(t){return t.id===e.id})),a="default";o||(o=t.conditions.find((function(t){return t.id===e.id})))&&(a="condition"),o||(null===(n=e.values)||void 0===n?void 0:n.length)||(a="text");var l=new T(o||e,a,x.value);l.values=e.values||[],i.push(l)}})),p.value=i,null===(r=k.value)||void 0===r||r.forEach((function(e){e.isSelected=t.uniqueSelect&&!!i.some((function(t){return t.id===e.id}))}))}),{immediate:!0,deep:!0}),(0,i.onMounted)((function(){h(c.value.querySelector(".".concat(l("search-select-container"))),g)})),(0,i.onBeforeUnmount)((function(){!function(e,t){var n=e.__resize_listeners__;if(n){if(t&&n.splice(n.indexOf(t),1),!n.length||!t){if(e.detachEvent&&e.removeEventListener)return e.detachEvent("onresize",e.__resize_legacy_resize_handler__),void document.removeEventListener("DOMSubtreeModified",e.__resize_mutation_handler__);e.__resize_observer__?(e.__resize_observer__.unobserve(e),e.__resize_observer__.disconnect(),e.__resize_observer__=null):(e.__resize_mutation_observer__&&(e.__resize_mutation_observer__.disconnect(),e.__resize_mutation_observer__=null),e.removeEventListener("scroll",m),e.removeChild(e.__resize_triggers__.triggers),e.__resize_triggers__=null),e.__resize_listeners__=null}! --v&&f&&f.parentNode.removeChild(f)}}(c.value.querySelector(".".concat(l("search-select-container"))),g)})),r={onEditClick:E,onEditEnter:S,onEditBlur:function(){b.value="",L("")},onValidate:L,editKey:b,valueSplitCode:x},(0,i.provide)(O,r),{inputRef:s,wrapRef:c,isFocus:d,copyData:k,selectedList:p,overflowIndex:y,validateStr:w,splitCode:x,onEditClick:E,onEditEnter:S,handleWrapClick:function(){b.value||s.value.handleInputFocus()},handleInputFocus:function(e){var t;e&&(y.value=-1),!1===e&&(null===(t=c.value.querySelector(".".concat(l("search-select-container"))))||void 0===t||t.scrollTo(0,0)),d.value=e},handleResize:C,handleClearAll:function(){p.value=[],y.value=-1,o("update:modelValue",[])},handleInputOutside:function(e){var t;return!(null===(t=c.value)||void 0===t?void 0:t.contains(e))},handleAddSelected:function(e){var t=p.value.slice();t.push(e),L(""),o("update:modelValue",t.map((function(e){return e.toValue()})))},handleDeleteSelected:function(e){var t=p.value.slice();t.splice("number"==typeof e?e:p.value.length-1,1),L(""),o("update:modelValue",t.map((function(e){return e.toValue()})))},handleClickSearch:function(e){o("search",e)},localConditions:u,resolveClassName:l,t:a}},render:function(){var e,t,n,o=this,a="".concat(!this.shrink||this.isFocus?this.maxHeight:this.minHeight,"px"),l=!!this.selectedList.length&&"condition"!==this.selectedList.slice(-1)[0].type,u=Object.assign({},this.$slots.menu?{menu:function(e){var t,n;return null===(n=(t=o.$slots).menu)||void 0===n?void 0:n.call(t,e)}}:{});return(0,i.createVNode)("div",{class:this.resolveClassName("search-select"),ref:"wrapRef"},[(0,i.createVNode)("div",{class:(e={},r(e,this.resolveClassName("search-select-container"),!0),r(e,"is-focus",this.isFocus),e),onClick:this.handleWrapClick},[(0,i.createVNode)("div",{class:"search-prefix"},[null===(n=(t=this.$slots).prepend)||void 0===n?void 0:n.call(t)]),(0,i.createVNode)("div",{class:"search-container",style:{maxHeight:a}},[(0,i.createVNode)(F,{data:this.copyData,conditions:this.localConditions,selectedList:this.selectedList,overflowIndex:this.overflowIndex,getMenuList:this.getMenuList,validateValues:this.validateValues,valueBehavior:this.valueBehavior,onDelete:this.handleDeleteSelected},Object.assign({},u)),(0,i.createVNode)("div",{class:"search-container-input"},[(0,i.createVNode)(j,{ref:"inputRef",data:this.copyData,showInputBefore:!this.selectedList.length,showCondition:l,conditions:this.localConditions,placeholder:this.placeholder||this.t.pleaseSelect,clickOutside:this.handleInputOutside,getMenuList:this.getMenuList,validateValues:this.validateValues,valueBehavior:this.valueBehavior,onAdd:this.handleAddSelected,onDelete:this.handleDeleteSelected,onFocus:this.handleInputFocus},Object.assign({},u))])]),(0,i.createVNode)("div",{class:"search-nextfix"},[this.clearable&&!!this.selectedList.length&&(0,i.createVNode)(w.Close,{class:"search-clear",onClick:this.handleClearAll},null),this.$slots.append?this.$slots.append():(0,i.createVNode)(w.Search,{onClick:this.handleClickSearch,class:"search-nextfix-icon ".concat(this.isFocus?"is-focus":"")},null)])]),!!this.validateStr.length&&(0,i.createVNode)("div",{class:this.resolveClassName("search-select-tips")},[this.$slots.validate?this.$slots.validate():(0,i.createVNode)(i.Fragment,null,[(0,i.createVNode)(w.ExclamationCircleShape,{class:"select-tips"},null),this.validateStr||""])])])}});var A=(0,e.withInstall)(D);const M=A})(),s})()));
|
2
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("../shared"),require("vue"),require("../config-provider"),require("../directives"),require("../icon"),require("../popover"),require("../checkbox"),require("../radio"));else if("function"==typeof define&&define.amd)define(["../shared","vue","../config-provider","../directives","../icon","../popover","../checkbox","../radio"],t);else{var n="object"==typeof exports?t(require("../shared"),require("vue"),require("../config-provider"),require("../directives"),require("../icon"),require("../popover"),require("../checkbox"),require("../radio")):t(e["../shared"],e.vue,e["../config-provider"],e["../directives"],e["../icon"],e["../popover"],e["../checkbox"],e["../radio"]);for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(self,((e,t,n,r,i,o,a,l)=>(()=>{var u={5800:e=>{"use strict";e.exports=a},2717:e=>{"use strict";e.exports=n},4061:e=>{"use strict";e.exports=r},6870:e=>{"use strict";e.exports=i},5537:e=>{"use strict";e.exports=o},8900:e=>{"use strict";e.exports=l},4212:t=>{"use strict";t.exports=e},748:e=>{"use strict";e.exports=t},7609:(e,t,n)=>{var r=n(7425).default;function i(){"use strict";e.exports=i=function(){return t},e.exports.__esModule=!0,e.exports.default=e.exports;var t={},n=Object.prototype,o=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},l="function"==typeof Symbol?Symbol:{},u=l.iterator||"@@iterator",c=l.asyncIterator||"@@asyncIterator",s=l.toStringTag||"@@toStringTag";function d(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(e,t,n){return e[t]=n}}function v(e,t,n,r){var i=t&&t.prototype instanceof p?t:p,o=Object.create(i.prototype),l=new I(r||[]);return a(o,"_invoke",{value:E(e,n,l)}),o}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=v;var h={};function p(){}function m(){}function g(){}var y={};d(y,u,(function(){return this}));var _=Object.getPrototypeOf,b=_&&_(_(N([])));b&&b!==n&&o.call(b,u)&&(y=b);var w=g.prototype=p.prototype=Object.create(y);function x(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function n(i,a,l,u){var c=f(e[i],e,a);if("throw"!==c.type){var s=c.arg,d=s.value;return d&&"object"==r(d)&&o.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,l,u)}),(function(e){n("throw",e,l,u)})):t.resolve(d).then((function(e){s.value=e,l(s)}),(function(e){return n("throw",e,l,u)}))}u(c.arg)}var i;a(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(o,o):o()}})}function E(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return{value:void 0,done:!0}}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var l=S(a,n);if(l){if(l===h)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=f(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function S(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var i=f(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,h;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function L(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 C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function N(e){if(e){var t=e[u];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(o.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:V}}function V(){return{value:void 0,done:!0}}return m.prototype=g,a(w,"constructor",{value:g,configurable:!0}),a(g,"constructor",{value:m,configurable:!0}),m.displayName=d(g,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,d(e,s,"GeneratorFunction")),e.prototype=Object.create(w),e},t.awrap=function(e){return{__await:e}},x(k.prototype),d(k.prototype,c,(function(){return this})),t.AsyncIterator=k,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new k(v(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},x(w),d(w,s,"Generator"),d(w,u,(function(){return this})),d(w,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=N,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!e)for(var t in this)"t"===t.charAt(0)&&o.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},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 t=this;function n(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var l=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(l&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.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 i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.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),C(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 i=r.arg;C(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:N(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},t}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},7425:e=>{function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},2841:(e,t,n)=>{var r=n(7609)();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}},c={};function s(e){var t=c[e];if(void 0!==t)return t.exports;var n=c[e]={exports:{}};return u[e](n,n.exports,s),n.exports}s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},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 d={};return(()=>{"use strict";s.r(d),s.d(d,{BkSearchSelect:()=>K,default:()=>H});var e=s(4212);function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function n(e){var n=function(e,n){if("object"!==t(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,"string");if("object"!==t(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===t(n)?n:String(n)}function r(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var i=s(748),o=null,a=null;function l(e,t){void 0===t&&(t={});var n=document.createElement(e);return Object.keys(t).forEach((function(e){n[e]=t[e]})),n}function u(e,t,n){return(window.getComputedStyle(e,n||null)||{display:"none"})[t]}function c(e){if(!document.documentElement.contains(e))return{detached:!0,rendered:!1};for(var t=e;t!==document;){if("none"===u(t,"display"))return{detached:!1,rendered:!1};t=t.parentNode}return{detached:!1,rendered:!0}}var v=0,f=null;function h(e,t){if(e.__resize_mutation_handler__||(e.__resize_mutation_handler__=p.bind(e)),!e.__resize_listeners__)if(e.__resize_listeners__=[],window.ResizeObserver){var n=e.offsetWidth,r=e.offsetHeight,i=new ResizeObserver((function(){(e.__resize_observer_triggered__||(e.__resize_observer_triggered__=!0,e.offsetWidth!==n||e.offsetHeight!==r))&&g(e)})),o=c(e),a=o.detached,s=o.rendered;e.__resize_observer_triggered__=!1===a&&!1===s,e.__resize_observer__=i,i.observe(e)}else if(e.attachEvent&&e.addEventListener)e.__resize_legacy_resize_handler__=function(){g(e)},e.attachEvent("onresize",e.__resize_legacy_resize_handler__),document.addEventListener("DOMSubtreeModified",e.__resize_mutation_handler__);else if(v||(f=function(e){var t=document.createElement("style");return t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e)),(document.querySelector("head")||document.body).appendChild(t),t}('.resize-triggers{visibility:hidden;opacity:0;pointer-events:none}.resize-contract-trigger,.resize-contract-trigger:before,.resize-expand-trigger,.resize-triggers{content:"";position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden}.resize-contract-trigger,.resize-expand-trigger{background:#eee;overflow:auto}.resize-contract-trigger:before{width:200%;height:200%}')),function(e){var t=u(e,"position");t&&"static"!==t||(e.style.position="relative"),e.__resize_old_position__=t,e.__resize_last__={};var n=l("div",{className:"resize-triggers"}),r=l("div",{className:"resize-expand-trigger"}),i=l("div"),o=l("div",{className:"resize-contract-trigger"});r.appendChild(i),n.appendChild(r),n.appendChild(o),e.appendChild(n),e.__resize_triggers__={triggers:n,expand:r,expandChild:i,contract:o},y(e),e.addEventListener("scroll",m,!0),e.__resize_last__={width:e.offsetWidth,height:e.offsetHeight}}(e),e.__resize_rendered__=c(e).rendered,window.MutationObserver){var d=new MutationObserver(e.__resize_mutation_handler__);d.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0}),e.__resize_mutation_observer__=d}e.__resize_listeners__.push(t),v++}function p(){var e=c(this),t=e.rendered,n=e.detached;t!==this.__resize_rendered__&&(!n&&this.__resize_triggers__&&(y(this),this.addEventListener("scroll",m,!0)),this.__resize_rendered__=t,g(this))}function m(){var e,t,n=this;y(this),this.__resize_raf__&&(e=this.__resize_raf__,a||(a=(window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||function(e){clearTimeout(e)}).bind(window)),a(e)),this.__resize_raf__=(t=function(){var e,t,r,i,o,a,l=(r=(t=(e=n).__resize_last__).width,i=t.height,o=e.offsetWidth,a=e.offsetHeight,o!==r||a!==i?{width:o,height:a}:null);l&&(n.__resize_last__=l,g(n))},o||(o=(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){return setTimeout(e,16)}).bind(window)),o(t))}function g(e){e&&e.__resize_listeners__&&e.__resize_listeners__.forEach((function(t){t.call(e,e)}))}function y(e){var t=e.__resize_triggers__,n=t.expand,r=t.expandChild,i=t.contract,o=i.scrollWidth,a=i.scrollHeight,l=n.offsetWidth,u=n.offsetHeight,c=n.scrollWidth,s=n.scrollHeight;i.scrollLeft=o,i.scrollTop=a,r.style.width=l+1+"px",r.style.height=u+1+"px",n.scrollLeft=c,n.scrollTop=s}var _=s(2717),b=s(4061),w=s(6870),x=s(2841),k=s.n(x);function E(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function l(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}u((r=r.apply(e,t||[])).next())}))}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;var S,L=s(5537),C=s.n(L),I=s(5800),N=s.n(I),V=s(8900),O=s.n(V);function z(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,n(i.key),i)}}!function(e){e.ALL="all",e.NEEDKEY="need-key"}(S||(S={}));var T,j,F=Symbol("SEARCH_SLECT_PROVIDER_KEY"),D=function(){return(0,i.inject)(F)};!function(e){e.DEFAULT="default",e.EDIT="edit"}(T||(T={})),function(e){e.AND="&",e.OR="|"}(j||(j={}));var A=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default";!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.searchItem=t,this.type=n,this.values=[],this.id=t.id,this.name=t.name,this.logical=t.logical||j.OR}var t,n;return t=e,(n=[{key:"multiple",get:function(){return!!this.searchItem.multiple}},{key:"placeholder",get:function(){return this.searchItem.placeholder||""}},{key:"children",get:function(){return this.searchItem.children||[]}},{key:"validate",get:function(){return!this.searchItem.noValidate}},{key:"inputInnerHtml",get:function(){var e;return this.isSpecialType()?this.name:"".concat(this.keyInnerHtml).concat((null===(e=this.values)||void 0===e?void 0:e.map((function(e){return e.name})).join(" ".concat(this.logical," ")))||"")}},{key:"inputInnerText",get:function(){var e;return this.isSpecialType()?this.name:"".concat(this.keyInnerText).concat((null===(e=this.values)||void 0===e?void 0:e.map((function(e){return e.name})).join(" ".concat(this.logical," ")))||"")}},{key:"keyInnerHtml",get:function(){return this.isSpecialType()?this.name:this.name?"".concat(this.name,": "):""}},{key:"keyInnerText",get:function(){return this.isSpecialType()?this.name:this.name?"".concat(this.name,": "):""}},{key:"showLogical",get:function(){return!!this.searchItem.showLogicalPanel}},{key:"isSpecialType",value:function(){return["text","condition"].includes(this.type)}},{key:"addValue",value:function(e){if(this.multiple){var t=this.values.findIndex((function(t){return t.id===e.id}));return t>-1?void this.values.splice(t,1):void this.values.push(e)}this.values=[e]}},{key:"toValue",value:function(){var e,t={id:this.id,name:this.name};return(null===(e=this.values)||void 0===e?void 0:e.length)&&(t.values=this.values.map((function(e){return{id:e.id,name:e.name}})),this.multiple&&this.logical!==j.OR&&(t.logical=this.logical)),this.type&&"default"!==this.type&&(t.type=this.type),t}},{key:"toValueKey",value:function(){return JSON.stringify(this.toValue())}},{key:"isInValueList",value:function(e){return this.children.some((function(t){return t.id===(null==e?void 0:e.id)}))}}])&&z(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();const B=(0,i.defineComponent)({name:"SearchSelectMenu",props:{list:{type:Array},hoverId:String,keyword:{type:String,default:""},multiple:{type:Boolean,default:!1},selected:{type:Array,default:function(){return[]}},conditions:{type:Array},footerBtns:{type:Array,default:function(){return[]}},showLogical:{type:Boolean,default:!0},logical:{type:String,default:j.OR}},emits:["selectItem","selectCondition","footerClick","update:logical"],setup:function(e,t){var n=t.emit,r=(0,_.useLocale)("searchSelect"),o=(0,_.usePrefix)().resolveClassName,a=(0,i.computed)((function(){return void 0===e.footerBtns||0===e.footerBtns.length?[{id:"confirm",name:r.value.ok},{id:"cancel",name:r.value.cancel,disabled:!1}]:e.footerBtns}));function l(e){n("selectItem",e)}return{handleClick:l,handleClickCondition:function(e){n("selectCondition",e)},handleClickFooterBtn:function(e){n("footerClick",e)},handleSelectedChange:function(e,t){e.stopPropagation(),e.preventDefault(),l(t)},handleLogicalChange:function(e){n("update:logical",e)},filterList:(0,i.computed)((function(){var t,n;return(null===(t=e.list)||void 0===t?void 0:t.length)?(null===(n=e.keyword)||void 0===n?void 0:n.length)?e.list.filter((function(t){return t.name.toLocaleLowerCase().includes(e.keyword.toLocaleLowerCase())})):e.list:[]})),getSearchNode:function(t){var n;return(null===(n=t.value)||void 0===n?void 0:n.name)?[(0,i.createVNode)("span",{class:"menu-name"},[t.name,(0,i.createTextVNode)(":")]),t.value.name]:function(t){if(!t)return t;var n=e.keyword,r=n.length;if(!(null==n?void 0:n.trim().length)||!t.toLocaleLowerCase().includes(n.toLocaleLowerCase()))return t;var o=[],a=-1;return n=n.replace(/([.*/]{1})/gim,"\\$1"),t.replace(new RegExp("".concat(n),"igm"),(function(e,n){return 0===o.length&&0!==n?o.push(t.slice(0,n)):a>=0&&o.push(t.slice(a+e.length,n)),o.push((0,i.createVNode)("span",{class:"is-keyword"},[e])),a=n,e})),a>=0&&o.push(t.slice(a+r)),o.length?o:t}(t.name)},localFooterBtns:a,resolveClassName:o,t:r}},render:function(){var e,t,n=this,r=(0,i.createVNode)("ul",{class:"menu-content"},[null===(e=this.list)||void 0===e?void 0:e.map((function(e){return(0,i.createVNode)("li",{class:"menu-item ".concat(e.disabled?"is-disabled":""," ").concat(n.hoverId!==e.id||e.disabled?"":"is-hover"),key:e.id,id:e.id,tabindex:"-1",onClick:function(){return!e.disabled&&n.handleClick(e)}},[n.$slots.default?n.$slots.default({item:e,list:n.list,multiple:!!n.multiple,hoverId:n.hoverId,getSearchNode:n.getSearchNode}):(0,i.createVNode)(i.Fragment,null,[n.multiple&&(0,i.createVNode)("span",{onClick:function(t){return n.handleSelectedChange(t,e)}},[(0,i.createVNode)(N(),{modelValue:n.selected.includes(e.id),class:"is-selected"},null)]),n.getSearchNode(e)])])}))]);return(0,i.createVNode)("div",{class:this.resolveClassName("search-select-menu")},[!!(null===(t=this.conditions)||void 0===t?void 0:t.length)&&(0,i.createVNode)("ul",{class:"menu-header"},[this.conditions.map((function(e){return(0,i.createVNode)("li",{key:e.id,class:"menu-header-item ".concat(e.disabled?"is-disabled":""),onClick:function(){return!e.disabled&&n.handleClickCondition(e)}},[e.name])}))]),n.showLogical&&n.multiple?(0,i.createVNode)("div",{class:"menu-content-wrapper"},[r,(0,i.createVNode)("div",{class:"menu-condition"},[(0,i.createVNode)("div",{class:"menu-condition-title"},[n.t.logical]),(0,i.createVNode)(O(),{modelValue:n.logical,onChange:n.handleLogicalChange,label:"|"},{default:function(){return[n.t.or,(0,i.createTextVNode)(" |")]}}),(0,i.createVNode)(O(),{modelValue:n.logical,onChange:n.handleLogicalChange,label:"&"},{default:function(){return[n.t.and,(0,i.createTextVNode)(" &")]}})])]):r])}}),R=(0,i.defineComponent)({name:"SearchSelectInput",directives:{clickoutside:b.clickoutside},props:{data:{type:Array,required:!0},showInputBefore:Boolean,showCondition:Boolean,clickOutside:Function,placeholder:String,conditions:{type:Array,default:function(){return[]}},defautUsingItem:Object,mode:{type:String,default:T.DEFAULT},getMenuList:Function,validateValues:Function,valueBehavior:String},emits:["focus","add","delete"],setup:function(t,n){var r=n.emit,o=n.expose,a=(0,_.useLocale)("searchSelect"),l=(0,_.usePrefix)().resolveClassName,u=(0,i.ref)(null),c=(0,i.ref)(null),s=(0,i.ref)(""),d=(0,i.ref)(!1),v=(0,i.ref)(!1),f=(0,i.ref)(!1),h=(0,i.ref)(t.defautUsingItem),p=(0,i.ref)(""),m=(0,i.ref)(!1),g=(0,e.debounce)(300,M),y=!1,b=(0,i.ref)([]),w=(0,i.ref)([]),x=D(),L=x.editKey,C=x.onValidate,I=(0,i.computed)((function(){var e;return(null===(e=h.value)||void 0===e?void 0:e.logical)||j.OR}));function N(e){switch(e.code){case"ArrowDown":case"ArrowUp":V(e);break;case"Enter":case"NumpadEnter":!function(e){if(y){e.preventDefault();var t=w.value.find((function(e){return e.id===p.value}));t&&F(t)}}(e)}}function V(e){var t;e.preventDefault(),null===(t=u.value)||void 0===t||t.blur();for(var n=w.value.length,r=n,i=w.value.findIndex((function(e){return e.id===p.value}));r>=0;){i=(i="ArrowDown"===e.code?i+1:i-1)>n-1?0:i<0?n-1:i;var o=w.value[i];if(o&&!o.disabled){r=-1;var a=document.getElementById(o.id);return null==a||a.focus(),void(p.value=o.id)}r-=1}}function O(e){q(),e&&M()}function z(e){var n;return E(this,void 0,void 0,k().mark((function i(){var o,a,l,u,c;return k().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return null==e||e.preventDefault(),i.next=3,new Promise((function(e){return setTimeout(e,0)}));case 3:if(h.value){i.next=16;break}if(s.value&&t.valueBehavior!==S.NEEDKEY){i.next=6;break}return i.abrupt("return");case 6:return o={id:s.value,name:s.value},i.next=9,B(o);case 9:if(i.sent){i.next=12;break}return i.abrupt("return");case 12:return r("add",new A(o,"text")),s.value="",M(),i.abrupt("return");case 16:if(null==(a=h.value.values)?void 0:a.length){i.next=43;break}if(!(null===(n=s.value)||void 0===n?void 0:n.length)){i.next=41;break}if(!s.value.includes(I.value)){i.next=29;break}return l=s.value.split(I.value),i.next=23,B({id:s.value,name:s.value});case 23:if(i.sent){i.next=26;break}return i.abrupt("return");case 26:l.forEach((function(e){return h.value.addValue({id:e,name:e})})),i.next=36;break;case 29:return u={id:s.value,name:s.value},i.next=32,B(u);case 32:if(i.sent){i.next=35;break}return i.abrupt("return");case 35:h.value.addValue(u);case 36:return r("add",h.value),s.value="",h.value=null,q(!0),i.abrupt("return");case 41:return d.value=!0,i.abrupt("return");case 43:if(!s.value){i.next=56;break}return c={id:s.value,name:s.value},i.next=47,B(c);case 47:if(i.sent){i.next=50;break}return i.abrupt("return");case 50:return h.value.addValue(c),r("add",h.value),s.value="",h.value=null,q(!0),i.abrupt("return");case 56:return i.next=58,B();case 58:if(i.sent){i.next=61;break}return i.abrupt("return");case 61:P();case 62:case"end":return i.stop()}}),i)})))}function F(e,n){var r,i,o,a,l,c;return E(this,void 0,void 0,k().mark((function d(){var v,m;return k().wrap((function(d){for(;;)switch(d.prev=d.next){case 0:if(!(null===(r=e.value)||void 0===r?void 0:r.id)){d.next=20;break}if((t.valueBehavior!==S.NEEDKEY||!e.value)&&t.validateValues){d.next=8;break}return(v=new A(Object.assign(Object.assign({},e),{id:null!==(i=e.realId)&&void 0!==i?i:e.id}),n)).addValue(e.value),P(v),t.valueBehavior===S.NEEDKEY&&p.value&&q(!0),p.value="",d.abrupt("return");case 8:return h.value=new A(Object.assign(Object.assign({},e),{id:null!==(o=e.realId)&&void 0!==o?o:e.id}),n),h.value.addValue(e.value),d.next=12,B(e.value);case 12:if(d.sent){d.next=16;break}return h.value=null,d.abrupt("return");case 16:return P(h.value),p.value="",q(!0),d.abrupt("return");case 20:if(h.value&&(null===(a=null==u?void 0:u.value)||void 0===a?void 0:a.innerText)){d.next=28;break}return h.value=new A(e,n),s.value="",(m="condition"===n)&&P(),f.value=m||!!h.value.children.length,q(t.valueBehavior===S.NEEDKEY&&!!p.value),d.abrupt("return");case 28:if("condition"!==(null===(l=h.value)||void 0===l?void 0:l.type)){d.next=32;break}return h.value=new A(e,n),P(),d.abrupt("return");case 32:return h.value.addValue(e),d.next=35,B(e);case 35:if(d.sent){d.next=38;break}return d.abrupt("return");case 38:h.value.multiple||P(),t.valueBehavior===S.NEEDKEY&&(null===(c=h.value)||void 0===c?void 0:c.multiple)&&q();case 40:case"end":return d.stop()}}),d)})))}function B(e){return E(this,void 0,void 0,k().mark((function n(){var r,i,o,a;return k().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(h.value){n.next=4;break}return n.next=3,R(null,[e]);case 3:case 8:return n.abrupt("return",n.sent);case 4:if(r=h.value,i=r.searchItem,o=r.validate,a=r.values,!o||"function"!=typeof t.validateValues){n.next=9;break}return n.next=8,R(i,e?[e]:a);case 9:return C(""),n.abrupt("return",!0);case 11:case"end":return n.stop()}}),n)})))}function R(e,n){var r;return E(this,void 0,void 0,k().mark((function i(){var o;return k().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,null===(r=t.validateValues)||void 0===r?void 0:r.call(t,null!=e?e:null,n).catch((function(){return!1}));case 2:if("string"!=typeof(o=i.sent)&&!1!==o){i.next=6;break}return C(o||"校验错误"),i.abrupt("return",!1);case 6:return C(""),i.abrupt("return",!0);case 8:case"end":return i.stop()}}),i)})))}function q(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&(0,i.nextTick)().then((function(){M()})),v.value=!0,f.value=!0,d.value=!1;var e=setTimeout((function(){if(u.value){u.value.focus();var t=window.getSelection();0===t.focusOffset&&(t.selectAllChildren(u.value),t.collapseToEnd())}window.clearTimeout(e)}),0);r("focus",v.value)}function M(){var n,r,i,o,a;return E(this,void 0,void 0,k().mark((function l(){var u,c;return k().wrap((function(l){for(;;)switch(l.prev=l.next){case 0:if(u=[],"function"!=typeof t.getMenuList||void 0!==(null===(r=null===(n=h.value)||void 0===n?void 0:n.searchItem)||void 0===r?void 0:r.async)&&!0!==h.value.searchItem.async){l.next=9;break}return m.value=!0,l.next=5,t.getMenuList(null===(i=h.value)||void 0===i?void 0:i.searchItem,s.value).catch((function(){return[]}));case 5:u=l.sent,m.value=!1,l.next=10;break;case 9:(null==h?void 0:h.value)?"condition"===h.value.type?u=t.conditions:(null===(a=h.value.values)||void 0===a?void 0:a.length)&&!h.value.multiple&&t.mode!==T.EDIT||(u=h.value.children.filter((function(e){return e.name.toLocaleLowerCase().includes(s.value.toLocaleLowerCase())}))):(null===(o=s.value)||void 0===o?void 0:o.length)?t.data.filter((function(e){return!e.isSelected})).forEach((function(t){var n,r;if(t.name.toLocaleLowerCase().includes(s.value.toLocaleLowerCase())){var i;u.push(t);var o=[];null===(n=t.children)||void 0===n||n.forEach((function(n){o.push(Object.assign(Object.assign({},t),{realId:t.id,id:(0,e.random)(10),value:n}))})),!o.length&&!t.onlyRecommendChildren&&o.push(Object.assign(Object.assign({},t),{realId:t.id,id:(0,e.random)(10),value:{id:s.value,name:s.value}})),(i=u).push.apply(i,o)}else{var a,l=[];null===(r=t.children)||void 0===r||r.forEach((function(n){n.name.toLocaleLowerCase().includes(s.value.toLocaleLowerCase())&&l.push(Object.assign(Object.assign({},t),{realId:t.id,id:(0,e.random)(10),value:n}))})),!l.length&&!t.onlyRecommendChildren&&l.push(Object.assign(Object.assign({},t),{value:{id:s.value,name:s.value}})),(a=u).push.apply(a,l)}})):u=t.data.filter((function(e){return!e.isSelected})).slice();case 10:w.value=u,t.valueBehavior===S.NEEDKEY&&(c=u.find((function(e){return!e.disabled})))&&(!p.value||p.value&&!u.some((function(e){return e.id===p.value})))&&(p.value=c.id);case 12:case"end":return l.stop()}}),l)})))}function P(e){r("add",null!=e?e:h.value),h.value=null,s.value="",q(t.valueBehavior===S.NEEDKEY)}function K(){var e=u.value.innerText;"\n"===e[e.length-1]||"\r"===e[0]?(H(e.slice(0,-1)),K()):"\n"!==e[0]&&"\r"!==e[0]||(H(e.slice(1)),K())}function H(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";u.value&&(u.value.innerHTML=t||(null===(e=h.value)||void 0===e?void 0:e.inputInnerHtml)||"")}return(0,i.watch)(L,(function(){t.mode===T.DEFAULT&&L.value&&(f.value=!1)})),(0,i.watchEffect)((function(){s.value||H()}),{flush:"pre"}),(0,i.watch)([w,f],(function(){var e;(null===(e=w.value)||void 0===e?void 0:e.some((function(e){return!e.disabled})))&&f.value?y||(t.valueBehavior===S.NEEDKEY?p.value=w.value.find((function(e){return!e.disabled})).id:p.value="",y=!0,document.addEventListener("keydown",N)):(document.removeEventListener("keydown",N),y=!1,t.valueBehavior!==S.NEEDKEY&&(p.value=""))})),o({handleInputFocus:O,isFocus:v}),{popoverRef:c,inputRef:u,keyword:s,loading:m,remoteMenuList:b,menuList:w,menuHoverId:p,isFocus:v,usingItem:h,showPopover:f,showNoSelectValueError:d,debounceSetMenuList:g,documentArrowEvent:V,handleClickOutside:function(e){var n,i,o,a,l;if(!(null===(n=c.value)||void 0===n?void 0:n.contains(e.target))&&(null===(i=t.clickOutside)||void 0===i?void 0:i.call(t,e.target,c.value))){if((null===(a=null===(o=h.value)||void 0===o?void 0:o.values)||void 0===a?void 0:a.length)&&(null===(l=h.value)||void 0===l?void 0:l.multiple))return s.value="",void z();f.value=!1,v.value=!1,r("focus",v.value)}},handleInputFocus:O,handleInputChange:function(e){var t,n,r,i,o,a,l,c,d;K();var v=e.target.innerText;if(/(\r|\n)/gm.test(v)||/\s{2}/gm.test(v))e.preventDefault(),v=v.replace(/(\r|\n)/gm," ".concat(I.value," ")).replace(/\s{2}/gm,""),u.value.innerText=v,q(),s.value=v.replace((null===(t=h.value)||void 0===t?void 0:t.keyInnerText)||"","").trim(),g();else if(!s.value&&v.length<((null===(r=null===(n=h.value)||void 0===n?void 0:n.inputInnerText)||void 0===r?void 0:r.length)||1)){var f=v.replace(" "," ").replace((null===(i=h.value)||void 0===i?void 0:i.keyInnerText.replace(" "," ").trim())||"","").trim();if(v&&(null===(o=h.value)||void 0===o?void 0:o.keyInnerText)&&v.replace(" "," ").includes(h.value.keyInnerText.replace(" "," ").trim())&&f&&(null===(a=h.value.values)||void 0===a?void 0:a.length))return s.value=f,console.info("outerText",f),void g();!f&&(null==v?void 0:v.length)||(h.value=null),s.value=f?v:"",g()}else(null===(c=null===(l=h.value)||void 0===l?void 0:l.values)||void 0===c?void 0:c.length)||(s.value=v.replace(" "," ").replace((null===(d=h.value)||void 0===d?void 0:d.keyInnerText.replace(" "," "))||"","").trim(),q(),g())},handleLogicalChange:function(e){h.value&&(h.value.logical=e)},handleInputKeyup:function(e){switch(e.code){case"Enter":case"NumpadEnter":if(t.valueBehavior===S.NEEDKEY&&w.value.some((function(e){return e.id===p.value})))return;z(e);break;case"Backspace":!function(){var e,n;if(!h.value&&!s.value)return r("delete"),void(0,i.nextTick)(M);if(null===(e=h.value)||void 0===e?void 0:e.values.length){if((null===(n=h.value)||void 0===n?void 0:n.multiple)||h.value.isInValueList(h.value.values[0])||t.mode===T.EDIT&&!s.value)return h.value.values.splice(-1,1),s.value="",void q()}else s.value||(h.value=null,s.value="",M());C("")}();default:d.value=!1}},handleSelectItem:F,handleSelectCondtionItem:function(e){F(e,"condition")},handleMenuFooterClick:function(e){var t;switch(e.id){case"confirm":if(!(null===(t=h.value)||void 0===t?void 0:t.values.length))return;s.value="",z();break;case"cancel":h.value.values=[],f.value=!1}},resolveClassName:l,t:a}},render:function(){var e,t,n=this,r=this.usingItem||{},o=r.multiple,a=r.values,l=r.placeholder,u=r.inputInnerHtml,c=!(null===(e=this.keyword)||void 0===e?void 0:e.length)&&!(null==a?void 0:a.length)&&l,s=this.loading||this.showNoSelectValueError||this.showPopover&&!!(null===(t=this.menuList)||void 0===t?void 0:t.length),d=!this.usingItem&&this.showCondition,v=Object.assign({},this.$slots.menu?{default:function(e){var t,r;return null===(r=(t=n.$slots).menu)||void 0===r?void 0:r.call(t,e)}}:{});return(0,i.createVNode)(C(),{trigger:"manual",theme:"light",placement:"bottom-start",arrow:!1,disableOutsideClick:!0,isShow:s},{default:function(){var e;return(0,i.withDirectives)((0,i.createVNode)("div",{ref:"inputRef",class:{"div-input":!0,"input-before":n.showInputBefore&&!(null===(e=n.keyword)||void 0===e?void 0:e.length),"input-after":c},contenteditable:!0,"data-placeholder":u||n.keyword?"":n.placeholder,"data-tips":l||"",spellcheck:"false",onFocus:n.handleInputFocus,onInput:n.handleInputChange,onKeydown:n.handleInputKeyup},null),[[(0,i.resolveDirective)("clickoutside"),n.handleClickOutside]])},content:function(){var e,t,r;return n.loading?(0,i.createVNode)("div",null,[n.t.loading]):n.showNoSelectValueError?(0,i.createVNode)("div",null,[n.t.filterQueryMustHasValue]):(null===(e=n.menuList)||void 0===e?void 0:e.length)?(0,i.createVNode)("div",{ref:"popoverRef",class:n.resolveClassName("search-select-popover")},[(0,i.createVNode)(B,{list:n.menuList,keyword:n.keyword,multiple:!!o,hoverId:n.menuHoverId,selected:(null==a?void 0:a.map((function(e){return e.id})))||[],conditions:d?n.conditions:[],logical:null===(t=n.usingItem)||void 0===t?void 0:t.logical,showLogical:null===(r=n.usingItem)||void 0===r?void 0:r.showLogical,"onUpdate:logical":n.handleLogicalChange,onSelectItem:n.handleSelectItem,onSelectCondition:n.handleSelectCondtionItem,onFooterClick:n.handleMenuFooterClick},Object.assign({},v))]):void 0}})}}),q=(0,i.defineComponent)({name:"SearchSelected",props:{data:{type:Array,required:!0},selectedList:{type:Array,required:!0},overflowIndex:{type:Number,default:-1},conditions:{type:Array,default:function(){return[]}},getMenuList:Function,validateValues:Function,valueBehavior:String},emits:["delete"],setup:function(e,t){var n=t.emit,r=(0,i.ref)(null),o=D(),a=o.onEditClick,l=o.onEditEnter,u=o.onEditBlur,c=o.editKey;return{inputRef:r,editKey:c,copySeletedItem:function(e){var t=new A(e.searchItem,e.type);return t.values=e.values.slice(),t.logical=e.logical||j.OR,t},handleDeleteSelected:function(e){n("delete",e)},handleEditSeleted:function(e,t,n){e.preventDefault(),e.stopPropagation(),a(t,n),setTimeout((function(){return r.value.handleInputFocus()}),200)},handleInputOutside:function(){return!0},handleAddSelected:function(e,t){l(e,t)},handleInputFocus:function(e){e||u()}}},render:function(){var e=this,t=function(t,n){return e.editKey==="".concat(t.id,"_").concat(n)?(0,i.createVNode)("div",{class:"selected-input",key:e.editKey.toString()},[(0,i.createVNode)(R,{ref:"inputRef",key:e.editKey.toString(),mode:T.EDIT,data:e.data,showCondition:!1,conditions:e.conditions,defautUsingItem:e.copySeletedItem(t),clickOutside:e.handleInputOutside,getMenuList:e.getMenuList,validateValues:e.validateValues,valueBehavior:e.valueBehavior,onAdd:function(t){return e.handleAddSelected(t,n)},onFocus:e.handleInputFocus},null)]):(0,i.createVNode)("li",{class:"search-container-selected ".concat((e.overflowIndex>=0?n<e.overflowIndex:n>=0)?"":"hidden-selected"),key:"".concat(t.id,"_").concat(n)},[(0,i.createVNode)("span",{class:"selected-name",onClick:function(r){return e.handleEditSeleted(r,t,n)}},[t.inputInnerText]),(0,i.createVNode)(w.Error,{class:"selected-clear",onClick:function(){return e.handleDeleteSelected(n)}},null)])};return(0,i.createVNode)(i.Fragment,null,[this.selectedList.map((function(n,r){return[e.overflowIndex>=0&&r===e.overflowIndex&&(0,i.createVNode)("div",{class:"search-container-selected overflow-selected"},[(0,i.createTextVNode)("+"),e.selectedList.length-e.overflowIndex]),t(n,r)]}))])}});var M={data:{type:Array,default:function(){return[]}},modelValue:{type:Array,default:function(){return[]}},shrink:{type:Boolean,default:!0},maxHeight:{type:Number,default:120},minHeight:{type:Number,default:26},conditions:{type:Array,default:function(){return[]}},clearable:{type:Boolean,default:!0},placeholder:String,getMenuList:Function,validateValues:Function,uniqueSelect:{type:Boolean,default:!1},valueBehavior:{type:String,default:S.ALL,validator:function(e){return[S.ALL,S.NEEDKEY].includes(e)}}};const P=(0,i.defineComponent)({name:"SearchSelect",directives:{clickoutside:b.clickoutside},props:M,emits:["update:modelValue","search"],setup:function(t,n){var r,o=n.emit,a=(0,_.useLocale)("searchSelect"),l=(0,_.usePrefix)().resolveClassName,u=(0,i.computed)((function(){return void 0===t.conditions?[{id:"or",name:a.value.or},{id:"and",name:a.value.and}]:t.conditions})),c=(0,i.ref)(null),s=(0,i.ref)(null),d=(0,i.ref)(!1),p=(0,i.ref)([]),g=(0,i.ref)(-1),y=(0,e.debounce)(32,L),b=(0,i.ref)(""),w=(0,i.ref)(""),x=(0,i.shallowRef)([]);function k(e,t){b.value="".concat(e.id,"_").concat(t)}function E(e,t){var n=p.value.slice();n.splice(t,1,e),o("update:modelValue",n.map((function(e){return e.toValue()}))),b.value=""}function S(e){w.value=e||""}function L(){if(d.value||p.value.length<1)g.value=-1;else{for(var e=s.value.querySelector(".".concat(l("search-select-container"))),n=s.value.querySelector(".search-container").clientWidth-6-2,r=e.querySelectorAll(".search-container-selected:not(.overflow-selected)"),i=0,o=0,a=0;0===o&&i<=n-40&&a<=r.length-1;){var u=r[a];if(u.clientHeight>t.minHeight)return void(g.value=a);(i+=u?u.clientWidth+6:0)>=n-40&&(o=a),a+=1}o===r.length-1&&i<=n?g.value=-1:g.value=i>=n-40?o:o-1}}return(0,i.watch)((function(){return t.data}),(function(){var e;x.value=JSON.parse(JSON.stringify(t.data)),null===(e=x.value)||void 0===e||e.forEach((function(e){e.isSelected=t.uniqueSelect&&!!t.modelValue.some((function(t){return t.id===e.id}))}))}),{immediate:!0}),(0,i.watch)((function(){return t.modelValue}),(function(e){var n,r;if(!(null==e?void 0:e.length))return p.value=[],void(null===(n=x.value)||void 0===n||n.forEach((function(e){e.isSelected=!1})));var i=[];e.forEach((function(e){var n,r=p.value.find((function(t){return t.id===e.id&&t.name===e.name}));if((null==r?void 0:r.toValueKey())===JSON.stringify(e))r.values=e.values||[],r.logical=e.logical||j.OR,i.push(r);else{var o=t.data.find((function(t){return t.id===e.id})),a="default";o||(o=t.conditions.find((function(t){return t.id===e.id})))&&(a="condition"),o||(null===(n=e.values)||void 0===n?void 0:n.length)||(a="text");var l=new A(o||e,a);l.values=e.values||[],l.logical=e.logical||j.OR,i.push(l)}})),p.value=i,null===(r=x.value)||void 0===r||r.forEach((function(e){e.isSelected=t.uniqueSelect&&!!i.some((function(t){return t.id===e.id}))}))}),{immediate:!0,deep:!0}),(0,i.onMounted)((function(){h(s.value.querySelector(".".concat(l("search-select-container"))),y)})),(0,i.onBeforeUnmount)((function(){!function(e,t){var n=e.__resize_listeners__;if(n){if(t&&n.splice(n.indexOf(t),1),!n.length||!t){if(e.detachEvent&&e.removeEventListener)return e.detachEvent("onresize",e.__resize_legacy_resize_handler__),void document.removeEventListener("DOMSubtreeModified",e.__resize_mutation_handler__);e.__resize_observer__?(e.__resize_observer__.unobserve(e),e.__resize_observer__.disconnect(),e.__resize_observer__=null):(e.__resize_mutation_observer__&&(e.__resize_mutation_observer__.disconnect(),e.__resize_mutation_observer__=null),e.removeEventListener("scroll",m),e.removeChild(e.__resize_triggers__.triggers),e.__resize_triggers__=null),e.__resize_listeners__=null}! --v&&f&&f.parentNode.removeChild(f)}}(s.value.querySelector(".".concat(l("search-select-container"))),y)})),r={onEditClick:k,onEditEnter:E,onEditBlur:function(){b.value="",S("")},onValidate:S,editKey:b},(0,i.provide)(F,r),{inputRef:c,wrapRef:s,isFocus:d,copyData:x,selectedList:p,overflowIndex:g,validateStr:w,onEditClick:k,onEditEnter:E,handleWrapClick:function(){b.value||c.value.handleInputFocus()},handleInputFocus:function(e){var t;e&&(g.value=-1),!1===e&&(null===(t=s.value.querySelector(".".concat(l("search-select-container"))))||void 0===t||t.scrollTo(0,0)),d.value=e},handleResize:L,handleClearAll:function(){p.value=[],g.value=-1,o("update:modelValue",[])},handleInputOutside:function(e){var t;return!(null===(t=s.value)||void 0===t?void 0:t.contains(e))},handleAddSelected:function(e){var t=p.value.slice();t.push(e),S(""),o("update:modelValue",t.map((function(e){return e.toValue()})))},handleDeleteSelected:function(e){var t=p.value.slice();t.splice("number"==typeof e?e:p.value.length-1,1),S(""),o("update:modelValue",t.map((function(e){return e.toValue()})))},handleClickSearch:function(e){o("search",e)},localConditions:u,resolveClassName:l,t:a}},render:function(){var e,t,n,o=this,a="".concat(!this.shrink||this.isFocus?this.maxHeight:this.minHeight,"px"),l=!!this.selectedList.length&&"condition"!==this.selectedList.slice(-1)[0].type,u=Object.assign({},this.$slots.menu?{menu:function(e){var t,n;return null===(n=(t=o.$slots).menu)||void 0===n?void 0:n.call(t,e)}}:{});return(0,i.createVNode)("div",{class:this.resolveClassName("search-select"),ref:"wrapRef"},[(0,i.createVNode)("div",{class:(e={},r(e,this.resolveClassName("search-select-container"),!0),r(e,"is-focus",this.isFocus),e),onClick:this.handleWrapClick},[(0,i.createVNode)("div",{class:"search-prefix"},[null===(n=(t=this.$slots).prepend)||void 0===n?void 0:n.call(t)]),(0,i.createVNode)("div",{class:"search-container",style:{maxHeight:a}},[(0,i.createVNode)(q,{data:this.copyData,conditions:this.localConditions,selectedList:this.selectedList,overflowIndex:this.overflowIndex,getMenuList:this.getMenuList,validateValues:this.validateValues,valueBehavior:this.valueBehavior,onDelete:this.handleDeleteSelected},Object.assign({},u)),(0,i.createVNode)("div",{class:"search-container-input"},[(0,i.createVNode)(R,{ref:"inputRef",data:this.copyData,showInputBefore:!this.selectedList.length,showCondition:l,conditions:this.localConditions,placeholder:this.placeholder||this.t.pleaseSelect,clickOutside:this.handleInputOutside,getMenuList:this.getMenuList,validateValues:this.validateValues,valueBehavior:this.valueBehavior,onAdd:this.handleAddSelected,onDelete:this.handleDeleteSelected,onFocus:this.handleInputFocus},Object.assign({},u))])]),(0,i.createVNode)("div",{class:"search-nextfix"},[this.clearable&&!!this.selectedList.length&&(0,i.createVNode)(w.Close,{class:"search-clear",onClick:this.handleClearAll},null),this.$slots.append?this.$slots.append():(0,i.createVNode)(w.Search,{onClick:this.handleClickSearch,class:"search-nextfix-icon ".concat(this.isFocus?"is-focus":"")},null)])]),!!this.validateStr.length&&(0,i.createVNode)("div",{class:this.resolveClassName("search-select-tips")},[this.$slots.validate?this.$slots.validate():(0,i.createVNode)(i.Fragment,null,[(0,i.createVNode)(w.ExclamationCircleShape,{class:"select-tips"},null),this.validateStr||""])])])}});var K=(0,e.withInstall)(P);const H=K})(),d})()));
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { PropType, Ref } from 'vue';
|
2
|
-
import { GetMenuListFunc, ICommonItem, IMenuFooterItem, ISearchItem, SearchInputMode, SearchItemType, SelectedItem, ValidateValuesFunc, ValueBehavior } from './utils';
|
2
|
+
import { GetMenuListFunc, ICommonItem, IMenuFooterItem, ISearchItem, SearchInputMode, SearchItemType, SearchLogical, SelectedItem, ValidateValuesFunc, ValueBehavior } from './utils';
|
3
3
|
declare const _default: import("vue").DefineComponent<{
|
4
4
|
data: {
|
5
5
|
type: PropType<ISearchItem[]>;
|
@@ -36,8 +36,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
36
36
|
id: string;
|
37
37
|
realId?: string;
|
38
38
|
isSelected?: boolean;
|
39
|
+
logical?: SearchLogical;
|
39
40
|
};
|
40
41
|
isSelected?: boolean;
|
42
|
+
logical?: SearchLogical;
|
41
43
|
}[]>;
|
42
44
|
menuList: Ref<ISearchItem[]>;
|
43
45
|
menuHoverId: Ref<string>;
|
@@ -53,6 +55,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
53
55
|
handleClickOutside: (e: MouseEvent) => void;
|
54
56
|
handleInputFocus: (e: FocusEvent) => void;
|
55
57
|
handleInputChange: (event: Event) => void;
|
58
|
+
handleLogicalChange: (logical: SearchLogical) => void;
|
56
59
|
handleInputKeyup: (event: KeyboardEvent) => void;
|
57
60
|
handleSelectItem: (item: ICommonItem, type?: SearchItemType) => Promise<void>;
|
58
61
|
handleSelectCondtionItem: (item: ICommonItem) => void;
|
@@ -66,6 +69,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
66
69
|
cancel: string;
|
67
70
|
or: string;
|
68
71
|
and: string;
|
72
|
+
logical: string;
|
69
73
|
}>;
|
70
74
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("focus" | "add" | "delete")[], "focus" | "add" | "delete", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
71
75
|
data: {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { PropType, VNode } from 'vue';
|
2
|
-
import { ICommonItem, IMenuFooterItem } from './utils';
|
2
|
+
import { ICommonItem, IMenuFooterItem, SearchLogical } from './utils';
|
3
3
|
declare const _default: import("vue").DefineComponent<{
|
4
4
|
list: {
|
5
5
|
type: PropType<ICommonItem[]>;
|
@@ -24,10 +24,20 @@ declare const _default: import("vue").DefineComponent<{
|
|
24
24
|
type: PropType<IMenuFooterItem[]>;
|
25
25
|
default: () => any[];
|
26
26
|
};
|
27
|
+
showLogical: {
|
28
|
+
type: BooleanConstructor;
|
29
|
+
default: boolean;
|
30
|
+
};
|
31
|
+
logical: {
|
32
|
+
type: PropType<SearchLogical>;
|
33
|
+
default: SearchLogical;
|
34
|
+
};
|
27
35
|
}, {
|
28
36
|
handleClick: (item: ICommonItem) => void;
|
29
37
|
handleClickCondition: (item: ICommonItem) => void;
|
30
38
|
handleClickFooterBtn: (item: IMenuFooterItem) => void;
|
39
|
+
handleSelectedChange: (e: MouseEvent, item: ICommonItem) => void;
|
40
|
+
handleLogicalChange: (value: unknown) => void;
|
31
41
|
filterList: import("vue").ComputedRef<ICommonItem[]>;
|
32
42
|
getSearchNode: (item: ICommonItem) => string | (string | VNode)[];
|
33
43
|
localFooterBtns: import("vue").ComputedRef<IMenuFooterItem[] | ({
|
@@ -40,7 +50,17 @@ declare const _default: import("vue").DefineComponent<{
|
|
40
50
|
disabled: boolean;
|
41
51
|
})[]>;
|
42
52
|
resolveClassName: (cls: string) => string;
|
43
|
-
|
53
|
+
t: import("vue").ComputedRef<{
|
54
|
+
pleaseSelect: string;
|
55
|
+
loading: string;
|
56
|
+
filterQueryMustHasValue: string;
|
57
|
+
ok: string;
|
58
|
+
cancel: string;
|
59
|
+
or: string;
|
60
|
+
and: string;
|
61
|
+
logical: string;
|
62
|
+
}>;
|
63
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("selectItem" | "selectCondition" | "footerClick" | "update:logical")[], "selectItem" | "selectCondition" | "footerClick" | "update:logical", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
44
64
|
list: {
|
45
65
|
type: PropType<ICommonItem[]>;
|
46
66
|
};
|
@@ -64,14 +84,25 @@ declare const _default: import("vue").DefineComponent<{
|
|
64
84
|
type: PropType<IMenuFooterItem[]>;
|
65
85
|
default: () => any[];
|
66
86
|
};
|
87
|
+
showLogical: {
|
88
|
+
type: BooleanConstructor;
|
89
|
+
default: boolean;
|
90
|
+
};
|
91
|
+
logical: {
|
92
|
+
type: PropType<SearchLogical>;
|
93
|
+
default: SearchLogical;
|
94
|
+
};
|
67
95
|
}>> & {
|
68
96
|
onSelectItem?: (...args: any[]) => any;
|
69
97
|
onSelectCondition?: (...args: any[]) => any;
|
70
98
|
onFooterClick?: (...args: any[]) => any;
|
99
|
+
"onUpdate:logical"?: (...args: any[]) => any;
|
71
100
|
}, {
|
72
101
|
multiple: boolean;
|
73
102
|
selected: string[];
|
103
|
+
logical: SearchLogical;
|
74
104
|
keyword: string;
|
75
105
|
footerBtns: IMenuFooterItem[];
|
106
|
+
showLogical: boolean;
|
76
107
|
}, {}>;
|
77
108
|
export default _default;
|
@@ -278,7 +278,7 @@
|
|
278
278
|
}
|
279
279
|
.bk-search-select-menu {
|
280
280
|
display: flex;
|
281
|
-
min-width:
|
281
|
+
min-width: 200px;
|
282
282
|
font-size: 12px;
|
283
283
|
color: #63656e;
|
284
284
|
flex-direction: column;
|
@@ -292,7 +292,7 @@
|
|
292
292
|
align-items: center;
|
293
293
|
width: 100%;
|
294
294
|
height: 32px;
|
295
|
-
padding: 0
|
295
|
+
padding: 0 8px;
|
296
296
|
flex: 0 0 32px;
|
297
297
|
outline: none;
|
298
298
|
}
|
@@ -317,7 +317,7 @@
|
|
317
317
|
align-items: center;
|
318
318
|
width: 100%;
|
319
319
|
height: 32px;
|
320
|
-
padding: 0
|
320
|
+
padding: 0 8px;
|
321
321
|
flex: 0 0 32px;
|
322
322
|
outline: none;
|
323
323
|
}
|
@@ -332,19 +332,46 @@
|
|
332
332
|
cursor: not-allowed;
|
333
333
|
background-color: white;
|
334
334
|
}
|
335
|
+
.bk-search-select-menu .menu-content-wrapper {
|
336
|
+
display: flex;
|
337
|
+
width: 100%;
|
338
|
+
height: 100%;
|
339
|
+
}
|
340
|
+
.bk-search-select-menu .menu-content-wrapper .menu-condition {
|
341
|
+
display: flex;
|
342
|
+
flex-direction: column;
|
343
|
+
width: 64px;
|
344
|
+
flex: 0 0 64px;
|
345
|
+
background-color: #F5F7FA;
|
346
|
+
padding: 8px 8px 2px 10px;
|
347
|
+
}
|
348
|
+
.bk-search-select-menu .menu-content-wrapper .menu-condition-title {
|
349
|
+
margin-bottom: 12px;
|
350
|
+
line-height: 24px;
|
351
|
+
display: flex;
|
352
|
+
align-items: center;
|
353
|
+
}
|
354
|
+
.bk-search-select-menu .menu-content-wrapper .menu-condition .bk-radio {
|
355
|
+
width: 50px;
|
356
|
+
margin-bottom: 14.5px;
|
357
|
+
}
|
358
|
+
.bk-search-select-menu .menu-content-wrapper .menu-condition .bk-radio ~ .bk-radio {
|
359
|
+
margin-left: 0;
|
360
|
+
}
|
335
361
|
.bk-search-select-menu .menu-content {
|
336
362
|
display: flex;
|
337
363
|
flex-direction: column;
|
338
364
|
flex: 1;
|
339
365
|
max-height: 240px;
|
340
366
|
overflow: auto;
|
367
|
+
padding: 4px 0;
|
341
368
|
}
|
342
369
|
.bk-search-select-menu .menu-content .menu-item {
|
343
370
|
display: flex;
|
344
371
|
align-items: center;
|
345
372
|
width: 100%;
|
346
373
|
height: 32px;
|
347
|
-
padding: 0
|
374
|
+
padding: 0 8px;
|
348
375
|
flex: 0 0 32px;
|
349
376
|
outline: none;
|
350
377
|
white-space: pre;
|
@@ -361,13 +388,6 @@
|
|
361
388
|
display: flex;
|
362
389
|
width: 22px;
|
363
390
|
height: 22px;
|
364
|
-
margin-left: auto;
|
365
|
-
overflow: hidden;
|
366
|
-
font-size: 22px;
|
367
|
-
font-weight: bold;
|
368
|
-
color: #3a84ff;
|
369
|
-
align-items: center;
|
370
|
-
justify-content: center;
|
371
391
|
}
|
372
392
|
.bk-search-select-menu .menu-content .menu-item.is-hover {
|
373
393
|
color: #3a84ff;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { PropType, ShallowRef } from 'vue';
|
2
|
-
import { GetMenuListFunc, ICommonItem, ISearchItem, ISearchValue, SearchItemType, SelectedItem, ValidateValuesFunc, ValueBehavior } from './utils';
|
2
|
+
import { GetMenuListFunc, ICommonItem, ISearchItem, ISearchValue, SearchItemType, SearchLogical, SelectedItem, ValidateValuesFunc, ValueBehavior } from './utils';
|
3
3
|
export declare const SearchSelectProps: {
|
4
4
|
data: {
|
5
5
|
type: PropType<ISearchItem[]>;
|
@@ -32,16 +32,12 @@ export declare const SearchSelectProps: {
|
|
32
32
|
placeholder: StringConstructor;
|
33
33
|
getMenuList: PropType<GetMenuListFunc>;
|
34
34
|
validateValues: PropType<ValidateValuesFunc>;
|
35
|
-
valueSplitCode: {
|
36
|
-
type: StringConstructor;
|
37
|
-
default: string;
|
38
|
-
};
|
39
35
|
uniqueSelect: {
|
40
36
|
type: BooleanConstructor;
|
41
37
|
default: boolean;
|
42
38
|
};
|
43
39
|
valueBehavior: {
|
44
|
-
type: PropType<
|
40
|
+
type: PropType<"all" | "need-key">;
|
45
41
|
default: ValueBehavior;
|
46
42
|
validator(v: ValueBehavior): boolean;
|
47
43
|
};
|
@@ -78,16 +74,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
78
74
|
placeholder: StringConstructor;
|
79
75
|
getMenuList: PropType<GetMenuListFunc>;
|
80
76
|
validateValues: PropType<ValidateValuesFunc>;
|
81
|
-
valueSplitCode: {
|
82
|
-
type: StringConstructor;
|
83
|
-
default: string;
|
84
|
-
};
|
85
77
|
uniqueSelect: {
|
86
78
|
type: BooleanConstructor;
|
87
79
|
default: boolean;
|
88
80
|
};
|
89
81
|
valueBehavior: {
|
90
|
-
type: PropType<
|
82
|
+
type: PropType<"all" | "need-key">;
|
91
83
|
default: ValueBehavior;
|
92
84
|
validator(v: ValueBehavior): boolean;
|
93
85
|
};
|
@@ -128,8 +120,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
128
120
|
id: string;
|
129
121
|
realId?: string;
|
130
122
|
isSelected?: boolean;
|
123
|
+
logical?: SearchLogical;
|
131
124
|
};
|
132
125
|
isSelected?: boolean;
|
126
|
+
logical?: SearchLogical;
|
133
127
|
}[]>;
|
134
128
|
menuList: import("vue").Ref<ISearchItem[]>;
|
135
129
|
menuHoverId: import("vue").Ref<string>;
|
@@ -145,6 +139,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
145
139
|
handleClickOutside: (e: MouseEvent) => void;
|
146
140
|
handleInputFocus: (e: FocusEvent) => void;
|
147
141
|
handleInputChange: (event: Event) => void;
|
142
|
+
handleLogicalChange: (logical: SearchLogical) => void;
|
148
143
|
handleInputKeyup: (event: KeyboardEvent) => void;
|
149
144
|
handleSelectItem: (item: ICommonItem, type?: SearchItemType) => Promise<void>;
|
150
145
|
handleSelectCondtionItem: (item: ICommonItem) => void;
|
@@ -158,6 +153,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
158
153
|
cancel: string;
|
159
154
|
or: string;
|
160
155
|
and: string;
|
156
|
+
logical: string;
|
161
157
|
}>;
|
162
158
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("focus" | "add" | "delete")[], "focus" | "add" | "delete", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
163
159
|
data: {
|
@@ -206,10 +202,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
206
202
|
id: string;
|
207
203
|
realId?: string;
|
208
204
|
isSelected?: boolean;
|
205
|
+
logical?: SearchLogical;
|
209
206
|
};
|
210
207
|
isSelected?: boolean;
|
208
|
+
logical?: SearchLogical;
|
211
209
|
}[];
|
212
210
|
condition: string;
|
211
|
+
logical: SearchLogical;
|
213
212
|
searchItem: {
|
214
213
|
id: string;
|
215
214
|
name: string;
|
@@ -223,8 +222,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
223
222
|
id: string;
|
224
223
|
realId?: string;
|
225
224
|
isSelected?: boolean;
|
225
|
+
logical?: SearchLogical;
|
226
226
|
};
|
227
227
|
isSelected?: boolean;
|
228
|
+
logical?: SearchLogical;
|
228
229
|
}[];
|
229
230
|
multiple?: boolean;
|
230
231
|
async?: boolean;
|
@@ -241,13 +242,17 @@ declare const _default: import("vue").DefineComponent<{
|
|
241
242
|
id: string;
|
242
243
|
realId?: string;
|
243
244
|
isSelected?: boolean;
|
245
|
+
logical?: SearchLogical;
|
244
246
|
};
|
245
247
|
isSelected?: boolean;
|
248
|
+
logical?: SearchLogical;
|
246
249
|
};
|
247
250
|
isSelected?: boolean;
|
251
|
+
onlyRecommendChildren?: boolean;
|
252
|
+
logical?: SearchLogical;
|
253
|
+
showLogicalPanel?: boolean;
|
248
254
|
};
|
249
255
|
type: SearchItemType;
|
250
|
-
splitCode: string;
|
251
256
|
readonly multiple: boolean;
|
252
257
|
readonly placeholder: string;
|
253
258
|
readonly children: {
|
@@ -260,14 +265,17 @@ declare const _default: import("vue").DefineComponent<{
|
|
260
265
|
id: string;
|
261
266
|
realId?: string;
|
262
267
|
isSelected?: boolean;
|
268
|
+
logical?: SearchLogical;
|
263
269
|
};
|
264
270
|
isSelected?: boolean;
|
271
|
+
logical?: SearchLogical;
|
265
272
|
}[];
|
266
273
|
readonly validate: boolean;
|
267
274
|
readonly inputInnerHtml: string;
|
268
275
|
readonly inputInnerText: string;
|
269
276
|
readonly keyInnerHtml: string;
|
270
277
|
readonly keyInnerText: string;
|
278
|
+
readonly showLogical: boolean;
|
271
279
|
isSpecialType: () => boolean;
|
272
280
|
addValue: (item: ICommonItem) => void;
|
273
281
|
toValue: () => ISearchValue;
|
@@ -276,7 +284,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
276
284
|
}[]>;
|
277
285
|
overflowIndex: import("vue").Ref<number>;
|
278
286
|
validateStr: import("vue").Ref<string>;
|
279
|
-
splitCode: import("vue").ComputedRef<string>;
|
280
287
|
onEditClick: (item: SelectedItem, index: number) => void;
|
281
288
|
onEditEnter: (item: SelectedItem, index: number) => void;
|
282
289
|
handleWrapClick: () => void;
|
@@ -297,6 +304,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
297
304
|
cancel: string;
|
298
305
|
or: string;
|
299
306
|
and: string;
|
307
|
+
logical: string;
|
300
308
|
}>;
|
301
309
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("search" | "update:modelValue")[], "search" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
302
310
|
data: {
|
@@ -330,16 +338,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
330
338
|
placeholder: StringConstructor;
|
331
339
|
getMenuList: PropType<GetMenuListFunc>;
|
332
340
|
validateValues: PropType<ValidateValuesFunc>;
|
333
|
-
valueSplitCode: {
|
334
|
-
type: StringConstructor;
|
335
|
-
default: string;
|
336
|
-
};
|
337
341
|
uniqueSelect: {
|
338
342
|
type: BooleanConstructor;
|
339
343
|
default: boolean;
|
340
344
|
};
|
341
345
|
valueBehavior: {
|
342
|
-
type: PropType<
|
346
|
+
type: PropType<"all" | "need-key">;
|
343
347
|
default: ValueBehavior;
|
344
348
|
validator(v: ValueBehavior): boolean;
|
345
349
|
};
|
@@ -353,8 +357,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
353
357
|
clearable: boolean;
|
354
358
|
modelValue: ISearchValue[];
|
355
359
|
conditions: ICommonItem[];
|
356
|
-
valueBehavior:
|
357
|
-
valueSplitCode: string;
|
360
|
+
valueBehavior: "all" | "need-key";
|
358
361
|
shrink: boolean;
|
359
362
|
uniqueSelect: boolean;
|
360
363
|
}, {}>;
|