bkui-vue 0.0.1-beta.29 → 0.0.1-beta.31
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/bkui-vue.cjs.js +141 -140
- package/dist/bkui-vue.esm.js +141 -140
- package/dist/bkui-vue.umd.js +141 -140
- package/dist/style.css +100 -5
- package/lib/code-diff/index.d.ts +139 -3
- package/lib/code-diff/index.js +15 -0
- package/lib/components.d.ts +1 -1
- package/lib/divider/index.js +1 -1
- package/lib/divider/props.d.ts +21 -0
- package/lib/loading/index.d.ts +27 -10
- package/lib/loading/index.js +1 -1
- package/lib/loading/loading.css +8 -2
- package/lib/loading/loading.d.ts +18 -4
- package/lib/loading/loading.less +10 -10
- package/lib/loading/loading.variable.css +8 -2
- package/lib/pagination/index.d.ts +7 -7
- package/lib/pagination/index.js +1 -1
- package/lib/pagination/pagination.d.ts +2 -2
- package/lib/radio/index.js +1 -1
- package/lib/radio/radio.css +2 -2
- package/lib/radio/radio.less +2 -2
- package/lib/radio/radio.variable.css +2 -2
- package/lib/slider/index.js +2 -2
- package/lib/slider/slider-button.d.ts +5 -0
- package/lib/slider/slider.d.ts +12 -0
- package/lib/styles/index.d.ts +1 -0
- package/lib/styles/index.js +1 -1
- package/lib/tab/index.d.ts +96 -205
- package/lib/tab/index.js +1 -1
- package/lib/tab/props.d.ts +191 -0
- package/lib/tab/tab-nav.d.ts +59 -84
- package/lib/tab/tab-panel.d.ts +39 -14
- package/lib/tab/tab.css +2 -1
- package/lib/tab/tab.d.ts +14 -37
- package/lib/tab/tab.less +2 -1
- package/lib/tab/tab.variable.css +2 -1
- package/lib/table/index.d.ts +1 -5
- package/lib/table/index.js +2 -2
- package/lib/table/props.d.ts +0 -1
- package/lib/table/table.d.ts +1 -3
- package/package.json +1 -1
package/lib/components.d.ts
CHANGED
@@ -27,7 +27,7 @@ export { default as Table } from './table';
|
|
27
27
|
export { default as Tag } from './tag';
|
28
28
|
export { default as TagInput } from './tag-input';
|
29
29
|
export { default as Divider } from './divider';
|
30
|
-
export { default as Tab,
|
30
|
+
export { default as Tab, BkTabPanel as TabPanel } from './tab';
|
31
31
|
export { default as Message } from './message';
|
32
32
|
export { default as Notify } from './notify';
|
33
33
|
export { default as Menu } from './menu';
|
package/lib/divider/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports,require("../shared"),require("vue")):"function"==typeof define&&define.amd?define(["exports","../shared","vue"],o):o((e="undefined"!=typeof globalThis?globalThis:e||self).bkuiVue={},e.Shared,e.Vue)}(this,(function(e,o,t){"use strict";var i=
|
1
|
+
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports,require("../shared"),require("vue")):"function"==typeof define&&define.amd?define(["exports","../shared","vue"],o):o((e="undefined"!=typeof globalThis?globalThis:e||self).bkuiVue={},e.Shared,e.Vue)}(this,(function(e,o,t){"use strict";var i={direction:o.PropTypes.commonType(["horizontal","vertical"],"direction").def("horizontal"),align:o.PropTypes.commonType(["left","center","right"],"align").def("center"),color:o.PropTypes.string.def("#dde4eb"),width:o.PropTypes.number.def(1),type:o.PropTypes.commonType(["dashed","solid"],"lineType").def("dashed")},d=t.defineComponent({name:"Divider",props:i,render:function(){var e,o=this;return this.$slots.default&&(e=t.createVNode("div",{class:["bk-divider-info","bk-divider-info-".concat(this.align)]},[this.$slots.default()])),t.createVNode("div",{class:["bk-divider","bk-divider-".concat(this.direction)],style:"vertical"===o.direction?{borderRight:"".concat(o.width,"px ").concat(o.type," ").concat(o.color)}:{borderBottom:"".concat(o.width,"px ").concat(o.type," ").concat(o.color)}},[e])}}),r=o.withInstall(d);e.default=r,Object.defineProperty(e,"__esModule",{value:!0})}));
|
@@ -0,0 +1,21 @@
|
|
1
|
+
export declare const dividerProps: {
|
2
|
+
direction: import("vue-types").VueTypeDef<string> & {
|
3
|
+
default: string;
|
4
|
+
};
|
5
|
+
align: import("vue-types").VueTypeDef<string> & {
|
6
|
+
default: string;
|
7
|
+
};
|
8
|
+
color: import("vue-types").VueTypeValidableDef<string> & {
|
9
|
+
default: string;
|
10
|
+
} & {
|
11
|
+
default: string;
|
12
|
+
};
|
13
|
+
width: import("vue-types").VueTypeValidableDef<number> & {
|
14
|
+
default: number;
|
15
|
+
} & {
|
16
|
+
default: number;
|
17
|
+
};
|
18
|
+
type: import("vue-types").VueTypeDef<string> & {
|
19
|
+
default: string;
|
20
|
+
};
|
21
|
+
};
|
package/lib/loading/index.d.ts
CHANGED
@@ -5,6 +5,7 @@ declare const BkLoading: {
|
|
5
5
|
$data: {};
|
6
6
|
$props: Partial<{
|
7
7
|
title: string;
|
8
|
+
inline: boolean;
|
8
9
|
size: string;
|
9
10
|
loading: boolean;
|
10
11
|
mode: string;
|
@@ -15,6 +16,11 @@ declare const BkLoading: {
|
|
15
16
|
loading: import("vue-types").VueTypeValidableDef<boolean> & {
|
16
17
|
default: boolean;
|
17
18
|
};
|
19
|
+
inline: import("vue-types").VueTypeValidableDef<boolean> & {
|
20
|
+
default: boolean;
|
21
|
+
} & {
|
22
|
+
default: boolean;
|
23
|
+
};
|
18
24
|
theme: import("vue-types").VueTypeDef<string>;
|
19
25
|
title: import("vue-types").VueTypeValidableDef<string> & {
|
20
26
|
default: string;
|
@@ -27,7 +33,7 @@ declare const BkLoading: {
|
|
27
33
|
mode: import("vue-types").VueTypeDef<string> & {
|
28
34
|
default: string;
|
29
35
|
};
|
30
|
-
}>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "title" | "size" | "loading" | "mode">;
|
36
|
+
}>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "title" | "inline" | "size" | "loading" | "mode">;
|
31
37
|
$attrs: {
|
32
38
|
[x: string]: unknown;
|
33
39
|
};
|
@@ -48,6 +54,11 @@ declare const BkLoading: {
|
|
48
54
|
loading: import("vue-types").VueTypeValidableDef<boolean> & {
|
49
55
|
default: boolean;
|
50
56
|
};
|
57
|
+
inline: import("vue-types").VueTypeValidableDef<boolean> & {
|
58
|
+
default: boolean;
|
59
|
+
} & {
|
60
|
+
default: boolean;
|
61
|
+
};
|
51
62
|
theme: import("vue-types").VueTypeDef<string>;
|
52
63
|
title: import("vue-types").VueTypeValidableDef<string> & {
|
53
64
|
default: string;
|
@@ -60,10 +71,9 @@ declare const BkLoading: {
|
|
60
71
|
mode: import("vue-types").VueTypeDef<string> & {
|
61
72
|
default: string;
|
62
73
|
};
|
63
|
-
}>>, () => JSX.Element
|
64
|
-
[key: string]: any;
|
65
|
-
}>[], unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {
|
74
|
+
}>>, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {
|
66
75
|
title: string;
|
76
|
+
inline: boolean;
|
67
77
|
size: string;
|
68
78
|
loading: boolean;
|
69
79
|
mode: string;
|
@@ -94,6 +104,11 @@ declare const BkLoading: {
|
|
94
104
|
loading: import("vue-types").VueTypeValidableDef<boolean> & {
|
95
105
|
default: boolean;
|
96
106
|
};
|
107
|
+
inline: import("vue-types").VueTypeValidableDef<boolean> & {
|
108
|
+
default: boolean;
|
109
|
+
} & {
|
110
|
+
default: boolean;
|
111
|
+
};
|
97
112
|
theme: import("vue-types").VueTypeDef<string>;
|
98
113
|
title: import("vue-types").VueTypeValidableDef<string> & {
|
99
114
|
default: string;
|
@@ -106,9 +121,7 @@ declare const BkLoading: {
|
|
106
121
|
mode: import("vue-types").VueTypeDef<string> & {
|
107
122
|
default: string;
|
108
123
|
};
|
109
|
-
}>> & import("vue").ShallowUnwrapRef<() => JSX.Element
|
110
|
-
[key: string]: any;
|
111
|
-
}>[]> & {} & {} & import("vue").ComponentCustomProperties;
|
124
|
+
}>> & import("vue").ShallowUnwrapRef<() => JSX.Element> & {} & {} & import("vue").ComponentCustomProperties;
|
112
125
|
__isFragment?: never;
|
113
126
|
__isTeleport?: never;
|
114
127
|
__isSuspense?: never;
|
@@ -119,6 +132,11 @@ declare const BkLoading: {
|
|
119
132
|
loading: import("vue-types").VueTypeValidableDef<boolean> & {
|
120
133
|
default: boolean;
|
121
134
|
};
|
135
|
+
inline: import("vue-types").VueTypeValidableDef<boolean> & {
|
136
|
+
default: boolean;
|
137
|
+
} & {
|
138
|
+
default: boolean;
|
139
|
+
};
|
122
140
|
theme: import("vue-types").VueTypeDef<string>;
|
123
141
|
title: import("vue-types").VueTypeValidableDef<string> & {
|
124
142
|
default: string;
|
@@ -131,10 +149,9 @@ declare const BkLoading: {
|
|
131
149
|
mode: import("vue-types").VueTypeDef<string> & {
|
132
150
|
default: string;
|
133
151
|
};
|
134
|
-
}>>, () => JSX.Element
|
135
|
-
[key: string]: any;
|
136
|
-
}>[], unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {
|
152
|
+
}>>, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {
|
137
153
|
title: string;
|
154
|
+
inline: boolean;
|
138
155
|
size: string;
|
139
156
|
loading: boolean;
|
140
157
|
mode: string;
|
package/lib/loading/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports,require("../shared"),require("vue")):"function"==typeof define&&define.amd?define(["exports","../shared","vue"],o):o((e="undefined"!=typeof globalThis?globalThis:e||self).bkuiVue={},e.Shared,e.Vue)}(this,(function(e,o,
|
1
|
+
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports,require("../shared"),require("vue")):"function"==typeof define&&define.amd?define(["exports","../shared","vue"],o):o((e="undefined"!=typeof globalThis?globalThis:e||self).bkuiVue={},e.Shared,e.Vue)}(this,(function(e,o,n){"use strict";function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var a={exports:{}};!function(e){e.exports=function(e,o,n){return o in e?Object.defineProperty(e,o,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[o]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports}(a);var i,d,l,r=t(a.exports);function u(e){l="function"==typeof e?e:function(){return n.createVNode(e,null,null)}}e.BkLoadingMode=void 0,(i=e.BkLoadingMode||(e.BkLoadingMode={})).Default="default",i.Spin="spin",e.BkLoadingSize=void 0,(d=e.BkLoadingSize||(e.BkLoadingSize={})).Normal="",d.Mini="mini",d.Small="small",d.Large="large";var s={indicator:{type:Function},loading:o.PropTypes.bool,inline:o.PropTypes.bool.def(!0),theme:o.PropTypes.theme(["white","primary","warning","success","danger"]),title:o.PropTypes.string.def(""),size:o.PropTypes.commonType(Object.values(e.BkLoadingSize)).def(e.BkLoadingSize.Normal),mode:o.PropTypes.commonType(Object.values(e.BkLoadingMode)).def("default")},c=n.defineComponent({name:"Loading",props:s,setup:function(t,a){var i=[1,2,3,4].map((function(e){return n.createVNode("span",{class:"dot dot-".concat(e)},null)})),d=n.createVNode("div",{class:"bk-spin-indicator"},[[1,2,3,4,5,6,7,8].map((function(e){return n.createVNode("span",{class:"oval oval-".concat(e)},null)}))]),u=n.computed((function(){return o.classes({"bk-loading-wrapper":t.loading,"bk-nested-loading":!!a.slots.default})})),s=n.computed((function(){var e;return o.classes((r(e={},"bk-loading-size-".concat(t.size),!!t.size),r(e,"bk-loading-".concat(t.theme),!!t.theme),e),"bk-loading-indicator")})),c=n.computed((function(){return!!t.title})),p=n.computed((function(){var o=t.mode===e.BkLoadingMode.Spin;return"function"==typeof t.indicator?n.createVNode(t.indicator,null,null):"function"==typeof l?n.createVNode(l,null,null):o?d:i}));return function(){var e,o;return n.createVNode("div",{class:u.value},[t.loading&&n.createVNode(n.Fragment,null,[n.createVNode("div",{class:s.value},[p.value,c.value&&n.createVNode("div",{class:"bk-loading-title"},[t.title])]),a.slots.default&&n.createVNode("div",{class:"bk-loading-mask"},null)]),null===(o=(e=a.slots).default)||void 0===o?void 0:o.call(e)])}}}),p=o.withInstallProps(c,{setDefaultIndicator:u,BkLoadingMode:e.BkLoadingMode,BkLoadingSize:e.BkLoadingSize},!0);e.BkLoading=p,e.default=p,e.setDefaultIndicator=u,Object.defineProperty(e,"__esModule",{value:!0})}));
|
package/lib/loading/loading.css
CHANGED
@@ -21,13 +21,18 @@
|
|
21
21
|
}
|
22
22
|
.bk-loading-wrapper {
|
23
23
|
position: static;
|
24
|
-
display: inline-block;
|
25
24
|
font-size: 0;
|
26
25
|
vertical-align: middle;
|
27
26
|
}
|
27
|
+
.bk-loading-wrapper:not(.bk-nested-loading) {
|
28
|
+
display: inline-block;
|
29
|
+
}
|
28
30
|
.bk-loading-wrapper.bk-nested-loading {
|
29
31
|
position: relative;
|
30
32
|
}
|
33
|
+
.bk-loading-wrapper.bk-nested-loading.is-block {
|
34
|
+
display: block;
|
35
|
+
}
|
31
36
|
.bk-loading-wrapper.bk-nested-loading .bk-loading-indicator {
|
32
37
|
position: absolute;
|
33
38
|
top: 50%;
|
@@ -61,6 +66,7 @@
|
|
61
66
|
animation-direction: normal;
|
62
67
|
}
|
63
68
|
.bk-loading-wrapper .bk-loading-mask {
|
69
|
+
position: absolute;
|
64
70
|
width: 100%;
|
65
71
|
height: 100%;
|
66
72
|
opacity: 0.5;
|
@@ -74,7 +80,7 @@
|
|
74
80
|
z-index: 10;
|
75
81
|
width: 100%;
|
76
82
|
height: 100%;
|
77
|
-
background-color: rgba(255, 255, 255, 0.
|
83
|
+
background-color: rgba(255, 255, 255, 0.8);
|
78
84
|
content: '';
|
79
85
|
}
|
80
86
|
.bk-loading-wrapper .bk-loading-indicator {
|
package/lib/loading/loading.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ExtractPropTypes
|
1
|
+
import { ExtractPropTypes } from 'vue';
|
2
2
|
export declare enum BkLoadingMode {
|
3
3
|
Default = "default",
|
4
4
|
Spin = "spin"
|
@@ -17,6 +17,11 @@ export declare const loadingTypes: {
|
|
17
17
|
loading: import("vue-types").VueTypeValidableDef<boolean> & {
|
18
18
|
default: boolean;
|
19
19
|
};
|
20
|
+
inline: import("vue-types").VueTypeValidableDef<boolean> & {
|
21
|
+
default: boolean;
|
22
|
+
} & {
|
23
|
+
default: boolean;
|
24
|
+
};
|
20
25
|
theme: import("vue-types").VueTypeDef<string>;
|
21
26
|
title: import("vue-types").VueTypeValidableDef<string> & {
|
22
27
|
default: string;
|
@@ -38,6 +43,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
38
43
|
loading: import("vue-types").VueTypeValidableDef<boolean> & {
|
39
44
|
default: boolean;
|
40
45
|
};
|
46
|
+
inline: import("vue-types").VueTypeValidableDef<boolean> & {
|
47
|
+
default: boolean;
|
48
|
+
} & {
|
49
|
+
default: boolean;
|
50
|
+
};
|
41
51
|
theme: import("vue-types").VueTypeDef<string>;
|
42
52
|
title: import("vue-types").VueTypeValidableDef<string> & {
|
43
53
|
default: string;
|
@@ -50,15 +60,18 @@ declare const _default: import("vue").DefineComponent<{
|
|
50
60
|
mode: import("vue-types").VueTypeDef<string> & {
|
51
61
|
default: string;
|
52
62
|
};
|
53
|
-
}, () => JSX.Element
|
54
|
-
[key: string]: any;
|
55
|
-
}>[], unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
63
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
56
64
|
indicator: {
|
57
65
|
type: FunctionConstructor;
|
58
66
|
};
|
59
67
|
loading: import("vue-types").VueTypeValidableDef<boolean> & {
|
60
68
|
default: boolean;
|
61
69
|
};
|
70
|
+
inline: import("vue-types").VueTypeValidableDef<boolean> & {
|
71
|
+
default: boolean;
|
72
|
+
} & {
|
73
|
+
default: boolean;
|
74
|
+
};
|
62
75
|
theme: import("vue-types").VueTypeDef<string>;
|
63
76
|
title: import("vue-types").VueTypeValidableDef<string> & {
|
64
77
|
default: string;
|
@@ -73,6 +86,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
73
86
|
};
|
74
87
|
}>>, {
|
75
88
|
title: string;
|
89
|
+
inline: boolean;
|
76
90
|
size: string;
|
77
91
|
loading: boolean;
|
78
92
|
mode: string;
|
package/lib/loading/loading.less
CHANGED
@@ -26,7 +26,6 @@
|
|
26
26
|
@largeOvalHeight: 12px;
|
27
27
|
@largeOvalGap: 26px;
|
28
28
|
|
29
|
-
|
30
29
|
.create-rotate(@time, @deg) {
|
31
30
|
transform: rotate(@deg);
|
32
31
|
animation-delay: @time;
|
@@ -56,13 +55,19 @@
|
|
56
55
|
|
57
56
|
.@{bk-prefix}-loading-wrapper {
|
58
57
|
position: static;
|
59
|
-
display: inline-block;
|
60
58
|
font-size: 0;
|
61
59
|
vertical-align: middle;
|
62
|
-
|
60
|
+
&:not(.@{bk-prefix}-nested-loading) {
|
61
|
+
display: inline-block;
|
62
|
+
}
|
63
|
+
|
63
64
|
&.@{bk-prefix}-nested-loading {
|
64
65
|
position: relative;
|
65
66
|
|
67
|
+
&.is-block {
|
68
|
+
display: block;
|
69
|
+
}
|
70
|
+
|
66
71
|
.@{bk-prefix}-loading-indicator {
|
67
72
|
position: absolute;
|
68
73
|
top: 50%;
|
@@ -100,6 +105,7 @@
|
|
100
105
|
}
|
101
106
|
|
102
107
|
.@{bk-prefix}-loading-mask {
|
108
|
+
position: absolute;
|
103
109
|
width: 100%;
|
104
110
|
height: 100%;
|
105
111
|
opacity: .5;
|
@@ -113,7 +119,7 @@
|
|
113
119
|
z-index: 10;
|
114
120
|
width: 100%;
|
115
121
|
height: 100%;
|
116
|
-
background-color: rgba(255, 255, 255, .
|
122
|
+
background-color: rgba(255, 255, 255, .8);
|
117
123
|
content: '';
|
118
124
|
}
|
119
125
|
}
|
@@ -141,9 +147,6 @@
|
|
141
147
|
.create-rotate(.45s + (@value * .15), -135deg + (45 * (@value - 1)));
|
142
148
|
}
|
143
149
|
});
|
144
|
-
|
145
|
-
|
146
|
-
;
|
147
150
|
|
148
151
|
.@{bk-prefix}-spin-indicator {
|
149
152
|
display: inline-block;
|
@@ -182,7 +185,6 @@
|
|
182
185
|
}
|
183
186
|
}
|
184
187
|
})
|
185
|
-
|
186
188
|
.@{bk-prefix}-loading-title {
|
187
189
|
margin-top: @titleMarginTop;
|
188
190
|
font-size: @font-size-medium;
|
@@ -190,7 +192,5 @@
|
|
190
192
|
color: @default-color;
|
191
193
|
text-align: center;
|
192
194
|
}
|
193
|
-
|
194
|
-
|
195
195
|
}
|
196
196
|
}
|
@@ -114,13 +114,18 @@
|
|
114
114
|
}
|
115
115
|
.bk-loading-wrapper {
|
116
116
|
position: static;
|
117
|
-
display: inline-block;
|
118
117
|
font-size: 0;
|
119
118
|
vertical-align: middle;
|
120
119
|
}
|
120
|
+
.bk-loading-wrapper:not(.bk-nested-loading) {
|
121
|
+
display: inline-block;
|
122
|
+
}
|
121
123
|
.bk-loading-wrapper.bk-nested-loading {
|
122
124
|
position: relative;
|
123
125
|
}
|
126
|
+
.bk-loading-wrapper.bk-nested-loading.is-block {
|
127
|
+
display: block;
|
128
|
+
}
|
124
129
|
.bk-loading-wrapper.bk-nested-loading .bk-loading-indicator {
|
125
130
|
position: absolute;
|
126
131
|
top: 50%;
|
@@ -154,6 +159,7 @@
|
|
154
159
|
animation-direction: normal;
|
155
160
|
}
|
156
161
|
.bk-loading-wrapper .bk-loading-mask {
|
162
|
+
position: absolute;
|
157
163
|
width: 100%;
|
158
164
|
height: 100%;
|
159
165
|
opacity: 0.5;
|
@@ -167,7 +173,7 @@
|
|
167
173
|
z-index: 10;
|
168
174
|
width: 100%;
|
169
175
|
height: 100%;
|
170
|
-
background-color: rgba(255, 255, 255, 0.
|
176
|
+
background-color: rgba(255, 255, 255, 0.8);
|
171
177
|
content: '';
|
172
178
|
}
|
173
179
|
.bk-loading-wrapper .bk-loading-indicator {
|
@@ -81,7 +81,7 @@ declare const BkPagination: {
|
|
81
81
|
onChange?: (...args: any[]) => any;
|
82
82
|
"onUpdate:modelValue"?: (...args: any[]) => any;
|
83
83
|
"onUpdate:limit"?: (...args: any[]) => any;
|
84
|
-
|
84
|
+
onLimitChange?: (...args: any[]) => any;
|
85
85
|
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "type" | "location" | "small" | "layout" | "disabled" | "count" | "modelValue" | "align" | "limit" | "limitList" | "showLimit" | "showTotalCount" | "prevText" | "nextText">;
|
86
86
|
$attrs: {
|
87
87
|
[x: string]: unknown;
|
@@ -94,7 +94,7 @@ declare const BkPagination: {
|
|
94
94
|
}>;
|
95
95
|
$root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>>;
|
96
96
|
$parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>>;
|
97
|
-
$emit: (event: "change" | "update:modelValue" | "update:limit" | "
|
97
|
+
$emit: (event: "change" | "update:modelValue" | "update:limit" | "limitChange", ...args: any[]) => void;
|
98
98
|
$el: any;
|
99
99
|
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
100
100
|
modelValue: import("vue-types").VueTypeValidableDef<number> & {
|
@@ -160,7 +160,7 @@ declare const BkPagination: {
|
|
160
160
|
onChange?: (...args: any[]) => any;
|
161
161
|
"onUpdate:modelValue"?: (...args: any[]) => any;
|
162
162
|
"onUpdate:limit"?: (...args: any[]) => any;
|
163
|
-
|
163
|
+
onLimitChange?: (...args: any[]) => any;
|
164
164
|
}, {
|
165
165
|
totalPageNum: import("vue").Ref<number>;
|
166
166
|
renderTotal: ({ isFirst, isLast }: {
|
@@ -176,7 +176,7 @@ declare const BkPagination: {
|
|
176
176
|
isLast: any;
|
177
177
|
}) => JSX.Element;
|
178
178
|
renderSmallList: () => JSX.Element;
|
179
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "update:modelValue" | "update:limit" | "
|
179
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "update:modelValue" | "update:limit" | "limitChange")[], string, {
|
180
180
|
type: string;
|
181
181
|
location: string;
|
182
182
|
small: boolean;
|
@@ -275,7 +275,7 @@ declare const BkPagination: {
|
|
275
275
|
onChange?: (...args: any[]) => any;
|
276
276
|
"onUpdate:modelValue"?: (...args: any[]) => any;
|
277
277
|
"onUpdate:limit"?: (...args: any[]) => any;
|
278
|
-
|
278
|
+
onLimitChange?: (...args: any[]) => any;
|
279
279
|
} & import("vue").ShallowUnwrapRef<{
|
280
280
|
totalPageNum: import("vue").Ref<number>;
|
281
281
|
renderTotal: ({ isFirst, isLast }: {
|
@@ -359,7 +359,7 @@ declare const BkPagination: {
|
|
359
359
|
onChange?: (...args: any[]) => any;
|
360
360
|
"onUpdate:modelValue"?: (...args: any[]) => any;
|
361
361
|
"onUpdate:limit"?: (...args: any[]) => any;
|
362
|
-
|
362
|
+
onLimitChange?: (...args: any[]) => any;
|
363
363
|
}, {
|
364
364
|
totalPageNum: import("vue").Ref<number>;
|
365
365
|
renderTotal: ({ isFirst, isLast }: {
|
@@ -375,7 +375,7 @@ declare const BkPagination: {
|
|
375
375
|
isLast: any;
|
376
376
|
}) => JSX.Element;
|
377
377
|
renderSmallList: () => JSX.Element;
|
378
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "update:modelValue" | "update:limit" | "
|
378
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "update:modelValue" | "update:limit" | "limitChange")[], "change" | "update:modelValue" | "update:limit" | "limitChange", {
|
379
379
|
type: string;
|
380
380
|
location: string;
|
381
381
|
small: boolean;
|
package/lib/pagination/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("../shared"),require("vue"),require("../select"),require("../icon"),require("../popover")):"function"==typeof define&&define.amd?define(["exports","../shared","vue","../select","../icon","../popover"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).bkuiVue={},e.Shared,e.Vue,e.Select,e["@bkui-vue/icon/icons"],e.Popover)}(this,(function(e,t,n,a,r,o){"use strict";function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=i(a),u=i(o);function c(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var s={exports:{}};!function(e){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports}(s);var d=c(s.exports),p={exports:{}},f={exports:{}};!function(e){e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports}(f);var v={exports:{}};!function(e){e.exports=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,r,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(a=n.next()).done)&&(o.push(a.value),!t||o.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw r}}return o}},e.exports.__esModule=!0,e.exports.default=e.exports}(v);var m={exports:{}},g={exports:{}};!function(e){e.exports=function(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},e.exports.__esModule=!0,e.exports.default=e.exports}(g),function(e){var t=g.exports;e.exports=function(e,n){if(e){if("string"==typeof e)return t(e,n);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)?t(e,n):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports}(m);var b={exports:{}};!function(e){e.exports=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.")},e.exports.__esModule=!0,e.exports.default=e.exports}(b),function(e){var t=f.exports,n=v.exports,a=m.exports,r=b.exports;e.exports=function(e,o){return t(e)||n(e,o)||a(e,o)||r()},e.exports.__esModule=!0,e.exports.default=e.exports}(p);var x=c(p.exports);var h=function(){var e=n.getCurrentInstance().proxy,t=n.ref(null),a=n.ref(!1),o=n.ref(1),i=n.computed((function(){return 1===o.value})),l=n.computed((function(){return o.value===e.totalPageNum})),c=0,s=n.computed((function(){for(var t=[],n=1;n<=e.totalPageNum;n++)t.push(n);return t}));n.watch((function(){return e.modelValue}),(function(t){n.nextTick((function(){t>=1&&t<=e.totalPageNum?o.value=t:o.value=t<1?1:e.totalPageNum,c=o.value}))}),{immediate:!0}),n.nextTick((function(){n.watch((function(){return e.totalPageNum}),(function(e){o.value>e&&(o.value=e)}))}));var d=function(){i.value||(o.value=o.value-1)},p=function(){l.value||(o.value=o.value+1)},f=function(){n.nextTick((function(){t.value.focus();var e=window.getSelection();e.selectAllChildren(t.value),e.collapseToEnd()}))},v=function(){a.value=!0},m=function(){a.value=!1,t.value.textContent="".concat(c),c!==o.value&&(o.value=c)},g=function(t){var n=t.target,a=Number(n.textContent);!a||a<1||a>e.totalPageNum||a===o.value||(c=a,f())},b=function(e){["Enter","NumpadEnter"].includes(e.code)&&(e.preventDefault(),m(),f())};return{current:o,render:function(){return n.createVNode("div",{class:"bk-pagination-small-list"},[n.createVNode("div",{class:{"bk-pagination-btn-pre":!0,"is-disabled":i.value},onClick:d},[n.createVNode(r.LeftShape,null,null)]),n.createVNode(u.default,{theme:"light",trigger:"click",arrow:!1,boundary:"body",placement:"bottom"},{default:function(){return n.createVNode("div",{class:{"bk-pagination-picker":!0,"is-focused":a.value}},[n.createVNode("span",{ref:t,class:"bk-pagination-editor",contenteditable:!0,spellcheck:"false",onFocus:v,onBlur:m,onInput:g,onKeydown:b},[o.value]),n.createVNode("span",null,[n.createTextVNode("/")]),n.createVNode("span",{class:"bk-pagination-small-list-total"},[e.totalPageNum])])},content:function(){return n.createVNode("div",{class:"bk-pagination-picker-list"},[s.value.map((function(e){return n.createVNode("div",{class:{item:!0,"is-actived":e===o.value},key:e,onClick:function(){return function(e){c=e,m()}(e)}},[e])}))])}}),n.createVNode("div",{class:{"bk-pagination-btn-next":!0,"is-disabled":l.value},onClick:p},[n.createVNode(r.RightShape,null,null)])])}}},N={modelValue:t.PropTypes.number.def(1),count:t.PropTypes.number.def(0).isRequired,limit:t.PropTypes.number.def(10),limitList:t.PropTypes.arrayOf(Number).def([10,20,50,100]),showLimit:t.PropTypes.bool.def(!0),type:t.PropTypes.oneOf(["default","compact"]).def("default"),location:t.PropTypes.oneOf(["left","right"]).def("right"),align:t.PropTypes.oneOf(["left","center","right"]).def("left"),size:t.PropTypes.size(),small:t.PropTypes.bool.def(!1),showTotalCount:t.PropTypes.bool.def(!0),prevText:t.PropTypes.string,nextText:t.PropTypes.string,disabled:t.PropTypes.bool.def(!1),layout:t.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"])},y=n.defineComponent({name:"Pagination",props:N,emits:["update:modelValue","change","update:limit","limit-change"],setup:function(e,t){var o=n.ref(0),i=n.toRefs(e),u=i.count,c=i.limit,s=function(e){var t=e.isFirst,a=e.isLast,r=n.getCurrentInstance().props;return r.showTotalCount?n.createVNode("div",n.mergeProps({class:{"bk-pagination-total":!0,"is-first":t,"is-last":a}},{disabled:r.disabled}),[n.createTextVNode("共计"),n.createVNode("div",{class:"bk-pagination-total-num"},[r.count]),n.createTextVNode("条")]):null},d=function(){var e=n.getCurrentInstance().proxy,t=n.ref(1),a=n.computed((function(){return 1===t.value})),o=n.computed((function(){return t.value===e.totalPageNum})),i=n.ref(!1),l=n.ref(!1),u=n.computed((function(){i.value=!1,l.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,l.value=t.value+r<e.totalPageNum-1);for(var o=Math.min(e.totalPageNum-5,Math.max(2,t.value-r)),u=o;u<o+5;u++)n.push(u);return n}));n.watch((function(){return e.modelValue}),(function(a){n.nextTick((function(){a>=1&&a<=e.totalPageNum?t.value=a:t.value=a<1?1:e.totalPageNum}))})),n.nextTick((function(){n.watch((function(){return e.totalPageNum}),(function(e){t.value>e&&(t.value=e)}))}));var c=function(){a.value||(t.value=t.value-1)},s=function(){o.value||(t.value=t.value+1)},d=function(e){e!==t.value&&(t.value=e)},p=function(){t.value=Math.max(1,t.value-5)},f=function(){t.value=Math.min(e.totalPageNum,t.value+5)};return{current:t,render:function(v){var m=v.isFirst,g=v.isLast;return n.createVNode("div",{class:{"bk-pagination-list":!0,"is-first":m,"is-last":g}},[n.createVNode("div",{class:{"bk-pagination-list-pre":!0,"is-disabled":a.value},onClick:c},[e.prevText||n.createVNode(r.AngleLeft,null,null)]),n.createVNode("div",{class:{"bk-pagination-list-item":!0,"is-active":1===t.value},key:"1",onClick:function(){return d(1)}},[n.createTextVNode("1")]),i.value&&n.createVNode("div",{key:"pre-batch",class:"bk-pagination-list-pre-batch",onClick:p},[n.createVNode(r.Ellipsis,null,null)]),u.value.map((function(e){return n.createVNode("div",{class:{"bk-pagination-list-item":!0,"is-active":t.value===e},key:e,onClick:function(){return d(e)}},[e])})),l.value&&n.createVNode("div",{key:"next-batch",class:"bk-pagination-list-next-batch",onClick:f},[n.createVNode(r.Ellipsis,null,null)]),e.totalPageNum>1&&n.createVNode("div",{class:{"bk-pagination-list-item":!0,"is-active":t.value===e.totalPageNum},key:"last",onClick:function(){return d(e.totalPageNum)}},[e.totalPageNum]),n.createVNode("div",{class:{"bk-pagination-list-pre":!0,"is-disabled":o.value},onClick:s},[e.nextText||n.createVNode(r.AngleRight,null,null)])])}}}(),p=d.current,f=d.render,v=h(),m=v.current,g=v.render,b=function(){var e=n.getCurrentInstance().proxy,t=n.ref(e.limit);n.watch((function(){return e.limit}),(function(e){t.value=e})),n.watch((function(){return e.limitList}),(function(e){n.nextTick((function(){if(!e.includes(t.value)){var n=x(e,1);t.value=n[0]}}))}),{immediate:!0});var r=function(e){t.value=e};return{limit:t,render:function(o){var i,u,c=o.isFirst,s=o.isLast;return e.showLimit?n.createVNode("div",n.mergeProps({class:{"bk-pagination-limit":!0,"is-first":c,"is-last":s}},{disabled:e.disabled}),[n.createVNode("div",null,[n.createTextVNode("每页")]),n.createVNode(l.default,{class:"bk-pagination-limit-select",clearable:!1,modelValue:t.value,onChange:r,disabled:e.disabled},(u=i=e.limitList.map((function(e,t){return n.createVNode(a.BkOption,{value:e,label:e,key:"".concat(t,"_").concat(e)},null)})),"function"==typeof u||"[object Object]"===Object.prototype.toString.call(u)&&!n.isVNode(u)?i:{default:function(){return[i]}})),n.createVNode("div",null,[n.createTextVNode("条")])]):null}}}(),N=b.limit,y=b.render;return n.watch([u,N,c],(function(e){var t=x(e,2),n=t[0],a=t[1],r=Math.ceil(n/a);o.value=r<1?1:r}),{immediate:!0}),n.watch(p,(function(e){t.emit("update:modelValue",e),t.emit("change",e)})),n.watch(m,(function(e){t.emit("update:modelValue",e),t.emit("change",e)})),n.watch(N,(function(e){t.emit("limit-change",e)})),{totalPageNum:o,renderTotal:s,renderList:f,renderLimit:y,renderSmallList:g}},render:function(){var e,a=this,r=t.classes((d(e={"bk-pagination":!0},"bk-pagination--".concat(this.size),!0),d(e,"is-align-".concat(this.align),!0),e)),o={total:this.renderTotal,list:this.small?this.renderSmallList:this.renderList,limit:this.renderLimit};return n.createVNode("div",{class:r},[this.layout.map((function(e,t){return o[e]({isFirst:0===t,isLast:t===a.layout.length-1})}))])}}),k=t.withInstall(y);e.BkPagination=k,e.default=k,Object.defineProperty(e,"__esModule",{value:!0})}));
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("../shared"),require("vue"),require("../select"),require("../icon"),require("../popover")):"function"==typeof define&&define.amd?define(["exports","../shared","vue","../select","../icon","../popover"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).bkuiVue={},e.Shared,e.Vue,e.Select,e["@bkui-vue/icon/icons"],e.Popover)}(this,(function(e,t,n,a,r,o){"use strict";function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=i(a),u=i(o);function s(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var c={exports:{}};!function(e){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports}(c);var d=s(c.exports),p={exports:{}},f={exports:{}};!function(e){e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports}(f);var v={exports:{}};!function(e){e.exports=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,r,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(a=n.next()).done)&&(o.push(a.value),!t||o.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw r}}return o}},e.exports.__esModule=!0,e.exports.default=e.exports}(v);var m={exports:{}},g={exports:{}};!function(e){e.exports=function(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},e.exports.__esModule=!0,e.exports.default=e.exports}(g),function(e){var t=g.exports;e.exports=function(e,n){if(e){if("string"==typeof e)return t(e,n);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)?t(e,n):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports}(m);var b={exports:{}};!function(e){e.exports=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.")},e.exports.__esModule=!0,e.exports.default=e.exports}(b),function(e){var t=f.exports,n=v.exports,a=m.exports,r=b.exports;e.exports=function(e,o){return t(e)||n(e,o)||a(e,o)||r()},e.exports.__esModule=!0,e.exports.default=e.exports}(p);var x=s(p.exports);var h=function(){var e=n.getCurrentInstance().proxy,t=n.ref(null),a=n.ref(!1),o=n.ref(1),i=n.computed((function(){return 1===o.value})),l=n.computed((function(){return o.value===e.totalPageNum})),s=0,c=n.computed((function(){for(var t=[],n=1;n<=e.totalPageNum;n++)t.push(n);return t}));n.watch((function(){return e.modelValue}),(function(t){n.nextTick((function(){t>=1&&t<=e.totalPageNum?o.value=t:o.value=t<1?1:e.totalPageNum,s=o.value}))}),{immediate:!0}),n.nextTick((function(){n.watch((function(){return e.totalPageNum}),(function(e){o.value>e&&(o.value=e)}))}));var d=function(){i.value||(o.value=o.value-1)},p=function(){l.value||(o.value=o.value+1)},f=function(){n.nextTick((function(){t.value.focus();var e=window.getSelection();e.selectAllChildren(t.value),e.collapseToEnd()}))},v=function(){a.value=!0},m=function(){a.value=!1,t.value.textContent="".concat(s),s!==o.value&&(o.value=s)},g=function(t){var n=t.target,a=Number(n.textContent);!a||a<1||a>e.totalPageNum||a===o.value||(s=a,f())},b=function(e){["Enter","NumpadEnter"].includes(e.code)&&(e.preventDefault(),m(),f())};return{current:o,render:function(){return n.createVNode("div",{class:"bk-pagination-small-list"},[n.createVNode("div",{class:{"bk-pagination-btn-pre":!0,"is-disabled":i.value},onClick:d},[n.createVNode(r.LeftShape,null,null)]),n.createVNode(u.default,{theme:"light",trigger:"click",arrow:!1,boundary:"body",placement:"bottom"},{default:function(){return n.createVNode("div",{class:{"bk-pagination-picker":!0,"is-focused":a.value}},[n.createVNode("span",{ref:t,class:"bk-pagination-editor",contenteditable:!0,spellcheck:"false",onFocus:v,onBlur:m,onInput:g,onKeydown:b},[o.value]),n.createVNode("span",null,[n.createTextVNode("/")]),n.createVNode("span",{class:"bk-pagination-small-list-total"},[e.totalPageNum])])},content:function(){return n.createVNode("div",{class:"bk-pagination-picker-list"},[c.value.map((function(e){return n.createVNode("div",{class:{item:!0,"is-actived":e===o.value},key:e,onClick:function(){return function(e){s=e,m()}(e)}},[e])}))])}}),n.createVNode("div",{class:{"bk-pagination-btn-next":!0,"is-disabled":l.value},onClick:p},[n.createVNode(r.RightShape,null,null)])])}}},N={modelValue:t.PropTypes.number.def(1),count:t.PropTypes.number.def(0).isRequired,limit:t.PropTypes.number.def(10),limitList:t.PropTypes.arrayOf(Number).def([10,20,50,100]),showLimit:t.PropTypes.bool.def(!0),type:t.PropTypes.oneOf(["default","compact"]).def("default"),location:t.PropTypes.oneOf(["left","right"]).def("right"),align:t.PropTypes.oneOf(["left","center","right"]).def("left"),size:t.PropTypes.size(),small:t.PropTypes.bool.def(!1),showTotalCount:t.PropTypes.bool.def(!0),prevText:t.PropTypes.string,nextText:t.PropTypes.string,disabled:t.PropTypes.bool.def(!1),layout:t.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"])},y=n.defineComponent({name:"Pagination",props:N,emits:["update:modelValue","change","update:limit","limitChange"],setup:function(e,t){var o=n.ref(0),i=n.toRefs(e),u=i.count,s=i.limit,c=function(e){var t=e.isFirst,a=e.isLast,r=n.getCurrentInstance().props;return r.showTotalCount?n.createVNode("div",n.mergeProps({class:{"bk-pagination-total":!0,"is-first":t,"is-last":a}},{disabled:r.disabled}),[n.createTextVNode("共计"),n.createVNode("div",{class:"bk-pagination-total-num"},[r.count]),n.createTextVNode("条")]):null},d=function(){var e=n.getCurrentInstance().proxy,t=n.ref(1),a=n.computed((function(){return 1===t.value})),o=n.computed((function(){return t.value===e.totalPageNum})),i=n.ref(!1),l=n.ref(!1),u=n.computed((function(){i.value=!1,l.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,l.value=t.value+r<e.totalPageNum-1);for(var o=Math.min(e.totalPageNum-5,Math.max(2,t.value-r)),u=o;u<o+5;u++)n.push(u);return n}));n.watch((function(){return e.modelValue}),(function(a){n.nextTick((function(){a>=1&&a<=e.totalPageNum?t.value=a:t.value=a<1?1:e.totalPageNum}))}),{immediate:!0}),n.nextTick((function(){n.watch((function(){return e.totalPageNum}),(function(e){t.value>e&&(t.value=e)}))}));var s=function(){a.value||(t.value=t.value-1)},c=function(){o.value||(t.value=t.value+1)},d=function(e){e!==t.value&&(t.value=e)},p=function(){t.value=Math.max(1,t.value-5)},f=function(){t.value=Math.min(e.totalPageNum,t.value+5)};return{current:t,render:function(v){var m=v.isFirst,g=v.isLast;return n.createVNode("div",{class:{"bk-pagination-list":!0,"is-first":m,"is-last":g}},[n.createVNode("div",{class:{"bk-pagination-list-pre":!0,"is-disabled":a.value},onClick:s},[e.prevText||n.createVNode(r.AngleLeft,null,null)]),n.createVNode("div",{class:{"bk-pagination-list-item":!0,"is-active":1===t.value},key:"1",onClick:function(){return d(1)}},[n.createTextVNode("1")]),i.value&&n.createVNode("div",{key:"pre-batch",class:"bk-pagination-list-pre-batch",onClick:p},[n.createVNode(r.Ellipsis,null,null)]),u.value.map((function(e){return n.createVNode("div",{class:{"bk-pagination-list-item":!0,"is-active":t.value===e},key:e,onClick:function(){return d(e)}},[e])})),l.value&&n.createVNode("div",{key:"next-batch",class:"bk-pagination-list-next-batch",onClick:f},[n.createVNode(r.Ellipsis,null,null)]),e.totalPageNum>1&&n.createVNode("div",{class:{"bk-pagination-list-item":!0,"is-active":t.value===e.totalPageNum},key:"last",onClick:function(){return d(e.totalPageNum)}},[e.totalPageNum]),n.createVNode("div",{class:{"bk-pagination-list-pre":!0,"is-disabled":o.value},onClick:c},[e.nextText||n.createVNode(r.AngleRight,null,null)])])}}}(),p=d.current,f=d.render,v=h(),m=v.current,g=v.render,b=function(){var e=n.getCurrentInstance().proxy,t=n.ref(e.limit);n.watch((function(){return e.limit}),(function(e){t.value=e})),n.watch((function(){return e.limitList}),(function(e){n.nextTick((function(){if(!e.includes(t.value)){var n=x(e,1);t.value=n[0]}}))}),{immediate:!0});var r=function(e){t.value=e};return{limit:t,render:function(o){var i,u,s=o.isFirst,c=o.isLast;return e.showLimit?n.createVNode("div",n.mergeProps({class:{"bk-pagination-limit":!0,"is-first":s,"is-last":c}},{disabled:e.disabled}),[n.createVNode("div",null,[n.createTextVNode("每页")]),n.createVNode(l.default,{class:"bk-pagination-limit-select",clearable:!1,modelValue:t.value,onChange:r,disabled:e.disabled},(u=i=e.limitList.map((function(e,t){return n.createVNode(a.BkOption,{value:e,label:e,key:"".concat(t,"_").concat(e)},null)})),"function"==typeof u||"[object Object]"===Object.prototype.toString.call(u)&&!n.isVNode(u)?i:{default:function(){return[i]}})),n.createVNode("div",null,[n.createTextVNode("条")])]):null}}}(),N=b.limit,y=b.render;return n.watch([u,N,s],(function(e){var t=x(e,2),n=t[0],a=t[1],r=Math.ceil(n/a);o.value=r<1?1:r}),{immediate:!0}),n.watch(p,(function(e){t.emit("update:modelValue",e),t.emit("change",e)})),n.watch(m,(function(e){t.emit("update:modelValue",e),t.emit("change",e)})),n.watch(N,(function(e){t.emit("limitChange",e)})),{totalPageNum:o,renderTotal:c,renderList:f,renderLimit:y,renderSmallList:g}},render:function(){var e,a=this,r=t.classes((d(e={"bk-pagination":!0},"bk-pagination--".concat(this.size),!0),d(e,"is-align-".concat(this.align),!0),e)),o={total:this.renderTotal,list:this.small?this.renderSmallList:this.renderList,limit:this.renderLimit};return n.createVNode("div",{class:r},[this.layout.map((function(e,t){return o[e]({isFirst:0===t,isLast:t===a.layout.length-1})}))])}}),k=t.withInstall(y);e.BkPagination=k,e.default=k,Object.defineProperty(e,"__esModule",{value:!0})}));
|
@@ -136,7 +136,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
136
136
|
isLast: any;
|
137
137
|
}) => JSX.Element;
|
138
138
|
renderSmallList: () => JSX.Element;
|
139
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "update:modelValue" | "update:limit" | "
|
139
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "update:modelValue" | "update:limit" | "limitChange")[], "change" | "update:modelValue" | "update:limit" | "limitChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
140
140
|
modelValue: import("vue-types").VueTypeValidableDef<number> & {
|
141
141
|
default: number;
|
142
142
|
} & {
|
@@ -200,7 +200,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
200
200
|
onChange?: (...args: any[]) => any;
|
201
201
|
"onUpdate:modelValue"?: (...args: any[]) => any;
|
202
202
|
"onUpdate:limit"?: (...args: any[]) => any;
|
203
|
-
|
203
|
+
onLimitChange?: (...args: any[]) => any;
|
204
204
|
}, {
|
205
205
|
type: string;
|
206
206
|
location: string;
|
package/lib/radio/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("../shared"),require("vue")):"function"==typeof define&&define.amd?define(["exports","../shared","vue"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).bkuiVue={},e.Shared,e.Vue)}(this,(function(e,t,o){"use strict";function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var a={exports:{}},n={exports:{}};!function(e){e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports}(n);var s={exports:{}};!function(e){e.exports=function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var r,a,n=[],s=!0,l=!1;try{for(o=o.call(e);!(s=(r=o.next()).done)&&(n.push(r.value),!t||n.length!==t);s=!0);}catch(e){l=!0,a=e}finally{try{s||null==o.return||o.return()}finally{if(l)throw a}}return n}},e.exports.__esModule=!0,e.exports.default=e.exports}(s);var l={exports:{}},i={exports:{}};!function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,r=new Array(t);o<t;o++)r[o]=e[o];return r},e.exports.__esModule=!0,e.exports.default=e.exports}(i),function(e){var t=i.exports;e.exports=function(e,o){if(e){if("string"==typeof e)return t(e,o);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,o):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports}(l);var u={exports:{}};!function(e){e.exports=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.")},e.exports.__esModule=!0,e.exports.default=e.exports}(u),function(e){var t=n.exports,o=s.exports,r=l.exports,a=u.exports;e.exports=function(e,n){return t(e)||o(e,n)||r(e,n)||a()},e.exports.__esModule=!0,e.exports.default=e.exports}(a);var d=r(a.exports),p=Symbol("RadioGroup");function c(){var e=o.ref(!1);return[e,{blur:function(){e.value=!1},focus:function(){e.value=!0}}]}function h(){var e=o.getCurrentInstance(),r=e.props,a=e.emit,n=o.inject(p,t.EMPTY_OBJ),s=!t.isEmptyObj(n),l=o.reactive({isLocalChecked:r.checked}),i=o.computed((function(){return s?n.state.localValue===r.label:""!==r.modelValue?r.modelValue===r.label:l.isLocalChecked}));l.isLocalChecked=i.value;var u=o.computed((function(){return!(!s||!n.props.disabled)||r.disabled}));return{name:o.computed((function(){return s&&n.props.name?n.props.name:r.name})),isCheck:i,isDisabled:u,handlerChange:function(){u.value||(a("change",r.label),a("update:modelValue",r.label),s&&n.handleChange(r.label))}}}var f={name:t.PropTypes.string.def(""),label:t.PropTypes.oneOfType([String,Number,Boolean]).isRequired,modelValue:t.PropTypes.oneOfType([String,Number,Boolean]).def(""),checked:t.PropTypes.bool.def(!1),disabled:t.PropTypes.bool.def(!1)},b=o.defineComponent({name:"Radio",props:f,emits:["change","update:modelValue"],setup:function(){var e=c(),t=d(e,2),o=t[0],r=t[1],a=r.blur,n=r.focus,s=h();return{isFocus:o,realName:s.name,isCheck:s.isCheck,isDisabled:s.isDisabled,handleBlur:a,handleFocus:n,handlerChange:s.handlerChange}},render:function(){var e=t.classes({"bk-radio":!0,"is-
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("../shared"),require("vue")):"function"==typeof define&&define.amd?define(["exports","../shared","vue"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).bkuiVue={},e.Shared,e.Vue)}(this,(function(e,t,o){"use strict";function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var a={exports:{}},n={exports:{}};!function(e){e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports}(n);var s={exports:{}};!function(e){e.exports=function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var r,a,n=[],s=!0,l=!1;try{for(o=o.call(e);!(s=(r=o.next()).done)&&(n.push(r.value),!t||n.length!==t);s=!0);}catch(e){l=!0,a=e}finally{try{s||null==o.return||o.return()}finally{if(l)throw a}}return n}},e.exports.__esModule=!0,e.exports.default=e.exports}(s);var l={exports:{}},i={exports:{}};!function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,r=new Array(t);o<t;o++)r[o]=e[o];return r},e.exports.__esModule=!0,e.exports.default=e.exports}(i),function(e){var t=i.exports;e.exports=function(e,o){if(e){if("string"==typeof e)return t(e,o);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,o):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports}(l);var u={exports:{}};!function(e){e.exports=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.")},e.exports.__esModule=!0,e.exports.default=e.exports}(u),function(e){var t=n.exports,o=s.exports,r=l.exports,a=u.exports;e.exports=function(e,n){return t(e)||o(e,n)||r(e,n)||a()},e.exports.__esModule=!0,e.exports.default=e.exports}(a);var d=r(a.exports),p=Symbol("RadioGroup");function c(){var e=o.ref(!1);return[e,{blur:function(){e.value=!1},focus:function(){e.value=!0}}]}function h(){var e=o.getCurrentInstance(),r=e.props,a=e.emit,n=o.inject(p,t.EMPTY_OBJ),s=!t.isEmptyObj(n),l=o.reactive({isLocalChecked:r.checked}),i=o.computed((function(){return s?n.state.localValue===r.label:""!==r.modelValue?r.modelValue===r.label:l.isLocalChecked}));l.isLocalChecked=i.value;var u=o.computed((function(){return!(!s||!n.props.disabled)||r.disabled}));return{name:o.computed((function(){return s&&n.props.name?n.props.name:r.name})),isCheck:i,isDisabled:u,handlerChange:function(){u.value||(a("change",r.label),a("update:modelValue",r.label),s&&n.handleChange(r.label))}}}var f={name:t.PropTypes.string.def(""),label:t.PropTypes.oneOfType([String,Number,Boolean]).isRequired,modelValue:t.PropTypes.oneOfType([String,Number,Boolean]).def(""),checked:t.PropTypes.bool.def(!1),disabled:t.PropTypes.bool.def(!1)},b=o.defineComponent({name:"Radio",props:f,emits:["change","update:modelValue"],setup:function(){var e=c(),t=d(e,2),o=t[0],r=t[1],a=r.blur,n=r.focus,s=h();return{isFocus:o,realName:s.name,isCheck:s.isCheck,isDisabled:s.isDisabled,handleBlur:a,handleFocus:n,handlerChange:s.handlerChange}},render:function(){var e=t.classes({"bk-radio":!0,"is-focusd":this.isFocus,"is-disabled":this.isDisabled,"is-checked":this.isCheck});return o.createVNode("label",{class:e,tabindex:"0"},[o.createVNode("input",{class:"bk-radio-input",type:"radio",tabindex:"0",name:this.realName,value:this.label,checked:this.isCheck,disabled:this.isDisabled,onFocus:this.handleFocus,onBlur:this.handleBlur,onChange:this.handlerChange},null),o.createVNode("span",{class:"bk-radio-text"},[this.$slots.default?this.$slots.default():this.label])])}}),m={name:t.PropTypes.string.def(""),label:t.PropTypes.oneOfType([String,Number,Boolean]).isRequired,modelValue:t.PropTypes.oneOfType([String,Number,Boolean]).def(""),checked:t.PropTypes.bool.def(!1),disabled:t.PropTypes.bool.def(!1),size:t.PropTypes.size},y=o.defineComponent({name:"RadioButton",props:m,emits:["change","update:modelValue"],setup:function(){var e=c(),t=d(e,2),o=t[0],r=t[1],a=r.blur,n=r.focus,s=h();return{isFocus:o,realName:s.name,isCheck:s.isCheck,isDisabled:s.isDisabled,handleBlur:a,handleFocus:n,handlerChange:s.handlerChange}},render:function(){var e=t.classes({"bk-radio-button":!0,"is-focusd":this.isFocus,"is-disabled":this.isDisabled,"is-checked":this.isCheck});return o.createVNode("label",{class:e,tabindex:"0"},[o.createVNode("input",{class:"bk-radio-button-input",type:"radio",tabindex:"0",name:this.realName,value:this.label,checked:this.isCheck,disabled:this.isDisabled,onFocus:this.handleFocus,onBlur:this.handleBlur,onChange:this.handlerChange},null),o.createVNode("div",{class:"bk-radio-button-text"},[this.$slots.default?this.$slots.default():this.label])])}}),x={name:t.PropTypes.string.def(""),modelValue:t.PropTypes.oneOfType([String,Number,Boolean]),disabled:t.PropTypes.bool},v=o.defineComponent({name:"RadioGroup",props:x,emits:["change","update:modelValue"],setup:function(e,t){var r=o.reactive({localValue:e.modelValue});o.watch((function(){return e.modelValue}),(function(){r.localValue=e.modelValue}));return o.provide(p,{props:e,state:r,handleChange:function(e){t.emit("update:modelValue",e),t.emit("change",e)}}),{}},render:function(){var e;return o.createVNode("div",{class:"bk-radio-group"},[null===(e=this.$slots)||void 0===e?void 0:e.default()])}}),g=t.withInstallProps(b,{Group:v,Button:y});e.BkRadio=g,e.BkRadioButton=y,e.BkRadioGroup=v,e.default=g,Object.defineProperty(e,"__esModule",{value:!0})}));
|
package/lib/radio/radio.css
CHANGED
@@ -34,7 +34,7 @@
|
|
34
34
|
.bk-radio.is-disabled .bk-radio-text {
|
35
35
|
cursor: not-allowed;
|
36
36
|
}
|
37
|
-
.bk-radio.is-
|
37
|
+
.bk-radio.is-focusd .bk-radio-input {
|
38
38
|
border-color: #3a84ff;
|
39
39
|
}
|
40
40
|
.bk-radio .bk-radio-text {
|
@@ -107,7 +107,7 @@
|
|
107
107
|
background: #dcdee5;
|
108
108
|
border-color: #dcdee5;
|
109
109
|
}
|
110
|
-
.bk-radio-button.is-
|
110
|
+
.bk-radio-button.is-focusd .bk-radio-button-text {
|
111
111
|
border-color: #3a84ff;
|
112
112
|
}
|
113
113
|
.bk-radio-button .bk-radio-button-input {
|
package/lib/radio/radio.less
CHANGED
@@ -46,7 +46,7 @@
|
|
46
46
|
}
|
47
47
|
}
|
48
48
|
|
49
|
-
&.is-
|
49
|
+
&.is-focusd {
|
50
50
|
.bk-radio-input {
|
51
51
|
border-color: @primary-color;
|
52
52
|
}
|
@@ -136,7 +136,7 @@
|
|
136
136
|
}
|
137
137
|
}
|
138
138
|
|
139
|
-
&.is-
|
139
|
+
&.is-focusd {
|
140
140
|
.bk-radio-button-text {
|
141
141
|
border-color: @primary-color;
|
142
142
|
}
|
@@ -127,7 +127,7 @@
|
|
127
127
|
.bk-radio.is-disabled .bk-radio-text {
|
128
128
|
cursor: not-allowed;
|
129
129
|
}
|
130
|
-
.bk-radio.is-
|
130
|
+
.bk-radio.is-focusd .bk-radio-input {
|
131
131
|
border-color: var(--primary-color);
|
132
132
|
}
|
133
133
|
.bk-radio .bk-radio-text {
|
@@ -200,7 +200,7 @@
|
|
200
200
|
background: var(--disable-color);
|
201
201
|
border-color: var(--disable-color);
|
202
202
|
}
|
203
|
-
.bk-radio-button.is-
|
203
|
+
.bk-radio-button.is-focusd .bk-radio-button-text {
|
204
204
|
border-color: var(--primary-color);
|
205
205
|
}
|
206
206
|
.bk-radio-button .bk-radio-button-input {
|