bkui-vue 0.0.2-beta.7 → 0.0.2-beta.9
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 +54 -54
- package/dist/index.esm.js +7445 -7494
- package/dist/index.umd.js +54 -54
- package/dist/style.css +1 -1
- package/dist/style.variable.css +1 -1
- package/lib/components.d.ts +1 -1
- package/lib/container/index.js +1 -1
- package/lib/dropdown/dropdown.d.ts +1 -1
- package/lib/dropdown/index.d.ts +5 -5
- package/lib/message/index.js +1 -1
- package/lib/message/messageConstructor.d.ts +5 -4
- package/lib/plugin-popover/index.js +1 -1
- package/lib/popover/const.d.ts +22 -9
- package/lib/popover/index.d.ts +80 -45
- package/lib/popover/index.js +1 -1
- package/lib/popover/popover.d.ts +24 -16
- package/lib/popover/props.d.ts +4 -2
- package/lib/popover/use-floating.d.ts +1 -1
- package/lib/select/index.d.ts +0 -12
- package/lib/select/select.d.ts +0 -6
- package/lib/styles/mixins/clearfix.less +0 -10
- package/lib/styles/mixins/clearfix.variable.css +0 -8
- package/lib/table/components/table-cell.d.ts +15 -6
- package/lib/table/components/table-column.d.ts +108 -215
- package/lib/table/const.d.ts +16 -54
- package/lib/table/events.d.ts +180 -0
- package/lib/table/index.d.ts +749 -410
- package/lib/table/index.js +1 -1
- package/lib/table/plugins/head-filter.d.ts +3 -7
- package/lib/table/plugins/head-sort.d.ts +3 -7
- package/lib/table/plugins/settings.d.ts +8 -12
- package/lib/table/plugins/use-fixed-column.d.ts +3 -2
- package/lib/table/props.d.ts +147 -160
- package/lib/table/render.d.ts +6 -4
- package/lib/table/table.css +16 -2
- package/lib/table/table.d.ts +194 -83
- package/lib/table/table.less +38 -2
- package/lib/table/table.variable.css +16 -2
- package/lib/table/use-column.d.ts +47 -1
- package/lib/table/use-common.d.ts +22 -9
- package/lib/table/utils.d.ts +1 -0
- package/lib/table-column/index.d.ts +417 -537
- package/lib/table-column/index.js +1 -1
- package/lib/tag-input/index.d.ts +0 -6
- package/lib/tag-input/tag-input.d.ts +0 -4
- package/lib/tag-input/tag-props.d.ts +0 -2
- package/package.json +1 -1
- package/lib/styles/mixins/clearfix.css +0 -8
- package/lib/styles/mixins/mixins.css +0 -72
- package/lib/styles/mixins/mixins.less +0 -5
- package/lib/styles/mixins/mixins.variable.css +0 -72
package/lib/table/props.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { ExtractPropTypes, Slot } from 'vue';
|
2
|
-
import { ROW_HOVER, SORT_OPTION } from './const';
|
2
|
+
import { IHeadColor, ROW_HOVER, SORT_OPTION } from './const';
|
3
3
|
export declare enum SortScope {
|
4
4
|
CURRENT = "current",
|
5
5
|
ALL = "all"
|
@@ -12,7 +12,7 @@ export declare enum OverflowModeEnum {
|
|
12
12
|
STATIC = "static",
|
13
13
|
AUTO = "auto"
|
14
14
|
}
|
15
|
-
export declare const
|
15
|
+
export declare const EnumOverflowModeType: import("vue-types").VueTypeDef<"auto" | "static">;
|
16
16
|
export declare enum ColumnTypeEnum {
|
17
17
|
SELECTION = "selection",
|
18
18
|
INDEX = "index",
|
@@ -49,9 +49,48 @@ export type IOverflowTooltip = {
|
|
49
49
|
watchCellResize?: boolean;
|
50
50
|
mode?: `${OverflowModeEnum}`;
|
51
51
|
};
|
52
|
+
export type IOverflowTooltipProp = {
|
53
|
+
content: string | Function;
|
54
|
+
disabled?: boolean;
|
55
|
+
watchCellResize?: boolean;
|
56
|
+
mode?: `${OverflowModeEnum}`;
|
57
|
+
} | boolean;
|
58
|
+
export declare const IOverflowTooltipPropType: import("vue-types").VueTypeDef<IOverflowTooltipProp> & {
|
59
|
+
default: boolean | (() => {
|
60
|
+
content: string | Function;
|
61
|
+
disabled?: boolean;
|
62
|
+
watchCellResize?: boolean;
|
63
|
+
mode?: `${OverflowModeEnum}`;
|
64
|
+
});
|
65
|
+
};
|
66
|
+
export declare const IOverflowTooltipType: import("vue-types").VueTypeDef<IOverflowTooltip> & {
|
67
|
+
default: () => IOverflowTooltip;
|
68
|
+
};
|
52
69
|
export type ISortOption = {
|
53
70
|
[key: string]: SORT_OPTION;
|
54
71
|
};
|
72
|
+
export declare const ISortType: import("vue-types").VueTypeDef<ISortPropShape> & {
|
73
|
+
default: string | boolean | (() => ISortShape);
|
74
|
+
};
|
75
|
+
export type ISortShape = {
|
76
|
+
sortFn?: Function;
|
77
|
+
sortScope?: SortScope;
|
78
|
+
value?: SORT_OPTION;
|
79
|
+
};
|
80
|
+
export type ISortPropShape = ISortShape | boolean | string;
|
81
|
+
export type IFilterShape = {
|
82
|
+
list: any[];
|
83
|
+
filterFn?: Function;
|
84
|
+
match?: FullEnum;
|
85
|
+
checked?: any[];
|
86
|
+
filterScope?: SortScope;
|
87
|
+
btnSave?: boolean | string;
|
88
|
+
btnReset?: boolean | string;
|
89
|
+
};
|
90
|
+
export type IFilterPropShape = IFilterShape | boolean | string;
|
91
|
+
export declare const IFilterType: import("vue-types").VueTypeDef<IFilterPropShape> & {
|
92
|
+
default: string | boolean | (() => IFilterShape);
|
93
|
+
};
|
55
94
|
export declare enum ColumnPickEnum {
|
56
95
|
MULTI = "multi",
|
57
96
|
SINGLE = "single",
|
@@ -61,67 +100,94 @@ export declare enum ResizerWay {
|
|
61
100
|
DEBOUNCE = "debounce",
|
62
101
|
THROTTLE = "throttle"
|
63
102
|
}
|
64
|
-
export declare const IColumnType:
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
103
|
+
export declare const IColumnType: import("vue-types").VueTypeDef<Column>;
|
104
|
+
export declare const ITableSettings: import("vue-types").VueTypeDef<ISettingPropType> & {
|
105
|
+
default: boolean | (() => Settings);
|
106
|
+
};
|
107
|
+
/**
|
108
|
+
* 配置自定义行高选项
|
109
|
+
*/
|
110
|
+
export type SizeItem = {
|
111
|
+
value?: string;
|
112
|
+
label?: string;
|
113
|
+
height?: number;
|
114
|
+
};
|
115
|
+
export type Settings = {
|
116
|
+
fields?: Field[];
|
117
|
+
checked?: string[];
|
118
|
+
limit?: number;
|
119
|
+
size?: string;
|
120
|
+
sizeList?: SizeItem[];
|
121
|
+
showLineHeight?: boolean;
|
122
|
+
};
|
123
|
+
export type ISettingPropType = Settings | boolean;
|
124
|
+
export type Field = {
|
125
|
+
label: string;
|
126
|
+
field?: string;
|
127
|
+
disabled?: boolean;
|
128
|
+
id?: string;
|
129
|
+
name?: string;
|
130
|
+
};
|
131
|
+
export type Column = {
|
132
|
+
label: Function | string;
|
133
|
+
field?: Function | string;
|
134
|
+
render?: Function | string | Slot;
|
135
|
+
width?: number | string;
|
136
|
+
minWidth?: number | string;
|
137
|
+
columnKey?: string;
|
138
|
+
showOverflowTooltip?: boolean | IOverflowTooltip;
|
139
|
+
type?: string;
|
140
|
+
fixed?: string | boolean;
|
141
|
+
resizable?: boolean;
|
142
|
+
sort?: ISortShape | boolean | string;
|
143
|
+
filter?: IFilterShape | boolean | string;
|
144
|
+
colspan?: Function | Number;
|
145
|
+
rowspan?: Function | Number;
|
146
|
+
textAlign?: String;
|
147
|
+
className?: string | Function;
|
148
|
+
align?: string;
|
149
|
+
prop?: string;
|
150
|
+
index?: Number;
|
151
|
+
};
|
152
|
+
export declare const IColumnProp: import("vue-types").VueTypeDef<Column> & {
|
153
|
+
default: () => Column;
|
154
|
+
};
|
155
|
+
export type Thead = {
|
156
|
+
height?: Number;
|
157
|
+
isShow?: boolean;
|
158
|
+
cellFn?: Function;
|
159
|
+
color?: IHeadColor | string;
|
160
|
+
};
|
161
|
+
export type Columns = ReadonlyArray<Column>;
|
162
|
+
export type TablePropTypes = Readonly<ExtractPropTypes<typeof tableProps>>;
|
163
|
+
export type GroupColumn = {
|
164
|
+
calcWidth?: number;
|
165
|
+
resizeWidth?: number;
|
166
|
+
isHidden?: boolean;
|
167
|
+
listeners?: Map<string, any>;
|
168
|
+
} & Column;
|
169
|
+
export type IColumnActive = {
|
170
|
+
index: number;
|
171
|
+
active: boolean;
|
172
|
+
};
|
173
|
+
export type IReactiveProp = {
|
174
|
+
activeColumns: IColumnActive[];
|
175
|
+
rowActions: Record<string, any>;
|
176
|
+
scrollTranslateY: Number;
|
177
|
+
scrollTranslateX: Number;
|
178
|
+
pos: Record<string, any>;
|
179
|
+
settings: Settings | boolean;
|
180
|
+
setting: {
|
181
|
+
size: string;
|
182
|
+
height: Number;
|
118
183
|
};
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
184
|
+
defaultSort: Record<string, any>;
|
185
|
+
};
|
186
|
+
export type Colgroups = Column & {
|
187
|
+
calcWidth: number;
|
188
|
+
resizeWidth: number;
|
189
|
+
listeners: Map<string, Function>;
|
123
190
|
};
|
124
|
-
export type TableColumnProps = Partial<ExtractPropTypes<typeof IColumnType>>;
|
125
191
|
export declare const tableProps: {
|
126
192
|
/**
|
127
193
|
* 渲染列表
|
@@ -156,6 +222,14 @@ export declare const tableProps: {
|
|
156
222
|
height: import("vue-types").VueTypeDef<string | number> & {
|
157
223
|
default: string | number;
|
158
224
|
};
|
225
|
+
/**
|
226
|
+
* 是否为斑马纹 Table
|
227
|
+
*/
|
228
|
+
stripe: import("vue-types").VueTypeValidableDef<boolean> & {
|
229
|
+
default: boolean;
|
230
|
+
} & {
|
231
|
+
default: boolean;
|
232
|
+
};
|
159
233
|
/**
|
160
234
|
* 设置表格最小高度
|
161
235
|
* 默认:300
|
@@ -196,7 +270,9 @@ export declare const tableProps: {
|
|
196
270
|
/**
|
197
271
|
* table header config
|
198
272
|
*/
|
199
|
-
thead: import("vue-types").
|
273
|
+
thead: import("vue-types").VueTypeDef<Thead> & {
|
274
|
+
default: () => Thead;
|
275
|
+
};
|
200
276
|
/**
|
201
277
|
* 是否启用虚拟渲染 & 滚动
|
202
278
|
* 当数据量很大时,启用虚拟渲染可以解决压面卡顿问题
|
@@ -253,22 +329,8 @@ export declare const tableProps: {
|
|
253
329
|
/**
|
254
330
|
* bk-table-setting-content
|
255
331
|
*/
|
256
|
-
settings: import("vue-types").VueTypeDef<
|
257
|
-
|
258
|
-
checked: string[] | (() => string[]);
|
259
|
-
limit: number;
|
260
|
-
size: "small" | "medium" | "large";
|
261
|
-
sizeList: SizeItem[] | (object & (() => SizeItem[]));
|
262
|
-
showLineHeight: (boolean | object | (() => boolean) | ((props: Record<string, unknown>) => boolean)) & boolean;
|
263
|
-
}> & {
|
264
|
-
default: boolean | (() => {
|
265
|
-
fields: Field[] | (() => Field[]);
|
266
|
-
checked: string[] | (() => string[]);
|
267
|
-
limit: number;
|
268
|
-
size: "small" | "medium" | "large";
|
269
|
-
sizeList: SizeItem[] | (object & (() => SizeItem[]));
|
270
|
-
showLineHeight: (boolean | object | (() => boolean) | ((props: Record<string, unknown>) => boolean)) & boolean;
|
271
|
-
});
|
332
|
+
settings: import("vue-types").VueTypeDef<ISettingPropType> & {
|
333
|
+
default: boolean | (() => Settings);
|
272
334
|
};
|
273
335
|
/**
|
274
336
|
* 行的 class 的回调方法,也可以使用一个固定的 Object 为所有行设置一样的 Style
|
@@ -346,8 +408,13 @@ export declare const tableProps: {
|
|
346
408
|
* 当内容过长被隐藏时显示 tooltip, 此处为全局配置, 如果只配置此处,整个table都启用
|
347
409
|
* column内部可以单个配置覆盖此配置
|
348
410
|
*/
|
349
|
-
showOverflowTooltip: import("vue-types").VueTypeDef<
|
350
|
-
default: boolean | (() =>
|
411
|
+
showOverflowTooltip: import("vue-types").VueTypeDef<IOverflowTooltipProp> & {
|
412
|
+
default: boolean | (() => {
|
413
|
+
content: string | Function;
|
414
|
+
disabled?: boolean;
|
415
|
+
watchCellResize?: boolean;
|
416
|
+
mode?: `${OverflowModeEnum}`;
|
417
|
+
});
|
351
418
|
};
|
352
419
|
/**
|
353
420
|
* 为避免不必要的数据修改导致的不可控组件更新
|
@@ -409,83 +476,3 @@ export declare const tableProps: {
|
|
409
476
|
default: () => import("vue").CSSProperties;
|
410
477
|
};
|
411
478
|
};
|
412
|
-
/**
|
413
|
-
* 配置自定义行高选项
|
414
|
-
*/
|
415
|
-
export type SizeItem = {
|
416
|
-
value?: string;
|
417
|
-
label?: string;
|
418
|
-
height?: number;
|
419
|
-
};
|
420
|
-
export type Settings = {
|
421
|
-
fields?: Field[];
|
422
|
-
checked?: string[];
|
423
|
-
limit?: number;
|
424
|
-
size?: string;
|
425
|
-
sizeList?: SizeItem[];
|
426
|
-
showLineHeight?: boolean;
|
427
|
-
};
|
428
|
-
export type Field = {
|
429
|
-
label: string;
|
430
|
-
field?: string;
|
431
|
-
disabled?: boolean;
|
432
|
-
};
|
433
|
-
export type Column = {
|
434
|
-
label: Function | string;
|
435
|
-
field?: Function | string;
|
436
|
-
render?: Function | string | Slot;
|
437
|
-
width?: number | string;
|
438
|
-
minWidth?: number | string;
|
439
|
-
columnKey?: string;
|
440
|
-
showOverflowTooltip?: boolean | IOverflowTooltip;
|
441
|
-
type?: string;
|
442
|
-
fixed?: string | boolean;
|
443
|
-
resizable?: boolean;
|
444
|
-
sort?: {
|
445
|
-
sortFn?: Function;
|
446
|
-
sortScope?: string;
|
447
|
-
value?: string;
|
448
|
-
} | boolean | string;
|
449
|
-
filter?: {
|
450
|
-
list?: any;
|
451
|
-
filterFn?: Function;
|
452
|
-
checked?: any;
|
453
|
-
} | boolean | string;
|
454
|
-
colspan?: Function | Number;
|
455
|
-
rowspan?: Function | Number;
|
456
|
-
textAlign?: String;
|
457
|
-
className?: string | Function;
|
458
|
-
align?: string;
|
459
|
-
};
|
460
|
-
export type Thead = {
|
461
|
-
height?: Number;
|
462
|
-
isShow?: boolean;
|
463
|
-
cellFn?: Function;
|
464
|
-
};
|
465
|
-
export type GroupColumn = {
|
466
|
-
calcWidth?: number;
|
467
|
-
resizeWidth?: number;
|
468
|
-
isHidden?: boolean;
|
469
|
-
listeners?: Map<string, any>;
|
470
|
-
} & Column;
|
471
|
-
export type Columns = ReadonlyArray<Column>;
|
472
|
-
export type TablePropTypes = Readonly<ExtractPropTypes<typeof tableProps>>;
|
473
|
-
export type IColumnActive = {
|
474
|
-
index: number;
|
475
|
-
active: boolean;
|
476
|
-
};
|
477
|
-
export type IReactiveProp = {
|
478
|
-
activeColumns: IColumnActive[];
|
479
|
-
rowActions: Record<string, any>;
|
480
|
-
scrollTranslateY: Number;
|
481
|
-
scrollTranslateX: Number;
|
482
|
-
pos: Record<string, any>;
|
483
|
-
settings: any;
|
484
|
-
setting: any;
|
485
|
-
defaultSort: Record<string, any>;
|
486
|
-
};
|
487
|
-
export type Colgroups = Column & {
|
488
|
-
calcWidth: number;
|
489
|
-
resizeWidth: number;
|
490
|
-
listeners: Map<string, Function>;
|
491
|
-
};
|
package/lib/table/render.d.ts
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
import { ComputedRef, Ref } from 'vue';
|
1
|
+
import { ComputedRef, Ref, SetupContext } from 'vue';
|
2
2
|
import type { Language } from '../locale';
|
3
3
|
import { TablePlugins } from './plugins';
|
4
4
|
import { GroupColumn, IColumnActive, IReactiveProp, TablePropTypes } from './props';
|
5
5
|
export default class TableRender {
|
6
6
|
props: TablePropTypes;
|
7
|
-
context:
|
8
|
-
reactiveProp:
|
7
|
+
context: SetupContext;
|
8
|
+
reactiveProp: IReactiveProp;
|
9
9
|
colgroups: GroupColumn[];
|
10
10
|
uuid: string;
|
11
11
|
events: Map<string, any[]>;
|
@@ -26,7 +26,9 @@ export default class TableRender {
|
|
26
26
|
* @param rows 表格数据
|
27
27
|
* @returns
|
28
28
|
*/
|
29
|
-
renderTableBodySchema(rows: any[]):
|
29
|
+
renderTableBodySchema(rows: any[]): import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
30
|
+
[key: string]: any;
|
31
|
+
}>[] | JSX.Element;
|
30
32
|
renderTableFooter(options: any): JSX.Element;
|
31
33
|
getRowHeight: (row?: any, rowIndex?: number) => any;
|
32
34
|
/**
|
package/lib/table/table.css
CHANGED
@@ -1004,6 +1004,12 @@
|
|
1004
1004
|
.bk-table .bk-table-body .prepend-row {
|
1005
1005
|
transform: translateX(var(--prepend-left));
|
1006
1006
|
}
|
1007
|
+
.bk-table .bk-table-body-content.bk-stripe table tbody tr:nth-child(even) td {
|
1008
|
+
background-color: #FAFBFD;
|
1009
|
+
}
|
1010
|
+
.bk-table .bk-table-body-content.bk-stripe table tbody tr td {
|
1011
|
+
border-bottom: none;
|
1012
|
+
}
|
1007
1013
|
.bk-table .bk-fixed-bottom-border {
|
1008
1014
|
position: sticky;
|
1009
1015
|
bottom: 0;
|
@@ -1044,6 +1050,7 @@
|
|
1044
1050
|
width: 100%;
|
1045
1051
|
height: 100%;
|
1046
1052
|
padding-bottom: 20px;
|
1053
|
+
position: relative;
|
1047
1054
|
}
|
1048
1055
|
.bk-table .bk-table-head table,
|
1049
1056
|
.bk-table .bk-table-body table {
|
@@ -1059,6 +1066,7 @@
|
|
1059
1066
|
height: var(--row-height);
|
1060
1067
|
min-width: 30px;
|
1061
1068
|
clear: both;
|
1069
|
+
background-color: #fff;
|
1062
1070
|
}
|
1063
1071
|
.bk-table .bk-table-head table th.expand-row .expand-btn-action,
|
1064
1072
|
.bk-table .bk-table-body table th.expand-row .expand-btn-action,
|
@@ -1123,7 +1131,6 @@
|
|
1123
1131
|
.bk-table .bk-table-body table td.column_fixed {
|
1124
1132
|
position: sticky;
|
1125
1133
|
z-index: 1;
|
1126
|
-
background: #fff;
|
1127
1134
|
}
|
1128
1135
|
.bk-table .bk-table-head table th.column_fixed.column_fixed_left,
|
1129
1136
|
.bk-table .bk-table-body table th.column_fixed.column_fixed_left,
|
@@ -1240,6 +1247,9 @@
|
|
1240
1247
|
width: 1rem;
|
1241
1248
|
height: 1rem;
|
1242
1249
|
}
|
1250
|
+
.bk-table .bk-table-head .bk-table-fixed .column_fixed.column_fixed_right.shadow {
|
1251
|
+
box-shadow: -2px 2px 10px 0px rgba(0, 0, 0, 0.12);
|
1252
|
+
}
|
1243
1253
|
.bk-table .bk-table-footer {
|
1244
1254
|
height: var(--footer-height);
|
1245
1255
|
line-height: var(--footer-height);
|
@@ -1291,12 +1301,13 @@
|
|
1291
1301
|
position: absolute;
|
1292
1302
|
top: 0;
|
1293
1303
|
right: 0;
|
1294
|
-
bottom:
|
1304
|
+
bottom: 0;
|
1295
1305
|
left: 0;
|
1296
1306
|
pointer-events: none;
|
1297
1307
|
}
|
1298
1308
|
.bk-table .bk-table-fixed .column_fixed {
|
1299
1309
|
position: absolute;
|
1310
|
+
transform: translate(var(--var-scroll-left), var(--var-scroll-top));
|
1300
1311
|
}
|
1301
1312
|
.bk-table .bk-table-fixed .column_fixed.column_fixed_left {
|
1302
1313
|
top: 0;
|
@@ -1331,3 +1342,6 @@
|
|
1331
1342
|
.bk-table .bk-pagination .is-last {
|
1332
1343
|
margin-left: auto;
|
1333
1344
|
}
|
1345
|
+
.bk-table .stripe-row {
|
1346
|
+
background: #FAFBFD;
|
1347
|
+
}
|