@zat-design/sisyphus-react 3.13.8 → 3.13.10-deta.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/es/ProAction/index.js +2 -2
- package/es/ProDownload/index.js +4 -3
- package/es/ProDownload/utils.js +5 -4
- package/es/ProDrawerForm/components/ProDrawer/index.js +2 -2
- package/es/ProDrawerForm/components/ProModal/index.js +2 -2
- package/es/ProEditLabel/components/RenderProForm.js +3 -3
- package/es/ProEditLabel/index.js +2 -2
- package/es/ProEditTable/components/ActionButton/index.js +9 -8
- package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +6 -6
- package/es/ProEditTable/components/RenderField/index.js +20 -16
- package/es/ProEditTable/index.js +10 -7
- package/es/ProEditTable/utils/config.js +3 -3
- package/es/ProEditTable/utils/diffOriginal.js +6 -4
- package/es/ProEditTable/utils/getDefaultProps.js +8 -7
- package/es/ProEditTable/utils/index.js +21 -18
- package/es/ProEditTable/utils/tools.js +32 -24
- package/es/ProEditTable/utils/useEditTableError.js +2 -2
- package/es/ProEnum/index.js +16 -11
- package/es/ProEnum/utils/eventCenter.js +2 -2
- package/es/ProEnum/utils/getEnumLabel.js +5 -4
- package/es/ProEnum/utils/index.js +3 -2
- package/es/ProForm/components/base/DatePicker/index.js +11 -8
- package/es/ProForm/components/base/Input/index.js +3 -3
- package/es/ProForm/components/base/InputNumber/index.js +6 -4
- package/es/ProForm/components/base/RangePicker/index.js +12 -8
- package/es/ProForm/components/base/Select/index.js +2 -2
- package/es/ProForm/components/base/Switch/index.js +3 -2
- package/es/ProForm/components/base/SwitchCheckbox/index.js +3 -2
- package/es/ProForm/components/base/TextArea/index.js +2 -2
- package/es/ProForm/components/combination/Container/index.js +2 -2
- package/es/ProForm/components/combination/FormList/components/ActionButton.js +7 -6
- package/es/ProForm/components/combination/FormList/components/BlockFields.js +2 -2
- package/es/ProForm/components/combination/FormList/components/BlockTitle.js +2 -2
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +5 -4
- package/es/ProForm/components/combination/FormList/index.js +2 -2
- package/es/ProForm/components/combination/FormList/utils.js +2 -2
- package/es/ProForm/components/combination/Group/hooks/index.js +4 -3
- package/es/ProForm/components/combination/Group/index.js +2 -2
- package/es/ProForm/components/combination/Group/utils.js +6 -6
- package/es/ProForm/components/combination/ProCascader/index.js +6 -4
- package/es/ProForm/components/combination/ProCascader/utils/index.js +2 -2
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +3 -3
- package/es/ProForm/components/combination/ProModalSelect/index.js +13 -10
- package/es/ProForm/components/combination/ProNumberRange/index.js +2 -2
- package/es/ProForm/components/combination/ProRangeLimit/index.js +8 -5
- package/es/ProForm/components/combination/ProTimeLimit/index.js +10 -7
- package/es/ProForm/components/old/EnumSelect/hooks/useRequestList.js +3 -3
- package/es/ProForm/components/old/EnumSelect/index.js +3 -3
- package/es/ProForm/components/render/ChangedWrapper.js +3 -3
- package/es/ProForm/components/render/ConfirmWrapper.js +4 -3
- package/es/ProForm/components/render/Render.js +17 -13
- package/es/ProForm/components/render/RenderFields.js +9 -6
- package/es/ProForm/index.js +6 -4
- package/es/ProForm/utils/_useChanged.js +3 -3
- package/es/ProForm/utils/_useListChanged.js +6 -6
- package/es/ProForm/utils/diffOriginal.js +6 -4
- package/es/ProForm/utils/getDefaultProps.js +7 -6
- package/es/ProForm/utils/index.js +20 -15
- package/es/ProForm/utils/rulesCreator.js +4 -3
- package/es/ProForm/utils/transformNames.js +2 -2
- package/es/ProForm/utils/transformValue.js +3 -3
- package/es/ProForm/utils/useDeepCompareMemo.js +2 -2
- package/es/ProForm/utils/useRules.js +4 -3
- package/es/ProForm/utils/useShouldUpdate.js +23 -21
- package/es/ProForm/utils/useWatch.js +2 -2
- package/es/ProForm/utils/valueType.js +2 -2
- package/es/ProIcon/index.js +2 -2
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +2 -2
- package/es/ProLayout/components/ProCollapse/index.js +2 -2
- package/es/ProLayout/components/ProHeader/index.js +12 -9
- package/es/ProLayout/utils/index.js +3 -2
- package/es/ProSelect/index.js +11 -7
- package/es/ProSelect/utils/index.js +5 -3
- package/es/ProStep/components/Item/index.js +2 -2
- package/es/ProStep/components/Listener/index.js +2 -2
- package/es/ProStep/components/Step/index.js +2 -2
- package/es/ProStep/index.js +2 -2
- package/es/ProStep/utils/index.js +4 -3
- package/es/ProStepTab/index.js +3 -3
- package/es/ProTable/components/FormatColumn/index.js +16 -12
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +3 -3
- package/es/ProTable/components/RenderColumn/index.js +2 -2
- package/es/ProTable/components/RenderSummary/index.js +3 -3
- package/es/ProTable/hooks/useAntdTable.js +15 -10
- package/es/ProTable/index.js +12 -7
- package/es/ProTable/utils/index.js +5 -4
- package/es/ProTabs/index.js +2 -2
- package/es/ProThemeTools/index.js +2 -2
- package/es/ProTree/components/ProTree.js +5 -4
- package/es/ProTree/components/ProTreeSelect/index.js +6 -5
- package/es/ProTreeModal/index.js +5 -4
- package/es/ProUpload/components/ImageRender.js +2 -2
- package/es/ProUpload/index.js +5 -4
- package/es/old/ProEditableTable/index.js +7 -7
- package/es/old/ProEditableTable/utils.js +2 -2
- package/lib/ProAction/index.js +8 -5
- package/lib/ProConfigProvider/index.js +3 -2
- package/lib/ProDownload/index.js +7 -6
- package/lib/ProDownload/utils.js +9 -7
- package/lib/ProDrawerForm/components/ProDrawer/index.js +12 -7
- package/lib/ProDrawerForm/components/ProModal/index.js +12 -7
- package/lib/ProEditLabel/components/RenderProForm.js +6 -5
- package/lib/ProEditLabel/index.js +15 -8
- package/lib/ProEditTable/components/ActionButton/index.js +15 -11
- package/lib/ProEditTable/components/RcTable/BaseTable.js +6 -3
- package/lib/ProEditTable/components/RcTable/DraggableTable.js +3 -2
- package/lib/ProEditTable/components/RenderField/ListChangedWrapper.js +14 -11
- package/lib/ProEditTable/components/RenderField/index.js +25 -20
- package/lib/ProEditTable/components/RenderToolbar/index.js +3 -2
- package/lib/ProEditTable/components/Summary/index.js +8 -5
- package/lib/ProEditTable/components/Validator/index.js +7 -3
- package/lib/ProEditTable/index.js +20 -12
- package/lib/ProEditTable/utils/config.js +8 -7
- package/lib/ProEditTable/utils/diffOriginal.js +7 -4
- package/lib/ProEditTable/utils/getDefaultProps.js +8 -7
- package/lib/ProEditTable/utils/index.js +27 -21
- package/lib/ProEditTable/utils/tools.js +32 -24
- package/lib/ProEditTable/utils/useEditTableError.js +2 -2
- package/lib/ProEnum/index.js +31 -19
- package/lib/ProEnum/utils/eventCenter.js +2 -2
- package/lib/ProEnum/utils/getEnumLabel.js +5 -4
- package/lib/ProEnum/utils/index.js +3 -2
- package/lib/ProForm/components/Container.js +3 -2
- package/lib/ProForm/components/FormFooter/index.js +7 -4
- package/lib/ProForm/components/base/Checkbox/index.js +4 -3
- package/lib/ProForm/components/base/DatePicker/index.js +14 -10
- package/lib/ProForm/components/base/Input/index.js +6 -5
- package/lib/ProForm/components/base/InputNumber/index.js +12 -7
- package/lib/ProForm/components/base/Radio/index.js +4 -3
- package/lib/ProForm/components/base/RangePicker/index.js +15 -10
- package/lib/ProForm/components/base/Select/index.js +5 -4
- package/lib/ProForm/components/base/Switch/index.js +6 -4
- package/lib/ProForm/components/base/SwitchCheckbox/index.js +6 -4
- package/lib/ProForm/components/base/TextArea/index.js +5 -4
- package/lib/ProForm/components/base/TimePicker/index.js +3 -2
- package/lib/ProForm/components/combination/Container/index.js +2 -2
- package/lib/ProForm/components/combination/FormList/components/ActionButton.js +16 -10
- package/lib/ProForm/components/combination/FormList/components/BlockFields.js +8 -5
- package/lib/ProForm/components/combination/FormList/components/BlockTitle.js +2 -2
- package/lib/ProForm/components/combination/FormList/components/LineFields.js +3 -2
- package/lib/ProForm/components/combination/FormList/components/ToolbarButton.js +10 -6
- package/lib/ProForm/components/combination/FormList/index.js +5 -4
- package/lib/ProForm/components/combination/FormList/utils.js +2 -2
- package/lib/ProForm/components/combination/Group/hooks/index.js +4 -3
- package/lib/ProForm/components/combination/Group/index.js +6 -5
- package/lib/ProForm/components/combination/Group/utils.js +10 -9
- package/lib/ProForm/components/combination/ProCascader/index.js +14 -7
- package/lib/ProForm/components/combination/ProCascader/utils/index.js +2 -2
- package/lib/ProForm/components/combination/ProCombination/index.js +9 -4
- package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +3 -3
- package/lib/ProForm/components/combination/ProModalSelect/index.js +35 -19
- package/lib/ProForm/components/combination/ProNumberRange/index.js +17 -10
- package/lib/ProForm/components/combination/ProRangeLimit/index.js +17 -9
- package/lib/ProForm/components/combination/ProTimeLimit/index.js +19 -11
- package/lib/ProForm/components/old/EnumSelect/hooks/useRequestList.js +3 -3
- package/lib/ProForm/components/old/EnumSelect/index.js +15 -8
- package/lib/ProForm/components/old/InputRange/index.js +8 -5
- package/lib/ProForm/components/old/InputWithSuffix/index.js +4 -3
- package/lib/ProForm/components/old/ProAddress/index.js +18 -11
- package/lib/ProForm/components/old/ProCertNo/index.js +12 -7
- package/lib/ProForm/components/old/ProCertValidity/index.js +11 -6
- package/lib/ProForm/components/old/ProRangeBox/index.js +21 -12
- package/lib/ProForm/components/render/ChangedWrapper.js +11 -8
- package/lib/ProForm/components/render/ConfirmWrapper.js +8 -6
- package/lib/ProForm/components/render/Render.js +34 -23
- package/lib/ProForm/components/render/RenderFields.js +9 -6
- package/lib/ProForm/index.js +21 -12
- package/lib/ProForm/utils/_useChanged.js +7 -5
- package/lib/ProForm/utils/_useListChanged.js +10 -8
- package/lib/ProForm/utils/diffOriginal.js +7 -4
- package/lib/ProForm/utils/getDefaultProps.js +8 -6
- package/lib/ProForm/utils/index.js +20 -15
- package/lib/ProForm/utils/rulesCreator.js +4 -3
- package/lib/ProForm/utils/transformNames.js +3 -2
- package/lib/ProForm/utils/transformValue.js +3 -3
- package/lib/ProForm/utils/useDeepCompareMemo.js +3 -2
- package/lib/ProForm/utils/useForm.js +3 -2
- package/lib/ProForm/utils/useRules.js +4 -3
- package/lib/ProForm/utils/useShouldUpdate.js +23 -21
- package/lib/ProForm/utils/useWatch.js +2 -2
- package/lib/ProForm/utils/valueType.js +2 -2
- package/lib/ProIcon/index.js +13 -8
- package/lib/ProLayout/components/Layout/Menu/FoldMenu/index.js +6 -3
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +5 -4
- package/lib/ProLayout/components/ProCollapse/index.js +13 -8
- package/lib/ProLayout/components/ProFooter/index.js +3 -2
- package/lib/ProLayout/components/ProHeader/components/Copy/index.js +3 -2
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/index.js +3 -2
- package/lib/ProLayout/components/ProHeader/index.js +37 -25
- package/lib/ProLayout/index.js +3 -2
- package/lib/ProLayout/utils/index.js +2 -2
- package/lib/ProSelect/components/AdaptiveTooltip.js +3 -2
- package/lib/ProSelect/index.js +25 -14
- package/lib/ProSelect/utils/index.js +4 -4
- package/lib/ProStep/components/Anchor/index.js +3 -2
- package/lib/ProStep/components/Item/index.js +2 -2
- package/lib/ProStep/components/Listener/index.js +2 -2
- package/lib/ProStep/components/Step/index.js +2 -2
- package/lib/ProStep/index.js +2 -2
- package/lib/ProStep/utils/index.js +4 -3
- package/lib/ProStepTab/index.js +3 -3
- package/lib/ProTable/components/FormatColumn/index.js +26 -21
- package/lib/ProTable/components/RcTable/components/BaseTable/index.js +3 -2
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +3 -3
- package/lib/ProTable/components/RcTable/components/DraggableTable/index.js +3 -2
- package/lib/ProTable/components/RenderColumn/index.js +17 -12
- package/lib/ProTable/components/RenderSummary/index.js +8 -7
- package/lib/ProTable/components/RenderTableHeader/index.js +5 -3
- package/lib/ProTable/components/RenderTabs/index.js +6 -3
- package/lib/ProTable/components/TooltipTitle/index.js +3 -2
- package/lib/ProTable/hooks/useAntdTable.js +21 -13
- package/lib/ProTable/index.js +12 -7
- package/lib/ProTable/utils/index.js +5 -4
- package/lib/ProTabs/components/Card/index.js +11 -5
- package/lib/ProTabs/index.js +5 -4
- package/lib/ProThemeTools/component/ProTools/index.js +19 -12
- package/lib/ProThemeTools/index.js +12 -9
- package/lib/ProThemeTools/utils/index.js +3 -2
- package/lib/ProTooltip/index.js +5 -4
- package/lib/ProTree/components/AdaptiveTooltip.js +4 -2
- package/lib/ProTree/components/List.js +4 -3
- package/lib/ProTree/components/ProTree.js +17 -9
- package/lib/ProTree/components/ProTreeSelect/index.js +22 -14
- package/lib/ProTree/components/Tree.js +6 -3
- package/lib/ProTreeModal/components/Cascader.js +4 -3
- package/lib/ProTreeModal/components/List.js +14 -9
- package/lib/ProTreeModal/components/SortableItem.js +3 -2
- package/lib/ProTreeModal/components/Tree.js +4 -3
- package/lib/ProTreeModal/components/Trigger.js +11 -6
- package/lib/ProTreeModal/index.js +21 -13
- package/lib/ProUpload/components/ButtonRender.js +6 -3
- package/lib/ProUpload/components/DragRender.js +3 -2
- package/lib/ProUpload/components/FileItem.js +15 -10
- package/lib/ProUpload/components/ImageRender.js +19 -10
- package/lib/ProUpload/index.js +9 -7
- package/lib/ProViewer/index.js +9 -4
- package/lib/old/ProCertValidity/index.js +11 -6
- package/lib/old/ProEditableTable/index.js +36 -23
- package/lib/old/ProEditableTable/utils.js +35 -18
- package/package.json +4 -3
@@ -2,9 +2,9 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import "antd/es/select/style";
|
3
3
|
import _Select from "antd/es/select";
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
5
|
+
import _isNumber from "lodash/isNumber";
|
5
6
|
var _excluded = ["dataSource", "fieldNames", "otherProps", "scrollFollowParent"];
|
6
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
7
|
-
import { isNumber } from 'lodash';
|
8
8
|
import Container from '../../Container';
|
9
9
|
import { useProConfig } from '../../../../ProConfigProvider';
|
10
10
|
import locale from '../../../../locale';
|
@@ -46,7 +46,7 @@ var Select = function Select(props) {
|
|
46
46
|
}
|
47
47
|
return _jsx(Container, {
|
48
48
|
viewEmpty: viewEmpty,
|
49
|
-
children: value ||
|
49
|
+
children: value || _isNumber(value) ? transToLabel([value]) : null
|
50
50
|
});
|
51
51
|
}
|
52
52
|
return _jsx(_Select, _objectSpread(_objectSpread(_objectSpread({
|
@@ -2,9 +2,10 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import "antd/es/switch/style";
|
3
3
|
import _Switch from "antd/es/switch";
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
5
|
+
import _isUndefined from "lodash/isUndefined";
|
6
|
+
import _isNull from "lodash/isNull";
|
5
7
|
var _excluded = ["disabled", "otherProps"];
|
6
8
|
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
7
|
-
import { isNull, isUndefined } from 'lodash';
|
8
9
|
import { useProConfig } from '../../../../ProConfigProvider';
|
9
10
|
import Container from '../../Container';
|
10
11
|
import locale from '../../../../locale';
|
@@ -20,7 +21,7 @@ var Switch = function Switch(props) {
|
|
20
21
|
var isView = typeof props.isView === 'boolean' ? props.isView : isViewCon;
|
21
22
|
var config = useProConfig('Switch');
|
22
23
|
if (isView) {
|
23
|
-
if (
|
24
|
+
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)) {
|
24
25
|
return _jsx(_Fragment, {
|
25
26
|
children: viewEmpty
|
26
27
|
});
|
@@ -2,9 +2,10 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import "antd/es/checkbox/style";
|
3
3
|
import _Checkbox from "antd/es/checkbox";
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
5
|
+
import _isUndefined from "lodash/isUndefined";
|
6
|
+
import _isNull from "lodash/isNull";
|
5
7
|
var _excluded = ["onChange", "disabled", "value", "otherProps", "className"];
|
6
8
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
7
|
-
import { isNull, isUndefined } from 'lodash';
|
8
9
|
import classnames from 'classnames';
|
9
10
|
import { useProConfig } from '../../../../ProConfigProvider';
|
10
11
|
import locale from '../../../../locale';
|
@@ -26,7 +27,7 @@ var SwitchCheckbox = function SwitchCheckbox(props) {
|
|
26
27
|
onChange(e.target.checked);
|
27
28
|
};
|
28
29
|
if (isView) {
|
29
|
-
if (
|
30
|
+
if (_isUndefined(restProps.checked) || _isNull(restProps.checked) || valueType === 'switch' && _isUndefined(value)) {
|
30
31
|
return _jsxs("span", {
|
31
32
|
className: "switch-checkbox-view",
|
32
33
|
children: [_jsx("span", {
|
@@ -3,9 +3,9 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
4
4
|
import "antd/es/input/style";
|
5
5
|
import _Input from "antd/es/input";
|
6
|
+
import _omit from "lodash/omit";
|
6
7
|
var _excluded = ["placeholder", "otherProps", "className", "tooltip"];
|
7
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
8
|
-
import { omit } from 'lodash';
|
9
9
|
import classnames from 'classnames';
|
10
10
|
import { useProConfig } from '../../../../ProConfigProvider';
|
11
11
|
import locale from '../../../../locale';
|
@@ -44,7 +44,7 @@ var TextAreaDef = function TextAreaDef(props) {
|
|
44
44
|
autoComplete: "off",
|
45
45
|
placeholder: placeholder || "".concat(locale.ProForm.inputPlaceholder).concat(label || ''),
|
46
46
|
autoSize: !(props === null || props === void 0 ? void 0 : (_props$style = props.style) === null || _props$style === void 0 ? void 0 : _props$style.height)
|
47
|
-
},
|
47
|
+
}, _omit(initialConfig, ['trim', 'upperCase'])), rest), {}, {
|
48
48
|
className: _className
|
49
49
|
}));
|
50
50
|
};
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
3
|
+
import _omit from "lodash/omit";
|
3
4
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
4
5
|
import { useMemo } from 'react';
|
5
|
-
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';
|
@@ -43,7 +43,7 @@ var Container = function Container(props) {
|
|
43
43
|
diffConfig: diffConfig
|
44
44
|
}, otherProps));
|
45
45
|
if (type === 'ProCollapse') {
|
46
|
-
return _jsx(ProCollapse, _objectSpread(_objectSpread({},
|
46
|
+
return _jsx(ProCollapse, _objectSpread(_objectSpread({}, _omit(props, ['otherProps', 'children', 'onBlur', 'onChange', 'placeholder', 'className'])), {}, {
|
47
47
|
children: child
|
48
48
|
}));
|
49
49
|
}
|
@@ -9,11 +9,12 @@ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
9
9
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
10
10
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
11
11
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
12
|
+
import _omit from "lodash/omit";
|
13
|
+
import _isFunction from "lodash/isFunction";
|
12
14
|
var _excluded = ["label", "onClick", "onHandle", "type", "needConfirm", "confirmProps", "title"],
|
13
15
|
_excluded2 = ["onClick", "label"];
|
14
16
|
import { createElement as _createElement } from "react";
|
15
17
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
16
|
-
import { isFunction, omit } from 'lodash';
|
17
18
|
import { useMemo } from 'react';
|
18
19
|
import { CopyOutlined, PlusSquareOutlined, ArrowUpOutlined, ArrowDownOutlined } from '@ant-design/icons';
|
19
20
|
import ProIcon from '../../../../../ProIcon';
|
@@ -193,7 +194,7 @@ var ActionButton = function ActionButton(props) {
|
|
193
194
|
className: "pro-form-list-action",
|
194
195
|
children: actionProps === null || actionProps === void 0 ? void 0 : actionProps.map(function (item) {
|
195
196
|
if (item.show === false) return _jsx("span", {}, "".concat(item === null || item === void 0 ? void 0 : item.type).concat(index));
|
196
|
-
if (
|
197
|
+
if (_isFunction(item.show) && !item.show(form.getFieldValue(namePath), {
|
197
198
|
namePath: namePath,
|
198
199
|
index: index,
|
199
200
|
form: form
|
@@ -243,14 +244,14 @@ var ActionButton = function ActionButton(props) {
|
|
243
244
|
handleClick(internalOnClick, _onClick, index, item);
|
244
245
|
}
|
245
246
|
}, _confirmProps), {}, {
|
246
|
-
children: _jsx(_Button, _objectSpread(_objectSpread(_objectSpread({}, defaultRest),
|
247
|
+
children: _jsx(_Button, _objectSpread(_objectSpread(_objectSpread({}, defaultRest), _omit(rest, filterKeys)), {}, {
|
247
248
|
type: "text",
|
248
249
|
onClick: function onClick(e) {
|
249
250
|
return e.stopPropagation();
|
250
251
|
},
|
251
252
|
children: label || defaultLabel
|
252
253
|
}))
|
253
|
-
}), "".concat(item === null || item === void 0 ? void 0 : item.type).concat(index)) : _jsx(_Button, _objectSpread(_objectSpread(_objectSpread({}, defaultRest),
|
254
|
+
}), "".concat(item === null || item === void 0 ? void 0 : item.type).concat(index)) : _jsx(_Button, _objectSpread(_objectSpread(_objectSpread({}, defaultRest), _omit(rest, filterKeys)), {}, {
|
254
255
|
type: "text",
|
255
256
|
onClick: function onClick(e) {
|
256
257
|
e.stopPropagation();
|
@@ -268,14 +269,14 @@ var ActionButton = function ActionButton(props) {
|
|
268
269
|
return customClick(_onClick, index);
|
269
270
|
}
|
270
271
|
}, _confirmProps), {}, {
|
271
|
-
children: _jsx(_Button, _objectSpread(_objectSpread({},
|
272
|
+
children: _jsx(_Button, _objectSpread(_objectSpread({}, _omit(rest, filterKeys)), {}, {
|
272
273
|
type: "text",
|
273
274
|
onClick: function onClick(e) {
|
274
275
|
return e.stopPropagation();
|
275
276
|
},
|
276
277
|
children: label
|
277
278
|
}))
|
278
|
-
}), "".concat(item === null || item === void 0 ? void 0 : item.type).concat(index)) : (/*#__PURE__*/_createElement(_Button, _objectSpread(_objectSpread({},
|
279
|
+
}), "".concat(item === null || item === void 0 ? void 0 : item.type).concat(index)) : (/*#__PURE__*/_createElement(_Button, _objectSpread(_objectSpread({}, _omit(rest, filterKeys)), {}, {
|
279
280
|
key: "".concat(item === null || item === void 0 ? void 0 : item.type).concat(index),
|
280
281
|
type: "text",
|
281
282
|
onClick: function onClick(e) {
|
@@ -3,9 +3,9 @@ import _Row from "antd/es/row";
|
|
3
3
|
import "antd/es/space/style";
|
4
4
|
import _Space from "antd/es/space";
|
5
5
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
6
|
+
import _isFunction from "lodash/isFunction";
|
6
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
7
8
|
import React, { useMemo } from 'react';
|
8
|
-
import { isFunction } from 'lodash';
|
9
9
|
import classNames from 'classnames';
|
10
10
|
import ActionButton from './ActionButton';
|
11
11
|
import RenderFields from '../../../render/RenderFields';
|
@@ -34,7 +34,7 @@ var BlockFields = function BlockFields(props) {
|
|
34
34
|
id = props.id,
|
35
35
|
diffConfig = props.diffConfig;
|
36
36
|
var _title = useMemo(function () {
|
37
|
-
if (
|
37
|
+
if (_isFunction(title)) {
|
38
38
|
var record = form.getFieldValue(namePath);
|
39
39
|
return title(record, index, form);
|
40
40
|
}
|
@@ -1,6 +1,6 @@
|
|
1
|
+
import _isFunction from "lodash/isFunction";
|
1
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
2
3
|
import React from 'react';
|
3
|
-
import { isFunction } from 'lodash';
|
4
4
|
var BlockTitle = function BlockTitle(props) {
|
5
5
|
var mode = props.mode,
|
6
6
|
namePath = props.namePath,
|
@@ -17,7 +17,7 @@ var BlockTitle = function BlockTitle(props) {
|
|
17
17
|
return title;
|
18
18
|
}
|
19
19
|
var titleContent = title;
|
20
|
-
if (
|
20
|
+
if (_isFunction(title)) {
|
21
21
|
var record = form.getFieldValue(namePath);
|
22
22
|
titleContent = title(record, index, form);
|
23
23
|
}
|
@@ -7,13 +7,14 @@ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
7
7
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
8
8
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
9
9
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
10
|
+
import _omit from "lodash/omit";
|
11
|
+
import _isFunction from "lodash/isFunction";
|
10
12
|
var _excluded = ["label", "onClick", "onHandle", "type"],
|
11
13
|
_excluded2 = ["onClick", "label"];
|
12
14
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
13
15
|
/* eslint-disable react/no-array-index-key */
|
14
16
|
|
15
17
|
import { PlusOutlined } from '@ant-design/icons';
|
16
|
-
import { isFunction, omit } from 'lodash';
|
17
18
|
import { useMemo } from 'react';
|
18
19
|
import locale from '../../../../../locale';
|
19
20
|
var actions = {
|
@@ -109,7 +110,7 @@ var ToolbarButton = function ToolbarButton(props) {
|
|
109
110
|
className: "pro-form-list-toolbar",
|
110
111
|
children: toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.map(function (item, index) {
|
111
112
|
if (item.show === false) return _jsx(_Fragment, {});
|
112
|
-
if (
|
113
|
+
if (_isFunction(item.show) && !item.show(form.getFieldValue(namePath), {
|
113
114
|
namePath: namePath,
|
114
115
|
form: form
|
115
116
|
})) {
|
@@ -131,7 +132,7 @@ var ToolbarButton = function ToolbarButton(props) {
|
|
131
132
|
if (max && max <= fields.length && type === 'add') {
|
132
133
|
return false;
|
133
134
|
}
|
134
|
-
return _jsx(_Button, _objectSpread(_objectSpread(_objectSpread({}, actions[type]),
|
135
|
+
return _jsx(_Button, _objectSpread(_objectSpread(_objectSpread({}, actions[type]), _omit(rest, filterKeys)), {}, {
|
135
136
|
type: "link",
|
136
137
|
onClick: function onClick() {
|
137
138
|
return handleClick(internalOnClick, _onClick, item);
|
@@ -139,7 +140,7 @@ var ToolbarButton = function ToolbarButton(props) {
|
|
139
140
|
children: label || defaultLabel
|
140
141
|
}), "".concat(type).concat(index));
|
141
142
|
}
|
142
|
-
return _jsx(_Button, _objectSpread(_objectSpread({},
|
143
|
+
return _jsx(_Button, _objectSpread(_objectSpread({}, _omit(rest, filterKeys)), {}, {
|
143
144
|
type: "link",
|
144
145
|
onClick: function onClick() {
|
145
146
|
return customClick(_onClick2, item);
|
@@ -2,10 +2,10 @@ import "antd/es/form/style";
|
|
2
2
|
import _Form from "antd/es/form";
|
3
3
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
4
4
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
5
|
+
import _get from "lodash/get";
|
5
6
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
6
7
|
import { forwardRef, useCallback, useImperativeHandle } from 'react';
|
7
8
|
import { DndContext } from '@dnd-kit/core';
|
8
|
-
import { get } from 'lodash';
|
9
9
|
import { SortableContext, verticalListSortingStrategy } from '@dnd-kit/sortable';
|
10
10
|
import { toArray } from '../../../utils';
|
11
11
|
import { namesPathTransform } from './utils';
|
@@ -41,7 +41,7 @@ var FormList = function FormList(props, ref) {
|
|
41
41
|
isDiffAll = _useProConfig.isDiffAll;
|
42
42
|
var errors = meta.errors;
|
43
43
|
var _namePath = toArray(name);
|
44
|
-
var orgValues =
|
44
|
+
var orgValues = _get(diffConfig === null || diffConfig === void 0 ? void 0 : diffConfig.originalValues, name);
|
45
45
|
var _diffConfig = _objectSpread(_objectSpread({}, diffConfig), {}, {
|
46
46
|
originalValues: (diffConfig === null || diffConfig === void 0 ? void 0 : diffConfig.originalValues) && isDiffAll ? orgValues || [] : orgValues
|
47
47
|
});
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import _isEqualWith from "lodash/isEqualWith";
|
2
2
|
import React from 'react';
|
3
3
|
/**
|
4
4
|
* namesPath生产 [['list', 0, 'min'], ['list', 0, 'max']] => list_0_min-list_0_max
|
@@ -22,7 +22,7 @@ export var namesPathTransform = function namesPathTransform(_ref) {
|
|
22
22
|
};
|
23
23
|
// 比较memo
|
24
24
|
export var memoWith = function memoWith(pre, next) {
|
25
|
-
return
|
25
|
+
return _isEqualWith(pre, next, function (objValue, othValue) {
|
26
26
|
if (/*#__PURE__*/React.isValidElement(objValue) && /*#__PURE__*/React.isValidElement(othValue)) {
|
27
27
|
return true;
|
28
28
|
}
|
@@ -1,8 +1,9 @@
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
2
2
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
3
|
+
import _isEqual from "lodash/isEqual";
|
4
|
+
import _cloneDeep from "lodash/cloneDeep";
|
3
5
|
/* eslint-disable no-lonely-if */
|
4
6
|
import { useRef } from 'react';
|
5
|
-
import { cloneDeep, isEqual } from 'lodash';
|
6
7
|
import { useDeepCompareMemo } from '../../../../utils/useDeepCompareMemo';
|
7
8
|
import { difference } from '../../../../../ProEditTable/utils/tools';
|
8
9
|
import { getReactiveProps, getValueTypeTrans, valueFromEventWrapper } from '../utils';
|
@@ -103,7 +104,7 @@ export var useTransformColumns = function useTransformColumns(params) {
|
|
103
104
|
}
|
104
105
|
internalChange === null || internalChange === void 0 ? void 0 : internalChange(newValue, args[1], index);
|
105
106
|
var values = form.getFieldValue(namePath);
|
106
|
-
var originRow = (namePath === null || namePath === void 0 ? void 0 : namePath.length) ?
|
107
|
+
var originRow = (namePath === null || namePath === void 0 ? void 0 : namePath.length) ? _cloneDeep(values) : undefined;
|
107
108
|
onChange === null || onChange === void 0 ? void 0 : onChange.apply(void 0, args);
|
108
109
|
onFieldChange === null || onFieldChange === void 0 ? void 0 : onFieldChange(newValue, values, {
|
109
110
|
index: outerIndex,
|
@@ -112,7 +113,7 @@ export var useTransformColumns = function useTransformColumns(params) {
|
|
112
113
|
option: args === null || args === void 0 ? void 0 : args[1]
|
113
114
|
});
|
114
115
|
// 如果是在可编辑表格或formList内部, 储存当前行的值, 并在变更后更新到表单里
|
115
|
-
if ((namePath === null || namePath === void 0 ? void 0 : namePath.length) && !
|
116
|
+
if ((namePath === null || namePath === void 0 ? void 0 : namePath.length) && !_isEqual(originRow, values)) {
|
116
117
|
var _Object$keys, _Object$keys$map;
|
117
118
|
form.setFieldValue(namePath, values);
|
118
119
|
var diff = difference(originRow, values) || {};
|
@@ -3,9 +3,9 @@ import "antd/es/space/style";
|
|
3
3
|
import _Space from "antd/es/space";
|
4
4
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
5
5
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
6
|
+
import _omit from "lodash/omit";
|
6
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
7
8
|
import React from 'react';
|
8
|
-
import { omit } from 'lodash';
|
9
9
|
import classnames from 'classnames';
|
10
10
|
import { insertSeparator } from './utils';
|
11
11
|
import { useTransformColumns } from './hooks';
|
@@ -89,7 +89,7 @@ var Group = function Group(props) {
|
|
89
89
|
})
|
90
90
|
}) : _jsx(_Space, _objectSpread(_objectSpread({
|
91
91
|
align: "start"
|
92
|
-
},
|
92
|
+
}, _omit(space, ['separator', 'compact'])), {}, {
|
93
93
|
children: columns.map(function (column, index) {
|
94
94
|
column.otherProps = otherProps;
|
95
95
|
if (column === null || column === void 0 ? void 0 : column.separator) {
|
@@ -2,8 +2,8 @@ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
2
|
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
3
3
|
import "antd/es/button/style";
|
4
4
|
import _Button from "antd/es/button";
|
5
|
+
import _isFunction from "lodash/isFunction";
|
5
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
6
|
-
import { isFunction } from 'lodash';
|
7
7
|
import { validate } from '@zat-design/utils';
|
8
8
|
import valueTypeMap from '../../../utils/valueType';
|
9
9
|
/**
|
@@ -117,27 +117,27 @@ export var getReactiveProps = function getReactiveProps(params) {
|
|
117
117
|
fieldProps = params.fieldProps,
|
118
118
|
desensitization = params.desensitization;
|
119
119
|
var values = namePath ? form.getFieldValue(namePath) : form.getFieldsValue();
|
120
|
-
var _disabled =
|
120
|
+
var _disabled = _isFunction(disabled) ? disabled(values, {
|
121
121
|
form: form,
|
122
122
|
index: index,
|
123
123
|
namePath: namePath
|
124
124
|
}) : disabled;
|
125
|
-
var _show =
|
125
|
+
var _show = _isFunction(show) ? show(values, {
|
126
126
|
form: form,
|
127
127
|
index: index,
|
128
128
|
namePath: namePath
|
129
129
|
}) : show;
|
130
|
-
var _component =
|
130
|
+
var _component = _isFunction(component) ? component(values, {
|
131
131
|
form: form,
|
132
132
|
index: index,
|
133
133
|
namePath: namePath
|
134
134
|
}) : component;
|
135
|
-
var _fieldProps =
|
135
|
+
var _fieldProps = _isFunction(fieldProps) ? fieldProps(values, {
|
136
136
|
form: form,
|
137
137
|
index: index,
|
138
138
|
namePath: namePath
|
139
139
|
}) : fieldProps;
|
140
|
-
var _desensitization =
|
140
|
+
var _desensitization = _isFunction(desensitization) ? desensitization(values, {
|
141
141
|
form: form,
|
142
142
|
index: index,
|
143
143
|
namePath: namePath
|
@@ -11,10 +11,12 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
11
11
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
12
12
|
import "antd/es/typography/style";
|
13
13
|
import _Typography from "antd/es/typography";
|
14
|
+
import _isBoolean from "lodash/isBoolean";
|
15
|
+
import _find2 from "lodash/find";
|
16
|
+
import _omit from "lodash/omit";
|
14
17
|
var _excluded = ["className", "hasDetail", "detailMaxLength", "fieldNames", "value", "disabled", "dataSource", "onChange", "useRequest", "transformResponse", "level", "isView", "enumCode", "code", "tooltip", "separator", "detailPlaceholder", "scrollFollowParent", "desensitization", "otherProps"];
|
15
18
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
16
19
|
import { useEffect, useState, memo, useMemo } from 'react';
|
17
|
-
import { omit, find as _find, isBoolean } from 'lodash';
|
18
20
|
import { transformDataName } from './utils/index';
|
19
21
|
import { useProConfig } from '../../../../ProConfigProvider';
|
20
22
|
import Input from '../../base/Input';
|
@@ -113,7 +115,7 @@ var ProCascader = function ProCascader(props) {
|
|
113
115
|
return result;
|
114
116
|
}, [isAddressMode, addressCode, realLevel, dataSource, enumDataSource === null || enumDataSource === void 0 ? void 0 : enumDataSource.length]);
|
115
117
|
var lastDisabled = useMemo(function () {
|
116
|
-
if (
|
118
|
+
if (_isBoolean(disabled) || disabled === undefined) {
|
117
119
|
return [disabled, disabled];
|
118
120
|
}
|
119
121
|
return disabled;
|
@@ -233,7 +235,7 @@ var ProCascader = function ProCascader(props) {
|
|
233
235
|
}
|
234
236
|
// 尝试在当前层级的选项中查找匹配的 _value
|
235
237
|
var currentValue = _value[0];
|
236
|
-
var foundOption =
|
238
|
+
var foundOption = _find2(options, {
|
237
239
|
value: currentValue
|
238
240
|
});
|
239
241
|
if (foundOption) {
|
@@ -285,7 +287,7 @@ var ProCascader = function ProCascader(props) {
|
|
285
287
|
getPopupContainer: function getPopupContainer(trigger) {
|
286
288
|
return scrollFollowParent ? trigger.parentElement : document.body;
|
287
289
|
}
|
288
|
-
},
|
290
|
+
}, _omit(restProps, ['otherProps', 'scrollFollowParent']))), hasDetail && (tooltip && lastDisabled[1] && detail ? _jsx(_Tooltip, {
|
289
291
|
title: detail,
|
290
292
|
children: _jsx("span", {
|
291
293
|
className: "pro-address-detail",
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
3
|
+
import _omit from "lodash/omit";
|
3
4
|
var _excluded = ["label", "value", "children"];
|
4
|
-
import { omit } from 'lodash';
|
5
5
|
export var transformDataName = function transformDataName(dataSource, fieldNames) {
|
6
6
|
var label = fieldNames.label,
|
7
7
|
value = fieldNames.value,
|
@@ -22,7 +22,7 @@ export var transformDataName = function transformDataName(dataSource, fieldNames
|
|
22
22
|
if (children && Array.isArray(node[children])) {
|
23
23
|
newNode.children = node[children].map(transformNode);
|
24
24
|
}
|
25
|
-
return _objectSpread(_objectSpread({}, newNode),
|
25
|
+
return _objectSpread(_objectSpread({}, newNode), _omit(node, Object.values(fieldNames)));
|
26
26
|
}
|
27
27
|
var transformData = function transformData(data) {
|
28
28
|
return data.map(transformNode);
|
@@ -2,8 +2,8 @@ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
3
3
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
4
4
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
5
|
+
import _isEqual from "lodash/isEqual";
|
5
6
|
import { useDebounceFn, usePrevious, useRequest } from 'ahooks';
|
6
|
-
import { isEqual } from 'lodash';
|
7
7
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
8
8
|
import locale, { formatMessage } from '../../../../../locale';
|
9
9
|
var defaultPage = {
|
@@ -79,7 +79,7 @@ export function useRequestList(service, options, useRequestOptions) {
|
|
79
79
|
}),
|
80
80
|
queryList = _useDebounceFn.run;
|
81
81
|
useEffect(function () {
|
82
|
-
if (prevParams && !
|
82
|
+
if (prevParams && !_isEqual(prevParams, params)) {
|
83
83
|
queryList();
|
84
84
|
}
|
85
85
|
}, [params, prevParams, queryList]);
|
@@ -91,7 +91,7 @@ export function useRequestList(service, options, useRequestOptions) {
|
|
91
91
|
});
|
92
92
|
}, [onPageChange]);
|
93
93
|
var onSearch = useCallback(function (values) {
|
94
|
-
if (!
|
94
|
+
if (!_isEqual(searchValues, values)) {
|
95
95
|
onChange(defaultPage.pageNum, defaultPage.pageSize);
|
96
96
|
setSearchValues(values);
|
97
97
|
}
|
@@ -19,13 +19,16 @@ 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
|
+
import _isFunction from "lodash/isFunction";
|
23
|
+
import _isEqual from "lodash/isEqual";
|
24
|
+
import _isArray from "lodash/isArray";
|
25
|
+
import _debounce from "lodash/debounce";
|
22
26
|
var _excluded = ["value", "onChange", "disabled", "labelInValue", "fieldNames", "readOnly", "addonAfter", "configOption", "title", "onFormat", "showCodeName", "optionRender", "customRender", "style", "className", "beforeOpen", "afterOpen", "isTooltip", "searchForm", "searchKey", "defaultOne", "otherProps"],
|
23
27
|
_excluded2 = ["onOk"],
|
24
28
|
_excluded3 = ["rowKey", "columns", "rowSelection"];
|
25
29
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
26
30
|
import { SearchOutlined } from '@ant-design/icons';
|
27
31
|
import { useDebounceEffect, useDeepCompareEffect, useMount, useSetState } from 'ahooks';
|
28
|
-
import { debounce, isArray, isEqual, isFunction } from 'lodash';
|
29
32
|
import classNames from 'classnames';
|
30
33
|
import { ReactSVG } from 'react-svg';
|
31
34
|
import React, { forwardRef, useEffect, useImperativeHandle, useMemo, useRef } from 'react';
|
@@ -206,7 +209,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
206
209
|
label: data[labelKey]
|
207
210
|
}));
|
208
211
|
}
|
209
|
-
return
|
212
|
+
return _isArray(data) ? data === null || data === void 0 ? void 0 : (_data$map = data.map(function (item) {
|
210
213
|
return handleFormat(_objectSpread(_objectSpread({}, item), {}, {
|
211
214
|
value: item[valueKey],
|
212
215
|
label: item[labelKey]
|
@@ -383,7 +386,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
383
386
|
// 更新内部展示值
|
384
387
|
setState({
|
385
388
|
_value: record,
|
386
|
-
options:
|
389
|
+
options: _isArray(record) ? record : [record]
|
387
390
|
});
|
388
391
|
handleClose();
|
389
392
|
}
|
@@ -638,7 +641,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
638
641
|
nextState.selectedRowKeys = [getRowKey(value)];
|
639
642
|
nextState.selectedRows = [value];
|
640
643
|
}
|
641
|
-
if (
|
644
|
+
if (_isArray(value)) {
|
642
645
|
nextState.selectedRowKeys = value.map(function (item) {
|
643
646
|
return getRowKey(item);
|
644
647
|
});
|
@@ -665,7 +668,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
665
668
|
}
|
666
669
|
}, [JSON.stringify(value), visible, isInit]);
|
667
670
|
useDebounceEffect(function () {
|
668
|
-
if (value && !visible && readOnly && (!
|
671
|
+
if (value && !visible && readOnly && (!_isEqual(value, preValue.current) || (options === null || options === void 0 ? void 0 : options.length) === 0)) {
|
669
672
|
var _options$some;
|
670
673
|
preValue.current = value;
|
671
674
|
var _data3 = labelInValue ? value[valueKey] : value;
|
@@ -699,7 +702,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
699
702
|
} : queryBean;
|
700
703
|
var nextParams = transformParams ? transformParams(params) : params;
|
701
704
|
// 减少请求条件一致时,且请求过时,focus的重复请求
|
702
|
-
if (!
|
705
|
+
if (!_isEqual(queryBean, defaultParamsRef.current) || !(options === null || options === void 0 ? void 0 : options.length)) {
|
703
706
|
run(nextParams); // 触发 run 请求
|
704
707
|
defaultParamsRef.current = queryBean; // 更新缓存
|
705
708
|
}
|
@@ -708,7 +711,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
708
711
|
});
|
709
712
|
}
|
710
713
|
};
|
711
|
-
var handleSelectSearch =
|
714
|
+
var handleSelectSearch = _debounce(function (val) {
|
712
715
|
if (useRequest) {
|
713
716
|
var queryBean = _objectSpread(_objectSpread({}, defaultParams), {}, _defineProperty({}, searchKey !== null && searchKey !== void 0 ? searchKey : labelKey, val));
|
714
717
|
var params = withPagination ? {
|
@@ -733,14 +736,14 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
733
736
|
}
|
734
737
|
}
|
735
738
|
if (!readOnly) {
|
736
|
-
if (labelInValue && _value && !
|
739
|
+
if (labelInValue && _value && !_isEqual(value, _value)) {
|
737
740
|
setState({
|
738
741
|
_value: value,
|
739
742
|
selectedRowKeys: [],
|
740
743
|
selectedRows: []
|
741
744
|
});
|
742
745
|
}
|
743
|
-
if (!labelInValue && !
|
746
|
+
if (!labelInValue && !_isEqual(value, _value === null || _value === void 0 ? void 0 : _value[valueKey])) {
|
744
747
|
setState({
|
745
748
|
_value: value,
|
746
749
|
selectedRowKeys: [],
|
@@ -841,7 +844,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
841
844
|
if (!((_formColumns$2 = formColumns[0]) === null || _formColumns$2 === void 0 ? void 0 : _formColumns$2.fieldProps)) {
|
842
845
|
formColumns[0].fieldProps = {};
|
843
846
|
}
|
844
|
-
if (!
|
847
|
+
if (!_isFunction(formColumns[0].fieldProps) && !(formColumns === null || formColumns === void 0 ? void 0 : (_formColumns$3 = formColumns[0]) === null || _formColumns$3 === void 0 ? void 0 : (_formColumns$3$fieldP = _formColumns$3.fieldProps) === null || _formColumns$3$fieldP === void 0 ? void 0 : _formColumns$3$fieldP.suffix)) {
|
845
848
|
formColumns[0].fieldProps.suffix = _jsx(SearchOutlined, {
|
846
849
|
onClick: handleSearch
|
847
850
|
});
|
@@ -9,9 +9,9 @@ import "antd/es/space/style";
|
|
9
9
|
import _Space from "antd/es/space";
|
10
10
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
11
11
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
12
|
+
import _isEmpty from "lodash/isEmpty";
|
12
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
13
14
|
import { useSetState, useDeepCompareEffect } from 'ahooks';
|
14
|
-
import { isEmpty } from 'lodash';
|
15
15
|
import classnames from 'classnames';
|
16
16
|
import { tools } from '@zat-design/utils';
|
17
17
|
import Container from '../../Container';
|
@@ -95,7 +95,7 @@ var ProNumberRange = function ProNumberRange(props) {
|
|
95
95
|
});
|
96
96
|
// 查看模式
|
97
97
|
if (isView || props.isView) {
|
98
|
-
if (
|
98
|
+
if (_isEmpty(value) || (value === null || value === void 0 ? void 0 : value.every(function (item) {
|
99
99
|
return typeof item !== 'number';
|
100
100
|
}))) {
|
101
101
|
return viewEmpty;
|
@@ -8,10 +8,13 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
|
|
8
8
|
import "antd/es/date-picker/style";
|
9
9
|
import _DatePicker from "antd/es/date-picker";
|
10
10
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
11
|
+
import _isObject from "lodash/isObject";
|
12
|
+
import _uniq from "lodash/uniq";
|
13
|
+
import _isFunction from "lodash/isFunction";
|
14
|
+
import _omit from "lodash/omit";
|
11
15
|
var _excluded = ["disabled", "foreverText", "foreverDate", "format", "otherProps", "separator", "limit"];
|
12
16
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
13
17
|
import { useMemo, useState } from 'react';
|
14
|
-
import { omit, isFunction, uniq, isObject } from 'lodash';
|
15
18
|
import classNames from 'classnames';
|
16
19
|
import moment from 'moment';
|
17
20
|
import { useProConfig } from '../../../../ProConfigProvider';
|
@@ -95,10 +98,10 @@ var ProRangeLimit = function ProRangeLimit(props) {
|
|
95
98
|
}
|
96
99
|
var _viewFormat = Array.isArray(format) ? format[0] : format;
|
97
100
|
var tempFormat = Array.isArray(format) ? format : [format];
|
98
|
-
if (
|
101
|
+
if (_isFunction(format)) {
|
99
102
|
tempFormat = [];
|
100
103
|
}
|
101
|
-
var _format =
|
104
|
+
var _format = _uniq([].concat(_toConsumableArray(tempFormat), ['YYYY-MM-DD', 'YYYYMMDD', 'YYYY/MM/DD', 'YYYY_MM_DD', 'YYYY.MM.DD'])).filter(function (formatKey) {
|
102
105
|
return !!formatKey;
|
103
106
|
});
|
104
107
|
var _defaultShowTime = {
|
@@ -162,7 +165,7 @@ var ProRangeLimit = function ProRangeLimit(props) {
|
|
162
165
|
if (_rest.showTime === true) {
|
163
166
|
_rest.showTime = _objectSpread({}, _defaultShowTime);
|
164
167
|
}
|
165
|
-
if (
|
168
|
+
if (_isObject(_rest.showTime)) {
|
166
169
|
_rest.showTime = Object.assign(_defaultShowTime, _rest.showTime);
|
167
170
|
}
|
168
171
|
return _jsxs(_Input.Group, {
|
@@ -172,7 +175,7 @@ var ProRangeLimit = function ProRangeLimit(props) {
|
|
172
175
|
allowClear: true,
|
173
176
|
disabled: [_disabled === null || _disabled === void 0 ? void 0 : _disabled[0], (_disabled === null || _disabled === void 0 ? void 0 : _disabled[1]) || _isForever],
|
174
177
|
defaultPickerValue: defaultPickerValue
|
175
|
-
}, initialConfig),
|
178
|
+
}, initialConfig), _omit(_rest, ['placeholder', 'separator'])), {}, {
|
176
179
|
format: _format,
|
177
180
|
value: value,
|
178
181
|
onChange: handleRangeChange
|