tdesign-react 0.42.5-alpha.2 → 0.42.5-alpha.3

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/tdesign.js CHANGED
@@ -45433,7 +45433,8 @@
45433
45433
  var key = 0;
45434
45434
  var FormList = function FormList(props) {
45435
45435
  var _useFormContext = useFormContext(),
45436
- formMapRef = _useFormContext.formMapRef;
45436
+ formMapRef = _useFormContext.formMapRef,
45437
+ form = _useFormContext.form;
45437
45438
  var name = props.name,
45438
45439
  _props$initialData = props.initialData,
45439
45440
  initialData = _props$initialData === void 0 ? [] : _props$initialData,
@@ -45481,6 +45482,10 @@
45481
45482
  var nextFields = fields.filter(function (item) {
45482
45483
  if (Array.isArray(index)) return !index.includes(item.name);
45483
45484
  return item.name !== index;
45485
+ }).map(function (field, i) {
45486
+ return _objectSpread$G(_objectSpread$G({}, field), {}, {
45487
+ name: i
45488
+ });
45484
45489
  });
45485
45490
  setInitialValue(initialValue.filter(function (_, idx) {
45486
45491
  return idx !== index;
@@ -45524,6 +45529,8 @@
45524
45529
  });
45525
45530
  }, [initialValue]);
45526
45531
  React.useEffect(function () {
45532
+ var _form$getInternalHook, _form$getInternalHook2, _form$getInternalHook3;
45533
+ form === null || form === void 0 ? void 0 : (_form$getInternalHook = form.getInternalHooks) === null || _form$getInternalHook === void 0 ? void 0 : (_form$getInternalHook2 = _form$getInternalHook.call(form, HOOK_MARK)) === null || _form$getInternalHook2 === void 0 ? void 0 : (_form$getInternalHook3 = _form$getInternalHook2.notifyWatch) === null || _form$getInternalHook3 === void 0 ? void 0 : _form$getInternalHook3.call(_form$getInternalHook2, name);
45527
45534
  var currentQueue = fieldsTaskQueueRef.current.pop();
45528
45535
  if (!currentQueue) return;
45529
45536
  _toConsumableArray(formListMapRef.current.values()).forEach(function (formItemRef) {
@@ -45534,7 +45541,7 @@
45534
45541
  var data = get_1(fieldData, name2);
45535
45542
  callback(formItemRef, data);
45536
45543
  });
45537
- }, [fields]);
45544
+ }, [form, fields]);
45538
45545
  React.useEffect(function () {
45539
45546
  if (!name || !formMapRef) return;
45540
45547
  formMapRef.current.set(name, formListRef);
@@ -45555,9 +45562,7 @@
45555
45562
  var fieldValue = calcFieldValue(name2, getValue());
45556
45563
  merge_1(formListValue, fieldValue);
45557
45564
  });
45558
- return formListValue.filter(function (item) {
45559
- return !!item;
45560
- });
45565
+ return formListValue;
45561
45566
  },
45562
45567
  validate: function validate() {
45563
45568
  var trigger = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "all";