@m4l/layouts 0.0.17 → 0.0.20

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,6 @@ export interface MasterDetailContextStateProps {
4
4
  masterSelection?: MasterSelecion;
5
5
  }
6
6
  export interface MasterDetailProviderProps {
7
- masterSelection: MasterSelecion;
8
- setMasterSelection: (newMasterSelecion: MasterSelecion) => void;
9
7
  children: ReactNode;
10
8
  }
11
9
  export interface MasterDetailContextProps extends MasterDetailContextStateProps {
@@ -24,17 +24,13 @@ const initialState = {
24
24
  const MasterDetailContext = createContext(initialState);
25
25
  function MasterDetailProvider(props) {
26
26
  const {
27
- children,
28
- masterSelection,
29
- setMasterSelection
27
+ children
30
28
  } = props;
31
- const onChangeMasterSelection = (newMasterSelection) => {
32
- setMasterSelection(newMasterSelection);
33
- };
29
+ const [masterSelection, setMasterSelection] = useState(void 0);
34
30
  return /* @__PURE__ */ jsx(MasterDetailContext.Provider, {
35
31
  value: {
36
32
  masterSelection,
37
- onChangeMasterSelection
33
+ onChangeMasterSelection: setMasterSelection
38
34
  },
39
35
  children
40
36
  });
@@ -64,7 +60,7 @@ function MasterDetailLayout(props) {
64
60
  moduleId,
65
61
  moduleNameField,
66
62
  detailComponent,
67
- initialModuleActions: moduleActions,
63
+ moduleActions,
68
64
  urlIcon,
69
65
  masterComponent,
70
66
  componentsDictionary,
@@ -78,7 +74,6 @@ function MasterDetailLayout(props) {
78
74
  const [splitPosition, setSplitPosition] = useState("vertical");
79
75
  const isDesktop = useResponsiveDesktop();
80
76
  const moduleLayoutRef = useRef(null);
81
- const [masterSelection, setMasterSelection] = useState(void 0);
82
77
  const onChangePostionInternal = (newPostion) => {
83
78
  const newSplitActions = [...initialSplitActions];
84
79
  for (let i = 0; i < newSplitActions.length; i++) {
@@ -143,14 +138,12 @@ function MasterDetailLayout(props) {
143
138
  }, [splitActions, moduleActions, isDesktop, viewDetailAction]);
144
139
  const finalComponentsDictionary = useMemo(() => componentsDictionary.concat(getMasterDetailLayoutComponentsDictionary()), [componentsDictionary]);
145
140
  return /* @__PURE__ */ jsx(MasterDetailProvider, {
146
- masterSelection,
147
- setMasterSelection,
148
141
  children: /* @__PURE__ */ jsx(ModuleLayout, {
149
142
  ref: moduleLayoutRef,
150
143
  moduleId,
151
144
  moduleNameField,
152
145
  urlIcon,
153
- initialModuleActions: finalModuleActions,
146
+ moduleActions: finalModuleActions,
154
147
  privileges,
155
148
  componentsDictionary: finalComponentsDictionary,
156
149
  breadcrumbLinks,
@@ -6,5 +6,4 @@ export interface ContainerProps {
6
6
  export interface MasterDetailLayoutProps extends Omit<ModuleLayoutProps, 'children'> {
7
7
  masterComponent: ((props?: any) => JSX.Element) | ReactNode;
8
8
  detailComponent: ((props?: any) => JSX.Element) | ReactNode;
9
- onChangeSelected?: (row: any[]) => void;
10
9
  }
@@ -336,7 +336,7 @@ const ModuleLayout = forwardRef((props, ref) => {
336
336
  const {
337
337
  moduleId,
338
338
  moduleNameField = "module_name",
339
- initialModuleActions,
339
+ moduleActions: initialModuleActions,
340
340
  urlIcon,
341
341
  children,
342
342
  componentsDictionary,
@@ -21,7 +21,7 @@ export interface ModuleLayoutProps extends HeaderProps {
21
21
  moduleNameField?: string;
22
22
  privileges: string[];
23
23
  breadcrumbLinks: TLink[];
24
- initialModuleActions: ModuleAction[];
24
+ moduleActions: ModuleAction[];
25
25
  componentsDictionary: string[];
26
26
  children: ReactNode;
27
27
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@m4l/layouts",
3
3
  "private": false,
4
- "version": "0.0.17",
4
+ "version": "0.0.20",
5
5
  "license": "UNLICENSED",
6
6
  "scripts": {
7
7
  "dev": "vite",
@@ -14,7 +14,7 @@
14
14
  "format": "npm run prettier:fix && npm run lint:fix"
15
15
  },
16
16
  "dependencies": {
17
- "@m4l/components": "^0.0.39",
17
+ "@m4l/components": "^0.0.40",
18
18
  "react": "^17.0.0 || 18.x",
19
19
  "react-dom": "^18.0.0"
20
20
  },