dcp-design-react 1.11.16 → 1.11.18

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.
@@ -18,6 +18,7 @@ export type ITableContext = {
18
18
  sorter: ITableState['sorter'];
19
19
  filters: ITableState['filters'];
20
20
  superFilters: ITableState['superFilters'];
21
+ activedCell: ITableState['activedCell'];
21
22
  mergedTdCells: IMergedCell[];
22
23
  derivedMergeCells: IMergeCellItem[];
23
24
  layout: ITableState['layout'];
@@ -56,6 +57,7 @@ export type ITableContext = {
56
57
  setSelectionRows: (records: IRecord[]) => void;
57
58
  setSelectionKeysEffect: (rowKeys: IRowKey[]) => void;
58
59
  setInvalidRowKeys: (rowKeys: IRowKey[]) => void;
60
+ setActivedCell: (value: ITableState['activedCell']) => void;
59
61
  setMergedCells: (options: IMergedCell[]) => void;
60
62
  getSpan: (row: IRecord, column: IColumn, rowIndex: number, columnIndex: number, tableData: IRecord[]) => IRowColSpan;
61
63
  getStickyLeft: (dataIndex: string, part?: string) => number;
@@ -67,7 +69,6 @@ export type ITableContext = {
67
69
  setPingRight: (value: boolean) => void;
68
70
  setSpinning: (value: boolean) => void;
69
71
  setFullScreen: (value: boolean) => void;
70
- setShouldToTop: (value: boolean) => void;
71
72
  doFieldValidate: (rules: IRule[], val: unknown, rowKey: IRowKey, columnKey: string, columnTitle: string) => void;
72
73
  createTableData: (list: IRecord[]) => void;
73
74
  createGroupData: (records: IRecord[]) => IRecord[];
@@ -63,8 +63,6 @@ declare const useTableCore: <T extends ITableProps>(props: T, extra: IExtra) =>
63
63
  createTableList: () => IRecord<any>[];
64
64
  createTableData: (list: IRecord[]) => void;
65
65
  createGroupData: (list: IRecord[]) => IRecord<any>[];
66
- createSelectionKeys: (rowKeys?: IRowKey[]) => (string | number)[];
67
- createRowExpandedKeys: (rowKeys?: IRowKey[]) => (string | number)[];
68
66
  setSelectionKeysEffect: (selectedKeys: IRowKey[]) => void;
69
67
  findParentRowKeys: (deriveRowKeyList: IDerivedRowKey[], key: IRowKey) => (string | number)[];
70
68
  getAllChildRowKeys: (deriveRowKeyList: IDerivedRowKey[]) => (string | number)[];
@@ -27,8 +27,6 @@ type IExtra = {
27
27
  setResizeState: (option: ITableRef['resizeState']) => void;
28
28
  setUnMounted: (value: boolean) => void;
29
29
  calcTableHeight: () => void;
30
- createSelectionKeys: (rowKeys?: IRowKey[]) => IRowKey[];
31
- createRowExpandedKeys: (rowKeys?: IRowKey[]) => IRowKey[];
32
30
  initialTable: () => void;
33
31
  destroy: () => void;
34
32
  };
@@ -22,7 +22,6 @@ type IExtra = {
22
22
  isFullScreen: boolean;
23
23
  setLayout: <T extends ITableState['layout']>(layout: T | ((prev: T) => T)) => void;
24
24
  setElementStore: (key: string, value: HTMLElement) => void;
25
- setShouldToTop: (value: boolean) => void;
26
25
  };
27
26
  declare const useTableLayout: <T extends ITableProps>(props: T, extra: IExtra) => {
28
27
  createElementStore: () => void;
@@ -35,7 +35,6 @@ export type ITableRef = {
35
35
  isTreeTable: boolean;
36
36
  scrollXLoad: boolean;
37
37
  scrollYLoad: boolean;
38
- shouldToTop: boolean;
39
38
  selectionRows: IRecord[];
40
39
  recordsMap: Map<IRowKey, IRecord>;
41
40
  unMounted: boolean;
@@ -60,7 +59,6 @@ declare const useTableRef: <T extends ITableProps>(props: T, { getRowKey, $size
60
59
  setSummaries: (option: ITableRef['summaries']) => void;
61
60
  setScrollXLoad: (value: boolean) => void;
62
61
  setScrollYLoad: (value: boolean) => void;
63
- setShouldToTop: (value: boolean) => void;
64
62
  setSelectionRows: (selectKeys: IRecord[]) => void;
65
63
  setRecordsMap: (key: IRowKey, value: IRecord) => void;
66
64
  setUnMounted: (value: boolean) => void;
@@ -96,7 +94,6 @@ declare const useTableRef: <T extends ITableProps>(props: T, { getRowKey, $size
96
94
  isTreeTable: boolean;
97
95
  scrollXLoad: boolean;
98
96
  scrollYLoad: boolean;
99
- shouldToTop: boolean;
100
97
  selectionRows: IRecord[];
101
98
  recordsMap: Map<IRowKey, IRecord>;
102
99
  unMounted: boolean;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import type { IFilter, IMergedCell, IPagination, IRecord, IRowKey, ISorter, ISuperFilter, ITableProps } from '../table/types';
2
+ import type { IFilter, IMergedCell, IPagination, IRecord, IRowKey, ISearchResult, ISorter, ISuperFilter, ITableProps } from '../table/types';
3
3
  export type ITableState = {
4
4
  tableFlatData: IRecord[];
5
5
  filters: IFilter;
@@ -10,6 +10,7 @@ export type ITableState = {
10
10
  rowExpandedKeys: IRowKey[];
11
11
  highlightKey: IRowKey;
12
12
  updateMark: number;
13
+ activedCell: Partial<ISearchResult>;
13
14
  mergedTdCells: IMergedCell[];
14
15
  layout: {
15
16
  gutterWidth: number;
@@ -51,6 +52,8 @@ declare const useTableState: <T extends ITableProps>(props: T) => {
51
52
  setHighlightKey: React.Dispatch<React.SetStateAction<string | number>>;
52
53
  updateMark: number;
53
54
  forceUpdate: React.DispatchWithoutAction;
55
+ activedCell: Partial<ISearchResult>;
56
+ setActivedCell: React.Dispatch<Partial<ISearchResult>>;
54
57
  mergedTdCells: IMergedCell[];
55
58
  setMergedCells: (updater: IMergedCell[] | ((origin: IMergedCell[]) => IMergedCell[])) => void;
56
59
  layout: {
@@ -82,6 +82,13 @@ export type ISorter = {
82
82
  export type ISummaries = {
83
83
  [key: string]: number;
84
84
  };
85
+ export type ISearchResult = {
86
+ value: string;
87
+ rowKey: IRowKey;
88
+ dataIndex: string;
89
+ rowIndex: number;
90
+ colIndex: number;
91
+ };
85
92
  export type ISuperFilter = {
86
93
  type: string;
87
94
  bracketLeft: string;
@@ -1,108 +1,150 @@
1
- /*
2
- * @Author: 焦质晔
3
- * @Date: 2022-03-16 19:05:30
4
- * @Last Modified by: 焦质晔
5
- * @Last Modified time: 2022-11-26 21:11:04
6
- */
7
- .@{prefix-table}-fast-search {
8
- display: inline-block;
9
- padding: 5px 3px;
10
- line-height: 1;
11
- cursor: pointer;
12
- transition: all 0.3s ease;
13
- .icon {
14
- font-size: 1.05em;
15
- }
16
- &:hover {
17
- color: @v-primary-color;
18
- }
19
- }
20
-
21
- .@{prefix-table}-fast-search__setting {
22
- height: 100%;
23
- .main {
24
- display: flex;
25
- flex-direction: column;
26
- height: 100%;
27
- .top {
28
- display: flex;
29
- flex: 1;
30
- height: 0;
31
- overflow-y: auto;
32
- .container {
33
- flex: 1;
34
- width: 0;
35
- .@{qm-prefix}-tabs {
36
- margin-top: -5px;
37
- }
38
- }
39
- .saved {
40
- width: 200px;
41
- .form-wrap {
42
- display: flex;
43
- }
44
- .card-wrap {
45
- margin-top: @v-module-distance;
46
- border: 1px solid @v-table-border-color;
47
- > h5 {
48
- display: flex;
49
- align-items: center;
50
- font-size: inherit;
51
- font-weight: normal;
52
- margin-bottom: 0;
53
- padding: 0 @v-module-distance;
54
- border-bottom: 1px solid @v-table-border-color;
55
- background-color: @v-table-header-background-color;
56
- }
57
- > ul {
58
- margin-bottom: 0;
59
- li {
60
- display: flex;
61
- align-items: center;
62
- position: relative;
63
- padding: 6px @v-module-distance;
64
- border-bottom: 1px solid @v-table-border-color;
65
- cursor: pointer;
66
- transition: all 0.3s ease;
67
- &:last-of-type {
68
- border-bottom: 0;
69
- }
70
- &:hover {
71
- background-color: @v-table-row-hover-background-color;
72
- .close {
73
- visibility: visible;
74
- }
75
- }
76
- &.selected {
77
- background-color: @v-table-row-selected-background-color;
78
- }
79
- .title {
80
- i {
81
- margin-right: 5px;
82
- }
83
- }
84
- .close {
85
- position: absolute;
86
- right: @v-module-distance;
87
- visibility: hidden;
88
- }
89
- }
90
- }
91
- }
92
- }
93
- .line {
94
- border-left: 1px dashed @--border-color-base;
95
- padding-left: @v-module-distance;
96
- margin-left: @v-module-distance;
97
- }
98
- }
99
- .bottom {
100
- display: flex;
101
- justify-content: space-between;
102
- align-items: center;
103
- padding: 10px 5px;
104
- margin-top: 10px;
105
- border-top: 1px dashed @--border-color-base;
106
- }
107
- }
108
- }
1
+ /*
2
+ * @Author: 焦质晔
3
+ * @Date: 2022-03-16 19:05:30
4
+ * @Last Modified by: 焦质晔
5
+ * @Last Modified time: 2022-11-26 21:11:04
6
+ */
7
+ .@{prefix-table}-fast-search {
8
+ display: inline-block;
9
+ padding: 5px 3px;
10
+ line-height: 1;
11
+ cursor: pointer;
12
+ transition: all 0.3s ease;
13
+ .icon {
14
+ font-size: 1.05em;
15
+ }
16
+ &:hover {
17
+ color: @v-primary-color;
18
+ }
19
+ }
20
+
21
+ .@{prefix-table}-fast-search__setting {
22
+ height: 100%;
23
+ .main {
24
+ display: flex;
25
+ flex-direction: row;
26
+ height: 100%;
27
+ .container {
28
+ flex: 1;
29
+ min-width: 0;
30
+ display: flex;
31
+ flex-direction: column;
32
+ .search-box {
33
+ display: flex;
34
+ align-items: center;
35
+ .label {
36
+ width: 100px;
37
+ }
38
+ }
39
+ .condition {
40
+ margin-top: @v-module-distance;
41
+ margin-bottom: @v-module-distance;
42
+ }
43
+ .all-list {
44
+ flex: 1 0;
45
+ min-height: 0;
46
+ overflow-y: auto;
47
+ .rtable {
48
+ width: 100%;
49
+ border: 1px solid @v-table-border-color;
50
+ thead {
51
+ position: sticky;
52
+ top: 0;
53
+ th {
54
+ background-color: @v-table-header-background-color;
55
+ height: 30px;
56
+ text-align: center;
57
+ }
58
+ }
59
+ tbody {
60
+ tr {
61
+ &.active {
62
+ td {
63
+ background-color: @--primary-1;
64
+ color: @v-primary-color;
65
+ }
66
+ }
67
+ &:hover {
68
+ td {
69
+ text-decoration: underline;
70
+ }
71
+ }
72
+ td {
73
+ height: 30px;
74
+ text-align: center;
75
+ border-top: 1px solid @v-table-border-color;
76
+ cursor: pointer;
77
+ .text-overflow-cut();
78
+ max-width: 0;
79
+ }
80
+ }
81
+ }
82
+ }
83
+ }
84
+ }
85
+ .saved {
86
+ width: 240px;
87
+ .form-wrap {
88
+ display: flex;
89
+ }
90
+ .card-wrap {
91
+ margin-top: @v-module-distance;
92
+ border: 1px solid @v-table-border-color;
93
+ > h5 {
94
+ display: flex;
95
+ align-items: center;
96
+ font-size: inherit;
97
+ font-weight: normal;
98
+ margin-bottom: 0;
99
+ padding: 0 @v-module-distance;
100
+ border-bottom: 1px solid @v-table-border-color;
101
+ background-color: @v-table-header-background-color;
102
+ }
103
+ > ul {
104
+ margin-bottom: 0;
105
+ li {
106
+ display: flex;
107
+ align-items: center;
108
+ position: relative;
109
+ padding: 6px @v-module-distance;
110
+ border-bottom: 1px solid @v-table-border-color;
111
+ cursor: pointer;
112
+ transition: all 0.3s ease;
113
+ &:last-of-type {
114
+ border-bottom: 0;
115
+ }
116
+ &:hover {
117
+ background-color: @v-table-row-hover-background-color;
118
+ .close {
119
+ visibility: visible;
120
+ }
121
+ }
122
+ &.selected {
123
+ background-color: @v-table-row-selected-background-color;
124
+ }
125
+ .title {
126
+ i {
127
+ margin-right: 5px;
128
+ }
129
+ }
130
+ .close {
131
+ position: absolute;
132
+ right: @v-module-distance;
133
+ visibility: hidden;
134
+ }
135
+ }
136
+ }
137
+ }
138
+ }
139
+ .line {
140
+ border-left: 1px dashed @--border-color-base;
141
+ padding-left: @v-module-distance;
142
+ margin-left: @v-module-distance;
143
+ }
144
+ }
145
+ .bottom-bar {
146
+ display: flex;
147
+ justify-content: space-between;
148
+ align-items: center;
149
+ }
150
+ }