@m4l/components 9.3.35-BE20251128-beta.1 → 9.3.35-JT27112025.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/components/AccountPopover/slots/AccountPopoverSlots.d.ts +6 -6
- 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/contexts/DataGridContext/index.js +39 -268
- package/components/DataGrid/contexts/DataGridContext/types.d.ts +3 -20
- package/components/DataGrid/helpers/getAllViewModes/getAllViewModes.d.ts +19 -0
- package/components/DataGrid/helpers/getAllViewModes/getAllViewModes.js +6 -0
- package/components/DataGrid/helpers/getAllViewModes/getAllViewModes.test.d.ts +1 -0
- package/components/DataGrid/helpers/getAllViewModes/index.d.ts +1 -0
- package/components/DataGrid/helpers/getAllViewModes/index.js +1 -0
- package/components/DataGrid/helpers/getColumnsWidth/getColumnsWidth.d.ts +47 -0
- package/components/DataGrid/helpers/getColumnsWidth/getColumnsWidth.js +32 -0
- package/components/DataGrid/helpers/getColumnsWidth/getColumnsWidth.test.d.ts +1 -0
- package/components/DataGrid/helpers/getColumnsWidth/index.d.ts +1 -0
- package/components/DataGrid/helpers/getColumnsWidth/index.js +1 -0
- package/components/DataGrid/helpers/getIndexRowHeightVariant/getIndexRowHeightVariant.d.ts +24 -0
- package/components/DataGrid/helpers/getIndexRowHeightVariant/getIndexRowHeightVariant.js +12 -0
- package/components/DataGrid/helpers/getIndexRowHeightVariant/getIndexRowHeightVariant.test.d.ts +1 -0
- package/components/DataGrid/helpers/getIndexRowHeightVariant/index.d.ts +1 -0
- package/components/DataGrid/helpers/getIndexRowHeightVariant/index.js +1 -0
- package/components/DataGrid/helpers/getInitialColumnsConfig/getInitialColumnsConfig.d.ts +48 -0
- package/components/DataGrid/helpers/getInitialColumnsConfig/getInitialColumnsConfig.js +35 -0
- package/components/DataGrid/helpers/getInitialColumnsConfig/getInitialColumnsConfig.test.d.ts +1 -0
- package/components/DataGrid/helpers/getInitialColumnsConfig/index.d.ts +1 -0
- package/components/DataGrid/helpers/getInitialColumnsConfig/index.js +1 -0
- package/components/DataGrid/helpers/getViewSpecificConfig/getViewSpecificConfig.d.ts +28 -0
- package/components/DataGrid/helpers/getViewSpecificConfig/getViewSpecificConfig.js +22 -0
- package/components/DataGrid/helpers/getViewSpecificConfig/getViewSpecificConfig.test.d.ts +1 -0
- package/components/DataGrid/helpers/getViewSpecificConfig/index.d.ts +1 -0
- package/components/DataGrid/helpers/getViewSpecificConfig/index.js +1 -0
- package/components/DataGrid/helpers/getViewSuffix/getViewSuffix.d.ts +24 -0
- package/components/DataGrid/helpers/getViewSuffix/getViewSuffix.js +9 -0
- package/components/DataGrid/helpers/getViewSuffix/getViewSuffix.test.d.ts +1 -0
- package/components/DataGrid/helpers/getViewSuffix/index.d.ts +1 -0
- package/components/DataGrid/helpers/getViewSuffix/index.js +1 -0
- package/components/DataGrid/helpers/index.d.ts +12 -0
- package/components/DataGrid/helpers/index.js +1 -0
- package/components/DataGrid/helpers/loadViewConfig/index.d.ts +1 -0
- package/components/DataGrid/helpers/loadViewConfig/index.js +1 -0
- package/components/DataGrid/helpers/loadViewConfig/loadViewConfig.d.ts +23 -0
- package/components/DataGrid/helpers/loadViewConfig/loadViewConfig.js +12 -0
- package/components/DataGrid/helpers/loadViewConfig/loadViewConfig.test.d.ts +1 -0
- package/components/DataGrid/helpers/saveColumnsWidth/index.d.ts +1 -0
- package/components/DataGrid/helpers/saveColumnsWidth/index.js +1 -0
- package/components/DataGrid/helpers/saveColumnsWidth/saveColumnsWidth.d.ts +52 -0
- package/components/DataGrid/helpers/saveColumnsWidth/saveColumnsWidth.js +18 -0
- package/components/DataGrid/helpers/saveColumnsWidth/saveColumnsWidth.test.d.ts +1 -0
- package/components/DataGrid/helpers/saveViewConfig/index.d.ts +1 -0
- package/components/DataGrid/helpers/saveViewConfig/index.js +1 -0
- package/components/DataGrid/helpers/saveViewConfig/saveViewConfig.d.ts +35 -0
- package/components/DataGrid/helpers/saveViewConfig/saveViewConfig.js +15 -0
- package/components/DataGrid/helpers/saveViewConfig/saveViewConfig.test.d.ts +1 -0
- package/components/DataGrid/helpers/saveViewMode/index.d.ts +1 -0
- package/components/DataGrid/helpers/saveViewMode/index.js +1 -0
- package/components/DataGrid/helpers/saveViewMode/saveViewMode.d.ts +33 -0
- package/components/DataGrid/helpers/saveViewMode/saveViewMode.js +13 -0
- package/components/DataGrid/helpers/saveViewMode/saveViewMode.test.d.ts +1 -0
- package/components/DataGrid/hooks/index.d.ts +6 -0
- package/components/DataGrid/hooks/index.js +1 -0
- package/components/DataGrid/hooks/useChangeColumnsConfig/index.d.ts +1 -0
- package/components/DataGrid/hooks/useChangeColumnsConfig/index.js +1 -0
- package/components/DataGrid/hooks/useChangeColumnsConfig/useChangeColumnsConfig.d.ts +9 -0
- package/components/DataGrid/hooks/useChangeColumnsConfig/useChangeColumnsConfig.js +27 -0
- package/components/DataGrid/hooks/useChangeColumnsConfig/useChangeColumnsConfig.test.d.ts +1 -0
- package/components/DataGrid/hooks/useChangeColumnsOrder/index.d.ts +1 -0
- package/components/DataGrid/hooks/useChangeColumnsOrder/index.js +1 -0
- package/components/DataGrid/hooks/useChangeColumnsOrder/useChangeColumnsOrder.d.ts +10 -0
- package/components/DataGrid/hooks/useChangeColumnsOrder/useChangeColumnsOrder.js +34 -0
- package/components/DataGrid/hooks/useChangeColumnsOrder/useChangeColumnsOrder.test.d.ts +1 -0
- package/components/DataGrid/hooks/useColumnsWidth/index.d.ts +1 -0
- package/components/DataGrid/hooks/useColumnsWidth/index.js +1 -0
- package/components/DataGrid/hooks/useColumnsWidth/useColumnsWidth.d.ts +11 -0
- package/components/DataGrid/hooks/useColumnsWidth/useColumnsWidth.js +29 -0
- package/components/DataGrid/hooks/useColumnsWidth/useColumnsWidth.test.d.ts +1 -0
- package/components/DataGrid/hooks/useRowHeight/index.d.ts +1 -0
- package/components/DataGrid/hooks/useRowHeight/index.js +1 -0
- package/components/DataGrid/hooks/useRowHeight/useRowHeight.d.ts +28 -0
- package/components/DataGrid/hooks/useRowHeight/useRowHeight.js +51 -0
- package/components/DataGrid/hooks/useRowHeight/useRowHeight.test.d.ts +1 -0
- package/components/DataGrid/hooks/useViewConfig/index.d.ts +1 -0
- package/components/DataGrid/hooks/useViewConfig/index.js +1 -0
- package/components/DataGrid/hooks/useViewConfig/useViewConfig.d.ts +9 -0
- package/components/DataGrid/hooks/useViewConfig/useViewConfig.js +30 -0
- package/components/DataGrid/hooks/useViewConfig/useViewConfig.test.d.ts +1 -0
- package/components/DataGrid/hooks/useViewMode/index.d.ts +1 -0
- package/components/DataGrid/hooks/useViewMode/index.js +1 -0
- package/components/DataGrid/hooks/useViewMode/useViewMode.d.ts +44 -0
- package/components/DataGrid/hooks/useViewMode/useViewMode.js +48 -0
- package/components/DataGrid/hooks/useViewMode/useViewMode.test.d.ts +1 -0
- package/components/DataGrid/index.d.ts +5 -4
- package/components/DataGrid/types.helpers.d.ts +55 -0
- package/components/DataGrid/types.helpers.js +1 -0
- package/components/DataGrid/types.hooks.d.ts +79 -0
- package/components/DynamicFilter/slots/dynamicFilterSlots.d.ts +2 -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/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/slots/LabelSlots.d.ts +3 -3
- package/components/LanguagePopover/slots/LanguagePopoverSlots.d.ts +1 -1
- package/components/LoadingError/slots/LoadingErrorSlots.d.ts +1 -1
- package/components/MenuActions/slots/MenuActionsSlots.d.ts +2 -2
- 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/SettingsLayout/slots/SettingsLayoutSlots.d.ts +3 -3
- package/components/SideBar/slots/SideBarSlots.d.ts +1 -1
- package/components/Stepper/slots/StepperSlot.d.ts +4 -4
- package/components/TabsNavigator/slots/TabsNavigatorSlots.d.ts +2 -2
- package/components/ToastContainer/slots/toastContainerSlots.d.ts +4 -4
- package/components/WindowBase/slots/WindowBaseSlots.d.ts +2 -2
- 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/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/constants.d.ts +1 -1
- package/components/formatters/ImageFormatter/slots/ImageFormatterSlots.d.ts +1 -1
- 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/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/mui_extended/Accordion/slots/AccordionSlots.d.ts +3 -3
- 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/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/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/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/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/constants.d.ts +1 -1
- package/components/mui_extended/Typography/slots/typographySlots.d.ts +1 -1
- package/hooks/useDataGridPersistence/constants.d.ts +1 -0
- package/hooks/useDataGridPersistence/constants.js +4 -2
- package/hooks/useDataGridPersistence/useDataGridPersistence.js +5 -2
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const ActionIntroRootStyled: import('@emotion/styled').StyledComponent<Pick<Omit<import('../../../../mui_extended/Button').ButtonProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>, "value" | "size" | "children" | "title" | "component" | "name" | "id" | "type" | "disabled" | "action" | "
|
|
1
|
+
declare const ActionIntroRootStyled: import('@emotion/styled').StyledComponent<Pick<Omit<import('../../../../mui_extended/Button').ButtonProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>, "value" | "size" | "children" | "title" | "component" | "name" | "id" | "type" | "disabled" | "action" | "hidden" | "color" | "content" | "style" | "variant" | "translate" | "className" | "classes" | "sx" | "form" | "label" | "slot" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "href" | "skeletonWidth" | "startIcon" | "endIcon" | keyof import('react').RefAttributes<HTMLButtonElement> | "disableElevation" | "fullWidth"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Partial<import('..').ActionIntroOwnerState> & Record<string, unknown> & {
|
|
2
2
|
ownerState: Partial<import('..').ActionIntroOwnerState> & Record<string, unknown>;
|
|
3
3
|
}, {}, {}>;
|
|
4
4
|
export { ActionIntroRootStyled };
|
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" | "content" | "
|
|
3
|
+
}, keyof import('@mui/system').BoxOwnProps<import('@mui/material').Theme>>, "title" | "id" | "hidden" | "content" | "style" | "translate" | "className" | "slot" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | keyof import('@mui/system').BoxOwnProps<import('@mui/material').Theme>> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown>, {}, {}>;
|
|
4
4
|
export { ActionsContainerRoot };
|
|
@@ -1,146 +1,21 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useState,
|
|
3
|
-
import {
|
|
4
|
-
import { useFirstRender, useIsMobile } from "@m4l/graphics";
|
|
2
|
+
import { useState, useEffect, useMemo, createContext } from "react";
|
|
3
|
+
import { useFirstRender } from "@m4l/graphics";
|
|
5
4
|
import { g as getComponentClasses } from "../../../../utils/getComponentSlotRoot.js";
|
|
6
5
|
import { a as DATAGRID_ROW_HEIGHTS, b as DATAGRID_ROW_HEADER_HEIGHTS, D as DATAGRID_PREFIX_NAME } from "../../constants.js";
|
|
7
6
|
import { C as ControlNavigateSlots, a as ColumnsConfigSlots, T as TextEditorSlots, b as TableSlots, R as RowsCountSlots, A as ActionsSlots, D as DataGridSlots } from "../../slots/DataGridEnum.js";
|
|
8
7
|
import { deepEqual } from "fast-equals";
|
|
8
|
+
import { u as useViewMode } from "../../hooks/useViewMode/useViewMode.js";
|
|
9
|
+
import { u as useRowHeight } from "../../hooks/useRowHeight/useRowHeight.js";
|
|
10
|
+
import { u as useColumnsWidth } from "../../hooks/useColumnsWidth/useColumnsWidth.js";
|
|
11
|
+
import { u as useViewConfig } from "../../hooks/useViewConfig/useViewConfig.js";
|
|
12
|
+
import { u as useChangeColumnsConfig } from "../../hooks/useChangeColumnsConfig/useChangeColumnsConfig.js";
|
|
13
|
+
import { u as useChangeColumnsOrder } from "../../hooks/useChangeColumnsOrder/useChangeColumnsOrder.js";
|
|
14
|
+
import { g as getColumnsWidth } from "../../helpers/getColumnsWidth/getColumnsWidth.js";
|
|
15
|
+
import { g as getInitialColumnsConfig } from "../../helpers/getInitialColumnsConfig/getInitialColumnsConfig.js";
|
|
16
|
+
import { g as getAllViewModes } from "../../helpers/getAllViewModes/getAllViewModes.js";
|
|
17
|
+
import { g as getViewSpecificConfig } from "../../helpers/getViewSpecificConfig/getViewSpecificConfig.js";
|
|
9
18
|
const DataGridContext = createContext(null);
|
|
10
|
-
function getColumnsWidth(id, columns, defaultUserColumns) {
|
|
11
|
-
const newMap = /* @__PURE__ */ new Map();
|
|
12
|
-
let storeColumnsWidth;
|
|
13
|
-
try {
|
|
14
|
-
const item = window.localStorage.getItem(`${id}_columns_width`);
|
|
15
|
-
storeColumnsWidth = item !== null ? new Map(JSON.parse(item)) : /* @__PURE__ */ new Map();
|
|
16
|
-
} catch (_e) {
|
|
17
|
-
storeColumnsWidth = /* @__PURE__ */ new Map();
|
|
18
|
-
}
|
|
19
|
-
for (let i = 0; i < columns.length; i++) {
|
|
20
|
-
let width;
|
|
21
|
-
if (defaultUserColumns) {
|
|
22
|
-
try {
|
|
23
|
-
width = defaultUserColumns.columnsWidths[columns[i].key];
|
|
24
|
-
} catch (_e) {
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
if (width === void 0) {
|
|
28
|
-
const storeWidth = storeColumnsWidth.get(columns[i].key);
|
|
29
|
-
if (typeof storeWidth === "number") {
|
|
30
|
-
width = storeWidth;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
if (width !== void 0) {
|
|
34
|
-
newMap.set(columns[i].key, width);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
return newMap;
|
|
38
|
-
}
|
|
39
|
-
function saveColumnsWidth(id, storeColumnsWidth, onChangeUserColumns) {
|
|
40
|
-
if (onChangeUserColumns) {
|
|
41
|
-
const columnsWidthObject = castMapColumnsWidthToRecord(storeColumnsWidth);
|
|
42
|
-
onChangeUserColumns({
|
|
43
|
-
reason: "columnsWidths",
|
|
44
|
-
userConfig: columnsWidthObject
|
|
45
|
-
});
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
localStorage.setItem(
|
|
49
|
-
`${id}_columns_width`,
|
|
50
|
-
JSON.stringify([...storeColumnsWidth])
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
const getAllViewModes = () => {
|
|
54
|
-
return ["table", "cards"];
|
|
55
|
-
};
|
|
56
|
-
const getViewSpecificConfig = (viewMode) => {
|
|
57
|
-
const configs = {
|
|
58
|
-
table: {
|
|
59
|
-
defaults: { frozen: false },
|
|
60
|
-
originalDefaults: { originalFrozen: false },
|
|
61
|
-
dynamicOriginalProperty: (item) => ({
|
|
62
|
-
originalFrozen: item?.frozen ?? false
|
|
63
|
-
})
|
|
64
|
-
},
|
|
65
|
-
cards: {
|
|
66
|
-
defaults: { showTitle: true },
|
|
67
|
-
originalDefaults: { originalShowTitle: true },
|
|
68
|
-
dynamicOriginalProperty: (item) => ({
|
|
69
|
-
originalShowTitle: item?.showTitle ?? true
|
|
70
|
-
})
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
return configs[viewMode] || configs.table;
|
|
74
|
-
};
|
|
75
|
-
const getViewSuffix = (viewMode) => {
|
|
76
|
-
if (viewMode === "table") {
|
|
77
|
-
return "";
|
|
78
|
-
}
|
|
79
|
-
return `_${viewMode}`;
|
|
80
|
-
};
|
|
81
|
-
function getInitialColumnsConfig(id, columns, viewMode, defaultUserConfig, viewSpecificDefaults, originalViewSpecificDefaults) {
|
|
82
|
-
let columnsConfig;
|
|
83
|
-
if (defaultUserConfig) {
|
|
84
|
-
columnsConfig = defaultUserConfig;
|
|
85
|
-
} else {
|
|
86
|
-
columnsConfig = loadViewConfig(
|
|
87
|
-
id,
|
|
88
|
-
getViewSuffix(viewMode)
|
|
89
|
-
) || [];
|
|
90
|
-
}
|
|
91
|
-
return columns.map((column, index) => {
|
|
92
|
-
const existingConfig = columnsConfig.find((c) => c.key === column.key);
|
|
93
|
-
const columnConfigIndex = existingConfig ? columnsConfig.indexOf(existingConfig) : -1;
|
|
94
|
-
const baseConfig = {
|
|
95
|
-
key: column.key,
|
|
96
|
-
name: typeof column.name === "string" ? column.name : String(column.name),
|
|
97
|
-
hidden: column.hidden === void 0 ? false : column.hidden,
|
|
98
|
-
index: columnConfigIndex > -1 ? columnConfigIndex : index,
|
|
99
|
-
visible: existingConfig?.visible !== void 0 ? existingConfig.visible : column.visible === void 0 ? true : column.visible,
|
|
100
|
-
originalIndex: index,
|
|
101
|
-
originalVisible: column.visible === void 0 ? true : column.visible
|
|
102
|
-
};
|
|
103
|
-
return {
|
|
104
|
-
...baseConfig,
|
|
105
|
-
...viewSpecificDefaults,
|
|
106
|
-
...originalViewSpecificDefaults,
|
|
107
|
-
...existingConfig || {}
|
|
108
|
-
};
|
|
109
|
-
}).sort((a, b) => a.index - b.index);
|
|
110
|
-
}
|
|
111
|
-
function saveViewConfig(id, viewSuffix, config, onChangeCallback) {
|
|
112
|
-
if (onChangeCallback) {
|
|
113
|
-
const reason = viewSuffix === "" ? "columnsConfig" : `columnsConfig${viewSuffix.replace("_", "")}`;
|
|
114
|
-
onChangeCallback({
|
|
115
|
-
reason,
|
|
116
|
-
userConfig: config
|
|
117
|
-
});
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
|
-
const storageKey = viewSuffix === "" ? `${id}_columns_config` : `${id}_columns_config${viewSuffix}`;
|
|
121
|
-
localStorage.setItem(storageKey, JSON.stringify(config));
|
|
122
|
-
}
|
|
123
|
-
function loadViewConfig(id, viewSuffix) {
|
|
124
|
-
try {
|
|
125
|
-
const storageKey = viewSuffix === "" ? `${id}_columns_config` : `${id}_columns_config${viewSuffix}`;
|
|
126
|
-
const stored = localStorage.getItem(storageKey);
|
|
127
|
-
return stored ? JSON.parse(stored) : null;
|
|
128
|
-
} catch (_e) {
|
|
129
|
-
return null;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
function saveViewMode(id, viewMode) {
|
|
133
|
-
localStorage.setItem(`${id}_view_mode`, viewMode);
|
|
134
|
-
}
|
|
135
|
-
function getIndexRowHeightVariant(variant) {
|
|
136
|
-
if (variant === "compact") {
|
|
137
|
-
return 0;
|
|
138
|
-
}
|
|
139
|
-
if (variant === "standard") {
|
|
140
|
-
return 1;
|
|
141
|
-
}
|
|
142
|
-
return 2;
|
|
143
|
-
}
|
|
144
19
|
function DataGridProvider(props) {
|
|
145
20
|
const {
|
|
146
21
|
id,
|
|
@@ -166,7 +41,32 @@ function DataGridProvider(props) {
|
|
|
166
41
|
cardsViewConfig
|
|
167
42
|
} = props;
|
|
168
43
|
const isFirstRender = useFirstRender([columns, id]);
|
|
169
|
-
const
|
|
44
|
+
const { viewModeState, handleViewModeChange } = useViewMode({
|
|
45
|
+
id,
|
|
46
|
+
viewMode,
|
|
47
|
+
defaultViewMode,
|
|
48
|
+
onViewModeChange,
|
|
49
|
+
onChangeUserColumns
|
|
50
|
+
});
|
|
51
|
+
const { currentRowHeightVariant, setRowHeightVariant } = useRowHeight({
|
|
52
|
+
rowHeights,
|
|
53
|
+
rowHeaderHeights,
|
|
54
|
+
initialRowHeightVariant
|
|
55
|
+
});
|
|
56
|
+
const { columnsWidths, setColumnsWidths, onChangeColumnWidth } = useColumnsWidth({
|
|
57
|
+
id,
|
|
58
|
+
onChangeUserColumns
|
|
59
|
+
});
|
|
60
|
+
const { getConfigColumns, updateConfigColumns } = useViewConfig();
|
|
61
|
+
const { onChangeColumnsConfig } = useChangeColumnsConfig({
|
|
62
|
+
id,
|
|
63
|
+
onChangeUserColumns,
|
|
64
|
+
updateConfigColumns
|
|
65
|
+
});
|
|
66
|
+
const { onChangeColumnsOrder } = useChangeColumnsOrder({
|
|
67
|
+
getConfigColumns,
|
|
68
|
+
onChangeColumnsConfig
|
|
69
|
+
});
|
|
170
70
|
const classes = getComponentClasses(DATAGRID_PREFIX_NAME, {
|
|
171
71
|
...DataGridSlots,
|
|
172
72
|
...ActionsSlots,
|
|
@@ -176,80 +76,8 @@ function DataGridProvider(props) {
|
|
|
176
76
|
...ColumnsConfigSlots,
|
|
177
77
|
...ControlNavigateSlots
|
|
178
78
|
});
|
|
179
|
-
const [columnsWidths, setColumnsWidths] = useState(/* @__PURE__ */ new Map());
|
|
180
|
-
const [viewConfig, setViewConfig] = useState(() => ({
|
|
181
|
-
table: [],
|
|
182
|
-
cards: []
|
|
183
|
-
}));
|
|
184
|
-
const getConfigColumns = useCallback(
|
|
185
|
-
(viewModeParam) => {
|
|
186
|
-
return viewConfig[viewModeParam];
|
|
187
|
-
},
|
|
188
|
-
[viewConfig]
|
|
189
|
-
);
|
|
190
|
-
const updateConfigColumns = useCallback(
|
|
191
|
-
(viewModeParam, config) => {
|
|
192
|
-
setViewConfig((prev) => ({
|
|
193
|
-
...prev,
|
|
194
|
-
[viewModeParam]: config
|
|
195
|
-
}));
|
|
196
|
-
},
|
|
197
|
-
[]
|
|
198
|
-
);
|
|
199
79
|
const [rowsFilterCount, setRowFilterCount] = useState(rowsCount);
|
|
200
80
|
const [sortColumns, setSortColumns] = useState([]);
|
|
201
|
-
const [viewModeState, setViewModeState] = useState(() => {
|
|
202
|
-
if (viewMode) {
|
|
203
|
-
return viewMode;
|
|
204
|
-
}
|
|
205
|
-
try {
|
|
206
|
-
const savedViewMode = localStorage.getItem(`${id}_view_mode`);
|
|
207
|
-
if (savedViewMode === "cards" || savedViewMode === "table") {
|
|
208
|
-
return savedViewMode;
|
|
209
|
-
}
|
|
210
|
-
} catch (_e) {
|
|
211
|
-
}
|
|
212
|
-
if (defaultViewMode) {
|
|
213
|
-
return defaultViewMode;
|
|
214
|
-
}
|
|
215
|
-
return isMobile ? "cards" : "table";
|
|
216
|
-
});
|
|
217
|
-
const handleViewModeChange = useCallback(
|
|
218
|
-
(newViewMode) => {
|
|
219
|
-
setViewModeState(newViewMode);
|
|
220
|
-
saveViewMode(id, newViewMode);
|
|
221
|
-
onViewModeChange?.(newViewMode);
|
|
222
|
-
},
|
|
223
|
-
[onViewModeChange, id]
|
|
224
|
-
);
|
|
225
|
-
useEffect(() => {
|
|
226
|
-
if (viewMode !== void 0) {
|
|
227
|
-
setViewModeState(viewMode);
|
|
228
|
-
}
|
|
229
|
-
}, [viewMode]);
|
|
230
|
-
const [currentRowHeightVariant, setCurrentRowHeightVariant] = useState(() => {
|
|
231
|
-
if (typeof rowHeights !== typeof rowHeaderHeights) {
|
|
232
|
-
throw new Error("Must be same type rowheights and rowHeaderTypes");
|
|
233
|
-
}
|
|
234
|
-
if (typeof rowHeights === "number" && typeof rowHeaderHeights === "number") {
|
|
235
|
-
return {
|
|
236
|
-
rowHVariant: "compact",
|
|
237
|
-
rowHeight: rowHeights,
|
|
238
|
-
rowHeaderHeight: rowHeaderHeights
|
|
239
|
-
};
|
|
240
|
-
}
|
|
241
|
-
if (typeof rowHeights !== "number" && rowHeights.length !== 3) {
|
|
242
|
-
throw new Error("Must be 3 heights");
|
|
243
|
-
}
|
|
244
|
-
if (typeof rowHeaderHeights !== "number" && rowHeaderHeights.length !== 3) {
|
|
245
|
-
throw new Error("Must be 3 HeaderHeights");
|
|
246
|
-
}
|
|
247
|
-
return {
|
|
248
|
-
rowHVariant: initialRowHeightVariant,
|
|
249
|
-
rowHeight: typeof rowHeights !== "number" ? rowHeights[getIndexRowHeightVariant(initialRowHeightVariant)] : rowHeights,
|
|
250
|
-
rowHeaderHeight: typeof rowHeaderHeights !== "number" ? rowHeaderHeights[getIndexRowHeightVariant(initialRowHeightVariant)] : rowHeaderHeights
|
|
251
|
-
};
|
|
252
|
-
});
|
|
253
81
|
useEffect(() => {
|
|
254
82
|
const keys = new Set(columns.map((c) => c.key));
|
|
255
83
|
if (sortSettings?.sortsColumns) {
|
|
@@ -315,7 +143,6 @@ function DataGridProvider(props) {
|
|
|
315
143
|
}
|
|
316
144
|
}, [columns, sortSettings, filterSettings, cardsViewConfig]);
|
|
317
145
|
const finalRowHeights = useMemo(() => rowHeights, [rowHeights]);
|
|
318
|
-
let timerSaveColumns;
|
|
319
146
|
useEffect(() => {
|
|
320
147
|
if (isFirstRender) {
|
|
321
148
|
setColumnsWidths(getColumnsWidth(id, columns, defaultUserColumns));
|
|
@@ -450,65 +277,9 @@ function DataGridProvider(props) {
|
|
|
450
277
|
});
|
|
451
278
|
}
|
|
452
279
|
}, [columns, id]);
|
|
453
|
-
const onChangeColumnsConfig = useCallback(
|
|
454
|
-
(viewModeParam, newConfig) => {
|
|
455
|
-
saveViewConfig(
|
|
456
|
-
id,
|
|
457
|
-
getViewSuffix(viewModeParam),
|
|
458
|
-
newConfig,
|
|
459
|
-
onChangeUserColumns
|
|
460
|
-
);
|
|
461
|
-
updateConfigColumns(viewModeParam, newConfig);
|
|
462
|
-
},
|
|
463
|
-
[id, onChangeUserColumns, updateConfigColumns]
|
|
464
|
-
);
|
|
465
|
-
const onChangeColumnsOrder = useCallback(
|
|
466
|
-
(viewModeParam, sourceKey, targetKey) => {
|
|
467
|
-
if (sourceKey === targetKey) {
|
|
468
|
-
return;
|
|
469
|
-
}
|
|
470
|
-
const currentConfig = getConfigColumns(viewModeParam);
|
|
471
|
-
const sourceColumnIndex = currentConfig.findIndex(
|
|
472
|
-
(c) => c.key === sourceKey
|
|
473
|
-
);
|
|
474
|
-
const targetColumnIndex = currentConfig.findIndex(
|
|
475
|
-
(c) => c.key === targetKey
|
|
476
|
-
);
|
|
477
|
-
const reorderedConfig = [...currentConfig];
|
|
478
|
-
reorderedConfig.splice(
|
|
479
|
-
targetColumnIndex,
|
|
480
|
-
0,
|
|
481
|
-
reorderedConfig.splice(sourceColumnIndex, 1)[0]
|
|
482
|
-
);
|
|
483
|
-
onChangeColumnsConfig(viewModeParam, reorderedConfig);
|
|
484
|
-
},
|
|
485
|
-
[getConfigColumns, onChangeColumnsConfig]
|
|
486
|
-
);
|
|
487
|
-
const onChangeColumnWidth = (columnKey, width) => {
|
|
488
|
-
columnsWidths.set(columnKey, Math.round(width));
|
|
489
|
-
if (timerSaveColumns) {
|
|
490
|
-
clearTimeout(timerSaveColumns);
|
|
491
|
-
}
|
|
492
|
-
timerSaveColumns = setTimeout(() => {
|
|
493
|
-
saveColumnsWidth(id, columnsWidths, onChangeUserColumns);
|
|
494
|
-
}, 500);
|
|
495
|
-
};
|
|
496
280
|
const setRowFilterCountInternal = (newRowsCount) => {
|
|
497
281
|
setRowFilterCount(newRowsCount);
|
|
498
282
|
};
|
|
499
|
-
const setCurrentRowHeightInternal = useCallback(
|
|
500
|
-
(newVariant) => {
|
|
501
|
-
if (typeof rowHeights === "number" || typeof rowHeaderHeights === "number") {
|
|
502
|
-
throw new Error("Only use setCurrentRowHeight with vector rowHeights");
|
|
503
|
-
}
|
|
504
|
-
setCurrentRowHeightVariant({
|
|
505
|
-
rowHVariant: newVariant,
|
|
506
|
-
rowHeight: rowHeights[getIndexRowHeightVariant(newVariant)],
|
|
507
|
-
rowHeaderHeight: rowHeaderHeights[getIndexRowHeightVariant(newVariant)]
|
|
508
|
-
});
|
|
509
|
-
},
|
|
510
|
-
[setCurrentRowHeightVariant, rowHeights, rowHeaderHeights]
|
|
511
|
-
);
|
|
512
283
|
return /* @__PURE__ */ jsx(
|
|
513
284
|
DataGridContext.Provider,
|
|
514
285
|
{
|
|
@@ -528,7 +299,7 @@ function DataGridProvider(props) {
|
|
|
528
299
|
onChangeColumnWidth,
|
|
529
300
|
setRowsCount: setRowFilterCountInternal,
|
|
530
301
|
rowActionsGetter,
|
|
531
|
-
setRowHeightVariant
|
|
302
|
+
setRowHeightVariant,
|
|
532
303
|
onCheckedRowsChange,
|
|
533
304
|
rowKeyGetter,
|
|
534
305
|
onChangeUserColumns,
|
|
@@ -3,21 +3,12 @@ import { RowKey, RowHeightVariants, GridProps } from '../../types';
|
|
|
3
3
|
import { Maybe } from '@m4l/core';
|
|
4
4
|
import { ActionsSlots, ColumnsConfigSlots, ControlNavigateSlots, DataGridSlots, RowsCountSlots, TableSlots, TextEditorSlots } from '../../slots/DataGridEnum';
|
|
5
5
|
import { SortColumn } from 'react-data-grid';
|
|
6
|
-
|
|
7
|
-
* Configuración base genérica que puede extenderse con propiedades específicas de cualquier vista
|
|
8
|
-
* USO INTERNO: El sistema usa esto para manejar genéricamente las configuraciones
|
|
9
|
-
*/
|
|
10
|
-
export type BaseViewConfig<TViewSpecific = {}> = TViewSpecific & {
|
|
11
|
-
key: string;
|
|
12
|
-
visible: boolean;
|
|
13
|
-
index: number;
|
|
14
|
-
name?: string;
|
|
15
|
-
};
|
|
6
|
+
import { IGridConfig, BaseViewConfig } from '../../types.helpers';
|
|
16
7
|
/**
|
|
17
8
|
* Configuración extendida genérica con propiedades originales
|
|
18
9
|
* USO INTERNO: El contexto usa esto para el estado interno con propiedades de tracking
|
|
19
10
|
*/
|
|
20
|
-
export type IViewConfig<TViewSpecific =
|
|
11
|
+
export type IViewConfig<TViewSpecific = object, TOriginalViewSpecific = object> = BaseViewConfig<TViewSpecific> & {
|
|
21
12
|
hidden: boolean;
|
|
22
13
|
originalIndex: number;
|
|
23
14
|
originalVisible: boolean;
|
|
@@ -62,15 +53,6 @@ export interface IConfigColumnCards extends Omit<IConfigColumn, 'frozen' | 'orig
|
|
|
62
53
|
originalShowTitle: boolean;
|
|
63
54
|
}
|
|
64
55
|
export type ViewMode = 'table' | 'cards';
|
|
65
|
-
/**
|
|
66
|
-
* Configuración base del Grid (API pública original)
|
|
67
|
-
* USO: Tipo base para defaultUserColumns - mantiene retrocompatibilidad
|
|
68
|
-
* IMPORTANTE: No modificar para mantener retrocompatibilidad con código existente
|
|
69
|
-
*/
|
|
70
|
-
export interface IGridConfig {
|
|
71
|
-
columnsConfig: BaseConfigColumn[];
|
|
72
|
-
columnsWidths: Record<RowKey, number>;
|
|
73
|
-
}
|
|
74
56
|
/**
|
|
75
57
|
* Configuración extendida del Grid para soportar múltiples vistas
|
|
76
58
|
* USO: Para nuevas implementaciones que soporten cards y futuras vistas
|
|
@@ -78,6 +60,7 @@ export interface IGridConfig {
|
|
|
78
60
|
*/
|
|
79
61
|
export interface IGridConfigExtended extends IGridConfig {
|
|
80
62
|
columnsConfigCards?: BaseConfigColumnCards[];
|
|
63
|
+
viewMode?: ViewMode;
|
|
81
64
|
}
|
|
82
65
|
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'> {
|
|
83
66
|
id: number | string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ViewMode } from '../../contexts/DataGridContext/types';
|
|
2
|
+
/**
|
|
3
|
+
* Obtiene todos los modos de vista disponibles en el DataGrid.
|
|
4
|
+
*
|
|
5
|
+
* ## Modos disponibles
|
|
6
|
+
*
|
|
7
|
+
* - `table`: Vista de tabla tradicional con filas y columnas
|
|
8
|
+
* - `cards`: Vista de tarjetas para visualización compacta
|
|
9
|
+
*
|
|
10
|
+
* ## Uso
|
|
11
|
+
*
|
|
12
|
+
* Esta función centraliza los modos de vista disponibles,
|
|
13
|
+
* facilitando la extensión futura si se agregan nuevos modos.
|
|
14
|
+
* @returns Array con los modos de vista disponibles
|
|
15
|
+
* @example
|
|
16
|
+
* const modes = getAllViewModes();
|
|
17
|
+
* // ['table', 'cards']
|
|
18
|
+
*/
|
|
19
|
+
export declare const getAllViewModes: () => ViewMode[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getAllViewModes } from './getAllViewModes';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Column } from 'react-data-grid';
|
|
2
|
+
import { Maybe } from '@m4l/core';
|
|
3
|
+
import { RowKey } from '../../types';
|
|
4
|
+
import { IGridConfig } from '../../types.helpers';
|
|
5
|
+
/**
|
|
6
|
+
* Obtiene la configuración de anchos de las columnas del DataGrid.
|
|
7
|
+
*
|
|
8
|
+
* ## Flujo de persistencia
|
|
9
|
+
*
|
|
10
|
+
* Esta función obtiene los anchos de columnas siguiendo una jerarquía de precedencia:
|
|
11
|
+
*
|
|
12
|
+
* 1. **defaultUserColumns** (Backend/API) - Prioridad máxima
|
|
13
|
+
* Configuración que viene del backend cuando el componente se monta.
|
|
14
|
+
* En producción, esta es la fuente principal de datos persistidos.
|
|
15
|
+
*
|
|
16
|
+
* 2. **localStorage** - Fallback local
|
|
17
|
+
* Solo se usa cuando NO hay configuración del backend.
|
|
18
|
+
* Útil para desarrollo o cuando no hay integración con backend.
|
|
19
|
+
*
|
|
20
|
+
* Si no se encuentra configuración en ninguna fuente, la columna no se incluye
|
|
21
|
+
* en el Map resultante y usará el ancho por defecto definido en la columna.
|
|
22
|
+
*
|
|
23
|
+
* ## Relación con saveColumnsWidth
|
|
24
|
+
*
|
|
25
|
+
* - Cuando el usuario modifica anchos, `saveColumnsWidth` envía los cambios al backend
|
|
26
|
+
* mediante el callback `onChangeUserColumns`
|
|
27
|
+
* - En la siguiente carga, esos datos vuelven como `defaultUserColumns`
|
|
28
|
+
* - localStorage es solo un fallback cuando no hay callback configurado
|
|
29
|
+
* @template TRow - Tipo de datos de cada fila del DataGrid
|
|
30
|
+
* @template TSummaryRow - Tipo de datos de la fila de resumen del DataGrid
|
|
31
|
+
* @param id - Identificador único del DataGrid. Se usa como prefijo para la key en localStorage (fallback)
|
|
32
|
+
* @param columns - Array de columnas del DataGrid con su configuración
|
|
33
|
+
* @param defaultUserColumns - Configuración del usuario obtenida del backend/API.
|
|
34
|
+
* Esta es la fuente principal en producción.
|
|
35
|
+
* @returns Map donde la key es el identificador de la columna (column.key) y el value
|
|
36
|
+
* es el ancho configurado (número en píxeles o string con unidad CSS)
|
|
37
|
+
* @example
|
|
38
|
+
* // Sin configuración del backend (usa localStorage como fallback)
|
|
39
|
+
* const columnsWidths = getColumnsWidth('my-grid', columns, null);
|
|
40
|
+
* @example
|
|
41
|
+
* // Con configuración del backend (caso típico en producción)
|
|
42
|
+
* const columnsWidths = getColumnsWidth('my-grid', columns, {
|
|
43
|
+
* columnsWidths: { name: 200, email: 300 }
|
|
44
|
+
* });
|
|
45
|
+
* @see saveColumnsWidth - Función complementaria para persistir la configuración
|
|
46
|
+
*/
|
|
47
|
+
export declare function getColumnsWidth<TRow, TSummaryRow>(id: RowKey, columns: readonly Column<TRow, TSummaryRow>[], defaultUserColumns: Maybe<IGridConfig>): Map<string, Maybe<string | number>>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
function getColumnsWidth(id, columns, defaultUserColumns) {
|
|
2
|
+
const newMap = /* @__PURE__ */ new Map();
|
|
3
|
+
let storeColumnsWidth;
|
|
4
|
+
try {
|
|
5
|
+
const item = window.localStorage.getItem(`${id}_columns_width`);
|
|
6
|
+
storeColumnsWidth = item !== null ? new Map(JSON.parse(item)) : /* @__PURE__ */ new Map();
|
|
7
|
+
} catch (_e) {
|
|
8
|
+
storeColumnsWidth = /* @__PURE__ */ new Map();
|
|
9
|
+
}
|
|
10
|
+
for (let i = 0; i < columns.length; i++) {
|
|
11
|
+
let width;
|
|
12
|
+
if (defaultUserColumns) {
|
|
13
|
+
try {
|
|
14
|
+
width = defaultUserColumns.columnsWidths[columns[i].key];
|
|
15
|
+
} catch (_e) {
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
if (width === void 0) {
|
|
19
|
+
const storeWidth = storeColumnsWidth.get(columns[i].key);
|
|
20
|
+
if (typeof storeWidth === "number") {
|
|
21
|
+
width = storeWidth;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
if (width !== void 0) {
|
|
25
|
+
newMap.set(columns[i].key, width);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return newMap;
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
getColumnsWidth as g
|
|
32
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getColumnsWidth } from './getColumnsWidth';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { RowHeightVariants } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Obtiene el índice correspondiente a un variant de altura de fila.
|
|
4
|
+
*
|
|
5
|
+
* ## Propósito
|
|
6
|
+
*
|
|
7
|
+
* Mapea el nombre del variant ('compact', 'standard', 'confortable') a su
|
|
8
|
+
* índice en los arrays de alturas (rowHeights y rowHeaderHeights).
|
|
9
|
+
*
|
|
10
|
+
* ## Mapeo de variants a índices
|
|
11
|
+
*
|
|
12
|
+
* | Variant | Índice |
|
|
13
|
+
* |-------------|--------|
|
|
14
|
+
* | compact | 0 |
|
|
15
|
+
* | standard | 1 |
|
|
16
|
+
* | confortable | 2 |
|
|
17
|
+
* @param variant - Variant de altura de fila
|
|
18
|
+
* @returns Índice correspondiente en los arrays de alturas (0, 1 o 2)
|
|
19
|
+
* @example
|
|
20
|
+
* getIndexRowHeightVariant('compact'); // 0
|
|
21
|
+
* getIndexRowHeightVariant('standard'); // 1
|
|
22
|
+
* getIndexRowHeightVariant('confortable'); // 2
|
|
23
|
+
*/
|
|
24
|
+
export declare const getIndexRowHeightVariant: (variant: RowHeightVariants) => number;
|
package/components/DataGrid/helpers/getIndexRowHeightVariant/getIndexRowHeightVariant.test.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getIndexRowHeightVariant } from './getIndexRowHeightVariant';
|