@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
|
@@ -2,6 +2,7 @@ import { useRef, useMemo, useCallback } from "react";
|
|
|
2
2
|
import { useModuleDictionary } from "@m4l/core";
|
|
3
3
|
import { u as useDynamicFilterStore } from "../../store/useDynamicFilterStore.js";
|
|
4
4
|
import { f as fieldFactory } from "../FieldTypes/fieldFactory.js";
|
|
5
|
+
import { shallow } from "zustand/shallow";
|
|
5
6
|
function usePopoverFilter() {
|
|
6
7
|
let anchorEl;
|
|
7
8
|
let field;
|
|
@@ -10,7 +11,7 @@ function usePopoverFilter() {
|
|
|
10
11
|
let popupValidationSchema;
|
|
11
12
|
const { getLabel } = useModuleDictionary();
|
|
12
13
|
const popoverFilterData = useDynamicFilterStore((state) => state.popoverFilterData);
|
|
13
|
-
const elementRef = useDynamicFilterStore((state) => state.
|
|
14
|
+
const elementRef = useDynamicFilterStore((state) => state.actions.getElementRef(), shallow);
|
|
14
15
|
const { hidePopoverFilter, addFilter, updateFilter, getNewId } = useDynamicFilterStore(
|
|
15
16
|
(state) => state.actions
|
|
16
17
|
);
|
|
@@ -5,7 +5,6 @@ import { FilterField } from '../../types';
|
|
|
5
5
|
*/
|
|
6
6
|
declare function usePopoverMenuFields(): {
|
|
7
7
|
elementRef: import('react').MutableRefObject<HTMLElement | null> | null;
|
|
8
|
-
openPopoverMenuFields: boolean | undefined;
|
|
9
8
|
isOpenPopoverMenuFields: boolean | undefined;
|
|
10
9
|
getItemLabel: (field: FilterField) => string;
|
|
11
10
|
handleClosePopover: () => void;
|
|
@@ -3,8 +3,7 @@ import { u as useDynamicFilterStore } from "../../store/useDynamicFilterStore.js
|
|
|
3
3
|
import { shallow } from "zustand/shallow";
|
|
4
4
|
function usePopoverMenuFields() {
|
|
5
5
|
const { getLabel } = useModuleDictionary();
|
|
6
|
-
const
|
|
7
|
-
const elementRef = useDynamicFilterStore((state) => state.elementRef, shallow);
|
|
6
|
+
const elementRef = useDynamicFilterStore((state) => state.actions.getElementRef(), shallow);
|
|
8
7
|
const isOpenPopoverMenuFields = useDynamicFilterStore((state) => state.isOpenPopoverMenuFields);
|
|
9
8
|
const { showPopoverFilterForAdd, closePopoverMenuFields } = useDynamicFilterStore(
|
|
10
9
|
(state) => state.actions
|
|
@@ -20,7 +19,6 @@ function usePopoverMenuFields() {
|
|
|
20
19
|
}
|
|
21
20
|
return {
|
|
22
21
|
elementRef,
|
|
23
|
-
openPopoverMenuFields,
|
|
24
22
|
isOpenPopoverMenuFields,
|
|
25
23
|
getItemLabel,
|
|
26
24
|
handleClosePopover,
|
|
@@ -134,8 +134,8 @@ export interface RawFilterFieldApply {
|
|
|
134
134
|
o: Operator;
|
|
135
135
|
ft: FieldType;
|
|
136
136
|
o1: Maybe<OperandType>;
|
|
137
|
-
o2
|
|
138
|
-
oa
|
|
137
|
+
o2?: Maybe<OperandType>;
|
|
138
|
+
oa?: Maybe<OperandType[]>;
|
|
139
139
|
}
|
|
140
140
|
export type FilterToEditApply = FilterFieldApplied;
|
|
141
141
|
export interface DataTypeFilerLabels {
|
|
@@ -35,6 +35,9 @@ const dynamicSortStyles = {
|
|
|
35
35
|
gridTemplateAreas: `"input-sort actions-sort"
|
|
36
36
|
"applied-sorts applied-sorts"`
|
|
37
37
|
},
|
|
38
|
+
'&:has([aria-expanded="true"])': {
|
|
39
|
+
borderColor: theme.vars.palette.primary.active
|
|
40
|
+
},
|
|
38
41
|
"&:focus-within": {
|
|
39
42
|
borderColor: !ownerState.isValid ? theme.vars.palette.error.enabled : theme.vars.palette.primary.active
|
|
40
43
|
},
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SortOperator } from './types';
|
|
2
2
|
export declare const DYNAMIC_SORT_KEY_COMPONENT = "M4LDynamicSort";
|
|
3
|
+
export declare const DYNAMIC_SORT_STORE_ID = "M4LDynamicSortStore";
|
|
3
4
|
export declare const ASSETS_URL = "frontend/components/Dynamic_sort/assets/icons";
|
|
4
5
|
export declare const ASSETS: {
|
|
5
6
|
readonly refresh: "restart.svg";
|
|
@@ -7,5 +8,4 @@ export declare const ASSETS: {
|
|
|
7
8
|
readonly list_bulleted: "list_bulleted.svg";
|
|
8
9
|
readonly clean: "clean.svg";
|
|
9
10
|
};
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const OPERATORS: Array<Operator>;
|
|
11
|
+
export declare const OPERATORS: Array<SortOperator>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const DYNAMIC_SORT_KEY_COMPONENT = "M4LDynamicSort";
|
|
2
|
+
const DYNAMIC_SORT_STORE_ID = "M4LDynamicSortStore";
|
|
2
3
|
const ASSETS_URL = "frontend/components/Dynamic_sort/assets/icons";
|
|
3
4
|
const ASSETS = {
|
|
4
5
|
refresh: "restart.svg",
|
|
@@ -6,10 +7,11 @@ const ASSETS = {
|
|
|
6
7
|
list_bulleted: "list_bulleted.svg",
|
|
7
8
|
clean: "clean.svg"
|
|
8
9
|
};
|
|
9
|
-
const
|
|
10
|
+
const OPERATORS = ["asc", "desc"];
|
|
10
11
|
export {
|
|
11
12
|
ASSETS_URL as A,
|
|
12
13
|
DYNAMIC_SORT_KEY_COMPONENT as D,
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
OPERATORS as O,
|
|
15
|
+
DYNAMIC_SORT_STORE_ID as a,
|
|
16
|
+
ASSETS as b
|
|
15
17
|
};
|
|
@@ -22,7 +22,8 @@ const getDynamicSortDictionary = (key) => {
|
|
|
22
22
|
return `${DYNAMICSORT_DICTIONARY_ID}.${key}`;
|
|
23
23
|
};
|
|
24
24
|
export {
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
DYNAMICSORT_DICTIONARY_ID as D,
|
|
26
|
+
DICCTIONARY as a,
|
|
27
|
+
getDynamicSortComponentsDictionary as b,
|
|
27
28
|
getDynamicSortDictionary as g
|
|
28
29
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
const formatToRowSort = (appliedSorts) => {
|
|
2
2
|
const sortsApplied = appliedSorts.map((appliedSort) => ({
|
|
3
|
-
|
|
4
|
-
o: appliedSort.operator
|
|
3
|
+
n: appliedSort.field.name,
|
|
4
|
+
o: appliedSort.operator,
|
|
5
|
+
ft: appliedSort.field.type
|
|
5
6
|
}));
|
|
6
7
|
return sortsApplied;
|
|
7
8
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SortFieldType, SortOperator } from '../types';
|
|
2
|
+
type SortValue = string | number | boolean | Date | null;
|
|
3
|
+
/**
|
|
4
|
+
* Comparadir de valores para el sort cuando se usa en el frontEnd, y no atraves de la API
|
|
5
|
+
*/
|
|
6
|
+
export declare const SortCompareValues: (valueA: SortValue, valueB: SortValue, fieldType: SortFieldType, order: SortOperator) => number;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { g as getValidDate } from "../../../utils/getValidDate.js";
|
|
2
|
+
const SortCompareValues = (valueA, valueB, fieldType, order) => {
|
|
3
|
+
if (valueA === null || valueB === null) {
|
|
4
|
+
return 0;
|
|
5
|
+
}
|
|
6
|
+
switch (fieldType) {
|
|
7
|
+
case "string":
|
|
8
|
+
if (typeof valueA === "string" && typeof valueB === "string") {
|
|
9
|
+
return order === "asc" ? valueA.localeCompare(valueB) : valueB.localeCompare(valueA);
|
|
10
|
+
}
|
|
11
|
+
return 0;
|
|
12
|
+
case "number":
|
|
13
|
+
if (typeof valueA === "number" && typeof valueB === "number") {
|
|
14
|
+
return order === "asc" ? valueA - valueB : valueB - valueA;
|
|
15
|
+
}
|
|
16
|
+
return 0;
|
|
17
|
+
case "boolean":
|
|
18
|
+
if (typeof valueA === "boolean" && typeof valueB === "boolean") {
|
|
19
|
+
const comparison = valueA === valueB ? 0 : valueA ? 1 : -1;
|
|
20
|
+
if (comparison !== 0) {
|
|
21
|
+
return order === "asc" ? comparison : -comparison;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return 0;
|
|
25
|
+
case "date":
|
|
26
|
+
const dateA = getValidDate(valueA);
|
|
27
|
+
const dateB = getValidDate(valueB);
|
|
28
|
+
if (dateA === null || dateB === null) {
|
|
29
|
+
return 0;
|
|
30
|
+
}
|
|
31
|
+
return order === "asc" ? dateA.getTime() - dateB.getTime() : dateB.getTime() - dateA.getTime();
|
|
32
|
+
default:
|
|
33
|
+
return 0;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
export {
|
|
37
|
+
SortCompareValues as S
|
|
38
|
+
};
|
|
@@ -18,7 +18,7 @@ const getPurgedInitialSortApplied = (fields, initialSort, getFieldByName) => {
|
|
|
18
18
|
if (!field) {
|
|
19
19
|
continue;
|
|
20
20
|
}
|
|
21
|
-
const add = fieldFactory(
|
|
21
|
+
const add = fieldFactory().verifySort(initialSortData, field);
|
|
22
22
|
if (add === true) {
|
|
23
23
|
if (field.presence === "fixed") {
|
|
24
24
|
if (fixedFields.findIndex((f) => f === field.name) === -1) {
|
|
@@ -39,7 +39,7 @@ const getPurgedInitialSortApplied = (fields, initialSort, getFieldByName) => {
|
|
|
39
39
|
const field = fields[index];
|
|
40
40
|
if (field.presence === "initialized" || field.presence === "fixed") {
|
|
41
41
|
if (!initialSort.find((f) => f.name === field.name)) {
|
|
42
|
-
const newFilter = fieldFactory(
|
|
42
|
+
const newFilter = fieldFactory().getDefaultSort(
|
|
43
43
|
field,
|
|
44
44
|
field.presence === "fixed"
|
|
45
45
|
);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export * from './DynamicSort';
|
|
2
2
|
export { getDynamicSortComponentsDictionary } from './dictionary';
|
|
3
|
-
export type { SortFieldApplied
|
|
3
|
+
export type { SortFieldApplied, RawSortFieldApply, InitialSortApplied, SortField, SortFieldType, SortOperator, } from './types';
|
|
4
|
+
export { SortCompareValues } from './helpers/frontEndHelpers';
|
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
export declare const RootStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> &
|
|
1
|
+
export declare const RootStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
2
2
|
ownerState: Partial<import('../types').DynamicSortOwnerState> & Record<string, unknown>;
|
|
3
|
-
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').
|
|
4
|
-
export declare const InnerContainerStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> &
|
|
3
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
4
|
+
export declare const InnerContainerStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
5
5
|
ownerState: Partial<import('../types').DynamicSortOwnerState> & Record<string, unknown>;
|
|
6
|
-
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').
|
|
7
|
-
export declare const InputSortStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> &
|
|
6
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
7
|
+
export declare const InputSortStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
8
8
|
ownerState: Partial<import('../types').DynamicSortOwnerState> & Record<string, unknown>;
|
|
9
|
-
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').
|
|
10
|
-
export declare const InputSortInputStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> &
|
|
9
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
10
|
+
export declare const InputSortInputStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
11
11
|
ownerState: Partial<import('../types').DynamicSortOwnerState> & Record<string, unknown>;
|
|
12
12
|
}, Pick<import('react').DetailedHTMLProps<import('react').InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, keyof import('react').ClassAttributes<HTMLInputElement> | keyof import('react').InputHTMLAttributes<HTMLInputElement>>, {}>;
|
|
13
|
-
export declare const InputSortIconStyled: import('@emotion/styled').StyledComponent<Pick<import('../../Icon').IconProps, keyof import('../../Icon').IconProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> &
|
|
13
|
+
export declare const InputSortIconStyled: import('@emotion/styled').StyledComponent<Pick<import('../../Icon').IconProps, keyof import('../../Icon').IconProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
14
14
|
ownerState: Partial<import('../types').DynamicSortOwnerState> & Record<string, unknown>;
|
|
15
15
|
}, {}, {}>;
|
|
16
|
-
export declare const AppliedSortsStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> &
|
|
16
|
+
export declare const AppliedSortsStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
17
17
|
ownerState: Partial<import('../types').DynamicSortOwnerState> & Record<string, unknown>;
|
|
18
|
-
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').
|
|
19
|
-
export declare const AppliedSortInnerContainerStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> &
|
|
18
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
19
|
+
export declare const AppliedSortInnerContainerStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
20
20
|
ownerState: Partial<import('../types').DynamicSortOwnerState> & Record<string, unknown>;
|
|
21
|
-
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').
|
|
22
|
-
export declare const AppliedSortChipStyled: import('@emotion/styled').StyledComponent<Pick<import('../../Chip').ChipProps & import('react').RefAttributes<HTMLDivElement>, keyof import('react').RefAttributes<HTMLDivElement> | keyof import('../../Chip').ChipProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> &
|
|
21
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
22
|
+
export declare const AppliedSortChipStyled: import('@emotion/styled').StyledComponent<Pick<import('../../Chip').ChipProps & import('react').RefAttributes<HTMLDivElement>, keyof import('react').RefAttributes<HTMLDivElement> | keyof import('../../Chip').ChipProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
23
23
|
ownerState: Partial<import('../types').DynamicSortOwnerState> & Record<string, unknown>;
|
|
24
24
|
}, {}, {}>;
|
|
25
|
-
export declare const ActionsStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> &
|
|
25
|
+
export declare const ActionsStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
26
26
|
ownerState: Partial<import('../types').DynamicSortOwnerState> & Record<string, unknown>;
|
|
27
|
-
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').
|
|
28
|
-
export declare const ActionsClearButtonStyled: import('@emotion/styled').StyledComponent<Pick<Omit<import('../../mui_extended/IconButton/types').IconButtonProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>, "value" | "size" | "children" | "title" | "component" | "name" | "id" | "type" | "selected" | "disabled" | "action" | "hidden" | "content" | "style" | "icon" | "tooltip" | "variant" | "translate" | "
|
|
27
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
28
|
+
export declare const ActionsClearButtonStyled: import('@emotion/styled').StyledComponent<Pick<Omit<import('../../mui_extended/IconButton/types').IconButtonProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>, "value" | "size" | "children" | "title" | "component" | "name" | "id" | "type" | "selected" | "disabled" | "action" | "hidden" | "content" | "style" | "icon" | "tooltip" | "variant" | "translate" | "className" | "classes" | "src" | "sx" | "form" | "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" | "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" | "instaceDataTestId" | "rotationAngle" | "placement" | "tooltipContent" | "componentPaletteColor" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "edge" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "badgeContent" | "dictionaryTooltipId" | keyof import('react').RefAttributes<HTMLButtonElement>> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
29
29
|
ownerState: Partial<import('../types').DynamicSortOwnerState> & Record<string, unknown>;
|
|
30
30
|
}, {}, {}>;
|
|
31
|
-
export declare const ActionsSubmitButtonStyled: import('@emotion/styled').StyledComponent<Pick<Omit<import('../../mui_extended/IconButton/types').IconButtonProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>, "value" | "size" | "children" | "title" | "component" | "name" | "id" | "type" | "selected" | "disabled" | "action" | "hidden" | "content" | "style" | "icon" | "tooltip" | "variant" | "translate" | "
|
|
31
|
+
export declare const ActionsSubmitButtonStyled: import('@emotion/styled').StyledComponent<Pick<Omit<import('../../mui_extended/IconButton/types').IconButtonProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>, "value" | "size" | "children" | "title" | "component" | "name" | "id" | "type" | "selected" | "disabled" | "action" | "hidden" | "content" | "style" | "icon" | "tooltip" | "variant" | "translate" | "className" | "classes" | "src" | "sx" | "form" | "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" | "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" | "instaceDataTestId" | "rotationAngle" | "placement" | "tooltipContent" | "componentPaletteColor" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "edge" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "badgeContent" | "dictionaryTooltipId" | keyof import('react').RefAttributes<HTMLButtonElement>> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
32
32
|
ownerState: Partial<import('../types').DynamicSortOwnerState> & Record<string, unknown>;
|
|
33
33
|
}, {}, {}>;
|
|
34
|
-
export declare const PopoverMenuStyled: import('@emotion/styled').StyledComponent<Pick<import('../../mui_extended/Popover/types').PopoverProps, keyof import('../../mui_extended/Popover/types').PopoverProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> &
|
|
34
|
+
export declare const PopoverMenuStyled: import('@emotion/styled').StyledComponent<Pick<import('../../mui_extended/Popover/types').PopoverProps, keyof import('../../mui_extended/Popover/types').PopoverProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
35
35
|
ownerState: Partial<import('../types').DynamicSortOwnerState> & Record<string, unknown>;
|
|
36
36
|
}, {}, {}>;
|
|
37
|
-
export declare const PopoverMenuItemStyled: import('@emotion/styled').StyledComponent<Pick<import('../../mui_extended/MenuItem/types').MenuItemProps, keyof import('../../mui_extended/MenuItem/types').MenuItemProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> &
|
|
37
|
+
export declare const PopoverMenuItemStyled: import('@emotion/styled').StyledComponent<Pick<import('../../mui_extended/MenuItem/types').MenuItemProps, keyof import('../../mui_extended/MenuItem/types').MenuItemProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
38
38
|
ownerState: Partial<import('../types').DynamicSortOwnerState> & Record<string, unknown>;
|
|
39
39
|
}, {}, {}>;
|
|
40
|
-
export declare const PopoverMenuItemIconStyled: import('@emotion/styled').StyledComponent<Pick<import('../../Icon').IconProps, keyof import('../../Icon').IconProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> &
|
|
40
|
+
export declare const PopoverMenuItemIconStyled: import('@emotion/styled').StyledComponent<Pick<import('../../Icon').IconProps, keyof import('../../Icon').IconProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
41
41
|
ownerState: Partial<import('../types').DynamicSortOwnerState> & Record<string, unknown>;
|
|
42
42
|
}, {}, {}>;
|
|
43
|
-
export declare const PopoverStyled: import('@emotion/styled').StyledComponent<Pick<import('../../mui_extended/Popover/types').PopoverProps, keyof import('../../mui_extended/Popover/types').PopoverProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> &
|
|
43
|
+
export declare const PopoverStyled: import('@emotion/styled').StyledComponent<Pick<import('../../mui_extended/Popover/types').PopoverProps, keyof import('../../mui_extended/Popover/types').PopoverProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
44
44
|
ownerState: Partial<import('../types').DynamicSortOwnerState> & Record<string, unknown>;
|
|
45
45
|
}, {}, {}>;
|
|
46
|
-
export declare const PopoverContainerFieldsStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> &
|
|
46
|
+
export declare const PopoverContainerFieldsStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
47
47
|
ownerState: Partial<import('../types').DynamicSortOwnerState> & Record<string, unknown>;
|
|
48
|
-
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').
|
|
49
|
-
export declare const PopoverHeaderStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> &
|
|
48
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
49
|
+
export declare const PopoverHeaderStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
50
50
|
ownerState: Partial<import('../types').DynamicSortOwnerState> & Record<string, unknown>;
|
|
51
|
-
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').
|
|
52
|
-
export declare const PopoverHeaderIconStyled: import('@emotion/styled').StyledComponent<Pick<import('../../Icon').IconProps, keyof import('../../Icon').IconProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> &
|
|
51
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
52
|
+
export declare const PopoverHeaderIconStyled: import('@emotion/styled').StyledComponent<Pick<import('../../Icon').IconProps, keyof import('../../Icon').IconProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
53
53
|
ownerState: Partial<import('../types').DynamicSortOwnerState> & Record<string, unknown>;
|
|
54
54
|
}, {}, {}>;
|
|
55
|
-
export declare const PopoverHeaderTitleStyled: import('@emotion/styled').StyledComponent<Pick<import('../../mui_extended/Typography/types').TypographyProps, keyof import('../../mui_extended/Typography/types').TypographyProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> &
|
|
55
|
+
export declare const PopoverHeaderTitleStyled: import('@emotion/styled').StyledComponent<Pick<import('../../mui_extended/Typography/types').TypographyProps, keyof import('../../mui_extended/Typography/types').TypographyProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
56
56
|
ownerState: Partial<import('../types').DynamicSortOwnerState> & Record<string, unknown>;
|
|
57
57
|
}, {}, {}>;
|
|
58
|
-
export declare const PopoverHeaderActionsStyled: import('@emotion/styled').StyledComponent<Pick<import('../../CommonActions/components/ActionsContainer').ActionsContainerProps & import('react').RefAttributes<HTMLDivElement>, keyof import('react').RefAttributes<HTMLDivElement> | keyof import('../../CommonActions/components/ActionsContainer').ActionsContainerProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> &
|
|
58
|
+
export declare const PopoverHeaderActionsStyled: import('@emotion/styled').StyledComponent<Pick<import('../../CommonActions/components/ActionsContainer').ActionsContainerProps & import('react').RefAttributes<HTMLDivElement>, keyof import('react').RefAttributes<HTMLDivElement> | keyof import('../../CommonActions/components/ActionsContainer').ActionsContainerProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
59
59
|
ownerState: Partial<import('../types').DynamicSortOwnerState> & Record<string, unknown>;
|
|
60
60
|
}, {}, {}>;
|
|
61
|
-
export declare const InputSortInputSkeletonStyled: import('@emotion/styled').StyledComponent<Pick<import('../../mui_extended/Skeleton/types').SkeletonProps, keyof import('../../mui_extended/Skeleton/types').SkeletonProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> &
|
|
61
|
+
export declare const InputSortInputSkeletonStyled: import('@emotion/styled').StyledComponent<Pick<import('../../mui_extended/Skeleton/types').SkeletonProps, keyof import('../../mui_extended/Skeleton/types').SkeletonProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
62
62
|
ownerState: Partial<import('../types').DynamicSortOwnerState> & Record<string, unknown>;
|
|
63
63
|
}, {}, {}>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { DynamicSortProps } from '../types';
|
|
3
|
-
declare const DynamicSortContext: import('react').Context<(Omit<Omit<import('zustand').StoreApi<import('./
|
|
3
|
+
declare const DynamicSortContext: import('react').Context<(Omit<Omit<import('zustand').StoreApi<import('./types').DynamicSortStateWithActions>, "setState"> & {
|
|
4
4
|
setState<A extends string | {
|
|
5
5
|
type: unknown;
|
|
6
|
-
}>(partial: import('./
|
|
6
|
+
}>(partial: import('./types').DynamicSortStateWithActions | Partial<import('./types').DynamicSortStateWithActions> | ((state: import('./types').DynamicSortStateWithActions) => import('./types').DynamicSortStateWithActions | Partial<import('./types').DynamicSortStateWithActions>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
7
7
|
}, "setState"> & {
|
|
8
|
-
setState(nextStateOrUpdater: import('./
|
|
8
|
+
setState(nextStateOrUpdater: import('./types').DynamicSortStateWithActions | Partial<import('./types').DynamicSortStateWithActions> | ((state: import('immer/dist/internal').WritableDraft<import('./types').DynamicSortStateWithActions>) => void), shouldReplace?: boolean | undefined, action?: string | {
|
|
9
9
|
type: unknown;
|
|
10
10
|
} | undefined): void;
|
|
11
11
|
}) | null>;
|
|
@@ -2,8 +2,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { createContext, useRef, useEffect } from "react";
|
|
3
3
|
import { useStore } from "zustand";
|
|
4
4
|
import { shallow } from "zustand/shallow";
|
|
5
|
-
import { useModuleDictionary
|
|
6
|
-
import { useIsMobile, useFirstRender } from "@m4l/graphics";
|
|
5
|
+
import { useModuleDictionary } from "@m4l/core";
|
|
7
6
|
import { f as formatToInitialSorts } from "../helpers/formatToInitialSorts.js";
|
|
8
7
|
import { f as formatToRowSort } from "../helpers/formatToRowSort.js";
|
|
9
8
|
import { c as createAreaStore } from "./DynamicSortStore.js";
|
|
@@ -16,13 +15,12 @@ function DynamicSortProvider(props) {
|
|
|
16
15
|
onChangeSorts,
|
|
17
16
|
dataTestId = "",
|
|
18
17
|
size = "medium",
|
|
18
|
+
storeId,
|
|
19
|
+
storeDevtoolsEnabled,
|
|
19
20
|
children
|
|
20
21
|
} = props;
|
|
21
22
|
const { getLabel } = useModuleDictionary();
|
|
22
23
|
const dynamicSortStoreRef = useRef();
|
|
23
|
-
const isDesktop = !useIsMobile();
|
|
24
|
-
const isSkeleton = useModuleSkeleton();
|
|
25
|
-
const isFirstRender = useFirstRender([isDesktop, isSkeleton]);
|
|
26
24
|
if (!dynamicSortStoreRef.current) {
|
|
27
25
|
dynamicSortStoreRef.current = createAreaStore({
|
|
28
26
|
fields,
|
|
@@ -30,16 +28,15 @@ function DynamicSortProvider(props) {
|
|
|
30
28
|
getLabel,
|
|
31
29
|
dataTestId,
|
|
32
30
|
size,
|
|
31
|
+
storeId,
|
|
33
32
|
ownerState: {
|
|
34
|
-
isSkeleton,
|
|
35
33
|
isDirty: !automatic,
|
|
36
34
|
inEdition: false,
|
|
37
35
|
isValid: true,
|
|
38
|
-
isMobile: !isDesktop,
|
|
39
36
|
isEmpty: true,
|
|
40
37
|
size
|
|
41
38
|
}
|
|
42
|
-
});
|
|
39
|
+
}, storeDevtoolsEnabled);
|
|
43
40
|
dynamicSortStoreRef.current.getState().actions.init(initialAppliedSorts);
|
|
44
41
|
}
|
|
45
42
|
const countOnChangeSortsApplyed = useStore(
|
|
@@ -59,12 +56,6 @@ function DynamicSortProvider(props) {
|
|
|
59
56
|
);
|
|
60
57
|
}
|
|
61
58
|
}, [countOnChangeSortsApplyed]);
|
|
62
|
-
useEffect(() => {
|
|
63
|
-
if (isFirstRender) {
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
dynamicSortStoreRef.current?.getState().actions.setExternalState({ isMobile: !isDesktop, isSkeleton });
|
|
67
|
-
}, [isDesktop, isSkeleton]);
|
|
68
59
|
useEffect(() => {
|
|
69
60
|
if (automatic) {
|
|
70
61
|
dynamicSortStoreRef.current?.getState().actions.fireOnChangeSorts();
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { WritableDraft } from 'immer/dist/internal';
|
|
2
|
-
import { DynamicSortStateWithActions, InitialStoreProps } from './
|
|
2
|
+
import { DynamicSortStateWithActions, InitialStoreProps } from './types';
|
|
3
3
|
export type OpenFor = 'add' | 'edit';
|
|
4
4
|
/**
|
|
5
5
|
* Crea el store de zustand para el componente DynamicSort
|
|
6
6
|
* @param initProps Variables iniciales que necesita store para poder inicializarlo
|
|
7
7
|
* @returns
|
|
8
8
|
*/
|
|
9
|
-
export declare const createAreaStore: (initProps: InitialStoreProps) => Omit<Omit<import('zustand').StoreApi<DynamicSortStateWithActions>, "setState"> & {
|
|
9
|
+
export declare const createAreaStore: (initProps: InitialStoreProps, storeDevtoolsEnabled?: boolean) => Omit<Omit<import('zustand').StoreApi<DynamicSortStateWithActions>, "setState"> & {
|
|
10
10
|
setState<A extends string | {
|
|
11
11
|
type: unknown;
|
|
12
12
|
}>(partial: DynamicSortStateWithActions | Partial<DynamicSortStateWithActions> | ((state: DynamicSortStateWithActions) => DynamicSortStateWithActions | Partial<DynamicSortStateWithActions>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createStore } from "zustand";
|
|
2
2
|
import { devtools } from "zustand/middleware";
|
|
3
3
|
import { immer } from "zustand/middleware/immer";
|
|
4
|
+
import { a as DYNAMIC_SORT_STORE_ID } from "../constants.js";
|
|
4
5
|
import { g as getPurgedInitialSortApplied } from "../helpers/getPurgedInitialSortApplyed.js";
|
|
5
6
|
const updateAvailableFields = (state) => {
|
|
6
7
|
const newFields = [];
|
|
@@ -37,18 +38,26 @@ const updateAutomatic = (state) => {
|
|
|
37
38
|
}
|
|
38
39
|
}
|
|
39
40
|
};
|
|
40
|
-
const
|
|
41
|
+
const createDevtools = (immerMiddlewere, config) => {
|
|
42
|
+
const { enabled = false } = config;
|
|
43
|
+
if (enabled && process.env.NODE_ENV === "development") {
|
|
44
|
+
return devtools(immerMiddlewere, config);
|
|
45
|
+
}
|
|
46
|
+
return immerMiddlewere;
|
|
47
|
+
};
|
|
48
|
+
const createAreaStore = (initProps, storeDevtoolsEnabled = false) => {
|
|
41
49
|
const startProps = {
|
|
42
50
|
countOnChangeSortsApplyed: 0,
|
|
43
51
|
appliedSorts: [],
|
|
44
52
|
availableFields: [],
|
|
45
|
-
|
|
53
|
+
// elementRef: null,
|
|
46
54
|
popoverSortData: void 0,
|
|
47
55
|
inputData: "",
|
|
48
56
|
...initProps
|
|
49
57
|
};
|
|
58
|
+
let elementRef = null;
|
|
50
59
|
return createStore(
|
|
51
|
-
|
|
60
|
+
createDevtools(
|
|
52
61
|
immer((set, get) => ({
|
|
53
62
|
...startProps,
|
|
54
63
|
actions: {
|
|
@@ -65,6 +74,15 @@ const createAreaStore = (initProps) => {
|
|
|
65
74
|
updateAutomatic(state);
|
|
66
75
|
});
|
|
67
76
|
},
|
|
77
|
+
/**
|
|
78
|
+
* Actualiza la referencia del elemento (inputFilter) desde donde se desprende el listado de campos
|
|
79
|
+
*/
|
|
80
|
+
setElementRef: (ref) => {
|
|
81
|
+
elementRef = ref;
|
|
82
|
+
},
|
|
83
|
+
getElementRef: () => {
|
|
84
|
+
return elementRef;
|
|
85
|
+
},
|
|
68
86
|
/**
|
|
69
87
|
* Funcion para obtener un Field a través del nombre
|
|
70
88
|
*/
|
|
@@ -92,26 +110,24 @@ const createAreaStore = (initProps) => {
|
|
|
92
110
|
/**
|
|
93
111
|
* TODO: Documentar
|
|
94
112
|
*/
|
|
95
|
-
showPopoverSortForAdd: (
|
|
113
|
+
showPopoverSortForAdd: (field) => {
|
|
96
114
|
set((state) => {
|
|
97
|
-
state.fnAnchorEl = void 0;
|
|
98
115
|
state.inputData = "";
|
|
99
116
|
state.popoverSortData = {
|
|
100
117
|
openFor: "add",
|
|
101
|
-
fnAnchorEl: () => anchorEl,
|
|
102
118
|
field
|
|
103
119
|
};
|
|
120
|
+
state.isOpenPopoverMenuFields = false;
|
|
121
|
+
state.ownerState.inEdition = true;
|
|
104
122
|
});
|
|
105
|
-
get().actions.setInEdition(true);
|
|
106
123
|
},
|
|
107
124
|
/**
|
|
108
125
|
* TODO: Documentar
|
|
109
126
|
*/
|
|
110
|
-
showPopoverSortForEdit: (
|
|
127
|
+
showPopoverSortForEdit: (sortToEdit) => {
|
|
111
128
|
set((state) => {
|
|
112
129
|
state.popoverSortData = {
|
|
113
130
|
openFor: "edit",
|
|
114
|
-
fnAnchorEl: () => anchorEl,
|
|
115
131
|
sort: sortToEdit
|
|
116
132
|
};
|
|
117
133
|
});
|
|
@@ -194,17 +210,10 @@ const createAreaStore = (initProps) => {
|
|
|
194
210
|
/**
|
|
195
211
|
* TODO: Documentar
|
|
196
212
|
*/
|
|
197
|
-
|
|
198
|
-
set((state) => {
|
|
199
|
-
state.ownerState = { ...state.ownerState, ...newExternalState };
|
|
200
|
-
});
|
|
201
|
-
},
|
|
202
|
-
/**
|
|
203
|
-
* TODO: Documentar
|
|
204
|
-
*/
|
|
205
|
-
openPopoverMenuFields: (anchorEl) => {
|
|
213
|
+
openPopoverMenuFields: () => {
|
|
206
214
|
set((state) => {
|
|
207
|
-
state.
|
|
215
|
+
state.isOpenPopoverMenuFields = true;
|
|
216
|
+
state.ownerState.inEdition = true;
|
|
208
217
|
});
|
|
209
218
|
},
|
|
210
219
|
/**
|
|
@@ -212,7 +221,7 @@ const createAreaStore = (initProps) => {
|
|
|
212
221
|
*/
|
|
213
222
|
closePopoverMenuFields: (newInEdition) => {
|
|
214
223
|
set((state) => {
|
|
215
|
-
state.
|
|
224
|
+
state.isOpenPopoverMenuFields = false;
|
|
216
225
|
state.ownerState.inEdition = newInEdition || false;
|
|
217
226
|
});
|
|
218
227
|
},
|
|
@@ -227,7 +236,7 @@ const createAreaStore = (initProps) => {
|
|
|
227
236
|
}
|
|
228
237
|
}
|
|
229
238
|
})),
|
|
230
|
-
{ name:
|
|
239
|
+
{ name: `${DYNAMIC_SORT_STORE_ID}: ${initProps.storeId}`, enabled: storeDevtoolsEnabled }
|
|
231
240
|
)
|
|
232
241
|
);
|
|
233
242
|
};
|