@jiaozhiye/qm-design-react 1.11.18 → 1.11.20

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.
@@ -360,6 +360,7 @@ declare const _default: {
360
360
  title: string;
361
361
  cell: string;
362
362
  row: string;
363
+ col: string;
363
364
  };
364
365
  filter: {
365
366
  text: string;
@@ -365,7 +365,8 @@ export default {
365
365
  add: 'Add condition',
366
366
  title: 'Set fill color conditions',
367
367
  cell: 'Cell',
368
- row: 'Row'
368
+ row: 'Row',
369
+ col: 'Col'
369
370
  },
370
371
  filter: {
371
372
  text: 'Filter',
@@ -360,6 +360,7 @@ declare const _default: {
360
360
  title: string;
361
361
  cell: string;
362
362
  row: string;
363
+ col: string;
363
364
  };
364
365
  filter: {
365
366
  text: string;
@@ -365,7 +365,8 @@ export default {
365
365
  add: '添加条件',
366
366
  title: '设置填色条件',
367
367
  cell: '单元格',
368
- row: '整行'
368
+ row: '整行',
369
+ col: '整列'
369
370
  },
370
371
  filter: {
371
372
  text: '筛选',
@@ -1,16 +1,23 @@
1
1
  import React from 'react';
2
+ import type { Virtualizer } from '../../../virtual-list/src/useVirtual';
2
3
  import type { IRowKey } from '../../../table/src/table/types';
3
4
  import type { ScrollbarRef } from '../../../scrollbar';
5
+ import type { Nullable, ValueOf } from '../../../_utils/types';
6
+ type GridRef = {
7
+ bodyEl: Nullable<HTMLElement>;
8
+ rowVirtualizer: Virtualizer<HTMLElement, Element> | null;
9
+ };
4
10
  export type IGridLayoutContext = {
5
11
  scrollbarRef: React.RefObject<ScrollbarRef>;
12
+ gridRef: React.MutableRefObject<GridRef>;
6
13
  indentDepth: number;
7
14
  selectionKeys: IRowKey[];
8
15
  treeExpandKeys: IRowKey[];
9
16
  highlightKey: IRowKey;
10
17
  checkedColumnKey: string;
11
- hoverRowKey: IRowKey;
12
18
  updateLayout: number;
13
19
  clicked: [IRowKey, string] | [];
20
+ isPingLeft: boolean;
14
21
  };
15
22
  type IProps = {
16
23
  scrollbar: React.RefObject<ScrollbarRef>;
@@ -19,14 +26,15 @@ type IProps = {
19
26
  export declare const GridLayoutProvider: React.FC<IProps>;
20
27
  export declare const useGridLayoutContext: () => (IGridLayoutContext & {
21
28
  setContext: (data: Partial<IGridLayoutContext>) => void;
29
+ setGridLayoutRef: (key: string, value: ValueOf<GridRef>) => void;
22
30
  setSelectionKeys: (rowKeys: IRowKey[]) => void;
23
31
  setTreeExpandKeys: (rowKeys: IRowKey[]) => void;
24
32
  setHighlightKey: (value: IRowKey) => void;
25
33
  setCheckColumnKey: (value: string) => void;
26
- setHoverRowKey: (value: IRowKey) => void;
27
34
  forceUpdateLayout: () => void;
28
35
  updateColumnsWidth: () => void;
29
36
  setClicked: (value: [IRowKey, string] | [
30
37
  ]) => void;
38
+ setPingLeft: (value: boolean) => void;
31
39
  }) | undefined;
32
40
  export {};
@@ -7,6 +7,7 @@ type IProps = {
7
7
  layout: GroupLayout[];
8
8
  displayList: IRecord[];
9
9
  virtualRows: VirtualItem[];
10
+ notGroup: boolean;
10
11
  };
11
12
  declare const LeftPanel: React.FC<IProps>;
12
13
  export default LeftPanel;
@@ -7,6 +7,7 @@ type IProps = {
7
7
  layout: GroupLayout[];
8
8
  displayList: IRecord[];
9
9
  virtualRows: VirtualItem[];
10
+ notGroup: boolean;
10
11
  };
11
12
  declare const MainPanel: React.FC<IProps>;
12
13
  export default MainPanel;
@@ -13,7 +13,7 @@ export type SorterItem = {
13
13
  };
14
14
  export type FillColorItem = ISuperFilter & {
15
15
  color: string;
16
- mode: 'cell' | 'row';
16
+ mode: 'cell' | 'row' | 'col';
17
17
  };
18
18
  export type SearchResult = {
19
19
  value: string;
@@ -29,7 +29,7 @@ export declare const calculations: {
29
29
  empty: (arr: number[]) => number;
30
30
  notEmpty: (arr: number[]) => number;
31
31
  };
32
- export declare const flattenGroupedData: (groupData: Record<string, any> | Record<string, any>[]) => IRecord[];
32
+ export declare const flattenGroupedData: (groupData: Record<string, any> | Record<string, any>[], groupKeys?: Record<string, IOrderBy>[]) => IRecord[];
33
33
  export type GroupLayout = {
34
34
  key: IRowKey;
35
35
  top: number;
@@ -9,6 +9,26 @@
9
9
  .@{prefix-pivot-grid}__layout {
10
10
  .reset-container();
11
11
  width: 100%;
12
+
13
+ // =========== 变量 ===========
14
+ @header-bg-color: #d7f0ff;
15
+ @border-radius: 8px;
16
+ .bor-radius-left() {
17
+ border-top-left-radius: @border-radius;
18
+ border-bottom-left-radius: @border-radius;
19
+ }
20
+ .bor-radius-right() {
21
+ border-top-right-radius: @border-radius;
22
+ border-bottom-right-radius: @border-radius;
23
+ }
24
+ .bor-left-shadow() {
25
+ box-shadow: -5px 0px 0 0px @--background-color-light;
26
+ }
27
+ .bor-right-shadow() {
28
+ box-shadow: 5px 0px 0 0px @--background-color-light;
29
+ }
30
+ // =========== 变量 END ===========
31
+
12
32
  .@{qm-prefix}-scrollbar__wrap {
13
33
  // 调整为 flex 布局
14
34
  display: flex;
@@ -28,11 +48,21 @@
28
48
  display: flex;
29
49
  border-left: 1px solid @--border-color-secondary;
30
50
  border-bottom: 1px solid @--border-color-secondary;
51
+ .bor-left-shadow();
52
+ &,
53
+ .table-cell:first-child {
54
+ .bor-radius-left();
55
+ }
31
56
  }
32
57
  .no-fixed {
33
58
  flex: 1 0;
34
59
  display: flex;
35
60
  border-bottom: 1px solid @--border-color-secondary;
61
+ .bor-right-shadow();
62
+ &,
63
+ .table-cell:last-child {
64
+ .bor-radius-right();
65
+ }
36
66
  }
37
67
  }
38
68
  .header {
@@ -41,7 +71,7 @@
41
71
  z-index: 2;
42
72
  .table-cell {
43
73
  position: relative;
44
- background-color: #d6f2ff !important;
74
+ background-color: @header-bg-color !important;
45
75
  cursor: pointer;
46
76
  }
47
77
  .resize-bar {
@@ -129,9 +159,6 @@
129
159
  .cell {
130
160
  .text-overflow-cut();
131
161
  padding: 0 @--padding-sm;
132
- &.indent {
133
- padding-left: 16px;
134
- }
135
162
  }
136
163
  }
137
164
  .label-cell,
@@ -185,6 +212,22 @@
185
212
  border-left: 1px solid @--primary-3;
186
213
  z-index: 2;
187
214
  pointer-events: none;
215
+ &::after {
216
+ content: '';
217
+ position: absolute;
218
+ top: 0;
219
+ right: 0;
220
+ bottom: -1px;
221
+ width: 20px;
222
+ transform: translateX(100%);
223
+ transition: box-shadow 0.3s, -webkit-box-shadow 0.3s;
224
+ pointer-events: none;
225
+ }
226
+ &.active {
227
+ &::after {
228
+ box-shadow: inset 10px 0 8px -8px rgba(0, 0, 0, 0.15);
229
+ }
230
+ }
188
231
  }
189
232
  // 左侧面板
190
233
  .left-panel {
@@ -193,6 +236,30 @@
193
236
  z-index: 1;
194
237
  .group-label {
195
238
  border-right: 0 !important;
239
+ .bor-radius-left();
240
+ &.level0 {
241
+ .bor-left-shadow();
242
+ }
243
+ }
244
+ .row-item {
245
+ &:nth-of-type(1) {
246
+ border-top-left-radius: @border-radius;
247
+ .bor-left-shadow();
248
+ .table-cell:first-child {
249
+ border-top-left-radius: @border-radius;
250
+ }
251
+ }
252
+ &.last {
253
+ border-bottom-left-radius: @border-radius;
254
+ .table-cell:first-child {
255
+ border-bottom-left-radius: @border-radius;
256
+ }
257
+ }
258
+ }
259
+ .no-group {
260
+ .row-item:last-child {
261
+ .bor-left-shadow();
262
+ }
196
263
  }
197
264
  }
198
265
  .main-panel {
@@ -202,6 +269,23 @@
202
269
  .row-item {
203
270
  border-left: 0 !important;
204
271
  }
272
+ .group-label {
273
+ .bor-radius-right();
274
+ }
275
+ .row-item {
276
+ &:nth-of-type(1) {
277
+ border-top-right-radius: @border-radius;
278
+ .table-cell:last-child {
279
+ border-top-right-radius: @border-radius;
280
+ }
281
+ }
282
+ &.last {
283
+ border-bottom-right-radius: @border-radius;
284
+ .table-cell:last-child {
285
+ border-bottom-right-radius: @border-radius;
286
+ }
287
+ }
288
+ }
205
289
  }
206
290
  .container {
207
291
  position: relative;
@@ -237,7 +321,11 @@
237
321
  .title {
238
322
  flex-shrink: 0;
239
323
  margin-right: 20px;
240
- font-weight: 700;
324
+ font-weight: 600;
325
+ .empty {
326
+ color: @--text-color-placeholder;
327
+ font-weight: 400;
328
+ }
241
329
  }
242
330
  }
243
331
  }
@@ -14,7 +14,7 @@
14
14
  }
15
15
  &:not(.is-from-table) {
16
16
  border: 1px solid @--border-color-secondary;
17
- border-radius: @--border-radius-lg;
17
+ border-radius: @--border-radius-lg + 2px;
18
18
  }
19
19
  .top-bar {
20
20
  display: flex;
@@ -1,6 +1,7 @@
1
1
  import React, { Component } from 'react';
2
2
  import ConfigContext from '../../config-provider/context';
3
- import { QmForm, QmFormItem } from '../../index';
3
+ import type { IFormItem } from '../../form';
4
+ import Form from '../../form';
4
5
  type IProps = {
5
6
  setting: {
6
7
  distance: {
@@ -19,13 +20,13 @@ type IProps = {
19
20
  onClose: () => void;
20
21
  };
21
22
  type IState = {
22
- formList: QmFormItem[];
23
+ formList: IFormItem[];
23
24
  };
24
25
  declare class Setting extends Component<IProps, IState> {
25
26
  static contextType: React.Context<import("../../config-provider/context").IConfig>;
26
27
  context: React.ContextType<typeof ConfigContext>;
27
- formRef: React.RefObject<QmForm>;
28
- createFormList: () => QmFormItem[];
28
+ formRef: React.RefObject<Form>;
29
+ createFormList: () => IFormItem[];
29
30
  getInitialvalue: () => {
30
31
  disleft: number;
31
32
  disright: number;
@@ -8,6 +8,7 @@ type ITableConfig = {
8
8
  rowKey?: ((row: IRecord, index: number) => IRowKey) | IRowKey;
9
9
  webPagination?: boolean;
10
10
  paginationConfig?: IPaginationConfig;
11
+ topBarExtra?: React.ReactNode;
11
12
  };
12
13
  type IProps = {
13
14
  size?: ComponentSize;
@@ -1,34 +1,35 @@
1
- /*
2
- * @Author: 焦质晔
3
- * @Date: 2022-01-11 18:01:20
4
- * @Last Modified by: 焦质晔
5
- * @Last Modified time: 2022-09-04 16:40:18
6
- */
7
- @import '../../style/common';
8
-
9
- @prefix-search-tree: ~'@{qm-prefix}-search-tree';
10
-
11
- .@{prefix-search-tree} {
12
- .reset-container();
13
- height: 100%;
14
- .topper {
15
- display: flex;
16
- justify-content: space-between;
17
- align-items: center;
18
- .ant-input-search {
19
- flex: 1 0;
20
- margin-bottom: 8px;
21
- }
22
- .trigger {
23
- margin-left: 8px;
24
- margin-bottom: 8px;
25
- }
26
- }
27
- .ant-tree {
28
- .filter-node {
29
- & > span:last-of-type {
30
- color: @--primary-color;
31
- }
32
- }
33
- }
34
- }
1
+ /*
2
+ * @Author: 焦质晔
3
+ * @Date: 2022-01-11 18:01:20
4
+ * @Last Modified by: 焦质晔
5
+ * @Last Modified time: 2022-09-04 16:40:18
6
+ */
7
+ @import '../../style/common';
8
+
9
+ @prefix-search-tree: ~'@{qm-prefix}-search-tree';
10
+
11
+ .@{prefix-search-tree} {
12
+ .reset-container();
13
+ height: 100%;
14
+ .topper {
15
+ display: flex;
16
+ justify-content: space-between;
17
+ align-items: center;
18
+ .ant-input-search {
19
+ flex: 1 0;
20
+ margin-bottom: 8px;
21
+ }
22
+ .trigger {
23
+ flex-shrink: 0;
24
+ margin-left: 8px;
25
+ margin-bottom: 8px;
26
+ }
27
+ }
28
+ .ant-tree {
29
+ .filter-node {
30
+ & > span:last-of-type {
31
+ color: @--primary-color;
32
+ }
33
+ }
34
+ }
35
+ }
@@ -30276,6 +30276,7 @@ body {
30276
30276
  margin-bottom: 8px;
30277
30277
  }
30278
30278
  .qm-search-tree .topper .trigger {
30279
+ flex-shrink: 0;
30279
30280
  margin-left: 8px;
30280
30281
  margin-bottom: 8px;
30281
30282
  }
@@ -31035,7 +31036,7 @@ body {
31035
31036
  }
31036
31037
  .qm-pivot-grid:not(.is-from-table) {
31037
31038
  border: 1px solid #e8e8e8;
31038
- border-radius: 4px;
31039
+ border-radius: 6px;
31039
31040
  }
31040
31041
  .qm-pivot-grid .top-bar {
31041
31042
  display: flex;
@@ -31259,12 +31260,28 @@ body {
31259
31260
  display: flex;
31260
31261
  border-left: 1px solid #e8e8e8;
31261
31262
  border-bottom: 1px solid #e8e8e8;
31263
+ box-shadow: -5px 0px 0 0px #f5f5f5;
31264
+ }
31265
+ .qm-pivot-grid__layout .header .fixed-left,
31266
+ .qm-pivot-grid__layout .footer .fixed-left,
31267
+ .qm-pivot-grid__layout .header .fixed-left .table-cell:first-child,
31268
+ .qm-pivot-grid__layout .footer .fixed-left .table-cell:first-child {
31269
+ border-top-left-radius: 8px;
31270
+ border-bottom-left-radius: 8px;
31262
31271
  }
31263
31272
  .qm-pivot-grid__layout .header .no-fixed,
31264
31273
  .qm-pivot-grid__layout .footer .no-fixed {
31265
31274
  flex: 1 0;
31266
31275
  display: flex;
31267
31276
  border-bottom: 1px solid #e8e8e8;
31277
+ box-shadow: 5px 0px 0 0px #f5f5f5;
31278
+ }
31279
+ .qm-pivot-grid__layout .header .no-fixed,
31280
+ .qm-pivot-grid__layout .footer .no-fixed,
31281
+ .qm-pivot-grid__layout .header .no-fixed .table-cell:last-child,
31282
+ .qm-pivot-grid__layout .footer .no-fixed .table-cell:last-child {
31283
+ border-top-right-radius: 8px;
31284
+ border-bottom-right-radius: 8px;
31268
31285
  }
31269
31286
  .qm-pivot-grid__layout .header {
31270
31287
  position: sticky;
@@ -31273,7 +31290,7 @@ body {
31273
31290
  }
31274
31291
  .qm-pivot-grid__layout .header .table-cell {
31275
31292
  position: relative;
31276
- background-color: #d6f2ff !important;
31293
+ background-color: #d7f0ff !important;
31277
31294
  cursor: pointer;
31278
31295
  }
31279
31296
  .qm-pivot-grid__layout .header .resize-bar {
@@ -31392,11 +31409,6 @@ body {
31392
31409
  white-space: nowrap;
31393
31410
  padding: 0 8px;
31394
31411
  }
31395
- .qm-pivot-grid__layout .header .table-cell .cell.indent,
31396
- .qm-pivot-grid__layout .body .table-cell .cell.indent,
31397
- .qm-pivot-grid__layout .footer .table-cell .cell.indent {
31398
- padding-left: 16px;
31399
- }
31400
31412
  .qm-pivot-grid__layout .header .label-cell:hover .count-select,
31401
31413
  .qm-pivot-grid__layout .body .label-cell:hover .count-select,
31402
31414
  .qm-pivot-grid__layout .footer .label-cell:hover .count-select,
@@ -31460,6 +31472,20 @@ body {
31460
31472
  z-index: 2;
31461
31473
  pointer-events: none;
31462
31474
  }
31475
+ .qm-pivot-grid__layout .fixed-line::after {
31476
+ content: '';
31477
+ position: absolute;
31478
+ top: 0;
31479
+ right: 0;
31480
+ bottom: -1px;
31481
+ width: 20px;
31482
+ transform: translateX(100%);
31483
+ transition: box-shadow 0.3s;
31484
+ pointer-events: none;
31485
+ }
31486
+ .qm-pivot-grid__layout .fixed-line.active::after {
31487
+ box-shadow: inset 10px 0 8px -8px rgba(0, 0, 0, 0.15);
31488
+ }
31463
31489
  .qm-pivot-grid__layout .left-panel {
31464
31490
  position: sticky;
31465
31491
  left: 0;
@@ -31467,6 +31493,27 @@ body {
31467
31493
  }
31468
31494
  .qm-pivot-grid__layout .left-panel .group-label {
31469
31495
  border-right: 0 !important;
31496
+ border-top-left-radius: 8px;
31497
+ border-bottom-left-radius: 8px;
31498
+ }
31499
+ .qm-pivot-grid__layout .left-panel .group-label.level0 {
31500
+ box-shadow: -5px 0px 0 0px #f5f5f5;
31501
+ }
31502
+ .qm-pivot-grid__layout .left-panel .row-item:nth-of-type(1) {
31503
+ border-top-left-radius: 8px;
31504
+ box-shadow: -5px 0px 0 0px #f5f5f5;
31505
+ }
31506
+ .qm-pivot-grid__layout .left-panel .row-item:nth-of-type(1) .table-cell:first-child {
31507
+ border-top-left-radius: 8px;
31508
+ }
31509
+ .qm-pivot-grid__layout .left-panel .row-item.last {
31510
+ border-bottom-left-radius: 8px;
31511
+ }
31512
+ .qm-pivot-grid__layout .left-panel .row-item.last .table-cell:first-child {
31513
+ border-bottom-left-radius: 8px;
31514
+ }
31515
+ .qm-pivot-grid__layout .left-panel .no-group .row-item:last-child {
31516
+ box-shadow: -5px 0px 0 0px #f5f5f5;
31470
31517
  }
31471
31518
  .qm-pivot-grid__layout .main-panel {
31472
31519
  flex: 1 0;
@@ -31476,6 +31523,22 @@ body {
31476
31523
  .qm-pivot-grid__layout .main-panel .row-item {
31477
31524
  border-left: 0 !important;
31478
31525
  }
31526
+ .qm-pivot-grid__layout .main-panel .group-label {
31527
+ border-top-right-radius: 8px;
31528
+ border-bottom-right-radius: 8px;
31529
+ }
31530
+ .qm-pivot-grid__layout .main-panel .row-item:nth-of-type(1) {
31531
+ border-top-right-radius: 8px;
31532
+ }
31533
+ .qm-pivot-grid__layout .main-panel .row-item:nth-of-type(1) .table-cell:last-child {
31534
+ border-top-right-radius: 8px;
31535
+ }
31536
+ .qm-pivot-grid__layout .main-panel .row-item.last {
31537
+ border-bottom-right-radius: 8px;
31538
+ }
31539
+ .qm-pivot-grid__layout .main-panel .row-item.last .table-cell:last-child {
31540
+ border-bottom-right-radius: 8px;
31541
+ }
31479
31542
  .qm-pivot-grid__layout .container {
31480
31543
  position: relative;
31481
31544
  left: 0;
@@ -31511,7 +31574,11 @@ body {
31511
31574
  .qm-pivot-grid__layout .container .group-label .label-cell .title {
31512
31575
  flex-shrink: 0;
31513
31576
  margin-right: 20px;
31514
- font-weight: 700;
31577
+ font-weight: 600;
31578
+ }
31579
+ .qm-pivot-grid__layout .container .group-label .label-cell .title .empty {
31580
+ color: rgba(0, 0, 0, 0.45);
31581
+ font-weight: 400;
31515
31582
  }
31516
31583
  .qm-pivot-grid__layout .container .row-item {
31517
31584
  position: absolute;