@zat-design/sisyphus-react 3.13.19-beta.9 → 3.13.19
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/README.md +207 -77
- package/dist/index.esm.css +1 -0
- package/dist/index.min.js +1 -0
- package/dist/less.esm.css +1 -0
- package/dist/less.min.js +1 -0
- package/es/ProEnum/index.js +12 -22
- package/es/ProForm/components/combination/Group/index.js +14 -5
- package/es/ProForm/components/combination/Group/propsType.d.ts +2 -0
- package/es/ProForm/components/combination/Group/style/index.less +7 -0
- package/es/ProForm/components/combination/ProNumberRange/index.js +39 -11
- package/es/ProForm/components/combination/ProNumberRange/propsType.d.ts +3 -2
- package/es/ProForm/components/combination/ProNumberRange/style/index.less +1 -1
- package/lib/ProEnum/index.js +11 -21
- package/lib/ProForm/components/combination/Group/index.js +13 -4
- package/lib/ProForm/components/combination/Group/propsType.d.ts +2 -0
- package/lib/ProForm/components/combination/Group/style/index.less +7 -0
- package/lib/ProForm/components/combination/ProNumberRange/index.js +39 -11
- package/lib/ProForm/components/combination/ProNumberRange/propsType.d.ts +3 -2
- package/lib/ProForm/components/combination/ProNumberRange/style/index.less +1 -1
- package/package.json +4 -2
@@ -1,5 +1,3 @@
|
|
1
|
-
import "antd/es/space/style";
|
2
|
-
import _Space from "antd/es/space";
|
3
1
|
import "antd/es/input/style";
|
4
2
|
import _Input from "antd/es/input";
|
5
3
|
import "antd/es/button/style";
|
@@ -7,6 +5,8 @@ import _Button from "antd/es/button";
|
|
7
5
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
8
6
|
import "antd/es/input-number/style";
|
9
7
|
import _InputNumber from "antd/es/input-number";
|
8
|
+
import "antd/es/space/style";
|
9
|
+
import _Space from "antd/es/space";
|
10
10
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
11
11
|
import { useSetState, useDeepCompareEffect } from 'ahooks';
|
12
12
|
import { isEmpty } from 'lodash';
|
@@ -19,7 +19,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
19
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
20
20
|
var formatAmount = tools.formatAmount;
|
21
21
|
var ProNumberRange = props => {
|
22
|
-
var
|
22
|
+
var _valueProps, _ref2, _ref3, _value$, _valueProps2, _ref4, _ref5, _value$2, _valueProps3, _valueProps4;
|
23
23
|
var _props$value = props.value,
|
24
24
|
value = _props$value === void 0 ? [] : _props$value,
|
25
25
|
_props$onChange = props.onChange,
|
@@ -35,16 +35,16 @@ var ProNumberRange = props => {
|
|
35
35
|
childProps = props.childProps,
|
36
36
|
addonBefore = props.addonBefore,
|
37
37
|
addonAfter = props.addonAfter,
|
38
|
-
_props$separator = props.separator,
|
39
|
-
separator = _props$separator === void 0 ? '~' : _props$separator,
|
40
38
|
inValueType = props.valueType,
|
39
|
+
_props$split = props.split,
|
40
|
+
split = _props$split === void 0 ? '~' : _props$split,
|
41
41
|
id = props.id;
|
42
42
|
var _ref = ProForm.useFieldProps() || {},
|
43
43
|
isViewCon = _ref.isView,
|
44
44
|
viewEmpty = _ref.viewEmpty,
|
45
45
|
valueType = _ref.valueType;
|
46
46
|
var isView = typeof props.isView === 'boolean' ? props.isView : isViewCon; // 组件可直接接收isView参数, 优先级高
|
47
|
-
|
47
|
+
|
48
48
|
var _useSetState = useSetState({
|
49
49
|
range: value || []
|
50
50
|
}),
|
@@ -101,25 +101,53 @@ var ProNumberRange = props => {
|
|
101
101
|
case 'percentage':
|
102
102
|
return /*#__PURE__*/_jsx(Container, {
|
103
103
|
viewEmpty: viewEmpty,
|
104
|
-
children:
|
104
|
+
children: /*#__PURE__*/_jsxs(_Space, {
|
105
|
+
split: split,
|
106
|
+
children: [/*#__PURE__*/_jsx("span", {
|
107
|
+
children: formatAmount(value[0], precision || decimal)
|
108
|
+
}), /*#__PURE__*/_jsx("span", {
|
109
|
+
children: formatAmount(value[1], precision || decimal)
|
110
|
+
})]
|
111
|
+
})
|
105
112
|
});
|
106
113
|
// 千分比
|
107
114
|
case 'permillage':
|
108
115
|
return /*#__PURE__*/_jsx(Container, {
|
109
116
|
viewEmpty: viewEmpty,
|
110
|
-
children:
|
117
|
+
children: /*#__PURE__*/_jsxs(_Space, {
|
118
|
+
split: split,
|
119
|
+
children: [/*#__PURE__*/_jsx("span", {
|
120
|
+
children: formatAmount(value[0], precision || decimal)
|
121
|
+
}), /*#__PURE__*/_jsx("span", {
|
122
|
+
children: formatAmount(value[1], precision || decimal)
|
123
|
+
})]
|
124
|
+
})
|
111
125
|
});
|
112
126
|
// 千分位
|
113
127
|
case 'amount':
|
114
128
|
case 'thousandth':
|
115
129
|
return /*#__PURE__*/_jsx(Container, {
|
116
130
|
viewEmpty: viewEmpty,
|
117
|
-
children:
|
131
|
+
children: /*#__PURE__*/_jsxs(_Space, {
|
132
|
+
split: split,
|
133
|
+
children: [/*#__PURE__*/_jsx("span", {
|
134
|
+
children: formatAmount(value[0], precision || decimal)
|
135
|
+
}), /*#__PURE__*/_jsx("span", {
|
136
|
+
children: formatAmount(value[1], precision || decimal)
|
137
|
+
})]
|
138
|
+
})
|
118
139
|
});
|
119
140
|
default:
|
120
141
|
return /*#__PURE__*/_jsx(Container, {
|
121
142
|
viewEmpty: viewEmpty,
|
122
|
-
children:
|
143
|
+
children: /*#__PURE__*/_jsxs(_Space, {
|
144
|
+
split: split,
|
145
|
+
children: [/*#__PURE__*/_jsx("span", {
|
146
|
+
children: value[0] || '-'
|
147
|
+
}), /*#__PURE__*/_jsx("span", {
|
148
|
+
children: value[1] || '-'
|
149
|
+
})]
|
150
|
+
})
|
123
151
|
});
|
124
152
|
}
|
125
153
|
}
|
@@ -199,7 +227,7 @@ var ProNumberRange = props => {
|
|
199
227
|
'range-split': true,
|
200
228
|
'range-split-disabled': !!disabled
|
201
229
|
}),
|
202
|
-
placeholder:
|
230
|
+
placeholder: split,
|
203
231
|
disabled: true
|
204
232
|
}), /*#__PURE__*/_jsx(_InputNumber, _objectSpread(_objectSpread({
|
205
233
|
className: "range-right",
|
@@ -71,9 +71,10 @@ export interface ProNumberRangeType {
|
|
71
71
|
* @default '-'
|
72
72
|
*/
|
73
73
|
/**
|
74
|
-
* 查看分割符
|
74
|
+
* @description 查看分割符
|
75
|
+
* @default '-'
|
75
76
|
*/
|
76
|
-
|
77
|
+
split?: React.ReactNode | string;
|
77
78
|
childProps?: any[];
|
78
79
|
otherProps?: ProFormOtherType;
|
79
80
|
id?: string;
|
package/lib/ProEnum/index.js
CHANGED
@@ -33,7 +33,7 @@ require("./style/index.less");
|
|
33
33
|
var _useFieldProps2 = require("../ProForm/utils/useFieldProps");
|
34
34
|
var _jsxRuntime = require("react/jsx-runtime");
|
35
35
|
var _excluded = ["code", "type", "dataSource", "useRequest", "value", "component", "onChange", "transformResponse", "otherProps", "isView"],
|
36
|
-
_excluded2 = ["fieldNames", "clear", "
|
36
|
+
_excluded2 = ["fieldNames", "clear", "cacheKey", "showCodeName"];
|
37
37
|
var ProEnum = props => {
|
38
38
|
var _otherProps$isView, _enumProps$showCodeNa;
|
39
39
|
var code = props.code,
|
@@ -57,19 +57,10 @@ var ProEnum = props => {
|
|
57
57
|
fieldNames = _ref2.fieldNames,
|
58
58
|
_ref2$clear = _ref2.clear,
|
59
59
|
clear = _ref2$clear === void 0 ? true : _ref2$clear,
|
60
|
-
_ref2$storage = _ref2.storage,
|
61
|
-
storage = _ref2$storage === void 0 ? 'localStorage' : _ref2$storage,
|
62
60
|
_ref2$cacheKey = _ref2.cacheKey,
|
63
61
|
cacheKey = _ref2$cacheKey === void 0 ? 'zat-design-pro-component-cacheKey' : _ref2$cacheKey,
|
64
62
|
showCodeName = _ref2.showCodeName,
|
65
|
-
configUseRequest = _ref2.useRequest,
|
66
|
-
configTransformResponse = _ref2.transformResponse,
|
67
63
|
resProps = (0, _objectWithoutProperties2.default)(_ref2, _excluded2);
|
68
|
-
|
69
|
-
// 优先使用props中的配置,如果没有则使用全局配置
|
70
|
-
var finalUseRequest = useRequest || configUseRequest;
|
71
|
-
var finalTransformResponse = transformResponse || configTransformResponse;
|
72
|
-
var cacheData = (0, _utils.getEnumData)(storage, cacheKey);
|
73
64
|
var _isView = isView !== undefined && isView !== null ? isView : (_otherProps$isView = otherProps === null || otherProps === void 0 ? void 0 : otherProps.isView) !== null && _otherProps$isView !== void 0 ? _otherProps$isView : configIsView;
|
74
65
|
enumProps.showCodeName = (_enumProps$showCodeNa = enumProps.showCodeName) !== null && _enumProps$showCodeNa !== void 0 ? _enumProps$showCodeNa : showCodeName;
|
75
66
|
var label = 'label';
|
@@ -96,7 +87,7 @@ var ProEnum = props => {
|
|
96
87
|
}
|
97
88
|
|
98
89
|
// 这种时候优先级最高、完全走自定义
|
99
|
-
if (
|
90
|
+
if (useRequest !== null && useRequest !== void 0 && useRequest.service && props.fieldNames) {
|
100
91
|
var _props$fieldNames5, _props$fieldNames6;
|
101
92
|
if ((_props$fieldNames5 = props.fieldNames) !== null && _props$fieldNames5 !== void 0 && _props$fieldNames5.label) label = props.fieldNames.label;
|
102
93
|
if ((_props$fieldNames6 = props.fieldNames) !== null && _props$fieldNames6 !== void 0 && _props$fieldNames6.value) fieldValue = props.fieldNames.value;
|
@@ -104,13 +95,13 @@ var ProEnum = props => {
|
|
104
95
|
var _useProConfig = (0, _ProConfigProvider.useProConfig)('ProEnum'),
|
105
96
|
_useProConfig$dics = _useProConfig.dics,
|
106
97
|
dics = _useProConfig$dics === void 0 ? {} : _useProConfig$dics;
|
107
|
-
var _useRequestFunc = (0, _ahooks.useRequest)(
|
98
|
+
var _useRequestFunc = (0, _ahooks.useRequest)(useRequest === null || useRequest === void 0 ? void 0 : useRequest.service, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
108
99
|
manual: true,
|
109
100
|
cacheTime: -1
|
110
|
-
},
|
101
|
+
}, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options), {}, {
|
111
102
|
onSuccess: res => {
|
112
|
-
if (
|
113
|
-
var responseData =
|
103
|
+
if (transformResponse && typeof transformResponse === 'function') {
|
104
|
+
var responseData = transformResponse(res);
|
114
105
|
if (typeof responseData !== 'object') {
|
115
106
|
var _locale$ProEnum;
|
116
107
|
return _message2.default.error((_locale$ProEnum = _locale.default.ProEnum) === null || _locale$ProEnum === void 0 ? void 0 : _locale$ProEnum.errorMessage);
|
@@ -142,14 +133,13 @@ var ProEnum = props => {
|
|
142
133
|
|
143
134
|
// 自定义请求
|
144
135
|
(0, _ahooks.useDeepCompareEffect)(() => {
|
145
|
-
var _ref3 = (
|
136
|
+
var _ref3 = (useRequest === null || useRequest === void 0 ? void 0 : useRequest.options) || {},
|
146
137
|
defaultParams = _ref3.defaultParams;
|
147
138
|
var params = Array.isArray(defaultParams) ? defaultParams === null || defaultParams === void 0 ? void 0 : defaultParams[0] : defaultParams || {};
|
148
|
-
|
149
|
-
if (finalUseRequest !== null && finalUseRequest !== void 0 && finalUseRequest.service && (!Object.keys(cacheData).length || cacheData !== null && cacheData !== void 0 && cacheData.data && !Object.keys(cacheData === null || cacheData === void 0 ? void 0 : cacheData.data).length)) {
|
139
|
+
if (useRequest !== null && useRequest !== void 0 && useRequest.service) {
|
150
140
|
run(params);
|
151
141
|
}
|
152
|
-
}, [
|
142
|
+
}, [useRequest === null || useRequest === void 0 ? void 0 : useRequest.options]);
|
153
143
|
var enumLists = (0, _react.useMemo)(() => {
|
154
144
|
var lists = [];
|
155
145
|
if ((0, _lodash.isString)(code)) {
|
@@ -168,8 +158,8 @@ var ProEnum = props => {
|
|
168
158
|
// 优先使用组件内部自己传入的数据源或者请求得到的数据
|
169
159
|
list = (0, _lodash.cloneDeep)(dataList && dataList.length ? dataList : enumLists);
|
170
160
|
// 对数据进行一系列的过滤等操作
|
171
|
-
if (!(
|
172
|
-
list =
|
161
|
+
if (!(useRequest !== null && useRequest !== void 0 && useRequest.service) && transformResponse) {
|
162
|
+
list = transformResponse(list);
|
173
163
|
if (!Array.isArray(list)) {
|
174
164
|
var _locale$ProEnum3;
|
175
165
|
console.error((_locale$ProEnum3 = _locale.default.ProEnum) === null || _locale$ProEnum3 === void 0 ? void 0 : _locale$ProEnum3.errorArrayMessage);
|
@@ -33,7 +33,9 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
33
33
|
otherProps = props.otherProps,
|
34
34
|
id = props.id,
|
35
35
|
isParentView = props.isView,
|
36
|
-
formDisabled = props.disabled
|
36
|
+
formDisabled = props.disabled,
|
37
|
+
_props$split = props.split,
|
38
|
+
split = _props$split === void 0 ? '/' : _props$split;
|
37
39
|
var _ref = otherProps || {},
|
38
40
|
desensitizationKey = _ref.desensitizationKey;
|
39
41
|
var contextProps = _ProForm.default.useFieldProps() || {};
|
@@ -44,6 +46,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
44
46
|
index = contextProps.index,
|
45
47
|
isView = contextProps.isView;
|
46
48
|
var nextOption = _react.default.useRef([]);
|
49
|
+
var nextIsView = isParentView || isView || otherProps.isView;
|
47
50
|
|
48
51
|
// 组合onChange
|
49
52
|
var handleChange = (value, option, index) => {
|
@@ -75,12 +78,16 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
75
78
|
'pro-group-width-auto': columns.some(item => {
|
76
79
|
return ['Radio', 'Checkbox', 'Switch'].includes(item.type);
|
77
80
|
}),
|
81
|
+
'pro-group-view': nextIsView,
|
78
82
|
[`${className}`]: className
|
79
83
|
});
|
84
|
+
if (nextIsView && (0, _lodash.isEmpty)(value)) {
|
85
|
+
return (otherProps === null || otherProps === void 0 ? void 0 : otherProps.viewEmpty) || '-';
|
86
|
+
}
|
80
87
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
81
88
|
className: nextClassName,
|
82
89
|
id: id,
|
83
|
-
children: space.compact || space !== null && space !== void 0 && space.separator ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_space.default.Compact, {
|
90
|
+
children: (space.compact || space !== null && space !== void 0 && space.separator) && !nextIsView ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_space.default.Compact, {
|
84
91
|
children: columns.map((column, index) => {
|
85
92
|
column.otherProps = otherProps;
|
86
93
|
// 自定义间隔移除对应参数
|
@@ -90,12 +97,14 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
90
97
|
}
|
91
98
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComRender.default, (0, _objectSpread2.default)({
|
92
99
|
contextProps: contextProps,
|
93
|
-
isView:
|
100
|
+
isView: nextIsView
|
94
101
|
}, column), column.name || index);
|
95
102
|
})
|
96
103
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_space.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
97
104
|
align: "start"
|
98
105
|
}, (0, _lodash.omit)(space, ['separator', 'compact'])), {}, {
|
106
|
+
split: nextIsView ? split : null,
|
107
|
+
size: nextIsView ? 0 : space.size,
|
99
108
|
children: columns.map((column, index) => {
|
100
109
|
column.otherProps = otherProps;
|
101
110
|
if (column !== null && column !== void 0 && column.separator) {
|
@@ -104,7 +113,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
104
113
|
}
|
105
114
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComRender.default, (0, _objectSpread2.default)({
|
106
115
|
contextProps: contextProps,
|
107
|
-
isView:
|
116
|
+
isView: nextIsView
|
108
117
|
}, column), column.name || index);
|
109
118
|
})
|
110
119
|
}))
|
@@ -27,6 +27,8 @@ export interface GroupType {
|
|
27
27
|
value?: any[];
|
28
28
|
onChange?: (value: any[] | null, options?: any[]) => void;
|
29
29
|
otherProps?: any;
|
30
|
+
/** 分隔符 */
|
31
|
+
split?: string | React.ReactNode;
|
30
32
|
}
|
31
33
|
export type GroupColumnType<Values = any> = {
|
32
34
|
component?: React.ReactNode | ReactiveFunction<Values, React.ReactNode>;
|
@@ -21,6 +21,13 @@
|
|
21
21
|
.pro-group {
|
22
22
|
width: unset !important;
|
23
23
|
display: flex;
|
24
|
+
&.pro-group-view {
|
25
|
+
.@{ant-prefix}-space {
|
26
|
+
.@{ant-prefix}-space-item {
|
27
|
+
width: auto;
|
28
|
+
}
|
29
|
+
}
|
30
|
+
}
|
24
31
|
|
25
32
|
&.pro-group-diy-width, &.pro-group-width-auto {
|
26
33
|
.@{ant-prefix}-space .@{ant-prefix}-space-item {
|
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
6
6
|
});
|
7
7
|
exports.default = void 0;
|
8
|
-
require("antd/es/space/style");
|
9
|
-
var _space = _interopRequireDefault(require("antd/es/space"));
|
10
8
|
require("antd/es/input/style");
|
11
9
|
var _input = _interopRequireDefault(require("antd/es/input"));
|
12
10
|
require("antd/es/button/style");
|
@@ -14,6 +12,8 @@ var _button = _interopRequireDefault(require("antd/es/button"));
|
|
14
12
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
15
13
|
require("antd/es/input-number/style");
|
16
14
|
var _inputNumber = _interopRequireDefault(require("antd/es/input-number"));
|
15
|
+
require("antd/es/space/style");
|
16
|
+
var _space = _interopRequireDefault(require("antd/es/space"));
|
17
17
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
18
18
|
var _ahooks = require("ahooks");
|
19
19
|
var _lodash = require("lodash");
|
@@ -25,7 +25,7 @@ var _ProForm = _interopRequireDefault(require("../../../../ProForm"));
|
|
25
25
|
var _jsxRuntime = require("react/jsx-runtime");
|
26
26
|
var formatAmount = _utils.tools.formatAmount;
|
27
27
|
var ProNumberRange = props => {
|
28
|
-
var
|
28
|
+
var _valueProps, _ref2, _ref3, _value$, _valueProps2, _ref4, _ref5, _value$2, _valueProps3, _valueProps4;
|
29
29
|
var _props$value = props.value,
|
30
30
|
value = _props$value === void 0 ? [] : _props$value,
|
31
31
|
_props$onChange = props.onChange,
|
@@ -41,16 +41,16 @@ var ProNumberRange = props => {
|
|
41
41
|
childProps = props.childProps,
|
42
42
|
addonBefore = props.addonBefore,
|
43
43
|
addonAfter = props.addonAfter,
|
44
|
-
_props$separator = props.separator,
|
45
|
-
separator = _props$separator === void 0 ? '~' : _props$separator,
|
46
44
|
inValueType = props.valueType,
|
45
|
+
_props$split = props.split,
|
46
|
+
split = _props$split === void 0 ? '~' : _props$split,
|
47
47
|
id = props.id;
|
48
48
|
var _ref = _ProForm.default.useFieldProps() || {},
|
49
49
|
isViewCon = _ref.isView,
|
50
50
|
viewEmpty = _ref.viewEmpty,
|
51
51
|
valueType = _ref.valueType;
|
52
52
|
var isView = typeof props.isView === 'boolean' ? props.isView : isViewCon; // 组件可直接接收isView参数, 优先级高
|
53
|
-
|
53
|
+
|
54
54
|
var _useSetState = (0, _ahooks.useSetState)({
|
55
55
|
range: value || []
|
56
56
|
}),
|
@@ -107,25 +107,53 @@ var ProNumberRange = props => {
|
|
107
107
|
case 'percentage':
|
108
108
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Container.default, {
|
109
109
|
viewEmpty: viewEmpty,
|
110
|
-
children:
|
110
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_space.default, {
|
111
|
+
split: split,
|
112
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
113
|
+
children: formatAmount(value[0], precision || decimal)
|
114
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
115
|
+
children: formatAmount(value[1], precision || decimal)
|
116
|
+
})]
|
117
|
+
})
|
111
118
|
});
|
112
119
|
// 千分比
|
113
120
|
case 'permillage':
|
114
121
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Container.default, {
|
115
122
|
viewEmpty: viewEmpty,
|
116
|
-
children:
|
123
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_space.default, {
|
124
|
+
split: split,
|
125
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
126
|
+
children: formatAmount(value[0], precision || decimal)
|
127
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
128
|
+
children: formatAmount(value[1], precision || decimal)
|
129
|
+
})]
|
130
|
+
})
|
117
131
|
});
|
118
132
|
// 千分位
|
119
133
|
case 'amount':
|
120
134
|
case 'thousandth':
|
121
135
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Container.default, {
|
122
136
|
viewEmpty: viewEmpty,
|
123
|
-
children:
|
137
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_space.default, {
|
138
|
+
split: split,
|
139
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
140
|
+
children: formatAmount(value[0], precision || decimal)
|
141
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
142
|
+
children: formatAmount(value[1], precision || decimal)
|
143
|
+
})]
|
144
|
+
})
|
124
145
|
});
|
125
146
|
default:
|
126
147
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Container.default, {
|
127
148
|
viewEmpty: viewEmpty,
|
128
|
-
children:
|
149
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_space.default, {
|
150
|
+
split: split,
|
151
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
152
|
+
children: value[0] || '-'
|
153
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
154
|
+
children: value[1] || '-'
|
155
|
+
})]
|
156
|
+
})
|
129
157
|
});
|
130
158
|
}
|
131
159
|
}
|
@@ -205,7 +233,7 @@ var ProNumberRange = props => {
|
|
205
233
|
'range-split': true,
|
206
234
|
'range-split-disabled': !!disabled
|
207
235
|
}),
|
208
|
-
placeholder:
|
236
|
+
placeholder: split,
|
209
237
|
disabled: true
|
210
238
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_inputNumber.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
211
239
|
className: "range-right",
|
@@ -71,9 +71,10 @@ export interface ProNumberRangeType {
|
|
71
71
|
* @default '-'
|
72
72
|
*/
|
73
73
|
/**
|
74
|
-
* 查看分割符
|
74
|
+
* @description 查看分割符
|
75
|
+
* @default '-'
|
75
76
|
*/
|
76
|
-
|
77
|
+
split?: React.ReactNode | string;
|
77
78
|
childProps?: any[];
|
78
79
|
otherProps?: ProFormOtherType;
|
79
80
|
id?: string;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@zat-design/sisyphus-react",
|
3
|
-
"version": "3.13.19
|
3
|
+
"version": "3.13.19",
|
4
4
|
"license": "MIT",
|
5
5
|
"main": "lib/index.js",
|
6
6
|
"module": "es/index.js",
|
@@ -8,9 +8,10 @@
|
|
8
8
|
"homepage": "https://procomponents.zhongan.tech",
|
9
9
|
"scripts": {
|
10
10
|
"analyze": "ANALYZE=1 dumi build",
|
11
|
-
"build": "father build",
|
11
|
+
"build": "father build && mv dist/index.min.css dist/index.esm.css && mv dist/less.min.css dist/less.esm.css",
|
12
12
|
"build-es": "father build --format esm",
|
13
13
|
"build-lib": "father build --format cjs",
|
14
|
+
"build-dist": "father build --format umd",
|
14
15
|
"docs": "dumi build",
|
15
16
|
"docs:deploy": "gh-pages -d docs-dist",
|
16
17
|
"lint": "npm run lint:js && npm run lint:style && npm run lint:prettier",
|
@@ -120,6 +121,7 @@
|
|
120
121
|
"husky": "^4.0.7",
|
121
122
|
"jest-canvas-mock": "^2.5.2",
|
122
123
|
"lint-staged": "^10.0.0",
|
124
|
+
"mini-css-extract-plugin": "^2.9.4",
|
123
125
|
"mockjs": "^1.0.0",
|
124
126
|
"prettier": "^2.5.0",
|
125
127
|
"pretty-quick": "^3.1.3",
|