bkui-vue 0.0.1-beta.14 → 0.0.1-beta.17

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 (260) hide show
  1. package/README.md +25 -17
  2. package/README_EN.md +89 -0
  3. package/dist/bkui-vue.cjs.js +2266 -535
  4. package/dist/bkui-vue.esm.js +2308 -582
  5. package/dist/bkui-vue.umd.js +2266 -535
  6. package/dist/style.css +601 -189
  7. package/lib/alert/alert.d.ts +24 -15
  8. package/lib/alert/alert.variable.css +6 -0
  9. package/lib/alert/index.d.ts +96 -60
  10. package/lib/alert/index.js +1 -1
  11. package/lib/animate-number/animate-number.d.ts +12 -7
  12. package/lib/animate-number/index.d.ts +48 -28
  13. package/lib/backtop/backtop.d.ts +27 -13
  14. package/lib/backtop/backtop.variable.css +6 -0
  15. package/lib/backtop/index.d.ts +108 -52
  16. package/lib/backtop/index.js +1 -1
  17. package/lib/badge/badge.d.ts +40 -19
  18. package/lib/badge/badge.variable.css +6 -0
  19. package/lib/badge/index.d.ts +144 -76
  20. package/lib/badge/index.js +1 -1
  21. package/lib/breadcrumb/breadcrumb-item.d.ts +13 -9
  22. package/lib/breadcrumb/breadcrumb.css +10 -1
  23. package/lib/breadcrumb/breadcrumb.d.ts +37 -9
  24. package/lib/breadcrumb/breadcrumb.less +13 -2
  25. package/lib/breadcrumb/breadcrumb.variable.css +16 -1
  26. package/lib/breadcrumb/index.d.ts +117 -45
  27. package/lib/breadcrumb/index.js +1 -1
  28. package/lib/button/button-group.d.ts +3 -5
  29. package/lib/button/button.d.ts +27 -22
  30. package/lib/button/button.variable.css +6 -0
  31. package/lib/button/index.d.ts +111 -93
  32. package/lib/button/index.js +1 -1
  33. package/lib/card/card.d.ts +30 -15
  34. package/lib/card/card.variable.css +6 -0
  35. package/lib/card/index.d.ts +120 -60
  36. package/lib/card/index.js +1 -1
  37. package/lib/checkbox/checkbox-group.d.ts +13 -9
  38. package/lib/checkbox/checkbox.d.ts +31 -22
  39. package/lib/checkbox/checkbox.variable.css +6 -0
  40. package/lib/checkbox/index.d.ts +137 -97
  41. package/lib/checkbox/index.js +1 -1
  42. package/lib/collapse/collapse.d.ts +50 -18
  43. package/lib/collapse/index.d.ts +108 -72
  44. package/lib/collapse/index.js +1 -1
  45. package/lib/components.d.ts +4 -0
  46. package/lib/date-picker/date-picker.d.ts +110 -63
  47. package/lib/date-picker/date-picker.variable.css +6 -0
  48. package/lib/date-picker/index.d.ts +437 -249
  49. package/lib/date-picker/index.js +1 -1
  50. package/lib/dialog/dialog.d.ts +46 -25
  51. package/lib/dialog/index.d.ts +179 -95
  52. package/lib/directives/index.js +1 -1
  53. package/lib/divider/divider.d.ts +21 -13
  54. package/lib/divider/divider.variable.css +6 -0
  55. package/lib/divider/index.d.ts +84 -52
  56. package/lib/dropdown/dropdown-item.d.ts +6 -5
  57. package/lib/dropdown/dropdown-menu.d.ts +6 -5
  58. package/lib/dropdown/dropdown.d.ts +25 -13
  59. package/lib/dropdown/dropdown.variable.css +6 -0
  60. package/lib/dropdown/index.d.ts +94 -62
  61. package/lib/exception/exception.d.ts +11 -9
  62. package/lib/exception/exception.variable.css +6 -0
  63. package/lib/exception/index.d.ts +44 -36
  64. package/lib/fixed-navbar/fixed-navbar.d.ts +15 -9
  65. package/lib/fixed-navbar/fixed-navbar.variable.css +6 -0
  66. package/lib/fixed-navbar/index.d.ts +60 -36
  67. package/lib/form/form-item.d.ts +46 -27
  68. package/lib/form/form.d.ts +21 -13
  69. package/lib/form/index.js +1 -1
  70. package/lib/icon/angle-double-left.js +15 -0
  71. package/lib/icon/angle-double-right.js +15 -0
  72. package/lib/icon/angle-down-fill.d.ts +4 -0
  73. package/lib/icon/angle-down-fill.js +15 -0
  74. package/lib/icon/angle-down-line.js +15 -0
  75. package/lib/icon/angle-down.js +15 -0
  76. package/lib/icon/angle-left.js +15 -0
  77. package/lib/icon/angle-right.js +15 -0
  78. package/lib/icon/angle-up-fill.d.ts +4 -0
  79. package/lib/icon/angle-up-fill.js +15 -0
  80. package/lib/icon/angle-up.js +15 -0
  81. package/lib/icon/arrows-left.d.ts +4 -0
  82. package/lib/icon/arrows-left.js +15 -0
  83. package/lib/icon/circle.js +15 -0
  84. package/lib/icon/close.js +15 -0
  85. package/lib/icon/code.js +15 -0
  86. package/lib/icon/cog-shape.js +15 -0
  87. package/lib/icon/collapse-left.js +15 -0
  88. package/lib/icon/copy.js +15 -0
  89. package/lib/icon/done.js +15 -0
  90. package/lib/icon/down-shape.js +15 -0
  91. package/lib/icon/down-small.js +15 -0
  92. package/lib/icon/error.js +15 -0
  93. package/lib/icon/eye.js +15 -0
  94. package/lib/icon/folder-open.js +15 -0
  95. package/lib/icon/folder-shape-open.js +15 -0
  96. package/lib/icon/folder-shape.js +15 -0
  97. package/lib/icon/folder.js +15 -0
  98. package/lib/icon/help-document-fill.js +15 -0
  99. package/lib/icon/help-fill.js +15 -0
  100. package/lib/icon/help.js +15 -0
  101. package/lib/icon/icon.js +15 -0
  102. package/lib/icon/index.d.ts +7 -3
  103. package/lib/icon/index.js +1 -1
  104. package/lib/icon/info-line.js +15 -0
  105. package/lib/icon/info.js +15 -0
  106. package/lib/icon/play-shape.js +15 -0
  107. package/lib/icon/plus.js +15 -0
  108. package/lib/icon/right-shape.js +15 -0
  109. package/lib/icon/search.js +15 -0
  110. package/lib/icon/share.js +15 -0
  111. package/lib/icon/spinner.d.ts +4 -0
  112. package/lib/icon/spinner.js +15 -0
  113. package/lib/icon/success.js +15 -0
  114. package/lib/icon/switcher-loading.js +15 -0
  115. package/lib/icon/text-file.js +15 -0
  116. package/lib/icon/tree-application-shape.js +15 -0
  117. package/lib/icon/unvisible.js +15 -0
  118. package/lib/icon/warn.js +15 -0
  119. package/lib/input/index.d.ts +251 -163
  120. package/lib/input/index.js +2 -2
  121. package/lib/input/input.css +1 -0
  122. package/lib/input/input.d.ts +62 -40
  123. package/lib/input/input.less +4 -3
  124. package/lib/input/input.variable.css +7 -0
  125. package/lib/link/index.d.ts +100 -52
  126. package/lib/link/link.d.ts +25 -13
  127. package/lib/link/link.variable.css +6 -0
  128. package/lib/loading/index.d.ts +64 -64
  129. package/lib/loading/index.js +1 -1
  130. package/lib/loading/loading.d.ts +16 -16
  131. package/lib/loading/loading.variable.css +6 -0
  132. package/lib/menu/index.d.ts +90 -71
  133. package/lib/menu/index.js +1 -1
  134. package/lib/menu/menu-group.d.ts +6 -5
  135. package/lib/menu/menu-item.d.ts +6 -5
  136. package/lib/menu/menu.d.ts +18 -14
  137. package/lib/menu/menu.variable.css +6 -0
  138. package/lib/menu/submenu.css +3 -0
  139. package/lib/menu/submenu.d.ts +6 -5
  140. package/lib/menu/submenu.less +1 -1
  141. package/lib/menu/submenu.variable.css +9 -0
  142. package/lib/message/index.js +1 -1
  143. package/lib/message/message.variable.css +6 -0
  144. package/lib/message/messageConstructor.d.ts +28 -16
  145. package/lib/modal/index.d.ts +92 -56
  146. package/lib/modal/index.js +1 -1
  147. package/lib/modal/modal.d.ts +24 -15
  148. package/lib/modal/props.mixin.d.ts +1 -1
  149. package/lib/navigation/index.js +1 -1
  150. package/lib/navigation/navigation-title.d.ts +10 -7
  151. package/lib/navigation/navigation.d.ts +40 -23
  152. package/lib/navigation/navigation.variable.css +6 -0
  153. package/lib/notify/index.js +1 -1
  154. package/lib/notify/notify.variable.css +6 -0
  155. package/lib/notify/notifyConstructor.d.ts +37 -21
  156. package/lib/popover/index.d.ts +219 -134
  157. package/lib/popover/index.js +1 -1
  158. package/lib/popover/popover.css +22 -13
  159. package/lib/popover/popover.d.ts +73 -44
  160. package/lib/popover/popover.less +55 -45
  161. package/lib/popover/popover.variable.css +28 -13
  162. package/lib/popover/props.d.ts +77 -0
  163. package/lib/process/index.d.ts +120 -60
  164. package/lib/process/index.js +1 -1
  165. package/lib/process/process.css +2 -3
  166. package/lib/process/process.d.ts +30 -15
  167. package/lib/process/process.less +2 -3
  168. package/lib/process/process.variable.css +8 -3
  169. package/lib/progress/index.d.ts +290 -120
  170. package/lib/progress/index.js +1 -1
  171. package/lib/progress/progress.css +0 -3
  172. package/lib/progress/progress.d.ts +84 -31
  173. package/lib/progress/progress.less +0 -4
  174. package/lib/progress/progress.variable.css +6 -3
  175. package/lib/radio/index.d.ts +127 -78
  176. package/lib/radio/index.js +1 -1
  177. package/lib/radio/radio-button.d.ts +24 -16
  178. package/lib/radio/radio-group.d.ts +11 -10
  179. package/lib/radio/radio.d.ts +23 -13
  180. package/lib/radio/radio.variable.css +6 -0
  181. package/lib/rate/index.d.ts +52 -40
  182. package/lib/rate/rate.d.ts +13 -10
  183. package/lib/rate/star.d.ts +32 -15
  184. package/lib/select/common.d.ts +10 -1
  185. package/lib/select/index.d.ts +515 -503
  186. package/lib/select/index.js +2 -2
  187. package/lib/select/option.d.ts +10 -17
  188. package/lib/select/optionGroup.d.ts +67 -52
  189. package/lib/select/select.css +71 -14
  190. package/lib/select/select.d.ts +136 -137
  191. package/lib/select/select.less +73 -14
  192. package/lib/select/select.variable.css +77 -14
  193. package/lib/shared/bk-helper-core.d.ts +6 -0
  194. package/lib/shared/bk-popover.d.ts +45 -4
  195. package/lib/shared/index.d.ts +10 -0
  196. package/lib/shared/index.js +1 -1
  197. package/lib/shared/utils.d.ts +6 -0
  198. package/lib/sideslider/index.d.ts +111 -63
  199. package/lib/sideslider/sideslider.d.ts +29 -17
  200. package/lib/sideslider/sideslider.variable.css +6 -0
  201. package/lib/slider/slider-button.d.ts +10 -7
  202. package/lib/slider/slider.d.ts +70 -40
  203. package/lib/slider/slider.variable.css +6 -0
  204. package/lib/steps/index.d.ts +156 -104
  205. package/lib/steps/index.js +1 -1
  206. package/lib/steps/steps.css +3 -0
  207. package/lib/steps/steps.d.ts +39 -26
  208. package/lib/steps/steps.less +4 -0
  209. package/lib/steps/steps.variable.css +9 -0
  210. package/lib/styles/index.d.ts +2 -0
  211. package/lib/styles/index.js +1 -1
  212. package/lib/styles/themes/themes.less +10 -0
  213. package/lib/switcher/index.d.ts +192 -128
  214. package/lib/switcher/index.js +1 -1
  215. package/lib/switcher/switcher.css +149 -135
  216. package/lib/switcher/switcher.d.ts +48 -32
  217. package/lib/switcher/switcher.less +210 -154
  218. package/lib/switcher/switcher.variable.css +155 -135
  219. package/lib/tab/index.d.ts +344 -208
  220. package/lib/tab/index.js +1 -1
  221. package/lib/tab/tab-nav.d.ts +74 -38
  222. package/lib/tab/tab-panel.d.ts +22 -20
  223. package/lib/tab/tab.d.ts +64 -32
  224. package/lib/tab/tab.variable.css +6 -0
  225. package/lib/table/const.d.ts +4 -0
  226. package/lib/table/index.d.ts +169 -70
  227. package/lib/table/index.js +1 -1
  228. package/lib/table/props.d.ts +56 -0
  229. package/lib/table/render.d.ts +19 -3
  230. package/lib/table/table.css +52 -13
  231. package/lib/table/table.d.ts +71 -12
  232. package/lib/table/table.less +62 -18
  233. package/lib/table/table.variable.css +60 -15
  234. package/lib/table/utils.d.ts +34 -1
  235. package/lib/tag/index.d.ts +10 -286
  236. package/lib/tag/tag.d.ts +2 -48
  237. package/lib/tag/tag.variable.css +6 -0
  238. package/lib/timeline/index.d.ts +129 -0
  239. package/lib/timeline/index.js +1 -0
  240. package/lib/timeline/timeline.css +235 -0
  241. package/lib/timeline/timeline.d.ts +81 -0
  242. package/lib/timeline/timeline.less +239 -0
  243. package/lib/timeline/timeline.variable.css +327 -0
  244. package/lib/tree/index.d.ts +148 -69
  245. package/lib/tree/index.js +1 -1
  246. package/lib/tree/props.d.ts +70 -0
  247. package/lib/tree/tree.css +16 -7
  248. package/lib/tree/tree.d.ts +51 -23
  249. package/lib/tree/tree.less +24 -24
  250. package/lib/tree/tree.variable.css +16 -7
  251. package/lib/tree/util.d.ts +3 -44
  252. package/lib/virtual-render/index.d.ts +556 -0
  253. package/lib/virtual-render/index.js +1 -0
  254. package/lib/virtual-render/props.d.ts +157 -0
  255. package/lib/virtual-render/v-virtual-render.d.ts +7 -0
  256. package/lib/virtual-render/virtual-render.css +40 -0
  257. package/lib/virtual-render/virtual-render.d.ts +244 -0
  258. package/lib/virtual-render/virtual-render.less +51 -0
  259. package/lib/virtual-render/virtual-render.variable.css +40 -0
  260. package/package.json +9 -7
@@ -23,6 +23,59 @@ export declare const tableProps: {
23
23
  columnPick: import("vue-types").VueTypeDef<string> & {
24
24
  default: string;
25
25
  };
26
+ /**
27
+ * 设置表格高度
28
+ * 默认:auto,依赖外层高度
29
+ */
30
+ height: import("vue-types").VueTypeDef<string | number> & {
31
+ default: string | number;
32
+ };
33
+ /**
34
+ * 设置表格最小高度
35
+ * 默认:auto,依赖外层高度
36
+ */
37
+ minHeight: import("vue-types").VueTypeDef<string | number> & {
38
+ default: string | number;
39
+ };
40
+ /**
41
+ * 行高,可以为固定数值类型
42
+ * 可以是函数,返回当前行的高度,返回值为数值类型
43
+ */
44
+ rowHeight: import("vue-types").VueTypeDef<any> & {
45
+ default: any;
46
+ };
47
+ /**
48
+ * Thead行高,可以为固定数值类型
49
+ */
50
+ headHeight: import("vue-types").VueTypeValidableDef<number> & {
51
+ default: number;
52
+ } & {
53
+ default: number;
54
+ };
55
+ /**
56
+ * 是否显示Head
57
+ */
58
+ showHead: import("vue-types").VueTypeValidableDef<boolean> & {
59
+ default: boolean;
60
+ } & {
61
+ default: boolean;
62
+ };
63
+ /**
64
+ * 是否启用虚拟渲染 & 滚动
65
+ * 当数据量很大时,启用虚拟渲染可以解决压面卡顿问题
66
+ */
67
+ virtualEnabled: import("vue-types").VueTypeValidableDef<boolean> & {
68
+ default: boolean;
69
+ } & {
70
+ default: boolean;
71
+ };
72
+ /**
73
+ * 表格边框显示设置,可以是一个组合
74
+ * 生效规则: 除非单独设置 none,否则会追加每个设置
75
+ */
76
+ border: import("vue-types").VueTypeDef<string[]> & {
77
+ default: () => string[];
78
+ };
26
79
  };
27
80
  export declare type Column = {
28
81
  label: Function | string;
@@ -30,6 +83,9 @@ export declare type Column = {
30
83
  render?: Function | string;
31
84
  width?: number | string;
32
85
  };
86
+ export declare type GroupColumn = {
87
+ calcWidth?: number;
88
+ } & Column;
33
89
  export declare type Columns = ReadonlyArray<Column>;
34
90
  export declare type TablePropTypes = Readonly<ExtractPropTypes<typeof tableProps>>;
35
91
  export declare type IColumnActive = {
@@ -1,17 +1,26 @@
1
1
  import { SetupContext } from 'vue';
2
- import { IColumnActive, IReactiveProp, TablePropTypes } from './props';
2
+ import { GroupColumn, IColumnActive, IReactiveProp, TablePropTypes } from './props';
3
+ import { TablePlugins } from './plugins/index';
3
4
  export default class TableRender {
4
5
  props: TablePropTypes;
5
6
  context: SetupContext;
6
7
  reactiveProp: any;
7
- constructor(props: TablePropTypes, ctx: SetupContext, reactiveProp: IReactiveProp);
8
+ colgroups: GroupColumn[];
9
+ plugins: TablePlugins;
10
+ constructor(props: TablePropTypes, ctx: SetupContext, reactiveProp: IReactiveProp, colgroups: GroupColumn[]);
8
11
  get propActiveCols(): IColumnActive[];
12
+ /**
13
+ * 渲染Table Head
14
+ * @param activeColumns 当前选中的列
15
+ * @returns
16
+ */
17
+ renderTableHeadSchema(): JSX.Element;
9
18
  /**
10
19
  * 渲染Table主体
11
20
  * @param activeColumns 当前选中的列
12
21
  * @returns
13
22
  */
14
- renderTableBodySchema(): JSX.Element;
23
+ renderTableBodySchema(rows: any[]): JSX.Element;
15
24
  /**
16
25
  * 指定列选中状态
17
26
  * @param index 指定选中的列Index
@@ -33,6 +42,13 @@ export default class TableRender {
33
42
  * @returns
34
43
  */
35
44
  private renderTBody;
45
+ /**
46
+ * 渲染表格Cell内容
47
+ * @param row 当前行
48
+ * @param column 当前列
49
+ * @returns
50
+ */
51
+ private renderCell;
36
52
  /**
37
53
  * 判定指定列是否为选中状态
38
54
  * @param colIndex 指定列Index
@@ -1,42 +1,81 @@
1
- .bk-table .bk-table-body {
2
- height: 500px;
1
+ .bk-table {
3
2
  overflow: auto;
3
+ border-top: 1px solid #dcdee5;
4
+ border-bottom: 1px solid #dcdee5;
5
+ }
6
+ .bk-table .bk-table-head,
7
+ .bk-table .bk-table-body {
4
8
  background: white;
5
9
  }
10
+ .bk-table .bk-table-head table,
6
11
  .bk-table .bk-table-body table {
7
12
  width: 100%;
8
13
  border-collapse: collapse;
9
14
  }
10
- .bk-table .bk-table-body table .cell {
11
- height: 40px;
15
+ .bk-table .bk-table-head table th,
16
+ .bk-table .bk-table-body table th,
17
+ .bk-table .bk-table-head table td,
18
+ .bk-table .bk-table-body table td {
19
+ min-width: 80px;
20
+ }
21
+ .bk-table .bk-table-head table th .cell,
22
+ .bk-table .bk-table-body table th .cell,
23
+ .bk-table .bk-table-head table td .cell,
24
+ .bk-table .bk-table-body table td .cell {
25
+ height: var(--row-height);
12
26
  padding: 0 15px;
13
27
  overflow: hidden;
14
- line-height: 40px;
28
+ line-height: var(--row-height);
29
+ color: #575961;
30
+ text-align: left;
15
31
  text-overflow: ellipsis;
16
32
  white-space: nowrap;
17
33
  }
18
- .bk-table .bk-table-body table th,
19
- .bk-table .bk-table-body table td {
20
- min-width: 80px;
21
- border-bottom: 1px solid #dfe0e5;
22
- }
34
+ .bk-table .bk-table-head table thead th,
23
35
  .bk-table .bk-table-body table thead th {
24
36
  position: sticky;
25
37
  top: 0;
26
38
  z-index: 1;
27
- background-color: #fff;
39
+ color: #313238;
40
+ background-color: #fafbfd;
28
41
  }
29
- .bk-table .bk-table-body table thead th.active {
42
+ .bk-table .bk-table-head table thead th.active,
43
+ .bk-table .bk-table-body table thead th.active,
44
+ .bk-table .bk-table-head table thead th:hover,
45
+ .bk-table .bk-table-body table thead th:hover {
30
46
  background: #f0f1f5;
31
47
  }
48
+ .bk-table .bk-table-head table tbody tr:hover td,
32
49
  .bk-table .bk-table-body table tbody tr:hover td {
33
50
  background: #f5f7fa;
34
51
  }
52
+ .bk-table.bordered-row .cell {
53
+ border-bottom: 1px solid #dcdee5;
54
+ }
55
+ .bk-table.bordered-outer {
56
+ border-right: 1px solid #dcdee5;
57
+ border-left: 1px solid #dcdee5;
58
+ }
59
+ .bk-table.bordered-col th .cell,
60
+ .bk-table.bordered-col td .cell {
61
+ border-right: 1px solid #dcdee5;
62
+ }
63
+ .bk-table.bordered-col th:last-child .cell,
64
+ .bk-table.bordered-col td:last-child .cell {
65
+ border-right: none;
66
+ }
67
+ .bk-table.bordered-none th .cell,
68
+ .bk-table.bordered-none td .cell {
69
+ border-top: none;
70
+ border-right: none;
71
+ border-bottom: none;
72
+ border-left: none;
73
+ }
35
74
  .bk-table .bk-table-fixed {
36
75
  width: 100%;
37
76
  }
38
77
  .bk-table colgroup col {
39
- background: #fff;
78
+ background: white;
40
79
  }
41
80
  .bk-table colgroup col.active {
42
81
  position: relative;
@@ -8,19 +8,78 @@ declare const _default: import("vue").DefineComponent<{
8
8
  columnPick: import("vue-types").VueTypeDef<string> & {
9
9
  default: string;
10
10
  };
11
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
12
- data?: unknown;
13
- columns?: unknown;
14
- activeColumn?: unknown;
15
- columnPick?: unknown;
16
- } & {
17
- data: any[];
18
- columnPick: string;
19
- } & {
20
- columns?: Column[];
21
- activeColumn?: number | number[];
22
- }> & ({} | {}), {
11
+ height: import("vue-types").VueTypeDef<string | number> & {
12
+ default: string | number;
13
+ };
14
+ minHeight: import("vue-types").VueTypeDef<string | number> & {
15
+ default: string | number;
16
+ }; /** 表格外层容器样式 */
17
+ rowHeight: import("vue-types").VueTypeDef<any> & {
18
+ default: any;
19
+ };
20
+ headHeight: import("vue-types").VueTypeValidableDef<number> & {
21
+ default: number;
22
+ } & {
23
+ default: number;
24
+ };
25
+ showHead: import("vue-types").VueTypeValidableDef<boolean> & {
26
+ default: boolean;
27
+ } & {
28
+ default: boolean;
29
+ };
30
+ virtualEnabled: import("vue-types").VueTypeValidableDef<boolean> & {
31
+ default: boolean;
32
+ } & {
33
+ default: boolean;
34
+ };
35
+ border: import("vue-types").VueTypeDef<string[]> & {
36
+ default: () => string[];
37
+ };
38
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
39
+ data: import("vue-types").VueTypeDef<any[]> & {
40
+ default: () => any[];
41
+ };
42
+ columns: import("vue-types").VueTypeDef<Column[]>;
43
+ activeColumn: import("vue-types").VueTypeDef<number | number[]>;
44
+ columnPick: import("vue-types").VueTypeDef<string> & {
45
+ default: string;
46
+ };
47
+ height: import("vue-types").VueTypeDef<string | number> & {
48
+ default: string | number;
49
+ };
50
+ minHeight: import("vue-types").VueTypeDef<string | number> & {
51
+ default: string | number;
52
+ }; /** 表格外层容器样式 */
53
+ rowHeight: import("vue-types").VueTypeDef<any> & {
54
+ default: any;
55
+ };
56
+ headHeight: import("vue-types").VueTypeValidableDef<number> & {
57
+ default: number;
58
+ } & {
59
+ default: number;
60
+ };
61
+ showHead: import("vue-types").VueTypeValidableDef<boolean> & {
62
+ default: boolean;
63
+ } & {
64
+ default: boolean;
65
+ };
66
+ virtualEnabled: import("vue-types").VueTypeValidableDef<boolean> & {
67
+ default: boolean;
68
+ } & {
69
+ default: boolean;
70
+ };
71
+ border: import("vue-types").VueTypeDef<string[]> & {
72
+ default: () => string[];
73
+ };
74
+ }>>, {
23
75
  data: any[];
76
+ height: string | number;
77
+ border: string[];
78
+ headHeight: number;
24
79
  columnPick: string;
80
+ minHeight: string | number;
81
+ rowHeight: any;
82
+ showHead: boolean;
83
+ virtualEnabled: boolean;
25
84
  }>;
26
85
  export default _default;
@@ -1,28 +1,31 @@
1
1
  @import '../styles/themes/themes.less';
2
2
 
3
3
  .@{bk-prefix}-table {
4
+ overflow: auto;
5
+ border-top: 1px solid @table-border-color;
6
+ border-bottom: 1px solid @table-border-color;
7
+ .@{bk-prefix}-table-head,
4
8
  .@{bk-prefix}-table-body {
5
- height: 500px;
6
- overflow: auto;
7
- background: @white-color;
9
+ background: @table-bg-color;
8
10
 
9
11
  table {
10
12
  width: 100%;
11
13
  border-collapse: collapse;
12
14
 
13
- .cell {
14
- height: 40px;
15
- padding: 0 15px;
16
- overflow: hidden;
17
- line-height: 40px;
18
- text-overflow: ellipsis;
19
- white-space: nowrap;
20
- }
21
-
22
15
  th,
23
16
  td {
24
17
  min-width: 80px;
25
- border-bottom: 1px solid #dfe0e5;
18
+
19
+ .cell {
20
+ height: var(--row-height);
21
+ padding: 0 15px;
22
+ overflow: hidden;
23
+ line-height: var(--row-height);
24
+ color: @table-body-font-color;
25
+ text-align: left;
26
+ text-overflow: ellipsis;
27
+ white-space: nowrap;
28
+ }
26
29
  }
27
30
 
28
31
  thead {
@@ -30,11 +33,12 @@
30
33
  position: sticky;
31
34
  top: 0;
32
35
  z-index: 1;
33
- background-color: #fff;
36
+ color: @table-head-font-color;
37
+ background-color: @table-head-bg-color;
34
38
 
35
- &.active {
39
+ &.active,
40
+ &:hover {
36
41
  background: #f0f1f5;
37
- // cursor: ;
38
42
  }
39
43
  }
40
44
  }
@@ -43,20 +47,60 @@
43
47
  tr {
44
48
  &:hover {
45
49
  td {
46
- background: #f5f7fa;
50
+ background: @table-row-hover-bg-color;
47
51
  }
48
52
  }
49
53
  }
50
54
  }
51
55
  }
52
56
  }
57
+
58
+ &.bordered-row {
59
+ .cell {
60
+ border-bottom: 1px solid @table-border-color;
61
+ }
62
+ }
63
+
64
+ &.bordered-outer {
65
+ border-right: 1px solid @table-border-color;
66
+ border-left: 1px solid @table-border-color;
67
+ }
68
+
69
+ &.bordered-col {
70
+ th,
71
+ td {
72
+ .cell {
73
+ border-right: 1px solid @table-border-color;
74
+ }
75
+
76
+ &:last-child {
77
+ .cell {
78
+ border-right: none;
79
+ }
80
+ }
81
+ }
82
+
83
+ }
84
+
85
+ &.bordered-none {
86
+ th,
87
+ td {
88
+ .cell {
89
+ border-top: none;
90
+ border-right: none;
91
+ border-bottom: none;
92
+ border-left: none;
93
+ }
94
+ }
95
+ }
96
+
53
97
  .@{bk-prefix}-table-fixed {
54
98
  width: 100%;
55
99
  }
56
100
 
57
101
  colgroup {
58
102
  col {
59
- background: #fff;
103
+ background: @table-bg-color;
60
104
 
61
105
  &.active {
62
106
  position: relative;
@@ -83,46 +83,91 @@
83
83
  --date-picker-disabled-bg: #fafbfd;
84
84
  --date-picker-dropdown-mb: 4px;
85
85
  --date-picker-dropdown-bg: #fff;
86
+ --table-bg-color: var(--white-color);
87
+ --table-border-color: #dcdee5;
88
+ --table-head-bg-color: #fafbfd;
89
+ --table-head-font-color: #313238;
90
+ --table-body-font-color: #575961;
91
+ --table-row-hover-bg-color: #f5f7fa;
86
92
  }
87
- .bk-table .bk-table-body {
88
- height: 500px;
93
+ .bk-table {
89
94
  overflow: auto;
90
- background: var(--white-color);
95
+ border-top: 1px solid var(--table-border-color);
96
+ border-bottom: 1px solid var(--table-border-color);
97
+ }
98
+ .bk-table .bk-table-head,
99
+ .bk-table .bk-table-body {
100
+ background: var(--table-bg-color);
91
101
  }
102
+ .bk-table .bk-table-head table,
92
103
  .bk-table .bk-table-body table {
93
104
  width: 100%;
94
105
  border-collapse: collapse;
95
106
  }
96
- .bk-table .bk-table-body table .cell {
97
- height: 40px;
107
+ .bk-table .bk-table-head table th,
108
+ .bk-table .bk-table-body table th,
109
+ .bk-table .bk-table-head table td,
110
+ .bk-table .bk-table-body table td {
111
+ min-width: 80px;
112
+ }
113
+ .bk-table .bk-table-head table th .cell,
114
+ .bk-table .bk-table-body table th .cell,
115
+ .bk-table .bk-table-head table td .cell,
116
+ .bk-table .bk-table-body table td .cell {
117
+ height: var(--row-height);
98
118
  padding: 0 15px;
99
119
  overflow: hidden;
100
- line-height: 40px;
120
+ line-height: var(--row-height);
121
+ color: var(--table-body-font-color);
122
+ text-align: left;
101
123
  text-overflow: ellipsis;
102
124
  white-space: nowrap;
103
125
  }
104
- .bk-table .bk-table-body table th,
105
- .bk-table .bk-table-body table td {
106
- min-width: 80px;
107
- border-bottom: 1px solid #dfe0e5;
108
- }
126
+ .bk-table .bk-table-head table thead th,
109
127
  .bk-table .bk-table-body table thead th {
110
128
  position: sticky;
111
129
  top: 0;
112
130
  z-index: 1;
113
- background-color: #fff;
131
+ color: var(--table-head-font-color);
132
+ background-color: var(--table-head-bg-color);
114
133
  }
115
- .bk-table .bk-table-body table thead th.active {
134
+ .bk-table .bk-table-head table thead th.active,
135
+ .bk-table .bk-table-body table thead th.active,
136
+ .bk-table .bk-table-head table thead th:hover,
137
+ .bk-table .bk-table-body table thead th:hover {
116
138
  background: #f0f1f5;
117
139
  }
140
+ .bk-table .bk-table-head table tbody tr:hover td,
118
141
  .bk-table .bk-table-body table tbody tr:hover td {
119
- background: #f5f7fa;
142
+ background: var(--table-row-hover-bg-color);
143
+ }
144
+ .bk-table.bordered-row .cell {
145
+ border-bottom: 1px solid var(--table-border-color);
146
+ }
147
+ .bk-table.bordered-outer {
148
+ border-right: 1px solid var(--table-border-color);
149
+ border-left: 1px solid var(--table-border-color);
150
+ }
151
+ .bk-table.bordered-col th .cell,
152
+ .bk-table.bordered-col td .cell {
153
+ border-right: 1px solid var(--table-border-color);
154
+ }
155
+ .bk-table.bordered-col th:last-child .cell,
156
+ .bk-table.bordered-col td:last-child .cell {
157
+ border-right: none;
158
+ }
159
+ .bk-table.bordered-none th .cell,
160
+ .bk-table.bordered-none td .cell {
161
+ border-top: none;
162
+ border-right: none;
163
+ border-bottom: none;
164
+ border-left: none;
120
165
  }
121
166
  .bk-table .bk-table-fixed {
122
167
  width: 100%;
123
168
  }
124
169
  .bk-table colgroup col {
125
- background: #fff;
170
+ background: var(--table-bg-color);
126
171
  }
127
172
  .bk-table colgroup col.active {
128
173
  position: relative;
@@ -1,4 +1,4 @@
1
- import { TablePropTypes } from './props';
1
+ import { GroupColumn, TablePropTypes } from './props';
2
2
  /**
3
3
  * 解析Prop值 | 可能为多种类型 & 函数返回的场景
4
4
  * @param prop 当前Prop
@@ -20,3 +20,36 @@ export declare const resolveActiveColumns: (props: TablePropTypes) => number[];
20
20
  */
21
21
  export declare const resolveNumberToNumArray: (prop: number) => number[];
22
22
  export declare const resolveWidth: (propWidth: string | number) => string | number;
23
+ /**
24
+ * 解析可为数字或者字符串设置的样式配置
25
+ * @param val 配置值
26
+ * @param defaultValue 默认值
27
+ * @param offset 偏移量
28
+ * @returns 标准化px string
29
+ */
30
+ export declare const resolveNumberOrStringToPix: (val: string | number, defaultValue?: string | number, offset?: any) => string | number;
31
+ /**
32
+ * 格式化Border配置为标准Class
33
+ * @param val
34
+ * @returns
35
+ */
36
+ export declare const resolvePropBorderToClassStr: (val: string | string[]) => string;
37
+ /**
38
+ * 根据Props Column配置计算并设置列宽度
39
+ * @param root 当前根元素
40
+ * @param colgroups Columns配置
41
+ * @param autoWidth 自动填充宽度
42
+ */
43
+ export declare const resolveColumnWidth: (root: HTMLElement, colgroups: GroupColumn[], autoWidth?: number) => void;
44
+ /**
45
+ * 监听目标元素的Resize事件
46
+ * @param root 目标元素
47
+ * @param callbackFn 执行函数
48
+ * @param delay 延迟执行时间,默认 60
49
+ * @param immediate 是否立即执行回调函数
50
+ * @returns "{ start: () => void, stop: () => void }"
51
+ */
52
+ export declare const observerResize: (root: HTMLElement, callbackFn: () => void, delay?: number, immediate?: boolean) => {
53
+ start: () => void;
54
+ stop: () => void;
55
+ };