@m4l/components 9.3.34 → 9.3.35-BE20251129-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/export.d.ts +6 -0
- package/@types/types.d.ts +51 -5
- package/components/AccountPopover/AccountPopover.styles.js +5 -2
- package/components/AccountPopover/slots/AccountPopoverSlots.d.ts +6 -6
- package/components/ActionsGroup/ActionsGroup.d.ts +5 -0
- package/components/ActionsGroup/ActionsGroup.js +40 -0
- package/components/ActionsGroup/ActionsGroup.styles.d.ts +2 -0
- package/components/ActionsGroup/ActionsGroup.styles.js +95 -0
- package/components/ActionsGroup/__tests__/ActionsGroup.test.d.ts +1 -0
- package/components/ActionsGroup/constants.d.ts +2 -0
- package/components/ActionsGroup/constants.js +8 -0
- package/components/ActionsGroup/icons.d.ts +3 -0
- package/components/ActionsGroup/icons.js +6 -0
- package/components/ActionsGroup/index.d.ts +1 -0
- package/components/ActionsGroup/index.js +1 -0
- package/components/ActionsGroup/slots/ActionsGroupEnum.d.ts +8 -0
- package/components/ActionsGroup/slots/ActionsGroupEnum.js +12 -0
- package/components/ActionsGroup/slots/ActionsGroupSlots.d.ts +15 -0
- package/components/ActionsGroup/slots/ActionsGroupSlots.js +35 -0
- package/components/ActionsGroup/subcomponents/ActionIconButton/ActionIconButton.d.ts +6 -0
- package/components/ActionsGroup/subcomponents/ActionIconButton/ActionIconButton.js +76 -0
- package/components/ActionsGroup/subcomponents/ActionIconButton/types.d.ts +7 -0
- package/components/ActionsGroup/types.d.ts +60 -0
- package/components/AppBar/slots/AppBarSlots.d.ts +1 -1
- package/components/Chip/slots/ChipSlots.d.ts +2 -2
- package/components/CommonActions/components/ActionCancel/slots/ActionsCancelSlots.d.ts +1 -1
- package/components/CommonActions/components/ActionFormCancel/slots/ActionFormCancelSlots.d.ts +1 -1
- package/components/CommonActions/components/ActionIntro/slots/ActionsIntroSlots.d.ts +1 -1
- package/components/CommonActions/components/ActionsContainer/slots/ActionsContainerSlots.d.ts +1 -1
- package/components/DataGrid/DataGrid.js +2 -0
- package/components/DataGrid/Datagrid.styles.js +12 -2
- package/components/DataGrid/contexts/DataGridContext/index.js +2 -0
- package/components/DataGrid/contexts/DataGridContext/types.d.ts +2 -2
- package/components/DataGrid/formatters/ColumnImageFormatter/ImageFormatterCell.d.ts +13 -0
- package/components/DataGrid/formatters/ColumnImageFormatter/ImageFormatterCell.js +33 -0
- package/components/DataGrid/formatters/ColumnImageFormatter/constants.d.ts +6 -0
- package/components/DataGrid/formatters/ColumnImageFormatter/constants.js +6 -0
- package/components/DataGrid/formatters/ColumnImageFormatter/formatter.d.ts +8 -0
- package/components/DataGrid/formatters/ColumnImageFormatter/formatter.js +25 -0
- package/components/DataGrid/formatters/ColumnImageFormatter/index.d.ts +3 -0
- package/components/DataGrid/formatters/ColumnImageFormatter/index.js +1 -0
- package/components/DataGrid/formatters/ColumnImageFormatter/tests/ColumnImageFormatter.test.d.ts +1 -0
- package/components/DataGrid/formatters/ColumnImageFormatter/types.d.ts +44 -0
- package/components/DataGrid/formatters/ColumnImageFormatter/types.js +1 -0
- package/components/DataGrid/formatters/ColumnImageFormatter/useColumnImage.d.ts +9 -0
- package/components/DataGrid/formatters/ColumnImageFormatter/useColumnImage.js +22 -0
- package/components/DataGrid/formatters/index.d.ts +1 -0
- package/components/DataGrid/subcomponents/Cards/helpers/scrollToCardElement.js +2 -2
- package/components/DataGrid/subcomponents/Cards/index.js +16 -3
- package/components/DataGrid/subcomponents/Cards/subcomponents/CardHeader/index.js +15 -7
- package/components/DataGrid/subcomponents/Cards/subcomponents/CardRow/index.js +1 -0
- package/components/DataGrid/subcomponents/CheckboxCellAdapter/index.js +4 -1
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Density/index.js +0 -3
- package/components/DataGrid/subcomponents/Table/hooks/useSortColumnsRows.js +6 -2
- package/components/DataGrid/subcomponents/Table/index.js +10 -1
- package/components/DataGrid/subcomponents/Table/subcomponents/ActionsColumn.js +0 -3
- package/components/DataGrid/subcomponents/Table/subcomponents/RadioButtonFormatter.d.ts +6 -0
- package/components/DataGrid/subcomponents/Table/subcomponents/RadioButtonFormatter.js +12 -0
- package/components/DataGrid/subcomponents/Table/subcomponents/RadioSelectColumn.d.ts +64 -0
- package/components/DataGrid/subcomponents/Table/subcomponents/RadioSelectColumn.js +46 -0
- package/components/DataGrid/tests/helpers/types.d.ts +10 -0
- package/components/DataGrid/tests/table/subcomponents/RadioButtonFormatter.test.d.ts +1 -0
- package/components/DataGrid/tests/table/subcomponents/RadioSelectColumn.test.d.ts +1 -0
- package/components/DataGrid/types.d.ts +7 -0
- package/components/DynamicFilter/DynamicFilter.styles.js +5 -2
- package/components/DynamicFilter/slots/dynamicFilterSlots.d.ts +2 -2
- package/components/DynamicSort/DynamicSort.styles.js +5 -2
- package/components/DynamicSort/slots/DynamicSortSlots.d.ts +2 -2
- package/components/EditLabel/constants.d.ts +1 -1
- package/components/EditLabel/slots/EditLabelSlots.d.ts +4 -4
- package/components/GridLayout/styles.js +0 -1
- package/components/HelperError/slots/HelperErrorSlots.d.ts +1 -1
- package/components/ImageText/constants.d.ts +1 -1
- package/components/ImageText/slots/ImageTextSlots.d.ts +2 -2
- package/components/Label/index.d.ts +1 -1
- package/components/Label/slots/LabelSlots.d.ts +3 -3
- package/components/Label/types.d.ts +6 -0
- package/components/LanguagePopover/slots/LanguagePopoverSlots.d.ts +1 -1
- package/components/LoadingError/slots/LoadingErrorSlots.d.ts +1 -1
- package/components/MFLoader/styles.js +0 -1
- package/components/MenuActions/slots/MenuActionsSlots.d.ts +2 -2
- package/components/ModalDialog/ModalDialog.styles.js +8 -1
- package/components/ModalDialog/slots/ModalDialogSlots.d.ts +2 -2
- package/components/NumberInput/slots/NumberInputSlots.d.ts +2 -2
- package/components/ObjectLogs/slots/ObjectLogsSlots.d.ts +1 -1
- package/components/Pager/slots/PagerSlots.d.ts +3 -3
- package/components/PaperForm/slots/PaperFormSlots.d.ts +1 -1
- package/components/PrintingSystem/PrintingSystem.js +3 -1
- package/components/PrintingSystem/PrintingSystem.styles.js +179 -2
- package/components/SettingsLayout/slots/SettingsLayoutSlots.d.ts +3 -3
- package/components/SideBar/slots/SideBarSlots.d.ts +1 -1
- package/components/SideBar/subcomponents/SideBarMobile/index.js +0 -3
- package/components/Stepper/slots/StepperSlot.d.ts +4 -4
- package/components/TabsNavigator/slots/TabsNavigatorSlots.d.ts +12 -12
- package/components/ToastContainer/slots/toastContainerSlots.d.ts +4 -4
- package/components/WindowBase/WindowBase.styles.js +8 -0
- package/components/WindowBase/slots/WindowBaseSlots.d.ts +2 -2
- package/components/WindowBase/subcomponents/Header/useButtonActions.js +23 -13
- package/components/animate/variants/background.d.ts +9 -9
- package/components/animate/variants/bounce.d.ts +9 -9
- package/components/animate/variants/fade.d.ts +20 -20
- package/components/animate/variants/flip.d.ts +6 -6
- package/components/animate/variants/rotate.d.ts +3 -3
- package/components/animate/variants/scale.d.ts +6 -6
- package/components/animate/variants/slide.d.ts +16 -16
- package/components/animate/variants/transition.d.ts +3 -3
- package/components/animate/variants/zoom.d.ts +15 -15
- package/components/areas/components/AreasAdmin/slots/AreasAdminSlots.d.ts +3 -3
- package/components/commercial/AppBarCommercial/styles.js +1 -3
- package/components/commercial/HamburgerMenu/styles.js +1 -3
- package/components/commercial/SectionCommercial/styles.js +1 -3
- package/components/commercial/TopBar/component/ConteinItem/subcomponets/NavItem/index.js +1 -3
- package/components/commercial/TopBar/style.js +1 -3
- package/components/extended/React-Resizable/Resizable/slots/ResizableSlots.d.ts +1 -1
- package/components/extended/React-Resizable/ResizableBox/slots/ResizableBoxSlots.d.ts +1 -1
- package/components/extended/React-resizable-panels/slots/SplitLayoutSlots.d.ts +6 -6
- package/components/formatters/BooleanFormatter/slots/BooleanFormatterSlots.d.ts +1 -1
- package/components/formatters/ConcatenatedFormatter/slots/ConcatenatedFormatterSlots.d.ts +1 -1
- package/components/formatters/DateFormatter/slots/DateFormatterSlots.d.ts +1 -1
- package/components/formatters/DistanceToNowFormatter/slots/DistanceToNowFormatterSlots.d.ts +1 -1
- package/components/formatters/ImageFormatter/ImageFormatter.d.ts +10 -0
- package/components/formatters/ImageFormatter/ImageFormatter.js +72 -0
- package/components/formatters/ImageFormatter/ImageFormatter.styles.d.ts +2 -0
- package/components/formatters/ImageFormatter/ImageFormatter.styles.js +42 -0
- package/components/formatters/ImageFormatter/constants.d.ts +5 -0
- package/components/formatters/ImageFormatter/constants.js +10 -0
- package/components/formatters/ImageFormatter/index.d.ts +2 -0
- package/components/formatters/ImageFormatter/index.js +1 -0
- package/components/formatters/ImageFormatter/slots/ImageFormatterEnum.d.ts +5 -0
- package/components/formatters/ImageFormatter/slots/ImageFormatterEnum.js +9 -0
- package/components/formatters/ImageFormatter/slots/ImageFormatterSlots.d.ts +9 -0
- package/components/formatters/ImageFormatter/slots/ImageFormatterSlots.js +23 -0
- package/components/formatters/ImageFormatter/tests/ImageFormatter.test.d.ts +1 -0
- package/components/formatters/ImageFormatter/types.d.ts +51 -0
- package/components/formatters/ImageFormatter/types.js +1 -0
- package/components/formatters/PeriodFormatter/slots/PeriodFormatterSlots.d.ts +1 -1
- package/components/formatters/PointsFormatter/slots/ointsFormatterSlots.d.ts +1 -1
- package/components/formatters/PriceFormatter/slots/PriceFormatterSlots.d.ts +1 -1
- package/components/formatters/UncertaintyFormatter/slots/UncertaintyFormatterSlots.d.ts +1 -1
- package/components/formatters/index.d.ts +1 -0
- package/components/hook-form/RHFActionsGroup/RHFActionsGroup.d.ts +7 -0
- package/components/hook-form/RHFActionsGroup/RHFActionsGroup.js +87 -0
- package/components/hook-form/RHFActionsGroup/RHFActionsGroupStyles.d.ts +2 -0
- package/components/hook-form/RHFActionsGroup/RHFActionsGroupStyles.js +14 -0
- package/components/hook-form/RHFActionsGroup/constants.d.ts +9 -0
- package/components/hook-form/RHFActionsGroup/constants.js +8 -0
- package/components/hook-form/RHFActionsGroup/index.d.ts +2 -0
- package/components/hook-form/RHFActionsGroup/index.js +1 -0
- package/components/hook-form/RHFActionsGroup/slots/RHFActionsGroupEnum.d.ts +3 -0
- package/components/hook-form/RHFActionsGroup/slots/RHFActionsGroupEnum.js +7 -0
- package/components/hook-form/RHFActionsGroup/slots/RHFActionsGroupSlots.d.ts +1 -0
- package/components/hook-form/RHFActionsGroup/slots/RHFActionsGroupSlots.js +11 -0
- package/components/hook-form/RHFActionsGroup/slots/index.d.ts +2 -0
- package/components/hook-form/RHFActionsGroup/slots/index.js +1 -0
- package/components/hook-form/RHFActionsGroup/tests/RHFActionsGroup.test.d.ts +1 -0
- package/components/hook-form/RHFActionsGroup/tests/common.d.ts +28 -0
- package/components/hook-form/RHFActionsGroup/types.d.ts +54 -0
- package/components/hook-form/RHFCheckbox/slots/RHFCheckBoxSlots.d.ts +1 -1
- package/components/hook-form/RHFColorPicker/slots/RHFColorPickerSlots.d.ts +1 -1
- package/components/hook-form/RHFPeriod/slots/RHFPeriodSlots.d.ts +1 -1
- package/components/hook-form/RHFSelect/constants.d.ts +1 -1
- package/components/hook-form/RHFSelect/slots/RHFSlots.d.ts +1 -1
- package/components/hook-form/RHFTextField/slots/RHFTextFieldSlots.d.ts +1 -1
- package/components/hook-form/RHFTextFieldPassword/slots/RHFTextFieldPasswordSlots.d.ts +2 -2
- package/components/hook-form/RHFUpload/RHFUploadImage/slots/RHFUploadImageSlots.d.ts +3 -3
- package/components/hook-form/RHFUpload/RHFUploadSingleFile/constants.d.ts +1 -1
- package/components/hook-form/RHFUpload/RHFUploadSingleFile/slots/RHFUploadSingleFileSlots.d.ts +7 -7
- package/components/hook-form/RHFormProvider/classes/index.d.ts +1 -1
- package/components/hook-form/RHFormProvider/styles.js +4 -3
- package/components/hook-form/index.d.ts +1 -0
- package/components/index.d.ts +1 -0
- package/components/mui_extended/Accordion/slots/AccordionSlots.d.ts +3 -3
- package/components/mui_extended/Accordion/styles.js +9 -5
- package/components/mui_extended/Autocomplete/Autocomplete.styles.js +11 -1
- package/components/mui_extended/Autocomplete/slots/AutocompleteSlots.d.ts +6 -6
- package/components/mui_extended/Avatar/slots/AvatarSlots.d.ts +1 -1
- package/components/mui_extended/Badge/slots/BadgeSlots.d.ts +1 -1
- package/components/mui_extended/Button/slots/ButtonSlots.d.ts +2 -2
- package/components/mui_extended/CheckBox/slots/CheckBoxSlots.d.ts +2 -2
- package/components/mui_extended/DateTimePicker/DateTimePicker.styles.js +5 -1
- package/components/mui_extended/DateTimePicker/slots/DateTimePickerSlots.d.ts +4 -4
- package/components/mui_extended/Divider/slots/DividerSlots.d.ts +1 -1
- package/components/mui_extended/IconButton/constants.d.ts +1 -1
- package/components/mui_extended/IconButton/slots/IconButtonSlots.d.ts +1 -1
- package/components/mui_extended/ImageButton/styles.js +1 -3
- package/components/mui_extended/LoadingButton/slots/LoadingButtonSlots.d.ts +1 -1
- package/components/mui_extended/MenuDivider/slots/MenuDividerSlots.d.ts +1 -1
- package/components/mui_extended/MenuItem/slots/MenuItemSlots.d.ts +2 -2
- package/components/mui_extended/NavLink/slots/NavLinkSlots.d.ts +1 -1
- package/components/mui_extended/Popper/slots/PopperStlots.d.ts +1 -1
- package/components/mui_extended/RadioButton/RadioButton.d.ts +24 -0
- package/components/mui_extended/RadioButton/RadioButton.js +110 -0
- package/components/mui_extended/RadioButton/RadioButton.styles.d.ts +2 -0
- package/components/mui_extended/RadioButton/RadioButton.styles.js +126 -0
- package/components/mui_extended/RadioButton/constants.d.ts +1 -0
- package/components/mui_extended/RadioButton/constants.js +4 -0
- package/components/mui_extended/RadioButton/icons.d.ts +4 -0
- package/components/mui_extended/RadioButton/icons.js +7 -0
- package/components/mui_extended/RadioButton/index.d.ts +1 -0
- package/components/mui_extended/RadioButton/index.js +1 -0
- package/components/mui_extended/RadioButton/slots/RadioButtonEnum.d.ts +8 -0
- package/components/mui_extended/RadioButton/slots/RadioButtonEnum.js +12 -0
- package/components/mui_extended/RadioButton/slots/RadioButtonSlots.d.ts +20 -0
- package/components/mui_extended/RadioButton/slots/RadioButtonSlots.js +39 -0
- package/components/mui_extended/RadioButton/tests/RadioButton.test.d.ts +1 -0
- package/components/mui_extended/RadioButton/types.d.ts +50 -0
- package/components/mui_extended/Select/Select.js +2 -18
- package/components/mui_extended/Select/Select.styles.js +33 -1
- package/components/mui_extended/Select/constants.d.ts +2 -1
- package/components/mui_extended/Select/slots/SelectEnum.d.ts +2 -1
- package/components/mui_extended/Select/slots/SelectEnum.js +1 -0
- package/components/mui_extended/Select/slots/SelectSlots.d.ts +5 -5
- package/components/mui_extended/Skeleton/Slots/skeletonSlots.d.ts +1 -1
- package/components/mui_extended/Stack/slots/StackSlot.d.ts +1 -1
- package/components/mui_extended/Tab/Slots/TabSlots.d.ts +2 -2
- package/components/mui_extended/Tabs/slots/TabsSlots.d.ts +1 -1
- package/components/mui_extended/TextField/TextField.styles.js +2 -1
- package/components/mui_extended/TextField/slots/TextFieldSlots.d.ts +4 -4
- package/components/mui_extended/TimePicker/slots/TimePickerSlots.d.ts +3 -3
- package/components/mui_extended/ToggleButton/slots/ToggleButtonSlots.d.ts +1 -1
- package/components/mui_extended/ToggleIconButton/slots/ToggleIconButtonSlots.d.ts +1 -1
- package/components/mui_extended/Tooltip/Tooltip.styles.js +22 -4
- package/components/mui_extended/Tooltip/constants.d.ts +1 -1
- package/components/mui_extended/Typography/slots/typographySlots.d.ts +1 -1
- package/components/mui_extended/index.d.ts +1 -0
- package/index.js +143 -131
- package/package.json +3 -3
package/components/CommonActions/components/ActionsContainer/slots/ActionsContainerSlots.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
declare const ActionsContainerRoot: import('@emotion/styled').StyledComponent<Pick<import('@mui/system').BoxOwnProps<import('@mui/material').Theme> & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
2
2
|
ref?: ((instance: HTMLDivElement | null) => void | import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import('react').RefObject<HTMLDivElement> | null | undefined;
|
|
3
|
-
}, keyof import('@mui/system').BoxOwnProps<import('@mui/material').Theme>>, "title" | "id" | "
|
|
3
|
+
}, keyof import('@mui/system').BoxOwnProps<import('@mui/material').Theme>>, "title" | "id" | "content" | "translate" | "className" | "style" | "slot" | "key" | "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" | keyof import('@mui/system').BoxOwnProps<import('@mui/material').Theme>> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown>, {}, {}>;
|
|
4
4
|
export { ActionsContainerRoot };
|
|
@@ -30,6 +30,7 @@ function DataGrid(props) {
|
|
|
30
30
|
initialRowHeightVariant,
|
|
31
31
|
checkedRows,
|
|
32
32
|
onCheckedRowsChange,
|
|
33
|
+
checkedRowsMultiple,
|
|
33
34
|
dataTestId = "",
|
|
34
35
|
customHeader: CustomHeader,
|
|
35
36
|
visibleCustomHeader = true,
|
|
@@ -87,6 +88,7 @@ function DataGrid(props) {
|
|
|
87
88
|
checkedRows,
|
|
88
89
|
rowActionsGetter,
|
|
89
90
|
onCheckedRowsChange,
|
|
91
|
+
checkedRowsMultiple,
|
|
90
92
|
rowKeyGetter,
|
|
91
93
|
rows,
|
|
92
94
|
onChangeUserColumns,
|
|
@@ -270,6 +270,7 @@ const dataGridStyles = {
|
|
|
270
270
|
border: theme.vars.size.borderStroke.container,
|
|
271
271
|
borderColor: theme.vars.palette?.border.secondary,
|
|
272
272
|
"& .rdg ": {
|
|
273
|
+
scrollBehavior: "smooth",
|
|
273
274
|
display: "grid",
|
|
274
275
|
contain: "content",
|
|
275
276
|
boxSizing: "border-box",
|
|
@@ -423,6 +424,10 @@ const dataGridStyles = {
|
|
|
423
424
|
borderColor: `${theme.vars.palette?.border.disabled} !important`,
|
|
424
425
|
...theme.colorSchemes.finalTheme.typography.body
|
|
425
426
|
},
|
|
427
|
+
"&:has(> .M4LRadioButton-root)": {
|
|
428
|
+
overflow: "visible",
|
|
429
|
+
paddingInline: 0
|
|
430
|
+
},
|
|
426
431
|
"&.rdg-cell-frozen": {
|
|
427
432
|
display: "flex",
|
|
428
433
|
boxShadow: "unset",
|
|
@@ -733,7 +738,10 @@ const dataGridStyles = {
|
|
|
733
738
|
*/
|
|
734
739
|
cardsContainer: () => ({
|
|
735
740
|
height: "auto",
|
|
736
|
-
overflow: "auto"
|
|
741
|
+
overflow: "auto",
|
|
742
|
+
"& > .M4LContainerFlow-root": {
|
|
743
|
+
alignItems: "start"
|
|
744
|
+
}
|
|
737
745
|
}),
|
|
738
746
|
/**
|
|
739
747
|
* Card de la vista cards
|
|
@@ -745,6 +753,8 @@ const dataGridStyles = {
|
|
|
745
753
|
minWidth: "280px",
|
|
746
754
|
maxWidth: "580px",
|
|
747
755
|
cursor: "pointer",
|
|
756
|
+
padding: theme.vars.size.baseSpacings["sp2-5"],
|
|
757
|
+
gap: "0 !important",
|
|
748
758
|
// Si está checked (pero no selected), border de checked
|
|
749
759
|
...ownerState?.checked && !ownerState?.selected && {
|
|
750
760
|
borderColor: theme.vars.palette.primary.activeOpacity
|
|
@@ -785,7 +795,7 @@ const dataGridStyles = {
|
|
|
785
795
|
cardHeaderRight: ({ theme }) => ({
|
|
786
796
|
display: "flex",
|
|
787
797
|
alignItems: "center",
|
|
788
|
-
gap: theme.vars.size.baseSpacings
|
|
798
|
+
gap: theme.vars.size.baseSpacings["sp0-5"]
|
|
789
799
|
}),
|
|
790
800
|
/**
|
|
791
801
|
* Contenido de la card (body)
|
|
@@ -155,6 +155,7 @@ function DataGridProvider(props) {
|
|
|
155
155
|
initialRowHeightVariant = "standard",
|
|
156
156
|
checkedRows,
|
|
157
157
|
onCheckedRowsChange,
|
|
158
|
+
checkedRowsMultiple,
|
|
158
159
|
rowKeyGetter,
|
|
159
160
|
onChangeUserColumns,
|
|
160
161
|
externalSortSettings: sortSettings,
|
|
@@ -530,6 +531,7 @@ function DataGridProvider(props) {
|
|
|
530
531
|
rowActionsGetter,
|
|
531
532
|
setRowHeightVariant: setCurrentRowHeightInternal,
|
|
532
533
|
onCheckedRowsChange,
|
|
534
|
+
checkedRowsMultiple,
|
|
533
535
|
rowKeyGetter,
|
|
534
536
|
onChangeUserColumns,
|
|
535
537
|
sortColumns,
|
|
@@ -79,7 +79,7 @@ export interface IGridConfig {
|
|
|
79
79
|
export interface IGridConfigExtended extends IGridConfig {
|
|
80
80
|
columnsConfigCards?: BaseConfigColumnCards[];
|
|
81
81
|
}
|
|
82
|
-
export interface DataGridProviderProps<TRow, TSummaryRow, TKey extends RowKey = RowKey> extends Pick<GridProps<TRow, TSummaryRow, TKey>, 'rows' | 'columns' | 'rowActionsGetter' | 'rowHeaderHeights' | 'rowHeights' | 'initialRowHeightVariant' | 'checkedRows' | 'onCheckedRowsChange' | 'rowKeyGetter' | 'onChangeUserColumns' | 'defaultUserColumns' | 'externalSortSettings' | 'externalFilterSettings' | 'defaultViewMode' | 'cardsViewConfig'> {
|
|
82
|
+
export interface DataGridProviderProps<TRow, TSummaryRow, TKey extends RowKey = RowKey> extends Pick<GridProps<TRow, TSummaryRow, TKey>, 'rows' | 'columns' | 'rowActionsGetter' | 'rowHeaderHeights' | 'rowHeights' | 'initialRowHeightVariant' | 'checkedRows' | 'onCheckedRowsChange' | 'checkedRowsMultiple' | 'rowKeyGetter' | 'onChangeUserColumns' | 'defaultUserColumns' | 'externalSortSettings' | 'externalFilterSettings' | 'defaultViewMode' | 'cardsViewConfig'> {
|
|
83
83
|
id: number | string;
|
|
84
84
|
children: ReactNode;
|
|
85
85
|
rowsCount: number;
|
|
@@ -92,7 +92,7 @@ export type RowHeightState = {
|
|
|
92
92
|
rowHeight: number;
|
|
93
93
|
rowHeaderHeight: number;
|
|
94
94
|
};
|
|
95
|
-
export interface DataGridContextProps<TRow, TSummaryRow, TKey extends RowKey = RowKey> extends Pick<DataGridProviderProps<TRow, TSummaryRow, TKey>, 'rows' | 'checkedRows' | 'onCheckedRowsChange' | 'rowHeights' | 'rowsCount' | 'rowActionsGetter' | 'rowKeyGetter' | 'onChangeUserColumns' | 'externalSortSettings' | 'externalFilterSettings' | 'viewMode' | 'onViewModeChange' | 'defaultViewMode' | 'cardsViewConfig'> {
|
|
95
|
+
export interface DataGridContextProps<TRow, TSummaryRow, TKey extends RowKey = RowKey> extends Pick<DataGridProviderProps<TRow, TSummaryRow, TKey>, 'rows' | 'checkedRows' | 'onCheckedRowsChange' | 'checkedRowsMultiple' | 'rowHeights' | 'rowsCount' | 'rowActionsGetter' | 'rowKeyGetter' | 'onChangeUserColumns' | 'externalSortSettings' | 'externalFilterSettings' | 'viewMode' | 'onViewModeChange' | 'defaultViewMode' | 'cardsViewConfig'> {
|
|
96
96
|
getConfigColumns: (viewMode: ViewMode) => IViewConfig[];
|
|
97
97
|
onChangeColumnsConfig: (viewMode: ViewMode, config: IViewConfig[]) => void;
|
|
98
98
|
onChangeColumnsOrder: (viewMode: ViewMode, sourceKey: string, targetKey: string) => void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ColumnImageFormatterProps } from './types';
|
|
2
|
+
import { RenderCellProps } from 'react-data-grid';
|
|
3
|
+
/**
|
|
4
|
+
* Componente interno que renderiza la celda y puede usar hooks
|
|
5
|
+
*/
|
|
6
|
+
export declare function ImageFormatterCell<TRow>(props: {
|
|
7
|
+
formatterProps: RenderCellProps<TRow>;
|
|
8
|
+
fieldValue: ColumnImageFormatterProps<TRow>['fieldValue'];
|
|
9
|
+
fieldText: ColumnImageFormatterProps<TRow>['fieldText'];
|
|
10
|
+
width?: ColumnImageFormatterProps<TRow>['width'];
|
|
11
|
+
height?: ColumnImageFormatterProps<TRow>['height'];
|
|
12
|
+
cover?: ColumnImageFormatterProps<TRow>['cover'];
|
|
13
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useContext } from "react";
|
|
3
|
+
import { getPropertyByString } from "@m4l/core";
|
|
4
|
+
import { I as IMAGE_SIZES } from "./constants.js";
|
|
5
|
+
import { a as DataGridContext } from "../../contexts/DataGridContext/index.js";
|
|
6
|
+
import { I as ImageFormatter } from "../../../formatters/ImageFormatter/ImageFormatter.js";
|
|
7
|
+
function ImageFormatterCell(props) {
|
|
8
|
+
const { formatterProps, fieldValue, fieldText, width, height, cover } = props;
|
|
9
|
+
const context = useContext(DataGridContext);
|
|
10
|
+
const viewMode = context?.viewMode ?? "cards";
|
|
11
|
+
const hasCustomSize = width !== void 0 && height !== void 0;
|
|
12
|
+
const finalWidth = viewMode === "cards" && hasCustomSize ? width : viewMode === "cards" ? IMAGE_SIZES.cards : void 0;
|
|
13
|
+
const finalHeight = viewMode === "cards" && hasCustomSize ? height : viewMode === "cards" ? IMAGE_SIZES.cards : void 0;
|
|
14
|
+
const src = getPropertyByString(formatterProps.row, fieldValue) ?? void 0;
|
|
15
|
+
const text = fieldText ? getPropertyByString(formatterProps.row, fieldText) ?? void 0 : void 0;
|
|
16
|
+
if (!src) {
|
|
17
|
+
return /* @__PURE__ */ jsx(Fragment, { children: "-" });
|
|
18
|
+
}
|
|
19
|
+
return /* @__PURE__ */ jsx(
|
|
20
|
+
ImageFormatter,
|
|
21
|
+
{
|
|
22
|
+
src,
|
|
23
|
+
alt: text || src,
|
|
24
|
+
width: finalWidth,
|
|
25
|
+
height: finalHeight,
|
|
26
|
+
text,
|
|
27
|
+
cover
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
ImageFormatterCell as I
|
|
33
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RenderCellProps } from 'react-data-grid';
|
|
2
|
+
import { ColumnImageFormatterProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Formatter para mostrar imágenes con o sin texto
|
|
5
|
+
* @param props - Propiedades del formatter
|
|
6
|
+
* @returns Función que recibe RenderCellProps y retorna el ImageFormatter
|
|
7
|
+
*/
|
|
8
|
+
export declare function ColumnImageFormatter<TRow>(props: ColumnImageFormatterProps<TRow>): (formatterProps: RenderCellProps<TRow>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { I as ImageFormatterCell } from "./ImageFormatterCell.js";
|
|
3
|
+
function ColumnImageFormatter(props) {
|
|
4
|
+
const { fieldValue, fieldText, cover } = props;
|
|
5
|
+
const width = "width" in props && props.width !== void 0 ? props.width : void 0;
|
|
6
|
+
const height = "height" in props && props.height !== void 0 ? props.height : void 0;
|
|
7
|
+
const formatter = (formatterProps) => {
|
|
8
|
+
return /* @__PURE__ */ jsx(
|
|
9
|
+
ImageFormatterCell,
|
|
10
|
+
{
|
|
11
|
+
formatterProps,
|
|
12
|
+
fieldValue,
|
|
13
|
+
fieldText,
|
|
14
|
+
width,
|
|
15
|
+
height,
|
|
16
|
+
cover
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
formatter.__imageFormatterHeight = height ?? 60;
|
|
21
|
+
return formatter;
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
ColumnImageFormatter as C
|
|
25
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/components/DataGrid/formatters/ColumnImageFormatter/tests/ColumnImageFormatter.test.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { DeepKeyOf } from '../../../../utils/types';
|
|
2
|
+
interface ColumnImageFormatterBaseProps<TRow> {
|
|
3
|
+
/**
|
|
4
|
+
* Campo del row que contiene la URL de la imagen
|
|
5
|
+
*/
|
|
6
|
+
fieldValue: DeepKeyOf<TRow>;
|
|
7
|
+
/**
|
|
8
|
+
* Campo opcional del row que contiene el texto a mostrar junto a la imagen
|
|
9
|
+
*/
|
|
10
|
+
fieldText?: DeepKeyOf<TRow>;
|
|
11
|
+
/**
|
|
12
|
+
* Si es true, la imagen usa object-fit: cover (recorta si es necesario)
|
|
13
|
+
* Si es false o undefined, usa object-fit: contain (muestra completa)
|
|
14
|
+
* @default false
|
|
15
|
+
*/
|
|
16
|
+
cover?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Props sin dimensiones personalizadas (usa IMAGE_SIZES.cards por defecto)
|
|
20
|
+
*/
|
|
21
|
+
interface ColumnImageFormatterWithoutSize<TRow> extends ColumnImageFormatterBaseProps<TRow> {
|
|
22
|
+
width?: never;
|
|
23
|
+
height?: never;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Props con dimensiones personalizadas para vista cards
|
|
27
|
+
* IMPORTANTE: width y height deben proporcionarse juntas
|
|
28
|
+
*/
|
|
29
|
+
interface ColumnImageFormatterWithSize<TRow> extends ColumnImageFormatterBaseProps<TRow> {
|
|
30
|
+
/**
|
|
31
|
+
* Ancho personalizado para la imagen en vista cards (en píxeles)
|
|
32
|
+
*/
|
|
33
|
+
width: number;
|
|
34
|
+
/**
|
|
35
|
+
* Alto personalizado para la imagen en vista cards (en píxeles)
|
|
36
|
+
*/
|
|
37
|
+
height: number;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Props para ColumnImageFormatter
|
|
41
|
+
* Puede tener dimensiones personalizadas (width Y height juntas) o ninguna
|
|
42
|
+
*/
|
|
43
|
+
export type ColumnImageFormatterProps<TRow> = ColumnImageFormatterWithoutSize<TRow> | ColumnImageFormatterWithSize<TRow>;
|
|
44
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ColumnImageFormatterProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Hook que retorna el formatter para columnas con imágenes en DataGrid
|
|
4
|
+
* @param props - Propiedades del formatter
|
|
5
|
+
* @returns Objeto con el formatter
|
|
6
|
+
*/
|
|
7
|
+
export declare const useColumnImage: <TRow>(props: ColumnImageFormatterProps<TRow>) => {
|
|
8
|
+
formatter: (formatterProps: import('react-data-grid').RenderCellProps<TRow, unknown>) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useState, useRef, useEffect, useMemo } from "react";
|
|
2
|
+
import { deepEqual } from "fast-equals";
|
|
3
|
+
import { C as ColumnImageFormatter } from "./formatter.js";
|
|
4
|
+
const useColumnImage = (props) => {
|
|
5
|
+
const [stateProps, setStateProps] = useState(props);
|
|
6
|
+
const refProps = useRef({ ...props });
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
if (!deepEqual(refProps.current, props)) {
|
|
9
|
+
refProps.current = props;
|
|
10
|
+
setStateProps(props);
|
|
11
|
+
}
|
|
12
|
+
}, [props]);
|
|
13
|
+
return useMemo(
|
|
14
|
+
() => ({
|
|
15
|
+
formatter: ColumnImageFormatter(stateProps)
|
|
16
|
+
}),
|
|
17
|
+
[stateProps]
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
useColumnImage as u
|
|
22
|
+
};
|
|
@@ -13,8 +13,8 @@ function scrollToCardElement(containerElement, rowKey, selectorType = "data-attr
|
|
|
13
13
|
return;
|
|
14
14
|
}
|
|
15
15
|
foundElement.scrollIntoView({
|
|
16
|
-
behavior: "
|
|
17
|
-
block: "
|
|
16
|
+
behavior: "smooth",
|
|
17
|
+
block: "end"
|
|
18
18
|
});
|
|
19
19
|
} catch (error) {
|
|
20
20
|
console.error("scrollToCardElement: Error al hacer scroll", error);
|
|
@@ -21,6 +21,7 @@ function Cards(props) {
|
|
|
21
21
|
onCheckedRowsChange
|
|
22
22
|
} = props;
|
|
23
23
|
const containerRef = useRef(null);
|
|
24
|
+
const hasScrolledToFocusRow = useRef(false);
|
|
24
25
|
const processedColumns = useProcessedColumns(columns);
|
|
25
26
|
const allProcessedColumns = useProcessedColumns(columns, {
|
|
26
27
|
applyVisibilityFilter: false
|
|
@@ -31,13 +32,21 @@ function Cards(props) {
|
|
|
31
32
|
onRowsChange
|
|
32
33
|
});
|
|
33
34
|
const cardHeight = useMemo(() => {
|
|
35
|
+
const imageHeight = processedColumns.reduce((totalHeight, col) => {
|
|
36
|
+
const formatterHeight = col.renderCell?.__imageFormatterHeight;
|
|
37
|
+
return formatterHeight ? totalHeight + formatterHeight : totalHeight;
|
|
38
|
+
}, 0);
|
|
34
39
|
return calculateCardHeight({
|
|
35
40
|
visibleColumnsCount: processedColumns.length,
|
|
36
41
|
customMinHeight: cardsViewConfig?.customRender?.minHeight
|
|
37
|
-
});
|
|
38
|
-
}, [processedColumns
|
|
42
|
+
}) + imageHeight;
|
|
43
|
+
}, [processedColumns, cardsViewConfig]);
|
|
39
44
|
useEffect(() => {
|
|
40
45
|
if (!focusOnRowKey) {
|
|
46
|
+
hasScrolledToFocusRow.current = false;
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
if (hasScrolledToFocusRow.current) {
|
|
41
50
|
return;
|
|
42
51
|
}
|
|
43
52
|
const rowIndex = rows.findIndex(
|
|
@@ -58,9 +67,13 @@ function Cards(props) {
|
|
|
58
67
|
"data-attribute",
|
|
59
68
|
"data-row-key"
|
|
60
69
|
);
|
|
70
|
+
if (onSelectedRowsChange) {
|
|
71
|
+
onSelectedRowsChange(/* @__PURE__ */ new Set([focusOnRowKey]));
|
|
72
|
+
}
|
|
73
|
+
hasScrolledToFocusRow.current = true;
|
|
61
74
|
}, 300);
|
|
62
75
|
return () => clearTimeout(timer);
|
|
63
|
-
}, [focusOnRowKey, rows, rowKeyGetter, cardHeight]);
|
|
76
|
+
}, [focusOnRowKey, rows, rowKeyGetter, cardHeight, onSelectedRowsChange]);
|
|
64
77
|
if (processedColumns.length === 0) {
|
|
65
78
|
return null;
|
|
66
79
|
}
|
|
@@ -15,7 +15,7 @@ function CardHeader({
|
|
|
15
15
|
checkedRows,
|
|
16
16
|
onCheckedRowsChange
|
|
17
17
|
}) {
|
|
18
|
-
const { rowKeyGetter, rowActionsGetter, size } = useDataGrid();
|
|
18
|
+
const { rowKeyGetter, rowActionsGetter, size, checkedRowsMultiple } = useDataGrid();
|
|
19
19
|
const { host_static_assets, environment_assets } = useEnvironment();
|
|
20
20
|
const rowKey = useMemo(() => rowKeyGetter(row), [rowKeyGetter, row]);
|
|
21
21
|
const onChange = useCallback(
|
|
@@ -23,15 +23,23 @@ function CardHeader({
|
|
|
23
23
|
if (!onCheckedRowsChange || !checkedRows) {
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
if (checkedRowsMultiple === false) {
|
|
27
|
+
if (checked) {
|
|
28
|
+
onCheckedRowsChange(/* @__PURE__ */ new Set([rowKey]));
|
|
29
|
+
} else {
|
|
30
|
+
onCheckedRowsChange(/* @__PURE__ */ new Set());
|
|
31
|
+
}
|
|
29
32
|
} else {
|
|
30
|
-
newCheckedRows
|
|
33
|
+
const newCheckedRows = new Set(checkedRows);
|
|
34
|
+
if (checked) {
|
|
35
|
+
newCheckedRows.add(rowKey);
|
|
36
|
+
} else {
|
|
37
|
+
newCheckedRows.delete(rowKey);
|
|
38
|
+
}
|
|
39
|
+
onCheckedRowsChange(newCheckedRows);
|
|
31
40
|
}
|
|
32
|
-
onCheckedRowsChange(newCheckedRows);
|
|
33
41
|
},
|
|
34
|
-
[checkedRows, onCheckedRowsChange, rowKey]
|
|
42
|
+
[checkedRows, onCheckedRowsChange, rowKey, checkedRowsMultiple]
|
|
35
43
|
);
|
|
36
44
|
const anchorOrigin = useMemo(
|
|
37
45
|
() => ({
|
|
@@ -2,6 +2,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef, useContext } from "react";
|
|
3
3
|
import { SelectCellFormatter } from "react-data-grid";
|
|
4
4
|
import { C as CheckboxFormatter } from "../Table/subcomponents/CheckboxFormatter.js";
|
|
5
|
+
import { R as RadioButtonFormatter } from "../Table/subcomponents/RadioButtonFormatter.js";
|
|
5
6
|
import { a as DataGridContext } from "../../contexts/DataGridContext/index.js";
|
|
6
7
|
import { l as CheckboxCellWrapperStyled } from "../../slots/DataGridSlot.js";
|
|
7
8
|
const CheckboxCellAdapter = forwardRef(function CheckboxCellAdapter2(props, ref) {
|
|
@@ -14,12 +15,14 @@ const CheckboxCellAdapter = forwardRef(function CheckboxCellAdapter2(props, ref)
|
|
|
14
15
|
} = props;
|
|
15
16
|
const context = useContext(DataGridContext);
|
|
16
17
|
const viewMode = context?.viewMode ?? "cards";
|
|
18
|
+
const checkedRowsMultiple = context?.checkedRowsMultiple;
|
|
17
19
|
if (viewMode !== "table") {
|
|
18
20
|
const handleClick = (e) => {
|
|
19
21
|
e.stopPropagation();
|
|
20
22
|
};
|
|
23
|
+
const FormatterComponent = checkedRowsMultiple === false ? RadioButtonFormatter : CheckboxFormatter;
|
|
21
24
|
return /* @__PURE__ */ jsx(CheckboxCellWrapperStyled, { onClick: handleClick, children: /* @__PURE__ */ jsx(
|
|
22
|
-
|
|
25
|
+
FormatterComponent,
|
|
23
26
|
{
|
|
24
27
|
ref,
|
|
25
28
|
checked: value,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo } from "react";
|
|
3
3
|
import { useEnvironment, useModuleDictionary } from "@m4l/core";
|
|
4
|
-
import { useTheme } from "@mui/material";
|
|
5
4
|
import { M as MenuActions } from "../../../../../MenuActions/MenuActions.js";
|
|
6
5
|
import { u as useDataGrid } from "../../../../hooks/useDataGrid.js";
|
|
7
6
|
import { p as pathIcons } from "../../../../icons.js";
|
|
@@ -45,7 +44,6 @@ function Density() {
|
|
|
45
44
|
environment_assets,
|
|
46
45
|
getLabel
|
|
47
46
|
]);
|
|
48
|
-
const theme = useTheme();
|
|
49
47
|
const currenViewIcon = useMemo(() => {
|
|
50
48
|
if (currentRowHeightVariant === "compact") {
|
|
51
49
|
return `${host_static_assets}/${environment_assets}/${pathIcons.compact}`;
|
|
@@ -62,7 +60,6 @@ function Density() {
|
|
|
62
60
|
MenuActions,
|
|
63
61
|
{
|
|
64
62
|
arrowType: "right-top",
|
|
65
|
-
menuActionSx: theme.components?.M4LDataGridDensityPopover?.styleOverrides,
|
|
66
63
|
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
67
64
|
transformOrigin: { vertical: "top", horizontal: "left" },
|
|
68
65
|
menuActions,
|
|
@@ -2,6 +2,7 @@ import { useState, useEffect, useMemo } from "react";
|
|
|
2
2
|
import { g as getDragHeaderRenderer } from "./getDragHeaderRenderer.js";
|
|
3
3
|
import { A as ActionsColumn } from "../subcomponents/ActionsColumn.js";
|
|
4
4
|
import { f as filterColumnClassName, S as SelectColumn } from "../subcomponents/SelectColumn.js";
|
|
5
|
+
import { R as RadioSelectColumn } from "../subcomponents/RadioSelectColumn.js";
|
|
5
6
|
import { useModuleSkeleton, getPropertyByString } from "@m4l/core";
|
|
6
7
|
import { u as useFilters } from "../../../hooks/useFilters.js";
|
|
7
8
|
import { u as useDataGrid } from "../../../hooks/useDataGrid.js";
|
|
@@ -38,7 +39,7 @@ function getComparator(columns, sortColumn) {
|
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
41
|
const getColumIndex = (key, columnsConfig) => columnsConfig.findIndex((columnConfig) => columnConfig.key === key);
|
|
41
|
-
const getInOrderColumns = (columns, hasCheckedRows, columnsConfig, columnsWidths, rowActionsGetter) => {
|
|
42
|
+
const getInOrderColumns = (columns, hasCheckedRows, checkedRowsMultiple, columnsConfig, columnsWidths, rowActionsGetter) => {
|
|
42
43
|
let filteredSortedColumns = columns.filter((column) => {
|
|
43
44
|
const columnConfigIndex = getColumIndex(column.key, columnsConfig);
|
|
44
45
|
const visible = columnConfigIndex > -1 ? columnsConfig[columnConfigIndex].visible : true;
|
|
@@ -64,7 +65,8 @@ const getInOrderColumns = (columns, hasCheckedRows, columnsConfig, columnsWidths
|
|
|
64
65
|
filteredSortedColumns = [ActionsColumn, ...filteredSortedColumns];
|
|
65
66
|
}
|
|
66
67
|
if (hasCheckedRows) {
|
|
67
|
-
|
|
68
|
+
const selectionColumn = checkedRowsMultiple === false ? RadioSelectColumn : SelectColumn;
|
|
69
|
+
filteredSortedColumns = [selectionColumn, ...filteredSortedColumns];
|
|
68
70
|
}
|
|
69
71
|
return filteredSortedColumns;
|
|
70
72
|
};
|
|
@@ -89,6 +91,7 @@ const useSortColumnsRows = (sourceColumns, sourceRows, popoverHandlers) => {
|
|
|
89
91
|
rowActionsGetter,
|
|
90
92
|
checkedRows,
|
|
91
93
|
onCheckedRowsChange,
|
|
94
|
+
checkedRowsMultiple,
|
|
92
95
|
sortColumns,
|
|
93
96
|
setSortColumns
|
|
94
97
|
} = useDataGrid();
|
|
@@ -109,6 +112,7 @@ const useSortColumnsRows = (sourceColumns, sourceRows, popoverHandlers) => {
|
|
|
109
112
|
sourceColumns,
|
|
110
113
|
!!checkedRows && !!onCheckedRowsChange,
|
|
111
114
|
//Si están seteados se habilita el múltipe
|
|
115
|
+
checkedRowsMultiple,
|
|
112
116
|
columnsConfig,
|
|
113
117
|
columnsWidths,
|
|
114
118
|
rowActionsGetter
|
|
@@ -68,6 +68,7 @@ function Table(props) {
|
|
|
68
68
|
anchorEl: null,
|
|
69
69
|
columnKey: null
|
|
70
70
|
});
|
|
71
|
+
const hasScrolledToFocusRow = useRef(false);
|
|
71
72
|
const [allowSortChange, setAllowSortChange] = useState(false);
|
|
72
73
|
const handleSortColumnsChange = (newSortColumns) => {
|
|
73
74
|
if (allowSortChange) {
|
|
@@ -113,6 +114,10 @@ function Table(props) {
|
|
|
113
114
|
}, [finalRows]);
|
|
114
115
|
useEffect(() => {
|
|
115
116
|
if (!focusOnRowKey) {
|
|
117
|
+
hasScrolledToFocusRow.current = false;
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
if (hasScrolledToFocusRow.current) {
|
|
116
121
|
return;
|
|
117
122
|
}
|
|
118
123
|
const rowIndex = finalRows.findIndex(
|
|
@@ -120,8 +125,12 @@ function Table(props) {
|
|
|
120
125
|
);
|
|
121
126
|
if (rowIndex !== -1) {
|
|
122
127
|
ref_data_grid.current?.scrollToCell({ rowIdx: rowIndex });
|
|
128
|
+
if (onSelectedRowsChange) {
|
|
129
|
+
onSelectedRowsChange(/* @__PURE__ */ new Set([focusOnRowKey]));
|
|
130
|
+
}
|
|
131
|
+
hasScrolledToFocusRow.current = true;
|
|
123
132
|
}
|
|
124
|
-
}, [focusOnRowKey, finalRows, rowKeyGetter]);
|
|
133
|
+
}, [focusOnRowKey, finalRows, rowKeyGetter, onSelectedRowsChange]);
|
|
125
134
|
const onColumnResize = (idx, width) => {
|
|
126
135
|
onChangeColumnWidth(finalColumns[idx].key, width);
|
|
127
136
|
};
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { jsx, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { u as useDataGrid } from "../../../hooks/useDataGrid.js";
|
|
3
|
-
import { useTheme } from "@mui/material";
|
|
4
3
|
import { f as DATAGRID_SEMANTIC_WIDTHS, e as DATAGRID_ACTIONS_COLUMN_KEY } from "../../../constants.js";
|
|
5
4
|
import { M as MenuActions } from "../../../../MenuActions/MenuActions.js";
|
|
6
5
|
function ActionsFormatter(props) {
|
|
7
6
|
const { rowActionsGetter } = useDataGrid();
|
|
8
|
-
const theme = useTheme();
|
|
9
7
|
if (rowActionsGetter === void 0) {
|
|
10
8
|
return /* @__PURE__ */ jsx(Fragment, {});
|
|
11
9
|
}
|
|
@@ -15,7 +13,6 @@ function ActionsFormatter(props) {
|
|
|
15
13
|
arrowType: "top-left",
|
|
16
14
|
objItem: props.row,
|
|
17
15
|
menuActions: rowActionsGetter,
|
|
18
|
-
menuActionSx: theme.components?.M4LDataGridActionsFormatter?.styleOverrides,
|
|
19
16
|
marginTop: 1,
|
|
20
17
|
marginLeft: "-11px",
|
|
21
18
|
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { RenderCheckboxProps } from 'react-data-grid';
|
|
2
|
+
/**
|
|
3
|
+
* Componente visual del RadioButton que se renderiza dentro de cada celda del DataGrid.
|
|
4
|
+
* ¿Para que sirve? Es un wrapper alrededor del componente Radio del MUI que adapta las props de react-data-grid
|
|
5
|
+
*/
|
|
6
|
+
export declare const RadioButtonFormatter: import('react').ForwardRefExoticComponent<RenderCheckboxProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { R as RadioButton } from "../../../../mui_extended/RadioButton/RadioButton.js";
|
|
4
|
+
const RadioButtonFormatter = forwardRef(function RadioFormatter({ onChange, checked, ...props }, _ref) {
|
|
5
|
+
function handleChange(e) {
|
|
6
|
+
onChange(e.target.checked, e.nativeEvent.shiftKey);
|
|
7
|
+
}
|
|
8
|
+
return /* @__PURE__ */ jsx(RadioButton, { checked, onChange: handleChange, ...props });
|
|
9
|
+
});
|
|
10
|
+
export {
|
|
11
|
+
RadioButtonFormatter as R
|
|
12
|
+
};
|