@m4l/layouts 9.1.14 → 9.2.0-beta.1
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/components/DynamicTabs/DynamicTabs.d.ts +5 -0
- package/components/DynamicTabs/DynamicTabs.js +39 -0
- package/components/DynamicTabs/index.d.ts +2 -0
- package/components/DynamicTabs/index.js +1 -0
- package/components/DynamicTabs/types.d.ts +31 -0
- package/components/DynamicTabs/useDynamicTabs.d.ts +9 -0
- package/components/DynamicTabs/useDynamicTabs.js +23 -0
- package/components/ModuleDetailTabs/useModuleDatailTabs.d.ts +83 -83
- package/components/index.d.ts +1 -0
- package/constants.d.ts +4 -0
- package/constants.js +33 -0
- package/hooks/index.d.ts +2 -0
- package/hooks/useDynamicAccordions/types.d.ts +20 -19
- package/hooks/useDynamicAccordions/useBaseAccordions.d.ts +1 -1
- package/hooks/useDynamicAccordions/useBaseAccordions.js +12 -8
- package/hooks/useDynamicPaperForm/index.d.ts +2 -0
- package/hooks/useDynamicPaperForm/index.js +1 -0
- package/hooks/useDynamicPaperForm/types.d.ts +25 -0
- package/hooks/useDynamicPaperForm/useDynamicPaperForm.d.ts +9 -0
- package/hooks/useDynamicPaperForm/useDynamicPaperForm.js +55 -0
- package/hooks/useNetworkActionConfirm/index.d.ts +1 -0
- package/hooks/useNetworkActionConfirm/index.js +1 -0
- package/hooks/useNetworkActionConfirm/types.d.ts +19 -0
- package/hooks/useNetworkActionConfirm/useNetworkActionConfirm.d.ts +7 -0
- package/hooks/useNetworkActionConfirm/useNetworkActionConfirm.js +49 -0
- package/index.d.ts +1 -0
- package/index.js +12 -3
- package/layouts/MasterDetailLayout/contexts/MasterDetailContext/index.js +1 -1
- package/layouts/MasterDetailLayout/contexts/MasterDetailContext/store.js +3 -1
- package/layouts/ModuleLayout/contexts/ModuleContext/store.js +3 -1
- package/package.json +1 -1
- package/commonjs/index.js +0 -7
- package/not_recognized/index.js +0 -964
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useModal, useWindowToolsMF, WindowConfirm } from "@m4l/components";
|
|
3
|
+
import { useNetwork, useHostTools } from "@m4l/core";
|
|
4
|
+
import { useCallback } from "react";
|
|
5
|
+
function useNetworkActionConfirm(props) {
|
|
6
|
+
const { fullRefresh, getEndPoint, title, message } = props;
|
|
7
|
+
const { networkOperation } = useNetwork();
|
|
8
|
+
const { toast } = useHostTools();
|
|
9
|
+
const { openModal, closeModal } = useModal();
|
|
10
|
+
const { startProgress, stopProgress } = useWindowToolsMF();
|
|
11
|
+
const onConfirm = useCallback((obj) => {
|
|
12
|
+
networkOperation({
|
|
13
|
+
options: {
|
|
14
|
+
startProgress,
|
|
15
|
+
stopProgress
|
|
16
|
+
},
|
|
17
|
+
...getEndPoint(obj)
|
|
18
|
+
}).then((response) => {
|
|
19
|
+
toast({ title: `${response.message}` }, { type: "success" });
|
|
20
|
+
}).catch((response) => {
|
|
21
|
+
toast({ title: `${response.message}` }, { type: "error" });
|
|
22
|
+
}).finally(() => {
|
|
23
|
+
fullRefresh(obj);
|
|
24
|
+
});
|
|
25
|
+
closeModal();
|
|
26
|
+
}, [closeModal, fullRefresh, networkOperation, toast, startProgress, stopProgress, getEndPoint]);
|
|
27
|
+
const onAction = useCallback(
|
|
28
|
+
(obj) => {
|
|
29
|
+
openModal({
|
|
30
|
+
window: /* @__PURE__ */ jsx(
|
|
31
|
+
WindowConfirm,
|
|
32
|
+
{
|
|
33
|
+
title,
|
|
34
|
+
msg: message,
|
|
35
|
+
onClickIntro: () => onConfirm(obj)
|
|
36
|
+
}
|
|
37
|
+
),
|
|
38
|
+
variant: "delete",
|
|
39
|
+
initialWidth: 300,
|
|
40
|
+
initialHeight: 350
|
|
41
|
+
});
|
|
42
|
+
},
|
|
43
|
+
[message, onConfirm, openModal, title]
|
|
44
|
+
);
|
|
45
|
+
return { onAction };
|
|
46
|
+
}
|
|
47
|
+
export {
|
|
48
|
+
useNetworkActionConfirm as u
|
|
49
|
+
};
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { L } from "./constants.js";
|
|
1
2
|
import { M } from "./components/MFNoAuthApp/index.js";
|
|
2
3
|
import { M as M2 } from "./components/MFHostApp/MFHostApp.js";
|
|
3
4
|
import { M as M3 } from "./components/ModuleDetailTabs/ModuleDetailTabs.js";
|
|
5
|
+
import { D } from "./components/DynamicTabs/DynamicTabs.js";
|
|
4
6
|
import { A, a } from "./contexts/AuthContext/index.js";
|
|
5
7
|
import { M as M4 } from "./layouts/ModuleLayout/ModuleLayout.js";
|
|
6
8
|
import { N } from "./layouts/NoAuthModuleLayout/index.js";
|
|
@@ -12,17 +14,22 @@ import { u } from "./hooks/useMasterDetail/index.js";
|
|
|
12
14
|
import { u as u2 } from "./hooks/useAuth/index.js";
|
|
13
15
|
import { u as u3 } from "./hooks/useModule/index.js";
|
|
14
16
|
import { u as u4 } from "./hooks/useDynamicAccordions/useDynamicAccordions.js";
|
|
15
|
-
import { c } from "./
|
|
17
|
+
import { c, u as u5 } from "./hooks/useDynamicPaperForm/useDynamicPaperForm.js";
|
|
18
|
+
import { u as u6 } from "./hooks/useNetworkActionConfirm/useNetworkActionConfirm.js";
|
|
19
|
+
import { c as c2 } from "./utils/createAppMF.js";
|
|
16
20
|
export {
|
|
17
21
|
A as AuthContext,
|
|
18
22
|
a as AuthProvider,
|
|
23
|
+
D as DynamicTabs,
|
|
24
|
+
L as LIMIT_RECORDS_500_CONFIG,
|
|
19
25
|
M2 as MFHostApp,
|
|
20
26
|
M as MFNoAuthApp,
|
|
21
27
|
M5 as MasterDetailLayout,
|
|
22
28
|
M3 as ModuleDetailTabs,
|
|
23
29
|
M4 as ModuleLayout,
|
|
24
30
|
N as NoAuthModuleLayout,
|
|
25
|
-
|
|
31
|
+
c2 as createAppMF,
|
|
32
|
+
c as createComponentField,
|
|
26
33
|
d as defaultModuleLayoutDictionary,
|
|
27
34
|
d2 as defaultNoAuthModuleLayoutDictionary,
|
|
28
35
|
g2 as getMasterDetailLayoutComponentsDictionary,
|
|
@@ -30,6 +37,8 @@ export {
|
|
|
30
37
|
g3 as getNoAuthModuleLayoutComponentsDictionary,
|
|
31
38
|
u2 as useAuth,
|
|
32
39
|
u4 as useDynamicAccordions,
|
|
40
|
+
u5 as useDynamicPaperForm,
|
|
33
41
|
u as useMasterDetail,
|
|
34
|
-
u3 as useModule
|
|
42
|
+
u3 as useModule,
|
|
43
|
+
u6 as useNetworkActionConfirm
|
|
35
44
|
};
|
|
@@ -2,7 +2,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { createContext, useRef } from "react";
|
|
3
3
|
import { voidFunction } from "@m4l/core";
|
|
4
4
|
import { c as createMasterDetailLayoutStore } from "./store.js";
|
|
5
|
-
import {
|
|
5
|
+
import { useStore } from "zustand";
|
|
6
6
|
const initialState = {
|
|
7
7
|
masterSelection: void 0,
|
|
8
8
|
onChangeMasterSelection: voidFunction,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { create } from "zustand";
|
|
2
|
+
import { devtools } from "zustand/middleware";
|
|
3
|
+
import { immer } from "zustand/middleware/immer";
|
|
2
4
|
import { a as MASTER_DETAIL_LAYOUT_STORE_ID } from "../../constants.js";
|
|
3
5
|
const createDevtools = (immerMiddlewere, config) => {
|
|
4
6
|
const { enabled = false } = config;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { create } from "zustand";
|
|
2
|
+
import { devtools } from "zustand/middleware";
|
|
3
|
+
import { immer } from "zustand/middleware/immer";
|
|
2
4
|
import { M as MODULE_LAYOUT_STORE_ID } from "../../constants.js";
|
|
3
5
|
const createDevtools = (immerMiddlewere, config) => {
|
|
4
6
|
const { enabled = false } = config;
|
package/package.json
CHANGED