bkui-vue 0.0.2-beta.8 → 0.0.2-table-refactor.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +70 -62
- package/dist/index.esm.js +16711 -16319
- package/dist/index.umd.js +72 -64
- package/dist/locale/en.esm.js +1 -1
- package/dist/locale/en.esm.js.map +1 -1
- package/dist/locale/en.umd.js +1 -1
- package/dist/locale/en.umd.js.map +1 -1
- package/dist/locale/zh-cn.esm.js +1 -1
- package/dist/locale/zh-cn.esm.js.map +1 -1
- package/dist/locale/zh-cn.umd.js +1 -1
- package/dist/locale/zh-cn.umd.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/style.variable.css +1 -1
- package/lib/affix/affix.d.ts +1 -1
- package/lib/affix/index.d.ts +4 -4
- package/lib/alert/alert.css +7 -0
- package/lib/alert/alert.d.ts +5 -5
- package/lib/alert/alert.less +16 -6
- package/lib/alert/alert.variable.css +7 -0
- package/lib/alert/index.d.ts +10 -10
- package/lib/animate-number/index.d.ts +1 -1
- package/lib/backtop/index.d.ts +1 -1
- package/lib/badge/badge.d.ts +2 -2
- package/lib/badge/index.d.ts +7 -7
- package/lib/breadcrumb/index.d.ts +2 -2
- package/lib/button/button.css +20 -0
- package/lib/button/button.less +105 -94
- package/lib/button/button.variable.css +20 -0
- package/lib/button/index.d.ts +2 -2
- package/lib/card/card.d.ts +1 -1
- package/lib/card/index.d.ts +4 -4
- package/lib/cascader/cascader.d.ts +1 -0
- package/lib/cascader/index.d.ts +5 -2
- package/lib/cascader/index.js +1 -1
- package/lib/cascader/interface.d.ts +1 -1
- package/lib/checkbox/checkbox-group.d.ts +6 -3
- package/lib/checkbox/checkbox.d.ts +4 -4
- package/lib/checkbox/index.d.ts +22 -19
- package/lib/checkbox/index.js +1 -1
- package/lib/code-diff/index.d.ts +1 -1
- package/lib/collapse/index.d.ts +2 -2
- package/lib/collapse-transition/index.d.ts +128 -2
- package/lib/collapse-transition/index.js +1 -1
- package/lib/color-picker/color-picker.d.ts +16 -0
- package/lib/color-picker/components/recommend-colors.d.ts +16 -0
- package/lib/color-picker/index.d.ts +19 -1
- package/lib/color-picker/index.js +1 -1
- package/lib/components.d.ts +1 -1
- package/lib/config-provider/config-provider.d.ts +3 -0
- package/lib/config-provider/index.d.ts +5 -1
- package/lib/config-provider/index.js +1 -1
- package/lib/config-provider/token.d.ts +1 -0
- package/lib/config-provider/use-global-config.d.ts +2 -0
- package/lib/config-provider/use-prefix.d.ts +2 -0
- package/lib/container/index.d.ts +2 -2
- package/lib/container/index.js +1 -1
- package/lib/date-picker/date-picker.d.ts +3 -1
- package/lib/date-picker/index.d.ts +12 -5
- package/lib/date-picker/index.js +1 -1
- package/lib/date-picker/panel/date-range.d.ts +2 -1
- package/lib/dialog/index.d.ts +1 -1
- package/lib/directives/index.js +1 -1
- package/lib/directives/tooltips.d.ts +3 -2
- package/lib/divider/index.d.ts +1 -1
- package/lib/dropdown/dropdown.css +1 -0
- package/lib/dropdown/dropdown.d.ts +1 -1
- package/lib/dropdown/dropdown.variable.css +1 -0
- package/lib/dropdown/index.d.ts +7 -7
- package/lib/exception/index.d.ts +2 -2
- package/lib/fixed-navbar/index.d.ts +1 -1
- package/lib/form/index.d.ts +3 -3
- package/lib/form/index.js +1 -1
- package/lib/hooks.d.ts +1 -1
- package/lib/hooks.js +1 -1
- package/lib/icon/assistant.d.ts +4 -0
- package/lib/icon/assistant.js +1 -0
- package/lib/icon/index.d.ts +1 -0
- package/lib/icon/index.js +1 -1
- package/lib/image/index.d.ts +1 -1
- package/lib/image/index.js +1 -1
- package/lib/info-box/index.js +1 -1
- package/lib/input/index.d.ts +146 -50
- package/lib/input/index.js +2 -1
- package/lib/input/index.js.LICENSE.txt +1 -0
- package/lib/input/input.css +34 -6
- package/lib/input/input.d.ts +100 -11
- package/lib/input/input.less +53 -14
- package/lib/input/input.variable.css +34 -6
- package/lib/input/util.d.ts +6 -0
- package/lib/link/index.d.ts +4 -4
- package/lib/link/link.d.ts +1 -1
- package/lib/loading/index.d.ts +2 -2
- package/lib/locale/index.js +1 -1
- package/lib/locale/lang/en.d.ts +1 -0
- package/lib/menu/index.d.ts +2 -2
- package/lib/message/index.js +1 -1
- package/lib/message/message.css +33 -9
- package/lib/message/message.less +78 -54
- package/lib/message/message.variable.css +33 -9
- package/lib/message/messageConstructor.d.ts +30 -8
- package/lib/modal/index.d.ts +2 -2
- package/lib/modal/index.js +1 -1
- package/lib/navigation/index.d.ts +4 -1
- package/lib/navigation/index.js +1 -1
- package/lib/navigation/navigation.d.ts +1 -0
- package/lib/notify/index.js +1 -1
- package/lib/notify/notifyConstructor.d.ts +1 -1
- package/lib/overflow-title/components/overflow-title.d.ts +257 -1
- package/lib/overflow-title/index.d.ts +387 -2
- package/lib/overflow-title/index.js +1 -1
- package/lib/overflow-title/props.d.ts +129 -0
- package/lib/pagination/index.d.ts +2 -2
- package/lib/plugin-popover/index.js +1 -1
- package/lib/pop-confirm/index.d.ts +1 -1
- package/lib/popover/const.d.ts +22 -9
- package/lib/popover/content.d.ts +33 -0
- package/lib/popover/index.d.ts +154 -61
- package/lib/popover/index.js +1 -1
- package/lib/popover/popover.css +1 -0
- package/lib/popover/popover.d.ts +64 -23
- package/lib/popover/popover.less +3 -2
- package/lib/popover/popover.variable.css +1 -0
- package/lib/popover/props.d.ts +29 -4
- package/lib/popover/use-floating.d.ts +2 -2
- package/lib/popover/use-popover-init.d.ts +2 -1
- package/lib/popover2/index.d.ts +1 -1
- package/lib/preset.d.ts +2 -0
- package/lib/process/index.d.ts +1 -1
- package/lib/progress/index.d.ts +1 -1
- package/lib/radio/index.d.ts +23 -23
- package/lib/radio/radio-button.d.ts +4 -4
- package/lib/radio/radio-group.d.ts +4 -4
- package/lib/radio/radio.d.ts +4 -4
- package/lib/rate/index.d.ts +8 -4
- package/lib/rate/index.js +1 -1
- package/lib/rate/rate.d.ts +2 -1
- package/lib/resize-layout/index.d.ts +4 -4
- package/lib/resize-layout/index.js +1 -1
- package/lib/resize-layout/resize-layout.css +12 -0
- package/lib/resize-layout/resize-layout.d.ts +1 -1
- package/lib/resize-layout/resize-layout.less +12 -0
- package/lib/resize-layout/resize-layout.variable.css +12 -0
- package/lib/search-select/index.d.ts +62 -29
- package/lib/search-select/index.js +1 -1
- package/lib/search-select/input.d.ts +5 -1
- package/lib/search-select/menu.d.ts +33 -2
- package/lib/search-select/search-select.css +31 -11
- package/lib/search-select/search-select.d.ts +23 -20
- package/lib/search-select/search-select.less +29 -10
- package/lib/search-select/search-select.variable.css +31 -11
- package/lib/search-select/selected.d.ts +5 -1
- package/lib/search-select/utils.d.ts +13 -5
- package/lib/select/index.d.ts +180 -84
- package/lib/select/index.js +1 -1
- package/lib/select/option.d.ts +11 -0
- package/lib/select/select.css +9 -1
- package/lib/select/select.d.ts +75 -37
- package/lib/select/select.less +11 -1
- package/lib/select/select.variable.css +9 -1
- package/lib/select/selectTagInput.d.ts +8 -5
- package/lib/shared/helper.d.ts +1 -1
- package/lib/shared/index.js +1 -1
- package/lib/shared/mask-manager.d.ts +3 -4
- package/lib/shared/pop-manager.d.ts +6 -2
- package/lib/shared/popover.d.ts +2 -2
- package/lib/shared/vue-types.d.ts +3 -2
- package/lib/sideslider/index.d.ts +1 -1
- package/lib/slider/index.d.ts +1 -1
- package/lib/slider/index.js +1 -1
- package/lib/steps/index.d.ts +1 -1
- package/lib/steps/index.js +1 -1
- package/lib/styles/mixins/popper.less +6 -5
- package/lib/swiper/index.d.ts +1 -1
- package/lib/swiper/index.js +1 -1
- package/lib/swiper/swiper.css +0 -6
- package/lib/swiper/swiper.less +0 -8
- package/lib/swiper/swiper.variable.css +0 -6
- package/lib/switcher/index.d.ts +30 -16
- package/lib/switcher/index.js +1 -1
- package/lib/switcher/switcher.d.ts +74 -5
- package/lib/tab/index.d.ts +3 -3
- package/lib/tab/tab-nav.d.ts +12 -2
- package/lib/tab/tab-panel.d.ts +1 -1
- package/lib/table/components/table-cell.d.ts +22 -15
- package/lib/table/components/table-column.d.ts +154 -219
- package/lib/table/const.d.ts +34 -56
- package/lib/table/events.d.ts +180 -0
- package/lib/table/index.d.ts +746 -440
- package/lib/table/index.js +1 -1
- package/lib/table/plugins/head-filter.css +3 -0
- package/lib/table/plugins/head-filter.d.ts +3 -7
- package/lib/table/plugins/head-filter.less +3 -0
- package/lib/table/plugins/head-filter.variable.css +3 -0
- package/lib/table/plugins/head-sort.d.ts +3 -7
- package/lib/table/plugins/settings.d.ts +12 -26
- package/lib/table/plugins/use-column-resize.d.ts +30 -10
- package/lib/table/plugins/use-fixed-column.d.ts +7 -5
- package/lib/table/plugins/use-pagination.d.ts +7 -4
- package/lib/table/props.d.ts +219 -181
- package/lib/table/render.d.ts +12 -20
- package/lib/table/table.css +85 -5
- package/lib/table/table.d.ts +227 -104
- package/lib/table/table.less +75 -8
- package/lib/table/table.variable.css +85 -5
- package/lib/table/use-attributes.d.ts +55 -0
- package/lib/table/use-column.d.ts +175 -3
- package/lib/table/use-common.d.ts +1609 -76
- package/lib/table/use-render.d.ts +11 -0
- package/lib/table/utils.d.ts +30 -28
- package/lib/table-column/index.d.ts +237 -527
- package/lib/table-column/index.js +1 -1
- package/lib/tag/index.d.ts +10 -10
- package/lib/tag/index.js +1 -1
- package/lib/tag/tag.d.ts +5 -5
- package/lib/tag-input/index.d.ts +49 -13
- package/lib/tag-input/index.js +1 -1
- package/lib/tag-input/tag-input.css +6 -1
- package/lib/tag-input/tag-input.d.ts +46 -10
- package/lib/tag-input/tag-input.less +9 -4
- package/lib/tag-input/tag-input.variable.css +6 -1
- package/lib/tag-input/tag-props.d.ts +16 -4
- package/lib/time-picker/index.d.ts +1 -1
- package/lib/timeline/index.d.ts +1 -1
- package/lib/transfer/index.d.ts +1 -1
- package/lib/tree/constant.d.ts +2 -2
- package/lib/tree/index.d.ts +37 -7
- package/lib/tree/index.js +1 -1
- package/lib/tree/props.d.ts +8 -1
- package/lib/tree/tree.d.ts +20 -2
- package/lib/tree/use-node-action.d.ts +3 -2
- package/lib/tree/use-node-attribute.d.ts +15 -8
- package/lib/tree/use-tree-init.d.ts +1 -2
- package/lib/tree/util.d.ts +7 -2
- package/lib/upload/index.d.ts +1 -1
- package/lib/virtual-render/index.d.ts +43 -1
- package/lib/virtual-render/index.js +1 -1
- package/lib/virtual-render/props.d.ts +15 -0
- package/lib/virtual-render/v-virtual-render.d.ts +1 -0
- package/lib/virtual-render/virtual-render.d.ts +27 -2
- package/lib/volar.components.d.ts +24 -24
- package/package.json +17 -16
@@ -1,22 +1,24 @@
|
|
1
|
-
import {
|
1
|
+
import { Column, TablePropTypes } from '../props';
|
2
|
+
import { ITableResponse } from '../use-attributes';
|
2
3
|
/**
|
3
4
|
* 固定列Hooks
|
4
5
|
*/
|
5
|
-
declare const _default: (
|
6
|
+
declare const _default: (props: TablePropTypes, tableResp: ITableResponse, hasScrollY?: any) => {
|
6
7
|
fixedWrapperClass: string;
|
7
|
-
resolveFixedColumnStyle: (column:
|
8
|
+
resolveFixedColumnStyle: (column: Column, hasScrollY?: boolean) => {
|
8
9
|
[x: string]: string;
|
9
10
|
};
|
10
11
|
fixedColumns: import("vue").ComputedRef<{
|
11
12
|
isExist: boolean;
|
12
13
|
colPos: string;
|
13
|
-
column:
|
14
|
+
column: Column;
|
14
15
|
}[]>;
|
15
16
|
resolveColumnStyle: (colPos: string) => {
|
16
17
|
width: string;
|
18
|
+
backgroundColor: string;
|
17
19
|
bottom: string;
|
18
20
|
};
|
19
|
-
resolveColumnClass: (column:
|
21
|
+
resolveColumnClass: (column: Column, scrollX?: any, offsetRight?: any) => {
|
20
22
|
column_fixed: boolean;
|
21
23
|
column_fixed_left: boolean;
|
22
24
|
column_fixed_right: boolean;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { TablePropTypes } from '../props';
|
1
|
+
import { Column, SortScope, TablePropTypes } from '../props';
|
2
2
|
/**
|
3
3
|
* 处理 Prop中的分页配置
|
4
4
|
* prop中的配置会覆盖本地的配置
|
@@ -7,10 +7,13 @@ import { TablePropTypes } from '../props';
|
|
7
7
|
* @returns 返回值
|
8
8
|
*/
|
9
9
|
export declare const resolvePaginationOption: (propPagination: any, defVal: any) => any;
|
10
|
-
declare const _default: (props: TablePropTypes
|
10
|
+
declare const _default: (props: TablePropTypes) => {
|
11
11
|
pageData: any[];
|
12
|
+
indexData: import("vue").ComputedRef<any[]>;
|
12
13
|
localPagination: any;
|
13
|
-
resolvePageData: (filterFn
|
14
|
-
|
14
|
+
resolvePageData: (filterFn?: any, sortFn?: any, column?: Column, type?: string, sortScope?: any) => void;
|
15
|
+
resetStartEndIndex: () => void;
|
16
|
+
multiFilter: (filterFnList: ((row: any, index: any, data: any) => void)[]) => void;
|
17
|
+
sort: (sourceData: any[], sortFn: any, column: Column, type: string, sortScope: SortScope) => void;
|
15
18
|
};
|
16
19
|
export default _default;
|
package/lib/table/props.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import { ExtractPropTypes
|
2
|
-
import { ROW_HOVER, SORT_OPTION } from './const';
|
1
|
+
import { ExtractPropTypes } from 'vue';
|
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",
|
@@ -43,15 +43,38 @@ export declare enum FixedEnum {
|
|
43
43
|
RIGHT = "right"
|
44
44
|
}
|
45
45
|
export declare const fixedType: import("vue-types").VueTypeValidableDef<"right" | "left">;
|
46
|
-
export type
|
46
|
+
export type IOverflowTooltipProp = {
|
47
47
|
content: string | Function;
|
48
|
-
disabled?: boolean;
|
48
|
+
disabled?: (col: Column, row: any) => boolean | boolean;
|
49
49
|
watchCellResize?: boolean;
|
50
50
|
mode?: `${OverflowModeEnum}`;
|
51
|
-
|
51
|
+
popoverOption?: any;
|
52
|
+
resizerWay?: ResizerWay;
|
53
|
+
} | boolean;
|
54
|
+
export type IOverflowTooltip = IOverflowTooltipProp;
|
55
|
+
export declare const IOverflowTooltipPropType: import("vue-types").VueTypeDef<IOverflowTooltipProp>;
|
52
56
|
export type ISortOption = {
|
53
57
|
[key: string]: SORT_OPTION;
|
54
58
|
};
|
59
|
+
export declare const ISortType: import("vue-types").VueTypeDef<ISortPropShape>;
|
60
|
+
export type ISortShape = {
|
61
|
+
sortFn?: Function;
|
62
|
+
sortScope?: SortScope;
|
63
|
+
value?: SORT_OPTION;
|
64
|
+
};
|
65
|
+
export type ISortPropShape = ISortShape | boolean | string;
|
66
|
+
export type IFilterShape = {
|
67
|
+
list: any[];
|
68
|
+
filterFn?: Function;
|
69
|
+
match?: FullEnum;
|
70
|
+
checked?: any[];
|
71
|
+
filterScope?: SortScope;
|
72
|
+
btnSave?: boolean | string;
|
73
|
+
btnReset?: boolean | string;
|
74
|
+
maxHeight?: number;
|
75
|
+
};
|
76
|
+
export type IFilterPropShape = IFilterShape | boolean | string;
|
77
|
+
export declare const IFilterType: import("vue-types").VueTypeDef<IFilterPropShape>;
|
55
78
|
export declare enum ColumnPickEnum {
|
56
79
|
MULTI = "multi",
|
57
80
|
SINGLE = "single",
|
@@ -61,67 +84,137 @@ export declare enum ResizerWay {
|
|
61
84
|
DEBOUNCE = "debounce",
|
62
85
|
THROTTLE = "throttle"
|
63
86
|
}
|
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
|
-
|
87
|
+
export declare const IColumnType: import("vue-types").VueTypeDef<Column>;
|
88
|
+
export declare const ITableSettings: import("vue-types").VueTypeDef<ISettingPropType>;
|
89
|
+
/**
|
90
|
+
* 配置自定义行高选项
|
91
|
+
*/
|
92
|
+
export type SizeItem = {
|
93
|
+
value?: string;
|
94
|
+
label?: string;
|
95
|
+
height?: number;
|
96
|
+
};
|
97
|
+
export type Settings = {
|
98
|
+
fields?: Field[];
|
99
|
+
checked?: string[];
|
100
|
+
limit?: number;
|
101
|
+
size?: string;
|
102
|
+
sizeList?: SizeItem[];
|
103
|
+
showLineHeight?: boolean;
|
104
|
+
};
|
105
|
+
export type ISettingPropType = Settings | boolean;
|
106
|
+
export type Field = {
|
107
|
+
label: string;
|
108
|
+
field?: string;
|
109
|
+
disabled?: boolean;
|
110
|
+
id?: string;
|
111
|
+
name?: string;
|
112
|
+
};
|
113
|
+
export type LabelFunctionString = ((_column: any, _index: any) => string | number | boolean | JSX.Element) | string | number | boolean;
|
114
|
+
export declare const LabelFunctionStringType: import("vue-types").VueTypeDef<LabelFunctionString>;
|
115
|
+
export type RenderFunctionString = ({ cell, data, row, column, index, rows, }: {
|
116
|
+
cell: any;
|
117
|
+
data: any;
|
118
|
+
row: any;
|
119
|
+
column: any;
|
120
|
+
index: any;
|
121
|
+
rows: any;
|
122
|
+
}) => string | number | boolean | JSX.Element;
|
123
|
+
export declare const RenderFunctionStringType: import("vue-types").VueTypeDef<RenderFunctionString>;
|
124
|
+
export type SpanFunctionString = (({ column, colIndex, row, rowIndex }: {
|
125
|
+
column: any;
|
126
|
+
colIndex: any;
|
127
|
+
row: any;
|
128
|
+
rowIndex: any;
|
129
|
+
}) => number) | Number;
|
130
|
+
export declare const SpanFunctionStringType: import("vue-types").VueTypeDef<SpanFunctionString>;
|
131
|
+
export type RowClassFunctionString = ((row: any) => string) | string;
|
132
|
+
export declare const RowClassFunctionStringType: import("vue-types").VueTypeDef<RowClassFunctionString>;
|
133
|
+
export type RowHeightFunctionNumber = ((_type: string, _row: any, _rowIndex: number, _size?: any) => number) | number;
|
134
|
+
export declare const RowHeightFunctionNumberType: import("vue-types").VueTypeDef<RowHeightFunctionNumber>;
|
135
|
+
type FunctionNumber = Function | number;
|
136
|
+
export declare const FunctionNumberType: import("vue-types").VueTypeDef<FunctionNumber>;
|
137
|
+
type StringNumber = string | number;
|
138
|
+
export declare const StringNumberType: (val: number | string) => import("vue-types").VueTypeDef<StringNumber> & {
|
139
|
+
default: StringNumber;
|
140
|
+
};
|
141
|
+
/**
|
142
|
+
* 表格字段解释说明
|
143
|
+
*/
|
144
|
+
export type IColumnExplain = {
|
145
|
+
content: LabelFunctionString;
|
146
|
+
head: LabelFunctionString | boolean;
|
147
|
+
} | boolean;
|
148
|
+
export type Column = {
|
149
|
+
label: LabelFunctionString;
|
150
|
+
field?: LabelFunctionString;
|
151
|
+
render?: RenderFunctionString;
|
152
|
+
renderHead?: RenderFunctionString;
|
153
|
+
width?: number | string;
|
154
|
+
minWidth?: number | string;
|
155
|
+
columnKey?: string;
|
156
|
+
showOverflowTooltip?: boolean | IOverflowTooltip;
|
157
|
+
type?: string;
|
158
|
+
fixed?: string | boolean;
|
159
|
+
resizable?: boolean;
|
160
|
+
sort?: ISortShape | boolean | string;
|
161
|
+
filter?: IFilterShape | boolean | string;
|
162
|
+
colspan?: SpanFunctionString;
|
163
|
+
rowspan?: SpanFunctionString;
|
164
|
+
textAlign?: string;
|
165
|
+
className?: RowClassFunctionString;
|
166
|
+
align?: string;
|
167
|
+
prop?: LabelFunctionString;
|
168
|
+
index?: Number;
|
169
|
+
explain?: IColumnExplain;
|
170
|
+
};
|
171
|
+
export declare const IColumnProp: import("vue-types").VueTypeDef<Column>;
|
172
|
+
export type Thead = {
|
173
|
+
height?: Number;
|
174
|
+
isShow?: boolean;
|
175
|
+
cellFn?: Function;
|
176
|
+
color?: IHeadColor | string;
|
177
|
+
};
|
178
|
+
export type Columns = ReadonlyArray<Column>;
|
179
|
+
export type TablePropTypes = Readonly<ExtractPropTypes<typeof tableProps>>;
|
180
|
+
export type GroupColumn = {
|
181
|
+
calcWidth?: number;
|
182
|
+
resizeWidth?: number;
|
183
|
+
isHidden?: boolean;
|
184
|
+
listeners?: Map<string, any>;
|
185
|
+
} & Column;
|
186
|
+
export type IColumnActive = {
|
187
|
+
index: number;
|
188
|
+
active: boolean;
|
189
|
+
};
|
190
|
+
export type IReactiveProp = {
|
191
|
+
activeColumns: IColumnActive[];
|
192
|
+
rowActions: Record<string, any>;
|
193
|
+
scrollTranslateY: Number;
|
194
|
+
scrollTranslateX: Number;
|
195
|
+
pos: Record<string, any>;
|
196
|
+
settings: Settings | boolean;
|
197
|
+
setting: {
|
198
|
+
size: string;
|
199
|
+
height: Number;
|
118
200
|
};
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
201
|
+
defaultSort: Record<string, any>;
|
202
|
+
};
|
203
|
+
export type Colgroups = Column & {
|
204
|
+
calcWidth: number;
|
205
|
+
resizeWidth: number;
|
206
|
+
listeners: Map<string, Function>;
|
123
207
|
};
|
124
|
-
export
|
208
|
+
export declare enum IColSortBehavior {
|
209
|
+
/**
|
210
|
+
* 列排序是相互依赖的
|
211
|
+
*/
|
212
|
+
interdependent = "interdependent",
|
213
|
+
/**
|
214
|
+
* 列与列之间的排序是独立的,互斥的
|
215
|
+
*/
|
216
|
+
independent = "independent"
|
217
|
+
}
|
125
218
|
export declare const tableProps: {
|
126
219
|
/**
|
127
220
|
* 渲染列表
|
@@ -153,29 +246,37 @@ export declare const tableProps: {
|
|
153
246
|
* 默认:auto 根据行数自动填充高度
|
154
247
|
* 100%,依赖初始化时父级容器高度
|
155
248
|
*/
|
156
|
-
height: import("vue-types").VueTypeDef<
|
157
|
-
default:
|
249
|
+
height: import("vue-types").VueTypeDef<StringNumber> & {
|
250
|
+
default: StringNumber;
|
251
|
+
};
|
252
|
+
/**
|
253
|
+
* 是否为斑马纹 Table
|
254
|
+
*/
|
255
|
+
stripe: import("vue-types").VueTypeValidableDef<boolean> & {
|
256
|
+
default: boolean;
|
257
|
+
} & {
|
258
|
+
default: boolean;
|
158
259
|
};
|
159
260
|
/**
|
160
261
|
* 设置表格最小高度
|
161
262
|
* 默认:300
|
162
263
|
*/
|
163
|
-
minHeight: import("vue-types").VueTypeDef<
|
164
|
-
default:
|
264
|
+
minHeight: import("vue-types").VueTypeDef<StringNumber> & {
|
265
|
+
default: StringNumber;
|
165
266
|
};
|
166
267
|
/**
|
167
268
|
* 设置表格最d大高度
|
168
269
|
* 默认:auto,依赖外层高度
|
169
270
|
*/
|
170
|
-
maxHeight: import("vue-types").VueTypeDef<
|
171
|
-
default:
|
271
|
+
maxHeight: import("vue-types").VueTypeDef<StringNumber> & {
|
272
|
+
default: StringNumber;
|
172
273
|
};
|
173
274
|
/**
|
174
275
|
* 行高,可以为固定数值类型
|
175
276
|
* 可以是函数,返回当前行的高度,返回值为数值类型
|
176
277
|
*/
|
177
|
-
rowHeight: import("vue-types").VueTypeDef<
|
178
|
-
default:
|
278
|
+
rowHeight: import("vue-types").VueTypeDef<RowHeightFunctionNumber> & {
|
279
|
+
default: RowHeightFunctionNumber;
|
179
280
|
};
|
180
281
|
/**
|
181
282
|
* Thead行高,可以为固定数值类型
|
@@ -196,14 +297,8 @@ export declare const tableProps: {
|
|
196
297
|
/**
|
197
298
|
* table header config
|
198
299
|
*/
|
199
|
-
thead: import("vue-types").
|
200
|
-
|
201
|
-
* 是否为斑马纹 Table
|
202
|
-
*/
|
203
|
-
stripe: import("vue-types").VueTypeValidableDef<boolean> & {
|
204
|
-
default: boolean;
|
205
|
-
} & {
|
206
|
-
default: boolean;
|
300
|
+
thead: import("vue-types").VueTypeDef<Thead> & {
|
301
|
+
default: () => Thead;
|
207
302
|
};
|
208
303
|
/**
|
209
304
|
* 是否启用虚拟渲染 & 滚动
|
@@ -252,6 +347,14 @@ export declare const tableProps: {
|
|
252
347
|
} & {
|
253
348
|
default: boolean;
|
254
349
|
};
|
350
|
+
/**
|
351
|
+
* 是否支持跨页全选
|
352
|
+
*/
|
353
|
+
acrossAll: import("vue-types").VueTypeValidableDef<boolean> & {
|
354
|
+
default: boolean;
|
355
|
+
} & {
|
356
|
+
default: boolean;
|
357
|
+
};
|
255
358
|
/**
|
256
359
|
* 空数据展示
|
257
360
|
*/
|
@@ -259,25 +362,15 @@ export declare const tableProps: {
|
|
259
362
|
default: string;
|
260
363
|
};
|
261
364
|
/**
|
262
|
-
*
|
365
|
+
* 单元格数据为空展示
|
263
366
|
*/
|
264
|
-
|
265
|
-
|
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
|
-
}> & {
|
272
|
-
default: boolean | (() => {
|
273
|
-
fields: Field[] | (() => Field[]);
|
274
|
-
checked: string[] | (() => string[]);
|
275
|
-
limit: number;
|
276
|
-
size: "small" | "medium" | "large";
|
277
|
-
sizeList: SizeItem[] | (object & (() => SizeItem[]));
|
278
|
-
showLineHeight: (boolean | object | (() => boolean) | ((props: Record<string, unknown>) => boolean)) & boolean;
|
279
|
-
});
|
367
|
+
emptyCellText: import("vue-types").VueTypeDef<any> & {
|
368
|
+
default: any;
|
280
369
|
};
|
370
|
+
/**
|
371
|
+
* bk-table-setting-content
|
372
|
+
*/
|
373
|
+
settings: import("vue-types").VueTypeDef<ISettingPropType>;
|
281
374
|
/**
|
282
375
|
* 行的 class 的回调方法,也可以使用一个固定的 Object 为所有行设置一样的 Style
|
283
376
|
*/
|
@@ -331,6 +424,17 @@ export declare const tableProps: {
|
|
331
424
|
} & {
|
332
425
|
default: string;
|
333
426
|
};
|
427
|
+
/**
|
428
|
+
* 默认选中行
|
429
|
+
* 仅对设置了selection的情况下生效
|
430
|
+
* 值可以为 [key1, key2, key3, ...] 或者 [row1, row2, row3, ...]
|
431
|
+
* 如果设置为key,则 selectionKey 必须设置,内部匹配逻辑为:row[selectionKey] === key
|
432
|
+
*/
|
433
|
+
checked: import("vue-types").VueTypeValidableDef<unknown[]> & {
|
434
|
+
default: () => unknown[];
|
435
|
+
} & {
|
436
|
+
default: () => unknown[];
|
437
|
+
};
|
334
438
|
/**
|
335
439
|
* 提供自定义判定当前行是否选中
|
336
440
|
* 如果设置了此属性,其他判定均不生效
|
@@ -354,9 +458,7 @@ export declare const tableProps: {
|
|
354
458
|
* 当内容过长被隐藏时显示 tooltip, 此处为全局配置, 如果只配置此处,整个table都启用
|
355
459
|
* column内部可以单个配置覆盖此配置
|
356
460
|
*/
|
357
|
-
showOverflowTooltip: import("vue-types").VueTypeDef<
|
358
|
-
default: boolean | (() => IOverflowTooltip);
|
359
|
-
};
|
461
|
+
showOverflowTooltip: import("vue-types").VueTypeDef<IOverflowTooltipProp>;
|
360
462
|
/**
|
361
463
|
* 为避免不必要的数据修改导致的不可控组件更新
|
362
464
|
* 默认组件不会对传入组件的data进行任何修改
|
@@ -416,84 +518,20 @@ export declare const tableProps: {
|
|
416
518
|
prependStyle: import("vue-types").VueTypeDef<import("vue").CSSProperties> & {
|
417
519
|
default: () => import("vue").CSSProperties;
|
418
520
|
};
|
521
|
+
/**
|
522
|
+
* 列排序行为
|
523
|
+
* independent:列与列之间的排序是独立的,互斥的
|
524
|
+
* interdependent:列排序是相互影响、依赖的
|
525
|
+
*
|
526
|
+
*/
|
527
|
+
colSortBehavior: import("vue-types").VueTypeDef<IColSortBehavior>;
|
528
|
+
/**
|
529
|
+
* 是否采用flex布局表格
|
530
|
+
*/
|
531
|
+
isFlex: import("vue-types").VueTypeValidableDef<boolean> & {
|
532
|
+
default: boolean;
|
533
|
+
} & {
|
534
|
+
default: boolean;
|
535
|
+
};
|
419
536
|
};
|
420
|
-
|
421
|
-
* 配置自定义行高选项
|
422
|
-
*/
|
423
|
-
export type SizeItem = {
|
424
|
-
value?: string;
|
425
|
-
label?: string;
|
426
|
-
height?: number;
|
427
|
-
};
|
428
|
-
export type Settings = {
|
429
|
-
fields?: Field[];
|
430
|
-
checked?: string[];
|
431
|
-
limit?: number;
|
432
|
-
size?: string;
|
433
|
-
sizeList?: SizeItem[];
|
434
|
-
showLineHeight?: boolean;
|
435
|
-
};
|
436
|
-
export type Field = {
|
437
|
-
label: string;
|
438
|
-
field?: string;
|
439
|
-
disabled?: boolean;
|
440
|
-
};
|
441
|
-
export type Column = {
|
442
|
-
label: Function | string;
|
443
|
-
field?: Function | string;
|
444
|
-
render?: Function | string | Slot;
|
445
|
-
width?: number | string;
|
446
|
-
minWidth?: number | string;
|
447
|
-
columnKey?: string;
|
448
|
-
showOverflowTooltip?: boolean | IOverflowTooltip;
|
449
|
-
type?: string;
|
450
|
-
fixed?: string | boolean;
|
451
|
-
resizable?: boolean;
|
452
|
-
sort?: {
|
453
|
-
sortFn?: Function;
|
454
|
-
sortScope?: string;
|
455
|
-
value?: string;
|
456
|
-
} | boolean | string;
|
457
|
-
filter?: {
|
458
|
-
list?: any;
|
459
|
-
filterFn?: Function;
|
460
|
-
checked?: any;
|
461
|
-
} | boolean | string;
|
462
|
-
colspan?: Function | Number;
|
463
|
-
rowspan?: Function | Number;
|
464
|
-
textAlign?: String;
|
465
|
-
className?: string | Function;
|
466
|
-
align?: string;
|
467
|
-
};
|
468
|
-
export type Thead = {
|
469
|
-
height?: Number;
|
470
|
-
isShow?: boolean;
|
471
|
-
cellFn?: Function;
|
472
|
-
};
|
473
|
-
export type GroupColumn = {
|
474
|
-
calcWidth?: number;
|
475
|
-
resizeWidth?: number;
|
476
|
-
isHidden?: boolean;
|
477
|
-
listeners?: Map<string, any>;
|
478
|
-
} & Column;
|
479
|
-
export type Columns = ReadonlyArray<Column>;
|
480
|
-
export type TablePropTypes = Readonly<ExtractPropTypes<typeof tableProps>>;
|
481
|
-
export type IColumnActive = {
|
482
|
-
index: number;
|
483
|
-
active: boolean;
|
484
|
-
};
|
485
|
-
export type IReactiveProp = {
|
486
|
-
activeColumns: IColumnActive[];
|
487
|
-
rowActions: Record<string, any>;
|
488
|
-
scrollTranslateY: Number;
|
489
|
-
scrollTranslateX: Number;
|
490
|
-
pos: Record<string, any>;
|
491
|
-
settings: any;
|
492
|
-
setting: any;
|
493
|
-
defaultSort: Record<string, any>;
|
494
|
-
};
|
495
|
-
export type Colgroups = Column & {
|
496
|
-
calcWidth: number;
|
497
|
-
resizeWidth: number;
|
498
|
-
listeners: Map<string, Function>;
|
499
|
-
};
|
537
|
+
export {};
|
package/lib/table/render.d.ts
CHANGED
@@ -1,12 +1,12 @@
|
|
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
|
-
import {
|
4
|
+
import { Column, TablePropTypes } from './props';
|
5
|
+
import { ITableFormatData, ITableResponse } from './use-attributes';
|
5
6
|
export default class TableRender {
|
6
7
|
props: TablePropTypes;
|
7
|
-
context:
|
8
|
-
|
9
|
-
colgroups: GroupColumn[];
|
8
|
+
context: SetupContext;
|
9
|
+
tableResp: ITableResponse;
|
10
10
|
uuid: string;
|
11
11
|
events: Map<string, any[]>;
|
12
12
|
styleRef: ComputedRef<{
|
@@ -15,8 +15,9 @@ export default class TableRender {
|
|
15
15
|
t: ComputedRef<Language['table']>;
|
16
16
|
activeSortIndex: Ref<number>;
|
17
17
|
plugins: TablePlugins;
|
18
|
-
constructor(props: any, ctx: any,
|
19
|
-
get
|
18
|
+
constructor(props: any, ctx: any, tableResp: ITableResponse, styleRef: any, t: ComputedRef<Language['table']>);
|
19
|
+
get formatData(): ITableFormatData;
|
20
|
+
get columns(): Column[];
|
20
21
|
/**
|
21
22
|
* 渲染Table Head
|
22
23
|
*/
|
@@ -26,7 +27,9 @@ export default class TableRender {
|
|
26
27
|
* @param rows 表格数据
|
27
28
|
* @returns
|
28
29
|
*/
|
29
|
-
renderTableBodySchema(rows: any[]):
|
30
|
+
renderTableBodySchema(rows: any[]): import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
31
|
+
[key: string]: any;
|
32
|
+
}>[] | JSX.Element;
|
30
33
|
renderTableFooter(options: any): JSX.Element;
|
31
34
|
getRowHeight: (row?: any, rowIndex?: number) => any;
|
32
35
|
/**
|
@@ -36,12 +39,6 @@ export default class TableRender {
|
|
36
39
|
*/
|
37
40
|
on(eventName: string, watcher: Function): this;
|
38
41
|
destroy(): void;
|
39
|
-
/**
|
40
|
-
* 派发事件
|
41
|
-
* @param eventName
|
42
|
-
* @param args
|
43
|
-
*/
|
44
|
-
private emitEvent;
|
45
42
|
private handlePageLimitChange;
|
46
43
|
private handlePageChange;
|
47
44
|
/**
|
@@ -49,7 +46,7 @@ export default class TableRender {
|
|
49
46
|
* @param index 指定选中的列Index
|
50
47
|
* @param single 是否重置其他列,当只允许选中一列的情况下需要先重置
|
51
48
|
*/
|
52
|
-
private
|
49
|
+
private getSortFnByColumn;
|
53
50
|
/**
|
54
51
|
* 点击选中一列事件
|
55
52
|
* @param index 当前选中列Index
|
@@ -121,7 +118,6 @@ export default class TableRender {
|
|
121
118
|
* @param colIndex 指定列Index
|
122
119
|
* @returns
|
123
120
|
*/
|
124
|
-
private isColActive;
|
125
121
|
/**
|
126
122
|
* 渲染表格Col分组
|
127
123
|
* @returns
|
@@ -131,8 +127,4 @@ export default class TableRender {
|
|
131
127
|
* 过滤当前可渲染的列
|
132
128
|
*/
|
133
129
|
private get filterColGroups();
|
134
|
-
/**
|
135
|
-
* 当前Table Setting
|
136
|
-
*/
|
137
|
-
private get setting();
|
138
130
|
}
|