@zat-design/sisyphus-react 3.2.0-beta.2 → 3.2.1-beta.1
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 +10 -5
- package/es/ProDownload/utils.js +0 -2
- 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 +10 -11
- package/es/ProForm/components/combination/ProModalSelect/index.js +4 -5
- 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 +47 -18
- package/es/ProForm/components/render/RenderFields.d.ts +1 -0
- package/es/ProForm/components/render/RenderFields.js +4 -2
- package/es/ProForm/index.js +5 -2
- package/es/ProForm/propsType.d.ts +1 -0
- package/es/ProForm/style/index.less +44 -43
- package/es/ProForm/utils/useChanged.d.ts +1 -1
- package/es/ProForm/utils/useChanged.js +9 -8
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +7 -13
- package/es/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +1 -1
- package/es/ProSelect/index.js +6 -3
- package/lib/ProEditTable/components/RenderField/index.js +0 -2
- 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 +6 -4
- 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 +10 -11
- package/lib/ProForm/components/combination/ProModalSelect/index.js +4 -5
- 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/old/InputRange/index.js +1 -0
- package/lib/ProForm/components/old/ProCertValidity/index.js +1 -1
- package/lib/ProForm/components/render/Render.js +46 -20
- package/lib/ProForm/components/render/RenderFields.d.ts +1 -0
- package/lib/ProForm/components/render/RenderFields.js +4 -2
- package/lib/ProForm/index.js +5 -2
- package/lib/ProForm/propsType.d.ts +1 -0
- package/lib/ProForm/style/index.less +44 -43
- package/lib/ProForm/utils/useChanged.d.ts +1 -1
- package/lib/ProForm/utils/useChanged.js +9 -8
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +6 -12
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +1 -1
- package/lib/ProSelect/index.js +6 -3
- package/lib/ProTable/components/TableResizable/index.js +0 -8
- package/lib/ProTabs/index.js +0 -1
- package/lib/ProThemeTools/index.js +0 -1
- package/lib/ProTree/components/Tree.js +0 -7
- package/lib/ProTree/index.js +1 -0
- package/lib/ProTreeModal/components/Tree.js +0 -1
- package/lib/ProUpload/index.js +0 -7
- package/lib/old/ProCertValidity/index.js +1 -1
- package/package.json +1 -1
package/dist/index.esm.css
CHANGED
|
@@ -331,7 +331,7 @@
|
|
|
331
331
|
line-height: initial !important;
|
|
332
332
|
height: auto !important;
|
|
333
333
|
margin: 0;
|
|
334
|
-
padding
|
|
334
|
+
padding: 12px 0;
|
|
335
335
|
min-height: 48px;
|
|
336
336
|
}
|
|
337
337
|
.pro-layout-open-menu .ant-menu-title-content div {
|
|
@@ -2419,8 +2419,8 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
2419
2419
|
-webkit-align-items: center;
|
|
2420
2420
|
-ms-flex-align: center;
|
|
2421
2421
|
align-items: center;
|
|
2422
|
-
margin-bottom: 0;
|
|
2423
2422
|
height: auto;
|
|
2423
|
+
margin-bottom: 0;
|
|
2424
2424
|
padding-top: 6px;
|
|
2425
2425
|
}
|
|
2426
2426
|
.pro-form.ant-form-vertical .pro-form-custom-footer .ant-space-align-center {
|
|
@@ -2470,7 +2470,7 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
2470
2470
|
width: 100%;
|
|
2471
2471
|
}
|
|
2472
2472
|
.pro-form .expand-button {
|
|
2473
|
-
line-height: 32px;
|
|
2473
|
+
line-height: calc(var(--zaui-space-card, 32px) * var(--zaui-size, 1));
|
|
2474
2474
|
cursor: pointer;
|
|
2475
2475
|
}
|
|
2476
2476
|
.pro-form .expand-button .rotate-to-top {
|
|
@@ -2505,13 +2505,18 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
2505
2505
|
.pro-form .ant-form-item.pro-form-item-changed span.ant-input-affix-wrapper,
|
|
2506
2506
|
.pro-form .ant-form-item.pro-form-item-changed .ant-select-selector,
|
|
2507
2507
|
.pro-form .ant-form-item.pro-form-item-changed .ant-picker {
|
|
2508
|
-
background: var(--zaui-contract-bg, #fffaa1);
|
|
2508
|
+
background: var(--zaui-contract-bg, #fffaa1) !important;
|
|
2509
2509
|
}
|
|
2510
2510
|
.pro-form .ant-form-item.pro-form-item-changed span.ant-input-affix-wrapper input,
|
|
2511
2511
|
.pro-form .ant-form-item.pro-form-item-changed .ant-select-selector input,
|
|
2512
2512
|
.pro-form .ant-form-item.pro-form-item-changed .ant-picker input {
|
|
2513
2513
|
background: var(--zaui-contract-bg, #fffaa1);
|
|
2514
2514
|
}
|
|
2515
|
+
.pro-form .ant-form-item.pro-form-item-changed span.ant-input-affix-wrapper .ant-select-selection-placeholder,
|
|
2516
|
+
.pro-form .ant-form-item.pro-form-item-changed .ant-select-selector .ant-select-selection-placeholder,
|
|
2517
|
+
.pro-form .ant-form-item.pro-form-item-changed .ant-picker .ant-select-selection-placeholder {
|
|
2518
|
+
z-index: 9;
|
|
2519
|
+
}
|
|
2515
2520
|
.pro-form .ant-form-item .ant-row {
|
|
2516
2521
|
width: 100%;
|
|
2517
2522
|
}
|
|
@@ -2627,7 +2632,7 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
2627
2632
|
}
|
|
2628
2633
|
.pro-form div.pro-form-custom-footer {
|
|
2629
2634
|
width: unset !important;
|
|
2630
|
-
height: 32px;
|
|
2635
|
+
height: calc(var(--zaui-space-card, 32px) * var(--zaui-size, 1));
|
|
2631
2636
|
margin-bottom: calc(var(--zaui-height-size-md, 16px) * var(--zaui-size, 1));
|
|
2632
2637
|
}
|
|
2633
2638
|
.pro-form div.pro-form-custom-footer.pro-form-custom-footer-hidden {
|
package/es/ProDownload/utils.js
CHANGED
|
@@ -4,8 +4,6 @@ import _message from "antd/es/message";
|
|
|
4
4
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
5
5
|
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
6
6
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
7
|
-
/* eslint-disable no-empty */
|
|
8
|
-
/* eslint-disable prefer-promise-reject-errors */
|
|
9
7
|
import { isFunction, get } from 'lodash';
|
|
10
8
|
import locale from '../locale';
|
|
11
9
|
var stringify = function stringify(data) {
|
|
@@ -7,15 +7,17 @@ import { createElement as _createElement } from "react";
|
|
|
7
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
8
|
import Container from '../../Container';
|
|
9
9
|
import { useProConfig } from '../../../../ProConfigProvider';
|
|
10
|
+
import ProForm from '../../../index';
|
|
10
11
|
var Checkbox = function Checkbox(props) {
|
|
11
12
|
var dataSource = props.dataSource,
|
|
12
13
|
otherProps = props.otherProps,
|
|
13
14
|
fieldNames = props.fieldNames,
|
|
14
15
|
rest = _objectWithoutProperties(props, _excluded);
|
|
15
|
-
var _ref = otherProps || {},
|
|
16
|
-
isView = _ref.isView,
|
|
17
|
-
viewEmpty = _ref.viewEmpty;
|
|
18
16
|
var initialConfig = useProConfig('Checkbox') || {};
|
|
17
|
+
var _ref = ProForm.useFieldProps() || {},
|
|
18
|
+
isViewCon = _ref.isView,
|
|
19
|
+
viewEmpty = _ref.viewEmpty;
|
|
20
|
+
var isView = typeof props.isView === 'boolean' ? props.isView : isViewCon; // 组件可直接接收isView参数, 优先级高
|
|
19
21
|
var _fieldNames = fieldNames || initialConfig.fieldNames || {
|
|
20
22
|
label: 'label',
|
|
21
23
|
value: 'value'
|
|
@@ -17,14 +17,15 @@ var DatePicker = function DatePicker(props) {
|
|
|
17
17
|
format = _props$format === void 0 ? 'YYYY-MM-DD' : _props$format,
|
|
18
18
|
rest = _objectWithoutProperties(props, _excluded);
|
|
19
19
|
var _ref = ProForm.useFieldProps() || {},
|
|
20
|
-
|
|
20
|
+
isViewCon = _ref.isView,
|
|
21
21
|
viewEmpty = _ref.viewEmpty,
|
|
22
22
|
valueType = _ref.valueType;
|
|
23
|
+
var isView = typeof props.isView === 'boolean' ? props.isView : isViewCon; // 组件可直接接收isView参数, 优先级高
|
|
23
24
|
var initialConfig = useProConfig('DatePicker');
|
|
24
25
|
var _className = classNames(_defineProperty({
|
|
25
26
|
'full-form-item': true
|
|
26
27
|
}, className, !!className));
|
|
27
|
-
if (isView
|
|
28
|
+
if (isView) {
|
|
28
29
|
var value = rest.value;
|
|
29
30
|
var viewChildren = null;
|
|
30
31
|
if (!value) {
|
|
@@ -8,6 +8,7 @@ import { omit } from 'lodash';
|
|
|
8
8
|
import { useProConfig } from '../../../../ProConfigProvider';
|
|
9
9
|
import Container from '../../Container';
|
|
10
10
|
import locale from '../../../../locale';
|
|
11
|
+
import ProForm from '../../../index';
|
|
11
12
|
// 参数优先级
|
|
12
13
|
// 组件内默认值 < config默认值 < props
|
|
13
14
|
var Input = function Input(props) {
|
|
@@ -17,9 +18,10 @@ var Input = function Input(props) {
|
|
|
17
18
|
fieldName = props.fieldName,
|
|
18
19
|
otherProps = props.otherProps,
|
|
19
20
|
rest = _objectWithoutProperties(props, _excluded);
|
|
20
|
-
var _ref =
|
|
21
|
-
|
|
21
|
+
var _ref = ProForm.useFieldProps() || {},
|
|
22
|
+
isViewCon = _ref.isView,
|
|
22
23
|
viewEmpty = _ref.viewEmpty;
|
|
24
|
+
var isView = typeof props.isView === 'boolean' ? props.isView : isViewCon; // 组件可直接接收isView参数, 优先级高
|
|
23
25
|
var initialConfig = useProConfig('Input');
|
|
24
26
|
if (isView) {
|
|
25
27
|
return _jsx(Container, {
|
|
@@ -5,6 +5,7 @@ export interface Props extends Omit<InputNumberProps, 'onBlur'> {
|
|
|
5
5
|
otherProps?: ProFormOtherProps;
|
|
6
6
|
range?: string;
|
|
7
7
|
onBlur?: (value?: number, record?: any, object?: any) => void;
|
|
8
|
+
isView?: boolean;
|
|
8
9
|
}
|
|
9
10
|
declare const InputNumber: React.FC<Props>;
|
|
10
11
|
export default InputNumber;
|
|
@@ -17,6 +17,7 @@ import { useProConfig } from '../../../../ProConfigProvider';
|
|
|
17
17
|
import Container from '../../Container';
|
|
18
18
|
import { getDecimalDigits } from '../../../utils/index';
|
|
19
19
|
import locale from '../../../../locale';
|
|
20
|
+
import ProForm from '../../../../ProForm';
|
|
20
21
|
var calc = tools.calc;
|
|
21
22
|
var rangeReg = /^[([](-?\d+(\.\d+)?)?,\s*(-?\d+(\.\d+)?)?[)\]]$/;
|
|
22
23
|
/**
|
|
@@ -42,12 +43,13 @@ var InputNumber = function InputNumber(props) {
|
|
|
42
43
|
max = props.max,
|
|
43
44
|
onBlur = props.onBlur,
|
|
44
45
|
rest = _objectWithoutProperties(props, _excluded);
|
|
45
|
-
var _ref2 =
|
|
46
|
-
|
|
46
|
+
var _ref2 = ProForm.useFieldProps() || {},
|
|
47
|
+
isViewCon = _ref2.isView,
|
|
47
48
|
viewEmpty = _ref2.viewEmpty,
|
|
48
|
-
viewType = _ref2.viewType,
|
|
49
49
|
valueType = _ref2.valueType,
|
|
50
|
+
viewType = _ref2.viewType,
|
|
50
51
|
label = _ref2.label;
|
|
52
|
+
var isView = typeof props.isView === 'boolean' ? props.isView : isViewCon; // 组件可直接接收isView参数, 优先级高
|
|
51
53
|
var valueProps = {};
|
|
52
54
|
if (valueType) {
|
|
53
55
|
switch (valueType) {
|
|
@@ -4,10 +4,11 @@ import _Cascader from "antd/es/cascader";
|
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
5
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
6
6
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
7
|
-
var _excluded = ["useRequest", "
|
|
7
|
+
var _excluded = ["useRequest", "otherProps", "dataSource", "options"];
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
9
|
import { useRequest } from 'ahooks';
|
|
10
10
|
import Container from '../../Container';
|
|
11
|
+
import ProForm from '../../../../ProForm';
|
|
11
12
|
var defaultFieldNames = {
|
|
12
13
|
value: 'value',
|
|
13
14
|
label: 'label',
|
|
@@ -41,19 +42,18 @@ var findTreeTarget = function findTreeTarget(dataSource, value, fieldNames) {
|
|
|
41
42
|
var ProCascader = function ProCascader(props) {
|
|
42
43
|
var _restProps$fieldNames;
|
|
43
44
|
var requestProps = props.useRequest,
|
|
44
|
-
isView = props.isView,
|
|
45
45
|
otherProps = props.otherProps,
|
|
46
46
|
dataSource = props.dataSource,
|
|
47
47
|
options = props.options,
|
|
48
48
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
49
|
-
var _ref2 =
|
|
50
|
-
|
|
49
|
+
var _ref2 = ProForm.useFieldProps() || {},
|
|
50
|
+
isViewCon = _ref2.isView;
|
|
51
|
+
var isView = typeof props.isView === 'boolean' ? props.isView : isViewCon;
|
|
51
52
|
var _useRequest = useRequest(requestProps === null || requestProps === void 0 ? void 0 : requestProps.service, requestProps === null || requestProps === void 0 ? void 0 : requestProps.options),
|
|
52
53
|
data = _useRequest.data;
|
|
53
|
-
var _isView = isView || formIsView;
|
|
54
54
|
var _dataSource = data || dataSource || options;
|
|
55
55
|
var _fieldNames = (_restProps$fieldNames = restProps.fieldNames) !== null && _restProps$fieldNames !== void 0 ? _restProps$fieldNames : defaultFieldNames;
|
|
56
|
-
if (
|
|
56
|
+
if (isView) {
|
|
57
57
|
var valueTarget = findTreeTarget(_dataSource, restProps.value, _fieldNames);
|
|
58
58
|
var valueName = _fieldNames.value,
|
|
59
59
|
label = _fieldNames.label;
|
|
@@ -6,6 +6,7 @@ var _excluded = ["dataSource", "fieldNames", "onChange", "value", "otherProps"];
|
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
7
|
import { useProConfig } from '../../../../ProConfigProvider';
|
|
8
8
|
import Container from '../../Container';
|
|
9
|
+
import ProForm from '../../../../ProForm';
|
|
9
10
|
var Radio = function Radio(props) {
|
|
10
11
|
var dataSource = props.dataSource,
|
|
11
12
|
fieldNames = props.fieldNames,
|
|
@@ -13,9 +14,10 @@ var Radio = function Radio(props) {
|
|
|
13
14
|
value = props.value,
|
|
14
15
|
otherProps = props.otherProps,
|
|
15
16
|
rest = _objectWithoutProperties(props, _excluded);
|
|
16
|
-
var _ref =
|
|
17
|
-
|
|
17
|
+
var _ref = ProForm.useFieldProps() || {},
|
|
18
|
+
isViewCon = _ref.isView,
|
|
18
19
|
viewEmpty = _ref.viewEmpty;
|
|
20
|
+
var isView = typeof props.isView === 'boolean' ? props.isView : isViewCon;
|
|
19
21
|
var initialConfig = useProConfig('Radio') || {};
|
|
20
22
|
var _fieldNames = fieldNames || initialConfig.fieldNames || {
|
|
21
23
|
label: 'label',
|
|
@@ -9,6 +9,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
9
9
|
import { isFunction, isString, omit } from 'lodash';
|
|
10
10
|
import moment from 'moment';
|
|
11
11
|
import { useProConfig } from '../../../../ProConfigProvider';
|
|
12
|
+
import ProForm from '../../../../ProForm';
|
|
12
13
|
import Container from '../../Container';
|
|
13
14
|
var AntRangePicker = _DatePicker.RangePicker;
|
|
14
15
|
var RangePicker = function RangePicker(props) {
|
|
@@ -18,11 +19,12 @@ var RangePicker = function RangePicker(props) {
|
|
|
18
19
|
_props$separator = props.separator,
|
|
19
20
|
separator = _props$separator === void 0 ? '~' : _props$separator,
|
|
20
21
|
rest = _objectWithoutProperties(props, _excluded);
|
|
21
|
-
var
|
|
22
|
-
|
|
22
|
+
var initialConfig = useProConfig('AntRangePicker');
|
|
23
|
+
var _ref = ProForm.useFieldProps() || {},
|
|
24
|
+
isViewCon = _ref.isView,
|
|
23
25
|
viewEmpty = _ref.viewEmpty,
|
|
24
26
|
valueType = _ref.valueType;
|
|
25
|
-
var
|
|
27
|
+
var isView = typeof props.isView === 'boolean' ? props.isView : isViewCon;
|
|
26
28
|
if (isView) {
|
|
27
29
|
var _props$value = props.value,
|
|
28
30
|
value = _props$value === void 0 ? [] : _props$value;
|
|
@@ -7,6 +7,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
7
7
|
import Container from '../../Container';
|
|
8
8
|
import { useProConfig } from '../../../../ProConfigProvider';
|
|
9
9
|
import locale from '../../../../locale';
|
|
10
|
+
import ProForm from '../../../index';
|
|
10
11
|
var Select = function Select(props) {
|
|
11
12
|
var _props$dataSource = props.dataSource,
|
|
12
13
|
dataSource = _props$dataSource === void 0 ? [] : _props$dataSource,
|
|
@@ -15,9 +16,10 @@ var Select = function Select(props) {
|
|
|
15
16
|
_props$scrollFollowPa = props.scrollFollowParent,
|
|
16
17
|
scrollFollowParent = _props$scrollFollowPa === void 0 ? true : _props$scrollFollowPa,
|
|
17
18
|
rest = _objectWithoutProperties(props, _excluded);
|
|
18
|
-
var _ref =
|
|
19
|
-
|
|
19
|
+
var _ref = ProForm.useFieldProps() || {},
|
|
20
|
+
isViewCon = _ref.isView,
|
|
20
21
|
viewEmpty = _ref.viewEmpty;
|
|
22
|
+
var isView = typeof props.isView === 'boolean' ? props.isView : isViewCon; // 组件可直接接收isView参数, 优先级高
|
|
21
23
|
var initialConfig = useProConfig('Select') || {};
|
|
22
24
|
var _fieldNames = fieldNames || initialConfig.fieldNames || {
|
|
23
25
|
label: 'label',
|
|
@@ -8,14 +8,16 @@ import { isNull, isUndefined } from 'lodash';
|
|
|
8
8
|
import { useProConfig } from '../../../../ProConfigProvider';
|
|
9
9
|
import Container from '../../Container';
|
|
10
10
|
import locale from '../../../../locale';
|
|
11
|
+
import ProForm from '../../../../ProForm';
|
|
11
12
|
var Switch = function Switch(props) {
|
|
12
13
|
var disabled = props.disabled,
|
|
13
14
|
otherProps = props.otherProps,
|
|
14
15
|
res = _objectWithoutProperties(props, _excluded);
|
|
15
|
-
var _ref =
|
|
16
|
-
|
|
16
|
+
var _ref = ProForm.useFieldProps() || {},
|
|
17
|
+
isViewCon = _ref.isView,
|
|
17
18
|
viewEmpty = _ref.viewEmpty,
|
|
18
19
|
valueType = _ref.valueType;
|
|
20
|
+
var isView = typeof props.isView === 'boolean' ? props.isView : isViewCon;
|
|
19
21
|
var config = useProConfig('Switch');
|
|
20
22
|
if (isView) {
|
|
21
23
|
if (isUndefined(res === null || res === void 0 ? void 0 : res.checked) || isNull(res === null || res === void 0 ? void 0 : res.checked) || valueType === 'switch' && isUndefined(res.value)) {
|
|
@@ -7,16 +7,18 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
7
7
|
import { isNull, isUndefined } from 'lodash';
|
|
8
8
|
import { useProConfig } from '../../../../ProConfigProvider';
|
|
9
9
|
import locale from '../../../../locale';
|
|
10
|
+
import ProForm from '../../../../ProForm';
|
|
10
11
|
var SwitchCheckbox = function SwitchCheckbox(props) {
|
|
11
12
|
var onChange = props.onChange,
|
|
12
13
|
disabled = props.disabled,
|
|
13
14
|
value = props.value,
|
|
14
15
|
otherProps = props.otherProps,
|
|
15
16
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
16
|
-
var _ref =
|
|
17
|
-
|
|
17
|
+
var _ref = ProForm.useFieldProps() || {},
|
|
18
|
+
isViewCon = _ref.isView,
|
|
18
19
|
viewEmpty = _ref.viewEmpty,
|
|
19
20
|
valueType = _ref.valueType;
|
|
21
|
+
var isView = typeof props.isView === 'boolean' ? props.isView : isViewCon;
|
|
20
22
|
var initialConfig = useProConfig('SwitchCheckbox');
|
|
21
23
|
var changeVal = function changeVal(e) {
|
|
22
24
|
onChange(e.target.checked);
|
|
@@ -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);
|