@zat-design/sisyphus-react 3.7.0 → 3.7.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.
Files changed (35) hide show
  1. package/dist/index.esm.css +30 -4
  2. package/dist/less.esm.css +30 -4
  3. package/es/ProEditTable/style/index.less +0 -1
  4. package/es/ProEditTable/utils/index.js +2 -2
  5. package/es/ProEnum/hooks/useEnumRequest.js +3 -0
  6. package/es/ProEnum/utils/index.js +1 -1
  7. package/es/ProForm/components/base/Select/index.js +1 -0
  8. package/es/ProForm/components/combination/ProModalSelect/index.js +4 -3
  9. package/es/ProForm/components/combination/ProModalSelect/style/index.less +37 -4
  10. package/es/ProForm/components/render/ConfirmWrapper.js +2 -1
  11. package/es/ProForm/components/render/propsType.d.ts +1 -1
  12. package/es/ProLayout/style/index.less +0 -1
  13. package/es/ProSelect/index.js +4 -0
  14. package/es/ProTable/components/RcTable/components/BaseTable/index.js +0 -1
  15. package/es/ProTable/components/RcTable/components/DraggableTable/index.js +1 -1
  16. package/es/ProTable/components/RenderColumn/index.js +38 -7
  17. package/es/ProTable/components/RenderFooter/index.js +5 -3
  18. package/es/ProTable/style/index.less +1 -2
  19. package/lib/ProEditTable/style/index.less +0 -1
  20. package/lib/ProEditTable/utils/index.js +1 -1
  21. package/lib/ProEnum/hooks/useEnumRequest.js +3 -0
  22. package/lib/ProEnum/utils/index.js +1 -1
  23. package/lib/ProForm/components/base/Select/index.js +1 -0
  24. package/lib/ProForm/components/combination/ProModalSelect/index.js +3 -2
  25. package/lib/ProForm/components/combination/ProModalSelect/style/index.less +37 -4
  26. package/lib/ProForm/components/render/ConfirmWrapper.js +2 -1
  27. package/lib/ProForm/components/render/propsType.d.ts +1 -1
  28. package/lib/ProLayout/style/index.less +0 -1
  29. package/lib/ProSelect/index.js +4 -0
  30. package/lib/ProTable/components/RcTable/components/BaseTable/index.js +0 -1
  31. package/lib/ProTable/components/RcTable/components/DraggableTable/index.js +1 -1
  32. package/lib/ProTable/components/RenderColumn/index.js +38 -7
  33. package/lib/ProTable/components/RenderFooter/index.js +5 -3
  34. package/lib/ProTable/style/index.less +1 -2
  35. package/package.json +1 -1
@@ -1387,7 +1387,6 @@
1387
1387
  content: '';
1388
1388
  }
1389
1389
  .pro-layout.pro-layout-light .pro-layout-open-menu .ant-menu-item-selected {
1390
- padding-right: 16px;
1391
1390
  background: transparent !important;
1392
1391
  }
1393
1392
  .pro-layout.pro-layout-light .pro-layout-open-menu .ant-menu-item-selected::after {
@@ -2024,7 +2023,6 @@
2024
2023
  height: 100%;
2025
2024
  }
2026
2025
  .pro-table .ant-table .ant-table-thead > tr > th {
2027
- white-space: nowrap;
2028
2026
  background: var(--zaui-table-header-bg, #f2f3f5);
2029
2027
  border-bottom: 0;
2030
2028
  }
@@ -2477,6 +2475,32 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
2477
2475
  border-top-left-radius: 0;
2478
2476
  border-bottom-left-radius: 0;
2479
2477
  }
2478
+ .pro-modal-select .ant-input-compact-item:not(.ant-input-compact-last-item):not(.ant-input-compact-item-rtl),
2479
+ .pro-tree-modal .ant-input-compact-item:not(.ant-input-compact-last-item):not(.ant-input-compact-item-rtl) {
2480
+ margin-right: 0;
2481
+ }
2482
+ .pro-modal-select .ant-btn-compact-item.ant-btn.ant-btn-compact-last-item:not(.ant-btn-compact-first-item):not(.ant-btn-compact-item-rtl):hover,
2483
+ .pro-tree-modal .ant-btn-compact-item.ant-btn.ant-btn-compact-last-item:not(.ant-btn-compact-first-item):not(.ant-btn-compact-item-rtl):hover {
2484
+ position: relative;
2485
+ -webkit-transition: none;
2486
+ transition: none;
2487
+ }
2488
+ .pro-modal-select .ant-btn-compact-item.ant-btn.ant-btn-compact-last-item:not(.ant-btn-compact-first-item):not(.ant-btn-compact-item-rtl):hover::before,
2489
+ .pro-tree-modal .ant-btn-compact-item.ant-btn.ant-btn-compact-last-item:not(.ant-btn-compact-first-item):not(.ant-btn-compact-item-rtl):hover::before {
2490
+ opacity: 1;
2491
+ }
2492
+ .pro-modal-select .ant-btn-compact-item.ant-btn.ant-btn-compact-last-item:not(.ant-btn-compact-first-item):not(.ant-btn-compact-item-rtl)::before,
2493
+ .pro-tree-modal .ant-btn-compact-item.ant-btn.ant-btn-compact-last-item:not(.ant-btn-compact-first-item):not(.ant-btn-compact-item-rtl)::before {
2494
+ content: '';
2495
+ position: absolute;
2496
+ top: -1px;
2497
+ left: -1px;
2498
+ width: 1px;
2499
+ height: calc(100% + 2px);
2500
+ background: var(--ant-primary-color-hover);
2501
+ opacity: 0;
2502
+ display: block;
2503
+ }
2480
2504
  .pro-modal-select .ant-input-group-wrapper-status-error:hover .ant-input,
2481
2505
  .pro-tree-modal .ant-input-group-wrapper-status-error:hover .ant-input,
2482
2506
  .pro-modal-select .ant-input-group-wrapper-status-error:hover .ant-input-group-addon,
@@ -2515,7 +2539,7 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
2515
2539
  }
2516
2540
  .pro-modal-select .ant-space-compact .ant-btn-compact-last-item,
2517
2541
  .pro-tree-modal .ant-space-compact .ant-btn-compact-last-item {
2518
- border-left: none;
2542
+ border-left: none !important;
2519
2543
  }
2520
2544
  .pro-modal-select .ant-input-group-addon,
2521
2545
  .pro-tree-modal .ant-input-group-addon {
@@ -2538,6 +2562,9 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
2538
2562
  color: var(--zaui-danger, #ff5050);
2539
2563
  border-color: var(--zaui-danger, #ff5050);
2540
2564
  }
2565
+ .ant-form-item-has-error .pro-modal-select .ant-btn-compact-last-item::before {
2566
+ background: var(--zaui-danger, #ff5050) !important;
2567
+ }
2541
2568
  .pro-group {
2542
2569
  width: unset !important;
2543
2570
  display: -webkit-box;
@@ -4433,7 +4460,6 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
4433
4460
  }
4434
4461
  .pro-edit-table .ant-table-thead > tr > th {
4435
4462
  border: 0;
4436
- white-space: nowrap;
4437
4463
  background-color: var(--zaui-table-header-bg, #f2f3f5);
4438
4464
  }
4439
4465
  .pro-edit-table .ant-table-thead > tr > th:not(:last-child):not(.ant-table-selection-column):not(.ant-table-row-expand-icon-cell):not([colspan])::before {
package/dist/less.esm.css CHANGED
@@ -1387,7 +1387,6 @@
1387
1387
  content: '';
1388
1388
  }
1389
1389
  .pro-layout.pro-layout-light .pro-layout-open-menu .ant-menu-item-selected {
1390
- padding-right: 16px;
1391
1390
  background: transparent !important;
1392
1391
  }
1393
1392
  .pro-layout.pro-layout-light .pro-layout-open-menu .ant-menu-item-selected::after {
@@ -2024,7 +2023,6 @@
2024
2023
  height: 100%;
2025
2024
  }
2026
2025
  .pro-table .ant-table .ant-table-thead > tr > th {
2027
- white-space: nowrap;
2028
2026
  background: var(--zaui-table-header-bg, #f2f3f5);
2029
2027
  border-bottom: 0;
2030
2028
  }
@@ -2477,6 +2475,32 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
2477
2475
  border-top-left-radius: 0;
2478
2476
  border-bottom-left-radius: 0;
2479
2477
  }
2478
+ .pro-modal-select .ant-input-compact-item:not(.ant-input-compact-last-item):not(.ant-input-compact-item-rtl),
2479
+ .pro-tree-modal .ant-input-compact-item:not(.ant-input-compact-last-item):not(.ant-input-compact-item-rtl) {
2480
+ margin-right: 0;
2481
+ }
2482
+ .pro-modal-select .ant-btn-compact-item.ant-btn.ant-btn-compact-last-item:not(.ant-btn-compact-first-item):not(.ant-btn-compact-item-rtl):hover,
2483
+ .pro-tree-modal .ant-btn-compact-item.ant-btn.ant-btn-compact-last-item:not(.ant-btn-compact-first-item):not(.ant-btn-compact-item-rtl):hover {
2484
+ position: relative;
2485
+ -webkit-transition: none;
2486
+ transition: none;
2487
+ }
2488
+ .pro-modal-select .ant-btn-compact-item.ant-btn.ant-btn-compact-last-item:not(.ant-btn-compact-first-item):not(.ant-btn-compact-item-rtl):hover::before,
2489
+ .pro-tree-modal .ant-btn-compact-item.ant-btn.ant-btn-compact-last-item:not(.ant-btn-compact-first-item):not(.ant-btn-compact-item-rtl):hover::before {
2490
+ opacity: 1;
2491
+ }
2492
+ .pro-modal-select .ant-btn-compact-item.ant-btn.ant-btn-compact-last-item:not(.ant-btn-compact-first-item):not(.ant-btn-compact-item-rtl)::before,
2493
+ .pro-tree-modal .ant-btn-compact-item.ant-btn.ant-btn-compact-last-item:not(.ant-btn-compact-first-item):not(.ant-btn-compact-item-rtl)::before {
2494
+ content: '';
2495
+ position: absolute;
2496
+ top: -1px;
2497
+ left: -1px;
2498
+ width: 1px;
2499
+ height: calc(100% + 2px);
2500
+ background: var(--ant-primary-color-hover);
2501
+ opacity: 0;
2502
+ display: block;
2503
+ }
2480
2504
  .pro-modal-select .ant-input-group-wrapper-status-error:hover .ant-input,
2481
2505
  .pro-tree-modal .ant-input-group-wrapper-status-error:hover .ant-input,
2482
2506
  .pro-modal-select .ant-input-group-wrapper-status-error:hover .ant-input-group-addon,
@@ -2515,7 +2539,7 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
2515
2539
  }
2516
2540
  .pro-modal-select .ant-space-compact .ant-btn-compact-last-item,
2517
2541
  .pro-tree-modal .ant-space-compact .ant-btn-compact-last-item {
2518
- border-left: none;
2542
+ border-left: none !important;
2519
2543
  }
2520
2544
  .pro-modal-select .ant-input-group-addon,
2521
2545
  .pro-tree-modal .ant-input-group-addon {
@@ -2538,6 +2562,9 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
2538
2562
  color: var(--zaui-danger, #ff5050);
2539
2563
  border-color: var(--zaui-danger, #ff5050);
2540
2564
  }
2565
+ .ant-form-item-has-error .pro-modal-select .ant-btn-compact-last-item::before {
2566
+ background: var(--zaui-danger, #ff5050) !important;
2567
+ }
2541
2568
  .pro-group {
2542
2569
  width: unset !important;
2543
2570
  display: -webkit-box;
@@ -4433,7 +4460,6 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
4433
4460
  }
4434
4461
  .pro-edit-table .ant-table-thead > tr > th {
4435
4462
  border: 0;
4436
- white-space: nowrap;
4437
4463
  background-color: var(--zaui-table-header-bg, #f2f3f5);
4438
4464
  }
4439
4465
  .pro-edit-table .ant-table-thead > tr > th:not(:last-child):not(.ant-table-selection-column):not(.ant-table-row-expand-icon-cell):not([colspan])::before {
@@ -206,7 +206,6 @@
206
206
 
207
207
  .@{ant-prefix}-table-thead>tr>th {
208
208
  border : 0;
209
- white-space : nowrap;
210
209
  background-color: var(--zaui-table-header-bg, #f2f3f5);
211
210
  }
212
211
 
@@ -13,7 +13,7 @@ var _excluded = ["type", "label", "show", "needConfirm", "onHandle", "onClick"],
13
13
  _excluded2 = ["title", "icon"];
14
14
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
15
15
  import React from 'react';
16
- import { cloneDeep, cloneDeepWith, isArray, isBoolean, isEqual } from 'lodash';
16
+ import { cloneDeepWith, isArray, isBoolean, isEqual } from 'lodash';
17
17
  import classnames from 'classnames';
18
18
  import { ReactSVG } from 'react-svg';
19
19
  import { tools } from '@zat-design/utils';
@@ -284,7 +284,7 @@ export var transformColumns = function transformColumns() {
284
284
  if (!(_cacheMap === null || _cacheMap === void 0 ? void 0 : (_cacheMap$item$dataIn = _cacheMap[item.dataIndex]) === null || _cacheMap$item$dataIn === void 0 ? void 0 : (_cacheMap$item$dataIn2 = _cacheMap$item$dataIn.dataSource) === null || _cacheMap$item$dataIn2 === void 0 ? void 0 : _cacheMap$item$dataIn2.length)) {
285
285
  var _item$fieldProps, _item$fieldProps2;
286
286
  _cacheMap[item.dataIndex] = {
287
- useRequest: cloneDeep((_item$fieldProps = item.fieldProps) === null || _item$fieldProps === void 0 ? void 0 : _item$fieldProps.useRequest),
287
+ useRequest: (_item$fieldProps = item.fieldProps) === null || _item$fieldProps === void 0 ? void 0 : _item$fieldProps.useRequest,
288
288
  dataSource: [],
289
289
  transformResponse: (_item$fieldProps2 = item.fieldProps) === null || _item$fieldProps2 === void 0 ? void 0 : _item$fieldProps2.transformResponse
290
290
  };
@@ -91,6 +91,9 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
91
91
  // 忽略清洗的 codes
92
92
  ignoreCodes = (useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options = useRequest.options) === null || _useRequest$options === void 0 ? void 0 : _useRequest$options.ignoreCodes) || [];
93
93
  Object.keys(response).forEach(function (key) {
94
+ if (!response[key] || !Array.isArray(response[key])) {
95
+ return;
96
+ }
94
97
  var options = _toConsumableArray(response[key]) || [];
95
98
  if (ignoreCodes.includes(key)) {
96
99
  response[key] = options;
@@ -74,7 +74,7 @@ export function cacheFieldNames(fieldNames, dataSource) {
74
74
  });
75
75
  // 递归去对数据进行清洗
76
76
  if (children && Array.isArray(dataSource[children])) {
77
- result[children] = dataSource[children].map(function (item) {
77
+ result.children = dataSource[children].map(function (item) {
78
78
  return cacheFieldNames(fieldNames, item);
79
79
  });
80
80
  }
@@ -58,6 +58,7 @@ var Select = function Select(props) {
58
58
  }, initialConfig), {}, {
59
59
  options: dataSource
60
60
  }, rest), {}, {
61
+ value: rest.value === '' ? null : rest.value,
61
62
  fieldNames: _fieldNames
62
63
  }));
63
64
  };
@@ -9,6 +9,7 @@ import _Spin from "antd/es/spin";
9
9
  import "antd/es/space/style";
10
10
  import _Space from "antd/es/space";
11
11
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
12
+ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
12
13
  import "antd/es/message/style";
13
14
  import _message from "antd/es/message";
14
15
  import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
@@ -24,7 +25,7 @@ var _excluded = ["value", "onChange", "disabled", "labelInValue", "fieldNames",
24
25
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
25
26
  import { SearchOutlined } from '@ant-design/icons';
26
27
  import { useDeepCompareEffect, useMount, useSetState } from 'ahooks';
27
- import { cloneDeep, debounce, isArray, isEqual, isFunction, omit } from 'lodash';
28
+ import { debounce, isArray, isEqual, isFunction, omit } from 'lodash';
28
29
  import { ReactSVG } from 'react-svg';
29
30
  import React, { forwardRef, useEffect, useImperativeHandle, useMemo } from 'react';
30
31
  import { ProForm, ProDrawerForm, ProTable, useProConfig, ProSelect } from '../../../../index';
@@ -409,8 +410,8 @@ var ProModalSelect = function ProModalSelect(props, ref) {
409
410
  }
410
411
  if (record === null || record === void 0 ? void 0 : record.disabled) return;
411
412
  var selectedValue = getRowKey(record);
412
- var tempSelectedRows = cloneDeep(selectedRows);
413
- var tempSelectedRowKeys = cloneDeep(selectedRowKeys);
413
+ var tempSelectedRows = _toConsumableArray(selectedRows);
414
+ var tempSelectedRowKeys = _toConsumableArray(selectedRowKeys);
414
415
  if (isMultiple) {
415
416
  var rowIndex = tempSelectedRows.findIndex(function (item) {
416
417
  return getRowKey(item) === selectedValue;
@@ -57,7 +57,7 @@
57
57
  .@{ant-prefix}-input-affix-wrapper {
58
58
  border-top-right-radius: 0;
59
59
  border-bottom-right-radius: 0;
60
- &.ant-input-affix-wrapper-status-error{
60
+ &.@{ant-prefix}-input-affix-wrapper-status-error{
61
61
  & + .@{ant-prefix}-btn{
62
62
  border: 1px solid var(--ant-error-color);
63
63
  >.viewSvg{
@@ -74,6 +74,36 @@
74
74
  }
75
75
  }
76
76
 
77
+ .@{ant-prefix}-input-compact-item:not(.@{ant-prefix}-input-compact-last-item):not(.@{ant-prefix}-input-compact-item-rtl){
78
+ margin-right: 0;
79
+ }
80
+
81
+ .@{ant-prefix}-btn-compact-item.@{ant-prefix}-btn.@{ant-prefix}-btn-compact-last-item:not(.@{ant-prefix}-btn-compact-first-item):not(.@{ant-prefix}-btn-compact-item-rtl){
82
+ &:hover{
83
+ position: relative;
84
+ transition: none;
85
+ &::before{
86
+ opacity: 1;
87
+ }
88
+ }
89
+ &::before{
90
+ content: '';
91
+ position: absolute;
92
+ top: -1px;
93
+ left: -1px;
94
+ width: 1px;
95
+ height: calc(100% + 2px);
96
+ background:var(--ant-primary-color-hover);
97
+ opacity: 0;
98
+ display: block;
99
+ }
100
+ }
101
+
102
+ .@{ant-prefix}-input-affix-wrapper-status-error{
103
+
104
+ }
105
+
106
+
77
107
  .@{ant-prefix}-input-group-wrapper-status-error {
78
108
  &:hover {
79
109
  .@{ant-prefix}-input,
@@ -109,7 +139,7 @@
109
139
 
110
140
  .@{ant-prefix}-space-compact {
111
141
  .@{ant-prefix}-select-compact-item-div:has(.@{ant-prefix}-select-status-error) {
112
- & + .ant-btn-compact-last-item {
142
+ & + .@{ant-prefix}-btn-compact-last-item {
113
143
  border-top: 1px solid var(--ant-error-color);
114
144
  border-right: 1px solid var(--ant-error-color);
115
145
  border-bottom: 1px solid var(--ant-error-color);
@@ -119,7 +149,7 @@
119
149
  }
120
150
  }
121
151
  .@{ant-prefix}-btn-compact-last-item{
122
- border-left: none;
152
+ border-left: none !important;
123
153
  }
124
154
  }
125
155
 
@@ -138,9 +168,12 @@
138
168
  // 报错信息
139
169
  .@{ant-prefix}-form-item-has-error{
140
170
  .pro-modal-select{
141
- .ant-btn-compact-last-item{
171
+ .@{ant-prefix}-btn-compact-last-item{
142
172
  color: @zaui-danger;
143
173
  border-color: @zaui-danger;
174
+ &::before{
175
+ background: @zaui-danger !important;
176
+ }
144
177
  }
145
178
  }
146
179
  }
@@ -46,7 +46,8 @@ var ConfirmWrapper = function ConfirmWrapper(props) {
46
46
  form: form,
47
47
  namePath: otherProps.namePath,
48
48
  name: otherProps.name,
49
- index: otherProps.index
49
+ index: otherProps.index,
50
+ preValue: form.getFieldValue(otherProps.listName || otherProps.name)
50
51
  });
51
52
  case 5:
52
53
  _context.t0 = _context.sent;
@@ -220,7 +220,7 @@ export interface ProFormColumnProps<Values = any> extends Omit<FormItemProps<Val
220
220
  extra?: string | React.ReactNode;
221
221
  /** 是否固定字段, 不隐藏 */
222
222
  fixed?: boolean;
223
- confirm?: boolean | ModalFuncProps | FunctionArgs<Values, boolean | ModalFuncProps | void>;
223
+ confirm?: boolean | ModalFuncProps | FunctionArgs<Values, boolean | ModalFuncProps | void | Promise<boolean | ModalFuncProps | void>>;
224
224
  /** 防抖模式 */
225
225
  debounceWait?: number;
226
226
  }
@@ -242,7 +242,6 @@
242
242
  }
243
243
 
244
244
  .pro-layout-open-menu .@{ant-prefix}-menu-item-selected {
245
- padding-right: 16px;
246
245
  &::after {
247
246
  display: none;
248
247
  }
@@ -268,6 +268,10 @@ export var ProSelect = function ProSelect(props, ref) {
268
268
  return option === null || option === void 0 ? void 0 : option[code];
269
269
  }
270
270
  }
271
+ // 修复空字符placeholder不显示
272
+ if (value === '') {
273
+ return null;
274
+ }
271
275
  return value;
272
276
  };
273
277
  var newSelectList = selectList;
@@ -25,7 +25,6 @@ var BaseTable = function BaseTable(_ref) {
25
25
  return null;
26
26
  };
27
27
  return _jsx(_Table, _objectSpread(_objectSpread({
28
- className: "pro-edit-table-drag",
29
28
  components: renderComponents(),
30
29
  columns: columns,
31
30
  locale: {
@@ -8,7 +8,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
8
8
  * @Author: za-xuwenli xuwenli@zhongan.io
9
9
  * @Date: 2024-08-09 13:48:59
10
10
  * @LastEditors: za-xuwenli xuwenli@zhongan.io
11
- * @LastEditTime: 2024-08-20 19:31:24
11
+ * @LastEditTime: 2024-08-27 15:27:44
12
12
  * @FilePath: /za-material-warehouse/src/ProTable/components/RcTable/components/DraggableTable/index.tsx
13
13
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
14
14
  */
@@ -1,9 +1,11 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import "antd/es/tooltip/style";
3
3
  import _Tooltip from "antd/es/tooltip";
4
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
4
5
  import "antd/es/typography/style";
5
6
  import _Typography from "antd/es/typography";
6
7
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
8
+ import { useSetState } from 'ahooks';
7
9
  import { CheckOutlined } from '@ant-design/icons';
8
10
  import { ReactSVG } from 'react-svg';
9
11
  import copySvg from '../../../assets/copy.svg';
@@ -22,6 +24,12 @@ var RenderColumn = function RenderColumn(props) {
22
24
  originalDiffTip = props.originalDiffTip,
23
25
  _props$toolTipProps = props.toolTipProps,
24
26
  toolTipProps = _props$toolTipProps === void 0 ? {} : _props$toolTipProps;
27
+ var _useSetState = useSetState({
28
+ tooltip: false
29
+ }),
30
+ _useSetState2 = _slicedToArray(_useSetState, 2),
31
+ tooltip = _useSetState2[0].tooltip,
32
+ setState = _useSetState2[1];
25
33
  if (originalValue !== undefined) {
26
34
  var renderNode = value ? node : '-';
27
35
  if (ellipsis || originalDiffTip) {
@@ -82,17 +90,40 @@ var RenderColumn = function RenderColumn(props) {
82
90
  });
83
91
  }
84
92
  if (ellipsis) {
93
+ var handleMouseOver = function handleMouseOver(e) {
94
+ var _e$target, _e$target2;
95
+ if ((e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.scrollWidth) > (e === null || e === void 0 ? void 0 : (_e$target2 = e.target) === null || _e$target2 === void 0 ? void 0 : _e$target2.offsetWidth)) {
96
+ setState({
97
+ tooltip: _objectSpread({
98
+ getPopupContainer: function getPopupContainer(triggerNode) {
99
+ return triggerNode.parentNode;
100
+ },
101
+ open: true
102
+ }, toolTipProps)
103
+ });
104
+ } else {
105
+ setState({
106
+ tooltip: false
107
+ });
108
+ }
109
+ };
110
+ var handleMouseOut = function handleMouseOut() {
111
+ setState({
112
+ tooltip: false
113
+ });
114
+ };
115
+ var _ellipsis = {
116
+ tooltip: tooltip
117
+ };
85
118
  return value ? _jsx(Text, {
86
119
  style: {
87
120
  width: width
88
121
  },
89
- ellipsis: {
90
- tooltip: _objectSpread({
91
- getPopupContainer: function getPopupContainer(triggerNode) {
92
- return triggerNode.parentNode;
93
- }
94
- }, toolTipProps)
95
- },
122
+ ellipsis: _ellipsis,
123
+ onMouseOver: handleMouseOver,
124
+ onFocus: handleMouseOver,
125
+ onMouseOut: handleMouseOut,
126
+ onBlur: handleMouseOut,
96
127
  children: node
97
128
  }) : '-';
98
129
  }
@@ -1,9 +1,11 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  var RenderFooter = function RenderFooter(props) {
3
3
  var _ref = props || {},
4
- footerRender = _ref.footerRender,
5
- pagination = _ref.pagination,
6
- _dataSource = _ref._dataSource;
4
+ dataSource = _ref.dataSource;
5
+ var _ref2 = dataSource || {},
6
+ footerRender = _ref2.footerRender,
7
+ pagination = _ref2.pagination,
8
+ _dataSource = _ref2._dataSource;
7
9
  return footerRender ? _jsx("div", {
8
10
  className: "pro-table-footer ".concat(pagination && !!(_dataSource === null || _dataSource === void 0 ? void 0 : _dataSource.length) ? 'has-page' : 'no-page'),
9
11
  children: typeof footerRender === 'function' ? footerRender() : footerRender
@@ -403,7 +403,6 @@
403
403
  }
404
404
 
405
405
  .@{ant-prefix}-table .@{ant-prefix}-table-thead > tr > th {
406
- white-space: nowrap;
407
406
  background: var(--zaui-table-header-bg, #f2f3f5);
408
407
  border-bottom: 0;
409
408
 
@@ -558,4 +557,4 @@
558
557
  }
559
558
  }
560
559
  }
561
- }
560
+ }
@@ -206,7 +206,6 @@
206
206
 
207
207
  .@{ant-prefix}-table-thead>tr>th {
208
208
  border : 0;
209
- white-space : nowrap;
210
209
  background-color: var(--zaui-table-header-bg, #f2f3f5);
211
210
  }
212
211
 
@@ -288,7 +288,7 @@ var transformColumns = exports.transformColumns = function transformColumns() {
288
288
  if (!(_cacheMap === null || _cacheMap === void 0 ? void 0 : (_cacheMap$item$dataIn = _cacheMap[item.dataIndex]) === null || _cacheMap$item$dataIn === void 0 ? void 0 : (_cacheMap$item$dataIn2 = _cacheMap$item$dataIn.dataSource) === null || _cacheMap$item$dataIn2 === void 0 ? void 0 : _cacheMap$item$dataIn2.length)) {
289
289
  var _item$fieldProps, _item$fieldProps2;
290
290
  _cacheMap[item.dataIndex] = {
291
- useRequest: (0, _lodash.cloneDeep)((_item$fieldProps = item.fieldProps) === null || _item$fieldProps === void 0 ? void 0 : _item$fieldProps.useRequest),
291
+ useRequest: (_item$fieldProps = item.fieldProps) === null || _item$fieldProps === void 0 ? void 0 : _item$fieldProps.useRequest,
292
292
  dataSource: [],
293
293
  transformResponse: (_item$fieldProps2 = item.fieldProps) === null || _item$fieldProps2 === void 0 ? void 0 : _item$fieldProps2.transformResponse
294
294
  };
@@ -98,6 +98,9 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
98
98
  // 忽略清洗的 codes
99
99
  ignoreCodes = (useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options = useRequest.options) === null || _useRequest$options === void 0 ? void 0 : _useRequest$options.ignoreCodes) || [];
100
100
  Object.keys(response).forEach(function (key) {
101
+ if (!response[key] || !Array.isArray(response[key])) {
102
+ return;
103
+ }
101
104
  var options = (0, _toConsumableArray2.default)(response[key]) || [];
102
105
  if (ignoreCodes.includes(key)) {
103
106
  response[key] = options;
@@ -87,7 +87,7 @@ function cacheFieldNames(fieldNames, dataSource) {
87
87
  });
88
88
  // 递归去对数据进行清洗
89
89
  if (children && Array.isArray(dataSource[children])) {
90
- result[children] = dataSource[children].map(function (item) {
90
+ result.children = dataSource[children].map(function (item) {
91
91
  return cacheFieldNames(fieldNames, item);
92
92
  });
93
93
  }
@@ -64,6 +64,7 @@ var Select = function Select(props) {
64
64
  }, initialConfig), {}, {
65
65
  options: dataSource
66
66
  }, rest), {}, {
67
+ value: rest.value === '' ? null : rest.value,
67
68
  fieldNames: _fieldNames
68
69
  }));
69
70
  };
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.default = void 0;
9
9
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
10
11
  var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
11
12
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
12
13
  var _objectSpread3 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
@@ -404,8 +405,8 @@ var ProModalSelect = function ProModalSelect(props, ref) {
404
405
  }
405
406
  if (record === null || record === void 0 ? void 0 : record.disabled) return;
406
407
  var selectedValue = getRowKey(record);
407
- var tempSelectedRows = (0, _lodash.cloneDeep)(selectedRows);
408
- var tempSelectedRowKeys = (0, _lodash.cloneDeep)(selectedRowKeys);
408
+ var tempSelectedRows = (0, _toConsumableArray2.default)(selectedRows);
409
+ var tempSelectedRowKeys = (0, _toConsumableArray2.default)(selectedRowKeys);
409
410
  if (isMultiple) {
410
411
  var rowIndex = tempSelectedRows.findIndex(function (item) {
411
412
  return getRowKey(item) === selectedValue;
@@ -57,7 +57,7 @@
57
57
  .@{ant-prefix}-input-affix-wrapper {
58
58
  border-top-right-radius: 0;
59
59
  border-bottom-right-radius: 0;
60
- &.ant-input-affix-wrapper-status-error{
60
+ &.@{ant-prefix}-input-affix-wrapper-status-error{
61
61
  & + .@{ant-prefix}-btn{
62
62
  border: 1px solid var(--ant-error-color);
63
63
  >.viewSvg{
@@ -74,6 +74,36 @@
74
74
  }
75
75
  }
76
76
 
77
+ .@{ant-prefix}-input-compact-item:not(.@{ant-prefix}-input-compact-last-item):not(.@{ant-prefix}-input-compact-item-rtl){
78
+ margin-right: 0;
79
+ }
80
+
81
+ .@{ant-prefix}-btn-compact-item.@{ant-prefix}-btn.@{ant-prefix}-btn-compact-last-item:not(.@{ant-prefix}-btn-compact-first-item):not(.@{ant-prefix}-btn-compact-item-rtl){
82
+ &:hover{
83
+ position: relative;
84
+ transition: none;
85
+ &::before{
86
+ opacity: 1;
87
+ }
88
+ }
89
+ &::before{
90
+ content: '';
91
+ position: absolute;
92
+ top: -1px;
93
+ left: -1px;
94
+ width: 1px;
95
+ height: calc(100% + 2px);
96
+ background:var(--ant-primary-color-hover);
97
+ opacity: 0;
98
+ display: block;
99
+ }
100
+ }
101
+
102
+ .@{ant-prefix}-input-affix-wrapper-status-error{
103
+
104
+ }
105
+
106
+
77
107
  .@{ant-prefix}-input-group-wrapper-status-error {
78
108
  &:hover {
79
109
  .@{ant-prefix}-input,
@@ -109,7 +139,7 @@
109
139
 
110
140
  .@{ant-prefix}-space-compact {
111
141
  .@{ant-prefix}-select-compact-item-div:has(.@{ant-prefix}-select-status-error) {
112
- & + .ant-btn-compact-last-item {
142
+ & + .@{ant-prefix}-btn-compact-last-item {
113
143
  border-top: 1px solid var(--ant-error-color);
114
144
  border-right: 1px solid var(--ant-error-color);
115
145
  border-bottom: 1px solid var(--ant-error-color);
@@ -119,7 +149,7 @@
119
149
  }
120
150
  }
121
151
  .@{ant-prefix}-btn-compact-last-item{
122
- border-left: none;
152
+ border-left: none !important;
123
153
  }
124
154
  }
125
155
 
@@ -138,9 +168,12 @@
138
168
  // 报错信息
139
169
  .@{ant-prefix}-form-item-has-error{
140
170
  .pro-modal-select{
141
- .ant-btn-compact-last-item{
171
+ .@{ant-prefix}-btn-compact-last-item{
142
172
  color: @zaui-danger;
143
173
  border-color: @zaui-danger;
174
+ &::before{
175
+ background: @zaui-danger !important;
176
+ }
144
177
  }
145
178
  }
146
179
  }
@@ -52,7 +52,8 @@ var ConfirmWrapper = function ConfirmWrapper(props) {
52
52
  form: form,
53
53
  namePath: otherProps.namePath,
54
54
  name: otherProps.name,
55
- index: otherProps.index
55
+ index: otherProps.index,
56
+ preValue: form.getFieldValue(otherProps.listName || otherProps.name)
56
57
  });
57
58
  case 5:
58
59
  _context.t0 = _context.sent;
@@ -220,7 +220,7 @@ export interface ProFormColumnProps<Values = any> extends Omit<FormItemProps<Val
220
220
  extra?: string | React.ReactNode;
221
221
  /** 是否固定字段, 不隐藏 */
222
222
  fixed?: boolean;
223
- confirm?: boolean | ModalFuncProps | FunctionArgs<Values, boolean | ModalFuncProps | void>;
223
+ confirm?: boolean | ModalFuncProps | FunctionArgs<Values, boolean | ModalFuncProps | void | Promise<boolean | ModalFuncProps | void>>;
224
224
  /** 防抖模式 */
225
225
  debounceWait?: number;
226
226
  }
@@ -242,7 +242,6 @@
242
242
  }
243
243
 
244
244
  .pro-layout-open-menu .@{ant-prefix}-menu-item-selected {
245
- padding-right: 16px;
246
245
  &::after {
247
246
  display: none;
248
247
  }
@@ -269,6 +269,10 @@ var ProSelect = exports.ProSelect = function ProSelect(props, ref) {
269
269
  return option === null || option === void 0 ? void 0 : option[code];
270
270
  }
271
271
  }
272
+ // 修复空字符placeholder不显示
273
+ if (value === '') {
274
+ return null;
275
+ }
272
276
  return value;
273
277
  };
274
278
  var newSelectList = selectList;
@@ -31,7 +31,6 @@ var BaseTable = function BaseTable(_ref) {
31
31
  return null;
32
32
  };
33
33
  return (0, _jsxRuntime.jsx)(_antd.Table, (0, _objectSpread2.default)((0, _objectSpread2.default)({
34
- className: "pro-edit-table-drag",
35
34
  components: renderComponents(),
36
35
  columns: columns,
37
36
  locale: {
@@ -19,7 +19,7 @@ var _excluded = ["dataSource", "tableProps", "draggableProps", "summaryProps", "
19
19
  * @Author: za-xuwenli xuwenli@zhongan.io
20
20
  * @Date: 2024-08-09 13:48:59
21
21
  * @LastEditors: za-xuwenli xuwenli@zhongan.io
22
- * @LastEditTime: 2024-08-20 19:31:24
22
+ * @LastEditTime: 2024-08-27 15:27:44
23
23
  * @FilePath: /za-material-warehouse/src/ProTable/components/RcTable/components/DraggableTable/index.tsx
24
24
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
25
25
  */
@@ -6,8 +6,10 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = void 0;
8
8
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
9
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
10
  var _jsxRuntime = require("react/jsx-runtime");
10
11
  var _antd = require("antd");
12
+ var _ahooks = require("ahooks");
11
13
  var _icons = require("@ant-design/icons");
12
14
  var _reactSvg = require("react-svg");
13
15
  var _copy = _interopRequireDefault(require("../../../assets/copy.svg"));
@@ -26,6 +28,12 @@ var RenderColumn = function RenderColumn(props) {
26
28
  originalDiffTip = props.originalDiffTip,
27
29
  _props$toolTipProps = props.toolTipProps,
28
30
  toolTipProps = _props$toolTipProps === void 0 ? {} : _props$toolTipProps;
31
+ var _useSetState = (0, _ahooks.useSetState)({
32
+ tooltip: false
33
+ }),
34
+ _useSetState2 = (0, _slicedToArray2.default)(_useSetState, 2),
35
+ tooltip = _useSetState2[0].tooltip,
36
+ setState = _useSetState2[1];
29
37
  if (originalValue !== undefined) {
30
38
  var renderNode = value ? node : '-';
31
39
  if (ellipsis || originalDiffTip) {
@@ -86,17 +94,40 @@ var RenderColumn = function RenderColumn(props) {
86
94
  });
87
95
  }
88
96
  if (ellipsis) {
97
+ var handleMouseOver = function handleMouseOver(e) {
98
+ var _e$target, _e$target2;
99
+ if ((e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.scrollWidth) > (e === null || e === void 0 ? void 0 : (_e$target2 = e.target) === null || _e$target2 === void 0 ? void 0 : _e$target2.offsetWidth)) {
100
+ setState({
101
+ tooltip: (0, _objectSpread2.default)({
102
+ getPopupContainer: function getPopupContainer(triggerNode) {
103
+ return triggerNode.parentNode;
104
+ },
105
+ open: true
106
+ }, toolTipProps)
107
+ });
108
+ } else {
109
+ setState({
110
+ tooltip: false
111
+ });
112
+ }
113
+ };
114
+ var handleMouseOut = function handleMouseOut() {
115
+ setState({
116
+ tooltip: false
117
+ });
118
+ };
119
+ var _ellipsis = {
120
+ tooltip: tooltip
121
+ };
89
122
  return value ? (0, _jsxRuntime.jsx)(Text, {
90
123
  style: {
91
124
  width: width
92
125
  },
93
- ellipsis: {
94
- tooltip: (0, _objectSpread2.default)({
95
- getPopupContainer: function getPopupContainer(triggerNode) {
96
- return triggerNode.parentNode;
97
- }
98
- }, toolTipProps)
99
- },
126
+ ellipsis: _ellipsis,
127
+ onMouseOver: handleMouseOver,
128
+ onFocus: handleMouseOver,
129
+ onMouseOut: handleMouseOut,
130
+ onBlur: handleMouseOut,
100
131
  children: node
101
132
  }) : '-';
102
133
  }
@@ -7,9 +7,11 @@ exports.default = void 0;
7
7
  var _jsxRuntime = require("react/jsx-runtime");
8
8
  var RenderFooter = function RenderFooter(props) {
9
9
  var _ref = props || {},
10
- footerRender = _ref.footerRender,
11
- pagination = _ref.pagination,
12
- _dataSource = _ref._dataSource;
10
+ dataSource = _ref.dataSource;
11
+ var _ref2 = dataSource || {},
12
+ footerRender = _ref2.footerRender,
13
+ pagination = _ref2.pagination,
14
+ _dataSource = _ref2._dataSource;
13
15
  return footerRender ? (0, _jsxRuntime.jsx)("div", {
14
16
  className: "pro-table-footer ".concat(pagination && !!(_dataSource === null || _dataSource === void 0 ? void 0 : _dataSource.length) ? 'has-page' : 'no-page'),
15
17
  children: typeof footerRender === 'function' ? footerRender() : footerRender
@@ -403,7 +403,6 @@
403
403
  }
404
404
 
405
405
  .@{ant-prefix}-table .@{ant-prefix}-table-thead > tr > th {
406
- white-space: nowrap;
407
406
  background: var(--zaui-table-header-bg, #f2f3f5);
408
407
  border-bottom: 0;
409
408
 
@@ -558,4 +557,4 @@
558
557
  }
559
558
  }
560
559
  }
561
- }
560
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zat-design/sisyphus-react",
3
- "version": "3.7.0",
3
+ "version": "3.7.1",
4
4
  "license": "Apache-2.0",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",