@monolith-forensics/monolith-ui 1.8.1-dev.2 → 1.8.1-dev.4
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/Calendar/Calendar.d.ts +4 -1
- package/dist/Calendar/Calendar.js +126 -50
- package/dist/Calendar/CalendarStyles.d.ts +3 -2
- package/dist/Calendar/CalendarStyles.js +62 -23
- package/dist/Calendar/calendarHelpers.d.ts +1 -1
- package/dist/CheckBox/CheckBox.js +35 -4
- package/dist/DropDownMenu/DropDownMenu.js +25 -15
- package/dist/DropDownMenu/components/MenuComponent.js +6 -1
- package/dist/DropDownMenu/components/MenuItem.js +6 -0
- package/dist/DropDownMenu/components/MenuItemList.d.ts +2 -0
- package/dist/DropDownMenu/components/MenuItemList.js +94 -13
- package/dist/DropDownMenu/components/StyledContent.js +1 -2
- package/dist/DropDownMenu/types.d.ts +1 -0
- package/dist/FileViewer/viewers/ImageViewer.js +75 -18
- package/dist/MonolithUIProvider/MonolithUIProvider.d.ts +1 -0
- package/dist/QueryFilter/QueryFilter.constants.d.ts +134 -0
- package/dist/QueryFilter/QueryFilter.constants.js +39 -0
- package/dist/QueryFilter/QueryFilter.d.ts +1 -1
- package/dist/QueryFilter/QueryFilter.js +3 -303
- package/dist/QueryFilter/QueryFilter.lib.d.ts +14 -0
- package/dist/QueryFilter/QueryFilter.lib.js +84 -0
- package/dist/QueryFilter/QueryFilter.styled.d.ts +89 -0
- package/dist/QueryFilter/QueryFilter.styled.js +184 -0
- package/dist/QueryFilter/{types.d.ts → QueryFilter.types.d.ts} +11 -2
- package/dist/QueryFilter/components/MultiSelectEditor.d.ts +7 -0
- package/dist/QueryFilter/components/MultiSelectEditor.js +44 -0
- package/dist/QueryFilter/components/RuleChip.d.ts +8 -0
- package/dist/QueryFilter/components/RuleChip.js +37 -0
- package/dist/QueryFilter/components/Rules.d.ts +11 -0
- package/dist/QueryFilter/components/Rules.js +41 -0
- package/dist/QueryFilter/components/UnavailableRuleChip.d.ts +5 -0
- package/dist/QueryFilter/components/UnavailableRuleChip.js +7 -0
- package/dist/QueryFilter/components/ValueEditor.d.ts +7 -0
- package/dist/QueryFilter/components/ValueEditor.js +45 -0
- package/dist/QueryFilter/components/ValueSelector.d.ts +7 -0
- package/dist/QueryFilter/components/ValueSelector.js +34 -0
- package/dist/QueryFilter/components/index.d.ts +6 -0
- package/dist/QueryFilter/components/index.js +6 -0
- package/dist/QueryFilter/index.d.ts +3 -2
- package/dist/QueryFilter/index.js +3 -2
- package/dist/QueryFilter/useQueryFilter.d.ts +1 -1
- package/dist/QueryFilter/useQueryFilter.js +23 -19
- package/dist/RichTextEditor/Extensions/getTiptapExtensions.js +5 -15
- package/dist/RichTextEditor/Plugins/ImageActionsPlugin.d.ts +3 -0
- package/dist/RichTextEditor/Plugins/ImageActionsPlugin.js +241 -0
- package/dist/RichTextEditor/Plugins/UploadImagesPlugin.d.ts +15 -0
- package/dist/RichTextEditor/Plugins/UploadImagesPlugin.js +115 -51
- package/dist/RichTextEditor/Plugins/index.d.ts +1 -0
- package/dist/RichTextEditor/Plugins/index.js +1 -0
- package/dist/RichTextEditor/RichTextEditor.d.ts +3 -2
- package/dist/RichTextEditor/RichTextEditor.js +309 -35
- package/dist/RichTextEditor/Toolbar/Toolbar.js +14 -2
- package/dist/SuperDatePicker/SuperDatePicker.constants.d.ts +24 -0
- package/dist/SuperDatePicker/SuperDatePicker.constants.js +30 -0
- package/dist/SuperDatePicker/SuperDatePicker.d.ts +3 -0
- package/dist/SuperDatePicker/SuperDatePicker.js +31 -0
- package/dist/SuperDatePicker/SuperDatePicker.lib.d.ts +17 -0
- package/dist/SuperDatePicker/SuperDatePicker.lib.js +206 -0
- package/dist/SuperDatePicker/SuperDatePicker.styled.d.ts +60 -0
- package/dist/SuperDatePicker/SuperDatePicker.styled.js +256 -0
- package/dist/SuperDatePicker/SuperDatePicker.types.d.ts +48 -0
- package/dist/SuperDatePicker/SuperDatePicker.types.js +1 -0
- package/dist/SuperDatePicker/components/CommonPresetGroups.d.ts +7 -0
- package/dist/SuperDatePicker/components/CommonPresetGroups.js +6 -0
- package/dist/SuperDatePicker/components/EndpointCalendarDropdown.d.ts +10 -0
- package/dist/SuperDatePicker/components/EndpointCalendarDropdown.js +9 -0
- package/dist/SuperDatePicker/components/EndpointDateInput.d.ts +16 -0
- package/dist/SuperDatePicker/components/EndpointDateInput.js +26 -0
- package/dist/SuperDatePicker/components/EndpointPopover.d.ts +18 -0
- package/dist/SuperDatePicker/components/EndpointPopover.js +11 -0
- package/dist/SuperDatePicker/components/QuickRangeDropdown.d.ts +14 -0
- package/dist/SuperDatePicker/components/QuickRangeDropdown.js +19 -0
- package/dist/SuperDatePicker/components/QuickRangePopover.d.ts +18 -0
- package/dist/SuperDatePicker/components/QuickRangePopover.js +12 -0
- package/dist/SuperDatePicker/components/index.d.ts +6 -0
- package/dist/SuperDatePicker/components/index.js +6 -0
- package/dist/SuperDatePicker/index.d.ts +3 -0
- package/dist/SuperDatePicker/index.js +3 -0
- package/dist/SuperDatePicker/useSuperDatePicker.d.ts +32 -0
- package/dist/SuperDatePicker/useSuperDatePicker.js +125 -0
- package/dist/Table/ColumnResizer.d.ts +6 -9
- package/dist/Table/ColumnResizer.js +30 -10
- package/dist/Table/TableComponents.js +14 -10
- package/dist/Table/TableHeader.js +31 -16
- package/dist/Table/TableMenu/TableMenu.js +1 -1
- package/dist/Table/TableProvider.js +91 -4
- package/dist/Table/TableRow.js +19 -12
- package/dist/Table/Utils/index.d.ts +0 -1
- package/dist/Table/Utils/index.js +0 -1
- package/dist/Table/types.d.ts +6 -19
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/theme/variants.js +2 -0
- package/package.json +22 -18
- package/dist/QueryFilter/DefaultOperators.d.ts +0 -76
- package/dist/QueryFilter/DefaultOperators.js +0 -21
- package/dist/Table/Utils/resizeHandler.d.ts +0 -3
- package/dist/Table/Utils/resizeHandler.js +0 -84
- /package/dist/QueryFilter/{types.js → QueryFilter.types.js} +0 -0
|
@@ -1,306 +1,6 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
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
|
-
};
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Rules } from "./components";
|
|
3
|
+
import { FilterContainer } from "./QueryFilter.styled";
|
|
304
4
|
export const QueryFilter = ({ queryFilter, }) => {
|
|
305
5
|
var _a;
|
|
306
6
|
const { filter, filterDefinitions, showCombinator } = queryFilter;
|
|
@@ -0,0 +1,14 @@
|
|
|
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;
|
|
@@ -0,0 +1,84 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
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;
|
|
@@ -0,0 +1,184 @@
|
|
|
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
|
+
`;
|