@lingxiteam/ebe-utils 0.2.22 → 0.2.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.
- package/lib/h5public/yarn.lock +7 -8
- package/lib/pcpublic/src/components/pcfactory/src/Button/index.tsx +11 -10
- package/lib/pcpublic/src/components/pcfactory/src/Card/CardTitle/index.tsx +31 -24
- package/lib/pcpublic/src/components/pcfactory/src/Card/index.tsx +32 -14
- package/lib/pcpublic/src/components/pcfactory/src/Card/useExtendBtn.tsx +85 -48
- package/lib/pcpublic/src/components/pcfactory/src/ChartLine/ChartLine.tsx +24 -6
- package/lib/pcpublic/src/components/pcfactory/src/ChartLine/PropsType.ts +31 -5
- package/lib/pcpublic/src/components/pcfactory/src/ChartLine/index.tsx +3 -2
- package/lib/pcpublic/src/components/pcfactory/src/ChartLine/loader.tsx +1 -1
- package/lib/pcpublic/src/components/pcfactory/src/Form/Form.tsx +153 -129
- package/lib/pcpublic/src/components/pcfactory/src/Form/index.tsx +2 -5
- package/lib/pcpublic/src/components/pcfactory/src/Form/useFormStatus.ts +8 -4
- package/lib/pcpublic/src/components/pcfactory/src/LXPieChart/LXPieChart.tsx +15 -3
- package/lib/pcpublic/src/components/pcfactory/src/LXPieChart/PropsType.ts +4 -3
- package/lib/pcpublic/src/components/pcfactory/src/LXPieChart/index.tsx +1 -1
- package/lib/pcpublic/src/components/pcfactory/src/LXPieChart/loader.tsx +1 -1
- package/lib/pcpublic/src/components/pcfactory/src/LXRadarChart/LXRadarChat.tsx +18 -4
- package/lib/pcpublic/src/components/pcfactory/src/LXRadarChart/PropsType.ts +2 -1
- package/lib/pcpublic/src/components/pcfactory/src/LXRadarChart/index.tsx +1 -1
- package/lib/pcpublic/src/components/pcfactory/src/LXRadarChart/loader.tsx +1 -1
- package/lib/pcpublic/src/components/pcfactory/src/ModalSelect/BaseModalSelect.tsx +7 -2
- package/lib/pcpublic/src/components/pcfactory/src/ModalSelect/index.tsx +60 -26
- package/lib/pcpublic/src/components/pcfactory/src/RichTextEditor/LcdpUeditorMain.tsx +62 -55
- package/lib/pcpublic/src/components/pcfactory/src/RichTextEditor/RichTextEditor.tsx +2 -6
- package/lib/pcpublic/src/components/pcfactory/src/RichTextEditor/RichTextEditorMain.tsx +5 -5
- package/lib/pcpublic/src/components/pcfactory/src/RichTextEditor/index.tsx +9 -2
- package/lib/pcpublic/src/components/pcfactory/src/RichTextEditor/loader.ts +1 -1
- package/lib/pcpublic/src/components/pcfactory/src/Select/index.tsx +145 -66
- package/lib/pcpublic/src/components/pcfactory/src/Select/selectUtils.ts +13 -9
- package/lib/pcpublic/src/components/pcfactory/src/Table/BodyCell/index.tsx +36 -26
- package/lib/pcpublic/src/components/pcfactory/src/Table/EditComponent/index.tsx +69 -94
- package/lib/pcpublic/src/components/pcfactory/src/Table/FormatCell/GhostTag/index.tsx +12 -5
- package/lib/pcpublic/src/components/pcfactory/src/Table/FormatCell/Hyperlink/index.tsx +9 -5
- package/lib/pcpublic/src/components/pcfactory/src/Table/FormatCell/PointTag/index.tsx +11 -5
- package/lib/pcpublic/src/components/pcfactory/src/Table/FormatCell/PureColourFill/index.tsx +11 -5
- package/lib/pcpublic/src/components/pcfactory/src/Table/FormatCell/PureFadeColourTag/index.tsx +14 -7
- package/lib/pcpublic/src/components/pcfactory/src/Table/FormatCell/Thumbnail/index.tsx +30 -31
- package/lib/pcpublic/src/components/pcfactory/src/Table/FormatCell/index.tsx +89 -41
- package/lib/pcpublic/src/components/pcfactory/src/Table/HeaderCell/HeaderCellTitle/index.tsx +25 -12
- package/lib/pcpublic/src/components/pcfactory/src/Table/HeaderCell/index.tsx +12 -5
- package/lib/pcpublic/src/components/pcfactory/src/Table/OperationCell/PopoverWrapper.tsx +220 -0
- package/lib/pcpublic/src/components/pcfactory/src/Table/OperationCell/SingleBtn.tsx +39 -32
- package/lib/pcpublic/src/components/pcfactory/src/Table/OperationCell/index.tsx +178 -148
- package/lib/pcpublic/src/components/pcfactory/src/Table/Table.tsx +439 -0
- package/lib/pcpublic/src/components/pcfactory/src/Table/TableHead/index.tsx +159 -72
- package/lib/pcpublic/src/components/pcfactory/src/Table/TableSummaryRow/index.tsx +12 -20
- package/lib/pcpublic/src/components/pcfactory/src/Table/constant.ts +3 -0
- package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/index.ts +4 -4
- package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useCMDActions.ts +32 -28
- package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useCheckStrict.ts +44 -57
- package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useColumns.tsx +306 -276
- package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useCommon.ts +9 -6
- package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useDataSource.ts +30 -21
- package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useExpandable.tsx +33 -27
- package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useFilter.tsx +84 -77
- package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useFormatCell.tsx +33 -16
- package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/usePagination.ts +15 -5
- package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useRowEdit.ts +33 -33
- package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useRowMerge.ts +13 -5
- package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useScroll.ts +94 -28
- package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useSelection.ts +108 -99
- package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useSort.ts +8 -5
- package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useSummaryCol.ts +27 -43
- package/lib/pcpublic/src/components/pcfactory/src/Table/index.tsx +73 -394
- package/lib/pcpublic/src/components/pcfactory/src/Table/loader.tsx +15 -0
- package/lib/pcpublic/src/components/pcfactory/src/Table/types/OperationCell.d.ts +2 -2
- package/lib/pcpublic/src/components/pcfactory/src/Table/types/event.d.ts +12 -8
- package/lib/pcpublic/src/components/pcfactory/src/Table/types/headerCell.d.ts +2 -1
- package/lib/pcpublic/src/components/pcfactory/src/Table/types/prop.d.ts +24 -11
- package/lib/pcpublic/src/components/pcfactory/src/Table/utils/SequenceId.ts +2 -1
- package/lib/pcpublic/src/components/pcfactory/src/Table/utils/index.ts +90 -82
- package/lib/pcpublic/src/components/pcfactory/src/Table/utils/indexedDBHelper.ts +9 -22
- package/lib/pcpublic/src/components/pcfactory/src/Table/utils/translate.ts +59 -0
- package/lib/pcpublic/src/components/pcfactory/src/Transfer/Transfer.tsx +644 -0
- package/lib/pcpublic/src/components/pcfactory/src/Transfer/index.tsx +49 -637
- package/lib/pcpublic/src/components/pcfactory/src/Transfer/loader.tsx +11 -0
- package/lib/pcpublic/src/components/pcfactory/src/Tree/TreeEllipsisIcon.tsx +38 -0
- package/lib/pcpublic/src/components/pcfactory/src/Tree/TreeNodeMenu/index.tsx +34 -35
- package/lib/pcpublic/src/components/pcfactory/src/Tree/index.tsx +213 -149
- package/lib/pcpublic/src/components/pcfactory/src/TreeSelect/index.tsx +47 -43
- package/lib/pcpublic/src/components/pcfactory/src/TreeTable/TreeTable.tsx +264 -0
- package/lib/pcpublic/src/components/pcfactory/src/TreeTable/hooks/index.ts +4 -1
- package/lib/pcpublic/src/components/pcfactory/src/TreeTable/hooks/useCMDAction.ts +9 -3
- package/lib/pcpublic/src/components/pcfactory/src/TreeTable/hooks/useExpandable.tsx +9 -3
- package/lib/pcpublic/src/components/pcfactory/src/TreeTable/index.tsx +52 -191
- package/lib/pcpublic/src/components/pcfactory/src/TreeTable/loader.tsx +16 -0
- package/lib/pcpublic/src/components/pcfactory/src/assets/index.tsx +34 -0
- package/lib/pcpublic/src/components/pcfactory/src/assets/svg/quadrate.tsx +20 -0
- package/lib/pcpublic/src/components/pcfactory/src/assets/svg/roundness.tsx +14 -0
- package/lib/pcpublic/src/components/pcfactory/src/assets/svg/semicircle.tsx +15 -0
- package/lib/pcpublic/src/components/pcfactory/src/assets/svg/verticalLine.tsx +12 -0
- package/lib/pcpublic/src/components/pcfactory/src/styles/common.less +17 -0
- package/lib/pcpublic/src/components/pcfactory/src/styles/components/Card.less +57 -11
- package/lib/pcpublic/src/components/pcfactory/src/styles/components/Form.less +101 -12
- package/lib/pcpublic/src/components/pcfactory/src/styles/components/ModalSelect.less +6 -0
- package/lib/pcpublic/src/components/pcfactory/src/styles/components/Select.less +70 -6
- package/lib/pcpublic/src/components/pcfactory/src/utils/ChannelContainer.tsx +20 -14
- package/lib/pcpublic/src/components/pcfactory/src/utils/ChildRender.ts +6 -8
- package/lib/pcpublic/src/components/pcfactory/src/utils/CustomModule.tsx +4 -6
- package/lib/pcpublic/src/components/pcfactory/src/utils/DummyFormContext.ts +9 -13
- package/lib/pcpublic/src/components/pcfactory/src/utils/Empty/empty.tsx +5 -17
- package/lib/pcpublic/src/components/pcfactory/src/utils/Empty/index.tsx +3 -3
- package/lib/pcpublic/src/components/pcfactory/src/utils/Holidays.ts +11 -39
- package/lib/pcpublic/src/components/pcfactory/src/utils/HolidaysFormat.ts +83 -0
- package/lib/pcpublic/src/components/pcfactory/src/utils/IdleContainer/index.tsx +47 -0
- package/lib/pcpublic/src/components/pcfactory/src/utils/IdleContainer/scheduler.ts +74 -0
- package/lib/pcpublic/src/components/pcfactory/src/utils/LoaderHelper.tsx +4 -1
- package/lib/pcpublic/src/components/pcfactory/src/utils/Spin/index.tsx +8 -7
- package/lib/pcpublic/src/components/pcfactory/src/utils/WithSyncValue.ts +25 -23
- package/lib/pcpublic/src/components/pcfactory/src/utils/ahooks/index.ts +10 -7
- package/lib/pcpublic/src/components/pcfactory/src/utils/ahooks/useMap.ts +9 -6
- package/lib/pcpublic/src/components/pcfactory/src/utils/ahooks/useMemoizedFn.ts +4 -1
- package/lib/pcpublic/src/components/pcfactory/src/utils/ahooks/usePersistFn.ts +17 -0
- package/lib/pcpublic/src/components/pcfactory/src/utils/ahooks/useSafeState.ts +2 -2
- package/lib/pcpublic/src/components/pcfactory/src/utils/ahooks/useSetState.ts +7 -5
- package/lib/pcpublic/src/components/pcfactory/src/utils/common.ts +23 -50
- package/lib/pcpublic/src/components/pcfactory/src/utils/constant.ts +53 -57
- package/lib/pcpublic/src/components/pcfactory/src/utils/dynamicUtils/DynamicContext.tsx +12 -17
- package/lib/pcpublic/src/components/pcfactory/src/utils/formUtils/FormContext.tsx +22 -12
- package/lib/pcpublic/src/components/pcfactory/src/utils/formUtils/FormFields.tsx +50 -19
- package/lib/pcpublic/src/components/pcfactory/src/utils/formUtils/WrapperContainer.tsx +58 -37
- package/lib/pcpublic/src/components/pcfactory/src/utils/formUtils/cmdHelper.ts +33 -30
- package/lib/pcpublic/src/components/pcfactory/src/utils/formUtils/common.ts +2 -0
- package/lib/pcpublic/src/components/pcfactory/src/utils/generatorDisabledCallback.ts +121 -113
- package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useCommonImperativeHandle.ts +16 -14
- package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useCompState.tsx +1 -1
- package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useDataMask.ts +7 -2
- package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useDoubleClick.ts +3 -1
- package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useFuncExpExecute.ts +16 -14
- package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useGetStaticAttrData.ts +9 -3
- package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useHiddenStyle.ts +4 -5
- package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useInit.ts +11 -0
- package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useInitReactQuill.ts +3 -1
- package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useListenState.ts +1 -0
- package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useLocale.ts +5 -3
- package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/usePrintMode.tsx +2 -2
- package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useRules.ts +1 -1
- package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useTestHelper.ts +2 -0
- package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useToggleBoolean.ts +8 -4
- package/lib/pcpublic/src/components/pcfactory/src/utils/index.ts +10 -10
- package/lib/pcpublic/src/components/pcfactory/src/utils/polyfill.js +29 -31
- package/lib/pcpublic/src/components/pcfactory/src/utils/renderReadOnly.tsx +29 -26
- package/lib/public/public/iconfont.js +1 -0
- package/package.json +2 -2
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
2
|
import { useCreation } from '../../utils/ahooks';
|
|
3
|
+
import { recursionDataSource, getFullCheckedKeySet } from '../utils';
|
|
3
4
|
import { LevelItem } from '../types/prop';
|
|
4
|
-
import { getFullCheckedKeySet, recursionDataSource } from '../utils';
|
|
5
5
|
|
|
6
6
|
interface CheckStrictlyParams<T> {
|
|
7
|
-
rowSelectType?: 'checkbox' | 'radio'
|
|
8
|
-
checkLoosed?: boolean
|
|
7
|
+
rowSelectType?: 'checkbox' | 'radio',
|
|
8
|
+
checkLoosed?: boolean,
|
|
9
9
|
dataSource: T[];
|
|
10
10
|
currentRowKey: string;
|
|
11
|
-
childrenKey?: string
|
|
11
|
+
childrenKey?: string
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
function useCheckStrict<T extends {
|
|
14
|
+
function useCheckStrict<T extends {children?: T[], [key: string]: unknown}> (params: CheckStrictlyParams<T>) {
|
|
15
15
|
const { rowSelectType, checkLoosed = false, dataSource, currentRowKey, childrenKey = 'children' } = params;
|
|
16
16
|
// 父子数据是否关联选择,默认不关联
|
|
17
17
|
const checkStrictly = useMemo(() => !(rowSelectType === 'checkbox' && checkLoosed), [checkLoosed, rowSelectType]);
|
|
@@ -23,13 +23,9 @@ function useCheckStrict<T extends { children?: T[]; [key: string]: unknown }>(pa
|
|
|
23
23
|
if (!checkStrictly) {
|
|
24
24
|
relatedDisabledMap[node[currentRowKey] as string] = flag;
|
|
25
25
|
if (flag && node[childrenKey]) {
|
|
26
|
-
recursionDataSource<T>(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
relatedDisabledMap[n[currentRowKey] as string] = flag;
|
|
30
|
-
},
|
|
31
|
-
childrenKey
|
|
32
|
-
);
|
|
26
|
+
recursionDataSource<T>(node[childrenKey] as T[], (n) => {
|
|
27
|
+
relatedDisabledMap[n[currentRowKey] as string] = flag;
|
|
28
|
+
}, childrenKey);
|
|
33
29
|
}
|
|
34
30
|
}
|
|
35
31
|
};
|
|
@@ -43,26 +39,22 @@ function useCheckStrict<T extends { children?: T[]; [key: string]: unknown }>(pa
|
|
|
43
39
|
maxLevel,
|
|
44
40
|
};
|
|
45
41
|
}
|
|
46
|
-
recursionDataSource<T, LevelItem<T>>(
|
|
47
|
-
|
|
48
|
-
(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
return n;
|
|
63
|
-
},
|
|
64
|
-
'__children__'
|
|
65
|
-
);
|
|
42
|
+
recursionDataSource<T, LevelItem<T>>(dataSource, (node, parentPath) => {
|
|
43
|
+
const level = parentPath?.length || 0;
|
|
44
|
+
maxLevel = Math.max(maxLevel, level);
|
|
45
|
+
const n = {
|
|
46
|
+
...node,
|
|
47
|
+
__key__: node[currentRowKey] as string,
|
|
48
|
+
__parent__: level && parentPath ? parentPath[level - 1] : undefined,
|
|
49
|
+
__children__: node[childrenKey] as LevelItem<T>[],
|
|
50
|
+
};
|
|
51
|
+
if (levelDataMap.get(level)) {
|
|
52
|
+
levelDataMap.get(level)?.push(n);
|
|
53
|
+
} else {
|
|
54
|
+
levelDataMap.set(level, [n]);
|
|
55
|
+
}
|
|
56
|
+
return n;
|
|
57
|
+
}, '__children__');
|
|
66
58
|
return {
|
|
67
59
|
levelDataMap,
|
|
68
60
|
maxLevel,
|
|
@@ -76,16 +68,12 @@ function useCheckStrict<T extends { children?: T[]; [key: string]: unknown }>(pa
|
|
|
76
68
|
if (dataCacheMap[key]) {
|
|
77
69
|
return dataCacheMap[key];
|
|
78
70
|
}
|
|
79
|
-
recursionDataSource(
|
|
80
|
-
[
|
|
81
|
-
|
|
82
|
-
dataCacheMap[n[currentRowKey] as string] = n;
|
|
83
|
-
},
|
|
84
|
-
childrenKey
|
|
85
|
-
);
|
|
71
|
+
recursionDataSource([...dataSource, ...(extraData || [])], (n) => {
|
|
72
|
+
dataCacheMap[n[currentRowKey] as string] = n;
|
|
73
|
+
}, childrenKey);
|
|
86
74
|
return dataCacheMap[key];
|
|
87
75
|
};
|
|
88
|
-
|
|
76
|
+
|
|
89
77
|
return {
|
|
90
78
|
markDisable,
|
|
91
79
|
relatedDisabledMap,
|
|
@@ -94,16 +82,19 @@ function useCheckStrict<T extends { children?: T[]; [key: string]: unknown }>(pa
|
|
|
94
82
|
};
|
|
95
83
|
}, [dataSource, checkStrictly, currentRowKey, childrenKey]);
|
|
96
84
|
|
|
85
|
+
|
|
97
86
|
// 获取单个勾选/反选时的选中项
|
|
98
87
|
const triggerSingleSelection = (originSelectRow: T[], selectRow: T) => {
|
|
99
88
|
const key = selectRow[currentRowKey];
|
|
100
|
-
const checked = originSelectRow.findIndex(c => c[currentRowKey] === key) === -1;
|
|
101
|
-
const selectionList = checked
|
|
89
|
+
const checked = originSelectRow.findIndex((c) => c[currentRowKey] === key) === -1;
|
|
90
|
+
const selectionList = checked
|
|
91
|
+
? [...originSelectRow, selectRow]
|
|
92
|
+
: originSelectRow.filter((c) => c[currentRowKey] !== key);
|
|
102
93
|
if (checkStrictly) {
|
|
103
94
|
return selectionList;
|
|
104
95
|
}
|
|
105
96
|
const { levelDataMap, maxLevel } = getLevelDataMap();
|
|
106
|
-
const keys = selectionList.map(c => c[currentRowKey] as string);
|
|
97
|
+
const keys = selectionList.map((c) => c[currentRowKey] as string);
|
|
107
98
|
// 基于当前选中数据获取上层所有选中key
|
|
108
99
|
const checkedSet = getFullCheckedKeySet({
|
|
109
100
|
levelEntries: levelDataMap,
|
|
@@ -113,25 +104,21 @@ function useCheckStrict<T extends { children?: T[]; [key: string]: unknown }>(pa
|
|
|
113
104
|
checked,
|
|
114
105
|
});
|
|
115
106
|
const childrenRow: T[] = [];
|
|
116
|
-
recursionDataSource(
|
|
117
|
-
(
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
if (checked) {
|
|
121
|
-
childrenRow.push(n);
|
|
122
|
-
}
|
|
123
|
-
// 过滤选中集合中的部分
|
|
124
|
-
checkedSet.delete(n[currentRowKey] as string);
|
|
107
|
+
recursionDataSource(selectRow?.[childrenKey] as T[] || [], (n) => {
|
|
108
|
+
if (!relatedDisabledMap[n[currentRowKey] as string]) {
|
|
109
|
+
if (checked) {
|
|
110
|
+
childrenRow.push(n);
|
|
125
111
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
112
|
+
// 过滤选中集合中的部分
|
|
113
|
+
checkedSet.delete(n[currentRowKey] as string);
|
|
114
|
+
}
|
|
115
|
+
}, childrenKey);
|
|
116
|
+
const checkedRows = [...checkedSet].map((k) => getRecordByKey(k, selectionList));
|
|
130
117
|
return [...checkedRows, ...childrenRow];
|
|
131
118
|
};
|
|
132
119
|
|
|
133
120
|
// 根据当前选中项收集最终选中key
|
|
134
|
-
const triggerFullSelection = (checkedKeys: (string
|
|
121
|
+
const triggerFullSelection = (checkedKeys: (string|number)[]) => {
|
|
135
122
|
if (checkStrictly) {
|
|
136
123
|
return checkedKeys;
|
|
137
124
|
}
|