@m4l/components 9.2.48 → 9.2.50-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/@types/types.d.ts +8 -1
- package/components/Chip/ChipStyles.js +1 -1
- package/components/Chip/types.d.ts +2 -1
- package/components/DataGrid/contexts/DataGridContext/index.js +1 -1
- package/components/DataGrid/contexts/FilterContext/index.js +1 -1
- package/components/DataGrid/dictionary.js +0 -3
- package/components/DataGrid/formatters/ColumnChipStatusFormatter/formatter.js +4 -3
- package/components/DataGrid/formatters/ColumnChipStatusFormatter/types.d.ts +4 -3
- package/components/DataGrid/formatters/ColumnChipStatusFormatter/useColumnChipStatus.js +4 -4
- package/components/DataGrid/formatters/ColumnNestedValueFormatter/formatter.js +2 -1
- package/components/DataGrid/formatters/ColumnNestedValueFormatter/useColumnNestedValue.d.ts +1 -1
- package/components/DataGrid/formatters/ColumnNestedValueFormatter/useColumnNestedValue.js +4 -3
- package/components/DataGrid/slots/DataGridEnum.js +2 -2
- package/components/DataGrid/slots/DataGridSlot.js +1 -1
- package/components/DataGrid/subcomponents/Table/hooks/useSortColumnsRows.js +2 -0
- package/components/DataGrid/subcomponents/Table/subcomponents/CheckboxFormatter.js +1 -1
- package/components/DataGrid/subcomponents/Table/subcomponents/CustomIcons.js +2 -2
- package/components/DragResizeWindowRND/DragResizeWindowRND.js +0 -1
- package/components/DynamicFilter/DynamicFilter.styles.js +0 -1
- package/components/DynamicFilter/constants.d.ts +5 -2
- package/components/DynamicFilter/constants.js +9 -3
- package/components/DynamicFilter/dictionary.d.ts +40 -38
- package/components/DynamicFilter/dictionary.js +33 -39
- package/components/DynamicFilter/helpers/formatToInitialFilters.d.ts +3 -1
- package/components/DynamicFilter/helpers/formatToInitialFilters.js +30 -20
- package/components/DynamicFilter/helpers/formatToRowFilter.js +15 -6
- package/components/DynamicFilter/helpers/getPurgedInitialFiltersApplied.js +1 -1
- package/components/DynamicFilter/store/DynamicFilterContext.js +1 -1
- package/components/DynamicFilter/subcomponents/AppliedFilterChip/AppliedFilterChip.d.ts +1 -1
- package/components/DynamicFilter/subcomponents/AppliedFilterChip/AppliedFilterChip.js +4 -3
- package/components/DynamicFilter/subcomponents/AppliedFilters/useAppliedFilters.js +10 -3
- package/components/DynamicFilter/subcomponents/DynamicFilterBase/DynamicFilterBase.js +1 -1
- package/components/DynamicFilter/subcomponents/FieldTypes/BooleanFilter/helpers.js +7 -7
- package/components/DynamicFilter/subcomponents/FieldTypes/BooleanFilter/index.js +11 -8
- package/components/DynamicFilter/subcomponents/FieldTypes/DateTimeFilter/helpers.js +7 -7
- package/components/DynamicFilter/subcomponents/FieldTypes/DateTimeFilter/index.js +10 -7
- package/components/DynamicFilter/subcomponents/FieldTypes/NumberFilter/helpers.js +17 -9
- package/components/DynamicFilter/subcomponents/FieldTypes/NumberFilter/index.js +13 -9
- package/components/DynamicFilter/subcomponents/FieldTypes/SelectAsyncFilter/helpers.d.ts +7 -7
- package/components/DynamicFilter/subcomponents/FieldTypes/SelectAsyncFilter/helpers.js +121 -46
- package/components/DynamicFilter/subcomponents/FieldTypes/SelectAsyncFilter/index.js +13 -11
- package/components/DynamicFilter/subcomponents/FieldTypes/SelectFilter/helpers.d.ts +8 -7
- package/components/DynamicFilter/subcomponents/FieldTypes/SelectFilter/helpers.js +127 -46
- package/components/DynamicFilter/subcomponents/FieldTypes/SelectFilter/index.js +11 -9
- package/components/DynamicFilter/subcomponents/FieldTypes/StringFilter/helpers.js +11 -7
- package/components/DynamicFilter/subcomponents/FieldTypes/StringFilter/index.js +10 -7
- package/components/DynamicFilter/subcomponents/FieldTypes/fieldFactory.d.ts +1 -1
- package/components/DynamicFilter/subcomponents/FilterActions/FilterActions.js +2 -1
- package/components/DynamicFilter/subcomponents/FilterActions/useFilterActions.d.ts +1 -1
- package/components/DynamicFilter/subcomponents/FilterActions/useFilterActions.js +2 -4
- package/components/DynamicFilter/subcomponents/InputFilter/useInputFilter.js +2 -2
- package/components/DynamicFilter/subcomponents/PopoverFilter/usePopoverFilter.d.ts +3 -3
- package/components/DynamicFilter/subcomponents/PopoverMenuFields/PopoverMenuFields.js +28 -14
- package/components/DynamicFilter/types.d.ts +60 -18
- package/components/DynamicSort/dictionary.d.ts +1 -0
- package/components/DynamicSort/dictionary.js +1 -5
- package/components/DynamicSort/slots/DynamicSortSlots.js +1 -1
- package/components/DynamicSort/store/DynamicSortContext.js +1 -1
- package/components/DynamicSort/subcomponents/DynamicSortBase/DynamicSortBase.js +1 -1
- package/components/DynamicSort/subcomponents/PopoverMenuFields/PopoverMenuFields.js +28 -14
- package/components/DynamicSort/subcomponents/PopoverSort/usePopoverSort.d.ts +3 -3
- package/components/GridLayout/GridLayout.js +1 -1
- package/components/GridLayout/styles.js +1 -1
- package/components/GridLayout/subcomponents/GridItem/index.js +1 -1
- package/components/GridLayout/subcomponents/Responsive/helper.js +1 -1
- package/components/GridLayout/subcomponents/Responsive/index.js +1 -1
- package/components/GridLayout/subcomponents/Responsive/responsiveUtils.js +3 -3
- package/components/GridLayout/subcomponents/withSizeProvider/index.js +1 -1
- package/components/Icon/Icon.js +1 -1
- package/components/Icon/constants.js +2 -2
- package/components/Icon/slots/IconSlots.js +1 -1
- package/components/Image/Image.js +1 -1
- package/components/Image/constant.js +2 -2
- package/components/Image/slots/ImageSlots.js +1 -1
- package/components/Image/subcomponents/IntersectComponent/index.js +1 -1
- package/components/LanguagePopover/LanguagePopover.js +1 -1
- package/components/LoadingError/LoadingError.js +1 -1
- package/components/LoadingError/slots/LoadingErrorSlots.js +1 -1
- package/components/MFIsolationApp/MFIsolationApp.js +2 -2
- package/components/MFIsolationApp/subcomponents/MFAuthApp/MFAuthApp.js +1 -1
- package/components/NoItemSelected/NoItemSelected.js +1 -1
- package/components/NumberInput/hooks/useNumberInput/NumberInputReducer.js +1 -1
- package/components/NumberInput/hooks/useNumberInput/useNumberInput.js +5 -3
- package/components/ObjectLogs/dictionary.js +1 -1
- package/components/Pager/Pager.styles.js +0 -8
- package/components/Pager/dicctionary.js +0 -5
- package/components/PrintingSystem/subcomponents/ChartNode/index.js +1 -1
- package/components/PropertyValue/PropertyValue.js +3 -3
- package/components/PropertyValue/PropertyValue.styles.js +4 -2
- package/components/PropertyValue/index.d.ts +1 -0
- package/components/PropertyValue/types.d.ts +0 -2
- package/components/ScrollBar/ScrollBar.js +1 -1
- package/components/SideBar/slots/SideBarEnum.js +4 -4
- package/components/SideBar/slots/SideBarSlots.js +1 -1
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ContainerMenuItemsMain/styles.js +1 -1
- package/components/ToastContainer/ToastContainer.js +1 -1
- package/components/WindowBase/slots/WindowBaseSlots.js +1 -1
- package/components/animate/variants/bounce.js +1 -1
- package/components/animate/variants/fade.js +1 -1
- package/components/animate/variants/transition.js +2 -2
- package/components/areas/components/AreasAdmin/AreasAdmin.js +1 -1
- package/components/areas/components/AreasViewer/AreasViewer.js +1 -1
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/AreaGridLayout/AreaGridLayout.js +1 -1
- package/components/areas/contexts/AreasContext/helpers/helper.js +14 -14
- package/components/areas/contexts/AreasContext/store.js +5 -5
- package/components/areas/icons.js +0 -8
- package/components/commercial/HamburgerMenu/classes/index.js +1 -1
- package/components/extended/React-Splitter-Layout/slots/SplitLayoutSlots.d.ts +9 -3
- package/components/extended/React-resizable-panels/SplitLayout.js +25 -5
- package/components/extended/React-resizable-panels/SplitLayout.styles.js +20 -6
- package/components/extended/React-resizable-panels/slots/SplitLayoutSlots.d.ts +12 -4
- package/components/extended/React-resizable-panels/types.d.ts +7 -0
- package/components/formatters/BooleanFormatter/BooleanFormatter.js +1 -1
- package/components/formatters/BooleanFormatter/slots/BooleanFormatterSlots.js +3 -3
- package/components/formatters/ChipStatusFormatter/types.d.ts +3 -2
- package/components/formatters/PeriodFormatter/PeriodFormatter.js +1 -1
- package/components/formatters/PeriodFormatter/slots/PeriodFormatterSlots.js +2 -2
- package/components/hook-form/RHFCheckbox/slots/RHFCheckBoxSlots.js +1 -1
- package/components/hook-form/RHFNumberInput/index.d.ts +1 -0
- package/components/hook-form/RHFNumberInput/index.js +1 -0
- package/components/hook-form/RHFPeriod/RHFPeriod.js +1 -1
- package/components/hook-form/RHFTextField/RHFTextField.styles.js +1 -3
- package/components/hook-form/RHFTextFieldPassword/slots/RHFTextFieldPasswordSlots.js +1 -1
- package/components/hook-form/RHFUpload/RHFUploadSingleFile/RHFUploadSingleFile.js +1 -1
- package/components/hook-form/RHFormContext/classes/index.js +1 -1
- package/components/hook-form/RHFormContext/index.js +1 -1
- package/components/hook-form/index.d.ts +1 -1
- package/components/index.d.ts +1 -1
- package/components/mui_extended/Accordion/Accordion.js +1 -1
- package/components/mui_extended/Accordion/slots/AccordionSlots.js +2 -2
- package/components/mui_extended/Accordion/styles.js +1 -0
- package/components/mui_extended/Autocomplete/Autocomplete.js +25 -12
- package/components/mui_extended/Autocomplete/Autocomplete.styles.js +1 -1
- package/components/mui_extended/Autocomplete/slots/AutocompleteSlots.js +3 -3
- package/components/mui_extended/CheckBox/CheckBox.js +1 -1
- package/components/mui_extended/CheckBox/slots/CheckBoxSlots.js +2 -2
- package/components/mui_extended/DateTimePicker/slots/DateTimePickerSlots.js +1 -1
- package/components/mui_extended/IconButton/slots/IconButtonSlots.js +1 -1
- package/components/mui_extended/ImageButton/utils/Clases/index.js +1 -1
- package/components/mui_extended/MenuItem/slots/MenuItemSlots.js +1 -1
- package/components/mui_extended/NavLink/NavLink.js +1 -1
- package/components/mui_extended/NavLink/constants.js +2 -2
- package/components/mui_extended/NavLink/slots/NavLinkSlots.js +1 -1
- package/components/mui_extended/Popover/Popover.js +1 -1
- package/components/mui_extended/Popover/Popover.styles.js +1 -5
- package/components/mui_extended/Popover/constants.js +2 -2
- package/components/mui_extended/Select/Select.js +1 -1
- package/components/mui_extended/Select/Select.styles.js +1 -1
- package/components/mui_extended/Select/constants.js +1 -1
- package/components/mui_extended/Select/slots/SelectSlots.js +1 -1
- package/components/mui_extended/Tab/Tab.js +1 -1
- package/components/mui_extended/TabContent/TabContent.styles.js +2 -1
- package/components/mui_extended/TextField/constants.js +1 -1
- package/components/mui_extended/Tooltip/Tooltip.js +2 -2
- package/components/mui_extended/Tooltip/slots/TooltipSlots.js +2 -2
- package/components/mui_extended/Typography/Typography.js +1 -1
- package/components/mui_extended/Typography/constants.js +3 -3
- package/components/mui_extended/Typography/slots/typographySlots.js +1 -1
- package/components/popups/components/PopupsViewer/icons.js +0 -1
- package/hooks/useDataGridPersistence/constants.js +2 -2
- package/hooks/useDataGridPersistence/useDataGridPersistence.js +1 -1
- package/hooks/useDynamicFilterAndSort/styles.js +2 -0
- package/hooks/useDynamicFilterAndSort/types.d.ts +1 -0
- package/hooks/useDynamicFilterAndSort/useDynamicFilterAndSort.js +56 -12
- package/hooks/useSvgColor/constants.js +2 -2
- package/hooks/useSvgColor/helpers.js +1 -1
- package/hooks/useSvgColor/useSvgColor.js +1 -1
- package/index.js +109 -109
- package/mockServiceWorker.js +1 -1
- package/package.json +1 -6
- package/components/PropertyValue/styles.d.ts +0 -1
package/@types/types.d.ts
CHANGED
|
@@ -145,7 +145,7 @@ import { RHFUploadSingleFileOwnerState, RHFUploadSingleFileSlotsType } from '../
|
|
|
145
145
|
import { ChipStatusFormatterSlotsType } from '../components/formatters/ChipStatusFormatter/types';
|
|
146
146
|
import { RHFUploadImageOwnerState, RHFUploadImageSlotsType } from '../components/hook-form/RHFUpload/RHFUploadImage/types';
|
|
147
147
|
import { PrintingSystemOwnerState, PrintingSystemSlotsType } from '../components/PrintingSystem/types';
|
|
148
|
-
|
|
148
|
+
import { SplitLayoutOwnerState } from '../components/extended/React-resizable-panels/types';
|
|
149
149
|
declare module '@mui/material/styles' {
|
|
150
150
|
// Define the slots in the theme
|
|
151
151
|
interface ComponentNameToClassKey {
|
|
@@ -222,6 +222,7 @@ declare module '@mui/material/styles' {
|
|
|
222
222
|
M4LChipStatusFormatter: ChipStatusFormatterSlotsType;
|
|
223
223
|
M4LRHFUploadImage: RHFUploadImageSlotsType;
|
|
224
224
|
M4LPrintingSystem: PrintingSystemSlotsType;
|
|
225
|
+
M4LSplitLayout: SplitLayoutOwnerState;
|
|
225
226
|
}
|
|
226
227
|
interface ComponentsPropsList {
|
|
227
228
|
// Extend ComponentsProps or ComponentsOwnerState(this extend ComponentProps)
|
|
@@ -298,6 +299,7 @@ declare module '@mui/material/styles' {
|
|
|
298
299
|
M4LChipStatusFormatter: Partial<ChipStatusFormatterOwnerState>;
|
|
299
300
|
M4LRHFUploadImage: Partial<RHFUploadImageOwnerState>;
|
|
300
301
|
M4LPrintingSystem: Partial<PrintingSystemOwnerState>;
|
|
302
|
+
M4LSplitLayout: Partial<SplitLayoutOwnerState>;
|
|
301
303
|
}
|
|
302
304
|
interface Components {
|
|
303
305
|
M4LDynamicFilter?: {
|
|
@@ -675,5 +677,10 @@ declare module '@mui/material/styles' {
|
|
|
675
677
|
styleOverrides?: ComponentsOverrides<Theme>['M4LPrintingSystem'];
|
|
676
678
|
variants?: ComponentsVariants['M4LPrintingSystem'];
|
|
677
679
|
};
|
|
680
|
+
M4LSplitLayout?: {
|
|
681
|
+
defaultProps?: ComponentsPropsList['M4LSplitLayout'];
|
|
682
|
+
styleOverrides?: ComponentsOverrides<Theme>['M4LSplitLayout'];
|
|
683
|
+
variants?: ComponentsVariants['M4LSplitLayout'];
|
|
684
|
+
};
|
|
678
685
|
}
|
|
679
686
|
}
|
|
@@ -5,6 +5,7 @@ import { CHIP_KEY_COMPONENT } from './constants';
|
|
|
5
5
|
import { ChipSlots } from './slots';
|
|
6
6
|
import { IconButtonProps as MUIIconButtonProps } from '@mui/material';
|
|
7
7
|
import { M4LOverridesStyleRules } from '../../@types/augmentations';
|
|
8
|
+
import { Maybe } from '@m4l/core';
|
|
8
9
|
export type ChipVariants = 'contained' | 'outlined';
|
|
9
10
|
/**
|
|
10
11
|
* Propiedades del componente `Chip`.
|
|
@@ -25,7 +26,7 @@ export interface ChipProps {
|
|
|
25
26
|
/**
|
|
26
27
|
* Text describing the `Chip`.
|
|
27
28
|
*/
|
|
28
|
-
label?: string
|
|
29
|
+
label?: Maybe<string>;
|
|
29
30
|
/**
|
|
30
31
|
* Defines the variant of the `Chip` (default 'contained').
|
|
31
32
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useState, useMemo, useEffect, useCallback, createContext } from "react";
|
|
3
3
|
import { c as castMapColumnsWidthToRecord } from "../../helpers/castMapColumnsWidthToRecord.js";
|
|
4
4
|
import { useFirstRender } from "@m4l/graphics";
|
|
5
5
|
const DataGridContext = createContext(null);
|
|
@@ -5,9 +5,6 @@ function getDataGridComponentsDictionary() {
|
|
|
5
5
|
return ["data_grid"].concat(getPagerComponentsDictionary()).concat(getMenuActionsComponentsDictionary()).concat(getModalDictionary());
|
|
6
6
|
}
|
|
7
7
|
const dictionary = {
|
|
8
|
-
LABEL_ACTIONS: "actions",
|
|
9
|
-
LABEL_ROWS_PER_PAGE: "pager.rows_per_page",
|
|
10
|
-
LABEL_OF: "pager.of",
|
|
11
8
|
DENSITY_COMPACT: `${getDataGridComponentsDictionary()[0]}.density_compact`,
|
|
12
9
|
DENSITY_STANDARD: `${getDataGridComponentsDictionary()[0]}.density_standard`,
|
|
13
10
|
DENSITY_CONFORTABLE: `${getDataGridComponentsDictionary()[0]}.density_confortable`,
|
|
@@ -2,12 +2,13 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { getPropertyByString } from "@m4l/core";
|
|
3
3
|
import { g as getFieldValueWithRow } from "../../../../helpers/getFieldValueWithRow.js";
|
|
4
4
|
import { C as ChipStatusFormatterColumnWrapperStyled } from "../../../formatters/ChipStatusFormatter/slots/ChipStatusFormatterSlots.js";
|
|
5
|
+
import { g as getNullGuard } from "../../../../utils/getNullGuard.js";
|
|
5
6
|
import { C as ChipStatusFormatter } from "../../../formatters/ChipStatusFormatter/ChipStatusFormatter.js";
|
|
6
7
|
const ColumnChipStatusFormatter = (props) => {
|
|
7
|
-
const {
|
|
8
|
+
const { fieldStatus, fieldLabel, statusesColors, fallbackColor } = props;
|
|
8
9
|
return (obProps) => {
|
|
9
|
-
const
|
|
10
|
-
const
|
|
10
|
+
const status = getNullGuard(getPropertyByString(obProps, getFieldValueWithRow(fieldStatus.toString())));
|
|
11
|
+
const label = typeof fieldLabel === "string" ? getNullGuard(getPropertyByString(obProps, getFieldValueWithRow(fieldLabel))) : fieldLabel(obProps.row, status);
|
|
11
12
|
return /* @__PURE__ */ jsx(
|
|
12
13
|
ChipStatusFormatter,
|
|
13
14
|
{
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { DeepKeyOf } from '../../../../utils/types';
|
|
1
2
|
import { ChipStatusKey, ChipStatusFormatterProps } from '../../../formatters/ChipStatusFormatter/types';
|
|
2
|
-
export interface ColumnChipStatusFormatterProps<
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
export interface ColumnChipStatusFormatterProps<TRow> extends Pick<ChipStatusFormatterProps, 'statusesColors' | 'fallbackColor'> {
|
|
4
|
+
fieldStatus: DeepKeyOf<TRow>;
|
|
5
|
+
fieldLabel: DeepKeyOf<TRow> | ((row: TRow, status: ChipStatusKey) => string);
|
|
5
6
|
}
|
|
@@ -4,16 +4,16 @@ import { g as getColumnKey } from "../../helpers/getColumnKey.js";
|
|
|
4
4
|
import { deepEqual } from "fast-equals";
|
|
5
5
|
import { useState, useRef, useEffect, useMemo } from "react";
|
|
6
6
|
const getCustomChipStatusFilter = (props) => {
|
|
7
|
-
const { uriLabel } = props;
|
|
7
|
+
const { fieldLabel: uriLabel } = props;
|
|
8
8
|
return (row, value) => {
|
|
9
|
-
const valueMaybeString = typeof uriLabel === "string" ? getPropertyByString(row, getColumnKey(uriLabel), "") : uriLabel(row, props.
|
|
9
|
+
const valueMaybeString = typeof uriLabel === "string" ? getPropertyByString(row, getColumnKey(uriLabel), "") : uriLabel(row, props.fieldStatus);
|
|
10
10
|
return valueMaybeString.includes(value.toString());
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
13
|
const getCustomChipStatusSort = (props) => {
|
|
14
14
|
return (a, b) => {
|
|
15
|
-
const valueA = typeof props.
|
|
16
|
-
const valueB = typeof props.
|
|
15
|
+
const valueA = typeof props.fieldLabel === "string" ? getPropertyByString(a, getColumnKey(props.fieldLabel), "") : props.fieldLabel(a, props.fieldStatus);
|
|
16
|
+
const valueB = typeof props.fieldLabel === "string" ? getPropertyByString(b, getColumnKey(props.fieldLabel), "") : props.fieldLabel(b, props.fieldStatus);
|
|
17
17
|
return valueA > valueB ? 1 : valueA < valueB ? -1 : 0;
|
|
18
18
|
};
|
|
19
19
|
};
|
|
@@ -2,10 +2,11 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { getPropertyByString } from "@m4l/core";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { g as getFieldValueWithRow } from "../../../../helpers/getFieldValueWithRow.js";
|
|
5
|
+
import { g as getNullGuard } from "../../../../utils/getNullGuard.js";
|
|
5
6
|
function ColumnNestedValueFormatter(props) {
|
|
6
7
|
const { fieldValue, Component = React.Fragment } = props;
|
|
7
8
|
return (obProps) => {
|
|
8
|
-
const property = getPropertyByString(obProps, getFieldValueWithRow(fieldValue));
|
|
9
|
+
const property = getNullGuard(getPropertyByString(obProps, getFieldValueWithRow(fieldValue)));
|
|
9
10
|
const value = typeof property === "object" ? JSON.stringify(property) : property;
|
|
10
11
|
return /* @__PURE__ */ jsx(Component, { children: value });
|
|
11
12
|
};
|
|
@@ -5,6 +5,6 @@ import { ColumnNestedValueFormatterProps } from './types';
|
|
|
5
5
|
*/
|
|
6
6
|
export declare const useColumnNestedValue: <TRow>(props: ColumnNestedValueFormatterProps<TRow>) => {
|
|
7
7
|
formatter: (obProps: any) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
customFilter: (row: TRow, value: string) =>
|
|
8
|
+
customFilter: (row: TRow, value: string) => any;
|
|
9
9
|
customSort: (a: TRow, b: TRow) => 0 | 1 | -1;
|
|
10
10
|
};
|
|
@@ -2,10 +2,11 @@ import { getPropertyByString } from "@m4l/core";
|
|
|
2
2
|
import { useState, useRef, useEffect, useMemo } from "react";
|
|
3
3
|
import { deepEqual } from "fast-equals";
|
|
4
4
|
import { g as getColumnKey } from "../../helpers/getColumnKey.js";
|
|
5
|
+
import { g as getNullGuard } from "../../../../utils/getNullGuard.js";
|
|
5
6
|
import { C as ColumnNestedValueFormatter } from "./formatter.js";
|
|
6
7
|
const getCustomNestedValueFilter = (props) => {
|
|
7
8
|
return (row, value) => {
|
|
8
|
-
const property = getPropertyByString(row, props.fieldValue)
|
|
9
|
+
const property = getNullGuard(getPropertyByString(row, props.fieldValue));
|
|
9
10
|
if (typeof property === "object") {
|
|
10
11
|
return Object.values(property).includes(value);
|
|
11
12
|
}
|
|
@@ -15,8 +16,8 @@ const getCustomNestedValueFilter = (props) => {
|
|
|
15
16
|
const getCustomNestedValueSort = (props) => {
|
|
16
17
|
return (a, b) => {
|
|
17
18
|
const keyWiouthRow = getColumnKey(props.fieldValue);
|
|
18
|
-
const valueA = getPropertyByString(a, keyWiouthRow);
|
|
19
|
-
const valueB = getPropertyByString(b, keyWiouthRow);
|
|
19
|
+
const valueA = getNullGuard(getPropertyByString(a, keyWiouthRow));
|
|
20
|
+
const valueB = getNullGuard(getPropertyByString(b, keyWiouthRow));
|
|
20
21
|
if (typeof valueA === "object" || typeof valueB === "object" || valueA === void 0 || valueB === void 0) {
|
|
21
22
|
return 0;
|
|
22
23
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { styled } from "@mui/material/styles";
|
|
2
2
|
import { InputBase } from "@mui/material";
|
|
3
3
|
import { D as DATAGRID_PREFIX_NAME } from "../constants.js";
|
|
4
|
-
import { D as DataGridSlots,
|
|
4
|
+
import { D as DataGridSlots, T as TextEditorSlots, A as ActionsSlots, a as TableSlots, R as RowsCountSlots, C as ColumnsConfigSlots } from "./DataGridEnum.js";
|
|
5
5
|
import { d as dataGridStyles } from "../styles.js";
|
|
6
6
|
const DataGridRootStyled = styled("div", {
|
|
7
7
|
name: DATAGRID_PREFIX_NAME,
|
|
@@ -17,6 +17,7 @@ function getComparator(columns, sortColumn) {
|
|
|
17
17
|
return column.customSort;
|
|
18
18
|
}
|
|
19
19
|
switch (typeOrder) {
|
|
20
|
+
//Si el tipo de dato de la columna es un numerico, retorna una función de ordenamiento numérica
|
|
20
21
|
case "number":
|
|
21
22
|
return (a, b) => {
|
|
22
23
|
try {
|
|
@@ -25,6 +26,7 @@ function getComparator(columns, sortColumn) {
|
|
|
25
26
|
return -1;
|
|
26
27
|
}
|
|
27
28
|
};
|
|
29
|
+
//Por defecto retorna una función de ordenamiento de string
|
|
28
30
|
default:
|
|
29
31
|
return (a, b) => {
|
|
30
32
|
try {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
-
import { C as
|
|
3
|
+
import { C as CheckboxIndeterminateIcon, a as CheckboxCheckedIcon, b as CheckboxIcon } from "./CustomIcons.js";
|
|
4
4
|
import { Checkbox } from "@mui/material";
|
|
5
5
|
const CheckboxFormatter = forwardRef(
|
|
6
6
|
function CheckboxFormatter2({ onChange, checked, ...props }, _ref) {
|
|
@@ -10,7 +10,7 @@ function CheckboxIndeterminateIcon(props) {
|
|
|
10
10
|
return /* @__PURE__ */ jsx(SvgIcon, { ...props, children: /* @__PURE__ */ jsx("path", { d: "M17 3a4 4 0 014 4v10a4 4 0 01-4 4H7a4 4 0 01-4-4V7a4 4 0 014-4h10zm-1.75 8h-6.5a.75.75 0 00-.75.75v.5c0 .414.336.75.75.75h6.5a.75.75 0 00.75-.75v-.5a.75.75 0 00-.75-.75z" }) });
|
|
11
11
|
}
|
|
12
12
|
export {
|
|
13
|
-
|
|
13
|
+
CheckboxIndeterminateIcon as C,
|
|
14
14
|
CheckboxCheckedIcon as a,
|
|
15
|
-
|
|
15
|
+
CheckboxIcon as b
|
|
16
16
|
};
|
|
@@ -80,7 +80,6 @@ const dynamicFilterStyles = {
|
|
|
80
80
|
borderColor: "transparent",
|
|
81
81
|
paddingLeft: theme.vars.size.baseSpacings.sp2,
|
|
82
82
|
paddingRight: theme.vars.size.baseSpacings.sp2,
|
|
83
|
-
width: "100%",
|
|
84
83
|
height: "100%",
|
|
85
84
|
"&::placeholder": {
|
|
86
85
|
color: theme.vars.palette.text.secondary
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { BooleanOperator, DateTimeOperator, FilterField, NumberOperator, SelectOperator, StringOperator } from './types';
|
|
1
|
+
import { BooleanOperator, DateTimeOperator, FilterField, NumberOperator, SelectOperator, SelectOperatorAsync, StringOperator } from './types';
|
|
2
2
|
export declare const DYNAMIC_FILTER_KEY_COMPONENT = "M4LDynamicFilter";
|
|
3
3
|
export declare const DYNAMIC_FILTER_SOTORE_ID = "M4LDynamicFilterStore";
|
|
4
4
|
export declare const ALL_FIELD: FilterField;
|
|
5
5
|
export declare const STRING_OPERATORS: Array<StringOperator>;
|
|
6
6
|
export declare const NUMBER_OPERATORS: Array<NumberOperator>;
|
|
7
7
|
export declare const BOOLEAN_OPERATORS: Array<BooleanOperator>;
|
|
8
|
-
export declare const
|
|
8
|
+
export declare const SELECT_OPERATORS_MULTIPLE: Array<SelectOperator>;
|
|
9
|
+
export declare const SELECT_OPERATORS_SINGLE: Array<SelectOperator>;
|
|
10
|
+
export declare const SELECT_ASYNC_OPERATORS_MULTIPLE: Array<SelectOperatorAsync>;
|
|
11
|
+
export declare const SELECT_ASYNC_OPERATORS_SINGLE: Array<SelectOperatorAsync>;
|
|
9
12
|
export declare const DATE_TIME_OPERATORS: Array<DateTimeOperator>;
|
|
@@ -11,7 +11,10 @@ const ALL_FIELD = {
|
|
|
11
11
|
const STRING_OPERATORS = ["c", "nc"];
|
|
12
12
|
const NUMBER_OPERATORS = ["b", "e", "ne", "gt", "gte", "lt", "lte"];
|
|
13
13
|
const BOOLEAN_OPERATORS = ["e", "ne"];
|
|
14
|
-
const
|
|
14
|
+
const SELECT_OPERATORS_MULTIPLE = ["in", "nin"];
|
|
15
|
+
const SELECT_OPERATORS_SINGLE = ["e", "ne"];
|
|
16
|
+
const SELECT_ASYNC_OPERATORS_MULTIPLE = ["in", "nin"];
|
|
17
|
+
const SELECT_ASYNC_OPERATORS_SINGLE = ["e", "ne"];
|
|
15
18
|
const DATE_TIME_OPERATORS = [
|
|
16
19
|
"b",
|
|
17
20
|
"e",
|
|
@@ -26,8 +29,11 @@ export {
|
|
|
26
29
|
BOOLEAN_OPERATORS as B,
|
|
27
30
|
DYNAMIC_FILTER_KEY_COMPONENT as D,
|
|
28
31
|
NUMBER_OPERATORS as N,
|
|
29
|
-
|
|
32
|
+
SELECT_ASYNC_OPERATORS_MULTIPLE as S,
|
|
30
33
|
DYNAMIC_FILTER_SOTORE_ID as a,
|
|
31
34
|
DATE_TIME_OPERATORS as b,
|
|
32
|
-
|
|
35
|
+
SELECT_ASYNC_OPERATORS_SINGLE as c,
|
|
36
|
+
SELECT_OPERATORS_MULTIPLE as d,
|
|
37
|
+
SELECT_OPERATORS_SINGLE as e,
|
|
38
|
+
STRING_OPERATORS as f
|
|
33
39
|
};
|
|
@@ -5,43 +5,45 @@ export declare const DYNAMIC_FILTER_DICTIONARY_ID = "dynamic_filter";
|
|
|
5
5
|
*/
|
|
6
6
|
export declare function getDynamicFilterComponentsDictionary(): string[];
|
|
7
7
|
export declare const DICCTIONARY: {
|
|
8
|
-
readonly input_placeholder: "input_placeholder";
|
|
9
|
-
readonly operand_true: "operand_true";
|
|
10
|
-
readonly operand_false: "operand_false";
|
|
11
|
-
readonly filter_tooltip_refresh: "filter_tooltip_refresh";
|
|
12
|
-
readonly filter_tooltip_dirty: "filter_tooltip_dirty";
|
|
13
|
-
readonly filter_tooltip_invalid: "filter_tooltip_invalid";
|
|
14
|
-
readonly
|
|
15
|
-
readonly
|
|
16
|
-
readonly
|
|
17
|
-
readonly
|
|
18
|
-
readonly
|
|
19
|
-
readonly
|
|
20
|
-
readonly
|
|
21
|
-
readonly
|
|
22
|
-
readonly
|
|
23
|
-
readonly
|
|
24
|
-
readonly
|
|
25
|
-
readonly
|
|
26
|
-
readonly
|
|
27
|
-
readonly
|
|
28
|
-
readonly
|
|
29
|
-
readonly
|
|
30
|
-
readonly
|
|
31
|
-
readonly
|
|
32
|
-
readonly
|
|
33
|
-
readonly
|
|
34
|
-
readonly
|
|
35
|
-
readonly
|
|
36
|
-
readonly
|
|
37
|
-
readonly
|
|
38
|
-
readonly
|
|
39
|
-
readonly
|
|
40
|
-
readonly
|
|
8
|
+
readonly input_placeholder: "dynamic_filter.input_placeholder";
|
|
9
|
+
readonly operand_true: "dynamic_filter.operand_true";
|
|
10
|
+
readonly operand_false: "dynamic_filter.operand_false";
|
|
11
|
+
readonly filter_tooltip_refresh: "dynamic_filter.filter_tooltip_refresh";
|
|
12
|
+
readonly filter_tooltip_dirty: "dynamic_filter.filter_tooltip_dirty";
|
|
13
|
+
readonly filter_tooltip_invalid: "dynamic_filter.filter_tooltip_invalid";
|
|
14
|
+
readonly tooltip_clear_filters: "dynamic_filter.tooltip_clear_filters";
|
|
15
|
+
readonly operator_b: "dynamic_filter.operator_b";
|
|
16
|
+
readonly operator_e: "dynamic_filter.operator_e";
|
|
17
|
+
readonly operator_ne: "dynamic_filter.operator_ne";
|
|
18
|
+
readonly operator_gt: "dynamic_filter.operator_gt";
|
|
19
|
+
readonly operator_gte: "dynamic_filter.operator_gte";
|
|
20
|
+
readonly operator_lt: "dynamic_filter.operator_lt";
|
|
21
|
+
readonly operator_lte: "dynamic_filter.operator_lte";
|
|
22
|
+
readonly operator_c: "dynamic_filter.operator_c";
|
|
23
|
+
readonly operator_nc: "dynamic_filter.operator_nc";
|
|
24
|
+
readonly operator_in: "dynamic_filter.operator_in";
|
|
25
|
+
readonly operator_nin: "dynamic_filter.operator_nin";
|
|
26
|
+
readonly label_boolean_operator: "dynamic_filter.label_boolean_operator";
|
|
27
|
+
readonly label_boolean_operand1: "dynamic_filter.label_boolean_operand1";
|
|
28
|
+
readonly label_operator_date_time: "dynamic_filter.label_operator_date_time";
|
|
29
|
+
readonly label_operand1_date_time: "dynamic_filter.label_operand1_date_time";
|
|
30
|
+
readonly label_operand2_date_time: "dynamic_filter.label_operand2_date_time";
|
|
31
|
+
readonly label_operator_number: "dynamic_filter.label_operator_number";
|
|
32
|
+
readonly label_operand1_number: "dynamic_filter.label_operand1_number";
|
|
33
|
+
readonly label_operand2_number: "dynamic_filter.label_operand2_number";
|
|
34
|
+
readonly label_operator_string: "dynamic_filter.label_operator_string";
|
|
35
|
+
readonly label_operand1_string: "dynamic_filter.label_operand1_string";
|
|
36
|
+
readonly label_select_operator: "dynamic_filter.label_select_operator";
|
|
37
|
+
readonly label_select_operands_array: "dynamic_filter.label_select_operands_array";
|
|
38
|
+
readonly label_select_operand1: "dynamic_filter.label_select_operand1";
|
|
39
|
+
readonly label_select_operand2: "dynamic_filter.label_select_operand2";
|
|
40
|
+
readonly label_select_async_operand1: "dynamic_filter.label_select_async_operand1";
|
|
41
|
+
readonly label_select_async_operands_array: "dynamic_filter.label_select_async_operands_array";
|
|
42
|
+
readonly label_no_fields_available: "dynamic_filter.label_no_fields_available";
|
|
43
|
+
readonly error_operand_required: "dynamic_filter.error_operand_required";
|
|
44
|
+
readonly error_operator_required: "dynamic_filter.error_operator_required";
|
|
45
|
+
readonly error_invalid_date: "dynamic_filter.error_invalid_date";
|
|
46
|
+
readonly error_less_than_start: "dynamic_filter.error_less_than_start";
|
|
47
|
+
readonly error_operand_mustbe_number: "dynamic_filter.error_operand_mustbe_number";
|
|
41
48
|
};
|
|
42
49
|
export type TypeDictionary = typeof DICCTIONARY;
|
|
43
|
-
/**
|
|
44
|
-
* getDynamicFilterDictionary: Devuelve el id del diccionario de un componente DynamicFilter.
|
|
45
|
-
* @param key - Clave del diccionario.
|
|
46
|
-
*/
|
|
47
|
-
export declare const getDynamicFilterDictionary: (key: keyof TypeDictionary) => string;
|
|
@@ -7,45 +7,39 @@ function getDynamicFilterComponentsDictionary() {
|
|
|
7
7
|
);
|
|
8
8
|
}
|
|
9
9
|
const DICCTIONARY = {
|
|
10
|
-
input_placeholder:
|
|
11
|
-
operand_true:
|
|
12
|
-
operand_false:
|
|
13
|
-
filter_tooltip_refresh:
|
|
14
|
-
filter_tooltip_dirty:
|
|
15
|
-
filter_tooltip_invalid:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
label_select_operator: "label_select_operator",
|
|
41
|
-
label_select_operands_array: "label_select_operands_array",
|
|
42
|
-
error_operand_required: "error_operand_required"
|
|
43
|
-
};
|
|
44
|
-
const getDynamicFilterDictionary = (key) => {
|
|
45
|
-
return `${DYNAMIC_FILTER_DICTIONARY_ID}.${key}`;
|
|
10
|
+
input_placeholder: `${DYNAMIC_FILTER_DICTIONARY_ID}.input_placeholder`,
|
|
11
|
+
operand_true: `${DYNAMIC_FILTER_DICTIONARY_ID}.operand_true`,
|
|
12
|
+
operand_false: `${DYNAMIC_FILTER_DICTIONARY_ID}.operand_false`,
|
|
13
|
+
filter_tooltip_refresh: `${DYNAMIC_FILTER_DICTIONARY_ID}.filter_tooltip_refresh`,
|
|
14
|
+
filter_tooltip_dirty: `${DYNAMIC_FILTER_DICTIONARY_ID}.filter_tooltip_dirty`,
|
|
15
|
+
filter_tooltip_invalid: `${DYNAMIC_FILTER_DICTIONARY_ID}.filter_tooltip_invalid`,
|
|
16
|
+
tooltip_clear_filters: `${DYNAMIC_FILTER_DICTIONARY_ID}.tooltip_clear_filters`,
|
|
17
|
+
//Labels de los formularios de los filtros
|
|
18
|
+
label_boolean_operator: `${DYNAMIC_FILTER_DICTIONARY_ID}.label_boolean_operator`,
|
|
19
|
+
label_boolean_operand1: `${DYNAMIC_FILTER_DICTIONARY_ID}.label_boolean_operand1`,
|
|
20
|
+
label_operator_date_time: `${DYNAMIC_FILTER_DICTIONARY_ID}.label_operator_date_time`,
|
|
21
|
+
label_operand1_date_time: `${DYNAMIC_FILTER_DICTIONARY_ID}.label_operand1_date_time`,
|
|
22
|
+
label_operand2_date_time: `${DYNAMIC_FILTER_DICTIONARY_ID}.label_operand2_date_time`,
|
|
23
|
+
label_operator_number: `${DYNAMIC_FILTER_DICTIONARY_ID}.label_operator_number`,
|
|
24
|
+
label_operand1_number: `${DYNAMIC_FILTER_DICTIONARY_ID}.label_operand1_number`,
|
|
25
|
+
label_operand2_number: `${DYNAMIC_FILTER_DICTIONARY_ID}.label_operand2_number`,
|
|
26
|
+
label_operator_string: `${DYNAMIC_FILTER_DICTIONARY_ID}.label_operator_string`,
|
|
27
|
+
label_operand1_string: `${DYNAMIC_FILTER_DICTIONARY_ID}.label_operand1_string`,
|
|
28
|
+
label_select_operator: `${DYNAMIC_FILTER_DICTIONARY_ID}.label_select_operator`,
|
|
29
|
+
label_select_operands_array: `${DYNAMIC_FILTER_DICTIONARY_ID}.label_select_operands_array`,
|
|
30
|
+
label_select_operand1: `${DYNAMIC_FILTER_DICTIONARY_ID}.label_select_operand1`,
|
|
31
|
+
label_select_async_operand1: `${DYNAMIC_FILTER_DICTIONARY_ID}.label_select_async_operand1`,
|
|
32
|
+
label_select_async_operands_array: `${DYNAMIC_FILTER_DICTIONARY_ID}.label_select_async_operands_array`,
|
|
33
|
+
label_no_fields_available: `${DYNAMIC_FILTER_DICTIONARY_ID}.label_no_fields_available`,
|
|
34
|
+
//Validations
|
|
35
|
+
error_operand_required: `${DYNAMIC_FILTER_DICTIONARY_ID}.error_operand_required`,
|
|
36
|
+
error_operator_required: `${DYNAMIC_FILTER_DICTIONARY_ID}.error_operator_required`,
|
|
37
|
+
error_invalid_date: `${DYNAMIC_FILTER_DICTIONARY_ID}.error_invalid_date`,
|
|
38
|
+
error_less_than_start: `${DYNAMIC_FILTER_DICTIONARY_ID}.error_less_than_start`,
|
|
39
|
+
error_operand_mustbe_number: `${DYNAMIC_FILTER_DICTIONARY_ID}.error_operand_mustbe_number`
|
|
46
40
|
};
|
|
47
41
|
export {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
42
|
+
DYNAMIC_FILTER_DICTIONARY_ID as D,
|
|
43
|
+
DICCTIONARY as a,
|
|
44
|
+
getDynamicFilterComponentsDictionary as g
|
|
51
45
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { FilterFieldApplied, InitialFilterApplied } from '../types';
|
|
2
2
|
/**
|
|
3
|
-
* Función formateadora filtros como el DynamicFilter los usa a nivel interno
|
|
3
|
+
* Función formateadora filtros como el DynamicFilter los usa a nivel interno diferente como se guardan en las cookies
|
|
4
|
+
* Por ejemplo: El filtro internamente trabaja con Date, pero se guarda en las cookies como string
|
|
5
|
+
* Adicionalmente se formatean los filtros para que no se guarden los undefined
|
|
4
6
|
* @param appliedFilters Filtros actualmente aplicados
|
|
5
7
|
* @returns
|
|
6
8
|
*/
|
|
@@ -1,29 +1,39 @@
|
|
|
1
1
|
import { f as filterValidOperandsArraySelectAsync } from "../subcomponents/FieldTypes/SelectAsyncFilter/helpers.js";
|
|
2
|
+
import { f as filterValidOperandsArraySelect } from "../subcomponents/FieldTypes/SelectFilter/helpers.js";
|
|
2
3
|
function formatToInitialFilters(appliedFilters) {
|
|
3
|
-
return appliedFilters.map((
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
if (
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
4
|
+
return appliedFilters.map((af) => {
|
|
5
|
+
let operandArray = void 0;
|
|
6
|
+
let operand1 = af.operand1;
|
|
7
|
+
let operand2 = af.operand2;
|
|
8
|
+
if (af.fieldType === "datetime") {
|
|
9
|
+
operand1 = af.operand1.toISOString();
|
|
10
|
+
operand2 = af.operator === "b" ? af.operand2.toISOString() : void 0;
|
|
11
|
+
} else if (af.fieldType === "selectAsync" && af.field.type === "selectAsync") {
|
|
12
|
+
if (af.field.selectAsyncOptions.multiple) {
|
|
13
|
+
const validOperandsArray = filterValidOperandsArraySelectAsync(
|
|
14
|
+
af.operandsArray,
|
|
15
|
+
af.field
|
|
16
|
+
);
|
|
17
|
+
if (validOperandsArray && validOperandsArray?.length > 0) {
|
|
18
|
+
operandArray = validOperandsArray;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
} else if (af.fieldType === "select") {
|
|
22
|
+
const validOperandsArray = filterValidOperandsArraySelect(
|
|
23
|
+
af.operandsArray,
|
|
24
|
+
af.field
|
|
18
25
|
);
|
|
19
26
|
if (validOperandsArray && validOperandsArray?.length > 0) {
|
|
20
|
-
|
|
27
|
+
operandArray = validOperandsArray;
|
|
21
28
|
}
|
|
22
29
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
30
|
+
return {
|
|
31
|
+
name: af.field.name,
|
|
32
|
+
operator: af.operator,
|
|
33
|
+
...operand1 ? { operand1 } : {},
|
|
34
|
+
...operand2 ? { operand2 } : {},
|
|
35
|
+
...operandArray ? { operandArray } : {}
|
|
36
|
+
};
|
|
27
37
|
});
|
|
28
38
|
}
|
|
29
39
|
export {
|
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
const formatToRawFilter = (appliedFilters) => {
|
|
2
2
|
return appliedFilters.map((af) => {
|
|
3
3
|
let oa = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
let o1 = void 0;
|
|
5
|
+
if (af.fieldType === "selectAsync" && af.field.type === "selectAsync") {
|
|
6
|
+
if (af.field.selectAsyncOptions.multiple) {
|
|
7
|
+
o1 = void 0;
|
|
8
|
+
oa = af.operandsArray.map(af.field.selectAsyncOptions.getOptionId);
|
|
9
|
+
} else {
|
|
10
|
+
o1 = af.field.selectAsyncOptions.getOptionId(af.operand1);
|
|
11
|
+
}
|
|
12
|
+
} else if (af.fieldType === "select" && af.field.type === "select" && af.operandsArray) {
|
|
13
|
+
if (af.field.selectOptions.multiple) {
|
|
14
|
+
oa = af.operandsArray;
|
|
15
|
+
}
|
|
16
|
+
} else {
|
|
17
|
+
o1 = af.operand1;
|
|
9
18
|
}
|
|
10
19
|
return {
|
|
11
20
|
n: af.field.name,
|
|
12
21
|
ft: af.field.type,
|
|
13
22
|
o: af.operator,
|
|
14
|
-
o1
|
|
23
|
+
o1,
|
|
15
24
|
o2: af.operator === "b" ? af.operand2 : void 0,
|
|
16
25
|
oa
|
|
17
26
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { forwardRef, useRef, useImperativeHandle, useEffect, createContext } from "react";
|
|
3
3
|
import { useStore } from "zustand";
|
|
4
4
|
import { shallow } from "zustand/shallow";
|
|
5
5
|
import { useModuleDictionary, useEnvironment, useModuleSkeleton } from "@m4l/core";
|
|
@@ -2,5 +2,5 @@ import { FilterFieldApplied } from '../../types';
|
|
|
2
2
|
/**
|
|
3
3
|
* AppliedFilterChip: Componente encargado de mostrar el chip de filtro aplicado
|
|
4
4
|
*/
|
|
5
|
-
declare function AppliedFilterChip(
|
|
5
|
+
declare function AppliedFilterChip(filter: FilterFieldApplied): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export default AppliedFilterChip;
|