@monolith-forensics/monolith-ui 1.8.1-dev.4 → 1.9.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/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/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 +0 -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 -0
- package/dist/QueryFilter/DefaultOperators.js +21 -0
- 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/{QueryFilter.types.d.ts → types.d.ts} +2 -11
- package/dist/QueryFilter/useQueryFilter.d.ts +1 -1
- package/dist/QueryFilter/useQueryFilter.js +19 -23
- package/dist/RichTextEditor/Extensions/getTiptapExtensions.js +15 -5
- 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 -309
- package/dist/RichTextEditor/Toolbar/Toolbar.js +2 -14
- 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/Utils/resizeHandler.d.ts +3 -0
- package/dist/Table/Utils/resizeHandler.js +84 -0
- package/dist/Table/types.d.ts +19 -70
- package/dist/Tabs/Tab.js +0 -8
- package/dist/TagBox/TagBox.d.ts +1 -1
- package/dist/TagBox/TagBox.js +208 -50
- package/dist/TagBox/types.d.ts +13 -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.d.ts +0 -26
- package/dist/core/controlSizes.js +0 -156
- package/dist/index.d.ts +0 -3
- package/dist/index.js +0 -2
- package/dist/theme/variants.js +0 -2
- package/package.json +18 -26
- package/dist/Charts/BarChart/BarChart.d.ts +0 -5
- package/dist/Charts/BarChart/BarChart.js +0 -549
- package/dist/Charts/BarChart/BarChart.lib.d.ts +0 -31
- package/dist/Charts/BarChart/BarChart.lib.js +0 -136
- package/dist/Charts/BarChart/BarChart.styled.d.ts +0 -51
- package/dist/Charts/BarChart/BarChart.styled.js +0 -115
- package/dist/Charts/BarChart/BarChart.types.d.ts +0 -171
- package/dist/Charts/BarChart/index.d.ts +0 -3
- package/dist/Charts/BarChart/index.js +0 -2
- package/dist/Charts/ChartPrimitives/ChartExportControl.d.ts +0 -11
- package/dist/Charts/ChartPrimitives/ChartExportControl.js +0 -29
- package/dist/Charts/ChartPrimitives/chartActions.styled.d.ts +0 -1
- package/dist/Charts/ChartPrimitives/chartActions.styled.js +0 -8
- package/dist/Charts/ChartPrimitives/chartLegend.styled.d.ts +0 -12
- package/dist/Charts/ChartPrimitives/chartLegend.styled.js +0 -52
- package/dist/Charts/ChartPrimitives/chartTooltip.styled.d.ts +0 -19
- package/dist/Charts/ChartPrimitives/chartTooltip.styled.js +0 -61
- package/dist/Charts/ChartPrimitives/index.d.ts +0 -4
- package/dist/Charts/ChartPrimitives/index.js +0 -4
- package/dist/Charts/ChartUtils/chartColors.d.ts +0 -8
- package/dist/Charts/ChartUtils/chartColors.js +0 -65
- package/dist/Charts/ChartUtils/chartExport.d.ts +0 -47
- package/dist/Charts/ChartUtils/chartExport.js +0 -311
- package/dist/Charts/ChartUtils/chartMath.d.ts +0 -3
- package/dist/Charts/ChartUtils/chartMath.js +0 -3
- package/dist/Charts/ChartUtils/index.d.ts +0 -3
- package/dist/Charts/ChartUtils/index.js +0 -3
- package/dist/Charts/HeatMap/HeatMap.d.ts +0 -5
- package/dist/Charts/HeatMap/HeatMap.js +0 -212
- package/dist/Charts/HeatMap/HeatMap.lib.d.ts +0 -30
- package/dist/Charts/HeatMap/HeatMap.lib.js +0 -115
- package/dist/Charts/HeatMap/HeatMap.styled.d.ts +0 -37
- package/dist/Charts/HeatMap/HeatMap.styled.js +0 -91
- package/dist/Charts/HeatMap/HeatMap.types.d.ts +0 -80
- package/dist/Charts/HeatMap/HeatMap.types.js +0 -1
- package/dist/Charts/HeatMap/index.d.ts +0 -3
- package/dist/Charts/HeatMap/index.js +0 -2
- package/dist/Charts/LineChart/LineChart.d.ts +0 -5
- package/dist/Charts/LineChart/LineChart.js +0 -529
- package/dist/Charts/LineChart/LineChart.lib.d.ts +0 -24
- package/dist/Charts/LineChart/LineChart.lib.js +0 -132
- package/dist/Charts/LineChart/LineChart.styled.d.ts +0 -59
- package/dist/Charts/LineChart/LineChart.styled.js +0 -147
- package/dist/Charts/LineChart/LineChart.types.d.ts +0 -193
- package/dist/Charts/LineChart/LineChart.types.js +0 -1
- package/dist/Charts/LineChart/index.d.ts +0 -3
- package/dist/Charts/LineChart/index.js +0 -2
- package/dist/Charts/PieChart/PieChart.d.ts +0 -4
- package/dist/Charts/PieChart/PieChart.js +0 -199
- package/dist/Charts/PieChart/PieChart.lib.d.ts +0 -5
- package/dist/Charts/PieChart/PieChart.lib.js +0 -19
- package/dist/Charts/PieChart/PieChart.styled.d.ts +0 -51
- package/dist/Charts/PieChart/PieChart.styled.js +0 -163
- package/dist/Charts/PieChart/PieChart.types.d.ts +0 -100
- package/dist/Charts/PieChart/PieChart.types.js +0 -1
- package/dist/Charts/PieChart/index.d.ts +0 -2
- package/dist/Charts/PieChart/index.js +0 -1
- package/dist/Charts/index.d.ts +0 -5
- package/dist/Charts/index.js +0 -4
- package/dist/QueryFilter/QueryFilter.constants.d.ts +0 -134
- package/dist/QueryFilter/QueryFilter.constants.js +0 -39
- package/dist/QueryFilter/QueryFilter.lib.d.ts +0 -14
- package/dist/QueryFilter/QueryFilter.lib.js +0 -84
- package/dist/QueryFilter/QueryFilter.styled.d.ts +0 -89
- package/dist/QueryFilter/QueryFilter.styled.js +0 -184
- package/dist/QueryFilter/QueryFilter.types.js +0 -1
- package/dist/QueryFilter/components/MultiSelectEditor.d.ts +0 -7
- package/dist/QueryFilter/components/MultiSelectEditor.js +0 -44
- package/dist/QueryFilter/components/RuleChip.d.ts +0 -8
- package/dist/QueryFilter/components/RuleChip.js +0 -37
- package/dist/QueryFilter/components/Rules.d.ts +0 -11
- package/dist/QueryFilter/components/Rules.js +0 -41
- package/dist/QueryFilter/components/UnavailableRuleChip.d.ts +0 -5
- package/dist/QueryFilter/components/UnavailableRuleChip.js +0 -7
- package/dist/QueryFilter/components/ValueEditor.d.ts +0 -7
- package/dist/QueryFilter/components/ValueEditor.js +0 -45
- package/dist/QueryFilter/components/ValueSelector.d.ts +0 -7
- package/dist/QueryFilter/components/ValueSelector.js +0 -34
- package/dist/QueryFilter/components/index.d.ts +0 -6
- package/dist/QueryFilter/components/index.js +0 -6
- package/dist/RichTextEditor/Plugins/ImageActionsPlugin.d.ts +0 -3
- package/dist/RichTextEditor/Plugins/ImageActionsPlugin.js +0 -241
- package/dist/SuperDatePicker/SuperDatePicker.constants.d.ts +0 -24
- package/dist/SuperDatePicker/SuperDatePicker.constants.js +0 -30
- package/dist/SuperDatePicker/SuperDatePicker.d.ts +0 -3
- package/dist/SuperDatePicker/SuperDatePicker.js +0 -31
- package/dist/SuperDatePicker/SuperDatePicker.lib.d.ts +0 -17
- package/dist/SuperDatePicker/SuperDatePicker.lib.js +0 -206
- package/dist/SuperDatePicker/SuperDatePicker.styled.d.ts +0 -60
- package/dist/SuperDatePicker/SuperDatePicker.styled.js +0 -256
- package/dist/SuperDatePicker/SuperDatePicker.types.d.ts +0 -48
- package/dist/SuperDatePicker/SuperDatePicker.types.js +0 -1
- package/dist/SuperDatePicker/components/CommonPresetGroups.d.ts +0 -7
- package/dist/SuperDatePicker/components/CommonPresetGroups.js +0 -6
- package/dist/SuperDatePicker/components/EndpointCalendarDropdown.d.ts +0 -10
- package/dist/SuperDatePicker/components/EndpointCalendarDropdown.js +0 -9
- package/dist/SuperDatePicker/components/EndpointDateInput.d.ts +0 -16
- package/dist/SuperDatePicker/components/EndpointDateInput.js +0 -26
- package/dist/SuperDatePicker/components/EndpointPopover.d.ts +0 -18
- package/dist/SuperDatePicker/components/EndpointPopover.js +0 -11
- package/dist/SuperDatePicker/components/QuickRangeDropdown.d.ts +0 -14
- package/dist/SuperDatePicker/components/QuickRangeDropdown.js +0 -19
- package/dist/SuperDatePicker/components/QuickRangePopover.d.ts +0 -18
- package/dist/SuperDatePicker/components/QuickRangePopover.js +0 -12
- package/dist/SuperDatePicker/components/index.d.ts +0 -6
- package/dist/SuperDatePicker/components/index.js +0 -6
- package/dist/SuperDatePicker/index.d.ts +0 -3
- package/dist/SuperDatePicker/index.js +0 -3
- package/dist/SuperDatePicker/useSuperDatePicker.d.ts +0 -32
- package/dist/SuperDatePicker/useSuperDatePicker.js +0 -125
- /package/dist/{Charts/BarChart/BarChart.types.js → QueryFilter/types.js} +0 -0
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import type { DropDownItem } from "../DropDownMenu";
|
|
2
|
-
import type { Operator, Query } from "./QueryFilter.types";
|
|
3
|
-
export declare const DEFAULT_QUERY_FILTER: Query;
|
|
4
|
-
export declare const QUERY_FILTER_OPERATORS: {
|
|
5
|
-
Equals: {
|
|
6
|
-
value: string;
|
|
7
|
-
label: string;
|
|
8
|
-
};
|
|
9
|
-
NotEquals: {
|
|
10
|
-
value: string;
|
|
11
|
-
label: string;
|
|
12
|
-
};
|
|
13
|
-
LessThan: {
|
|
14
|
-
value: string;
|
|
15
|
-
label: string;
|
|
16
|
-
};
|
|
17
|
-
GreaterThan: {
|
|
18
|
-
value: string;
|
|
19
|
-
label: string;
|
|
20
|
-
};
|
|
21
|
-
LessThanOrEqual: {
|
|
22
|
-
value: string;
|
|
23
|
-
label: string;
|
|
24
|
-
};
|
|
25
|
-
GreaterThanOrEqual: {
|
|
26
|
-
value: string;
|
|
27
|
-
label: string;
|
|
28
|
-
};
|
|
29
|
-
Contains: {
|
|
30
|
-
value: string;
|
|
31
|
-
label: string;
|
|
32
|
-
};
|
|
33
|
-
DoesNotContain: {
|
|
34
|
-
value: string;
|
|
35
|
-
label: string;
|
|
36
|
-
};
|
|
37
|
-
IsEmpty: {
|
|
38
|
-
value: string;
|
|
39
|
-
label: string;
|
|
40
|
-
};
|
|
41
|
-
IsNotEmpty: {
|
|
42
|
-
value: string;
|
|
43
|
-
label: string;
|
|
44
|
-
};
|
|
45
|
-
In: {
|
|
46
|
-
value: string;
|
|
47
|
-
label: string;
|
|
48
|
-
};
|
|
49
|
-
NIn: {
|
|
50
|
-
value: string;
|
|
51
|
-
label: string;
|
|
52
|
-
};
|
|
53
|
-
Between: {
|
|
54
|
-
value: string;
|
|
55
|
-
label: string;
|
|
56
|
-
};
|
|
57
|
-
NotBetween: {
|
|
58
|
-
value: string;
|
|
59
|
-
label: string;
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
export declare const Operators: {
|
|
63
|
-
Equals: {
|
|
64
|
-
value: string;
|
|
65
|
-
label: string;
|
|
66
|
-
};
|
|
67
|
-
NotEquals: {
|
|
68
|
-
value: string;
|
|
69
|
-
label: string;
|
|
70
|
-
};
|
|
71
|
-
LessThan: {
|
|
72
|
-
value: string;
|
|
73
|
-
label: string;
|
|
74
|
-
};
|
|
75
|
-
GreaterThan: {
|
|
76
|
-
value: string;
|
|
77
|
-
label: string;
|
|
78
|
-
};
|
|
79
|
-
LessThanOrEqual: {
|
|
80
|
-
value: string;
|
|
81
|
-
label: string;
|
|
82
|
-
};
|
|
83
|
-
GreaterThanOrEqual: {
|
|
84
|
-
value: string;
|
|
85
|
-
label: string;
|
|
86
|
-
};
|
|
87
|
-
Contains: {
|
|
88
|
-
value: string;
|
|
89
|
-
label: string;
|
|
90
|
-
};
|
|
91
|
-
DoesNotContain: {
|
|
92
|
-
value: string;
|
|
93
|
-
label: string;
|
|
94
|
-
};
|
|
95
|
-
IsEmpty: {
|
|
96
|
-
value: string;
|
|
97
|
-
label: string;
|
|
98
|
-
};
|
|
99
|
-
IsNotEmpty: {
|
|
100
|
-
value: string;
|
|
101
|
-
label: string;
|
|
102
|
-
};
|
|
103
|
-
In: {
|
|
104
|
-
value: string;
|
|
105
|
-
label: string;
|
|
106
|
-
};
|
|
107
|
-
NIn: {
|
|
108
|
-
value: string;
|
|
109
|
-
label: string;
|
|
110
|
-
};
|
|
111
|
-
Between: {
|
|
112
|
-
value: string;
|
|
113
|
-
label: string;
|
|
114
|
-
};
|
|
115
|
-
NotBetween: {
|
|
116
|
-
value: string;
|
|
117
|
-
label: string;
|
|
118
|
-
};
|
|
119
|
-
};
|
|
120
|
-
export declare const DEFAULT_QUERY_FILTER_OPERATORS: Operator[];
|
|
121
|
-
export declare const DefaultOperators: Operator[];
|
|
122
|
-
export declare const QUERY_FILTER_VALUE_PLACEHOLDER = "Enter Value...";
|
|
123
|
-
export declare const QUERY_FILTER_SELECT_VALUE_LABEL = "Select Value";
|
|
124
|
-
export declare const QUERY_FILTER_UNAVAILABLE_FILTER_LABEL = "Unavailable filter";
|
|
125
|
-
export declare const QUERY_FILTER_COMBINATOR_TITLE = "Chain these query filters together using AND | OR logic";
|
|
126
|
-
export declare const QUERY_FILTER_DATE_FORMATS: {
|
|
127
|
-
readonly day: "YYYY-MM-DD";
|
|
128
|
-
readonly second: "YYYY-MM-DD HH:mm:ss";
|
|
129
|
-
readonly millisecond: "YYYY-MM-DD HH:mm:ss.SSS";
|
|
130
|
-
readonly default: "YYYY-MM-DD HH:mm:ss";
|
|
131
|
-
};
|
|
132
|
-
export declare const QUERY_FILTER_BETWEEN_OPERATORS: string[];
|
|
133
|
-
export declare const QUERY_FILTER_VALUELESS_OPERATORS: string[];
|
|
134
|
-
export declare const QUERY_FILTER_COMBINATOR_OPTIONS: DropDownItem[];
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
export const DEFAULT_QUERY_FILTER = {
|
|
2
|
-
combinator: "and",
|
|
3
|
-
rules: [],
|
|
4
|
-
};
|
|
5
|
-
export const QUERY_FILTER_OPERATORS = {
|
|
6
|
-
Equals: { value: "=", label: "is" },
|
|
7
|
-
NotEquals: { value: "!=", label: "is not" },
|
|
8
|
-
LessThan: { value: "<", label: "less than" },
|
|
9
|
-
GreaterThan: { value: ">", label: "greater than" },
|
|
10
|
-
LessThanOrEqual: { value: "<=", label: "less than or equal" },
|
|
11
|
-
GreaterThanOrEqual: { value: ">=", label: "greater than or equal" },
|
|
12
|
-
Contains: { value: "contains", label: "contains" },
|
|
13
|
-
DoesNotContain: { value: "doesNotContain", label: "does not contain" },
|
|
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 Operators = QUERY_FILTER_OPERATORS;
|
|
22
|
-
export const DEFAULT_QUERY_FILTER_OPERATORS = Object.values(QUERY_FILTER_OPERATORS);
|
|
23
|
-
export const DefaultOperators = DEFAULT_QUERY_FILTER_OPERATORS;
|
|
24
|
-
export const QUERY_FILTER_VALUE_PLACEHOLDER = "Enter Value...";
|
|
25
|
-
export const QUERY_FILTER_SELECT_VALUE_LABEL = "Select Value";
|
|
26
|
-
export const QUERY_FILTER_UNAVAILABLE_FILTER_LABEL = "Unavailable filter";
|
|
27
|
-
export const QUERY_FILTER_COMBINATOR_TITLE = "Chain these query filters together using AND | OR logic";
|
|
28
|
-
export const QUERY_FILTER_DATE_FORMATS = {
|
|
29
|
-
day: "YYYY-MM-DD",
|
|
30
|
-
second: "YYYY-MM-DD HH:mm:ss",
|
|
31
|
-
millisecond: "YYYY-MM-DD HH:mm:ss.SSS",
|
|
32
|
-
default: "YYYY-MM-DD HH:mm:ss",
|
|
33
|
-
};
|
|
34
|
-
export const QUERY_FILTER_BETWEEN_OPERATORS = ["between", "notbetween"];
|
|
35
|
-
export const QUERY_FILTER_VALUELESS_OPERATORS = ["isEmpty", "isNotEmpty"];
|
|
36
|
-
export const QUERY_FILTER_COMBINATOR_OPTIONS = [
|
|
37
|
-
{ label: "AND", value: "and" },
|
|
38
|
-
{ label: "OR", value: "or" },
|
|
39
|
-
];
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { SuperDatePickerValue } from "../SuperDatePicker";
|
|
2
|
-
import type { FilterDefinition, InputType, Operator, Rule } from "./QueryFilter.types";
|
|
3
|
-
export declare const dateFormatResolver: (resolution?: string) => "YYYY-MM-DD" | "YYYY-MM-DD HH:mm:ss" | "YYYY-MM-DD HH:mm:ss.SSS";
|
|
4
|
-
export declare const isBetweenOperator: (operator: Operator) => boolean;
|
|
5
|
-
export declare const isDateInputType: (inputType: InputType) => inputType is "date" | "datetime";
|
|
6
|
-
export declare const operatorRequiresValue: (operator: Operator) => boolean;
|
|
7
|
-
export declare const formatRuleTimestampValue: (timestamp: string | null | undefined, filterDef: FilterDefinition) => string | undefined;
|
|
8
|
-
export declare const resolveRuleValueForOperator: (currentValue: Rule["value"], operator: Operator) => string[] | undefined;
|
|
9
|
-
export declare const updateRuleOperator: (rule: Rule, operator: Operator) => Rule;
|
|
10
|
-
export declare const getSecondaryRuleValue: (rule: Rule) => string;
|
|
11
|
-
export declare const getRuleDateRangeValue: (rule: Rule) => SuperDatePickerValue;
|
|
12
|
-
export declare const updateRulePrimaryValue: (rule: Rule, nextRule: Rule) => Rule;
|
|
13
|
-
export declare const updateRuleSecondaryValue: (rule: Rule, nextRule: Rule) => Rule;
|
|
14
|
-
export declare const updateRuleDateRangeValue: (rule: Rule, nextValue: SuperDatePickerValue, filterDef: FilterDefinition) => Rule;
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import moment from "moment";
|
|
2
|
-
import { QUERY_FILTER_BETWEEN_OPERATORS, QUERY_FILTER_DATE_FORMATS, QUERY_FILTER_VALUELESS_OPERATORS, } from "./QueryFilter.constants";
|
|
3
|
-
export const dateFormatResolver = (resolution) => {
|
|
4
|
-
switch (resolution) {
|
|
5
|
-
case "day":
|
|
6
|
-
return QUERY_FILTER_DATE_FORMATS.day;
|
|
7
|
-
case "second":
|
|
8
|
-
return QUERY_FILTER_DATE_FORMATS.second;
|
|
9
|
-
case "millisecond":
|
|
10
|
-
return QUERY_FILTER_DATE_FORMATS.millisecond;
|
|
11
|
-
default:
|
|
12
|
-
return QUERY_FILTER_DATE_FORMATS.default;
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
export const isBetweenOperator = (operator) => {
|
|
16
|
-
const value = operator.value.toLowerCase();
|
|
17
|
-
return QUERY_FILTER_BETWEEN_OPERATORS.includes(value);
|
|
18
|
-
};
|
|
19
|
-
export const isDateInputType = (inputType) => {
|
|
20
|
-
return inputType === "date" || inputType === "datetime";
|
|
21
|
-
};
|
|
22
|
-
export const operatorRequiresValue = (operator) => {
|
|
23
|
-
return !QUERY_FILTER_VALUELESS_OPERATORS.includes(operator.value);
|
|
24
|
-
};
|
|
25
|
-
export const formatRuleTimestampValue = (timestamp, filterDef) => {
|
|
26
|
-
if (!timestamp || !filterDef.resolution) {
|
|
27
|
-
return timestamp || undefined;
|
|
28
|
-
}
|
|
29
|
-
const date = moment(timestamp).utc(true); // utc mode prevents datetime from shifting when using toISOString
|
|
30
|
-
switch (filterDef.resolution) {
|
|
31
|
-
case "day":
|
|
32
|
-
date.set({ hour: 0, minute: 0, second: 0, millisecond: 0 });
|
|
33
|
-
break;
|
|
34
|
-
case "second":
|
|
35
|
-
date.set({ millisecond: 0 });
|
|
36
|
-
break;
|
|
37
|
-
case "millisecond":
|
|
38
|
-
break;
|
|
39
|
-
default:
|
|
40
|
-
break;
|
|
41
|
-
}
|
|
42
|
-
return filterDef.isoString
|
|
43
|
-
? date.toISOString()
|
|
44
|
-
: date.format(dateFormatResolver(filterDef.resolution));
|
|
45
|
-
};
|
|
46
|
-
export const resolveRuleValueForOperator = (currentValue, operator) => {
|
|
47
|
-
if (isBetweenOperator(operator)) {
|
|
48
|
-
return [(currentValue === null || currentValue === void 0 ? void 0 : currentValue[0]) || "", (currentValue === null || currentValue === void 0 ? void 0 : currentValue[1]) || ""];
|
|
49
|
-
}
|
|
50
|
-
return (currentValue === null || currentValue === void 0 ? void 0 : currentValue.length) && currentValue.length > 0
|
|
51
|
-
? currentValue
|
|
52
|
-
: undefined;
|
|
53
|
-
};
|
|
54
|
-
export const updateRuleOperator = (rule, operator) => {
|
|
55
|
-
return Object.assign(Object.assign({}, rule), { operator, value: resolveRuleValueForOperator(rule.value, operator) });
|
|
56
|
-
};
|
|
57
|
-
export const getSecondaryRuleValue = (rule) => {
|
|
58
|
-
var _a;
|
|
59
|
-
return ((_a = rule.value) === null || _a === void 0 ? void 0 : _a[1]) || "";
|
|
60
|
-
};
|
|
61
|
-
export const getRuleDateRangeValue = (rule) => {
|
|
62
|
-
var _a, _b;
|
|
63
|
-
return {
|
|
64
|
-
start: ((_a = rule.value) === null || _a === void 0 ? void 0 : _a[0]) || null,
|
|
65
|
-
end: ((_b = rule.value) === null || _b === void 0 ? void 0 : _b[1]) || null,
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
export const updateRulePrimaryValue = (rule, nextRule) => {
|
|
69
|
-
var _a, _b;
|
|
70
|
-
if (isBetweenOperator(rule.operator)) {
|
|
71
|
-
return Object.assign(Object.assign({}, rule), { value: [((_a = nextRule.value) === null || _a === void 0 ? void 0 : _a[0]) || "", ((_b = rule.value) === null || _b === void 0 ? void 0 : _b[1]) || ""] });
|
|
72
|
-
}
|
|
73
|
-
return Object.assign(Object.assign({}, rule), { value: nextRule.value, options: nextRule.options });
|
|
74
|
-
};
|
|
75
|
-
export const updateRuleSecondaryValue = (rule, nextRule) => {
|
|
76
|
-
var _a, _b;
|
|
77
|
-
return Object.assign(Object.assign({}, rule), { value: [((_a = rule.value) === null || _a === void 0 ? void 0 : _a[0]) || "", ((_b = nextRule.value) === null || _b === void 0 ? void 0 : _b[0]) || ""], options: nextRule.options });
|
|
78
|
-
};
|
|
79
|
-
export const updateRuleDateRangeValue = (rule, nextValue, filterDef) => {
|
|
80
|
-
return Object.assign(Object.assign({}, rule), { value: [
|
|
81
|
-
formatRuleTimestampValue(nextValue.start, filterDef) || "",
|
|
82
|
-
formatRuleTimestampValue(nextValue.end, filterDef) || "",
|
|
83
|
-
] });
|
|
84
|
-
};
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
export declare const StyledContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
2
|
-
export declare const RuleContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>, never>> & string;
|
|
3
|
-
export declare const FilterContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>, never>> & string;
|
|
4
|
-
export declare const StyledButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
5
|
-
ref?: import("react").RefObject<HTMLButtonElement>;
|
|
6
|
-
children?: import("react").ReactNode | string;
|
|
7
|
-
className?: string;
|
|
8
|
-
loading?: boolean;
|
|
9
|
-
leftSection?: import("react").ReactNode;
|
|
10
|
-
rightSection?: import("react").ReactNode;
|
|
11
|
-
href?: string | null;
|
|
12
|
-
download?: string | null;
|
|
13
|
-
fullWidth?: boolean;
|
|
14
|
-
size?: import("../core").Size;
|
|
15
|
-
variant?: import("../core").Variant;
|
|
16
|
-
color?: import("../Button").ButtonColor;
|
|
17
|
-
disabled?: boolean;
|
|
18
|
-
selected?: boolean;
|
|
19
|
-
justify?: "start" | "center" | "end";
|
|
20
|
-
onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
21
|
-
}, never>> & string & Omit<import("react").FC<import("../Button").ButtonProps>, keyof import("react").Component<any, {}, any>>;
|
|
22
|
-
export declare const BaseLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
23
|
-
export declare const FieldLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>, never>> & string;
|
|
24
|
-
export declare const ValueLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>, never>> & string;
|
|
25
|
-
export declare const StyledInput: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<import("../Input/Input").InputProps, "ref"> & import("react").RefAttributes<HTMLInputElement>, never>> & string & Omit<import("react").ForwardRefExoticComponent<Omit<import("../Input/Input").InputProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>, keyof import("react").Component<any, {}, any>>;
|
|
26
|
-
export declare const StyledDateInput: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<{
|
|
27
|
-
className?: string;
|
|
28
|
-
style?: React.CSSProperties;
|
|
29
|
-
defaultValue?: string | null | undefined;
|
|
30
|
-
value?: string | null | undefined;
|
|
31
|
-
format?: import("../DateInput/DateInput").FormatOptions;
|
|
32
|
-
label?: string;
|
|
33
|
-
description?: import("react").ReactNode;
|
|
34
|
-
arrow?: boolean;
|
|
35
|
-
size?: import("../core").Size;
|
|
36
|
-
variant?: import("../core").Variant;
|
|
37
|
-
clearable?: boolean;
|
|
38
|
-
required?: boolean;
|
|
39
|
-
onChange?: (value?: string | null) => void;
|
|
40
|
-
min?: Date;
|
|
41
|
-
max?: Date;
|
|
42
|
-
error?: string;
|
|
43
|
-
width?: string;
|
|
44
|
-
enableCalendar?: boolean;
|
|
45
|
-
utc?: boolean;
|
|
46
|
-
closeOnSelect?: boolean;
|
|
47
|
-
disabled?: boolean;
|
|
48
|
-
}, never>> & string & Omit<import("react").FC<{
|
|
49
|
-
className?: string;
|
|
50
|
-
style?: React.CSSProperties;
|
|
51
|
-
defaultValue?: string | null | undefined;
|
|
52
|
-
value?: string | null | undefined;
|
|
53
|
-
format?: import("../DateInput/DateInput").FormatOptions;
|
|
54
|
-
label?: string;
|
|
55
|
-
description?: import("react").ReactNode;
|
|
56
|
-
arrow?: boolean;
|
|
57
|
-
size?: import("../core").Size;
|
|
58
|
-
variant?: import("../core").Variant;
|
|
59
|
-
clearable?: boolean;
|
|
60
|
-
required?: boolean;
|
|
61
|
-
onChange?: (value?: string | null) => void;
|
|
62
|
-
min?: Date;
|
|
63
|
-
max?: Date;
|
|
64
|
-
error?: string;
|
|
65
|
-
width?: string;
|
|
66
|
-
enableCalendar?: boolean;
|
|
67
|
-
utc?: boolean;
|
|
68
|
-
closeOnSelect?: boolean;
|
|
69
|
-
disabled?: boolean;
|
|
70
|
-
}>, keyof import("react").Component<any, {}, any>>;
|
|
71
|
-
export declare const CloseLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
72
|
-
ref?: import("react").RefObject<HTMLButtonElement>;
|
|
73
|
-
children?: import("react").ReactNode | string;
|
|
74
|
-
className?: string;
|
|
75
|
-
loading?: boolean;
|
|
76
|
-
leftSection?: import("react").ReactNode;
|
|
77
|
-
rightSection?: import("react").ReactNode;
|
|
78
|
-
href?: string | null;
|
|
79
|
-
download?: string | null;
|
|
80
|
-
fullWidth?: boolean;
|
|
81
|
-
size?: import("../core").Size;
|
|
82
|
-
variant?: import("../core").Variant;
|
|
83
|
-
color?: import("../Button").ButtonColor;
|
|
84
|
-
disabled?: boolean;
|
|
85
|
-
selected?: boolean;
|
|
86
|
-
justify?: "start" | "center" | "end";
|
|
87
|
-
onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
88
|
-
}, never>, never>> & string;
|
|
89
|
-
export declare const UnavailableRuleContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>, never>, never>> & string;
|
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
import styled from "styled-components";
|
|
2
|
-
import { Button } from "../Button";
|
|
3
|
-
import Input from "../Input";
|
|
4
|
-
import DateInput from "../DateInput";
|
|
5
|
-
export const StyledContainer = styled.div `
|
|
6
|
-
display: flex;
|
|
7
|
-
flex-direction: row;
|
|
8
|
-
gap: 2px;
|
|
9
|
-
`;
|
|
10
|
-
export const RuleContainer = styled(StyledContainer) `
|
|
11
|
-
gap: 0;
|
|
12
|
-
align-items: center;
|
|
13
|
-
overflow: hidden;
|
|
14
|
-
|
|
15
|
-
border: 1px solid transparent;
|
|
16
|
-
border-radius: 5px;
|
|
17
|
-
background-color: ${({ theme }) => theme.palette.background.subtle};
|
|
18
|
-
|
|
19
|
-
& > * {
|
|
20
|
-
box-shadow: inset -1px 0 0 ${({ theme }) => theme.palette.divider};
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
& > *:last-child {
|
|
24
|
-
box-shadow: none;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
button.mfui-DropDownMenu {
|
|
28
|
-
min-height: 24px;
|
|
29
|
-
border-color: transparent;
|
|
30
|
-
border-radius: 0;
|
|
31
|
-
background-color: transparent;
|
|
32
|
-
font-family: ${({ theme }) => theme.typography.fontFamily};
|
|
33
|
-
font-size: 11px;
|
|
34
|
-
font-weight: 400;
|
|
35
|
-
line-height: 1;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
button.mfui-DropDownMenu:hover {
|
|
39
|
-
background-color: ${({ theme }) => theme.palette.action.hover} !important;
|
|
40
|
-
border-color: transparent;
|
|
41
|
-
}
|
|
42
|
-
`;
|
|
43
|
-
export const FilterContainer = styled(StyledContainer) `
|
|
44
|
-
align-items: center;
|
|
45
|
-
flex-wrap: wrap;
|
|
46
|
-
row-gap: 6px;
|
|
47
|
-
column-gap: 6px;
|
|
48
|
-
|
|
49
|
-
button.mfui-DropDownMenu {
|
|
50
|
-
background-color: ${({ theme }) => theme.palette.background.subtle} !important;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
button.mfui-DropDownMenu:hover {
|
|
54
|
-
background-color: ${({ theme }) => theme.palette.action.hover} !important;
|
|
55
|
-
}
|
|
56
|
-
`;
|
|
57
|
-
export const StyledButton = styled(Button) `
|
|
58
|
-
height: 24px;
|
|
59
|
-
padding: 3px 7px;
|
|
60
|
-
|
|
61
|
-
border-radius: 0;
|
|
62
|
-
font-family: ${({ theme }) => theme.typography.fontFamily};
|
|
63
|
-
font-size: 11px;
|
|
64
|
-
font-weight: 400;
|
|
65
|
-
line-height: 1;
|
|
66
|
-
|
|
67
|
-
&:hover {
|
|
68
|
-
background-color: ${({ theme }) => theme.palette.action.hover};
|
|
69
|
-
border-color: ${({ theme }) => theme.palette.primary.main};
|
|
70
|
-
}
|
|
71
|
-
`;
|
|
72
|
-
export const BaseLabel = styled.div `
|
|
73
|
-
user-select: none;
|
|
74
|
-
|
|
75
|
-
display: flex;
|
|
76
|
-
flex-direction: row;
|
|
77
|
-
align-items: center;
|
|
78
|
-
|
|
79
|
-
height: 24px;
|
|
80
|
-
min-height: 24px;
|
|
81
|
-
|
|
82
|
-
padding: 3px 8px;
|
|
83
|
-
border: 0;
|
|
84
|
-
|
|
85
|
-
background-color: transparent;
|
|
86
|
-
|
|
87
|
-
font-family: ${({ theme }) => theme.typography.fontFamily};
|
|
88
|
-
font-size: 11px;
|
|
89
|
-
font-weight: 400;
|
|
90
|
-
line-height: 1;
|
|
91
|
-
|
|
92
|
-
overflow: hidden;
|
|
93
|
-
white-space: nowrap;
|
|
94
|
-
text-overflow: ellipsis;
|
|
95
|
-
|
|
96
|
-
cursor: pointer;
|
|
97
|
-
|
|
98
|
-
&:hover {
|
|
99
|
-
background-color: ${({ theme }) => theme.palette.action.hover};
|
|
100
|
-
}
|
|
101
|
-
`;
|
|
102
|
-
export const FieldLabel = styled(BaseLabel) `
|
|
103
|
-
font-weight: 400;
|
|
104
|
-
color: ${({ theme }) => theme.palette.text.primary};
|
|
105
|
-
`;
|
|
106
|
-
export const ValueLabel = styled(BaseLabel) `
|
|
107
|
-
color: ${({ theme }) => theme.palette.text.secondary};
|
|
108
|
-
`;
|
|
109
|
-
export const StyledInput = styled(Input) `
|
|
110
|
-
height: 24px;
|
|
111
|
-
min-height: 24px;
|
|
112
|
-
width: 110px;
|
|
113
|
-
padding: 3px 8px;
|
|
114
|
-
|
|
115
|
-
border-radius: 0;
|
|
116
|
-
border-color: transparent;
|
|
117
|
-
|
|
118
|
-
background-color: transparent;
|
|
119
|
-
color: ${({ theme }) => theme.palette.text.primary};
|
|
120
|
-
font-family: ${({ theme }) => theme.typography.fontFamily};
|
|
121
|
-
font-size: 11px;
|
|
122
|
-
font-weight: 400;
|
|
123
|
-
line-height: 1;
|
|
124
|
-
|
|
125
|
-
&:hover {
|
|
126
|
-
border-color: transparent;
|
|
127
|
-
background-color: ${({ theme }) => theme.palette.action.hover};
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
&:focus {
|
|
131
|
-
border-color: ${({ theme }) => theme.palette.primary.main};
|
|
132
|
-
}
|
|
133
|
-
`;
|
|
134
|
-
export const StyledDateInput = styled(DateInput) `
|
|
135
|
-
width: auto;
|
|
136
|
-
|
|
137
|
-
.input-container {
|
|
138
|
-
height: 24px;
|
|
139
|
-
|
|
140
|
-
border-radius: 0;
|
|
141
|
-
border-color: transparent;
|
|
142
|
-
|
|
143
|
-
background-color: transparent;
|
|
144
|
-
color: ${({ theme }) => theme.palette.text.primary};
|
|
145
|
-
font-family: ${({ theme }) => theme.typography.fontFamily};
|
|
146
|
-
font-size: 11px;
|
|
147
|
-
font-weight: 400;
|
|
148
|
-
line-height: 1;
|
|
149
|
-
|
|
150
|
-
cursor: pointer;
|
|
151
|
-
|
|
152
|
-
&:hover {
|
|
153
|
-
border-color: transparent;
|
|
154
|
-
background-color: ${({ theme }) => theme.palette.action.hover};
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
`;
|
|
158
|
-
export const CloseLabel = styled(StyledButton) `
|
|
159
|
-
width: 22px;
|
|
160
|
-
min-width: 22px;
|
|
161
|
-
padding: 2px;
|
|
162
|
-
|
|
163
|
-
background-color: transparent;
|
|
164
|
-
color: ${({ theme }) => theme.palette.text.secondary};
|
|
165
|
-
|
|
166
|
-
&:hover {
|
|
167
|
-
background-color: ${({ theme }) => theme.palette.action.hover};
|
|
168
|
-
border-color: transparent;
|
|
169
|
-
}
|
|
170
|
-
`;
|
|
171
|
-
export const UnavailableRuleContainer = styled(RuleContainer) `
|
|
172
|
-
border-style: dashed;
|
|
173
|
-
border-color: ${({ theme }) => theme.alert.warning.border};
|
|
174
|
-
background-color: ${({ theme }) => theme.palette.background.subtle};
|
|
175
|
-
|
|
176
|
-
${FieldLabel},
|
|
177
|
-
${ValueLabel} {
|
|
178
|
-
background-color: transparent;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
${ValueLabel} {
|
|
182
|
-
color: ${({ theme }) => theme.alert.warning.color};
|
|
183
|
-
}
|
|
184
|
-
`;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { DropDownItem } from "../../DropDownMenu";
|
|
2
|
-
import { FilterDefinition, Rule } from "../QueryFilter.types";
|
|
3
|
-
export declare const MultiSelectEditor: React.FC<{
|
|
4
|
-
rule: Rule;
|
|
5
|
-
filterDef: FilterDefinition;
|
|
6
|
-
onChange?: (selected: DropDownItem[], diff: DropDownItem[]) => void;
|
|
7
|
-
}>;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useTheme } from "styled-components";
|
|
3
|
-
import { DropDownMenu } from "../../DropDownMenu";
|
|
4
|
-
import { QUERY_FILTER_SELECT_VALUE_LABEL, } from "../QueryFilter.constants";
|
|
5
|
-
export const MultiSelectEditor = ({ rule, filterDef, onChange }) => {
|
|
6
|
-
var _a, _b;
|
|
7
|
-
const theme = useTheme();
|
|
8
|
-
const handleChange = (selected, diff) => {
|
|
9
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(selected, diff);
|
|
10
|
-
};
|
|
11
|
-
const options = [
|
|
12
|
-
...((filterDef === null || filterDef === void 0 ? void 0 : filterDef.selectOptions) || []),
|
|
13
|
-
...(rule.options || []),
|
|
14
|
-
];
|
|
15
|
-
const selected = ((_a = rule.value) === null || _a === void 0 ? void 0 : _a.map((value) => {
|
|
16
|
-
const option = options.find((o) => o.value == value);
|
|
17
|
-
return option || { label: value, value };
|
|
18
|
-
})) || [];
|
|
19
|
-
let display = selected.map((o) => o.label).join(", ") || QUERY_FILTER_SELECT_VALUE_LABEL;
|
|
20
|
-
if (Array.isArray(rule.value) && rule.value.length > 1) {
|
|
21
|
-
display = `${rule.value.length} ${(filterDef === null || filterDef === void 0 ? void 0 : filterDef.pluralLabel) || "Values"}`;
|
|
22
|
-
}
|
|
23
|
-
return (_jsx(DropDownMenu, { data: (filterDef === null || filterDef === void 0 ? void 0 : filterDef.selectOptions) || [], variant: "outlined", multiselect: true, searchable: true, size: "xs", buttonProps: {
|
|
24
|
-
title: QUERY_FILTER_SELECT_VALUE_LABEL,
|
|
25
|
-
variant: "contained",
|
|
26
|
-
size: "xxs",
|
|
27
|
-
style: {
|
|
28
|
-
padding: "3px 8px",
|
|
29
|
-
height: 24,
|
|
30
|
-
borderRadius: 0,
|
|
31
|
-
backgroundColor: "transparent",
|
|
32
|
-
borderColor: "transparent",
|
|
33
|
-
fontFamily: theme.typography.fontFamily,
|
|
34
|
-
fontSize: 11,
|
|
35
|
-
fontWeight: "normal",
|
|
36
|
-
lineHeight: 1,
|
|
37
|
-
color: !!rule.value && Array.isArray(rule.value) && rule.value.length > 0
|
|
38
|
-
? theme.palette.text.primary
|
|
39
|
-
: theme.palette.text.secondary,
|
|
40
|
-
},
|
|
41
|
-
}, dropDownProps: {
|
|
42
|
-
style: Object.assign({ width: 200, maxWidth: 400 }, (_b = filterDef === null || filterDef === void 0 ? void 0 : filterDef.dropDownOptions) === null || _b === void 0 ? void 0 : _b.style),
|
|
43
|
-
}, value: selected, onChange: handleChange, query: filterDef === null || filterDef === void 0 ? void 0 : filterDef.query, children: display }));
|
|
44
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { FilterDefinition, Operator, Rule } from "../QueryFilter.types";
|
|
2
|
-
export declare const RuleChip: React.FC<{
|
|
3
|
-
rule: Rule;
|
|
4
|
-
filterDef: FilterDefinition;
|
|
5
|
-
onDelete: (rule: Rule) => void;
|
|
6
|
-
onOperatorChange: (rule: Rule, operator: Operator) => void;
|
|
7
|
-
onUpdate: (rule: Rule) => void;
|
|
8
|
-
}>;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { XIcon } from "lucide-react";
|
|
3
|
-
import styled, { useTheme } from "styled-components";
|
|
4
|
-
import { DropDownMenu } from "../../DropDownMenu";
|
|
5
|
-
import { DefaultOperators } from "../QueryFilter.constants";
|
|
6
|
-
import { operatorRequiresValue } from "../QueryFilter.lib";
|
|
7
|
-
import { CloseLabel, FieldLabel, RuleContainer } from "../QueryFilter.styled";
|
|
8
|
-
import { ValueSelector } from "./ValueSelector";
|
|
9
|
-
const RuleLabel = styled(FieldLabel) `
|
|
10
|
-
&:hover {
|
|
11
|
-
background-color: transparent;
|
|
12
|
-
}
|
|
13
|
-
`;
|
|
14
|
-
export const RuleChip = ({ rule, filterDef, onDelete, onOperatorChange, onUpdate }) => {
|
|
15
|
-
const theme = useTheme();
|
|
16
|
-
const operatorOptions = (filterDef === null || filterDef === void 0 ? void 0 : filterDef.operators) || DefaultOperators;
|
|
17
|
-
const inputType = (filterDef === null || filterDef === void 0 ? void 0 : filterDef.inputType) || "text";
|
|
18
|
-
return (_jsxs(RuleContainer, { "data-rule-id": rule.id, children: [_jsx(RuleLabel, { children: rule.label }), _jsx(DropDownMenu, { variant: "outlined", data: operatorOptions, size: "xs", buttonProps: {
|
|
19
|
-
title: "Select Operator",
|
|
20
|
-
variant: "contained",
|
|
21
|
-
color: "secondary",
|
|
22
|
-
style: {
|
|
23
|
-
fontFamily: theme.typography.fontFamily,
|
|
24
|
-
fontWeight: "normal",
|
|
25
|
-
fontSize: 11,
|
|
26
|
-
lineHeight: 1,
|
|
27
|
-
padding: "3px 8px",
|
|
28
|
-
height: 24,
|
|
29
|
-
borderRadius: 0,
|
|
30
|
-
backgroundColor: "transparent",
|
|
31
|
-
borderColor: "transparent",
|
|
32
|
-
color: theme.palette.text.secondary,
|
|
33
|
-
},
|
|
34
|
-
}, onItemSelect: (e) => onOperatorChange(rule, e), dropDownProps: {
|
|
35
|
-
style: { width: 150, maxWidth: 400 },
|
|
36
|
-
}, children: rule.operator.label }), operatorRequiresValue(rule.operator) && (_jsx(ValueSelector, { rule: rule, inputType: inputType, filterDef: filterDef, onChange: onUpdate })), _jsx(CloseLabel, { variant: "contained", onClick: () => onDelete(rule), children: _jsx(XIcon, { size: 16 }) })] }));
|
|
37
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { FilterDefinition, Rule } from "../QueryFilter.types";
|
|
2
|
-
export interface RulesProps {
|
|
3
|
-
rules: Rule[];
|
|
4
|
-
combinator: "and" | "or";
|
|
5
|
-
showCombinator?: boolean;
|
|
6
|
-
filterDefinitions: FilterDefinition[];
|
|
7
|
-
onDelete: (rule: Rule) => void;
|
|
8
|
-
onUpdate: (rule: Rule) => void;
|
|
9
|
-
onUpdateRootCombinator: (e: "or" | "and") => void;
|
|
10
|
-
}
|
|
11
|
-
export declare const Rules: React.FC<RulesProps>;
|