bkui-vue 2.0.1-beta.27 → 2.0.1-beta.28.table.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.
@@ -44,12 +44,12 @@ export declare enum FixedEnum {
44
44
  }
45
45
  export declare const fixedType: import("vue-types").VueTypeValidableDef<"left" | "right">;
46
46
  export type IOverflowTooltipOption = {
47
- content: ((col: Column, row: any) => string) | string;
48
- disabled?: ((col: Column, row: any) => boolean) | boolean;
47
+ content: ((col: Column, row: Record<string, object>) => string) | string;
48
+ disabled?: ((col: Column, row: Record<string, object>) => boolean) | boolean;
49
49
  allowHtml?: boolean;
50
50
  watchCellResize?: boolean;
51
51
  mode?: `${OverflowModeEnum}`;
52
- popoverOption?: any;
52
+ popoverOption?: Record<string, object>;
53
53
  resizerWay?: ResizerWay;
54
54
  showHead?: boolean;
55
55
  };
@@ -61,16 +61,19 @@ export type ISortOption = {
61
61
  };
62
62
  export declare const ISortType: import("vue-types").VueTypeDef<ISortPropShape>;
63
63
  export type ISortShape = {
64
- sortFn?: Function;
64
+ sortFn?: (...args: any[]) => boolean;
65
65
  sortScope?: SortScope;
66
66
  value?: SORT_OPTION;
67
67
  };
68
68
  export type ISortPropShape = ISortShape | boolean | string;
69
69
  export type IFilterShape = {
70
- list: any[];
71
- filterFn?: Function;
70
+ list: {
71
+ label: string;
72
+ value: string;
73
+ }[];
74
+ filterFn?: (...args: any[]) => boolean;
72
75
  match?: FullEnum;
73
- checked?: any[];
76
+ checked?: string[];
74
77
  filterScope?: SortScope;
75
78
  btnSave?: boolean | string;
76
79
  btnReset?: boolean | string;
@@ -119,12 +122,12 @@ export type Field = {
119
122
  export type LabelFunctionString = ((_column: any, _index: any) => JSX.Element | boolean | number | string) | boolean | number | string;
120
123
  export declare const LabelFunctionStringType: import("vue-types").VueTypeDef<LabelFunctionString>;
121
124
  export type HeadRenderArgs = {
122
- cell?: any;
123
- data?: any[];
124
- row?: any;
125
+ cell?: Record<string, object>;
126
+ data?: Record<string, object>[];
127
+ row?: Record<string, object>;
125
128
  column: Column;
126
129
  index: number;
127
- rows?: any[];
130
+ rows?: Record<string, object>[];
128
131
  };
129
132
  export type RenderFunctionString = (args: HeadRenderArgs) => JSX.Element | boolean | number | string;
130
133
  export declare const RenderFunctionStringType: import("vue-types").VueTypeDef<RenderFunctionString>;
@@ -135,11 +138,11 @@ export type SpanFunctionString = (({ column, colIndex, row, rowIndex }: {
135
138
  rowIndex: any;
136
139
  }) => number) | number;
137
140
  export declare const SpanFunctionStringType: import("vue-types").VueTypeDef<SpanFunctionString>;
138
- export type RowClassFunctionString = ((row: any) => string) | string;
141
+ export type RowClassFunctionString = ((row: Record<string, object>) => string) | string;
139
142
  export declare const RowClassFunctionStringType: import("vue-types").VueTypeDef<RowClassFunctionString>;
140
- export type RowHeightFunctionNumber = ((_type: string, _row: any, _rowIndex: number, _size?: any) => number) | number;
143
+ export type RowHeightFunctionNumber = ((type: string, row: Record<string, object>, rowIndex: number, size?: any) => number) | number;
141
144
  export declare const RowHeightFunctionNumberType: import("vue-types").VueTypeDef<RowHeightFunctionNumber>;
142
- type FunctionNumber = Function | number;
145
+ type FunctionNumber = ((...args: any[]) => void) | number;
143
146
  export declare const FunctionNumberType: import("vue-types").VueTypeDef<FunctionNumber>;
144
147
  type StringNumber = number | string;
145
148
  export declare const StringNumberType: (val: number | string) => import("vue-types").VueTypeDef<StringNumber> & {
@@ -159,8 +162,16 @@ export type IDraggableRowOption = {
159
162
  icon?: JSX.Element;
160
163
  width?: number;
161
164
  };
165
+ export type IHeadGroup = {
166
+ thColspan: number;
167
+ thRowspan: number;
168
+ isGroup: boolean;
169
+ parent?: IHeadGroup;
170
+ label?: string;
171
+ offsetLeft?: number;
172
+ };
162
173
  export type Column = {
163
- label: LabelFunctionString;
174
+ label?: LabelFunctionString;
164
175
  field?: LabelFunctionString;
165
176
  render?: RenderFunctionString;
166
177
  renderHead?: RenderFunctionString;
@@ -181,12 +192,13 @@ export type Column = {
181
192
  prop?: LabelFunctionString;
182
193
  index?: number;
183
194
  explain?: IColumnExplain;
195
+ children?: Column[];
184
196
  };
185
197
  export declare const IColumnProp: import("vue-types").VueTypeDef<Column>;
186
198
  export type Thead = {
187
199
  height?: number;
188
200
  isShow?: boolean;
189
- cellFn?: Function;
201
+ cellFn?: (...args: any[]) => void;
190
202
  color?: IHeadColor | string;
191
203
  };
192
204
  export type Columns = ReadonlyArray<Column>;
@@ -195,7 +207,7 @@ export type GroupColumn = {
195
207
  calcWidth?: number;
196
208
  resizeWidth?: number;
197
209
  isHidden?: boolean;
198
- listeners?: Map<string, any>;
210
+ listeners?: Map<string, (...args: any[]) => void>;
199
211
  } & Column;
200
212
  export type IColumnActive = {
201
213
  index: number;
@@ -203,21 +215,21 @@ export type IColumnActive = {
203
215
  };
204
216
  export type IReactiveProp = {
205
217
  activeColumns: IColumnActive[];
206
- rowActions: Record<string, any>;
218
+ rowActions: Record<string, object>;
207
219
  scrollTranslateY: number;
208
220
  scrollTranslateX: number;
209
- pos: Record<string, any>;
221
+ pos: Record<string, object>;
210
222
  settings: Settings | boolean;
211
223
  setting: {
212
224
  size: string;
213
225
  height: number;
214
226
  };
215
- defaultSort: Record<string, any>;
227
+ defaultSort: Record<string, object>;
216
228
  };
217
229
  export type Colgroups = Column & {
218
230
  calcWidth: number;
219
231
  resizeWidth: number;
220
- listeners: Map<string, Function>;
232
+ listeners: Map<string, (...args: any[]) => void>;
221
233
  };
222
234
  export declare enum IColSortBehavior {
223
235
  /**
@@ -1235,9 +1235,21 @@
1235
1235
  }
1236
1236
  .bk-table .bk-table-body {
1237
1237
  position: relative;
1238
- overflow: hidden;
1238
+ overflow: auto;
1239
1239
  flex: 1;
1240
1240
  }
1241
+ .bk-table .bk-table-body::-webkit-scrollbar {
1242
+ width: 8px;
1243
+ height: 8px;
1244
+ }
1245
+ .bk-table .bk-table-body::-webkit-scrollbar-thumb {
1246
+ background: #ddd;
1247
+ border-radius: 20px;
1248
+ box-shadow: inset 0 0 6px rgba(204, 204, 204, 0.3);
1249
+ }
1250
+ .bk-table .bk-table-body.is-bk-scrollbar {
1251
+ overflow: hidden;
1252
+ }
1241
1253
  .bk-table .bk-table-body .prepend-row {
1242
1254
  transform: translate3d(var(--translate-x), 0, 0);
1243
1255
  }
@@ -1492,6 +1504,15 @@
1492
1504
  background-color: var(--background-color);
1493
1505
  height: var(--row-height);
1494
1506
  }
1507
+ .bk-table .bk-table-head.has-group .is-head-group {
1508
+ border-bottom: 1px solid var(--table-border-color);
1509
+ }
1510
+ .bk-table .bk-table-head.has-group th {
1511
+ border-right: 1px solid var(--table-border-color);
1512
+ }
1513
+ .bk-table .bk-table-head.has-group th.is-last-child {
1514
+ border-right: none;
1515
+ }
1495
1516
  .bk-table .bk-table-head .col-resize-drag {
1496
1517
  position: absolute;
1497
1518
  top: 0;
@@ -1561,15 +1582,30 @@
1561
1582
  .bk-table.bordered-horizontal .__is-empty .bk-table-body-content {
1562
1583
  border-bottom: 1px solid var(--table-border-color);
1563
1584
  }
1585
+ .bk-table.bordered-col .bk-table-head {
1586
+ border-right: 1px solid var(--table-border-color);
1587
+ }
1588
+ .bk-table.bordered-col .bk-table-head .is-head-group {
1589
+ border-bottom: 1px solid var(--table-border-color);
1590
+ }
1564
1591
  .bk-table.bordered-col th {
1565
1592
  border-right: 1px solid var(--table-border-color);
1566
1593
  }
1567
1594
  .bk-table.bordered-col th:last-child {
1568
1595
  border-right: none;
1569
1596
  }
1597
+ .bk-table.bordered-col .bk-table-body {
1598
+ border-right: 1px solid var(--table-border-color);
1599
+ }
1570
1600
  .bk-table.bordered-col .bk-table-body tbody tr td {
1571
1601
  border-right-color: var(--table-border-color);
1572
1602
  }
1603
+ .bk-table.bordered-col .bk-table-body tbody tr td:last-child {
1604
+ border-right: none;
1605
+ }
1606
+ .bk-table.bordered-col .bk-table-body tbody tr:hover.hover-highlight td:not(.empty-cell) {
1607
+ border-right-color: var(--table-border-color);
1608
+ }
1573
1609
  .bk-table th,
1574
1610
  .bk-table td {
1575
1611
  border-right: 1px solid var(--table-bg-color);
@@ -22,9 +22,24 @@
22
22
 
23
23
  .@{bk-prefix}-table-body {
24
24
  position: relative;
25
- overflow: hidden;
25
+ overflow: auto;
26
26
  flex: 1;
27
27
 
28
+ &::-webkit-scrollbar {
29
+ width: 8px;
30
+ height: 8px;
31
+ }
32
+
33
+ &::-webkit-scrollbar-thumb {
34
+ background: #ddd;
35
+ border-radius: 20px;
36
+ box-shadow: inset 0 0 6px rgba(204, 204, 204, 0.3);
37
+ }
38
+
39
+ &.is-bk-scrollbar {
40
+ overflow: hidden;
41
+ }
42
+
28
43
  .prepend-row {
29
44
  transform: translate3d(var(--translate-x), 0, 0);
30
45
  }
@@ -293,6 +308,20 @@
293
308
  background-color: var(--background-color);
294
309
  height: var(--row-height);
295
310
 
311
+ &.has-group {
312
+ .is-head-group {
313
+ border-bottom: 1px solid @table-border-color;
314
+ }
315
+
316
+ th {
317
+ border-right: 1px solid @table-border-color;
318
+
319
+ &.is-last-child {
320
+ border-right: none;
321
+ }
322
+ }
323
+ }
324
+
296
325
  .col-resize-drag {
297
326
  position: absolute;
298
327
  top: 0;
@@ -389,6 +418,12 @@
389
418
  }
390
419
 
391
420
  &.bordered-col {
421
+ .@{bk-prefix}-table-head {
422
+ border-right: 1px solid @table-border-color;
423
+ .is-head-group {
424
+ border-bottom: 1px solid @table-border-color;
425
+ }
426
+ }
392
427
  th {
393
428
  border-right: 1px solid @table-border-color;
394
429
 
@@ -397,11 +432,26 @@
397
432
  }
398
433
  }
399
434
 
400
- .bk-table-body {
435
+ .@{bk-prefix}-table-body {
436
+ border-right: 1px solid @table-border-color;
401
437
  tbody {
402
438
  tr {
403
439
  td {
404
440
  border-right-color: @table-border-color;
441
+
442
+ &:last-child {
443
+ border-right: none;
444
+ }
445
+ }
446
+
447
+ &:hover {
448
+ &.hover-highlight {
449
+ td {
450
+ &:not(.empty-cell) {
451
+ border-right-color: @table-border-color;
452
+ }
453
+ }
454
+ }
405
455
  }
406
456
  }
407
457
  }
@@ -1625,9 +1625,21 @@
1625
1625
  }
1626
1626
  .bk-table .bk-table-body {
1627
1627
  position: relative;
1628
- overflow: hidden;
1628
+ overflow: auto;
1629
1629
  flex: 1;
1630
1630
  }
1631
+ .bk-table .bk-table-body::-webkit-scrollbar {
1632
+ width: 8px;
1633
+ height: 8px;
1634
+ }
1635
+ .bk-table .bk-table-body::-webkit-scrollbar-thumb {
1636
+ background: #ddd;
1637
+ border-radius: 20px;
1638
+ box-shadow: inset 0 0 6px rgba(204, 204, 204, 0.3);
1639
+ }
1640
+ .bk-table .bk-table-body.is-bk-scrollbar {
1641
+ overflow: hidden;
1642
+ }
1631
1643
  .bk-table .bk-table-body .prepend-row {
1632
1644
  transform: translate3d(var(--translate-x), 0, 0);
1633
1645
  }
@@ -1882,6 +1894,15 @@
1882
1894
  background-color: var(--background-color);
1883
1895
  height: var(--row-height);
1884
1896
  }
1897
+ .bk-table .bk-table-head.has-group .is-head-group {
1898
+ border-bottom: 1px solid var(--table-border-color);
1899
+ }
1900
+ .bk-table .bk-table-head.has-group th {
1901
+ border-right: 1px solid var(--table-border-color);
1902
+ }
1903
+ .bk-table .bk-table-head.has-group th.is-last-child {
1904
+ border-right: none;
1905
+ }
1885
1906
  .bk-table .bk-table-head .col-resize-drag {
1886
1907
  position: absolute;
1887
1908
  top: 0;
@@ -1951,15 +1972,30 @@
1951
1972
  .bk-table.bordered-horizontal .__is-empty .bk-table-body-content {
1952
1973
  border-bottom: 1px solid var(--table-border-color);
1953
1974
  }
1975
+ .bk-table.bordered-col .bk-table-head {
1976
+ border-right: 1px solid var(--table-border-color);
1977
+ }
1978
+ .bk-table.bordered-col .bk-table-head .is-head-group {
1979
+ border-bottom: 1px solid var(--table-border-color);
1980
+ }
1954
1981
  .bk-table.bordered-col th {
1955
1982
  border-right: 1px solid var(--table-border-color);
1956
1983
  }
1957
1984
  .bk-table.bordered-col th:last-child {
1958
1985
  border-right: none;
1959
1986
  }
1987
+ .bk-table.bordered-col .bk-table-body {
1988
+ border-right: 1px solid var(--table-border-color);
1989
+ }
1960
1990
  .bk-table.bordered-col .bk-table-body tbody tr td {
1961
1991
  border-right-color: var(--table-border-color);
1962
1992
  }
1993
+ .bk-table.bordered-col .bk-table-body tbody tr td:last-child {
1994
+ border-right: none;
1995
+ }
1996
+ .bk-table.bordered-col .bk-table-body tbody tr:hover.hover-highlight td:not(.empty-cell) {
1997
+ border-right-color: var(--table-border-color);
1998
+ }
1963
1999
  .bk-table th,
1964
2000
  .bk-table td {
1965
2001
  border-right: 1px solid var(--table-bg-color);
@@ -6,7 +6,7 @@ import { Column, GroupColumn, ISortPropShape, TablePropTypes } from './props';
6
6
  * @param args 如果是函数,传递参数
7
7
  * @returns
8
8
  */
9
- export declare const resolvePropVal: (prop: any, key: string | string[], args: any[]) => any;
9
+ export declare const resolvePropVal: (prop: Record<string, unknown>, key: string | string[], args: unknown[]) => any;
10
10
  /**
11
11
  * 处理Props中的ActiveColumn,解析为统一的数组格式
12
12
  * @param props
@@ -117,7 +117,7 @@ export declare const getNextSortType: (sortType: string) => string;
117
117
  export declare const resolveSort: (sort: ISortPropShape, column: any, format?: any[]) => ({
118
118
  sortFn: ((_a: any, _b: any) => boolean) | ((_a: any, _b: any, index0: any, index1: any) => number);
119
119
  } & import("./props").ISortShape) | {
120
- sortFn?: Function;
120
+ sortFn?: (...args: any[]) => boolean;
121
121
  sortScope?: import("./props").SortScope;
122
122
  value: string;
123
123
  };
@@ -129,17 +129,20 @@ export declare const isRowSelectEnable: (props: any, { row, index, isCheckAll }:
129
129
  export declare const getRowId: (row: any, defVal: any, props: any) => any;
130
130
  export declare const resolveColumnSortProp: (col: Column, props: TablePropTypes) => {
131
131
  type: string;
132
- fn: Function | ((((_a: any, _b: any) => boolean) | ((_a: any, _b: any, index0: any, index1: any) => number)) & Function);
132
+ fn: ((...args: any[]) => boolean) | ((((_a: any, _b: any) => boolean) | ((_a: any, _b: any, index0: any, index1: any) => number)) & ((...args: any[]) => boolean));
133
133
  scope: import("./props").SortScope;
134
134
  active: boolean;
135
135
  enabled: boolean;
136
136
  };
137
137
  export declare const resolveColumnFilterProp: (col: Column) => {
138
138
  enabled: boolean;
139
- list: any[];
140
- filterFn?: Function;
139
+ list: {
140
+ label: string;
141
+ value: string;
142
+ }[];
143
+ filterFn?: (...args: any[]) => boolean;
141
144
  match?: import("./props").FullEnum;
142
- checked?: any[];
145
+ checked?: string[];
143
146
  filterScope?: import("./props").SortScope;
144
147
  btnSave?: string | boolean;
145
148
  btnReset?: string | boolean;
@@ -156,4 +159,4 @@ export declare const getRawData: (data: any) => any;
156
159
  * @param parentVal
157
160
  * @returns
158
161
  */
159
- export declare const getNumberOrPercentValue: (val: string | number, parentVal?: number) => number;
162
+ export declare const getNumberOrPercentValue: (val: number | string, parentVal?: number) => number;
@@ -17442,7 +17442,7 @@ var COLUMN_ATTRIBUTE = {
17442
17442
  /**
17443
17443
  * Y 轴滚动条宽度
17444
17444
  */
17445
- var SCROLLY_WIDTH = 0;
17445
+ var SCROLLY_WIDTH = 8;
17446
17446
  /**
17447
17447
  * 默认行高
17448
17448
  */
package/lib/tree/index.js CHANGED
@@ -19933,9 +19933,6 @@ var use_tree_init_this = undefined;
19933
19933
  }
19934
19934
  setNodeAttribute(item, [NODE_ATTRIBUTES.IS_MATCH], [isMatch], isTreeUI.value && isMatch);
19935
19935
  });
19936
- (0,external_vue_namespaceObject.nextTick)(function () {
19937
- scrollToTop();
19938
- });
19939
19936
  });
19940
19937
  if (!isSearchDisabled) {
19941
19938
  (0,external_vue_namespaceObject.watch)([refSearch], function () {
@@ -312,10 +312,10 @@ declare const BkVirtualRender: {
312
312
  autoReset: boolean;
313
313
  autoIndex: boolean;
314
314
  }, true, {}, import("vue").SlotsType<{
315
- default?: any;
316
- beforeContent?: any;
317
- afterContent?: any;
318
- afterSection?: any;
315
+ default?: Record<string, object>;
316
+ beforeContent?: Record<string, object>;
317
+ afterContent?: Record<string, object>;
318
+ afterSection?: Record<string, object>;
319
319
  }>, {
320
320
  P: {};
321
321
  B: {};
@@ -674,9 +674,9 @@ declare const BkVirtualRender: {
674
674
  autoReset: boolean;
675
675
  autoIndex: boolean;
676
676
  }, {}, string, import("vue").SlotsType<{
677
- default?: any;
678
- beforeContent?: any;
679
- afterContent?: any;
680
- afterSection?: any;
677
+ default?: Record<string, object>;
678
+ beforeContent?: Record<string, object>;
679
+ afterContent?: Record<string, object>;
680
+ afterSection?: Record<string, object>;
681
681
  }>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("vue").Plugin<any[]>;
682
682
  export default BkVirtualRender;