@zat-design/sisyphus-react 3.2.2 → 3.3.0-beta.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/README.md +7 -0
- package/dist/index.esm.css +82 -37
- package/es/ProAction/index.less +3 -0
- package/es/ProDownload/index.js +9 -6
- package/es/ProDownload/style/index.less +5 -2
- package/es/ProDrawerForm/index.js +1 -15
- package/es/ProDrawerForm/style/index.less +76 -73
- package/es/ProEditLabel/style/index.less +12 -9
- package/es/ProEditTable/components/RenderField/index.js +6 -4
- package/es/ProEditTable/index.js +34 -20
- package/es/ProEditTable/style/index.less +57 -47
- package/es/ProEditTable/utils/config.d.ts +1 -1
- package/es/ProEditTable/utils/config.js +3 -3
- package/es/ProEnum/style/index.less +3 -0
- package/es/ProForm/components/base/DatePicker/index.d.ts +2 -2
- package/es/ProForm/components/base/DatePicker/index.js +5 -8
- package/es/ProForm/components/base/RangePicker/index.d.ts +3 -2
- package/es/ProForm/components/base/RangePicker/index.js +3 -5
- package/es/ProForm/components/base/SwitchCheckbox/style/index.less +3 -0
- package/es/ProForm/components/base/TextArea/index.less +4 -3
- package/es/ProForm/components/base/TimePicker/index.js +3 -3
- package/es/ProForm/components/base/TimePicker/style/index.less +4 -1
- package/es/ProForm/components/combination/Container/style/index.less +6 -3
- package/es/ProForm/components/combination/FormList/style/index.less +20 -24
- package/es/ProForm/components/combination/Group/style/index.less +18 -15
- package/es/ProForm/components/combination/ProAddressBar/style/index.less +6 -3
- package/es/ProForm/components/combination/ProCombination/style/index.less +5 -2
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +6 -1
- package/es/ProForm/components/combination/ProModalSelect/index.js +22 -24
- package/es/ProForm/components/combination/ProModalSelect/style/index.less +32 -11
- package/es/ProForm/components/combination/ProNumberRange/style/index.less +13 -10
- package/es/ProForm/components/combination/ProRangeLimit/index.d.ts +2 -2
- package/es/ProForm/components/combination/ProRangeLimit/index.js +6 -6
- package/es/ProForm/components/combination/ProTimeLimit/hooks/useControlled.d.ts +2 -2
- package/es/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +2 -2
- package/es/ProForm/components/combination/ProTimeLimit/index.d.ts +2 -2
- package/es/ProForm/components/combination/ProTimeLimit/index.js +4 -4
- package/es/ProForm/components/combination/ProTimeLimit/style/index.less +9 -6
- package/es/ProForm/components/old/ProCertValidity/index.js +16 -16
- package/es/ProForm/components/old/ProCertValidity/propsType.d.ts +4 -4
- package/es/ProForm/components/render/RenderFields.js +4 -5
- package/es/ProForm/style/index.less +46 -44
- package/es/ProIcon/style/index.less +4 -1
- package/es/ProLayout/components/Layout/Header/style/index.less +1 -1
- package/es/ProLayout/components/Layout/Menu/FoldMenu/style/index.less +10 -7
- package/es/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +31 -28
- package/es/ProLayout/components/Layout/Menu/SideMenu/style/index.less +14 -11
- package/es/ProLayout/components/Layout/Menu/style/index.less +2 -0
- package/es/ProLayout/components/Layout/Notice/style/index.less +3 -0
- package/es/ProLayout/components/ProCollapse/style/index.less +27 -24
- package/es/ProLayout/components/ProFooter/style/index.less +11 -7
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +4 -1
- package/es/ProLayout/components/ProHeader/index.js +4 -4
- package/es/ProLayout/components/ProHeader/style/index.less +12 -11
- package/es/ProLayout/style/index.less +10 -7
- package/es/ProSelect/index.less +3 -0
- package/es/ProStep/index.js +2 -2
- package/es/ProStep/style/index.less +3 -0
- package/es/ProTable/index.js +15 -7
- package/es/ProTable/style/index.less +76 -54
- package/es/ProTable/utils.d.ts +1 -1
- package/es/ProTable/utils.js +52 -33
- package/es/ProTabs/style/index.less +25 -23
- package/es/ProThemeTools/component/PrdTools/index.d.ts +1 -1
- package/es/ProThemeTools/component/PrdTools/index.js +7 -6
- package/es/ProThemeTools/component/PrdTools/style/index.less +6 -6
- package/es/ProThemeTools/index.d.ts +1 -1
- package/es/ProThemeTools/index.js +7 -2
- package/es/ProThemeTools/propsType.d.ts +4 -0
- package/es/ProThemeTools/style/index.less +6 -3
- package/es/ProThemeTools/utils/index.d.ts +1 -1
- package/es/ProThemeTools/utils/index.js +2 -1
- package/es/ProTooltip/style/index.less +3 -0
- package/es/ProTree/components/CloseIcon.js +2 -4
- package/es/ProTree/components/ProTree.js +27 -11
- package/es/ProTree/components/Tree.js +1 -1
- package/es/ProTree/propsType.d.ts +2 -2
- package/es/ProTree/style/index.less +29 -26
- package/es/ProTree/utils.d.ts +6 -0
- package/es/ProTree/utils.js +11 -0
- package/es/ProTreeModal/components/CloseIcon.js +2 -4
- package/es/ProTreeModal/components/Trigger.d.ts +3 -0
- package/es/ProTreeModal/components/Trigger.js +79 -19
- package/es/ProTreeModal/index.js +38 -6
- package/es/ProTreeModal/propsType.d.ts +5 -2
- package/es/ProTreeModal/style/index.less +11 -8
- package/es/ProTreeSelect/index.js +6 -4
- package/es/ProTreeSelect/propsType.d.ts +2 -0
- package/es/ProTreeSelect/style/index.less +25 -22
- package/es/ProUpload/components/DragRender.js +7 -4
- package/es/ProUpload/components/ImageRender.js +5 -1
- package/es/ProUpload/index.js +11 -7
- package/es/ProUpload/style/index.less +13 -4
- package/es/ProViewer/index.js +3 -1
- package/es/ProViewer/style/index.less +6 -3
- package/es/locale/en_US.d.ts +4 -0
- package/es/locale/en_US.js +5 -1
- package/es/locale/index.js +2 -2
- package/es/locale/zh_CN.d.ts +4 -0
- package/es/locale/zh_CN.js +6 -2
- package/es/old/ProCertValidity/index.js +16 -16
- package/es/old/ProCertValidity/propsType.d.ts +4 -4
- package/es/old/ProEditableTable/utils.d.ts +5 -5
- package/es/old/ProEditableTable/utils.js +5 -5
- package/es/style/core/compatible.less +6 -6
- package/es/style/theme/antd.less +272 -253
- package/lib/ProAction/index.less +3 -0
- package/lib/ProDownload/index.js +9 -6
- package/lib/ProDownload/style/index.less +5 -2
- package/lib/ProDrawerForm/index.js +0 -14
- package/lib/ProDrawerForm/style/index.less +76 -73
- package/lib/ProEditLabel/style/index.less +12 -9
- package/lib/ProEditTable/components/RenderField/index.js +6 -4
- package/lib/ProEditTable/index.js +32 -18
- package/lib/ProEditTable/style/index.less +57 -47
- package/lib/ProEditTable/utils/config.d.ts +1 -1
- package/lib/ProEditTable/utils/config.js +3 -3
- package/lib/ProEnum/style/index.less +3 -0
- package/lib/ProForm/components/base/DatePicker/index.d.ts +2 -2
- package/lib/ProForm/components/base/DatePicker/index.js +5 -8
- package/lib/ProForm/components/base/RangePicker/index.d.ts +3 -2
- package/lib/ProForm/components/base/RangePicker/index.js +4 -4
- package/lib/ProForm/components/base/SwitchCheckbox/style/index.less +3 -0
- package/lib/ProForm/components/base/TextArea/index.less +4 -3
- package/lib/ProForm/components/base/TimePicker/index.js +3 -3
- package/lib/ProForm/components/base/TimePicker/style/index.less +4 -1
- package/lib/ProForm/components/combination/Container/style/index.less +6 -3
- package/lib/ProForm/components/combination/FormList/style/index.less +20 -24
- package/lib/ProForm/components/combination/Group/style/index.less +18 -15
- package/lib/ProForm/components/combination/ProAddressBar/style/index.less +6 -3
- package/lib/ProForm/components/combination/ProCombination/style/index.less +5 -2
- package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +7 -1
- package/lib/ProForm/components/combination/ProModalSelect/index.js +22 -24
- package/lib/ProForm/components/combination/ProModalSelect/style/index.less +32 -11
- package/lib/ProForm/components/combination/ProNumberRange/style/index.less +13 -10
- package/lib/ProForm/components/combination/ProRangeLimit/index.d.ts +2 -2
- package/lib/ProForm/components/combination/ProRangeLimit/index.js +6 -6
- package/lib/ProForm/components/combination/ProTimeLimit/hooks/useControlled.d.ts +2 -2
- package/lib/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +2 -2
- package/lib/ProForm/components/combination/ProTimeLimit/index.d.ts +2 -2
- package/lib/ProForm/components/combination/ProTimeLimit/index.js +4 -4
- package/lib/ProForm/components/combination/ProTimeLimit/style/index.less +9 -6
- package/lib/ProForm/components/old/ProCertValidity/index.js +16 -16
- package/lib/ProForm/components/old/ProCertValidity/propsType.d.ts +4 -4
- package/lib/ProForm/components/render/RenderFields.js +4 -5
- package/lib/ProForm/style/index.less +46 -44
- package/lib/ProIcon/style/index.less +4 -1
- package/lib/ProLayout/components/Layout/Header/style/index.less +1 -1
- package/lib/ProLayout/components/Layout/Menu/FoldMenu/style/index.less +10 -7
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +31 -28
- package/lib/ProLayout/components/Layout/Menu/SideMenu/style/index.less +14 -11
- package/lib/ProLayout/components/Layout/Menu/style/index.less +2 -0
- package/lib/ProLayout/components/Layout/Notice/style/index.less +3 -0
- package/lib/ProLayout/components/ProCollapse/style/index.less +27 -24
- package/lib/ProLayout/components/ProFooter/style/index.less +11 -7
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +4 -1
- package/lib/ProLayout/components/ProHeader/index.js +4 -4
- package/lib/ProLayout/components/ProHeader/style/index.less +12 -11
- package/lib/ProLayout/style/index.less +10 -7
- package/lib/ProSelect/index.less +3 -0
- package/lib/ProStep/index.js +1 -1
- package/lib/ProStep/style/index.less +3 -0
- package/lib/ProTable/index.js +14 -6
- package/lib/ProTable/style/index.less +76 -54
- package/lib/ProTable/utils.d.ts +1 -1
- package/lib/ProTable/utils.js +52 -33
- package/lib/ProTabs/style/index.less +25 -23
- package/lib/ProThemeTools/component/PrdTools/index.d.ts +1 -1
- package/lib/ProThemeTools/component/PrdTools/index.js +7 -6
- package/lib/ProThemeTools/component/PrdTools/style/index.less +6 -6
- package/lib/ProThemeTools/index.d.ts +1 -1
- package/lib/ProThemeTools/index.js +7 -2
- package/lib/ProThemeTools/propsType.d.ts +4 -0
- package/lib/ProThemeTools/style/index.less +6 -3
- package/lib/ProThemeTools/utils/index.d.ts +1 -1
- package/lib/ProThemeTools/utils/index.js +2 -1
- package/lib/ProTooltip/style/index.less +3 -0
- package/lib/ProTree/components/CloseIcon.js +2 -4
- package/lib/ProTree/components/ProTree.js +26 -10
- package/lib/ProTree/components/Tree.js +1 -1
- package/lib/ProTree/propsType.d.ts +2 -2
- package/lib/ProTree/style/index.less +29 -26
- package/lib/ProTree/utils.d.ts +6 -0
- package/lib/ProTree/utils.js +12 -0
- package/lib/ProTreeModal/components/CloseIcon.js +2 -4
- package/lib/ProTreeModal/components/Trigger.d.ts +3 -0
- package/lib/ProTreeModal/components/Trigger.js +74 -18
- package/lib/ProTreeModal/index.js +38 -6
- package/lib/ProTreeModal/propsType.d.ts +5 -2
- package/lib/ProTreeModal/style/index.less +11 -8
- package/lib/ProTreeSelect/index.js +6 -4
- package/lib/ProTreeSelect/propsType.d.ts +2 -0
- package/lib/ProTreeSelect/style/index.less +25 -22
- package/lib/ProUpload/components/DragRender.js +7 -4
- package/lib/ProUpload/components/ImageRender.js +5 -1
- package/lib/ProUpload/index.js +11 -7
- package/lib/ProUpload/style/index.less +13 -4
- package/lib/ProViewer/index.js +4 -3
- package/lib/ProViewer/style/index.less +6 -3
- package/lib/locale/en_US.d.ts +4 -0
- package/lib/locale/en_US.js +5 -1
- package/lib/locale/index.js +2 -2
- package/lib/locale/zh_CN.d.ts +4 -0
- package/lib/locale/zh_CN.js +6 -2
- package/lib/old/ProCertValidity/index.js +16 -16
- package/lib/old/ProCertValidity/propsType.d.ts +4 -4
- package/lib/old/ProEditableTable/utils.d.ts +5 -5
- package/lib/old/ProEditableTable/utils.js +5 -5
- package/lib/style/core/compatible.less +6 -6
- package/lib/style/theme/antd.less +272 -253
- package/package.json +3 -2
- package/typings.d.ts +0 -6
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
@root-entry-name: 'default';
|
|
2
|
+
@import (reference) '~antd/es/style/themes/index.less';
|
|
3
|
+
|
|
1
4
|
.pro-edit-label {
|
|
2
5
|
display: inline-block;
|
|
3
6
|
|
|
4
7
|
.pro-form-view {
|
|
5
|
-
|
|
8
|
+
.@{ant-prefix}-row {
|
|
6
9
|
display: block;
|
|
7
10
|
}
|
|
8
11
|
}
|
|
@@ -54,8 +57,8 @@
|
|
|
54
57
|
|
|
55
58
|
}
|
|
56
59
|
|
|
57
|
-
|
|
58
|
-
|
|
60
|
+
.@{ant-prefix}-popover {
|
|
61
|
+
.@{ant-prefix}-btn-sm {
|
|
59
62
|
font-size : var(--zaui-font-size-sm, 12px);
|
|
60
63
|
min-width : 56px;
|
|
61
64
|
line-height: 1;
|
|
@@ -70,15 +73,15 @@
|
|
|
70
73
|
.pro-edit-label-popconfirm {
|
|
71
74
|
z-index: 1001 !important;
|
|
72
75
|
|
|
73
|
-
|
|
76
|
+
.@{ant-prefix}-popover-message {
|
|
74
77
|
display: block;
|
|
75
78
|
}
|
|
76
79
|
|
|
77
|
-
|
|
80
|
+
.@{ant-prefix}-popover-message-title {
|
|
78
81
|
padding-left: 0;
|
|
79
82
|
}
|
|
80
83
|
|
|
81
|
-
|
|
84
|
+
.@{ant-prefix}-popover-content {
|
|
82
85
|
width : 360px;
|
|
83
86
|
max-width: 400px;
|
|
84
87
|
}
|
|
@@ -109,13 +112,13 @@
|
|
|
109
112
|
width: 100%;
|
|
110
113
|
|
|
111
114
|
&.pro-form-no-label {
|
|
112
|
-
|
|
115
|
+
.@{ant-prefix}-form-item-label {
|
|
113
116
|
display: none;
|
|
114
117
|
}
|
|
115
118
|
}
|
|
116
119
|
}
|
|
117
120
|
|
|
118
|
-
|
|
121
|
+
.@{ant-prefix}-col-10 {
|
|
119
122
|
flex : 0 0 var(--zaui-form-label-width, 130px);
|
|
120
123
|
text-align : var(--zaui-form-align, left);
|
|
121
124
|
white-space : pre-wrap;
|
|
@@ -127,7 +130,7 @@
|
|
|
127
130
|
|
|
128
131
|
}
|
|
129
132
|
|
|
130
|
-
|
|
133
|
+
.@{ant-prefix}-select {
|
|
131
134
|
width: 100%;
|
|
132
135
|
}
|
|
133
136
|
|
|
@@ -506,7 +506,7 @@ var RenderField = function RenderField(_ref) {
|
|
|
506
506
|
delete _formItemProps.rules;
|
|
507
507
|
}
|
|
508
508
|
var _className = classNames((_classNames = {}, _defineProperty(_classNames, className, className), _defineProperty(_classNames, 'pro-form-item-changed', changed), _classNames));
|
|
509
|
-
var originalTitle = _jsxs(_Space, {
|
|
509
|
+
var originalTitle = originalTip ? _jsxs(_Space, {
|
|
510
510
|
children: ["\u521D\u59CB\u503C\uFF1A", /*#__PURE__*/React.isValidElement(TargetComponent) ? /*#__PURE__*/React.cloneElement(TargetComponent, _objectSpread(_objectSpread({}, omit(componentProps, ['onFieldChange'])), {}, {
|
|
511
511
|
isView: true,
|
|
512
512
|
value: originalValue,
|
|
@@ -516,14 +516,16 @@ var RenderField = function RenderField(_ref) {
|
|
|
516
516
|
value: originalValue,
|
|
517
517
|
checked: type === 'Switch' ? originalValue : undefined
|
|
518
518
|
}))]
|
|
519
|
-
});
|
|
520
|
-
var FormItem = _jsx(_Form.Item, _objectSpread(_objectSpread({
|
|
519
|
+
}) : null;
|
|
520
|
+
var FormItem = TargetComponent ? _jsx(_Form.Item, _objectSpread(_objectSpread({
|
|
521
521
|
validateFirst: true
|
|
522
522
|
}, omit(_formItemProps, ['render', 'cache', 'key', 'width', 'hiddenNames', 'name'])), {}, {
|
|
523
523
|
className: _className,
|
|
524
524
|
name: cellName,
|
|
525
525
|
children: /*#__PURE__*/React.isValidElement(TargetComponent) ? /*#__PURE__*/React.cloneElement(TargetComponent, _objectSpread({}, omit(componentProps, ['onFieldChange']))) : _jsx(TargetComponent, _objectSpread({}, omit(componentProps, ['onFieldChange'])))
|
|
526
|
-
}))
|
|
526
|
+
})) : _jsx(Container, {
|
|
527
|
+
viewEmpty: viewEmpty
|
|
528
|
+
});
|
|
527
529
|
return _jsx(FieldProvider, {
|
|
528
530
|
value: componentProps === null || componentProps === void 0 ? void 0 : componentProps.otherProps,
|
|
529
531
|
children: !originalTip || ['FormList', 'ProEditTable'].includes(type) ? FormItem : _jsx(_Tooltip, {
|
package/es/ProEditTable/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import "antd/es/table/style";
|
|
2
2
|
import _Table from "antd/es/table";
|
|
3
|
-
import "antd/es/config-provider/style";
|
|
4
|
-
import _ConfigProvider from "antd/es/config-provider";
|
|
5
3
|
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
6
4
|
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
7
5
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
8
6
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
9
7
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
8
|
+
import "antd/es/config-provider/style";
|
|
9
|
+
import _ConfigProvider from "antd/es/config-provider";
|
|
10
10
|
import "antd/es/form/style";
|
|
11
11
|
import _Form from "antd/es/form";
|
|
12
12
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
13
|
-
var _excluded = ["value", "onChange", "className", "columns", "type", "mode", "stripe", "draggable", "disabled", "insertType", "emptyBtnText", "actionWidth", "actionProps", "toolbarProps", "rowSelection", "onlyOneLineMsg", "deletePoConfirmMsg", "mulDeletePoConfirmMsg", "otherProps", "requiredAlign", "summary", "max", "headerRender", "pagination", "originalValues", "originalTip"];
|
|
13
|
+
var _excluded = ["value", "onChange", "className", "columns", "type", "mode", "stripe", "draggable", "disabled", "insertType", "emptyBtnText", "actionWidth", "actionProps", "toolbarProps", "rowSelection", "onlyOneLineMsg", "deletePoConfirmMsg", "mulDeletePoConfirmMsg", "otherProps", "requiredAlign", "summary", "max", "headerRender", "pagination", "originalValues", "originalTip", "rowKey"];
|
|
14
14
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
-
import { forwardRef, useCallback, useEffect, useImperativeHandle, useRef } from 'react';
|
|
15
|
+
import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useRef } from 'react';
|
|
16
16
|
import { isArray } from 'lodash';
|
|
17
17
|
import { useDebounceEffect, useSetState } from 'ahooks';
|
|
18
18
|
import classnames from 'classnames';
|
|
@@ -50,6 +50,7 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
|
50
50
|
pagination = _ref.pagination,
|
|
51
51
|
originalValues = _ref.originalValues,
|
|
52
52
|
originalTip = _ref.originalTip,
|
|
53
|
+
rowKey = _ref.rowKey,
|
|
53
54
|
resetProps = _objectWithoutProperties(_ref, _excluded);
|
|
54
55
|
// 上下文form
|
|
55
56
|
var contentForm = _Form.useFormInstance();
|
|
@@ -60,6 +61,9 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
|
60
61
|
_otherProps$viewEmpty = otherProps.viewEmpty,
|
|
61
62
|
viewEmpty = _otherProps$viewEmpty === void 0 ? '-' : _otherProps$viewEmpty;
|
|
62
63
|
var tableRef = useRef(null);
|
|
64
|
+
var _React$useContext = React.useContext(_ConfigProvider.ConfigContext),
|
|
65
|
+
getPrefixCls = _React$useContext.getPrefixCls;
|
|
66
|
+
var prefixCls = getPrefixCls();
|
|
63
67
|
disabled = (otherProps === null || otherProps === void 0 ? void 0 : otherProps.disabled) || disabled;
|
|
64
68
|
var _useSetState = useSetState({
|
|
65
69
|
_columns: columns,
|
|
@@ -94,21 +98,13 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
|
94
98
|
'pro-table-no-stripe': !stripe,
|
|
95
99
|
className: className
|
|
96
100
|
});
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
// 复选框
|
|
102
|
-
var _rowSelection = _objectSpread({
|
|
103
|
-
fixed: true,
|
|
104
|
-
selectedRowKeys: selectedRowKeys,
|
|
105
|
-
onChange: function onChange(selectedRowKeys, selectedRows) {
|
|
106
|
-
setState({
|
|
107
|
-
selectedRowKeys: selectedRowKeys,
|
|
108
|
-
selectedRows: selectedRows
|
|
109
|
-
});
|
|
101
|
+
var getRowKey = function getRowKey(record) {
|
|
102
|
+
var key = record.rowKey || getRandom();
|
|
103
|
+
if (rowKey) {
|
|
104
|
+
key = typeof rowKey === 'function' ? rowKey(record) : record[rowKey];
|
|
110
105
|
}
|
|
111
|
-
|
|
106
|
+
return key;
|
|
107
|
+
};
|
|
112
108
|
var config = {
|
|
113
109
|
form: form,
|
|
114
110
|
mode: mode,
|
|
@@ -138,8 +134,26 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
|
138
134
|
tableLength: value === null || value === void 0 ? void 0 : value.length,
|
|
139
135
|
page: page,
|
|
140
136
|
originalValues: originalValues,
|
|
141
|
-
originalTip: originalTip
|
|
137
|
+
originalTip: originalTip,
|
|
138
|
+
prefixCls: prefixCls
|
|
139
|
+
};
|
|
140
|
+
// 编辑行设置下样式
|
|
141
|
+
var _rowClassName = function _rowClassName(record) {
|
|
142
|
+
var isEdit = !virtualKey || editingKeys.includes(record.rowKey);
|
|
143
|
+
var className = isEdit ? 'is-editing' : '';
|
|
144
|
+
return className;
|
|
142
145
|
};
|
|
146
|
+
// 复选框
|
|
147
|
+
var _rowSelection = _objectSpread({
|
|
148
|
+
fixed: true,
|
|
149
|
+
selectedRowKeys: selectedRowKeys,
|
|
150
|
+
onChange: function onChange(selectedRowKeys, selectedRows) {
|
|
151
|
+
setState({
|
|
152
|
+
selectedRowKeys: selectedRowKeys,
|
|
153
|
+
selectedRows: selectedRows
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
}, rowSelection);
|
|
143
157
|
// 判断是否禁止添加、批量删除
|
|
144
158
|
var isForbiddenBtn = useCallback(function (type) {
|
|
145
159
|
// 当工具栏不渲染时,都不渲染
|
|
@@ -233,7 +247,7 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
|
233
247
|
if ((value === null || value === void 0 ? void 0 : value.length) && !(value === null || value === void 0 ? void 0 : (_value$ = value[0]) === null || _value$ === void 0 ? void 0 : _value$.rowKey)) {
|
|
234
248
|
var nextValues = value === null || value === void 0 ? void 0 : value.map(function (item) {
|
|
235
249
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
236
|
-
rowKey:
|
|
250
|
+
rowKey: getRowKey(item)
|
|
237
251
|
});
|
|
238
252
|
});
|
|
239
253
|
onChange(nextValues);
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
@root-entry-name: 'default';
|
|
2
|
+
@import (reference) '~antd/es/style/themes/index.less';
|
|
3
|
+
|
|
1
4
|
.pro-edit-table {
|
|
2
5
|
.pro-edit-table-tooltip {
|
|
3
6
|
display : inline-flex;
|
|
@@ -35,7 +38,7 @@
|
|
|
35
38
|
justify-content: center;
|
|
36
39
|
margin-top: var(--zaui-space-size-md, 16px);
|
|
37
40
|
|
|
38
|
-
|
|
41
|
+
.@{ant-prefix}-btn-link {
|
|
39
42
|
padding: 0;
|
|
40
43
|
}
|
|
41
44
|
}
|
|
@@ -47,7 +50,7 @@
|
|
|
47
50
|
}
|
|
48
51
|
|
|
49
52
|
|
|
50
|
-
.is-cell
|
|
53
|
+
.is-cell .@{ant-prefix}-form-item .@{ant-prefix}-form-item-row .@{ant-prefix}-form-item-control .@{ant-prefix}-form-item-control-input {
|
|
51
54
|
border: 1px solid transparent;
|
|
52
55
|
|
|
53
56
|
&:hover {
|
|
@@ -66,15 +69,15 @@
|
|
|
66
69
|
}
|
|
67
70
|
|
|
68
71
|
&.pro-table-no-stripe {
|
|
69
|
-
|
|
72
|
+
.@{ant-prefix}-table-tbody tr:nth-child(n)>td {
|
|
70
73
|
background-color: var(--zaui-base-bg, #fff);
|
|
71
74
|
}
|
|
72
75
|
}
|
|
73
76
|
|
|
74
|
-
|
|
77
|
+
.@{ant-prefix}-space {
|
|
75
78
|
gap: var(--zaui-space-size-sm, 8px);
|
|
76
79
|
|
|
77
|
-
|
|
80
|
+
.@{ant-prefix}-btn-link {
|
|
78
81
|
padding: 0 var(--zaui-space-size-xs, 4px);
|
|
79
82
|
|
|
80
83
|
&:first-child {
|
|
@@ -83,12 +86,12 @@
|
|
|
83
86
|
}
|
|
84
87
|
}
|
|
85
88
|
|
|
86
|
-
|
|
89
|
+
.@{ant-prefix}-table-header>table .@{ant-prefix}-table-thead>tr>th.@{ant-prefix}-table-selection-column {
|
|
87
90
|
padding-left: var(--zaui-space-size-md, 16px);
|
|
88
91
|
padding-right: var(--zaui-space-size-md, 16px);
|
|
89
92
|
}
|
|
90
93
|
|
|
91
|
-
|
|
94
|
+
.@{ant-prefix}-table-header>table .@{ant-prefix}-table-thead>tr>th:not(.@{ant-prefix}-table-selection-column):not(.@{ant-prefix}-table-row-expand-icon-cell):not([colspan]).is-required {
|
|
92
95
|
&::after {
|
|
93
96
|
content: "";
|
|
94
97
|
}
|
|
@@ -130,27 +133,29 @@
|
|
|
130
133
|
}
|
|
131
134
|
}
|
|
132
135
|
|
|
133
|
-
|
|
136
|
+
.@{ant-prefix}-table-scroll-horizontal {
|
|
137
|
+
.@{ant-prefix}-table-cell-fix-right-first {
|
|
138
|
+
&::after {
|
|
139
|
+
box-shadow: inset -10px 0 8px -8px rgba(0, 0, 0, 0.15);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.@{ant-prefix}-table-content {
|
|
134
145
|
>table {
|
|
135
|
-
|
|
146
|
+
.@{ant-prefix}-table-summary {
|
|
136
147
|
background-color: var(--zaui-table-header-bg, #f2f3f5);
|
|
137
148
|
color : var(--zaui-text, #343434);
|
|
138
149
|
font-weight : 600;
|
|
139
150
|
|
|
140
|
-
|
|
141
|
-
|
|
151
|
+
.@{ant-prefix}-table-cell-fix-left,
|
|
152
|
+
.@{ant-prefix}-table-cell-fix-right {
|
|
142
153
|
background-color: var(--zaui-table-header-bg, #f2f3f5);
|
|
143
154
|
|
|
144
155
|
}
|
|
145
156
|
}
|
|
146
157
|
|
|
147
|
-
|
|
148
|
-
&::after {
|
|
149
|
-
box-shadow: inset -10px 0 8px -8px rgba(0, 0, 0, 0.15);
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
th.ant-table-selection-column {
|
|
158
|
+
th.@{ant-prefix}-table-selection-column {
|
|
154
159
|
width: 48px;
|
|
155
160
|
}
|
|
156
161
|
|
|
@@ -160,7 +165,7 @@
|
|
|
160
165
|
}
|
|
161
166
|
}
|
|
162
167
|
|
|
163
|
-
|
|
168
|
+
.@{ant-prefix}-table-thead>tr>th:not(.@{ant-prefix}-table-selection-column):not(.@{ant-prefix}-table-row-expand-icon-cell):not([colspan]).is-required {
|
|
164
169
|
&::after {
|
|
165
170
|
content: "";
|
|
166
171
|
}
|
|
@@ -204,83 +209,88 @@
|
|
|
204
209
|
}
|
|
205
210
|
}
|
|
206
211
|
|
|
207
|
-
|
|
208
|
-
|
|
212
|
+
.@{ant-prefix}-table-cell {
|
|
213
|
+
.@{ant-prefix}-form-item {
|
|
209
214
|
margin-bottom: 0px !important;
|
|
210
215
|
}
|
|
211
216
|
}
|
|
212
217
|
|
|
213
|
-
|
|
218
|
+
.@{ant-prefix}-table.@{ant-prefix}-table-bordered>.@{ant-prefix}-table-container {
|
|
214
219
|
border: 0;
|
|
215
220
|
}
|
|
216
221
|
|
|
217
|
-
|
|
222
|
+
.@{ant-prefix}-table-thead>tr>th {
|
|
218
223
|
border : 0;
|
|
219
224
|
white-space : nowrap;
|
|
220
225
|
background-color: var(--zaui-table-header-bg, #f2f3f5);
|
|
221
226
|
}
|
|
222
227
|
|
|
223
|
-
|
|
228
|
+
.@{ant-prefix}-table-thead>tr>th:not(:last-child):not(.@{ant-prefix}-table-selection-column):not(.@{ant-prefix}-table-row-expand-icon-cell):not([colspan])::before {
|
|
224
229
|
height: 0;
|
|
225
230
|
}
|
|
226
231
|
|
|
227
|
-
|
|
232
|
+
.@{ant-prefix}-table-tbody>tr:not(.@{ant-prefix}-table-placeholder)>td {
|
|
228
233
|
border-bottom: 0;
|
|
229
234
|
border-right : 0;
|
|
230
235
|
border-top : 0;
|
|
231
236
|
}
|
|
232
237
|
|
|
233
|
-
|
|
238
|
+
.@{ant-prefix}-table-tbody>.is-editing:not(.@{ant-prefix}-table-measure-row)>td {
|
|
234
239
|
border-bottom : 0;
|
|
235
240
|
vertical-align: top;
|
|
236
241
|
}
|
|
237
242
|
|
|
238
|
-
|
|
243
|
+
.@{ant-prefix}-table-tbody tr:nth-child(n)>td {
|
|
239
244
|
background-color: var(--zaui-base-bg, #ffffff);
|
|
240
245
|
}
|
|
241
246
|
|
|
242
|
-
|
|
247
|
+
.@{ant-prefix}-table-tbody tr:nth-child(2n)>td {
|
|
243
248
|
background-color: var(--zaui-table-strip-bg, #FAFAFA);
|
|
244
249
|
}
|
|
245
250
|
|
|
246
|
-
|
|
251
|
+
.@{ant-prefix}-table-tbody>.@{ant-prefix}-table-placeholder>td {
|
|
247
252
|
background-color: var(--zaui-base-bg, #ffffff);
|
|
248
253
|
}
|
|
249
254
|
|
|
250
|
-
|
|
255
|
+
.@{ant-prefix}-table-tbody {
|
|
251
256
|
|
|
252
|
-
>tr:hover:not(
|
|
253
|
-
|
|
254
|
-
|
|
257
|
+
>tr:hover:not(.@{ant-prefix}-table-expanded-row)>td,
|
|
258
|
+
.@{ant-prefix}-table-row-hover,
|
|
259
|
+
.@{ant-prefix}-table-row-hover>td {
|
|
260
|
+
background: #FAFAFA;
|
|
261
|
+
}
|
|
262
|
+
>tr:hover:not(.@{ant-prefix}-table-placeholder)>td,
|
|
263
|
+
.@{ant-prefix}-table-row-hover,
|
|
264
|
+
.@{ant-prefix}-table-row-hover>td {
|
|
255
265
|
background: #FAFAFA;
|
|
256
266
|
}
|
|
257
267
|
}
|
|
258
268
|
|
|
259
|
-
|
|
269
|
+
.@{ant-prefix}-table-fixed {
|
|
260
270
|
|
|
261
|
-
|
|
262
|
-
|
|
271
|
+
.@{ant-prefix}-table-row-hover,
|
|
272
|
+
.@{ant-prefix}-table-row-hover>td {
|
|
263
273
|
background: #FAFAFA;
|
|
264
274
|
}
|
|
265
275
|
}
|
|
266
276
|
|
|
267
|
-
|
|
268
|
-
|
|
277
|
+
.@{ant-prefix}-table-fixed-header {
|
|
278
|
+
.@{ant-prefix}-table-tbody tr:nth-child(n)>td {
|
|
269
279
|
background-color: #FAFAFA;
|
|
270
280
|
}
|
|
271
281
|
|
|
272
|
-
|
|
282
|
+
.@{ant-prefix}-table-tbody tr:nth-child(2n)>td {
|
|
273
283
|
background-color: var(--zaui-base-bg, #ffffff);
|
|
274
284
|
}
|
|
275
285
|
}
|
|
276
286
|
|
|
277
|
-
|
|
287
|
+
.@{ant-prefix}-table-summary>tr>td {
|
|
278
288
|
border-bottom: none;
|
|
279
289
|
}
|
|
280
290
|
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
291
|
+
.@{ant-prefix}-table-pagination {
|
|
292
|
+
.@{ant-prefix}-pagination-options {
|
|
293
|
+
.@{ant-prefix}-select.@{ant-prefix}-select-in-form-item {
|
|
284
294
|
width: auto;
|
|
285
295
|
}
|
|
286
296
|
}
|
|
@@ -299,11 +309,11 @@
|
|
|
299
309
|
|
|
300
310
|
.pro-edit-table-toolbar {
|
|
301
311
|
margin-top: var(--zaui-space-size-md, 16px);
|
|
302
|
-
|
|
312
|
+
.@{ant-prefix}-space {
|
|
303
313
|
gap: var(--zaui-space-size-sm, 8px);
|
|
304
314
|
|
|
305
|
-
|
|
306
|
-
|
|
315
|
+
.@{ant-prefix}-space-item {
|
|
316
|
+
.@{ant-prefix}-btn-link {
|
|
307
317
|
display: flex;
|
|
308
318
|
align-items: center;
|
|
309
319
|
padding: 0 var(--zaui-space-size-xs, 4px);
|
|
@@ -321,7 +331,7 @@
|
|
|
321
331
|
}
|
|
322
332
|
|
|
323
333
|
.pro-edit-table-drag {
|
|
324
|
-
table tr th
|
|
334
|
+
table tr th.@{ant-prefix}-table-selection-column.@{ant-prefix}-table-cell-fix-left{
|
|
325
335
|
text-align: right;
|
|
326
336
|
}
|
|
327
337
|
}
|
|
@@ -20,6 +20,6 @@ export declare const actions: {
|
|
|
20
20
|
save: ({ record, editingKeys, setState, form, rowName, virtualRowName, result }: any) => Promise<void>;
|
|
21
21
|
cancel: ({ name, record, editingKeys, setState, form, virtualRowName, virtualKey }: any) => void;
|
|
22
22
|
delete: ({ name, record, editingKeys, setState, form, virtualKey, onlyOneLineMsg }: any) => boolean;
|
|
23
|
-
add: ({ result, insertType, editingKeys, setState, form, name, virtualName, virtualKey, onlyOneLineMsg, tableRef, }: any) => Promise<boolean>;
|
|
23
|
+
add: ({ result, insertType, editingKeys, setState, form, name, virtualName, virtualKey, onlyOneLineMsg, tableRef, prefixCls, }: any) => Promise<boolean>;
|
|
24
24
|
mulDelete: ({ form, name, virtualKey, setState, selectedRowKeys, editingKeys }: any) => void;
|
|
25
25
|
};
|
|
@@ -168,11 +168,11 @@ export var actions = {
|
|
|
168
168
|
add: function () {
|
|
169
169
|
var _add = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref5) {
|
|
170
170
|
var _tableRef$current$que, _tableRef$current$que2;
|
|
171
|
-
var result, insertType, editingKeys, setState, form, name, virtualName, virtualKey, onlyOneLineMsg, tableRef, nextData, rowKey, addData, nextEditingKeys;
|
|
171
|
+
var result, insertType, editingKeys, setState, form, name, virtualName, virtualKey, onlyOneLineMsg, tableRef, _ref5$prefixCls, prefixCls, nextData, rowKey, addData, nextEditingKeys;
|
|
172
172
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
173
173
|
while (1) switch (_context2.prev = _context2.next) {
|
|
174
174
|
case 0:
|
|
175
|
-
result = _ref5.result, insertType = _ref5.insertType, editingKeys = _ref5.editingKeys, setState = _ref5.setState, form = _ref5.form, name = _ref5.name, virtualName = _ref5.virtualName, virtualKey = _ref5.virtualKey, onlyOneLineMsg = _ref5.onlyOneLineMsg, tableRef = _ref5.tableRef;
|
|
175
|
+
result = _ref5.result, insertType = _ref5.insertType, editingKeys = _ref5.editingKeys, setState = _ref5.setState, form = _ref5.form, name = _ref5.name, virtualName = _ref5.virtualName, virtualKey = _ref5.virtualKey, onlyOneLineMsg = _ref5.onlyOneLineMsg, tableRef = _ref5.tableRef, _ref5$prefixCls = _ref5.prefixCls, prefixCls = _ref5$prefixCls === void 0 ? 'ant' : _ref5$prefixCls;
|
|
176
176
|
nextData = _toConsumableArray(form.getFieldValue(name) || []); // 单行编辑时,需要先保存,才能进行下面的编辑
|
|
177
177
|
if (!(virtualKey && editingKeys.length >= 1)) {
|
|
178
178
|
_context2.next = 5;
|
|
@@ -191,7 +191,7 @@ export var actions = {
|
|
|
191
191
|
}
|
|
192
192
|
insertType === 'before' ? nextData.unshift(addData) : nextData.push(addData);
|
|
193
193
|
form.setFieldValue(name, nextData);
|
|
194
|
-
(_tableRef$current$que = tableRef.current.querySelector(
|
|
194
|
+
(_tableRef$current$que = tableRef.current.querySelector(".".concat(prefixCls, "-table-body"))) === null || _tableRef$current$que === void 0 ? void 0 : (_tableRef$current$que2 = _tableRef$current$que.scrollTo) === null || _tableRef$current$que2 === void 0 ? void 0 : _tableRef$current$que2.call(_tableRef$current$que, {
|
|
195
195
|
top: 10000,
|
|
196
196
|
behavior: 'smooth'
|
|
197
197
|
});
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { DatePickerProps, TimePickerProps } from 'antd';
|
|
2
|
-
import {
|
|
2
|
+
import { Dayjs } from 'dayjs';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { PickerPanelDateProps } from 'antd/lib/calendar/generateCalendar';
|
|
5
5
|
export type Props = DatePickerProps & TimePickerProps & {
|
|
6
6
|
isView?: boolean;
|
|
7
7
|
viewEmpty?: React.ReactNode;
|
|
8
8
|
format?: string;
|
|
9
|
-
showTime?: PickerPanelDateProps<
|
|
9
|
+
showTime?: PickerPanelDateProps<Dayjs>['showTime'];
|
|
10
10
|
showNow?: boolean;
|
|
11
11
|
};
|
|
12
12
|
declare const DatePicker: React.FC<Props>;
|
|
@@ -7,7 +7,7 @@ var _excluded = ["className", "format"];
|
|
|
7
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
8
|
import { isFunction, isString } from 'lodash';
|
|
9
9
|
import classNames from 'classnames';
|
|
10
|
-
import
|
|
10
|
+
import dayjs from 'dayjs';
|
|
11
11
|
import { useProConfig } from '../../../../ProConfigProvider';
|
|
12
12
|
import ProForm from '../../../../ProForm';
|
|
13
13
|
import Container from '../../Container';
|
|
@@ -30,12 +30,12 @@ var DatePicker = function DatePicker(props) {
|
|
|
30
30
|
var viewChildren = null;
|
|
31
31
|
if (!value) {
|
|
32
32
|
viewChildren = null;
|
|
33
|
-
} else if (typeof format === 'string' &&
|
|
33
|
+
} else if (typeof format === 'string' && dayjs.isDayjs(value)) {
|
|
34
34
|
viewChildren = value.format(format);
|
|
35
35
|
} else if (isFunction(format)) {
|
|
36
36
|
viewChildren = format(value);
|
|
37
37
|
} else if (isString(value)) {
|
|
38
|
-
viewChildren =
|
|
38
|
+
viewChildren = dayjs(value).format(format);
|
|
39
39
|
}
|
|
40
40
|
return _jsx(Container, {
|
|
41
41
|
viewEmpty: viewEmpty,
|
|
@@ -46,16 +46,13 @@ var DatePicker = function DatePicker(props) {
|
|
|
46
46
|
var _rest = _objectSpread(_objectSpread({}, rest), {}, {
|
|
47
47
|
showTime: rest.showTime === undefined && valueType === 'dateTime' || rest.showTime
|
|
48
48
|
});
|
|
49
|
-
if (_rest === null || _rest === void 0 ? void 0 : _rest.placeholder) {
|
|
50
|
-
_rest === null || _rest === void 0 ? true : delete _rest.placeholder;
|
|
51
|
-
}
|
|
52
49
|
// 字符串时间格式兼容
|
|
53
50
|
if (isString(_rest.value)) {
|
|
54
|
-
_rest.value =
|
|
51
|
+
_rest.value = dayjs(_rest.value);
|
|
55
52
|
}
|
|
56
53
|
if (['dateStartTime', 'dateEndTime'].includes(valueType) && rest.showTime === undefined) {
|
|
57
54
|
_rest.showTime = {
|
|
58
|
-
value:
|
|
55
|
+
value: dayjs(valueType === 'dateStartTime' ? '00:00:00' : '23:59:59', 'HH:mm:ss'),
|
|
59
56
|
disabled: true
|
|
60
57
|
};
|
|
61
58
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import type { RangePickerProps } from 'antd/es/date-picker';
|
|
2
1
|
import React from 'react';
|
|
2
|
+
import { Dayjs } from 'dayjs';
|
|
3
|
+
import { RangePickerProps } from 'antd/lib/date-picker/generatePicker';
|
|
3
4
|
import { ProFormOtherProps } from '../../../propsType';
|
|
4
5
|
export type Props = {
|
|
5
6
|
otherProps?: ProFormOtherProps;
|
|
6
7
|
separator?: any;
|
|
7
8
|
showTime?: any;
|
|
8
9
|
isView?: boolean;
|
|
9
|
-
} & Omit<RangePickerProps
|
|
10
|
+
} & Omit<RangePickerProps<Dayjs>, 'separator'>;
|
|
10
11
|
declare const RangePicker: React.FC<Props>;
|
|
11
12
|
export default RangePicker;
|
|
@@ -4,10 +4,8 @@ import "antd/es/date-picker/style";
|
|
|
4
4
|
import _DatePicker from "antd/es/date-picker";
|
|
5
5
|
var _excluded = ["format", "otherProps", "separator"];
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
// @ts-check
|
|
8
|
-
|
|
9
7
|
import { isFunction, isString, omit } from 'lodash';
|
|
10
|
-
import
|
|
8
|
+
import dayjs from 'dayjs';
|
|
11
9
|
import { useProConfig } from '../../../../ProConfigProvider';
|
|
12
10
|
import ProForm from '../../../../ProForm';
|
|
13
11
|
import Container from '../../Container';
|
|
@@ -52,9 +50,9 @@ var RangePicker = function RangePicker(props) {
|
|
|
52
50
|
var _res = _objectSpread(_objectSpread({}, rest), {}, {
|
|
53
51
|
showTime: !rest.showTime && valueType === 'dateTime' || rest.showTime
|
|
54
52
|
});
|
|
55
|
-
// 字符串时间格式兼容
|
|
53
|
+
// // 字符串时间格式兼容
|
|
56
54
|
if (Array.isArray(_res.value) && isString(_res.value[0]) && isString(_res.value[1])) {
|
|
57
|
-
_res.value = [
|
|
55
|
+
_res.value = [dayjs(_res.value[0]), dayjs(_res.value[1])];
|
|
58
56
|
}
|
|
59
57
|
return _jsx(AntRangePicker, _objectSpread(_objectSpread({}, initialConfig), omit(_res, ['separator'])));
|
|
60
58
|
};
|
|
@@ -4,7 +4,7 @@ import _TimePicker from "antd/es/time-picker";
|
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
5
|
var _excluded = ["format", "onChange", "value", "otherProps"];
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
import
|
|
7
|
+
import dayjs from 'dayjs';
|
|
8
8
|
import { useProConfig } from '../../../../ProConfigProvider';
|
|
9
9
|
import Container from '../../Container';
|
|
10
10
|
import ProForm from '../../../../ProForm';
|
|
@@ -25,7 +25,7 @@ var TimePicker = function TimePicker(props) {
|
|
|
25
25
|
var initialConfig = useProConfig('AntTimePicker');
|
|
26
26
|
var handleChange = function handleChange(value) {
|
|
27
27
|
if (valueType === 'dateTime') {
|
|
28
|
-
onChange && onChange(value ?
|
|
28
|
+
onChange && onChange(value ? dayjs(value).format(format) : undefined);
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
if (isView) {
|
|
@@ -35,7 +35,7 @@ var TimePicker = function TimePicker(props) {
|
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
37
|
return _jsx(_TimePicker, _objectSpread(_objectSpread(_objectSpread({
|
|
38
|
-
value: value ?
|
|
38
|
+
value: value ? dayjs(value, format) : undefined
|
|
39
39
|
}, initialConfig), rest), {}, {
|
|
40
40
|
format: format,
|
|
41
41
|
onChange: handleChange
|