@m4l/components 9.1.96 → 9.1.97

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 (36) hide show
  1. package/components/hook-form/RHFPeriod/RHFPeriod.d.ts +2 -2
  2. package/components/hook-form/RHFPeriod/RHFPeriod.js +5 -5
  3. package/components/hook-form/RHFPeriod/index.d.ts +2 -0
  4. package/components/hook-form/RHFPeriod/subcomponents/Period/Period.d.ts +3 -3
  5. package/components/hook-form/RHFPeriod/subcomponents/Period/Period.js +84 -35
  6. package/components/hook-form/RHFPeriod/subcomponents/Period/dictionary.js +6 -1
  7. package/components/hook-form/RHFPeriod/subcomponents/Period/types.d.ts +7 -4
  8. package/components/hook-form/RHFPeriod/types.d.ts +6 -2
  9. package/components/hook-form/RHFPeriod/types.js +1 -0
  10. package/components/hook-form/index.d.ts +1 -2
  11. package/components/index.d.ts +0 -1
  12. package/index.js +102 -93
  13. package/package.json +1 -1
  14. package/components/Period/Period.d.ts +0 -5
  15. package/components/Period/Period.js +0 -193
  16. package/components/Period/classes/constants.d.ts +0 -1
  17. package/components/Period/classes/constants.js +0 -4
  18. package/components/Period/classes/index.d.ts +0 -15
  19. package/components/Period/classes/index.js +0 -53
  20. package/components/Period/classes/types.d.ts +0 -18
  21. package/components/Period/dictionary.d.ts +0 -7
  22. package/components/Period/dictionary.js +0 -13
  23. package/components/Period/index.d.ts +0 -2
  24. package/components/Period/styles.d.ts +0 -6
  25. package/components/Period/styles.js +0 -45
  26. package/components/Period/subcomponents/SkeletonPeriod/index.d.ts +0 -5
  27. package/components/Period/subcomponents/SkeletonPeriod/index.js +0 -12
  28. package/components/Period/subcomponents/SkeletonPeriod/types.d.ts +0 -4
  29. package/components/Period/tests/constants.d.ts +0 -1
  30. package/components/Period/tests/constants.js +0 -4
  31. package/components/Period/tests/index.test.d.ts +0 -1
  32. package/components/Period/tests/utils.d.ts +0 -2
  33. package/components/Period/tests/utils.js +0 -7
  34. package/components/Period/types.d.ts +0 -35
  35. package/components/Period/types.js +0 -9
  36. /package/components/{Period → hook-form/RHFPeriod}/index.js +0 -0
@@ -3,7 +3,7 @@ import { RHFPeriodProps } from './types';
3
3
  * Componente que renderiza un campo de formulario para ingresar un período.
4
4
  * @author cesar - automatic
5
5
  * @createdAt 2024-12-27 15:03:02 - automatic
6
- * @updatedAt 2025-01-08 10:36:41 - automatic
7
- * @updatedUser Andrés Quintero - automatic
6
+ * @updatedAt 2025-01-24 15:21:25 - automatic
7
+ * @updatedUser cesar - automatic
8
8
  */
9
9
  export declare const RHFPeriod: (props: RHFPeriodProps) => import("react/jsx-runtime").JSX.Element;
@@ -14,7 +14,6 @@ import { H as HelperError } from "../../HelperError/HelperError.js";
14
14
  const RHFPeriod = (props) => {
15
15
  const {
16
16
  name,
17
- readOnly,
18
17
  label,
19
18
  mandatory,
20
19
  mandatoryMessage,
@@ -45,8 +44,9 @@ const RHFPeriod = (props) => {
45
44
  children: /* @__PURE__ */ jsx(
46
45
  Controller,
47
46
  {
48
- name,
47
+ name: name || "",
49
48
  control,
49
+ defaultValue: { selPeriodTime: "", singleValue: "" },
50
50
  render: ({ field: { onChange, value }, fieldState: { error } }) => {
51
51
  return /* @__PURE__ */ jsxs(Fragment, { children: [
52
52
  label && /* @__PURE__ */ jsx(
@@ -62,12 +62,12 @@ const RHFPeriod = (props) => {
62
62
  /* @__PURE__ */ jsx(
63
63
  Period,
64
64
  {
65
+ name,
66
+ control,
65
67
  disabled,
66
68
  value,
67
69
  onChange,
68
- size,
69
- readOnly,
70
- error: !!error
70
+ size
71
71
  }
72
72
  ),
73
73
  error && /* @__PURE__ */ jsx(HelperError, { message: error.message || "" })
@@ -4,3 +4,5 @@ export * from './constants';
4
4
  export * from './slots/RHFPeriodEnum';
5
5
  export * from './slots/RHFPeriodSlots';
6
6
  export * from './types';
7
+ export { getPeriodComponetsDictionary } from './subcomponents/Period/dictionary';
8
+ export type { PeriodType } from './subcomponents/Period/types';
@@ -3,7 +3,7 @@ import { PeriodProps } from './types';
3
3
  * Componente que renderiza un campo de formulario para ingresar un período.
4
4
  * @author cesar - automatic
5
5
  * @createdAt 2024-12-30 16:32:50 - automatic
6
- * @updatedAt 2025-01-08 10:36:41 - automatic
7
- * @updatedUser Andrés Quintero - automatic
6
+ * @updatedAt 2025-01-28 17:32:00 - automatic
7
+ * @updatedUser cesar - automatic
8
8
  */
9
- export declare const Period: ({ value: valuePeriod, onChange, size, disabled, error }: PeriodProps) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const Period: (props: PeriodProps) => import("react/jsx-runtime").JSX.Element;
@@ -2,23 +2,21 @@ import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { useModuleDictionary, useEnvironment } from "@m4l/core";
3
3
  import { E as ETimePeriods } from "./types.js";
4
4
  import { d as dictionary } from "./dictionary.js";
5
- import { useMemo, useCallback } from "react";
5
+ import { useMemo } from "react";
6
6
  import { u as useComponentSize } from "../../../../../hooks/useComponentSize/useComponentSize.js";
7
7
  import { P as PeriodRootStyled, S as SelectStyled, T as TextFieldStyled } from "../../slots/RHFPeriodSlots.js";
8
8
  import { I as Icon } from "../../../../Icon/Icon.js";
9
- const normalizePeriod = (period) => {
10
- const defaultPeriodTime = { id: ETimePeriods.YEARS, label: "" };
11
- return {
12
- selPeriodTime: period?.selPeriodTime ?? defaultPeriodTime,
13
- singleValue: period?.singleValue ?? ""
14
- };
15
- };
16
- const Period = ({ value: valuePeriod, onChange, size, disabled, error }) => {
9
+ const Period = (props) => {
10
+ const {
11
+ value,
12
+ onChange,
13
+ size,
14
+ error,
15
+ disabled
16
+ } = props;
17
17
  const { getLabel } = useModuleDictionary();
18
18
  const { currentSize } = useComponentSize(size);
19
19
  const { host_static_assets, environment_assets } = useEnvironment();
20
- const normalizedSize = currentSize === "large" ? "medium" : currentSize;
21
- const { selPeriodTime, singleValue } = normalizePeriod(valuePeriod);
22
20
  const options = useMemo(
23
21
  () => [
24
22
  { id: ETimePeriods.YEARS.toString(), label: getLabel(dictionary.LABEL_YEARS) },
@@ -27,23 +25,75 @@ const Period = ({ value: valuePeriod, onChange, size, disabled, error }) => {
27
25
  ],
28
26
  [getLabel]
29
27
  );
30
- const handlePeriodChange = useCallback(
31
- (newPeriodTime, newValue) => {
32
- onChange({ selPeriodTime: newPeriodTime, singleValue: newValue });
33
- },
34
- [onChange]
35
- );
28
+ const getSingleValue = (period) => {
29
+ if (!period) {
30
+ return "";
31
+ }
32
+ if (period.singleValue !== void 0) {
33
+ return period.singleValue;
34
+ }
35
+ if (period.years && period.years > 0) {
36
+ return period.years;
37
+ }
38
+ if (period.months && period.months > 0) {
39
+ return period.months;
40
+ }
41
+ if (period.days && period.days > 0) {
42
+ return period.days;
43
+ }
44
+ return "";
45
+ };
46
+ const getSelPeriodTime = (period) => {
47
+ if (!period) {
48
+ return ETimePeriods.YEARS;
49
+ }
50
+ if (period.selPeriodTime) {
51
+ return period.selPeriodTime;
52
+ }
53
+ if (period.years && period.years > 0) {
54
+ return ETimePeriods.YEARS;
55
+ }
56
+ if (period.months && period.months > 0) {
57
+ return ETimePeriods.MONTHS;
58
+ }
59
+ if (period.days && period.days > 0) {
60
+ return ETimePeriods.DAYS;
61
+ }
62
+ return ETimePeriods.YEARS;
63
+ };
64
+ const singleValue = getSingleValue(value);
65
+ const selPeriodTime = getSelPeriodTime(value);
66
+ const onTotalChange = (newPeriodTime, newValue) => {
67
+ const newPeriod = {
68
+ selPeriodTime: newPeriodTime,
69
+ singleValue: newValue
70
+ };
71
+ if (newValue !== "" && newValue > 0) {
72
+ newPeriod.years = 0;
73
+ newPeriod.months = 0;
74
+ newPeriod.days = 0;
75
+ if (newPeriodTime === ETimePeriods.YEARS) {
76
+ newPeriod.years = newValue;
77
+ }
78
+ if (newPeriodTime === ETimePeriods.MONTHS) {
79
+ newPeriod.months = newValue;
80
+ }
81
+ if (newPeriodTime === ETimePeriods.DAYS) {
82
+ newPeriod.days = newValue;
83
+ }
84
+ }
85
+ onChange(newPeriod);
86
+ };
87
+ const onChangeTime = (newPeriodTime) => {
88
+ if (newPeriodTime) {
89
+ onTotalChange(newPeriodTime.id, singleValue);
90
+ }
91
+ };
92
+ const normalizedSize = currentSize === "large" ? "medium" : currentSize;
36
93
  const ownerState = {
37
94
  size: normalizedSize,
38
- disabled,
39
- isValid: !error
95
+ disabled
40
96
  };
41
- const handleKeyDown = useCallback((e) => {
42
- const validKeys = /^[0-9]$/;
43
- if (!validKeys.test(e.key) && e.key !== "Backspace" && e.key !== "Delete" && e.key !== "Tab") {
44
- e.preventDefault();
45
- }
46
- }, []);
47
97
  return /* @__PURE__ */ jsxs(PeriodRootStyled, { ownerState, children: [
48
98
  /* @__PURE__ */ jsx(
49
99
  Icon,
@@ -56,13 +106,14 @@ const Period = ({ value: valuePeriod, onChange, size, disabled, error }) => {
56
106
  /* @__PURE__ */ jsx(
57
107
  SelectStyled,
58
108
  {
59
- value: selPeriodTime.id,
109
+ size: normalizedSize,
110
+ value: options[selPeriodTime].id,
60
111
  options,
61
- onChange: (selectedOption) => handlePeriodChange(selectedOption, singleValue),
112
+ onChange: (autcValue) => {
113
+ onChangeTime(autcValue);
114
+ },
62
115
  disabled,
63
- size: normalizedSize,
64
- error,
65
- variant: "outlined"
116
+ error: !!error
66
117
  }
67
118
  ),
68
119
  /* @__PURE__ */ jsx(
@@ -72,11 +123,9 @@ const Period = ({ value: valuePeriod, onChange, size, disabled, error }) => {
72
123
  variant: "outlined",
73
124
  value: singleValue,
74
125
  InputProps: { disableUnderline: true },
75
- error,
76
- size: normalizedSize,
77
- onChange: (e) => handlePeriodChange(selPeriodTime, e.target.value === "" ? "" : parseInt(e.target.value, 10)),
78
- onKeyDown: handleKeyDown,
79
- disabled
126
+ onChange: (e) => {
127
+ onTotalChange(selPeriodTime, e.target.value === "" ? "" : parseInt(e.target.value));
128
+ }
80
129
  }
81
130
  )
82
131
  ] });
@@ -1,8 +1,13 @@
1
+ import { g as getCommonActionsDictionary } from "../../../../CommonActions/dictionary.js";
1
2
  const dictionary = {
2
3
  LABEL_YEARS: "period.label_years",
3
4
  LABEL_MONTHS: "period.label_months",
4
5
  LABEL_DAYS: "period.label_days"
5
6
  };
7
+ function getPeriodComponetsDictionary() {
8
+ return ["period"].concat(getCommonActionsDictionary());
9
+ }
6
10
  export {
7
- dictionary as d
11
+ dictionary as d,
12
+ getPeriodComponetsDictionary as g
8
13
  };
@@ -5,22 +5,25 @@ export declare enum ETimePeriods {
5
5
  DAYS = 2
6
6
  }
7
7
  export type PeriodTime = {
8
- id: number | string;
8
+ id: number;
9
9
  label: string;
10
10
  };
11
- export type SKTWrapperProps = Pick<PeriodProps, 'readOnly'>;
12
11
  export type PeriodType = {
13
- selPeriodTime: PeriodTime;
12
+ selPeriodTime: '' | ETimePeriods | undefined;
14
13
  singleValue: number | '';
14
+ years?: number;
15
+ months?: number;
16
+ days?: number;
15
17
  };
16
18
  export interface PeriodProps {
17
19
  value: PeriodType;
18
20
  onChange: (newValue: PeriodType) => void;
19
- readOnly?: boolean;
20
21
  size: Sizes;
21
22
  disabled?: boolean;
22
23
  isValid?: boolean;
23
24
  error?: boolean;
25
+ name?: string;
26
+ control?: any;
24
27
  }
25
28
  export interface WrapperProps {
26
29
  error: boolean;
@@ -1,19 +1,23 @@
1
1
  import { LabelProps } from '../../Label/types';
2
- import { PeriodProps } from '../RHFPeriod/subcomponents/Period/types';
3
2
  import { RHFPeriodSlots } from './slots/RHFPeriodEnum';
4
3
  import { OverridesStyleRules } from '@mui/material/styles/overrides';
5
4
  import { Theme } from '@mui/material';
6
5
  import { RHF_PERIOD_KEY_COMPONENT } from './constants';
7
6
  export type RHFPeriodType = keyof typeof RHFPeriodSlots;
8
- export interface RHFPeriodProps extends Pick<PeriodProps, 'readOnly'>, Omit<LabelProps, 'label'> {
7
+ export interface RHFPeriodProps extends Omit<LabelProps, 'label'> {
9
8
  size?: 'small' | 'medium';
10
9
  name: string;
11
10
  label?: string;
12
11
  dataTestId?: string;
13
12
  /**
14
13
  * Clase CSS adicional para aplicar estilos personalizados al componente.
14
+ * @author cesar - automatic
15
+ * @createdAt 2025-01-24 15:21:25 - automatic
16
+ * @updatedAt 2025-01-24 15:21:25 - automatic
17
+ * @updatedUser cesar - automatic
15
18
  */
16
19
  className?: string;
20
+ onChange?: (newValue: any) => void;
17
21
  }
18
22
  export interface RHFPeriodOwnerState {
19
23
  isFocus: boolean;
@@ -10,8 +10,7 @@ export { RHFSelect } from './RHFSelect';
10
10
  export { RHFHelperError } from './RHFHelperError';
11
11
  export * from './RHFTextField';
12
12
  export * from './RHFTextFieldPassword';
13
- export { RHFPeriod } from './RHFPeriod/RHFPeriod';
14
- export { getPeriodComponetsDictionary } from '../Period/dictionary';
13
+ export * from './RHFPeriod';
15
14
  export { RHFRadioGroup } from './RHFRadioGroup';
16
15
  export { RHFNumberInput } from './RHFNumberInput/RHFNumberInput';
17
16
  export * from './RHFUpload';
@@ -35,7 +35,6 @@ export * from './ObjectLogs';
35
35
  export * from './ObjectLogs/dictionary';
36
36
  export * from './PaperForm/PaperForm';
37
37
  export * from './PDFViewer';
38
- export * from './Period';
39
38
  export * from './HelmetPage';
40
39
  export * from './PropertyValue/PropertyValue';
41
40
  export * from './MenuActions';
package/index.js CHANGED
@@ -33,22 +33,26 @@ import { R as R3 } from "./components/hook-form/RHFDateTime/RHFDateTime.js";
33
33
  import { R as R4 } from "./components/hook-form/RHFMultiCheckbox/index.js";
34
34
  import { R as R5 } from "./components/hook-form/RHFSelect/RHFSelect.js";
35
35
  import { R as R6 } from "./components/hook-form/RHFHelperError/index.js";
36
- import { R as R7 } from "./components/hook-form/RHFPeriod/RHFPeriod.js";
37
- import { g as g6 } from "./components/Period/dictionary.js";
38
- import { R as R8 } from "./components/hook-form/RHFRadioGroup/RHFRadioGroup.js";
39
- import { R as R9 } from "./components/hook-form/RHFNumberInput/RHFNumberInput.js";
40
- import { R as R10 } from "./components/hook-form/RHFColorPicker/RFHColorPicker.js";
41
- import { R as R11 } from "./components/hook-form/RHFCheckbox/RHFCheckbox.js";
42
- import { R as R12 } from "./components/hook-form/RHFTextField/RHFTextField.js";
43
- import { R as R13 } from "./components/hook-form/RHFTextFieldPassword/RHFTextFieldPassword.js";
44
- import { R as R14 } from "./components/hook-form/RHFUpload/RHFUploadImage/RHFUploadImage.js";
36
+ import { R as R7 } from "./components/hook-form/RHFRadioGroup/RHFRadioGroup.js";
37
+ import { R as R8 } from "./components/hook-form/RHFNumberInput/RHFNumberInput.js";
38
+ import { R as R9 } from "./components/hook-form/RHFColorPicker/RFHColorPicker.js";
39
+ import { R as R10 } from "./components/hook-form/RHFCheckbox/RHFCheckbox.js";
40
+ import { R as R11 } from "./components/hook-form/RHFTextField/RHFTextField.js";
41
+ import { R as R12 } from "./components/hook-form/RHFTextFieldPassword/RHFTextFieldPassword.js";
42
+ import { g as g6 } from "./components/hook-form/RHFPeriod/subcomponents/Period/dictionary.js";
43
+ import { r } from "./components/hook-form/RHFPeriod/RHFPeriod.styles.js";
44
+ import { R as R13 } from "./components/hook-form/RHFPeriod/RHFPeriod.js";
45
+ import { R as R14 } from "./components/hook-form/RHFPeriod/constants.js";
46
+ import { R as R15 } from "./components/hook-form/RHFPeriod/slots/RHFPeriodEnum.js";
47
+ import { P as P2, R as R16, S as S2, T as T2 } from "./components/hook-form/RHFPeriod/slots/RHFPeriodSlots.js";
48
+ import { R as R17 } from "./components/hook-form/RHFUpload/RHFUploadImage/RHFUploadImage.js";
45
49
  import { B } from "./components/formatters/BooleanFormatter/BooleanFormatter.js";
46
50
  import { D as D2, u as u4 } from "./components/formatters/DateFormatter/DateFormatter.js";
47
51
  import { U, g as g7 } from "./components/formatters/UncertaintyFormatter/UncertaintyFormatter.js";
48
- import { P as P2, g as g8 } from "./components/formatters/PointsFormatter/PointsFormatter.js";
52
+ import { P as P3, g as g8 } from "./components/formatters/PointsFormatter/PointsFormatter.js";
49
53
  import { C, g as g9 } from "./components/formatters/ConcatenatedFormatter/ConcatenatedFormatter.js";
50
- import { P as P3, u as u5 } from "./components/formatters/PeriodFormatter/PeriodFormatter.js";
51
- import { P as P4, g as g10 } from "./components/formatters/PriceFormatter/PriceFormatter.js";
54
+ import { P as P4, u as u5 } from "./components/formatters/PeriodFormatter/PeriodFormatter.js";
55
+ import { P as P5, g as g10 } from "./components/formatters/PriceFormatter/PriceFormatter.js";
52
56
  import { g as g11 } from "./components/formatters/DistanceToNowFormatter/dictionary.js";
53
57
  import { D as D3 } from "./components/formatters/DistanceToNowFormatter/DistanceToNowFormatter.js";
54
58
  import { g as g12 } from "./components/formatters/dictionary.js";
@@ -74,11 +78,11 @@ import { d, g as g13 } from "./components/CommonActions/dictionary.js";
74
78
  import { D as D5 } from "./components/DragResizeWindow/DragResizeWindow.js";
75
79
  import { d as d2 } from "./components/DragResizeWindow/classes/index.js";
76
80
  import { G } from "./components/GridLayout/GridLayout.js";
77
- import { R as R15 } from "./components/GridLayout/subcomponents/Responsive/index.js";
81
+ import { R as R18 } from "./components/GridLayout/subcomponents/Responsive/index.js";
78
82
  import { c as c3, d as d3, e } from "./components/GridLayout/subcomponents/Responsive/responsiveUtils.js";
79
83
  import { i, k } from "./components/GridLayout/utils.js";
80
84
  import { w } from "./components/GridLayout/subcomponents/withSizeProvider/index.js";
81
- import { P as P5 } from "./components/PrintingSystem/PrintingSystem.js";
85
+ import { P as P6 } from "./components/PrintingSystem/PrintingSystem.js";
82
86
  import { L as L4 } from "./components/LanguagePopover/LanguagePopover.js";
83
87
  import { L as L5 } from "./components/LinearProgressIndeterminate/LinearProgressIndeterminate.js";
84
88
  import { I as I3 } from "./components/Image/Image.js";
@@ -95,7 +99,7 @@ import { M as M6 } from "./components/maps/components/Map/featureRenders/MarkerF
95
99
  import { C as C11 } from "./components/maps/components/Map/featureRenders/CommonFeatureRender/index.js";
96
100
  import { g as g16 } from "./components/maps/components/Map/popups/MapPopupMyGps/dictionary.js";
97
101
  import { M as M7 } from "./components/maps/components/Map/popups/MapPopupMyGps/MapPopupMyGps.js";
98
- import { P as P6 } from "./components/maps/components/Map/pluginLayers/PolylineWithArrows/index.js";
102
+ import { P as P7 } from "./components/maps/components/Map/pluginLayers/PolylineWithArrows/index.js";
99
103
  import { c as c4 } from "./components/maps/utils/courseToCartesianAngle.js";
100
104
  import { c as c5 } from "./components/maps/utils/courseToCssAngle.js";
101
105
  import { i as i2 } from "./components/maps/utils/isFeature.js";
@@ -111,7 +115,7 @@ import { W as W3 } from "./components/WindowBase/WindowBase.js";
111
115
  import { W as W4 } from "./components/WindowBase/constants.js";
112
116
  import { I as I4 } from "./components/WindowBase/icons.js";
113
117
  import { W as W5 } from "./components/WindowBase/slots/WindowBaseEnum.js";
114
- import { C as C12, a as a8, H as H2, I as I5, d as d5, L as L7, M as M9, b as b3, P as P7, S as S2, c as c6, T as T2, W as W6 } from "./components/WindowBase/slots/WindowBaseSlots.js";
118
+ import { C as C12, a as a8, H as H2, I as I5, d as d5, L as L7, M as M9, b as b3, P as P8, S as S3, c as c6, T as T3, W as W6 } from "./components/WindowBase/slots/WindowBaseSlots.js";
115
119
  import { H as H3 } from "./components/WindowBase/subcomponents/Header/HeaderWindowBase.js";
116
120
  import { L as L8 } from "./components/LoadingError/LoadingError.js";
117
121
  import { g as g19 } from "./components/LoadingError/dictionary.js";
@@ -121,20 +125,19 @@ import { N as N3 } from "./components/NoItemSelected/index.js";
121
125
  import { d as d6, g as g21 } from "./components/NoItemSelected/dictionary.js";
122
126
  import { O } from "./components/ObjectLogs/index.js";
123
127
  import { d as d7, g as g22 } from "./components/ObjectLogs/dictionary.js";
124
- import { P as P8 } from "./components/PaperForm/PaperForm.js";
125
- import { P as P9 } from "./components/PDFViewer/PDFViewer.js";
126
- import { P as P10 } from "./components/Period/Period.js";
128
+ import { P as P9 } from "./components/PaperForm/PaperForm.js";
129
+ import { P as P10 } from "./components/PDFViewer/PDFViewer.js";
127
130
  import { H as H4 } from "./components/HelmetPage/index.js";
128
131
  import { P as P11 } from "./components/PropertyValue/PropertyValue.js";
129
132
  import { a as a9 } from "./components/MenuActions/dictionary.js";
130
133
  import { a as a10, M as M11 } from "./components/MenuActions/MenuActions.js";
131
- import { R as R16 } from "./components/extended/React-Resizable/Resizable/Resizable.js";
132
- import { R as R17 } from "./components/extended/React-Resizable/ResizableBox/ResizableBox.js";
133
- import { S as S3 } from "./components/ScrollBar/ScrollBar.js";
134
- import { S as S4 } from "./components/extended/React-Splitter/SplitLayout/SplitLayout.js";
135
- import { T as T3 } from "./components/ToastContainer/ToastContainer.js";
136
- import { T as T4 } from "./components/ToastContainer/subcomponents/ToastMessage/ToastMessage.js";
137
- import { S as S5 } from "./components/SideBar/SideBar.js";
134
+ import { R as R19 } from "./components/extended/React-Resizable/Resizable/Resizable.js";
135
+ import { R as R20 } from "./components/extended/React-Resizable/ResizableBox/ResizableBox.js";
136
+ import { S as S4 } from "./components/ScrollBar/ScrollBar.js";
137
+ import { S as S5 } from "./components/extended/React-Splitter/SplitLayout/SplitLayout.js";
138
+ import { T as T4 } from "./components/ToastContainer/ToastContainer.js";
139
+ import { T as T5 } from "./components/ToastContainer/subcomponents/ToastMessage/ToastMessage.js";
140
+ import { S as S6 } from "./components/SideBar/SideBar.js";
138
141
  import { A as A11 } from "./components/AppBar/AppBar.js";
139
142
  import { g as g23 } from "./components/AppBar/dictionary.js";
140
143
  import { A as A12 } from "./components/AccountPopover/AccountPopover.js";
@@ -144,8 +147,8 @@ import { a as a11, P as P12 } from "./components/popups/components/PopupsProvide
144
147
  import { P as P13 } from "./components/popups/components/PopupsViewer/PopupsViewer.js";
145
148
  import { A as A13 } from "./components/commercial/AppBarCommercial/index.js";
146
149
  import { H as H5 } from "./components/commercial/HamburgerMenu/HamburgerMenu.js";
147
- import { T as T5 } from "./components/commercial/TopBar/TopBar.js";
148
- import { S as S6 } from "./components/commercial/SectionCommercial/index.js";
150
+ import { T as T6 } from "./components/commercial/TopBar/TopBar.js";
151
+ import { S as S7 } from "./components/commercial/SectionCommercial/index.js";
149
152
  import { M as M12 } from "./components/MFIsolationApp/MFIsolationApp.js";
150
153
  import { B as B2 } from "./components/BaseModule/BaseModule.js";
151
154
  import { A as A14 } from "./components/mui_extended/Accordion/Accordion.js";
@@ -159,36 +162,36 @@ import { L as L10 } from "./components/mui_extended/LinkWithRoute/index.js";
159
162
  import { L as L11 } from "./components/mui_extended/LoadingButton/LoadingButton.js";
160
163
  import { P as P14 } from "./components/Pager/Pager.js";
161
164
  import { g as g25 } from "./components/Pager/dicctionary.js";
162
- import { T as T6 } from "./components/mui_extended/Tab/Tab.js";
163
- import { T as T7 } from "./components/mui_extended/Tooltip/Tooltip.js";
165
+ import { T as T7 } from "./components/mui_extended/Tab/Tab.js";
166
+ import { T as T8 } from "./components/mui_extended/Tooltip/Tooltip.js";
164
167
  import { I as I6 } from "./components/mui_extended/IconButton/IconButton.js";
165
168
  import { B as B6 } from "./components/mui_extended/Button/Button.js";
166
169
  import { C as C14 } from "./components/mui_extended/CheckBox/CheckBox.js";
167
170
  import { I as I7 } from "./components/mui_extended/ImageButton/ImageButton.js";
168
171
  import { P as P15 } from "./components/mui_extended/Popover/Popover.js";
169
- import { S as S7 } from "./components/mui_extended/Skeleton/Skeleton.js";
170
- import { S as S8 } from "./components/mui_extended/Stack/Stack.js";
171
- import { T as T8 } from "./components/mui_extended/Tabs/Tabs.js";
172
- import { T as T9 } from "./components/mui_extended/TabContent/TabContent.js";
173
- import { a as a12, T as T10 } from "./components/mui_extended/TabContext/index.js";
174
- import { T as T11 } from "./components/mui_extended/Typography/Typography.js";
172
+ import { S as S8 } from "./components/mui_extended/Skeleton/Skeleton.js";
173
+ import { S as S9 } from "./components/mui_extended/Stack/Stack.js";
174
+ import { T as T9 } from "./components/mui_extended/Tabs/Tabs.js";
175
+ import { T as T10 } from "./components/mui_extended/TabContent/TabContent.js";
176
+ import { a as a12, T as T11 } from "./components/mui_extended/TabContext/index.js";
177
+ import { T as T12 } from "./components/mui_extended/Typography/Typography.js";
175
178
  import { t } from "./components/mui_extended/ToggleButton/ToggleButton.styles.js";
176
- import { T as T12 } from "./components/mui_extended/ToggleButton/ToggleButton.js";
177
- import { T as T13 } from "./components/mui_extended/ToggleButton/constants.js";
178
- import { T as T14 } from "./components/mui_extended/ToggleButton/slots/ToggleButtonEnum.js";
179
- import { T as T15 } from "./components/mui_extended/ToggleButton/slots/ToggleButtonSlots.js";
179
+ import { T as T13 } from "./components/mui_extended/ToggleButton/ToggleButton.js";
180
+ import { T as T14 } from "./components/mui_extended/ToggleButton/constants.js";
181
+ import { T as T15 } from "./components/mui_extended/ToggleButton/slots/ToggleButtonEnum.js";
182
+ import { T as T16 } from "./components/mui_extended/ToggleButton/slots/ToggleButtonSlots.js";
180
183
  import { t as t2 } from "./components/mui_extended/ToggleIconButton/ToggleIconButton.styles.js";
181
- import { T as T16 } from "./components/mui_extended/ToggleIconButton/ToggleIconButton.js";
182
- import { T as T17 } from "./components/mui_extended/ToggleIconButton/constants.js";
183
- import { T as T18 } from "./components/mui_extended/ToggleIconButton/slots/ToggleIconButtonEnum.js";
184
- import { T as T19 } from "./components/mui_extended/ToggleIconButton/slots/ToggleIconButtonSlots.js";
184
+ import { T as T17 } from "./components/mui_extended/ToggleIconButton/ToggleIconButton.js";
185
+ import { T as T18 } from "./components/mui_extended/ToggleIconButton/constants.js";
186
+ import { T as T19 } from "./components/mui_extended/ToggleIconButton/slots/ToggleIconButtonEnum.js";
187
+ import { T as T20 } from "./components/mui_extended/ToggleIconButton/slots/ToggleIconButtonSlots.js";
185
188
  import { a as a13, D as D6, M as M13 } from "./components/areas/contexts/DynamicMFParmsContext/index.js";
186
- import { F, R as R18, u as u9 } from "./components/hook-form/RHFormContext/index.js";
189
+ import { F, R as R21, u as u9 } from "./components/hook-form/RHFormContext/index.js";
187
190
  import { g as g26 } from "./components/hook-form/RHFormContext/dictionary.js";
188
191
  import { u as u10 } from "./contexts/AppearanceComponentContext/useAppearanceComponentStore.js";
189
192
  import { A as A16 } from "./contexts/AppearanceComponentContext/AppearanceComponentContext.js";
190
193
  import { a as a14, M as M14 } from "./contexts/ModalContext/index.js";
191
- import { a as a15, R as R19 } from "./contexts/RealTimeContext/RealTimeContext.js";
194
+ import { a as a15, R as R22 } from "./contexts/RealTimeContext/RealTimeContext.js";
192
195
  import { u as u11 } from "./hooks/useFormAddEdit/index.js";
193
196
  import { u as u12 } from "./hooks/useModal/index.js";
194
197
  import { u as u13 } from "./hooks/useTab/index.js";
@@ -292,72 +295,77 @@ export {
292
295
  N3 as NoItemSelected,
293
296
  N as NumberEditor,
294
297
  O as ObjectLogs,
295
- P9 as PDFViewer,
298
+ P10 as PDFViewer,
296
299
  P14 as Pager,
297
- P8 as PaperForm,
298
- P10 as Period,
299
- P3 as PeriodFormatter,
300
+ P9 as PaperForm,
301
+ P4 as PeriodFormatter,
302
+ P2 as PeriodRootStyled,
300
303
  b3 as PointIconStyled,
301
- P7 as PointStyled,
302
- P2 as PointsFormatter,
303
- P6 as PolylineWithArrows,
304
+ P8 as PointStyled,
305
+ P3 as PointsFormatter,
306
+ P7 as PolylineWithArrows,
304
307
  P15 as Popover,
305
308
  a11 as PopupsContext,
306
309
  P12 as PopupsProvider,
307
310
  P13 as PopupsViewer,
308
- P4 as PriceFormatter,
309
- P5 as PrintingSystem,
311
+ P5 as PriceFormatter,
312
+ P6 as PrintingSystem,
310
313
  P as PropagateLoaderSpinner,
311
314
  P11 as PropertyValue,
312
315
  R as RHFAutocomplete,
313
316
  R2 as RHFAutocompleteAsync,
314
- R11 as RHFCheckbox,
315
- R10 as RHFColorPicker,
317
+ R10 as RHFCheckbox,
318
+ R9 as RHFColorPicker,
316
319
  R3 as RHFDateTime,
317
320
  R6 as RHFHelperError,
318
321
  R4 as RHFMultiCheckbox,
319
- R9 as RHFNumberInput,
320
- R7 as RHFPeriod,
321
- R8 as RHFRadioGroup,
322
+ R8 as RHFNumberInput,
323
+ R13 as RHFPeriod,
324
+ R16 as RHFPeriodRootStyled,
325
+ R15 as RHFPeriodSlots,
326
+ R7 as RHFRadioGroup,
322
327
  R5 as RHFSelect,
323
- R12 as RHFTextField,
324
- R13 as RHFTextFieldPassword,
325
- R14 as RHFUploadImage,
326
- R18 as RHFormProvider,
328
+ R11 as RHFTextField,
329
+ R12 as RHFTextFieldPassword,
330
+ R17 as RHFUploadImage,
331
+ R14 as RHF_PERIOD_KEY_COMPONENT,
332
+ R21 as RHFormProvider,
327
333
  a15 as RealTimeContext,
328
- R19 as RealTimeProvider,
329
- R16 as Resizable,
330
- R17 as ResizableBox,
331
- R15 as Responsive,
332
- S3 as ScrollBar,
334
+ R22 as RealTimeProvider,
335
+ R19 as Resizable,
336
+ R20 as ResizableBox,
337
+ R18 as Responsive,
338
+ S4 as ScrollBar,
333
339
  S as ScrollToTop,
334
- S6 as SectionCommercial,
335
- S5 as SideBar,
336
- S7 as Skeleton,
337
- S4 as SplitLayout,
338
- S8 as Stack,
339
- S2 as SubtitleContainerStyled,
340
+ S7 as SectionCommercial,
341
+ S2 as SelectStyled,
342
+ S6 as SideBar,
343
+ S8 as Skeleton,
344
+ S5 as SplitLayout,
345
+ S9 as Stack,
346
+ S3 as SubtitleContainerStyled,
340
347
  c6 as SubtitleWindowStyled,
341
- T13 as TOGGLE_BUTTON_KEY_COMPONENT,
342
- T17 as TOGGLE_ICON_BUTTON_KEY_COMPONENT,
343
- T6 as Tab,
344
- T9 as TabContent,
348
+ T14 as TOGGLE_BUTTON_KEY_COMPONENT,
349
+ T18 as TOGGLE_ICON_BUTTON_KEY_COMPONENT,
350
+ T7 as Tab,
351
+ T10 as TabContent,
345
352
  a12 as TabContext,
346
- T10 as TabProvider,
347
- T8 as Tabs,
353
+ T11 as TabProvider,
354
+ T9 as Tabs,
348
355
  T as TextEditor,
349
- T2 as TitleWindowStyled,
350
- T3 as ToastContainer,
351
- T4 as ToastMessage,
352
- T12 as ToggleButton,
353
- T15 as ToggleButtonRootStyled,
354
- T14 as ToggleButtonSlots,
355
- T16 as ToggleIconButton,
356
- T19 as ToggleIconButtonRootStyled,
357
- T18 as ToggleIconButtonSlots,
358
- T7 as Tooltip,
359
- T5 as TopBar,
360
- T11 as Typography,
356
+ T2 as TextFieldStyled,
357
+ T3 as TitleWindowStyled,
358
+ T4 as ToastContainer,
359
+ T5 as ToastMessage,
360
+ T13 as ToggleButton,
361
+ T16 as ToggleButtonRootStyled,
362
+ T15 as ToggleButtonSlots,
363
+ T17 as ToggleIconButton,
364
+ T20 as ToggleIconButtonRootStyled,
365
+ T19 as ToggleIconButtonSlots,
366
+ T8 as Tooltip,
367
+ T6 as TopBar,
368
+ T12 as Typography,
361
369
  U as UncertaintyFormatter,
362
370
  W4 as WINDOW_BASE_KEY_COMPONENT,
363
371
  W3 as WindowBase,
@@ -415,6 +423,7 @@ export {
415
423
  i3 as isFeatureCollection,
416
424
  i4 as isFeatureCollectionDraft,
417
425
  i5 as isGeometry,
426
+ r as rhfPeriodStyles,
418
427
  t as toggleButtonStyles,
419
428
  t2 as toggleIconButtonStyles,
420
429
  u10 as useAppearanceComponentStore,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m4l/components",
3
- "version": "9.1.96",
3
+ "version": "9.1.97",
4
4
  "license": "UNLICENSED",
5
5
  "lint-staged": {
6
6
  "*.{js,ts,tsx}": "eslint --fix --max-warnings 0"
@@ -1,5 +0,0 @@
1
- import { PeriodProps } from './types';
2
- /**
3
- * TODO: Documentar
4
- */
5
- export declare const Period: (props: PeriodProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,193 +0,0 @@
1
- import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
- import { useModuleDictionary, useModuleSkeleton, useEnvironment } from "@m4l/core";
3
- import { C as ContainerPeriod } from "./styles.js";
4
- import { E as ETimePeriods } from "./types.js";
5
- import { Autocomplete, TextField } from "@mui/material";
6
- import { useState, useMemo } from "react";
7
- import { d as dictionary } from "./dictionary.js";
8
- import { p as periodUtilityClasses } from "./classes/index.js";
9
- import { g as getNamePeriodDataTestId } from "./tests/utils.js";
10
- import { T as TEST_PROP_ID } from "../../test/constants_no_mock.js";
11
- import { useResponsiveDesktop } from "@m4l/graphics";
12
- import { S as SkeletonPeriod } from "./subcomponents/SkeletonPeriod/index.js";
13
- import { T as Typography } from "../mui_extended/Typography/Typography.js";
14
- import { I as IconButton } from "../mui_extended/IconButton/IconButton.js";
15
- const getSelPeriodTime = (period) => {
16
- if (!period) {
17
- return ETimePeriods.YEARS;
18
- }
19
- if (period.selPeriodTime) {
20
- return period.selPeriodTime;
21
- }
22
- if (period.years && period.years > 0) {
23
- return ETimePeriods.YEARS;
24
- }
25
- if (period.months && period.months > 0) {
26
- return ETimePeriods.MONTHS;
27
- }
28
- if (period.days && period.days > 0) {
29
- return ETimePeriods.DAYS;
30
- }
31
- return ETimePeriods.YEARS;
32
- };
33
- const getSingleValue = (period) => {
34
- if (!period) {
35
- return "";
36
- }
37
- if (period.singleValue !== void 0) {
38
- return period.singleValue;
39
- }
40
- if (period.years && period.years > 0) {
41
- return period.years;
42
- }
43
- if (period.months && period.months > 0) {
44
- return period.months;
45
- }
46
- if (period.days && period.days > 0) {
47
- return period.days;
48
- }
49
- return "";
50
- };
51
- const Period = (props) => {
52
- const {
53
- value,
54
- onChange,
55
- state,
56
- readOnly = false,
57
- variant = "monoperiod",
58
- size = "small"
59
- } = props;
60
- const { getLabel } = useModuleDictionary();
61
- const [open, setOpen] = useState(false);
62
- const [isFocus, setIsFocus] = useState(false);
63
- const isSkeleton = useModuleSkeleton();
64
- const selPeriodTime = getSelPeriodTime(value);
65
- const singleValue = getSingleValue(value);
66
- const isDesktop = useResponsiveDesktop();
67
- const { host_static_assets, environment_assets } = useEnvironment();
68
- const iconDown = `${host_static_assets}/${environment_assets}/frontend/components/RHFAutocompletarAsync/assets/icons/chevronDown.svg`;
69
- const handleFocus = () => {
70
- setIsFocus(true);
71
- };
72
- const handleBlur = () => {
73
- setIsFocus(false);
74
- };
75
- const onTotalChange = (newPeriodTime, newValue) => {
76
- const newPeriod = {
77
- selPeriodTime: newPeriodTime,
78
- singleValue: newValue
79
- };
80
- if (newValue !== "" && newValue > 0) {
81
- newPeriod.years = 0;
82
- newPeriod.months = 0;
83
- newPeriod.days = 0;
84
- if (newPeriodTime === ETimePeriods.YEARS) {
85
- newPeriod.years = newValue;
86
- }
87
- if (newPeriodTime === ETimePeriods.MONTHS) {
88
- newPeriod.months = newValue;
89
- }
90
- if (newPeriodTime === ETimePeriods.DAYS) {
91
- newPeriod.days = newValue;
92
- }
93
- }
94
- onChange(newPeriod);
95
- };
96
- const onChangeTime = (newPeriodTime) => {
97
- if (newPeriodTime) {
98
- onTotalChange(newPeriodTime.id, singleValue);
99
- }
100
- };
101
- const options = useMemo(
102
- () => [
103
- {
104
- id: 0,
105
- label: getLabel(dictionary.LABEL_YEARS)
106
- },
107
- {
108
- id: 1,
109
- label: getLabel(dictionary.LABEL_MONTHS)
110
- },
111
- {
112
- id: 2,
113
- label: getLabel(dictionary.LABEL_DAYS)
114
- }
115
- ],
116
- [getLabel]
117
- );
118
- const ownerState = {
119
- readOnly,
120
- state,
121
- variant,
122
- size: isDesktop ? size : "medium",
123
- focus: isFocus
124
- };
125
- const classes = periodUtilityClasses(ownerState);
126
- return /* @__PURE__ */ jsx(
127
- ContainerPeriod,
128
- {
129
- className: classes.root,
130
- onFocus: handleFocus,
131
- onBlur: handleBlur,
132
- ...process.env.NODE_ENV !== "production" ? { [TEST_PROP_ID]: getNamePeriodDataTestId("root") } : {},
133
- children: !isSkeleton ? readOnly ? /* @__PURE__ */ jsxs(Fragment, { children: [
134
- /* @__PURE__ */ jsx("div", { className: classes.containerDateLabel, children: /* @__PURE__ */ jsx(Typography, { variant: "body", skeletonWidth: "50%", children: value.selPeriodTime === 0 ? getLabel(dictionary.LABEL_YEARS) : value.selPeriodTime === 1 ? getLabel(dictionary.LABEL_MONTHS) : value.selPeriodTime === 2 ? getLabel(dictionary.LABEL_DAYS) : "" }) }),
135
- /* @__PURE__ */ jsx("div", { className: classes.containerDateValue, children: /* @__PURE__ */ jsx(Typography, { variant: "body", skeletonWidth: "80%", children: String(value.singleValue || "") }) })
136
- ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
137
- /* @__PURE__ */ jsx(
138
- Autocomplete,
139
- {
140
- options,
141
- value: options[selPeriodTime],
142
- disableClearable: true,
143
- open,
144
- onOpen: () => setOpen(true),
145
- onClose: () => setOpen(false),
146
- onChange: (_event, autcValue) => {
147
- onChangeTime(autcValue);
148
- },
149
- renderInput: (params) => {
150
- return /* @__PURE__ */ jsx(
151
- TextField,
152
- {
153
- ...params,
154
- fullWidth: true,
155
- variant: "standard",
156
- SelectProps: { native: true },
157
- InputProps: {
158
- disableUnderline: true,
159
- ...params.InputProps,
160
- endAdornment: /* @__PURE__ */ jsx(
161
- IconButton,
162
- {
163
- src: iconDown,
164
- onClick: () => setOpen((currentOpen) => !currentOpen)
165
- }
166
- )
167
- },
168
- autoComplete: "off"
169
- },
170
- `tx_async_${params.id}`
171
- );
172
- }
173
- }
174
- ),
175
- /* @__PURE__ */ jsx(
176
- TextField,
177
- {
178
- type: "number",
179
- variant: "standard",
180
- value: singleValue,
181
- InputProps: { disableUnderline: true },
182
- onChange: (e) => {
183
- onTotalChange(selPeriodTime, e.target.value === "" ? "" : parseInt(e.target.value));
184
- }
185
- }
186
- )
187
- ] }) : /* @__PURE__ */ jsx(SkeletonPeriod, { classes })
188
- }
189
- );
190
- };
191
- export {
192
- Period as P
193
- };
@@ -1 +0,0 @@
1
- export declare const componentName = "M4LPeriod";
@@ -1,4 +0,0 @@
1
- const componentName = "M4LPeriod";
2
- export {
3
- componentName as c
4
- };
@@ -1,15 +0,0 @@
1
- import { PeriodClassesType } from './types';
2
- import { OwnerState } from '../types';
3
- export declare const periodClasses: PeriodClassesType;
4
- export declare function getPeriodUtilityClass(slot: string): string;
5
- /**
6
- * TODO: Documentar
7
- */
8
- export declare const periodUtilityClasses: (ownerState: OwnerState) => {
9
- skeleton: string;
10
- root: string;
11
- containerDateLabel: string;
12
- containerDateValue: string;
13
- skeletonFieldPrimary: string;
14
- skeletonFieldSecondary: string;
15
- };
@@ -1,53 +0,0 @@
1
- import { generateUtilityClasses, generateUtilityClass } from "@mui/material";
2
- import { unstable_composeClasses } from "@mui/base";
3
- import { c as componentName } from "./constants.js";
4
- generateUtilityClasses(componentName, [
5
- /* elements */
6
- "root",
7
- "containerDateLabel",
8
- "containerDateValue",
9
- "skeleton",
10
- "skeletonFieldPrimary",
11
- "skeletonFieldSecondary",
12
- "skeletonFieldSecondary",
13
- /* states or variants of elements */
14
- "stateError",
15
- "stateReadOnly",
16
- "variantMonoperiod",
17
- "variantMultiperiod",
18
- "sizeSmall",
19
- "sizeMedium",
20
- "isFocus"
21
- ]);
22
- function getPeriodUtilityClass(slot) {
23
- return generateUtilityClass(componentName, slot);
24
- }
25
- const periodUtilityClasses = (ownerState) => {
26
- const slots = {
27
- root: [
28
- "root",
29
- ownerState.size === "small" && "sizeSmall",
30
- ownerState.size === "medium" && "sizeMedium",
31
- ownerState.state === "error" && "stateError",
32
- ownerState.state === "success" && "stateSuccess",
33
- ownerState.state === "warning" && "stateWarning",
34
- ownerState.state === "info" && "stateInfo",
35
- ownerState.readOnly && "stateReadOnly",
36
- ownerState.variant === "monoperiod" ? "variantMonoperiod" : null,
37
- ownerState.variant === "multiperiod" ? "variantMultiperiod" : null,
38
- ownerState.focus && "isFocus"
39
- ],
40
- containerDateLabel: ["containerDateLabel"],
41
- containerDateValue: ["containerDateValue"],
42
- skeleton: ["skeleton"],
43
- skeletonFieldPrimary: ["skeletonFieldPrimary"],
44
- skeletonFieldSecondary: ["skeletonFieldSecondary"]
45
- };
46
- const composedClasses = unstable_composeClasses(slots, getPeriodUtilityClass, {});
47
- return {
48
- ...composedClasses
49
- };
50
- };
51
- export {
52
- periodUtilityClasses as p
53
- };
@@ -1,18 +0,0 @@
1
- import { periodUtilityClasses } from '.';
2
- export interface PeriodClassesType {
3
- root: string;
4
- containerDateLabel: string;
5
- containerDateValue: string;
6
- skeleton: string;
7
- skeletonFieldPrimary: string;
8
- skeletonFieldSecondary: string;
9
- stateError: string;
10
- stateReadOnly: string;
11
- variantMonoperiod: string;
12
- variantMultiperiod: string;
13
- sizeSmall: string;
14
- sizeMedium: string;
15
- isFocus: string;
16
- }
17
- export declare type PeriodClassesKey = keyof PeriodClassesType;
18
- export type Classes = ReturnType<typeof periodUtilityClasses>;
@@ -1,7 +0,0 @@
1
- export declare const PERIOD_FORMATTER_DICTIONARY_KEY = "period_formatter";
2
- export declare const dictionary: {
3
- LABEL_YEARS: string;
4
- LABEL_MONTHS: string;
5
- LABEL_DAYS: string;
6
- };
7
- export declare function getPeriodComponetsDictionary(): string[];
@@ -1,13 +0,0 @@
1
- import { g as getCommonActionsDictionary } from "../CommonActions/dictionary.js";
2
- const dictionary = {
3
- LABEL_YEARS: "period.label_years",
4
- LABEL_MONTHS: "period.label_months",
5
- LABEL_DAYS: "period.label_days"
6
- };
7
- function getPeriodComponetsDictionary() {
8
- return ["period"].concat(getCommonActionsDictionary());
9
- }
10
- export {
11
- dictionary as d,
12
- getPeriodComponetsDictionary as g
13
- };
@@ -1,2 +0,0 @@
1
- export { Period } from './Period';
2
- export type { PeriodType } from './types';
@@ -1,6 +0,0 @@
1
- import { SKTWrapperProps } from './types';
2
- export declare const ContainerPeriod: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme>, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
3
- export declare const Gap: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme>, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
4
- export declare const SKTWrapper: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & SKTWrapperProps, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
5
- export declare const FieldPeriod: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme>, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
6
- export declare const FieldValue: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme>, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -1,45 +0,0 @@
1
- import { styled } from "@mui/material/styles";
2
- const ContainerPeriod = styled("div")(({ theme }) => ({
3
- ...theme.components?.M4LPeriod?.styleOverrides || {}
4
- }));
5
- styled("div")(({ theme }) => ({
6
- width: "1px",
7
- height: "20px",
8
- backgroundColor: theme.vars.palette.divider
9
- }));
10
- styled("div", {
11
- shouldForwardProp: (props) => props !== "readOnly"
12
- })(({ theme, readOnly }) => ({
13
- display: "flex",
14
- width: "100%",
15
- height: "37.5px",
16
- alignItems: "center",
17
- gap: theme.spacing(1),
18
- border: `1px solid ${theme.vars.palette.divider}`,
19
- ...readOnly && {
20
- border: "0px"
21
- },
22
- padding: theme.spacing(0.5, 1),
23
- borderRadius: "4px"
24
- }));
25
- styled("div")(({ theme }) => ({
26
- ...theme.colorSchemes.finalTheme.typography.body2,
27
- width: "100%",
28
- display: "flex",
29
- textOverflow: "elipsis",
30
- overflow: "hidden",
31
- padding: "5px",
32
- textAlign: "left"
33
- }));
34
- styled("div")(({ theme }) => ({
35
- ...theme.colorSchemes.finalTheme.typography.body2,
36
- width: "70px",
37
- display: "flex",
38
- textOverflow: "elipsis",
39
- overflow: "hidden",
40
- padding: "5px",
41
- textAlign: "left"
42
- }));
43
- export {
44
- ContainerPeriod as C
45
- };
@@ -1,5 +0,0 @@
1
- import { SkeletonPeriodProps } from './types';
2
- /**
3
- * TODO: Documentar
4
- */
5
- export declare const SkeletonPeriod: (props: SkeletonPeriodProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,12 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import { Skeleton } from "@mui/material";
3
- const SkeletonPeriod = (props) => {
4
- const { classes } = props;
5
- return /* @__PURE__ */ jsxs("div", { className: classes.skeleton, children: [
6
- /* @__PURE__ */ jsx("div", { className: classes.skeletonFieldPrimary, children: /* @__PURE__ */ jsx(Skeleton, { variant: "text", width: "50%" }) }),
7
- /* @__PURE__ */ jsx("div", { className: classes.skeletonFieldSecondary, children: /* @__PURE__ */ jsx(Skeleton, { variant: "text", width: "50%" }) })
8
- ] });
9
- };
10
- export {
11
- SkeletonPeriod as S
12
- };
@@ -1,4 +0,0 @@
1
- import { Classes } from '../../classes/types';
2
- export interface SkeletonPeriodProps {
3
- classes: Classes;
4
- }
@@ -1 +0,0 @@
1
- export declare const PERIOD_PREFIX = "M4LPeriod";
@@ -1,4 +0,0 @@
1
- const PERIOD_PREFIX = "M4LPeriod";
2
- export {
3
- PERIOD_PREFIX as P
4
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,2 +0,0 @@
1
- import { PeriodClassesKey } from '../classes/types';
2
- export declare const getNamePeriodDataTestId: (KEY: PeriodClassesKey) => string;
@@ -1,7 +0,0 @@
1
- import { P as PERIOD_PREFIX } from "./constants.js";
2
- const getNamePeriodDataTestId = (KEY) => {
3
- return `${PERIOD_PREFIX}-${KEY}`;
4
- };
5
- export {
6
- getNamePeriodDataTestId as g
7
- };
@@ -1,35 +0,0 @@
1
- export declare enum ETimePeriods {
2
- YEARS = 0,
3
- MONTHS = 1,
4
- DAYS = 2
5
- }
6
- export type PeriodVariant = 'monoperiod' | 'multiperiod';
7
- export type PeriodTime = {
8
- id: number;
9
- label: string;
10
- };
11
- export type SKTWrapperProps = Pick<PeriodProps, 'readOnly'>;
12
- export type PeriodState = 'error' | 'success' | 'warning' | 'info' | undefined;
13
- export type PeriodType = {
14
- selPeriodTime: ETimePeriods;
15
- singleValue: number | '';
16
- years?: number;
17
- months?: number;
18
- days?: number;
19
- };
20
- export interface PeriodProps {
21
- value: PeriodType;
22
- onChange: (newValue: PeriodType) => void;
23
- state?: PeriodState;
24
- readOnly?: boolean;
25
- variant?: PeriodVariant;
26
- skeletonWidth?: string | number;
27
- skeletonHeight?: string | number;
28
- size?: 'small' | 'medium';
29
- }
30
- export interface WrapperProps {
31
- error: boolean;
32
- }
33
- export interface OwnerState extends Pick<PeriodProps, 'state' | 'readOnly' | 'variant' | 'size'> {
34
- focus: boolean;
35
- }
@@ -1,9 +0,0 @@
1
- var ETimePeriods = /* @__PURE__ */ ((ETimePeriods2) => {
2
- ETimePeriods2[ETimePeriods2["YEARS"] = 0] = "YEARS";
3
- ETimePeriods2[ETimePeriods2["MONTHS"] = 1] = "MONTHS";
4
- ETimePeriods2[ETimePeriods2["DAYS"] = 2] = "DAYS";
5
- return ETimePeriods2;
6
- })(ETimePeriods || {});
7
- export {
8
- ETimePeriods as E
9
- };