@m4l/components 9.3.19-BE093025-beta.1 → 9.3.19-BE101025-beta.1
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 +8 -0
- package/components/Card/constants.d.ts +1 -1
- package/components/Chip/constants.d.ts +1 -1
- package/components/ContainerFlow/constants.d.ts +1 -1
- package/components/DataGrid/subcomponents/editors/EditLabelEditor/formatter.d.ts +8 -0
- package/components/DataGrid/subcomponents/editors/EditLabelEditor/index.d.ts +3 -0
- package/components/DataGrid/subcomponents/editors/EditLabelEditor/types.d.ts +5 -0
- package/components/DataGrid/subcomponents/editors/EditLabelEditor/useColumnEditLabel.d.ts +9 -0
- package/components/DataGrid/tests/helpers/types.d.ts +2 -0
- package/components/EditLabel/EditLabel.d.ts +7 -0
- package/components/EditLabel/EditLabel.styles.d.ts +2 -0
- package/components/EditLabel/constants.d.ts +2 -0
- package/components/EditLabel/hooks/useEditLabel.d.ts +23 -0
- package/components/EditLabel/icons.d.ts +5 -0
- package/components/EditLabel/index.d.ts +2 -0
- package/components/EditLabel/slots/EditLabelEnum.d.ts +8 -0
- package/components/EditLabel/slots/EditLabelSlots.d.ts +18 -0
- package/components/EditLabel/test/EditLabel.test.d.ts +1 -0
- package/components/EditLabel/types.d.ts +43 -0
- package/components/FormContainer/constants.d.ts +1 -1
- package/components/Image/constant.d.ts +1 -1
- package/components/ImageText/ImageText.styles.js +1 -1
- package/components/ImageText/constants.d.ts +1 -1
- package/components/MFIsolationApp/MFIsolationApp.js +13 -5
- package/components/MFIsolationApp/icons.d.ts +3 -0
- package/components/MFIsolationApp/icons.js +6 -0
- package/components/MFIsolationApp/subcomponents/AppBarSettings/AppBarSettings.d.ts +4 -0
- package/components/MFIsolationApp/subcomponents/AppBarSettings/AppBarSettings.js +21 -0
- package/components/MFIsolationApp/subcomponents/AppBarSettings/index.d.ts +1 -0
- package/components/MFIsolationApp/subcomponents/AppBarSettings/index.js +1 -0
- package/components/MFIsolationApp/types.d.ts +1 -0
- package/components/MFIsolationAppStorybook/MFIsolationAppStorybook.d.ts +5 -0
- package/components/MFIsolationAppStorybook/MFIsolationAppStorybook.js +154 -0
- package/components/MFIsolationAppStorybook/constants.d.ts +1 -0
- package/components/MFIsolationAppStorybook/icons.d.ts +3 -0
- package/components/MFIsolationAppStorybook/icons.js +6 -0
- package/components/MFIsolationAppStorybook/index.d.ts +1 -0
- package/components/MFIsolationAppStorybook/index.js +1 -0
- package/components/MFIsolationAppStorybook/subcomponents/AppBarSettings/AppBarSettings.d.ts +4 -0
- package/components/MFIsolationAppStorybook/subcomponents/AppBarSettings/AppBarSettings.js +21 -0
- package/components/MFIsolationAppStorybook/subcomponents/AppBarSettings/index.d.ts +1 -0
- package/components/MFIsolationAppStorybook/subcomponents/AppBarSettings/index.js +1 -0
- package/components/MFIsolationAppStorybook/subcomponents/MFAuthAppStorybook/MFAuthAppStorybook.d.ts +5 -0
- package/components/MFIsolationAppStorybook/subcomponents/MFAuthAppStorybook/MFAuthAppStorybook.js +44 -0
- package/components/MFIsolationAppStorybook/subcomponents/MFAuthAppStorybook/index.d.ts +1 -0
- package/components/MFIsolationAppStorybook/subcomponents/MFAuthAppStorybook/index.js +1 -0
- package/components/MFIsolationAppStorybook/subcomponents/MFAuthAppStorybook/types.d.ts +4 -0
- package/components/MFIsolationAppStorybook/types.d.ts +31 -0
- package/components/MenuActions/constants.d.ts +1 -1
- package/components/ModalDialog/ModalDialog.js +1 -0
- package/components/NoItemSelected/constant.d.ts +1 -1
- package/components/Stepper/Stepper.styles.js +17 -14
- package/components/Stepper/helpers/getInitialFieldValues/index.d.ts +12 -0
- package/components/Stepper/helpers/getInitialFieldValues/index.js +14 -0
- package/components/Stepper/helpers/index.d.ts +2 -0
- package/components/Stepper/helpers/parseWatchedValues/index.d.ts +17 -0
- package/components/Stepper/helpers/parseWatchedValues/index.js +12 -0
- package/components/Stepper/hooks/useDynamicValidation/index.d.ts +11 -0
- package/components/Stepper/hooks/useDynamicValidation/index.js +69 -0
- package/components/Stepper/hooks/useStepperActions/index.js +19 -3
- package/components/Stepper/store/StepperStore/index.js +20 -1
- package/components/Stepper/subcomponents/StepArea/index.js +45 -25
- package/components/Stepper/subcomponents/StepArea/subcomponents/Inidicator/index.js +18 -10
- package/components/Stepper/subcomponents/StepperButtons/StepperCancelButton/index.d.ts +2 -1
- package/components/Stepper/subcomponents/StepperButtons/StepperCancelButton/index.js +38 -5
- package/components/Stepper/subcomponents/StepperButtons/StepperNextButton/index.d.ts +2 -1
- package/components/Stepper/subcomponents/StepperButtons/StepperNextButton/index.js +5 -3
- package/components/Stepper/subcomponents/StepperButtons/StepperPrevButton/index.d.ts +2 -1
- package/components/Stepper/subcomponents/StepperButtons/StepperPrevButton/index.js +5 -3
- package/components/Stepper/subcomponents/StepperButtons/StepperSubmitButton/index.d.ts +2 -1
- package/components/Stepper/subcomponents/StepperButtons/StepperSubmitButton/index.js +5 -3
- package/components/Stepper/subcomponents/StepperContent/subcomponents/Step/index.js +30 -11
- package/components/Stepper/subcomponents/StepperFooter/subcomponents/StepperFooterRightActions/index.js +20 -10
- package/components/Stepper/types.d.ts +7 -0
- package/components/WindowBase/constants.d.ts +1 -1
- package/components/extended/React-Json-Viewer/constants.d.ts +1 -1
- package/components/extended/React-resizable-panels/SplitLayout.js +1 -1
- package/components/formatters/ChipStatusFormatter/constants.d.ts +1 -1
- package/components/formatters/EditLabelFormatter/EditLabelFormatter.d.ts +5 -0
- package/components/formatters/EditLabelFormatter/EditLabelFormatter.styles.d.ts +2 -0
- package/components/formatters/EditLabelFormatter/constants.d.ts +5 -0
- package/components/formatters/EditLabelFormatter/index.d.ts +2 -0
- package/components/formatters/EditLabelFormatter/slots/EditLabelFormatterEnum.d.ts +4 -0
- package/components/formatters/EditLabelFormatter/slots/EditLabelFormatterSlots.d.ts +5 -0
- package/components/formatters/EditLabelFormatter/test/EditLabelFormatter.test.d.ts +1 -0
- package/components/formatters/EditLabelFormatter/types.d.ts +23 -0
- package/components/hook-form/RHFAutocomplete/RHFAutocomplete.js +8 -2
- package/components/hook-form/RHFAutocomplete/types.d.ts +13 -0
- package/components/hook-form/RHFAutocompleteAsync/RHFAutocompleteAsync.js +8 -2
- package/components/hook-form/RHFCheckbox/constants.d.ts +1 -1
- package/components/hook-form/RHFSelect/constants.d.ts +1 -1
- package/components/hook-form/RHFUpload/RHFUploadSingleFile/constants.d.ts +25 -1
- package/components/hook-form/RHFUpload/RHFUploadSingleFile/constants.js +5 -1
- package/components/hook-form/RHFormContext/index.d.ts +110 -10
- package/components/hook-form/RHFormContext/index.js +35 -8
- package/components/hook-form/RHFormContext/types.d.ts +64 -1
- package/components/index.d.ts +1 -0
- package/components/mui_extended/Autocomplete/Autocomplete.js +6 -2
- package/components/mui_extended/Autocomplete/hooks/useStartAdornments.d.ts +3 -1
- package/components/mui_extended/Autocomplete/hooks/useStartAdornments.js +9 -3
- package/components/mui_extended/Autocomplete/types.d.ts +8 -0
- package/components/mui_extended/Button/Button.js +15 -4
- package/components/mui_extended/Button/ButtonStyles.js +155 -82
- package/components/mui_extended/Button/{constans.d.ts → constants.d.ts} +1 -0
- package/components/mui_extended/Button/constants.js +8 -0
- package/components/mui_extended/Button/slots/ButtonSlots.js +1 -1
- package/components/mui_extended/Button/types.d.ts +1 -1
- package/components/mui_extended/IconButton/constants.d.ts +1 -1
- package/components/mui_extended/IconButton/constants.js +4 -1
- package/components/mui_extended/MenuItem/MenuItem.js +1 -1
- package/components/mui_extended/MenuItem/constants.d.ts +1 -1
- package/components/mui_extended/NavLink/constants.d.ts +1 -1
- package/components/mui_extended/Select/Select.js +2 -2
- package/components/mui_extended/Select/constants.d.ts +1 -1
- package/components/mui_extended/TextField/constants.d.ts +1 -1
- package/components/mui_extended/Tooltip/Tooltip.styles.js +8 -1
- package/components/mui_extended/Tooltip/constants.d.ts +1 -1
- package/components/mui_extended/Typography/constants.d.ts +1 -1
- package/components/mui_extended/Typography/types.d.ts +1 -1
- package/contexts/AppearanceComponentContext/AppearanceComponentContext.js +6 -1
- package/index.js +12 -10
- package/package.json +1 -1
- package/utils/getComponentSlotRoot.d.ts +3 -1
- package/components/mui_extended/Button/constans.js +0 -4
package/@types/types.d.ts
CHANGED
|
@@ -293,6 +293,7 @@ import {
|
|
|
293
293
|
ImageTextSlotsType,
|
|
294
294
|
} from '../components/ImageText/types';
|
|
295
295
|
import { FormContainerOwnerState, FormContainerSlotsType } from '../components/FormContainer/types';
|
|
296
|
+
import { EditLabelOwnerState, EditLabelSlotsType } from '../components/EditLabel/types';
|
|
296
297
|
|
|
297
298
|
declare module '@mui/material/styles' {
|
|
298
299
|
// Define the slots in the theme
|
|
@@ -381,6 +382,7 @@ declare module '@mui/material/styles' {
|
|
|
381
382
|
M4LStepper: StepperSlotsType;
|
|
382
383
|
M4LImageText: ImageTextSlotsType;
|
|
383
384
|
M4LFormContainer: FormContainerSlotsType;
|
|
385
|
+
M4LEditLabel: EditLabelSlotsType;
|
|
384
386
|
}
|
|
385
387
|
interface ComponentsPropsList {
|
|
386
388
|
// Extend ComponentsProps or ComponentsOwnerState(this extend ComponentProps)
|
|
@@ -468,6 +470,7 @@ declare module '@mui/material/styles' {
|
|
|
468
470
|
M4LStepper: Partial<StepperOwnerState>;
|
|
469
471
|
M4LImageText: Partial<ImageTextOwnerState>;
|
|
470
472
|
M4LFormContainer: Partial<FormContainerOwnerState>;
|
|
473
|
+
M4LEditLabel: Partial<EditLabelOwnerState>;
|
|
471
474
|
}
|
|
472
475
|
interface Components {
|
|
473
476
|
M4LDynamicFilter?: {
|
|
@@ -900,5 +903,10 @@ declare module '@mui/material/styles' {
|
|
|
900
903
|
styleOverrides?: ComponentsOverrides<Theme>['M4LFormContainer'];
|
|
901
904
|
variants?: ComponentsVariants['M4LFormContainer'];
|
|
902
905
|
};
|
|
906
|
+
M4LEditLabel?: {
|
|
907
|
+
defaultProps?: ComponentsPropsList['M4LEditLabel'];
|
|
908
|
+
styleOverrides?: ComponentsOverrides<Theme>['M4LEditLabel'];
|
|
909
|
+
variants?: ComponentsVariants['M4LEditLabel'];
|
|
910
|
+
};
|
|
903
911
|
}
|
|
904
912
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const CARD_KEY = "M4LCard";
|
|
2
|
-
export declare const CARD_CLASSES: Record<
|
|
2
|
+
export declare const CARD_CLASSES: Record<"text" | "selected" | "outlined" | "root", string>;
|
|
3
3
|
export declare const CARD_SIZES: {
|
|
4
4
|
compact: number;
|
|
5
5
|
standard: number;
|
|
@@ -18,4 +18,4 @@ export declare const COMBINED_CHIP_ENUMS: {
|
|
|
18
18
|
/**
|
|
19
19
|
* Inventario de clases CSS para el componente Chip
|
|
20
20
|
*/
|
|
21
|
-
export declare const CHIP_CLASSES: Record<
|
|
21
|
+
export declare const CHIP_CLASSES: Record<"root" | "iconButton" | "closeIcon" | "skeletonChip" | "chipIcon" | "textChip", string>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const CONTAINER_FLOW_KEY_COMPONENT = "M4LContainerFlow";
|
|
2
|
-
export declare const CONTAINER_FLOW_CLASSES: Record<
|
|
2
|
+
export declare const CONTAINER_FLOW_CLASSES: Record<"root" | "wrapperItem", string>;
|
|
3
3
|
export declare const CONTAINER_FLOW_GAP_VALUES: {
|
|
4
4
|
compact: number;
|
|
5
5
|
standard: number;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ColumnEditLabelFormatterProps } from './types';
|
|
2
|
+
import { RenderCellProps } from 'react-data-grid';
|
|
3
|
+
/**
|
|
4
|
+
* Formatter para mostrar un etiqueta en una columna de un DataGrid
|
|
5
|
+
* @param props - Propiedades del formatter
|
|
6
|
+
* @returns Componente EditLabelFormatter
|
|
7
|
+
*/
|
|
8
|
+
export declare const ColumnEditLabelFormatter: <TRow>(props: ColumnEditLabelFormatterProps<TRow>) => (renderProps: RenderCellProps<TRow>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { EditLabelFormatterProps } from '../../../../formatters/EditLabelFormatter';
|
|
2
|
+
import { DeepKeyOf } from '../../../../../utils/types';
|
|
3
|
+
export interface ColumnEditLabelFormatterProps<TRow> extends Pick<EditLabelFormatterProps, 'fieldWidth'> {
|
|
4
|
+
fieldLabel: DeepKeyOf<TRow>;
|
|
5
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ColumnEditLabelFormatterProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Funcion helper que retorna el formatter, filter y customSort de la columna concatenada.
|
|
4
|
+
*/
|
|
5
|
+
export declare const useColumnEditLabel: <TRow>(props: ColumnEditLabelFormatterProps<TRow>) => {
|
|
6
|
+
formatter: (renderProps: import('react-data-grid').RenderCellProps<TRow, unknown>) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
customFilter: (row: TRow, value: string | number) => boolean;
|
|
8
|
+
customSort: (a: TRow, b: TRow) => 0 | 1 | -1;
|
|
9
|
+
};
|
|
@@ -17,6 +17,7 @@ export interface SeedProps {
|
|
|
17
17
|
withSetCheck?: boolean;
|
|
18
18
|
withCesar?: boolean;
|
|
19
19
|
withChipStatus?: boolean;
|
|
20
|
+
withEditLabel?: boolean;
|
|
20
21
|
withActions?: boolean;
|
|
21
22
|
withActionsUser?: boolean;
|
|
22
23
|
withBooleanStatus?: boolean;
|
|
@@ -30,6 +31,7 @@ export type ColumnType = 'string' | 'number' | 'boolean' | 'date' | 'custom';
|
|
|
30
31
|
export interface RowType {
|
|
31
32
|
id: string;
|
|
32
33
|
name: string;
|
|
34
|
+
editLabel: string;
|
|
33
35
|
filterableOnlyOne: string;
|
|
34
36
|
email: string;
|
|
35
37
|
phone: string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { EditLabelProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Componente de texto editable con funcionalidades avanzadas.
|
|
4
|
+
* @param props - Las propiedades del componente
|
|
5
|
+
* @returns El componente EditLabel renderizado
|
|
6
|
+
*/
|
|
7
|
+
export declare const EditLabel: (props: EditLabelProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface UseEditLabelProps {
|
|
2
|
+
label: string;
|
|
3
|
+
onChange: (value: string) => void;
|
|
4
|
+
}
|
|
5
|
+
export interface UseEditLabelReturn {
|
|
6
|
+
inEdition: boolean;
|
|
7
|
+
value: string;
|
|
8
|
+
buttonSubmitRef: React.RefObject<HTMLButtonElement>;
|
|
9
|
+
buttonCancelRef: React.RefObject<HTMLButtonElement>;
|
|
10
|
+
handleChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
11
|
+
handleSubmit: (event: React.KeyboardEvent<HTMLInputElement> | React.MouseEvent<HTMLButtonElement>) => void;
|
|
12
|
+
handleCancel: (event: React.KeyboardEvent<HTMLInputElement> | React.FocusEvent<HTMLInputElement> | React.MouseEvent<HTMLButtonElement>) => void;
|
|
13
|
+
handleBlur: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
14
|
+
handleEditStart: () => void;
|
|
15
|
+
handleInputClick: () => void;
|
|
16
|
+
handleKeyDown: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Custom hook que maneja la lógica de estado y handlers para el componente EditLabel.
|
|
20
|
+
* @param props - Las propiedades del hook
|
|
21
|
+
* @returns El estado y handlers del EditLabel
|
|
22
|
+
*/
|
|
23
|
+
export declare const useEditLabel: ({ label, onChange, }: UseEditLabelProps) => UseEditLabelReturn;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const EditLabelRootStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
2
|
+
ownerState?: (Partial<import('..').EditLabelOwnerState> & Record<string, unknown>) | undefined;
|
|
3
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
4
|
+
export declare const TextFieldStyled: import('@emotion/styled').StyledComponent<Pick<Omit<import('../../mui_extended/TextField/types').TextFieldProps, "ref"> & import('react').RefAttributes<HTMLDivElement>, "value" | "size" | "children" | "title" | "component" | "name" | "error" | "select" | "rows" | "id" | "type" | "disabled" | "hidden" | "content" | "style" | "variant" | "margin" | "translate" | "className" | "classes" | "sx" | "label" | "slot" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "dataTestId" | "autoComplete" | "maxLength" | "placeholder" | "required" | keyof import('react').RefAttributes<HTMLDivElement> | "maxRows" | "fullWidth" | "inputProps" | "inputRef" | "multiline" | "minRows" | "hiddenLabel" | "focused" | "InputProps" | "FormHelperTextProps" | "helperText" | "InputLabelProps" | "SelectProps"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
5
|
+
ownerState?: (Partial<import('..').EditLabelOwnerState> & Record<string, unknown>) | undefined;
|
|
6
|
+
}, {}, {}>;
|
|
7
|
+
export declare const LabelStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
8
|
+
ownerState?: (Partial<import('..').EditLabelOwnerState> & Record<string, unknown>) | undefined;
|
|
9
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, keyof import('react').ClassAttributes<HTMLSpanElement> | keyof import('react').HTMLAttributes<HTMLSpanElement>>, {}>;
|
|
10
|
+
export declare const IconStyled: import('@emotion/styled').StyledComponent<Pick<import('../../Icon').IconProps, keyof import('../../Icon').IconProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
11
|
+
ownerState?: (Partial<import('..').EditLabelOwnerState> & Record<string, unknown>) | undefined;
|
|
12
|
+
}, {}, {}>;
|
|
13
|
+
export declare const ContainerActionsStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
14
|
+
ownerState?: (Partial<import('..').EditLabelOwnerState> & Record<string, unknown>) | undefined;
|
|
15
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
16
|
+
export declare const IconButtonStyled: import('@emotion/styled').StyledComponent<Pick<Omit<import('../../mui_extended/IconButton/types').IconButtonProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>, "value" | "size" | "children" | "title" | "component" | "name" | "id" | "type" | "selected" | "disabled" | "action" | "hidden" | "color" | "content" | "style" | "icon" | "tooltip" | "variant" | "translate" | "className" | "classes" | "src" | "sx" | "form" | "slot" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "instaceDataTestId" | "placement" | "rotationAngle" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "edge" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "badgeProps" | keyof import('react').RefAttributes<HTMLButtonElement>> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
17
|
+
ownerState?: (Partial<import('..').EditLabelOwnerState> & Record<string, unknown>) | undefined;
|
|
18
|
+
}, {}, {}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Sizes } from '@m4l/styles';
|
|
2
|
+
import { EditLabelSlots } from './slots/EditLabelEnum';
|
|
3
|
+
import { EDIT_LABEL_KEY_COMPONENT } from './constants';
|
|
4
|
+
import { Theme } from '@mui/material/styles';
|
|
5
|
+
import { M4LOverridesStyleRules } from '../../@types/augmentations';
|
|
6
|
+
export interface EditLabelProps {
|
|
7
|
+
/**
|
|
8
|
+
* The label to display
|
|
9
|
+
*/
|
|
10
|
+
label: string;
|
|
11
|
+
/**
|
|
12
|
+
* The function to call when the label is changed
|
|
13
|
+
*/
|
|
14
|
+
onChange: (value: string) => void;
|
|
15
|
+
/**
|
|
16
|
+
* The size of the label
|
|
17
|
+
*/
|
|
18
|
+
size?: Extract<Sizes, 'small' | 'medium'>;
|
|
19
|
+
/**
|
|
20
|
+
* Custom class name
|
|
21
|
+
*/
|
|
22
|
+
className?: string;
|
|
23
|
+
/**
|
|
24
|
+
* The width of the input
|
|
25
|
+
*/
|
|
26
|
+
fieldWidth?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface EditLabelOwnerState {
|
|
29
|
+
/**
|
|
30
|
+
* The size of the label
|
|
31
|
+
*/
|
|
32
|
+
size?: Extract<Sizes, 'small' | 'medium'>;
|
|
33
|
+
/**
|
|
34
|
+
* The state of the edition
|
|
35
|
+
*/
|
|
36
|
+
inEdition?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* The width of the input
|
|
39
|
+
*/
|
|
40
|
+
fieldWidth?: string;
|
|
41
|
+
}
|
|
42
|
+
export type EditLabelSlotsType = keyof typeof EditLabelSlots;
|
|
43
|
+
export type EditLabelStyles = M4LOverridesStyleRules<EditLabelSlotsType, typeof EDIT_LABEL_KEY_COMPONENT, Theme>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const FORM_CONTAINER_COMPONENT_KEY = "M4LFormContainer";
|
|
2
|
-
export declare const FORM_CONTAINER_CLASSES: Record<
|
|
2
|
+
export declare const FORM_CONTAINER_CLASSES: Record<"root" | "formContainer" | "buttonGroup", string>;
|
|
@@ -3,4 +3,4 @@ export declare const svgDataUriSkeleton = "data:image/svg+xml,%3Csvg width='36'
|
|
|
3
3
|
/**
|
|
4
4
|
* Clases de los slots del componente Image
|
|
5
5
|
*/
|
|
6
|
-
export declare const IMAGE_CLASSES: Record<
|
|
6
|
+
export declare const IMAGE_CLASSES: Record<"root" | "intersectComponent" | "scrollIntersectRoot" | "skeletonComponent" | "divContainerSkeleton" | "imgSkeleton", string>;
|
|
@@ -14,7 +14,7 @@ const imageTextContainerStyles = {
|
|
|
14
14
|
padding: "10px",
|
|
15
15
|
gap: theme.vars.size.baseSpacings.sp2,
|
|
16
16
|
minHeight: "60px",
|
|
17
|
-
backgroundColor: theme.palette.background.default
|
|
17
|
+
backgroundColor: theme.vars.palette.background.default
|
|
18
18
|
}),
|
|
19
19
|
/**
|
|
20
20
|
* Estilos para el contenedor de la imagen.
|
|
@@ -5,7 +5,7 @@ export declare const IMAGE_TEXT_KEY_COMPONENT = "M4LImageText";
|
|
|
5
5
|
/**
|
|
6
6
|
* Clases del componente ImageTextContainer.
|
|
7
7
|
*/
|
|
8
|
-
export declare const IMAGE_TEXT_CLASSES: Record<
|
|
8
|
+
export declare const IMAGE_TEXT_CLASSES: Record<"title" | "message" | "root" | "img" | "imageContainer" | "wrapperTitleMessage", string>;
|
|
9
9
|
/**
|
|
10
10
|
* URL de la imagen por defecto.
|
|
11
11
|
*/
|
|
@@ -4,15 +4,18 @@ import { unstable_HistoryRouter } from "react-router-dom";
|
|
|
4
4
|
import { createBrowserHistory } from "history";
|
|
5
5
|
import EventEmitter from "eventemitter3";
|
|
6
6
|
import NProgress from "nprogress";
|
|
7
|
-
import { DeviceTypeProvider, LocalesProvider, getLocaleFromNetwork } from "@m4l/graphics";
|
|
7
|
+
import { DeviceTypeProvider, ThemeSettingsProvider, LocalesProvider, getLocaleFromNetwork } from "@m4l/graphics";
|
|
8
8
|
import { EnvironmentProvider, HostToolsProvider, NetworkProvider, axiosOperation, AuthProvider } from "@m4l/core";
|
|
9
9
|
import { A as AppearanceComponentProvider } from "../../contexts/AppearanceComponentContext/AppearanceComponentContext.js";
|
|
10
10
|
import { c as createToaster } from "../ToastContainer/helpers/toaster.js";
|
|
11
11
|
import { M as MFAuthApp } from "./subcomponents/MFAuthApp/MFAuthApp.js";
|
|
12
12
|
import { B as BaseModule } from "../BaseModule/BaseModule.js";
|
|
13
|
+
import { S as SettingsLayout } from "../SettingsLayout/SettingsLayout.js";
|
|
13
14
|
import { T as ToastContainer } from "../ToastContainer/ToastContainer.js";
|
|
14
15
|
import { P as PopupsProvider } from "../popups/components/PopupsProvider/contexts/PopupsContext/PopupsContext.js";
|
|
15
16
|
import { A as AreasProvider } from "../areas/contexts/AreasContext/index.js";
|
|
17
|
+
import { S as Stack } from "../mui_extended/Stack/Stack.js";
|
|
18
|
+
import { A as AppBarSettings } from "./subcomponents/AppBarSettings/AppBarSettings.js";
|
|
16
19
|
const history = createBrowserHistory({ window });
|
|
17
20
|
function MFIsolationApp(props) {
|
|
18
21
|
const {
|
|
@@ -39,7 +42,8 @@ function MFIsolationApp(props) {
|
|
|
39
42
|
moduleDictionaryLoaded,
|
|
40
43
|
forcedDeviceType,
|
|
41
44
|
areasStoreId,
|
|
42
|
-
areasStoreDevtoolsEnabled
|
|
45
|
+
areasStoreDevtoolsEnabled,
|
|
46
|
+
appBarSettings = false
|
|
43
47
|
} = props;
|
|
44
48
|
const eventEmitter = useMemo(() => new EventEmitter(), []);
|
|
45
49
|
const events_add_listener = useCallback(
|
|
@@ -103,7 +107,7 @@ function MFIsolationApp(props) {
|
|
|
103
107
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
104
108
|
[]
|
|
105
109
|
);
|
|
106
|
-
return /* @__PURE__ */ jsx(EnvironmentProvider, { ...environment, children: /* @__PURE__ */ jsx(HostToolsProvider, { ...hostTools, children: /* @__PURE__ */ jsx(NetworkProvider, { axiosOperation, children: /* @__PURE__ */ jsx(unstable_HistoryRouter, { history, children: /* @__PURE__ */ jsx(DeviceTypeProvider, { forcedDeviceType, children: /* @__PURE__ */ jsx(AuthProvider, { children: /* @__PURE__ */ jsx(MFAuthApp, { user, pwd, children: /* @__PURE__ */ jsx(LocalesProvider, { isMicroFrontEnd: false, getLocaleFromNetwork, children: /* @__PURE__ */ jsx(
|
|
110
|
+
return /* @__PURE__ */ jsx(EnvironmentProvider, { ...environment, children: /* @__PURE__ */ jsx(HostToolsProvider, { ...hostTools, children: /* @__PURE__ */ jsx(NetworkProvider, { axiosOperation, children: /* @__PURE__ */ jsx(unstable_HistoryRouter, { history, children: /* @__PURE__ */ jsx(DeviceTypeProvider, { forcedDeviceType, children: /* @__PURE__ */ jsx(AuthProvider, { children: /* @__PURE__ */ jsx(MFAuthApp, { user, pwd, children: /* @__PURE__ */ jsx(ThemeSettingsProvider, { children: /* @__PURE__ */ jsx(LocalesProvider, { isMicroFrontEnd: false, getLocaleFromNetwork, children: /* @__PURE__ */ jsx(
|
|
107
111
|
BaseModule,
|
|
108
112
|
{
|
|
109
113
|
moduleId,
|
|
@@ -113,6 +117,7 @@ function MFIsolationApp(props) {
|
|
|
113
117
|
moduleNameField,
|
|
114
118
|
moduleDictionaryLoaded,
|
|
115
119
|
children: /* @__PURE__ */ jsxs(AppearanceComponentProvider, { children: [
|
|
120
|
+
/* @__PURE__ */ jsx(SettingsLayout, {}),
|
|
116
121
|
/* @__PURE__ */ jsx(ToastContainer, { containerId: toastContainerId }),
|
|
117
122
|
" ",
|
|
118
123
|
/* @__PURE__ */ jsx(
|
|
@@ -132,14 +137,17 @@ function MFIsolationApp(props) {
|
|
|
132
137
|
onSelectLayout: (modId) => {
|
|
133
138
|
console.log("onSelectLayout", modId);
|
|
134
139
|
},
|
|
135
|
-
children
|
|
140
|
+
children: /* @__PURE__ */ jsxs(Stack, { width: "100%", height: "100%", flexDirection: "column", overflow: "hidden", position: "relative", children: [
|
|
141
|
+
appBarSettings && /* @__PURE__ */ jsx(AppBarSettings, {}),
|
|
142
|
+
/* @__PURE__ */ jsx(Stack, { width: "100%", flexGrow: 1, flexDirection: "column", overflow: "hidden", position: "relative", children })
|
|
143
|
+
] })
|
|
136
144
|
}
|
|
137
145
|
)
|
|
138
146
|
}
|
|
139
147
|
)
|
|
140
148
|
] })
|
|
141
149
|
}
|
|
142
|
-
) }) }) }) }) }) }) }) });
|
|
150
|
+
) }) }) }) }) }) }) }) }) });
|
|
143
151
|
}
|
|
144
152
|
export {
|
|
145
153
|
MFIsolationApp as M
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useThemeSettingsStore } from "@m4l/graphics";
|
|
3
|
+
import { P as PATH_ICONS } from "../../icons.js";
|
|
4
|
+
import { useEnvironment } from "@m4l/core";
|
|
5
|
+
import { S as Stack } from "../../../mui_extended/Stack/Stack.js";
|
|
6
|
+
import { L as LanguagePopover } from "../../../LanguagePopover/LanguagePopover.js";
|
|
7
|
+
import { I as IconButton } from "../../../mui_extended/IconButton/IconButton.js";
|
|
8
|
+
function AppBarSettings() {
|
|
9
|
+
const handleOpen = useThemeSettingsStore((state) => state.settingsActions.handleOpen);
|
|
10
|
+
const { host_static_assets, environment_assets } = useEnvironment();
|
|
11
|
+
return /* @__PURE__ */ jsxs(Stack, { width: "100%", height: "40px", justifyContent: "space-between", flexDirection: "row", overflow: "hidden", position: "relative", padding: [0, 2], children: [
|
|
12
|
+
/* @__PURE__ */ jsx(Stack, { width: "100%", height: "100%" }),
|
|
13
|
+
/* @__PURE__ */ jsxs(Stack, { flexDirection: "row", gap: 2, height: "100%", width: "auto", alignItems: "center", children: [
|
|
14
|
+
/* @__PURE__ */ jsx(LanguagePopover, {}),
|
|
15
|
+
/* @__PURE__ */ jsx(IconButton, { src: `${host_static_assets}/${environment_assets}/${PATH_ICONS.SETTINGS}`, onClick: handleOpen })
|
|
16
|
+
] })
|
|
17
|
+
] });
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
AppBarSettings as A
|
|
21
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AppBarSettings } from './AppBarSettings';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -13,6 +13,7 @@ export type MFIsolationAppProps = BaseModuleProps & {
|
|
|
13
13
|
onLoad: () => void;
|
|
14
14
|
activeAreasNetwork?: boolean;
|
|
15
15
|
activeCookiesFromNetwork?: boolean;
|
|
16
|
+
appBarSettings?: boolean;
|
|
16
17
|
/**
|
|
17
18
|
* Diccionario de componentes, se puede proporcionar ya el diccionario cargado, para evitar que se llame al endpoint nuevamente.
|
|
18
19
|
*/
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo, useCallback, useId } from "react";
|
|
3
|
+
import { unstable_HistoryRouter } from "react-router-dom";
|
|
4
|
+
import { createBrowserHistory } from "history";
|
|
5
|
+
import EventEmitter from "eventemitter3";
|
|
6
|
+
import NProgress from "nprogress";
|
|
7
|
+
import { DeviceTypeProvider, ThemeSettingsProvider, LocalesProvider } from "@m4l/graphics";
|
|
8
|
+
import { EnvironmentProvider, HostToolsProvider, NetworkProvider } from "@m4l/core";
|
|
9
|
+
import { A as AppearanceComponentProvider } from "../../contexts/AppearanceComponentContext/AppearanceComponentContext.js";
|
|
10
|
+
import enLocale from "date-fns/locale/en-US";
|
|
11
|
+
import { c as createToaster } from "../ToastContainer/helpers/toaster.js";
|
|
12
|
+
import { M as MFAuthAppStorybook } from "./subcomponents/MFAuthAppStorybook/MFAuthAppStorybook.js";
|
|
13
|
+
import { B as BaseModule } from "../BaseModule/BaseModule.js";
|
|
14
|
+
import { S as SettingsLayout } from "../SettingsLayout/SettingsLayout.js";
|
|
15
|
+
import { T as ToastContainer } from "../ToastContainer/ToastContainer.js";
|
|
16
|
+
import { A as AppBarSettings } from "./subcomponents/AppBarSettings/AppBarSettings.js";
|
|
17
|
+
import { P as PopupsProvider } from "../popups/components/PopupsProvider/contexts/PopupsContext/PopupsContext.js";
|
|
18
|
+
import { A as AreasProvider } from "../areas/contexts/AreasContext/index.js";
|
|
19
|
+
import { S as Stack } from "../mui_extended/Stack/Stack.js";
|
|
20
|
+
const LOCALE_HOST_EN = {
|
|
21
|
+
lang: "en",
|
|
22
|
+
script: void 0,
|
|
23
|
+
region: "US",
|
|
24
|
+
name: "English US",
|
|
25
|
+
urlIcon: "https://s3.amazonaws.com/static.made4labs/environments/d1/frontend/commons/assets/icons/langs/lang_en.svg",
|
|
26
|
+
module: enLocale,
|
|
27
|
+
localeString: "en-US"
|
|
28
|
+
};
|
|
29
|
+
const history = createBrowserHistory({ window });
|
|
30
|
+
function MFIsolationAppStorybook(props) {
|
|
31
|
+
const {
|
|
32
|
+
children,
|
|
33
|
+
database = "domain",
|
|
34
|
+
// 'domain
|
|
35
|
+
host_api_local,
|
|
36
|
+
host_api_icons = "https://s3.amazonaws.com/static.made4labs/environments/d1/frontend/components/gclick/my_device_status/assets/icons",
|
|
37
|
+
//'https://dev1.gclick.co/api/v1/main/na/icons',
|
|
38
|
+
host_api_remote,
|
|
39
|
+
host_static_assets,
|
|
40
|
+
environment_assets,
|
|
41
|
+
moduleId,
|
|
42
|
+
skeletonFlags,
|
|
43
|
+
moduleNameField,
|
|
44
|
+
privileges,
|
|
45
|
+
componentsDictionary,
|
|
46
|
+
onLoad,
|
|
47
|
+
// observedDivRef,
|
|
48
|
+
moduleDictionaryLoaded,
|
|
49
|
+
forcedDeviceType,
|
|
50
|
+
areasStoreId,
|
|
51
|
+
areasStoreDevtoolsEnabled,
|
|
52
|
+
appBarSettings = false
|
|
53
|
+
} = props;
|
|
54
|
+
const eventEmitter = useMemo(() => new EventEmitter(), []);
|
|
55
|
+
const events_add_listener = useCallback(
|
|
56
|
+
(eventName, handler) => {
|
|
57
|
+
eventEmitter.on(eventName, handler);
|
|
58
|
+
},
|
|
59
|
+
[eventEmitter]
|
|
60
|
+
);
|
|
61
|
+
const events_remove_listener = useCallback(
|
|
62
|
+
(eventName, handler) => {
|
|
63
|
+
if (handler === null) {
|
|
64
|
+
eventEmitter.removeListener(eventName);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
eventEmitter.removeListener(eventName, handler);
|
|
68
|
+
},
|
|
69
|
+
[eventEmitter]
|
|
70
|
+
);
|
|
71
|
+
const events_emit = useCallback(
|
|
72
|
+
(eventName, arg) => {
|
|
73
|
+
eventEmitter.emit(eventName, arg);
|
|
74
|
+
},
|
|
75
|
+
[eventEmitter]
|
|
76
|
+
);
|
|
77
|
+
const startProgress = () => {
|
|
78
|
+
NProgress.configure({
|
|
79
|
+
showSpinner: true
|
|
80
|
+
});
|
|
81
|
+
NProgress.start();
|
|
82
|
+
};
|
|
83
|
+
const stopProgress = () => {
|
|
84
|
+
NProgress.done();
|
|
85
|
+
};
|
|
86
|
+
const environment = useMemo(
|
|
87
|
+
() => ({
|
|
88
|
+
host: "",
|
|
89
|
+
isLocalhost: true,
|
|
90
|
+
domain_token: "lab1",
|
|
91
|
+
database,
|
|
92
|
+
host_api_local,
|
|
93
|
+
host_api_icons,
|
|
94
|
+
host_api_remote,
|
|
95
|
+
host_static_assets,
|
|
96
|
+
environment_assets
|
|
97
|
+
}),
|
|
98
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
99
|
+
[]
|
|
100
|
+
);
|
|
101
|
+
const toastContainerId = useId();
|
|
102
|
+
const toaster = createToaster(toastContainerId);
|
|
103
|
+
const hostTools = useMemo(
|
|
104
|
+
() => ({
|
|
105
|
+
history,
|
|
106
|
+
toast: toaster,
|
|
107
|
+
startProgress,
|
|
108
|
+
stopProgress,
|
|
109
|
+
events_add_listener,
|
|
110
|
+
events_remove_listener,
|
|
111
|
+
events_emit
|
|
112
|
+
}),
|
|
113
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
114
|
+
[]
|
|
115
|
+
);
|
|
116
|
+
const mockNetworkOperation = useCallback(async (_networkProps) => {
|
|
117
|
+
return Promise.resolve({
|
|
118
|
+
data: [],
|
|
119
|
+
status: 200,
|
|
120
|
+
statusText: "OK"
|
|
121
|
+
});
|
|
122
|
+
}, []);
|
|
123
|
+
return /* @__PURE__ */ jsx(EnvironmentProvider, { ...environment, children: /* @__PURE__ */ jsx(HostToolsProvider, { ...hostTools, children: /* @__PURE__ */ jsx(NetworkProvider, { axiosOperation: mockNetworkOperation, children: /* @__PURE__ */ jsx(unstable_HistoryRouter, { history, children: /* @__PURE__ */ jsx(DeviceTypeProvider, { forcedDeviceType, children: /* @__PURE__ */ jsx(MFAuthAppStorybook, { children: /* @__PURE__ */ jsx(ThemeSettingsProvider, { children: /* @__PURE__ */ jsx(LocalesProvider, { isMicroFrontEnd: true, localeHost: LOCALE_HOST_EN, children: /* @__PURE__ */ jsx(
|
|
124
|
+
BaseModule,
|
|
125
|
+
{
|
|
126
|
+
moduleId,
|
|
127
|
+
privileges,
|
|
128
|
+
skeletonFlags,
|
|
129
|
+
componentsDictionary,
|
|
130
|
+
moduleNameField,
|
|
131
|
+
moduleDictionaryLoaded,
|
|
132
|
+
children: /* @__PURE__ */ jsxs(AppearanceComponentProvider, { children: [
|
|
133
|
+
/* @__PURE__ */ jsx(SettingsLayout, {}),
|
|
134
|
+
/* @__PURE__ */ jsx(ToastContainer, { containerId: toastContainerId }),
|
|
135
|
+
" ",
|
|
136
|
+
/* @__PURE__ */ jsx(
|
|
137
|
+
PopupsProvider,
|
|
138
|
+
{
|
|
139
|
+
baseZindex: 1e3,
|
|
140
|
+
storeId: areasStoreId,
|
|
141
|
+
storeDevtoolsEnabled: areasStoreDevtoolsEnabled,
|
|
142
|
+
children: /* @__PURE__ */ jsx(AreasProvider, { loadAreasFromNetwork: false, loadCookiesFromNetwork: false, onLoad, children: /* @__PURE__ */ jsxs(Stack, { width: "100%", height: "100%", flexDirection: "column", overflow: "hidden", position: "relative", children: [
|
|
143
|
+
appBarSettings && /* @__PURE__ */ jsx(AppBarSettings, {}),
|
|
144
|
+
/* @__PURE__ */ jsx(Stack, { width: "100%", flexGrow: 1, flexDirection: "column", overflow: "hidden", position: "relative", children })
|
|
145
|
+
] }) })
|
|
146
|
+
}
|
|
147
|
+
)
|
|
148
|
+
] })
|
|
149
|
+
}
|
|
150
|
+
) }) }) }) }) }) }) }) });
|
|
151
|
+
}
|
|
152
|
+
export {
|
|
153
|
+
MFIsolationAppStorybook as M
|
|
154
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TOAST_CONTAINER_ID = "toast-host";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MFIsolationAppStorybook } from './MFIsolationAppStorybook';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|