@arim-aisdc/public-components 0.0.46 → 0.0.48
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.
- package/dist/components/TableMax/TableHeader/index.less +8 -8
- package/dist/components/TableMax/TableMax.js +7 -2
- package/dist/components/TableMax/components/ColumnEdit/index.less +21 -3
- package/dist/components/TableMax/components/ColumnSetting/index.less +2 -2
- package/dist/components/TableMax/components/ColumnSort/customSortFns.d.ts +8 -8
- package/dist/components/TableMax/tableMax.less +1 -1
- package/dist/themes/variables.less +4 -0
- package/dist/themes/variablesConfig.d.ts +1 -1
- package/dist/themes/variablesConfig.js +6 -2
- package/package.json +1 -1
|
@@ -133,26 +133,26 @@ table {
|
|
|
133
133
|
|
|
134
134
|
.custom-light-select:not(.custom-light-select-customize-input) .custom-light-select-selector {
|
|
135
135
|
border-radius: 2px;
|
|
136
|
-
background-color:
|
|
136
|
+
background-color: @global-curd-input-background-color;
|
|
137
137
|
padding: 0 2px;
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
.custom-dark-select:not(.custom-dark-select-customize-input) .custom-dark-select-selector {
|
|
141
141
|
border-radius: 2px;
|
|
142
|
-
background-color:
|
|
142
|
+
background-color: @global-curd-input-background-color;
|
|
143
143
|
padding: 0 2px;
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
.custom-light-input-number {
|
|
147
147
|
width: 100% !important;
|
|
148
148
|
border-radius: 2px;
|
|
149
|
-
background-color:
|
|
149
|
+
background-color: @global-curd-input-background-color;
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
.custom-dark-input-number {
|
|
153
153
|
width: 100% !important;
|
|
154
154
|
border-radius: 2px;
|
|
155
|
-
background-color:
|
|
155
|
+
background-color: @global-curd-input-background-color;
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
.custom-dark-select-single .custom-dark-select-selector .custom-dark-select-selection-search {
|
|
@@ -171,23 +171,23 @@ table {
|
|
|
171
171
|
|
|
172
172
|
.custom-dark-picker {
|
|
173
173
|
padding: 4px;
|
|
174
|
-
background:
|
|
174
|
+
background: @global-curd-input-background-color;
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
.custom-dark-input-affix-wrapper,
|
|
178
178
|
.custom-dark-picker-input .custom-dark-picker-clear {
|
|
179
|
-
background:
|
|
179
|
+
background: @global-curd-input-background-color;
|
|
180
180
|
}
|
|
181
181
|
|
|
182
182
|
.custom-light-picker {
|
|
183
183
|
padding: 4px;
|
|
184
|
-
background:
|
|
184
|
+
background: @global-curd-input-background-color;
|
|
185
185
|
}
|
|
186
186
|
|
|
187
187
|
.custom-light-input-affix-wrapper,
|
|
188
188
|
.custom-light-input,
|
|
189
189
|
.custom-light-picker-input .custom-light-picker-clear {
|
|
190
|
-
background:
|
|
190
|
+
background: @global-curd-input-background-color;
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
193
|
}
|
|
@@ -30,7 +30,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
30
30
|
import { MinusSquareOutlined, PlusSquareOutlined } from '@ant-design/icons';
|
|
31
31
|
import { getCoreRowModel, getExpandedRowModel, getFacetedUniqueValues, getFilteredRowModel, getSortedRowModel, useReactTable } from '@tanstack/react-table';
|
|
32
32
|
import { produce } from 'immer';
|
|
33
|
-
import { cloneDeep } from 'lodash';
|
|
33
|
+
import { cloneDeep, debounce } from 'lodash';
|
|
34
34
|
import moment from 'moment';
|
|
35
35
|
import React, { createContext, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
36
36
|
import { DndProvider } from 'react-dnd';
|
|
@@ -613,12 +613,17 @@ var TableMax = function TableMax(_ref) {
|
|
|
613
613
|
}
|
|
614
614
|
}));
|
|
615
615
|
}, [tableContainerWidth, hasVerticalScrollBar, table.getState().columnSizing]);
|
|
616
|
+
var _rowSelectionChange = useCallback(debounce(function (rowOriginal, row) {
|
|
617
|
+
if (rowSelectionChange) {
|
|
618
|
+
rowSelectionChange(rowOriginal, row);
|
|
619
|
+
}
|
|
620
|
+
}, 100), [rowSelectionChange]);
|
|
616
621
|
|
|
617
622
|
// 多选数据变化回调
|
|
618
623
|
useEffect(function () {
|
|
619
624
|
var rowObjs = table.getSelectedRowModel().rows;
|
|
620
625
|
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
621
|
-
|
|
626
|
+
_rowSelectionChange(rowObjs.map(function (item) {
|
|
622
627
|
return item.original;
|
|
623
628
|
}), rowObjs);
|
|
624
629
|
}, [rowSelection]);
|
|
@@ -23,15 +23,33 @@
|
|
|
23
23
|
.custom-dark-input,
|
|
24
24
|
.custom-dark-input-affix-wrapper,
|
|
25
25
|
.custom-dark-switch {
|
|
26
|
-
background-color:
|
|
26
|
+
background-color: @global-curd-input-background-color;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
.custom-dark-switch-checked {
|
|
30
|
-
background-color:
|
|
30
|
+
background-color: @global-primary-color;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
.custom-dark-picker-clear,
|
|
34
34
|
.custom-dark-select-clear {
|
|
35
|
-
background-color:
|
|
35
|
+
background-color: @global-curd-input-background-color;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.custom-light-select,
|
|
39
|
+
.custom-light-picker,
|
|
40
|
+
.custom-light-input-number,
|
|
41
|
+
.custom-light-input,
|
|
42
|
+
.custom-light-input-affix-wrapper,
|
|
43
|
+
.custom-light-switch {
|
|
44
|
+
background-color: @global-curd-input-background-color;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.custom-light-switch-checked {
|
|
48
|
+
background-color: @global-primary-color;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.custom-light-picker-clear,
|
|
52
|
+
.custom-light-select-clear {
|
|
53
|
+
background-color: @global-curd-input-background-color;
|
|
36
54
|
}
|
|
37
55
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { TableMaxColumnType } from "../../type";
|
|
2
|
-
export declare const numberSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
3
|
-
export declare const stringSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
4
|
-
export declare const numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
5
|
-
export declare const timeSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
2
|
+
export declare const numberSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
3
|
+
export declare const stringSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
4
|
+
export declare const numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
5
|
+
export declare const timeSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
6
6
|
declare const customSortFns: {
|
|
7
|
-
numberSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
8
|
-
stringSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
9
|
-
timeSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
10
|
-
numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
7
|
+
numberSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
8
|
+
stringSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
9
|
+
timeSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
10
|
+
numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
11
11
|
};
|
|
12
12
|
export default customSortFns;
|
|
13
13
|
export type SortFnType = keyof typeof customSortFns | undefined;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
|
|
2
2
|
// @primary-color: #fa541c; // 全局主色
|
|
3
|
+
@global-primary-color: var(--global-primary-color, #fa541c); // 全局主色
|
|
4
|
+
|
|
5
|
+
// 输入框背景色
|
|
6
|
+
@global-curd-input-background-color: var(--global-curd-input-background-color, #494c5dff);
|
|
3
7
|
|
|
4
8
|
@scrollThumb: var(--scrollThumb, rgba(255, 255, 255, 0.2));
|
|
5
9
|
@scrollThumbHover: var(--scrollThumbHover, rgba(255, 255, 255, 0.3));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { VariablesConfigType } from
|
|
1
|
+
import { VariablesConfigType } from '../components/ThemeProvider';
|
|
2
2
|
export declare const PublicThemeVariablesConfig: VariablesConfigType;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export var PublicThemeVariablesConfig = {
|
|
2
|
-
|
|
2
|
+
light: {
|
|
3
|
+
'--global-curd-input-background-color': '#f5f6f7ff',
|
|
4
|
+
'--global-primary-color': '#fa541c',
|
|
3
5
|
'--scrollThumb': 'rgba(0, 0, 0, 0.2)',
|
|
4
6
|
'--scrollThumbHover': 'rgba(0, 0, 0, 0.3)',
|
|
5
7
|
'--sliderRightBorder': '#221919',
|
|
@@ -54,7 +56,9 @@ export var PublicThemeVariablesConfig = {
|
|
|
54
56
|
'--tableColor7': '#F5F6F7' // 表格列设置区列表元素边框颜色
|
|
55
57
|
},
|
|
56
58
|
|
|
57
|
-
|
|
59
|
+
dark: {
|
|
60
|
+
'--global-curd-input-background-color': '#494c5dff',
|
|
61
|
+
'--global-primary-color': '#fa541c',
|
|
58
62
|
'--primaryColor': 'blue',
|
|
59
63
|
'--split-line': '#5E6175',
|
|
60
64
|
'--scrollThumb': 'rgba(255, 255, 255, 0.2)',
|