bkui-vue 0.0.1-beta.165 → 0.0.1-beta.168
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 +29 -29
- package/dist/index.esm.js +203 -119
- package/dist/index.umd.js +30 -30
- package/dist/style.css +1 -1
- package/dist/style.variable.css +1 -1
- package/lib/cascader/cascader-panel.d.ts +16 -0
- package/lib/cascader/cascader.css +3 -0
- package/lib/cascader/cascader.d.ts +14 -0
- package/lib/cascader/cascader.less +3 -0
- package/lib/cascader/cascader.variable.css +3 -0
- package/lib/cascader/index.d.ts +47 -1
- package/lib/cascader/index.js +1 -1
- package/lib/checkbox/checkbox.css +5 -0
- package/lib/checkbox/checkbox.less +4 -0
- package/lib/checkbox/checkbox.variable.css +5 -0
- package/lib/pagination/index.d.ts +16 -1
- package/lib/pagination/index.js +1 -1
- package/lib/pagination/pagination.css +54 -28
- package/lib/pagination/pagination.d.ts +10 -0
- package/lib/pagination/pagination.less +58 -31
- package/lib/pagination/pagination.variable.css +54 -28
- package/lib/select/index.d.ts +67 -10
- package/lib/select/index.js +1 -1
- package/lib/select/select.css +69 -54
- package/lib/select/select.d.ts +22 -3
- package/lib/select/select.less +44 -29
- package/lib/select/select.variable.css +69 -54
- package/lib/select/selectTagInput.d.ts +12 -0
- package/lib/sideslider/index.js +1 -1
- package/lib/styles/reset.css +36 -0
- package/lib/styles/reset.less +26 -0
- package/lib/styles/reset.variable.css +36 -0
- package/lib/table/table.css +59 -28
- package/lib/table/table.variable.css +59 -28
- package/lib/tree/tree.css +5 -0
- package/lib/tree/tree.variable.css +5 -0
- package/package.json +1 -1
@@ -1,5 +1,11 @@
|
|
1
1
|
import { INode } from './interface';
|
2
2
|
declare const _default: import("vue").DefineComponent<{
|
3
|
+
width: import("vue-types").VueTypeDef<string | number> & {
|
4
|
+
default: string | number;
|
5
|
+
};
|
6
|
+
height: import("vue-types").VueTypeDef<string | number> & {
|
7
|
+
default: string | number;
|
8
|
+
};
|
3
9
|
store: import("vue-types").VueTypeValidableDef<{
|
4
10
|
[key: string]: any;
|
5
11
|
}> & {
|
@@ -27,7 +33,15 @@ declare const _default: import("vue").DefineComponent<{
|
|
27
33
|
checkValue: import("vue").Ref<any[]>;
|
28
34
|
checkNode: (node: INode, value: boolean) => void;
|
29
35
|
iconRender: (node: any) => JSX.Element;
|
36
|
+
panelWidth: string;
|
37
|
+
panelHeight: string;
|
30
38
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
39
|
+
width: import("vue-types").VueTypeDef<string | number> & {
|
40
|
+
default: string | number;
|
41
|
+
};
|
42
|
+
height: import("vue-types").VueTypeDef<string | number> & {
|
43
|
+
default: string | number;
|
44
|
+
};
|
31
45
|
store: import("vue-types").VueTypeValidableDef<{
|
32
46
|
[key: string]: any;
|
33
47
|
}> & {
|
@@ -43,6 +57,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
43
57
|
}>> & {
|
44
58
|
"onUpdate:modelValue"?: (...args: any[]) => any;
|
45
59
|
}, {
|
60
|
+
width: string | number;
|
61
|
+
height: string | number;
|
46
62
|
store: {
|
47
63
|
[key: string]: any;
|
48
64
|
};
|
@@ -112,7 +112,10 @@
|
|
112
112
|
.bk-cascader-panel-wrapper .bk-cascader-panel .bk-cascader-node {
|
113
113
|
position: relative;
|
114
114
|
padding: 0 16px;
|
115
|
+
overflow: hidden;
|
115
116
|
line-height: 32px;
|
117
|
+
text-overflow: ellipsis;
|
118
|
+
white-space: nowrap;
|
116
119
|
cursor: pointer;
|
117
120
|
}
|
118
121
|
.bk-cascader-panel-wrapper .bk-cascader-panel .bk-cascader-node:hover {
|
@@ -84,6 +84,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
84
84
|
} & {
|
85
85
|
default: string;
|
86
86
|
};
|
87
|
+
scrollHeight: import("vue-types").VueTypeDef<string | number> & {
|
88
|
+
default: string | number;
|
89
|
+
};
|
90
|
+
scrollWidth: import("vue-types").VueTypeDef<string | number> & {
|
91
|
+
default: string | number;
|
92
|
+
};
|
87
93
|
}, {
|
88
94
|
store: import("vue").Ref<{
|
89
95
|
data: {
|
@@ -248,6 +254,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
248
254
|
} & {
|
249
255
|
default: string;
|
250
256
|
};
|
257
|
+
scrollHeight: import("vue-types").VueTypeDef<string | number> & {
|
258
|
+
default: string | number;
|
259
|
+
};
|
260
|
+
scrollWidth: import("vue-types").VueTypeDef<string | number> & {
|
261
|
+
default: string | number;
|
262
|
+
};
|
251
263
|
}>> & {
|
252
264
|
onChange?: (...args: any[]) => any;
|
253
265
|
"onUpdate:modelValue"?: (...args: any[]) => any;
|
@@ -271,5 +283,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
271
283
|
remoteMethod: (...args: any[]) => any;
|
272
284
|
showCompleteName: boolean;
|
273
285
|
limitOneLine: boolean;
|
286
|
+
scrollHeight: string | number;
|
287
|
+
scrollWidth: string | number;
|
274
288
|
}>;
|
275
289
|
export default _default;
|
@@ -225,7 +225,10 @@
|
|
225
225
|
.bk-cascader-panel-wrapper .bk-cascader-panel .bk-cascader-node {
|
226
226
|
position: relative;
|
227
227
|
padding: 0 16px;
|
228
|
+
overflow: hidden;
|
228
229
|
line-height: 32px;
|
230
|
+
text-overflow: ellipsis;
|
231
|
+
white-space: nowrap;
|
229
232
|
cursor: pointer;
|
230
233
|
}
|
231
234
|
.bk-cascader-panel-wrapper .bk-cascader-panel .bk-cascader-node:hover {
|
package/lib/cascader/index.d.ts
CHANGED
@@ -21,6 +21,8 @@ declare const BkCascader: {
|
|
21
21
|
remoteMethod: (...args: any[]) => any;
|
22
22
|
showCompleteName: boolean;
|
23
23
|
limitOneLine: boolean;
|
24
|
+
scrollHeight: string | number;
|
25
|
+
scrollWidth: string | number;
|
24
26
|
}> & Omit<Readonly<import("vue").ExtractPropTypes<{
|
25
27
|
modelValue: import("vue-types").VueTypeDef<string[] | number[]>;
|
26
28
|
list: import("vue-types").VueTypeValidableDef<unknown[]> & {
|
@@ -106,12 +108,18 @@ declare const BkCascader: {
|
|
106
108
|
} & {
|
107
109
|
default: string;
|
108
110
|
};
|
111
|
+
scrollHeight: import("vue-types").VueTypeDef<string | number> & {
|
112
|
+
default: string | number;
|
113
|
+
};
|
114
|
+
scrollWidth: import("vue-types").VueTypeDef<string | number> & {
|
115
|
+
default: string | number;
|
116
|
+
};
|
109
117
|
}>> & {
|
110
118
|
onChange?: (...args: any[]) => any;
|
111
119
|
"onUpdate:modelValue"?: (...args: any[]) => any;
|
112
120
|
onClear?: (...args: any[]) => any;
|
113
121
|
onToggle?: (...args: any[]) => any;
|
114
|
-
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "disabled" | "trigger" | "extCls" | "placeholder" | "list" | "separator" | "multiple" | "clearable" | "checkAnyLevel" | "filterable" | "idKey" | "nameKey" | "childrenKey" | "isRemote" | "remoteMethod" | "showCompleteName" | "limitOneLine">;
|
122
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "disabled" | "trigger" | "extCls" | "placeholder" | "list" | "separator" | "multiple" | "clearable" | "checkAnyLevel" | "filterable" | "idKey" | "nameKey" | "childrenKey" | "isRemote" | "remoteMethod" | "showCompleteName" | "limitOneLine" | "scrollHeight" | "scrollWidth">;
|
115
123
|
$attrs: {
|
116
124
|
[x: string]: unknown;
|
117
125
|
};
|
@@ -210,6 +218,12 @@ declare const BkCascader: {
|
|
210
218
|
} & {
|
211
219
|
default: string;
|
212
220
|
};
|
221
|
+
scrollHeight: import("vue-types").VueTypeDef<string | number> & {
|
222
|
+
default: string | number;
|
223
|
+
};
|
224
|
+
scrollWidth: import("vue-types").VueTypeDef<string | number> & {
|
225
|
+
default: string | number;
|
226
|
+
};
|
213
227
|
}>> & {
|
214
228
|
onChange?: (...args: any[]) => any;
|
215
229
|
"onUpdate:modelValue"?: (...args: any[]) => any;
|
@@ -312,6 +326,8 @@ declare const BkCascader: {
|
|
312
326
|
remoteMethod: (...args: any[]) => any;
|
313
327
|
showCompleteName: boolean;
|
314
328
|
limitOneLine: boolean;
|
329
|
+
scrollHeight: string | number;
|
330
|
+
scrollWidth: string | number;
|
315
331
|
}> & {
|
316
332
|
beforeCreate?: (() => void) | (() => void)[];
|
317
333
|
created?: (() => void) | (() => void)[];
|
@@ -417,6 +433,12 @@ declare const BkCascader: {
|
|
417
433
|
} & {
|
418
434
|
default: string;
|
419
435
|
};
|
436
|
+
scrollHeight: import("vue-types").VueTypeDef<string | number> & {
|
437
|
+
default: string | number;
|
438
|
+
};
|
439
|
+
scrollWidth: import("vue-types").VueTypeDef<string | number> & {
|
440
|
+
default: string | number;
|
441
|
+
};
|
420
442
|
}>> & {
|
421
443
|
onChange?: (...args: any[]) => any;
|
422
444
|
"onUpdate:modelValue"?: (...args: any[]) => any;
|
@@ -590,6 +612,12 @@ declare const BkCascader: {
|
|
590
612
|
} & {
|
591
613
|
default: string;
|
592
614
|
};
|
615
|
+
scrollHeight: import("vue-types").VueTypeDef<string | number> & {
|
616
|
+
default: string | number;
|
617
|
+
};
|
618
|
+
scrollWidth: import("vue-types").VueTypeDef<string | number> & {
|
619
|
+
default: string | number;
|
620
|
+
};
|
593
621
|
}>> & {
|
594
622
|
onChange?: (...args: any[]) => any;
|
595
623
|
"onUpdate:modelValue"?: (...args: any[]) => any;
|
@@ -692,8 +720,16 @@ declare const BkCascader: {
|
|
692
720
|
remoteMethod: (...args: any[]) => any;
|
693
721
|
showCompleteName: boolean;
|
694
722
|
limitOneLine: boolean;
|
723
|
+
scrollHeight: string | number;
|
724
|
+
scrollWidth: string | number;
|
695
725
|
}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("@vue/runtime-core").Plugin & Readonly<{
|
696
726
|
CascaderPanel: import("vue").DefineComponent<{
|
727
|
+
width: import("vue-types").VueTypeDef<string | number> & {
|
728
|
+
default: string | number;
|
729
|
+
};
|
730
|
+
height: import("vue-types").VueTypeDef<string | number> & {
|
731
|
+
default: string | number;
|
732
|
+
};
|
697
733
|
store: import("vue-types").VueTypeValidableDef<{
|
698
734
|
[key: string]: any;
|
699
735
|
}> & {
|
@@ -721,7 +757,15 @@ declare const BkCascader: {
|
|
721
757
|
checkValue: import("vue").Ref<any[]>;
|
722
758
|
checkNode: (node: import("./interface").INode, value: boolean) => void;
|
723
759
|
iconRender: (node: any) => JSX.Element;
|
760
|
+
panelWidth: string;
|
761
|
+
panelHeight: string;
|
724
762
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
763
|
+
width: import("vue-types").VueTypeDef<string | number> & {
|
764
|
+
default: string | number;
|
765
|
+
};
|
766
|
+
height: import("vue-types").VueTypeDef<string | number> & {
|
767
|
+
default: string | number;
|
768
|
+
};
|
725
769
|
store: import("vue-types").VueTypeValidableDef<{
|
726
770
|
[key: string]: any;
|
727
771
|
}> & {
|
@@ -737,6 +781,8 @@ declare const BkCascader: {
|
|
737
781
|
}>> & {
|
738
782
|
"onUpdate:modelValue"?: (...args: any[]) => any;
|
739
783
|
}, {
|
784
|
+
width: string | number;
|
785
|
+
height: string | number;
|
740
786
|
store: {
|
741
787
|
[key: string]: any;
|
742
788
|
};
|
package/lib/cascader/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("../shared"),require("vue"),require("../directives"),require("../icon"),require("../popover2"),require("../checkbox"));else if("function"==typeof define&&define.amd)define(["../shared","vue","../directives","../icon","../popover2","../checkbox"],t);else{var r="object"==typeof exports?t(require("../shared"),require("vue"),require("../directives"),require("../icon"),require("../popover2"),require("../checkbox")):t(e["../shared"],e.vue,e["../directives"],e["../icon"],e["../popover2"],e["../checkbox"]);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(self,((e,t,r,n,o,i)=>(()=>{var a={7162:(e,t,r)=>{r(5047)},5047:e=>{var t=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function s(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var o=t&&t.prototype instanceof y?t:y,i=Object.create(o.prototype),a=new E(n||[]);return i._invoke=function(e,t,r){var n=d;return function(o,i){if(n===f)throw new Error("Generator is already running");if(n===h){if("throw"===o)throw i;return C()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=V(a,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===d)throw n=h,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=f;var s=u(e,t,r);if("normal"===s.type){if(n=r.done?h:p,s.arg===v)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n=h,r.method="throw",r.arg=s.arg)}}}(e,r,a),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var d="suspendedStart",p="suspendedYield",f="executing",h="completed",v={};function y(){}function g(){}function m(){}var b={};s(b,i,(function(){return this}));var k=Object.getPrototypeOf,w=k&&k(k(O([])));w&&w!==r&&n.call(w,i)&&(b=w);var N=m.prototype=y.prototype=Object.create(b);function P(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){function r(o,i,a,c){var s=u(e[o],e,i);if("throw"!==s.type){var l=s.arg,d=l.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,a,c)}),(function(e){r("throw",e,a,c)})):t.resolve(d).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,c)}))}c(s.arg)}var o;this._invoke=function(e,n){function i(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(i,i):i()}}function V(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,V(e,r),"throw"===r.method))return v;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var o=u(n,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var i=o.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function T(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 L(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function O(e){if(e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}return{next:C}}function C(){return{value:t,done:!0}}return g.prototype=m,s(N,"constructor",m),s(m,"constructor",g),g.displayName=s(m,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,s(e,c,"GeneratorFunction")),e.prototype=Object.create(N),e},e.awrap=function(e){return{__await:e}},P(x.prototype),s(x.prototype,a,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new x(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},P(N),s(N,c,"Generator"),s(N,i,(function(){return this})),s(N,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=O,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(L),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(s&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===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,v):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),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),L(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:O(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},5800:e=>{"use strict";e.exports=i},4061:e=>{"use strict";e.exports=r},6870:e=>{"use strict";e.exports=n},6175:e=>{"use strict";e.exports=o},4212:t=>{"use strict";t.exports=e},748:e=>{"use strict";e.exports=t}},c={};function s(e){var t=c[e];if(void 0!==t)return t.exports;var r=c[e]={exports:{}};return a[e](r,r.exports,s),r.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 r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},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 l={};return(()=>{"use strict";s.r(l),s.d(l,{BkCascader:()=>m,BkCascaderPanel:()=>u,default:()=>b});var e=s(4212),t=s(748),r=s(4061),n=s(6870),o=s(6175),i=s.n(o);s(7162),Symbol("BkSelect"),Symbol("BkOptionGroup");var a=s(5800),c=s.n(a);const u=(0,t.defineComponent)({name:"CascaderPanel",props:{store:e.PropTypes.object.def({}),modelValue:e.PropTypes.oneOfType([e.PropTypes.arrayOf(e.PropTypes.number).def([]),e.PropTypes.arrayOf(e.PropTypes.string).def([])])},emits:["update:modelValue"],setup:function(r,o){var i=o.emit,a=r.store,c=(0,t.reactive)({list:[r.store.getNodes()]}),s=(0,t.ref)([]),l=(0,t.ref)([]),u=function(e){e.config.multiple?l.value=a.getCheckedNodes().map((function(e){return e.path})):l.value=e.path,i("update:modelValue",l.value)},d=function(e){var t;if(e&&!(null==e?void 0:e.isDisabled)){if(c.list=c.list.slice(0,e.level),s.value=s.value.slice(0,e.level-1),null===(t=e.children)||void 0===t?void 0:t.length)return c.list.push(e.children),void s.value.push(e);a.config.isRemote&&!e.isLeaf&&(e.loading=!0,a.config.remoteMethod(e,(function(t){a.appendNodes(t,e||null),c.list.push(e.children),s.value.push(e),e.loading=!1})))}};return(0,t.watch)((function(){return r.modelValue}),(function(e){!function(e){0===e.length&&(c.list=c.list.slice(0,1),s.value=[]),e.forEach((function(e){var t=a.getNodeById(e);d(t)})),l.value=e}(e)}),{immediate:!0}),(0,t.watch)((function(){return r.store}),(function(e){c.list=[e.getNodes()]})),{menus:c,activePath:s,nodeExpandHandler:d,isNodeInPath:function(e){return(s.value[e.level-1]||{}).id===e.id},nodeEvent:function(e){var t=e.config,r=t.trigger,n=t.checkAnyLevel,o=t.multiple;return{onClick:function(t){e.isLeaf&&!o||t.stopPropagation(),"click"===r&&d(e),n&&!o&&u(e),e.isLeaf&&!o&&u(e)},onMouseenter:function(){"hover"===r&&d(e)}}},isCheckedNode:function(t,r){return!t.config.multiple&&(0,e.arrayEqual)(r,t.path)},checkValue:l,checkNode:function(e,t){e.setNodeCheck(t),u(e)},iconRender:function(e){return e.loading?(0,t.createVNode)(n.Spinner,{class:"icon-spinner"},null):(0,t.createVNode)(n.AngleRight,{class:"icon-angle-right"},null)}}},render:function(){var e=this;return(0,t.createVNode)("div",{class:"bk-cascader-panel-wrapper"},[this.menus.list.map((function(r){return(0,t.createVNode)("ul",{class:"bk-cascader-panel"},[r.map((function(r){return(0,t.createVNode)("li",(0,t.mergeProps)({class:["bk-cascader-node",{"is-selected":e.isNodeInPath(r)},{"is-disabled":r.isDisabled},{"is-checked":e.isCheckedNode(r,e.checkValue)}]},e.nodeEvent(r)),[r.config.multiple&&(0,t.createVNode)(c(),{disabled:r.isDisabled,modelValue:r.checked,"onUpdate:modelValue":function(e){return r.checked=e},onChange:function(t){return e.checkNode(r,t)}},null),(0,t.createVNode)("span",{class:"bk-cascader-node-name"},[r.name]),r.isLeaf?"":e.iconRender(r)])}))])}))])}});function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function f(e,t,r){return t&&p(e.prototype,t),r&&p(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}const h=function(){function e(t,r,n){d(this,e),this.data=t,this.config=r,this.parent=n||null,this.leaf=t.leaf,this.level=this.parent?this.parent.level+1:1,this.initState()}return f(e,[{key:"initState",value:function(){var t=this,r=this.config,n=r.idKey,o=r.nameKey,i=r.childrenKey;this.id=this.data[n],this.name=this.data[o],this.loading=!1,this.loaded=!1,this.checked=!1;var a=this.data[i];this.children=(a||[]).map((function(r){return new e(r,t.config,t)})),this.pathNodes=this.calculateNodesPath(),this.path=this.pathNodes.map((function(e){return e.id})),this.pathNames=this.pathNodes.map((function(e){return e.name}))}},{key:"isLeaf",get:function(){var e;return this.config.isRemote?this.leaf||!!this.loaded&&!this.children.length:!(Array.isArray(this.children)&&0!==(null===(e=this.children)||void 0===e?void 0:e.length))}},{key:"isDisabled",get:function(){return this.data.disabled}},{key:"setNodeCheck",value:function(e){this.checked=e}},{key:"calculateNodesPath",value:function(){for(var e=[this],t=this.parent;t;)e.unshift(t),t=t.parent;return e}}]),e}();var v=function e(t,r){return t.reduce((function(t,n){return n.isLeaf?t.push(n):(!r&&t.push(n),t=t.concat(e(n.children,r))),t}),[])};const y=function(){function t(e){var r=this;d(this,t);var n=e.list;this.data=n,this.config=e,this.nodes=this.data.map((function(e){return new h(e,r.config)}))}return f(t,[{key:"getNodes",value:function(){return this.nodes}},{key:"getFlattedNodes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return v(this.nodes,e)}},{key:"getCheckedNodes",value:function(){return this.getFlattedNodes().filter((function(e){return e.checked}))}},{key:"getNodeByValue",value:function(t){var r;return null!==(r=this.getFlattedNodes().filter((function(r){return(0,e.arrayEqual)(r.path,t)}))[0])&&void 0!==r?r:null}},{key:"getNodeById",value:function(e){return this.getFlattedNodes().find((function(t){return t.id===e}))}},{key:"appendNode",value:function(e,t){var r=new h(e,this.config,t);(t?t.children:this.nodes).push(r)}},{key:"appendNodes",value:function(e,t){var r=this;e.forEach((function(e){return r.appendNode(e,t)}))}}]),t}(),g=(0,t.defineComponent)({name:"Cascader",directives:{clickoutside:r.clickoutside},components:{CascaderPanel:u,BkPopover:i()},props:{modelValue:e.PropTypes.oneOfType([e.PropTypes.arrayOf(e.PropTypes.number).def([]),e.PropTypes.arrayOf(e.PropTypes.string).def([])]),list:e.PropTypes.array.def([]),placeholder:e.PropTypes.string.def("请选择"),filterable:e.PropTypes.bool.def(!1),multiple:e.PropTypes.bool.def(!1),disabled:e.PropTypes.bool.def(!1),clearable:e.PropTypes.bool.def(!0),trigger:e.PropTypes.string.def("click"),checkAnyLevel:e.PropTypes.bool.def(!1),isRemote:e.PropTypes.bool.def(!1),remoteMethod:e.PropTypes.func,showCompleteName:e.PropTypes.bool.def(!0),idKey:e.PropTypes.string.def("id"),nameKey:e.PropTypes.string.def("name"),childrenKey:e.PropTypes.string.def("children"),separator:e.PropTypes.string.def("/"),limitOneLine:e.PropTypes.bool.def(!1),extCls:e.PropTypes.string.def("")},emits:["update:modelValue","change","clear","toggle"],setup:function(e,r){var n=r.emit,o=e.separator,i=e.multiple,a=function(){var e=(0,t.ref)(!1);return{isHover:e,setHover:function(){e.value=!0},cancelHover:function(){e.value=!1}}}(),c=a.isHover,s=a.setHover,l=a.cancelHover,u=(0,t.ref)(new y(e)),d=(0,t.ref)(!1),p=(0,t.ref)(""),f=(0,t.ref)([]),h=(0,t.toRefs)(e).modelValue,v=(0,t.ref)(),g=(0,t.computed)({get:function(){return h.value},set:function(e){n("update:modelValue",e)}}),m=(0,t.ref)(null),b=function(t){return e.showCompleteName?t.pathNames.join(o):t.pathNames[t.pathNames.length-1]},k=function(e){var t;if(i)f.value=u.value.getCheckedNodes().map((function(e){return{text:b(e),key:e.id}}));else if(null===(t=null==m?void 0:m.value)||void 0===t||t.hide(),0===e.length)p.value="";else{var r=u.value.getNodeByValue(e);if(!r)return;p.value=b(r)}};return(0,t.watch)((function(){return e.modelValue}),(function(e){k(e),n("update:modelValue",e),n("change",e)}),{immediate:!0}),(0,t.watch)((function(){return e.list}),(function(){u.value=new y(e),k(e.modelValue)}),{deep:!0,immediate:!0}),{store:u,updateValue:k,panelShow:d,selectedText:p,checkedValue:g,handleClear:function(t){t.stopPropagation(),k([]),n("update:modelValue",[]),n("clear",JSON.parse(JSON.stringify(e.modelValue)))},isHover:c,setHover:s,popover:m,cancelHover:l,selectedTags:f,removeTag:function(e,t,r){r.stopPropagation();var n=JSON.parse(JSON.stringify(e));n.splice(t,1),k(n)},cascaderPanel:v,popoverChangeEmitter:function(e){n("toggle",e.isShow)}}},render:function(){var e=this;return(0,t.createVNode)("div",{class:["bk-cascader","bk-cascader-wrapper",this.extCls,{"bk-is-show-panel":this.panelShow,"is-unselected":0===this.modelValue.length,"is-hover":this.isHover}],tabindex:"0","data-placeholder":this.placeholder,onMouseenter:this.setHover,onMouseleave:this.cancelHover},[e.clearable&&e.isHover?(0,t.createVNode)(n.Close,{class:"bk-icon-clear-icon",onClick:e.handleClear},null):(0,t.createVNode)(n.AngleUp,{class:"bk-icon-angle-up"},null),(0,t.createVNode)(i(),{placement:"bottom-start",theme:"light bk-cascader-popover",trigger:"click",arrow:!1,class:"bk-cascader-popover-wrapper",ref:"popover",onAfterHidden:this.popoverChangeEmitter,onAfterShow:this.popoverChangeEmitter,boundary:"body"},{default:function(){return(0,t.createVNode)("div",{class:"bk-cascader-name"},[e.multiple&&(e.limitOneLine?(0,t.createVNode)("span",null,[e.selectedText]):(0,t.createVNode)("div",{class:"cascader-tag-list"},[e.selectedTags.map((function(r,o){return(0,t.createVNode)("span",{class:"cascader-tag-item"},[(0,t.createVNode)("span",{class:"cascader-tag-item-name"},[r.text]),(0,t.createVNode)(n.Error,{class:"bk-icon-clear-icon",onClick:function(t){return e.removeTag(e.modelValue,o,t)}},null)])}))])),e.filterable?(0,t.createVNode)("input",{class:"bk-cascader-search-input",type:"text",placeholder:e.placeholder},null):(0,t.createVNode)("span",null,[e.selectedText])])},content:function(){return(0,t.createVNode)("div",{class:"bk-cascader-popover"},[(0,t.createVNode)(u,{store:e.store,ref:"cascaderPanel",modelValue:e.checkedValue,"onUpdate:modelValue":function(t){return e.checkedValue=t}},null)])}})])}});var m=(0,e.withInstallProps)(g,{CascaderPanel:u});const b=m})(),l})()));
|
1
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("../shared"),require("vue"),require("../directives"),require("../icon"),require("../popover2"),require("../checkbox"));else if("function"==typeof define&&define.amd)define(["../shared","vue","../directives","../icon","../popover2","../checkbox"],t);else{var r="object"==typeof exports?t(require("../shared"),require("vue"),require("../directives"),require("../icon"),require("../popover2"),require("../checkbox")):t(e["../shared"],e.vue,e["../directives"],e["../icon"],e["../popover2"],e["../checkbox"]);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(self,((e,t,r,n,o,i)=>(()=>{var a={7162:(e,t,r)=>{r(5047)},5047:e=>{var t=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function s(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var o=t&&t.prototype instanceof y?t:y,i=Object.create(o.prototype),a=new O(n||[]);return i._invoke=function(e,t,r){var n=d;return function(o,i){if(n===h)throw new Error("Generator is already running");if(n===f){if("throw"===o)throw i;return C()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===d)throw n=f,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=h;var s=u(e,t,r);if("normal"===s.type){if(n=r.done?f:p,s.arg===v)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n=f,r.method="throw",r.arg=s.arg)}}}(e,r,a),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var d="suspendedStart",p="suspendedYield",h="executing",f="completed",v={};function y(){}function g(){}function m(){}var b={};s(b,i,(function(){return this}));var k=Object.getPrototypeOf,w=k&&k(k(E([])));w&&w!==r&&n.call(w,i)&&(b=w);var N=m.prototype=y.prototype=Object.create(b);function P(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,a,c){var s=u(e[o],e,i);if("throw"!==s.type){var l=s.arg,d=l.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,a,c)}),(function(e){r("throw",e,a,c)})):t.resolve(d).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,c)}))}c(s.arg)}var o;this._invoke=function(e,n){function i(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(i,i):i()}}function x(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,x(e,r),"throw"===r.method))return v;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var o=u(n,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var i=o.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function V(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function L(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(V,this),this.reset(!0)}function E(e){if(e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}return{next:C}}function C(){return{value:t,done:!0}}return g.prototype=m,s(N,"constructor",m),s(m,"constructor",g),g.displayName=s(m,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,s(e,c,"GeneratorFunction")),e.prototype=Object.create(N),e},e.awrap=function(e){return{__await:e}},P(T.prototype),s(T.prototype,a,(function(){return this})),e.AsyncIterator=T,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new T(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},P(N),s(N,c,"Generator"),s(N,i,(function(){return this})),s(N,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=E,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(L),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(s&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===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,v):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),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),L(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:E(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},5800:e=>{"use strict";e.exports=i},4061:e=>{"use strict";e.exports=r},6870:e=>{"use strict";e.exports=n},6175:e=>{"use strict";e.exports=o},4212:t=>{"use strict";t.exports=e},748:e=>{"use strict";e.exports=t}},c={};function s(e){var t=c[e];if(void 0!==t)return t.exports;var r=c[e]={exports:{}};return a[e](r,r.exports,s),r.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 r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},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 l={};return(()=>{"use strict";s.r(l),s.d(l,{BkCascader:()=>m,BkCascaderPanel:()=>u,default:()=>b});var e=s(4212),t=s(748),r=s(4061),n=s(6870),o=s(6175),i=s.n(o);s(7162),Symbol("BkSelect"),Symbol("BkOptionGroup");var a=s(5800),c=s.n(a);const u=(0,t.defineComponent)({name:"CascaderPanel",props:{width:e.PropTypes.oneOfType([e.PropTypes.number,e.PropTypes.string]).def("auto"),height:e.PropTypes.oneOfType([e.PropTypes.number,e.PropTypes.string]).def(216),store:e.PropTypes.object.def({}),modelValue:e.PropTypes.oneOfType([e.PropTypes.arrayOf(e.PropTypes.number).def([]),e.PropTypes.arrayOf(e.PropTypes.string).def([])])},emits:["update:modelValue"],setup:function(r,o){var i=o.emit,a=r.store,c=(0,t.reactive)({list:[r.store.getNodes()]}),s=(0,t.ref)([]),l=(0,t.ref)([]),u=function(e){return"number"==typeof e?"".concat(e,"px"):e},d=u(r.height),p=u(r.width),h=function(e){e.config.multiple?l.value=a.getCheckedNodes().map((function(e){return e.path})):l.value=e.path,i("update:modelValue",l.value)},f=function(e){var t;if(e&&!(null==e?void 0:e.isDisabled)){if(c.list=c.list.slice(0,e.level),s.value=s.value.slice(0,e.level-1),null===(t=e.children)||void 0===t?void 0:t.length)return c.list.push(e.children),void s.value.push(e);a.config.isRemote&&!e.isLeaf&&(e.loading=!0,a.config.remoteMethod(e,(function(t){a.appendNodes(t,e||null),c.list.push(e.children),s.value.push(e),e.loading=!1})))}};return(0,t.watch)((function(){return r.modelValue}),(function(e){!function(e){0===e.length&&(c.list=c.list.slice(0,1),s.value=[]),e.forEach((function(e){var t=a.getNodeById(e);f(t)})),l.value=e}(e)}),{immediate:!0}),(0,t.watch)((function(){return r.store}),(function(e){c.list=[e.getNodes()]})),{menus:c,activePath:s,nodeExpandHandler:f,isNodeInPath:function(e){return(s.value[e.level-1]||{}).id===e.id},nodeEvent:function(e){var t=e.config,r=t.trigger,n=t.checkAnyLevel,o=t.multiple;return{onClick:function(t){e.isLeaf&&!o||t.stopPropagation(),"click"===r&&f(e),n&&!o&&h(e),e.isLeaf&&!o&&h(e)},onMouseenter:function(){"hover"===r&&f(e)}}},isCheckedNode:function(t,r){return!t.config.multiple&&(0,e.arrayEqual)(r,t.path)},checkValue:l,checkNode:function(e,t){e.setNodeCheck(t),h(e)},iconRender:function(e){return e.loading?(0,t.createVNode)(n.Spinner,{class:"icon-spinner"},null):(0,t.createVNode)(n.AngleRight,{class:"icon-angle-right"},null)},panelWidth:p,panelHeight:d}},render:function(){var e=this;return(0,t.createVNode)("div",{class:"bk-cascader-panel-wrapper"},[this.menus.list.map((function(r){return(0,t.createVNode)("ul",{class:"bk-cascader-panel bk-scroll-y",style:{height:e.panelHeight,width:e.panelWidth}},[r.map((function(r){var n,o;return(0,t.createVNode)("li",(0,t.mergeProps)({class:["bk-cascader-node",{"is-selected":e.isNodeInPath(r)},{"is-disabled":r.isDisabled},{"is-checked":e.isCheckedNode(r,e.checkValue)}]},e.nodeEvent(r)),[r.config.multiple&&(0,t.createVNode)(c(),{disabled:r.isDisabled,modelValue:r.checked,"onUpdate:modelValue":function(e){return r.checked=e},onChange:function(t){return e.checkNode(r,t)}},null),null===(o=(n=e.$slots).default)||void 0===o?void 0:o.call(n,{node:r,data:r.data}),r.isLeaf?"":e.iconRender(r)])}))])}))])}});function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function h(e,t,r){return t&&p(e.prototype,t),r&&p(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}const f=function(){function e(t,r,n){d(this,e),this.data=t,this.config=r,this.parent=n||null,this.leaf=t.leaf,this.level=this.parent?this.parent.level+1:1,this.initState()}return h(e,[{key:"initState",value:function(){var t=this,r=this.config,n=r.idKey,o=r.nameKey,i=r.childrenKey;this.id=this.data[n],this.name=this.data[o],this.loading=!1,this.loaded=!1,this.checked=!1;var a=this.data[i];this.children=(a||[]).map((function(r){return new e(r,t.config,t)})),this.pathNodes=this.calculateNodesPath(),this.path=this.pathNodes.map((function(e){return e.id})),this.pathNames=this.pathNodes.map((function(e){return e.name}))}},{key:"isLeaf",get:function(){var e;return this.config.isRemote?this.leaf||!!this.loaded&&!this.children.length:!(Array.isArray(this.children)&&0!==(null===(e=this.children)||void 0===e?void 0:e.length))}},{key:"isDisabled",get:function(){return this.data.disabled}},{key:"setNodeCheck",value:function(e){this.checked=e}},{key:"calculateNodesPath",value:function(){for(var e=[this],t=this.parent;t;)e.unshift(t),t=t.parent;return e}}]),e}();var v=function e(t,r){return t.reduce((function(t,n){return n.isLeaf?t.push(n):(!r&&t.push(n),t=t.concat(e(n.children,r))),t}),[])};const y=function(){function t(e){var r=this;d(this,t);var n=e.list;this.data=n,this.config=e,this.nodes=this.data.map((function(e){return new f(e,r.config)}))}return h(t,[{key:"getNodes",value:function(){return this.nodes}},{key:"getFlattedNodes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return v(this.nodes,e)}},{key:"getCheckedNodes",value:function(){return this.getFlattedNodes().filter((function(e){return e.checked}))}},{key:"getNodeByValue",value:function(t){var r;return null!==(r=this.getFlattedNodes().filter((function(r){return(0,e.arrayEqual)(r.path,t)}))[0])&&void 0!==r?r:null}},{key:"getNodeById",value:function(e){return this.getFlattedNodes().find((function(t){return t.id===e}))}},{key:"appendNode",value:function(e,t){var r=new f(e,this.config,t);(t?t.children:this.nodes).push(r)}},{key:"appendNodes",value:function(e,t){var r=this;e.forEach((function(e){return r.appendNode(e,t)}))}}]),t}(),g=(0,t.defineComponent)({name:"Cascader",directives:{clickoutside:r.clickoutside},components:{CascaderPanel:u,BkPopover:i()},props:{modelValue:e.PropTypes.oneOfType([e.PropTypes.arrayOf(e.PropTypes.number).def([]),e.PropTypes.arrayOf(e.PropTypes.string).def([])]),list:e.PropTypes.array.def([]),placeholder:e.PropTypes.string.def("请选择"),filterable:e.PropTypes.bool.def(!1),multiple:e.PropTypes.bool.def(!1),disabled:e.PropTypes.bool.def(!1),clearable:e.PropTypes.bool.def(!0),trigger:e.PropTypes.string.def("click"),checkAnyLevel:e.PropTypes.bool.def(!1),isRemote:e.PropTypes.bool.def(!1),remoteMethod:e.PropTypes.func,showCompleteName:e.PropTypes.bool.def(!0),idKey:e.PropTypes.string.def("id"),nameKey:e.PropTypes.string.def("name"),childrenKey:e.PropTypes.string.def("children"),separator:e.PropTypes.string.def("/"),limitOneLine:e.PropTypes.bool.def(!1),extCls:e.PropTypes.string.def(""),scrollHeight:e.PropTypes.oneOfType([e.PropTypes.number,e.PropTypes.string]).def(216),scrollWidth:e.PropTypes.oneOfType([e.PropTypes.number,e.PropTypes.string]).def("auto")},emits:["update:modelValue","change","clear","toggle"],setup:function(e,r){var n=r.emit,o=e.separator,i=e.multiple,a=function(){var e=(0,t.ref)(!1);return{isHover:e,setHover:function(){e.value=!0},cancelHover:function(){e.value=!1}}}(),c=a.isHover,s=a.setHover,l=a.cancelHover,u=(0,t.ref)(new y(e)),d=(0,t.ref)(!1),p=(0,t.ref)(""),h=(0,t.ref)([]),f=(0,t.toRefs)(e).modelValue,v=(0,t.ref)(),g=(0,t.computed)({get:function(){return f.value},set:function(e){n("update:modelValue",e)}}),m=(0,t.ref)(null),b=function(t){return e.showCompleteName?t.pathNames.join(o):t.pathNames[t.pathNames.length-1]},k=function(t){var r;if(i)h.value=u.value.getCheckedNodes().map((function(e){return{text:b(e),key:e.id}}));else if(!e.checkAnyLevel&&(null===(r=null==m?void 0:m.value)||void 0===r||r.hide()),0===t.length)p.value="";else{var n=u.value.getNodeByValue(t);if(!n)return;p.value=b(n)}};return(0,t.watch)((function(){return e.modelValue}),(function(e){k(e),n("update:modelValue",e),n("change",e)}),{immediate:!0}),(0,t.watch)((function(){return e.list}),(function(){u.value=new y(e),k(e.modelValue)}),{deep:!0,immediate:!0}),{store:u,updateValue:k,panelShow:d,selectedText:p,checkedValue:g,handleClear:function(t){t.stopPropagation(),k([]),n("update:modelValue",[]),n("clear",JSON.parse(JSON.stringify(e.modelValue)))},isHover:c,setHover:s,popover:m,cancelHover:l,selectedTags:h,removeTag:function(e,t,r){r.stopPropagation();var n=JSON.parse(JSON.stringify(e));n.splice(t,1),k(n)},cascaderPanel:v,popoverChangeEmitter:function(e){n("toggle",e.isShow)}}},render:function(){var e=this;return(0,t.createVNode)("div",{class:["bk-cascader","bk-cascader-wrapper",this.extCls,{"bk-is-show-panel":this.panelShow,"is-unselected":0===this.modelValue.length,"is-hover":this.isHover}],tabindex:"0","data-placeholder":this.placeholder,onMouseenter:this.setHover,onMouseleave:this.cancelHover},[e.clearable&&e.isHover?(0,t.createVNode)(n.Close,{class:"bk-icon-clear-icon",onClick:e.handleClear},null):(0,t.createVNode)(n.AngleUp,{class:"bk-icon-angle-up"},null),(0,t.createVNode)(i(),{placement:"bottom-start",theme:"light bk-cascader-popover",trigger:"click",arrow:!1,class:"bk-cascader-popover-wrapper",ref:"popover",onAfterHidden:this.popoverChangeEmitter,onAfterShow:this.popoverChangeEmitter,boundary:"body"},{default:function(){return(0,t.createVNode)("div",{class:"bk-cascader-name"},[e.multiple&&(e.limitOneLine?(0,t.createVNode)("span",null,[e.selectedText]):(0,t.createVNode)("div",{class:"cascader-tag-list"},[e.selectedTags.map((function(r,o){return(0,t.createVNode)("span",{class:"cascader-tag-item"},[(0,t.createVNode)("span",{class:"cascader-tag-item-name"},[r.text]),(0,t.createVNode)(n.Error,{class:"bk-icon-clear-icon",onClick:function(t){return e.removeTag(e.modelValue,o,t)}},null)])}))])),e.filterable?(0,t.createVNode)("input",{class:"bk-cascader-search-input",type:"text",placeholder:e.placeholder},null):(0,t.createVNode)("span",null,[e.selectedText])])},content:function(){return(0,t.createVNode)("div",{class:"bk-cascader-popover"},[(0,t.createVNode)(u,{store:e.store,ref:"cascaderPanel",width:e.scrollWidth,height:e.scrollHeight,modelValue:e.checkedValue,"onUpdate:modelValue":function(t){return e.checkedValue=t}},{default:function(r){return e.$slots.default?e.$slots.default(r):(0,t.createVNode)("span",{class:"bk-cascader-node-name"},[r.node.name])}})])}})])}});var m=(0,e.withInstallProps)(g,{CascaderPanel:u});const b=m})(),l})()));
|
@@ -33,6 +33,11 @@
|
|
33
33
|
transform: translate(-50%, -60%) scaleY(1) rotate(45deg);
|
34
34
|
transform-origin: center;
|
35
35
|
}
|
36
|
+
.bk-checkbox.is-indeterminated .bk-checkbox-input {
|
37
|
+
background: #3a84ff;
|
38
|
+
border-color: #3a84ff;
|
39
|
+
transition: all 0.1s;
|
40
|
+
}
|
36
41
|
.bk-checkbox.is-indeterminated .bk-checkbox-input.small::after {
|
37
42
|
width: 6px;
|
38
43
|
height: 2px;
|
@@ -146,6 +146,11 @@
|
|
146
146
|
transform: translate(-50%, -60%) scaleY(1) rotate(45deg);
|
147
147
|
transform-origin: center;
|
148
148
|
}
|
149
|
+
.bk-checkbox.is-indeterminated .bk-checkbox-input {
|
150
|
+
background: var(--primary-color);
|
151
|
+
border-color: var(--primary-color);
|
152
|
+
transition: all 0.1s;
|
153
|
+
}
|
149
154
|
.bk-checkbox.is-indeterminated .bk-checkbox-input.small::after {
|
150
155
|
width: 6px;
|
151
156
|
height: 2px;
|
@@ -10,6 +10,7 @@ declare const BkPagination: {
|
|
10
10
|
layout: string[];
|
11
11
|
count: number;
|
12
12
|
modelValue: number;
|
13
|
+
beforeChange: (...args: any[]) => any;
|
13
14
|
prevText: string;
|
14
15
|
nextText: string;
|
15
16
|
align: string;
|
@@ -74,6 +75,9 @@ declare const BkPagination: {
|
|
74
75
|
} & {
|
75
76
|
default: boolean;
|
76
77
|
};
|
78
|
+
beforeChange: import("vue-types").VueTypeValidableDef<(...args: any[]) => any> & {
|
79
|
+
default: (...args: any[]) => any;
|
80
|
+
};
|
77
81
|
layout: import("vue-types").VueTypeDef<string[]> & {
|
78
82
|
default: () => string[];
|
79
83
|
};
|
@@ -82,7 +86,7 @@ declare const BkPagination: {
|
|
82
86
|
"onUpdate:modelValue"?: (...args: any[]) => any;
|
83
87
|
"onUpdate:limit"?: (...args: any[]) => any;
|
84
88
|
onLimitChange?: (...args: any[]) => any;
|
85
|
-
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "small" | "type" | "disabled" | "location" | "layout" | "count" | "modelValue" | "prevText" | "nextText" | "align" | "limit" | "limitList" | "showLimit" | "showTotalCount">;
|
89
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "small" | "type" | "disabled" | "location" | "layout" | "count" | "modelValue" | "beforeChange" | "prevText" | "nextText" | "align" | "limit" | "limitList" | "showLimit" | "showTotalCount">;
|
86
90
|
$attrs: {
|
87
91
|
[x: string]: unknown;
|
88
92
|
};
|
@@ -153,6 +157,9 @@ declare const BkPagination: {
|
|
153
157
|
} & {
|
154
158
|
default: boolean;
|
155
159
|
};
|
160
|
+
beforeChange: import("vue-types").VueTypeValidableDef<(...args: any[]) => any> & {
|
161
|
+
default: (...args: any[]) => any;
|
162
|
+
};
|
156
163
|
layout: import("vue-types").VueTypeDef<string[]> & {
|
157
164
|
default: () => string[];
|
158
165
|
};
|
@@ -184,6 +191,7 @@ declare const BkPagination: {
|
|
184
191
|
layout: string[];
|
185
192
|
count: number;
|
186
193
|
modelValue: number;
|
194
|
+
beforeChange: (...args: any[]) => any;
|
187
195
|
prevText: string;
|
188
196
|
nextText: string;
|
189
197
|
align: string;
|
@@ -268,6 +276,9 @@ declare const BkPagination: {
|
|
268
276
|
} & {
|
269
277
|
default: boolean;
|
270
278
|
};
|
279
|
+
beforeChange: import("vue-types").VueTypeValidableDef<(...args: any[]) => any> & {
|
280
|
+
default: (...args: any[]) => any;
|
281
|
+
};
|
271
282
|
layout: import("vue-types").VueTypeDef<string[]> & {
|
272
283
|
default: () => string[];
|
273
284
|
};
|
@@ -352,6 +363,9 @@ declare const BkPagination: {
|
|
352
363
|
} & {
|
353
364
|
default: boolean;
|
354
365
|
};
|
366
|
+
beforeChange: import("vue-types").VueTypeValidableDef<(...args: any[]) => any> & {
|
367
|
+
default: (...args: any[]) => any;
|
368
|
+
};
|
355
369
|
layout: import("vue-types").VueTypeDef<string[]> & {
|
356
370
|
default: () => string[];
|
357
371
|
};
|
@@ -383,6 +397,7 @@ declare const BkPagination: {
|
|
383
397
|
layout: string[];
|
384
398
|
count: number;
|
385
399
|
modelValue: number;
|
400
|
+
beforeChange: (...args: any[]) => any;
|
386
401
|
prevText: string;
|
387
402
|
nextText: string;
|
388
403
|
align: string;
|
package/lib/pagination/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("../shared"),require("vue"),require("../select"),require("../icon"),require("../popover"));else if("function"==typeof define&&define.amd)define(["../shared","vue","../select","../icon","../popover"],t);else{var n="object"==typeof exports?t(require("../shared"),require("vue"),require("../select"),require("../icon"),require("../popover")):t(e["../shared"],e.vue,e["../select"],e["../icon"],e["../popover"]);for(var a in n)("object"==typeof exports?exports:e)[a]=n[a]}}(self,((e,t,n,a,r)=>(()=>{"use strict";var i={6870:e=>{e.exports=a},5537:e=>{e.exports=r},6422:e=>{e.exports=n},4212:t=>{t.exports=e},748:e=>{e.exports=t}},o={};function l(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={exports:{}};return i[e](n,n.exports,l),n.exports}l.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return l.d(t,{a:t}),t},l.d=(e,t)=>{for(var n in t)l.o(t,n)&&!l.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),l.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var u={};return(()=>{l.r(u),l.d(u,{BkPagination:()=>v,default:()=>m});var e=l(4212);function t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,r,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(a=n.next()).done)&&(i.push(a.value),!t||i.length!==t);o=!0);}catch(e){l=!0,r=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return n(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?n(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var r=l(748),i=l(6422),o=l.n(i),c=l(6870),s=l(5537),d=l.n(s);var f={modelValue:e.PropTypes.number.def(1),count:e.PropTypes.number.def(0).isRequired,limit:e.PropTypes.number.def(10),limitList:e.PropTypes.arrayOf(Number).def([10,20,50,100]),showLimit:e.PropTypes.bool.def(!0),type:e.PropTypes.oneOf(["default","compact"]).def("default"),location:e.PropTypes.oneOf(["left","right"]).def("right"),align:e.PropTypes.oneOf(["left","center","right"]).def("left"),size:e.PropTypes.size(),small:e.PropTypes.bool.def(!1),showTotalCount:e.PropTypes.bool.def(!0),prevText:e.PropTypes.string,nextText:e.PropTypes.string,disabled:e.PropTypes.bool.def(!1),layout:e.PropTypes.custom((function(e){var t={total:!0,list:!0,limit:!0};return e.some((function(e){return t[e]}))}),"layout 的值只支持 * total、list、limit *").def(["total","list","limit"])};const p=(0,r.defineComponent)({name:"Pagination",props:f,emits:["update:modelValue","change","update:limit","limitChange"],setup:function(e,t){var n=(0,r.ref)(0),l=(0,r.toRefs)(e),u=l.count,s=l.limit,f=function(){var e=(0,r.getCurrentInstance)().proxy,t=(0,r.ref)(1),n=(0,r.computed)((function(){return 1===t.value})),a=(0,r.computed)((function(){return t.value===e.totalPageNum})),i=(0,r.ref)(!1),o=(0,r.ref)(!1),l=(0,r.computed)((function(){i.value=!1,o.value=!1;var n=[];if(e.totalPageNum<=7){for(var a=2;a<=e.totalPageNum-1;a++)n.push(a);return n}var r=Math.floor(2.5);e.totalPageNum>5&&(i.value=t.value-r>2,o.value=t.value+r<e.totalPageNum-1);for(var l=Math.min(e.totalPageNum-5,Math.max(2,t.value-r)),u=l;u<l+5;u++)n.push(u);return n}));(0,r.watch)((function(){return e.modelValue}),(function(n){(0,r.nextTick)((function(){n>=1&&n<=e.totalPageNum?t.value=n:t.value=n<1?1:e.totalPageNum}))}),{immediate:!0}),(0,r.nextTick)((function(){(0,r.watch)((function(){return e.totalPageNum}),(function(e){t.value>e&&(t.value=e)}))}));var u=function(){n.value||(t.value=t.value-1)},s=function(){a.value||(t.value=t.value+1)},d=function(e){e!==t.value&&(t.value=e)},f=function(){t.value=Math.max(1,t.value-5)},p=function(){t.value=Math.min(e.totalPageNum,t.value+5)};return{current:t,render:function(v){var m=v.isFirst,g=v.isLast;return(0,r.createVNode)("div",{class:{"bk-pagination-list":!0,"is-first":m,"is-last":g}},[(0,r.createVNode)("div",{class:{"bk-pagination-list-pre":!0,"is-disabled":n.value},onClick:u},[e.prevText||(0,r.createVNode)(c.AngleLeft,null,null)]),(0,r.createVNode)("div",{class:{"bk-pagination-list-item":!0,"is-active":1===t.value},key:"1",onClick:function(){return d(1)}},[(0,r.createTextVNode)("1")]),i.value&&(0,r.createVNode)("div",{key:"pre-batch",class:"bk-pagination-list-pre-batch",onClick:f},[(0,r.createVNode)(c.Ellipsis,null,null)]),l.value.map((function(e){return(0,r.createVNode)("div",{class:{"bk-pagination-list-item":!0,"is-active":t.value===e},key:e,onClick:function(){return d(e)}},[e])})),o.value&&(0,r.createVNode)("div",{key:"next-batch",class:"bk-pagination-list-next-batch",onClick:p},[(0,r.createVNode)(c.Ellipsis,null,null)]),e.totalPageNum>1&&(0,r.createVNode)("div",{class:{"bk-pagination-list-item":!0,"is-active":t.value===e.totalPageNum},key:"last",onClick:function(){return d(e.totalPageNum)}},[e.totalPageNum]),(0,r.createVNode)("div",{class:{"bk-pagination-list-pre":!0,"is-disabled":a.value},onClick:s},[e.nextText||(0,r.createVNode)(c.AngleRight,null,null)])])}}}(),p=f.current,v=f.render,m=function(){var e=(0,r.getCurrentInstance)().proxy,t=(0,r.ref)(null),n=(0,r.ref)(!1),a=(0,r.ref)(1),i=(0,r.computed)((function(){return 1===a.value})),o=(0,r.computed)((function(){return a.value===e.totalPageNum})),l=0,u=(0,r.computed)((function(){for(var t=[],n=1;n<=e.totalPageNum;n++)t.push(n);return t}));(0,r.watch)((function(){return e.modelValue}),(function(t){(0,r.nextTick)((function(){t>=1&&t<=e.totalPageNum?a.value=t:a.value=t<1?1:e.totalPageNum,l=a.value}))}),{immediate:!0}),(0,r.nextTick)((function(){(0,r.watch)((function(){return e.totalPageNum}),(function(e){a.value>e&&(a.value=e)}))}));var s=function(){i.value||(a.value=a.value-1)},f=function(){o.value||(a.value=a.value+1)},p=function(){n.value=!0},v=function(){n.value=!1,t.value.textContent="".concat(l),l!==a.value&&(a.value=l)},m=function(t){var n=t.target,r=Number(n.textContent);!r||r<1||r>e.totalPageNum||r===a.value||(l=r)},g=function(e){["Enter","NumpadEnter"].includes(e.code)&&(e.preventDefault(),v())};return{current:a,render:function(){return(0,r.createVNode)("div",{class:"bk-pagination-small-list"},[(0,r.createVNode)("div",{class:{"bk-pagination-btn-pre":!0,"is-disabled":i.value},onClick:s},[(0,r.createVNode)(c.LeftShape,null,null)]),(0,r.createVNode)(d(),{theme:"light",trigger:"click",arrow:!1,boundary:"body",placement:"bottom"},{default:function(){return(0,r.createVNode)("div",{class:{"bk-pagination-picker":!0,"is-focused":n.value}},[(0,r.createVNode)("span",{ref:t,class:"bk-pagination-editor",contenteditable:!0,spellcheck:"false",onFocus:p,onBlur:v,onInput:m,onKeydown:g},[a.value]),(0,r.createVNode)("span",null,[(0,r.createTextVNode)("/")]),(0,r.createVNode)("span",{class:"bk-pagination-small-list-total"},[e.totalPageNum])])},content:function(){return(0,r.createVNode)("div",{class:"bk-pagination-picker-list"},[u.value.map((function(e){return(0,r.createVNode)("div",{class:{item:!0,"is-actived":e===a.value},key:e,onClick:function(){return function(e){l=e,v()}(e)}},[e])}))])}}),(0,r.createVNode)("div",{class:{"bk-pagination-btn-next":!0,"is-disabled":o.value},onClick:f},[(0,r.createVNode)(c.RightShape,null,null)])])}}}(),g=m.current,b=m.render,h=function(){var e=(0,r.getCurrentInstance)().proxy,t=(0,r.ref)(e.limit);(0,r.watch)((function(){return e.limit}),(function(e){t.value=e})),(0,r.watch)((function(){return e.limitList}),(function(e){(0,r.nextTick)((function(){if(!e.includes(t.value)){var n=a(e,1);t.value=n[0]}}))}),{immediate:!0});var n=function(e){t.value=e};return{limit:t,render:function(a){var l,u,c=a.isFirst,s=a.isLast;return e.showLimit?(0,r.createVNode)("div",(0,r.mergeProps)({class:{"bk-pagination-limit":!0,"is-first":c,"is-last":s}},{disabled:e.disabled}),[(0,r.createVNode)("div",null,[(0,r.createTextVNode)("每页")]),(0,r.createVNode)(o(),{class:"bk-pagination-limit-select",clearable:!1,modelValue:t.value,onChange:n,disabled:e.disabled},(u=l=e.limitList.map((function(e,t){return(0,r.createVNode)(i.BkOption,{value:e,label:"".concat(e),key:"".concat(t,"_").concat(e)},null)})),"function"==typeof u||"[object Object]"===Object.prototype.toString.call(u)&&!(0,r.isVNode)(u)?l:{default:function(){return[l]}})),(0,r.createVNode)("div",null,[(0,r.createTextVNode)("条")])]):null}}}(),y=h.limit,N=h.render;return(0,r.watch)([u,y,s],(function(e){var t=a(e,2),r=t[0],i=t[1],o=Math.ceil(r/i);n.value=o<1?1:o}),{immediate:!0}),(0,r.watch)(p,(function(e){t.emit("update:modelValue",e),t.emit("change",e)})),(0,r.watch)(g,(function(e){t.emit("update:modelValue",e),t.emit("change",e)})),(0,r.watch)(y,(function(e){t.emit("limitChange",e)})),{totalPageNum:n,renderTotal:function(e){var t=e.isFirst,n=e.isLast,a=(0,r.getCurrentInstance)().props;return a.showTotalCount?(0,r.createVNode)("div",(0,r.mergeProps)({class:{"bk-pagination-total":!0,"is-first":t,"is-last":n}},{disabled:a.disabled}),[(0,r.createTextVNode)("共计"),(0,r.createVNode)("div",{class:"bk-pagination-total-num"},[a.count]),(0,r.createTextVNode)("条")]):null},renderList:v,renderLimit:N,renderSmallList:b}},render:function(){var n,a=this,i=(0,e.classes)((t(n={"bk-pagination":!0},"bk-pagination--".concat(this.size),!0),t(n,"is-align-".concat(this.align),!0),n)),o={total:this.renderTotal,list:this.small?this.renderSmallList:this.renderList,limit:this.renderLimit};return(0,r.createVNode)("div",{class:i},[this.layout.map((function(e,t){return o[e]({isFirst:0===t,isLast:t===a.layout.length-1})}))])}});var v=(0,e.withInstall)(p);const m=v})(),u})()));
|
1
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("../shared"),require("vue"),require("../select"),require("../icon"),require("../popover2"));else if("function"==typeof define&&define.amd)define(["../shared","vue","../select","../icon","../popover2"],t);else{var n="object"==typeof exports?t(require("../shared"),require("vue"),require("../select"),require("../icon"),require("../popover2")):t(e["../shared"],e.vue,e["../select"],e["../icon"],e["../popover2"]);for(var a in n)("object"==typeof exports?exports:e)[a]=n[a]}}(self,((e,t,n,a,r)=>(()=>{"use strict";var i={6870:e=>{e.exports=a},6175:e=>{e.exports=r},6422:e=>{e.exports=n},4212:t=>{t.exports=e},748:e=>{e.exports=t}},o={};function l(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={exports:{}};return i[e](n,n.exports,l),n.exports}l.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return l.d(t,{a:t}),t},l.d=(e,t)=>{for(var n in t)l.o(t,n)&&!l.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),l.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var u={};return(()=>{l.r(u),l.d(u,{BkPagination:()=>v,default:()=>m});var e=l(4212);function t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,r,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(a=n.next()).done)&&(i.push(a.value),!t||i.length!==t);o=!0);}catch(e){l=!0,r=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return n(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?n(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var r=l(748),i=l(6422),o=l.n(i),c=l(6870),s=l(6175),d=l.n(s);var f={modelValue:e.PropTypes.number.def(1),count:e.PropTypes.number.def(0).isRequired,limit:e.PropTypes.number.def(10),limitList:e.PropTypes.arrayOf(Number).def([10,20,50,100]),showLimit:e.PropTypes.bool.def(!0),type:e.PropTypes.oneOf(["default","compact"]).def("default"),location:e.PropTypes.oneOf(["left","right"]).def("right"),align:e.PropTypes.oneOf(["left","center","right"]).def("left"),size:e.PropTypes.size(),small:e.PropTypes.bool.def(!1),showTotalCount:e.PropTypes.bool.def(!0),prevText:e.PropTypes.string,nextText:e.PropTypes.string,disabled:e.PropTypes.bool.def(!1),beforeChange:e.PropTypes.func,layout:e.PropTypes.custom((function(e){var t={total:!0,list:!0,limit:!0};return e.some((function(e){return t[e]}))}),"layout 的值只支持 * total、list、limit *").def(["total","list","limit"])};const p=(0,r.defineComponent)({name:"Pagination",props:f,emits:["update:modelValue","change","update:limit","limitChange"],setup:function(e,t){var n=(0,r.ref)(0),l=(0,r.toRefs)(e),u=l.count,s=l.limit,f=function(){var e=(0,r.getCurrentInstance)().proxy,t=(0,r.ref)(1),n=(0,r.computed)((function(){return 1===t.value})),a=(0,r.computed)((function(){return t.value===e.totalPageNum})),i=(0,r.ref)(!1),o=(0,r.ref)(!1),l=(0,r.computed)((function(){i.value=!1,o.value=!1;var n=[];if(e.totalPageNum<=7){for(var a=2;a<=e.totalPageNum-1;a++)n.push(a);return n}var r=Math.floor(2.5);e.totalPageNum>5&&(i.value=t.value-r>2,o.value=t.value+r<e.totalPageNum-1);for(var l=Math.min(e.totalPageNum-5,Math.max(2,t.value-r)),u=l;u<l+5;u++)n.push(u);return n}));(0,r.watch)((function(){return e.modelValue}),(function(n){(0,r.nextTick)((function(){n>=1&&n<=e.totalPageNum?t.value=n:t.value=n<1?1:e.totalPageNum}))}),{immediate:!0}),(0,r.nextTick)((function(){(0,r.watch)((function(){return e.totalPageNum}),(function(e){t.value>e&&(t.value=e)}))}));var u=function(){n.value||(t.value=t.value-1)},s=function(){a.value||(t.value=t.value+1)},d=function(e){e!==t.value&&(t.value=e)},f=function(){t.value=Math.max(1,t.value-5)},p=function(){t.value=Math.min(e.totalPageNum,t.value+5)};return{current:t,render:function(v){var m=v.isFirst,g=v.isLast;return(0,r.createVNode)("div",{class:{"bk-pagination-list":!0,"is-first":m,"is-last":g}},[(0,r.createVNode)("div",{class:{"bk-pagination-list-pre":!0,"is-disabled":n.value},onClick:u},[e.prevText||(0,r.createVNode)(c.AngleLeft,null,null)]),(0,r.createVNode)("div",{class:{"bk-pagination-list-item":!0,"is-active":1===t.value},key:"1",onClick:function(){return d(1)}},[(0,r.createTextVNode)("1")]),i.value&&(0,r.createVNode)("div",{key:"pre-batch",class:"bk-pagination-list-pre-batch",onClick:f},[(0,r.createVNode)(c.Ellipsis,null,null)]),l.value.map((function(e){return(0,r.createVNode)("div",{class:{"bk-pagination-list-item":!0,"is-active":t.value===e},key:e,onClick:function(){return d(e)}},[e])})),o.value&&(0,r.createVNode)("div",{key:"next-batch",class:"bk-pagination-list-next-batch",onClick:p},[(0,r.createVNode)(c.Ellipsis,null,null)]),e.totalPageNum>1&&(0,r.createVNode)("div",{class:{"bk-pagination-list-item":!0,"is-active":t.value===e.totalPageNum},key:"last",onClick:function(){return d(e.totalPageNum)}},[e.totalPageNum]),(0,r.createVNode)("div",{class:{"bk-pagination-list-pre":!0,"is-disabled":a.value},onClick:s},[e.nextText||(0,r.createVNode)(c.AngleRight,null,null)])])}}}(),p=f.current,v=f.render,m=function(){var e=(0,r.getCurrentInstance)().proxy,t=(0,r.ref)(null),n=(0,r.ref)(!1),a=(0,r.ref)(1),i=(0,r.computed)((function(){return 1===a.value})),o=(0,r.computed)((function(){return a.value===e.totalPageNum})),l=0,u=(0,r.computed)((function(){for(var t=[],n=1;n<=e.totalPageNum;n++)t.push(n);return t}));(0,r.watch)((function(){return e.modelValue}),(function(t){(0,r.nextTick)((function(){t>=1&&t<=e.totalPageNum?a.value=t:a.value=t<1?1:e.totalPageNum,l=a.value}))}),{immediate:!0}),(0,r.nextTick)((function(){(0,r.watch)((function(){return e.totalPageNum}),(function(e){a.value>e&&(a.value=e)}))}));var s=function(){i.value||(a.value=a.value-1)},f=function(){o.value||(a.value=a.value+1)},p=function(){n.value=!0},v=function(){n.value=!1,t.value.textContent="".concat(l),l!==a.value&&(a.value=l)},m=function(t){var n=t.target,r=Number(n.textContent);!r||r<1||r>e.totalPageNum||r===a.value||(l=r)},g=function(e){["Enter","NumpadEnter"].includes(e.code)&&(e.preventDefault(),v())};return{current:a,render:function(){return(0,r.createVNode)("div",{class:"bk-pagination-small-list"},[(0,r.createVNode)("div",{class:{"bk-pagination-btn-pre":!0,"is-disabled":i.value},onClick:s},[(0,r.createVNode)(c.AngleLeft,null,null)]),(0,r.createVNode)(d(),{theme:"light",trigger:"click",arrow:!1,width:56,boundary:"body",placement:"bottom"},{default:function(){return(0,r.createVNode)("div",{class:{"bk-pagination-picker":!0,"is-focused":n.value}},[(0,r.createVNode)("span",{ref:t,class:"bk-pagination-editor",contenteditable:!0,spellcheck:"false",onFocus:p,onBlur:v,onInput:m,onKeydown:g},[a.value]),(0,r.createVNode)("span",null,[(0,r.createTextVNode)("/")]),(0,r.createVNode)("span",{class:"bk-pagination-small-list-total"},[e.totalPageNum])])},content:function(){return(0,r.createVNode)("div",{class:"bk-pagination-picker-list"},[u.value.map((function(e){return(0,r.createVNode)("div",{class:{item:!0,"is-actived":e===a.value},key:e,onClick:function(){return function(e){l=e,v()}(e)}},[e])}))])}}),(0,r.createVNode)("div",{class:{"bk-pagination-btn-next":!0,"is-disabled":o.value},onClick:f},[(0,r.createVNode)(c.AngleRight,null,null)])])}}}(),g=m.current,b=m.render,y=function(){var e=(0,r.getCurrentInstance)().proxy,t=(0,r.ref)(e.limit);(0,r.watch)((function(){return e.limit}),(function(e){t.value=e})),(0,r.watch)((function(){return e.limitList}),(function(e){(0,r.nextTick)((function(){if(!e.includes(t.value)){var n=a(e,1);t.value=n[0]}}))}),{immediate:!0});var n=function(e){t.value=e};return{limit:t,render:function(a){var l,u,c=a.isFirst,s=a.isLast;return e.showLimit?(0,r.createVNode)("div",(0,r.mergeProps)({class:{"bk-pagination-limit":!0,"is-first":c,"is-last":s}},{disabled:e.disabled}),[(0,r.createVNode)("div",null,[(0,r.createTextVNode)("每页")]),(0,r.createVNode)(o(),{class:"bk-pagination-limit-select",clearable:!1,size:"small",modelValue:t.value,onChange:n,disabled:e.disabled},(u=l=e.limitList.map((function(e,t){return(0,r.createVNode)(i.BkOption,{value:e,label:"".concat(e),key:"".concat(t,"_").concat(e)},null)})),"function"==typeof u||"[object Object]"===Object.prototype.toString.call(u)&&!(0,r.isVNode)(u)?l:{default:function(){return[l]}})),(0,r.createVNode)("div",null,[(0,r.createTextVNode)("条")])]):null}}}(),h=y.limit,N=y.render;return(0,r.watch)([u,h,s],(function(e){var t=a(e,2),r=t[0],i=t[1],o=Math.ceil(r/i);n.value=o<1?1:o}),{immediate:!0}),(0,r.watch)(p,(function(e){t.emit("update:modelValue",e),t.emit("change",e)})),(0,r.watch)(g,(function(n){e.small&&(t.emit("update:modelValue",n),t.emit("change",n))})),(0,r.watch)(h,(function(e){t.emit("limitChange",e)})),{totalPageNum:n,renderTotal:function(e){var t=e.isFirst,n=e.isLast,a=(0,r.getCurrentInstance)().props;return a.showTotalCount?(0,r.createVNode)("div",(0,r.mergeProps)({class:{"bk-pagination-total":!0,"is-first":t,"is-last":n}},{disabled:a.disabled}),[(0,r.createTextVNode)("共计"),(0,r.createVNode)("div",{class:"bk-pagination-total-num"},[a.count]),(0,r.createTextVNode)("条")]):null},renderList:v,renderLimit:N,renderSmallList:b}},render:function(){var n,a=this,i=(0,e.classes)((t(n={"bk-pagination":!0},"bk-pagination--".concat(this.size),!0),t(n,"is-align-".concat(this.align),!0),n)),o={total:this.renderTotal,list:this.small?this.renderSmallList:this.renderList,limit:this.renderLimit};return(0,r.createVNode)("div",{class:i},[this.layout.map((function(e,t){return o[e]({isFirst:0===t,isLast:t===a.layout.length-1})}))])}});var v=(0,e.withInstall)(p);const m=v})(),u})()));
|
@@ -33,11 +33,12 @@
|
|
33
33
|
}
|
34
34
|
.bk-pagination-total-num {
|
35
35
|
padding: 0 2px;
|
36
|
-
color: #3f4046;
|
37
36
|
}
|
38
37
|
.bk-pagination-list {
|
39
38
|
display: flex;
|
40
39
|
}
|
40
|
+
.bk-pagination-list-pre-batch,
|
41
|
+
.bk-pagination-list-next-batch,
|
41
42
|
.bk-pagination-list-pre,
|
42
43
|
.bk-pagination-list-next,
|
43
44
|
.bk-pagination-list-item {
|
@@ -52,19 +53,26 @@
|
|
52
53
|
color: #63656e;
|
53
54
|
cursor: pointer;
|
54
55
|
background: #fff;
|
55
|
-
border: 1px solid #c4c6cc;
|
56
56
|
border-radius: 2px;
|
57
57
|
user-select: none;
|
58
58
|
}
|
59
|
-
.bk-pagination-list-pre
|
60
|
-
.bk-pagination-list-next
|
61
|
-
.bk-pagination-list-item:hover,
|
59
|
+
.bk-pagination-list-pre-batch.is-active,
|
60
|
+
.bk-pagination-list-next-batch.is-active,
|
62
61
|
.bk-pagination-list-pre.is-active,
|
63
62
|
.bk-pagination-list-next.is-active,
|
64
63
|
.bk-pagination-list-item.is-active {
|
65
64
|
color: #3a84ff;
|
66
|
-
|
65
|
+
background: #e1ecff;
|
66
|
+
}
|
67
|
+
.bk-pagination-list-pre-batch:hover,
|
68
|
+
.bk-pagination-list-next-batch:hover,
|
69
|
+
.bk-pagination-list-pre:hover,
|
70
|
+
.bk-pagination-list-next:hover,
|
71
|
+
.bk-pagination-list-item:hover {
|
72
|
+
background: #f0f1f5;
|
67
73
|
}
|
74
|
+
.bk-pagination-list-pre-batch.is-disabled,
|
75
|
+
.bk-pagination-list-next-batch.is-disabled,
|
68
76
|
.bk-pagination-list-pre.is-disabled,
|
69
77
|
.bk-pagination-list-next.is-disabled,
|
70
78
|
.bk-pagination-list-item.is-disabled {
|
@@ -73,26 +81,20 @@
|
|
73
81
|
background-color: #fafbfd;
|
74
82
|
border-color: #dcdee5;
|
75
83
|
}
|
76
|
-
.bk-pagination-list-pre-batch,
|
77
|
-
.bk-pagination-list-next-batch {
|
78
|
-
display: flex;
|
79
|
-
align-items: center;
|
80
|
-
justify-content: center;
|
81
|
-
height: 32px;
|
82
|
-
cursor: pointer;
|
83
|
-
user-select: none;
|
84
|
-
}
|
85
|
-
.bk-pagination-list-pre-batch:hover,
|
86
|
-
.bk-pagination-list-next-batch:hover {
|
87
|
-
color: #3a84ff;
|
88
|
-
}
|
89
84
|
.bk-pagination-list-pre,
|
90
85
|
.bk-pagination-list-next {
|
91
|
-
font-size:
|
86
|
+
font-size: 20px;
|
87
|
+
color: #979ba5;
|
88
|
+
}
|
89
|
+
.bk-pagination-list-pre.is-disabled,
|
90
|
+
.bk-pagination-list-next.is-disabled {
|
91
|
+
color: #dcdee5;
|
92
|
+
cursor: not-allowed;
|
93
|
+
background-color: transparent;
|
92
94
|
}
|
93
95
|
.bk-pagination-list-item {
|
94
|
-
margin-right:
|
95
|
-
margin-left:
|
96
|
+
margin-right: 2px;
|
97
|
+
margin-left: 2px;
|
96
98
|
}
|
97
99
|
.bk-pagination-limit {
|
98
100
|
display: flex;
|
@@ -103,12 +105,32 @@
|
|
103
105
|
width: 60px;
|
104
106
|
margin: 0 4px;
|
105
107
|
}
|
108
|
+
.bk-pagination-limit-select .bk-input {
|
109
|
+
border-color: #f0f1f5;
|
110
|
+
}
|
111
|
+
.bk-pagination-limit-select .bk-input--text {
|
112
|
+
background-color: #f0f1f5;
|
113
|
+
}
|
114
|
+
.bk-pagination-limit-select:hover .bk-input {
|
115
|
+
border-color: #eaebf0;
|
116
|
+
}
|
117
|
+
.bk-pagination-limit-select:hover .bk-input--text {
|
118
|
+
background-color: #eaebf0;
|
119
|
+
}
|
120
|
+
.bk-pagination-limit-select .bk-input.is-focused {
|
121
|
+
border-color: #3a84ff;
|
122
|
+
}
|
123
|
+
.bk-pagination-limit-select .bk-input.is-focused .bk-input--text {
|
124
|
+
background-color: #fff;
|
125
|
+
}
|
106
126
|
.bk-pagination-small-list {
|
107
127
|
display: flex;
|
128
|
+
align-items: center;
|
108
129
|
}
|
109
130
|
.bk-pagination-small-list .bk-pagination-picker {
|
110
131
|
display: flex;
|
111
|
-
height:
|
132
|
+
height: 26px;
|
133
|
+
margin: 0 4px;
|
112
134
|
cursor: pointer;
|
113
135
|
background-color: #f0f1f5;
|
114
136
|
border: 1px solid #f0f1f5;
|
@@ -116,8 +138,8 @@
|
|
116
138
|
align-items: center;
|
117
139
|
}
|
118
140
|
.bk-pagination-small-list .bk-pagination-picker:hover {
|
119
|
-
background-color: #
|
120
|
-
border-color: #
|
141
|
+
background-color: #eaebf0;
|
142
|
+
border-color: #eaebf0;
|
121
143
|
}
|
122
144
|
.bk-pagination-small-list .bk-pagination-picker.is-focused {
|
123
145
|
background-color: #fff;
|
@@ -126,7 +148,7 @@
|
|
126
148
|
}
|
127
149
|
.bk-pagination-editor {
|
128
150
|
height: 16px;
|
129
|
-
min-width:
|
151
|
+
min-width: 23px;
|
130
152
|
padding-right: 4px;
|
131
153
|
padding-left: 8px;
|
132
154
|
line-height: 16px;
|
@@ -144,14 +166,18 @@
|
|
144
166
|
.bk-pagination-btn-pre,
|
145
167
|
.bk-pagination-btn-next {
|
146
168
|
display: flex;
|
169
|
+
width: 26px;
|
170
|
+
height: 26px;
|
171
|
+
font-size: 20px;
|
172
|
+
color: #979ba5;
|
173
|
+
cursor: pointer;
|
147
174
|
justify-content: center;
|
148
175
|
align-items: center;
|
149
|
-
width: 24px;
|
150
|
-
cursor: pointer;
|
151
176
|
}
|
152
177
|
.bk-pagination-btn-pre:hover,
|
153
178
|
.bk-pagination-btn-next:hover {
|
154
179
|
color: #3a84ff;
|
180
|
+
background: #f0f1f5;
|
155
181
|
}
|
156
182
|
.bk-pagination-btn-pre.is-disabled,
|
157
183
|
.bk-pagination-btn-next.is-disabled {
|