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.
Files changed (241) hide show
  1. package/dist/index.cjs.js +70 -62
  2. package/dist/index.esm.js +16711 -16319
  3. package/dist/index.umd.js +72 -64
  4. package/dist/locale/en.esm.js +1 -1
  5. package/dist/locale/en.esm.js.map +1 -1
  6. package/dist/locale/en.umd.js +1 -1
  7. package/dist/locale/en.umd.js.map +1 -1
  8. package/dist/locale/zh-cn.esm.js +1 -1
  9. package/dist/locale/zh-cn.esm.js.map +1 -1
  10. package/dist/locale/zh-cn.umd.js +1 -1
  11. package/dist/locale/zh-cn.umd.js.map +1 -1
  12. package/dist/style.css +1 -1
  13. package/dist/style.variable.css +1 -1
  14. package/lib/affix/affix.d.ts +1 -1
  15. package/lib/affix/index.d.ts +4 -4
  16. package/lib/alert/alert.css +7 -0
  17. package/lib/alert/alert.d.ts +5 -5
  18. package/lib/alert/alert.less +16 -6
  19. package/lib/alert/alert.variable.css +7 -0
  20. package/lib/alert/index.d.ts +10 -10
  21. package/lib/animate-number/index.d.ts +1 -1
  22. package/lib/backtop/index.d.ts +1 -1
  23. package/lib/badge/badge.d.ts +2 -2
  24. package/lib/badge/index.d.ts +7 -7
  25. package/lib/breadcrumb/index.d.ts +2 -2
  26. package/lib/button/button.css +20 -0
  27. package/lib/button/button.less +105 -94
  28. package/lib/button/button.variable.css +20 -0
  29. package/lib/button/index.d.ts +2 -2
  30. package/lib/card/card.d.ts +1 -1
  31. package/lib/card/index.d.ts +4 -4
  32. package/lib/cascader/cascader.d.ts +1 -0
  33. package/lib/cascader/index.d.ts +5 -2
  34. package/lib/cascader/index.js +1 -1
  35. package/lib/cascader/interface.d.ts +1 -1
  36. package/lib/checkbox/checkbox-group.d.ts +6 -3
  37. package/lib/checkbox/checkbox.d.ts +4 -4
  38. package/lib/checkbox/index.d.ts +22 -19
  39. package/lib/checkbox/index.js +1 -1
  40. package/lib/code-diff/index.d.ts +1 -1
  41. package/lib/collapse/index.d.ts +2 -2
  42. package/lib/collapse-transition/index.d.ts +128 -2
  43. package/lib/collapse-transition/index.js +1 -1
  44. package/lib/color-picker/color-picker.d.ts +16 -0
  45. package/lib/color-picker/components/recommend-colors.d.ts +16 -0
  46. package/lib/color-picker/index.d.ts +19 -1
  47. package/lib/color-picker/index.js +1 -1
  48. package/lib/components.d.ts +1 -1
  49. package/lib/config-provider/config-provider.d.ts +3 -0
  50. package/lib/config-provider/index.d.ts +5 -1
  51. package/lib/config-provider/index.js +1 -1
  52. package/lib/config-provider/token.d.ts +1 -0
  53. package/lib/config-provider/use-global-config.d.ts +2 -0
  54. package/lib/config-provider/use-prefix.d.ts +2 -0
  55. package/lib/container/index.d.ts +2 -2
  56. package/lib/container/index.js +1 -1
  57. package/lib/date-picker/date-picker.d.ts +3 -1
  58. package/lib/date-picker/index.d.ts +12 -5
  59. package/lib/date-picker/index.js +1 -1
  60. package/lib/date-picker/panel/date-range.d.ts +2 -1
  61. package/lib/dialog/index.d.ts +1 -1
  62. package/lib/directives/index.js +1 -1
  63. package/lib/directives/tooltips.d.ts +3 -2
  64. package/lib/divider/index.d.ts +1 -1
  65. package/lib/dropdown/dropdown.css +1 -0
  66. package/lib/dropdown/dropdown.d.ts +1 -1
  67. package/lib/dropdown/dropdown.variable.css +1 -0
  68. package/lib/dropdown/index.d.ts +7 -7
  69. package/lib/exception/index.d.ts +2 -2
  70. package/lib/fixed-navbar/index.d.ts +1 -1
  71. package/lib/form/index.d.ts +3 -3
  72. package/lib/form/index.js +1 -1
  73. package/lib/hooks.d.ts +1 -1
  74. package/lib/hooks.js +1 -1
  75. package/lib/icon/assistant.d.ts +4 -0
  76. package/lib/icon/assistant.js +1 -0
  77. package/lib/icon/index.d.ts +1 -0
  78. package/lib/icon/index.js +1 -1
  79. package/lib/image/index.d.ts +1 -1
  80. package/lib/image/index.js +1 -1
  81. package/lib/info-box/index.js +1 -1
  82. package/lib/input/index.d.ts +146 -50
  83. package/lib/input/index.js +2 -1
  84. package/lib/input/index.js.LICENSE.txt +1 -0
  85. package/lib/input/input.css +34 -6
  86. package/lib/input/input.d.ts +100 -11
  87. package/lib/input/input.less +53 -14
  88. package/lib/input/input.variable.css +34 -6
  89. package/lib/input/util.d.ts +6 -0
  90. package/lib/link/index.d.ts +4 -4
  91. package/lib/link/link.d.ts +1 -1
  92. package/lib/loading/index.d.ts +2 -2
  93. package/lib/locale/index.js +1 -1
  94. package/lib/locale/lang/en.d.ts +1 -0
  95. package/lib/menu/index.d.ts +2 -2
  96. package/lib/message/index.js +1 -1
  97. package/lib/message/message.css +33 -9
  98. package/lib/message/message.less +78 -54
  99. package/lib/message/message.variable.css +33 -9
  100. package/lib/message/messageConstructor.d.ts +30 -8
  101. package/lib/modal/index.d.ts +2 -2
  102. package/lib/modal/index.js +1 -1
  103. package/lib/navigation/index.d.ts +4 -1
  104. package/lib/navigation/index.js +1 -1
  105. package/lib/navigation/navigation.d.ts +1 -0
  106. package/lib/notify/index.js +1 -1
  107. package/lib/notify/notifyConstructor.d.ts +1 -1
  108. package/lib/overflow-title/components/overflow-title.d.ts +257 -1
  109. package/lib/overflow-title/index.d.ts +387 -2
  110. package/lib/overflow-title/index.js +1 -1
  111. package/lib/overflow-title/props.d.ts +129 -0
  112. package/lib/pagination/index.d.ts +2 -2
  113. package/lib/plugin-popover/index.js +1 -1
  114. package/lib/pop-confirm/index.d.ts +1 -1
  115. package/lib/popover/const.d.ts +22 -9
  116. package/lib/popover/content.d.ts +33 -0
  117. package/lib/popover/index.d.ts +154 -61
  118. package/lib/popover/index.js +1 -1
  119. package/lib/popover/popover.css +1 -0
  120. package/lib/popover/popover.d.ts +64 -23
  121. package/lib/popover/popover.less +3 -2
  122. package/lib/popover/popover.variable.css +1 -0
  123. package/lib/popover/props.d.ts +29 -4
  124. package/lib/popover/use-floating.d.ts +2 -2
  125. package/lib/popover/use-popover-init.d.ts +2 -1
  126. package/lib/popover2/index.d.ts +1 -1
  127. package/lib/preset.d.ts +2 -0
  128. package/lib/process/index.d.ts +1 -1
  129. package/lib/progress/index.d.ts +1 -1
  130. package/lib/radio/index.d.ts +23 -23
  131. package/lib/radio/radio-button.d.ts +4 -4
  132. package/lib/radio/radio-group.d.ts +4 -4
  133. package/lib/radio/radio.d.ts +4 -4
  134. package/lib/rate/index.d.ts +8 -4
  135. package/lib/rate/index.js +1 -1
  136. package/lib/rate/rate.d.ts +2 -1
  137. package/lib/resize-layout/index.d.ts +4 -4
  138. package/lib/resize-layout/index.js +1 -1
  139. package/lib/resize-layout/resize-layout.css +12 -0
  140. package/lib/resize-layout/resize-layout.d.ts +1 -1
  141. package/lib/resize-layout/resize-layout.less +12 -0
  142. package/lib/resize-layout/resize-layout.variable.css +12 -0
  143. package/lib/search-select/index.d.ts +62 -29
  144. package/lib/search-select/index.js +1 -1
  145. package/lib/search-select/input.d.ts +5 -1
  146. package/lib/search-select/menu.d.ts +33 -2
  147. package/lib/search-select/search-select.css +31 -11
  148. package/lib/search-select/search-select.d.ts +23 -20
  149. package/lib/search-select/search-select.less +29 -10
  150. package/lib/search-select/search-select.variable.css +31 -11
  151. package/lib/search-select/selected.d.ts +5 -1
  152. package/lib/search-select/utils.d.ts +13 -5
  153. package/lib/select/index.d.ts +180 -84
  154. package/lib/select/index.js +1 -1
  155. package/lib/select/option.d.ts +11 -0
  156. package/lib/select/select.css +9 -1
  157. package/lib/select/select.d.ts +75 -37
  158. package/lib/select/select.less +11 -1
  159. package/lib/select/select.variable.css +9 -1
  160. package/lib/select/selectTagInput.d.ts +8 -5
  161. package/lib/shared/helper.d.ts +1 -1
  162. package/lib/shared/index.js +1 -1
  163. package/lib/shared/mask-manager.d.ts +3 -4
  164. package/lib/shared/pop-manager.d.ts +6 -2
  165. package/lib/shared/popover.d.ts +2 -2
  166. package/lib/shared/vue-types.d.ts +3 -2
  167. package/lib/sideslider/index.d.ts +1 -1
  168. package/lib/slider/index.d.ts +1 -1
  169. package/lib/slider/index.js +1 -1
  170. package/lib/steps/index.d.ts +1 -1
  171. package/lib/steps/index.js +1 -1
  172. package/lib/styles/mixins/popper.less +6 -5
  173. package/lib/swiper/index.d.ts +1 -1
  174. package/lib/swiper/index.js +1 -1
  175. package/lib/swiper/swiper.css +0 -6
  176. package/lib/swiper/swiper.less +0 -8
  177. package/lib/swiper/swiper.variable.css +0 -6
  178. package/lib/switcher/index.d.ts +30 -16
  179. package/lib/switcher/index.js +1 -1
  180. package/lib/switcher/switcher.d.ts +74 -5
  181. package/lib/tab/index.d.ts +3 -3
  182. package/lib/tab/tab-nav.d.ts +12 -2
  183. package/lib/tab/tab-panel.d.ts +1 -1
  184. package/lib/table/components/table-cell.d.ts +22 -15
  185. package/lib/table/components/table-column.d.ts +154 -219
  186. package/lib/table/const.d.ts +34 -56
  187. package/lib/table/events.d.ts +180 -0
  188. package/lib/table/index.d.ts +746 -440
  189. package/lib/table/index.js +1 -1
  190. package/lib/table/plugins/head-filter.css +3 -0
  191. package/lib/table/plugins/head-filter.d.ts +3 -7
  192. package/lib/table/plugins/head-filter.less +3 -0
  193. package/lib/table/plugins/head-filter.variable.css +3 -0
  194. package/lib/table/plugins/head-sort.d.ts +3 -7
  195. package/lib/table/plugins/settings.d.ts +12 -26
  196. package/lib/table/plugins/use-column-resize.d.ts +30 -10
  197. package/lib/table/plugins/use-fixed-column.d.ts +7 -5
  198. package/lib/table/plugins/use-pagination.d.ts +7 -4
  199. package/lib/table/props.d.ts +219 -181
  200. package/lib/table/render.d.ts +12 -20
  201. package/lib/table/table.css +85 -5
  202. package/lib/table/table.d.ts +227 -104
  203. package/lib/table/table.less +75 -8
  204. package/lib/table/table.variable.css +85 -5
  205. package/lib/table/use-attributes.d.ts +55 -0
  206. package/lib/table/use-column.d.ts +175 -3
  207. package/lib/table/use-common.d.ts +1609 -76
  208. package/lib/table/use-render.d.ts +11 -0
  209. package/lib/table/utils.d.ts +30 -28
  210. package/lib/table-column/index.d.ts +237 -527
  211. package/lib/table-column/index.js +1 -1
  212. package/lib/tag/index.d.ts +10 -10
  213. package/lib/tag/index.js +1 -1
  214. package/lib/tag/tag.d.ts +5 -5
  215. package/lib/tag-input/index.d.ts +49 -13
  216. package/lib/tag-input/index.js +1 -1
  217. package/lib/tag-input/tag-input.css +6 -1
  218. package/lib/tag-input/tag-input.d.ts +46 -10
  219. package/lib/tag-input/tag-input.less +9 -4
  220. package/lib/tag-input/tag-input.variable.css +6 -1
  221. package/lib/tag-input/tag-props.d.ts +16 -4
  222. package/lib/time-picker/index.d.ts +1 -1
  223. package/lib/timeline/index.d.ts +1 -1
  224. package/lib/transfer/index.d.ts +1 -1
  225. package/lib/tree/constant.d.ts +2 -2
  226. package/lib/tree/index.d.ts +37 -7
  227. package/lib/tree/index.js +1 -1
  228. package/lib/tree/props.d.ts +8 -1
  229. package/lib/tree/tree.d.ts +20 -2
  230. package/lib/tree/use-node-action.d.ts +3 -2
  231. package/lib/tree/use-node-attribute.d.ts +15 -8
  232. package/lib/tree/use-tree-init.d.ts +1 -2
  233. package/lib/tree/util.d.ts +7 -2
  234. package/lib/upload/index.d.ts +1 -1
  235. package/lib/virtual-render/index.d.ts +43 -1
  236. package/lib/virtual-render/index.js +1 -1
  237. package/lib/virtual-render/props.d.ts +15 -0
  238. package/lib/virtual-render/v-virtual-render.d.ts +1 -0
  239. package/lib/virtual-render/virtual-render.d.ts +27 -2
  240. package/lib/volar.components.d.ts +24 -24
  241. package/package.json +17 -16
@@ -1,22 +1,24 @@
1
- import { GroupColumn } from '../props';
1
+ import { Column, TablePropTypes } from '../props';
2
+ import { ITableResponse } from '../use-attributes';
2
3
  /**
3
4
  * 固定列Hooks
4
5
  */
5
- declare const _default: (_props: any, colgroups: GroupColumn[], hasScrollY?: any) => {
6
+ declare const _default: (props: TablePropTypes, tableResp: ITableResponse, hasScrollY?: any) => {
6
7
  fixedWrapperClass: string;
7
- resolveFixedColumnStyle: (column: GroupColumn, hasScrollY?: boolean) => {
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: GroupColumn;
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: GroupColumn, scrollX?: any, offsetRight?: any) => {
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, indexData: any[]) => {
10
+ declare const _default: (props: TablePropTypes) => {
11
11
  pageData: any[];
12
+ indexData: import("vue").ComputedRef<any[]>;
12
13
  localPagination: any;
13
- resolvePageData: (filterFn: any, sortFn: any, activeSortColumn: any) => void;
14
- watchEffectFn: (filterFn: any, sortFn: any, activeSortColumn: any) => void;
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;
@@ -1,5 +1,5 @@
1
- import { ExtractPropTypes, Slot } from 'vue';
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 overflowModeType: import("vue-types").VueTypeDef<"auto" | "static">;
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 IOverflowTooltip = {
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
- label: import("vue-types").VueTypeDef<any>;
66
- field: import("vue-types").VueTypeDef<any>;
67
- render: import("vue-types").VueTypeDef<any>;
68
- width: import("vue-types").VueTypeDef<string | number>;
69
- minWidth: import("vue-types").VueTypeDef<string | number> & {
70
- default: string | number;
71
- };
72
- columnKey: import("vue-types").VueTypeValidableDef<string> & {
73
- default: string;
74
- } & {
75
- default: string;
76
- };
77
- showOverflowTooltip: import("vue-types").VueTypeDef<boolean | IOverflowTooltip> & {
78
- default: boolean | (() => IOverflowTooltip);
79
- };
80
- type: import("vue-types").VueTypeDef<"none" | "selection" | "index" | "expand">;
81
- resizable: import("vue-types").VueTypeValidableDef<boolean> & {
82
- default: boolean;
83
- } & {
84
- default: boolean;
85
- };
86
- fixed: import("vue-types").VueTypeDef<boolean | "right" | "left"> & {
87
- default: boolean | "right" | "left";
88
- };
89
- sort: import("vue-types").VueTypeDef<string | boolean | {
90
- sortFn: any;
91
- sortScope: (object | "all" | "current" | (() => "all" | "current") | ((props: Record<string, unknown>) => "all" | "current")) & ("all" | "current");
92
- value: string;
93
- }> & {
94
- default: string | boolean | (() => {
95
- sortFn: any;
96
- sortScope: (object | "all" | "current" | (() => "all" | "current") | ((props: Record<string, unknown>) => "all" | "current")) & ("all" | "current");
97
- value: string;
98
- });
99
- };
100
- filter: import("vue-types").VueTypeDef<string | boolean | {
101
- list: any[] | (object & (() => any[]));
102
- filterFn: any;
103
- match: "full" | "fuzzy";
104
- checked: any[] | (object & (() => any[]));
105
- filterScope: (object | "all" | "current" | (() => "all" | "current") | ((props: Record<string, unknown>) => "all" | "current")) & ("all" | "current");
106
- btnSave: (string | boolean | object | (() => string | boolean) | ((props: Record<string, unknown>) => string | boolean)) & (string | boolean);
107
- btnReset: (string | boolean | object | (() => string | boolean) | ((props: Record<string, unknown>) => string | boolean)) & (string | boolean);
108
- }> & {
109
- default: string | boolean | (() => {
110
- list: any[] | (object & (() => any[]));
111
- filterFn: any;
112
- match: "full" | "fuzzy";
113
- checked: any[] | (object & (() => any[]));
114
- filterScope: (object | "all" | "current" | (() => "all" | "current") | ((props: Record<string, unknown>) => "all" | "current")) & ("all" | "current");
115
- btnSave: (string | boolean | object | (() => string | boolean) | ((props: Record<string, unknown>) => string | boolean)) & (string | boolean);
116
- btnReset: (string | boolean | object | (() => string | boolean) | ((props: Record<string, unknown>) => string | boolean)) & (string | boolean);
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
- colspan: import("vue-types").VueTypeDef<any>;
120
- rowspan: import("vue-types").VueTypeDef<any>;
121
- align: import("vue-types").VueTypeDef<"" | "right" | "left" | "center">;
122
- className: import("vue-types").VueTypeDef<any>;
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 type TableColumnProps = Partial<ExtractPropTypes<typeof IColumnType>>;
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<string | number> & {
157
- default: string | number;
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<string | number> & {
164
- default: string | number;
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<string | number> & {
171
- default: string | number;
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<any> & {
178
- default: any;
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").VueTypeShape<Thead>;
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
- * bk-table-setting-content
365
+ * 单元格数据为空展示
263
366
  */
264
- settings: import("vue-types").VueTypeDef<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
- }> & {
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<boolean | IOverflowTooltip> & {
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 {};
@@ -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 { GroupColumn, IColumnActive, IReactiveProp, TablePropTypes } from './props';
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: any;
8
- reactiveProp: any;
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, reactiveProp: IReactiveProp, colgroups: GroupColumn[], styleRef: any, t: ComputedRef<Language['table']>);
19
- get propActiveCols(): IColumnActive[];
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[]): 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 setColumnActive;
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
  }