@zat-design/sisyphus-react 3.8.0-beta.15 → 3.8.0-beta.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.css +8 -46
- package/dist/less.esm.css +8 -46
- package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +8 -4
- package/es/ProEditTable/components/RenderField/index.js +4 -2
- package/es/ProForm/components/FormFooter/index.js +6 -4
- package/es/ProForm/components/combination/Group/utils.js +8 -1
- package/es/ProForm/components/combination/ProCascader/index.js +5 -2
- package/es/ProForm/components/combination/ProModalSelect/index.js +7 -1
- package/es/ProForm/components/combination/ProModalSelect/propsType.d.ts +1 -0
- package/es/ProForm/components/combination/ProNumberRange/index.js +54 -43
- package/es/ProForm/components/combination/ProNumberRange/style/index.less +51 -52
- package/es/ProForm/components/render/ChangedWrapper.js +5 -3
- package/es/ProForm/components/render/Render.js +1 -0
- package/es/ProForm/components/render/propsType.d.ts +1 -1
- package/es/ProForm/style/index.less +1 -1
- package/es/ProForm/utils/useShouldUpdate.d.ts +2 -2
- package/es/ProForm/utils/useShouldUpdate.js +1 -1
- package/es/ProSelect/index.js +2 -3
- package/es/ProSelect/utils/index.js +5 -4
- package/es/ProTable/components/FormatColumn/index.d.ts +2 -1
- package/es/ProTable/components/FormatColumn/index.js +12 -9
- package/es/ProTable/index.js +11 -1
- package/es/ProTable/propsType.d.ts +4 -0
- package/es/ProTree/components/ProTreeSelect/index.js +10 -0
- package/lib/ProEditTable/components/RenderField/ListChangedWrapper.js +8 -4
- package/lib/ProEditTable/components/RenderField/index.js +4 -2
- package/lib/ProForm/components/FormFooter/index.js +5 -3
- package/lib/ProForm/components/combination/Group/utils.js +8 -1
- package/lib/ProForm/components/combination/ProCascader/index.js +5 -2
- package/lib/ProForm/components/combination/ProModalSelect/index.js +7 -1
- package/lib/ProForm/components/combination/ProModalSelect/propsType.d.ts +1 -0
- package/lib/ProForm/components/combination/ProNumberRange/index.js +48 -41
- package/lib/ProForm/components/combination/ProNumberRange/style/index.less +51 -52
- package/lib/ProForm/components/render/ChangedWrapper.js +5 -3
- package/lib/ProForm/components/render/Render.js +1 -0
- package/lib/ProForm/components/render/propsType.d.ts +1 -1
- package/lib/ProForm/style/index.less +1 -1
- package/lib/ProForm/utils/useShouldUpdate.d.ts +2 -2
- package/lib/ProForm/utils/useShouldUpdate.js +1 -1
- package/lib/ProSelect/index.js +2 -3
- package/lib/ProSelect/utils/index.js +5 -4
- package/lib/ProTable/components/FormatColumn/index.d.ts +2 -1
- package/lib/ProTable/components/FormatColumn/index.js +12 -9
- package/lib/ProTable/index.js +11 -1
- package/lib/ProTable/propsType.d.ts +4 -0
- package/lib/ProTree/components/ProTreeSelect/index.js +10 -0
- package/package.json +1 -1
package/dist/index.esm.css
CHANGED
|
@@ -2339,8 +2339,6 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
2339
2339
|
.pro-number-range .range-split {
|
|
2340
2340
|
width: 32px !important;
|
|
2341
2341
|
text-align: center !important;
|
|
2342
|
-
border-right: 0px;
|
|
2343
|
-
border-left: 0px;
|
|
2344
2342
|
pointer-events: none;
|
|
2345
2343
|
}
|
|
2346
2344
|
.pro-number-range .range-split.ant-input[disabled] {
|
|
@@ -2349,54 +2347,18 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
2349
2347
|
.pro-number-range .ant-input-number-status-error:not(.ant-input-number-disabled):not( .ant-input-number-borderless).ant-input-number {
|
|
2350
2348
|
border-color: var(--zaui-danger, #ff5050) !important;
|
|
2351
2349
|
}
|
|
2352
|
-
.pro-number-range
|
|
2353
|
-
|
|
2350
|
+
.pro-number-range:has(.ant-input-status-error):not(.pro-number-range-disabled) .range-split,
|
|
2351
|
+
.pro-number-range:has(.ant-input-status-error):not(.pro-number-range-disabled) .range-addon-before,
|
|
2352
|
+
.pro-number-range:has(.ant-input-status-error):not(.pro-number-range-disabled) .range-addon-after {
|
|
2354
2353
|
border-color: var(--zaui-danger, #ff5050);
|
|
2355
2354
|
}
|
|
2356
|
-
.pro-number-range .ant-input-rtl.range-right {
|
|
2357
|
-
border-right-width: 0;
|
|
2358
|
-
}
|
|
2359
|
-
.pro-number-range .ant-input-rtl.range-right:hover,
|
|
2360
|
-
.pro-number-range .ant-input-rtl.range-right:focus {
|
|
2361
|
-
border-right-width: 1px;
|
|
2362
|
-
}
|
|
2363
2355
|
.pro-number-range .ant-form-item {
|
|
2364
2356
|
margin-bottom: 0;
|
|
2365
2357
|
}
|
|
2366
|
-
.pro-number-range .range-
|
|
2367
|
-
.pro-number-range .range-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
}
|
|
2371
|
-
.pro-number-range .range-left .ant-input-number {
|
|
2372
|
-
border-right: none;
|
|
2373
|
-
}
|
|
2374
|
-
.pro-number-range .range-right .ant-input-number {
|
|
2375
|
-
border-left: none;
|
|
2376
|
-
}
|
|
2377
|
-
.pro-number-range .range-right .range-right {
|
|
2378
|
-
width: 100%;
|
|
2379
|
-
border-top-left-radius: 0;
|
|
2380
|
-
border-bottom-left-radius: 0;
|
|
2381
|
-
}
|
|
2382
|
-
.pro-number-range.ant-input-group.ant-input-group-compact > *:not(:last-child) {
|
|
2383
|
-
margin-right: 0;
|
|
2384
|
-
}
|
|
2385
|
-
.pro-number-range > *:first-child {
|
|
2386
|
-
border-top-right-radius: 0 !important;
|
|
2387
|
-
border-bottom-right-radius: 0 !important;
|
|
2388
|
-
}
|
|
2389
|
-
.pro-number-range > *:first-child > .ant-select-selector {
|
|
2390
|
-
border-top-right-radius: 0 !important;
|
|
2391
|
-
border-bottom-right-radius: 0 !important;
|
|
2392
|
-
}
|
|
2393
|
-
.pro-number-range > *:last-child {
|
|
2394
|
-
border-top-left-radius: 0 !important;
|
|
2395
|
-
border-bottom-left-radius: 0 !important;
|
|
2396
|
-
}
|
|
2397
|
-
.pro-number-range > *:last-child > .ant-select-selector {
|
|
2398
|
-
border-top-left-radius: 0 !important;
|
|
2399
|
-
border-bottom-left-radius: 0 !important;
|
|
2358
|
+
.pro-number-range .range-addon-before,
|
|
2359
|
+
.pro-number-range .range-addon-after {
|
|
2360
|
+
color: var(--zaui-disabled-text);
|
|
2361
|
+
pointer-events: none;
|
|
2400
2362
|
}
|
|
2401
2363
|
.pro-modal-select .ant-input-group-wrapper .close-icon,
|
|
2402
2364
|
.pro-tree-modal .ant-input-group-wrapper .close-icon {
|
|
@@ -2978,7 +2940,7 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
2978
2940
|
}
|
|
2979
2941
|
.pro-form .site-input-group-wrapper .site-input-left,
|
|
2980
2942
|
.pro-form .site-input-group-wrapper .site-input-right {
|
|
2981
|
-
width: calc(50% -
|
|
2943
|
+
width: calc(50% - 16px);
|
|
2982
2944
|
}
|
|
2983
2945
|
.pro-form .site-input-group-wrapper .site-input-left .ant-input-number {
|
|
2984
2946
|
border-right: none;
|
package/dist/less.esm.css
CHANGED
|
@@ -2339,8 +2339,6 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
2339
2339
|
.pro-number-range .range-split {
|
|
2340
2340
|
width: 32px !important;
|
|
2341
2341
|
text-align: center !important;
|
|
2342
|
-
border-right: 0px;
|
|
2343
|
-
border-left: 0px;
|
|
2344
2342
|
pointer-events: none;
|
|
2345
2343
|
}
|
|
2346
2344
|
.pro-number-range .range-split.ant-input[disabled] {
|
|
@@ -2349,54 +2347,18 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
2349
2347
|
.pro-number-range .ant-input-number-status-error:not(.ant-input-number-disabled):not( .ant-input-number-borderless).ant-input-number {
|
|
2350
2348
|
border-color: var(--zaui-danger, #ff5050) !important;
|
|
2351
2349
|
}
|
|
2352
|
-
.pro-number-range
|
|
2353
|
-
|
|
2350
|
+
.pro-number-range:has(.ant-input-status-error):not(.pro-number-range-disabled) .range-split,
|
|
2351
|
+
.pro-number-range:has(.ant-input-status-error):not(.pro-number-range-disabled) .range-addon-before,
|
|
2352
|
+
.pro-number-range:has(.ant-input-status-error):not(.pro-number-range-disabled) .range-addon-after {
|
|
2354
2353
|
border-color: var(--zaui-danger, #ff5050);
|
|
2355
2354
|
}
|
|
2356
|
-
.pro-number-range .ant-input-rtl.range-right {
|
|
2357
|
-
border-right-width: 0;
|
|
2358
|
-
}
|
|
2359
|
-
.pro-number-range .ant-input-rtl.range-right:hover,
|
|
2360
|
-
.pro-number-range .ant-input-rtl.range-right:focus {
|
|
2361
|
-
border-right-width: 1px;
|
|
2362
|
-
}
|
|
2363
2355
|
.pro-number-range .ant-form-item {
|
|
2364
2356
|
margin-bottom: 0;
|
|
2365
2357
|
}
|
|
2366
|
-
.pro-number-range .range-
|
|
2367
|
-
.pro-number-range .range-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
}
|
|
2371
|
-
.pro-number-range .range-left .ant-input-number {
|
|
2372
|
-
border-right: none;
|
|
2373
|
-
}
|
|
2374
|
-
.pro-number-range .range-right .ant-input-number {
|
|
2375
|
-
border-left: none;
|
|
2376
|
-
}
|
|
2377
|
-
.pro-number-range .range-right .range-right {
|
|
2378
|
-
width: 100%;
|
|
2379
|
-
border-top-left-radius: 0;
|
|
2380
|
-
border-bottom-left-radius: 0;
|
|
2381
|
-
}
|
|
2382
|
-
.pro-number-range.ant-input-group.ant-input-group-compact > *:not(:last-child) {
|
|
2383
|
-
margin-right: 0;
|
|
2384
|
-
}
|
|
2385
|
-
.pro-number-range > *:first-child {
|
|
2386
|
-
border-top-right-radius: 0 !important;
|
|
2387
|
-
border-bottom-right-radius: 0 !important;
|
|
2388
|
-
}
|
|
2389
|
-
.pro-number-range > *:first-child > .ant-select-selector {
|
|
2390
|
-
border-top-right-radius: 0 !important;
|
|
2391
|
-
border-bottom-right-radius: 0 !important;
|
|
2392
|
-
}
|
|
2393
|
-
.pro-number-range > *:last-child {
|
|
2394
|
-
border-top-left-radius: 0 !important;
|
|
2395
|
-
border-bottom-left-radius: 0 !important;
|
|
2396
|
-
}
|
|
2397
|
-
.pro-number-range > *:last-child > .ant-select-selector {
|
|
2398
|
-
border-top-left-radius: 0 !important;
|
|
2399
|
-
border-bottom-left-radius: 0 !important;
|
|
2358
|
+
.pro-number-range .range-addon-before,
|
|
2359
|
+
.pro-number-range .range-addon-after {
|
|
2360
|
+
color: var(--zaui-disabled-text);
|
|
2361
|
+
pointer-events: none;
|
|
2400
2362
|
}
|
|
2401
2363
|
.pro-modal-select .ant-input-group-wrapper .close-icon,
|
|
2402
2364
|
.pro-tree-modal .ant-input-group-wrapper .close-icon {
|
|
@@ -2978,7 +2940,7 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
2978
2940
|
}
|
|
2979
2941
|
.pro-form .site-input-group-wrapper .site-input-left,
|
|
2980
2942
|
.pro-form .site-input-group-wrapper .site-input-right {
|
|
2981
|
-
width: calc(50% -
|
|
2943
|
+
width: calc(50% - 16px);
|
|
2982
2944
|
}
|
|
2983
2945
|
.pro-form .site-input-group-wrapper .site-input-left .ant-input-number {
|
|
2984
2946
|
border-right: none;
|
|
@@ -4,7 +4,7 @@ import "antd/es/tooltip/style";
|
|
|
4
4
|
import _Tooltip from "antd/es/tooltip";
|
|
5
5
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
6
6
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
7
|
-
var _excluded = ["name", "names", "namesStr", "originalName", "originalNames", "originalValues", "form", "equalWith", "rowKeyPath", "children", "type"];
|
|
7
|
+
var _excluded = ["name", "names", "namesStr", "originalName", "originalNames", "originalValues", "form", "equalWith", "rowKeyPath", "children", "type", "normalize", "valuePropName"];
|
|
8
8
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
9
|
import React, { useMemo } from 'react';
|
|
10
10
|
import classNames from 'classnames';
|
|
@@ -41,7 +41,7 @@ var getOriginalValue = function getOriginalValue(_ref) {
|
|
|
41
41
|
var keyValue = rowValue[rowKeyName]; // 获取表单中rowKey值
|
|
42
42
|
if (!keyValue) return undefined;
|
|
43
43
|
var originalValueList = get(originalValues, originalName.slice(0, rowKeyPath.length - 2));
|
|
44
|
-
var originalValueRow = originalValueList.find(function (item) {
|
|
44
|
+
var originalValueRow = originalValueList === null || originalValueList === void 0 ? void 0 : originalValueList.find(function (item) {
|
|
45
45
|
return item[rowKeyPath[rowKeyPath.length - 1]] === keyValue;
|
|
46
46
|
});
|
|
47
47
|
var originalValue;
|
|
@@ -78,6 +78,9 @@ var ListChangedWrapper = function ListChangedWrapper(props) {
|
|
|
78
78
|
rowKeyPath = props.rowKeyPath,
|
|
79
79
|
children = props.children,
|
|
80
80
|
type = props.type,
|
|
81
|
+
normalize = props.normalize,
|
|
82
|
+
_props$valuePropName = props.valuePropName,
|
|
83
|
+
valuePropName = _props$valuePropName === void 0 ? 'value' : _props$valuePropName,
|
|
81
84
|
rest = _objectWithoutProperties(props, _excluded);
|
|
82
85
|
var _ref2 = useProConfig('ProEditTable') || {},
|
|
83
86
|
isDiffAll = _ref2.isDiffAll;
|
|
@@ -96,14 +99,15 @@ var ListChangedWrapper = function ListChangedWrapper(props) {
|
|
|
96
99
|
var noChange = !equalWith && (!originalValues || isDiffAll ? false : isEmpty(originalValue));
|
|
97
100
|
var diffType = useMemo(function () {
|
|
98
101
|
if (!isWatch || noChange) return 'same';
|
|
102
|
+
var _value = normalize ? normalize(props[valuePropName]) : props[valuePropName];
|
|
99
103
|
return diffOriginal({
|
|
100
|
-
value:
|
|
104
|
+
value: _value,
|
|
101
105
|
originalValue: originalValue,
|
|
102
106
|
form: form,
|
|
103
107
|
equalWith: equalWith
|
|
104
108
|
// name: isString(namesStr) ? namesStr : originalName || name,
|
|
105
109
|
});
|
|
106
|
-
}, [props
|
|
110
|
+
}, [props[valuePropName], originalValue]);
|
|
107
111
|
var isAdd = diffType === 'add';
|
|
108
112
|
var isChanged = diffType === 'changed';
|
|
109
113
|
if (!isWatch || noChange) {
|
|
@@ -216,10 +216,10 @@ var RenderField = function RenderField(_ref) {
|
|
|
216
216
|
var originalNames = names;
|
|
217
217
|
if (virtualKey) {
|
|
218
218
|
var _cellName$slice, _names2, _names2$map;
|
|
219
|
-
originalName = [].concat(_toConsumableArray(name), _toConsumableArray(cellName === null || cellName === void 0 ? void 0 : (_cellName$slice = cellName.slice) === null || _cellName$slice === void 0 ? void 0 : _cellName$slice.call(cellName,
|
|
219
|
+
originalName = [].concat(_toConsumableArray(name), _toConsumableArray(cellName === null || cellName === void 0 ? void 0 : (_cellName$slice = cellName.slice) === null || _cellName$slice === void 0 ? void 0 : _cellName$slice.call(cellName, name.length)));
|
|
220
220
|
originalNames = (_names2 = names) === null || _names2 === void 0 ? void 0 : (_names2$map = _names2.map) === null || _names2$map === void 0 ? void 0 : _names2$map.call(_names2, function (item) {
|
|
221
221
|
var _item$slice;
|
|
222
|
-
return [].concat(_toConsumableArray(name), _toConsumableArray(item === null || item === void 0 ? void 0 : (_item$slice = item.slice) === null || _item$slice === void 0 ? void 0 : _item$slice.call(item,
|
|
222
|
+
return [].concat(_toConsumableArray(name), _toConsumableArray(item === null || item === void 0 ? void 0 : (_item$slice = item.slice) === null || _item$slice === void 0 ? void 0 : _item$slice.call(item, name.length)));
|
|
223
223
|
});
|
|
224
224
|
}
|
|
225
225
|
/**
|
|
@@ -559,6 +559,8 @@ var RenderField = function RenderField(_ref) {
|
|
|
559
559
|
equalWith: equalWith,
|
|
560
560
|
type: type,
|
|
561
561
|
onChange: _onChange,
|
|
562
|
+
valuePropName: _formItemProps.valuePropName,
|
|
563
|
+
normalize: _formItemProps.normalize,
|
|
562
564
|
children: FieldComponent
|
|
563
565
|
});
|
|
564
566
|
}
|
|
@@ -4,7 +4,7 @@ import "antd/es/space/style";
|
|
|
4
4
|
import _Space from "antd/es/space";
|
|
5
5
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
6
6
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
-
import { useMemo } from 'react';
|
|
7
|
+
import { useEffect, useMemo } from 'react';
|
|
8
8
|
import { useProConfig } from '../../../ProConfigProvider';
|
|
9
9
|
import locale from '../../../locale';
|
|
10
10
|
export var PRO_FORM_CACHE = 'PRO_FORM_CACHE';
|
|
@@ -30,11 +30,13 @@ var FormFooter = function FormFooter(props) {
|
|
|
30
30
|
var searchCache = useMemo(function () {
|
|
31
31
|
var cacheStr = window.sessionStorage.getItem(PRO_FORM_CACHE);
|
|
32
32
|
var cache = JSON.parse(cacheStr || '{}');
|
|
33
|
-
if (formId && cache[formId]) {
|
|
34
|
-
form.setFieldsValue(cache[formId]);
|
|
35
|
-
}
|
|
36
33
|
return cache;
|
|
37
34
|
}, [formId]);
|
|
35
|
+
useEffect(function () {
|
|
36
|
+
if (formId && searchCache[formId]) {
|
|
37
|
+
form.setFieldsValue(searchCache[formId]);
|
|
38
|
+
}
|
|
39
|
+
}, [formId]);
|
|
38
40
|
var _onOk = function _onOk() {
|
|
39
41
|
if (formId) {
|
|
40
42
|
var values = form.getFieldsValue();
|
|
@@ -283,10 +283,17 @@ export var useTransformColumns = function useTransformColumns(params) {
|
|
|
283
283
|
option: args === null || args === void 0 ? void 0 : args[1]
|
|
284
284
|
});
|
|
285
285
|
};
|
|
286
|
+
// 内外一个为true则为true
|
|
287
|
+
var getLastDisabled = function getLastDisabled() {
|
|
288
|
+
if (Array.isArray(groupProps.disabled)) {
|
|
289
|
+
return reactiveProps.disabled || groupProps.disabled[index];
|
|
290
|
+
}
|
|
291
|
+
return reactiveProps.disabled || groupProps.disabled;
|
|
292
|
+
};
|
|
286
293
|
return _objectSpread(_objectSpread(_objectSpread({}, column), {}, {
|
|
287
294
|
name: columnName
|
|
288
295
|
}, reactiveProps), {}, {
|
|
289
|
-
disabled:
|
|
296
|
+
disabled: getLastDisabled(),
|
|
290
297
|
getValueProps: transform === null || transform === void 0 ? void 0 : transform.getValueProps,
|
|
291
298
|
fieldProps: _objectSpread(_objectSpread({}, column === null || column === void 0 ? void 0 : column.fieldProps), {}, {
|
|
292
299
|
onChange: handleChange,
|
|
@@ -96,8 +96,11 @@ var ProCascader = function ProCascader(props) {
|
|
|
96
96
|
enumDataSource = _ref5$ === void 0 ? [] : _ref5$;
|
|
97
97
|
var realDataSource = useMemo(function () {
|
|
98
98
|
var innerDataSource = dataSource || (addressCode ? enumDataSource : []);
|
|
99
|
-
var result = isAddressMode && realLevel === 2 ? filterDataSource(innerDataSource, level, fieldNames) : innerDataSource;
|
|
100
|
-
|
|
99
|
+
var result = transformDataName(isAddressMode && realLevel === 2 ? filterDataSource(innerDataSource, level, fieldNames) : innerDataSource, fieldNames);
|
|
100
|
+
if (transformResponse) {
|
|
101
|
+
return transformResponse(result);
|
|
102
|
+
}
|
|
103
|
+
return result;
|
|
101
104
|
}, [isAddressMode, addressCode, realLevel, dataSource, enumDataSource === null || enumDataSource === void 0 ? void 0 : enumDataSource.length]);
|
|
102
105
|
var _useRequest = _objectSpread({}, useRequest),
|
|
103
106
|
service = _useRequest.service,
|
|
@@ -19,7 +19,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
19
19
|
import "antd/es/form/style";
|
|
20
20
|
import _Form from "antd/es/form";
|
|
21
21
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
22
|
-
var _excluded = ["value", "onChange", "disabled", "labelInValue", "fieldNames", "readOnly", "addonAfter", "configOption", "title", "onFormat", "showCodeName", "optionRender", "customRender", "style", "className", "beforeOpen", "isTooltip", "searchForm", "searchKey", "defaultOne"],
|
|
22
|
+
var _excluded = ["value", "onChange", "disabled", "labelInValue", "fieldNames", "readOnly", "addonAfter", "configOption", "title", "onFormat", "showCodeName", "optionRender", "customRender", "style", "className", "beforeOpen", "afterOpen", "isTooltip", "searchForm", "searchKey", "defaultOne"],
|
|
23
23
|
_excluded2 = ["onOk"],
|
|
24
24
|
_excluded3 = ["rowKey", "columns", "rowSelection"];
|
|
25
25
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
@@ -53,6 +53,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
53
53
|
style = props.style,
|
|
54
54
|
className = props.className,
|
|
55
55
|
beforeOpen = props.beforeOpen,
|
|
56
|
+
afterOpen = props.afterOpen,
|
|
56
57
|
isTooltip = props.isTooltip,
|
|
57
58
|
searchForm = props.searchForm,
|
|
58
59
|
searchKey = props.searchKey,
|
|
@@ -272,6 +273,11 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
272
273
|
setState({
|
|
273
274
|
onOff: true
|
|
274
275
|
});
|
|
276
|
+
setTimeout(function () {
|
|
277
|
+
afterOpen === null || afterOpen === void 0 ? void 0 : afterOpen({
|
|
278
|
+
setInnerState: setState
|
|
279
|
+
});
|
|
280
|
+
}, 100);
|
|
275
281
|
}
|
|
276
282
|
case 14:
|
|
277
283
|
case "end":
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import "antd/es/input/style";
|
|
2
|
+
import _Input from "antd/es/input";
|
|
3
|
+
import "antd/es/button/style";
|
|
4
|
+
import _Button from "antd/es/button";
|
|
1
5
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
6
|
import "antd/es/input-number/style";
|
|
3
7
|
import _InputNumber from "antd/es/input-number";
|
|
4
|
-
import "antd/es/
|
|
5
|
-
import
|
|
8
|
+
import "antd/es/space/style";
|
|
9
|
+
import _Space from "antd/es/space";
|
|
6
10
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
7
11
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
8
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -13,11 +17,9 @@ import { tools } from '@zat-design/utils';
|
|
|
13
17
|
import Container from '../../Container';
|
|
14
18
|
import locale from '../../../../locale';
|
|
15
19
|
import ProForm from '../../../../ProForm';
|
|
16
|
-
var formatAmount = tools.formatAmount
|
|
17
|
-
formatPercent = tools.formatPercent,
|
|
18
|
-
formatPerMill = tools.formatPerMill;
|
|
20
|
+
var formatAmount = tools.formatAmount;
|
|
19
21
|
var ProNumberRange = function ProNumberRange(props) {
|
|
20
|
-
var _valueProps, _ref2, _ref3, _value$, _valueProps2, _ref4, _ref5, _value$2, _valueProps3, _valueProps4;
|
|
22
|
+
var _document$querySelect, _valueProps, _ref2, _ref3, _value$, _valueProps2, _ref4, _ref5, _value$2, _valueProps3, _valueProps4;
|
|
21
23
|
var _props$value = props.value,
|
|
22
24
|
value = _props$value === void 0 ? [] : _props$value,
|
|
23
25
|
_props$onChange = props.onChange,
|
|
@@ -42,6 +44,7 @@ var ProNumberRange = function ProNumberRange(props) {
|
|
|
42
44
|
viewEmpty = _ref.viewEmpty,
|
|
43
45
|
valueType = _ref.valueType;
|
|
44
46
|
var isView = typeof props.isView === 'boolean' ? props.isView : isViewCon; // 组件可直接接收isView参数, 优先级高
|
|
47
|
+
var addonAfterDomWidth = (_document$querySelect = document.querySelector('.ant-input-number-group-addon')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.clientWidth;
|
|
45
48
|
var _useSetState = useSetState({
|
|
46
49
|
range: value || []
|
|
47
50
|
}),
|
|
@@ -87,6 +90,7 @@ var ProNumberRange = function ProNumberRange(props) {
|
|
|
87
90
|
};
|
|
88
91
|
var cls = classnames({
|
|
89
92
|
'pro-number-range': true,
|
|
93
|
+
'pro-number-range-disabled': disabled,
|
|
90
94
|
className: className
|
|
91
95
|
});
|
|
92
96
|
// 查看模式
|
|
@@ -175,44 +179,51 @@ var ProNumberRange = function ProNumberRange(props) {
|
|
|
175
179
|
}
|
|
176
180
|
return result;
|
|
177
181
|
};
|
|
178
|
-
return
|
|
179
|
-
compact: true,
|
|
182
|
+
return _jsx(_Space, {
|
|
180
183
|
className: cls,
|
|
181
|
-
children:
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
}),
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
184
|
+
children: _jsxs(_Space.Compact, {
|
|
185
|
+
children: [_jsx(_InputNumber, _objectSpread(_objectSpread({
|
|
186
|
+
id: id,
|
|
187
|
+
className: "range-left",
|
|
188
|
+
value: (value === null || value === void 0 ? void 0 : value[0]) || range[0],
|
|
189
|
+
placeholder: "".concat(locale.ProForm.inputPlaceholder),
|
|
190
|
+
precision: precision,
|
|
191
|
+
disabled: getDisabled(disabled, 0),
|
|
192
|
+
onChange: function onChange(e) {
|
|
193
|
+
firstHandleChange(e);
|
|
194
|
+
}
|
|
195
|
+
}, valueProps), {}, {
|
|
196
|
+
min: min !== null && min !== void 0 ? min : (_valueProps = valueProps) === null || _valueProps === void 0 ? void 0 : _valueProps.min,
|
|
197
|
+
max: (_ref2 = (_ref3 = (_value$ = value === null || value === void 0 ? void 0 : value[1]) !== null && _value$ !== void 0 ? _value$ : range[1]) !== null && _ref3 !== void 0 ? _ref3 : max) !== null && _ref2 !== void 0 ? _ref2 : (_valueProps2 = valueProps) === null || _valueProps2 === void 0 ? void 0 : _valueProps2.max
|
|
198
|
+
}, childProps === null || childProps === void 0 ? void 0 : childProps[0])), addonBefore ? _jsx(_Button, {
|
|
199
|
+
disabled: true,
|
|
200
|
+
className: "range-addon-before",
|
|
201
|
+
children: addonBefore
|
|
202
|
+
}) : null, _jsx(_Input, {
|
|
203
|
+
className: classnames({
|
|
204
|
+
'range-split': true,
|
|
205
|
+
'range-split-disabled': !!disabled
|
|
206
|
+
}),
|
|
207
|
+
placeholder: "~",
|
|
208
|
+
disabled: true
|
|
209
|
+
}), _jsx(_InputNumber, _objectSpread(_objectSpread({
|
|
210
|
+
className: "range-right",
|
|
211
|
+
value: (value === null || value === void 0 ? void 0 : value[1]) || range[1],
|
|
212
|
+
placeholder: "".concat(locale.ProForm.inputPlaceholder),
|
|
213
|
+
precision: precision,
|
|
214
|
+
disabled: getDisabled(disabled, 1),
|
|
215
|
+
onChange: function onChange(e) {
|
|
216
|
+
lastHandleChange(e);
|
|
217
|
+
}
|
|
218
|
+
}, valueProps), {}, {
|
|
219
|
+
min: (_ref4 = (_ref5 = (_value$2 = value === null || value === void 0 ? void 0 : value[0]) !== null && _value$2 !== void 0 ? _value$2 : range[0]) !== null && _ref5 !== void 0 ? _ref5 : min) !== null && _ref4 !== void 0 ? _ref4 : (_valueProps3 = valueProps) === null || _valueProps3 === void 0 ? void 0 : _valueProps3.min,
|
|
220
|
+
max: max !== null && max !== void 0 ? max : (_valueProps4 = valueProps) === null || _valueProps4 === void 0 ? void 0 : _valueProps4.max
|
|
221
|
+
}, childProps === null || childProps === void 0 ? void 0 : childProps[1])), addonAfter ? _jsx(_Button, {
|
|
222
|
+
disabled: true,
|
|
223
|
+
className: "range-addon-after",
|
|
224
|
+
children: addonAfter
|
|
225
|
+
}) : null]
|
|
226
|
+
})
|
|
216
227
|
});
|
|
217
228
|
};
|
|
218
229
|
export default ProNumberRange;
|
|
@@ -6,83 +6,82 @@
|
|
|
6
6
|
width: 32px !important;
|
|
7
7
|
text-align: center !important;
|
|
8
8
|
|
|
9
|
-
border-right: 0px;
|
|
10
|
-
border-left: 0px;
|
|
11
9
|
pointer-events: none;
|
|
12
10
|
&.@{ant-prefix}-input[disabled] {
|
|
13
11
|
background: #fff !important;
|
|
14
12
|
}
|
|
15
13
|
}
|
|
14
|
+
// 数字输入框error状态
|
|
16
15
|
.@{ant-prefix}-input-number-status-error:not(.@{ant-prefix}-input-number-disabled):not(
|
|
17
16
|
.@{ant-prefix}-input-number-borderless
|
|
18
17
|
).@{ant-prefix}-input-number {
|
|
19
18
|
border-color: @zaui-danger !important;
|
|
20
19
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
|
|
21
|
+
// 分隔符输入框error状态
|
|
22
|
+
&:has(.@{ant-prefix}-input-status-error):not(.pro-number-range-disabled) {
|
|
23
|
+
.range-split,
|
|
24
|
+
.range-addon-before,
|
|
25
|
+
.range-addon-after {
|
|
26
|
+
// color: @zaui-danger !important;
|
|
24
27
|
border-color: @zaui-danger;
|
|
25
28
|
}
|
|
26
29
|
}
|
|
27
30
|
|
|
28
|
-
& .@{ant-prefix}-input-rtl.range-right {
|
|
29
|
-
border-right-width: 0;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
& .@{ant-prefix}-input-rtl.range-right:hover,
|
|
33
|
-
& .@{ant-prefix}-input-rtl.range-right:focus {
|
|
34
|
-
border-right-width: 1px;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
31
|
.@{ant-prefix}-form-item {
|
|
38
32
|
margin-bottom: 0;
|
|
39
33
|
}
|
|
40
34
|
|
|
41
|
-
.range-left,
|
|
42
|
-
.range-right {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
35
|
+
// .range-left,
|
|
36
|
+
// .range-right {
|
|
37
|
+
// text-align: center;
|
|
38
|
+
// }
|
|
46
39
|
|
|
47
|
-
.range-left {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
40
|
+
// .range-left {
|
|
41
|
+
// .@{ant-prefix}-input-number {
|
|
42
|
+
// border-right: none;
|
|
43
|
+
// }
|
|
44
|
+
// }
|
|
52
45
|
|
|
53
|
-
.range-right {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
46
|
+
// .range-right {
|
|
47
|
+
// .@{ant-prefix}-input-number {
|
|
48
|
+
// border-left: none;
|
|
49
|
+
// }
|
|
57
50
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
51
|
+
// .range-right {
|
|
52
|
+
// width: 100%;
|
|
53
|
+
// border-top-left-radius: 0;
|
|
54
|
+
// border-bottom-left-radius: 0;
|
|
55
|
+
// }
|
|
56
|
+
// }
|
|
64
57
|
|
|
65
|
-
|
|
66
|
-
|
|
58
|
+
.range-addon-before,
|
|
59
|
+
.range-addon-after {
|
|
60
|
+
color: var(--zaui-disabled-text);
|
|
61
|
+
pointer-events: none;
|
|
67
62
|
}
|
|
68
63
|
|
|
69
|
-
> *:
|
|
70
|
-
|
|
71
|
-
|
|
64
|
+
// &.@{ant-prefix}-input-group.@{ant-prefix}-input-group-compact > *:not(:last-child) {
|
|
65
|
+
// margin-right: 0;
|
|
66
|
+
// }
|
|
72
67
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
}
|
|
68
|
+
// > *:first-child {
|
|
69
|
+
// border-top-right-radius: 0 !important;
|
|
70
|
+
// border-bottom-right-radius: 0 !important;
|
|
78
71
|
|
|
79
|
-
>
|
|
80
|
-
|
|
81
|
-
|
|
72
|
+
// > .@{ant-prefix}-select-selector {
|
|
73
|
+
// border-top-right-radius: 0 !important;
|
|
74
|
+
// border-bottom-right-radius: 0 !important;
|
|
75
|
+
// }
|
|
76
|
+
// }
|
|
82
77
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
78
|
+
// > *:last-child {
|
|
79
|
+
// border-top-left-radius: 0 !important;
|
|
80
|
+
// border-bottom-left-radius: 0 !important;
|
|
81
|
+
|
|
82
|
+
// > .@{ant-prefix}-select-selector {
|
|
83
|
+
// border-top-left-radius: 0 !important;
|
|
84
|
+
// border-bottom-left-radius: 0 !important;
|
|
85
|
+
// }
|
|
86
|
+
// }
|
|
88
87
|
}
|
|
@@ -5,7 +5,7 @@ import _Tooltip from "antd/es/tooltip";
|
|
|
5
5
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
6
6
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
7
7
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
8
|
-
var _excluded = ["name", "names", "namesStr", "form", "equalWith", "children", "type", "diffConfig", "valuePropName"];
|
|
8
|
+
var _excluded = ["name", "names", "namesStr", "form", "equalWith", "children", "type", "diffConfig", "valuePropName", "normalize"];
|
|
9
9
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
10
|
import classNames from 'classnames';
|
|
11
11
|
import { get } from 'lodash';
|
|
@@ -25,6 +25,7 @@ var ChangedWrapper = function ChangedWrapper(props) {
|
|
|
25
25
|
diffConfig = props.diffConfig,
|
|
26
26
|
_props$valuePropName = props.valuePropName,
|
|
27
27
|
valuePropName = _props$valuePropName === void 0 ? 'value' : _props$valuePropName,
|
|
28
|
+
normalize = props.normalize,
|
|
28
29
|
rest = _objectWithoutProperties(props, _excluded);
|
|
29
30
|
var _useProConfig = useProConfig('ProForm'),
|
|
30
31
|
isDiffAll = _useProConfig.isDiffAll;
|
|
@@ -39,9 +40,10 @@ var ChangedWrapper = function ChangedWrapper(props) {
|
|
|
39
40
|
var noChange = !equalWith && (!originalValues || isDiffAll ? false : isEmpty(originalValue));
|
|
40
41
|
var diffType = useMemo(function () {
|
|
41
42
|
if (!isWatch || noChange) return 'same';
|
|
43
|
+
var _value = normalize ? normalize(props[valuePropName]) : props[valuePropName];
|
|
42
44
|
return diffOriginal({
|
|
43
45
|
originalValue: originalValue,
|
|
44
|
-
value:
|
|
46
|
+
value: _value,
|
|
45
47
|
form: form,
|
|
46
48
|
equalWith: equalWith
|
|
47
49
|
// name: namesStr || name,
|
|
@@ -79,7 +81,7 @@ var ChangedWrapper = function ChangedWrapper(props) {
|
|
|
79
81
|
var _showEllipse = ((_children$props = children.props) === null || _children$props === void 0 ? void 0 : _children$props.showEllipse) || ((_children$props2 = children.props) === null || _children$props2 === void 0 ? void 0 : _children$props2.tooltip);
|
|
80
82
|
return _jsx(_Tooltip, {
|
|
81
83
|
open: tipOpenCalc(),
|
|
82
|
-
mouseEnterDelay
|
|
84
|
+
// mouseEnterDelay={1}
|
|
83
85
|
getPopupContainer: function getPopupContainer(target) {
|
|
84
86
|
return target.parentElement;
|
|
85
87
|
},
|