@m4l/components 9.1.142 → 9.1.144
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/.storybook/utils/getStylesColorsByMode.d.ts +48 -48
- package/@types/types.d.ts +17 -0
- package/components/AccountPopover/slots/AccountPopoverSlots.d.ts +7 -7
- package/components/AppBar/slots/AppBarSlots.d.ts +6 -6
- package/components/AppBar/slots/AppBarSlots.js +1 -1
- package/components/Chip/slots/ChipSlots.d.ts +2 -2
- package/components/Color/slots/ColorSlots.d.ts +2 -2
- package/components/Color/slots/ColorSlots.js +1 -1
- 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.d.ts +9 -0
- package/components/DataGrid/DataGrid.js +95 -0
- package/components/DataGrid/contexts/DataGridContext/index.js +2 -2
- package/components/DataGrid/contexts/FilterContext/index.js +2 -2
- package/components/DataGrid/formatters/ColumnDateFormatter/useColumnDate.js +6 -2
- package/components/DataGrid/hooks/useDataGrid.js +1 -1
- package/components/DataGrid/hooks/useFilters.js +1 -1
- package/components/DataGrid/index.d.ts +8 -9
- package/components/DataGrid/index.js +1 -89
- package/components/DataGrid/slots/DataGridEnum.d.ts +2 -1
- package/components/DataGrid/slots/DataGridEnum.js +1 -0
- package/components/DataGrid/slots/DataGridSlot.d.ts +19 -18
- package/components/DataGrid/slots/DataGridSlot.js +13 -8
- package/components/DataGrid/styles.js +10 -8
- package/components/DataGrid/subcomponents/Actions/index.js +15 -12
- package/components/DataGrid/subcomponents/Actions/subcomponents/Settings/subcomponents/ColumnsConfig/index.js +1 -1
- package/components/DataGrid/subcomponents/Actions/subcomponents/hooks/useModalSettings/index.js +1 -1
- package/components/DataGrid/subcomponents/Actions/types.d.ts +2 -0
- package/components/DataGrid/subcomponents/Table/index.js +1 -1
- package/components/DataGrid/subcomponents/Table/subcomponents/DraggableHeaderRenderer.js +1 -1
- package/components/DataGrid/types.d.ts +8 -12
- package/components/DragResizeWindow/slots/DragResizeWindowSlots.d.ts +2 -2
- package/components/DynamicFilter/__tests__/fronEndHelpers.test.d.ts +1 -0
- package/components/DynamicFilter/helpers/frontEndHelpers.d.ts +12 -0
- package/components/DynamicFilter/helpers/frontEndHelpers.js +213 -0
- package/components/DynamicFilter/index.d.ts +1 -0
- package/components/DynamicFilter/slots/dynamicFilterSlots.d.ts +15 -15
- package/components/DynamicFilter/slots/dynamicFilterSlots.js +1 -1
- package/components/DynamicFilter/store/DynamicFilterContext.d.ts +1 -1
- package/components/DynamicFilter/store/DynamicFilterStore.d.ts +1 -1
- package/components/DynamicFilter/store/DynamicFilterStore.js +5 -2
- package/components/DynamicFilter/store/{DynamicFilterStoreTypes.d.ts → types.d.ts} +4 -5
- package/components/DynamicFilter/store/useDynamicFilterStore.d.ts +1 -1
- package/components/DynamicFilter/subcomponents/AppliedFilterChip/useAppliedFilterChip.d.ts +1 -1
- package/components/DynamicFilter/subcomponents/AppliedFilterChip/useAppliedFilterChip.js +2 -4
- package/components/DynamicFilter/subcomponents/DynamicFilterBase/DynamicFilterBase.js +4 -0
- package/components/DynamicFilter/subcomponents/PopoverFilter/usePopoverFilter.js +2 -1
- package/components/DynamicFilter/subcomponents/PopoverMenuFields/usePopoverMenuFields.d.ts +0 -1
- package/components/DynamicFilter/subcomponents/PopoverMenuFields/usePopoverMenuFields.js +1 -3
- package/components/DynamicFilter/types.d.ts +2 -2
- package/components/DynamicSort/DynamicSort.styles.js +3 -0
- package/components/DynamicSort/constants.d.ts +3 -3
- package/components/DynamicSort/constants.js +5 -3
- package/components/DynamicSort/dictionary.js +3 -2
- package/components/DynamicSort/helpers/formatToRowSort.js +3 -2
- package/components/DynamicSort/helpers/frontEndHelpers.d.ts +7 -0
- package/components/DynamicSort/helpers/frontEndHelpers.js +38 -0
- package/components/DynamicSort/helpers/getPurgedInitialSortApplyed.js +2 -2
- package/components/DynamicSort/index.d.ts +2 -1
- package/components/DynamicSort/slots/DynamicSortSlots.d.ts +29 -29
- package/components/DynamicSort/store/DynamicSortContext.d.ts +3 -3
- package/components/DynamicSort/store/DynamicSortContext.js +5 -14
- package/components/DynamicSort/store/DynamicSortStore.d.ts +2 -2
- package/components/DynamicSort/store/DynamicSortStore.js +30 -21
- package/components/DynamicSort/store/{type.d.ts → types.d.ts} +19 -22
- package/components/DynamicSort/store/useDynamicSortStore.d.ts +1 -1
- package/components/DynamicSort/store/useDynamicSortStore.js +1 -1
- package/components/DynamicSort/subcomponents/AppliedSortChip/useAppliedSortChip.d.ts +1 -1
- package/components/DynamicSort/subcomponents/AppliedSortChip/useAppliedSortChip.js +3 -4
- package/components/DynamicSort/subcomponents/AppliedSorts/AppliedSorts.js +1 -1
- package/components/DynamicSort/subcomponents/AppliedSorts/useAppliedSorts.d.ts +1 -1
- package/components/DynamicSort/subcomponents/AppliedSorts/useAppliedSorts.js +2 -1
- package/components/DynamicSort/subcomponents/DynamicSortBase/DynamicSortBase.js +4 -0
- package/components/DynamicSort/subcomponents/FieldTypes/DataTypeComponent.js +2 -2
- package/components/DynamicSort/subcomponents/FieldTypes/FieldTypeInterface.d.ts +4 -4
- package/components/DynamicSort/subcomponents/FieldTypes/StringSort/helpers.d.ts +4 -4
- package/components/DynamicSort/subcomponents/FieldTypes/StringSort/helpers.js +4 -4
- package/components/DynamicSort/subcomponents/FieldTypes/StringSort/index.js +1 -1
- package/components/DynamicSort/subcomponents/FieldTypes/fieldFactory.d.ts +2 -3
- package/components/DynamicSort/subcomponents/FieldTypes/fieldFactory.js +4 -4
- package/components/DynamicSort/subcomponents/InputSort/InputSort.js +11 -2
- package/components/DynamicSort/subcomponents/InputSort/useInputSort.d.ts +13 -1
- package/components/DynamicSort/subcomponents/InputSort/useInputSort.js +26 -16
- package/components/DynamicSort/subcomponents/PopoverMenuFields/PopoverMenuFields.js +5 -4
- package/components/DynamicSort/subcomponents/PopoverMenuFields/usePopoverMenuFields.d.ts +2 -1
- package/components/DynamicSort/subcomponents/PopoverMenuFields/usePopoverMenuFields.js +6 -5
- package/components/DynamicSort/subcomponents/PopoverSort/usePopoverSort.d.ts +3 -2
- package/components/DynamicSort/subcomponents/PopoverSort/usePopoverSort.js +8 -6
- package/components/DynamicSort/subcomponents/SortActions/SortActions.js +1 -1
- package/components/DynamicSort/subcomponents/SortActions/useSortActions.js +4 -4
- package/components/DynamicSort/tests/fronEndHelpers.test.d.ts +1 -0
- package/components/DynamicSort/types.d.ts +36 -46
- package/components/Icon/slots/IconSlots.d.ts +2 -2
- package/components/Label/slots/LabelSlots.d.ts +1 -1
- package/components/LanguagePopover/slots/LanguagePopoverSlots.d.ts +1 -1
- package/components/LoadingError/slots/LoadingErrorSlots.d.ts +8 -8
- package/components/MenuActions/MenuActions.js +1 -1
- package/components/MenuActions/slots/MenuActionsSlots.d.ts +6 -6
- package/components/MenuActions/types.d.ts +4 -7
- package/components/ModalDialog/slots/ModalDialogSlots.d.ts +2 -2
- package/components/NoItemSelected/slots/NoItemSelectedSlots.d.ts +3 -3
- package/components/NumberInput/slots/NumberInputSlots.d.ts +5 -5
- package/components/ObjectLogs/index.js +1 -1
- package/components/PDFViewer/slots/PDFViewerSlots.d.ts +1 -1
- package/components/Pager/Pager.js +4 -1
- package/components/Pager/slots/PagerSlots.d.ts +4 -4
- package/components/PaperForm/slots/PaperFormSlots.d.ts +3 -3
- package/components/PropertyValue/slots/PropertyValueSlots.d.ts +3 -3
- package/components/ScrollBar/slots/ScrollBarSlots.d.ts +1 -1
- package/components/SideBar/slots/SideBarSlots.d.ts +15 -15
- package/components/ToastContainer/slots/toastContainerSlots.d.ts +7 -7
- package/components/WindowBase/slots/WindowBaseSlots.d.ts +8 -8
- package/components/WindowBase/subcomponents/Header/types.d.ts +2 -4
- package/components/WindowConfirm/slots/WindowConfirmSlots.d.ts +8 -8
- package/components/areas/components/AreasAdmin/slots/AreasAdminSlots.d.ts +17 -17
- package/components/areas/components/AreasAdmin/subcomponents/AreaChip/AreaChip.js +1 -1
- package/components/areas/components/AreasViewer/slots/AreasViewerSlots.d.ts +5 -5
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Component/index.js +2 -2
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Component/types.d.ts +1 -0
- package/components/areas/contexts/WindowToolsMFContext/types.d.ts +1 -1
- package/components/areas/types.d.ts +2 -4
- package/components/extended/React-Spinners/PropagateLoaderSpinner/slots/PropagateLoaderSpinnerSlots.d.ts +1 -1
- package/components/extended/React-Splitter-Layout/slots/SplitLayoutSlots.d.ts +3 -3
- package/components/extended/React-Window/FixedSizeList/slots/FixedSizeListSlots.js +1 -1
- package/components/extended/React-Window/VariableSizeList/VariableSizeList.js +1 -1
- package/components/hook-form/RHFAutocomplete/slots/RHFAutocompleteSlots.d.ts +1 -1
- package/components/hook-form/RHFCheckbox/slots/RHFCheckBoxSlots.d.ts +3 -3
- package/components/hook-form/RHFColorPicker/slots/RHFColorPickerSlots.d.ts +1 -1
- package/components/hook-form/RHFDateTime/slots/RHFDateTimeSlots.d.ts +1 -1
- package/components/hook-form/RHFNumberInput/slots/RHFNumberInputSlots.d.ts +1 -1
- package/components/hook-form/RHFPeriod/slots/RHFPeriodSlots.d.ts +4 -4
- package/components/hook-form/RHFSelect/slots/RHFSlots.d.ts +2 -2
- package/components/hook-form/RHFTextField/slots/RHFTextFieldSlots.d.ts +2 -2
- package/components/hook-form/RHFTextFieldPassword/slots/RHFTextFieldPasswordSlots.d.ts +3 -3
- package/components/hook-form/RHFTimePicker/slots/RHFTimePickerSlots.d.ts +1 -1
- package/components/index.d.ts +27 -33
- package/components/mui_extended/Accordion/slots/AccordionSlots.d.ts +2 -2
- package/components/mui_extended/Autocomplete/slots/AutocompleteSlots.d.ts +5 -5
- package/components/mui_extended/Autocomplete/slots/AutocompleteSlots.js +1 -1
- 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 +1 -1
- 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/Dialog/slots/DialogSlots.d.ts +2 -2
- package/components/mui_extended/Divider/slots/DividerSlots.d.ts +2 -2
- package/components/mui_extended/IconButton/IconButton.js +2 -2
- package/components/mui_extended/IconButton/slots/IconButtonSlots.d.ts +2 -2
- package/components/mui_extended/LoadingButton/slots/LoadingButtonSlots.d.ts +1 -1
- package/components/mui_extended/MenuDivider/slots/MenuDividerSlots.d.ts +2 -2
- package/components/mui_extended/MenuItem/slots/MenuItemSlots.d.ts +2 -2
- package/components/mui_extended/MenuItem/slots/MenuItemSlots.js +1 -1
- 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 +3 -3
- 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 +1 -1
- package/components/mui_extended/Tabs/slots/TabsSlots.d.ts +1 -1
- package/components/mui_extended/TextField/slots/TextFieldSlots.d.ts +1 -1
- 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/slots/TooltipSlots.d.ts +1 -1
- package/components/mui_extended/Typography/slots/typographySlots.d.ts +1 -1
- package/components/popups/components/PopupsProvider/contexts/PopupsContext/store.js +2 -2
- package/components/popups/components/PopupsProvider/contexts/PopupsContext/types.d.ts +6 -13
- package/components/popups/components/PopupsProvider/hooks/usePopops/usePopups.js +1 -1
- package/components/popups/components/PopupsViewer/slots/popupsViewerSlots.d.ts +5 -5
- package/hooks/index.d.ts +1 -0
- package/hooks/useDynamicFilterAndSort/constants.d.ts +1 -0
- package/hooks/useDynamicFilterAndSort/constants.js +4 -0
- package/hooks/useDynamicFilterAndSort/icons.d.ts +6 -0
- package/hooks/useDynamicFilterAndSort/icons.js +11 -0
- package/hooks/useDynamicFilterAndSort/index.d.ts +2 -0
- package/hooks/useDynamicFilterAndSort/index.js +1 -0
- package/hooks/useDynamicFilterAndSort/slots/DynamicFilterAndSortEnum.d.ts +5 -0
- package/hooks/useDynamicFilterAndSort/slots/DynamicFilterAndSortEnum.js +9 -0
- package/hooks/useDynamicFilterAndSort/slots/DynamicFilterAndSortSlots.d.ts +9 -0
- package/hooks/useDynamicFilterAndSort/slots/DynamicFilterAndSortSlots.js +22 -0
- package/hooks/useDynamicFilterAndSort/styles.d.ts +2 -0
- package/hooks/useDynamicFilterAndSort/styles.js +43 -0
- package/hooks/useDynamicFilterAndSort/types.d.ts +34 -0
- package/hooks/useDynamicFilterAndSort/useDynamicFilterAndSort.d.ts +10 -0
- package/hooks/useDynamicFilterAndSort/useDynamicFilterAndSort.js +90 -0
- package/index.js +304 -295
- package/package.json +1 -1
- package/utils/getValidDate.d.ts +4 -0
- package/utils/getValidDate.js +17 -0
- package/utils/index.d.ts +1 -0
- package/vendor.js +2 -2
- package/not_recognized/index.js +0 -23261
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export declare const StyledMUITypography: import('@emotion/styled').StyledComponent<Pick<import('@mui/material').TypographyOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
5
5
|
ref?: ((instance: HTMLSpanElement | 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<HTMLSpanElement> | null | undefined;
|
|
6
|
-
}, "children" | "zIndex" | "paragraph" | "border" | "fontWeight" | "lineHeight" | "letterSpacing" | "fontSize" | "textTransform" | "fontFamily" | "typography" | "flex" | "color" | "left" | "right" | "bottom" | "top" | "style" | "position" | "padding" | "variant" | "borderRadius" | "width" | "display" | "borderColor" | "height" | "gap" | "minHeight" | "minWidth" | "margin" | "overflow" | "boxShadow" | "justifyContent" | "alignItems" | "paddingLeft" | "borderLeft" | "borderTop" | "maxWidth" | "flexDirection" | "paddingRight" | "borderRight" | "flexGrow" | "marginLeft" | "textOverflow" | "borderBottom" | "gridTemplateColumns" | "marginBottom" | "alignContent" | "alignSelf" | "boxSizing" | "columnGap" | "flexBasis" | "flexShrink" | "flexWrap" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateRows" | "justifyItems" | "justifySelf" | "marginBlockEnd" | "marginBlockStart" | "marginInlineEnd" | "marginInlineStart" | "marginRight" | "marginTop" | "maxHeight" | "order" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingTop" | "rowGap" | "textAlign" | "visibility" | "whiteSpace" | "gridArea" | "gridColumn" | "gridRow" | "marginBlock" | "marginInline" | "paddingBlock" | "paddingInline" | "
|
|
6
|
+
}, "children" | "zIndex" | "paragraph" | "border" | "fontWeight" | "lineHeight" | "letterSpacing" | "fontSize" | "textTransform" | "fontFamily" | "typography" | "flex" | "color" | "left" | "right" | "bottom" | "top" | "style" | "position" | "padding" | "variant" | "borderRadius" | "width" | "display" | "borderColor" | "height" | "gap" | "minHeight" | "minWidth" | "margin" | "overflow" | "boxShadow" | "justifyContent" | "alignItems" | "paddingLeft" | "borderLeft" | "borderTop" | "maxWidth" | "flexDirection" | "paddingRight" | "borderRight" | "flexGrow" | "marginLeft" | "textOverflow" | "borderBottom" | "gridTemplateColumns" | "marginBottom" | "alignContent" | "alignSelf" | "boxSizing" | "columnGap" | "flexBasis" | "flexShrink" | "flexWrap" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateRows" | "justifyItems" | "justifySelf" | "marginBlockEnd" | "marginBlockStart" | "marginInlineEnd" | "marginInlineStart" | "marginRight" | "marginTop" | "maxHeight" | "order" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingTop" | "rowGap" | "textAlign" | "visibility" | "whiteSpace" | "gridArea" | "gridColumn" | "gridRow" | "marginBlock" | "marginInline" | "paddingBlock" | "paddingInline" | "className" | "classes" | "sx" | "p" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "displayPrint" | "align" | "gutterBottom" | "noWrap" | "variantMapping">, "children" | "ref" | "title" | "zIndex" | "id" | "paragraph" | "border" | "fontWeight" | "lineHeight" | "letterSpacing" | "fontSize" | "textTransform" | "fontFamily" | "typography" | "flex" | "hidden" | "color" | "left" | "right" | "bottom" | "top" | "content" | "style" | "position" | "padding" | "variant" | "borderRadius" | "width" | "display" | "borderColor" | "height" | "gap" | "minHeight" | "minWidth" | "margin" | "overflow" | "boxShadow" | "justifyContent" | "alignItems" | "paddingLeft" | "borderLeft" | "borderTop" | "maxWidth" | "flexDirection" | "paddingRight" | "borderRight" | "flexGrow" | "marginLeft" | "textOverflow" | "borderBottom" | "gridTemplateColumns" | "marginBottom" | "alignContent" | "alignSelf" | "boxSizing" | "columnGap" | "flexBasis" | "flexShrink" | "flexWrap" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateRows" | "justifyItems" | "justifySelf" | "marginBlockEnd" | "marginBlockStart" | "marginInlineEnd" | "marginInlineStart" | "marginRight" | "marginTop" | "maxHeight" | "order" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingTop" | "rowGap" | "textAlign" | "translate" | "visibility" | "whiteSpace" | "gridArea" | "gridColumn" | "gridRow" | "marginBlock" | "marginInline" | "paddingBlock" | "paddingInline" | "className" | "classes" | "sx" | "p" | "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" | "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" | "onResize" | "onResizeCapture" | "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" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "displayPrint" | "align" | "gutterBottom" | "noWrap" | "variantMapping"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').TypographyOwnerState> & Record<string, unknown> & {
|
|
7
7
|
ownerState: Partial<import('../types').TypographyOwnerState> & Record<string, unknown>;
|
|
8
8
|
}, {}, {}>;
|
|
9
9
|
/**
|
|
@@ -36,8 +36,8 @@ const createPopupsStore = (initProps) => {
|
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
state.hashPopups[initialPopups[index].popupId] = {
|
|
39
|
-
...popupData
|
|
40
|
-
component: popupData.functionComponent
|
|
39
|
+
...popupData
|
|
40
|
+
// component: popupData.functionComponent,
|
|
41
41
|
};
|
|
42
42
|
state.popupsIds.push(initialPopups[index].popupId);
|
|
43
43
|
if (initialPopups[index].zIndex > maxZindex) {
|
|
@@ -46,15 +46,15 @@ export interface PopupStoreProps extends Pick<DragResizeWindowProps, 'bounds' |
|
|
|
46
46
|
*/
|
|
47
47
|
zIndex: number;
|
|
48
48
|
/**
|
|
49
|
-
*
|
|
50
|
-
*/
|
|
51
|
-
componentProps?: Record<string, any>;
|
|
52
|
-
/**
|
|
53
|
-
* functionComponent retorna el componente que se va a mostrar en el popup.
|
|
49
|
+
* component retorna el componente que se va a mostrar en el popup.
|
|
54
50
|
*
|
|
55
51
|
* Lo unico que necesita es guardar la referencia la función que retorna el componente.
|
|
56
52
|
*/
|
|
57
|
-
|
|
53
|
+
component: React.FC<Record<string, any>>;
|
|
54
|
+
/**
|
|
55
|
+
* "componentProps" Propiedades que se le pasan al componente que se va a mostrar en el popup.
|
|
56
|
+
*/
|
|
57
|
+
componentProps?: Record<string, any>;
|
|
58
58
|
/**
|
|
59
59
|
* "onMouseDown" Evento nativo del Draggable, para tomar acciones externamente
|
|
60
60
|
*/
|
|
@@ -91,9 +91,6 @@ export interface PopupStoreProps extends Pick<DragResizeWindowProps, 'bounds' |
|
|
|
91
91
|
* "dynamicMFStore" Almacén de microfrontends din
|
|
92
92
|
*/
|
|
93
93
|
dynamicMFStore?: Record<string, any>;
|
|
94
|
-
/**
|
|
95
|
-
* "emergeType" Tipo de emergencia
|
|
96
|
-
*/
|
|
97
94
|
/**
|
|
98
95
|
* dynamic params
|
|
99
96
|
*/
|
|
@@ -114,10 +111,6 @@ export interface PopupStoreProps extends Pick<DragResizeWindowProps, 'bounds' |
|
|
|
114
111
|
* "maximized" Indica si el popup está maximizado
|
|
115
112
|
*/
|
|
116
113
|
maximized?: boolean;
|
|
117
|
-
/**
|
|
118
|
-
* "component" Componente que se va a mostrar en el popup.
|
|
119
|
-
*/
|
|
120
|
-
component?: React.FC<Record<string, any>>;
|
|
121
114
|
}
|
|
122
115
|
/**
|
|
123
116
|
* Interface que define el store del componente (variables y funciones )
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
export declare const RootStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Partial<import('../types').PopupsViewerOwnerState> & Record<string, unknown> & {
|
|
2
2
|
ownerState: Partial<import('../types').PopupsViewerOwnerState> & Record<string, unknown>;
|
|
3
|
-
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').
|
|
3
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
4
4
|
export declare const PopupDragWindowRootStyled: import('@emotion/styled').StyledComponent<Pick<import('../../../../DragResizeWindow/types').DragResizeWindowProps & import('react').RefAttributes<HTMLDivElement>, keyof import('react').RefAttributes<HTMLDivElement> | keyof import('../../../../DragResizeWindow/types').DragResizeWindowProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Partial<import('../types').PopupsViewerOwnerState> & Record<string, unknown> & {
|
|
5
5
|
ownerState: Partial<import('../types').PopupsViewerOwnerState> & Record<string, unknown>;
|
|
6
6
|
}, {}, {}>;
|
|
7
7
|
export declare const WindowBaseContentStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Partial<import('../types').PopupsViewerOwnerState> & Record<string, unknown> & {
|
|
8
8
|
ownerState: Partial<import('../types').PopupsViewerOwnerState> & Record<string, unknown>;
|
|
9
|
-
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').
|
|
9
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
10
10
|
export declare const PopupHeaderContainerStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Partial<import('../types').PopupsViewerOwnerState> & Record<string, unknown> & {
|
|
11
11
|
ownerState: Partial<import('../types').PopupsViewerOwnerState> & Record<string, unknown>;
|
|
12
|
-
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').
|
|
12
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
13
13
|
export declare const PopupHeaderTitleStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Partial<import('../types').PopupsViewerOwnerState> & Record<string, unknown> & {
|
|
14
14
|
ownerState: Partial<import('../types').PopupsViewerOwnerState> & Record<string, unknown>;
|
|
15
15
|
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, keyof import('react').ClassAttributes<HTMLSpanElement> | keyof import('react').HTMLAttributes<HTMLSpanElement>>, {}>;
|
|
@@ -18,7 +18,7 @@ export declare const PopupHeaderSubTitleStyled: import('@emotion/styled').Styled
|
|
|
18
18
|
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, keyof import('react').ClassAttributes<HTMLSpanElement> | keyof import('react').HTMLAttributes<HTMLSpanElement>>, {}>;
|
|
19
19
|
export declare const PopupContentRootStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Partial<import('../types').PopupsViewerOwnerState> & Record<string, unknown> & {
|
|
20
20
|
ownerState: Partial<import('../types').PopupsViewerOwnerState> & Record<string, unknown>;
|
|
21
|
-
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').
|
|
21
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
22
22
|
export declare const PopupContentWrapperStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Partial<import('../types').PopupsViewerOwnerState> & Record<string, unknown> & {
|
|
23
23
|
ownerState: Partial<import('../types').PopupsViewerOwnerState> & Record<string, unknown>;
|
|
24
|
-
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').
|
|
24
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
package/hooks/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const M4LDYNAMIC_KEY_FILTER_AND_SORT = "M4LDynamicFilterAndSort";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const ICON_PATH_FILTER = "frontend/components/data_grid/assets/icons/filter.svg";
|
|
2
|
+
export declare const ICON_PATH_SORT = "frontend/components/data_grid/assets/icons/sort.svg";
|
|
3
|
+
export declare const ASSETS_URL = "frontend/components/Dynamic_sort/assets/icons";
|
|
4
|
+
export declare const ASSETS: {
|
|
5
|
+
readonly refresh: "frontend/components/Dynamic_sort/assets/icons/restart.svg";
|
|
6
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const ICON_PATH_FILTER = "frontend/components/data_grid/assets/icons/filter.svg";
|
|
2
|
+
const ICON_PATH_SORT = "frontend/components/data_grid/assets/icons/sort.svg";
|
|
3
|
+
const ASSETS_URL = "frontend/components/Dynamic_sort/assets/icons";
|
|
4
|
+
const ASSETS = {
|
|
5
|
+
refresh: `${ASSETS_URL}/restart.svg`
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
ASSETS as A,
|
|
9
|
+
ICON_PATH_FILTER as I,
|
|
10
|
+
ICON_PATH_SORT as a
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
var DynamicFilterAndSortSlots = /* @__PURE__ */ ((DynamicFilterAndSortSlots2) => {
|
|
2
|
+
DynamicFilterAndSortSlots2["stackLeftActions"] = "stackLeftActions";
|
|
3
|
+
DynamicFilterAndSortSlots2["stackCustomHeader"] = "stackCustomHeader";
|
|
4
|
+
DynamicFilterAndSortSlots2["stackRightActions"] = "stackRightActions";
|
|
5
|
+
return DynamicFilterAndSortSlots2;
|
|
6
|
+
})(DynamicFilterAndSortSlots || {});
|
|
7
|
+
export {
|
|
8
|
+
DynamicFilterAndSortSlots as D
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const StackLeftActionsStyled: import('@emotion/styled').StyledComponent<Pick<import('../../..').StackProps, keyof import('../../..').StackProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Partial<import('../types').DynamicFilterAndSortOwnerState> & Record<string, unknown> & {
|
|
2
|
+
ownerState: Partial<import('../types').DynamicFilterAndSortOwnerState> & Record<string, unknown>;
|
|
3
|
+
}, {}, {}>;
|
|
4
|
+
export declare const StackCustomHeaderStyled: import('@emotion/styled').StyledComponent<Pick<import('../../..').StackProps, keyof import('../../..').StackProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Partial<import('../types').DynamicFilterAndSortOwnerState> & Record<string, unknown> & {
|
|
5
|
+
ownerState: Partial<import('../types').DynamicFilterAndSortOwnerState> & Record<string, unknown>;
|
|
6
|
+
}, {}, {}>;
|
|
7
|
+
export declare const StackRightActionsStyled: import('@emotion/styled').StyledComponent<Pick<import('../../..').StackProps, keyof import('../../..').StackProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Partial<import('../types').DynamicFilterAndSortOwnerState> & Record<string, unknown> & {
|
|
8
|
+
ownerState: Partial<import('../types').DynamicFilterAndSortOwnerState> & Record<string, unknown>;
|
|
9
|
+
}, {}, {}>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { styled } from "@mui/material/styles";
|
|
2
|
+
import { M as M4LDYNAMIC_KEY_FILTER_AND_SORT } from "../constants.js";
|
|
3
|
+
import { S as Stack } from "../../../components/mui_extended/Stack/Stack.js";
|
|
4
|
+
import { D as DynamicFilterAndSortSlots } from "./DynamicFilterAndSortEnum.js";
|
|
5
|
+
import { d as dynamicFilterAndSortStyles } from "../styles.js";
|
|
6
|
+
const StackLeftActionsStyled = styled(Stack, {
|
|
7
|
+
name: M4LDYNAMIC_KEY_FILTER_AND_SORT,
|
|
8
|
+
slot: DynamicFilterAndSortSlots.stackLeftActions
|
|
9
|
+
})(dynamicFilterAndSortStyles.stackLeftActions);
|
|
10
|
+
const StackCustomHeaderStyled = styled(Stack, {
|
|
11
|
+
name: M4LDYNAMIC_KEY_FILTER_AND_SORT,
|
|
12
|
+
slot: DynamicFilterAndSortSlots.stackCustomHeader
|
|
13
|
+
})(dynamicFilterAndSortStyles.stackCustomHeader);
|
|
14
|
+
const StackRightActionsStyled = styled(Stack, {
|
|
15
|
+
name: M4LDYNAMIC_KEY_FILTER_AND_SORT,
|
|
16
|
+
slot: DynamicFilterAndSortSlots.stackRightActions
|
|
17
|
+
})(dynamicFilterAndSortStyles.stackRightActions);
|
|
18
|
+
export {
|
|
19
|
+
StackLeftActionsStyled as S,
|
|
20
|
+
StackRightActionsStyled as a,
|
|
21
|
+
StackCustomHeaderStyled as b
|
|
22
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
const dynamicFilterAndSortStyles = {
|
|
2
|
+
/**
|
|
3
|
+
* Estilos para los leftActions
|
|
4
|
+
*/
|
|
5
|
+
stackLeftActions: ({ theme }) => ({
|
|
6
|
+
gap: theme.vars.size.baseSpacings.sp1,
|
|
7
|
+
"& .MuiBadge-badge": {
|
|
8
|
+
width: `${theme.vars.size.baseSpacings.sp2} !important`,
|
|
9
|
+
minWidth: `${theme.vars.size.baseSpacings.sp2} !important`,
|
|
10
|
+
minHeight: `${theme.vars.size.baseSpacings.sp2} !important`,
|
|
11
|
+
height: `${theme.vars.size.baseSpacings.sp2} !important`,
|
|
12
|
+
backgroundColor: `${theme.vars.palette.primary.enabled} !important`
|
|
13
|
+
}
|
|
14
|
+
}),
|
|
15
|
+
/**
|
|
16
|
+
* Estilos para el Stack que contiene los componentes de filtro y ordenamiento
|
|
17
|
+
*/
|
|
18
|
+
stackCustomHeader: ({ theme, ownerState }) => ({
|
|
19
|
+
flexDirection: theme.generalSettings.isMobile ? "column" : "row",
|
|
20
|
+
gap: theme.vars.size.baseSpacings.sp3,
|
|
21
|
+
padding: `0 ${theme.vars.size.baseSpacings.sp1}`,
|
|
22
|
+
'& [class*="M4LDynamicFilter-root"]': {
|
|
23
|
+
display: ownerState.showDynamicFilter ? "block" : "none",
|
|
24
|
+
width: "auto",
|
|
25
|
+
flexGrow: theme.generalSettings.isMobile ? 1 : 2
|
|
26
|
+
},
|
|
27
|
+
'& [class*="dynamic_sort-root"]': {
|
|
28
|
+
display: ownerState.showDynamicSort ? "block" : "none",
|
|
29
|
+
width: "auto",
|
|
30
|
+
flexGrow: 1
|
|
31
|
+
}
|
|
32
|
+
}),
|
|
33
|
+
/**
|
|
34
|
+
* Estilos para el Stack que contiene los componentes de filtro y ordenamiento
|
|
35
|
+
*/
|
|
36
|
+
stackRightActions: ({ theme }) => ({
|
|
37
|
+
alignItems: "center",
|
|
38
|
+
gap: theme.vars.size.baseSpacings.sp1
|
|
39
|
+
})
|
|
40
|
+
};
|
|
41
|
+
export {
|
|
42
|
+
dynamicFilterAndSortStyles as d
|
|
43
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { DynamicSortProps, InitialSortApplied, RawSortFieldApply } from '../../components/DynamicSort/types';
|
|
2
|
+
import { DynamicFilterProps, InitialFilterApplied, RawFilterFieldApply } from '../../components/DynamicFilter/types';
|
|
3
|
+
import { OverridesStyleRules } from '@mui/material/styles/overrides';
|
|
4
|
+
import { DynamicFilterAndSortSlots } from './slots/DynamicFilterAndSortEnum';
|
|
5
|
+
import { M4LDYNAMIC_KEY_FILTER_AND_SORT } from './constants';
|
|
6
|
+
import { Theme } from '@mui/material/styles';
|
|
7
|
+
interface ChangeFilter {
|
|
8
|
+
filters?: Array<InitialFilterApplied>;
|
|
9
|
+
rawFilters?: Array<RawFilterFieldApply>;
|
|
10
|
+
}
|
|
11
|
+
interface ChangeSort {
|
|
12
|
+
sorts?: Array<InitialSortApplied>;
|
|
13
|
+
rawSorts?: Array<RawSortFieldApply>;
|
|
14
|
+
}
|
|
15
|
+
export interface ChangeFilterSort {
|
|
16
|
+
eventFilters?: ChangeFilter;
|
|
17
|
+
eventSorts?: ChangeSort;
|
|
18
|
+
}
|
|
19
|
+
export interface UseDynamicFilterAndSortProps extends Pick<DynamicFilterProps, 'fields' | 'withAllField' | 'initialAppliedFilters'> {
|
|
20
|
+
initialFilterToggleed?: boolean;
|
|
21
|
+
initialSortToggleed?: boolean;
|
|
22
|
+
rightActions?: React.ReactNode;
|
|
23
|
+
onChangeFilterSort: (params: ChangeFilterSort) => void;
|
|
24
|
+
dataTestId?: string;
|
|
25
|
+
sorts?: DynamicSortProps['fields'];
|
|
26
|
+
initialAppliedSorts?: DynamicSortProps['initialAppliedSorts'];
|
|
27
|
+
}
|
|
28
|
+
export interface DynamicFilterAndSortOwnerState {
|
|
29
|
+
showDynamicFilter: boolean;
|
|
30
|
+
showDynamicSort: boolean;
|
|
31
|
+
}
|
|
32
|
+
export type DynamicFilterAndSortSlotsType = keyof typeof DynamicFilterAndSortSlots;
|
|
33
|
+
export type DynamicFilterAndSortStyles = OverridesStyleRules<DynamicFilterAndSortSlotsType, typeof M4LDYNAMIC_KEY_FILTER_AND_SORT, Theme>;
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { UseDynamicFilterAndSortProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Hook para manejar los filtros y ordenamientos dinamicos
|
|
4
|
+
*/
|
|
5
|
+
export declare const useDynamicFilterAndSort: (props: UseDynamicFilterAndSortProps) => {
|
|
6
|
+
leftActions: import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
rightActions: import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
visibleCustomHeader: boolean;
|
|
9
|
+
customHeaderComponent: import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useEnvironment } from "@m4l/core";
|
|
3
|
+
import { T as ToggleIconButton } from "../../components/mui_extended/ToggleIconButton/ToggleIconButton.js";
|
|
4
|
+
import { I as ICON_PATH_FILTER, a as ICON_PATH_SORT, A as ASSETS } from "./icons.js";
|
|
5
|
+
import { useState, useMemo, useRef, useCallback } from "react";
|
|
6
|
+
import { D as DynamicFilter } from "../../components/DynamicFilter/DynamicFilter.js";
|
|
7
|
+
import { D as DynamicSort } from "../../components/DynamicSort/DynamicSort.js";
|
|
8
|
+
import { S as StackLeftActionsStyled, a as StackRightActionsStyled, b as StackCustomHeaderStyled } from "./slots/DynamicFilterAndSortSlots.js";
|
|
9
|
+
import { B as Badge } from "../../components/mui_extended/Badge/Badge.js";
|
|
10
|
+
import { g as getPropDataTestId } from "../../test/getNameDataTestId.js";
|
|
11
|
+
import { M as M4LDYNAMIC_KEY_FILTER_AND_SORT } from "./constants.js";
|
|
12
|
+
import { D as DynamicFilterAndSortSlots } from "./slots/DynamicFilterAndSortEnum.js";
|
|
13
|
+
import { I as IconButton } from "../../components/mui_extended/IconButton/IconButton.js";
|
|
14
|
+
const useDynamicFilterAndSort = (props) => {
|
|
15
|
+
const { fields, sorts, onChangeFilterSort, dataTestId, initialAppliedFilters, initialAppliedSorts, withAllField, rightActions, initialFilterToggleed = true, initialSortToggleed = true } = props;
|
|
16
|
+
const { host_static_assets, environment_assets } = useEnvironment();
|
|
17
|
+
const [togglesLeftActions, setTogglesLeftActions] = useState({ filter: initialFilterToggleed, sort: initialSortToggleed });
|
|
18
|
+
const [invisibleBadge, setInvisibleBadge] = useState({
|
|
19
|
+
filter: initialAppliedFilters?.length === 0,
|
|
20
|
+
sort: initialAppliedSorts?.length === 0
|
|
21
|
+
});
|
|
22
|
+
const visibleCustomHeader = useMemo(() => togglesLeftActions.filter || togglesLeftActions.sort, [togglesLeftActions]);
|
|
23
|
+
const sortIconUrl = `${host_static_assets}/${environment_assets}/${ASSETS.refresh}`;
|
|
24
|
+
const eventRefs = useRef({
|
|
25
|
+
eventFilters: { filters: initialAppliedFilters, rawFilters: [] },
|
|
26
|
+
eventSorts: { sorts: initialAppliedSorts, rawSorts: [] }
|
|
27
|
+
});
|
|
28
|
+
const handleToggles = (key) => {
|
|
29
|
+
setTogglesLeftActions((prev) => ({ ...prev, [key]: !prev[key] }));
|
|
30
|
+
};
|
|
31
|
+
const handleChangeFilters = useCallback(
|
|
32
|
+
(filters, rawFilters) => {
|
|
33
|
+
setInvisibleBadge((prev) => ({ ...prev, filter: filters.length === 0 }));
|
|
34
|
+
eventRefs.current = {
|
|
35
|
+
...eventRefs.current,
|
|
36
|
+
eventFilters: { filters, rawFilters }
|
|
37
|
+
};
|
|
38
|
+
onChangeFilterSort(eventRefs.current);
|
|
39
|
+
},
|
|
40
|
+
[onChangeFilterSort]
|
|
41
|
+
);
|
|
42
|
+
const handleChangeSorts = useCallback((Sorts, rawSorts) => {
|
|
43
|
+
setInvisibleBadge((prev) => ({ ...prev, sort: Sorts.length === 0 }));
|
|
44
|
+
eventRefs.current = {
|
|
45
|
+
...eventRefs.current,
|
|
46
|
+
eventSorts: { sorts: Sorts, rawSorts }
|
|
47
|
+
};
|
|
48
|
+
onChangeFilterSort(eventRefs.current);
|
|
49
|
+
}, [onChangeFilterSort]);
|
|
50
|
+
const onRefresh = useCallback(() => {
|
|
51
|
+
onChangeFilterSort(eventRefs.current);
|
|
52
|
+
}, [onChangeFilterSort]);
|
|
53
|
+
const leftActions = useMemo(() => /* @__PURE__ */ jsxs(StackLeftActionsStyled, { direction: "row", ownerState: {}, ...getPropDataTestId(M4LDYNAMIC_KEY_FILTER_AND_SORT, DynamicFilterAndSortSlots.stackLeftActions, dataTestId), children: [
|
|
54
|
+
/* @__PURE__ */ jsx(Badge, { badgeContent: "", size: "small", color: "primary", invisible: invisibleBadge.filter, children: /* @__PURE__ */ jsx(ToggleIconButton, { icon: `${host_static_assets}/${environment_assets}/${ICON_PATH_FILTER}`, isToggled: togglesLeftActions.filter, onToggle: () => handleToggles("filter") }) }),
|
|
55
|
+
/* @__PURE__ */ jsx(Badge, { badgeContent: "", size: "small", color: "primary", invisible: invisibleBadge.sort, children: /* @__PURE__ */ jsx(ToggleIconButton, { icon: `${host_static_assets}/${environment_assets}/${ICON_PATH_SORT}`, isToggled: togglesLeftActions.sort, onToggle: () => handleToggles("sort") }) })
|
|
56
|
+
] }), [togglesLeftActions, invisibleBadge, host_static_assets, environment_assets]);
|
|
57
|
+
const finalRightActions = useMemo(() => /* @__PURE__ */ jsxs(
|
|
58
|
+
StackRightActionsStyled,
|
|
59
|
+
{
|
|
60
|
+
direction: "row",
|
|
61
|
+
ownerState: {},
|
|
62
|
+
...getPropDataTestId(M4LDYNAMIC_KEY_FILTER_AND_SORT, DynamicFilterAndSortSlots.stackRightActions, dataTestId),
|
|
63
|
+
children: [
|
|
64
|
+
/* @__PURE__ */ jsx(
|
|
65
|
+
IconButton,
|
|
66
|
+
{
|
|
67
|
+
icon: sortIconUrl,
|
|
68
|
+
"aria-label": "refresh",
|
|
69
|
+
onClick: onRefresh
|
|
70
|
+
}
|
|
71
|
+
),
|
|
72
|
+
rightActions
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
), [dataTestId, rightActions, sortIconUrl, onRefresh]);
|
|
76
|
+
const dynamicsFiltersSorts = useMemo(() => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
77
|
+
/* @__PURE__ */ jsx(DynamicFilter, { fields, initialAppliedFilters, onChangeFilters: handleChangeFilters, withAllField }),
|
|
78
|
+
sorts ? /* @__PURE__ */ jsx(DynamicSort, { fields: sorts, initialAppliedSorts, onChangeSorts: handleChangeSorts }) : null
|
|
79
|
+
] }), [fields, sorts, initialAppliedFilters, initialAppliedSorts, handleChangeFilters, handleChangeSorts, withAllField]);
|
|
80
|
+
const customHeaderComponent = useMemo(() => /* @__PURE__ */ jsx(StackCustomHeaderStyled, { direction: "row", ownerState: { showDynamicFilter: togglesLeftActions.filter, showDynamicSort: togglesLeftActions.sort }, ...getPropDataTestId(M4LDYNAMIC_KEY_FILTER_AND_SORT, DynamicFilterAndSortSlots.stackCustomHeader, dataTestId), children: dynamicsFiltersSorts }), [togglesLeftActions]);
|
|
81
|
+
return {
|
|
82
|
+
leftActions,
|
|
83
|
+
rightActions: finalRightActions,
|
|
84
|
+
visibleCustomHeader,
|
|
85
|
+
customHeaderComponent
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
export {
|
|
89
|
+
useDynamicFilterAndSort as u
|
|
90
|
+
};
|