@lingxiteam/ebe-utils 0.2.22 → 0.2.24
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/Layout/index.tsx +2 -2
- 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 +6 -4
- 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
package/lib/h5public/yarn.lock
CHANGED
|
@@ -3200,15 +3200,14 @@
|
|
|
3200
3200
|
resolved "http://npm.iwhalecloud.com:8081/repository/npm-taobao/@lingxiteam/editor-types/-/editor-types-3.7.1.tgz#d6bb18884fa5ef68e636cffa74ac0b6af71e91bf"
|
|
3201
3201
|
integrity sha512-I3u3XqcC74k9ecCcaJy5j7tQolCNfNRjBjc8wl6eZVY5YlZOSOApOG2pTgdF0yHNBYYcM0BMpexrjhZp4FVNAQ==
|
|
3202
3202
|
|
|
3203
|
-
"@lingxiteam/icons
|
|
3204
|
-
version "
|
|
3205
|
-
resolved "
|
|
3206
|
-
integrity sha512-
|
|
3203
|
+
"@lingxiteam/icons@^4.3.1-alhpa.2":
|
|
3204
|
+
version "4.3.1-alhpa.2"
|
|
3205
|
+
resolved "http://npm.iwhalecloud.com:8081/repository/npm-taobao/@lingxiteam/icons/-/icons-4.3.1-alhpa.2.tgz#80f74d8ab6d8bab734a67dd5b41b4bd269fa1139"
|
|
3206
|
+
integrity sha512-4wbfqGxXDV3BUdSqm5sFPYcuEIDtP5+9VBNVhJ5TPFpjcLsf3Dwnh4P7thXFu+3bSZVaXffGHQGzvWrgLeILsQ==
|
|
3207
3207
|
dependencies:
|
|
3208
|
-
"@ant-design/icons" "^4.
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
rc-util "4.10.0"
|
|
3208
|
+
"@ant-design/icons" "^4.7.0"
|
|
3209
|
+
"@babel/runtime" "7.23.2"
|
|
3210
|
+
rc-util "^4.10.0"
|
|
3212
3211
|
|
|
3213
3212
|
"@lingxiteam/load-framework@0.2.1":
|
|
3214
3213
|
version "0.2.1"
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Button } from 'antd';
|
|
1
|
+
import Button from 'antd/es/button';
|
|
3
2
|
import type { ButtonProps } from 'antd/lib/button';
|
|
4
3
|
import React, { useImperativeHandle, useMemo } from 'react';
|
|
5
|
-
import CommIcon from '../Icon';
|
|
6
4
|
import type { IconCfg } from '../Icon/PropsType';
|
|
5
|
+
import CommIcon from '../Icon';
|
|
6
|
+
import { handleIsValidIconCfg } from '../Icon/hooks';
|
|
7
7
|
import { useListenProps, useListenToggleBoolean } from '../utils';
|
|
8
|
+
import { LingxiForwardRef } from '@lingxiteam/types';
|
|
8
9
|
import useDoubleClick from '../utils/hooks/useDoubleClick';
|
|
9
10
|
|
|
10
11
|
const WrapperButton = ({ children }: Record<string, any>) =>
|
|
@@ -87,14 +88,14 @@ const MyButton = LingxiForwardRef<any, MyButtonProps>((props, ref) => {
|
|
|
87
88
|
if (contentData?.name) {
|
|
88
89
|
setBtnText(contentData.name);
|
|
89
90
|
delete contentData.name;
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
setIcon({ ...contentData, type: contentData.iconType });
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (handleIsValidIconCfg(contentData)) {
|
|
94
|
+
setHasIcon(true);
|
|
95
|
+
if (!iconPosition) {
|
|
96
|
+
setIconPosition('left');
|
|
97
97
|
}
|
|
98
|
+
setIcon(contentData);
|
|
98
99
|
}
|
|
99
100
|
},
|
|
100
101
|
setLoading,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import React, { useEffect, useState, useRef, useMemo } from 'react';
|
|
1
2
|
import { Tooltip } from 'antd';
|
|
2
|
-
import
|
|
3
|
+
import { useEventListener } from 'ahooks';
|
|
3
4
|
|
|
4
5
|
interface CardTitleProps {
|
|
5
6
|
title?: any;
|
|
@@ -15,7 +16,7 @@ interface CardTitleProps {
|
|
|
15
16
|
subTitleClassName?: string;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
|
-
const CardTitle: React.FC<CardTitleProps> = props => {
|
|
19
|
+
const CardTitle: React.FC<CardTitleProps> = (props) => {
|
|
19
20
|
const {
|
|
20
21
|
title,
|
|
21
22
|
subTitle,
|
|
@@ -39,16 +40,16 @@ const CardTitle: React.FC<CardTitleProps> = props => {
|
|
|
39
40
|
const [showSubPopover, setShowSubPopover] = useState(false);
|
|
40
41
|
|
|
41
42
|
const mainTitle = useMemo(() => {
|
|
43
|
+
let lineHeight = titleLineHeight;
|
|
44
|
+
// 为了兼容一些设置了行高为auto的历史数据
|
|
45
|
+
if (titleLineHeight && ['auto', 'fit-content', 'autopx', 'fit-contentpx'].includes(titleLineHeight)) {
|
|
46
|
+
lineHeight = undefined;
|
|
47
|
+
}
|
|
42
48
|
return (
|
|
43
49
|
<div
|
|
44
50
|
className="main"
|
|
45
51
|
ref={mainTitleRef}
|
|
46
|
-
style={{
|
|
47
|
-
color: titleColor,
|
|
48
|
-
fontSize: titleFont,
|
|
49
|
-
lineHeight: titleLineHeight,
|
|
50
|
-
fontWeight: titleFontWeight,
|
|
51
|
-
}}
|
|
52
|
+
style={{ color: titleColor, fontSize: titleFont, lineHeight, fontWeight: titleFontWeight }}
|
|
52
53
|
>
|
|
53
54
|
{title}
|
|
54
55
|
</div>
|
|
@@ -56,16 +57,16 @@ const CardTitle: React.FC<CardTitleProps> = props => {
|
|
|
56
57
|
}, [title, titleColor, titleFont, titleLineHeight, titleFontWeight]);
|
|
57
58
|
|
|
58
59
|
const secondTitle = useMemo(() => {
|
|
60
|
+
let lineHeight = subTitleLineHeight;
|
|
61
|
+
// 为了兼容一些设置了行高为auto的历史数据
|
|
62
|
+
if (subTitleLineHeight && ['auto', 'fit-content', 'autopx', 'fit-contentpx'].includes(subTitleLineHeight)) {
|
|
63
|
+
lineHeight = undefined;
|
|
64
|
+
}
|
|
59
65
|
return (
|
|
60
66
|
<div
|
|
61
67
|
className="sub"
|
|
62
68
|
ref={subTitleRef}
|
|
63
|
-
style={{
|
|
64
|
-
color: subTitleColor,
|
|
65
|
-
fontSize: subTitleFont,
|
|
66
|
-
lineHeight: subTitleLineHeight,
|
|
67
|
-
fontWeight: subTitleFontWeight,
|
|
68
|
-
}}
|
|
69
|
+
style={{ color: subTitleColor, fontSize: subTitleFont, lineHeight, fontWeight: subTitleFontWeight }}
|
|
69
70
|
>
|
|
70
71
|
{subTitle}
|
|
71
72
|
</div>
|
|
@@ -88,21 +89,27 @@ const CardTitle: React.FC<CardTitleProps> = props => {
|
|
|
88
89
|
}
|
|
89
90
|
};
|
|
90
91
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}
|
|
92
|
+
// resizeObserver Api太新ie不支持,使用ahook的方法
|
|
93
|
+
// useEffect(() => {
|
|
94
|
+
// const resizeObserver = new ResizeObserver((entries) => {
|
|
95
|
+
// checkTitleIsElipsis();
|
|
96
|
+
// });
|
|
97
|
+
// // 使用ResizeObserver来监听窗口尺寸变化
|
|
98
|
+
// resizeObserver.observe(document.body);
|
|
99
|
+
// return (() => {
|
|
100
|
+
// resizeObserver.unobserve(document.body);
|
|
101
|
+
// });
|
|
102
|
+
// }, []);
|
|
103
|
+
|
|
104
|
+
useEventListener('resize', () => {
|
|
105
|
+
checkTitleIsElipsis();
|
|
106
|
+
});
|
|
101
107
|
|
|
102
108
|
useEffect(() => {
|
|
103
109
|
checkTitleIsElipsis();
|
|
104
110
|
}, [mainTitle, secondTitle]);
|
|
105
111
|
|
|
112
|
+
|
|
106
113
|
return (
|
|
107
114
|
<>
|
|
108
115
|
{showMainPopover && (
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { LingxiForwardRef } from '@lingxiteam/types';
|
|
2
1
|
import { Card, Skeleton } from 'antd';
|
|
3
2
|
import type { CardProps } from 'antd/lib/card';
|
|
4
3
|
import classnames from 'classnames';
|
|
5
4
|
import React, { useImperativeHandle, useMemo, useState } from 'react';
|
|
6
5
|
import CommIcon from '../Icon';
|
|
7
|
-
import { useHiddenStyle } from '../utils';
|
|
8
6
|
import useBackgroundStyle from '../View/useBackgroundStyle';
|
|
9
|
-
import
|
|
7
|
+
import { useHiddenStyle } from '../utils';
|
|
8
|
+
import { LingxiForwardRef } from '@lingxiteam/types';
|
|
10
9
|
import useExtendBtn from './useExtendBtn';
|
|
10
|
+
import CardTitle from './CardTitle';
|
|
11
11
|
|
|
12
12
|
export type FunctionHandleType = (e: any) => void;
|
|
13
13
|
|
|
@@ -70,11 +70,11 @@ const MyCard = LingxiForwardRef<any, MyCardProps>((props, ref) => {
|
|
|
70
70
|
pageState,
|
|
71
71
|
pagePublicState,
|
|
72
72
|
className,
|
|
73
|
-
cardIconType,
|
|
73
|
+
cardIconType = '',
|
|
74
74
|
titleColor,
|
|
75
75
|
backgroundType,
|
|
76
76
|
appId,
|
|
77
|
-
prefixIcon
|
|
77
|
+
prefixIcon,
|
|
78
78
|
getEngineApis,
|
|
79
79
|
subTitle,
|
|
80
80
|
titleFont,
|
|
@@ -89,7 +89,7 @@ const MyCard = LingxiForwardRef<any, MyCardProps>((props, ref) => {
|
|
|
89
89
|
const [loading, setLoading] = useState(props.loading);
|
|
90
90
|
const engineApis = getEngineApis?.() || {};
|
|
91
91
|
|
|
92
|
-
const { padding, ...restStyle } = style || {};
|
|
92
|
+
const { padding, headPadding, ...restStyle } = style || {} as any;
|
|
93
93
|
const { backgroundStyle } = useBackgroundStyle({
|
|
94
94
|
engineApis,
|
|
95
95
|
backgroundType,
|
|
@@ -106,6 +106,9 @@ const MyCard = LingxiForwardRef<any, MyCardProps>((props, ref) => {
|
|
|
106
106
|
}
|
|
107
107
|
if (hasHeader === false) {
|
|
108
108
|
s.display = 'none';
|
|
109
|
+
} else {
|
|
110
|
+
s.display = 'flex';
|
|
111
|
+
s.alignItems = 'center';
|
|
109
112
|
}
|
|
110
113
|
return s;
|
|
111
114
|
}, [headerColor, hasHeader]);
|
|
@@ -138,14 +141,24 @@ const MyCard = LingxiForwardRef<any, MyCardProps>((props, ref) => {
|
|
|
138
141
|
if (hasIcon || cardIconType) {
|
|
139
142
|
switch (cardIconType) {
|
|
140
143
|
case 'middle':
|
|
141
|
-
|
|
144
|
+
case 'middleDivider':
|
|
145
|
+
return <div className="ued-card-title ued-card-title-middle">{cardTitle}</div>;
|
|
142
146
|
case 'left':
|
|
147
|
+
case 'leftNoDivider':
|
|
143
148
|
return <div className="ued-card-title ued-card-title-icon-left">{cardTitle}</div>;
|
|
144
149
|
case 'auto': {
|
|
145
|
-
const {
|
|
146
|
-
|
|
150
|
+
const {
|
|
151
|
+
prefixIconIsIconFont,
|
|
152
|
+
prefixIconFontAddress,
|
|
153
|
+
prefixIconTheme,
|
|
154
|
+
prefixIconType,
|
|
155
|
+
prefixIconiconFile,
|
|
156
|
+
prefixIconIconFileInfo,
|
|
157
|
+
isSystem,
|
|
158
|
+
systemIconKey,
|
|
159
|
+
} = prefixIcon || {};
|
|
147
160
|
return (
|
|
148
|
-
<div className=
|
|
161
|
+
<div className={classnames('ued-card-title ued-card-title-icon-auto', prefixIcon && 'ued-card-title-icon-custom')}>
|
|
149
162
|
<CommIcon
|
|
150
163
|
icon={{
|
|
151
164
|
type: prefixIconType,
|
|
@@ -154,6 +167,8 @@ const MyCard = LingxiForwardRef<any, MyCardProps>((props, ref) => {
|
|
|
154
167
|
fontAddress: prefixIconFontAddress,
|
|
155
168
|
iconFile: prefixIconiconFile,
|
|
156
169
|
iconFileInfo: prefixIconIconFileInfo,
|
|
170
|
+
isSystem,
|
|
171
|
+
systemIconKey,
|
|
157
172
|
}}
|
|
158
173
|
engineApis={engineApis}
|
|
159
174
|
getEngineApis={getEngineApis}
|
|
@@ -162,8 +177,7 @@ const MyCard = LingxiForwardRef<any, MyCardProps>((props, ref) => {
|
|
|
162
177
|
/>
|
|
163
178
|
{cardTitle}
|
|
164
179
|
</div>
|
|
165
|
-
);
|
|
166
|
-
}
|
|
180
|
+
); }
|
|
167
181
|
case 'none':
|
|
168
182
|
return <div className="ued-card-style-less-title">{cardTitle}</div>;
|
|
169
183
|
default:
|
|
@@ -189,11 +203,15 @@ const MyCard = LingxiForwardRef<any, MyCardProps>((props, ref) => {
|
|
|
189
203
|
style={finalStyle}
|
|
190
204
|
{...restProps}
|
|
191
205
|
className={classnames('ued-card', className, {
|
|
192
|
-
'ued-card-simple':
|
|
206
|
+
'ued-card-simple': ['leftNoDivider', 'middle'].includes(cardIconType),
|
|
193
207
|
})}
|
|
194
208
|
size={size}
|
|
195
209
|
title={renderTitle()}
|
|
196
|
-
headStyle={
|
|
210
|
+
headStyle={{
|
|
211
|
+
padding: headPadding,
|
|
212
|
+
...headStyle,
|
|
213
|
+
display: ['flex', 'table', undefined].includes(headStyle.display) ? 'block' : headStyle.display,
|
|
214
|
+
}}
|
|
197
215
|
bodyStyle={padding ? { padding, ...backgroundStyle, ...bodyStyleRelative } : { ...backgroundStyle, ...bodyStyleRelative }}
|
|
198
216
|
extra={<div className="ued-card-extend">{renderExtendBtn()}</div>}
|
|
199
217
|
>
|
|
@@ -1,28 +1,27 @@
|
|
|
1
|
-
import { Icon } from '@lingxiteam/icons';
|
|
2
|
-
import { Button, Popover, Tooltip } from 'antd';
|
|
3
1
|
import { ButtonType } from 'antd/lib/button';
|
|
4
|
-
import { SizeType } from 'antd/lib/config-provider/SizeContext';
|
|
5
|
-
import CommIcon from '../Icon';
|
|
6
2
|
import type { IconCfg } from '../Icon/PropsType';
|
|
3
|
+
import { Button, Popover, Tooltip } from 'antd';
|
|
4
|
+
import { Icon } from '@lingxiteam/icons';
|
|
5
|
+
import CommIcon from '../Icon';
|
|
6
|
+
import React from 'react';
|
|
7
7
|
import { useLocale } from '../utils/hooks/useLocale';
|
|
8
|
+
import { SizeType } from 'antd/lib/config-provider/SizeContext';
|
|
8
9
|
|
|
9
10
|
interface ExtendProps {
|
|
10
|
-
extend?: Array<{
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
checked?: boolean;
|
|
11
|
+
extend?: Array<{icon: IconCfg,
|
|
12
|
+
iconPos: 'left' | 'right',
|
|
13
|
+
id: string,
|
|
14
|
+
btnType?: ButtonType,
|
|
15
|
+
btnSize?: SizeType,
|
|
16
|
+
isIcon?: boolean,
|
|
17
|
+
rule?: string,
|
|
18
|
+
visible?: boolean,
|
|
19
|
+
checked?: boolean,
|
|
20
20
|
value?: string;
|
|
21
|
-
disabled?: boolean
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
$$componentItem?: any;
|
|
21
|
+
disabled?: boolean}>,
|
|
22
|
+
getEngineApis: any;
|
|
23
|
+
extendNum?: number;
|
|
24
|
+
$$componentItem?: any;
|
|
26
25
|
prefixCls?: string;
|
|
27
26
|
[key: string | number]: unknown;
|
|
28
27
|
}
|
|
@@ -35,14 +34,30 @@ const useExtendBtn = (props: ExtendProps) => {
|
|
|
35
34
|
const renderBtn = (btnList: any, isPopover = false, clicks: any) => {
|
|
36
35
|
if (Array.isArray(btnList)) {
|
|
37
36
|
return btnList.map((c, i) => {
|
|
38
|
-
const {
|
|
37
|
+
const {
|
|
38
|
+
icon,
|
|
39
|
+
iconPos,
|
|
40
|
+
id,
|
|
41
|
+
btnType,
|
|
42
|
+
btnSize,
|
|
43
|
+
isIcon,
|
|
44
|
+
rule,
|
|
45
|
+
visible: buttonVisible = true,
|
|
46
|
+
disabled,
|
|
47
|
+
} = c;
|
|
39
48
|
const handleOnClick = (e: any) => {
|
|
40
49
|
if (clicks[i] && typeof clicks[i] === 'function') {
|
|
41
50
|
clicks[i](e);
|
|
42
51
|
}
|
|
43
52
|
};
|
|
44
53
|
const BtnIcon = icon ? (
|
|
45
|
-
<Button
|
|
54
|
+
<Button
|
|
55
|
+
className={`${prefixCls}-extend-iconBtn`}
|
|
56
|
+
type="link"
|
|
57
|
+
disabled={disabled}
|
|
58
|
+
key={isIcon && id}
|
|
59
|
+
onClick={isIcon && handleOnClick}
|
|
60
|
+
>
|
|
46
61
|
{/** @ts-ignore */}
|
|
47
62
|
<CommIcon icon={icon} engineApis={engineApis} getEngineApis={getEngineApis} />
|
|
48
63
|
</Button>
|
|
@@ -66,37 +81,55 @@ const useExtendBtn = (props: ExtendProps) => {
|
|
|
66
81
|
)
|
|
67
82
|
) : isPopover ? (
|
|
68
83
|
<div>
|
|
69
|
-
<Button
|
|
70
|
-
{
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
84
|
+
<Button
|
|
85
|
+
disabled={disabled}
|
|
86
|
+
key={id}
|
|
87
|
+
type="link"
|
|
88
|
+
size={btnSize}
|
|
89
|
+
onClick={handleOnClick}
|
|
90
|
+
>
|
|
91
|
+
{iconPos && iconPos === 'left' && icon &&
|
|
92
|
+
<CommIcon
|
|
93
|
+
icon={icon}
|
|
94
|
+
engineApis={engineApis}
|
|
95
|
+
getEngineApis={getEngineApis}
|
|
96
|
+
$$componentItem={props.$$componentItem}
|
|
97
|
+
className=""
|
|
98
|
+
/>}
|
|
79
99
|
{c.title}
|
|
80
|
-
{iconPos && iconPos === 'right' && icon &&
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
/>
|
|
88
|
-
)}
|
|
100
|
+
{iconPos && iconPos === 'right' && icon && <CommIcon
|
|
101
|
+
icon={icon}
|
|
102
|
+
engineApis={engineApis}
|
|
103
|
+
getEngineApis={getEngineApis}
|
|
104
|
+
$$componentItem={props.$$componentItem}
|
|
105
|
+
className=""
|
|
106
|
+
/>}
|
|
89
107
|
</Button>
|
|
90
108
|
</div>
|
|
91
109
|
) : (
|
|
92
|
-
<Button
|
|
93
|
-
{
|
|
94
|
-
|
|
95
|
-
|
|
110
|
+
<Button
|
|
111
|
+
disabled={disabled}
|
|
112
|
+
key={id}
|
|
113
|
+
className={`${prefixCls}-extend-btn`}
|
|
114
|
+
type={btnType}
|
|
115
|
+
size={btnSize}
|
|
116
|
+
onClick={handleOnClick}
|
|
117
|
+
>
|
|
118
|
+
{iconPos && iconPos === 'left' && icon && <CommIcon
|
|
119
|
+
icon={icon}
|
|
120
|
+
engineApis={engineApis}
|
|
121
|
+
getEngineApis={getEngineApis}
|
|
122
|
+
$$componentItem={props.$$componentItem}
|
|
123
|
+
className=""
|
|
124
|
+
/>}
|
|
96
125
|
{c.title}
|
|
97
|
-
{iconPos && iconPos === 'right' && icon &&
|
|
98
|
-
|
|
99
|
-
|
|
126
|
+
{iconPos && iconPos === 'right' && icon && <CommIcon
|
|
127
|
+
icon={icon}
|
|
128
|
+
engineApis={engineApis}
|
|
129
|
+
getEngineApis={getEngineApis}
|
|
130
|
+
$$componentItem={props.$$componentItem}
|
|
131
|
+
className=""
|
|
132
|
+
/>}
|
|
100
133
|
</Button>
|
|
101
134
|
)
|
|
102
135
|
) : null
|
|
@@ -120,7 +153,11 @@ const useExtendBtn = (props: ExtendProps) => {
|
|
|
120
153
|
const clicks = [...showBtnClick];
|
|
121
154
|
const preBtn = btnList.splice(0, extendNum);
|
|
122
155
|
const preClicks = clicks.splice(0, extendNum);
|
|
123
|
-
const content =
|
|
156
|
+
const content = (
|
|
157
|
+
<div className={`${prefixCls}-extend-btn-pop`}>
|
|
158
|
+
{renderBtn(btnList, true, clicks)}
|
|
159
|
+
</div>
|
|
160
|
+
);
|
|
124
161
|
return (
|
|
125
162
|
<>
|
|
126
163
|
{renderBtn(preBtn, false, preClicks)}
|
|
@@ -1,17 +1,35 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { LingXiFC } from '@lingxiteam/types';
|
|
3
|
-
import { useHiddenStyle } from '../utils';
|
|
4
3
|
import { useFuncExpExecute } from '../utils/hooks/useFuncExpExecute';
|
|
5
|
-
import { useLocale } from '../utils/hooks/useLocale';
|
|
6
4
|
import ChartLineProps from './PropsType';
|
|
5
|
+
import { LXChart } from '@lingxiteam/charts-common';
|
|
6
|
+
import { useHiddenStyle } from '../utils';
|
|
7
|
+
import useBackgroundStyle from '../View/useBackgroundStyle';
|
|
8
|
+
import { useLocale } from '../utils/hooks/useLocale';
|
|
9
|
+
|
|
7
10
|
|
|
8
11
|
const ChartLine: LingXiFC<ChartLineProps> = (props, ref) => {
|
|
9
|
-
const {
|
|
12
|
+
const {
|
|
13
|
+
style,
|
|
14
|
+
className,
|
|
15
|
+
getEngineApis,
|
|
16
|
+
exampleData,
|
|
17
|
+
dataSource,
|
|
18
|
+
dataSourceTop,
|
|
19
|
+
visible = true,
|
|
20
|
+
$$componentItem,
|
|
21
|
+
backgroundType,
|
|
22
|
+
...restProps
|
|
23
|
+
} = props;
|
|
10
24
|
|
|
11
25
|
const finalStyle = useHiddenStyle(visible, style);
|
|
12
26
|
const engineApis = getEngineApis?.();
|
|
27
|
+
const { backgroundStyle } = useBackgroundStyle({ backgroundType, engineApis, appId: $$componentItem?.appId, mode: 'engine' });
|
|
28
|
+
|
|
13
29
|
const { getLocale } = useLocale(engineApis);
|
|
14
|
-
const {
|
|
30
|
+
const {
|
|
31
|
+
sandBoxSafeRun,
|
|
32
|
+
} = engineApis || {};
|
|
15
33
|
|
|
16
34
|
const funcExpExecute = useFuncExpExecute(sandBoxSafeRun as any, getLocale);
|
|
17
35
|
|
|
@@ -24,7 +42,7 @@ const ChartLine: LingXiFC<ChartLineProps> = (props, ref) => {
|
|
|
24
42
|
|
|
25
43
|
return (
|
|
26
44
|
<LXChart
|
|
27
|
-
style={finalStyle}
|
|
45
|
+
style={{ ...backgroundStyle, ...(finalStyle || {}) }}
|
|
28
46
|
className={className}
|
|
29
47
|
configProps={configProps}
|
|
30
48
|
isEditMode={false}
|
|
@@ -28,7 +28,16 @@ export default interface ChartLineProps {
|
|
|
28
28
|
yAxisMaxRight?: number;
|
|
29
29
|
yAxisFormatterRight?: string;
|
|
30
30
|
color: any[]; // 颜色
|
|
31
|
-
layout:
|
|
31
|
+
layout:
|
|
32
|
+
| 'top'
|
|
33
|
+
| 'left'
|
|
34
|
+
| 'leftTop'
|
|
35
|
+
| 'rightTop'
|
|
36
|
+
| 'bottom'
|
|
37
|
+
| 'right'
|
|
38
|
+
| 'rightBottom'
|
|
39
|
+
| 'leftBottom'
|
|
40
|
+
| 'horizontal'; // 图标布局
|
|
32
41
|
smooth?: boolean; // 平滑曲线
|
|
33
42
|
lineType: 'solid' | 'dashed' | 'dotted'; // 线类型
|
|
34
43
|
stacked?: any; // 堆叠
|
|
@@ -42,11 +51,27 @@ export default interface ChartLineProps {
|
|
|
42
51
|
tooltipFormatter?: string; // 提示内容值后缀
|
|
43
52
|
label?: any; // 标签支持扩展
|
|
44
53
|
showLable?: boolean; // 数字标签显隐
|
|
45
|
-
symbol:
|
|
54
|
+
symbol:
|
|
55
|
+
| 'circle'
|
|
56
|
+
| 'rect'
|
|
57
|
+
| 'roundRect'
|
|
58
|
+
| 'triangle'
|
|
59
|
+
| 'diamond'
|
|
60
|
+
| 'pin'
|
|
61
|
+
| 'arrow'
|
|
62
|
+
| 'none'; // 标记图形 - 只有折线图存在symbol
|
|
46
63
|
symbolSize: number; // 标记大小
|
|
47
64
|
markPoint?: any; // 标签支持扩展
|
|
48
65
|
showMarkPoint?: boolean; // 标注显隐
|
|
49
|
-
markPointSymbol?:
|
|
66
|
+
markPointSymbol?:
|
|
67
|
+
| 'circle'
|
|
68
|
+
| 'rect'
|
|
69
|
+
| 'roundRect'
|
|
70
|
+
| 'triangle'
|
|
71
|
+
| 'diamond'
|
|
72
|
+
| 'pin'
|
|
73
|
+
| 'arrow'
|
|
74
|
+
| 'none'; // 标注图形
|
|
50
75
|
markPointType: 'min' | 'max' | 'average'; // 标注纬度
|
|
51
76
|
markLine?: any; // 标线支持扩展
|
|
52
77
|
showMarkLine?: boolean; // 标线显隐
|
|
@@ -59,5 +84,6 @@ export default interface ChartLineProps {
|
|
|
59
84
|
barGap?: number; // 组内间距
|
|
60
85
|
getEngineApis?: any; // 运行态api
|
|
61
86
|
funcExpExecute?: any;
|
|
62
|
-
|
|
63
|
-
|
|
87
|
+
backgroundType?:any;
|
|
88
|
+
// eslint-disable-next-line no-extra-semi
|
|
89
|
+
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import React, { useImperativeHandle } from 'react';
|
|
1
2
|
import { LingxiForwardRef } from '@lingxiteam/types';
|
|
2
|
-
import { useImperativeHandle } from 'react';
|
|
3
3
|
import CharBarLoader from './loader';
|
|
4
4
|
import ChartLineProps from './PropsType';
|
|
5
|
+
import classNames from 'classnames';
|
|
5
6
|
|
|
6
7
|
const ChartLine = LingxiForwardRef<unknown, ChartLineProps>((props, ref) => {
|
|
7
8
|
useImperativeHandle(ref, () => ({
|
|
@@ -9,7 +10,7 @@ const ChartLine = LingxiForwardRef<unknown, ChartLineProps>((props, ref) => {
|
|
|
9
10
|
// 由于组件采用懒加载延迟执行组件,导致组件在未加载完成的时候已经执行了页面加载完成的生命周期,所以未来的指令方法不应放入懒加载中,避免页面加载完成时机无法调用指令。
|
|
10
11
|
}));
|
|
11
12
|
|
|
12
|
-
return <CharBarLoader {...props} />;
|
|
13
|
+
return <CharBarLoader {...props} className={classNames(props.className, 'ued-chartLine')} />;
|
|
13
14
|
});
|
|
14
15
|
|
|
15
16
|
export default ChartLine;
|
|
@@ -2,7 +2,7 @@ import Loadable from 'react-loadable';
|
|
|
2
2
|
import { LoadingComponennt } from '../utils/LoaderHelper';
|
|
3
3
|
|
|
4
4
|
const LoadableChartLine = Loadable({
|
|
5
|
-
loader: async () => (await import
|
|
5
|
+
loader: async () => (await import/* webpackChunkName: 'pcfactory-ChartLine' */('./ChartLine')) as unknown as React.ComponentType<any>,
|
|
6
6
|
loading: LoadingComponennt,
|
|
7
7
|
});
|
|
8
8
|
|