@cloudtower/eagle 0.27.15 → 0.27.16

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/umd/index.js CHANGED
@@ -6672,18 +6672,18 @@
6672
6672
  error
6673
6673
  } = props;
6674
6674
  const [validateResult, setValidateResult] = React.useState();
6675
- const isTouched = React.useRef(false);
6675
+ const [isTouched, setIsTouched] = React.useState(false);
6676
6676
  const width = typeof column.width === "number" ? column.width + "px" : column.width;
6677
6677
  const isCellErrorStyle = Boolean((validateResult == null ? void 0 : validateResult.isError) || isRowError);
6678
6678
  React.useEffect(() => {
6679
- if (isTouched.current)
6679
+ if (isTouched)
6680
6680
  setValidateResult(
6681
6681
  error ? {
6682
6682
  msg: error,
6683
6683
  isError: true
6684
6684
  } : void 0
6685
6685
  );
6686
- }, [error]);
6686
+ }, [error, isTouched]);
6687
6687
  const triggerValidate = React.useCallback(
6688
6688
  (currentValue) => {
6689
6689
  var _a;
@@ -6708,24 +6708,24 @@
6708
6708
  );
6709
6709
  React.useEffect(() => {
6710
6710
  if (validateAll) {
6711
- isTouched.current = true;
6711
+ setIsTouched(true);
6712
6712
  triggerValidate();
6713
6713
  }
6714
- }, [validateAll, triggerValidate]);
6714
+ }, [validateAll, triggerValidate, setIsTouched]);
6715
6715
  const _onChange = (value, data2) => {
6716
6716
  const newData = data2.map(
6717
6717
  (row, i) => i === rowIndex ? __spreadProps$7(__spreadValues$7({}, row), { [column.key]: value }) : row
6718
6718
  );
6719
6719
  onChange == null ? void 0 : onChange(newData, rowIndex, column.key);
6720
- if (validateTriggerType === ValidateTriggerType.Normal && isTouched.current || validateTriggerType === ValidateTriggerType.Aggressive) {
6720
+ if (validateTriggerType === ValidateTriggerType.Normal && isTouched || validateTriggerType === ValidateTriggerType.Aggressive) {
6721
6721
  triggerValidate(value);
6722
6722
  }
6723
6723
  };
6724
6724
  const _onBlur = React.useCallback(() => {
6725
- isTouched.current = true;
6725
+ setIsTouched(true);
6726
6726
  triggerValidate();
6727
6727
  onBlur == null ? void 0 : onBlur(data, rowIndex, column.key);
6728
- }, [rowIndex, column, onBlur, data, triggerValidate]);
6728
+ }, [rowIndex, column, onBlur, data, triggerValidate, setIsTouched]);
6729
6729
  const renderDefaultComponent = () => {
6730
6730
  if (!column.type)
6731
6731
  return null;