@m4l/components 0.1.42 → 0.1.45
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.
- package/@types/types.d.ts +117 -0
- package/components/CmpDisenoTest/index.d.ts +4 -0
- package/components/CmpDisenoTest/types.d.ts +20 -0
- package/components/CommonActions/components/ActionCancel/{index.9230c57b.js → index.a81752ef.js} +1 -1
- package/components/CommonActions/components/ActionFormCancel/{index.ab514bd9.js → index.7870abce.js} +25 -9
- package/components/CommonActions/components/ActionIntro/{index.a0a341c7.js → index.d567aebb.js} +1 -1
- package/components/CommonActions/components/Actions/{index.d3e1f36e.js → index.a5f70d5d.js} +19 -8
- package/components/DataGrid/formatters/columnConcatenatedValueFormatter/index.d.ts +3 -0
- package/components/DataGrid/formatters/columnConcatenatedValueFormatter/types.d.ts +6 -0
- package/components/DataGrid/formatters/index.d.ts +1 -0
- package/components/DataGrid/{index.67260455.js → index.8333ea44.js} +42 -15
- package/components/DynamicFilter/contexts/BaseContext/types.d.ts +3 -0
- package/components/DynamicFilter/{index.071aa795.js → index.93dfa3e0.js} +208 -110
- package/components/DynamicFilter/index.d.ts +4 -1
- package/components/DynamicFilter/styles.d.ts +4 -6
- package/components/DynamicFilter/subcomponents/PopupEditFilter/styles.d.ts +7 -0
- package/components/DynamicFilter/types.d.ts +4 -0
- package/components/DynamicFilter/utils/Clases/index.d.ts +20 -0
- package/components/DynamicFilter/utils/Clases/types.d.ts +17 -0
- package/components/ErrorLabel/index.73f9362c.js +65 -0
- package/components/ErrorLabel/index.d.ts +8 -1
- package/components/ErrorLabel/styles.d.ts +1 -1
- package/components/ErrorLabel/types.d.ts +2 -1
- package/components/ErrorLabel/utils/Clases/index.d.ts +6 -0
- package/components/ErrorLabel/utils/Clases/types.d.ts +3 -0
- package/components/Icon/Icon.d.ts +8 -0
- package/components/Icon/classes/constants.d.ts +1 -0
- package/components/Icon/classes/index.d.ts +9 -0
- package/components/Icon/classes/types.d.ts +17 -0
- package/components/Icon/index.d.ts +2 -3
- package/components/Icon/{index.8d754623.js → index.f6e8d810.js} +58 -11
- package/components/Icon/styles.d.ts +1 -1
- package/components/Icon/types.d.ts +5 -0
- package/components/Image/Image.d.ts +9 -0
- package/components/Image/{index.93d5f37f.js → index.aa24e982.js} +107 -43
- package/components/Image/index.d.ts +2 -4
- package/components/Image/styles.d.ts +2 -2
- package/components/Image/subcomponents/LazyLoadComponent/index.d.ts +5 -0
- package/components/Image/subcomponents/LazyLoadComponent/styles.d.ts +2 -0
- package/components/Image/types.d.ts +17 -1
- package/components/Image/utils/classes/constant.d.ts +1 -0
- package/components/Image/utils/classes/index.d.ts +12 -0
- package/components/Image/utils/classes/types.d.ts +9 -0
- package/components/LanguagePopover/LanguagePopover.d.ts +8 -0
- package/components/LanguagePopover/classes/constants.d.ts +1 -0
- package/components/LanguagePopover/classes/index.d.ts +9 -0
- package/components/LanguagePopover/classes/types.d.ts +7 -0
- package/components/LanguagePopover/{index.cbc4b282.js → index.26b694ef.js} +57 -16
- package/components/LanguagePopover/index.d.ts +2 -2
- package/components/LanguagePopover/styles.d.ts +1 -0
- package/components/LanguagePopover/types.d.ts +9 -0
- package/components/ModalDialog/{index.a684827f.js → index.c72a6e31.js} +5 -5
- package/components/NoItemSelected/{index.46d2f632.js → index.9636ec8a.js} +1 -1
- package/components/NoItemSelected/styles.d.ts +1 -1
- package/components/ObjectLogs/{index.4a859658.js → index.239e5877.js} +22 -11
- package/components/PaperForm/{index.c5948756.js → index.0114aa9b.js} +1 -1
- package/components/Period/{index.abe445bd.js → index.10dc7de1.js} +20 -9
- package/components/Resizeable/{index.c96c0f09.js → index.8a442a8b.js} +1 -1
- package/components/areas/components/Area/types.d.ts +24 -12
- package/components/areas/components/AreasAdmin/{index.6794b22f.js → index.01739b1f.js} +24 -15
- package/components/areas/components/AreasContainer/{index.a2f8899b.js → index.41fb511e.js} +9 -10
- package/components/areas/components/GridLayout/{index.b9c1e846.js → index.d11ecdd8.js} +28 -18
- package/components/areas/components/Window/{index.252fbf4e.js → index.61f87e9d.js} +105 -85
- package/components/areas/components/Window/styles.d.ts +5 -2
- package/components/areas/components/Window/subcomponents/InnerForHooks/index.d.ts +4 -0
- package/components/areas/components/Window/subcomponents/InnerForHooks/styles.d.ts +2 -0
- package/components/areas/components/Window/subcomponents/{Component → InnerForHooks/subcomponents/Component}/index.d.ts +4 -3
- package/components/areas/components/Window/subcomponents/{MicroFrontend → InnerForHooks/subcomponents/MicroFrontend}/index.d.ts +1 -1
- package/components/areas/components/Window/subcomponents/{MicroFrontend → InnerForHooks/subcomponents/MicroFrontend}/subcomponents/MFLoader/index.d.ts +1 -1
- package/components/areas/components/Window/subcomponents/InnerForHooks/subcomponents/MicroFrontend/types.d.ts +8 -0
- package/components/areas/components/WindowPopUp/index.d.ts +2 -1
- package/components/areas/components/WindowPopUp/index.f5fa6cce.js +117 -0
- package/components/areas/components/index.d.ts +2 -1
- package/components/areas/components/{index.7d6cd649.js → index.e9971ebf.js} +18 -13
- package/components/areas/contexts/AreaContext/helper.d.ts +12 -0
- package/components/areas/contexts/AreaContext/index.cb686ae0.js +392 -0
- package/components/areas/contexts/AreaContext/index.d.ts +2 -2
- package/components/areas/contexts/AreaContext/store.d.ts +49 -0
- package/components/areas/contexts/AreaContext/types.d.ts +8 -16
- package/components/areas/contexts/AreasContext/index.1b624579.js +204 -0
- package/components/areas/contexts/AreasContext/index.d.ts +10 -2
- package/components/areas/contexts/AreasContext/store.d.ts +38 -0
- package/components/areas/contexts/AreasContext/types.d.ts +1 -13
- package/components/areas/contexts/DynamicMFParmsContext/index.c19cb8cc.js +43 -0
- package/components/areas/contexts/DynamicMFParmsContext/index.d.ts +13 -4
- package/components/areas/contexts/DynamicMFParmsContext/store.d.ts +20 -0
- package/components/areas/contexts/DynamicMFParmsContext/types.d.ts +4 -16
- package/components/areas/contexts/WindowContext/helper.d.ts +1 -0
- package/components/areas/contexts/WindowContext/index.d.ts +13 -0
- package/components/areas/contexts/WindowContext/store.d.ts +31 -0
- package/components/areas/contexts/WindowContext/types.d.ts +5 -0
- package/components/areas/contexts/WindowToolsMFContext/index.d.ts +6 -0
- package/components/areas/contexts/WindowToolsMFContext/types.d.ts +21 -0
- package/components/areas/contexts/index.9c342ce6.js +203 -0
- package/components/areas/contexts/index.d.ts +4 -1
- package/components/areas/hooks/index.4e59c40f.js +27 -0
- package/components/areas/hooks/index.d.ts +2 -0
- package/components/areas/hooks/useArea/index.d.ts +2 -0
- package/components/areas/hooks/useArea/index.df7c7169.js +20 -0
- package/components/areas/hooks/useAreas/index.d.ts +11 -1
- package/components/areas/hooks/useDynamicMFParameters/index.041a666b.js +14 -0
- package/components/areas/hooks/useDynamicMFParameters/index.d.ts +11 -1
- package/components/areas/hooks/useWindow/index.d.ts +11 -0
- package/components/areas/hooks/useWindowToolsMF/index.d.ts +1 -0
- package/components/areas/index.7b430c19.js +21 -0
- package/components/areas/index.d.ts +1 -0
- package/components/formatters/BooleanFormatter/{index.3a9b16c8.js → index.b3fb8a75.js} +1 -1
- package/components/formatters/ConcatenatedFormatter/index.d.ts +8 -0
- package/components/formatters/ConcatenatedFormatter/types.d.ts +11 -0
- package/components/formatters/PeriodFormatter/index.d.ts +8 -0
- package/components/formatters/PeriodFormatter/types.d.ts +13 -0
- package/components/formatters/dictionary.d.ts +9 -0
- package/components/formatters/index.0368bab3.js +127 -0
- package/components/formatters/index.d.ts +2 -0
- package/components/hook-form/RHFAutocomplete/{index.de93fe01.js → index.74add0d0.js} +1 -1
- package/components/hook-form/RHFAutocompleteAsync/{index.ca696cce.js → index.0aa3c224.js} +1 -1
- package/components/hook-form/RHFCheckbox/RHFCheckbox.d.ts +8 -0
- package/components/hook-form/RHFCheckbox/classes/index.d.ts +7 -0
- package/components/hook-form/RHFCheckbox/classes/types.d.ts +5 -0
- package/components/hook-form/RHFCheckbox/index.ebfe1e3c.js +110 -0
- package/components/hook-form/RHFCheckbox/styles.d.ts +14 -0
- package/components/hook-form/RHFCheckbox/subcomponents/Skeleton/index.d.ts +2 -1
- package/components/hook-form/RHFCheckbox/subcomponents/Skeleton/types.d.ts +3 -0
- package/components/hook-form/RHFPeriod/{index.3772295b.js → index.10c4501a.js} +2 -2
- package/components/hook-form/RHFTextField/RHFTextField.d.ts +8 -0
- package/components/hook-form/RHFTextField/classes/constants.d.ts +1 -0
- package/components/hook-form/RHFTextField/classes/index.d.ts +7 -0
- package/components/hook-form/RHFTextField/classes/types.d.ts +10 -0
- package/components/hook-form/RHFTextField/index.57f138f7.js +219 -0
- package/components/hook-form/RHFTextField/index.d.ts +2 -3
- package/components/hook-form/RHFTextField/styles.d.ts +3 -0
- package/components/hook-form/RHFTextField/subcomponents/Skeleton/types.d.ts +6 -1
- package/components/hook-form/RHFTextField/types.d.ts +0 -1
- package/components/hook-form/RHFTextFieldPassword/RHFTextFieldPassword.d.ts +9 -0
- package/components/hook-form/RHFTextFieldPassword/classes/index.d.ts +6 -0
- package/components/hook-form/RHFTextFieldPassword/classes/types.d.ts +4 -0
- package/components/hook-form/RHFTextFieldPassword/index.d.ts +2 -3
- package/components/hook-form/RHFTextFieldPassword/styles.d.ts +2 -0
- package/components/hook-form/RHFUpload/{index.d5cc7c13.js → index.7fdff30f.js} +1 -1
- package/components/hook-form/index.d.ts +3 -3
- package/components/index.d.ts +3 -2
- package/components/modal/{WindowBase.04439b8e.js → WindowBase.bed2458c.js} +3 -4
- package/components/modal/{WindowConfirm.0b8a6818.js → WindowConfirm.bde6242f.js} +22 -11
- package/components/modal/index.cb75ce72.js +29 -0
- package/components/mui_extended/Accordion/{index.a541c71c.js → index.1d513477.js} +2 -2
- package/components/mui_extended/Button/Button.d.ts +8 -0
- package/components/mui_extended/Button/classes/constants.d.ts +1 -0
- package/components/mui_extended/Button/classes/index.d.ts +7 -0
- package/components/mui_extended/Button/classes/types.d.ts +5 -0
- package/components/mui_extended/Button/index.8406ed5b.js +150 -0
- package/components/mui_extended/Button/index.d.ts +2 -3
- package/components/mui_extended/Button/styles.d.ts +13 -0
- package/components/mui_extended/IconButton/IconButton.d.ts +9 -0
- package/components/mui_extended/IconButton/classes/constants.d.ts +1 -0
- package/components/mui_extended/IconButton/classes/index.d.ts +7 -0
- package/components/mui_extended/IconButton/classes/types.d.ts +5 -0
- package/components/mui_extended/IconButton/index.1318a283.js +100 -0
- package/components/mui_extended/IconButton/index.d.ts +2 -4
- package/components/mui_extended/IconButton/styles.d.ts +2 -0
- package/components/mui_extended/IconButton/subcomponents/SkeletonIconButton/index.d.ts +2 -1
- package/components/mui_extended/IconButton/subcomponents/SkeletonIconButton/types.d.ts +3 -0
- package/components/mui_extended/ImageButton/ImageButton.d.ts +6 -0
- package/components/mui_extended/ImageButton/styles.d.ts +2 -0
- package/components/mui_extended/ImageButton/types.d.ts +0 -2
- package/components/mui_extended/ImageButton/utils/Clases/constants.d.ts +1 -0
- package/components/mui_extended/ImageButton/utils/Clases/index.d.ts +6 -0
- package/components/mui_extended/ImageButton/utils/Clases/types.d.ts +3 -0
- package/components/mui_extended/MenuActions/{index.ee17bddd.js → index.1261168c.js} +2 -2
- package/components/mui_extended/Pager/{index.74d3f5fc.js → index.80ccec47.js} +1 -1
- package/components/mui_extended/Popover/Popover.d.ts +9 -0
- package/components/mui_extended/Popover/classes/index.d.ts +8 -0
- package/components/mui_extended/Popover/classes/types.d.ts +17 -0
- package/components/mui_extended/Popover/{index.53c77d23.js → index.58c49cc0.js} +55 -13
- package/components/mui_extended/Popover/styles.d.ts +1 -0
- package/components/mui_extended/Popover/subcomponts/ArrowIcon/index.d.ts +3 -0
- package/components/mui_extended/Popover/types.d.ts +1 -1
- package/components/mui_extended/Typography/index.be3a279a.js +63 -0
- package/components/mui_extended/Typography/index.d.ts +3 -0
- package/components/mui_extended/Typography/styles.d.ts +2 -0
- package/components/mui_extended/Typography/utils/Clases/index.d.ts +6 -0
- package/components/mui_extended/Typography/utils/Clases/types.d.ts +3 -0
- package/components/mui_extended/index.3106c913.js +19 -0
- package/components/mui_extended/index.d.ts +5 -4
- package/contexts/ModalContext/{index.b90eec94.js → index.c8212291.js} +1 -1
- package/contexts/RHFormContext/{index.d88e6e27.js → index.828b60ad.js} +1 -1
- package/contexts/index.d.ts +1 -1
- package/hooks/index.d.ts +0 -1
- package/hooks/useFormAddEdit/{index.d4845f1a.js → index.15de3ba8.js} +5 -0
- package/hooks/useModal/{index.d14edee3.js → index.19172e70.js} +1 -1
- package/index.js +165 -109
- package/package.json +13 -8
- package/{react-draggable.84d6b038.js → react-draggable.0eef011c.js} +1 -1
- package/{react-resizable.1d00271d.js → react-resizable.bb58c8fc.js} +103 -67
- package/utils/{index.899eb67b.js → index.e882b264.js} +26 -18
- package/vite-env.d.ts +2 -1
- package/components/DynamicFilter/components/PopupEditFilter/styles.d.ts +0 -6
- package/components/ErrorLabel/index.c8615f16.js +0 -20
- package/components/areas/components/Window/contexts/WindowContext/index.d.ts +0 -5
- package/components/areas/components/Window/contexts/WindowContext/types.d.ts +0 -13
- package/components/areas/components/Window/hooks/useWindow/index.d.ts +0 -1
- package/components/areas/components/WindowPopUp/index.214cf099.js +0 -120
- package/components/areas/components/WindowPopUp/styles.d.ts +0 -2
- package/components/areas/contexts/AreaContext/index.4894cf23.js +0 -286
- package/components/areas/contexts/AreasContext/index.cd8e4bee.js +0 -158
- package/components/areas/contexts/DynamicMFParmsContext/index.668bc2e2.js +0 -17
- package/components/areas/contexts/index.f9196fb2.js +0 -1
- package/components/areas/hooks/useArea/index.9b85ce24.js +0 -19
- package/components/areas/hooks/useDynamicMFParameters/index.e6a44ae3.js +0 -11
- package/components/areas/index.d1bf612c.js +0 -16
- package/components/formatters/dicctionary.d.ts +0 -3
- package/components/formatters/index.0b5f95d0.js +0 -21
- package/components/hook-form/RHFCheckbox/index.6dcec9e2.js +0 -68
- package/components/hook-form/RHFCheckbox/index.d.ts +0 -4
- package/components/hook-form/RHFTextField/index.b17d68f4.js +0 -146
- package/components/modal/index.8387e90e.js +0 -18
- package/components/mui_extended/Button/index.86a155a2.js +0 -101
- package/components/mui_extended/IconButton/index.82f16572.js +0 -63
- package/components/mui_extended/ImageButton/index.d.ts +0 -3
- package/components/mui_extended/Popover/index.d.ts +0 -4
- package/components/mui_extended/Typography/index.e5494696.js +0 -35
- package/components/mui_extended/index.85dfadf1.js +0 -16
- /package/components/DynamicFilter/{components → subcomponents}/ApplyedFilters/components/ApplyedFilter/index.d.ts +0 -0
- /package/components/DynamicFilter/{components → subcomponents}/ApplyedFilters/components/ApplyedFilter/styles.d.ts +0 -0
- /package/components/DynamicFilter/{components → subcomponents}/ApplyedFilters/index.d.ts +0 -0
- /package/components/DynamicFilter/{components → subcomponents}/ApplyedFilters/styles.d.ts +0 -0
- /package/components/DynamicFilter/{components → subcomponents}/ClearFilters/index.d.ts +0 -0
- /package/components/DynamicFilter/{components → subcomponents}/ClearFilters/styles.d.ts +0 -0
- /package/components/DynamicFilter/{components → subcomponents}/FilterButton/index.d.ts +0 -0
- /package/components/DynamicFilter/{components → subcomponents}/FilterButton/styles.d.ts +0 -0
- /package/components/DynamicFilter/{components → subcomponents}/InputFilter/index.d.ts +0 -0
- /package/components/DynamicFilter/{components → subcomponents}/InputFilter/styles.d.ts +0 -0
- /package/components/DynamicFilter/{components → subcomponents}/PopupEditFilter/index.d.ts +0 -0
- /package/components/DynamicFilter/{components → subcomponents}/fieldstypes/BooleanFilter/index.d.ts +0 -0
- /package/components/DynamicFilter/{components → subcomponents}/fieldstypes/BooleanFilter/styles.d.ts +0 -0
- /package/components/DynamicFilter/{components → subcomponents}/fieldstypes/DateTimeFilter/index.d.ts +0 -0
- /package/components/DynamicFilter/{components → subcomponents}/fieldstypes/DateTimeFilter/styles.d.ts +0 -0
- /package/components/DynamicFilter/{components → subcomponents}/fieldstypes/NumberFilter/index.d.ts +0 -0
- /package/components/DynamicFilter/{components → subcomponents}/fieldstypes/NumberFilter/styles.d.ts +0 -0
- /package/components/DynamicFilter/{components → subcomponents}/fieldstypes/StringFilter/index.d.ts +0 -0
- /package/components/DynamicFilter/{components → subcomponents}/fieldstypes/StringFilter/styles.d.ts +0 -0
- /package/components/DynamicFilter/{components → subcomponents}/fieldstypes/factory.d.ts +0 -0
- /package/components/DynamicFilter/{components → subcomponents}/fieldstypes/validations.d.ts +0 -0
- /package/components/areas/components/Window/subcomponents/{Header → InnerForHooks/subcomponents/Header}/index.d.ts +0 -0
- /package/components/areas/components/Window/subcomponents/{Header → InnerForHooks/subcomponents/Header}/skeleton.d.ts +0 -0
- /package/components/areas/components/Window/subcomponents/{Header → InnerForHooks/subcomponents/Header}/styles.d.ts +0 -0
- /package/components/areas/components/Window/subcomponents/{MicroFrontend → InnerForHooks/subcomponents/MicroFrontend}/subcomponents/MFLoader/subcomponents/LoadingMF/index.d.ts +0 -0
- /package/components/areas/components/Window/subcomponents/{MicroFrontend → InnerForHooks/subcomponents/MicroFrontend}/subcomponents/MFLoader/subcomponents/LoadingMF/styles.d.ts +0 -0
- /package/components/areas/components/Window/subcomponents/{MicroFrontend → InnerForHooks/subcomponents/MicroFrontend}/subcomponents/MFLoader/subcomponents/LoadingMF/subcomponents/NotFound/index.d.ts +0 -0
- /package/components/areas/components/Window/subcomponents/{MicroFrontend → InnerForHooks/subcomponents/MicroFrontend}/subcomponents/MFLoader/subcomponents/LoadingMF/subcomponents/NotFound/styles.d.ts +0 -0
- /package/components/areas/components/Window/subcomponents/{MicroFrontend → InnerForHooks/subcomponents/MicroFrontend}/subcomponents/MFLoader/subcomponents/LoadingMF/subcomponents/NotFound/types.d.ts +0 -0
- /package/components/areas/components/Window/subcomponents/{MicroFrontend → InnerForHooks/subcomponents/MicroFrontend}/subcomponents/MFLoader/subcomponents/LoadingMF/types.d.ts +0 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ConcatenatedFormatterProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Concatena un arrays de strings y/o numbers
|
|
5
|
+
* @param props {values: Array<string> Valores a concatenar, separator: string Separador entre valores concatenados, Component: ElementType Componente que abraza la respuesta}
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
export declare function ConcatenatedFormatter(props: ConcatenatedFormatterProps): JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ElementType } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Component: Tipo de componente HTML que "abraza" el resultado
|
|
4
|
+
* Values: Array de strings a concatenar
|
|
5
|
+
* Separator: String usado para concatenar el array de strings
|
|
6
|
+
*/
|
|
7
|
+
export interface ConcatenatedFormatterProps {
|
|
8
|
+
values: Array<string | number>;
|
|
9
|
+
separator?: string | number;
|
|
10
|
+
Component?: ElementType;
|
|
11
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ElementType } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Component: Tipo de componente HTML que "abraza" el resultado
|
|
4
|
+
* years: Cantidad de años
|
|
5
|
+
* months: Cantidad de meses
|
|
6
|
+
* days: Cantidad de días
|
|
7
|
+
*/
|
|
8
|
+
export interface PeriodFormatterProps {
|
|
9
|
+
years?: number;
|
|
10
|
+
months?: number;
|
|
11
|
+
days?: number;
|
|
12
|
+
Component?: ElementType;
|
|
13
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Dictionary } from '@m4l/core';
|
|
2
|
+
export declare function getFormattersComponentsDictionary(): string[];
|
|
3
|
+
export declare const defaultFormattersDictionary: Dictionary;
|
|
4
|
+
export declare const LABEL_YEARS = "formatters.label_years";
|
|
5
|
+
export declare const LABEL_YEAR = "formatters.label_year";
|
|
6
|
+
export declare const LABEL_MONTHS = "formatters.label_months";
|
|
7
|
+
export declare const LABEL_MONTH = "formatters.label_month";
|
|
8
|
+
export declare const LABEL_DAYS = "formatters.label_days";
|
|
9
|
+
export declare const LABEL_DAY = "formatters.label_day";
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { W as WrapperComponent } from "../WrapperComponent/index.5e872594.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useModuleDictionary } from "@m4l/core";
|
|
4
|
+
import "react";
|
|
5
|
+
import "../Icon/index.f6e8d810.js";
|
|
6
|
+
import "@mui/material/styles";
|
|
7
|
+
import "@m4l/graphics";
|
|
8
|
+
function ConcatenatedFormatter(props) {
|
|
9
|
+
const {
|
|
10
|
+
values = "",
|
|
11
|
+
separator = " ",
|
|
12
|
+
Component = WrapperComponent
|
|
13
|
+
} = props;
|
|
14
|
+
const returnSymbol = "-";
|
|
15
|
+
if (values === null)
|
|
16
|
+
return /* @__PURE__ */ jsx(Component, {
|
|
17
|
+
children: returnSymbol
|
|
18
|
+
});
|
|
19
|
+
if (!Array.isArray(values)) {
|
|
20
|
+
return /* @__PURE__ */ jsx(Component, {
|
|
21
|
+
children: values.toString()
|
|
22
|
+
});
|
|
23
|
+
} else {
|
|
24
|
+
if (values.length == 0)
|
|
25
|
+
return /* @__PURE__ */ jsx(Component, {
|
|
26
|
+
children: returnSymbol
|
|
27
|
+
});
|
|
28
|
+
else {
|
|
29
|
+
const result = values.map((value) => {
|
|
30
|
+
if (value === null || value === void 0)
|
|
31
|
+
return returnSymbol;
|
|
32
|
+
else {
|
|
33
|
+
if (typeof value === "string" || typeof value === "number") {
|
|
34
|
+
return value.toString();
|
|
35
|
+
} else {
|
|
36
|
+
return returnSymbol;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
return /* @__PURE__ */ jsx(Component, {
|
|
41
|
+
children: result.join(separator.toString())
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function getFormattersComponentsDictionary() {
|
|
47
|
+
return ["formatters"];
|
|
48
|
+
}
|
|
49
|
+
const defaultFormattersDictionary = {
|
|
50
|
+
pager: {
|
|
51
|
+
boolean_yes: "Yes",
|
|
52
|
+
boolean_no: "No",
|
|
53
|
+
boolean_true: "True",
|
|
54
|
+
boolean_false: "False"
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
const LABEL_YEARS = "formatters.label_years";
|
|
58
|
+
const LABEL_YEAR = "formatters.label_year";
|
|
59
|
+
const LABEL_MONTHS = "formatters.label_months";
|
|
60
|
+
const LABEL_MONTH = "formatters.label_month";
|
|
61
|
+
const LABEL_DAYS = "formatters.label_days";
|
|
62
|
+
const LABEL_DAY = "formatters.label_day";
|
|
63
|
+
function PeriodFormatter(props) {
|
|
64
|
+
const {
|
|
65
|
+
getLabel
|
|
66
|
+
} = useModuleDictionary();
|
|
67
|
+
const {
|
|
68
|
+
years = 0,
|
|
69
|
+
months = 0,
|
|
70
|
+
days = 0,
|
|
71
|
+
Component = WrapperComponent
|
|
72
|
+
} = props;
|
|
73
|
+
let period = "";
|
|
74
|
+
const separator = ", ";
|
|
75
|
+
switch (years) {
|
|
76
|
+
case 0:
|
|
77
|
+
break;
|
|
78
|
+
case 1:
|
|
79
|
+
period = "1 " + getLabel(LABEL_YEAR);
|
|
80
|
+
break;
|
|
81
|
+
default:
|
|
82
|
+
period = years.toString() + " " + getLabel(LABEL_YEARS);
|
|
83
|
+
}
|
|
84
|
+
switch (months) {
|
|
85
|
+
case 0:
|
|
86
|
+
break;
|
|
87
|
+
case 1:
|
|
88
|
+
if (years > 0)
|
|
89
|
+
period += separator;
|
|
90
|
+
period += "1 " + getLabel(LABEL_MONTH);
|
|
91
|
+
break;
|
|
92
|
+
default:
|
|
93
|
+
if (years > 0)
|
|
94
|
+
period += separator;
|
|
95
|
+
period += months.toString() + " " + getLabel(LABEL_MONTHS);
|
|
96
|
+
}
|
|
97
|
+
switch (days) {
|
|
98
|
+
case 0:
|
|
99
|
+
break;
|
|
100
|
+
case 1:
|
|
101
|
+
if (years > 0 || months > 0)
|
|
102
|
+
period += separator;
|
|
103
|
+
period += "1 " + getLabel(LABEL_DAY);
|
|
104
|
+
break;
|
|
105
|
+
default:
|
|
106
|
+
if (years > 0 || months > 0)
|
|
107
|
+
period += separator;
|
|
108
|
+
period += days.toString() + " " + getLabel(LABEL_DAYS);
|
|
109
|
+
}
|
|
110
|
+
if (period == "")
|
|
111
|
+
period = "-";
|
|
112
|
+
return /* @__PURE__ */ jsx(Component, {
|
|
113
|
+
children: period
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
export {
|
|
117
|
+
ConcatenatedFormatter as C,
|
|
118
|
+
LABEL_YEARS as L,
|
|
119
|
+
PeriodFormatter as P,
|
|
120
|
+
LABEL_YEAR as a,
|
|
121
|
+
LABEL_MONTHS as b,
|
|
122
|
+
LABEL_MONTH as c,
|
|
123
|
+
defaultFormattersDictionary as d,
|
|
124
|
+
LABEL_DAYS as e,
|
|
125
|
+
LABEL_DAY as f,
|
|
126
|
+
getFormattersComponentsDictionary as g
|
|
127
|
+
};
|
|
@@ -2,5 +2,7 @@ export { BooleanFormatter } from './BooleanFormatter';
|
|
|
2
2
|
export { DateFormatter } from './DateFormatter';
|
|
3
3
|
export { UncertaintyFormatter, getUncertaintyFormat } from './UncertaintyFormatter';
|
|
4
4
|
export { PointsFormatter, getFormatPoints } from './PointsFormatter';
|
|
5
|
+
export { ConcatenatedFormatter } from './ConcatenatedFormatter';
|
|
6
|
+
export { PeriodFormatter } from './PeriodFormatter';
|
|
5
7
|
export { PriceFormatter, getFormatPrice } from './PriceFormatter';
|
|
6
8
|
export type { UncertaintyRange } from './UncertaintyFormatter/types';
|
|
@@ -2,7 +2,7 @@ import { useModuleDictionary, useModuleSkeleton } from "@m4l/core";
|
|
|
2
2
|
import { useFormContext, Controller } from "react-hook-form";
|
|
3
3
|
import { styled as styled$1, Skeleton, Autocomplete, TextField, CircularProgress } from "@mui/material";
|
|
4
4
|
import { styled } from "@mui/material/styles";
|
|
5
|
-
import { I as Image } from "../../Image/index.
|
|
5
|
+
import { I as Image } from "../../Image/index.aa24e982.js";
|
|
6
6
|
import { useMemo, useState, useEffect } from "react";
|
|
7
7
|
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
8
8
|
const WrapperAutocomplete = styled("div")(({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useState, useCallback, useEffect } from "react";
|
|
2
2
|
import { useNetwork, getPropertyByString } from "@m4l/core";
|
|
3
3
|
import debounce from "lodash/debounce";
|
|
4
|
-
import { R as RHFAutocomplete, g as getRHFAutocompleteComponentsDictionary } from "../RHFAutocomplete/index.
|
|
4
|
+
import { R as RHFAutocomplete, g as getRHFAutocompleteComponentsDictionary } from "../RHFAutocomplete/index.74add0d0.js";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
function RHFAutocompleteAsync(props) {
|
|
7
7
|
const {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { RHFCheckboxProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Provee de un caja de selección vinculado al controlador de hook-forms y aporta su versión provisional de carga en red.
|
|
5
|
+
* @param props
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
export declare function RHFCheckbox(props: RHFCheckboxProps): JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { RHFCheckboxClassesType } from './types';
|
|
2
|
+
export declare const RHFCheckboxClasses: RHFCheckboxClassesType;
|
|
3
|
+
export declare function getRHFCheckboxUtilityClass(slot: string): string;
|
|
4
|
+
export declare const useUtilityClasses: () => {
|
|
5
|
+
root: string;
|
|
6
|
+
skeleton: string;
|
|
7
|
+
};
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { useFormContext, Controller } from "react-hook-form";
|
|
2
|
+
import { styled, Skeleton, generateUtilityClasses, generateUtilityClass, Checkbox } from "@mui/material";
|
|
3
|
+
import { useModuleSkeleton } from "@m4l/core";
|
|
4
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
5
|
+
import { styled as styled$1 } from "@mui/material/styles";
|
|
6
|
+
import { unstable_composeClasses } from "@mui/base";
|
|
7
|
+
import { E as ErrorLabel } from "../../ErrorLabel/index.73f9362c.js";
|
|
8
|
+
import { T as Typography } from "../../mui_extended/Typography/index.be3a279a.js";
|
|
9
|
+
const WrapperSkeletonCheckBox = styled("div")(() => ({
|
|
10
|
+
display: "flex",
|
|
11
|
+
justifyContent: "center",
|
|
12
|
+
alignItems: "center",
|
|
13
|
+
width: "36px",
|
|
14
|
+
height: "36px"
|
|
15
|
+
}));
|
|
16
|
+
const SkeletonRHFCheckBox = (props) => {
|
|
17
|
+
const {
|
|
18
|
+
classes
|
|
19
|
+
} = props;
|
|
20
|
+
return /* @__PURE__ */ jsx(WrapperSkeletonCheckBox, {
|
|
21
|
+
className: classes.skeleton,
|
|
22
|
+
"data-testid": "SkeletonRHFCheckBox",
|
|
23
|
+
children: /* @__PURE__ */ jsx(Skeleton, {
|
|
24
|
+
variant: "rounded",
|
|
25
|
+
width: "18px",
|
|
26
|
+
height: "18px"
|
|
27
|
+
})
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
const RHFCheckboxRoot = styled$1("div")(({
|
|
31
|
+
theme
|
|
32
|
+
}) => ({
|
|
33
|
+
display: "flex",
|
|
34
|
+
alignItems: "center",
|
|
35
|
+
gap: theme.spacing(0.5),
|
|
36
|
+
...theme.components?.M4LRHFCheckbox?.styleOverrides
|
|
37
|
+
}));
|
|
38
|
+
styled$1("div")(() => ({
|
|
39
|
+
display: "flex",
|
|
40
|
+
justifyContent: "center",
|
|
41
|
+
alignItems: "center",
|
|
42
|
+
padding: "8px"
|
|
43
|
+
}));
|
|
44
|
+
styled$1(Skeleton)(() => ({
|
|
45
|
+
width: "20px",
|
|
46
|
+
height: "20px",
|
|
47
|
+
borderRadius: "4px"
|
|
48
|
+
}));
|
|
49
|
+
generateUtilityClasses("M4LRHFCheckbox", [
|
|
50
|
+
"root",
|
|
51
|
+
"skeleton"
|
|
52
|
+
]);
|
|
53
|
+
function getRHFCheckboxUtilityClass(slot) {
|
|
54
|
+
return generateUtilityClass("M4LRHFCheckbox", slot);
|
|
55
|
+
}
|
|
56
|
+
const useUtilityClasses = () => {
|
|
57
|
+
const slots = {
|
|
58
|
+
root: ["root"],
|
|
59
|
+
skeleton: ["skeleton"]
|
|
60
|
+
};
|
|
61
|
+
const composedClasses = unstable_composeClasses(slots, getRHFCheckboxUtilityClass, {});
|
|
62
|
+
return {
|
|
63
|
+
...composedClasses
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
function RHFCheckbox(props) {
|
|
67
|
+
const {
|
|
68
|
+
name,
|
|
69
|
+
sizeCheck = "small",
|
|
70
|
+
label
|
|
71
|
+
} = props;
|
|
72
|
+
const {
|
|
73
|
+
control
|
|
74
|
+
} = useFormContext();
|
|
75
|
+
const isSkeleton = useModuleSkeleton();
|
|
76
|
+
const classes = useUtilityClasses();
|
|
77
|
+
return /* @__PURE__ */ jsxs(RHFCheckboxRoot, {
|
|
78
|
+
className: classes.root,
|
|
79
|
+
"data-testid": "RHFCheckboxRoot",
|
|
80
|
+
children: [/* @__PURE__ */ jsx(Controller, {
|
|
81
|
+
name,
|
|
82
|
+
control,
|
|
83
|
+
render: ({
|
|
84
|
+
field,
|
|
85
|
+
fieldState: {
|
|
86
|
+
error
|
|
87
|
+
}
|
|
88
|
+
}) => {
|
|
89
|
+
return !isSkeleton ? /* @__PURE__ */ jsxs(Fragment, {
|
|
90
|
+
children: [/* @__PURE__ */ jsx(Checkbox, {
|
|
91
|
+
size: sizeCheck,
|
|
92
|
+
...field,
|
|
93
|
+
checked: field.value
|
|
94
|
+
}), error?.message && /* @__PURE__ */ jsx(ErrorLabel, {
|
|
95
|
+
message: error?.message + ""
|
|
96
|
+
})]
|
|
97
|
+
}) : /* @__PURE__ */ jsx(SkeletonRHFCheckBox, {
|
|
98
|
+
classes
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}), /* @__PURE__ */ jsx(Typography, {
|
|
102
|
+
variant: "body1",
|
|
103
|
+
skeletonWidth: "80px",
|
|
104
|
+
children: label
|
|
105
|
+
})]
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
export {
|
|
109
|
+
RHFCheckbox as R
|
|
110
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const RHFCheckboxRoot: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
3
|
+
export declare const WrapperSKTRHFCheckbox: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
4
|
+
export declare const SKTCheckSkeleton: import("@emotion/styled").StyledComponent<{
|
|
5
|
+
animation?: false | "pulse" | "wave" | undefined;
|
|
6
|
+
children?: import("react").ReactNode;
|
|
7
|
+
classes?: Partial<import("@mui/material").SkeletonClasses> | undefined;
|
|
8
|
+
height?: string | number | undefined;
|
|
9
|
+
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
10
|
+
variant?: "text" | "rectangular" | "rounded" | "circular" | undefined;
|
|
11
|
+
width?: string | number | undefined;
|
|
12
|
+
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
13
|
+
ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
|
|
14
|
+
}, "children" | "width" | "height" | keyof import("@mui/material/OverridableComponent").CommonProps | "animation" | "sx" | "variant"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { styled } from "@mui/material";
|
|
2
2
|
import { useFormContext, Controller } from "react-hook-form";
|
|
3
|
-
import { E as ErrorLabel } from "../../ErrorLabel/index.
|
|
4
|
-
import { P as Period } from "../../Period/index.
|
|
3
|
+
import { E as ErrorLabel } from "../../ErrorLabel/index.73f9362c.js";
|
|
4
|
+
import { P as Period } from "../../Period/index.10dc7de1.js";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
const Wrapper = styled("div")(({
|
|
7
7
|
theme
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { RHFTextFieldProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Provee de un campo de texto vinculado al formulario de hook-forms, aporta su versión provisional de carga en red.
|
|
5
|
+
* @param props
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
export declare const RHFTextField: import("react").ForwardRefExoticComponent<(Omit<RHFTextFieldProps & import("@mui/material").StandardTextFieldProps, "ref"> | Omit<RHFTextFieldProps & import("@mui/material").FilledTextFieldProps, "ref"> | Omit<RHFTextFieldProps & import("@mui/material").OutlinedTextFieldProps, "ref">) & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const componentName = "M4LRHFTextField";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { RHFTextFieldClassesType, RHFTextFieldState } from './types';
|
|
2
|
+
export declare const RHFTextFieldClasses: RHFTextFieldClassesType;
|
|
3
|
+
export declare function getRHFTextFieldUtilityClass(slot: string): string;
|
|
4
|
+
export declare const getRHFTextFieldClassesByState: (ownerState: RHFTextFieldState) => {
|
|
5
|
+
root: string;
|
|
6
|
+
skeleton: string;
|
|
7
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface RHFTextFieldClassesType {
|
|
2
|
+
root: string;
|
|
3
|
+
skeleton: string;
|
|
4
|
+
variantText: string;
|
|
5
|
+
variantPassword: string;
|
|
6
|
+
}
|
|
7
|
+
export interface RHFTextFieldState {
|
|
8
|
+
variant: 'password' | 'text';
|
|
9
|
+
}
|
|
10
|
+
export declare type RHFTextFieldClassesKey = keyof RHFTextFieldClassesType;
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { useModuleSkeleton, useEnvironment } from "@m4l/core";
|
|
2
|
+
import { styled, Skeleton, generateUtilityClasses, generateUtilityClass, TextField, InputAdornment } from "@mui/material";
|
|
3
|
+
import { forwardRef, useState } from "react";
|
|
4
|
+
import { I as IconButton } from "../../mui_extended/IconButton/index.1318a283.js";
|
|
5
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
6
|
+
import "../../Icon/index.f6e8d810.js";
|
|
7
|
+
import { styled as styled$1 } from "@mui/material/styles";
|
|
8
|
+
import { useFormContext, Controller } from "react-hook-form";
|
|
9
|
+
import { unstable_composeClasses } from "@mui/base";
|
|
10
|
+
const WrapperSkeletonRHFTextField = styled("div")(({
|
|
11
|
+
theme
|
|
12
|
+
}) => ({
|
|
13
|
+
display: "flex",
|
|
14
|
+
width: "100%",
|
|
15
|
+
height: "42.25px",
|
|
16
|
+
alignItems: "center",
|
|
17
|
+
justifyContent: "space-between",
|
|
18
|
+
border: `1px solid ${theme.palette.divider}`,
|
|
19
|
+
padding: "12px 14px",
|
|
20
|
+
borderRadius: theme.spacing(1)
|
|
21
|
+
}));
|
|
22
|
+
const SkeletonTextField = (props) => {
|
|
23
|
+
const {
|
|
24
|
+
skeletonWidth,
|
|
25
|
+
skeletonHeight,
|
|
26
|
+
ownerState,
|
|
27
|
+
classes
|
|
28
|
+
} = props;
|
|
29
|
+
const {
|
|
30
|
+
variant
|
|
31
|
+
} = ownerState;
|
|
32
|
+
return /* @__PURE__ */ jsx(WrapperSkeletonRHFTextField, {
|
|
33
|
+
className: classes.skeleton,
|
|
34
|
+
"data-testid": "WrapperSkeletonRHFTextField",
|
|
35
|
+
children: variant === "text" ? /* @__PURE__ */ jsx(Skeleton, {
|
|
36
|
+
variant: "text",
|
|
37
|
+
width: skeletonWidth,
|
|
38
|
+
height: skeletonHeight
|
|
39
|
+
}) : /* @__PURE__ */ jsxs(Fragment, {
|
|
40
|
+
children: [/* @__PURE__ */ jsx(Skeleton, {
|
|
41
|
+
variant: "text",
|
|
42
|
+
width: skeletonWidth,
|
|
43
|
+
height: skeletonHeight
|
|
44
|
+
}), /* @__PURE__ */ jsx(Skeleton, {
|
|
45
|
+
variant: "circular",
|
|
46
|
+
width: "20px",
|
|
47
|
+
height: "20px"
|
|
48
|
+
})]
|
|
49
|
+
})
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
const RHFTextFieldRoot = styled$1("div")(({
|
|
53
|
+
theme
|
|
54
|
+
}) => ({
|
|
55
|
+
...theme.components?.M4LRHFTextField?.styleOverrides
|
|
56
|
+
}));
|
|
57
|
+
styled$1("div")(({
|
|
58
|
+
theme
|
|
59
|
+
}) => ({
|
|
60
|
+
display: "flex",
|
|
61
|
+
width: "100%",
|
|
62
|
+
alignItems: "center",
|
|
63
|
+
border: `1px solid ${theme.palette.divider}`,
|
|
64
|
+
padding: "12px 14px",
|
|
65
|
+
borderRadius: theme.spacing(1)
|
|
66
|
+
}));
|
|
67
|
+
const componentName = "M4LRHFTextField";
|
|
68
|
+
generateUtilityClasses(
|
|
69
|
+
componentName,
|
|
70
|
+
[
|
|
71
|
+
"root",
|
|
72
|
+
"skeleton",
|
|
73
|
+
"variantText",
|
|
74
|
+
"variantPassword"
|
|
75
|
+
]
|
|
76
|
+
);
|
|
77
|
+
function getRHFTextFieldUtilityClass(slot) {
|
|
78
|
+
return generateUtilityClass(componentName, slot);
|
|
79
|
+
}
|
|
80
|
+
const getRHFTextFieldClassesByState = (ownerState) => {
|
|
81
|
+
const slots = {
|
|
82
|
+
root: ["root", ownerState.variant === "password" ? "variantPassword" : "variantText"],
|
|
83
|
+
skeleton: ["skeleton"]
|
|
84
|
+
};
|
|
85
|
+
const composedClasses = unstable_composeClasses(slots, getRHFTextFieldUtilityClass, {});
|
|
86
|
+
return {
|
|
87
|
+
...composedClasses
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
const RHFTextField = forwardRef((props, inputRef) => {
|
|
91
|
+
const {
|
|
92
|
+
name: nameRHF,
|
|
93
|
+
autoComplete = "off",
|
|
94
|
+
skeletonWidth = "100%",
|
|
95
|
+
skeletonHeight = "18px",
|
|
96
|
+
type,
|
|
97
|
+
...other
|
|
98
|
+
} = props;
|
|
99
|
+
const ownerState = {
|
|
100
|
+
variant: type === "password" ? "password" : "text"
|
|
101
|
+
};
|
|
102
|
+
const classes = getRHFTextFieldClassesByState(ownerState);
|
|
103
|
+
const isSkeleton = useModuleSkeleton();
|
|
104
|
+
const {
|
|
105
|
+
control
|
|
106
|
+
} = useFormContext();
|
|
107
|
+
return /* @__PURE__ */ jsx(RHFTextFieldRoot, {
|
|
108
|
+
className: classes.root,
|
|
109
|
+
role: "textbox",
|
|
110
|
+
"data-testid": "RHFTextFieldRoot",
|
|
111
|
+
children: !isSkeleton ? /* @__PURE__ */ jsx(Controller, {
|
|
112
|
+
name: nameRHF,
|
|
113
|
+
control,
|
|
114
|
+
render: ({
|
|
115
|
+
field: {
|
|
116
|
+
onChange,
|
|
117
|
+
onBlur,
|
|
118
|
+
value,
|
|
119
|
+
name,
|
|
120
|
+
ref
|
|
121
|
+
},
|
|
122
|
+
fieldState: {
|
|
123
|
+
error
|
|
124
|
+
}
|
|
125
|
+
}) => {
|
|
126
|
+
const onInternalChange = (event) => {
|
|
127
|
+
if (type === "number") {
|
|
128
|
+
if (event.target.value) {
|
|
129
|
+
onChange(Number(event.target.value));
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
onChange(event);
|
|
134
|
+
};
|
|
135
|
+
return /* @__PURE__ */ jsx(TextField, {
|
|
136
|
+
inputRef,
|
|
137
|
+
autoComplete,
|
|
138
|
+
onChange: onInternalChange,
|
|
139
|
+
onBlur,
|
|
140
|
+
value: value || "",
|
|
141
|
+
name,
|
|
142
|
+
ref,
|
|
143
|
+
fullWidth: true,
|
|
144
|
+
error: !!error,
|
|
145
|
+
helperText: error?.message,
|
|
146
|
+
type,
|
|
147
|
+
...other
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
}) : /* @__PURE__ */ jsx(SkeletonTextField, {
|
|
151
|
+
"data-testid": "SkeletonTextField",
|
|
152
|
+
classes,
|
|
153
|
+
skeletonWidth,
|
|
154
|
+
skeletonHeight,
|
|
155
|
+
ownerState
|
|
156
|
+
})
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
RHFTextField.displayName = "RHFTextField";
|
|
160
|
+
const RHFTextFieldPasswordRoot = styled$1("div")(({
|
|
161
|
+
theme
|
|
162
|
+
}) => ({
|
|
163
|
+
...theme.components?.M4LRHFTextFieldPassword?.styleOverrides
|
|
164
|
+
}));
|
|
165
|
+
generateUtilityClasses("M4LRHFTextFieldPassword", [
|
|
166
|
+
"root"
|
|
167
|
+
]);
|
|
168
|
+
function getRHFTextFieldPasswordUtilityClass(slot) {
|
|
169
|
+
return generateUtilityClass("M4LRHFTextFieldPassword", slot);
|
|
170
|
+
}
|
|
171
|
+
const useUtilityClasses = () => {
|
|
172
|
+
const slots = {
|
|
173
|
+
root: ["root"]
|
|
174
|
+
};
|
|
175
|
+
const composedClasses = unstable_composeClasses(slots, getRHFTextFieldPasswordUtilityClass, {});
|
|
176
|
+
return {
|
|
177
|
+
...composedClasses
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
const RHFTextFieldPassword = (props) => {
|
|
181
|
+
const {
|
|
182
|
+
name,
|
|
183
|
+
label,
|
|
184
|
+
skeletonWidth,
|
|
185
|
+
skeletonHeight
|
|
186
|
+
} = props;
|
|
187
|
+
const [showPassword, setShowPassword] = useState(false);
|
|
188
|
+
const {
|
|
189
|
+
host_static_assets,
|
|
190
|
+
environment_assets
|
|
191
|
+
} = useEnvironment();
|
|
192
|
+
console.log("enviroment", host_static_assets, environment_assets);
|
|
193
|
+
const classes = useUtilityClasses();
|
|
194
|
+
return /* @__PURE__ */ jsx(RHFTextFieldPasswordRoot, {
|
|
195
|
+
className: classes.root,
|
|
196
|
+
"data-testid": "RHFTextFieldPasswordRoot",
|
|
197
|
+
children: /* @__PURE__ */ jsx(RHFTextField, {
|
|
198
|
+
name,
|
|
199
|
+
label,
|
|
200
|
+
type: showPassword ? "text" : "password",
|
|
201
|
+
autoComplete: "on",
|
|
202
|
+
skeletonWidth,
|
|
203
|
+
skeletonHeight,
|
|
204
|
+
InputProps: {
|
|
205
|
+
endAdornment: /* @__PURE__ */ jsx(InputAdornment, {
|
|
206
|
+
position: "end",
|
|
207
|
+
children: /* @__PURE__ */ jsx(IconButton, {
|
|
208
|
+
onClick: () => setShowPassword(!showPassword),
|
|
209
|
+
src: showPassword ? `${host_static_assets}/${environment_assets}/frontend/domain/host/login/assets/icons/eye.svg` : `${host_static_assets}/${environment_assets}/frontend/domain/host/login/assets/icons/eye_off.svg`
|
|
210
|
+
})
|
|
211
|
+
})
|
|
212
|
+
}
|
|
213
|
+
})
|
|
214
|
+
});
|
|
215
|
+
};
|
|
216
|
+
export {
|
|
217
|
+
RHFTextField as R,
|
|
218
|
+
RHFTextFieldPassword as a
|
|
219
|
+
};
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare const RHFTextField: import("react").ForwardRefExoticComponent<(Omit<RHFTextFieldProps & import("@mui/material").StandardTextFieldProps, "ref"> | Omit<RHFTextFieldProps & import("@mui/material").FilledTextFieldProps, "ref"> | Omit<RHFTextFieldProps & import("@mui/material").OutlinedTextFieldProps, "ref">) & import("react").RefAttributes<HTMLInputElement>>;
|
|
1
|
+
export * from './RHFTextField';
|
|
2
|
+
export * from './types';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const RHFTextFieldRoot: 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 SKTRHFWrapperTextField: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
+
import { RHFTextFieldState } from '../../classes/types';
|
|
1
2
|
import { RHFTextFieldProps } from '../../types';
|
|
2
|
-
export
|
|
3
|
+
export interface SkeletonTextFieldProps extends Pick<RHFTextFieldProps, 'skeletonWidth' | 'skeletonHeight'> {
|
|
4
|
+
ownerState: RHFTextFieldState;
|
|
5
|
+
classes: any;
|
|
6
|
+
}
|
|
7
|
+
export declare type WrapperSkeletonRHFTextField = RHFTextFieldState;
|