@m4l/layouts 9.3.5-B09072025beta.1 → 9.3.5-B10072025beta.2

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.
@@ -1,2 +1,2 @@
1
1
  export * from './useDynamicAccordions';
2
- export type { useDynamicAccordionsProps, ConfigDynamicAccordion as DynamicAccordion, DynamicAccordionValue, GroupConfigDynamicAccordion as DynamicAccordionGroup } from './types';
2
+ export type { useDynamicAccordionsProps, ConfigDynamicAccordion as DynamicAccordion, DynamicAccordionValue } from './types';
@@ -1,4 +1,4 @@
1
- import { AccordionProps, ContainerFlowProps, PropertyValueProps } from '@m4l/components';
1
+ import { AccordionProps, PropertyValueProps } from '@m4l/components';
2
2
  import { ModuleDetailTabContent } from '../../components/ModuleDetailTabs';
3
3
  export type DynamicAccordionValue<T extends any = any, K extends any = any> = (data: T, endPointData?: K) => string | React.ReactNode;
4
4
  export interface DynamicAccordionProperty<T extends any = any, K extends any = any> extends Omit<PropertyValueProps, 'value' | 'property'> {
@@ -19,16 +19,6 @@ export interface DynamicAccordionProperty<T extends any = any, K extends any = a
19
19
  */
20
20
  isForm?: boolean;
21
21
  }
22
- export interface GroupConfigDynamicAccordion<T extends any = any, K extends any = any> {
23
- /**
24
- * "icon": Icono de la propiedad
25
- */
26
- minWidth?: ContainerFlowProps['minWidth'];
27
- /**
28
- * "children": Propiedades que se ven en el accordion
29
- */
30
- children: ConfigDynamicAccordion<T, K>[];
31
- }
32
22
  export interface ConfigDynamicAccordion<T extends any = any, K extends any = any> {
33
23
  /**
34
24
  * "icon": Icono de la propiedad
@@ -46,12 +36,8 @@ export interface ConfigDynamicAccordion<T extends any = any, K extends any = any
46
36
  * "properties": Propiedades que se ven en el accordion
47
37
  */
48
38
  properties: DynamicAccordionProperty<T, K>[];
49
- /**
50
- * "minWidth": Ancho mínimo del accordion
51
- */
52
- minWidth?: ContainerFlowProps['minWidth'];
53
39
  }
54
40
  export interface useDynamicAccordionsProps<T extends any = any, K extends any = any> {
55
- configDynamicAccordions: ConfigDynamicAccordion<T, K>[] | GroupConfigDynamicAccordion<T, K>[];
41
+ configDynamicAccordions: ConfigDynamicAccordion<T, K>[];
56
42
  }
57
43
  export type useBaseDynamicAccordionsProps<T extends any = any, K extends any = any> = useDynamicAccordionsProps<T, K> & ModuleDetailTabContent;
@@ -1,6 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { useMemo, createElement } from "react";
3
- import { ContainerFlow, Accordion, PropertyValue, Stack } from "@m4l/components";
3
+ import { Accordion, Stack, PropertyValue } from "@m4l/components";
4
4
  import { useModuleDictionary } from "@m4l/core";
5
5
  function useBaseAccordions(props) {
6
6
  const { data, endPointData, configDynamicAccordions: accordions } = props;
@@ -9,52 +9,16 @@ function useBaseAccordions(props) {
9
9
  if (!data) {
10
10
  return null;
11
11
  }
12
- return accordions.map((accordion, index) => {
13
- if ("children" in accordion && accordion.children && accordion.children.length > 0) {
14
- return /* @__PURE__ */ jsx(
15
- ContainerFlow,
16
- {
17
- variant: "column-flex",
18
- minWidth: accordion.minWidth,
19
- gap: "compact",
20
- children: accordion.children.map((child) => /* @__PURE__ */ jsx(
21
- Accordion,
22
- {
23
- icon: child.icon,
24
- label: getLabel(child.dictionaryId),
25
- accordionProps: {
26
- ...child.accordionProps
27
- },
28
- children: /* @__PURE__ */ jsx(ContainerFlow, { variant: "column-flex", minWidth: 150, gap: "standard", children: child.properties.map((property) => {
29
- const value = property.getValue(data, endPointData);
30
- return /* @__PURE__ */ createElement(
31
- PropertyValue,
32
- {
33
- ...property,
34
- key: property.dictionaryId,
35
- property: getLabel(property.dictionaryId),
36
- value,
37
- isForm: property.isForm ?? true
38
- }
39
- );
40
- }) })
41
- },
42
- child.dictionaryId
43
- ))
44
- },
45
- `group-${index}`
46
- );
47
- }
48
- const configAccordion = accordion;
12
+ return accordions.map((accordion) => {
49
13
  return /* @__PURE__ */ jsx(
50
14
  Accordion,
51
15
  {
52
- icon: configAccordion.icon,
53
- label: getLabel(configAccordion.dictionaryId),
16
+ icon: accordion.icon,
17
+ label: getLabel(accordion.dictionaryId),
54
18
  accordionProps: {
55
- ...configAccordion.accordionProps
19
+ ...accordion.accordionProps
56
20
  },
57
- children: /* @__PURE__ */ jsx(Stack, { direction: "column", children: configAccordion.properties.map((property) => {
21
+ children: /* @__PURE__ */ jsx(Stack, { direction: "column", children: accordion.properties.map((property) => {
58
22
  const value = property.getValue(data, endPointData);
59
23
  return /* @__PURE__ */ createElement(
60
24
  PropertyValue,
@@ -67,7 +31,7 @@ function useBaseAccordions(props) {
67
31
  );
68
32
  }) })
69
33
  },
70
- configAccordion.dictionaryId
34
+ accordion.dictionaryId
71
35
  );
72
36
  });
73
37
  }, [accordions, data, endPointData, getLabel]);
@@ -1,5 +1,5 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { ContainerFlow, Stack } from "@m4l/components";
2
+ import { Stack } from "@m4l/components";
3
3
  import { u as useBaseAccordions } from "./useBaseAccordions.js";
4
4
  function useDynamicAccordions(props) {
5
5
  const { configDynamicAccordions } = props;
@@ -10,11 +10,7 @@ function useDynamicAccordions(props) {
10
10
  endPointData,
11
11
  configDynamicAccordions
12
12
  });
13
- const hasChildrens = configDynamicAccordions.some((accordion) => "children" in accordion && accordion.children && accordion.children.length > 0);
14
- if (hasChildrens) {
15
- return /* @__PURE__ */ jsx(ContainerFlow, { variant: "column-flex", minWidth: 370, gap: "compact", children: accordionsComponents });
16
- }
17
- return /* @__PURE__ */ jsx(Stack, { direction: "column", gap: "16px", style: { height: "auto" }, children: accordionsComponents });
13
+ return /* @__PURE__ */ jsx(Stack, { direction: "column", gap: "8px", style: { height: "auto" }, children: accordionsComponents });
18
14
  };
19
15
  }
20
16
  export {
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@m4l/layouts",
3
- "version": "9.3.5-B09072025beta.1",
3
+ "version": "9.3.5-B10072025beta.2",
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": "9.2.62-B09072025beta.1",
10
+ "@m4l/components": "9.2.62-B10072025beta.2",
11
11
  "@m4l/core": "^2.0.0",
12
12
  "@m4l/graphics": "^7.0.0",
13
13
  "@m4l/styles": "^7.0.0"