@m4l/components 9.3.25 → 9.3.27-BE071125-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 +18 -5
- package/components/AccountPopover/slots/AccountPopoverSlots.d.ts +1 -1
- package/components/AccountPopover/subcomponents/MenuPopover/MenuPopover.js +1 -1
- package/components/AppBar/slots/AppBarSlots.d.ts +1 -1
- package/components/Card/constants.d.ts +1 -1
- package/components/Chip/constants.d.ts +1 -1
- package/components/Chip/slots/ChipSlots.d.ts +1 -1
- package/components/Color/slots/ColorSlots.d.ts +1 -1
- package/components/CommonActions/components/ActionFormCancel/ActionFormCancel.js +17 -8
- package/components/CommonActions/components/ActionFormCancel/types.d.ts +9 -0
- package/components/ContainerFlow/constants.d.ts +1 -1
- package/components/DataGrid/formatters/ColumnIconFormatter/index.d.ts +1 -0
- package/components/DataGrid/index.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/DataGrid/types.d.ts +2 -0
- package/components/DynamicFilter/slots/dynamicFilterSlots.d.ts +2 -2
- package/components/DynamicSort/slots/DynamicSortSlots.d.ts +2 -2
- 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/types.d.ts +17 -0
- package/components/EditLabel/hooks/useEditLabel.d.ts +7 -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/Icon/Icon.js +6 -3
- package/components/Icon/types.d.ts +4 -0
- 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/Label/Label.js +1 -1
- package/components/LanguagePopover/LanguagePopover.js +2 -0
- package/components/MFIsolationApp/MFIsolationApp.js +13 -8
- package/components/MFIsolationApp/MFIsolationApp.styles.d.ts +2 -0
- package/components/MFIsolationApp/MFIsolationApp.styles.js +22 -0
- package/components/MFIsolationApp/constants.d.ts +1 -0
- package/components/MFIsolationApp/constants.js +4 -0
- package/components/MFIsolationApp/icons.d.ts +3 -0
- package/components/MFIsolationApp/icons.js +6 -0
- package/components/MFIsolationApp/slots/MFIsolationAppEnum.d.ts +4 -0
- package/components/MFIsolationApp/slots/MFIsolationAppEnum.js +8 -0
- package/components/MFIsolationApp/slots/MFIsolationAppSlots.d.ts +2 -0
- package/components/MFIsolationApp/slots/MFIsolationAppSlots.js +17 -0
- package/components/MFIsolationApp/subcomponents/AppBarSettings/AppBarSettings.js +21 -0
- package/components/MFIsolationApp/subcomponents/AppBarSettings/index.js +1 -0
- package/components/MFIsolationApp/types.d.ts +8 -0
- package/components/MFIsolationAppStorybook/MFIsolationAppStorybook.js +137 -0
- package/components/MFIsolationAppStorybook/index.js +1 -0
- package/components/MFIsolationAppStorybook/subcomponents/MFAuthAppStorybook/MFAuthAppStorybook.js +44 -0
- package/components/MFIsolationAppStorybook/subcomponents/MFAuthAppStorybook/index.js +1 -0
- package/components/MFIsolationAppStorybook/types.d.ts +0 -4
- package/components/MenuActions/MenuActions.js +1 -1
- package/components/MenuActions/constants.d.ts +1 -1
- package/components/MenuActions/slots/MenuActionsSlots.d.ts +1 -1
- package/components/ModalDialog/ModalDialog.js +1 -0
- package/components/NoItemSelected/constant.d.ts +1 -1
- package/components/NumberInput/slots/NumberInputSlots.d.ts +2 -2
- package/components/ObjectLogs/slots/ObjectLogsSlots.d.ts +1 -1
- package/components/PaperForm/PaperForm.js +1 -1
- package/components/PaperForm/components/Header.js +9 -7
- package/components/PaperForm/styles.js +9 -4
- package/components/PaperForm/types.d.ts +3 -2
- package/components/SideBar/slots/SideBarSlots.d.ts +1 -1
- package/components/Stepper/Stepper.styles.js +2 -0
- package/components/Stepper/dictionary.js +0 -1
- package/components/Stepper/subcomponents/StepArea/hooks/useStepArea.d.ts +13 -0
- package/components/Stepper/subcomponents/StepArea/hooks/useStepArea.js +111 -0
- package/components/Stepper/subcomponents/StepArea/hooks/useVisibileSteps.d.ts +8 -0
- package/components/Stepper/subcomponents/StepArea/hooks/useVisibileSteps.js +79 -0
- package/components/Stepper/subcomponents/StepArea/index.js +7 -115
- package/components/Stepper/subcomponents/StepperButtons/StepperCancelButton/index.d.ts +2 -2
- package/components/Stepper/subcomponents/StepperButtons/StepperCancelButton/index.js +3 -53
- package/components/Stepper/subcomponents/StepperButtons/StepperNextButton/index.js +3 -2
- package/components/Stepper/subcomponents/StepperButtons/StepperPrevButton/index.js +3 -2
- package/components/Stepper/subcomponents/StepperButtons/StepperSubmitButton/index.js +24 -5
- package/components/Stepper/subcomponents/StepperContent/subcomponents/Step/hooks/useIsStepVisible.d.ts +8 -0
- package/components/Stepper/subcomponents/StepperContent/subcomponents/Step/hooks/useIsStepVisible.js +93 -0
- package/components/Stepper/subcomponents/StepperContent/subcomponents/Step/index.js +2 -51
- package/components/Stepper/types.d.ts +4 -0
- package/components/ToastContainer/ToastContainer.js +1 -0
- package/components/ToastContainer/constants.d.ts +1 -1
- package/components/ToastContainer/constants.js +1 -1
- package/components/ToastContainer/slots/toastContainerSlots.d.ts +2 -2
- package/components/WindowBase/constants.d.ts +1 -1
- package/components/WindowBase/contexts/WindowToolsMFContext/WindowToolsMFContext.js +47 -3
- package/components/WindowBase/contexts/WindowToolsMFContext/types.d.ts +1 -1
- package/components/WindowBase/subcomponents/Component/index.d.ts +12 -1
- package/components/WindowBase/subcomponents/Component/index.js +56 -2
- package/components/WindowBase/subcomponents/Component/types.d.ts +1 -0
- package/components/WindowBase/types.d.ts +1 -1
- package/components/areas/components/AreasAdmin/slots/AreasAdminSlots.d.ts +1 -1
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/Window.js +1 -0
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/useWindow.js +1 -1
- package/components/areas/contexts/AreasContext/store.js +5 -1
- package/components/areas/contexts/AreasContext/types.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/formatters/TagsFormatter/constants.d.ts +1 -1
- package/components/hook-form/RHFAutocomplete/RHFAutocomplete.d.ts +1 -1
- package/components/hook-form/RHFAutocomplete/RHFAutocomplete.js +7 -1
- package/components/hook-form/RHFAutocomplete/constants.d.ts +1 -1
- package/components/hook-form/RHFAutocomplete/types.d.ts +13 -0
- package/components/hook-form/RHFAutocompleteAsync/RHFAutocompleteAsync.js +7 -1
- package/components/hook-form/RHFAutocompleteAsync/slots/RHFAutocompleteSlotsAsync.d.ts +1 -1
- package/components/hook-form/RHFCheckbox/constants.d.ts +1 -1
- package/components/hook-form/RHFSelect/constants.d.ts +1 -1
- package/components/hook-form/RHFTextFieldPassword/slots/RHFTextFieldPasswordSlots.d.ts +1 -1
- package/components/hook-form/RHFUpload/RHFUploadImage/slots/RHFUploadImageSlots.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/RHFUpload/RHFUploadSingleFile/slots/RHFUploadSingleFileSlots.d.ts +1 -1
- package/components/hook-form/RHFormContext/index.d.ts +109 -9
- package/components/hook-form/RHFormContext/index.js +23 -21
- package/components/hook-form/RHFormContext/styles.js +2 -1
- package/components/hook-form/RHFormContext/types.d.ts +64 -1
- package/components/index.d.ts +1 -0
- package/components/mui_extended/Autocomplete/Autocomplete.d.ts +4 -8
- package/components/mui_extended/Autocomplete/Autocomplete.js +24 -112
- package/components/mui_extended/Autocomplete/Autocomplete.styles.js +41 -12
- package/components/mui_extended/Autocomplete/hooks/useAutocomplete/useAutocomplete.d.ts +26 -0
- package/components/mui_extended/Autocomplete/hooks/useAutocomplete/useAutocomplete.js +166 -0
- package/components/mui_extended/Autocomplete/hooks/useEndAdornments.js +2 -1
- package/components/mui_extended/Autocomplete/hooks/useMultipleChips.d.ts +17 -0
- package/components/mui_extended/Autocomplete/hooks/useMultipleChips.js +108 -0
- package/components/mui_extended/Autocomplete/hooks/useValuesAndHandlers.d.ts +0 -2
- package/components/mui_extended/Autocomplete/hooks/useValuesAndHandlers.js +11 -17
- package/components/mui_extended/Autocomplete/slots/AutocompleteEnum.d.ts +2 -1
- package/components/mui_extended/Autocomplete/slots/AutocompleteEnum.js +1 -0
- package/components/mui_extended/Autocomplete/slots/AutocompleteSlots.d.ts +4 -1
- package/components/mui_extended/Autocomplete/slots/AutocompleteSlots.js +5 -0
- package/components/mui_extended/Autocomplete/subcomponents/LoadingText/LoadingText.d.ts +2 -0
- package/components/mui_extended/Autocomplete/subcomponents/LoadingText/LoadingText.js +14 -0
- package/components/mui_extended/Autocomplete/subcomponents/LoadingText/index.d.ts +1 -0
- package/components/mui_extended/Autocomplete/subcomponents/LoadingText/index.js +1 -0
- package/components/mui_extended/Autocomplete/subcomponents/NoOptionsText/NoOptionsText.d.ts +2 -0
- package/components/mui_extended/Autocomplete/subcomponents/NoOptionsText/NoOptionsText.js +14 -0
- package/components/mui_extended/Autocomplete/subcomponents/NoOptionsText/index.d.ts +1 -0
- package/components/mui_extended/Autocomplete/subcomponents/NoOptionsText/index.js +1 -0
- package/components/mui_extended/Autocomplete/subcomponents/PopperComponent/PopperComponent.d.ts +8 -0
- package/components/mui_extended/Autocomplete/subcomponents/PopperComponent/PopperComponent.js +23 -0
- package/components/mui_extended/Autocomplete/subcomponents/PopperComponent/index.d.ts +2 -0
- package/components/mui_extended/Autocomplete/subcomponents/PopperComponent/index.js +1 -0
- package/components/mui_extended/Autocomplete/subcomponents/PopperComponent/types.d.ts +7 -0
- package/components/mui_extended/Autocomplete/subcomponents/PopperComponent/types.js +1 -0
- package/components/mui_extended/Autocomplete/subcomponents/RenderAdornment/RenderAdornment.d.ts +6 -0
- package/components/mui_extended/Autocomplete/subcomponents/RenderAdornment/RenderAdornment.js +45 -0
- package/components/mui_extended/Autocomplete/subcomponents/renderOptions/index.d.ts +9 -0
- package/components/mui_extended/Autocomplete/subcomponents/renderOptions/index.js +61 -0
- package/components/mui_extended/Autocomplete/subcomponents/renderOptions/types.d.ts +7 -0
- package/components/mui_extended/Autocomplete/types.d.ts +21 -1
- package/components/mui_extended/Button/Button.js +15 -4
- package/components/mui_extended/Button/ButtonStyles.js +165 -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/CheckBox/CheckBox.js +1 -0
- package/components/mui_extended/CircularProgress/types.d.ts +1 -1
- package/components/mui_extended/DateTimePicker/slots/DateTimePickerSlots.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/MenuItem.styles.js +4 -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 +71 -29
- package/components/mui_extended/Select/Select.styles.js +41 -6
- package/components/mui_extended/Select/constants.d.ts +1 -1
- package/components/mui_extended/Select/slots/SelectSlots.d.ts +1 -1
- package/components/mui_extended/Select/types.d.ts +6 -1
- package/components/mui_extended/TextField/constants.d.ts +1 -1
- package/components/mui_extended/TimePicker/slots/TimePickerSlots.d.ts +1 -1
- package/components/mui_extended/ToggleIconButton/slots/ToggleIconButtonSlots.d.ts +1 -1
- package/components/mui_extended/Tooltip/Tooltip.styles.js +16 -4
- 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 +2 -1
- package/components/mui_extended/Typography/typography.styles.js +4 -9
- package/components/popups/components/PopupsProvider/contexts/PopupsContext/store.js +5 -1
- package/components/popups/components/PopupsProvider/contexts/PopupsContext/types.d.ts +1 -1
- package/components/popups/components/PopupsProvider/hooks/usePopups.d.ts +2 -4
- package/components/popups/components/PopupsProvider/hooks/usePopups.js +19 -7
- package/components/popups/components/PopupsViewer/PopupsViewer.js +1 -1
- package/components/popups/components/PopupsViewer/PopupsViewer.styles.js +1 -1
- package/components/popups/components/PopupsViewer/subcomponents/Popup/Popup.js +32 -21
- package/contexts/AppearanceComponentContext/AppearanceComponentContext.js +9 -1
- package/index.js +74 -70
- package/package.json +1 -1
- package/utils/getComponentSlotRoot.d.ts +3 -1
- package/components/mui_extended/Autocomplete/hooks/useStartAdornments.d.ts +0 -21
- package/components/mui_extended/Autocomplete/hooks/useStartAdornments.js +0 -31
- package/components/mui_extended/Autocomplete/renderOptions/index.d.ts +0 -22
- package/components/mui_extended/Autocomplete/renderOptions/index.js +0 -24
- package/components/mui_extended/Button/constans.js +0 -4
- /package/components/{MFIsolationAppStorybook → MFIsolationApp}/subcomponents/AppBarSettings/AppBarSettings.d.ts +0 -0
- /package/components/{MFIsolationAppStorybook → MFIsolationApp}/subcomponents/AppBarSettings/index.d.ts +0 -0
|
@@ -9,8 +9,6 @@ function useValuesAndHandlers(props) {
|
|
|
9
9
|
onClose,
|
|
10
10
|
onChangeFilterParmsLocal,
|
|
11
11
|
multiple,
|
|
12
|
-
getOptionUrlImage,
|
|
13
|
-
// Diferencia
|
|
14
12
|
refresh,
|
|
15
13
|
onChange,
|
|
16
14
|
value,
|
|
@@ -27,9 +25,12 @@ function useValuesAndHandlers(props) {
|
|
|
27
25
|
return;
|
|
28
26
|
}
|
|
29
27
|
const newValue = value || (multiple ? [] : null);
|
|
28
|
+
if (deepEqual(selectedValue, newValue)) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
30
31
|
refValue.current = newValue;
|
|
31
32
|
setSelectedValue(newValue);
|
|
32
|
-
}, [multiple, value]);
|
|
33
|
+
}, [multiple, value, selectedValue]);
|
|
33
34
|
const isOptionEqualToValueLocal = useCallback(
|
|
34
35
|
(option, val) => {
|
|
35
36
|
if (val === null || val === void 0) {
|
|
@@ -112,21 +113,19 @@ function useValuesAndHandlers(props) {
|
|
|
112
113
|
},
|
|
113
114
|
[getOptionLabel]
|
|
114
115
|
);
|
|
115
|
-
const getOptionUrlImageLocal = useCallback((option) => {
|
|
116
|
-
if (option === void 0 || option === null || getOptionUrlImage === void 0) {
|
|
117
|
-
return "";
|
|
118
|
-
}
|
|
119
|
-
return getOptionUrlImage(option);
|
|
120
|
-
}, [getOptionUrlImage]);
|
|
121
116
|
const [inputValue, setInputValue] = useState("");
|
|
122
117
|
useEffect(() => {
|
|
123
118
|
if (readOnly && value !== null && value !== void 0 && !multiple) {
|
|
124
119
|
const displayValue = getOptionLabelLocal(value);
|
|
125
|
-
|
|
120
|
+
if (inputValue !== displayValue) {
|
|
121
|
+
setInputValue(displayValue);
|
|
122
|
+
}
|
|
126
123
|
} else if (readOnly && multiple) {
|
|
127
|
-
|
|
124
|
+
if (inputValue !== "") {
|
|
125
|
+
setInputValue("");
|
|
126
|
+
}
|
|
128
127
|
}
|
|
129
|
-
}, [readOnly, value, getOptionLabelLocal, multiple]);
|
|
128
|
+
}, [readOnly, value, getOptionLabelLocal, multiple, inputValue]);
|
|
130
129
|
useEffect(() => {
|
|
131
130
|
if (open === false && value === null && inputValue !== "") {
|
|
132
131
|
setInputValue("");
|
|
@@ -154,14 +153,10 @@ function useValuesAndHandlers(props) {
|
|
|
154
153
|
}
|
|
155
154
|
}
|
|
156
155
|
};
|
|
157
|
-
const selectedOption = options.find((option) => {
|
|
158
|
-
return isOptionEqualToValueLocal(option, selectedValue);
|
|
159
|
-
});
|
|
160
156
|
return {
|
|
161
157
|
open,
|
|
162
158
|
inputValue,
|
|
163
159
|
selectedValue,
|
|
164
|
-
selectedOption,
|
|
165
160
|
isOptionEqualToValueLocal,
|
|
166
161
|
handleDelete,
|
|
167
162
|
handleRefresh,
|
|
@@ -170,7 +165,6 @@ function useValuesAndHandlers(props) {
|
|
|
170
165
|
onCloseLocal,
|
|
171
166
|
onOpenLocal,
|
|
172
167
|
getOptionLabelLocal,
|
|
173
|
-
getOptionUrlImageLocal,
|
|
174
168
|
checkKeyDown,
|
|
175
169
|
scrollPositionOptionsRef
|
|
176
170
|
};
|
|
@@ -13,5 +13,6 @@ export declare enum AutocompleteSlots {
|
|
|
13
13
|
image = "image",
|
|
14
14
|
renderInputText = "renderInputText",
|
|
15
15
|
containerMultipleValues = "containerMultipleValues",
|
|
16
|
-
containerWrapper = "containerWrapper"
|
|
16
|
+
containerWrapper = "containerWrapper",
|
|
17
|
+
wrapperStartAdornment = "wrapperStartAdornment"
|
|
17
18
|
}
|
|
@@ -14,6 +14,7 @@ var AutocompleteSlots = /* @__PURE__ */ ((AutocompleteSlots2) => {
|
|
|
14
14
|
AutocompleteSlots2["renderInputText"] = "renderInputText";
|
|
15
15
|
AutocompleteSlots2["containerMultipleValues"] = "containerMultipleValues";
|
|
16
16
|
AutocompleteSlots2["containerWrapper"] = "containerWrapper";
|
|
17
|
+
AutocompleteSlots2["wrapperStartAdornment"] = "wrapperStartAdornment";
|
|
17
18
|
return AutocompleteSlots2;
|
|
18
19
|
})(AutocompleteSlots || {});
|
|
19
20
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const AutocompleteRootStyled: import('@emotion/styled').StyledComponent<Pick<import('@mui/material').AutocompleteProps<unknown, boolean | undefined, boolean | undefined, boolean | undefined, import('react').ElementType<any, keyof import("react").JSX.IntrinsicElements>>, keyof import('@mui/material').AutocompleteProps<unknown, boolean | undefined, boolean | undefined, boolean | undefined, import('react').ElementType<any, keyof import("react").JSX.IntrinsicElements>>> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
2
2
|
ownerState?: (Partial<import('../types').AutocompleteOwnerState> & Record<string, unknown>) | undefined;
|
|
3
3
|
}, {}, {}>;
|
|
4
|
-
export declare const IconButtonStyled: import('@emotion/styled').StyledComponent<Pick<Omit<import('../../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').Theme> & Record<string, unknown> & {
|
|
4
|
+
export declare const IconButtonStyled: import('@emotion/styled').StyledComponent<Pick<Omit<import('../../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" | "ariaLabel" | "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').Theme> & Record<string, unknown> & {
|
|
5
5
|
ownerState?: (Partial<import('../types').AutocompleteOwnerState> & Record<string, unknown>) | undefined;
|
|
6
6
|
}, {}, {}>;
|
|
7
7
|
export declare const ChipStyled: import('@emotion/styled').StyledComponent<Pick<import('../../..').ChipProps & import('react').RefAttributes<HTMLDivElement>, keyof import('react').RefAttributes<HTMLDivElement> | keyof import('../../..').ChipProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
@@ -39,6 +39,9 @@ export declare const RenderInputTextStyled: import('@emotion/styled').StyledComp
|
|
|
39
39
|
export declare const AdormentsStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
40
40
|
ownerState?: (Partial<import('../types').AutocompleteOwnerState> & Record<string, unknown>) | undefined;
|
|
41
41
|
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
42
|
+
export declare const WrapperStartAdornmentStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
43
|
+
ownerState?: (Partial<import('../types').AutocompleteOwnerState> & Record<string, unknown>) | undefined;
|
|
44
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
42
45
|
export declare const ContainerMultipleValuesStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
43
46
|
ownerState?: (Partial<import('../types').AutocompleteOwnerState> & Record<string, unknown>) | undefined;
|
|
44
47
|
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
@@ -64,6 +64,10 @@ const AdormentsStyled = styled("div", {
|
|
|
64
64
|
name: AUTOCOMPLETE_KEY_COMPONENT,
|
|
65
65
|
slot: AutocompleteSlots.adorments
|
|
66
66
|
})(autocompleteSyles?.adorments);
|
|
67
|
+
const WrapperStartAdornmentStyled = styled("div", {
|
|
68
|
+
name: AUTOCOMPLETE_KEY_COMPONENT,
|
|
69
|
+
slot: AutocompleteSlots.wrapperStartAdornment
|
|
70
|
+
})(autocompleteSyles?.wrapperStartAdornment);
|
|
67
71
|
const ContainerMultipleValuesStyled = styled("div", {
|
|
68
72
|
name: AUTOCOMPLETE_KEY_COMPONENT,
|
|
69
73
|
slot: AutocompleteSlots.containerMultipleValues
|
|
@@ -79,6 +83,7 @@ export {
|
|
|
79
83
|
PopperComponentStyled as P,
|
|
80
84
|
RenderInputStyled as R,
|
|
81
85
|
SkeletonAutocompleteStyled as S,
|
|
86
|
+
WrapperStartAdornmentStyled as W,
|
|
82
87
|
AdormentsStyled as a,
|
|
83
88
|
ContainerMultipleValuesStyled as b,
|
|
84
89
|
ContainerWrapperStyled as c,
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { useModuleDictionary } from "@m4l/core";
|
|
4
|
+
import { u as useComponentSize } from "../../../../../hooks/useComponentSize/useComponentSize.js";
|
|
5
|
+
import { T as Typography } from "../../../Typography/Typography.js";
|
|
6
|
+
const LoadingTextComponent = () => {
|
|
7
|
+
const { currentSize } = useComponentSize();
|
|
8
|
+
const { getLabel } = useModuleDictionary();
|
|
9
|
+
return /* @__PURE__ */ jsx(Typography, { variant: "body", size: currentSize, children: getLabel("autocomplete.loading_options") });
|
|
10
|
+
};
|
|
11
|
+
const LoadingText = React.memo(LoadingTextComponent);
|
|
12
|
+
export {
|
|
13
|
+
LoadingText as L
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { LoadingText } from './LoadingText';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { useModuleDictionary } from "@m4l/core";
|
|
4
|
+
import { u as useComponentSize } from "../../../../../hooks/useComponentSize/useComponentSize.js";
|
|
5
|
+
import { T as Typography } from "../../../Typography/Typography.js";
|
|
6
|
+
const NoOptionsTextComponent = () => {
|
|
7
|
+
const { currentSize } = useComponentSize();
|
|
8
|
+
const { getLabel } = useModuleDictionary();
|
|
9
|
+
return /* @__PURE__ */ jsx(Typography, { variant: "body", size: currentSize, children: getLabel("autocomplete.no_options") });
|
|
10
|
+
};
|
|
11
|
+
const NoOptionsText = React.memo(NoOptionsTextComponent);
|
|
12
|
+
export {
|
|
13
|
+
NoOptionsText as N
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { NoOptionsText } from './NoOptionsText';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/components/mui_extended/Autocomplete/subcomponents/PopperComponent/PopperComponent.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CustomPopperComponentProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Componente PopperComponent que se utiliza para renderizar el popper del autocomplete.
|
|
5
|
+
* Compatible con React.JSXElementConstructor<PopperProps> de MUI.
|
|
6
|
+
*/
|
|
7
|
+
export declare const PopperComponent: ({ currentSize, ownerState, ...popperProps }: CustomPopperComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const MemoizedPopperComponent: React.MemoExoticComponent<({ currentSize, ownerState, ...popperProps }: CustomPopperComponentProps) => import("react/jsx-runtime").JSX.Element>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { P as PopperComponentStyled } from "../../slots/AutocompleteSlots.js";
|
|
4
|
+
const PopperComponent = ({
|
|
5
|
+
currentSize = "medium",
|
|
6
|
+
ownerState,
|
|
7
|
+
...popperProps
|
|
8
|
+
}) => {
|
|
9
|
+
const { color: popperColor, ...otherPopperProps } = popperProps;
|
|
10
|
+
return /* @__PURE__ */ jsx(
|
|
11
|
+
PopperComponentStyled,
|
|
12
|
+
{
|
|
13
|
+
...otherPopperProps,
|
|
14
|
+
size: currentSize,
|
|
15
|
+
placement: "bottom-start",
|
|
16
|
+
ownerState: ownerState ? { ...ownerState } : void 0
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
React.memo(PopperComponent);
|
|
21
|
+
export {
|
|
22
|
+
PopperComponent as P
|
|
23
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Sizes } from '@m4l/styles';
|
|
2
|
+
import { AutocompleteOwnerState } from '../../types';
|
|
3
|
+
import { PopperProps } from '@mui/material';
|
|
4
|
+
export interface CustomPopperComponentProps extends PopperProps {
|
|
5
|
+
currentSize?: Extract<Sizes, 'small' | 'medium'>;
|
|
6
|
+
ownerState?: AutocompleteOwnerState;
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/components/mui_extended/Autocomplete/subcomponents/RenderAdornment/RenderAdornment.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Sizes } from '@m4l/styles';
|
|
2
|
+
import { ResourceType } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Render adornment function similar to useStartAdornments
|
|
5
|
+
*/
|
|
6
|
+
export declare const renderAdornment: (propsResource: ResourceType, adjustedSize: Extract<Sizes, "small" | "medium">) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { I as Image } from "../../../../Image/Image.js";
|
|
4
|
+
import { I as Icon } from "../../../../Icon/Icon.js";
|
|
5
|
+
const renderAdornment = (propsResource, adjustedSize) => {
|
|
6
|
+
const { resource, type } = propsResource;
|
|
7
|
+
if (!resource) {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
if (React.isValidElement(resource)) {
|
|
11
|
+
try {
|
|
12
|
+
return React.cloneElement(resource, {
|
|
13
|
+
size: adjustedSize
|
|
14
|
+
});
|
|
15
|
+
} catch (error) {
|
|
16
|
+
console.warn("Error cloning React element:", error);
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
if (typeof resource === "string") {
|
|
21
|
+
if (type === "image") {
|
|
22
|
+
return /* @__PURE__ */ jsx(
|
|
23
|
+
Image,
|
|
24
|
+
{
|
|
25
|
+
src: resource,
|
|
26
|
+
width: 14,
|
|
27
|
+
height: 14
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
} else {
|
|
31
|
+
return /* @__PURE__ */ jsx(
|
|
32
|
+
Icon,
|
|
33
|
+
{
|
|
34
|
+
src: resource,
|
|
35
|
+
size: adjustedSize
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
console.warn("Invalid icon type provided to renderAdornment:", typeof resource);
|
|
41
|
+
return null;
|
|
42
|
+
};
|
|
43
|
+
export {
|
|
44
|
+
renderAdornment as r
|
|
45
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import { ResourceType } from '../../types';
|
|
3
|
+
import { RenderOptionType } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* Render option for Autocomplete.
|
|
6
|
+
*/
|
|
7
|
+
export declare const renderOption: <T>(optionProps: HTMLAttributes<HTMLLIElement> & {
|
|
8
|
+
key: string;
|
|
9
|
+
}, option: RenderOptionType<T>, getOptionStartAdornment?: (option: T) => ResourceType | undefined, getOptionEndAdornment?: (option: T) => ResourceType | undefined) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { memo, useMemo } from "react";
|
|
3
|
+
import { r as renderAdornment } from "../RenderAdornment/RenderAdornment.js";
|
|
4
|
+
import { M as MenuItem } from "../../../MenuItem/MenuItem.js";
|
|
5
|
+
const MemoizedMenuItem = memo(MenuItem);
|
|
6
|
+
const RenderOptionComponent = ({
|
|
7
|
+
optionProps,
|
|
8
|
+
option,
|
|
9
|
+
getOptionStartAdornment,
|
|
10
|
+
getOptionEndAdornment
|
|
11
|
+
}) => {
|
|
12
|
+
const { className, key, ...otherOptionProps } = optionProps;
|
|
13
|
+
const processedStartAdornment = useMemo(() => {
|
|
14
|
+
if (!getOptionStartAdornment) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
const startAdornment = getOptionStartAdornment(option);
|
|
18
|
+
if (!startAdornment) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
return renderAdornment(startAdornment, option.size);
|
|
22
|
+
}, [getOptionStartAdornment, option]);
|
|
23
|
+
const processedEndAdornment = useMemo(() => {
|
|
24
|
+
if (!getOptionEndAdornment) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
const endAdornment = getOptionEndAdornment(option);
|
|
28
|
+
if (!endAdornment) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
return renderAdornment(endAdornment, option.size);
|
|
32
|
+
}, [getOptionEndAdornment, option]);
|
|
33
|
+
return /* @__PURE__ */ jsx(
|
|
34
|
+
MemoizedMenuItem,
|
|
35
|
+
{
|
|
36
|
+
...otherOptionProps,
|
|
37
|
+
selected: option.selected,
|
|
38
|
+
color: "default",
|
|
39
|
+
label: option.label,
|
|
40
|
+
disabled: option.disabled,
|
|
41
|
+
startIcon: processedStartAdornment,
|
|
42
|
+
endIcon: processedEndAdornment
|
|
43
|
+
},
|
|
44
|
+
option.label
|
|
45
|
+
);
|
|
46
|
+
};
|
|
47
|
+
const MemoizedRenderOptionComponent = memo(RenderOptionComponent);
|
|
48
|
+
const renderOption = (optionProps, option, getOptionStartAdornment, getOptionEndAdornment) => {
|
|
49
|
+
return /* @__PURE__ */ jsx(
|
|
50
|
+
MemoizedRenderOptionComponent,
|
|
51
|
+
{
|
|
52
|
+
optionProps,
|
|
53
|
+
option,
|
|
54
|
+
getOptionStartAdornment,
|
|
55
|
+
getOptionEndAdornment
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
};
|
|
59
|
+
export {
|
|
60
|
+
renderOption as r
|
|
61
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AutocompleteChangeReason, AutocompleteFreeSoloValueMapping, AutocompleteInputChangeReason, AutocompleteProps as MUIAutocompleteProps, Theme } from '@mui/material';
|
|
2
2
|
import { Sizes } from '@m4l/styles';
|
|
3
|
-
import { ChangeEvent } from 'react';
|
|
3
|
+
import { ChangeEvent, ReactElement, ReactNode } from 'react';
|
|
4
4
|
import { TextFieldProps } from '../TextField/types';
|
|
5
5
|
import { AUTOCOMPLETE_KEY_COMPONENT } from './constants';
|
|
6
6
|
import { AutocompleteSlots } from './slots';
|
|
@@ -21,6 +21,7 @@ export interface BaseAutocompleteProps {
|
|
|
21
21
|
*/
|
|
22
22
|
dataTestid?: string;
|
|
23
23
|
}
|
|
24
|
+
export type AdornmentType = ReactElement | string;
|
|
24
25
|
/**
|
|
25
26
|
* Props for the unified Autocomplete component.
|
|
26
27
|
* Supports both single and multiple selection, and two types: `text` and `image`.
|
|
@@ -47,9 +48,18 @@ export interface AutocompleteProps<T, Multiple extends boolean | undefined> exte
|
|
|
47
48
|
*/
|
|
48
49
|
value: T | T[] | null | undefined;
|
|
49
50
|
/**
|
|
51
|
+
*
|
|
50
52
|
* Function to get the label for a given option.
|
|
51
53
|
*/
|
|
52
54
|
getOptionLabel: (option: T | AutocompleteFreeSoloValueMapping<false>) => string;
|
|
55
|
+
/**
|
|
56
|
+
* Function to get the start adornment for a given option.
|
|
57
|
+
*/
|
|
58
|
+
getOptionStartAdornment?: (option: T) => ResourceType;
|
|
59
|
+
/**
|
|
60
|
+
* Function to get the end adornment for a given option.
|
|
61
|
+
*/
|
|
62
|
+
getOptionEndAdornment?: (option: T) => ResourceType;
|
|
53
63
|
/**
|
|
54
64
|
* Function to compare if an option matches the selected value.
|
|
55
65
|
*/
|
|
@@ -64,6 +74,7 @@ export interface AutocompleteProps<T, Multiple extends boolean | undefined> exte
|
|
|
64
74
|
onChangeFilterParmsLocal?: (newValue: string, reason: AutocompleteInputChangeReason) => void;
|
|
65
75
|
/**
|
|
66
76
|
* Function to get the image URL for a given option (only for `type: 'image'`).
|
|
77
|
+
* @deprecated Use getOptionStartAdornment or getOptionEndAdornment instead.
|
|
67
78
|
*/
|
|
68
79
|
getOptionUrlImage?: (option: T) => string;
|
|
69
80
|
/**
|
|
@@ -75,7 +86,15 @@ export interface AutocompleteProps<T, Multiple extends boolean | undefined> exte
|
|
|
75
86
|
* "htmlFor" attribute for the autocomplete field.
|
|
76
87
|
*/
|
|
77
88
|
htmlFor?: string;
|
|
89
|
+
/**
|
|
90
|
+
* Icono o adorno que se muestra al inicio del autocomplete.
|
|
91
|
+
*/
|
|
92
|
+
startAdornment?: ReactElement;
|
|
78
93
|
}
|
|
94
|
+
export type ResourceType = {
|
|
95
|
+
resource: ReactNode;
|
|
96
|
+
type?: 'icon' | 'image';
|
|
97
|
+
};
|
|
79
98
|
/**
|
|
80
99
|
* Represents the owner state of the Autocomplete component for styling purposes.
|
|
81
100
|
*/
|
|
@@ -84,6 +103,7 @@ export interface AutocompleteOwnerState extends Pick<BaseAutocompleteProps, 'siz
|
|
|
84
103
|
disabled?: boolean;
|
|
85
104
|
multiple?: boolean;
|
|
86
105
|
readOnly?: boolean;
|
|
106
|
+
startAdornment?: boolean;
|
|
87
107
|
}
|
|
88
108
|
/**
|
|
89
109
|
* Defines the types of Slots available for the Autocomplete.
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useModuleSkeleton, getPropertyByString } from "@m4l/core";
|
|
3
3
|
import { useTheme } from "@mui/material";
|
|
4
|
-
import clsx from "clsx";
|
|
5
4
|
import { forwardRef } from "react";
|
|
5
|
+
import { B as BUTTON_CLASSES } from "./constants.js";
|
|
6
|
+
import clsx from "clsx";
|
|
6
7
|
import { u as useComponentSize } from "../../../hooks/useComponentSize/useComponentSize.js";
|
|
7
8
|
import { S as SkeletonButtonStyled, B as ButtonRootStyled, T as TextButtonStyled, a as ButtonIconStyled } from "./slots/ButtonSlots.js";
|
|
8
9
|
const Button = forwardRef((props, ref) => {
|
|
@@ -58,7 +59,8 @@ const Button = forwardRef((props, ref) => {
|
|
|
58
59
|
alt: "icon",
|
|
59
60
|
size: currentSize,
|
|
60
61
|
disabled,
|
|
61
|
-
instaceDataTestId
|
|
62
|
+
instaceDataTestId,
|
|
63
|
+
className: BUTTON_CLASSES.buttonIcon
|
|
62
64
|
}
|
|
63
65
|
);
|
|
64
66
|
}
|
|
@@ -70,7 +72,7 @@ const Button = forwardRef((props, ref) => {
|
|
|
70
72
|
role: "button",
|
|
71
73
|
startIcon: renderIcon(startIcon, "ButtonStartIcon"),
|
|
72
74
|
endIcon: renderIcon(endIcon, "ButtonEndIcon"),
|
|
73
|
-
className: clsx(className),
|
|
75
|
+
className: clsx(className, BUTTON_CLASSES.buttonRoot),
|
|
74
76
|
variant,
|
|
75
77
|
size,
|
|
76
78
|
disabled,
|
|
@@ -80,7 +82,16 @@ const Button = forwardRef((props, ref) => {
|
|
|
80
82
|
ref,
|
|
81
83
|
...others,
|
|
82
84
|
children: [
|
|
83
|
-
/* @__PURE__ */ jsx(
|
|
85
|
+
/* @__PURE__ */ jsx(
|
|
86
|
+
TextButtonStyled,
|
|
87
|
+
{
|
|
88
|
+
ownerState: { ...ownerState },
|
|
89
|
+
color: adjustedColor,
|
|
90
|
+
size: currentSize,
|
|
91
|
+
className: BUTTON_CLASSES.textButton,
|
|
92
|
+
children: label
|
|
93
|
+
}
|
|
94
|
+
),
|
|
84
95
|
props.children
|
|
85
96
|
]
|
|
86
97
|
}
|