@m4l/components 9.33.2-beta-m4lcom-756-dynamicfilter-bug-con-las-fechas-aplicadas.0 → 9.34.0
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 +11 -0
- package/components/DynamicFilter/helpers/getPurgedInitialFiltersApplied.d.ts +1 -2
- package/components/DynamicFilter/helpers/getPurgedInitialFiltersApplied.d.ts.map +1 -1
- package/components/DynamicFilter/helpers/getPurgedInitialFiltersApplied.js +4 -5
- package/components/DynamicFilter/store/DynamicFilterContext.d.ts.map +1 -1
- package/components/DynamicFilter/store/DynamicFilterContext.js +36 -38
- package/components/DynamicFilter/store/DynamicFilterStore.d.ts.map +1 -1
- package/components/DynamicFilter/store/DynamicFilterStore.js +1 -2
- package/components/DynamicFilter/store/types.d.ts +1 -7
- package/components/DynamicFilter/store/types.d.ts.map +1 -1
- package/components/DynamicFilter/subcomponents/FieldTypes/DateTimeFilter/helpers.d.ts +3 -3
- package/components/DynamicFilter/subcomponents/FieldTypes/DateTimeFilter/helpers.d.ts.map +1 -1
- package/components/DynamicFilter/subcomponents/FieldTypes/DateTimeFilter/helpers.js +56 -57
- package/components/DynamicFilter/subcomponents/FieldTypes/FieldTypeInterface.d.ts +3 -15
- package/components/DynamicFilter/subcomponents/FieldTypes/FieldTypeInterface.d.ts.map +1 -1
- package/components/DynamicFilter/subcomponents/InputFilter/InputFilter.d.ts +1 -1
- package/components/DynamicFilter/subcomponents/InputFilter/InputFilter.d.ts.map +1 -1
- package/components/DynamicFilter/subcomponents/InputFilter/InputFilter.js +26 -25
- package/components/DynamicFilter/subcomponents/InputFilter/useInputFilter.d.ts +4 -0
- package/components/DynamicFilter/subcomponents/InputFilter/useInputFilter.d.ts.map +1 -1
- package/components/DynamicFilter/subcomponents/InputFilter/useInputFilter.js +27 -23
- package/components/DynamicFilter/subcomponents/PopoverFilter/usePopoverFilter.d.ts.map +1 -1
- package/components/DynamicFilter/subcomponents/PopoverFilter/usePopoverFilter.js +30 -31
- package/components/MFIsolationApp/MFIsolationApp.d.ts.map +1 -1
- package/components/MFIsolationApp/MFIsolationApp.js +85 -81
- package/components/MFIsolationApp/subcomponents/ThemeSettingsHostToolsBridge/ThemeSettingsHostToolsBridge.d.ts +5 -0
- package/components/MFIsolationApp/subcomponents/ThemeSettingsHostToolsBridge/ThemeSettingsHostToolsBridge.d.ts.map +1 -0
- package/components/MFIsolationApp/subcomponents/ThemeSettingsHostToolsBridge/ThemeSettingsHostToolsBridge.js +14 -0
- package/components/MFIsolationApp/subcomponents/ThemeSettingsHostToolsBridge/index.d.ts +2 -0
- package/components/MFIsolationApp/subcomponents/ThemeSettingsHostToolsBridge/index.d.ts.map +1 -0
- package/components/extended/ReactSimpleCodeEditor/CodeEditor.d.ts +6 -0
- package/components/extended/ReactSimpleCodeEditor/CodeEditor.d.ts.map +1 -0
- package/components/extended/ReactSimpleCodeEditor/CodeEditor.js +380 -0
- package/components/extended/ReactSimpleCodeEditor/CodeEditor.styles.d.ts +3 -0
- package/components/extended/ReactSimpleCodeEditor/CodeEditor.styles.d.ts.map +1 -0
- package/components/extended/ReactSimpleCodeEditor/CodeEditor.styles.js +344 -0
- package/components/extended/ReactSimpleCodeEditor/constants.d.ts +83 -0
- package/components/extended/ReactSimpleCodeEditor/constants.d.ts.map +1 -0
- package/components/extended/ReactSimpleCodeEditor/constants.js +149 -0
- package/components/extended/ReactSimpleCodeEditor/dictionary.d.ts +12 -0
- package/components/extended/ReactSimpleCodeEditor/dictionary.d.ts.map +1 -0
- package/components/extended/ReactSimpleCodeEditor/dictionary.js +8 -0
- package/components/extended/ReactSimpleCodeEditor/helpers/highlighting.d.ts +58 -0
- package/components/extended/ReactSimpleCodeEditor/helpers/highlighting.d.ts.map +1 -0
- package/components/extended/ReactSimpleCodeEditor/helpers/highlighting.js +1063 -0
- package/components/extended/ReactSimpleCodeEditor/helpers/languageIcon.d.ts +6 -0
- package/components/extended/ReactSimpleCodeEditor/helpers/languageIcon.d.ts.map +1 -0
- package/components/extended/ReactSimpleCodeEditor/helpers/languageIcon.js +7 -0
- package/components/extended/ReactSimpleCodeEditor/helpers/resolveEditorComponent.d.ts +6 -0
- package/components/extended/ReactSimpleCodeEditor/helpers/resolveEditorComponent.d.ts.map +1 -0
- package/components/extended/ReactSimpleCodeEditor/helpers/resolveEditorComponent.js +9 -0
- package/components/extended/ReactSimpleCodeEditor/index.d.ts +4 -0
- package/components/extended/ReactSimpleCodeEditor/index.d.ts.map +1 -0
- package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorEnum.d.ts +20 -0
- package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorEnum.d.ts.map +1 -0
- package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorEnum.js +4 -0
- package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorSlots.d.ts +90 -0
- package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorSlots.d.ts.map +1 -0
- package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorSlots.js +73 -0
- package/components/extended/ReactSimpleCodeEditor/slots/index.d.ts +3 -0
- package/components/extended/ReactSimpleCodeEditor/slots/index.d.ts.map +1 -0
- package/components/extended/ReactSimpleCodeEditor/types.d.ts +460 -0
- package/components/extended/ReactSimpleCodeEditor/types.d.ts.map +1 -0
- package/components/extended/index.d.ts +1 -0
- package/components/extended/index.d.ts.map +1 -1
- package/components/hook-form/RHFCodeEditor/RHFCodeEditor.d.ts +7 -0
- package/components/hook-form/RHFCodeEditor/RHFCodeEditor.d.ts.map +1 -0
- package/components/hook-form/RHFCodeEditor/RHFCodeEditor.js +6 -0
- package/components/hook-form/RHFCodeEditor/index.d.ts +3 -0
- package/components/hook-form/RHFCodeEditor/index.d.ts.map +1 -0
- package/components/hook-form/index.d.ts +1 -0
- package/components/hook-form/index.d.ts.map +1 -1
- package/index.js +565 -552
- package/package.json +8 -5
- package/components/DynamicFilter/hooks/useUserTimeZoneName.d.ts +0 -8
- package/components/DynamicFilter/hooks/useUserTimeZoneName.d.ts.map +0 -1
- package/components/DynamicFilter/hooks/useUserTimeZoneName.js +0 -8
package/@types/types.d.ts
CHANGED
|
@@ -373,6 +373,10 @@ import {
|
|
|
373
373
|
ReactJsonViewerOwnerState,
|
|
374
374
|
ReactJsonViewerSlotsType,
|
|
375
375
|
} from '../components/extended/React-Json-Viewer/types';
|
|
376
|
+
import {
|
|
377
|
+
CodeEditorOwnerState,
|
|
378
|
+
CodeEditorSlotsType,
|
|
379
|
+
} from '../components/extended/ReactSimpleCodeEditor/types';
|
|
376
380
|
import {
|
|
377
381
|
ResizableOwnerState as ReactResizableOwnerState,
|
|
378
382
|
ResizableSlotsType,
|
|
@@ -499,6 +503,7 @@ declare module '@mui/material/styles' {
|
|
|
499
503
|
M4LFixedSizeList: FixedSizeListSlotsType;
|
|
500
504
|
M4LVariableSizeList: VariableSizeListSlotsType;
|
|
501
505
|
M4LReactJsonViewer: ReactJsonViewerSlotsType;
|
|
506
|
+
M4LCodeEditor: CodeEditorSlotsType;
|
|
502
507
|
M4LResizable: ResizableSlotsType;
|
|
503
508
|
M4LResizableBox: ResizableBoxSlotsType;
|
|
504
509
|
M4LImageSelector: ImageSelectorSlotsType;
|
|
@@ -614,6 +619,7 @@ declare module '@mui/material/styles' {
|
|
|
614
619
|
M4LFixedSizeList: Partial<FixedSizeListOwnerState>;
|
|
615
620
|
M4LVariableSizeList: Partial<VariableSizeListOwnerState>;
|
|
616
621
|
M4LReactJsonViewer: Partial<ReactJsonViewerOwnerState>;
|
|
622
|
+
M4LCodeEditor: Partial<CodeEditorOwnerState>;
|
|
617
623
|
M4LResizable: Partial<ReactResizableOwnerState>;
|
|
618
624
|
M4LResizableBox: Partial<ResizableBoxOwnerState>;
|
|
619
625
|
M4LImageSelector: Partial<ImageSelectorOwnerState>;
|
|
@@ -1168,6 +1174,11 @@ declare module '@mui/material/styles' {
|
|
|
1168
1174
|
styleOverrides?: ComponentsOverrides<Theme>['M4LReactJsonViewer'];
|
|
1169
1175
|
variants?: ComponentsVariants['M4LReactJsonViewer'];
|
|
1170
1176
|
};
|
|
1177
|
+
M4LCodeEditor?: {
|
|
1178
|
+
defaultProps?: ComponentsPropsList['M4LCodeEditor'];
|
|
1179
|
+
styleOverrides?: ComponentsOverrides<Theme>['M4LCodeEditor'];
|
|
1180
|
+
variants?: ComponentsVariants['M4LCodeEditor'];
|
|
1181
|
+
};
|
|
1171
1182
|
M4LResizable?: {
|
|
1172
1183
|
defaultProps?: ComponentsPropsList['M4LResizable'];
|
|
1173
1184
|
styleOverrides?: ComponentsOverrides<Theme>['M4LResizable'];
|
|
@@ -4,8 +4,7 @@ import { FilterField, FilterFieldApplied, InitialFilterApplied } from '../types'
|
|
|
4
4
|
* @param fields todos los campos que pueden aparecer en el filtro no Inclute el AllField
|
|
5
5
|
* @param initialFilters Filtros que van a ser purgados (Eliminados si tienen errores)
|
|
6
6
|
* @param getFieldByName Funcion para obtener el Field a través del nombre
|
|
7
|
-
* @param timeZoneName Zona horaria del usuario para construir los filtros por defecto de fecha
|
|
8
7
|
* @returns Array de filtros aplicados excluyendo los que tengan errores
|
|
9
8
|
*/
|
|
10
|
-
export declare function getPurgedInitialFiltersApplied(fields: Array<FilterField>, initialFilters: Array<InitialFilterApplied>, getFieldByName: (name: string) => FilterField
|
|
9
|
+
export declare function getPurgedInitialFiltersApplied(fields: Array<FilterField>, initialFilters: Array<InitialFilterApplied>, getFieldByName: (name: string) => FilterField): Array<FilterFieldApplied>;
|
|
11
10
|
//# sourceMappingURL=getPurgedInitialFiltersApplied.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPurgedInitialFiltersApplied.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/DynamicFilter/helpers/getPurgedInitialFiltersApplied.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEtF
|
|
1
|
+
{"version":3,"file":"getPurgedInitialFiltersApplied.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/DynamicFilter/helpers/getPurgedInitialFiltersApplied.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEtF;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,KAAK,CAAC,WAAW,CAAC,EAC1B,cAAc,EAAE,KAAK,CAAC,oBAAoB,CAAC,EAC3C,cAAc,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,WAAW,GAC5C,KAAK,CAAC,kBAAkB,CAAC,CA0D3B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { fieldFactory as p } from "../subcomponents/FieldTypes/fieldFactory.js";
|
|
2
|
-
function
|
|
2
|
+
function u(f, t, a) {
|
|
3
3
|
const o = [], i = [];
|
|
4
4
|
for (let n = 0; n < t.length; n++)
|
|
5
5
|
try {
|
|
@@ -16,7 +16,7 @@ function x(f, t, a, c) {
|
|
|
16
16
|
};
|
|
17
17
|
if (!e)
|
|
18
18
|
continue;
|
|
19
|
-
p(e.type).verifyFilter(d, e) && (r.fieldType === "datetime" && (r.operand1 = /* @__PURE__ */ new Date(r.operand1 + ""), r.operand2 = /* @__PURE__ */ new Date(r.operand2 + "")), e.presence === "fixed" && (i.findIndex((
|
|
19
|
+
p(e.type).verifyFilter(d, e) && (r.fieldType === "datetime" && (r.operand1 = /* @__PURE__ */ new Date(r.operand1 + ""), r.operand2 = /* @__PURE__ */ new Date(r.operand2 + "")), e.presence === "fixed" && (i.findIndex((c) => c === e.name) === -1 ? (r.fixed = !0, i.push(e.name)) : r.fixed = !1), r.isSet = !0, r.id = o.length + 1, o.push(r));
|
|
20
20
|
} catch {
|
|
21
21
|
}
|
|
22
22
|
for (let n = 0; n < f.length; n++) {
|
|
@@ -24,8 +24,7 @@ function x(f, t, a, c) {
|
|
|
24
24
|
if ((d.presence === "initialized" || d.presence === "fixed") && !t.find((e) => e.name === d.name)) {
|
|
25
25
|
const e = p(d.type).getDefaultFilter(
|
|
26
26
|
d,
|
|
27
|
-
d.presence === "fixed"
|
|
28
|
-
c
|
|
27
|
+
d.presence === "fixed"
|
|
29
28
|
);
|
|
30
29
|
e.id = -(o.length + 1), o.push(e);
|
|
31
30
|
}
|
|
@@ -33,5 +32,5 @@ function x(f, t, a, c) {
|
|
|
33
32
|
return o;
|
|
34
33
|
}
|
|
35
34
|
export {
|
|
36
|
-
|
|
35
|
+
u as getPurgedInitialFiltersApplied
|
|
37
36
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DynamicFilterContext.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/DynamicFilter/store/DynamicFilterContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,SAAS,EAIf,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"DynamicFilterContext.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/DynamicFilter/store/DynamicFilterContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,SAAS,EAIf,MAAM,OAAO,CAAC;AAWf,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAQhE,QAAA,MAAM,oBAAoB,6GAAiD,CAAC;AAC5E,UAAU,yBAA0B,SAAQ,kBAAkB;IAC5D,QAAQ,EAAE,SAAS,CAAC;CACrB;AACD;;GAEG;AACH,QAAA,MAAM,qBAAqB,wHAwMzB,CAAC;AAEH,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,CAAC"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { jsx as $ } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import { forwardRef as V, useRef as
|
|
2
|
+
import { forwardRef as V, useRef as j, useImperativeHandle as B, useEffect as s, createContext as H } from "react";
|
|
3
3
|
import { useStore as r } from "zustand";
|
|
4
4
|
import { shallow as i } from "zustand/shallow";
|
|
5
|
-
import { useModuleDictionary as
|
|
6
|
-
import { useIsMobile as
|
|
7
|
-
import { useComponentSize as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
const te = B(null), de = V((g, S) => {
|
|
5
|
+
import { useModuleDictionary as N, useEnvironment as q, useModuleSkeleton as G } from "@m4l/core";
|
|
6
|
+
import { useIsMobile as J, useFirstRender as Q } from "@m4l/graphics";
|
|
7
|
+
import { useComponentSize as U } from "../../../hooks/useComponentSize/index.js";
|
|
8
|
+
import { ALL_FIELD as W } from "../constants.js";
|
|
9
|
+
import { formatToRawFilter as X } from "../helpers/formatToRowFilter.js";
|
|
10
|
+
import { formatToInitialFilters as Y } from "../helpers/formatToInitialFilters.js";
|
|
11
|
+
import { createDynamicFilterStore as Z } from "./DynamicFilterStore.js";
|
|
12
|
+
const K = H(null), fe = V((g, S) => {
|
|
14
13
|
const {
|
|
15
14
|
automatic: f = !0,
|
|
16
15
|
withAllField: h = !0,
|
|
@@ -24,12 +23,12 @@ const te = B(null), de = V((g, S) => {
|
|
|
24
23
|
storeId: R,
|
|
25
24
|
storeDevtoolsEnabled: b = !1,
|
|
26
25
|
visibleRefresh: l = !0
|
|
27
|
-
} = g, { currentSize: n } =
|
|
28
|
-
e.current || (e.current =
|
|
26
|
+
} = g, { currentSize: n } = U(w), { getLabel: A } = N(), e = j(null), { host_static_assets: M, environment_assets: x } = q(), a = !J(), c = G(), z = Q([a, c]);
|
|
27
|
+
e.current || (e.current = Z(
|
|
29
28
|
{
|
|
30
29
|
allField: {
|
|
31
|
-
...
|
|
32
|
-
urlIcon: `${
|
|
30
|
+
...W,
|
|
31
|
+
urlIcon: `${M}/${x}/frontend/components/dynamic_filter/assets/icons/all_fields.svg`
|
|
33
32
|
},
|
|
34
33
|
withAllField: h,
|
|
35
34
|
fields: v,
|
|
@@ -39,7 +38,6 @@ const te = B(null), de = V((g, S) => {
|
|
|
39
38
|
size: n,
|
|
40
39
|
storeId: R,
|
|
41
40
|
visibleRefresh: l,
|
|
42
|
-
timeZoneName: M,
|
|
43
41
|
ownerState: {
|
|
44
42
|
isSkeleton: c,
|
|
45
43
|
isDirty: !1,
|
|
@@ -52,44 +50,44 @@ const te = B(null), de = V((g, S) => {
|
|
|
52
50
|
},
|
|
53
51
|
b
|
|
54
52
|
), e.current.getState().actions.init(y));
|
|
55
|
-
const
|
|
53
|
+
const I = r(
|
|
56
54
|
e.current,
|
|
57
55
|
(t) => t.actions.fireOnChangeFilters,
|
|
58
56
|
i
|
|
59
|
-
),
|
|
57
|
+
), O = r(
|
|
60
58
|
e.current,
|
|
61
59
|
(t) => t.actions.openPopoverMenuFields,
|
|
62
60
|
i
|
|
63
|
-
),
|
|
61
|
+
), P = r(
|
|
64
62
|
e.current,
|
|
65
63
|
(t) => t.actions.showPopoverFilterForAdd,
|
|
66
64
|
i
|
|
67
|
-
),
|
|
65
|
+
), _ = (t) => {
|
|
68
66
|
try {
|
|
69
67
|
const o = e.current?.getState();
|
|
70
68
|
if (!o)
|
|
71
69
|
return;
|
|
72
|
-
const
|
|
70
|
+
const m = o.actions.getFieldByName(t), k = o.appliedFilters.some(
|
|
73
71
|
(F) => F.field.name === t && F.isSet
|
|
74
|
-
),
|
|
75
|
-
if (k && !
|
|
72
|
+
), T = m.multiple;
|
|
73
|
+
if (k && !T)
|
|
76
74
|
return;
|
|
77
|
-
|
|
75
|
+
P(m);
|
|
78
76
|
} catch (o) {
|
|
79
77
|
throw new Error(`Error al agregar el filtro externo: ${o}`);
|
|
80
78
|
}
|
|
81
|
-
},
|
|
79
|
+
}, L = r(
|
|
82
80
|
e.current,
|
|
83
81
|
(t) => () => t.appliedFilters,
|
|
84
82
|
i
|
|
85
83
|
);
|
|
86
|
-
|
|
87
|
-
fireOnChangeFilter:
|
|
88
|
-
openPopoverMenuFields:
|
|
89
|
-
addExternalFilter:
|
|
90
|
-
getCurrentFilters:
|
|
84
|
+
B(S, () => ({
|
|
85
|
+
fireOnChangeFilter: I,
|
|
86
|
+
openPopoverMenuFields: O,
|
|
87
|
+
addExternalFilter: _,
|
|
88
|
+
getCurrentFilters: L
|
|
91
89
|
}));
|
|
92
|
-
const
|
|
90
|
+
const d = r(
|
|
93
91
|
e.current,
|
|
94
92
|
(t) => t.countOnChangeFiltersApplied,
|
|
95
93
|
i
|
|
@@ -99,15 +97,15 @@ const te = B(null), de = V((g, S) => {
|
|
|
99
97
|
i
|
|
100
98
|
);
|
|
101
99
|
return s(() => {
|
|
102
|
-
if (
|
|
100
|
+
if (d === 0)
|
|
103
101
|
return;
|
|
104
102
|
const t = e.current?.getState();
|
|
105
103
|
t && C?.(
|
|
106
|
-
|
|
107
|
-
|
|
104
|
+
Y(t.appliedFilters),
|
|
105
|
+
X(t.appliedFilters)
|
|
108
106
|
);
|
|
109
|
-
}, [
|
|
110
|
-
|
|
107
|
+
}, [d]), s(() => {
|
|
108
|
+
z || e.current?.getState().actions.setExternalState({ isMobile: !a, isSkeleton: c });
|
|
111
109
|
}, [a, c]), s(() => {
|
|
112
110
|
if (f) {
|
|
113
111
|
e.current?.getState().actions.fireOnChangeFilters();
|
|
@@ -117,9 +115,9 @@ const te = B(null), de = V((g, S) => {
|
|
|
117
115
|
u && p && u();
|
|
118
116
|
}, [p, u]), s(() => {
|
|
119
117
|
e.current?.getState().size !== n && e.current?.getState().actions.setSize(n), e.current?.getState().visibleRefresh !== l && e.current?.getState().actions.setVisibleRefresh(l);
|
|
120
|
-
}, [n, l]), /* @__PURE__ */ $(
|
|
118
|
+
}, [n, l]), /* @__PURE__ */ $(K.Provider, { value: e.current, children: E });
|
|
121
119
|
});
|
|
122
120
|
export {
|
|
123
|
-
|
|
124
|
-
|
|
121
|
+
K as DynamicFilterContext,
|
|
122
|
+
fe as DynamicFilterProvider
|
|
125
123
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DynamicFilterStore.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/DynamicFilter/store/DynamicFilterStore.ts"],"names":[],"mappings":"AAaA,OAAO,EAAsB,6BAA6B,EAAsB,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAgDnH;;;GAGG;AACH,eAAO,MAAM,wBAAwB,GAAI,WAAW,iBAAiB,EAAE,8BAA4B,
|
|
1
|
+
{"version":3,"file":"DynamicFilterStore.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/DynamicFilter/store/DynamicFilterStore.ts"],"names":[],"mappings":"AAaA,OAAO,EAAsB,6BAA6B,EAAsB,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAgDnH;;;GAGG;AACH,eAAO,MAAM,wBAAwB,GAAI,WAAW,iBAAiB,EAAE,8BAA4B,8DA2PlG,CAAC;AACF,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
|
|
@@ -73,12 +73,6 @@ export interface DynamicFilterState extends Pick<DynamicFilterProps, 'visibleRef
|
|
|
73
73
|
* Función utilizada para el dictionary
|
|
74
74
|
*/
|
|
75
75
|
getLabel: GetLabelType;
|
|
76
|
-
/**
|
|
77
|
-
* "timeZoneName" IANA time-zone name from the user preferences (e.g.
|
|
78
|
-
* "America/Bogota"). Date filters use it so the picker, the applied chip and
|
|
79
|
-
* the network query all agree on the user's clock. Undefined = local time.
|
|
80
|
-
*/
|
|
81
|
-
timeZoneName?: string;
|
|
82
76
|
}
|
|
83
77
|
export interface DynamicFilterStateWithActions extends DynamicFilterState {
|
|
84
78
|
actions: {
|
|
@@ -188,5 +182,5 @@ export interface DynamicFilterStateWithActions extends DynamicFilterState {
|
|
|
188
182
|
setVisibleRefresh: (newVisibleRefresh: boolean) => void;
|
|
189
183
|
};
|
|
190
184
|
}
|
|
191
|
-
export type InitialStoreProps = Pick<DynamicFilterState, 'automatic' | 'fields' | 'withAllField' | 'getLabel' | 'allField' | 'ownerState' | 'dataTestId' | 'size' | 'storeId' | 'visibleRefresh'
|
|
185
|
+
export type InitialStoreProps = Pick<DynamicFilterState, 'automatic' | 'fields' | 'withAllField' | 'getLabel' | 'allField' | 'ownerState' | 'dataTestId' | 'size' | 'storeId' | 'visibleRefresh'>;
|
|
192
186
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/DynamicFilter/store/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,KAAK,EACV,kBAAkB,EAClB,WAAW,EACX,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,UAAU,EACX,MAAM,UAAU,CAAC;AAClB,MAAM,MAAM,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC;AAGrC,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;CAKlB;AACD,MAAM,WAAW,oBAAqB,SAAQ,qBAAqB;IACjE,OAAO,EAAE,KAAK,CAAC;IACf;;OAEG;IACH,KAAK,EAAE,WAAW,CAAC;CACpB;AACD,MAAM,WAAW,qBAAsB,SAAQ,qBAAqB;IAClE,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,MAAM,EAAE,kBAAkB,CAAC;IAC3B,KAAK,EAAE,WAAW,CAAC;CACpB;AACD;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,oBAAoB,GAAG,qBAAqB,CAAC;AAC7E;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,UAAU,EAAE,UAAU,GAAG,YAAY,CAAC,CAAC;AAG7E;;GAEG;AACH,MAAM,WAAW,kBACf,SAAQ,IAAI,CAAC,kBAAkB,EAAE,gBAAgB,GAAG,MAAM,GAAG,YAAY,GAAG,WAAW,GAAG,SAAS,GAAG,cAAc,GAAG,QAAQ,CAAC;IAChI;;OAEG;IACH,UAAU,EAAE,UAAU,CAAC;IACvB;;OAEG;IACH,QAAQ,EAAE,WAAW,CAAC;IAEtB;;OAEG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAElC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,eAAe,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;IACpC;;OAEG;IACH,cAAc,EAAE,KAAK,CAAC,kBAAkB,CAAC,CAAC;IAC1C;;;OAGG;IACH,2BAA2B,EAAE,MAAM,CAAC;IACpC;;OAEG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC;;OAEG;IACH,QAAQ,EAAE,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/DynamicFilter/store/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,KAAK,EACV,kBAAkB,EAClB,WAAW,EACX,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,UAAU,EACX,MAAM,UAAU,CAAC;AAClB,MAAM,MAAM,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC;AAGrC,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;CAKlB;AACD,MAAM,WAAW,oBAAqB,SAAQ,qBAAqB;IACjE,OAAO,EAAE,KAAK,CAAC;IACf;;OAEG;IACH,KAAK,EAAE,WAAW,CAAC;CACpB;AACD,MAAM,WAAW,qBAAsB,SAAQ,qBAAqB;IAClE,OAAO,EAAE,MAAM,C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CAAC;CACH;AACD,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAClC,kBAAkB,EAClB,WAAW,GAAG,QAAQ,GAAG,cAAc,GAAG,UAAU,GAAG,UAAU,GAAG,YAAY,GAAG,YAAY,GAAE,MAAM,GAAG,SAAS,GAAG,gBAAgB,CACvI,CAAC"}
|
|
@@ -12,15 +12,15 @@ export declare class DateTimeFilterHelpers implements IFieldType<FormFilterValue
|
|
|
12
12
|
/**
|
|
13
13
|
* getDefaultFilter devuelve un filtro por defecto para un campo de fecha y hora.
|
|
14
14
|
*/
|
|
15
|
-
getDefaultFilter(field: FilterField, fixed: boolean
|
|
15
|
+
getDefaultFilter(field: FilterField, fixed: boolean): FilterFieldApplied;
|
|
16
16
|
/**
|
|
17
17
|
* getFormValue convierte un valor de filtro en un valor de formulario.
|
|
18
18
|
*/
|
|
19
|
-
getFormValue(field: FilterField, getLabel: GetLabelType, filterValueDateTime?: FilterValue
|
|
19
|
+
getFormValue(field: FilterField, getLabel: GetLabelType, filterValueDateTime?: FilterValue): FormFilterValueDateTime;
|
|
20
20
|
/**
|
|
21
21
|
* getFilterFromFormValue convierte un valor de formulario en un valor de filtro.
|
|
22
22
|
*/
|
|
23
|
-
getFilterFromFormValue(formFilterValue: FormFilterValueDateTime
|
|
23
|
+
getFilterFromFormValue(formFilterValue: FormFilterValueDateTime): FilterValue;
|
|
24
24
|
/**
|
|
25
25
|
* getlabels devuelve las etiquetas de un filtro de fecha y hora.
|
|
26
26
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/components/src/components/DynamicFilter/subcomponents/FieldTypes/DateTimeFilter/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/components/src/components/DynamicFilter/subcomponents/FieldTypes/DateTimeFilter/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,E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
-
|
|
9
|
-
class g {
|
|
1
|
+
import * as p from "yup";
|
|
2
|
+
import { DATE_TIME_OPERATORS as c } from "../../../constants.js";
|
|
3
|
+
import { DYNAMIC_FILTER_DICTIONARY_ID as f, DICCTIONARY as d } from "../../../dictionary.js";
|
|
4
|
+
import { DateTimeFilter as D } from "./index.js";
|
|
5
|
+
import { startOfDay as _, endOfDay as y, differenceInDays as V } from "date-fns";
|
|
6
|
+
import { isValidDate as i } from "../../../../../utils/isValidDate.js";
|
|
7
|
+
import { createValidationSchema as F, createValidationFullObject as T, createValidationPartialObject as b } from "../../../../hook-form/RHFormProvider/schema.js";
|
|
8
|
+
class v {
|
|
10
9
|
getComponent() {
|
|
11
|
-
return
|
|
10
|
+
return D;
|
|
12
11
|
}
|
|
13
12
|
/**
|
|
14
13
|
* getDefaultFilter devuelve un filtro por defecto para un campo de fecha y hora.
|
|
15
14
|
*/
|
|
16
|
-
getDefaultFilter(e, o
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
const
|
|
20
|
-
let
|
|
21
|
-
return
|
|
15
|
+
getDefaultFilter(e, o) {
|
|
16
|
+
const a = /* @__PURE__ */ new Date(), r = /* @__PURE__ */ new Date();
|
|
17
|
+
a.setHours(0, 0, 0, 0), r.setHours(23, 59, 59, 999);
|
|
18
|
+
const t = e.defaultOperand1 && e.defaultOperand1 instanceof Date ? e.defaultOperand1 : a, n = e.defaultOperand2 && e.defaultOperand2 instanceof Date ? e.defaultOperand2 : r;
|
|
19
|
+
let u = !1;
|
|
20
|
+
return t !== void 0 && (u = !0), {
|
|
22
21
|
id: 0,
|
|
23
22
|
fieldType: "datetime",
|
|
24
23
|
field: e,
|
|
25
24
|
fixed: o,
|
|
26
|
-
isSet:
|
|
25
|
+
isSet: u,
|
|
27
26
|
operator: "b",
|
|
28
|
-
operand1:
|
|
29
|
-
operand2:
|
|
27
|
+
operand1: t,
|
|
28
|
+
operand2: n
|
|
30
29
|
};
|
|
31
30
|
}
|
|
32
31
|
/**
|
|
33
32
|
* getFormValue convierte un valor de filtro en un valor de formulario.
|
|
34
33
|
*/
|
|
35
|
-
getFormValue(e, o, a
|
|
36
|
-
const r = a,
|
|
34
|
+
getFormValue(e, o, a) {
|
|
35
|
+
const r = a, t = r ? r.operator : e.defaultOperator ?? "b", n = _(/* @__PURE__ */ new Date()), u = y(/* @__PURE__ */ new Date()), s = e.defaultOperand1 && e.defaultOperand1 instanceof Date ? e.defaultOperand1 : n, l = e.defaultOperand2 && e.defaultOperand2 instanceof Date ? e.defaultOperand2 : u, m = r ? r.operand1 : s, O = r && r.operator === "b" ? r.operand2 : l;
|
|
37
36
|
return {
|
|
38
37
|
fieldType: "datetime",
|
|
39
38
|
formValueOperator: {
|
|
40
|
-
id:
|
|
41
|
-
label: o(`${
|
|
39
|
+
id: t,
|
|
40
|
+
label: o(`${f}.operator_${t}`)
|
|
42
41
|
},
|
|
43
|
-
formValueOperand1:
|
|
44
|
-
formValueOperand2:
|
|
42
|
+
formValueOperand1: m,
|
|
43
|
+
formValueOperand2: O
|
|
45
44
|
};
|
|
46
45
|
}
|
|
47
46
|
/**
|
|
48
47
|
* getFilterFromFormValue convierte un valor de formulario en un valor de filtro.
|
|
49
48
|
*/
|
|
50
|
-
getFilterFromFormValue(e
|
|
51
|
-
const
|
|
52
|
-
if (
|
|
53
|
-
const r = e.formValueOperand2
|
|
49
|
+
getFilterFromFormValue(e) {
|
|
50
|
+
const o = e.formValueOperator.id, a = e.formValueOperand1;
|
|
51
|
+
if (o === "b") {
|
|
52
|
+
const r = e.formValueOperand2;
|
|
54
53
|
return {
|
|
55
54
|
fieldType: "datetime",
|
|
56
|
-
operator:
|
|
57
|
-
operand1:
|
|
58
|
-
operand2:
|
|
55
|
+
operator: o,
|
|
56
|
+
operand1: a,
|
|
57
|
+
operand2: r
|
|
59
58
|
};
|
|
60
59
|
} else
|
|
61
60
|
return {
|
|
62
61
|
fieldType: "datetime",
|
|
63
|
-
operator:
|
|
64
|
-
operand1:
|
|
62
|
+
operator: o,
|
|
63
|
+
operand1: a
|
|
65
64
|
};
|
|
66
65
|
}
|
|
67
66
|
/**
|
|
68
67
|
* getlabels devuelve las etiquetas de un filtro de fecha y hora.
|
|
69
68
|
*/
|
|
70
|
-
getLabels(e, o, a,
|
|
71
|
-
const { dateFormatter:
|
|
69
|
+
getLabels(e, o, a, r) {
|
|
70
|
+
const { dateFormatter: t } = a;
|
|
72
71
|
let n;
|
|
73
|
-
return e.operator === "b" ? n = e.operand1 && e.operand2 ? `${
|
|
72
|
+
return e.operator === "b" ? n = e.operand1 && e.operand2 ? `${t.formatDate(
|
|
74
73
|
e.operand1,
|
|
75
|
-
|
|
76
|
-
)} - ${
|
|
74
|
+
t.datetimeFormat
|
|
75
|
+
)} - ${t.formatDate(
|
|
77
76
|
e.operand2,
|
|
78
|
-
|
|
79
|
-
)}` : "" : n = e.operand1 ?
|
|
77
|
+
t.datetimeFormat
|
|
78
|
+
)}` : "" : n = e.operand1 ? t.formatDate(
|
|
80
79
|
e.operand1,
|
|
81
|
-
|
|
80
|
+
t.datetimeFormat
|
|
82
81
|
) : "", {
|
|
83
82
|
labelField: e.field.label ?? o(e.field.dictionaryId),
|
|
84
83
|
labelOperator: o(
|
|
85
|
-
`${
|
|
84
|
+
`${f}.operator_${e.operator}`
|
|
86
85
|
),
|
|
87
86
|
labelOperands: n
|
|
88
87
|
};
|
|
@@ -92,22 +91,22 @@ class g {
|
|
|
92
91
|
*/
|
|
93
92
|
getSchema(e, o) {
|
|
94
93
|
const a = o?.maxDays;
|
|
95
|
-
return
|
|
96
|
-
formValueOperator:
|
|
97
|
-
formValueOperand1:
|
|
98
|
-
formValueOperand2:
|
|
94
|
+
return F(T(b({
|
|
95
|
+
formValueOperator: p.object().nullable().required(e(d.error_operator_required)),
|
|
96
|
+
formValueOperand1: p.date().required(e(d.error_invalid_date)).typeError(e(d.error_invalid_date)),
|
|
97
|
+
formValueOperand2: p.mixed().when(["formValueOperator.id"], {
|
|
99
98
|
is: "b",
|
|
100
|
-
then:
|
|
101
|
-
|
|
102
|
-
e(
|
|
99
|
+
then: p.date().typeError(e(d.error_invalid_date)).min(
|
|
100
|
+
p.ref("formValueOperand1"),
|
|
101
|
+
e(d.error_invalid_date)
|
|
103
102
|
).test(
|
|
104
103
|
"max-days",
|
|
105
|
-
`${e(
|
|
106
|
-
function(
|
|
107
|
-
if (!a || !
|
|
104
|
+
`${e(d.error_max_days_exceeded)} (Máx. ${a})`,
|
|
105
|
+
function(r) {
|
|
106
|
+
if (!a || !r)
|
|
108
107
|
return !0;
|
|
109
|
-
const
|
|
110
|
-
return
|
|
108
|
+
const t = this.parent.formValueOperand1;
|
|
109
|
+
return t ? V(r, t) <= a : !0;
|
|
111
110
|
}
|
|
112
111
|
)
|
|
113
112
|
})
|
|
@@ -117,9 +116,9 @@ class g {
|
|
|
117
116
|
* verifyFilter verifica si un filtro de fecha y hora es válido.
|
|
118
117
|
*/
|
|
119
118
|
verifyFilter(e, o) {
|
|
120
|
-
return !(typeof e.operator != "string" ||
|
|
119
|
+
return !(typeof e.operator != "string" || c.findIndex((a) => a === e.operator) === -1 || typeof e.operand1 != "string" || !i(new Date(e.operand1)) || e.operator === "b" && (typeof e.operand2 != "string" || !i(new Date(e.operand1))));
|
|
121
120
|
}
|
|
122
121
|
}
|
|
123
122
|
export {
|
|
124
|
-
|
|
123
|
+
v as DateTimeFilterHelpers
|
|
125
124
|
};
|
|
@@ -10,23 +10,11 @@ export interface IFieldType<T extends RHFormValues> {
|
|
|
10
10
|
getComponent(): FC<{
|
|
11
11
|
[key: string]: any;
|
|
12
12
|
}>;
|
|
13
|
-
|
|
14
|
-
* `timeZoneName` (optional) lets date-based field types build their default
|
|
15
|
-
* operands in the user-preference time zone. Non-date field types ignore it.
|
|
16
|
-
*/
|
|
17
|
-
getDefaultFilter(field: FilterField, fixed: boolean, timeZoneName?: string): FilterFieldApplied;
|
|
13
|
+
getDefaultFilter(field: FilterField, fixed: boolean): FilterFieldApplied;
|
|
18
14
|
getLabels(filter: FilterFieldApplied, getLabel: GetLabelType, formatters: Formatters, field: FilterField): DataTypeFilerLabels;
|
|
19
15
|
getSchema(getLabel: GetLabelType, field?: FilterField): ValidationSchema<T>;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
* instants into the wall-clock the picker shows. Non-date field types ignore it.
|
|
23
|
-
*/
|
|
24
|
-
getFormValue(field: FilterField, getLabel: GetLabelType, filterValue?: FilterValue, timeZoneName?: string): T;
|
|
25
|
-
/**
|
|
26
|
-
* `timeZoneName` (optional) lets date-based field types convert the picker
|
|
27
|
-
* wall-clock back into the stored instant. Non-date field types ignore it.
|
|
28
|
-
*/
|
|
29
|
-
getFilterFromFormValue(formFilterValue: T, timeZoneName?: string): FilterValue;
|
|
16
|
+
getFormValue(field: FilterField, getLabel: GetLabelType, filterValue?: FilterValue): T;
|
|
17
|
+
getFilterFromFormValue(formFilterValue: T): FilterValue;
|
|
30
18
|
verifyFilter(filter: InitialFilterApplied, field?: FilterField): boolean;
|
|
31
19
|
}
|
|
32
20
|
//# sourceMappingURL=FieldTypeInterface.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldTypeInterface.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DynamicFilter/subcomponents/FieldTypes/FieldTypeInterface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAE3B,OAAO,KAAK,EACV,mBAAmB,EACnB,WAAW,EACX,kBAAkB,EAClB,WAAW,EACX,oBAAoB,EACrB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAEzF;;GAEG;AACH,MAAM,WAAW,UAAU,CAAC,CAAC,SAAS,YAAY;IAChD,YAAY,IAAI,EAAE,CAAC;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC,CAAC;IAC3C
|
|
1
|
+
{"version":3,"file":"FieldTypeInterface.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DynamicFilter/subcomponents/FieldTypes/FieldTypeInterface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAE3B,OAAO,KAAK,EACV,mBAAmB,EACnB,WAAW,EACX,kBAAkB,EAClB,WAAW,EACX,oBAAoB,EACrB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAEzF;;GAEG;AACH,MAAM,WAAW,UAAU,CAAC,CAAC,SAAS,YAAY;IAChD,YAAY,IAAI,EAAE,CAAC;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC,CAAC;IAC3C,gBAAgB,CAAC,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,GAAG,kBAAkB,CAAC;IACzE,SAAS,CACP,MAAM,EAAE,kBAAkB,EAC1B,QAAQ,EAAE,YAAY,EACtB,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,WAAW,GACjB,mBAAmB,CAAC;IACvB,SAAS,CAAC,QAAQ,EAAE,YAAY,EAAE,KAAK,CAAC,EAAE,WAAW,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAC5E,YAAY,CAAC,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,CAAC,EAAE,WAAW,GAAG,CAAC,CAAC;IACvF,sBAAsB,CAAC,eAAe,EAAE,CAAC,GAAG,WAAW,CAAC;IACxD,YAAY,CAAC,MAAM,EAAE,oBAAoB,EAAE,KAAK,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC;CAC1E"}
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
* campos. Al hacerle clic abre `PopoverMenuFields`, el cual contiene el input
|
|
4
4
|
* "Filtrar por" y el listado de campos disponibles.
|
|
5
5
|
*/
|
|
6
|
-
declare const InputFilter: () => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare const InputFilter: () => import("@emotion/react/jsx-runtime").JSX.Element | null;
|
|
7
7
|
export default InputFilter;
|
|
8
8
|
//# sourceMappingURL=InputFilter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputFilter.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DynamicFilter/subcomponents/InputFilter/InputFilter.tsx"],"names":[],"mappings":"AAMA;;;;GAIG;AACH,QAAA,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"InputFilter.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DynamicFilter/subcomponents/InputFilter/InputFilter.tsx"],"names":[],"mappings":"AAMA;;;;GAIG;AACH,QAAA,MAAM,WAAW,+DAgDhB,CAAC;AACF,eAAe,WAAW,CAAC"}
|