@m4l/layouts 8.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-10-09 20:00:30 - automatic
8
- * @updatedUser Juan Escobar - automatic
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
  }
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@m4l/layouts",
3
- "version": "8.0.0",
3
+ "version": "9.1.0-beta.0",
4
4
  "license": "UNLICENSED",
5
5
  "author": "M4L Team",
6
6
  "lint-staged": {
7
7
  "*.{js,ts,tsx}": "eslint --fix --max-warnings 0"
8
8
  },
9
9
  "peerDependencies": {
10
- "@m4l/components": "^8.0.0",
10
+ "@m4l/components": "^9.0.0",
11
11
  "@m4l/core": "^2.0.11",
12
12
  "@m4l/graphics": "^7.0.2",
13
13
  "@m4l/styles": "^7.0.1"
package/test/utils.d.ts CHANGED
@@ -1,4 +1,6 @@
1
- import { default as React } from 'react';
1
+ import { RenderResult } from '@testing-library/react';
2
+ import { default as userEvent } from '@testing-library/user-event';
3
+ import { ReactElement } from 'react';
2
4
  /**
3
5
  * Custom render function to wrap providers
4
6
  * @author Juan Escobar - automatic
@@ -6,7 +8,9 @@ import { default as React } from 'react';
6
8
  * @updatedAt 2024-10-09 20:00:30 - automatic
7
9
  * @updatedUser Juan Escobar - automatic
8
10
  */
9
- declare const customRender: (ui: React.ReactElement, options?: {}) => import('@testing-library/react').RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement, HTMLElement>;
11
+ declare const customRender: (ui: ReactElement, options?: {}) => RenderResult & {
12
+ user: ReturnType<typeof userEvent.setup>;
13
+ };
10
14
  export * from '@testing-library/react';
11
15
  export { default as userEvent } from '@testing-library/user-event';
12
16
  export { customRender as render };