@m4l/layouts 9.0.0 → 9.1.0-beta.0
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.
|
@@ -4,8 +4,8 @@ declare const MasterDetailContext: import('react').Context<MasterDetailContextPr
|
|
|
4
4
|
* Proveedor de contexto para el layout de maestro detalle
|
|
5
5
|
* @author Juan Escobar - automatic
|
|
6
6
|
* @createdAt 2024-10-09 19:56:26 - automatic
|
|
7
|
-
* @updatedAt 2024-
|
|
8
|
-
* @updatedUser
|
|
7
|
+
* @updatedAt 2024-11-28 16:23:20 - automatic
|
|
8
|
+
* @updatedUser Diego Betancur - automatic
|
|
9
9
|
*/
|
|
10
10
|
declare function MasterDetailProvider(props: MasterDetailProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
export { MasterDetailProvider, MasterDetailContext };
|
|
@@ -4,19 +4,24 @@ import { voidFunction } from "@m4l/core";
|
|
|
4
4
|
const initialState = {
|
|
5
5
|
masterSelection: void 0,
|
|
6
6
|
onChangeMasterSelection: voidFunction,
|
|
7
|
-
onClickViewDetail: voidFunction
|
|
7
|
+
onClickViewDetail: voidFunction,
|
|
8
|
+
refreshMaster: voidFunction,
|
|
9
|
+
setRefreshMaster: voidFunction
|
|
8
10
|
};
|
|
9
11
|
const MasterDetailContext = createContext(initialState);
|
|
10
12
|
function MasterDetailProvider(props) {
|
|
11
13
|
const { children, onClickViewDetail } = props;
|
|
12
14
|
const [masterSelection, setMasterSelection] = useState(void 0);
|
|
15
|
+
const [refreshMaster, setRefreshMaster] = useState(voidFunction);
|
|
13
16
|
return /* @__PURE__ */ jsx(
|
|
14
17
|
MasterDetailContext.Provider,
|
|
15
18
|
{
|
|
16
19
|
value: {
|
|
17
20
|
masterSelection,
|
|
18
21
|
onChangeMasterSelection: setMasterSelection,
|
|
19
|
-
onClickViewDetail
|
|
22
|
+
onClickViewDetail,
|
|
23
|
+
refreshMaster,
|
|
24
|
+
setRefreshMaster
|
|
20
25
|
},
|
|
21
26
|
children
|
|
22
27
|
}
|
|
@@ -9,4 +9,6 @@ export interface MasterDetailProviderProps {
|
|
|
9
9
|
}
|
|
10
10
|
export interface MasterDetailContextProps extends MasterDetailContextStateProps, Pick<MasterDetailProviderProps, 'onClickViewDetail'> {
|
|
11
11
|
onChangeMasterSelection: (newMasterSelection: MasterSelecion) => void;
|
|
12
|
+
refreshMaster: () => void;
|
|
13
|
+
setRefreshMaster: (callback: () => void) => void;
|
|
12
14
|
}
|