@jiaozhiye/qm-design-react 1.9.21 → 1.9.23

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.
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ export type AreaSelectRef = {
3
+ blur: () => void;
4
+ };
5
+ declare const AreaSelect: React.ForwardRefExoticComponent<React.RefAttributes<AreaSelectRef>>;
6
+ export default AreaSelect;
@@ -40,7 +40,6 @@ export type ITableContext = {
40
40
  isTreeTable: boolean;
41
41
  isGroupSubtotal: boolean;
42
42
  isWebPagination: boolean;
43
- isDragMergeCell: boolean;
44
43
  dataChange: () => void;
45
44
  tableChange: () => void;
46
45
  getTableData: () => Promise<void>;
@@ -7,6 +7,8 @@ import type { ComponentSize } from '../../../_utils/types';
7
7
  type IExtra = {
8
8
  getRowKey: getRowKeyType;
9
9
  tableRef: React.MutableRefObject<ITableRef>;
10
+ topElementRef: React.RefObject<HTMLDivElement>;
11
+ tableElementRef: React.RefObject<HTMLDivElement>;
10
12
  $size: ComponentSize;
11
13
  tableColumns: IColumn[];
12
14
  flattenColumns: IColumn[];
@@ -26,7 +28,7 @@ type IExtra = {
26
28
  setShouldToTop: (value: boolean) => void;
27
29
  };
28
30
  declare const useTableLayout: <T extends ITableProps>(props: T, extra: IExtra) => {
29
- createElementStore: (option: Record<string, HTMLElement>) => void;
31
+ createElementStore: () => void;
30
32
  tableStyles: React.CSSProperties;
31
33
  getSpan: (row: IRecord, column: IColumn, rowIndex: number, columnIndex: number, tableData: IRecord[]) => {
32
34
  rowSpan: number;
@@ -39,7 +39,6 @@ declare const useTableMemo: <T extends ITableProps>(props: T, extra: IExtra) =>
39
39
  isFastSearch: boolean;
40
40
  isGroupSummary: boolean;
41
41
  isGroupSubtotal: boolean;
42
- isDragMergeCell: boolean;
43
42
  isTreeTable: boolean;
44
43
  isTableEmpty: boolean;
45
44
  summationRows: Record<string, string | number>[];
@@ -19,7 +19,7 @@ export type ITableRef = {
19
19
  flattenRowKeys: IRowKey[];
20
20
  invalidRowKeys: IRowKey[];
21
21
  fieldAuth: Record<string, IFieldAuthItem>;
22
- mergeCells: IMergeCell[];
22
+ mergedCells: IMergeCell[];
23
23
  columnsDefined: boolean;
24
24
  scrollBarRef: React.RefObject<ScrollbarRef>;
25
25
  scrollXStore: {
@@ -98,7 +98,7 @@ declare const useTableRef: <T extends ITableProps>(props: T, { getRowKey, $size
98
98
  flattenRowKeys: IRowKey[];
99
99
  invalidRowKeys: IRowKey[];
100
100
  fieldAuth: Record<string, IFieldAuthItem>;
101
- mergeCells: IMergeCell[];
101
+ mergedCells: IMergeCell[];
102
102
  columnsDefined: boolean;
103
103
  scrollBarRef: React.RefObject<ScrollbarRef>;
104
104
  scrollXStore: {
@@ -143,10 +143,9 @@ export declare const propTypes: {
143
143
  nativeScrollBar: PropTypes.Requireable<boolean>;
144
144
  rowStyle: PropTypes.Requireable<object>;
145
145
  cellStyle: PropTypes.Requireable<object>;
146
- mergeCells: PropTypes.Requireable<any[]>;
146
+ mergedCells: PropTypes.Requireable<any[]>;
147
147
  spanMethod: PropTypes.Requireable<(...args: any[]) => any>;
148
148
  rowDraggable: PropTypes.Requireable<boolean>;
149
- dragMergeCell: PropTypes.Requireable<boolean>;
150
149
  initialSorter: PropTypes.Requireable<object>;
151
150
  initialFilter: PropTypes.Requireable<object>;
152
151
  rowSelection: PropTypes.Requireable<PropTypes.InferProps<{
@@ -199,6 +198,10 @@ export declare const propTypes: {
199
198
  onExpand: PropTypes.Requireable<(...args: any[]) => any>;
200
199
  onChange: PropTypes.Requireable<(...args: any[]) => any>;
201
200
  }>>;
201
+ areaSelection: PropTypes.Requireable<PropTypes.InferProps<{
202
+ cellMerge: PropTypes.Requireable<boolean>;
203
+ onCellMerge: PropTypes.Requireable<(...args: any[]) => any>;
204
+ }>>;
202
205
  summation: PropTypes.Requireable<PropTypes.InferProps<{
203
206
  groupItems: PropTypes.Requireable<(PropTypes.InferProps<{
204
207
  dataIndex: PropTypes.Validator<string>;
@@ -275,7 +278,6 @@ export declare const propTypes: {
275
278
  onRowEnter: PropTypes.Requireable<(...args: any[]) => any>;
276
279
  onScrollEnd: PropTypes.Requireable<(...args: any[]) => any>;
277
280
  onFetchError: PropTypes.Requireable<(...args: any[]) => any>;
278
- onMergeChange: PropTypes.Requireable<(...args: any[]) => any>;
279
281
  };
280
282
  export declare const defaultProps: ITableProps;
281
283
  /**
@@ -36,9 +36,7 @@ export type IRowColSpan = {
36
36
  export type IMergeCell = {
37
37
  row: number;
38
38
  col: number;
39
- rowSpan: number;
40
- colSpan: number;
41
- };
39
+ } & IRowColSpan;
42
40
  export declare enum EAlign {
43
41
  left = "flex-start",
44
42
  right = "flex-end"
@@ -219,6 +217,10 @@ export type IExpandable = {
219
217
  onExpand?: (expand: boolean, row: IRecord) => void;
220
218
  onChange?: (expandedKeys: IRowKey[], expandedRows: IRecord[]) => void;
221
219
  };
220
+ export type IAreaSelection = {
221
+ cellMerge?: boolean;
222
+ onCellMerge?: (cells: IMergeCell[]) => void;
223
+ };
222
224
  export type ISummation = {
223
225
  groupItems?: Array<{
224
226
  dataIndex: string;
@@ -346,7 +348,7 @@ export type ITableProps = {
346
348
  nativeScrollBar?: boolean;
347
349
  rowStyle?: CSSProperties | ((row: IRecord, rowIndex: number) => CSSProperties);
348
350
  cellStyle?: CSSProperties | ((row: IRecord, column: IColumn, rowIndex: number, columnIndex: number) => CSSProperties);
349
- mergeCells?: IMergeCell[];
351
+ mergedCells?: IMergeCell[];
350
352
  spanMethod?: (options: {
351
353
  row: IRecord;
352
354
  column: IColumn;
@@ -354,7 +356,6 @@ export type ITableProps = {
354
356
  columnIndex: number;
355
357
  tableData: IRecord[];
356
358
  }) => IRowColSpan | [number, number];
357
- dragMergeCell?: boolean;
358
359
  rowDraggable?: boolean;
359
360
  initialSorter?: ISorter;
360
361
  initialFilter?: IFilter;
@@ -363,6 +364,7 @@ export type ITableProps = {
363
364
  tableConfig?: ITableConfig;
364
365
  treeConfig?: ITreeConfig;
365
366
  expandable?: IExpandable;
367
+ areaSelection?: IAreaSelection;
366
368
  summation?: ISummation;
367
369
  footRender?: (flattenColumns: IColumn[], tableData: IRecord[]) => React.ReactNode;
368
370
  multipleSort?: boolean;
@@ -405,7 +407,6 @@ export type ITableProps = {
405
407
  onRowEnter?: (row: IRecord, event: KeyboardEvent) => void;
406
408
  onScrollEnd?: (event: React.MouseEvent<HTMLDivElement>) => void;
407
409
  onFetchError?: (error: any) => void;
408
- onMergeChange?: (cells: IMergeCell[]) => void;
409
410
  };
410
411
  export type TableRef = {
411
412
  CALCULATE_HEIGHT: () => void;
@@ -0,0 +1,29 @@
1
+ /*
2
+ * @Author: 焦质晔
3
+ * @Date: 2024-07-23 09:27:27
4
+ * @Last Modified by: 焦质晔
5
+ * @Last Modified time: 2024-07-24 13:32:48
6
+ */
7
+ .@{prefix-table}--area-select {
8
+ position: static;
9
+ height: 0;
10
+ font-size: 0;
11
+ .checked-area {
12
+ border: 1px solid @--primary-5;
13
+ background-color: rgba(@--primary-2, 0.35);
14
+ position: absolute;
15
+ z-index: 2;
16
+ pointer-events: none;
17
+ }
18
+ .active-area {
19
+ border: 2px solid @--primary-5;
20
+ position: absolute;
21
+ z-index: 2;
22
+ pointer-events: none;
23
+ }
24
+ .context-menu {
25
+ position: absolute;
26
+ z-index: 3;
27
+ background-color: #fff;
28
+ }
29
+ }
@@ -1,29 +1,30 @@
1
- /*
2
- * @Author: 焦质晔
3
- * @Date: 2021-07-23 19:05:57
4
- * @Last Modified by: 焦质晔
5
- * @Last Modified time: 2022-03-16 19:06:00
6
- */
7
- @import './variable.less';
8
- @import './toper.less';
9
- @import './alert.less';
10
- @import './full-screen.less';
11
- @import './reload.less';
12
- @import './print.less';
13
- @import './import.less';
14
- @import './export.less';
15
- @import './clipboard.less';
16
- @import './tollbox.less';
17
- @import './select-collection.less';
18
- @import './group-summary.less';
19
- @import './super-search.less';
20
- @import './fast-search.less';
21
- @import './column-filter.less';
22
- @import './table.less';
23
- @import './header.less';
24
- @import './body.less';
25
- @import './footer.less';
26
- @import './pager.less';
27
- @import './empty.less';
28
- @import './expandable.less';
29
- @import './size.less';
1
+ /*
2
+ * @Author: 焦质晔
3
+ * @Date: 2021-07-23 19:05:57
4
+ * @Last Modified by: 焦质晔
5
+ * @Last Modified time: 2024-07-23 09:28:50
6
+ */
7
+ @import './variable.less';
8
+ @import './toper.less';
9
+ @import './alert.less';
10
+ @import './full-screen.less';
11
+ @import './reload.less';
12
+ @import './print.less';
13
+ @import './import.less';
14
+ @import './export.less';
15
+ @import './clipboard.less';
16
+ @import './tollbox.less';
17
+ @import './select-collection.less';
18
+ @import './group-summary.less';
19
+ @import './super-search.less';
20
+ @import './fast-search.less';
21
+ @import './column-filter.less';
22
+ @import './table.less';
23
+ @import './header.less';
24
+ @import './body.less';
25
+ @import './footer.less';
26
+ @import './area-select.less';
27
+ @import './pager.less';
28
+ @import './empty.less';
29
+ @import './expandable.less';
30
+ @import './size.less';