@monolith-forensics/monolith-ui 1.8.1-dev.3 → 1.8.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/dist/Button/Button.js +58 -9
- package/dist/Calendar/Calendar.d.ts +2 -7
- package/dist/Calendar/Calendar.js +49 -226
- package/dist/Calendar/CalendarStyles.d.ts +2 -6
- package/dist/Calendar/CalendarStyles.js +33 -153
- package/dist/Calendar/calendarHelpers.d.ts +2 -6
- package/dist/Calendar/calendarHelpers.js +5 -13
- package/dist/Charts/BarChart/BarChart.js +28 -14
- package/dist/Charts/BarChart/BarChart.styled.d.ts +7 -2
- package/dist/Charts/BarChart/BarChart.styled.js +5 -1
- package/dist/Charts/BarChart/BarChart.types.d.ts +13 -5
- package/dist/Charts/ChartUtils/chartSizing.d.ts +20 -0
- package/dist/Charts/ChartUtils/chartSizing.js +83 -0
- package/dist/Charts/ChartUtils/index.d.ts +1 -0
- package/dist/Charts/ChartUtils/index.js +1 -0
- package/dist/Charts/HeatMap/HeatMap.js +28 -7
- package/dist/Charts/HeatMap/HeatMap.styled.d.ts +6 -2
- package/dist/Charts/HeatMap/HeatMap.styled.js +3 -0
- package/dist/Charts/HeatMap/HeatMap.types.d.ts +7 -1
- package/dist/Charts/LineChart/LineChart.js +34 -15
- package/dist/Charts/LineChart/LineChart.styled.d.ts +7 -2
- package/dist/Charts/LineChart/LineChart.styled.js +5 -1
- package/dist/Charts/LineChart/LineChart.types.d.ts +13 -5
- package/dist/Charts/PieChart/PieChart.js +48 -33
- package/dist/Charts/PieChart/PieChart.styled.d.ts +7 -2
- package/dist/Charts/PieChart/PieChart.styled.js +6 -1
- package/dist/Charts/PieChart/PieChart.types.d.ts +7 -3
- package/dist/CheckBox/CheckBox.js +19 -36
- package/dist/DateInput/DateInput.js +143 -198
- package/dist/DropDownMenu/DropDownMenu.js +15 -25
- package/dist/DropDownMenu/components/MenuComponent.js +2 -8
- package/dist/DropDownMenu/components/MenuItem.d.ts +0 -2
- package/dist/DropDownMenu/components/MenuItem.js +21 -25
- package/dist/DropDownMenu/components/MenuItemList.d.ts +0 -3
- package/dist/DropDownMenu/components/MenuItemList.js +86 -192
- package/dist/DropDownMenu/components/StyledContent.js +2 -1
- package/dist/DropDownMenu/components/StyledFloatContainer.js +1 -1
- package/dist/DropDownMenu/types.d.ts +0 -3
- package/dist/FieldLabel/FieldLabel.js +12 -4
- package/dist/FileInputField/FileInputField.js +23 -4
- package/dist/FileViewer/viewers/ImageViewer.js +18 -75
- package/dist/FormSection/FormSection.js +25 -5
- package/dist/IconButton/IconButton.js +16 -2
- package/dist/Input/Input.js +56 -7
- package/dist/MonolithUIProvider/MonolithUIProvider.d.ts +4 -1
- package/dist/Pill/Pill.js +79 -8
- package/dist/Popover/Popover.context.d.ts +1 -2
- package/dist/Popover/Popover.js +2 -5
- package/dist/Popover/Popover.styles.d.ts +6 -1
- package/dist/Popover/Popover.styles.js +28 -11
- package/dist/Popover/Popover.transitions.d.ts +2 -4
- package/dist/Popover/Popover.transitions.js +49 -23
- package/dist/Popover/PopoverDropdown.js +8 -6
- package/dist/Popover/PopoverTarget.js +3 -6
- package/dist/QueryFilter/DefaultOperators.d.ts +76 -1
- package/dist/QueryFilter/DefaultOperators.js +21 -1
- package/dist/QueryFilter/QueryFilter.d.ts +1 -1
- package/dist/QueryFilter/QueryFilter.js +303 -3
- package/dist/QueryFilter/index.d.ts +2 -3
- package/dist/QueryFilter/index.js +2 -3
- package/dist/QueryFilter/types.d.ts +52 -1
- package/dist/QueryFilter/types.js +1 -1
- package/dist/QueryFilter/useQueryFilter.d.ts +1 -1
- package/dist/QueryFilter/useQueryFilter.js +19 -23
- package/dist/RichTextEditor/Components/CodeBlockBaseButton.d.ts +18 -0
- package/dist/RichTextEditor/Components/CodeBlockBaseButton.js +6 -0
- package/dist/RichTextEditor/Components/CodeBlockCopyButton.d.ts +9 -0
- package/dist/RichTextEditor/Components/CodeBlockCopyButton.js +42 -0
- package/dist/RichTextEditor/Components/CodeBlockFormatButton.d.ts +10 -0
- package/dist/RichTextEditor/Components/CodeBlockFormatButton.js +60 -0
- package/dist/RichTextEditor/Components/CodeBlockLanguageSelect.d.ts +9 -0
- package/dist/RichTextEditor/Components/CodeBlockLanguageSelect.js +30 -0
- package/dist/RichTextEditor/Components/CodeBlockNodeView.d.ts +3 -0
- package/dist/RichTextEditor/Components/CodeBlockNodeView.js +28 -0
- package/dist/RichTextEditor/Components/CodeBlockWrapButton.d.ts +10 -0
- package/dist/RichTextEditor/Components/CodeBlockWrapButton.js +17 -0
- package/dist/RichTextEditor/Components/LinkEditor.d.ts +8 -0
- package/dist/RichTextEditor/Components/LinkEditor.js +94 -0
- package/dist/RichTextEditor/Components/TableTools/TableCornerMenu.d.ts +2 -0
- package/dist/RichTextEditor/Components/TableTools/TableCornerMenu.js +19 -0
- package/dist/RichTextEditor/Components/TableTools/TableInsertControls.d.ts +2 -0
- package/dist/RichTextEditor/Components/TableTools/TableInsertControls.js +24 -0
- package/dist/RichTextEditor/Components/TableTools/TableRails.d.ts +2 -0
- package/dist/RichTextEditor/Components/TableTools/TableRails.js +180 -0
- package/dist/RichTextEditor/Components/TableTools/TableToolMenu.d.ts +5 -0
- package/dist/RichTextEditor/Components/TableTools/TableToolMenu.js +6 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.actions.d.ts +5 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.actions.js +183 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.commands.d.ts +16 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.commands.js +217 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.constants.d.ts +8 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.constants.js +11 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.d.ts +3 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.geometry.d.ts +23 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.geometry.js +75 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.js +3 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.selectors.d.ts +16 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.selectors.js +53 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.styled.d.ts +40 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.styled.js +167 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.types.d.ts +76 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.types.js +1 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.utils.d.ts +4 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.utils.js +4 -0
- package/dist/RichTextEditor/Components/TableTools/TableToolsPopover.d.ts +2 -0
- package/dist/RichTextEditor/Components/TableTools/TableToolsPopover.js +12 -0
- package/dist/RichTextEditor/Components/TableTools/index.d.ts +3 -0
- package/dist/RichTextEditor/Components/TableTools/index.js +2 -0
- package/dist/RichTextEditor/Enums/HighlightColors.d.ts +9 -0
- package/dist/RichTextEditor/Enums/HighlightColors.js +10 -0
- package/dist/RichTextEditor/Extensions/getTiptapExtensions.js +15 -5
- package/dist/RichTextEditor/Plugins/ImageActionsPlugin.js +4 -7
- package/dist/RichTextEditor/Plugins/UploadImagesPlugin.d.ts +0 -15
- package/dist/RichTextEditor/Plugins/UploadImagesPlugin.js +51 -115
- package/dist/RichTextEditor/Plugins/index.d.ts +0 -1
- package/dist/RichTextEditor/Plugins/index.js +0 -1
- package/dist/RichTextEditor/RichTextEditor.d.ts +2 -3
- package/dist/RichTextEditor/RichTextEditor.js +35 -302
- package/dist/RichTextEditor/Utils/codeBlockUtils.d.ts +20 -0
- package/dist/RichTextEditor/Utils/codeBlockUtils.js +137 -0
- package/dist/RichTextEditor/Utils/codeUtils.d.ts +3 -0
- package/dist/RichTextEditor/Utils/codeUtils.js +12 -0
- package/dist/RichTextEditor/Utils/linkUtils.d.ts +19 -0
- package/dist/RichTextEditor/Utils/linkUtils.js +57 -0
- package/dist/RichTextEditor/Utils/tableUtils.d.ts +1 -0
- package/dist/RichTextEditor/Utils/tableUtils.js +1 -0
- package/dist/SegmentedControl/SegmentedControl.utils.d.ts +2 -2
- package/dist/SegmentedControl/SegmentedControl.utils.js +30 -3
- package/dist/SelectBox/SelectBox.js +5 -5
- package/dist/SelectBox/select-box.styled-components.d.ts +1 -4
- package/dist/SelectBox/select-box.styled-components.js +48 -11
- package/dist/SelectBox/types.d.ts +0 -1
- package/dist/Switch/Switch.d.ts +2 -2
- package/dist/Switch/Switch.js +83 -18
- package/dist/Table/ColumnResizer.d.ts +9 -6
- package/dist/Table/ColumnResizer.js +10 -30
- package/dist/Table/StateStorage.d.ts +0 -4
- package/dist/Table/StateStorage.js +0 -13
- package/dist/Table/Table.js +12 -160
- package/dist/Table/TableComponents.d.ts +0 -10
- package/dist/Table/TableComponents.js +10 -71
- package/dist/Table/TableDefaults.d.ts +0 -7
- package/dist/Table/TableDefaults.js +0 -7
- package/dist/Table/TableHeader.js +16 -31
- package/dist/Table/TableMenu/TableMenu.js +1 -1
- package/dist/Table/TableProvider.js +75 -354
- package/dist/Table/TableRow.js +16 -28
- package/dist/Table/Utils/index.d.ts +1 -0
- package/dist/Table/Utils/index.js +1 -0
- package/dist/Table/types.d.ts +19 -70
- package/dist/TagBox/TagBox.d.ts +1 -1
- package/dist/TagBox/TagBox.js +80 -22
- package/dist/TagBox/types.d.ts +0 -1
- package/dist/TextArea/TextArea.js +23 -9
- package/dist/TextInput/TextInput.js +6 -12
- package/dist/Utilities/parseTimestamp.js +6 -11
- package/dist/core/ArrowButton.d.ts +0 -2
- package/dist/core/ArrowButton.js +3 -7
- package/dist/core/ClearButton.d.ts +0 -2
- package/dist/core/ClearButton.js +3 -7
- package/dist/core/controlSizes.js +9 -9
- package/dist/core/index.d.ts +0 -1
- package/dist/core/index.js +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.js +0 -2
- package/dist/theme/variants.js +8 -2
- package/package.json +18 -26
- package/dist/DateTimeRangePicker/DateTimeRangePicker.d.ts +0 -41
- package/dist/DateTimeRangePicker/DateTimeRangePicker.js +0 -363
- package/dist/DateTimeRangePicker/index.d.ts +0 -2
- package/dist/DateTimeRangePicker/index.js +0 -2
|
@@ -1,37 +1,63 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useEffect, useRef, useState } from "react";
|
|
2
2
|
const TRANSITION_PRESETS = {
|
|
3
3
|
fade: {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
from: { opacity: 0 },
|
|
5
|
+
to: { opacity: 1 },
|
|
6
6
|
},
|
|
7
7
|
scale: {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
from: { opacity: 0, scale: "0.85" },
|
|
9
|
+
to: { opacity: 1, scale: "1" },
|
|
10
10
|
},
|
|
11
11
|
"scale-y": {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
from: { opacity: 0, scale: "1 0.7" },
|
|
13
|
+
to: { opacity: 1, scale: "1 1" },
|
|
14
14
|
},
|
|
15
15
|
pop: {
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
from: { opacity: 0, scale: "0.6" },
|
|
17
|
+
to: { opacity: 1, scale: "1" },
|
|
18
18
|
},
|
|
19
19
|
};
|
|
20
|
-
export function usePopoverTransition(
|
|
21
|
-
|
|
20
|
+
export function usePopoverTransition(opened, { transition = "fade", duration = 150, timingFunction = "ease" }) {
|
|
21
|
+
const [mounted, setMounted] = useState(opened);
|
|
22
|
+
const [transitionEnabled, setTransitionEnabled] = useState(false);
|
|
23
|
+
const [phase, setPhase] = useState(opened ? "enter" : "exit");
|
|
24
|
+
const frameRef = useRef(0);
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
cancelAnimationFrame(frameRef.current);
|
|
27
|
+
if (opened) {
|
|
28
|
+
setMounted(true);
|
|
29
|
+
setTransitionEnabled(false);
|
|
30
|
+
setPhase("exit");
|
|
31
|
+
frameRef.current = requestAnimationFrame(() => {
|
|
32
|
+
frameRef.current = requestAnimationFrame(() => {
|
|
33
|
+
setTransitionEnabled(true);
|
|
34
|
+
setPhase("enter");
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
setTransitionEnabled(true);
|
|
40
|
+
setPhase("exit");
|
|
41
|
+
const timer = setTimeout(() => {
|
|
42
|
+
setMounted(false);
|
|
43
|
+
setTransitionEnabled(false);
|
|
44
|
+
}, duration);
|
|
45
|
+
return () => clearTimeout(timer);
|
|
46
|
+
}
|
|
47
|
+
}, [opened, duration]);
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
return () => cancelAnimationFrame(frameRef.current);
|
|
50
|
+
}, []);
|
|
22
51
|
const preset = TRANSITION_PRESETS[transition];
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
willChange: transition === "fade" ? "opacity" : "opacity, transform",
|
|
31
|
-
},
|
|
32
|
-
});
|
|
52
|
+
const transitionStyles = phase === "enter" ? preset.to : preset.from;
|
|
53
|
+
const properties = [
|
|
54
|
+
...new Set([...Object.keys(preset.from), ...Object.keys(preset.to)]),
|
|
55
|
+
];
|
|
56
|
+
const transitionValue = properties
|
|
57
|
+
.map((prop) => `${prop} ${duration}ms ${timingFunction}`)
|
|
58
|
+
.join(", ");
|
|
33
59
|
return {
|
|
34
|
-
mounted:
|
|
35
|
-
styles,
|
|
60
|
+
mounted: mounted || opened,
|
|
61
|
+
styles: Object.assign(Object.assign({}, transitionStyles), (transitionEnabled ? { transition: transitionValue } : {})),
|
|
36
62
|
};
|
|
37
63
|
}
|
|
@@ -12,15 +12,17 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { FloatingFocusManager, FloatingPortal } from "@floating-ui/react";
|
|
14
14
|
import { usePopoverContext } from "./Popover.context";
|
|
15
|
-
import {
|
|
15
|
+
import { ARROW_STYLES, StyledDropdown } from "./Popover.styles";
|
|
16
16
|
import { usePopoverTransition } from "./Popover.transitions";
|
|
17
17
|
export const PopoverDropdown = (_a) => {
|
|
18
|
+
var _b, _c;
|
|
18
19
|
var { children, className, style } = _a, props = __rest(_a, ["children", "className", "style"]);
|
|
19
|
-
const { refs, context, floatingStyles, getFloatingProps, withArrow, arrowSize, arrowRadius, arrowRef, withinPortal, trapFocus, returnFocus, keepMounted, zIndex, dropdownId, transitionProps: ctxTransitionProps, } = usePopoverContext();
|
|
20
|
-
const { mounted, styles: transitionStyles } = usePopoverTransition(
|
|
21
|
-
const
|
|
22
|
-
const
|
|
20
|
+
const { opened, refs, context, floatingStyles, getFloatingProps, withArrow, arrowSize, arrowRadius, arrowRef, withinPortal, trapFocus, returnFocus, keepMounted, zIndex, dropdownId, transitionProps: ctxTransitionProps, } = usePopoverContext();
|
|
21
|
+
const { mounted, styles: transitionStyles } = usePopoverTransition(opened, ctxTransitionProps);
|
|
22
|
+
const arrowX = (_b = context.middlewareData.arrow) === null || _b === void 0 ? void 0 : _b.x;
|
|
23
|
+
const arrowY = (_c = context.middlewareData.arrow) === null || _c === void 0 ? void 0 : _c.y;
|
|
23
24
|
const [placementSide, placementAlignment] = context.placement.split("-");
|
|
25
|
+
const arrowConfig = ARROW_STYLES[placementSide];
|
|
24
26
|
const originSide = {
|
|
25
27
|
top: "bottom",
|
|
26
28
|
bottom: "top",
|
|
@@ -42,7 +44,7 @@ export const PopoverDropdown = (_a) => {
|
|
|
42
44
|
}
|
|
43
45
|
const dropdown = (_jsx(FloatingFocusManager, { context: context, modal: trapFocus, returnFocus: returnFocus, children: _jsxs(StyledDropdown, Object.assign({}, getFloatingProps(props), { id: dropdownId, ref: refs.setFloating, className: className, style: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, floatingStyles), transitionStyles), { transformOrigin }), style), { zIndex }), (keepMounted && !mounted
|
|
44
46
|
? { visibility: "hidden", pointerEvents: "none" }
|
|
45
|
-
: {})), children: [children, withArrow && (_jsx(
|
|
47
|
+
: {})), children: [children, withArrow && (_jsx("div", { ref: arrowRef, style: Object.assign(Object.assign(Object.assign({ position: "absolute", width: Math.max(arrowSize, 6), height: Math.max(arrowSize, 6), transform: "rotate(45deg)", background: "inherit", border: "1px solid", borderColor: "inherit", pointerEvents: "none", zIndex: 1 }, (arrowX != null ? { left: arrowX } : {})), (arrowY != null ? { top: arrowY } : {})), { [arrowConfig.staticProp]: -Math.max(arrowSize, 6) / 2, [arrowConfig.radiusCorner]: arrowRadius, [arrowConfig.borderTransparent[0]]: "transparent", [arrowConfig.borderTransparent[1]]: "transparent", clipPath: arrowConfig.clipPath }) }))] })) }));
|
|
46
48
|
if (!withinPortal) {
|
|
47
49
|
return dropdown;
|
|
48
50
|
}
|
|
@@ -2,13 +2,10 @@ import { useMergeRefs } from "@floating-ui/react";
|
|
|
2
2
|
import { cloneElement, isValidElement } from "react";
|
|
3
3
|
import { usePopoverContext } from "./Popover.context";
|
|
4
4
|
export const PopoverTarget = ({ children }) => {
|
|
5
|
-
const { refs, getReferenceProps, opened, dropdownId
|
|
5
|
+
const { refs, getReferenceProps, opened, dropdownId } = usePopoverContext();
|
|
6
6
|
if (!isValidElement(children)) {
|
|
7
7
|
return null;
|
|
8
8
|
}
|
|
9
|
-
const mergedRef = useMergeRefs([
|
|
10
|
-
|
|
11
|
-
children.ref,
|
|
12
|
-
]);
|
|
13
|
-
return cloneElement(children, getReferenceProps(Object.assign({ ref: mergedRef, "aria-expanded": opened, "aria-controls": dropdownId, "aria-haspopup": role === "tooltip" ? undefined : role }, children.props)));
|
|
9
|
+
const mergedRef = useMergeRefs([refs.setReference, children.ref]);
|
|
10
|
+
return cloneElement(children, getReferenceProps(Object.assign({ ref: mergedRef, "aria-expanded": opened, "aria-controls": dropdownId, "aria-haspopup": "dialog" }, children.props)));
|
|
14
11
|
};
|
|
@@ -1 +1,76 @@
|
|
|
1
|
-
|
|
1
|
+
import { Operator } from "./types";
|
|
2
|
+
export declare const Operators: {
|
|
3
|
+
Equals: {
|
|
4
|
+
value: string;
|
|
5
|
+
label: string;
|
|
6
|
+
};
|
|
7
|
+
NotEquals: {
|
|
8
|
+
value: string;
|
|
9
|
+
label: string;
|
|
10
|
+
};
|
|
11
|
+
LessThan: {
|
|
12
|
+
value: string;
|
|
13
|
+
label: string;
|
|
14
|
+
};
|
|
15
|
+
GreaterThan: {
|
|
16
|
+
value: string;
|
|
17
|
+
label: string;
|
|
18
|
+
};
|
|
19
|
+
LessThanOrEqual: {
|
|
20
|
+
value: string;
|
|
21
|
+
label: string;
|
|
22
|
+
};
|
|
23
|
+
GreaterThanOrEqual: {
|
|
24
|
+
value: string;
|
|
25
|
+
label: string;
|
|
26
|
+
};
|
|
27
|
+
Contains: {
|
|
28
|
+
value: string;
|
|
29
|
+
label: string;
|
|
30
|
+
};
|
|
31
|
+
BeginsWith: {
|
|
32
|
+
value: string;
|
|
33
|
+
label: string;
|
|
34
|
+
};
|
|
35
|
+
EndsWith: {
|
|
36
|
+
value: string;
|
|
37
|
+
label: string;
|
|
38
|
+
};
|
|
39
|
+
DoesNotContain: {
|
|
40
|
+
value: string;
|
|
41
|
+
label: string;
|
|
42
|
+
};
|
|
43
|
+
DoesNotBeginWith: {
|
|
44
|
+
value: string;
|
|
45
|
+
label: string;
|
|
46
|
+
};
|
|
47
|
+
DoesNotEndWith: {
|
|
48
|
+
value: string;
|
|
49
|
+
label: string;
|
|
50
|
+
};
|
|
51
|
+
IsEmpty: {
|
|
52
|
+
value: string;
|
|
53
|
+
label: string;
|
|
54
|
+
};
|
|
55
|
+
IsNotEmpty: {
|
|
56
|
+
value: string;
|
|
57
|
+
label: string;
|
|
58
|
+
};
|
|
59
|
+
In: {
|
|
60
|
+
value: string;
|
|
61
|
+
label: string;
|
|
62
|
+
};
|
|
63
|
+
NIn: {
|
|
64
|
+
value: string;
|
|
65
|
+
label: string;
|
|
66
|
+
};
|
|
67
|
+
Between: {
|
|
68
|
+
value: string;
|
|
69
|
+
label: string;
|
|
70
|
+
};
|
|
71
|
+
NotBetween: {
|
|
72
|
+
value: string;
|
|
73
|
+
label: string;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
export declare const DefaultOperators: Operator[];
|
|
@@ -1 +1,21 @@
|
|
|
1
|
-
export
|
|
1
|
+
export const Operators = {
|
|
2
|
+
Equals: { value: "=", label: "is" },
|
|
3
|
+
NotEquals: { value: "!=", label: "is not" },
|
|
4
|
+
LessThan: { value: "<", label: "less than" },
|
|
5
|
+
GreaterThan: { value: ">", label: "greater than" },
|
|
6
|
+
LessThanOrEqual: { value: "<=", label: "less than or equal" },
|
|
7
|
+
GreaterThanOrEqual: { value: ">=", label: "greater than or equal" },
|
|
8
|
+
Contains: { value: "contains", label: "contains" },
|
|
9
|
+
BeginsWith: { value: "beginsWith", label: "begins with" },
|
|
10
|
+
EndsWith: { value: "endsWith", label: "ends with" },
|
|
11
|
+
DoesNotContain: { value: "doesNotContain", label: "does not contain" },
|
|
12
|
+
DoesNotBeginWith: { value: "doesNotBeginWith", label: "does not begin with" },
|
|
13
|
+
DoesNotEndWith: { value: "doesNotEndWith", label: "does not end with" },
|
|
14
|
+
IsEmpty: { value: "isEmpty", label: "is empty" },
|
|
15
|
+
IsNotEmpty: { value: "isNotEmpty", label: "is not empty" },
|
|
16
|
+
In: { value: "in", label: "is any of" },
|
|
17
|
+
NIn: { value: "nin", label: "is none of" },
|
|
18
|
+
Between: { value: "between", label: "between" },
|
|
19
|
+
NotBetween: { value: "notBetween", label: "not between" },
|
|
20
|
+
};
|
|
21
|
+
export const DefaultOperators = Object.values(Operators);
|
|
@@ -1,6 +1,306 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import styled, { useTheme } from "styled-components";
|
|
3
|
+
import { XIcon } from "lucide-react";
|
|
4
|
+
import { DropDownMenu } from "../DropDownMenu";
|
|
5
|
+
import { Button } from "../Button";
|
|
6
|
+
import { DefaultOperators } from "./DefaultOperators";
|
|
7
|
+
import Input from "../Input";
|
|
8
|
+
import DateInput from "../DateInput";
|
|
9
|
+
import { useDebouncedCallback } from "use-debounce";
|
|
10
|
+
import moment from "moment";
|
|
11
|
+
const StyledContainer = styled.div `
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: row;
|
|
14
|
+
gap: 2px;
|
|
15
|
+
`;
|
|
16
|
+
const RuleContainer = styled(StyledContainer) `
|
|
17
|
+
// first child
|
|
18
|
+
& > *:first-child {
|
|
19
|
+
border-radius: 5px 0 0 5px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// last child
|
|
23
|
+
& > *:last-child {
|
|
24
|
+
border-radius: 0 5px 5px 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
button.mfui-DropDownMenu {
|
|
28
|
+
border-color: transparent;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
button.mfui-DropDownMenu:hover {
|
|
32
|
+
border-color: ${({ theme }) => theme.palette.primary.main};
|
|
33
|
+
}
|
|
34
|
+
`;
|
|
35
|
+
const FilterContainer = styled(StyledContainer) `
|
|
36
|
+
gap: 10px;
|
|
37
|
+
flex-wrap: wrap;
|
|
38
|
+
|
|
39
|
+
button.mfui-DropDownMenu:hover {
|
|
40
|
+
border-color: ${({ theme }) => theme.palette.primary.main};
|
|
41
|
+
}
|
|
42
|
+
`;
|
|
43
|
+
const StyledButton = styled(Button) `
|
|
44
|
+
border-radius: 0;
|
|
45
|
+
font-size: 12px;
|
|
46
|
+
height: 20px;
|
|
47
|
+
|
|
48
|
+
padding: 3px 5px;
|
|
49
|
+
|
|
50
|
+
&:hover {
|
|
51
|
+
background-color: ${({ theme }) => theme.palette.action.hover};
|
|
52
|
+
border-color: ${({ theme }) => theme.palette.primary.main};
|
|
53
|
+
}
|
|
54
|
+
`;
|
|
55
|
+
const BaseLabel = styled.div `
|
|
56
|
+
user-select: none;
|
|
57
|
+
|
|
58
|
+
display: flex;
|
|
59
|
+
flex-direction: row;
|
|
60
|
+
align-items: center;
|
|
61
|
+
|
|
62
|
+
border: 1px solid transparent;
|
|
63
|
+
|
|
64
|
+
background-color: ${({ theme }) => theme.button.background.alternate};
|
|
65
|
+
|
|
66
|
+
font-size: 12px;
|
|
67
|
+
|
|
68
|
+
height: 20px;
|
|
69
|
+
|
|
70
|
+
padding: 3px 5px;
|
|
71
|
+
|
|
72
|
+
overflow: hidden;
|
|
73
|
+
white-space: nowrap;
|
|
74
|
+
text-overflow: ellipsis;
|
|
75
|
+
|
|
76
|
+
cursor: pointer;
|
|
77
|
+
|
|
78
|
+
&:hover {
|
|
79
|
+
background-color: ${({ theme }) => theme.palette.action.hover};
|
|
80
|
+
}
|
|
81
|
+
`;
|
|
82
|
+
const FieldLabel = styled(BaseLabel) ``;
|
|
83
|
+
const ValueLabel = styled(BaseLabel) ``;
|
|
84
|
+
const StyledInput = styled(Input) `
|
|
85
|
+
height: 20px;
|
|
86
|
+
min-height: 20px;
|
|
87
|
+
width: 100px;
|
|
88
|
+
border-radius: 0;
|
|
89
|
+
font-size: 12px;
|
|
90
|
+
padding: 3px 5px;
|
|
91
|
+
|
|
92
|
+
border-color: transparent;
|
|
93
|
+
background-color: ${({ theme }) => theme.palette.background.secondary};
|
|
94
|
+
|
|
95
|
+
&:hover {
|
|
96
|
+
border-color: ${({ theme }) => theme.palette.primary.main};
|
|
97
|
+
}
|
|
98
|
+
`;
|
|
99
|
+
const StyledDateInput = styled(DateInput) `
|
|
100
|
+
width: auto;
|
|
101
|
+
|
|
102
|
+
.input-container {
|
|
103
|
+
height: 20px;
|
|
104
|
+
font-size: 12px;
|
|
105
|
+
border-radius: 0;
|
|
106
|
+
border-color: transparent;
|
|
107
|
+
background-color: ${({ theme }) => theme.palette.background.secondary};
|
|
108
|
+
|
|
109
|
+
cursor: pointer;
|
|
110
|
+
|
|
111
|
+
&:hover {
|
|
112
|
+
border-color: ${({ theme }) => theme.palette.primary.main};
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
`;
|
|
116
|
+
const dateFormatResolver = (resolution) => {
|
|
117
|
+
switch (resolution) {
|
|
118
|
+
case "day":
|
|
119
|
+
return "YYYY-MM-DD";
|
|
120
|
+
// case "month":
|
|
121
|
+
// return "YYYY-MM";
|
|
122
|
+
// case "year":
|
|
123
|
+
// return "YYYY";
|
|
124
|
+
// case "hour":
|
|
125
|
+
// return "YYYY-MM-DD HH";
|
|
126
|
+
// case "minute":
|
|
127
|
+
// return "YYYY-MM-DD HH:mm";
|
|
128
|
+
case "second":
|
|
129
|
+
return "YYYY-MM-DD HH:mm:ss";
|
|
130
|
+
case "millisecond":
|
|
131
|
+
return "YYYY-MM-DD HH:mm:ss.SSS";
|
|
132
|
+
default:
|
|
133
|
+
return "YYYY-MM-DD HH:mm:ss";
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
const MultiSelectEditor = ({ rule, filterDef, onChange }) => {
|
|
137
|
+
var _a, _b, _c;
|
|
138
|
+
const theme = useTheme();
|
|
139
|
+
const handleChange = (selected, diff) => {
|
|
140
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(selected, diff);
|
|
141
|
+
};
|
|
142
|
+
const selected = (_a = rule.options) === null || _a === void 0 ? void 0 : _a.filter((o) => { var _a; return (_a = rule.value) === null || _a === void 0 ? void 0 : _a.includes(o.value); });
|
|
143
|
+
let display = ((_b = rule.options) === null || _b === void 0 ? void 0 : _b.map((o) => o.label).join(", ")) || "Select Value";
|
|
144
|
+
if (Array.isArray(rule.value) && rule.value.length > 1) {
|
|
145
|
+
display = `${rule.value.length} ${(filterDef === null || filterDef === void 0 ? void 0 : filterDef.pluralLabel) || "Values"}`;
|
|
146
|
+
}
|
|
147
|
+
return (_jsx(DropDownMenu, { data: (filterDef === null || filterDef === void 0 ? void 0 : filterDef.selectOptions) || [], variant: "outlined", multiselect: true, searchable: true, size: "xs", buttonProps: {
|
|
148
|
+
title: "Select Value",
|
|
149
|
+
variant: "contained",
|
|
150
|
+
size: "xxs",
|
|
151
|
+
style: {
|
|
152
|
+
padding: "0px 4px",
|
|
153
|
+
height: 20,
|
|
154
|
+
borderRadius: 0,
|
|
155
|
+
backgroundColor: theme.button.background.alternate,
|
|
156
|
+
fontSize: 11,
|
|
157
|
+
fontWeight: "normal",
|
|
158
|
+
color: !!rule.value && Array.isArray(rule.value) && rule.value.length > 0
|
|
159
|
+
? theme.palette.text.primary
|
|
160
|
+
: theme.palette.text.secondary,
|
|
161
|
+
},
|
|
162
|
+
}, dropDownProps: {
|
|
163
|
+
style: Object.assign({ width: 200, maxWidth: 400 }, (_c = filterDef === null || filterDef === void 0 ? void 0 : filterDef.dropDownOptions) === null || _c === void 0 ? void 0 : _c.style),
|
|
164
|
+
}, defaultValue: selected || [], onChange: handleChange, query: filterDef === null || filterDef === void 0 ? void 0 : filterDef.query, children: display }));
|
|
165
|
+
};
|
|
166
|
+
const ValueEditor = ({ rule, inputType, filterDef, onChange }) => {
|
|
167
|
+
var _a, _b, _c, _d, _e, _f;
|
|
168
|
+
const handleInputChange = useDebouncedCallback((e) => {
|
|
169
|
+
const value = e.target.value;
|
|
170
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(Object.assign(Object.assign({}, rule), { value: value ? [value] : undefined }));
|
|
171
|
+
}, 250);
|
|
172
|
+
const handleMultiSelectChange = useDebouncedCallback((selected) => {
|
|
173
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(Object.assign(Object.assign({}, rule), { value: selected.map((s) => s.value), options: selected }));
|
|
174
|
+
}, 100);
|
|
175
|
+
const handleTimestampChange = useDebouncedCallback((timestamp) => {
|
|
176
|
+
let formattedValue = timestamp;
|
|
177
|
+
if (formattedValue && filterDef.resolution) {
|
|
178
|
+
const date = moment(formattedValue).utc(true); // utc mode prevents datetime from shifting when using toISOString
|
|
179
|
+
switch (filterDef.resolution) {
|
|
180
|
+
case "day":
|
|
181
|
+
date.set({ hour: 0, minute: 0, second: 0, millisecond: 0 });
|
|
182
|
+
break;
|
|
183
|
+
case "second":
|
|
184
|
+
date.set({ millisecond: 0 });
|
|
185
|
+
break;
|
|
186
|
+
case "millisecond":
|
|
187
|
+
break;
|
|
188
|
+
default:
|
|
189
|
+
break;
|
|
190
|
+
}
|
|
191
|
+
formattedValue = filterDef.isoString
|
|
192
|
+
? date.toISOString()
|
|
193
|
+
: date.format(dateFormatResolver(filterDef.resolution));
|
|
194
|
+
}
|
|
195
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(Object.assign(Object.assign({}, rule), { value: formattedValue ? [formattedValue] : undefined }));
|
|
196
|
+
}, 100);
|
|
197
|
+
switch (inputType) {
|
|
198
|
+
case "text":
|
|
199
|
+
return (_jsx(StyledInput, { placeholder: "Enter Value...", defaultValue: (_a = rule === null || rule === void 0 ? void 0 : rule.value) === null || _a === void 0 ? void 0 : _a[0], onChange: handleInputChange }));
|
|
200
|
+
case "number":
|
|
201
|
+
return (_jsx(StyledInput, { type: "number", placeholder: "Enter Value...", defaultValue: (_b = rule === null || rule === void 0 ? void 0 : rule.value) === null || _b === void 0 ? void 0 : _b[0], onChange: handleInputChange }));
|
|
202
|
+
case "date":
|
|
203
|
+
return (_jsx(StyledDateInput, { arrow: false, enableCalendar: true, format: "YYYY-MM-DD", defaultValue: ((_c = rule.value) === null || _c === void 0 ? void 0 : _c[0]) === "" ? undefined : (_d = rule.value) === null || _d === void 0 ? void 0 : _d[0], onChange: handleTimestampChange }));
|
|
204
|
+
case "datetime":
|
|
205
|
+
return (_jsx(StyledDateInput, { arrow: false, enableCalendar: true, format: dateFormatResolver(filterDef === null || filterDef === void 0 ? void 0 : filterDef.resolution), defaultValue: ((_e = rule.value) === null || _e === void 0 ? void 0 : _e[0]) === "" ? undefined : (_f = rule.value) === null || _f === void 0 ? void 0 : _f[0], onChange: handleTimestampChange }));
|
|
206
|
+
case "multiselect":
|
|
207
|
+
return (_jsx(MultiSelectEditor, { rule: rule, filterDef: filterDef, onChange: handleMultiSelectChange }));
|
|
208
|
+
default:
|
|
209
|
+
return (_jsx(StyledInput, { placeholder: "Enter Value...", onChange: handleInputChange }));
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
const ValueSelector = ({ rule, inputType, filterDef, onChange }) => {
|
|
213
|
+
var _a;
|
|
214
|
+
const isBetween = rule.operator.value.toLowerCase().includes("between");
|
|
215
|
+
const handleValueChange = (e) => {
|
|
216
|
+
const currentValue = rule.value;
|
|
217
|
+
if (isBetween) {
|
|
218
|
+
const newValue = (e === null || e === void 0 ? void 0 : e.value) || [""];
|
|
219
|
+
if (currentValue === null || currentValue === void 0 ? void 0 : currentValue[1]) {
|
|
220
|
+
newValue.push(currentValue[1]);
|
|
221
|
+
}
|
|
222
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(Object.assign(Object.assign({}, rule), { value: newValue }));
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(Object.assign(Object.assign({}, rule), { value: e.value, options: e.options }));
|
|
226
|
+
};
|
|
227
|
+
const handleSecondaryValueChange = (e) => {
|
|
228
|
+
var _a, _b;
|
|
229
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(Object.assign(Object.assign({}, rule), { value: [((_a = rule === null || rule === void 0 ? void 0 : rule.value) === null || _a === void 0 ? void 0 : _a[0]) || "", ((_b = e.value) === null || _b === void 0 ? void 0 : _b[0]) || ""], options: e.options }));
|
|
230
|
+
};
|
|
231
|
+
return (_jsxs(_Fragment, { children: [_jsx(ValueEditor, { rule: rule, inputType: inputType, filterDef: filterDef, onChange: handleValueChange }), isBetween && (_jsxs(_Fragment, { children: [_jsx(FieldLabel, { children: "and" }), _jsx(ValueEditor, { rule: Object.assign(Object.assign({}, rule), { value: [((_a = rule === null || rule === void 0 ? void 0 : rule.value) === null || _a === void 0 ? void 0 : _a[1]) || ""] }), inputType: inputType, filterDef: filterDef, onChange: handleSecondaryValueChange })] }))] }));
|
|
232
|
+
};
|
|
233
|
+
const CloseLabel = styled(StyledButton) `
|
|
234
|
+
padding: 2px;
|
|
235
|
+
|
|
236
|
+
background-color: ${({ theme }) => theme.button.background.alternate};
|
|
237
|
+
color: ${({ theme }) => theme.button.text.alternate};
|
|
238
|
+
|
|
239
|
+
&:hover {
|
|
240
|
+
border-color: ${({ theme }) => theme.palette.primary.main};
|
|
241
|
+
}
|
|
242
|
+
`;
|
|
243
|
+
const Rules = ({ rules = [], combinator, showCombinator, filterDefinitions, onDelete, onUpdate, onUpdateRootCombinator, }) => {
|
|
244
|
+
const theme = useTheme();
|
|
245
|
+
const handleCombinatorChange = (e) => {
|
|
246
|
+
onUpdateRootCombinator(e);
|
|
247
|
+
};
|
|
248
|
+
const handleOperatorChange = (rule, operator) => {
|
|
249
|
+
const prevValue = rule.value;
|
|
250
|
+
let newValue;
|
|
251
|
+
const isBetween = operator.value.toLowerCase().includes("between");
|
|
252
|
+
if (isBetween) {
|
|
253
|
+
newValue = [(prevValue === null || prevValue === void 0 ? void 0 : prevValue[0]) || "", (prevValue === null || prevValue === void 0 ? void 0 : prevValue[1]) || ""];
|
|
254
|
+
}
|
|
255
|
+
else {
|
|
256
|
+
newValue =
|
|
257
|
+
(prevValue === null || prevValue === void 0 ? void 0 : prevValue.length) && prevValue.length > 0 ? prevValue : undefined; // keep existing value if it exists, return undefined if array is empty
|
|
258
|
+
}
|
|
259
|
+
onUpdate(Object.assign(Object.assign({}, rule), { operator, value: newValue }));
|
|
260
|
+
};
|
|
261
|
+
return (_jsxs(_Fragment, { children: [showCombinator === true && (_jsx(DropDownMenu, { variant: "outlined", data: [
|
|
262
|
+
{ label: "AND", value: "and" },
|
|
263
|
+
{ label: "OR", value: "or" },
|
|
264
|
+
], size: "xs", buttonProps: {
|
|
265
|
+
title: "Chain these query filters together using AND | OR logic",
|
|
266
|
+
variant: "contained",
|
|
267
|
+
color: "secondary",
|
|
268
|
+
style: {
|
|
269
|
+
fontWeight: "normal",
|
|
270
|
+
fontSize: 12,
|
|
271
|
+
padding: "3px 5px",
|
|
272
|
+
height: 20,
|
|
273
|
+
borderRadius: 4,
|
|
274
|
+
backgroundColor: theme.button.background.alternate,
|
|
275
|
+
color: theme.button.text.alternate,
|
|
276
|
+
},
|
|
277
|
+
}, onItemSelect: (e) => handleCombinatorChange(e.value), dropDownProps: {
|
|
278
|
+
style: { width: 175, maxWidth: 400 },
|
|
279
|
+
}, children: combinator.toUpperCase() })), rules.map((rule) => {
|
|
280
|
+
const filterDef = filterDefinitions.find((f) => f.dataField === rule.dataField);
|
|
281
|
+
if (!filterDef)
|
|
282
|
+
throw new Error(`Filter Definition not found for dataField: ${rule.dataField}`);
|
|
283
|
+
const operatorOptions = (filterDef === null || filterDef === void 0 ? void 0 : filterDef.operators) || DefaultOperators;
|
|
284
|
+
const inputType = (filterDef === null || filterDef === void 0 ? void 0 : filterDef.inputType) || "text";
|
|
285
|
+
return (_jsxs(RuleContainer, { "data-rule-id": rule.id, children: [_jsx(FieldLabel, { children: rule.label }), _jsx(DropDownMenu, { variant: "outlined", data: operatorOptions, size: "xs", buttonProps: {
|
|
286
|
+
title: "Select Operator",
|
|
287
|
+
variant: "contained",
|
|
288
|
+
color: "secondary",
|
|
289
|
+
style: {
|
|
290
|
+
fontWeight: "normal",
|
|
291
|
+
fontSize: 12,
|
|
292
|
+
padding: "3px 5px",
|
|
293
|
+
height: 20,
|
|
294
|
+
borderRadius: 0,
|
|
295
|
+
backgroundColor: theme.button.background.alternate,
|
|
296
|
+
color: theme.button.text.alternate,
|
|
297
|
+
},
|
|
298
|
+
}, onItemSelect: (e) => handleOperatorChange(rule, e), dropDownProps: {
|
|
299
|
+
style: { width: 175, maxWidth: 400 },
|
|
300
|
+
}, children: rule.operator.label }), rule.operator.value != "isEmpty" &&
|
|
301
|
+
rule.operator.value != "isNotEmpty" && (_jsx(ValueSelector, { rule: rule, inputType: inputType, filterDef: filterDef, onChange: onUpdate })), _jsx(CloseLabel, { variant: "contained", onClick: () => onDelete(rule), children: _jsx(XIcon, { size: 16 }) })] }, rule.id));
|
|
302
|
+
})] }));
|
|
303
|
+
};
|
|
4
304
|
export const QueryFilter = ({ queryFilter, }) => {
|
|
5
305
|
var _a;
|
|
6
306
|
const { filter, filterDefinitions, showCombinator } = queryFilter;
|
|
@@ -1 +1,52 @@
|
|
|
1
|
-
|
|
1
|
+
import { DropDownItem, DropDownMenuProps } from "../DropDownMenu";
|
|
2
|
+
export interface UseQueryFilterProps {
|
|
3
|
+
defaultFilter?: Query | null;
|
|
4
|
+
filterDefinitions: FilterDefinition[];
|
|
5
|
+
showCombinator?: boolean;
|
|
6
|
+
onFilterChange?: (filter: any) => void;
|
|
7
|
+
}
|
|
8
|
+
export type QueryFilterType = {
|
|
9
|
+
filter: Query;
|
|
10
|
+
filterDefinitions: FilterDefinition[];
|
|
11
|
+
showCombinator?: boolean;
|
|
12
|
+
addRule: (rule: Rule) => void;
|
|
13
|
+
removeRule: (id: string) => void;
|
|
14
|
+
updateRule: (rule: Rule) => void;
|
|
15
|
+
updateRootCombinator: (combinator: Combinator) => void;
|
|
16
|
+
};
|
|
17
|
+
export type UseQueryFilter = (args: UseQueryFilterProps) => QueryFilterType;
|
|
18
|
+
export type Combinator = "and" | "or";
|
|
19
|
+
export type Operator = {
|
|
20
|
+
label: string;
|
|
21
|
+
value: string;
|
|
22
|
+
};
|
|
23
|
+
export type InputType = "text" | "number" | "date" | "datetime" | "multiselect";
|
|
24
|
+
export interface FilterDefinition {
|
|
25
|
+
dataField: string;
|
|
26
|
+
label: string;
|
|
27
|
+
pluralLabel?: string;
|
|
28
|
+
operators?: Operator[];
|
|
29
|
+
inputType?: InputType;
|
|
30
|
+
resolution?: "day" | "second" | "millisecond";
|
|
31
|
+
isoString?: boolean;
|
|
32
|
+
placeholder?: string;
|
|
33
|
+
selectOptions?: DropDownItem[];
|
|
34
|
+
dropDownOptions?: {
|
|
35
|
+
style?: React.CSSProperties;
|
|
36
|
+
};
|
|
37
|
+
query?: DropDownMenuProps["query"];
|
|
38
|
+
}
|
|
39
|
+
export interface Rule {
|
|
40
|
+
id?: string;
|
|
41
|
+
dataField: string;
|
|
42
|
+
value?: string[];
|
|
43
|
+
options?: DropDownItem[];
|
|
44
|
+
operator: Operator;
|
|
45
|
+
label: string;
|
|
46
|
+
}
|
|
47
|
+
export interface RuleGroup {
|
|
48
|
+
rules: Rule[];
|
|
49
|
+
combinator: Combinator;
|
|
50
|
+
}
|
|
51
|
+
export interface Query extends RuleGroup {
|
|
52
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { UseQueryFilter } from "./
|
|
1
|
+
import { UseQueryFilter } from "./types";
|
|
2
2
|
export declare const useQueryFilter: UseQueryFilter;
|