@m4l/components 9.1.104 → 9.1.105

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.
Files changed (23) hide show
  1. package/@types/types.d.ts +10 -0
  2. package/components/CommonActions/components/ActionFormIntro/ActionFormIntro.d.ts +9 -0
  3. package/components/CommonActions/components/ActionFormIntro/ActionFormIntro.js +34 -0
  4. package/components/CommonActions/components/ActionFormIntro/ActionFromIntro.styles.d.ts +2 -0
  5. package/components/CommonActions/components/ActionFormIntro/ActionFromIntro.styles.js +7 -0
  6. package/components/CommonActions/components/ActionFormIntro/constanst.d.ts +6 -0
  7. package/components/CommonActions/components/ActionFormIntro/constanst.js +7 -0
  8. package/components/CommonActions/components/ActionFormIntro/slots/ActionFormIntroEnum.d.ts +3 -0
  9. package/components/CommonActions/components/ActionFormIntro/slots/ActionFormIntroEnum.js +7 -0
  10. package/components/CommonActions/components/ActionFormIntro/slots/ActionFormIntroSlots.d.ts +3 -0
  11. package/components/CommonActions/components/ActionFormIntro/slots/ActionFormIntroSlots.js +12 -0
  12. package/components/CommonActions/components/ActionFormIntro/slots/index.d.ts +2 -0
  13. package/components/CommonActions/components/ActionFormIntro/slots/index.js +1 -0
  14. package/components/CommonActions/components/ActionFormIntro/test/ActionFormIntro.test.d.ts +1 -0
  15. package/components/CommonActions/components/ActionFormIntro/types.d.ts +14 -0
  16. package/components/CommonActions/dictionary.d.ts +3 -0
  17. package/components/CommonActions/dictionary.js +4 -0
  18. package/components/CommonActions/index.d.ts +1 -1
  19. package/components/maps/components/MapGpsTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/subcomponents/MyActions/index.js +1 -1
  20. package/index.js +7 -6
  21. package/package.json +1 -1
  22. package/components/CommonActions/components/ActionFormIntro/index.d.ts +0 -5
  23. package/components/CommonActions/components/ActionFormIntro/index.js +0 -30
package/@types/types.d.ts CHANGED
@@ -133,6 +133,9 @@ import { RHFCheckBoxOwnerState, RHFCheckBoxSlotsType } from '../components/hook-
133
133
  import { AreasAdminOwnerState, AreasAdminType } from '../components/areas/components/AreasAdmin/types';
134
134
  import { DateTimePickerOwnerState, DateTimePickerSlotsType } from '../components/mui_extended/DateTimePicker/types';
135
135
  import { DividerOwnerState, DividerSlotsType } from '../components/mui_extended/Divider/types';
136
+ import { ActionFormIntroOwnerState, ActionFormIntroSlotsType } from '../components/CommonActions/components/ActionFormIntro/types';
137
+
138
+
136
139
  declare module '@mui/material/styles' {
137
140
  // Define the slots in the theme
138
141
  interface ComponentNameToClassKey {
@@ -197,6 +200,7 @@ declare module '@mui/material/styles' {
197
200
  M4LStack: StackSlotsType;
198
201
  M4LDateTimePicker: DateTimePickerSlotsType;
199
202
  M4LDivider: DividerSlotsType;
203
+ M4LActionFormIntro: ActionFormIntroSlotsType;
200
204
  }
201
205
  interface ComponentsPropsList {
202
206
  // Extend ComponentsProps or ComponentsOwnerState(this extend ComponentProps)
@@ -261,6 +265,7 @@ declare module '@mui/material/styles' {
261
265
  M4LStack: Partial<StackOwnerState>;
262
266
  M4LDateTimePicker: Partial<DateTimePickerOwnerState>;
263
267
  M4LDivider: Partial<DividerOwnerState>;
268
+ M4LActionFormIntro : Partial<ActionFormIntroOwnerState>;
264
269
  }
265
270
  interface Components {
266
271
  M4LDynamicFilter?: {
@@ -562,6 +567,11 @@ declare module '@mui/material/styles' {
562
567
  styleOverrides?: ComponentsOverrides<Theme>['M4LDateTimePicker'];
563
568
  variants?: ComponentsVariants['M4LDateTimePicker'];
564
569
  };
570
+ M4LActionFormIntro?: {
571
+ defaultProps?: ComponentsPropsList['M4LActionFormIntro '];
572
+ styleOverrides?: ComponentsOverrides<Theme>['M4LActionFormIntro '];
573
+ variants?: ComponentsVariants['M4LActionFormIntro '];
574
+ };
565
575
  M4LDivider?: {
566
576
  defaultProps?: ComponentsPropsList['M4LDivider'];
567
577
  styleOverrides?: ComponentsOverrides<Theme>['M4LDivider'];
@@ -0,0 +1,9 @@
1
+ import { ActionsFormIntroProps } from './types';
2
+ /**
3
+ * Este componente es útil en formularios donde se necesita un botón de envío con
4
+ * funcionalidad de carga y soporte para internacionalización.
5
+ * @createdAt 2024-12-31 11:23:50 - automatic
6
+ * @updatedAt 2025-01-03 11:42:14 - automatic
7
+ * @updatedUser Andrés Quintero - automatic
8
+ */
9
+ export declare function ActionFormIntro(props: ActionsFormIntroProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,34 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useFormContext, useFormState } from "react-hook-form";
3
+ import { useModuleDictionary } from "@m4l/core";
4
+ import { c as classActoinFormIntroRoot } from "./constanst.js";
5
+ import { clsx } from "clsx";
6
+ import { D as DICTIONARY } from "../../dictionary.js";
7
+ import { u as useComponentSize } from "../../../../hooks/useComponentSize/useComponentSize.js";
8
+ import { L as LoadingButtonActionFormIntroRootStyled } from "./slots/ActionFormIntroSlots.js";
9
+ function ActionFormIntro(props) {
10
+ const { variant = "contained", color = "primary", className, label, size = "medium", ...others } = props;
11
+ const { getLabel } = useModuleDictionary();
12
+ const finalLabel = label || getLabel(DICTIONARY.LABEL_INTRO);
13
+ const { control } = useFormContext();
14
+ const { isSubmitting } = useFormState({ control });
15
+ const { currentSize } = useComponentSize(size);
16
+ const adjustedSize = currentSize === "small" || currentSize === "medium" ? currentSize : "medium";
17
+ return /* @__PURE__ */ jsx(
18
+ LoadingButtonActionFormIntroRootStyled,
19
+ {
20
+ ownerState: {},
21
+ variant,
22
+ type: "submit",
23
+ color,
24
+ loading: isSubmitting,
25
+ size: adjustedSize,
26
+ className: clsx(classActoinFormIntroRoot, className),
27
+ label: finalLabel,
28
+ ...others
29
+ }
30
+ );
31
+ }
32
+ export {
33
+ ActionFormIntro as A
34
+ };
@@ -0,0 +1,2 @@
1
+ import { ActionFormIntroStyles } from './types';
2
+ export declare const actionFormIntroStyles: ActionFormIntroStyles;
@@ -0,0 +1,7 @@
1
+ const actionFormIntroStyles = {
2
+ /** 🌳 Estilos para el componente raiz 🌳 */
3
+ root: () => ({})
4
+ };
5
+ export {
6
+ actionFormIntroStyles as a
7
+ };
@@ -0,0 +1,6 @@
1
+ export declare const ACTION_FORM_INTRO_KEY_COMPONENT = "M4LActionFormIntro";
2
+ /**
3
+ * Nombre de clase creado para aportar especificidad a los estilos del componente. Es usado para sobreescribir los estilos de MUI sin
4
+ * tener la necesidad de agregar valores en !important.
5
+ */
6
+ export declare const classActoinFormIntroRoot: string;
@@ -0,0 +1,7 @@
1
+ import { a as getComponentSlotRoot } from "../../../../utils/getComponentSlotRoot.js";
2
+ const ACTION_FORM_INTRO_KEY_COMPONENT = "M4LActionFormIntro";
3
+ const classActoinFormIntroRoot = getComponentSlotRoot(ACTION_FORM_INTRO_KEY_COMPONENT);
4
+ export {
5
+ ACTION_FORM_INTRO_KEY_COMPONENT as A,
6
+ classActoinFormIntroRoot as c
7
+ };
@@ -0,0 +1,3 @@
1
+ export declare enum ActionFormIntroSlots {
2
+ root = "root"
3
+ }
@@ -0,0 +1,7 @@
1
+ var ActionFormIntroSlots = /* @__PURE__ */ ((ActionFormIntroSlots2) => {
2
+ ActionFormIntroSlots2["root"] = "root";
3
+ return ActionFormIntroSlots2;
4
+ })(ActionFormIntroSlots || {});
5
+ export {
6
+ ActionFormIntroSlots as A
7
+ };
@@ -0,0 +1,3 @@
1
+ export declare const LoadingButtonActionFormIntroRootStyled: import('@emotion/styled').StyledComponent<Pick<import('../../../../mui_extended/LoadingButton/types').LoadingButtonProps, keyof import('../../../../mui_extended/LoadingButton/types').LoadingButtonProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').ActionFormIntroOwnerState> & Record<string, unknown> & {
2
+ ownerState: Partial<import('../types').ActionFormIntroOwnerState> & Record<string, unknown>;
3
+ }, {}, {}>;
@@ -0,0 +1,12 @@
1
+ import { styled } from "@mui/material";
2
+ import { L as LoadingButton } from "../../../../mui_extended/LoadingButton/LoadingButton.js";
3
+ import { A as ACTION_FORM_INTRO_KEY_COMPONENT } from "../constanst.js";
4
+ import { A as ActionFormIntroSlots } from "./ActionFormIntroEnum.js";
5
+ import { a as actionFormIntroStyles } from "../ActionFromIntro.styles.js";
6
+ const LoadingButtonActionFormIntroRootStyled = styled(LoadingButton, {
7
+ name: ACTION_FORM_INTRO_KEY_COMPONENT,
8
+ slot: ActionFormIntroSlots.root
9
+ })(actionFormIntroStyles?.root);
10
+ export {
11
+ LoadingButtonActionFormIntroRootStyled as L
12
+ };
@@ -0,0 +1,2 @@
1
+ export * from './ActionFormIntroEnum';
2
+ export * from './ActionFormIntroSlots';
@@ -1,4 +1,18 @@
1
+ import { Sizes } from '@m4l/styles';
2
+ import { Theme } from '@mui/material';
3
+ import { OverridesStyleRules } from '@mui/material/styles/overrides';
1
4
  import { LoadingButtonProps } from '../../../mui_extended/LoadingButton/types';
5
+ import { ACTION_FORM_INTRO_KEY_COMPONENT } from './constanst';
6
+ import { ActionFormIntroSlots } from './slots/ActionFormIntroEnum';
2
7
  export interface ActionsFormIntroProps extends Omit<LoadingButtonProps, 'label'> {
3
8
  label?: string;
9
+ size?: Extract<Sizes, 'small' | 'medium'>;
10
+ className?: string;
11
+ skeletonWidth?: string;
12
+ dictionaryId?: string;
4
13
  }
14
+ export type OwnerState = Pick<LoadingButtonProps, 'size'>;
15
+ export interface ActionFormIntroOwnerState extends LoadingButtonProps, OwnerState {
16
+ }
17
+ export type ActionFormIntroType = keyof typeof ActionFormIntroSlots;
18
+ export type ActionFormIntroStyles = OverridesStyleRules<ActionFormIntroSlots, typeof ACTION_FORM_INTRO_KEY_COMPONENT, Theme>;
@@ -1,3 +1,6 @@
1
1
  import { Dictionary } from '@m4l/core';
2
2
  export declare function getCommonActionsDictionary(): string[];
3
3
  export declare const defaultCommonActionsDictionary: Dictionary;
4
+ export declare const DICTIONARY: {
5
+ readonly LABEL_INTRO: "common_actions.intro";
6
+ };
@@ -9,7 +9,11 @@ const defaultCommonActionsDictionary = {
9
9
  confirm_quit_msg: "Are your sure exit?"
10
10
  }
11
11
  };
12
+ const DICTIONARY = {
13
+ LABEL_INTRO: "common_actions.intro"
14
+ };
12
15
  export {
16
+ DICTIONARY as D,
13
17
  defaultCommonActionsDictionary as d,
14
18
  getCommonActionsDictionary as g
15
19
  };
@@ -2,6 +2,6 @@ export { ActionsContainer } from './components/ActionsContainer/ActionsContainer
2
2
  export { ActionCancel } from './components/ActionCancel';
3
3
  export { ActionIntro } from './components/ActionIntro';
4
4
  export { ActionFormCancel } from './components/ActionFormCancel';
5
- export { ActionFormIntro } from './components/ActionFormIntro';
5
+ export { ActionFormIntro } from './components/ActionFormIntro/ActionFormIntro';
6
6
  export { getCommonActionsDictionary } from './dictionary';
7
7
  export * from './dictionary';
@@ -7,7 +7,7 @@ import { M as MAP_GPSTOOLS_DICCTIONARY } from "../../../../../../dictionary.js";
7
7
  import { u as usePopupsStore } from "../../../../../../../../../popups/components/PopupsProvider/hooks/usePopupsStore/index.js";
8
8
  import { u as useMapGpsToolsStore } from "../../../../../../hooks/useMapGpsToolsStore/index.js";
9
9
  import { R as RHFHelperError } from "../../../../../../../../../hook-form/RHFHelperError/index.js";
10
- import { A as ActionFormIntro } from "../../../../../../../../../CommonActions/components/ActionFormIntro/index.js";
10
+ import { A as ActionFormIntro } from "../../../../../../../../../CommonActions/components/ActionFormIntro/ActionFormIntro.js";
11
11
  import { W as WindowConfirm } from "../../../../../../../../../WindowConfirm/WindowConfirm.js";
12
12
  import { A as ActionsContainer } from "../../../../../../../../../CommonActions/components/ActionsContainer/ActionsContainer.js";
13
13
  import { B as Button } from "../../../../../../../../../mui_extended/Button/Button.js";
package/index.js CHANGED
@@ -73,9 +73,9 @@ import { A as A6 } from "./components/CommonActions/components/ActionsContainer/
73
73
  import { A as A7 } from "./components/CommonActions/components/ActionCancel/ActionCancel.js";
74
74
  import { A as A8 } from "./components/CommonActions/components/ActionIntro/ActionIntro.js";
75
75
  import { A as A9 } from "./components/CommonActions/components/ActionFormCancel/index.js";
76
- import { A as A10 } from "./components/CommonActions/components/ActionFormIntro/index.js";
77
- import { d, g as g13 } from "./components/CommonActions/dictionary.js";
78
- import { D as D5 } from "./components/DragResizeWindow/DragResizeWindow.js";
76
+ import { A as A10 } from "./components/CommonActions/components/ActionFormIntro/ActionFormIntro.js";
77
+ import { D as D5, d, g as g13 } from "./components/CommonActions/dictionary.js";
78
+ import { D as D6 } from "./components/DragResizeWindow/DragResizeWindow.js";
79
79
  import { d as d2 } from "./components/DragResizeWindow/classes/index.js";
80
80
  import { G } from "./components/GridLayout/GridLayout.js";
81
81
  import { R as R18 } from "./components/GridLayout/subcomponents/Responsive/index.js";
@@ -185,7 +185,7 @@ import { T as T17 } from "./components/mui_extended/ToggleIconButton/ToggleIconB
185
185
  import { T as T18 } from "./components/mui_extended/ToggleIconButton/constants.js";
186
186
  import { T as T19 } from "./components/mui_extended/ToggleIconButton/slots/ToggleIconButtonEnum.js";
187
187
  import { T as T20 } from "./components/mui_extended/ToggleIconButton/slots/ToggleIconButtonSlots.js";
188
- import { a as a13, D as D6, M as M13 } from "./components/areas/contexts/DynamicMFParmsContext/index.js";
188
+ import { a as a13, D as D7, M as M13 } from "./components/areas/contexts/DynamicMFParmsContext/index.js";
189
189
  import { F, R as R21, u as u9 } from "./components/hook-form/RHFormContext/index.js";
190
190
  import { g as g26 } from "./components/hook-form/RHFormContext/dictionary.js";
191
191
  import { u as u10 } from "./contexts/AppearanceComponentContext/useAppearanceComponentStore.js";
@@ -239,13 +239,14 @@ export {
239
239
  C11 as CommonFeatureRender,
240
240
  C as ConcatenatedFormatter,
241
241
  C12 as ContentWindowStyled,
242
+ D5 as DICTIONARY,
242
243
  D as DataGrid,
243
244
  D2 as DateFormatter,
244
245
  D3 as DistanceToNowFormatter,
245
- D5 as DragResizeWindow,
246
+ D6 as DragResizeWindow,
246
247
  D4 as DynamicFilter,
247
248
  a13 as DynamicMFParmsContext,
248
- D6 as DynamicMFParmsProvider,
249
+ D7 as DynamicMFParmsProvider,
249
250
  F as FormProviderCustom,
250
251
  G as GridLayout,
251
252
  H5 as HamburgerMenu,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m4l/components",
3
- "version": "9.1.104",
3
+ "version": "9.1.105",
4
4
  "license": "UNLICENSED",
5
5
  "lint-staged": {
6
6
  "*.{js,ts,tsx}": "eslint --fix --max-warnings 0"
@@ -1,5 +0,0 @@
1
- import { ActionsFormIntroProps } from './types';
2
- /**
3
- * TODO: Documentar
4
- */
5
- export declare function ActionFormIntro(props: ActionsFormIntroProps): import("react/jsx-runtime").JSX.Element;
@@ -1,30 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { useFormContext, useFormState } from "react-hook-form";
3
- import { useModuleDictionary } from "@m4l/core";
4
- import { L as LoadingButton } from "../../../mui_extended/LoadingButton/LoadingButton.js";
5
- import { u as useCommonActionsUtilityClasses } from "../../classes/index.js";
6
- function ActionFormIntro(props) {
7
- const { variant = "contained", color = "primary", label, ...others } = props;
8
- const { getLabel } = useModuleDictionary();
9
- const finalLabel = label || getLabel("common_actions.intro");
10
- const { control } = useFormContext();
11
- const { isSubmitting } = useFormState({
12
- control
13
- });
14
- const classes = useCommonActionsUtilityClasses();
15
- return /* @__PURE__ */ jsx(
16
- LoadingButton,
17
- {
18
- ...others,
19
- variant,
20
- type: "submit",
21
- color,
22
- loading: isSubmitting,
23
- className: classes.actionFormIntro,
24
- label: finalLabel
25
- }
26
- );
27
- }
28
- export {
29
- ActionFormIntro as A
30
- };