@zat-design/sisyphus-react 3.9.0-beta.9 → 3.9.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 +26 -16
- package/dist/less.esm.css +22 -14
- package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +7 -3
- package/es/ProEditTable/components/RenderField/index.js +3 -2
- package/es/ProEditTable/index.js +23 -16
- package/es/ProEditTable/style/index.less +14 -2
- package/es/ProEnum/index.js +5 -3
- package/es/ProEnum/propsType.d.ts +1 -0
- package/es/ProForm/components/base/SwitchCheckbox/index.js +9 -2
- package/es/ProForm/components/combination/Group/component/ComRender.d.ts +1 -0
- package/es/ProForm/components/combination/Group/component/ComRender.js +12 -1
- package/es/ProForm/components/combination/ProModalSelect/index.js +28 -28
- package/es/ProForm/components/render/ChangedWrapper.js +1 -1
- package/es/ProForm/components/render/RenderFields.js +3 -2
- package/es/ProForm/components/render/propsType.d.ts +1 -0
- package/es/ProForm/style/index.less +10 -6
- package/es/ProForm/utils/diffOriginal.js +18 -12
- package/es/ProTable/components/FormatColumn/index.d.ts +4 -2
- package/es/ProTable/components/FormatColumn/index.js +54 -33
- package/es/ProTable/components/RenderColumn/index.d.ts +1 -2
- package/es/ProTable/components/RenderColumn/index.js +16 -12
- package/es/ProTable/components/TableResizable/index.js +1 -5
- package/es/ProTable/index.js +0 -1
- package/es/ProTable/propsType.d.ts +1 -2
- package/es/ProTable/utils/index.d.ts +5 -2
- package/es/ProTable/utils/index.js +13 -4
- package/es/style/theme/antd.less +4 -2
- package/es/utils/index.d.ts +1 -1
- package/es/utils/index.js +4 -1
- package/lib/ProEditTable/components/RenderField/ListChangedWrapper.js +5 -1
- package/lib/ProEditTable/components/RenderField/index.js +3 -2
- package/lib/ProEditTable/index.js +23 -16
- package/lib/ProEditTable/style/index.less +14 -2
- package/lib/ProEnum/index.js +5 -3
- package/lib/ProEnum/propsType.d.ts +1 -0
- package/lib/ProForm/components/base/SwitchCheckbox/index.js +9 -2
- package/lib/ProForm/components/combination/Group/component/ComRender.d.ts +1 -0
- package/lib/ProForm/components/combination/Group/component/ComRender.js +12 -1
- package/lib/ProForm/components/combination/ProModalSelect/index.js +27 -27
- package/lib/ProForm/components/render/ChangedWrapper.js +1 -1
- package/lib/ProForm/components/render/RenderFields.js +3 -2
- package/lib/ProForm/components/render/propsType.d.ts +1 -0
- package/lib/ProForm/style/index.less +10 -6
- package/lib/ProForm/utils/diffOriginal.js +18 -12
- package/lib/ProTable/components/FormatColumn/index.d.ts +4 -2
- package/lib/ProTable/components/FormatColumn/index.js +53 -32
- package/lib/ProTable/components/RenderColumn/index.d.ts +1 -2
- package/lib/ProTable/components/RenderColumn/index.js +16 -12
- package/lib/ProTable/components/TableResizable/index.js +0 -4
- package/lib/ProTable/index.js +0 -1
- package/lib/ProTable/propsType.d.ts +1 -2
- package/lib/ProTable/utils/index.d.ts +5 -2
- package/lib/ProTable/utils/index.js +13 -4
- package/lib/style/theme/antd.less +4 -2
- package/lib/utils/index.d.ts +1 -1
- package/lib/utils/index.js +4 -1
- package/package.json +1 -1
package/dist/index.esm.css
CHANGED
@@ -3097,7 +3097,8 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
3097
3097
|
.pro-form .pro-form-item-changed .ant-form-item-control-input-content > .ant-input-group .forever-checkbox {
|
3098
3098
|
background: var(--zaui-contract-bg, #fffaa1);
|
3099
3099
|
}
|
3100
|
-
.pro-form .pro-form-item-changed .ant-checkbox-group
|
3100
|
+
.pro-form .pro-form-item-changed .ant-checkbox-group,
|
3101
|
+
.pro-form .pro-form-item-changed .pro-switch-checkbox {
|
3101
3102
|
padding: 5px 0;
|
3102
3103
|
}
|
3103
3104
|
.pro-form .pro-form-item-changed:has(.ant-switch) {
|
@@ -3116,7 +3117,7 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
3116
3117
|
background: var(--zaui-contract-bg-add, #d2fff4) !important;
|
3117
3118
|
}
|
3118
3119
|
.pro-form .pro-form-item-add .ant-input {
|
3119
|
-
background: var(--zaui-contract-bg, #
|
3120
|
+
background: var(--zaui-contract-bg-add, #d2fff4) !important;
|
3120
3121
|
}
|
3121
3122
|
.pro-form .pro-form-item-add .ant-select.ant-select-disabled .ant-select-selector {
|
3122
3123
|
background: var(--zaui-contract-bg-add, #d2fff4) !important;
|
@@ -3157,7 +3158,8 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
3157
3158
|
.pro-form .pro-form-item-add .ant-form-item-control-input-content > .ant-input-group .forever-checkbox {
|
3158
3159
|
background: var(--zaui-contract-bg-add, #d2fff4);
|
3159
3160
|
}
|
3160
|
-
.pro-form .pro-form-item-add .ant-checkbox-group
|
3161
|
+
.pro-form .pro-form-item-add .ant-checkbox-group,
|
3162
|
+
.pro-form .pro-form-item-add .pro-switch-checkbox {
|
3161
3163
|
padding: 5px 0;
|
3162
3164
|
}
|
3163
3165
|
.pro-form .pro-form-item-add:has(.ant-switch) {
|
@@ -3171,25 +3173,26 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
3171
3173
|
background: var(--zaui-contract-bg-add, #d2fff4);
|
3172
3174
|
border-radius: 4px;
|
3173
3175
|
}
|
3174
|
-
.original-value-
|
3175
|
-
max-width: 100%;
|
3176
|
+
.original-value-tooltip {
|
3176
3177
|
width: -webkit-max-content;
|
3177
3178
|
width: -moz-max-content;
|
3178
3179
|
width: max-content;
|
3179
|
-
position: fixed;
|
3180
3180
|
}
|
3181
|
-
.original-value-
|
3181
|
+
.original-value-tooltip .changed-tooltip .original-value-container .ant-space-item:nth-child(1) {
|
3182
3182
|
white-space: nowrap;
|
3183
3183
|
}
|
3184
|
-
.original-value-
|
3184
|
+
.original-value-tooltip .changed-tooltip .original-value-container .pro-group .ant-space-compact {
|
3185
3185
|
display: block;
|
3186
3186
|
}
|
3187
|
-
.original-value-
|
3187
|
+
.original-value-tooltip .changed-tooltip .original-value-container .pro-group .pro-form-view-container {
|
3188
3188
|
word-break: keep-all;
|
3189
3189
|
}
|
3190
|
-
.original-value-
|
3190
|
+
.original-value-tooltip .changed-tooltip .current-value-container .ant-space-item:nth-child(1) {
|
3191
3191
|
white-space: nowrap;
|
3192
3192
|
}
|
3193
|
+
.original-value-tooltip-fixed {
|
3194
|
+
position: fixed;
|
3195
|
+
}
|
3193
3196
|
.pro-upload .pro-upload-dragger .pro-upload-handle-box {
|
3194
3197
|
padding: var(--zaui-space-size-sm, 8px);
|
3195
3198
|
background: #f8f9fa;
|
@@ -4406,6 +4409,10 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
4406
4409
|
.pro-edit-table td[rowspan] {
|
4407
4410
|
vertical-align: middle !important;
|
4408
4411
|
}
|
4412
|
+
.pro-edit-table .ant-table-content .ant-table-tbody .pro-form-item-add .pro-form-view-container {
|
4413
|
+
padding: 0;
|
4414
|
+
border-radius: 0;
|
4415
|
+
}
|
4409
4416
|
.pro-edit-table .pro-edit-table-tooltip {
|
4410
4417
|
display: -webkit-inline-box;
|
4411
4418
|
display: -webkit-inline-flex;
|
@@ -4610,10 +4617,11 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
4610
4617
|
.pro-edit-table .ant-table-pagination .ant-pagination-options .ant-select.ant-select-in-form-item {
|
4611
4618
|
width: auto;
|
4612
4619
|
}
|
4613
|
-
.pro-edit-table .is-new-row td
|
4614
|
-
|
4615
|
-
|
4616
|
-
.pro-edit-table .
|
4620
|
+
.pro-edit-table .ant-table .ant-table-tbody .is-new-row.ant-table-row td {
|
4621
|
+
background: var(--zaui-contract-bg-add, #d2fff4) !important;
|
4622
|
+
}
|
4623
|
+
.pro-edit-table .ant-table .ant-table-tbody .is-new-row.ant-table-row:hover td,
|
4624
|
+
.pro-edit-table .ant-table .ant-table-tbody .is-new-row.ant-table-row:hover .ant-table-cell-row-hover {
|
4617
4625
|
background: var(--zaui-contract-bg-add, #d2fff4) !important;
|
4618
4626
|
}
|
4619
4627
|
.pro-edit-table-footer {
|
@@ -5627,8 +5635,10 @@ input[type='button'] {
|
|
5627
5635
|
.ant-table.ant-table-scroll-horizontal table .ant-table-tbody tr td {
|
5628
5636
|
border-bottom: none;
|
5629
5637
|
}
|
5630
|
-
.ant-table.ant-table-scroll-horizontal table .ant-table-tbody .ant-table-row:nth-child(even):hover td
|
5631
|
-
|
5638
|
+
.ant-table.ant-table-scroll-horizontal table .ant-table-tbody .ant-table-row:nth-child(even):hover td,
|
5639
|
+
.ant-table.ant-table-scroll-horizontal table .ant-table-tbody .ant-table-row:nth-child(even):hover td.ant-table-cell-fix-right,
|
5640
|
+
.ant-table.ant-table-scroll-horizontal table .ant-table-tbody .ant-table-row:nth-child(even):hover td.ant-table-cell-fix-left {
|
5641
|
+
background-color: var(--zaui-table-hover-bg, #fafafa) !important;
|
5632
5642
|
}
|
5633
5643
|
.ant-table.ant-table-scroll-horizontal table .ant-table-tbody .ant-table-row:nth-child(even) td,
|
5634
5644
|
.ant-table.ant-table-scroll-horizontal table .ant-table-tbody .ant-table-row:nth-child(even) td.ant-table-cell-fix-right,
|
package/dist/less.esm.css
CHANGED
@@ -3097,7 +3097,8 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
3097
3097
|
.pro-form .pro-form-item-changed .ant-form-item-control-input-content > .ant-input-group .forever-checkbox {
|
3098
3098
|
background: var(--zaui-contract-bg, #fffaa1);
|
3099
3099
|
}
|
3100
|
-
.pro-form .pro-form-item-changed .ant-checkbox-group
|
3100
|
+
.pro-form .pro-form-item-changed .ant-checkbox-group,
|
3101
|
+
.pro-form .pro-form-item-changed .pro-switch-checkbox {
|
3101
3102
|
padding: 5px 0;
|
3102
3103
|
}
|
3103
3104
|
.pro-form .pro-form-item-changed:has(.ant-switch) {
|
@@ -3116,7 +3117,7 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
3116
3117
|
background: var(--zaui-contract-bg-add, #d2fff4) !important;
|
3117
3118
|
}
|
3118
3119
|
.pro-form .pro-form-item-add .ant-input {
|
3119
|
-
background: var(--zaui-contract-bg, #
|
3120
|
+
background: var(--zaui-contract-bg-add, #d2fff4) !important;
|
3120
3121
|
}
|
3121
3122
|
.pro-form .pro-form-item-add .ant-select.ant-select-disabled .ant-select-selector {
|
3122
3123
|
background: var(--zaui-contract-bg-add, #d2fff4) !important;
|
@@ -3157,7 +3158,8 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
3157
3158
|
.pro-form .pro-form-item-add .ant-form-item-control-input-content > .ant-input-group .forever-checkbox {
|
3158
3159
|
background: var(--zaui-contract-bg-add, #d2fff4);
|
3159
3160
|
}
|
3160
|
-
.pro-form .pro-form-item-add .ant-checkbox-group
|
3161
|
+
.pro-form .pro-form-item-add .ant-checkbox-group,
|
3162
|
+
.pro-form .pro-form-item-add .pro-switch-checkbox {
|
3161
3163
|
padding: 5px 0;
|
3162
3164
|
}
|
3163
3165
|
.pro-form .pro-form-item-add:has(.ant-switch) {
|
@@ -3171,25 +3173,26 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
3171
3173
|
background: var(--zaui-contract-bg-add, #d2fff4);
|
3172
3174
|
border-radius: 4px;
|
3173
3175
|
}
|
3174
|
-
.original-value-
|
3175
|
-
max-width: 100%;
|
3176
|
+
.original-value-tooltip {
|
3176
3177
|
width: -webkit-max-content;
|
3177
3178
|
width: -moz-max-content;
|
3178
3179
|
width: max-content;
|
3179
|
-
position: fixed;
|
3180
3180
|
}
|
3181
|
-
.original-value-
|
3181
|
+
.original-value-tooltip .changed-tooltip .original-value-container .ant-space-item:nth-child(1) {
|
3182
3182
|
white-space: nowrap;
|
3183
3183
|
}
|
3184
|
-
.original-value-
|
3184
|
+
.original-value-tooltip .changed-tooltip .original-value-container .pro-group .ant-space-compact {
|
3185
3185
|
display: block;
|
3186
3186
|
}
|
3187
|
-
.original-value-
|
3187
|
+
.original-value-tooltip .changed-tooltip .original-value-container .pro-group .pro-form-view-container {
|
3188
3188
|
word-break: keep-all;
|
3189
3189
|
}
|
3190
|
-
.original-value-
|
3190
|
+
.original-value-tooltip .changed-tooltip .current-value-container .ant-space-item:nth-child(1) {
|
3191
3191
|
white-space: nowrap;
|
3192
3192
|
}
|
3193
|
+
.original-value-tooltip-fixed {
|
3194
|
+
position: fixed;
|
3195
|
+
}
|
3193
3196
|
.pro-upload .pro-upload-dragger .pro-upload-handle-box {
|
3194
3197
|
padding: var(--zaui-space-size-sm, 8px);
|
3195
3198
|
background: #f8f9fa;
|
@@ -4406,6 +4409,10 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
4406
4409
|
.pro-edit-table td[rowspan] {
|
4407
4410
|
vertical-align: middle !important;
|
4408
4411
|
}
|
4412
|
+
.pro-edit-table .ant-table-content .ant-table-tbody .pro-form-item-add .pro-form-view-container {
|
4413
|
+
padding: 0;
|
4414
|
+
border-radius: 0;
|
4415
|
+
}
|
4409
4416
|
.pro-edit-table .pro-edit-table-tooltip {
|
4410
4417
|
display: -webkit-inline-box;
|
4411
4418
|
display: -webkit-inline-flex;
|
@@ -4610,10 +4617,11 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
4610
4617
|
.pro-edit-table .ant-table-pagination .ant-pagination-options .ant-select.ant-select-in-form-item {
|
4611
4618
|
width: auto;
|
4612
4619
|
}
|
4613
|
-
.pro-edit-table .is-new-row td
|
4614
|
-
|
4615
|
-
|
4616
|
-
.pro-edit-table .
|
4620
|
+
.pro-edit-table .ant-table .ant-table-tbody .is-new-row.ant-table-row td {
|
4621
|
+
background: var(--zaui-contract-bg-add, #d2fff4) !important;
|
4622
|
+
}
|
4623
|
+
.pro-edit-table .ant-table .ant-table-tbody .is-new-row.ant-table-row:hover td,
|
4624
|
+
.pro-edit-table .ant-table .ant-table-tbody .is-new-row.ant-table-row:hover .ant-table-cell-row-hover {
|
4617
4625
|
background: var(--zaui-contract-bg-add, #d2fff4) !important;
|
4618
4626
|
}
|
4619
4627
|
.pro-edit-table-footer {
|
@@ -8,7 +8,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
|
|
8
8
|
var _excluded = ["name", "names", "namesStr", "originalName", "originalNames", "originalValues", "form", "equalWith", "rowKeyPath", "children", "type", "normalize", "getValueProps", "valuePropName", "viewRender", "diffConfig", "index"];
|
9
9
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
10
10
|
import React, { useMemo, useRef } from 'react';
|
11
|
-
import
|
11
|
+
import classnames from 'classnames';
|
12
12
|
import { get } from 'lodash';
|
13
13
|
import { diffOriginal } from '../../../ProForm/utils/diffOriginal';
|
14
14
|
import { useProConfig } from '../../../ProConfigProvider';
|
@@ -162,7 +162,11 @@ var ListChangedWrapper = function ListChangedWrapper(props) {
|
|
162
162
|
};
|
163
163
|
// @ts-ignore
|
164
164
|
var _showEllipse = ((_children$props = children.props) === null || _children$props === void 0 ? void 0 : _children$props.showEllipse) || ((_children$props2 = children.props) === null || _children$props2 === void 0 ? void 0 : _children$props2.tooltip);
|
165
|
-
var
|
165
|
+
var classNames = classnames({
|
166
|
+
'original-value-tooltip': true,
|
167
|
+
'original-value-tooltip-fixed': true
|
168
|
+
});
|
169
|
+
var diffClassName = classnames({
|
166
170
|
'pro-form-item-changed': isChanged,
|
167
171
|
'pro-form-item-add': isAdd
|
168
172
|
});
|
@@ -172,7 +176,7 @@ var ListChangedWrapper = function ListChangedWrapper(props) {
|
|
172
176
|
getPopupContainer: function getPopupContainer(trigger) {
|
173
177
|
return scrollFollowParent ? trigger.parentElement : document.body;
|
174
178
|
},
|
175
|
-
overlayClassName:
|
179
|
+
overlayClassName: classNames,
|
176
180
|
placement: "topLeft",
|
177
181
|
autoAdjustOverflow: false,
|
178
182
|
title: _jsxs(_Space, {
|
@@ -6,7 +6,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
6
6
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
7
7
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
8
8
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
9
|
-
var _excluded = ["type", "valueType", "names", "fieldProps", "labelRequired", "editRender", "component", "viewRender", "title", "originTitle", "label", "dataIndex", "formItemProps", "isEditable", "required", "rules", "equalWith", "className", "trim", "confirm"];
|
9
|
+
var _excluded = ["type", "valueType", "names", "fieldProps", "labelRequired", "editRender", "component", "viewRender", "title", "originTitle", "label", "dataIndex", "formItemProps", "isEditable", "required", "rules", "equalWith", "onDiff", "className", "trim", "confirm"];
|
10
10
|
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
11
11
|
/* eslint-disable prefer-destructuring */
|
12
12
|
/* eslint-disable prefer-const */
|
@@ -53,6 +53,7 @@ var RenderField = function RenderField(_ref) {
|
|
53
53
|
_column$rules = column.rules,
|
54
54
|
rules = _column$rules === void 0 ? [] : _column$rules,
|
55
55
|
equalWith = column.equalWith,
|
56
|
+
onDiff = column.onDiff,
|
56
57
|
className = column.className,
|
57
58
|
trim = column.trim,
|
58
59
|
confirm = column.confirm,
|
@@ -555,7 +556,7 @@ var RenderField = function RenderField(_ref) {
|
|
555
556
|
originalNames: originalNames,
|
556
557
|
originalValues: originalValues,
|
557
558
|
form: form,
|
558
|
-
equalWith: equalWith,
|
559
|
+
equalWith: onDiff || equalWith,
|
559
560
|
type: type,
|
560
561
|
onChange: _onChange,
|
561
562
|
valuePropName: _formItemProps.valuePropName,
|
package/es/ProEditTable/index.js
CHANGED
@@ -2,6 +2,7 @@ import "antd/es/affix/style";
|
|
2
2
|
import _Affix from "antd/es/affix";
|
3
3
|
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
4
4
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
5
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
5
6
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
6
7
|
import "antd/es/config-provider/style";
|
7
8
|
import _ConfigProvider from "antd/es/config-provider";
|
@@ -9,7 +10,7 @@ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
9
10
|
import "antd/es/form/style";
|
10
11
|
import _Form from "antd/es/form";
|
11
12
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
12
|
-
var _excluded = ["value", "onChange", "onDrag", "className", "columns", "type", "mode", "stripe", "draggable", "virtual", "disabled", "insertType", "emptyBtnText", "actionWidth", "actionProps", "toolbarProps", "toolbarSticky", "rowSelection", "onlyOneLineMsg", "deletePoConfirmMsg", "mulDeletePoConfirmMsg", "requiredAlign", "summary", "max", "headerRender", "pagination", "
|
13
|
+
var _excluded = ["value", "onChange", "onDrag", "className", "columns", "type", "mode", "stripe", "draggable", "virtual", "disabled", "insertType", "emptyBtnText", "actionWidth", "actionProps", "toolbarProps", "toolbarSticky", "rowSelection", "onlyOneLineMsg", "deletePoConfirmMsg", "mulDeletePoConfirmMsg", "requiredAlign", "summary", "max", "headerRender", "pagination", "rowKey", "rowDisabled", "rowDraggable", "footerRender", "scroll", "actionDirection", "diffConfig"];
|
13
14
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
14
15
|
import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef } from 'react';
|
15
16
|
import { get, isArray, isBoolean } from 'lodash';
|
@@ -50,7 +51,6 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
50
51
|
max = _ref.max,
|
51
52
|
headerRender = _ref.headerRender,
|
52
53
|
pagination = _ref.pagination,
|
53
|
-
originalValues = _ref.originalValues,
|
54
54
|
rowKey = _ref.rowKey,
|
55
55
|
rowDisabled = _ref.rowDisabled,
|
56
56
|
rowDraggable = _ref.rowDraggable,
|
@@ -136,6 +136,25 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
136
136
|
return getRowKey(item) === getRowKey(record);
|
137
137
|
}));
|
138
138
|
};
|
139
|
+
var originalValues = useMemo(function () {
|
140
|
+
var _originalArr$every, _originalArr$some;
|
141
|
+
// 原始值也需要设置对应的rowkey,后续比对通过rowkey对比
|
142
|
+
var originalArr = get(resetProps === null || resetProps === void 0 ? void 0 : resetProps.originalValues, name);
|
143
|
+
var isOriginalAllHasKey = originalArr ? originalArr === null || originalArr === void 0 ? void 0 : (_originalArr$every = originalArr.every) === null || _originalArr$every === void 0 ? void 0 : _originalArr$every.call(originalArr, function (item) {
|
144
|
+
return item.rowKey;
|
145
|
+
}) : true;
|
146
|
+
var isNeedCoverOriginal = originalArr === null || originalArr === void 0 ? void 0 : (_originalArr$some = originalArr.some) === null || _originalArr$some === void 0 ? void 0 : _originalArr$some.call(originalArr, function (item) {
|
147
|
+
return item.rowKey !== getRowKey(item);
|
148
|
+
});
|
149
|
+
// 初始化默认生成row-key
|
150
|
+
if ((originalArr === null || originalArr === void 0 ? void 0 : originalArr.length) && (!isOriginalAllHasKey || isNeedCoverOriginal)) {
|
151
|
+
var _originalArr$forEach;
|
152
|
+
originalArr === null || originalArr === void 0 ? void 0 : (_originalArr$forEach = originalArr.forEach) === null || _originalArr$forEach === void 0 ? void 0 : _originalArr$forEach.call(originalArr, function (item) {
|
153
|
+
item.rowKey = getRowKey(item);
|
154
|
+
});
|
155
|
+
}
|
156
|
+
return (originalArr === null || originalArr === void 0 ? void 0 : originalArr.length) ? _defineProperty({}, name, originalArr) : undefined;
|
157
|
+
}, [resetProps === null || resetProps === void 0 ? void 0 : resetProps.originalValues]);
|
139
158
|
var config = _objectSpread({
|
140
159
|
form: form,
|
141
160
|
mode: mode,
|
@@ -275,33 +294,21 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
275
294
|
return transformColumns(columns, config);
|
276
295
|
}, [valueChangeRef.current, disabled, forceUpdate, columns, page, actionProps, editingKeys, cellNamePath]);
|
277
296
|
var initDataSource = function initDataSource() {
|
278
|
-
var _value$every,
|
297
|
+
var _value$every, _value$some;
|
279
298
|
var isAllHasKey = value === null || value === void 0 ? void 0 : (_value$every = value.every) === null || _value$every === void 0 ? void 0 : _value$every.call(value, function (item) {
|
280
299
|
return item.rowKey;
|
281
300
|
});
|
282
|
-
// 原始值也需要设置对应的rowkey,后续比对通过rowkey对比
|
283
|
-
var originalArr = get(originalValues, name);
|
284
|
-
var isOriginalAllHasKey = originalArr ? originalArr === null || originalArr === void 0 ? void 0 : (_originalArr$every = originalArr.every) === null || _originalArr$every === void 0 ? void 0 : _originalArr$every.call(originalArr, function (item) {
|
285
|
-
return item.rowKey;
|
286
|
-
}) : true;
|
287
301
|
// 检测当前rowkey是否与制定key的值是否一致,不一致,则执行覆盖
|
288
302
|
var isNeedCover = value === null || value === void 0 ? void 0 : (_value$some = value.some) === null || _value$some === void 0 ? void 0 : _value$some.call(value, function (item) {
|
289
303
|
return item.rowKey !== getRowKey(item);
|
290
304
|
});
|
291
|
-
var isNeedCoverOriginal = originalArr === null || originalArr === void 0 ? void 0 : (_originalArr$some = originalArr.some) === null || _originalArr$some === void 0 ? void 0 : _originalArr$some.call(originalArr, function (item) {
|
292
|
-
return item.rowKey !== getRowKey(item);
|
293
|
-
});
|
294
305
|
// 初始化默认生成row-key
|
295
|
-
if ((value === null || value === void 0 ? void 0 : value.length) && (!isAllHasKey || isNeedCover)
|
296
|
-
var _originalArr$forEach;
|
306
|
+
if ((value === null || value === void 0 ? void 0 : value.length) && (!isAllHasKey || isNeedCover)) {
|
297
307
|
var nextValues = value === null || value === void 0 ? void 0 : value.map(function (item) {
|
298
308
|
return _objectSpread(_objectSpread({}, item), {}, {
|
299
309
|
rowKey: getRowKey(item)
|
300
310
|
});
|
301
311
|
});
|
302
|
-
originalArr === null || originalArr === void 0 ? void 0 : (_originalArr$forEach = originalArr.forEach) === null || _originalArr$forEach === void 0 ? void 0 : _originalArr$forEach.call(originalArr, function (item) {
|
303
|
-
item.rowKey = getRowKey(item);
|
304
|
-
});
|
305
312
|
onChange(nextValues);
|
306
313
|
if (virtualKey) {
|
307
314
|
form.setFieldValue(virtualRowName, nextValues);
|
@@ -5,6 +5,15 @@
|
|
5
5
|
td[rowspan]{
|
6
6
|
vertical-align: middle !important;
|
7
7
|
}
|
8
|
+
.@{ant-prefix}-table-content{
|
9
|
+
.@{ant-prefix}-table-tbody{
|
10
|
+
.pro-form-item-add .pro-form-view-container{
|
11
|
+
padding: 0;
|
12
|
+
border-radius: 0;
|
13
|
+
}
|
14
|
+
}
|
15
|
+
}
|
16
|
+
|
8
17
|
|
9
18
|
.pro-edit-table-tooltip {
|
10
19
|
display : inline-flex;
|
@@ -281,8 +290,11 @@
|
|
281
290
|
}
|
282
291
|
}
|
283
292
|
|
284
|
-
|
285
|
-
|
293
|
+
.@{ant-prefix}-table .@{ant-prefix}-table-tbody .is-new-row.@{ant-prefix}-table-row td{
|
294
|
+
background: var(--zaui-contract-bg-add, #d2fff4) !important;
|
295
|
+
}
|
296
|
+
.@{ant-prefix}-table .@{ant-prefix}-table-tbody .is-new-row.@{ant-prefix}-table-row:hover{
|
297
|
+
td, .@{ant-prefix}-table-cell-row-hover {
|
286
298
|
background: var(--zaui-contract-bg-add, #d2fff4) !important;
|
287
299
|
}
|
288
300
|
}
|
package/es/ProEnum/index.js
CHANGED
@@ -44,6 +44,7 @@ var ProEnum = function ProEnum(props) {
|
|
44
44
|
var _ref = otherProps || {},
|
45
45
|
viewEmpty = _ref.viewEmpty;
|
46
46
|
var _isView = isView !== undefined && isView !== null ? isView : otherProps === null || otherProps === void 0 ? void 0 : otherProps.isView;
|
47
|
+
var _defalutValue = props === null || props === void 0 ? void 0 : props.defaultValue;
|
47
48
|
var _ref2 = useProConfig('ProEnum') || {},
|
48
49
|
fieldNames = _ref2.fieldNames,
|
49
50
|
_ref2$clear = _ref2.clear,
|
@@ -273,16 +274,17 @@ var ProEnum = function ProEnum(props) {
|
|
273
274
|
return isFunction(props.optionRender) && record.length ? _optionRender() : labelList === null || labelList === void 0 ? void 0 : labelList.join(',');
|
274
275
|
};
|
275
276
|
if (_isView) {
|
276
|
-
|
277
|
+
var __value = value || _defalutValue;
|
278
|
+
if (Array.isArray(__value)) {
|
277
279
|
return _jsx(Container, {
|
278
280
|
tooltip: true,
|
279
281
|
viewEmpty: viewEmpty,
|
280
|
-
children: transToLabel(
|
282
|
+
children: transToLabel(__value)
|
281
283
|
});
|
282
284
|
}
|
283
285
|
return _jsx(Container, {
|
284
286
|
viewEmpty: viewEmpty,
|
285
|
-
children:
|
287
|
+
children: __value || isNumber(__value) ? transToLabel([__value]) : null
|
286
288
|
});
|
287
289
|
}
|
288
290
|
return _jsx(_Fragment, {
|
@@ -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
|
-
var _excluded = ["onChange", "disabled", "value", "otherProps"];
|
5
|
+
var _excluded = ["onChange", "disabled", "value", "otherProps", "className"];
|
6
6
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
7
7
|
import { isNull, isUndefined } from 'lodash';
|
8
|
+
import classnames from 'classnames';
|
8
9
|
import { useProConfig } from '../../../../ProConfigProvider';
|
9
10
|
import locale from '../../../../locale';
|
10
11
|
import ProForm from '../../../../ProForm';
|
@@ -13,6 +14,7 @@ var SwitchCheckbox = function SwitchCheckbox(props) {
|
|
13
14
|
disabled = props.disabled,
|
14
15
|
value = props.value,
|
15
16
|
otherProps = props.otherProps,
|
17
|
+
className = props.className,
|
16
18
|
restProps = _objectWithoutProperties(props, _excluded);
|
17
19
|
var _ref = ProForm.useFieldProps() || {},
|
18
20
|
isViewCon = _ref.isView,
|
@@ -47,9 +49,14 @@ var SwitchCheckbox = function SwitchCheckbox(props) {
|
|
47
49
|
})]
|
48
50
|
});
|
49
51
|
}
|
52
|
+
var classNames = classnames({
|
53
|
+
'pro-switch-checkbox': true,
|
54
|
+
className: className
|
55
|
+
});
|
50
56
|
return _jsx(_Checkbox, _objectSpread(_objectSpread(_objectSpread({
|
51
57
|
disabled: disabled,
|
52
|
-
onChange: changeVal
|
58
|
+
onChange: changeVal,
|
59
|
+
className: classNames
|
53
60
|
}, initialConfig), restProps), {}, {
|
54
61
|
children: restProps.label
|
55
62
|
}));
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
3
3
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
4
|
-
var _excluded = ["type", "confirm", "component", "fieldProps", "contextProps", "before", "after", "getValueProps", "valuePropName", "valueType", "isView"];
|
4
|
+
var _excluded = ["type", "confirm", "component", "fieldProps", "contextProps", "before", "after", "getValueProps", "valuePropName", "valueType", "isView", "viewRender"];
|
5
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
6
6
|
import React from 'react';
|
7
7
|
import ConfirmWrapper from '../../../../components/render/ConfirmWrapper';
|
@@ -42,6 +42,7 @@ var ComRender = function ComRender(props) {
|
|
42
42
|
valuePropName = _props$valuePropName === void 0 ? 'value' : _props$valuePropName,
|
43
43
|
valueType = props.valueType,
|
44
44
|
isView = props.isView,
|
45
|
+
viewRender = props.viewRender,
|
45
46
|
rest = _objectWithoutProperties(props, _excluded);
|
46
47
|
var TypeComponent = componentMap[type];
|
47
48
|
var mergedGetValueProps = getValueProps || function (val) {
|
@@ -49,6 +50,16 @@ var ComRender = function ComRender(props) {
|
|
49
50
|
};
|
50
51
|
var _props = mergedGetValueProps(fieldProps.value);
|
51
52
|
var componentProps = _objectSpread(_objectSpread(_objectSpread({}, fieldProps), rest), _props);
|
53
|
+
if (viewRender && isView) {
|
54
|
+
return _jsx(FieldProvider, {
|
55
|
+
value: _objectSpread(_objectSpread({}, contextProps), {}, {
|
56
|
+
valueType: valueType,
|
57
|
+
type: type,
|
58
|
+
isView: isView
|
59
|
+
}),
|
60
|
+
children: viewRender(componentProps)
|
61
|
+
});
|
62
|
+
}
|
52
63
|
var Component = component ? (/*#__PURE__*/React.cloneElement(component, _objectSpread({}, componentProps))) : _jsx(TypeComponent, _objectSpread({}, componentProps));
|
53
64
|
var Com = getComRender(Component, props, componentProps);
|
54
65
|
return _jsx(FieldProvider, {
|
@@ -24,7 +24,7 @@ var _excluded = ["value", "onChange", "disabled", "labelInValue", "fieldNames",
|
|
24
24
|
_excluded3 = ["rowKey", "columns", "rowSelection"];
|
25
25
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
26
26
|
import { SearchOutlined } from '@ant-design/icons';
|
27
|
-
import { useDeepCompareEffect, useMount, useSetState } from 'ahooks';
|
27
|
+
import { useDebounceEffect, useDeepCompareEffect, useMount, useSetState } from 'ahooks';
|
28
28
|
import { debounce, isArray, isEqual, isFunction, omit } from 'lodash';
|
29
29
|
import { ReactSVG } from 'react-svg';
|
30
30
|
import React, { forwardRef, useImperativeHandle, useMemo } from 'react';
|
@@ -34,7 +34,7 @@ import viewSvg from '../../../../assets/view.svg';
|
|
34
34
|
import useRequestList from './hooks/useRequestList';
|
35
35
|
import locale from '../../../../locale';
|
36
36
|
var ProModalSelect = function ProModalSelect(props, ref) {
|
37
|
-
var _formColumns$;
|
37
|
+
var _useRequest$options9, _formColumns$;
|
38
38
|
var value = props.value,
|
39
39
|
onChange = props.onChange,
|
40
40
|
disabled = props.disabled,
|
@@ -147,13 +147,21 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
147
147
|
})),
|
148
148
|
run = _useRequestList.run,
|
149
149
|
selectLoading = _useRequestList.loading;
|
150
|
+
var initParams = useMemo(function () {
|
151
|
+
var nextInitParams = useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams;
|
152
|
+
if (typeof (useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams) === 'function') {
|
153
|
+
var _contentForm$getField;
|
154
|
+
nextInitParams = useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams(value, contentForm === null || contentForm === void 0 ? void 0 : (_contentForm$getField = contentForm.getFieldsValue) === null || _contentForm$getField === void 0 ? void 0 : _contentForm$getField.call(contentForm));
|
155
|
+
}
|
156
|
+
return nextInitParams;
|
157
|
+
}, [value]);
|
150
158
|
var _useRequestList2 = useRequestList(useRequest === null || useRequest === void 0 ? void 0 : useRequest.service, {
|
151
159
|
withPagination: withPagination,
|
152
160
|
transformParams: transformParams,
|
153
161
|
transformResponse: transformResponse
|
154
162
|
}, _objectSpread({
|
155
163
|
manual: true,
|
156
|
-
ready: (
|
164
|
+
ready: (initParams || defaultOne) && !readOnly || visible
|
157
165
|
}, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options)),
|
158
166
|
data = _useRequestList2.data,
|
159
167
|
loading = _useRequestList2.loading,
|
@@ -458,18 +466,15 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
458
466
|
// 初始化回显,当传入initParams时,前端用来回险
|
459
467
|
var getInitValues = /*#__PURE__*/function () {
|
460
468
|
var _ref10 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
461
|
-
var
|
469
|
+
var _useRequest$options2, _useRequest$options3, queryBean, page, params, res, _res$data2, _list, list, _data, nextSelectRowKeys;
|
462
470
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
463
471
|
while (1) switch (_context4.prev = _context4.next) {
|
464
472
|
case 0:
|
465
|
-
if (
|
466
|
-
|
467
|
-
}
|
468
|
-
if (!((useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams) || defaultOne)) {
|
469
|
-
_context4.next = 10;
|
473
|
+
if (!(initParams || defaultOne)) {
|
474
|
+
_context4.next = 9;
|
470
475
|
break;
|
471
476
|
}
|
472
|
-
queryBean = _objectSpread(_objectSpread({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options2 = useRequest.options) === null || _useRequest$options2 === void 0 ? void 0 : _useRequest$options2.defaultParams),
|
477
|
+
queryBean = _objectSpread(_objectSpread({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options2 = useRequest.options) === null || _useRequest$options2 === void 0 ? void 0 : _useRequest$options2.defaultParams), initParams || {});
|
473
478
|
page = _objectSpread({
|
474
479
|
pageNum: 1,
|
475
480
|
pageSize: 10
|
@@ -478,9 +483,9 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
478
483
|
queryBean: queryBean !== null && queryBean !== void 0 ? queryBean : {}
|
479
484
|
}) : queryBean;
|
480
485
|
params = transformParams ? transformParams(params) : params;
|
481
|
-
_context4.next =
|
486
|
+
_context4.next = 7;
|
482
487
|
return runAsync(params);
|
483
|
-
case
|
488
|
+
case 7:
|
484
489
|
res = _context4.sent;
|
485
490
|
if (res === null || res === void 0 ? void 0 : res.data) {
|
486
491
|
list = withPagination ? res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.list : res === null || res === void 0 ? void 0 : res.data;
|
@@ -508,7 +513,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
508
513
|
});
|
509
514
|
}
|
510
515
|
}
|
511
|
-
case
|
516
|
+
case 9:
|
512
517
|
case "end":
|
513
518
|
return _context4.stop();
|
514
519
|
}
|
@@ -599,7 +604,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
599
604
|
});
|
600
605
|
}
|
601
606
|
});
|
602
|
-
|
607
|
+
useDebounceEffect(function () {
|
603
608
|
if (onOff && !visible) {
|
604
609
|
var _useRequest$options6;
|
605
610
|
if ((useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options6 = useRequest.options) === null || _useRequest$options6 === void 0 ? void 0 : _useRequest$options6.manual) !== true) {
|
@@ -634,13 +639,13 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
634
639
|
}
|
635
640
|
setState(nextState);
|
636
641
|
}
|
637
|
-
}, [onOff, visible, value]);
|
642
|
+
}, [onOff, visible, JSON.stringify(value)]);
|
638
643
|
useDeepCompareEffect(function () {
|
639
644
|
if (value && !visible && isInit && !readOnly) {
|
640
645
|
getInitValues();
|
641
646
|
}
|
642
|
-
}, [value, visible, isInit]);
|
643
|
-
|
647
|
+
}, [JSON.stringify(value), visible, isInit]);
|
648
|
+
useDebounceEffect(function () {
|
644
649
|
if (value && !visible && readOnly) {
|
645
650
|
var _options$some;
|
646
651
|
var isHasValue = options === null || options === void 0 ? void 0 : (_options$some = options.some) === null || _options$some === void 0 ? void 0 : _options$some.call(options, function (item) {
|
@@ -652,11 +657,6 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
652
657
|
// 加定时器 修复依赖数据同步更新未取到问题
|
653
658
|
setTimeout(function () {
|
654
659
|
var _useRequest$options7, _useRequest$options8;
|
655
|
-
var initParams = useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams;
|
656
|
-
if (typeof (useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams) === 'function') {
|
657
|
-
var _contentForm$getField2;
|
658
|
-
initParams = useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams(value, contentForm === null || contentForm === void 0 ? void 0 : (_contentForm$getField2 = contentForm.getFieldsValue) === null || _contentForm$getField2 === void 0 ? void 0 : _contentForm$getField2.call(contentForm));
|
659
|
-
}
|
660
660
|
var params = withPagination ? {
|
661
661
|
pageNum: 1,
|
662
662
|
pageSize: 50,
|
@@ -666,8 +666,8 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
666
666
|
run(nextParams);
|
667
667
|
}, 300);
|
668
668
|
}
|
669
|
-
}, [value, options, visible, useRequest]);
|
670
|
-
|
669
|
+
}, [JSON.stringify(value), JSON.stringify(options), visible, JSON.stringify(useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options9 = useRequest.options) === null || _useRequest$options9 === void 0 ? void 0 : _useRequest$options9.defaultParams), JSON.stringify(initParams)]);
|
670
|
+
useDebounceEffect(function () {
|
671
671
|
if (!value) {
|
672
672
|
if (defaultOne) {
|
673
673
|
getDefaultOneValues();
|
@@ -718,8 +718,8 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
718
718
|
}) : null,
|
719
719
|
onFocus: function onFocus() {
|
720
720
|
if (useRequest) {
|
721
|
-
var _useRequest$
|
722
|
-
var queryBean = (useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$
|
721
|
+
var _useRequest$options10;
|
722
|
+
var queryBean = (useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options10 = useRequest.options) === null || _useRequest$options10 === void 0 ? void 0 : _useRequest$options10.defaultParams) || {};
|
723
723
|
var params = withPagination ? {
|
724
724
|
pageNum: 1,
|
725
725
|
pageSize: 50,
|
@@ -733,8 +733,8 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
733
733
|
}
|
734
734
|
},
|
735
735
|
onSearch: debounce(function (val) {
|
736
|
-
var _useRequest$
|
737
|
-
var queryBean = _objectSpread(_objectSpread({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$
|
736
|
+
var _useRequest$options11;
|
737
|
+
var queryBean = _objectSpread(_objectSpread({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options11 = useRequest.options) === null || _useRequest$options11 === void 0 ? void 0 : _useRequest$options11.defaultParams), {}, _defineProperty({}, searchKey !== null && searchKey !== void 0 ? searchKey : labelKey, val));
|
738
738
|
var params = withPagination ? {
|
739
739
|
pageNum: 1,
|
740
740
|
pageSize: 50,
|