@m4l/components 9.4.40 → 9.4.41
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/components/DynamicFilter/subcomponents/FieldTypes/SelectFilter/index.js +1 -1
- package/components/DynamicForm/helpers/resolveFieldComponent/resolveFieldComponent.js +3 -5
- package/components/DynamicForm/hooks/useDynamicForm/useDynamicForm.js +3 -5
- package/components/DynamicSort/dictionary.js +9 -11
- package/components/areas/components/AreasAdmin/subcomponents/AreaChip/AreaChip.js +15 -17
- package/components/areas/components/AreasAdmin/subcomponents/AreaChipMobile/subcomponents/ChipMobile/ChipMobile.js +3 -5
- package/components/extended/mui/Autocomplete/hooks/useValuesAndHandlers.d.ts.map +1 -1
- package/components/extended/mui/Autocomplete/hooks/useValuesAndHandlers.js +68 -61
- package/components/extended/mui/AutocompleteAsync/AutocompleteAsync.d.ts +11 -0
- package/components/extended/mui/AutocompleteAsync/AutocompleteAsync.d.ts.map +1 -0
- package/components/extended/mui/AutocompleteAsync/AutocompleteAsync.js +81 -0
- package/components/extended/mui/AutocompleteAsync/AutocompleteAsync.styles.d.ts +3 -0
- package/components/extended/mui/AutocompleteAsync/AutocompleteAsync.styles.d.ts.map +1 -0
- package/components/extended/mui/AutocompleteAsync/AutocompleteAsync.styles.js +8 -0
- package/components/extended/mui/AutocompleteAsync/constants.d.ts +13 -0
- package/components/extended/mui/AutocompleteAsync/constants.d.ts.map +1 -0
- package/components/extended/mui/AutocompleteAsync/constants.js +25 -0
- package/components/extended/mui/AutocompleteAsync/hooks/useFetchOptions.d.ts +6 -0
- package/components/extended/mui/AutocompleteAsync/hooks/useFetchOptions.d.ts.map +1 -0
- package/components/extended/mui/AutocompleteAsync/hooks/useFetchOptions.js +62 -0
- package/components/extended/mui/AutocompleteAsync/index.d.ts +3 -0
- package/components/extended/mui/AutocompleteAsync/index.d.ts.map +1 -0
- package/components/extended/mui/AutocompleteAsync/reducer/AutocompleteAsyncReducer.d.ts +23 -0
- package/components/extended/mui/AutocompleteAsync/reducer/AutocompleteAsyncReducer.d.ts.map +1 -0
- package/components/extended/mui/AutocompleteAsync/reducer/AutocompleteAsyncReducer.js +72 -0
- package/components/extended/mui/AutocompleteAsync/slots/AutocompleteAsyncEnum.d.ts +6 -0
- package/components/extended/mui/AutocompleteAsync/slots/AutocompleteAsyncEnum.d.ts.map +1 -0
- package/components/extended/mui/AutocompleteAsync/slots/AutocompleteAsyncEnum.js +5 -0
- package/components/extended/mui/AutocompleteAsync/slots/AutocompleteAsyncSlots.d.ts +4 -0
- package/components/extended/mui/AutocompleteAsync/slots/AutocompleteAsyncSlots.d.ts.map +1 -0
- package/components/extended/mui/AutocompleteAsync/slots/AutocompleteAsyncSlots.js +12 -0
- package/components/extended/mui/AutocompleteAsync/slots/index.d.ts +3 -0
- package/components/extended/mui/AutocompleteAsync/slots/index.d.ts.map +1 -0
- package/components/extended/mui/AutocompleteAsync/tests/common.d.ts +34 -0
- package/components/extended/mui/AutocompleteAsync/tests/common.d.ts.map +1 -0
- package/components/extended/mui/AutocompleteAsync/types.d.ts +82 -0
- package/components/extended/mui/AutocompleteAsync/types.d.ts.map +1 -0
- package/components/extended/mui/AutocompleteAsync/types.js +11 -0
- package/components/extended/mui/MenuItem/MenuItem.d.ts.map +1 -1
- package/components/extended/mui/MenuItem/MenuItem.js +44 -45
- package/components/extended/mui/MenuItem/MenuItem.styles.d.ts.map +1 -1
- package/components/extended/mui/MenuItem/MenuItem.styles.js +34 -27
- package/components/extended/mui/MenuItem/constants.d.ts +1 -1
- package/components/extended/mui/MenuItem/constants.d.ts.map +1 -1
- package/components/extended/mui/MenuItem/constants.js +7 -3
- package/components/extended/mui/NavLink/constants.d.ts +1 -1
- package/components/extended/mui/Select/slots/SelectSlots.d.ts +1 -1
- package/components/hook-form/RHFAutocomplete/RHFAutocomplete.d.ts +34 -5
- package/components/hook-form/RHFAutocomplete/RHFAutocomplete.d.ts.map +1 -1
- package/components/hook-form/RHFAutocomplete/RHFAutocomplete.js +4 -114
- package/components/hook-form/RHFAutocomplete/types.d.ts +4 -73
- package/components/hook-form/RHFAutocomplete/types.d.ts.map +1 -1
- package/components/hook-form/RHFAutocompleteAsync/RHFAutocompleteAsync.d.ts +17 -32
- package/components/hook-form/RHFAutocompleteAsync/RHFAutocompleteAsync.d.ts.map +1 -1
- package/components/hook-form/RHFAutocompleteAsync/RHFAutocompleteAsync.js +4 -94
- package/components/hook-form/RHFAutocompleteAsync/types.d.ts +8 -141
- package/components/hook-form/RHFAutocompleteAsync/types.d.ts.map +1 -1
- package/components/hook-form/RHFDateTimePicker/RHFDateTimePicker.js +6 -8
- package/components/hook-form/RHFPeriod/slots/RHFPeriodSlots.d.ts +1 -1
- package/components/hook-form/RHFSelect/slots/RHFSlots.d.ts +1 -1
- package/package.json +6 -6
- package/components/hook-form/RHFAutocomplete/RFHAutocompleteStyles.d.ts +0 -3
- package/components/hook-form/RHFAutocomplete/RFHAutocompleteStyles.d.ts.map +0 -1
- package/components/hook-form/RHFAutocomplete/RFHAutocompleteStyles.js +0 -25
- package/components/hook-form/RHFAutocomplete/constants.d.ts +0 -11
- package/components/hook-form/RHFAutocomplete/constants.d.ts.map +0 -1
- package/components/hook-form/RHFAutocomplete/constants.js +0 -8
- package/components/hook-form/RHFAutocomplete/slots/RHFAutocompleteEnum.d.ts +0 -5
- package/components/hook-form/RHFAutocomplete/slots/RHFAutocompleteEnum.d.ts.map +0 -1
- package/components/hook-form/RHFAutocomplete/slots/RHFAutocompleteEnum.js +0 -4
- package/components/hook-form/RHFAutocomplete/slots/RHFAutocompleteSlots.d.ts +0 -7
- package/components/hook-form/RHFAutocomplete/slots/RHFAutocompleteSlots.d.ts.map +0 -1
- package/components/hook-form/RHFAutocomplete/slots/RHFAutocompleteSlots.js +0 -16
- package/components/hook-form/RHFAutocomplete/slots/index.d.ts +0 -3
- package/components/hook-form/RHFAutocomplete/slots/index.d.ts.map +0 -1
- package/components/hook-form/RHFAutocomplete/tests/common.d.ts +0 -38
- package/components/hook-form/RHFAutocomplete/tests/common.d.ts.map +0 -1
- package/components/hook-form/RHFAutocompleteAsync/RHFAutocompleteAsyncStyles.d.ts +0 -3
- package/components/hook-form/RHFAutocompleteAsync/RHFAutocompleteAsyncStyles.d.ts.map +0 -1
- package/components/hook-form/RHFAutocompleteAsync/constants.d.ts +0 -10
- package/components/hook-form/RHFAutocompleteAsync/constants.d.ts.map +0 -1
- package/components/hook-form/RHFAutocompleteAsync/hooks/useFetchOptions.d.ts +0 -6
- package/components/hook-form/RHFAutocompleteAsync/hooks/useFetchOptions.d.ts.map +0 -1
- package/components/hook-form/RHFAutocompleteAsync/hooks/useFetchOptions.js +0 -44
- package/components/hook-form/RHFAutocompleteAsync/reducer/RHFAutocompleteReducer.d.ts +0 -15
- package/components/hook-form/RHFAutocompleteAsync/reducer/RHFAutocompleteReducer.d.ts.map +0 -1
- package/components/hook-form/RHFAutocompleteAsync/reducer/RHFAutocompleteReducer.js +0 -70
- package/components/hook-form/RHFAutocompleteAsync/slots/RHFAutocompleteEnumAsync.d.ts +0 -4
- package/components/hook-form/RHFAutocompleteAsync/slots/RHFAutocompleteEnumAsync.d.ts.map +0 -1
- package/components/hook-form/RHFAutocompleteAsync/slots/RHFAutocompleteSlotsAsync.d.ts +0 -2
- package/components/hook-form/RHFAutocompleteAsync/slots/RHFAutocompleteSlotsAsync.d.ts.map +0 -1
- package/components/hook-form/RHFAutocompleteAsync/slots/index.d.ts +0 -3
- package/components/hook-form/RHFAutocompleteAsync/slots/index.d.ts.map +0 -1
- package/components/hook-form/RHFAutocompleteAsync/tests/common.d.ts +0 -44
- package/components/hook-form/RHFAutocompleteAsync/tests/common.d.ts.map +0 -1
- package/components/hook-form/RHFAutocompleteAsync/types.js +0 -38
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* <SelectRootStyled<number> />
|
|
7
7
|
* <SelectRootStyled<string> />
|
|
8
8
|
*/
|
|
9
|
-
export declare const SelectRootStyled: <T extends string | number>() => import('@emotion/styled').StyledComponent<Pick<import('@mui/material').SelectProps<T>, "onClose" | "title" | "error" | "size" | "variant" | "color" | "content" | "translate" | "margin" | "className" | "style" | "classes" | "children" | "sx" | "slots" | "slotProps" | "input" | "label" | "slot" | "ref" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "hidden" | "id" | "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" | "popover" | "popoverTargetAction" | "popoverTarget" | "inert" | "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" | "onScrollEnd" | "onScrollEndCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onToggle" | "onBeforeToggle" | "onTransitionCancel" | "onTransitionCancelCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "onTransitionRun" | "onTransitionRunCapture" | "onTransitionStart" | "onTransitionStartCapture" | "name" | "value" | "components" | "componentsProps" | "onOpen" | "open" | "disabled" | "type" | "multiple" | "placeholder" | "maxRows" | "fullWidth" | "autoComplete" | "required" | "readOnly" | "inputProps" | "inputRef" | "multiline" | "rows" | "minRows" | "disableInjectingGlobalStyles" | "
|
|
9
|
+
export declare const SelectRootStyled: <T extends string | number>() => import('@emotion/styled').StyledComponent<Pick<import('@mui/material').SelectProps<T>, "onClose" | "title" | "error" | "size" | "variant" | "color" | "content" | "translate" | "margin" | "className" | "style" | "classes" | "children" | "sx" | "slots" | "slotProps" | "input" | "label" | "slot" | "ref" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "hidden" | "id" | "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" | "popover" | "popoverTargetAction" | "popoverTarget" | "inert" | "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" | "onScrollEnd" | "onScrollEndCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onToggle" | "onBeforeToggle" | "onTransitionCancel" | "onTransitionCancelCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "onTransitionRun" | "onTransitionRunCapture" | "onTransitionStart" | "onTransitionStartCapture" | "name" | "value" | "components" | "componentsProps" | "onOpen" | "open" | "disabled" | "type" | "startAdornment" | "endAdornment" | "multiple" | "placeholder" | "maxRows" | "fullWidth" | "autoComplete" | "required" | "readOnly" | "inputProps" | "inputRef" | "multiline" | "rows" | "minRows" | "disableInjectingGlobalStyles" | "inputComponent" | "renderSuffix" | "disableUnderline" | "autoWidth" | "defaultOpen" | "displayEmpty" | "IconComponent" | "labelId" | "MenuProps" | "native" | "renderValue" | "SelectDisplayProps"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
10
10
|
ownerState?: (Partial<import('../types').SelectOwnerState<any, any>> & Record<string, unknown>) | undefined;
|
|
11
11
|
}, {}, {}>;
|
|
12
12
|
export declare const AdormentStyled: import('@emotion/styled').StyledComponent<Pick<import('../../../..').IconProps, "src" | "icon" | keyof import('../../../..').IconBaseProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
@@ -1,8 +1,37 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ref } from 'react';
|
|
2
|
+
import { FieldValues } from 'react-hook-form';
|
|
3
|
+
import { AutocompleteProps } from '../../extended/mui/Autocomplete/types';
|
|
4
|
+
import { BaseRHFProps } from '../../../hocs/withRHFController/types';
|
|
2
5
|
/**
|
|
3
|
-
* RHFAutocomplete component renders an autocomplete input field with
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
+
* RHFAutocomplete component renders an autocomplete input field integrated with react-hook-form.
|
|
7
|
+
* Uses the withRHFController HOC to handle Controller, Label, and error display automatically.
|
|
8
|
+
* Generic T is the option type (e.g. FormOperator, FormOperandBoolean).
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* <RHFAutocomplete<MyOption>
|
|
12
|
+
* name="city"
|
|
13
|
+
* label="City"
|
|
14
|
+
* options={cities}
|
|
15
|
+
* getOptionLabel={(opt) => opt.name}
|
|
16
|
+
* isOptionEqualToValue={(opt, val) => opt.id === val.id}
|
|
17
|
+
* />
|
|
18
|
+
* ```
|
|
6
19
|
*/
|
|
7
|
-
|
|
20
|
+
/** Props for RHFAutocomplete: Autocomplete props without value/onChange (injected by RHF Controller). */
|
|
21
|
+
export type RHFAutocompleteProps<T, Multiple extends boolean | undefined = undefined> = Omit<AutocompleteProps<T, Multiple>, 'value' | 'onChange'> & BaseRHFProps<FieldValues> & {
|
|
22
|
+
ref?: Ref<HTMLInputElement | HTMLTextAreaElement>;
|
|
23
|
+
/**
|
|
24
|
+
* @deprecated Has no effect on the component. Kept only for API compatibility.
|
|
25
|
+
* The underlying input type is not configurable; this prop is ignored and has no impact.
|
|
26
|
+
* Will be removed in an upcoming release.
|
|
27
|
+
*/
|
|
28
|
+
type?: string;
|
|
29
|
+
/**
|
|
30
|
+
* @deprecated Has no effect on the component. Kept only for API compatibility.
|
|
31
|
+
* Autocomplete behaviour is controlled internally; this prop is ignored and has no impact.
|
|
32
|
+
* Will be removed in an upcoming release.
|
|
33
|
+
*/
|
|
34
|
+
autoComplete?: string;
|
|
35
|
+
};
|
|
36
|
+
export declare const RHFAutocomplete: <T, Multiple extends boolean | undefined = undefined>(props: RHFAutocompleteProps<T, Multiple>) => JSX.Element;
|
|
8
37
|
//# sourceMappingURL=RHFAutocomplete.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RHFAutocomplete.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/hook-form/RHFAutocomplete/RHFAutocomplete.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RHFAutocomplete.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/hook-form/RHFAutocomplete/RHFAutocomplete.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAE/E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAI1E;;;;;;;;;;;;;;GAcG;AACH,yGAAyG;AACzG,MAAM,MAAM,oBAAoB,CAAC,CAAC,EAAE,QAAQ,SAAS,OAAO,GAAG,SAAS,GAAG,SAAS,IAAI,IAAI,CAC1F,iBAAiB,CAAC,CAAC,EAAE,QAAQ,CAAC,EAC9B,OAAO,GAAG,UAAU,CACrB,GACC,YAAY,CAAC,WAAW,CAAC,GAAG;IAC1B,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,GAAG,mBAAmB,CAAC,CAAC;IAClD;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEJ,eAAO,MAAM,eAAe,EAAqC,CAC/D,CAAC,EACD,QAAQ,SAAS,OAAO,GAAG,SAAS,GAAG,SAAS,EAEhD,KAAK,EAAE,oBAAoB,CAAC,CAAC,EAAE,QAAQ,CAAC,KACrC,GAAG,CAAC,OAAO,CAAC"}
|
|
@@ -1,116 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { HelperError as Q } from "../../HelperError/HelperError.js";
|
|
5
|
-
import { Autocomplete as U } from "../../extended/mui/Autocomplete/Autocomplete.js";
|
|
6
|
-
import { AutocompleteRootStyled as W, LabelStyled as X } from "./slots/RHFAutocompleteSlots.js";
|
|
7
|
-
import { rhfAutocompleteClasses as Y } from "./constants.js";
|
|
8
|
-
import Z from "clsx";
|
|
9
|
-
function me(F) {
|
|
10
|
-
const {
|
|
11
|
-
name: b,
|
|
12
|
-
getOptionLabel: n,
|
|
13
|
-
isOptionEqualToValue: A,
|
|
14
|
-
label: c,
|
|
15
|
-
options: f,
|
|
16
|
-
disabled: r,
|
|
17
|
-
onOpen: l,
|
|
18
|
-
onClose: s,
|
|
19
|
-
loading: L,
|
|
20
|
-
helperMessage: x,
|
|
21
|
-
size: a,
|
|
22
|
-
placeholder: y,
|
|
23
|
-
onChangeFilterParmsLocal: d,
|
|
24
|
-
mandatory: E,
|
|
25
|
-
mandatoryMessage: R,
|
|
26
|
-
multiple: w,
|
|
27
|
-
refresh: H,
|
|
28
|
-
startAdornment: I,
|
|
29
|
-
getOptionStartAdornment: V,
|
|
30
|
-
getOptionEndAdornment: j,
|
|
31
|
-
className: M
|
|
32
|
-
// onChange: onChangeRHF,
|
|
33
|
-
} = F, u = D(), [g, h] = S(!1), N = p((o, e) => {
|
|
34
|
-
h(!1), s && s(o, e);
|
|
35
|
-
}, [s]), _ = p(
|
|
36
|
-
(o) => {
|
|
37
|
-
h((e) => !e), l && l(o);
|
|
38
|
-
},
|
|
39
|
-
[l]
|
|
40
|
-
), C = p(
|
|
41
|
-
(o) => o == null ? "" : n(o),
|
|
42
|
-
[n]
|
|
43
|
-
), {
|
|
44
|
-
control: k
|
|
45
|
-
} = J(), m = {
|
|
46
|
-
disabled: r
|
|
47
|
-
};
|
|
48
|
-
return /* @__PURE__ */ t(
|
|
49
|
-
W,
|
|
50
|
-
{
|
|
51
|
-
className: Z(M, Y.autocompleteRoot),
|
|
52
|
-
ownerState: { ...m },
|
|
53
|
-
size: a,
|
|
54
|
-
children: /* @__PURE__ */ t(
|
|
55
|
-
K,
|
|
56
|
-
{
|
|
57
|
-
name: b,
|
|
58
|
-
control: k,
|
|
59
|
-
render: ({ field: { onChange: o, value: e }, fieldState: { error: i }, formState: { isSubmitting: q } }) => {
|
|
60
|
-
const [O, z] = S(
|
|
61
|
-
C(e)
|
|
62
|
-
);
|
|
63
|
-
return G(() => {
|
|
64
|
-
!g && e === null && O !== "" && z(""), !g && e !== null && f.length === 0 && d?.(C(e), "reset");
|
|
65
|
-
}, [e, O]), /* @__PURE__ */ P(T, { children: [
|
|
66
|
-
c && /* @__PURE__ */ t(
|
|
67
|
-
X,
|
|
68
|
-
{
|
|
69
|
-
ownerState: { ...m },
|
|
70
|
-
label: c,
|
|
71
|
-
htmlFor: u,
|
|
72
|
-
size: a,
|
|
73
|
-
mandatory: E,
|
|
74
|
-
mandatoryMessage: R,
|
|
75
|
-
helperMessage: x,
|
|
76
|
-
disabled: r
|
|
77
|
-
}
|
|
78
|
-
),
|
|
79
|
-
/* @__PURE__ */ t(
|
|
80
|
-
U,
|
|
81
|
-
{
|
|
82
|
-
...m,
|
|
83
|
-
error: !!i,
|
|
84
|
-
options: f,
|
|
85
|
-
getOptionLabel: n,
|
|
86
|
-
isOptionEqualToValue: A,
|
|
87
|
-
multiple: w,
|
|
88
|
-
onChange: ($, B, v) => {
|
|
89
|
-
o(B);
|
|
90
|
-
},
|
|
91
|
-
onChangeFilterParmsLocal: d,
|
|
92
|
-
refresh: H,
|
|
93
|
-
disabled: r || q,
|
|
94
|
-
loading: L,
|
|
95
|
-
onOpen: _,
|
|
96
|
-
onClose: N,
|
|
97
|
-
size: a,
|
|
98
|
-
value: e,
|
|
99
|
-
htmlFor: u,
|
|
100
|
-
placeholder: y,
|
|
101
|
-
startAdornment: I,
|
|
102
|
-
getOptionStartAdornment: V,
|
|
103
|
-
getOptionEndAdornment: j
|
|
104
|
-
}
|
|
105
|
-
),
|
|
106
|
-
i?.message ? /* @__PURE__ */ t(Q, { message: i?.message }) : null
|
|
107
|
-
] });
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
)
|
|
111
|
-
}
|
|
112
|
-
);
|
|
113
|
-
}
|
|
1
|
+
import { Autocomplete as o } from "../../extended/mui/Autocomplete/Autocomplete.js";
|
|
2
|
+
import { withRHFController as t } from "../../../hocs/withRHFController/index.js";
|
|
3
|
+
const e = t(o), p = e;
|
|
114
4
|
export {
|
|
115
|
-
|
|
5
|
+
p as RHFAutocomplete
|
|
116
6
|
};
|
|
@@ -1,77 +1,8 @@
|
|
|
1
|
-
import { AutocompleteCloseReason, AutocompleteFreeSoloValueMapping, AutocompleteInputChangeReason, AutocompleteProps as MUIAutocompleteProps, Theme, PopperProps } from '@mui/material';
|
|
2
|
-
import { ComponentPalletColor, Sizes } from '@m4l/styles';
|
|
3
|
-
import { TextFieldProps } from '../../extended/mui/TextField/types';
|
|
4
|
-
import { RFHAUTOCOMPLETE_KEY_COMPONENT } from './constants';
|
|
5
|
-
import { OverridesStyleRules } from '@mui/material/styles/overrides';
|
|
6
|
-
import { RFHAutocompleteSlots } from './slots';
|
|
7
|
-
import { LabelProps } from '../../Label/types';
|
|
8
1
|
import { AutocompleteProps } from '../../extended/mui/Autocomplete/types';
|
|
9
|
-
|
|
10
|
-
export type RHFAutocompleteVariants = 'outlined' | 'text';
|
|
11
|
-
export type RHFAutocompleteType = 'text' | 'image';
|
|
2
|
+
import { BaseRHFProps } from '../../../hocs/withRHFController/types';
|
|
12
3
|
/**
|
|
13
|
-
* Props for
|
|
14
|
-
*
|
|
4
|
+
* Props for RHFAutocomplete (Autocomplete wrapped with withRHFController).
|
|
5
|
+
* value and onChange are injected by the HOC from the form state.
|
|
15
6
|
*/
|
|
16
|
-
export
|
|
17
|
-
name: string;
|
|
18
|
-
/**
|
|
19
|
-
* The label for the autocomplete field.
|
|
20
|
-
*/
|
|
21
|
-
popperProps?: Omit<PopperProps, 'color'>;
|
|
22
|
-
onFocus?: (event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
23
|
-
autoComplete?: string;
|
|
24
|
-
size?: Extract<Sizes, 'small' | 'medium'>;
|
|
25
|
-
variant?: RHFAutocompleteVariants;
|
|
26
|
-
color?: Extract<ComponentPalletColor, 'primary'>;
|
|
27
|
-
dataTestid?: string;
|
|
28
|
-
options: T[];
|
|
29
|
-
getOptionLabel: (option: T | AutocompleteFreeSoloValueMapping<FreeSolo>) => string;
|
|
30
|
-
isOptionEqualToValue: (options: T | T[], value: T) => boolean;
|
|
31
|
-
skeletonWidth?: string | number;
|
|
32
|
-
loading?: boolean;
|
|
33
|
-
refresh?: () => void;
|
|
34
|
-
label?: string;
|
|
35
|
-
/**
|
|
36
|
-
* Whether the controller detected an error on component.
|
|
37
|
-
*/
|
|
38
|
-
helperMessage?: string;
|
|
39
|
-
onClose?: (event: React.SyntheticEvent, reason: AutocompleteCloseReason) => void;
|
|
40
|
-
onChangeFilterParmsLocal?: (newValue: string, reason: AutocompleteInputChangeReason) => void;
|
|
41
|
-
multiple?: boolean;
|
|
42
|
-
type?: RHFAutocompleteType;
|
|
43
|
-
getOptionUrlImage?: (option: T) => string;
|
|
44
|
-
imageScale?: boolean;
|
|
45
|
-
imageRepeat?: boolean;
|
|
46
|
-
customError?: {
|
|
47
|
-
message: string;
|
|
48
|
-
};
|
|
49
|
-
renderInput?: MUIAutocompleteProps<T, Multiple, DisableClearable, FreeSolo>['renderInput'];
|
|
50
|
-
/**
|
|
51
|
-
* Icono o adorno que se muestra al inicio del autocomplete.
|
|
52
|
-
*/
|
|
53
|
-
startAdornment?: AutocompleteProps<T, Multiple>['startAdornment'];
|
|
54
|
-
/**
|
|
55
|
-
* Icono o adorno inicial que se muestra en cada opción del autocomplete.
|
|
56
|
-
*/
|
|
57
|
-
getOptionEndAdornment?: AutocompleteProps<T, Multiple>['getOptionEndAdornment'];
|
|
58
|
-
/**
|
|
59
|
-
* Icono o adorno final que se muestra en cada opción del autocomplete.
|
|
60
|
-
*/
|
|
61
|
-
getOptionStartAdornment?: AutocompleteProps<T, Multiple>['getOptionStartAdornment'];
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Represents the owner state of the Autocomplete component for styling purposes.
|
|
65
|
-
*/
|
|
66
|
-
export interface RHFAutocompleteOwnerState extends Pick<RHFAutocompleteProps<any>, 'size' | 'disabled' | 'variant'> {
|
|
67
|
-
disabled?: boolean;
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Defines the types of Slots available for the Autocomplete.
|
|
71
|
-
*/
|
|
72
|
-
export type RHFAutocompleteSlotsType = keyof typeof RFHAutocompleteSlots;
|
|
73
|
-
/**
|
|
74
|
-
* Styles applicable to the Autocomplete using themes and custom slots.
|
|
75
|
-
*/
|
|
76
|
-
export type RHFAutocompleteStyles = Partial<OverridesStyleRules<RHFAutocompleteSlotsType, typeof RFHAUTOCOMPLETE_KEY_COMPONENT, Theme>> | undefined;
|
|
7
|
+
export type RHFAutocompleteProps<T = unknown> = BaseRHFProps & Omit<AutocompleteProps<T, boolean | undefined>, 'value' | 'onChange'>;
|
|
77
8
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/hook-form/RHFAutocomplete/types.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/hook-form/RHFAutocomplete/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAErE;;;GAGG;AACH,MAAM,MAAM,oBAAoB,CAAC,CAAC,GAAG,OAAO,IAAI,YAAY,GAC1D,IAAI,CAAC,iBAAiB,CAAC,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC,CAAC"}
|
|
@@ -1,36 +1,21 @@
|
|
|
1
|
+
import { Ref } from 'react';
|
|
1
2
|
import { RHFAutocompleteAsyncProps } from './types';
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* - (Test OK) Si el request esta en curso y se cierra el combo, se debe dejar terminar el request para no perder la respuesta.
|
|
17
|
-
* - (Test OK) Si el request genera un error, debe dejar las mismas opciones y en el proximo open se debe volver a hacer el request.
|
|
18
|
-
* - Si es multiple = false
|
|
19
|
-
* - (Test OK) Si el usuario tiene preseleccionada una opcion al cargar el componente, esta opcion debe verse incluso si no se abierto el combo.
|
|
20
|
-
* - (Test OK) Si tiene preseleccionada una opcion, se abre el combo y cuando llega la respuesta no está dentro de las que llegan de la red,
|
|
21
|
-
* no debe desaparecer la opcion preseleccionada, solo si se selecciona otra opcion.
|
|
22
|
-
*
|
|
23
|
-
* - Si es multiple = true
|
|
24
|
-
* - (Test OK) Si el usuario tiene preseleccionadas una opcion al cargar el componente, esta opcion debe verse incluso si no se abierto el combo.
|
|
25
|
-
* - (Test OK) Si tiene preseleccionadas varias opciones, se abre el combo y cuando llega la respuesta no están dentro de las que llegan de la red,
|
|
26
|
-
* no deben desaparecer las opciones preseleccionadas, solo si se selecciona otra opcion.
|
|
27
|
-
*
|
|
28
|
-
* - Si el componente se le define onChangeFilterParms
|
|
29
|
-
* - (Test OK) Si se define multiple y onChangeFilterParms, se debe lanzar un error.
|
|
30
|
-
* - (Test OK) Cuando se ejecuta se hace la primera apertura debe ejecutarse el request con los parms y adicionalmente los que devuelve onChangeFilterParms.
|
|
31
|
-
* - (Test OK) Si el usuario digita y deja espacios de 300ms, se encola otra petición usando onChangeFilterParms.
|
|
32
|
-
* - (Test OK) Si el request esta en curso y el usuario digita, cancela la petición actual.
|
|
33
|
-
*
|
|
4
|
+
* RHFAutocompleteAsync: async autocomplete integrated with react-hook-form.
|
|
5
|
+
* Uses AutocompleteAsync (fetch logic) wrapped with withRHFController for form state, label, and errors.
|
|
6
|
+
* Generic T is the option type (e.g. OperandSelectAsync).
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* <RHFAutocompleteAsync<MyOption>
|
|
10
|
+
* name="city"
|
|
11
|
+
* label="City"
|
|
12
|
+
* endPoint="/api/cities"
|
|
13
|
+
* getOptionLabel={(opt) => opt.name}
|
|
14
|
+
* isOptionEqualToValue={(opt, val) => opt.id === val.id}
|
|
15
|
+
* />
|
|
16
|
+
* ```
|
|
34
17
|
*/
|
|
35
|
-
export declare
|
|
18
|
+
export declare const RHFAutocompleteAsync: <T = unknown>(props: RHFAutocompleteAsyncProps<T> & {
|
|
19
|
+
ref?: Ref<HTMLInputElement | HTMLTextAreaElement>;
|
|
20
|
+
}) => JSX.Element;
|
|
36
21
|
//# sourceMappingURL=RHFAutocompleteAsync.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RHFAutocompleteAsync.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/hook-form/RHFAutocompleteAsync/RHFAutocompleteAsync.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RHFAutocompleteAsync.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/hook-form/RHFAutocompleteAsync/RHFAutocompleteAsync.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAG5B,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAIzD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,oBAAoB,EAA0C,CAAC,CAAC,GAAG,OAAO,EACrF,KAAK,EAAE,yBAAyB,CAAC,CAAC,CAAC,GAAG;IACpC,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,GAAG,mBAAmB,CAAC,CAAC;CACnD,KACE,GAAG,CAAC,OAAO,CAAC"}
|
|
@@ -1,96 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
import { actionsType as t } from "./types.js";
|
|
5
|
-
import { RHFAutocomplete as _ } from "../RHFAutocomplete/RHFAutocomplete.js";
|
|
6
|
-
import { RHFAutocompleteAsyncReducer as j, getInitialStateRHFAutocompleteAsync as q } from "./reducer/RHFAutocompleteReducer.js";
|
|
7
|
-
import { useFetchOptions as v } from "./hooks/useFetchOptions.js";
|
|
8
|
-
function B(p) {
|
|
9
|
-
const {
|
|
10
|
-
name: m,
|
|
11
|
-
endPoint: c,
|
|
12
|
-
label: d,
|
|
13
|
-
timeout: u = 5e3,
|
|
14
|
-
parms: i,
|
|
15
|
-
resultField: f = "data",
|
|
16
|
-
size: A,
|
|
17
|
-
isRemote: F = !0,
|
|
18
|
-
isExternalUrl: g = !1,
|
|
19
|
-
onChangeFilterParms: e,
|
|
20
|
-
getOptionLabel: h,
|
|
21
|
-
isOptionEqualToValue: R,
|
|
22
|
-
multiple: s,
|
|
23
|
-
disabled: C,
|
|
24
|
-
skeletonWidth: E,
|
|
25
|
-
responseToCamelCase: y,
|
|
26
|
-
startAdornment: O,
|
|
27
|
-
getOptionStartAdornment: b,
|
|
28
|
-
getOptionEndAdornment: P,
|
|
29
|
-
className: L
|
|
30
|
-
} = p, [n, o] = U(
|
|
31
|
-
j(e),
|
|
32
|
-
q({
|
|
33
|
-
parms: i,
|
|
34
|
-
onChangeFilterParms: e
|
|
35
|
-
})
|
|
36
|
-
);
|
|
37
|
-
if (s && e)
|
|
38
|
-
throw new Error("multiple no puede estar habilitado cuando se define onChangeFilterParms, definir el filtro en los parms, si es necesario");
|
|
39
|
-
v({
|
|
40
|
-
state: n,
|
|
41
|
-
dispatch: o,
|
|
42
|
-
endPoint: c,
|
|
43
|
-
timeout: u,
|
|
44
|
-
isExternalUrl: g,
|
|
45
|
-
parms: i,
|
|
46
|
-
responseToCamelCase: y,
|
|
47
|
-
isRemote: F,
|
|
48
|
-
resultField: f
|
|
49
|
-
});
|
|
50
|
-
const S = () => {
|
|
51
|
-
o({ type: t.REFRESH });
|
|
52
|
-
}, H = () => {
|
|
53
|
-
o({ type: t.OPEN });
|
|
54
|
-
}, T = () => {
|
|
55
|
-
o({ type: t.CLOSE });
|
|
56
|
-
}, a = l(
|
|
57
|
-
N((r) => {
|
|
58
|
-
o({
|
|
59
|
-
type: t.SET_QUERY_PARAMS,
|
|
60
|
-
payload: r
|
|
61
|
-
});
|
|
62
|
-
}, 300, {
|
|
63
|
-
// leading: true,
|
|
64
|
-
trailing: !0
|
|
65
|
-
}),
|
|
66
|
-
[o]
|
|
67
|
-
), x = l((r, k) => {
|
|
68
|
-
e && k === "input" && a(e(r));
|
|
69
|
-
}, [e, a]);
|
|
70
|
-
return /* @__PURE__ */ w(
|
|
71
|
-
_,
|
|
72
|
-
{
|
|
73
|
-
className: L,
|
|
74
|
-
name: m,
|
|
75
|
-
loading: n.loading,
|
|
76
|
-
label: d,
|
|
77
|
-
options: n.options,
|
|
78
|
-
onChangeFilterParmsLocal: e ? x : void 0,
|
|
79
|
-
size: A,
|
|
80
|
-
refresh: () => S(),
|
|
81
|
-
onOpen: H,
|
|
82
|
-
getOptionLabel: h,
|
|
83
|
-
isOptionEqualToValue: R,
|
|
84
|
-
multiple: s,
|
|
85
|
-
disabled: C,
|
|
86
|
-
onClose: T,
|
|
87
|
-
skeletonWidth: E,
|
|
88
|
-
startAdornment: O,
|
|
89
|
-
getOptionStartAdornment: b,
|
|
90
|
-
getOptionEndAdornment: P
|
|
91
|
-
}
|
|
92
|
-
);
|
|
93
|
-
}
|
|
1
|
+
import { AutocompleteAsync as o } from "../../extended/mui/AutocompleteAsync/AutocompleteAsync.js";
|
|
2
|
+
import { withRHFController as t } from "../../../hocs/withRHFController/index.js";
|
|
3
|
+
const e = t(o), r = e;
|
|
94
4
|
export {
|
|
95
|
-
|
|
5
|
+
r as RHFAutocompleteAsync
|
|
96
6
|
};
|
|
@@ -1,144 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { Theme } from '@mui/material';
|
|
5
|
-
import { M4LOverridesStyleRules } from '../../../@types/augmentations';
|
|
6
|
-
export type OnChangeFilterParms = (newValue: string) => Record<string, any>;
|
|
7
|
-
export interface RHFAutocompleteAsyncProps<T = unknown> extends Omit<RHFAutocompleteProps<T>, 'options' | 'onOpen' | 'onClose' | 'open' | 'multiple'> {
|
|
8
|
-
/**
|
|
9
|
-
* URL to fetch data from
|
|
10
|
-
*/
|
|
11
|
-
endPoint: string;
|
|
12
|
-
/**
|
|
13
|
-
* Whether the response should be converted to camel case
|
|
14
|
-
*/
|
|
15
|
-
responseToCamelCase?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Timeout for the fetch request
|
|
18
|
-
*/
|
|
19
|
-
timeout?: number;
|
|
20
|
-
/**
|
|
21
|
-
* Parameters to send with the fetch request
|
|
22
|
-
*/
|
|
23
|
-
parms?: Record<string, any>;
|
|
24
|
-
/**
|
|
25
|
-
* Whether the URL is external
|
|
26
|
-
*/
|
|
27
|
-
isExternalUrl?: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* Field in the response object that contains the data, normalmente data.
|
|
30
|
-
*/
|
|
31
|
-
resultField?: string;
|
|
32
|
-
/**
|
|
33
|
-
* Whether the data is fetched remotely
|
|
34
|
-
*/
|
|
35
|
-
isRemote?: boolean;
|
|
36
|
-
/**
|
|
37
|
-
* Callback for when the filter parameters change, or initial state.
|
|
38
|
-
*/
|
|
39
|
-
onChangeFilterParms?: OnChangeFilterParms;
|
|
40
|
-
/**
|
|
41
|
-
* Whether the autocomplete is multiple
|
|
42
|
-
*/
|
|
43
|
-
multiple?: boolean;
|
|
44
|
-
/**
|
|
45
|
-
* Class name for the autocomplete
|
|
46
|
-
*/
|
|
47
|
-
className?: string;
|
|
48
|
-
}
|
|
1
|
+
import { BaseRHFProps } from '../../../hocs/withRHFController/types';
|
|
2
|
+
import { AutocompleteAsyncProps } from '../../extended/mui/AutocompleteAsync/types';
|
|
3
|
+
export type { OnChangeFilterParms } from '../../extended/mui/AutocompleteAsync/types';
|
|
49
4
|
/**
|
|
50
|
-
*
|
|
5
|
+
* Props for RHFAutocompleteAsync (AutocompleteAsync wrapped with withRHFController).
|
|
6
|
+
* value and onChange are injected by the HOC from the form state.
|
|
51
7
|
*/
|
|
52
|
-
export type
|
|
53
|
-
/**
|
|
54
|
-
|
|
55
|
-
*/
|
|
56
|
-
export type RHFAutocompleteAsyncStyles = M4LOverridesStyleRules<RHFAutocompleteAsyncSlotsType, typeof RFHAUTOCOMPLETEASYNC_KEY_COMPONENT, Theme>;
|
|
57
|
-
/**
|
|
58
|
-
* Name of actions for reducer in RHFAutocompleteAsync component.
|
|
59
|
-
*/
|
|
60
|
-
export declare const actionsType: {
|
|
61
|
-
/**
|
|
62
|
-
* Refresh the options of the autocomplete, esta opcion es manual, por lo tanto debe forzar
|
|
63
|
-
* la recarga de las options.
|
|
64
|
-
*/
|
|
65
|
-
readonly REFRESH: "REFRESH";
|
|
66
|
-
/**
|
|
67
|
-
* Set the params to request the options. When the parms change, the options are requested again, and queryParams are rebuilt.
|
|
68
|
-
*/
|
|
69
|
-
readonly SET_PARAMS: "SET_PARAMS";
|
|
70
|
-
/**
|
|
71
|
-
* Set the query params to request the options with the new filter
|
|
72
|
-
* selected from the option listed in the autocomplete.
|
|
73
|
-
*/
|
|
74
|
-
readonly SET_QUERY_PARAMS: "SET_QUERY_PARAMS";
|
|
75
|
-
/**
|
|
76
|
-
* Indicate if the popover options are open.
|
|
77
|
-
*/
|
|
78
|
-
readonly OPEN: "OPEN";
|
|
79
|
-
/**
|
|
80
|
-
* Indicate if the popover options are close.
|
|
81
|
-
*/
|
|
82
|
-
readonly CLOSE: "CLOSE";
|
|
83
|
-
/**
|
|
84
|
-
* Reset the state options, allowFetchingOptionsAutocomplete (false)
|
|
85
|
-
* and loading (true) to initial state before fetching options
|
|
86
|
-
* to wait the response from the server.
|
|
87
|
-
*/
|
|
88
|
-
readonly START_FETCHING_OPTIONS: "START_FETCHING_OPTIONS";
|
|
89
|
-
/**
|
|
90
|
-
* Set new options to list in autocomplete.
|
|
91
|
-
* For example, when the user is typing,
|
|
92
|
-
* the options are filtered from the server and the new options are set to the list.
|
|
93
|
-
*/
|
|
94
|
-
readonly FINISH_LOAD_OPTIONS: "FINISH_LOAD_OPTIONS";
|
|
95
|
-
};
|
|
96
|
-
/**
|
|
97
|
-
* Action type for RHFAutocompleteAsync component.
|
|
98
|
-
*/
|
|
99
|
-
export type RHFAutocompleteAsyncAction<T> = {
|
|
100
|
-
type: typeof actionsType.REFRESH;
|
|
101
|
-
} | {
|
|
102
|
-
type: typeof actionsType.SET_QUERY_PARAMS;
|
|
103
|
-
payload: Record<string, any>;
|
|
104
|
-
} | {
|
|
105
|
-
type: typeof actionsType.FINISH_LOAD_OPTIONS;
|
|
106
|
-
payload: {
|
|
107
|
-
options?: Array<T>;
|
|
108
|
-
};
|
|
109
|
-
} | {
|
|
110
|
-
type: typeof actionsType.OPEN;
|
|
111
|
-
} | {
|
|
112
|
-
type: typeof actionsType.CLOSE;
|
|
113
|
-
} | {
|
|
114
|
-
type: typeof actionsType.SET_PARAMS;
|
|
115
|
-
payload: Record<string, any> | undefined;
|
|
116
|
-
};
|
|
117
|
-
/**
|
|
118
|
-
* State type for RHFAutocompleteAsync component.
|
|
119
|
-
*/
|
|
120
|
-
export type RHFAutocompleteAsyncState<T> = {
|
|
121
|
-
options: Array<T>;
|
|
122
|
-
loading: boolean;
|
|
123
|
-
parms?: Record<string, any>;
|
|
124
|
-
queryParams: Record<string, any>;
|
|
125
|
-
isOpen: boolean;
|
|
126
|
-
/**
|
|
127
|
-
* Indica si es la primera apertura el componente
|
|
128
|
-
*/
|
|
129
|
-
firstOpen: boolean;
|
|
130
|
-
/**
|
|
131
|
-
* Number of times the fetching is fired.
|
|
132
|
-
* the fetching count is incremented, useFetchOptions Effect is fired.
|
|
133
|
-
* When the fetching count is equal to 0, the fetching is not allowed.
|
|
134
|
-
*/
|
|
135
|
-
fireFetchCount: number;
|
|
136
|
-
};
|
|
137
|
-
/**
|
|
138
|
-
* Params for useFetchOptions hook.
|
|
139
|
-
*/
|
|
140
|
-
export interface UseFetchOptionsProps<T> extends Pick<RHFAutocompleteAsyncProps<T>, 'endPoint' | 'timeout' | 'isExternalUrl' | 'parms' | 'responseToCamelCase' | 'isRemote' | 'resultField'> {
|
|
141
|
-
state: RHFAutocompleteAsyncState<T>;
|
|
142
|
-
dispatch: (value: RHFAutocompleteAsyncAction<T>) => void;
|
|
143
|
-
}
|
|
8
|
+
export type RHFAutocompleteAsyncProps<T = unknown> = BaseRHFProps & Omit<AutocompleteAsyncProps<T>, 'value' | 'onChange'>;
|
|
9
|
+
/** Re-export for tests that assert reducer behavior. */
|
|
10
|
+
export { actionsType } from '../../extended/mui/AutocompleteAsync/types';
|
|
144
11
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/hook-form/RHFAutocompleteAsync/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/hook-form/RHFAutocompleteAsync/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AAEpF,YAAY,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AAEtF;;;GAGG;AACH,MAAM,MAAM,yBAAyB,CAAC,CAAC,GAAG,OAAO,IAAI,YAAY,GAC/D,IAAI,CAAC,sBAAsB,CAAC,CAAC,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC,CAAC;AAExD,wDAAwD;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,4CAA4C,CAAC"}
|