@m4l/components 9.4.17 → 9.4.19
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 +9 -2
- package/components/DaysOfWeekPicker/DaysOfWeekPicker.d.ts +33 -0
- package/components/DaysOfWeekPicker/DaysOfWeekPicker.js +81 -0
- package/components/DaysOfWeekPicker/DaysOfWeekPicker.styles.d.ts +2 -0
- package/components/DaysOfWeekPicker/DaysOfWeekPicker.styles.js +99 -0
- package/components/DaysOfWeekPicker/DaysOfWeekPicker.test.d.ts +1 -0
- package/components/DaysOfWeekPicker/constants.d.ts +12 -0
- package/components/DaysOfWeekPicker/constants.js +11 -0
- package/components/DaysOfWeekPicker/dictionary.d.ts +1 -0
- package/components/DaysOfWeekPicker/dictionary.js +6 -0
- package/components/DaysOfWeekPicker/helpers/getDaysOfWeekFromDictionary.d.ts +29 -0
- package/components/DaysOfWeekPicker/helpers/getDaysOfWeekFromDictionary.js +12 -0
- package/components/DaysOfWeekPicker/helpers/getDaysOfWeekFromDictionary.test.d.ts +1 -0
- package/components/DaysOfWeekPicker/helpers/index.d.ts +1 -0
- package/components/DaysOfWeekPicker/helpers/index.js +1 -0
- package/components/DaysOfWeekPicker/hooks/index.d.ts +2 -0
- package/components/DaysOfWeekPicker/hooks/types.d.ts +29 -0
- package/components/DaysOfWeekPicker/hooks/useDaysOfWeekPicker.d.ts +9 -0
- package/components/DaysOfWeekPicker/hooks/useDaysOfWeekPicker.js +71 -0
- package/components/DaysOfWeekPicker/hooks/useDaysOfWeekPicker.test.d.ts +1 -0
- package/components/DaysOfWeekPicker/index.d.ts +3 -0
- package/components/DaysOfWeekPicker/index.js +1 -0
- package/components/DaysOfWeekPicker/slots/DaysOfWeekPickerEnum.d.ts +5 -0
- package/components/DaysOfWeekPicker/slots/DaysOfWeekPickerEnum.js +9 -0
- package/components/DaysOfWeekPicker/slots/DaysOfWeekPickerSlots.d.ts +9 -0
- package/components/DaysOfWeekPicker/slots/DaysOfWeekPickerSlots.js +23 -0
- package/components/DaysOfWeekPicker/slots/index.d.ts +3 -0
- package/components/DaysOfWeekPicker/slots/index.js +1 -0
- package/components/DaysOfWeekPicker/types.d.ts +70 -0
- package/components/extended/React-resizable-panels/slots/SplitLayoutSlots.d.ts +2 -2
- package/components/hook-form/RHFDaysOfWeekPicker/RHFDaysOfWeekPicker.d.ts +26 -0
- package/components/hook-form/RHFDaysOfWeekPicker/RHFDaysOfWeekPicker.js +6 -0
- package/components/hook-form/RHFDaysOfWeekPicker/index.d.ts +1 -0
- package/components/hook-form/RHFDaysOfWeekPicker/index.js +1 -0
- package/components/hook-form/index.d.ts +1 -0
- package/components/index.d.ts +1 -0
- package/components/mui_extended/Autocomplete/Autocomplete.js +7 -3
- package/components/mui_extended/Autocomplete/Autocomplete.styles.js +76 -45
- package/components/mui_extended/Autocomplete/constants.d.ts +23 -0
- package/components/mui_extended/Autocomplete/constants.js +9 -1
- package/components/mui_extended/Autocomplete/hooks/useAutocomplete/useAutocomplete.js +9 -4
- package/components/mui_extended/Autocomplete/hooks/useEndAdornments.d.ts +5 -1
- package/components/mui_extended/Autocomplete/hooks/useEndAdornments.js +42 -10
- package/components/mui_extended/Autocomplete/hooks/useMultipleChips.js +25 -6
- package/components/mui_extended/Autocomplete/slots/AutocompleteEnum.d.ts +6 -1
- package/components/mui_extended/Autocomplete/slots/AutocompleteEnum.js +8 -1
- package/components/mui_extended/Autocomplete/slots/AutocompleteSlots.d.ts +3 -0
- package/components/mui_extended/Autocomplete/slots/AutocompleteSlots.js +9 -4
- package/components/mui_extended/Autocomplete/subcomponents/renderOptions/index.js +4 -3
- package/components/mui_extended/Autocomplete/types.d.ts +9 -2
- package/hocs/index.d.ts +2 -0
- package/hocs/withRHFController/constants.d.ts +8 -0
- package/hocs/withRHFController/constants.js +8 -0
- package/hocs/withRHFController/index.d.ts +37 -0
- package/hocs/withRHFController/index.js +95 -0
- package/hocs/withRHFController/slots/WithRHFControllerEnum.d.ts +3 -0
- package/hocs/withRHFController/slots/WithRHFControllerEnum.js +7 -0
- package/hocs/withRHFController/slots/WithRHFControllerSlots.d.ts +5 -0
- package/hocs/withRHFController/slots/WithRHFControllerSlots.js +11 -0
- package/hocs/withRHFController/slots/index.d.ts +2 -0
- package/hocs/withRHFController/slots/index.js +1 -0
- package/hocs/withRHFController/types.d.ts +70 -0
- package/hocs/withRHFController/withRHFController.styles.d.ts +5 -0
- package/hocs/withRHFController/withRHFController.styles.js +14 -0
- package/hocs/withRHFController/withRHFController.test.d.ts +1 -0
- package/index.js +111 -105
- package/package.json +1 -1
|
@@ -14,7 +14,7 @@ export declare const SplitLayoutRootStyled: import('@emotion/styled').StyledComp
|
|
|
14
14
|
} & import('react').RefAttributes<import('react-resizable-panels').ImperativePanelGroupHandle>, "children" | "title" | "storage" | "id" | "direction" | "color" | "content" | "translate" | "className" | "style" | "slot" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "hidden" | "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" | "autoSaveId" | "keyboardResizeBy" | "onLayout" | "tagName" | keyof import('react').RefAttributes<import('react-resizable-panels').ImperativePanelGroupHandle>> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
15
15
|
ownerState?: (Partial<import('../types').SplitLayoutOwnerState> & Record<string, unknown>) | undefined;
|
|
16
16
|
}, {}, {}>;
|
|
17
|
-
export declare const SplitMasterStyled: import('@emotion/styled').StyledComponent<Pick<Omit<import('react').HTMLAttributes<HTMLElement | HTMLDivElement | HTMLSpanElement | HTMLObjectElement | HTMLMapElement | HTMLLinkElement | HTMLTitleElement | HTMLInputElement | HTMLProgressElement | HTMLSelectElement | HTMLDataElement | HTMLHeadElement | HTMLBaseElement | HTMLHeadingElement | HTMLBodyElement | HTMLButtonElement |
|
|
17
|
+
export declare const SplitMasterStyled: import('@emotion/styled').StyledComponent<Pick<Omit<import('react').HTMLAttributes<HTMLElement | HTMLDivElement | HTMLSpanElement | HTMLObjectElement | HTMLMapElement | HTMLLinkElement | HTMLTitleElement | HTMLInputElement | HTMLProgressElement | HTMLSelectElement | HTMLDataElement | HTMLHeadElement | HTMLBaseElement | HTMLHeadingElement | HTMLBodyElement | HTMLButtonElement | HTMLTableElement | HTMLStyleElement | HTMLAnchorElement | HTMLAreaElement | HTMLAudioElement | HTMLQuoteElement | HTMLBRElement | HTMLCanvasElement | HTMLTableColElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDialogElement | HTMLDListElement | HTMLEmbedElement | HTMLFieldSetElement | HTMLFormElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLImageElement | HTMLLabelElement | HTMLLegendElement | HTMLLIElement | HTMLMetaElement | HTMLMeterElement | HTMLOListElement | HTMLOptGroupElement | HTMLOptionElement | HTMLOutputElement | HTMLParagraphElement | HTMLPreElement | HTMLSlotElement | HTMLScriptElement | HTMLSourceElement | HTMLTemplateElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTextAreaElement | HTMLTimeElement | HTMLTableRowElement | HTMLTrackElement | HTMLUListElement | HTMLVideoElement | HTMLTableCaptionElement | HTMLMenuElement | HTMLPictureElement>, "id" | "onResize"> & {
|
|
18
18
|
className?: string | undefined;
|
|
19
19
|
collapsedSize?: number | undefined;
|
|
20
20
|
collapsible?: boolean | undefined;
|
|
@@ -33,7 +33,7 @@ export declare const SplitMasterStyled: import('@emotion/styled').StyledComponen
|
|
|
33
33
|
} & import('react').RefAttributes<import('react-resizable-panels').ImperativePanelHandle>, "children" | "title" | "id" | "color" | "content" | "order" | "translate" | "className" | "style" | "slot" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "hidden" | "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" | "defaultSize" | "onResize" | "minSize" | "maxSize" | "tagName" | "collapsedSize" | "collapsible" | "onCollapse" | "onExpand" | keyof import('react').RefAttributes<import('react-resizable-panels').ImperativePanelHandle>> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
34
34
|
ownerState?: (Partial<import('../types').SplitLayoutOwnerState> & Record<string, unknown>) | undefined;
|
|
35
35
|
}, {}, {}>;
|
|
36
|
-
export declare const SplitDetailStyled: import('@emotion/styled').StyledComponent<Pick<Omit<import('react').HTMLAttributes<HTMLElement | HTMLDivElement | HTMLSpanElement | HTMLObjectElement | HTMLMapElement | HTMLLinkElement | HTMLTitleElement | HTMLInputElement | HTMLProgressElement | HTMLSelectElement | HTMLDataElement | HTMLHeadElement | HTMLBaseElement | HTMLHeadingElement | HTMLBodyElement | HTMLButtonElement |
|
|
36
|
+
export declare const SplitDetailStyled: import('@emotion/styled').StyledComponent<Pick<Omit<import('react').HTMLAttributes<HTMLElement | HTMLDivElement | HTMLSpanElement | HTMLObjectElement | HTMLMapElement | HTMLLinkElement | HTMLTitleElement | HTMLInputElement | HTMLProgressElement | HTMLSelectElement | HTMLDataElement | HTMLHeadElement | HTMLBaseElement | HTMLHeadingElement | HTMLBodyElement | HTMLButtonElement | HTMLTableElement | HTMLStyleElement | HTMLAnchorElement | HTMLAreaElement | HTMLAudioElement | HTMLQuoteElement | HTMLBRElement | HTMLCanvasElement | HTMLTableColElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDialogElement | HTMLDListElement | HTMLEmbedElement | HTMLFieldSetElement | HTMLFormElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLImageElement | HTMLLabelElement | HTMLLegendElement | HTMLLIElement | HTMLMetaElement | HTMLMeterElement | HTMLOListElement | HTMLOptGroupElement | HTMLOptionElement | HTMLOutputElement | HTMLParagraphElement | HTMLPreElement | HTMLSlotElement | HTMLScriptElement | HTMLSourceElement | HTMLTemplateElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTextAreaElement | HTMLTimeElement | HTMLTableRowElement | HTMLTrackElement | HTMLUListElement | HTMLVideoElement | HTMLTableCaptionElement | HTMLMenuElement | HTMLPictureElement>, "id" | "onResize"> & {
|
|
37
37
|
className?: string | undefined;
|
|
38
38
|
collapsedSize?: number | undefined;
|
|
39
39
|
collapsible?: boolean | undefined;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Componente RHFDaysOfWeekPicker que integra DaysOfWeekPicker con react-hook-form.
|
|
3
|
+
*
|
|
4
|
+
* Este componente permite seleccionar días de la semana en un formulario controlado
|
|
5
|
+
* por react-hook-form, proporcionando validación automática y manejo de estados.
|
|
6
|
+
*
|
|
7
|
+
* ### Características:
|
|
8
|
+
* - **Integración con RHF**: Se integra automáticamente con react-hook-form mediante el HOC withRHFController
|
|
9
|
+
* - **Validación**: Soporta validación mediante esquemas de validación (Yup, Zod, etc.)
|
|
10
|
+
* - **Estados del formulario**: Se deshabilita automáticamente durante el envío del formulario
|
|
11
|
+
* - **Label y errores**: El HOC maneja automáticamente el Label y los mensajes de error
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* const schema = Yup.object({
|
|
15
|
+
* days: Yup.array().min(1, 'Debe seleccionar al menos un día').required('Campo requerido'),
|
|
16
|
+
* });
|
|
17
|
+
*
|
|
18
|
+
* <RHFDaysOfWeekPicker
|
|
19
|
+
* name="days"
|
|
20
|
+
* label="Días de la semana"
|
|
21
|
+
* mandatory
|
|
22
|
+
* disabledDays={[6]} // Deshabilita domingo
|
|
23
|
+
* />
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare const RHFDaysOfWeekPicker: import('react').ForwardRefExoticComponent<Omit<import('../../DaysOfWeekPicker').DaysOfWeekPickerProps & import('react').RefAttributes<HTMLDivElement> & import('../../../hocs').BaseRHFProps<import('react-hook-form').FieldValues>, "ref"> & import('react').RefAttributes<any>>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { w as withRHFController } from "../../../hocs/withRHFController/index.js";
|
|
2
|
+
import { D as DaysOfWeekPicker } from "../../DaysOfWeekPicker/DaysOfWeekPicker.js";
|
|
3
|
+
const RHFDaysOfWeekPicker = withRHFController(DaysOfWeekPicker);
|
|
4
|
+
export {
|
|
5
|
+
RHFDaysOfWeekPicker as R
|
|
6
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RHFDaysOfWeekPicker } from './RHFDaysOfWeekPicker';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -8,6 +8,7 @@ export * from './RHFCheckableList';
|
|
|
8
8
|
export { RHFDateTime } from './RHFDateTime';
|
|
9
9
|
export { RHFDateTimePicker } from './RHFDateTimePicker';
|
|
10
10
|
export { RHFDatePicker } from './RHFDatePicker';
|
|
11
|
+
export * from './RHFDaysOfWeekPicker';
|
|
11
12
|
export { RHFMultiCheckbox } from './RHFMultiCheckbox';
|
|
12
13
|
export { RHFSelect } from './RHFSelect';
|
|
13
14
|
export { RHFHelperError } from './RHFHelperError';
|
package/components/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export * from './CommonActions/';
|
|
|
14
14
|
export * from './ContainerFlow';
|
|
15
15
|
export * from './CommonActions/dictionary';
|
|
16
16
|
export * from './datagrids';
|
|
17
|
+
export * from './DaysOfWeekPicker';
|
|
17
18
|
export * from './DragResizeWindowRND';
|
|
18
19
|
export * from './DynamicFilter';
|
|
19
20
|
export * from './DynamicSort';
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import { u as useAutocomplete } from "./hooks/useAutocomplete/useAutocomplete.js";
|
|
4
|
+
import { A as AUTOCOMPLETE_CLASSES } from "./constants.js";
|
|
5
|
+
import clsx from "clsx";
|
|
4
6
|
import { S as SkeletonAutocompleteStyled, A as AutocompleteRootStyled } from "./slots/AutocompleteSlots.js";
|
|
5
7
|
import { P as PopperComponent } from "./subcomponents/PopperComponent/PopperComponent.js";
|
|
6
8
|
import { N as NoOptionsText } from "./subcomponents/NoOptionsText/NoOptionsText.js";
|
|
@@ -11,7 +13,8 @@ function AutocompleteComponent(props, ref) {
|
|
|
11
13
|
disabled,
|
|
12
14
|
loading,
|
|
13
15
|
onChangeFilterParmsLocal,
|
|
14
|
-
multiple
|
|
16
|
+
multiple,
|
|
17
|
+
className
|
|
15
18
|
} = props;
|
|
16
19
|
const {
|
|
17
20
|
// propiedades de useAutocomplete
|
|
@@ -37,19 +40,20 @@ function AutocompleteComponent(props, ref) {
|
|
|
37
40
|
return /* @__PURE__ */ jsx(
|
|
38
41
|
SkeletonAutocompleteStyled,
|
|
39
42
|
{
|
|
40
|
-
ownerState
|
|
43
|
+
ownerState
|
|
41
44
|
}
|
|
42
45
|
);
|
|
43
46
|
}
|
|
44
47
|
return /* @__PURE__ */ jsx(
|
|
45
48
|
AutocompleteRootStyled,
|
|
46
49
|
{
|
|
47
|
-
ownerState
|
|
50
|
+
ownerState,
|
|
48
51
|
multiple,
|
|
49
52
|
onKeyDown: checkKeyDown,
|
|
50
53
|
size: currentSize,
|
|
51
54
|
ref,
|
|
52
55
|
forcePopupIcon: false,
|
|
56
|
+
className: clsx(className, multiple && AUTOCOMPLETE_CLASSES.multiple),
|
|
53
57
|
autoSelect: false,
|
|
54
58
|
options,
|
|
55
59
|
getOptionLabel: getOptionLabelLocal,
|
|
@@ -1,22 +1,39 @@
|
|
|
1
|
+
import { k as keyframes } from "../../../not_recognized/index.js";
|
|
1
2
|
import { g as getSizeStyles } from "../../../utils/getSizeStyles/getSizeStyles.js";
|
|
3
|
+
import { A as AUTOCOMPLETE_CLASSES } from "./constants.js";
|
|
4
|
+
const rotate360 = keyframes`
|
|
5
|
+
from {
|
|
6
|
+
transform: rotate(0deg);
|
|
7
|
+
}
|
|
8
|
+
to {
|
|
9
|
+
transform: rotate(360deg);
|
|
10
|
+
}
|
|
11
|
+
`;
|
|
2
12
|
const autocompleteSyles = {
|
|
3
13
|
/**
|
|
4
14
|
* Styles for the root component.
|
|
5
15
|
*/
|
|
6
|
-
root: ({ theme }) =>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
root: ({ theme, ownerState }) => {
|
|
17
|
+
return {
|
|
18
|
+
width: "100%",
|
|
19
|
+
padding: 0,
|
|
20
|
+
"& .M4LImage-root": {
|
|
21
|
+
width: theme.vars.size.baseSpacings["sp3-5"],
|
|
22
|
+
height: theme.vars.size.baseSpacings["sp3-5"]
|
|
23
|
+
},
|
|
24
|
+
"& .MuiInputBase-input": {
|
|
25
|
+
...ownerState?.multiple && {
|
|
26
|
+
gridArea: "c",
|
|
27
|
+
marginTop: theme.vars.size.baseSpacings.sp1,
|
|
28
|
+
marginBottom: theme.vars.size.baseSpacings.sp1
|
|
29
|
+
},
|
|
30
|
+
"&::placeholder": {
|
|
31
|
+
color: theme.vars.palette.text.disabled,
|
|
32
|
+
opacity: 1
|
|
33
|
+
}
|
|
17
34
|
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
35
|
+
};
|
|
36
|
+
},
|
|
20
37
|
/**
|
|
21
38
|
* Styles for the icon button component.
|
|
22
39
|
*/
|
|
@@ -32,19 +49,23 @@ const autocompleteSyles = {
|
|
|
32
49
|
backgroundColor: "unset!important",
|
|
33
50
|
outline: "none!important"
|
|
34
51
|
}
|
|
52
|
+
},
|
|
53
|
+
// Animación de rotación para el botón de refresh
|
|
54
|
+
[`&.${AUTOCOMPLETE_CLASSES.refreshRotating}`]: {
|
|
55
|
+
"& .M4LIcon-icon": {
|
|
56
|
+
animation: `${rotate360} 0.6s ease-in-out`
|
|
57
|
+
}
|
|
35
58
|
}
|
|
36
59
|
}),
|
|
37
60
|
/**
|
|
38
61
|
* Styles for the input component.
|
|
39
62
|
*/
|
|
40
|
-
adorments: ({
|
|
63
|
+
adorments: ({ ownerState }) => ({
|
|
41
64
|
display: "flex",
|
|
42
65
|
alignItems: "center",
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
top: 0,
|
|
47
|
-
bottom: 0
|
|
66
|
+
...ownerState?.multiple && {
|
|
67
|
+
gridArea: "d"
|
|
68
|
+
}
|
|
48
69
|
}),
|
|
49
70
|
/**
|
|
50
71
|
* Styles for the typography component.
|
|
@@ -81,20 +102,20 @@ const autocompleteSyles = {
|
|
|
81
102
|
* Styles for the text field component.
|
|
82
103
|
*/
|
|
83
104
|
textField: ({ theme, ownerState }) => {
|
|
84
|
-
const sp1 = theme?.vars?.size?.baseSpacings?.sp1 || "4px";
|
|
85
|
-
const sp5 = theme?.vars?.size?.baseSpacings?.sp5 || "16px";
|
|
86
|
-
const sp7 = theme?.vars?.size?.baseSpacings?.sp7 || "24px";
|
|
87
105
|
return {
|
|
88
106
|
height: "auto !important",
|
|
89
107
|
position: "relative",
|
|
90
108
|
"&& .MuiInputBase-root": {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
109
|
+
gap: theme.vars.size.baseSpacings.sp1,
|
|
110
|
+
...ownerState?.multiple && {
|
|
111
|
+
gap: "unset",
|
|
112
|
+
display: "grid",
|
|
113
|
+
columnGap: theme.vars.size.baseSpacings.sp1,
|
|
114
|
+
gridTemplateColumns: "auto 1fr auto",
|
|
115
|
+
gridTemplateAreas: ownerState?.hasChips ? `"a b d"
|
|
116
|
+
"a c d"` : `"a c d"
|
|
117
|
+
"a c d"`
|
|
95
118
|
},
|
|
96
|
-
gap: sp1,
|
|
97
|
-
flexWrap: "wrap",
|
|
98
119
|
"&& > input": {
|
|
99
120
|
width: "100%",
|
|
100
121
|
textOverflow: "ellipsis",
|
|
@@ -156,13 +177,20 @@ const autocompleteSyles = {
|
|
|
156
177
|
/**
|
|
157
178
|
* Styles for the container multiple values component.
|
|
158
179
|
*/
|
|
159
|
-
containerMultipleValues: () =>
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
180
|
+
containerMultipleValues: ({ theme, ownerState }) => {
|
|
181
|
+
return {
|
|
182
|
+
display: "flex",
|
|
183
|
+
overflow: "auto",
|
|
184
|
+
width: "100%",
|
|
185
|
+
flex: 1,
|
|
186
|
+
maxHeight: "80px",
|
|
187
|
+
marginTop: theme.vars.size.baseSpacings.sp1,
|
|
188
|
+
marginBottom: theme.vars.size.baseSpacings.sp1,
|
|
189
|
+
...ownerState?.multiple && {
|
|
190
|
+
gridArea: "b"
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
},
|
|
166
194
|
/**
|
|
167
195
|
* Styles for the container wrapper component.
|
|
168
196
|
*/
|
|
@@ -174,21 +202,24 @@ const autocompleteSyles = {
|
|
|
174
202
|
/**
|
|
175
203
|
* Styles for the wrapper start adornment component.
|
|
176
204
|
*/
|
|
177
|
-
wrapperStartAdornment: ({ theme }) => {
|
|
178
|
-
const sp1 = theme?.vars?.size?.baseSpacings?.sp1 || "4px";
|
|
205
|
+
wrapperStartAdornment: ({ theme, ownerState }) => {
|
|
179
206
|
return {
|
|
180
207
|
width: "fit-content",
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
left: 0,
|
|
208
|
+
...ownerState?.multiple && {
|
|
209
|
+
gridArea: "a"
|
|
210
|
+
},
|
|
185
211
|
display: "flex",
|
|
186
|
-
|
|
212
|
+
gap: theme.vars.size.baseSpacings.sp3,
|
|
187
213
|
justifyContent: "center",
|
|
188
|
-
alignItems: "center"
|
|
189
|
-
padding: `0px ${sp1}`
|
|
214
|
+
alignItems: "center"
|
|
190
215
|
};
|
|
191
|
-
}
|
|
216
|
+
},
|
|
217
|
+
/**
|
|
218
|
+
* Styles for the wrapper end adornment component.
|
|
219
|
+
*/
|
|
220
|
+
wrapperEndAdornment: ({ theme }) => ({
|
|
221
|
+
marginRight: theme.vars.size.baseSpacings.sp3
|
|
222
|
+
})
|
|
192
223
|
};
|
|
193
224
|
export {
|
|
194
225
|
autocompleteSyles as a
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AutocompleteComplementaryClasses, AutocompleteSlots } from './slots/AutocompleteEnum';
|
|
1
2
|
/**
|
|
2
3
|
* Clave de identificación del componente Autocomplete dentro del sistema.
|
|
3
4
|
*
|
|
@@ -7,3 +8,25 @@
|
|
|
7
8
|
*/
|
|
8
9
|
export declare const AUTOCOMPLETE_KEY_COMPONENT = "M4LAutocomplete";
|
|
9
10
|
export declare const AUTOCOMPLETE_CLASS_NAME_SPECIFY = "M4LclasssAutocompleCssSpecificity";
|
|
11
|
+
export declare const AUTCOMPLETE_COMBINED_CLASSES: {
|
|
12
|
+
multiple: AutocompleteComplementaryClasses.multiple;
|
|
13
|
+
refreshRotating: AutocompleteComplementaryClasses.refreshRotating;
|
|
14
|
+
root: AutocompleteSlots.root;
|
|
15
|
+
chip: AutocompleteSlots.chip;
|
|
16
|
+
popper: AutocompleteSlots.popper;
|
|
17
|
+
typography: AutocompleteSlots.typography;
|
|
18
|
+
adorments: AutocompleteSlots.adorments;
|
|
19
|
+
iconButton: AutocompleteSlots.iconButton;
|
|
20
|
+
menuItem: AutocompleteSlots.menuItem;
|
|
21
|
+
menuList: AutocompleteSlots.menuList;
|
|
22
|
+
skeletonAutocomplete: AutocompleteSlots.skeletonAutocomplete;
|
|
23
|
+
circularProgress: AutocompleteSlots.circularProgress;
|
|
24
|
+
textField: AutocompleteSlots.textField;
|
|
25
|
+
image: AutocompleteSlots.image;
|
|
26
|
+
renderInputText: AutocompleteSlots.renderInputText;
|
|
27
|
+
containerMultipleValues: AutocompleteSlots.containerMultipleValues;
|
|
28
|
+
containerWrapper: AutocompleteSlots.containerWrapper;
|
|
29
|
+
wrapperStartAdornment: AutocompleteSlots.wrapperStartAdornment;
|
|
30
|
+
wrapperEndAdornment: AutocompleteSlots.wrapperEndAdornment;
|
|
31
|
+
};
|
|
32
|
+
export declare const AUTOCOMPLETE_CLASSES: Record<"menuItem" | "typography" | "image" | "root" | "popper" | "multiple" | "menuList" | "iconButton" | "circularProgress" | "chip" | "adorments" | "skeletonAutocomplete" | "textField" | "renderInputText" | "containerMultipleValues" | "containerWrapper" | "wrapperStartAdornment" | "wrapperEndAdornment" | "refreshRotating", string>;
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
+
import { g as getComponentClasses } from "../../../utils/getComponentSlotRoot.js";
|
|
2
|
+
import { A as AutocompleteComplementaryClasses, a as AutocompleteSlots } from "./slots/AutocompleteEnum.js";
|
|
1
3
|
const AUTOCOMPLETE_KEY_COMPONENT = "M4LAutocomplete";
|
|
4
|
+
const AUTCOMPLETE_COMBINED_CLASSES = {
|
|
5
|
+
...AutocompleteSlots,
|
|
6
|
+
...AutocompleteComplementaryClasses
|
|
7
|
+
};
|
|
8
|
+
const AUTOCOMPLETE_CLASSES = getComponentClasses(AUTOCOMPLETE_KEY_COMPONENT, AUTCOMPLETE_COMBINED_CLASSES);
|
|
2
9
|
export {
|
|
3
|
-
|
|
10
|
+
AUTOCOMPLETE_CLASSES as A,
|
|
11
|
+
AUTOCOMPLETE_KEY_COMPONENT as a
|
|
4
12
|
};
|
|
@@ -41,6 +41,7 @@ function useAutocomplete(props) {
|
|
|
41
41
|
const { currentSize } = useComponentSize(size);
|
|
42
42
|
const isSkeleton = useModuleSkeleton();
|
|
43
43
|
const hasStartAdornment = !!props.startAdornment;
|
|
44
|
+
const hasChips = Boolean(multiple && Array.isArray(selectedValue) && selectedValue.length > 0);
|
|
44
45
|
const ownerState = useMemo(() => ({
|
|
45
46
|
size: currentSize,
|
|
46
47
|
variant,
|
|
@@ -48,8 +49,9 @@ function useAutocomplete(props) {
|
|
|
48
49
|
multiple: Boolean(multiple),
|
|
49
50
|
error,
|
|
50
51
|
readOnly,
|
|
51
|
-
startAdornment: hasStartAdornment
|
|
52
|
-
|
|
52
|
+
startAdornment: hasStartAdornment,
|
|
53
|
+
hasChips
|
|
54
|
+
}), [currentSize, variant, disabled, multiple, error, readOnly, hasStartAdornment, hasChips]);
|
|
53
55
|
const multipleChips = useMultipleChips({
|
|
54
56
|
selectedValue,
|
|
55
57
|
multiple,
|
|
@@ -71,7 +73,10 @@ function useAutocomplete(props) {
|
|
|
71
73
|
disabled,
|
|
72
74
|
onOpenLocal,
|
|
73
75
|
open,
|
|
74
|
-
readOnly
|
|
76
|
+
readOnly,
|
|
77
|
+
multiple,
|
|
78
|
+
selectedValue,
|
|
79
|
+
getOptionEndAdornment
|
|
75
80
|
});
|
|
76
81
|
const memoizedRenderOption = useCallback((renderProps, option) => {
|
|
77
82
|
const isSelected = multiple ? Array.isArray(selectedValue) && selectedValue.some((val) => isOptionEqualToValueLocal(option, val)) : isOptionEqualToValueLocal(option, selectedValue);
|
|
@@ -100,7 +105,7 @@ function useAutocomplete(props) {
|
|
|
100
105
|
RenderInputStyled,
|
|
101
106
|
{
|
|
102
107
|
variant,
|
|
103
|
-
ownerState
|
|
108
|
+
ownerState,
|
|
104
109
|
InputLabelProps: {
|
|
105
110
|
...InputLabelProps,
|
|
106
111
|
shrink: true
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { AutocompleteOwnerState, ResourceType } from '../types';
|
|
2
3
|
export type UseAdornmentsProps = {
|
|
3
4
|
loading?: boolean;
|
|
4
5
|
adjustedSize: 'small' | 'medium';
|
|
@@ -9,6 +10,9 @@ export type UseAdornmentsProps = {
|
|
|
9
10
|
onOpenLocal: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
10
11
|
open: boolean;
|
|
11
12
|
readOnly?: boolean;
|
|
13
|
+
multiple?: boolean;
|
|
14
|
+
selectedValue: any | any[] | null;
|
|
15
|
+
getOptionEndAdornment?: (option: any) => ResourceType;
|
|
12
16
|
};
|
|
13
17
|
/**
|
|
14
18
|
* Hook para el componente Autocomplete local
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useMemo } from "react";
|
|
3
|
+
import { r as renderAdornment } from "../subcomponents/RenderAdornment/RenderAdornment.js";
|
|
4
|
+
import { A as AUTOCOMPLETE_CLASSES } from "../constants.js";
|
|
2
5
|
import { ArrowRefreshSmOutlined, ArrowChevronSmDownOutlined } from "@m4l/icons";
|
|
3
|
-
import { a as AdormentsStyled, C as CircularProgressStyled, I as IconButtonStyled } from "../slots/AutocompleteSlots.js";
|
|
6
|
+
import { a as AdormentsStyled, W as WrapperEndAdornmentStyled, C as CircularProgressStyled, I as IconButtonStyled } from "../slots/AutocompleteSlots.js";
|
|
4
7
|
function useEndAdornments(props) {
|
|
5
8
|
const {
|
|
6
9
|
loading,
|
|
@@ -11,32 +14,61 @@ function useEndAdornments(props) {
|
|
|
11
14
|
disabled,
|
|
12
15
|
onOpenLocal,
|
|
13
16
|
open,
|
|
14
|
-
readOnly
|
|
17
|
+
readOnly,
|
|
18
|
+
multiple,
|
|
19
|
+
selectedValue,
|
|
20
|
+
getOptionEndAdornment
|
|
15
21
|
} = props;
|
|
16
|
-
|
|
22
|
+
const [isRotating, setIsRotating] = useState(false);
|
|
23
|
+
const handleRefreshWithAnimation = () => {
|
|
24
|
+
setIsRotating(true);
|
|
25
|
+
handleRefresh();
|
|
26
|
+
setTimeout(() => {
|
|
27
|
+
setIsRotating(false);
|
|
28
|
+
}, 600);
|
|
29
|
+
};
|
|
30
|
+
const memoizedEndAdornment = useMemo(() => {
|
|
31
|
+
if (multiple || !selectedValue || Array.isArray(selectedValue) && selectedValue.length === 0) {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
const selectedOption = Array.isArray(selectedValue) ? selectedValue[0] : selectedValue;
|
|
35
|
+
const endAdornmentResource = getOptionEndAdornment?.(selectedOption);
|
|
36
|
+
if (endAdornmentResource) {
|
|
37
|
+
return renderAdornment(endAdornmentResource, adjustedSize);
|
|
38
|
+
}
|
|
39
|
+
return null;
|
|
40
|
+
}, [
|
|
41
|
+
multiple,
|
|
42
|
+
selectedValue,
|
|
43
|
+
getOptionEndAdornment,
|
|
44
|
+
adjustedSize
|
|
45
|
+
]);
|
|
46
|
+
return /* @__PURE__ */ jsxs(AdormentsStyled, { ownerState, children: [
|
|
47
|
+
!multiple && memoizedEndAdornment && /* @__PURE__ */ jsx(WrapperEndAdornmentStyled, { children: memoizedEndAdornment }),
|
|
17
48
|
loading ? /* @__PURE__ */ jsx(
|
|
18
49
|
CircularProgressStyled,
|
|
19
50
|
{
|
|
20
|
-
ownerState
|
|
51
|
+
ownerState,
|
|
21
52
|
size: adjustedSize
|
|
22
53
|
}
|
|
23
54
|
) : refresh ? /* @__PURE__ */ jsx(
|
|
24
55
|
IconButtonStyled,
|
|
25
56
|
{
|
|
26
|
-
ownerState
|
|
57
|
+
ownerState,
|
|
27
58
|
src: /* @__PURE__ */ jsx(ArrowRefreshSmOutlined, {}),
|
|
28
|
-
onClick: !readOnly ?
|
|
29
|
-
disabled,
|
|
30
|
-
size: adjustedSize
|
|
59
|
+
onClick: !readOnly ? handleRefreshWithAnimation : void 0,
|
|
60
|
+
disabled: disabled || readOnly,
|
|
61
|
+
size: adjustedSize,
|
|
62
|
+
className: isRotating ? AUTOCOMPLETE_CLASSES.refreshRotating : ""
|
|
31
63
|
}
|
|
32
64
|
) : null,
|
|
33
65
|
/* @__PURE__ */ jsx(
|
|
34
66
|
IconButtonStyled,
|
|
35
67
|
{
|
|
36
|
-
ownerState
|
|
68
|
+
ownerState,
|
|
37
69
|
icon: /* @__PURE__ */ jsx(ArrowChevronSmDownOutlined, {}),
|
|
38
70
|
onClick: (event) => !readOnly ? onOpenLocal(event) : void 0,
|
|
39
|
-
disabled,
|
|
71
|
+
disabled: disabled || readOnly,
|
|
40
72
|
size: adjustedSize,
|
|
41
73
|
rotationAngle: open ? 180 : 0,
|
|
42
74
|
"aria-label": "toggle Autocomplete"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import React, { useMemo } from "react";
|
|
3
3
|
import { r as renderAdornment } from "../subcomponents/RenderAdornment/RenderAdornment.js";
|
|
4
|
-
import { b as ContainerMultipleValuesStyled, c as ContainerWrapperStyled, d as ChipStyled,
|
|
4
|
+
import { b as ContainerMultipleValuesStyled, c as ContainerWrapperStyled, d as ChipStyled, e as WrapperStartAdornmentStyled } from "../slots/AutocompleteSlots.js";
|
|
5
5
|
function useMultipleChips(props) {
|
|
6
6
|
const {
|
|
7
7
|
selectedValue,
|
|
@@ -53,11 +53,27 @@ function useMultipleChips(props) {
|
|
|
53
53
|
getOptionEndAdornment,
|
|
54
54
|
adjustedSize
|
|
55
55
|
]);
|
|
56
|
+
const memoizedStartAdornment = useMemo(() => {
|
|
57
|
+
if (multiple || !selectedValue || Array.isArray(selectedValue) && selectedValue.length === 0) {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
const selectedOption = Array.isArray(selectedValue) ? selectedValue[0] : selectedValue;
|
|
61
|
+
const startAdornmentResource = getOptionStartAdornment?.(selectedOption);
|
|
62
|
+
if (startAdornmentResource) {
|
|
63
|
+
return renderAdornment(startAdornmentResource, adjustedSize);
|
|
64
|
+
}
|
|
65
|
+
return null;
|
|
66
|
+
}, [
|
|
67
|
+
multiple,
|
|
68
|
+
selectedValue,
|
|
69
|
+
getOptionStartAdornment,
|
|
70
|
+
adjustedSize
|
|
71
|
+
]);
|
|
56
72
|
const internalAdornments = useMemo(() => {
|
|
57
|
-
if (!(Array.isArray(selectedValue) && multiple)) {
|
|
73
|
+
if (!(Array.isArray(selectedValue) && multiple && selectedValue.length > 0)) {
|
|
58
74
|
return null;
|
|
59
75
|
}
|
|
60
|
-
return /* @__PURE__ */ jsx(ContainerMultipleValuesStyled, { role: "list", "aria-label": "Selected options", children: /* @__PURE__ */ jsx(ContainerWrapperStyled, { children: selectedValue.map((option, index) => {
|
|
76
|
+
return /* @__PURE__ */ jsx(ContainerMultipleValuesStyled, { ownerState, role: "list", "aria-label": "Selected options", children: /* @__PURE__ */ jsx(ContainerWrapperStyled, { children: selectedValue.map((option, index) => {
|
|
61
77
|
const optionKey = getOptionLabelLocal(option);
|
|
62
78
|
return /* @__PURE__ */ jsx(
|
|
63
79
|
ChipStyled,
|
|
@@ -67,7 +83,7 @@ function useMultipleChips(props) {
|
|
|
67
83
|
opacity: true,
|
|
68
84
|
onDeleted: () => handleDelete(option),
|
|
69
85
|
disabledDeleteButton: disabled,
|
|
70
|
-
ownerState
|
|
86
|
+
ownerState,
|
|
71
87
|
startIcon: memoizedIcons?.get(`${optionKey}-start`),
|
|
72
88
|
endIcon: memoizedIcons?.get(`${optionKey}-end`)
|
|
73
89
|
},
|
|
@@ -86,12 +102,15 @@ function useMultipleChips(props) {
|
|
|
86
102
|
]);
|
|
87
103
|
if (startAdornmentClone && internalAdornments) {
|
|
88
104
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
89
|
-
/* @__PURE__ */ jsx(WrapperStartAdornmentStyled, { role: "img", "aria-hidden": "true", children: startAdornmentClone }),
|
|
105
|
+
/* @__PURE__ */ jsx(WrapperStartAdornmentStyled, { role: "img", "aria-hidden": "true", ownerState, children: startAdornmentClone }),
|
|
90
106
|
internalAdornments
|
|
91
107
|
] });
|
|
92
108
|
}
|
|
93
109
|
if (startAdornmentClone) {
|
|
94
|
-
return /* @__PURE__ */
|
|
110
|
+
return /* @__PURE__ */ jsxs(WrapperStartAdornmentStyled, { role: "img", "aria-hidden": "true", ownerState, children: [
|
|
111
|
+
startAdornmentClone,
|
|
112
|
+
!multiple && memoizedStartAdornment
|
|
113
|
+
] });
|
|
95
114
|
}
|
|
96
115
|
if (!getOptionLabelLocal) {
|
|
97
116
|
console.error("useStartAdornments: getOptionLabelLocal is required");
|
|
@@ -14,5 +14,10 @@ export declare enum AutocompleteSlots {
|
|
|
14
14
|
renderInputText = "renderInputText",
|
|
15
15
|
containerMultipleValues = "containerMultipleValues",
|
|
16
16
|
containerWrapper = "containerWrapper",
|
|
17
|
-
wrapperStartAdornment = "wrapperStartAdornment"
|
|
17
|
+
wrapperStartAdornment = "wrapperStartAdornment",
|
|
18
|
+
wrapperEndAdornment = "wrapperEndAdornment"
|
|
19
|
+
}
|
|
20
|
+
export declare enum AutocompleteComplementaryClasses {
|
|
21
|
+
multiple = "multiple",
|
|
22
|
+
refreshRotating = "refresh-rotating"
|
|
18
23
|
}
|
|
@@ -15,8 +15,15 @@ var AutocompleteSlots = /* @__PURE__ */ ((AutocompleteSlots2) => {
|
|
|
15
15
|
AutocompleteSlots2["containerMultipleValues"] = "containerMultipleValues";
|
|
16
16
|
AutocompleteSlots2["containerWrapper"] = "containerWrapper";
|
|
17
17
|
AutocompleteSlots2["wrapperStartAdornment"] = "wrapperStartAdornment";
|
|
18
|
+
AutocompleteSlots2["wrapperEndAdornment"] = "wrapperEndAdornment";
|
|
18
19
|
return AutocompleteSlots2;
|
|
19
20
|
})(AutocompleteSlots || {});
|
|
21
|
+
var AutocompleteComplementaryClasses = /* @__PURE__ */ ((AutocompleteComplementaryClasses2) => {
|
|
22
|
+
AutocompleteComplementaryClasses2["multiple"] = "multiple";
|
|
23
|
+
AutocompleteComplementaryClasses2["refreshRotating"] = "refresh-rotating";
|
|
24
|
+
return AutocompleteComplementaryClasses2;
|
|
25
|
+
})(AutocompleteComplementaryClasses || {});
|
|
20
26
|
export {
|
|
21
|
-
|
|
27
|
+
AutocompleteComplementaryClasses as A,
|
|
28
|
+
AutocompleteSlots as a
|
|
22
29
|
};
|
|
@@ -48,3 +48,6 @@ export declare const ContainerMultipleValuesStyled: import('@emotion/styled').St
|
|
|
48
48
|
export declare const ContainerWrapperStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
49
49
|
ownerState?: (Partial<import('../types').AutocompleteOwnerState> & Record<string, unknown>) | undefined;
|
|
50
50
|
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
51
|
+
export declare const WrapperEndAdornmentStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
52
|
+
ownerState?: (Partial<import('../types').AutocompleteOwnerState> & Record<string, unknown>) | undefined;
|
|
53
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|