@zat-design/sisyphus-react 4.1.2-beta.5 → 4.1.2-beta.6

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.
@@ -14,7 +14,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
14
14
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
15
15
  import { memo, useCallback } from 'react';
16
16
  import { Badge, Table } from 'antd';
17
- import { isFunction, isNumber } from 'lodash';
17
+ import { isFunction } from 'lodash';
18
18
  import useEditTableError from "../../utils/useEditTableError";
19
19
  import { jsx as _jsx } from "react/jsx-runtime";
20
20
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -51,23 +51,19 @@ var BaseTable = _ref => {
51
51
  _useEditTableError2 = _slicedToArray(_useEditTableError, 1),
52
52
  errorLength = _useEditTableError2[0];
53
53
  var getScroll = useCallback(() => {
54
- if (scroll !== null && scroll !== void 0 && scroll.x && scroll !== null && scroll !== void 0 && scroll.y) {
55
- return {
56
- x: scroll === null || scroll === void 0 ? void 0 : scroll.x,
57
- y: Number(scroll === null || scroll === void 0 ? void 0 : scroll.y)
58
- };
54
+ if (!scroll) return null;
55
+ var result = {};
56
+
57
+ // 处理 x
58
+ if (scroll.x !== undefined) {
59
+ result.x = scroll.x;
59
60
  }
60
- if (scroll !== null && scroll !== void 0 && scroll.x && !isNumber(scroll === null || scroll === void 0 ? void 0 : scroll.y)) {
61
- return {
62
- x: scroll === null || scroll === void 0 ? void 0 : scroll.x
63
- };
61
+
62
+ // 处理 y 轴:支持数字和字符串(如 calc 表达式)
63
+ if (scroll.y !== undefined) {
64
+ result.y = scroll.y;
64
65
  }
65
- if (scroll !== null && scroll !== void 0 && scroll.y && !(scroll !== null && scroll !== void 0 && scroll.x)) {
66
- return {
67
- y: Number(scroll === null || scroll === void 0 ? void 0 : scroll.y)
68
- };
69
- }
70
- return null;
66
+ return Object.keys(result).length > 0 ? result : null;
71
67
  }, [scroll]);
72
68
  var nextTableProps = _objectSpread(_objectSpread({
73
69
  className,
@@ -10,7 +10,6 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
10
10
  import { Table } from 'antd';
11
11
  import React, { memo, useCallback } from 'react';
12
12
  import { DndContext } from '@dnd-kit/core';
13
- import { isNumber } from 'lodash';
14
13
  import { arrayMove, useSortable, SortableContext, verticalListSortingStrategy } from '@dnd-kit/sortable';
15
14
  import { CSS } from '@dnd-kit/utilities';
16
15
  import dragSvg from "../../../assets/drag.svg";
@@ -142,23 +141,19 @@ var DraggableTable = _ref3 => {
142
141
  draggable = draggableProps.draggable,
143
142
  onDragEnd = draggableProps.onDragEnd;
144
143
  var getScroll = useCallback(() => {
145
- if (scroll !== null && scroll !== void 0 && scroll.x && scroll !== null && scroll !== void 0 && scroll.y) {
146
- return {
147
- x: scroll === null || scroll === void 0 ? void 0 : scroll.x,
148
- y: Number(scroll === null || scroll === void 0 ? void 0 : scroll.y)
149
- };
150
- }
151
- if (scroll !== null && scroll !== void 0 && scroll.x && !isNumber(scroll === null || scroll === void 0 ? void 0 : scroll.y)) {
152
- return {
153
- x: scroll === null || scroll === void 0 ? void 0 : scroll.x
154
- };
144
+ if (!scroll) return null;
145
+ var result = {};
146
+
147
+ // 处理 x
148
+ if (scroll.x !== undefined) {
149
+ result.x = scroll.x;
155
150
  }
156
- if (scroll !== null && scroll !== void 0 && scroll.y && !(scroll !== null && scroll !== void 0 && scroll.x)) {
157
- return {
158
- y: Number(scroll === null || scroll === void 0 ? void 0 : scroll.y)
159
- };
151
+
152
+ // 处理 y 轴:支持数字和字符串(如 calc 表达式)
153
+ if (scroll.y !== undefined) {
154
+ result.y = scroll.y;
160
155
  }
161
- return null;
156
+ return Object.keys(result).length > 0 ? result : null;
162
157
  }, [scroll]);
163
158
  var nextTableProps = _objectSpread(_objectSpread({
164
159
  className,
@@ -376,25 +376,25 @@ var RenderField = _ref => {
376
376
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
377
377
  args[_key] = arguments[_key];
378
378
  }
379
- var _args = args === null || args === void 0 ? void 0 : args[0];
379
+ var rawArgs = (args === null || args === void 0 ? void 0 : args.length) === 1 && Array.isArray(args === null || args === void 0 ? void 0 : args[0]) ? args === null || args === void 0 ? void 0 : args[0] : args;
380
380
  var nextArgs = [];
381
- nextArgs[0] = _args[0];
381
+ nextArgs[0] = rawArgs === null || rawArgs === void 0 ? void 0 : rawArgs[0];
382
382
  // 返回表单元素默认值
383
383
  nextArgs[2] = _objectSpread(_objectSpread({}, options), {}, {
384
- extra: _args
384
+ extra: rawArgs
385
385
  });
386
386
  switch (type) {
387
387
  case 'ProSelect':
388
388
  case 'ProModalSelect':
389
389
  case 'ProEnum':
390
- nextArgs[2].option = _args[1];
390
+ nextArgs[2].option = rawArgs === null || rawArgs === void 0 ? void 0 : rawArgs[1];
391
391
  break;
392
392
  case 'ProCascader':
393
- nextArgs[2].selectedOptions = _args[1];
393
+ nextArgs[2].selectedOptions = rawArgs === null || rawArgs === void 0 ? void 0 : rawArgs[1];
394
394
  break;
395
395
  case 'DatePicker':
396
396
  case 'RangePicker':
397
- nextArgs[2].dateString = _args[1];
397
+ nextArgs[2].dateString = rawArgs === null || rawArgs === void 0 ? void 0 : rawArgs[1];
398
398
  break;
399
399
  default:
400
400
  break;
@@ -570,10 +570,7 @@ var RenderField = _ref => {
570
570
  // 使用useCallback优化_onblur函数
571
571
  var _onblur = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
572
572
  var _TargetComponent3;
573
- var _len3,
574
- args,
575
- _key3,
576
- _args,
573
+ var _args,
577
574
  rowPath,
578
575
  row,
579
576
  orgRow,
@@ -591,30 +588,27 @@ var RenderField = _ref => {
591
588
  }
592
589
  return _context3.abrupt("return", null);
593
590
  case 2:
594
- for (_len3 = _args4.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
595
- args[_key3] = _args4[_key3];
596
- }
597
- _args = formatArgs([...args]);
591
+ _args = formatArgs(..._args4);
598
592
  rowPath = [...namePath, index];
599
593
  row = form.getFieldValue(rowPath, true);
600
594
  orgRow = cloneDeep(row);
601
595
  _args[1] = row;
602
596
  _context3.t0 = (_TargetComponent3 = TargetComponent) === null || _TargetComponent3 === void 0 || (_TargetComponent3 = _TargetComponent3.props) === null || _TargetComponent3 === void 0 ? void 0 : _TargetComponent3.onBlur;
603
597
  if (!_context3.t0) {
604
- _context3.next = 12;
598
+ _context3.next = 11;
605
599
  break;
606
600
  }
607
- _context3.next = 12;
601
+ _context3.next = 11;
608
602
  return TargetComponent.props.onBlur(..._args);
609
- case 12:
603
+ case 11:
610
604
  _context3.t1 = onBlur;
611
605
  if (!_context3.t1) {
612
- _context3.next = 16;
606
+ _context3.next = 15;
613
607
  break;
614
608
  }
615
- _context3.next = 16;
609
+ _context3.next = 15;
616
610
  return onBlur(..._args);
617
- case 16:
611
+ case 15:
618
612
  // 判断属性是否变动
619
613
  form.setFieldValue(rowPath, row);
620
614
  if (validateTrigger && validateTrigger.includes('onBlur')) {
@@ -627,16 +621,16 @@ var RenderField = _ref => {
627
621
  }
628
622
  }
629
623
  if (!isCell) {
630
- _context3.next = 22;
624
+ _context3.next = 21;
631
625
  break;
632
626
  }
633
- _context3.next = 21;
627
+ _context3.next = 20;
634
628
  return form.validateFields([cellName]);
635
- case 21:
629
+ case 20:
636
630
  setState({
637
631
  cellNamePath: []
638
632
  });
639
- case 22:
633
+ case 21:
640
634
  // 单行编辑时需要 强制更新视图,仅对当前行打标记
641
635
  compatStartTransition(() => {
642
636
  setState({
@@ -645,7 +639,7 @@ var RenderField = _ref => {
645
639
  }
646
640
  });
647
641
  });
648
- case 23:
642
+ case 22:
649
643
  case "end":
650
644
  return _context3.stop();
651
645
  }
@@ -780,10 +774,12 @@ var RenderField = _ref => {
780
774
  });
781
775
 
782
776
  // 更新 componentProps 中的所有响应式属性
783
- finalComponentProps = _objectSpread(_objectSpread(_objectSpread({}, componentProps), {}, {
784
- disabled: latestDisabled
785
- }, latestFieldProps), {}, {
786
- desensitization: latestDesensitization
777
+ finalComponentProps = _objectSpread(_objectSpread(_objectSpread({}, componentProps), latestFieldProps), {}, {
778
+ disabled: latestDisabled,
779
+ desensitization: latestDesensitization,
780
+ // shouldUpdate 模式下,确保事件包装函数不被 fieldProps 覆盖
781
+ onChange: _onChange,
782
+ onBlur: _onblur
787
783
  });
788
784
 
789
785
  // ⭐ 关键修改:在 shouldUpdate 模式下,需要重新设置 TargetComponent
@@ -75,29 +75,37 @@ export declare const useFormItemProps: (column: FlexibleGroupColumnType, context
75
75
  confirm?: boolean | import("antd").ModalFuncProps | import("../../../render/propsType").FunctionArgs<any, boolean | import("antd").ModalFuncProps>;
76
76
  show?: boolean | ReactiveFunction<any, boolean>;
77
77
  component?: React.ReactNode | ReactiveFunction<any, React.ReactNode>;
78
- id?: string;
78
+ toISOString?: boolean;
79
+ toCSTString?: boolean;
80
+ switchValue?: [any, any];
81
+ clearNotShow?: boolean;
82
+ style?: React.CSSProperties;
83
+ valueType?: import("../../../render/propsType").ProFormValueType;
84
+ viewRender?: (value: any, record: any, { form, index, namePath, }: {
85
+ [key: string]: any;
86
+ form: FormInstance<any>;
87
+ index?: number;
88
+ }) => string | React.ReactElement<any, any>;
79
89
  className?: string;
90
+ trim?: boolean;
91
+ desensitization?: [number, number] | ReactiveFunction<any, [number, number]>;
92
+ validateTrigger?: string | false | string[];
93
+ id?: string;
80
94
  hidden?: boolean;
81
- style?: React.CSSProperties;
82
95
  children?: React.ReactNode | ((form: FormInstance<any>) => React.ReactNode);
83
96
  onReset?: () => void;
84
97
  prefixCls?: string;
85
98
  rootClassName?: string;
86
99
  status?: "" | "warning" | "error" | "success" | "validating";
87
- vertical?: boolean;
88
- isView?: boolean;
89
- valueType?: import("../../../render/propsType").ProFormValueType;
90
- trim?: boolean;
91
100
  normalize?: (value: any, prevValue: any, allValues: import("@rc-component/form/lib/interface").Store) => any;
92
- validateTrigger?: string | false | string[];
93
101
  getValueProps?: ((value: any) => Record<string, unknown>) & ((value: any) => Record<string, unknown>);
94
- desensitization?: [number, number] | ReactiveFunction<any, [number, number]>;
102
+ shouldUpdate?: import("@rc-component/form/lib/Field").ShouldUpdate<any>;
95
103
  colon?: boolean;
96
104
  htmlFor?: string;
97
105
  labelAlign?: import("antd/es/form/interface").FormLabelAlign;
98
106
  labelCol?: import("antd").ColProps;
107
+ vertical?: boolean;
99
108
  getValueFromEvent?: (...args: import("@rc-component/form/lib/interface").EventArgs) => any;
100
- shouldUpdate?: import("@rc-component/form/lib/Field").ShouldUpdate<any>;
101
109
  trigger?: string;
102
110
  validateDebounce?: number;
103
111
  valuePropName?: string;
@@ -116,17 +124,9 @@ export declare const useFormItemProps: (column: FlexibleGroupColumnType, context
116
124
  wrapperCol?: import("antd").ColProps;
117
125
  help?: React.ReactNode;
118
126
  fieldId?: string;
119
- switchValue?: [any, any];
120
- viewRender?: (value: any, record: any, { form, index, namePath, }: {
121
- [key: string]: any;
122
- form: FormInstance<any>;
123
- index?: number;
124
- }) => string | React.ReactElement<any, any>;
127
+ isView?: boolean;
125
128
  viewType?: import("../../../render/propsType").ViewType;
126
129
  upperCase?: boolean;
127
- toISOString?: boolean;
128
- toCSTString?: boolean;
129
- clearNotShow?: boolean;
130
130
  name: any;
131
131
  dependencies: any[];
132
132
  tooltip: string | {
@@ -141,7 +141,7 @@ export declare const useFormItemProps: (column: FlexibleGroupColumnType, context
141
141
  * 创建组件属性
142
142
  */
143
143
  export declare const createComponentProps: (column: FlexibleGroupColumnType, formItemProps: any) => {
144
- componentProps: import("lodash").Omit<any, "format" | "valueType" | "precision" | "switchValue" | "dependNames" | "toISOString" | "toCSTString" | "clearNotShow">;
144
+ componentProps: import("lodash").Omit<any, "format" | "toISOString" | "toCSTString" | "switchValue" | "precision" | "clearNotShow" | "dependNames" | "valueType">;
145
145
  formItemTransform: {
146
146
  getValueProps: any;
147
147
  normalize: any;
@@ -84,7 +84,7 @@
84
84
  }
85
85
 
86
86
  .file-name {
87
- display: box;
87
+ display: flex;
88
88
  overflow: hidden;
89
89
  word-break: break-all;
90
90
  line-clamp: 1;
@@ -362,7 +362,7 @@
362
362
  position: absolute;
363
363
  }
364
364
  .file-name {
365
- display: box;
365
+ display: flex;
366
366
  padding-left: var(--zaui-space-size-lg, 32px);
367
367
  overflow: hidden;
368
368
  line-clamp: 1;
@@ -429,7 +429,7 @@
429
429
  position: absolute;
430
430
  }
431
431
  .file-name {
432
- display: box;
432
+ display: flex;
433
433
  padding-left: var(--zaui-space-size-sm, 8px);
434
434
  overflow: hidden;
435
435
  line-clamp: 1;
@@ -56,23 +56,19 @@ var BaseTable = _ref => {
56
56
  _useEditTableError2 = _slicedToArray(_useEditTableError, 1),
57
57
  errorLength = _useEditTableError2[0];
58
58
  var getScroll = (0, _react.useCallback)(() => {
59
- if (scroll !== null && scroll !== void 0 && scroll.x && scroll !== null && scroll !== void 0 && scroll.y) {
60
- return {
61
- x: scroll === null || scroll === void 0 ? void 0 : scroll.x,
62
- y: Number(scroll === null || scroll === void 0 ? void 0 : scroll.y)
63
- };
64
- }
65
- if (scroll !== null && scroll !== void 0 && scroll.x && !(0, _lodash.isNumber)(scroll === null || scroll === void 0 ? void 0 : scroll.y)) {
66
- return {
67
- x: scroll === null || scroll === void 0 ? void 0 : scroll.x
68
- };
59
+ if (!scroll) return null;
60
+ var result = {};
61
+
62
+ // 处理 x
63
+ if (scroll.x !== undefined) {
64
+ result.x = scroll.x;
69
65
  }
70
- if (scroll !== null && scroll !== void 0 && scroll.y && !(scroll !== null && scroll !== void 0 && scroll.x)) {
71
- return {
72
- y: Number(scroll === null || scroll === void 0 ? void 0 : scroll.y)
73
- };
66
+
67
+ // 处理 y 轴:支持数字和字符串(如 calc 表达式)
68
+ if (scroll.y !== undefined) {
69
+ result.y = scroll.y;
74
70
  }
75
- return null;
71
+ return Object.keys(result).length > 0 ? result : null;
76
72
  }, [scroll]);
77
73
  var nextTableProps = _objectSpread(_objectSpread({
78
74
  className,
@@ -7,7 +7,6 @@ exports.default = void 0;
7
7
  var _antd = require("antd");
8
8
  var _react = _interopRequireWildcard(require("react"));
9
9
  var _core = require("@dnd-kit/core");
10
- var _lodash = require("lodash");
11
10
  var _sortable = require("@dnd-kit/sortable");
12
11
  var _utilities = require("@dnd-kit/utilities");
13
12
  var _drag = _interopRequireDefault(require("../../../assets/drag.svg"));
@@ -150,23 +149,19 @@ var DraggableTable = _ref3 => {
150
149
  draggable = draggableProps.draggable,
151
150
  onDragEnd = draggableProps.onDragEnd;
152
151
  var getScroll = (0, _react.useCallback)(() => {
153
- if (scroll !== null && scroll !== void 0 && scroll.x && scroll !== null && scroll !== void 0 && scroll.y) {
154
- return {
155
- x: scroll === null || scroll === void 0 ? void 0 : scroll.x,
156
- y: Number(scroll === null || scroll === void 0 ? void 0 : scroll.y)
157
- };
158
- }
159
- if (scroll !== null && scroll !== void 0 && scroll.x && !(0, _lodash.isNumber)(scroll === null || scroll === void 0 ? void 0 : scroll.y)) {
160
- return {
161
- x: scroll === null || scroll === void 0 ? void 0 : scroll.x
162
- };
152
+ if (!scroll) return null;
153
+ var result = {};
154
+
155
+ // 处理 x
156
+ if (scroll.x !== undefined) {
157
+ result.x = scroll.x;
163
158
  }
164
- if (scroll !== null && scroll !== void 0 && scroll.y && !(scroll !== null && scroll !== void 0 && scroll.x)) {
165
- return {
166
- y: Number(scroll === null || scroll === void 0 ? void 0 : scroll.y)
167
- };
159
+
160
+ // 处理 y 轴:支持数字和字符串(如 calc 表达式)
161
+ if (scroll.y !== undefined) {
162
+ result.y = scroll.y;
168
163
  }
169
- return null;
164
+ return Object.keys(result).length > 0 ? result : null;
170
165
  }, [scroll]);
171
166
  var nextTableProps = _objectSpread(_objectSpread({
172
167
  className,
@@ -383,25 +383,25 @@ var RenderField = _ref => {
383
383
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
384
384
  args[_key] = arguments[_key];
385
385
  }
386
- var _args = args === null || args === void 0 ? void 0 : args[0];
386
+ var rawArgs = (args === null || args === void 0 ? void 0 : args.length) === 1 && Array.isArray(args === null || args === void 0 ? void 0 : args[0]) ? args === null || args === void 0 ? void 0 : args[0] : args;
387
387
  var nextArgs = [];
388
- nextArgs[0] = _args[0];
388
+ nextArgs[0] = rawArgs === null || rawArgs === void 0 ? void 0 : rawArgs[0];
389
389
  // 返回表单元素默认值
390
390
  nextArgs[2] = _objectSpread(_objectSpread({}, options), {}, {
391
- extra: _args
391
+ extra: rawArgs
392
392
  });
393
393
  switch (type) {
394
394
  case 'ProSelect':
395
395
  case 'ProModalSelect':
396
396
  case 'ProEnum':
397
- nextArgs[2].option = _args[1];
397
+ nextArgs[2].option = rawArgs === null || rawArgs === void 0 ? void 0 : rawArgs[1];
398
398
  break;
399
399
  case 'ProCascader':
400
- nextArgs[2].selectedOptions = _args[1];
400
+ nextArgs[2].selectedOptions = rawArgs === null || rawArgs === void 0 ? void 0 : rawArgs[1];
401
401
  break;
402
402
  case 'DatePicker':
403
403
  case 'RangePicker':
404
- nextArgs[2].dateString = _args[1];
404
+ nextArgs[2].dateString = rawArgs === null || rawArgs === void 0 ? void 0 : rawArgs[1];
405
405
  break;
406
406
  default:
407
407
  break;
@@ -577,10 +577,7 @@ var RenderField = _ref => {
577
577
  // 使用useCallback优化_onblur函数
578
578
  var _onblur = (0, _react.useCallback)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
579
579
  var _TargetComponent3;
580
- var _len3,
581
- args,
582
- _key3,
583
- _args,
580
+ var _args,
584
581
  rowPath,
585
582
  row,
586
583
  orgRow,
@@ -598,30 +595,27 @@ var RenderField = _ref => {
598
595
  }
599
596
  return _context3.abrupt("return", null);
600
597
  case 2:
601
- for (_len3 = _args4.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
602
- args[_key3] = _args4[_key3];
603
- }
604
- _args = formatArgs([...args]);
598
+ _args = formatArgs(..._args4);
605
599
  rowPath = [...namePath, index];
606
600
  row = form.getFieldValue(rowPath, true);
607
601
  orgRow = (0, _lodash.cloneDeep)(row);
608
602
  _args[1] = row;
609
603
  _context3.t0 = (_TargetComponent3 = TargetComponent) === null || _TargetComponent3 === void 0 || (_TargetComponent3 = _TargetComponent3.props) === null || _TargetComponent3 === void 0 ? void 0 : _TargetComponent3.onBlur;
610
604
  if (!_context3.t0) {
611
- _context3.next = 12;
605
+ _context3.next = 11;
612
606
  break;
613
607
  }
614
- _context3.next = 12;
608
+ _context3.next = 11;
615
609
  return TargetComponent.props.onBlur(..._args);
616
- case 12:
610
+ case 11:
617
611
  _context3.t1 = onBlur;
618
612
  if (!_context3.t1) {
619
- _context3.next = 16;
613
+ _context3.next = 15;
620
614
  break;
621
615
  }
622
- _context3.next = 16;
616
+ _context3.next = 15;
623
617
  return onBlur(..._args);
624
- case 16:
618
+ case 15:
625
619
  // 判断属性是否变动
626
620
  form.setFieldValue(rowPath, row);
627
621
  if (validateTrigger && validateTrigger.includes('onBlur')) {
@@ -634,16 +628,16 @@ var RenderField = _ref => {
634
628
  }
635
629
  }
636
630
  if (!isCell) {
637
- _context3.next = 22;
631
+ _context3.next = 21;
638
632
  break;
639
633
  }
640
- _context3.next = 21;
634
+ _context3.next = 20;
641
635
  return form.validateFields([cellName]);
642
- case 21:
636
+ case 20:
643
637
  setState({
644
638
  cellNamePath: []
645
639
  });
646
- case 22:
640
+ case 21:
647
641
  // 单行编辑时需要 强制更新视图,仅对当前行打标记
648
642
  (0, _utils.compatStartTransition)(() => {
649
643
  setState({
@@ -652,7 +646,7 @@ var RenderField = _ref => {
652
646
  }
653
647
  });
654
648
  });
655
- case 23:
649
+ case 22:
656
650
  case "end":
657
651
  return _context3.stop();
658
652
  }
@@ -787,10 +781,12 @@ var RenderField = _ref => {
787
781
  });
788
782
 
789
783
  // 更新 componentProps 中的所有响应式属性
790
- finalComponentProps = _objectSpread(_objectSpread(_objectSpread({}, componentProps), {}, {
791
- disabled: latestDisabled
792
- }, latestFieldProps), {}, {
793
- desensitization: latestDesensitization
784
+ finalComponentProps = _objectSpread(_objectSpread(_objectSpread({}, componentProps), latestFieldProps), {}, {
785
+ disabled: latestDisabled,
786
+ desensitization: latestDesensitization,
787
+ // shouldUpdate 模式下,确保事件包装函数不被 fieldProps 覆盖
788
+ onChange: _onChange,
789
+ onBlur: _onblur
794
790
  });
795
791
 
796
792
  // ⭐ 关键修改:在 shouldUpdate 模式下,需要重新设置 TargetComponent
@@ -75,29 +75,37 @@ export declare const useFormItemProps: (column: FlexibleGroupColumnType, context
75
75
  confirm?: boolean | import("antd").ModalFuncProps | import("../../../render/propsType").FunctionArgs<any, boolean | import("antd").ModalFuncProps>;
76
76
  show?: boolean | ReactiveFunction<any, boolean>;
77
77
  component?: React.ReactNode | ReactiveFunction<any, React.ReactNode>;
78
- id?: string;
78
+ toISOString?: boolean;
79
+ toCSTString?: boolean;
80
+ switchValue?: [any, any];
81
+ clearNotShow?: boolean;
82
+ style?: React.CSSProperties;
83
+ valueType?: import("../../../render/propsType").ProFormValueType;
84
+ viewRender?: (value: any, record: any, { form, index, namePath, }: {
85
+ [key: string]: any;
86
+ form: FormInstance<any>;
87
+ index?: number;
88
+ }) => string | React.ReactElement<any, any>;
79
89
  className?: string;
90
+ trim?: boolean;
91
+ desensitization?: [number, number] | ReactiveFunction<any, [number, number]>;
92
+ validateTrigger?: string | false | string[];
93
+ id?: string;
80
94
  hidden?: boolean;
81
- style?: React.CSSProperties;
82
95
  children?: React.ReactNode | ((form: FormInstance<any>) => React.ReactNode);
83
96
  onReset?: () => void;
84
97
  prefixCls?: string;
85
98
  rootClassName?: string;
86
99
  status?: "" | "warning" | "error" | "success" | "validating";
87
- vertical?: boolean;
88
- isView?: boolean;
89
- valueType?: import("../../../render/propsType").ProFormValueType;
90
- trim?: boolean;
91
100
  normalize?: (value: any, prevValue: any, allValues: import("@rc-component/form/lib/interface").Store) => any;
92
- validateTrigger?: string | false | string[];
93
101
  getValueProps?: ((value: any) => Record<string, unknown>) & ((value: any) => Record<string, unknown>);
94
- desensitization?: [number, number] | ReactiveFunction<any, [number, number]>;
102
+ shouldUpdate?: import("@rc-component/form/lib/Field").ShouldUpdate<any>;
95
103
  colon?: boolean;
96
104
  htmlFor?: string;
97
105
  labelAlign?: import("antd/es/form/interface").FormLabelAlign;
98
106
  labelCol?: import("antd").ColProps;
107
+ vertical?: boolean;
99
108
  getValueFromEvent?: (...args: import("@rc-component/form/lib/interface").EventArgs) => any;
100
- shouldUpdate?: import("@rc-component/form/lib/Field").ShouldUpdate<any>;
101
109
  trigger?: string;
102
110
  validateDebounce?: number;
103
111
  valuePropName?: string;
@@ -116,17 +124,9 @@ export declare const useFormItemProps: (column: FlexibleGroupColumnType, context
116
124
  wrapperCol?: import("antd").ColProps;
117
125
  help?: React.ReactNode;
118
126
  fieldId?: string;
119
- switchValue?: [any, any];
120
- viewRender?: (value: any, record: any, { form, index, namePath, }: {
121
- [key: string]: any;
122
- form: FormInstance<any>;
123
- index?: number;
124
- }) => string | React.ReactElement<any, any>;
127
+ isView?: boolean;
125
128
  viewType?: import("../../../render/propsType").ViewType;
126
129
  upperCase?: boolean;
127
- toISOString?: boolean;
128
- toCSTString?: boolean;
129
- clearNotShow?: boolean;
130
130
  name: any;
131
131
  dependencies: any[];
132
132
  tooltip: string | {
@@ -141,7 +141,7 @@ export declare const useFormItemProps: (column: FlexibleGroupColumnType, context
141
141
  * 创建组件属性
142
142
  */
143
143
  export declare const createComponentProps: (column: FlexibleGroupColumnType, formItemProps: any) => {
144
- componentProps: import("lodash").Omit<any, "format" | "valueType" | "precision" | "switchValue" | "dependNames" | "toISOString" | "toCSTString" | "clearNotShow">;
144
+ componentProps: import("lodash").Omit<any, "format" | "toISOString" | "toCSTString" | "switchValue" | "precision" | "clearNotShow" | "dependNames" | "valueType">;
145
145
  formItemTransform: {
146
146
  getValueProps: any;
147
147
  normalize: any;
@@ -84,7 +84,7 @@
84
84
  }
85
85
 
86
86
  .file-name {
87
- display: box;
87
+ display: flex;
88
88
  overflow: hidden;
89
89
  word-break: break-all;
90
90
  line-clamp: 1;
@@ -362,7 +362,7 @@
362
362
  position: absolute;
363
363
  }
364
364
  .file-name {
365
- display: box;
365
+ display: flex;
366
366
  padding-left: var(--zaui-space-size-lg, 32px);
367
367
  overflow: hidden;
368
368
  line-clamp: 1;
@@ -429,7 +429,7 @@
429
429
  position: absolute;
430
430
  }
431
431
  .file-name {
432
- display: box;
432
+ display: flex;
433
433
  padding-left: var(--zaui-space-size-sm, 8px);
434
434
  overflow: hidden;
435
435
  line-clamp: 1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zat-design/sisyphus-react",
3
- "version": "4.1.2-beta.5",
3
+ "version": "4.1.2-beta.6",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",