@zat-design/sisyphus-react 3.2.1 → 3.2.2
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 +32 -7
- package/es/ProEditTable/components/RenderField/index.js +66 -21
- package/es/ProEditTable/index.js +11 -4
- package/es/ProEditTable/propsType.d.ts +11 -1
- package/es/ProForm/components/base/Checkbox/index.d.ts +1 -0
- package/es/ProForm/components/base/Checkbox/index.js +5 -3
- package/es/ProForm/components/base/DatePicker/index.js +3 -2
- package/es/ProForm/components/base/Input/index.js +4 -2
- package/es/ProForm/components/base/Input/propsType.d.ts +1 -0
- package/es/ProForm/components/base/InputNumber/index.d.ts +1 -0
- package/es/ProForm/components/base/InputNumber/index.js +5 -3
- package/es/ProForm/components/base/ProCascader/index.js +6 -6
- package/es/ProForm/components/base/Radio/index.d.ts +1 -0
- package/es/ProForm/components/base/Radio/index.js +4 -2
- package/es/ProForm/components/base/RangePicker/index.d.ts +1 -0
- package/es/ProForm/components/base/RangePicker/index.js +5 -3
- package/es/ProForm/components/base/Select/index.d.ts +1 -0
- package/es/ProForm/components/base/Select/index.js +4 -2
- package/es/ProForm/components/base/Switch/index.d.ts +1 -0
- package/es/ProForm/components/base/Switch/index.js +4 -2
- package/es/ProForm/components/base/SwitchCheckbox/index.d.ts +1 -0
- package/es/ProForm/components/base/SwitchCheckbox/index.js +4 -2
- package/es/ProForm/components/base/TextArea/index.d.ts +1 -0
- package/es/ProForm/components/base/TextArea/index.js +4 -3
- package/es/ProForm/components/base/TimePicker/index.d.ts +1 -0
- package/es/ProForm/components/base/TimePicker/index.js +4 -2
- package/es/ProForm/components/combination/Container/index.js +7 -5
- package/es/ProForm/components/combination/FormList/index.js +6 -5
- package/es/ProForm/components/combination/Group/index.js +6 -3
- package/es/ProForm/components/combination/ProAddressBar/index.js +29 -30
- package/es/ProForm/components/combination/ProCombination/index.js +11 -11
- package/es/ProForm/components/combination/ProModalSelect/index.js +4 -5
- package/es/ProForm/components/combination/ProModalSelect/style/index.less +1 -1
- package/es/ProForm/components/combination/ProNumberRange/index.d.ts +1 -1
- package/es/ProForm/components/combination/ProNumberRange/index.js +7 -7
- package/es/ProForm/components/combination/ProRangeLimit/index.d.ts +1 -0
- package/es/ProForm/components/combination/ProRangeLimit/index.js +4 -2
- package/es/ProForm/components/combination/ProTimeLimit/index.d.ts +1 -0
- package/es/ProForm/components/combination/ProTimeLimit/index.js +4 -2
- package/es/ProForm/components/render/Render.js +54 -20
- package/es/ProForm/components/render/RenderFields.d.ts +1 -0
- package/es/ProForm/components/render/RenderFields.js +12 -11
- package/es/ProForm/index.js +5 -2
- package/es/ProForm/propsType.d.ts +1 -0
- package/es/ProForm/style/index.less +49 -42
- package/es/ProForm/utils/contrastOriginal.d.ts +10 -1
- package/es/ProForm/utils/contrastOriginal.js +15 -18
- package/es/ProForm/utils/useChanged.d.ts +15 -1
- package/es/ProForm/utils/useChanged.js +27 -8
- package/es/ProLayout/components/ProHeader/index.js +1 -0
- package/es/ProLayout/components/ProHeader/style/index.less +7 -0
- package/es/ProSelect/index.js +6 -3
- package/es/ProStep/components/Item/index.js +1 -4
- package/es/ProTable/components/RenderColumn/index.js +1 -1
- package/es/ProTable/style/index.less +6 -0
- package/es/ProTabs/style/index.less +1 -1
- package/es/ProThemeTools/component/PrdTools/index.js +21 -20
- package/es/ProThemeTools/index.js +2 -1
- package/es/ProTree/components/Tree.js +43 -42
- package/es/ProTree/style/index.less +0 -6
- package/es/ProTreeSelect/index.js +3 -2
- package/es/locale/en_US.d.ts +15 -1
- package/es/locale/en_US.js +17 -3
- package/es/locale/zh_CN.d.ts +15 -1
- package/es/locale/zh_CN.js +15 -1
- package/es/style/theme/antd.less +8 -3
- package/lib/ProEditTable/components/RenderField/index.js +61 -20
- package/lib/ProEditTable/index.js +12 -4
- package/lib/ProEditTable/propsType.d.ts +11 -1
- package/lib/ProForm/components/base/Checkbox/index.d.ts +1 -0
- package/lib/ProForm/components/base/Checkbox/index.js +5 -3
- package/lib/ProForm/components/base/DatePicker/index.js +3 -2
- package/lib/ProForm/components/base/Input/index.js +4 -2
- package/lib/ProForm/components/base/Input/propsType.d.ts +1 -0
- package/lib/ProForm/components/base/InputNumber/index.d.ts +1 -0
- package/lib/ProForm/components/base/InputNumber/index.js +5 -3
- package/lib/ProForm/components/base/ProCascader/index.js +6 -6
- package/lib/ProForm/components/base/Radio/index.d.ts +1 -0
- package/lib/ProForm/components/base/Radio/index.js +4 -2
- package/lib/ProForm/components/base/RangePicker/index.d.ts +1 -0
- package/lib/ProForm/components/base/RangePicker/index.js +5 -3
- package/lib/ProForm/components/base/Select/index.d.ts +1 -0
- package/lib/ProForm/components/base/Select/index.js +4 -2
- package/lib/ProForm/components/base/Switch/index.d.ts +1 -0
- package/lib/ProForm/components/base/Switch/index.js +4 -2
- package/lib/ProForm/components/base/SwitchCheckbox/index.d.ts +1 -0
- package/lib/ProForm/components/base/SwitchCheckbox/index.js +4 -2
- package/lib/ProForm/components/base/TextArea/index.d.ts +1 -0
- package/lib/ProForm/components/base/TextArea/index.js +4 -3
- package/lib/ProForm/components/base/TimePicker/index.d.ts +1 -0
- package/lib/ProForm/components/base/TimePicker/index.js +4 -2
- package/lib/ProForm/components/combination/Container/index.js +7 -5
- package/lib/ProForm/components/combination/FormList/index.js +6 -5
- package/lib/ProForm/components/combination/Group/index.js +6 -3
- package/lib/ProForm/components/combination/ProAddressBar/index.js +29 -30
- package/lib/ProForm/components/combination/ProCombination/index.js +11 -11
- package/lib/ProForm/components/combination/ProModalSelect/index.js +4 -5
- package/lib/ProForm/components/combination/ProModalSelect/style/index.less +1 -1
- package/lib/ProForm/components/combination/ProNumberRange/index.d.ts +1 -1
- package/lib/ProForm/components/combination/ProNumberRange/index.js +7 -7
- package/lib/ProForm/components/combination/ProRangeLimit/index.d.ts +1 -0
- package/lib/ProForm/components/combination/ProRangeLimit/index.js +4 -2
- package/lib/ProForm/components/combination/ProTimeLimit/index.d.ts +1 -0
- package/lib/ProForm/components/combination/ProTimeLimit/index.js +4 -2
- package/lib/ProForm/components/render/Render.js +53 -21
- package/lib/ProForm/components/render/RenderFields.d.ts +1 -0
- package/lib/ProForm/components/render/RenderFields.js +12 -11
- package/lib/ProForm/index.js +5 -2
- package/lib/ProForm/propsType.d.ts +1 -0
- package/lib/ProForm/style/index.less +49 -42
- package/lib/ProForm/utils/contrastOriginal.d.ts +10 -1
- package/lib/ProForm/utils/contrastOriginal.js +14 -17
- package/lib/ProForm/utils/useChanged.d.ts +15 -1
- package/lib/ProForm/utils/useChanged.js +27 -8
- package/lib/ProLayout/components/ProHeader/index.js +1 -0
- package/lib/ProLayout/components/ProHeader/style/index.less +7 -0
- package/lib/ProSelect/index.js +6 -3
- package/lib/ProStep/components/Item/index.js +1 -4
- package/lib/ProTable/components/RenderColumn/index.js +1 -1
- package/lib/ProTable/style/index.less +6 -0
- package/lib/ProTabs/style/index.less +1 -1
- package/lib/ProThemeTools/component/PrdTools/index.js +21 -20
- package/lib/ProThemeTools/index.js +2 -1
- package/lib/ProTree/components/Tree.js +42 -41
- package/lib/ProTree/style/index.less +0 -6
- package/lib/ProTreeSelect/index.js +3 -2
- package/lib/locale/en_US.d.ts +15 -1
- package/lib/locale/en_US.js +17 -3
- package/lib/locale/zh_CN.d.ts +15 -1
- package/lib/locale/zh_CN.js +15 -1
- package/lib/style/theme/antd.less +8 -3
- package/package.json +1 -1
|
@@ -8,6 +8,7 @@ import { omit } from 'lodash';
|
|
|
8
8
|
import classnames from 'classnames';
|
|
9
9
|
import { useProConfig } from '../../../../ProConfigProvider';
|
|
10
10
|
import locale from '../../../../locale';
|
|
11
|
+
import ProForm from '../../../../ProForm';
|
|
11
12
|
import './index.less';
|
|
12
13
|
var TextArea = _Input.TextArea;
|
|
13
14
|
var TextAreaDef = function TextAreaDef(props) {
|
|
@@ -15,10 +16,10 @@ var TextAreaDef = function TextAreaDef(props) {
|
|
|
15
16
|
otherProps = props.otherProps,
|
|
16
17
|
className = props.className,
|
|
17
18
|
rest = _objectWithoutProperties(props, _excluded);
|
|
18
|
-
var _ref =
|
|
19
|
+
var _ref = ProForm.useFieldProps() || {},
|
|
19
20
|
label = _ref.label,
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
isViewCon = _ref.isView;
|
|
22
|
+
var isView = typeof props.isView === 'boolean' ? props.isView : isViewCon;
|
|
22
23
|
var initialConfig = useProConfig('TextArea');
|
|
23
24
|
var disabled = (initialConfig === null || initialConfig === void 0 ? void 0 : initialConfig.disabled) || rest.disabled;
|
|
24
25
|
if (isView) {
|
|
@@ -7,6 +7,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
7
7
|
import moment from 'moment';
|
|
8
8
|
import { useProConfig } from '../../../../ProConfigProvider';
|
|
9
9
|
import Container from '../../Container';
|
|
10
|
+
import ProForm from '../../../../ProForm';
|
|
10
11
|
import './style/index.less';
|
|
11
12
|
var TimePicker = function TimePicker(props) {
|
|
12
13
|
var _props$format = props.format,
|
|
@@ -15,11 +16,12 @@ var TimePicker = function TimePicker(props) {
|
|
|
15
16
|
value = props.value,
|
|
16
17
|
otherProps = props.otherProps,
|
|
17
18
|
rest = _objectWithoutProperties(props, _excluded);
|
|
18
|
-
var _ref =
|
|
19
|
-
|
|
19
|
+
var _ref = ProForm.useFieldProps() || {},
|
|
20
|
+
isViewCon = _ref.isView,
|
|
20
21
|
viewEmpty = _ref.viewEmpty,
|
|
21
22
|
_ref$valueType = _ref.valueType,
|
|
22
23
|
valueType = _ref$valueType === void 0 ? 'dateTime' : _ref$valueType;
|
|
24
|
+
var isView = typeof props.isView === 'boolean' ? props.isView : isViewCon;
|
|
23
25
|
var initialConfig = useProConfig('AntTimePicker');
|
|
24
26
|
var handleChange = function handleChange(value) {
|
|
25
27
|
if (valueType === 'dateTime') {
|
|
@@ -6,16 +6,18 @@ import { omit } from 'lodash';
|
|
|
6
6
|
import classnames from 'classnames';
|
|
7
7
|
import RenderFields from '../../render/RenderFields';
|
|
8
8
|
import ProCollapse from '../../../../ProLayout/components/ProCollapse';
|
|
9
|
+
import ProForm from '../../../../ProForm';
|
|
9
10
|
var Container = function Container(props) {
|
|
10
11
|
var children = props.children,
|
|
11
12
|
otherProps = props.otherProps,
|
|
12
13
|
className = props.className,
|
|
13
14
|
container = props.container;
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
var _ref = ProForm.useFieldProps() || {},
|
|
16
|
+
type = _ref.type,
|
|
17
|
+
form = _ref.form,
|
|
18
|
+
show = _ref.show,
|
|
19
|
+
required = _ref.required,
|
|
20
|
+
disabled = _ref.disabled;
|
|
19
21
|
var _className = classnames(_defineProperty({
|
|
20
22
|
'pro-container': true,
|
|
21
23
|
'pro-container-diy': type === 'Container'
|
|
@@ -11,9 +11,9 @@ import { namesPathTransform } from './utils';
|
|
|
11
11
|
import ToolbarButton from './components/ToolbarButton';
|
|
12
12
|
import BlockFields from './components/BlockFields';
|
|
13
13
|
import LineFields from './components/LineFields';
|
|
14
|
+
import ProForm from '../../../../ProForm';
|
|
14
15
|
var FormList = function FormList(props, ref) {
|
|
15
16
|
var columns = props.columns,
|
|
16
|
-
otherProps = props.otherProps,
|
|
17
17
|
min = props.min,
|
|
18
18
|
max = props.max,
|
|
19
19
|
toolbarProps = props.toolbarProps,
|
|
@@ -29,10 +29,11 @@ var FormList = function FormList(props, ref) {
|
|
|
29
29
|
key: String(item.key)
|
|
30
30
|
});
|
|
31
31
|
});
|
|
32
|
-
var
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
var _ref = ProForm.useFieldProps() || {},
|
|
33
|
+
form = _ref.form,
|
|
34
|
+
name = _ref.name,
|
|
35
|
+
isView = _ref.isView,
|
|
36
|
+
disabled = _ref.disabled;
|
|
36
37
|
var errors = meta.errors;
|
|
37
38
|
var _namePath = toArray(name);
|
|
38
39
|
var processColumns = useCallback(function (fieldName, namePath) {
|
|
@@ -10,6 +10,7 @@ import { omit } from 'lodash';
|
|
|
10
10
|
import classnames from 'classnames';
|
|
11
11
|
import RenderFields from '../../render/RenderFields';
|
|
12
12
|
import { insertSeparator, parseName } from './utils';
|
|
13
|
+
import ProForm from '../../../../ProForm';
|
|
13
14
|
var Group = function Group(props) {
|
|
14
15
|
var columns = props.children,
|
|
15
16
|
otherProps = props.otherProps,
|
|
@@ -19,9 +20,11 @@ var Group = function Group(props) {
|
|
|
19
20
|
size: 12
|
|
20
21
|
} : _props$space,
|
|
21
22
|
id = props.id;
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
var _ref = ProForm.useFieldProps() || {},
|
|
24
|
+
names = _ref.names,
|
|
25
|
+
name = _ref.name,
|
|
26
|
+
form = _ref.form;
|
|
27
|
+
if (!Array.isArray(names)) {
|
|
25
28
|
console.error('Warning: Composite form components whose type is Group must be configured with names');
|
|
26
29
|
}
|
|
27
30
|
var _parentNames = parseName(id);
|
|
@@ -9,11 +9,9 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
|
9
9
|
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
10
10
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
11
11
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
12
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
13
12
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
14
13
|
import "antd/es/typography/style";
|
|
15
14
|
import _Typography from "antd/es/typography";
|
|
16
|
-
var _excluded = ["className", "getPopupContainer", "hasDetail", "detailMaxLength", "fieldNames", "value", "disabled", "dataSource", "onChange", "useRequest", "transformResponse", "level", "isView", "enumCode", "code", "tooltip", "separator"];
|
|
17
15
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
16
|
import { useEffect, useState, memo, useMemo } from 'react';
|
|
19
17
|
import { useSetState } from 'ahooks';
|
|
@@ -21,6 +19,7 @@ import { tools } from '@zat-design/utils';
|
|
|
21
19
|
import { useProConfig } from '../../../../ProConfigProvider';
|
|
22
20
|
import useEnum from '../../../../ProEnum/hooks/useEnum';
|
|
23
21
|
import locale from '../../../../locale';
|
|
22
|
+
import ProForm from '../../../../ProForm';
|
|
24
23
|
var transformDataName = tools.transformDataName;
|
|
25
24
|
var Text = _Typography.Text;
|
|
26
25
|
var filterDataSource = function filterDataSource(dataSource, level) {
|
|
@@ -48,7 +47,7 @@ var levelMap = {
|
|
|
48
47
|
3: 'county'
|
|
49
48
|
};
|
|
50
49
|
var ProAddressBar = function ProAddressBar(props) {
|
|
51
|
-
var
|
|
50
|
+
var _ref12, _ref12$filter, _locale$ProAddressBar, _locale$ProAddressBar2, _locale$ProAddressBar3;
|
|
52
51
|
var _ref = useProConfig('ProAddressBar') || {},
|
|
53
52
|
configUseRequest = _ref.useRequest,
|
|
54
53
|
configTransformResponse = _ref.transformResponse,
|
|
@@ -78,30 +77,30 @@ var ProAddressBar = function ProAddressBar(props) {
|
|
|
78
77
|
transformResponse = _props$transformRespo === void 0 ? configTransformResponse : _props$transformRespo,
|
|
79
78
|
_props$level = props.level,
|
|
80
79
|
level = _props$level === void 0 ? 3 : _props$level,
|
|
81
|
-
|
|
82
|
-
isView = _props$isView === void 0 ? false : _props$isView,
|
|
80
|
+
isView = props.isView,
|
|
83
81
|
_props$enumCode = props.enumCode,
|
|
84
82
|
enumCode = _props$enumCode === void 0 ? configEnumCode : _props$enumCode,
|
|
85
83
|
_props$code = props.code,
|
|
86
84
|
code = _props$code === void 0 ? configCode : _props$code,
|
|
87
85
|
tooltip = props.tooltip,
|
|
88
86
|
_props$separator = props.separator,
|
|
89
|
-
separator = _props$separator === void 0 ? '' : _props$separator
|
|
90
|
-
|
|
87
|
+
separator = _props$separator === void 0 ? '' : _props$separator;
|
|
88
|
+
var _ref2 = ProForm.useFieldProps() || {},
|
|
89
|
+
isViewCon = _ref2.isView;
|
|
91
90
|
var addressCode = code || enumCode;
|
|
92
|
-
var realIsView = isView
|
|
93
|
-
var
|
|
94
|
-
|
|
95
|
-
province =
|
|
96
|
-
city =
|
|
91
|
+
var realIsView = typeof isView === 'boolean' ? isView : isViewCon;
|
|
92
|
+
var _ref3 = value || [],
|
|
93
|
+
_ref4 = _slicedToArray(_ref3, 2),
|
|
94
|
+
province = _ref4[0],
|
|
95
|
+
city = _ref4[1];
|
|
97
96
|
var realLevel = Math.max(2, level);
|
|
98
97
|
var county = realLevel === 3 ? value === null || value === void 0 ? void 0 : value[realLevel - 1] : undefined;
|
|
99
98
|
var address = value === null || value === void 0 ? void 0 : value[realLevel];
|
|
100
99
|
var enumData = useEnum(addressCode);
|
|
101
|
-
var
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
enumDataSource =
|
|
100
|
+
var _ref5 = Array.isArray(enumData) ? enumData : [],
|
|
101
|
+
_ref6 = _slicedToArray(_ref5, 1),
|
|
102
|
+
_ref6$ = _ref6[0],
|
|
103
|
+
enumDataSource = _ref6$ === void 0 ? [] : _ref6$;
|
|
105
104
|
var realDataSource = useMemo(function () {
|
|
106
105
|
var innerDataSource = dataSource || (addressCode ? enumDataSource : []);
|
|
107
106
|
return realLevel === 2 ? filterDataSource(innerDataSource, level) : innerDataSource;
|
|
@@ -141,12 +140,12 @@ var ProAddressBar = function ProAddressBar(props) {
|
|
|
141
140
|
_useSetState2 = _slicedToArray(_useSetState, 2),
|
|
142
141
|
defaultLabel = _useSetState2[0],
|
|
143
142
|
setDefaultLabel = _useSetState2[1];
|
|
144
|
-
var
|
|
145
|
-
provinceLabel =
|
|
146
|
-
cityLabel =
|
|
147
|
-
countyLabel =
|
|
143
|
+
var _ref7 = defaultLabel || {},
|
|
144
|
+
provinceLabel = _ref7.province,
|
|
145
|
+
cityLabel = _ref7.city,
|
|
146
|
+
countyLabel = _ref7.county;
|
|
148
147
|
var getProvinces = /*#__PURE__*/function () {
|
|
149
|
-
var
|
|
148
|
+
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(loadData) {
|
|
150
149
|
var _yield$service, data, newData, _newData, _provinces, transFormData;
|
|
151
150
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
152
151
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -186,11 +185,11 @@ var ProAddressBar = function ProAddressBar(props) {
|
|
|
186
185
|
}, _callee);
|
|
187
186
|
}));
|
|
188
187
|
return function getProvinces(_x) {
|
|
189
|
-
return
|
|
188
|
+
return _ref8.apply(this, arguments);
|
|
190
189
|
};
|
|
191
190
|
}();
|
|
192
191
|
var getAddressData = /*#__PURE__*/function () {
|
|
193
|
-
var
|
|
192
|
+
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
|
|
194
193
|
var _yield$service2, data;
|
|
195
194
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
196
195
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -214,12 +213,12 @@ var ProAddressBar = function ProAddressBar(props) {
|
|
|
214
213
|
}, _callee2);
|
|
215
214
|
}));
|
|
216
215
|
return function getAddressData(_x2) {
|
|
217
|
-
return
|
|
216
|
+
return _ref9.apply(this, arguments);
|
|
218
217
|
};
|
|
219
218
|
}();
|
|
220
219
|
// 传入useRequest时,得到地址省市区的label,初次加载需要
|
|
221
220
|
var initAddressLabel = /*#__PURE__*/function () {
|
|
222
|
-
var
|
|
221
|
+
var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(key, value, extra) {
|
|
223
222
|
var selectProvince, _newData2, _yield$service3, data, newData;
|
|
224
223
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
225
224
|
while (1) switch (_context3.prev = _context3.next) {
|
|
@@ -259,7 +258,7 @@ var ProAddressBar = function ProAddressBar(props) {
|
|
|
259
258
|
}, _callee3);
|
|
260
259
|
}));
|
|
261
260
|
return function initAddressLabel(_x3, _x4, _x5) {
|
|
262
|
-
return
|
|
261
|
+
return _ref10.apply(this, arguments);
|
|
263
262
|
};
|
|
264
263
|
}();
|
|
265
264
|
useEffect(function () {
|
|
@@ -298,7 +297,7 @@ var ProAddressBar = function ProAddressBar(props) {
|
|
|
298
297
|
}
|
|
299
298
|
}, [realIsView, value, serviceData]);
|
|
300
299
|
var handleLoadData = /*#__PURE__*/function () {
|
|
301
|
-
var
|
|
300
|
+
var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(selectedOptions) {
|
|
302
301
|
var targetOption, data;
|
|
303
302
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
304
303
|
while (1) switch (_context4.prev = _context4.next) {
|
|
@@ -327,7 +326,7 @@ var ProAddressBar = function ProAddressBar(props) {
|
|
|
327
326
|
}, _callee4);
|
|
328
327
|
}));
|
|
329
328
|
return function handleLoadData(_x6) {
|
|
330
|
-
return
|
|
329
|
+
return _ref11.apply(this, arguments);
|
|
331
330
|
};
|
|
332
331
|
}();
|
|
333
332
|
var handleChange = function handleChange(changeValue, selectedOptions) {
|
|
@@ -369,9 +368,9 @@ var ProAddressBar = function ProAddressBar(props) {
|
|
|
369
368
|
})) === null || _filter === void 0 ? void 0 : _filter.join('/') : undefined;
|
|
370
369
|
};
|
|
371
370
|
var addressValue = value && (province || city || county) ? [province, city, county].slice(0, realLevel) : undefined;
|
|
372
|
-
var viewValue = ((
|
|
371
|
+
var viewValue = ((_ref12 = [provinceLabel, cityLabel, countyLabel, value === null || value === void 0 ? void 0 : value[realLevel]]) === null || _ref12 === void 0 ? void 0 : (_ref12$filter = _ref12.filter(function (item) {
|
|
373
372
|
return !!item;
|
|
374
|
-
})) === null ||
|
|
373
|
+
})) === null || _ref12$filter === void 0 ? void 0 : _ref12$filter.join(separator)) || '-';
|
|
375
374
|
return realIsView ? tooltip ? _jsx(_Tooltip, {
|
|
376
375
|
className: className,
|
|
377
376
|
title: tooltip === true ? viewValue : tooltip,
|
|
@@ -15,6 +15,7 @@ import Container from '../../Container';
|
|
|
15
15
|
import * as componentMap from '../../index';
|
|
16
16
|
import { isNullValue, weedOutProps } from '../../../utils';
|
|
17
17
|
import { otherKeys } from '../../../propsType';
|
|
18
|
+
import ProForm from '../../../../ProForm';
|
|
18
19
|
import './style/index.less';
|
|
19
20
|
var useControlled = function useControlled(props) {
|
|
20
21
|
var value = props.value,
|
|
@@ -49,17 +50,16 @@ export var ProCombination = function ProCombination(props) {
|
|
|
49
50
|
}, {
|
|
50
51
|
renderType: 'Input'
|
|
51
52
|
}] : _props$childProps,
|
|
52
|
-
separator = props.separator
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
form = otherProps.form;
|
|
53
|
+
separator = props.separator;
|
|
54
|
+
var _ref = ProForm.useFieldProps() || {},
|
|
55
|
+
_ref$isView = _ref.isView,
|
|
56
|
+
isView = _ref$isView === void 0 ? false : _ref$isView,
|
|
57
|
+
viewEmpty = _ref.viewEmpty,
|
|
58
|
+
form = _ref.form;
|
|
59
59
|
// 取到对应组件
|
|
60
|
-
var
|
|
61
|
-
BeforeCom =
|
|
62
|
-
AfterCom =
|
|
60
|
+
var _ref2 = [componentMap[((_childProps$ = childProps[0]) === null || _childProps$ === void 0 ? void 0 : _childProps$.renderType) || 'Input'], componentMap[((_childProps$2 = childProps[1]) === null || _childProps$2 === void 0 ? void 0 : _childProps$2.renderType) || 'Input']],
|
|
61
|
+
BeforeCom = _ref2[0],
|
|
62
|
+
AfterCom = _ref2[1];
|
|
63
63
|
var _useControlled = useControlled(props),
|
|
64
64
|
_useControlled2 = _slicedToArray(_useControlled, 2),
|
|
65
65
|
values = _useControlled2[0],
|
|
@@ -107,7 +107,7 @@ export var ProCombination = function ProCombination(props) {
|
|
|
107
107
|
// 查看模式
|
|
108
108
|
if (isView) {
|
|
109
109
|
if (!values || !Array.isArray(values)) {
|
|
110
|
-
return
|
|
110
|
+
return viewEmpty;
|
|
111
111
|
}
|
|
112
112
|
var childData = childProps;
|
|
113
113
|
if (!childData || Array.isArray(childData) && !childData.length) {
|
|
@@ -12,7 +12,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
12
12
|
import "antd/es/form/style";
|
|
13
13
|
import _Form from "antd/es/form";
|
|
14
14
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
15
|
-
var _excluded = ["value", "onChange", "disabled", "labelInValue", "fieldNames", "readOnly", "addonAfter", "configOption", "title", "onFormat", "showCodeName", "optionRender", "customRender", "style", "className", "beforeOpen", "isTooltip", "
|
|
15
|
+
var _excluded = ["value", "onChange", "disabled", "labelInValue", "fieldNames", "readOnly", "addonAfter", "configOption", "title", "onFormat", "showCodeName", "optionRender", "customRender", "style", "className", "beforeOpen", "isTooltip", "searchForm", "defaultOne"],
|
|
16
16
|
_excluded2 = ["onOk"],
|
|
17
17
|
_excluded3 = ["rowKey", "columns", "rowSelection"];
|
|
18
18
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
@@ -47,7 +47,6 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
47
47
|
className = props.className,
|
|
48
48
|
beforeOpen = props.beforeOpen,
|
|
49
49
|
isTooltip = props.isTooltip,
|
|
50
|
-
otherProps = props.otherProps,
|
|
51
50
|
searchForm = props.searchForm,
|
|
52
51
|
defaultOne = props.defaultOne,
|
|
53
52
|
restInputProps = _objectWithoutProperties(props, _excluded);
|
|
@@ -68,10 +67,10 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
68
67
|
var _ref = modalProps || {},
|
|
69
68
|
onOk = _ref.onOk,
|
|
70
69
|
restModalProps = _objectWithoutProperties(_ref, _excluded2);
|
|
71
|
-
var _ref2 =
|
|
72
|
-
|
|
73
|
-
isView = _ref2$isView === void 0 ? false : _ref2$isView,
|
|
70
|
+
var _ref2 = ProForm.useFieldProps() || {},
|
|
71
|
+
isViewCon = _ref2.isView,
|
|
74
72
|
viewEmpty = _ref2.viewEmpty;
|
|
73
|
+
var isView = typeof props.isView === 'boolean' ? props.isView : isViewCon; // 组件可直接接收isView参数, 优先级高
|
|
75
74
|
// 是否多选
|
|
76
75
|
var isMultiple = type === 'checkbox';
|
|
77
76
|
// 生成一个唯一id,用于满足tooltip功能
|
|
@@ -12,6 +12,7 @@ import classnames from 'classnames';
|
|
|
12
12
|
import { tools } from '@zat-design/utils';
|
|
13
13
|
import Container from '../../Container';
|
|
14
14
|
import locale from '../../../../locale';
|
|
15
|
+
import ProForm from '../../../../ProForm';
|
|
15
16
|
var formatAmount = tools.formatAmount,
|
|
16
17
|
formatPercent = tools.formatPercent,
|
|
17
18
|
formatPerMill = tools.formatPerMill;
|
|
@@ -29,17 +30,16 @@ var ProNumberRange = function ProNumberRange(props) {
|
|
|
29
30
|
decimal = _props$decimal === void 0 ? 2 : _props$decimal,
|
|
30
31
|
precision = props.precision,
|
|
31
32
|
childProps = props.childProps,
|
|
32
|
-
otherProps = props.otherProps,
|
|
33
33
|
addonBefore = props.addonBefore,
|
|
34
34
|
addonAfter = props.addonAfter,
|
|
35
35
|
_props$separator = props.separator,
|
|
36
36
|
separator = _props$separator === void 0 ? '~' : _props$separator,
|
|
37
37
|
inValueType = props.valueType;
|
|
38
|
-
var _ref =
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
valueType = _ref.valueType
|
|
42
|
-
|
|
38
|
+
var _ref = ProForm.useFieldProps() || {},
|
|
39
|
+
isViewCon = _ref.isView,
|
|
40
|
+
viewEmpty = _ref.viewEmpty,
|
|
41
|
+
valueType = _ref.valueType;
|
|
42
|
+
var isView = typeof props.isView === 'boolean' ? props.isView : isViewCon; // 组件可直接接收isView参数, 优先级高
|
|
43
43
|
var _useSetState = useSetState({
|
|
44
44
|
range: value || []
|
|
45
45
|
}),
|
|
@@ -90,7 +90,7 @@ var ProNumberRange = function ProNumberRange(props) {
|
|
|
90
90
|
// 查看模式
|
|
91
91
|
if (isView || props.isView) {
|
|
92
92
|
if (isEmpty(value)) {
|
|
93
|
-
return
|
|
93
|
+
return viewEmpty;
|
|
94
94
|
}
|
|
95
95
|
switch (valueType) {
|
|
96
96
|
// 百分比
|
|
@@ -10,6 +10,7 @@ export type Props = Omit<RangePickerProps, 'value' | 'onChange' | 'format' | 'se
|
|
|
10
10
|
value?: ValueStr;
|
|
11
11
|
format?: string;
|
|
12
12
|
separator?: any;
|
|
13
|
+
isView?: boolean;
|
|
13
14
|
};
|
|
14
15
|
type Value = [Moment?, Moment?, boolean?];
|
|
15
16
|
type ValueStr = [string?, string?, string?];
|
|
@@ -16,6 +16,7 @@ import moment from 'moment';
|
|
|
16
16
|
import { useProConfig } from '../../../../ProConfigProvider';
|
|
17
17
|
import Container from '../../Container';
|
|
18
18
|
import locale from '../../../../locale';
|
|
19
|
+
import ProForm from '../../../../ProForm';
|
|
19
20
|
var defaultPickerValue = [moment(), moment()];
|
|
20
21
|
var useControlled = function useControlled(props) {
|
|
21
22
|
var _useState = useState(),
|
|
@@ -52,9 +53,10 @@ var ProRangeLimit = function ProRangeLimit(props) {
|
|
|
52
53
|
_props$separator = props.separator,
|
|
53
54
|
separator = _props$separator === void 0 ? '~' : _props$separator,
|
|
54
55
|
rest = _objectWithoutProperties(props, _excluded);
|
|
55
|
-
var _ref =
|
|
56
|
-
|
|
56
|
+
var _ref = ProForm.useFieldProps() || {},
|
|
57
|
+
isViewCon = _ref.isView,
|
|
57
58
|
viewEmpty = _ref.viewEmpty;
|
|
59
|
+
var isView = typeof props.isView === 'boolean' ? props.isView : isViewCon; // 组件可直接接收isView参数, 优先级高
|
|
58
60
|
var _useControlled = useControlled(_objectSpread(_objectSpread({}, props), {}, {
|
|
59
61
|
format: format
|
|
60
62
|
})),
|
|
@@ -15,6 +15,7 @@ export type ProTimeLimitProps = DistributiveOmit<DatePickerProps, 'value' | 'onC
|
|
|
15
15
|
valueType?: 'moment' | 'format' | 'ISO';
|
|
16
16
|
otherProps?: ProFormOtherProps;
|
|
17
17
|
mode?: 'DatePicker';
|
|
18
|
+
isView?: boolean;
|
|
18
19
|
};
|
|
19
20
|
export declare const ProTimeLimit: React.FC<ProTimeLimitProps>;
|
|
20
21
|
export type ProLimitProps = ProTimeLimitProps | (ProRangeLimitProps & {
|
|
@@ -19,6 +19,7 @@ import Container from '../../Container';
|
|
|
19
19
|
import useControlled from './hooks/useControlled';
|
|
20
20
|
import ProRangeLimit from '../ProRangeLimit';
|
|
21
21
|
import locale from '../../../../locale';
|
|
22
|
+
import ProForm from '../../../../ProForm';
|
|
22
23
|
// 永久有效默认值
|
|
23
24
|
export var ProTimeLimit = function ProTimeLimit(props) {
|
|
24
25
|
var _props$format = props.format,
|
|
@@ -31,9 +32,10 @@ export var ProTimeLimit = function ProTimeLimit(props) {
|
|
|
31
32
|
valueType = _props$valueType === void 0 ? 'format' : _props$valueType,
|
|
32
33
|
otherProps = props.otherProps,
|
|
33
34
|
rest = _objectWithoutProperties(props, _excluded);
|
|
34
|
-
var _ref =
|
|
35
|
-
|
|
35
|
+
var _ref = ProForm.useFieldProps() || {},
|
|
36
|
+
isViewCon = _ref.isView,
|
|
36
37
|
viewEmpty = _ref.viewEmpty;
|
|
38
|
+
var isView = typeof props.isView === 'boolean' ? props.isView : isViewCon; // 组件可直接接收isView参数, 优先级高
|
|
37
39
|
var _useMemo = useMemo(function () {
|
|
38
40
|
var foreverMoment = foreverTime ? moment(foreverTime, format) : moment('9999-01-01', 'YYYY-MM-DD');
|
|
39
41
|
var foreverString = foreverTime || foreverMoment.format(format);
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import "antd/es/col/style";
|
|
2
2
|
import _Col from "antd/es/col";
|
|
3
|
+
import "antd/es/tooltip/style";
|
|
4
|
+
import _Tooltip from "antd/es/tooltip";
|
|
3
5
|
import "antd/es/space/style";
|
|
4
6
|
import _Space from "antd/es/space";
|
|
5
7
|
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
@@ -11,6 +13,7 @@ import "antd/es/form/style";
|
|
|
11
13
|
import _Form from "antd/es/form";
|
|
12
14
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
13
15
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
16
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
14
17
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
15
18
|
var _excluded = ["labelWidth", "hiddenNames", "trim", "upperCase", "className", "rules", "required", "labelRequired", "tooltip"];
|
|
16
19
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
@@ -46,7 +49,8 @@ var Render = function Render(props) {
|
|
|
46
49
|
isSelect = props.isSelect,
|
|
47
50
|
originalValues = props.originalValues,
|
|
48
51
|
equalWith = props.equalWith,
|
|
49
|
-
requiredOnView = props.requiredOnView
|
|
52
|
+
requiredOnView = props.requiredOnView,
|
|
53
|
+
originalTip = props.originalTip;
|
|
50
54
|
var colProps = props.colProps;
|
|
51
55
|
// 剔除一些不是FormItem的属性, 防止控制台报warning
|
|
52
56
|
var labelWidth = formItemProps.labelWidth,
|
|
@@ -67,7 +71,6 @@ var Render = function Render(props) {
|
|
|
67
71
|
disabled: componentProps.disabled,
|
|
68
72
|
rules: rules,
|
|
69
73
|
required: required,
|
|
70
|
-
componentProps: componentProps,
|
|
71
74
|
fieldProps: fieldProps,
|
|
72
75
|
component: component,
|
|
73
76
|
originComponent: originComponent,
|
|
@@ -78,7 +81,6 @@ var Render = function Render(props) {
|
|
|
78
81
|
_disabled = _useShouldUpdate.disabled,
|
|
79
82
|
_rules = _useShouldUpdate.rules,
|
|
80
83
|
_required = _useShouldUpdate.required,
|
|
81
|
-
_componentProps = _useShouldUpdate.componentProps,
|
|
82
84
|
_fieldProps = _useShouldUpdate.fieldProps,
|
|
83
85
|
AutoComponent = _useShouldUpdate.component;
|
|
84
86
|
otherFormItemProps.shouldUpdate = shouldUpdate;
|
|
@@ -96,7 +98,17 @@ var Render = function Render(props) {
|
|
|
96
98
|
}).join('-');
|
|
97
99
|
}, [otherProps === null || otherProps === void 0 ? void 0 : otherProps.names]);
|
|
98
100
|
// 判断当前字段是否变更
|
|
99
|
-
var
|
|
101
|
+
var _useChanged = useChanged({
|
|
102
|
+
name: formItemProps.name,
|
|
103
|
+
names: otherProps.names,
|
|
104
|
+
namesStr: namesStr,
|
|
105
|
+
originalValues: originalValues,
|
|
106
|
+
form: form,
|
|
107
|
+
equalWith: equalWith
|
|
108
|
+
}),
|
|
109
|
+
_useChanged2 = _slicedToArray(_useChanged, 2),
|
|
110
|
+
changed = _useChanged2[0],
|
|
111
|
+
originalValue = _useChanged2[1];
|
|
100
112
|
var internalRule = useRules({
|
|
101
113
|
names: otherProps.names,
|
|
102
114
|
label: otherFormItemProps.label,
|
|
@@ -351,7 +363,9 @@ var Render = function Render(props) {
|
|
|
351
363
|
};
|
|
352
364
|
}
|
|
353
365
|
// 需要过滤掉的form_item的key
|
|
354
|
-
var filterFormItemKey = ['onFieldChange',
|
|
366
|
+
var filterFormItemKey = ['onFieldChange',
|
|
367
|
+
// 'shouldUpdate',
|
|
368
|
+
'namePath', 'isView', 'parentNames', 'space', 'before', 'after'];
|
|
355
369
|
if (type === 'FormList') {
|
|
356
370
|
lastComponentProps.disabled = lastDisabled;
|
|
357
371
|
var lessMode = lastComponentProps.mode === 'less';
|
|
@@ -376,26 +390,46 @@ var Render = function Render(props) {
|
|
|
376
390
|
});
|
|
377
391
|
}
|
|
378
392
|
// 当存在shouldUpdate时补货所有form变更(防止表单onchange设置form值时无法更新的问题)
|
|
379
|
-
if (_otherFormItemProps.shouldUpdate) {
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
393
|
+
// if (_otherFormItemProps.shouldUpdate) {
|
|
394
|
+
// return (
|
|
395
|
+
// <Form.Item shouldUpdate={_otherFormItemProps.shouldUpdate} noStyle>
|
|
396
|
+
// {() => {
|
|
397
|
+
// return (
|
|
398
|
+
// <Form.Item
|
|
399
|
+
// {...omit(_otherFormItemProps, filterFormItemKey)}
|
|
400
|
+
// // @ts-ignore
|
|
401
|
+
// _internalItemRender={internalItemRender}
|
|
402
|
+
// className={_className}
|
|
403
|
+
// >
|
|
404
|
+
// {child}
|
|
405
|
+
// </Form.Item>
|
|
406
|
+
// );
|
|
407
|
+
// }}
|
|
408
|
+
// </Form.Item>
|
|
409
|
+
// );
|
|
410
|
+
// }
|
|
411
|
+
var formItem = _jsx(_Form.Item, _objectSpread(_objectSpread({}, omit(_otherFormItemProps, filterFormItemKey)), {}, {
|
|
394
412
|
// @ts-ignore
|
|
395
413
|
_internalItemRender: internalItemRender,
|
|
396
414
|
className: _className,
|
|
397
415
|
children: child
|
|
398
416
|
}));
|
|
417
|
+
// 不渲染tooltip
|
|
418
|
+
if (!originalTip || ['FormList', 'ProEditTable'].includes(type)) {
|
|
419
|
+
return formItem;
|
|
420
|
+
}
|
|
421
|
+
var title = _jsxs(_Space, {
|
|
422
|
+
children: ["\u521D\u59CB\u503C\uFF1A", /*#__PURE__*/React.cloneElement(child, _objectSpread(_objectSpread({}, child), {}, {
|
|
423
|
+
isView: true,
|
|
424
|
+
value: originalValue,
|
|
425
|
+
checked: type === 'Switch' ? originalValue : undefined
|
|
426
|
+
}))]
|
|
427
|
+
});
|
|
428
|
+
return _jsx(_Tooltip, {
|
|
429
|
+
title: title,
|
|
430
|
+
visible: changed ? undefined : false,
|
|
431
|
+
children: formItem
|
|
432
|
+
});
|
|
399
433
|
};
|
|
400
434
|
var FormItem = _jsxs(_Fragment, {
|
|
401
435
|
children: [renderItem(), (otherProps === null || otherProps === void 0 ? void 0 : (_otherProps$names2 = otherProps.names) === null || _otherProps$names2 === void 0 ? void 0 : _otherProps$names2.length) ? otherProps.names.map(function (name) {
|