@zat-design/sisyphus-react 3.1.4 → 3.1.5-beta.10
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/.dumi/theme/builtins/Alert.tsx +19 -0
- package/.dumi/theme/builtins/Previewer.tsx +232 -0
- package/.dumi/theme/builtins/SourceCode.tsx +64 -0
- package/.dumi/theme/hooks/useCodeSandbox.tsx +197 -0
- package/.dumi/theme/hooks/useTheme.tsx +707 -0
- package/.dumi/theme/layouts/BasicLayout.tsx +88 -0
- package/.dumi/theme/layouts/components/Dark.less +157 -0
- package/.dumi/theme/layouts/components/Dark.tsx +78 -0
- package/.dumi/theme/layouts/components/Navbar.tsx +83 -0
- package/.dumi/theme/layouts/components/SideMenu.tsx +61 -0
- package/.dumi/theme/layouts/index.tsx +26 -0
- package/.dumi/theme/layouts/layout.less +87 -0
- package/.dumi/theme/typings.d.ts +7 -0
- package/dist/index.esm.css +122 -249
- package/es/ProAction/index.less +3 -2
- package/es/ProConfigProvider/index.d.ts +2 -0
- package/es/ProConfigProvider/index.js +18 -2
- package/es/ProDrawerForm/index.js +5 -3
- package/es/ProDrawerForm/style/index.less +15 -11
- package/es/ProEditLabel/style/index.less +2 -2
- package/es/ProEditTable/style/index.less +15 -8
- package/es/ProEditTable/utils/config.js +11 -4
- package/es/ProEnum/style/index.less +1 -1
- package/es/ProForm/components/base/RangePicker/index.js +0 -3
- package/es/ProForm/components/base/TextArea/index.less +1 -1
- package/es/ProForm/components/combination/Container/style/index.less +0 -1
- package/es/ProForm/components/combination/FormList/style/index.less +20 -19
- package/es/ProForm/components/combination/Group/index.js +2 -2
- package/es/ProForm/components/combination/ProAddressBar/index.js +81 -61
- package/es/ProForm/components/combination/ProAddressBar/propsType.d.ts +3 -2
- package/es/ProForm/components/combination/ProModalSelect/index.js +75 -13
- package/es/ProForm/components/combination/ProModalSelect/propsType.d.ts +1 -0
- package/es/ProForm/components/combination/ProModalSelect/style/index.less +3 -3
- package/es/ProForm/components/combination/ProNumberRange/style/index.less +1 -1
- package/es/ProForm/components/combination/ProRangeLimit/index.d.ts +1 -1
- package/es/ProForm/components/combination/ProTimeLimit/index.d.ts +10 -5
- package/es/ProForm/components/combination/ProTimeLimit/style/index.less +1 -1
- package/es/ProForm/components/old/EnumSelect/style/index.less +7 -8
- package/es/ProForm/components/render/RenderFields.js +10 -5
- package/es/ProForm/components/render/propsType.d.ts +5 -4
- package/es/ProForm/index.js +5 -0
- package/es/ProForm/style/index.less +55 -169
- package/es/ProForm/utils/useShouldUpdate.js +16 -16
- package/es/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +2 -2
- package/es/ProLayout/components/ProCollapse/style/index.less +4 -4
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +21 -0
- package/es/ProLayout/components/ProHeader/components/index.d.ts +1 -0
- package/es/ProLayout/components/ProHeader/components/index.js +2 -1
- package/es/ProLayout/components/ProHeader/index.js +4 -2
- package/es/ProLayout/components/ProHeader/style/index.less +16 -7
- package/es/ProStep/style/index.less +0 -1
- package/es/ProTable/components/RenderColumn/index.d.ts +5 -5
- package/es/ProTable/components/RenderColumn/index.js +41 -25
- package/es/ProTable/index.js +3 -2
- package/es/ProTable/propsType.d.ts +2 -0
- package/es/ProTable/style/index.less +14 -1
- package/es/ProTable/utils.d.ts +1 -1
- package/es/ProTable/utils.js +258 -201
- package/es/ProTabs/style/index.less +1 -1
- package/es/ProThemeTools/component/PrdTools/index.js +1 -1
- package/es/ProThemeTools/component/PrdTools/style/index.less +3 -3
- package/es/ProThemeTools/index.d.ts +2 -2
- package/es/ProThemeTools/index.js +24 -17
- package/es/ProThemeTools/propsType.d.ts +8 -6
- package/es/ProThemeTools/style/index.less +2 -2
- package/es/ProThemeTools/utils/index.d.ts +7 -0
- package/es/ProThemeTools/utils/index.js +19 -1
- package/es/ProTree/components/ProTree.js +1 -1
- package/es/ProTree/components/SearchTitle.d.ts +2 -2
- package/es/ProTree/components/SearchTitle.js +11 -1
- package/es/ProTree/components/Tree.js +6 -1
- package/es/ProTree/style/index.less +193 -141
- package/es/ProTreeModal/style/index.less +2 -6
- package/es/ProUpload/style/index.less +41 -39
- package/es/index.d.ts +2 -1
- package/es/index.js +2 -1
- package/es/locale/en_US.d.ts +69 -0
- package/es/locale/en_US.js +68 -0
- package/es/locale/index.d.ts +7 -0
- package/es/locale/index.js +21 -0
- package/es/locale/zh_CN.d.ts +69 -0
- package/es/locale/zh_CN.js +68 -0
- package/es/old/ProEditableTable/style/index.less +1 -2
- package/es/style/components.less +0 -1
- package/es/style/core/normalize.less +1 -1
- package/es/style/theme/antd.less +3 -4
- package/es/style/theme/index.less +80 -79
- package/es/style/theme/tokens.less +1 -0
- package/lib/ProAction/index.less +3 -2
- package/lib/ProConfigProvider/index.d.ts +2 -0
- package/lib/ProConfigProvider/index.js +17 -2
- package/lib/ProDrawerForm/index.js +5 -3
- package/lib/ProDrawerForm/style/index.less +15 -11
- package/lib/ProEditLabel/style/index.less +2 -2
- package/lib/ProEditTable/style/index.less +15 -8
- package/lib/ProEditTable/utils/config.js +11 -4
- package/lib/ProEnum/style/index.less +1 -1
- package/lib/ProForm/components/base/RangePicker/index.js +0 -3
- package/lib/ProForm/components/base/TextArea/index.less +1 -1
- package/lib/ProForm/components/combination/Container/style/index.less +0 -1
- package/lib/ProForm/components/combination/FormList/style/index.less +20 -19
- package/lib/ProForm/components/combination/Group/index.js +2 -2
- package/lib/ProForm/components/combination/ProAddressBar/index.js +76 -58
- package/lib/ProForm/components/combination/ProAddressBar/propsType.d.ts +3 -2
- package/lib/ProForm/components/combination/ProModalSelect/index.js +75 -13
- package/lib/ProForm/components/combination/ProModalSelect/propsType.d.ts +1 -0
- package/lib/ProForm/components/combination/ProModalSelect/style/index.less +3 -3
- package/lib/ProForm/components/combination/ProNumberRange/style/index.less +1 -1
- package/lib/ProForm/components/combination/ProRangeLimit/index.d.ts +1 -1
- package/lib/ProForm/components/combination/ProTimeLimit/index.d.ts +10 -5
- package/lib/ProForm/components/combination/ProTimeLimit/style/index.less +1 -1
- package/lib/ProForm/components/old/EnumSelect/style/index.less +7 -8
- package/lib/ProForm/components/render/RenderFields.js +9 -4
- package/lib/ProForm/components/render/propsType.d.ts +5 -4
- package/lib/ProForm/index.js +5 -0
- package/lib/ProForm/style/index.less +55 -169
- package/lib/ProForm/utils/useShouldUpdate.js +16 -16
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +2 -2
- package/lib/ProLayout/components/ProCollapse/style/index.less +4 -4
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +21 -0
- package/lib/ProLayout/components/ProHeader/components/index.d.ts +1 -0
- package/lib/ProLayout/components/ProHeader/components/index.js +8 -1
- package/lib/ProLayout/components/ProHeader/index.js +4 -2
- package/lib/ProLayout/components/ProHeader/style/index.less +16 -7
- package/lib/ProStep/style/index.less +0 -1
- package/lib/ProTable/components/RenderColumn/index.d.ts +5 -5
- package/lib/ProTable/components/RenderColumn/index.js +38 -24
- package/lib/ProTable/index.js +3 -2
- package/lib/ProTable/propsType.d.ts +2 -0
- package/lib/ProTable/style/index.less +14 -1
- package/lib/ProTable/utils.d.ts +1 -1
- package/lib/ProTable/utils.js +258 -201
- package/lib/ProTabs/style/index.less +1 -1
- package/lib/ProThemeTools/component/PrdTools/index.js +1 -1
- package/lib/ProThemeTools/component/PrdTools/style/index.less +3 -3
- package/lib/ProThemeTools/index.d.ts +2 -2
- package/lib/ProThemeTools/index.js +23 -16
- package/lib/ProThemeTools/propsType.d.ts +8 -6
- package/lib/ProThemeTools/style/index.less +2 -2
- package/lib/ProThemeTools/utils/index.d.ts +7 -0
- package/lib/ProThemeTools/utils/index.js +20 -2
- package/lib/ProTree/components/ProTree.js +1 -1
- package/lib/ProTree/components/SearchTitle.d.ts +2 -2
- package/lib/ProTree/components/SearchTitle.js +11 -1
- package/lib/ProTree/components/Tree.js +6 -1
- package/lib/ProTree/style/index.less +193 -141
- package/lib/ProTreeModal/style/index.less +2 -6
- package/lib/ProUpload/style/index.less +41 -39
- package/lib/index.d.ts +2 -1
- package/lib/index.js +13 -1
- package/lib/locale/en_US.d.ts +69 -0
- package/lib/locale/en_US.js +74 -0
- package/lib/locale/index.d.ts +7 -0
- package/lib/locale/index.js +28 -0
- package/lib/locale/zh_CN.d.ts +69 -0
- package/lib/locale/zh_CN.js +74 -0
- package/lib/old/ProEditableTable/style/index.less +1 -2
- package/lib/style/components.less +0 -1
- package/lib/style/core/normalize.less +1 -1
- package/lib/style/theme/antd.less +3 -4
- package/lib/style/theme/index.less +80 -79
- package/lib/style/theme/tokens.less +1 -0
- package/package.json +2 -2
- package/typings.d.ts +2 -0
- package/es/old/ProBackBtn/style/index.less +0 -19
- package/lib/old/ProBackBtn/style/index.less +0 -19
- /package/es/{old → ProLayout/components/ProHeader/components}/ProBackBtn/index.d.ts +0 -0
- /package/es/{old → ProLayout/components/ProHeader/components}/ProBackBtn/index.js +0 -0
- /package/es/{old → ProLayout/components/ProHeader/components}/ProBackBtn/propsType.d.ts +0 -0
- /package/es/{old → ProLayout/components/ProHeader/components}/ProBackBtn/propsType.js +0 -0
- /package/lib/{old → ProLayout/components/ProHeader/components}/ProBackBtn/index.d.ts +0 -0
- /package/lib/{old → ProLayout/components/ProHeader/components}/ProBackBtn/index.js +0 -0
- /package/lib/{old → ProLayout/components/ProHeader/components}/ProBackBtn/propsType.d.ts +0 -0
- /package/lib/{old → ProLayout/components/ProHeader/components}/ProBackBtn/propsType.js +0 -0
|
@@ -1,35 +1,55 @@
|
|
|
1
|
+
import "antd/es/tooltip/style";
|
|
2
|
+
import _Tooltip from "antd/es/tooltip";
|
|
1
3
|
import "antd/es/typography/style";
|
|
2
4
|
import _Typography from "antd/es/typography";
|
|
3
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
6
|
import { CheckOutlined } from '@ant-design/icons';
|
|
5
7
|
import { ReactSVG } from 'react-svg';
|
|
6
|
-
import ProForm from '../../../ProForm';
|
|
7
|
-
import getEnumLabel from '../../../ProEnum/utils/getEnumLabel';
|
|
8
8
|
import copySvg from '../../../assets/copy.svg';
|
|
9
9
|
var Paragraph = _Typography.Paragraph,
|
|
10
10
|
Text = _Typography.Text;
|
|
11
11
|
// @ts-ignore
|
|
12
12
|
var RenderColumn = function RenderColumn(props) {
|
|
13
13
|
var valueType = props.valueType,
|
|
14
|
-
code = props.code,
|
|
15
14
|
value = props.value,
|
|
16
|
-
|
|
15
|
+
node = props.node,
|
|
16
|
+
currentValue = props.currentValue,
|
|
17
17
|
copyable = props.copyable,
|
|
18
18
|
ellipsis = props.ellipsis,
|
|
19
19
|
width = props.width,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
var
|
|
24
|
-
if (
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
originalValue = props.originalValue,
|
|
21
|
+
originalTip = props.originalTip;
|
|
22
|
+
if (originalValue !== undefined) {
|
|
23
|
+
var renderNode = value ? node : '-';
|
|
24
|
+
if (ellipsis || originalTip) {
|
|
25
|
+
if (ellipsis) {
|
|
26
|
+
renderNode = _jsx(Text, {
|
|
27
|
+
style: {
|
|
28
|
+
width: currentValue === '-' ? 32.5 : width
|
|
29
|
+
},
|
|
30
|
+
ellipsis: {
|
|
31
|
+
tooltip: false
|
|
32
|
+
},
|
|
33
|
+
children: ellipsis ? currentValue : renderNode
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
return _jsx(_Tooltip, {
|
|
37
|
+
className: "varied-cell",
|
|
38
|
+
style: {
|
|
39
|
+
width: width
|
|
40
|
+
},
|
|
41
|
+
title: originalTip ? _jsxs(_Fragment, {
|
|
42
|
+
children: ["\u521D\u59CB\u503C\uFF1A", originalValue, _jsx("br", {}), ellipsis ? "\u5F53\u524D\u503C\uFF1A".concat(currentValue) : undefined]
|
|
43
|
+
}) : node,
|
|
44
|
+
children: renderNode
|
|
45
|
+
});
|
|
28
46
|
}
|
|
29
|
-
return _jsx(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
47
|
+
return _jsx("span", {
|
|
48
|
+
className: "varied-cell",
|
|
49
|
+
style: {
|
|
50
|
+
width: width
|
|
51
|
+
},
|
|
52
|
+
children: renderNode
|
|
33
53
|
});
|
|
34
54
|
}
|
|
35
55
|
if (copyable) {
|
|
@@ -40,25 +60,21 @@ var RenderColumn = function RenderColumn(props) {
|
|
|
40
60
|
width: width
|
|
41
61
|
} : undefined,
|
|
42
62
|
ellipsis: ellipsis ? {
|
|
43
|
-
tooltip:
|
|
63
|
+
tooltip: node
|
|
44
64
|
} : false,
|
|
45
65
|
copyable: {
|
|
46
|
-
text:
|
|
66
|
+
text: node,
|
|
47
67
|
icon: [_jsx(ReactSVG, {
|
|
48
68
|
className: "drag-icon",
|
|
49
69
|
src: copySvg
|
|
50
70
|
}, "copy-icon"), _jsx(CheckOutlined, {}, "copied-icon")],
|
|
51
71
|
tooltips: ['复制', '复制成功']
|
|
52
72
|
},
|
|
53
|
-
children:
|
|
73
|
+
children: node
|
|
54
74
|
})
|
|
55
75
|
});
|
|
56
76
|
}
|
|
57
77
|
if (ellipsis) {
|
|
58
|
-
var node = value;
|
|
59
|
-
if (['enumName', 'enumCodeName'].includes(valueType)) {
|
|
60
|
-
node = getEnumLabel(typeof code === 'function' ? code() : code, value, valueType === 'enumCodeName');
|
|
61
|
-
}
|
|
62
78
|
return value ? _jsx(Text, {
|
|
63
79
|
style: {
|
|
64
80
|
width: width
|
|
@@ -70,6 +86,6 @@ var RenderColumn = function RenderColumn(props) {
|
|
|
70
86
|
children: node
|
|
71
87
|
}) : '-';
|
|
72
88
|
}
|
|
73
|
-
return
|
|
89
|
+
return value ? node : '-';
|
|
74
90
|
};
|
|
75
91
|
export default RenderColumn;
|
package/es/ProTable/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
|
8
8
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
9
9
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
10
10
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
11
|
-
var _excluded = ["tableId", "headerRender", "footerRender", "quickConfig", "stripe", "columns", "className", "summary", "emptyText"],
|
|
11
|
+
var _excluded = ["tableId", "headerRender", "footerRender", "quickConfig", "stripe", "columns", "className", "summary", "emptyText", "originalDataSource"],
|
|
12
12
|
_excluded2 = ["resizeColumn", "columnConfig", "cacheTime", "storage"];
|
|
13
13
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
14
14
|
import { useEffect, useMemo, useState, createContext } from 'react';
|
|
@@ -51,6 +51,7 @@ function ProTable(props) {
|
|
|
51
51
|
summary = props.summary,
|
|
52
52
|
_props$emptyText = props.emptyText,
|
|
53
53
|
emptyText = _props$emptyText === void 0 ? '暂无数据' : _props$emptyText,
|
|
54
|
+
originalDataSource = props.originalDataSource,
|
|
54
55
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
55
56
|
var quickTableConfig = quickConfig ? _objectSpread({
|
|
56
57
|
// resizeColumn: true,
|
|
@@ -161,7 +162,7 @@ function ProTable(props) {
|
|
|
161
162
|
return !(item === null || item === void 0 ? void 0 : item.delete);
|
|
162
163
|
});
|
|
163
164
|
newColumns === null || newColumns === void 0 ? void 0 : newColumns.forEach(function (item) {
|
|
164
|
-
formatColumn(item);
|
|
165
|
+
formatColumn(item, originalDataSource);
|
|
165
166
|
});
|
|
166
167
|
return newColumns;
|
|
167
168
|
}, [curColumns, handleResize]);
|
|
@@ -26,6 +26,7 @@ export interface ProTableColumn extends Omit<ColumnType<any>, 'dataIndex'> {
|
|
|
26
26
|
precision?: number;
|
|
27
27
|
code?: string | string[] | (() => string);
|
|
28
28
|
copyable?: boolean;
|
|
29
|
+
originalTip?: boolean;
|
|
29
30
|
prefix?: string | ReactNode | ((value: any, record?: any, index?: number) => any);
|
|
30
31
|
suffix?: string | ReactNode | ((value: any, record?: any, index?: number) => any);
|
|
31
32
|
tooltip?: ReactNode | {
|
|
@@ -53,6 +54,7 @@ export interface ProTableProps extends Omit<TableProps<any>, 'summary' | 'column
|
|
|
53
54
|
*/
|
|
54
55
|
stripe?: boolean;
|
|
55
56
|
columns: ProTableColumn[];
|
|
57
|
+
originalDataSource?: any[];
|
|
56
58
|
}
|
|
57
59
|
export type ProTableValueType = 'percentage' | 'permillage' | 'thousandth' | 'datePicker' | 'enumName' | 'enumCodeName' | 'address' | 'thousandthCNY' | 'date' | 'dateTime' | 'dateStartTime' | 'dateEndTime' | 'dateStartEndTime';
|
|
58
60
|
export interface Response<T = any> {
|
|
@@ -54,6 +54,19 @@
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
+
.ant-table-body {
|
|
58
|
+
.ant-table-cell .varied-cell {
|
|
59
|
+
margin-left: -8px;
|
|
60
|
+
background: var(--zaui-contract-bg, #fffaa1);
|
|
61
|
+
padding: var(--zaui-space-size-xs, 4px) var(--zaui-space-size-sm, 8px);
|
|
62
|
+
border-radius: var(--zaui-border-radius, 4px);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.varied-cell.empty-cell {
|
|
66
|
+
width: 24.5px;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
57
70
|
.copyable-table-cell {
|
|
58
71
|
|
|
59
72
|
|
|
@@ -140,7 +153,7 @@
|
|
|
140
153
|
.column-config {
|
|
141
154
|
display : flex;
|
|
142
155
|
justify-content: space-between;
|
|
143
|
-
margin-bottom : var(--zaui-space-size-md
|
|
156
|
+
margin-bottom : calc(var(--zaui-space-size-md; 16px) * var(--zaui-size; 1));
|
|
144
157
|
|
|
145
158
|
.right-actions {
|
|
146
159
|
display : flex;
|
package/es/ProTable/utils.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ProTableColumn } from './propsType';
|
|
3
|
-
export declare const formatColumn: (column: ProTableColumn) => void;
|
|
3
|
+
export declare const formatColumn: (column: ProTableColumn, originalDataSource: any[]) => void;
|
|
4
4
|
export declare const getColumnDataIndex: (dataIndex: string | string[]) => string;
|
|
5
5
|
/**
|
|
6
6
|
* 查找最近的父级className
|