react-toolkits 2.13.14 → 2.13.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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # react-toolkits
2
2
 
3
+ ## 2.13.16
4
+
5
+ ### Patch Changes
6
+
7
+ - 836e406: alpha
8
+
9
+ ## 2.13.15
10
+
11
+ ### Patch Changes
12
+
13
+ - 6012610: fix: data should be refresh
14
+
3
15
  ## 2.13.14
4
16
 
5
17
  ### Patch Changes
package/lib/index.d.ts CHANGED
@@ -153,6 +153,7 @@ interface UseModalOperation {
153
153
  interface UseModalProps extends Omit<ModalProps, 'open' | 'confirmLoading' | 'onOk' | 'onCancel'> {
154
154
  content?: ReactNode | ((operation: UseModalOperation) => ReactNode);
155
155
  onConfirm?: () => void | Promise<void>;
156
+ afterOpen?: () => void | Promise<void>;
156
157
  }
157
158
  declare function useModal(props: UseModalProps): {
158
159
  id: number;
package/lib/index.js CHANGED
@@ -1037,7 +1037,7 @@ var init_stores4 = __esm({
1037
1037
  }
1038
1038
  });
1039
1039
  function useModal(props) {
1040
- const { content, onConfirm, ...modalProps } = props;
1040
+ const { content, onConfirm, afterOpen, ...modalProps } = props;
1041
1041
  const _id = useMemo(() => ++id, []);
1042
1042
  const { show, hide, isOpen } = useModalStore();
1043
1043
  const open = isOpen(_id);
@@ -1045,6 +1045,7 @@ function useModal(props) {
1045
1045
  const isRenderFunction = typeof content === "function";
1046
1046
  const _show = () => {
1047
1047
  show(_id);
1048
+ afterOpen?.();
1048
1049
  };
1049
1050
  const _hide = () => {
1050
1051
  hide(_id);
@@ -3213,7 +3214,6 @@ var InternalInfiniteList = (props, ref) => {
3213
3214
  try {
3214
3215
  await _form.validateFields();
3215
3216
  setIsValid(true);
3216
- setSize(1);
3217
3217
  mutate2();
3218
3218
  } catch (_) {
3219
3219
  setSize(0);
@@ -3227,7 +3227,7 @@ var InternalInfiniteList = (props, ref) => {
3227
3227
  try {
3228
3228
  _form.resetFields();
3229
3229
  await _form.validateFields({ validateOnly: true });
3230
- setSize(1);
3230
+ mutate2();
3231
3231
  } catch (error) {
3232
3232
  setSize(0);
3233
3233
  }