bkui-vue 0.0.1-beta.81 → 0.0.1-beta.82
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 +27 -27
- package/dist/index.esm.js +466 -212
- package/dist/index.umd.js +26 -26
- package/dist/style.css +1 -1
- package/lib/button/button.css +16 -11
- package/lib/button/button.d.ts +0 -10
- package/lib/button/button.less +28 -13
- package/lib/button/button.variable.css +16 -11
- package/lib/button/index.d.ts +1 -16
- package/lib/button/index.js +1 -1
- package/lib/cascader/cascader.d.ts +1 -1
- package/lib/cascader/index.d.ts +4 -4
- package/lib/loading/loading.css +4 -3
- package/lib/loading/loading.less +4 -3
- package/lib/loading/loading.variable.css +4 -3
- package/lib/pagination/index.js +1 -1
- package/lib/select/common.d.ts +4 -4
- package/lib/select/index.d.ts +563 -212
- package/lib/select/index.js +1 -1
- package/lib/select/option.d.ts +11 -4
- package/lib/select/select.css +31 -59
- package/lib/select/select.d.ts +168 -62
- package/lib/select/select.less +43 -51
- package/lib/select/select.variable.css +31 -59
- package/lib/select/selectTagInput.d.ts +71 -0
- package/lib/select/type.d.ts +9 -5
- package/lib/shared/index.js +1 -1
- package/lib/tab/index.d.ts +7 -7
- package/lib/tab/tab.d.ts +2 -2
- package/lib/table/index.js +1 -1
- package/lib/table/props.d.ts +1 -0
- package/lib/tag-input/index.d.ts +4 -4
- package/lib/tag-input/index.js +1 -1
- package/lib/tag-input/tag-input.d.ts +1 -1
- package/lib/transfer/index.js +1 -1
- package/lib/transfer/transfer.css +41 -60
- package/lib/transfer/transfer.less +55 -82
- package/lib/transfer/transfer.variable.css +41 -60
- package/package.json +1 -1
package/lib/button/button.css
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
.bk-button {
|
2
|
-
display: inline-
|
2
|
+
display: inline-flex;
|
3
|
+
height: 32px;
|
3
4
|
padding: 5px 12px;
|
4
5
|
font-size: 14px;
|
5
6
|
color: #63656e;
|
6
|
-
text-align: center;
|
7
7
|
text-decoration: none;
|
8
8
|
white-space: nowrap;
|
9
9
|
cursor: pointer;
|
@@ -14,6 +14,8 @@
|
|
14
14
|
box-sizing: border-box;
|
15
15
|
transition: background-color ease 0.3s;
|
16
16
|
appearance: none;
|
17
|
+
align-items: center;
|
18
|
+
justify-content: center;
|
17
19
|
}
|
18
20
|
.bk-button.bk-button-primary {
|
19
21
|
background-color: #3a84ff;
|
@@ -200,11 +202,18 @@
|
|
200
202
|
color: white;
|
201
203
|
}
|
202
204
|
.bk-button.bk-button-small {
|
203
|
-
|
205
|
+
height: 26px;
|
206
|
+
padding: 3px 12px;
|
204
207
|
}
|
205
208
|
.bk-button.bk-button-large {
|
209
|
+
height: 38px;
|
206
210
|
padding: 8px 20px;
|
207
211
|
}
|
212
|
+
.bk-button .bk-button-text {
|
213
|
+
display: inline-flex;
|
214
|
+
align-items: center;
|
215
|
+
line-height: 1;
|
216
|
+
}
|
208
217
|
.bk-button:not(.is-text) .bk-button-loading:not(:last-child) {
|
209
218
|
margin-right: 6px;
|
210
219
|
}
|
@@ -217,11 +226,9 @@
|
|
217
226
|
}
|
218
227
|
.bk-button.is-text {
|
219
228
|
height: auto;
|
220
|
-
min-width: auto;
|
221
229
|
padding: 0;
|
222
230
|
font-size: 14px;
|
223
231
|
font-size: inherit;
|
224
|
-
line-height: 1;
|
225
232
|
color: #63656e;
|
226
233
|
text-decoration: none;
|
227
234
|
cursor: pointer;
|
@@ -234,22 +241,20 @@
|
|
234
241
|
cursor: not-allowed;
|
235
242
|
border-color: #dcdee5;
|
236
243
|
}
|
237
|
-
.bk-button.is-circle {
|
238
|
-
padding: 10px;
|
239
|
-
line-height: 1;
|
240
|
-
border-radius: 50%;
|
241
|
-
}
|
242
244
|
.bk-button-group {
|
243
245
|
display: inline-block;
|
244
246
|
font-size: 0;
|
245
247
|
}
|
246
248
|
.bk-button-group.bk-button-group-small .bk-button {
|
247
|
-
|
249
|
+
height: 26px;
|
250
|
+
padding: 3px 12px;
|
248
251
|
}
|
249
252
|
.bk-button-group.bk-button-group-large .bk-button {
|
253
|
+
height: 38px;
|
250
254
|
padding: 8px 20px;
|
251
255
|
}
|
252
256
|
.bk-button-group .bk-button {
|
257
|
+
height: 32px;
|
253
258
|
margin: 0 0 0 -1px;
|
254
259
|
border-radius: 0;
|
255
260
|
}
|
package/lib/button/button.d.ts
CHANGED
@@ -57,9 +57,6 @@ declare const buttonProps: {
|
|
57
57
|
text: import("vue-types").VueTypeValidableDef<boolean> & {
|
58
58
|
default: boolean;
|
59
59
|
};
|
60
|
-
circle: import("vue-types").VueTypeValidableDef<boolean> & {
|
61
|
-
default: boolean;
|
62
|
-
};
|
63
60
|
nativeType: {
|
64
61
|
type: IButtonNativeType;
|
65
62
|
};
|
@@ -97,9 +94,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
97
94
|
text: import("vue-types").VueTypeValidableDef<boolean> & {
|
98
95
|
default: boolean;
|
99
96
|
};
|
100
|
-
circle: import("vue-types").VueTypeValidableDef<boolean> & {
|
101
|
-
default: boolean;
|
102
|
-
};
|
103
97
|
nativeType: {
|
104
98
|
type: IButtonNativeType;
|
105
99
|
};
|
@@ -135,9 +129,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
135
129
|
text: import("vue-types").VueTypeValidableDef<boolean> & {
|
136
130
|
default: boolean;
|
137
131
|
};
|
138
|
-
circle: import("vue-types").VueTypeValidableDef<boolean> & {
|
139
|
-
default: boolean;
|
140
|
-
};
|
141
132
|
nativeType: {
|
142
133
|
type: IButtonNativeType;
|
143
134
|
};
|
@@ -146,7 +137,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
146
137
|
onMouseover?: (...args: any[]) => any;
|
147
138
|
}, {
|
148
139
|
title: string;
|
149
|
-
circle: boolean;
|
150
140
|
text: boolean;
|
151
141
|
theme: string;
|
152
142
|
size: string;
|
package/lib/button/button.less
CHANGED
@@ -1,20 +1,24 @@
|
|
1
1
|
@import '../styles/themes/themes.less';
|
2
2
|
|
3
|
+
@btnHeight: 32px;
|
3
4
|
@btnPadding: 5px 12px;
|
4
5
|
@btnBorderRadius: 2px;
|
5
6
|
|
6
|
-
@
|
7
|
+
@smallBtnHeight: 26px;
|
8
|
+
@smallBtnPadding: 3px 12px;
|
7
9
|
|
10
|
+
@largeBtnHeight: 38px;
|
8
11
|
@largeBtnPadding: 8px 20px;
|
12
|
+
|
9
13
|
@themeSelectors: primary, warning, success, danger;
|
10
14
|
@sizeSelectors: small, large;
|
11
15
|
|
12
16
|
.@{bk-prefix}-button {
|
13
|
-
display: inline-
|
17
|
+
display: inline-flex;
|
18
|
+
height: @btnHeight;
|
14
19
|
padding: @btnPadding;
|
15
20
|
font-size: @font-size-medium;
|
16
21
|
color: @default-color;
|
17
|
-
text-align: center;
|
18
22
|
text-decoration: none;
|
19
23
|
white-space: nowrap;
|
20
24
|
cursor: pointer;
|
@@ -25,6 +29,8 @@
|
|
25
29
|
box-sizing: border-box;
|
26
30
|
transition: background-color ease .3s;
|
27
31
|
appearance: none;
|
32
|
+
align-items: center;
|
33
|
+
justify-content: center;
|
28
34
|
|
29
35
|
each(@themeSelectors, {
|
30
36
|
@color: '@{value}-color';
|
@@ -88,12 +94,20 @@
|
|
88
94
|
|
89
95
|
|
90
96
|
each(@sizeSelectors, {
|
91
|
-
|
92
|
-
|
93
|
-
|
97
|
+
@sizeBtnHeight: '@{value}BtnHeight';
|
98
|
+
@sizeBtnPadding: '@{value}BtnPadding';
|
99
|
+
&.@{bk-prefix}-button-@{value} {
|
100
|
+
height: @@sizeBtnHeight;
|
101
|
+
padding: @@sizeBtnPadding;
|
94
102
|
}
|
95
103
|
});
|
96
104
|
|
105
|
+
.@{bk-prefix}-button-text {
|
106
|
+
display: inline-flex;
|
107
|
+
align-items: center;
|
108
|
+
line-height: 1;
|
109
|
+
}
|
110
|
+
|
97
111
|
&:not(.is-text) {
|
98
112
|
.@{bk-prefix}-button-loading {
|
99
113
|
&:not(:last-child) {
|
@@ -113,11 +127,9 @@
|
|
113
127
|
|
114
128
|
&.is-text {
|
115
129
|
height: auto;
|
116
|
-
min-width: auto;
|
117
130
|
padding: 0;
|
118
131
|
font-size: @font-size-medium;
|
119
132
|
font-size: inherit;
|
120
|
-
line-height: 1;
|
121
133
|
color: @default-color;
|
122
134
|
text-decoration: none;
|
123
135
|
cursor: pointer;
|
@@ -132,11 +144,11 @@
|
|
132
144
|
border-color: @disable-color;
|
133
145
|
}
|
134
146
|
|
135
|
-
&.is-circle {
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
}
|
147
|
+
// &.is-circle {
|
148
|
+
// padding: 8px;
|
149
|
+
// line-height: 1;
|
150
|
+
// border-radius: 50%;
|
151
|
+
// }
|
140
152
|
}
|
141
153
|
|
142
154
|
|
@@ -145,9 +157,11 @@
|
|
145
157
|
font-size: 0;
|
146
158
|
|
147
159
|
each(@sizeSelectors, {
|
160
|
+
@sizeBtnHeight: '@{value}BtnHeight';
|
148
161
|
@sizeBtnPadding: '@{value}BtnPadding';
|
149
162
|
&.@{bk-prefix}-button-group-@{value} {
|
150
163
|
.@{bk-prefix}-button {
|
164
|
+
height: @@sizeBtnHeight;
|
151
165
|
padding: @@sizeBtnPadding;
|
152
166
|
}
|
153
167
|
}
|
@@ -155,6 +169,7 @@
|
|
155
169
|
;
|
156
170
|
|
157
171
|
.@{bk-prefix}-button {
|
172
|
+
height: @btnHeight;
|
158
173
|
margin: 0 0 0 -1px;
|
159
174
|
border-radius: 0;
|
160
175
|
|
@@ -98,11 +98,11 @@
|
|
98
98
|
--cascader-panel-disabled-bg: #fff;
|
99
99
|
}
|
100
100
|
.bk-button {
|
101
|
-
display: inline-
|
101
|
+
display: inline-flex;
|
102
|
+
height: 32px;
|
102
103
|
padding: 5px 12px;
|
103
104
|
font-size: var(--font-size-medium);
|
104
105
|
color: var(--default-color);
|
105
|
-
text-align: center;
|
106
106
|
text-decoration: none;
|
107
107
|
white-space: nowrap;
|
108
108
|
cursor: pointer;
|
@@ -113,6 +113,8 @@
|
|
113
113
|
box-sizing: border-box;
|
114
114
|
transition: background-color ease 0.3s;
|
115
115
|
appearance: none;
|
116
|
+
align-items: center;
|
117
|
+
justify-content: center;
|
116
118
|
}
|
117
119
|
.bk-button.bk-button-primary {
|
118
120
|
background-color: var(--primary-color);
|
@@ -299,11 +301,18 @@
|
|
299
301
|
color: var(--white-color);
|
300
302
|
}
|
301
303
|
.bk-button.bk-button-small {
|
302
|
-
|
304
|
+
height: 26px;
|
305
|
+
padding: 3px 12px;
|
303
306
|
}
|
304
307
|
.bk-button.bk-button-large {
|
308
|
+
height: 38px;
|
305
309
|
padding: 8px 20px;
|
306
310
|
}
|
311
|
+
.bk-button .bk-button-text {
|
312
|
+
display: inline-flex;
|
313
|
+
align-items: center;
|
314
|
+
line-height: 1;
|
315
|
+
}
|
307
316
|
.bk-button:not(.is-text) .bk-button-loading:not(:last-child) {
|
308
317
|
margin-right: 6px;
|
309
318
|
}
|
@@ -316,11 +325,9 @@
|
|
316
325
|
}
|
317
326
|
.bk-button.is-text {
|
318
327
|
height: auto;
|
319
|
-
min-width: auto;
|
320
328
|
padding: 0;
|
321
329
|
font-size: var(--font-size-medium);
|
322
330
|
font-size: inherit;
|
323
|
-
line-height: 1;
|
324
331
|
color: var(--default-color);
|
325
332
|
text-decoration: none;
|
326
333
|
cursor: pointer;
|
@@ -333,22 +340,20 @@
|
|
333
340
|
cursor: not-allowed;
|
334
341
|
border-color: var(--disable-color);
|
335
342
|
}
|
336
|
-
.bk-button.is-circle {
|
337
|
-
padding: 10px;
|
338
|
-
line-height: 1;
|
339
|
-
border-radius: 50%;
|
340
|
-
}
|
341
343
|
.bk-button-group {
|
342
344
|
display: inline-block;
|
343
345
|
font-size: 0;
|
344
346
|
}
|
345
347
|
.bk-button-group.bk-button-group-small .bk-button {
|
346
|
-
|
348
|
+
height: 26px;
|
349
|
+
padding: 3px 12px;
|
347
350
|
}
|
348
351
|
.bk-button-group.bk-button-group-large .bk-button {
|
352
|
+
height: 38px;
|
349
353
|
padding: 8px 20px;
|
350
354
|
}
|
351
355
|
.bk-button-group .bk-button {
|
356
|
+
height: 32px;
|
352
357
|
margin: 0 0 0 -1px;
|
353
358
|
border-radius: 0;
|
354
359
|
}
|
package/lib/button/index.d.ts
CHANGED
@@ -5,7 +5,6 @@ declare const BkButton: {
|
|
5
5
|
$data: {};
|
6
6
|
$props: Partial<{
|
7
7
|
title: string;
|
8
|
-
circle: boolean;
|
9
8
|
text: boolean;
|
10
9
|
theme: string;
|
11
10
|
size: string;
|
@@ -47,16 +46,13 @@ declare const BkButton: {
|
|
47
46
|
text: import("vue-types").VueTypeValidableDef<boolean> & {
|
48
47
|
default: boolean;
|
49
48
|
};
|
50
|
-
circle: import("vue-types").VueTypeValidableDef<boolean> & {
|
51
|
-
default: boolean;
|
52
|
-
};
|
53
49
|
nativeType: {
|
54
50
|
type: ((new (...args: any[]) => ("button" | "reset" | "submit") & {}) | (() => "button" | "reset" | "submit")) | ((new (...args: any[]) => ("button" | "reset" | "submit") & {}) | (() => "button" | "reset" | "submit"))[];
|
55
51
|
};
|
56
52
|
}>> & {
|
57
53
|
onClick?: (...args: any[]) => any;
|
58
54
|
onMouseover?: (...args: any[]) => any;
|
59
|
-
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "title" | "
|
55
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "title" | "text" | "theme" | "size" | "icon" | "outline" | "disabled" | "loading" | "hoverTheme" | "iconRight">;
|
60
56
|
$attrs: {
|
61
57
|
[x: string]: unknown;
|
62
58
|
};
|
@@ -102,9 +98,6 @@ declare const BkButton: {
|
|
102
98
|
text: import("vue-types").VueTypeValidableDef<boolean> & {
|
103
99
|
default: boolean;
|
104
100
|
};
|
105
|
-
circle: import("vue-types").VueTypeValidableDef<boolean> & {
|
106
|
-
default: boolean;
|
107
|
-
};
|
108
101
|
nativeType: {
|
109
102
|
type: ((new (...args: any[]) => ("button" | "reset" | "submit") & {}) | (() => "button" | "reset" | "submit")) | ((new (...args: any[]) => ("button" | "reset" | "submit") & {}) | (() => "button" | "reset" | "submit"))[];
|
110
103
|
};
|
@@ -113,7 +106,6 @@ declare const BkButton: {
|
|
113
106
|
onMouseover?: (...args: any[]) => any;
|
114
107
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("click" | "mouseover")[], string, {
|
115
108
|
title: string;
|
116
|
-
circle: boolean;
|
117
109
|
text: boolean;
|
118
110
|
theme: string;
|
119
111
|
size: string;
|
@@ -175,9 +167,6 @@ declare const BkButton: {
|
|
175
167
|
text: import("vue-types").VueTypeValidableDef<boolean> & {
|
176
168
|
default: boolean;
|
177
169
|
};
|
178
|
-
circle: import("vue-types").VueTypeValidableDef<boolean> & {
|
179
|
-
default: boolean;
|
180
|
-
};
|
181
170
|
nativeType: {
|
182
171
|
type: ((new (...args: any[]) => ("button" | "reset" | "submit") & {}) | (() => "button" | "reset" | "submit")) | ((new (...args: any[]) => ("button" | "reset" | "submit") & {}) | (() => "button" | "reset" | "submit"))[];
|
183
172
|
};
|
@@ -220,9 +209,6 @@ declare const BkButton: {
|
|
220
209
|
text: import("vue-types").VueTypeValidableDef<boolean> & {
|
221
210
|
default: boolean;
|
222
211
|
};
|
223
|
-
circle: import("vue-types").VueTypeValidableDef<boolean> & {
|
224
|
-
default: boolean;
|
225
|
-
};
|
226
212
|
nativeType: {
|
227
213
|
type: ((new (...args: any[]) => ("button" | "reset" | "submit") & {}) | (() => "button" | "reset" | "submit")) | ((new (...args: any[]) => ("button" | "reset" | "submit") & {}) | (() => "button" | "reset" | "submit"))[];
|
228
214
|
};
|
@@ -231,7 +217,6 @@ declare const BkButton: {
|
|
231
217
|
onMouseover?: (...args: any[]) => any;
|
232
218
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("click" | "mouseover")[], "click" | "mouseover", {
|
233
219
|
title: string;
|
234
|
-
circle: boolean;
|
235
220
|
text: boolean;
|
236
221
|
theme: string;
|
237
222
|
size: string;
|
package/lib/button/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
!function(e,o){if("object"==typeof exports&&"object"==typeof module)module.exports=o(require("../shared"),require("vue"),require("../loading"));else if("function"==typeof define&&define.amd)define(["../shared","vue","../loading"],o);else{var t="object"==typeof exports?o(require("../shared"),require("vue"),require("../loading")):o(e["../shared"],e.vue,e["../loading"]);for(var
|
1
|
+
!function(e,o){if("object"==typeof exports&&"object"==typeof module)module.exports=o(require("../shared"),require("vue"),require("../loading"));else if("function"==typeof define&&define.amd)define(["../shared","vue","../loading"],o);else{var t="object"==typeof exports?o(require("../shared"),require("vue"),require("../loading")):o(e["../shared"],e.vue,e["../loading"]);for(var n in t)("object"==typeof exports?exports:e)[n]=t[n]}}(self,((e,o,t)=>(()=>{"use strict";var n={4870:e=>{e.exports=t},4212:o=>{o.exports=e},748:e=>{e.exports=o}},r={};function i(e){var o=r[e];if(void 0!==o)return o.exports;var t=r[e]={exports:{}};return n[e](t,t.exports,i),t.exports}i.n=e=>{var o=e&&e.__esModule?()=>e.default:()=>e;return i.d(o,{a:o}),o},i.d=(e,o)=>{for(var t in o)i.o(o,t)&&!i.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:o[t]})},i.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return(()=>{i.r(a),i.d(a,{BkButton:()=>c,BkButtonGroup:()=>d,default:()=>p});var e=i(4212);function o(e,o,t){return o in e?Object.defineProperty(e,o,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[o]=t,e}var t=i(748),n=i(4870),r=i.n(n),u=["","small","large"],l={theme:e.PropTypes.theme().def(""),hoverTheme:e.PropTypes.theme(["primary","warning","success","danger"]).def(""),size:e.PropTypes.size(u).def(""),title:e.PropTypes.string,icon:e.PropTypes.string,iconRight:e.PropTypes.string,disabled:e.PropTypes.bool,loading:e.PropTypes.bool,loadingMode:e.PropTypes.commonType(Object.values(n.BkLoadingMode)),outline:e.PropTypes.bool,text:e.PropTypes.bool,nativeType:{type:String}};const s=(0,t.defineComponent)({name:"Button",props:l,emits:["click","mouseover"],setup:function(i,a){var l,s=a.slots,d=a.attrs,c=a.emit,p=(0,t.ref)(!1),v=null!==(l=s.default)&&void 0!==l&&l,f="bk-button",m=(0,t.computed)((function(){return i.text&&!i.hoverTheme})),b=(0,t.computed)((function(){var t,n=i.hoverTheme?"".concat(f,"-hover-").concat(i.hoverTheme):"",r=i.theme?"".concat(f,"-").concat(i.theme):"",a=i.hoverTheme?"":r;return(0,e.classes)((o(t={"is-disabled":i.disabled,"is-outline":i.outline,"is-text":m.value},"".concat(f,"-").concat(i.size),i.size&&u.includes(i.size)),o(t,"no-slot",!v),t),"".concat(a," ").concat(f," ").concat(n))})),g=(0,t.computed)((function(){return i.text||i.outline||i.hoverTheme?p.value&&!i.text?"white":i.text&&i.disabled?"":i.hoverTheme||i.theme:["","default"].includes(i.theme)?"":"white"})),y=(0,t.computed)((function(){return m.value||i.size===n.BkLoadingSize.Small?n.BkLoadingSize.Mini:n.BkLoadingSize.Small})),h=function(){i.loading||c("click")},T=function(){p.value=!0,c("mouseover")},x=function(){p.value=!1};return function(){var e;return(0,t.createVNode)("button",(0,t.mergeProps)({title:i.title,disabled:i.disabled,class:b.value,type:i.nativeType},d,{onClick:h,onMouseover:T,onMouseleave:x}),[i.loading&&(0,t.createVNode)(r(),{loading:!0,class:"".concat(f,"-loading"),mode:i.loadingMode,theme:g.value,size:y.value},null),s.default&&!i.loading&&(0,t.createVNode)("span",{class:"".concat(f,"-text")},[null===(e=s.default)||void 0===e?void 0:e.call(s)])])}}}),d=(0,t.defineComponent)({name:"ButtonGroup",props:{size:e.PropTypes.size()},setup:function(n,r){var i=(0,t.computed)((function(){return(0,e.classes)(o({},"bk-button-group-".concat(n.size),!!n.size),"bk-button-group")}));return function(){var e,o;return(0,t.createVNode)("div",{class:i.value},[null===(o=(e=r.slots).default)||void 0===o?void 0:o.call(e)])}}});var c=(0,e.withInstallProps)(s,{ButtonGroup:d});const p=c})(),a})()));
|
@@ -259,10 +259,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
259
259
|
modelValue: unknown[];
|
260
260
|
trigger: string;
|
261
261
|
checkAnyLevel: boolean;
|
262
|
+
filterable: boolean;
|
262
263
|
idKey: string;
|
263
264
|
nameKey: string;
|
264
265
|
childrenKey: string;
|
265
|
-
filterable: boolean;
|
266
266
|
isRemote: boolean;
|
267
267
|
remoteMethod: (...args: any[]) => any;
|
268
268
|
showCompleteName: boolean;
|
package/lib/cascader/index.d.ts
CHANGED
@@ -14,10 +14,10 @@ declare const BkCascader: {
|
|
14
14
|
modelValue: unknown[];
|
15
15
|
trigger: string;
|
16
16
|
checkAnyLevel: boolean;
|
17
|
+
filterable: boolean;
|
17
18
|
idKey: string;
|
18
19
|
nameKey: string;
|
19
20
|
childrenKey: string;
|
20
|
-
filterable: boolean;
|
21
21
|
isRemote: boolean;
|
22
22
|
remoteMethod: (...args: any[]) => any;
|
23
23
|
showCompleteName: boolean;
|
@@ -113,7 +113,7 @@ declare const BkCascader: {
|
|
113
113
|
};
|
114
114
|
}>> & {
|
115
115
|
"onUpdate:modelValue"?: (...args: any[]) => any;
|
116
|
-
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "placeholder" | "list" | "extCls" | "separator" | "multiple" | "disabled" | "clearable" | "modelValue" | "trigger" | "checkAnyLevel" | "
|
116
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "placeholder" | "list" | "extCls" | "separator" | "multiple" | "disabled" | "clearable" | "modelValue" | "trigger" | "checkAnyLevel" | "filterable" | "idKey" | "nameKey" | "childrenKey" | "isRemote" | "remoteMethod" | "showCompleteName" | "limitOneLine">;
|
117
117
|
$attrs: {
|
118
118
|
[x: string]: unknown;
|
119
119
|
};
|
@@ -298,10 +298,10 @@ declare const BkCascader: {
|
|
298
298
|
modelValue: unknown[];
|
299
299
|
trigger: string;
|
300
300
|
checkAnyLevel: boolean;
|
301
|
+
filterable: boolean;
|
301
302
|
idKey: string;
|
302
303
|
nameKey: string;
|
303
304
|
childrenKey: string;
|
304
|
-
filterable: boolean;
|
305
305
|
isRemote: boolean;
|
306
306
|
remoteMethod: (...args: any[]) => any;
|
307
307
|
showCompleteName: boolean;
|
@@ -661,10 +661,10 @@ declare const BkCascader: {
|
|
661
661
|
modelValue: unknown[];
|
662
662
|
trigger: string;
|
663
663
|
checkAnyLevel: boolean;
|
664
|
+
filterable: boolean;
|
664
665
|
idKey: string;
|
665
666
|
nameKey: string;
|
666
667
|
childrenKey: string;
|
667
|
-
filterable: boolean;
|
668
668
|
isRemote: boolean;
|
669
669
|
remoteMethod: (...args: any[]) => any;
|
670
670
|
showCompleteName: boolean;
|
package/lib/loading/loading.css
CHANGED
@@ -33,7 +33,7 @@
|
|
33
33
|
vertical-align: middle;
|
34
34
|
}
|
35
35
|
.bk-loading-wrapper:not(.bk-nested-loading) {
|
36
|
-
display: inline-
|
36
|
+
display: inline-flex;
|
37
37
|
}
|
38
38
|
.bk-loading-wrapper.bk-nested-loading {
|
39
39
|
position: relative;
|
@@ -52,7 +52,7 @@
|
|
52
52
|
transform: translate(-50%, -50%);
|
53
53
|
}
|
54
54
|
.bk-loading-wrapper .dot {
|
55
|
-
display: inline-
|
55
|
+
display: inline-flex;
|
56
56
|
width: 14px;
|
57
57
|
height: 14px;
|
58
58
|
margin-right: 10px;
|
@@ -195,7 +195,8 @@
|
|
195
195
|
}
|
196
196
|
.bk-loading-wrapper .bk-loading-indicator .bk-spin-indicator {
|
197
197
|
position: relative;
|
198
|
-
display: inline-
|
198
|
+
display: inline-flex;
|
199
|
+
justify-content: center;
|
199
200
|
width: 40px;
|
200
201
|
height: 40px;
|
201
202
|
}
|
package/lib/loading/loading.less
CHANGED
@@ -58,7 +58,7 @@
|
|
58
58
|
font-size: 0;
|
59
59
|
vertical-align: middle;
|
60
60
|
&:not(.@{bk-prefix}-nested-loading) {
|
61
|
-
display: inline-
|
61
|
+
display: inline-flex;
|
62
62
|
}
|
63
63
|
|
64
64
|
&.@{bk-prefix}-nested-loading {
|
@@ -81,7 +81,7 @@
|
|
81
81
|
}
|
82
82
|
|
83
83
|
.dot {
|
84
|
-
display: inline-
|
84
|
+
display: inline-flex;
|
85
85
|
width: @dotSize;
|
86
86
|
height: @dotSize;
|
87
87
|
margin-right: @dotGap;
|
@@ -152,7 +152,8 @@
|
|
152
152
|
|
153
153
|
.@{bk-prefix}-spin-indicator {
|
154
154
|
position: relative;
|
155
|
-
display: inline-
|
155
|
+
display: inline-flex;
|
156
|
+
justify-content: center;
|
156
157
|
width: 2 * @ovalGap;
|
157
158
|
height: 2 * @ovalGap;
|
158
159
|
}
|
@@ -132,7 +132,7 @@
|
|
132
132
|
vertical-align: middle;
|
133
133
|
}
|
134
134
|
.bk-loading-wrapper:not(.bk-nested-loading) {
|
135
|
-
display: inline-
|
135
|
+
display: inline-flex;
|
136
136
|
}
|
137
137
|
.bk-loading-wrapper.bk-nested-loading {
|
138
138
|
position: relative;
|
@@ -151,7 +151,7 @@
|
|
151
151
|
transform: translate(-50%, -50%);
|
152
152
|
}
|
153
153
|
.bk-loading-wrapper .dot {
|
154
|
-
display: inline-
|
154
|
+
display: inline-flex;
|
155
155
|
width: 14px;
|
156
156
|
height: 14px;
|
157
157
|
margin-right: 10px;
|
@@ -294,7 +294,8 @@
|
|
294
294
|
}
|
295
295
|
.bk-loading-wrapper .bk-loading-indicator .bk-spin-indicator {
|
296
296
|
position: relative;
|
297
|
-
display: inline-
|
297
|
+
display: inline-flex;
|
298
|
+
justify-content: center;
|
298
299
|
width: 40px;
|
299
300
|
height: 40px;
|
300
301
|
}
|
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<=5){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(){(0,r.nextTick)((function(){t.value.focus();var e=window.getSelection();e.selectAllChildren(t.value),e.collapseToEnd()}))},v=function(){n.value=!0},m=function(){n.value=!1,t.value.textContent="".concat(l),l!==a.value&&(a.value=l)},g=function(t){var n=t.target,r=Number(n.textContent);!r||r<1||r>e.totalPageNum||r===a.value||(l=r,p())},b=function(e){["Enter","NumpadEnter"].includes(e.code)&&(e.preventDefault(),m(),p())};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:v,onBlur:m,onInput:g,onKeydown:b},[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,m()}(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: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("../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<=5){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(){(0,r.nextTick)((function(){t.value.focus();var e=window.getSelection();e.selectAllChildren(t.value),e.collapseToEnd()}))},v=function(){n.value=!0},m=function(){n.value=!1,t.value.textContent="".concat(l),l!==a.value&&(a.value=l)},g=function(t){var n=t.target,r=Number(n.textContent);!r||r<1||r>e.totalPageNum||r===a.value||(l=r,p())},b=function(e){["Enter","NumpadEnter"].includes(e.code)&&(e.preventDefault(),m(),p())};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:v,onBlur:m,onInput:g,onKeydown:b},[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,m()}(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})()));
|
package/lib/select/common.d.ts
CHANGED
@@ -13,9 +13,9 @@ export declare function useHover(): {
|
|
13
13
|
setHover: () => void;
|
14
14
|
cancelHover: () => void;
|
15
15
|
};
|
16
|
-
export declare function useRegistry<T>(data: Ref<
|
17
|
-
register: (item: T) =>
|
18
|
-
unregister: (item: T) =>
|
16
|
+
export declare function useRegistry<T>(data: Ref<Array<T>>): {
|
17
|
+
register: (item: T) => number;
|
18
|
+
unregister: (item: T) => void;
|
19
19
|
};
|
20
20
|
export declare function useDebouncedRef<T>(value: any, delay?: number): Ref<T>;
|
21
21
|
export declare function usePopover(config: IPopoverConfig): {
|
@@ -26,7 +26,7 @@ export declare function usePopover(config: IPopoverConfig): {
|
|
26
26
|
hidePopover: () => void;
|
27
27
|
showPopover: () => void;
|
28
28
|
};
|
29
|
-
export declare function useRemoteSearch(method: Function): {
|
29
|
+
export declare function useRemoteSearch(method: Function, callBack?: Function): {
|
30
30
|
searchKey: Ref<string>;
|
31
31
|
searchLoading: Ref<boolean>;
|
32
32
|
};
|