react-toolkits 2.22.8 → 2.22.10
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 +12 -0
- package/README.md +350 -26
- package/lib/chunk-4GULXGNG.js +1 -0
- package/lib/chunk-7NM3DK6A.js +1 -0
- package/lib/chunk-FXPGR372.js +0 -0
- package/lib/chunk-HZHE6R72.js +1 -0
- package/lib/chunk-JIBSYGRB.js +1 -0
- package/lib/chunk-JLHCYGWL.js +1 -0
- package/lib/chunk-JTDKSGJR.js +1 -0
- package/lib/chunk-LRMME3YZ.js +2 -0
- package/lib/chunk-MSKNHKMD.js +1 -0
- package/lib/chunk-O7AQM3CB.js +1 -0
- package/lib/chunk-OLM4QNJB.js +1 -0
- package/lib/chunk-RITI5HRV.js +1 -0
- package/lib/chunk-SJK2ZPEL.js +1 -0
- package/lib/chunk-WHOTHZUW.js +1 -0
- package/lib/chunk-X6ZI7RL7.js +1 -0
- package/lib/chunk-XQERUQGQ.js +1 -0
- package/lib/chunk-XWIQENHQ.js +2 -0
- package/lib/chunk-YIJSACFM.js +1 -0
- package/lib/chunk-ZCPZYTPN.js +1 -0
- package/lib/components.d.ts +429 -0
- package/lib/components.js +1 -0
- package/lib/constants.d.ts +11 -0
- package/lib/constants.js +1 -0
- package/lib/createMenuItem-HUQG2HQY.js +1 -0
- package/lib/hooks.d.ts +108 -0
- package/lib/hooks.js +1 -0
- package/lib/index.d.ts +21 -789
- package/lib/index.js +1 -2
- package/lib/menuItemList-AS6ZDOTZ.js +1 -0
- package/lib/modules.d.ts +7 -0
- package/lib/modules.js +1 -0
- package/lib/pages.d.ts +20 -0
- package/lib/pages.js +1 -0
- package/lib/roleDetail-2QUBILZK.js +1 -0
- package/lib/roleList-KWWVOLWJ.js +1 -0
- package/lib/services.d.ts +196 -0
- package/lib/services.js +1 -0
- package/lib/types-DVKf5poe.d.ts +19 -0
- package/lib/types.d.ts +23 -0
- package/lib/types.js +1 -0
- package/lib/updateMenuItem-7SUIOBXS.js +1 -0
- package/lib/userDetail-TXGT2W7X.js +1 -0
- package/lib/userList-ELLBMK76.js +1 -0
- package/lib/utils.d.ts +6 -0
- package/lib/utils.js +1 -0
- package/locale/chunk-GHHHKGNN.js +1 -0
- package/locale/hooks.js +1 -1
- package/locale/index.js +1 -1
- package/package.json +35 -3
package/lib/hooks.d.ts
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { DrawerProps, Button, FormProps, FormInstance, ModalProps } from 'antd';
|
|
3
|
+
import { ReactNode, ComponentProps } from 'react';
|
|
4
|
+
import { AnyObject } from 'antd/es/_util/type';
|
|
5
|
+
import { RecursivePartial } from './types.js';
|
|
6
|
+
import * as zustand from 'zustand';
|
|
7
|
+
|
|
8
|
+
interface UseDrawerOperation {
|
|
9
|
+
hide: () => void;
|
|
10
|
+
}
|
|
11
|
+
interface UseDrawerProps extends Omit<DrawerProps, 'open' | 'confirmLoading' | 'onClose' | 'footer'> {
|
|
12
|
+
content?: ReactNode | ((operation: UseDrawerOperation) => ReactNode);
|
|
13
|
+
onConfirm?: () => void | Promise<void>;
|
|
14
|
+
afterOpen?: () => void | Promise<void>;
|
|
15
|
+
afterClose?: () => void | Promise<void>;
|
|
16
|
+
footer?: ReactNode | null;
|
|
17
|
+
confirmText?: string;
|
|
18
|
+
cancelText?: string;
|
|
19
|
+
confirmButtonProps?: ComponentProps<typeof Button>;
|
|
20
|
+
cancelButtonProps?: ComponentProps<typeof Button>;
|
|
21
|
+
}
|
|
22
|
+
declare function useDrawer(props: UseDrawerProps): {
|
|
23
|
+
id: number;
|
|
24
|
+
show: () => Promise<void>;
|
|
25
|
+
hide: () => void;
|
|
26
|
+
confirmLoading: boolean;
|
|
27
|
+
drawer: react_jsx_runtime.JSX.Element;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
interface UseFormDrawerProps<Values extends AnyObject = AnyObject, ExtraValues = any> extends Omit<UseDrawerProps, 'onConfirm' | 'content' | 'onShow' | 'afterClose'> {
|
|
31
|
+
formProps?: Omit<FormProps, 'form'>;
|
|
32
|
+
form?: FormInstance<Values>;
|
|
33
|
+
content?: ReactNode | ((extraValues: ExtraValues, operation: UseDrawerOperation) => ReactNode);
|
|
34
|
+
onConfirm?: (values: Values, extraValues: ExtraValues) => void | Promise<void>;
|
|
35
|
+
onSuccess?: () => void;
|
|
36
|
+
afterClose?: (form: FormInstance<Values>) => void;
|
|
37
|
+
}
|
|
38
|
+
declare function useFormDrawer<Values extends AnyObject = AnyObject, ExtraValues = any>(props: UseFormDrawerProps<Values, ExtraValues>): {
|
|
39
|
+
id: number;
|
|
40
|
+
show: (options?: {
|
|
41
|
+
initialValues?: RecursivePartial<Values>;
|
|
42
|
+
extraValues?: ExtraValues;
|
|
43
|
+
}) => void;
|
|
44
|
+
hide: () => void;
|
|
45
|
+
drawer: react_jsx_runtime.JSX.Element;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
interface DrawerState {
|
|
49
|
+
open: Map<number, boolean>;
|
|
50
|
+
usedIds: Set<number>;
|
|
51
|
+
isOpen: (uuid: number) => boolean;
|
|
52
|
+
show: (uuid: number) => void;
|
|
53
|
+
hide: (uuid: number) => void;
|
|
54
|
+
hideAll: () => void;
|
|
55
|
+
checkUniqueness: (uuid: number) => boolean;
|
|
56
|
+
registerIds: (uuid: number) => boolean;
|
|
57
|
+
cleanup: (uuid: number) => void;
|
|
58
|
+
}
|
|
59
|
+
declare const useDrawerStore: zustand.UseBoundStore<zustand.StoreApi<DrawerState>>;
|
|
60
|
+
|
|
61
|
+
interface UseModalOperation {
|
|
62
|
+
hide: () => void;
|
|
63
|
+
}
|
|
64
|
+
interface UseModalProps extends Omit<ModalProps, 'open' | 'confirmLoading' | 'onOk' | 'onCancel'> {
|
|
65
|
+
content?: ReactNode | ((operation: UseModalOperation) => ReactNode);
|
|
66
|
+
onConfirm?: () => void | Promise<void>;
|
|
67
|
+
afterOpen?: () => void | Promise<void>;
|
|
68
|
+
afterClose?: () => void | Promise<void>;
|
|
69
|
+
}
|
|
70
|
+
declare function useModal(props: UseModalProps): {
|
|
71
|
+
id: number;
|
|
72
|
+
show: () => Promise<void>;
|
|
73
|
+
hide: () => void;
|
|
74
|
+
modal: react_jsx_runtime.JSX.Element;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
interface UseFormModalProps<Values extends AnyObject = AnyObject, ExtraValues = any> extends Omit<UseModalProps, 'onConfirm' | 'content' | 'onShow' | 'afterClose'> {
|
|
78
|
+
formProps?: Omit<FormProps, 'form'>;
|
|
79
|
+
form?: FormInstance<Values>;
|
|
80
|
+
content?: ReactNode | ((extraValues: ExtraValues, operation: UseModalOperation) => ReactNode);
|
|
81
|
+
onConfirm?: (values: Values, extraValues: ExtraValues) => void | Promise<void>;
|
|
82
|
+
onSuccess?: () => void;
|
|
83
|
+
afterClose?: (form: FormInstance<Values>) => void;
|
|
84
|
+
}
|
|
85
|
+
declare function useFormModal<Values extends AnyObject = AnyObject, ExtraValues = any>(props: UseFormModalProps<Values, ExtraValues>): {
|
|
86
|
+
id: number;
|
|
87
|
+
show: (options?: {
|
|
88
|
+
initialValues?: RecursivePartial<Values>;
|
|
89
|
+
extraValues?: ExtraValues;
|
|
90
|
+
}) => void;
|
|
91
|
+
hide: () => void;
|
|
92
|
+
modal: react_jsx_runtime.JSX.Element;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
interface ModalState {
|
|
96
|
+
open: Map<number, boolean>;
|
|
97
|
+
usedIds: Set<number>;
|
|
98
|
+
isOpen: (uuid: number) => boolean;
|
|
99
|
+
show: (uuid: number) => void;
|
|
100
|
+
hide: (uuid: number) => void;
|
|
101
|
+
hideAll: () => void;
|
|
102
|
+
checkUniqueness: (uuid: number) => boolean;
|
|
103
|
+
registerIds: (uuid: number) => boolean;
|
|
104
|
+
cleanup: (uuid: number) => void;
|
|
105
|
+
}
|
|
106
|
+
declare const useModalStore: zustand.UseBoundStore<zustand.StoreApi<ModalState>>;
|
|
107
|
+
|
|
108
|
+
export { type UseFormDrawerProps, type UseFormModalProps, useDrawer, useDrawerStore, useFormDrawer, useFormModal, useModal, useModalStore };
|
package/lib/hooks.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{b as useDrawer,a as useDrawerStore,c as useFormDrawer}from'./chunk-ZCPZYTPN.js';export{c as useFormModal,b as useModal,a as useModalStore}from'./chunk-HZHE6R72.js';import'./chunk-OLM4QNJB.js';
|