@danikokonn/yarik-frontend-lib 2.0.57-test → 2.0.57
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/components/ActionDialog/ActionDialog.d.ts +1 -2
- package/dist/components/ActionDialog/ActionDialog.d.ts.map +1 -1
- package/dist/components/ActionDialog/ActionDialog.js +7 -18
- package/dist/components/ActionDialog/ActionDialogProps.d.ts +1 -1
- package/dist/components/ActionDialog/ActionDialogProps.d.ts.map +1 -1
- package/dist/components/ActionDialog/index.d.ts +2 -2
- package/dist/components/ActionDialog/index.d.ts.map +1 -1
- package/dist/components/ActionDialog/index.js +1 -1
- package/dist/components/ColumnSearchInput/ColumnSearchInput.d.ts +1 -2
- package/dist/components/ColumnSearchInput/ColumnSearchInput.d.ts.map +1 -1
- package/dist/components/ColumnSearchInput/ColumnSearchInput.js +5 -5
- package/dist/components/ColumnSearchInput/index.d.ts +2 -2
- package/dist/components/ColumnSearchInput/index.d.ts.map +1 -1
- package/dist/components/ColumnSearchInput/index.js +1 -1
- package/dist/components/DateTimeRangePicker/DateTimeRangePicker.d.ts +2 -3
- package/dist/components/DateTimeRangePicker/DateTimeRangePicker.d.ts.map +1 -1
- package/dist/components/DateTimeRangePicker/DateTimeRangePicker.js +39 -42
- package/dist/components/DateTimeRangePicker/index.d.ts +2 -2
- package/dist/components/DateTimeRangePicker/index.d.ts.map +1 -1
- package/dist/components/DateTimeRangePicker/index.js +1 -1
- package/dist/components/DatetimeRangeInput/DatetimeRangeInput.d.ts +1 -0
- package/dist/components/DatetimeRangeInput/DatetimeRangeInput.d.ts.map +1 -1
- package/dist/components/DatetimeRangeInput/DatetimeRangeInput.js +38 -44
- package/dist/components/DatetimeRangeInput/index.d.ts +2 -2
- package/dist/components/DatetimeRangeInput/index.d.ts.map +1 -1
- package/dist/components/DatetimeRangeInput/index.js +1 -1
- package/dist/components/Footer/Footer.d.ts +1 -2
- package/dist/components/Footer/Footer.d.ts.map +1 -1
- package/dist/components/Footer/Footer.js +5 -13
- package/dist/components/Footer/index.d.ts +1 -1
- package/dist/components/Footer/index.d.ts.map +1 -1
- package/dist/components/Footer/index.js +1 -1
- package/dist/components/IpAddressInput/IpAddressInput.d.ts +1 -2
- package/dist/components/IpAddressInput/IpAddressInput.d.ts.map +1 -1
- package/dist/components/IpAddressInput/IpAddressInput.js +5 -6
- package/dist/components/IpAddressInput/index.d.ts +2 -2
- package/dist/components/IpAddressInput/index.d.ts.map +1 -1
- package/dist/components/IpAddressInput/index.js +1 -1
- package/dist/components/IpAddressSwitchableInput/IpAddressSwitchableInput.d.ts +1 -2
- package/dist/components/IpAddressSwitchableInput/IpAddressSwitchableInput.d.ts.map +1 -1
- package/dist/components/IpAddressSwitchableInput/IpAddressSwitchableInput.js +3 -2
- package/dist/components/IpAddressSwitchableInput/index.d.ts +2 -2
- package/dist/components/IpAddressSwitchableInput/index.d.ts.map +1 -1
- package/dist/components/IpAddressSwitchableInput/index.js +1 -1
- package/dist/components/LocalizedDatetimePicker/LocalizedDatetimePicker.d.ts +1 -2
- package/dist/components/LocalizedDatetimePicker/LocalizedDatetimePicker.d.ts.map +1 -1
- package/dist/components/LocalizedDatetimePicker/LocalizedDatetimePicker.js +6 -6
- package/dist/components/LocalizedDatetimePicker/index.d.ts +2 -2
- package/dist/components/LocalizedDatetimePicker/index.d.ts.map +1 -1
- package/dist/components/LocalizedDatetimePicker/index.js +1 -1
- package/dist/components/Navigation/NavMenu.d.ts +4 -3
- package/dist/components/Navigation/NavMenu.d.ts.map +1 -1
- package/dist/components/Navigation/NavMenu.js +23 -27
- package/dist/components/Navigation/Navigation.d.ts +1 -2
- package/dist/components/Navigation/Navigation.d.ts.map +1 -1
- package/dist/components/Navigation/Navigation.js +122 -147
- package/dist/components/Navigation/NavigationProps.d.ts +2 -1
- package/dist/components/Navigation/NavigationProps.d.ts.map +1 -1
- package/dist/components/Navigation/index.d.ts +2 -2
- package/dist/components/Navigation/index.d.ts.map +1 -1
- package/dist/components/Navigation/index.js +1 -1
- package/dist/components/NumberRangeInput/NumberRangeInput.d.ts +1 -2
- package/dist/components/NumberRangeInput/NumberRangeInput.d.ts.map +1 -1
- package/dist/components/NumberRangeInput/NumberRangeInput.js +34 -39
- package/dist/components/NumberRangeInput/index.d.ts +2 -2
- package/dist/components/NumberRangeInput/index.d.ts.map +1 -1
- package/dist/components/NumberRangeInput/index.js +1 -1
- package/dist/components/PageWrapper/PageWrapper.d.ts +2 -2
- package/dist/components/PageWrapper/PageWrapper.d.ts.map +1 -1
- package/dist/components/PageWrapper/PageWrapper.js +11 -14
- package/dist/components/PageWrapper/index.d.ts +2 -2
- package/dist/components/PageWrapper/index.d.ts.map +1 -1
- package/dist/components/PageWrapper/index.js +1 -1
- package/dist/components/RichFilterTextField/FilterHistoryMenu.d.ts +1 -2
- package/dist/components/RichFilterTextField/FilterHistoryMenu.d.ts.map +1 -1
- package/dist/components/RichFilterTextField/FilterHistoryMenu.js +17 -31
- package/dist/components/RichFilterTextField/HintOptionsMenu.d.ts +4 -4
- package/dist/components/RichFilterTextField/HintOptionsMenu.d.ts.map +1 -1
- package/dist/components/RichFilterTextField/HintOptionsMenu.js +8 -10
- package/dist/components/RichFilterTextField/RichFilterTextField.d.ts +1 -2
- package/dist/components/RichFilterTextField/RichFilterTextField.d.ts.map +1 -1
- package/dist/components/RichFilterTextField/RichFilterTextField.js +105 -86
- package/dist/components/RichFilterTextField/index.d.ts +2 -2
- package/dist/components/RichFilterTextField/index.d.ts.map +1 -1
- package/dist/components/RichFilterTextField/index.js +1 -1
- package/dist/components/RichFilterTextField/utils.d.ts.map +1 -1
- package/dist/components/RichFilterTextField/utils.js +13 -5
- package/dist/components/SmartTable/RowContent.d.ts +29 -9
- package/dist/components/SmartTable/RowContent.d.ts.map +1 -1
- package/dist/components/SmartTable/RowContent.js +59 -20
- package/dist/components/SmartTable/SmartTable.d.ts +9 -2
- package/dist/components/SmartTable/SmartTable.d.ts.map +1 -1
- package/dist/components/SmartTable/SmartTable.js +97 -109
- package/dist/components/SmartTable/SmartTableProps.d.ts +20 -10
- package/dist/components/SmartTable/SmartTableProps.d.ts.map +1 -1
- package/dist/components/SmartTable/TableHeader.d.ts +1 -2
- package/dist/components/SmartTable/TableHeader.d.ts.map +1 -1
- package/dist/components/SmartTable/TableHeader.js +5 -4
- package/dist/components/SmartTable/index.d.ts +2 -2
- package/dist/components/SmartTable/index.d.ts.map +1 -1
- package/dist/components/SmartTable/index.js +1 -1
- package/dist/components/SortBtn/SortBtn.d.ts +1 -2
- package/dist/components/SortBtn/SortBtn.d.ts.map +1 -1
- package/dist/components/SortBtn/SortBtn.js +3 -2
- package/dist/components/SortBtn/index.d.ts +2 -2
- package/dist/components/SortBtn/index.d.ts.map +1 -1
- package/dist/components/SortBtn/index.js +1 -1
- package/dist/components/SubtaskItem/SubtaskItem.d.ts +1 -2
- package/dist/components/SubtaskItem/SubtaskItem.d.ts.map +1 -1
- package/dist/components/SubtaskItem/SubtaskItem.js +82 -43
- package/dist/components/SubtaskItem/SubtaskItemProps.d.ts +1 -1
- package/dist/components/SubtaskItem/SubtaskItemProps.d.ts.map +1 -1
- package/dist/components/SubtaskItem/index.d.ts +2 -2
- package/dist/components/SubtaskItem/index.d.ts.map +1 -1
- package/dist/components/SubtaskItem/index.js +1 -1
- package/dist/components/TaskLoader/TaskLoader.d.ts +2 -2
- package/dist/components/TaskLoader/TaskLoader.d.ts.map +1 -1
- package/dist/components/TaskLoader/TaskLoader.js +179 -194
- package/dist/components/TaskLoader/TaskLoaderProps.d.ts +1 -0
- package/dist/components/TaskLoader/TaskLoaderProps.d.ts.map +1 -1
- package/dist/components/TaskLoader/index.d.ts +2 -2
- package/dist/components/TaskLoader/index.d.ts.map +1 -1
- package/dist/components/TaskLoader/index.js +1 -1
- package/dist/components/TaskStateDialog/TaskStateDialog.d.ts +1 -2
- package/dist/components/TaskStateDialog/TaskStateDialog.d.ts.map +1 -1
- package/dist/components/TaskStateDialog/TaskStateDialog.js +33 -47
- package/dist/components/TaskStateDialog/TaskStateDialogProps.d.ts +2 -1
- package/dist/components/TaskStateDialog/TaskStateDialogProps.d.ts.map +1 -1
- package/dist/components/TaskStateDialog/index.d.ts +2 -2
- package/dist/components/TaskStateDialog/index.d.ts.map +1 -1
- package/dist/components/TaskStateDialog/index.js +1 -1
- package/dist/components/icons/GenerateAndRunIcon.d.ts +1 -2
- package/dist/components/icons/GenerateAndRunIcon.d.ts.map +1 -1
- package/dist/components/icons/GenerateAndRunIcon.js +6 -23
- package/dist/components/icons/GenerateIcon.d.ts +1 -2
- package/dist/components/icons/GenerateIcon.d.ts.map +1 -1
- package/dist/components/icons/GenerateIcon.js +6 -21
- package/dist/components/icons/IntegerIcon.d.ts +1 -2
- package/dist/components/icons/IntegerIcon.d.ts.map +1 -1
- package/dist/components/icons/IntegerIcon.js +6 -9
- package/dist/components/icons/ProcessingIcon.d.ts +1 -2
- package/dist/components/icons/ProcessingIcon.d.ts.map +1 -1
- package/dist/components/icons/ProcessingIcon.js +2 -12
- package/dist/components/icons/QueueIcon.d.ts +1 -2
- package/dist/components/icons/QueueIcon.d.ts.map +1 -1
- package/dist/components/icons/QueueIcon.js +6 -9
- package/dist/components/icons/RangeIcon.d.ts +1 -2
- package/dist/components/icons/RangeIcon.d.ts.map +1 -1
- package/dist/components/icons/RangeIcon.js +6 -9
- package/dist/components/icons/RunIcon.d.ts +1 -2
- package/dist/components/icons/RunIcon.d.ts.map +1 -1
- package/dist/components/icons/RunIcon.js +6 -12
- package/dist/components/icons/TextModeIcon.d.ts.map +1 -1
- package/dist/components/icons/TextModeIcon.js +2 -6
- package/dist/components/icons/TreeModeIcon.d.ts.map +1 -1
- package/dist/components/icons/TreeModeIcon.js +2 -6
- package/dist/components/icons/index.d.ts +1 -1
- package/dist/components/icons/index.js +1 -1
- package/dist/http.d.ts +2 -2
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +4 -29
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/providers/AirflowProvider.d.ts +5 -4
- package/dist/providers/AirflowProvider.d.ts.map +1 -1
- package/dist/providers/AirflowProvider.js +44 -58
- package/dist/providers/DagStateProvider.d.ts +7 -5
- package/dist/providers/DagStateProvider.d.ts.map +1 -1
- package/dist/providers/DagStateProvider.js +95 -84
- package/dist/providers/SessionProvider.d.ts +3 -1
- package/dist/providers/SessionProvider.d.ts.map +1 -1
- package/dist/providers/SessionProvider.js +14 -7
- package/dist/providers/SnackBarProvider.d.ts +2 -2
- package/dist/providers/SnackBarProvider.d.ts.map +1 -1
- package/dist/providers/SnackBarProvider.js +8 -9
- package/dist/providers/index.d.ts +4 -4
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js +4 -4
- package/dist/types.d.ts +17 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/utils.d.ts +3 -3
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +4 -2
- package/package.json +30 -21
- package/dist/components/SmartTable/RuleRow.d.ts +0 -22
- package/dist/components/SmartTable/RuleRow.d.ts.map +0 -1
- package/dist/components/SmartTable/RuleRow.js +0 -35
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import ClearIcon from "@mui/icons-material/Clear";
|
|
3
|
+
import { Stack } from "@mui/material";
|
|
2
4
|
import IconButton from "@mui/material/IconButton";
|
|
3
5
|
import Popover from "@mui/material/Popover";
|
|
4
6
|
import TextField from "@mui/material/TextField";
|
|
5
|
-
import
|
|
6
|
-
import { Stack } from "@mui/material";
|
|
7
|
+
import { useState } from "react";
|
|
7
8
|
const NumberRangeInput = ({ from: _from, to: _to, variant, sx, placeholder, size, onRangeSet, }) => {
|
|
8
9
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
9
10
|
const [from, setFrom] = useState(_from);
|
|
@@ -11,41 +12,35 @@ const NumberRangeInput = ({ from: _from, to: _to, variant, sx, placeholder, size
|
|
|
11
12
|
const rangeText = (from != null && to != null && `(${from}, ${to})`) || "";
|
|
12
13
|
const open = Boolean(anchorEl);
|
|
13
14
|
const validRange = from && to && from !== to && from < to;
|
|
14
|
-
return (
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
onRangeSet(Number(e.target.value), to);
|
|
45
|
-
}, size: "small", type: "number", variant: "standard" }),
|
|
46
|
-
React.createElement(TextField, { required: true, label: "\u0414\u043E", value: to, error: !validRange, onChange: (e) => {
|
|
47
|
-
setTo(Number(e.target.value));
|
|
48
|
-
onRangeSet(from, Number(e.target.value));
|
|
49
|
-
}, size: "small", type: "number", variant: "standard" })))));
|
|
15
|
+
return (_jsxs(_Fragment, { children: [_jsx(TextField, { size: size, variant: variant || "standard", placeholder: open ? rangeText || "" : "", label: placeholder, title: validRange ? rangeText : "Некорректно введён диапазон", value: rangeText, onClick: (e) => setAnchorEl(e.currentTarget), error: !validRange, sx: sx, required: true, slotProps: {
|
|
16
|
+
input: {
|
|
17
|
+
readOnly: true,
|
|
18
|
+
endAdornment: rangeText.length > 0 ? (_jsx(IconButton, { onClick: (e) => {
|
|
19
|
+
setFrom(null);
|
|
20
|
+
setTo(null);
|
|
21
|
+
onRangeSet(null, null);
|
|
22
|
+
e.stopPropagation();
|
|
23
|
+
}, children: _jsx(ClearIcon, { fontSize: "small" }) })) : null,
|
|
24
|
+
},
|
|
25
|
+
inputLabel: {
|
|
26
|
+
shrink: open || rangeText.length > 0, // позволяет метке находиться сверху при поиске, при этом выбранное значение будет в заполнителе
|
|
27
|
+
},
|
|
28
|
+
} }), _jsx(Popover, { open: open, anchorEl: anchorEl, onClose: () => setAnchorEl(null), anchorOrigin: {
|
|
29
|
+
vertical: "bottom",
|
|
30
|
+
horizontal: "left",
|
|
31
|
+
}, transformOrigin: {
|
|
32
|
+
vertical: "top",
|
|
33
|
+
horizontal: "left",
|
|
34
|
+
}, slotProps: {
|
|
35
|
+
paper: {
|
|
36
|
+
sx: { minWidth: "30rem" },
|
|
37
|
+
},
|
|
38
|
+
}, children: _jsxs(Stack, { direction: "row", sx: { m: 2 }, spacing: 2, children: [_jsx(TextField, { required: true, label: "\u041E\u0442", value: from, error: !validRange, onChange: (e) => {
|
|
39
|
+
setFrom(Number(e.target.value));
|
|
40
|
+
onRangeSet(Number(e.target.value), to);
|
|
41
|
+
}, size: "small", type: "number", variant: "standard" }), _jsx(TextField, { required: true, label: "\u0414\u043E", value: to, error: !validRange, onChange: (e) => {
|
|
42
|
+
setTo(Number(e.target.value));
|
|
43
|
+
onRangeSet(from, Number(e.target.value));
|
|
44
|
+
}, size: "small", type: "number", variant: "standard" })] }) })] }));
|
|
50
45
|
};
|
|
51
46
|
export default NumberRangeInput;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { default } from "./NumberRangeInput";
|
|
2
1
|
export * from "./NumberRangeInput";
|
|
3
|
-
export { default
|
|
2
|
+
export { default } from "./NumberRangeInput";
|
|
4
3
|
export * from "./NumberRangeInputProps";
|
|
4
|
+
export { type default as NumberRangeInputProps } from "./NumberRangeInputProps";
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/NumberRangeInput/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/NumberRangeInput/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,cAAc,yBAAyB,CAAC;AACxC,OAAO,EAAE,KAAK,OAAO,IAAI,qBAAqB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import PageWrapperProps from "./PageWrapperProps";
|
|
3
|
-
|
|
2
|
+
declare const PageWrapper: ({ children, version, appName, desc, ...props }: PageWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default PageWrapper;
|
|
4
4
|
//# sourceMappingURL=PageWrapper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageWrapper.d.ts","sourceRoot":"","sources":["../../../src/components/PageWrapper/PageWrapper.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PageWrapper.d.ts","sourceRoot":"","sources":["../../../src/components/PageWrapper/PageWrapper.tsx"],"names":[],"mappings":"AAIA,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AASlD,QAAA,MAAM,WAAW,GAAI,gDAMlB,gBAAgB,4CAMlB,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { styled } from "@mui/material";
|
|
2
3
|
import Stack from "@mui/material/Stack";
|
|
3
|
-
import Navigation from "../Navigation/Navigation";
|
|
4
4
|
import Footer from "../Footer/Footer";
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
children,
|
|
15
|
-
React.createElement(Footer, { version: version, appName: appName, desc: desc })));
|
|
16
|
-
}
|
|
5
|
+
import Navigation from "../Navigation/Navigation";
|
|
6
|
+
const StackWithDefaultBgColor = styled(Stack)(({ theme }) => ({
|
|
7
|
+
backgroundColor: theme.vars?.palette.background.default,
|
|
8
|
+
justifyContent: "space-between",
|
|
9
|
+
minHeight: "100vh",
|
|
10
|
+
position: "relative",
|
|
11
|
+
}));
|
|
12
|
+
const PageWrapper = ({ children, version, appName, desc, ...props }) => (_jsxs(StackWithDefaultBgColor, { direction: "column", children: [_jsx(Navigation, { ...props }), children, _jsx(Footer, { version: version, appName: appName, desc: desc })] }));
|
|
13
|
+
export default PageWrapper;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { default } from "./PageWrapper";
|
|
2
1
|
export * from "./PageWrapper";
|
|
3
|
-
export { default
|
|
2
|
+
export { default } from "./PageWrapper";
|
|
4
3
|
export * from "./PageWrapperProps";
|
|
4
|
+
export { type default as PageWrapperProps } from "./PageWrapperProps";
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/PageWrapper/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/PageWrapper/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,KAAK,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
declare const FilterHistoryMenu: ({ searchHist, onChange, onCopy, }: {
|
|
3
2
|
searchHist: string[];
|
|
4
3
|
onChange(text: string, idx: number): void;
|
|
5
4
|
onCopy(): void;
|
|
6
|
-
}) =>
|
|
5
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
7
6
|
export default FilterHistoryMenu;
|
|
8
7
|
//# sourceMappingURL=FilterHistoryMenu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterHistoryMenu.d.ts","sourceRoot":"","sources":["../../../src/components/RichFilterTextField/FilterHistoryMenu.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FilterHistoryMenu.d.ts","sourceRoot":"","sources":["../../../src/components/RichFilterTextField/FilterHistoryMenu.tsx"],"names":[],"mappings":"AAaA,QAAA,MAAM,iBAAiB,GAAI,mCAIxB;IACD,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,MAAM,IAAI,IAAI,CAAC;CAChB,4CA2DA,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,43 +1,29 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import IconButton from "@mui/material/IconButton";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import ContentCopy from "@mui/icons-material/ContentCopy";
|
|
4
3
|
import FilterListIcon from "@mui/icons-material/FilterList";
|
|
5
4
|
import HistoryIcon from "@mui/icons-material/History";
|
|
6
|
-
import ContentCopy from "@mui/icons-material/ContentCopy";
|
|
7
5
|
import Divider from "@mui/material/Divider";
|
|
6
|
+
import IconButton from "@mui/material/IconButton";
|
|
8
7
|
import ListItemIcon from "@mui/material/ListItemIcon";
|
|
9
8
|
import ListItemText from "@mui/material/ListItemText";
|
|
10
9
|
import Menu from "@mui/material/Menu";
|
|
11
10
|
import MenuItem from "@mui/material/MenuItem";
|
|
11
|
+
import Stack from "@mui/material/Stack";
|
|
12
12
|
import Typography from "@mui/material/Typography";
|
|
13
|
+
import { useState } from "react";
|
|
13
14
|
const FilterHistoryMenu = ({ searchHist, onChange, onCopy, }) => {
|
|
14
15
|
const [searchHistMenuAnchor, setSearchHistMenuAnchor] = useState(null);
|
|
15
|
-
return (
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
React.createElement(HistoryIcon, null),
|
|
28
|
-
React.createElement(Typography, { variant: "h5" }, "\u0418\u0441\u0442\u043E\u0440\u0438\u044F \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0441\u043A\u0438\u0445 \u0444\u0438\u043B\u044C\u0442\u0440\u043E\u0432")),
|
|
29
|
-
React.createElement(Divider, null),
|
|
30
|
-
searchHist.map((el, idx) => (React.createElement(MenuItem, { key: idx + 1, onClick: () => onChange(el, idx), title: el },
|
|
31
|
-
React.createElement(ListItemText, { sx: { overflow: "hidden" } },
|
|
32
|
-
idx + 1,
|
|
33
|
-
". ",
|
|
34
|
-
el),
|
|
35
|
-
React.createElement(ListItemIcon, null,
|
|
36
|
-
React.createElement(IconButton, { onClick: (e) => {
|
|
37
|
-
navigator.clipboard.writeText(el);
|
|
38
|
-
e.stopPropagation();
|
|
39
|
-
onCopy();
|
|
40
|
-
} },
|
|
41
|
-
React.createElement(ContentCopy, { fontSize: "small" })))))))));
|
|
16
|
+
return (_jsxs(_Fragment, { children: [_jsx(IconButton, { color: "secondary", title: "\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0438\u0441\u0442\u043E\u0440\u0438\u044E \u0444\u0438\u043B\u044C\u0442\u0440\u043E\u0432", disabled: searchHist.length === 0, onClick: (e) => {
|
|
17
|
+
setSearchHistMenuAnchor(e.currentTarget);
|
|
18
|
+
e.stopPropagation();
|
|
19
|
+
}, children: _jsx(FilterListIcon, {}) }), _jsxs(Menu, { anchorEl: searchHistMenuAnchor, open: Boolean(searchHistMenuAnchor), onClose: () => setSearchHistMenuAnchor(null), onClick: () => setSearchHistMenuAnchor(null), children: [_jsxs(Stack, { direction: "row", spacing: 1, sx: {
|
|
20
|
+
px: 2,
|
|
21
|
+
py: 1,
|
|
22
|
+
alignItems: "center",
|
|
23
|
+
}, children: [_jsx(HistoryIcon, {}), _jsx(Typography, { variant: "h5", children: "\u0418\u0441\u0442\u043E\u0440\u0438\u044F \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0441\u043A\u0438\u0445 \u0444\u0438\u043B\u044C\u0442\u0440\u043E\u0432" })] }), _jsx(Divider, {}), searchHist.map((el, idx) => (_jsxs(MenuItem, { onClick: () => onChange(el, idx), title: el, children: [_jsxs(ListItemText, { sx: { overflow: "hidden" }, children: [idx + 1, ". ", el] }), _jsx(ListItemIcon, { children: _jsx(IconButton, { onClick: (e) => {
|
|
24
|
+
navigator.clipboard.writeText(el);
|
|
25
|
+
e.stopPropagation();
|
|
26
|
+
onCopy();
|
|
27
|
+
}, children: _jsx(ContentCopy, { fontSize: "small" }) }) })] }, idx + 1)))] })] }));
|
|
42
28
|
};
|
|
43
29
|
export default FilterHistoryMenu;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from "react";
|
|
2
2
|
declare const HintOptionsMenu: ({ inputAnchor, inputRef, textFieldRef, options, focusIdx, onSelectHint, onClose, }: {
|
|
3
3
|
inputAnchor: Element;
|
|
4
|
-
inputRef:
|
|
5
|
-
textFieldRef:
|
|
4
|
+
inputRef: RefObject<HTMLTextAreaElement>;
|
|
5
|
+
textFieldRef: RefObject<HTMLDivElement>;
|
|
6
6
|
options: Map<string, string | undefined>;
|
|
7
7
|
focusIdx: number;
|
|
8
8
|
onSelectHint(hint: string): void;
|
|
9
9
|
onClose: () => void;
|
|
10
|
-
}) =>
|
|
10
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
export default HintOptionsMenu;
|
|
12
12
|
//# sourceMappingURL=HintOptionsMenu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HintOptionsMenu.d.ts","sourceRoot":"","sources":["../../../src/components/RichFilterTextField/HintOptionsMenu.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"HintOptionsMenu.d.ts","sourceRoot":"","sources":["../../../src/components/RichFilterTextField/HintOptionsMenu.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAqB,MAAM,OAAO,CAAC;AAErD,QAAA,MAAM,eAAe,GAAI,oFAQtB;IACD,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,SAAS,CAAC,mBAAmB,CAAC,CAAC;IACzC,YAAY,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;IACxC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,4CA4EA,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import ListItemText from "@mui/material/ListItemText";
|
|
2
3
|
import Menu from "@mui/material/Menu";
|
|
3
4
|
import MenuItem from "@mui/material/MenuItem";
|
|
4
|
-
import
|
|
5
|
+
import { useEffect, useRef } from "react";
|
|
5
6
|
const HintOptionsMenu = ({ inputAnchor, inputRef, textFieldRef, options, focusIdx, onSelectHint, onClose, }) => {
|
|
6
7
|
const focusRef = useRef(null);
|
|
7
8
|
useEffect(() => {
|
|
@@ -9,15 +10,12 @@ const HintOptionsMenu = ({ inputAnchor, inputRef, textFieldRef, options, focusId
|
|
|
9
10
|
return;
|
|
10
11
|
focusRef.current.scrollIntoView({ behavior: "smooth" });
|
|
11
12
|
}, [focusRef.current]);
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
.toArray()
|
|
15
|
-
.map((opt, idx) => (React.createElement(MenuItem, { key: idx + 1, onClick: () => onSelectHint(opt[0]), className: focusIdx === idx ? "Mui-focusVisible" : "", ref: focusIdx === idx ? focusRef : null },
|
|
16
|
-
React.createElement(ListItemText, { sx: { overflow: "hidden" }, secondary: opt[1], slotProps: {
|
|
13
|
+
const optsArr = Array.from(options?.entries());
|
|
14
|
+
const menuOptions = () => optsArr.map((opt, idx) => (_jsx(MenuItem, { onClick: () => onSelectHint(opt[0]), className: focusIdx === idx ? "Mui-focusVisible" : "", ref: focusIdx === idx ? focusRef : null, children: _jsx(ListItemText, { sx: { overflow: "hidden" }, secondary: opt[1], slotProps: {
|
|
17
15
|
primary: { variant: "subtitle2" },
|
|
18
16
|
secondary: { variant: "caption" },
|
|
19
|
-
}
|
|
20
|
-
return (
|
|
17
|
+
}, children: opt[0] }) }, idx + 1)));
|
|
18
|
+
return (_jsx(Menu, { sx: { mt: "5px" }, open: Boolean(inputAnchor), anchorEl: inputAnchor, onClose: (_e, r) => {
|
|
21
19
|
if (r === "escapeKeyDown")
|
|
22
20
|
onClose();
|
|
23
21
|
}, onClick: onClose, anchorOrigin: {
|
|
@@ -45,6 +43,6 @@ const HintOptionsMenu = ({ inputAnchor, inputRef, textFieldRef, options, focusId
|
|
|
45
43
|
},
|
|
46
44
|
},
|
|
47
45
|
},
|
|
48
|
-
}, onFocus: () => inputRef.current.focus(), disableAutoFocus: true, disableEnforceFocus: true, disableRestoreFocus: true
|
|
46
|
+
}, onFocus: () => inputRef.current.focus(), disableAutoFocus: true, disableEnforceFocus: true, disableRestoreFocus: true, children: menuOptions() }));
|
|
49
47
|
};
|
|
50
48
|
export default HintOptionsMenu;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import RichFilterTextFieldProps from "./RichFilterTextFieldProps";
|
|
3
|
-
declare const RichFilterTextField: ({ filterExpr, filterExprHist, fields, operators, additionalComponents, instant: _instant, onChange, onSelectFromHistory, }: RichFilterTextFieldProps) =>
|
|
2
|
+
declare const RichFilterTextField: ({ filterExpr, filterExprHist: searchHist, fields, operators, additionalComponents, instant: _instant, onChange, onSelectFromHistory, }: RichFilterTextFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
3
|
export default RichFilterTextField;
|
|
5
4
|
//# sourceMappingURL=RichFilterTextField.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichFilterTextField.d.ts","sourceRoot":"","sources":["../../../src/components/RichFilterTextField/RichFilterTextField.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RichFilterTextField.d.ts","sourceRoot":"","sources":["../../../src/components/RichFilterTextField/RichFilterTextField.tsx"],"names":[],"mappings":"AAUA,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAGlE,QAAA,MAAM,mBAAmB,GAAI,wIAS1B,wBAAwB,4CAkS1B,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -1,68 +1,71 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import ClearIcon from "@mui/icons-material/Clear";
|
|
3
|
+
import SearchRoundedIcon from "@mui/icons-material/SearchRounded";
|
|
2
4
|
import IconButton from "@mui/material/IconButton";
|
|
3
5
|
import InputAdornment from "@mui/material/InputAdornment";
|
|
6
|
+
import Stack from "@mui/material/Stack";
|
|
4
7
|
import TextField from "@mui/material/TextField";
|
|
5
|
-
import
|
|
6
|
-
import SearchRoundedIcon from "@mui/icons-material/SearchRounded";
|
|
7
|
-
import HintOptionsMenu from "./HintOptionsMenu";
|
|
8
|
-
import { getHints, insertInStrPos } from "./utils";
|
|
8
|
+
import { useRef, useState } from "react";
|
|
9
9
|
import { useSnackbarContext } from "../../providers";
|
|
10
|
-
import { useDebounce } from "../../utils";
|
|
11
10
|
import FilterHistoryMenu from "./FilterHistoryMenu";
|
|
12
|
-
import
|
|
13
|
-
|
|
11
|
+
import HintOptionsMenu from "./HintOptionsMenu";
|
|
12
|
+
import { getHints, insertInStrPos } from "./utils";
|
|
13
|
+
const RichFilterTextField = ({ filterExpr, filterExprHist: searchHist, fields, operators, additionalComponents, instant: _instant, onChange, onSelectFromHistory, }) => {
|
|
14
14
|
const { enqueueSnackbar } = useSnackbarContext();
|
|
15
15
|
const [search, setSearch] = useState(filterExpr);
|
|
16
|
-
const instant = _instant ?? true;
|
|
17
|
-
useEffect(() => setSearch(filterExpr), [filterExpr]);
|
|
18
|
-
const [searchHist, setSearchHist] = useState(filterExprHist);
|
|
19
|
-
const [inputAnchor, setInputAnchor] = useState(null);
|
|
20
16
|
const [cursorPos, setCursorPos] = useState(null);
|
|
21
|
-
const [currentHintOptions, setCurrentHintOptions] = useState(() => new Map());
|
|
22
17
|
const [focusIdx, setFocusIdx] = useState(0);
|
|
23
18
|
const inputRef = useRef(null);
|
|
24
19
|
const textFieldRef = useRef(null);
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
20
|
+
const prevFilterExpr = useRef(filterExpr);
|
|
21
|
+
const instant = _instant ?? true;
|
|
22
|
+
const currentHintOptions = (cursorPos != null
|
|
23
|
+
? getHints(search, cursorPos, fields, operators)
|
|
24
|
+
: null) ?? new Map();
|
|
25
|
+
const inputAnchor = currentHintOptions?.size > 0 ? textFieldRef.current : null;
|
|
26
|
+
if (prevFilterExpr.current !== filterExpr && filterExpr !== search) {
|
|
27
|
+
setSearch(filterExpr);
|
|
28
|
+
setCursorPos(null);
|
|
30
29
|
setFocusIdx(0);
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
updateHints();
|
|
41
|
-
}, [cursorPos]);
|
|
30
|
+
prevFilterExpr.current = filterExpr;
|
|
31
|
+
}
|
|
32
|
+
if (cursorPos != null &&
|
|
33
|
+
inputRef.current &&
|
|
34
|
+
cursorPos !== inputRef.current.selectionStart) {
|
|
35
|
+
inputRef.current.selectionStart = cursorPos;
|
|
36
|
+
inputRef.current.selectionEnd = cursorPos;
|
|
37
|
+
}
|
|
42
38
|
const handleChange = (value, _idx) => {
|
|
43
39
|
setSearch(value);
|
|
44
|
-
|
|
40
|
+
if (cursorPos &&
|
|
41
|
+
getHints(value, cursorPos, fields, operators) !== currentHintOptions)
|
|
42
|
+
setFocusIdx(0);
|
|
43
|
+
onChange(value /*(v: unknown) => setSearchHist(v as string[])*/);
|
|
45
44
|
};
|
|
46
45
|
const insertHint = (hint) => {
|
|
47
46
|
if (cursorPos == null)
|
|
48
47
|
return;
|
|
49
|
-
if (hint.includes("["))
|
|
50
|
-
hint
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
hint = hint.replace("regex", "");
|
|
48
|
+
if ((hint.includes("[") && hint.endsWith("]")) ||
|
|
49
|
+
(hint.includes("(") && hint.endsWith(")")) ||
|
|
50
|
+
((hint.match(/\//g) || []).length === 2 && hint.endsWith("/"))) {
|
|
51
|
+
hint = hint
|
|
52
|
+
.replace(/\[.*?\]/g, "[]")
|
|
53
|
+
.replace(/\(.*?\)/g, "()")
|
|
54
|
+
.replace(/\/.*?\//g, "//");
|
|
57
55
|
}
|
|
58
56
|
const { newSearch, newPos } = insertInStrPos(search, cursorPos, hint, fields);
|
|
59
|
-
|
|
57
|
+
setSearch(newSearch);
|
|
58
|
+
if (instant)
|
|
59
|
+
onChange(newSearch);
|
|
60
|
+
let newCursorPos = newPos;
|
|
60
61
|
if (hint.includes("[") || hint.includes("(") || hint.includes("/")) {
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
setCursorPos(newPos);
|
|
62
|
+
newCursorPos--;
|
|
65
63
|
}
|
|
64
|
+
setCursorPos(newCursorPos);
|
|
65
|
+
if (newCursorPos &&
|
|
66
|
+
getHints(newSearch, newCursorPos, fields, operators) !==
|
|
67
|
+
currentHintOptions)
|
|
68
|
+
setFocusIdx(0);
|
|
66
69
|
};
|
|
67
70
|
const handleKeyUp = (e) => {
|
|
68
71
|
switch (e.code) {
|
|
@@ -77,22 +80,28 @@ const RichFilterTextField = ({ filterExpr, filterExprHist, fields, operators, ad
|
|
|
77
80
|
case "Enter": {
|
|
78
81
|
e.preventDefault();
|
|
79
82
|
if (inputAnchor) {
|
|
80
|
-
const focusedHint = currentHintOptions.entries()
|
|
81
|
-
|
|
83
|
+
const focusedHint = Array.from(currentHintOptions.entries())[focusIdx]?.[0];
|
|
84
|
+
if (focusedHint)
|
|
85
|
+
insertHint(focusedHint);
|
|
82
86
|
}
|
|
83
87
|
else {
|
|
84
|
-
onChange(search
|
|
88
|
+
onChange(search);
|
|
89
|
+
inputRef.current?.blur();
|
|
85
90
|
}
|
|
86
91
|
break;
|
|
87
92
|
}
|
|
88
93
|
case "Escape":
|
|
89
94
|
case "Tab": {
|
|
90
|
-
setInputAnchor(null);
|
|
91
95
|
setCursorPos(null);
|
|
92
96
|
break;
|
|
93
97
|
}
|
|
94
98
|
default: {
|
|
95
|
-
|
|
99
|
+
const newCursorPos = inputRef.current?.selectionStart ?? null;
|
|
100
|
+
setCursorPos(newCursorPos);
|
|
101
|
+
if (newCursorPos &&
|
|
102
|
+
getHints(search, newCursorPos, fields, operators) !==
|
|
103
|
+
currentHintOptions)
|
|
104
|
+
setFocusIdx(0);
|
|
96
105
|
}
|
|
97
106
|
}
|
|
98
107
|
};
|
|
@@ -102,8 +111,12 @@ const RichFilterTextField = ({ filterExpr, filterExprHist, fields, operators, ad
|
|
|
102
111
|
case "ArrowRight":
|
|
103
112
|
case "Space":
|
|
104
113
|
case "Backspace": {
|
|
105
|
-
|
|
106
|
-
setCursorPos(
|
|
114
|
+
const newCursorPos = inputRef.current?.selectionStart ?? null;
|
|
115
|
+
setCursorPos(newCursorPos);
|
|
116
|
+
if (newCursorPos &&
|
|
117
|
+
getHints(search, newCursorPos, fields, operators) !==
|
|
118
|
+
currentHintOptions)
|
|
119
|
+
setFocusIdx(0);
|
|
107
120
|
return;
|
|
108
121
|
}
|
|
109
122
|
case "ArrowDown": {
|
|
@@ -136,50 +149,56 @@ const RichFilterTextField = ({ filterExpr, filterExprHist, fields, operators, ad
|
|
|
136
149
|
}
|
|
137
150
|
case "Escape":
|
|
138
151
|
case "Tab": {
|
|
139
|
-
setInputAnchor(null);
|
|
140
152
|
setCursorPos(null);
|
|
153
|
+
setFocusIdx(0);
|
|
141
154
|
break;
|
|
142
155
|
}
|
|
143
156
|
default: {
|
|
144
|
-
|
|
157
|
+
const newCursorPos = inputRef.current?.selectionStart ?? null;
|
|
158
|
+
setCursorPos(newCursorPos);
|
|
159
|
+
if (newCursorPos &&
|
|
160
|
+
getHints(search, newCursorPos, fields, operators) !==
|
|
161
|
+
currentHintOptions)
|
|
162
|
+
setFocusIdx(0);
|
|
145
163
|
}
|
|
146
164
|
}
|
|
147
165
|
};
|
|
148
|
-
return (
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
166
|
+
return (_jsxs(_Fragment, { children: [_jsx(TextField, { ref: textFieldRef, inputRef: inputRef, fullWidth: true, size: "small", value: search, title: search, multiline: true, maxRows: 1, onChange: (e) => {
|
|
167
|
+
(instant ? handleChange : setSearch)(e.target.value);
|
|
168
|
+
const newCursorPos = inputRef.current?.selectionStart ?? null;
|
|
169
|
+
setCursorPos(newCursorPos);
|
|
170
|
+
if (newCursorPos &&
|
|
171
|
+
getHints(e.target.value, newCursorPos, fields, operators) !==
|
|
172
|
+
currentHintOptions)
|
|
173
|
+
setFocusIdx(0);
|
|
174
|
+
}, onKeyUp: handleKeyUp, onKeyDown: handleKeyDown, slotProps: {
|
|
175
|
+
htmlInput: {
|
|
176
|
+
onClick: (e) => {
|
|
177
|
+
if (Object(e).target !== Object(e).currentTarget)
|
|
178
|
+
return;
|
|
179
|
+
const newCursorPos = inputRef.current?.selectionStart ?? null;
|
|
180
|
+
setCursorPos(newCursorPos);
|
|
181
|
+
if (newCursorPos &&
|
|
182
|
+
getHints(search, newCursorPos, fields, operators) !==
|
|
183
|
+
currentHintOptions)
|
|
184
|
+
setFocusIdx(0);
|
|
185
|
+
},
|
|
160
186
|
},
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
187
|
+
input: {
|
|
188
|
+
startAdornment: (_jsx(InputAdornment, { position: "start", children: _jsxs(Stack, { direction: "row", sx: { alignItems: "center" }, children: [!instant && (_jsx(IconButton, { onClick: (e) => {
|
|
189
|
+
onChange(search);
|
|
190
|
+
e.stopPropagation();
|
|
191
|
+
}, title: "\u041F\u043E\u0438\u0441\u043A", children: _jsx(SearchRoundedIcon, {}) })), _jsx(FilterHistoryMenu, { searchHist: searchHist, onChange: onSelectFromHistory || handleChange, onCopy: () => enqueueSnackbar("Предустановка фильтра скопирована в буфер обмена", "default") }), additionalComponents] }) })),
|
|
192
|
+
endAdornment: (_jsx(InputAdornment, { position: "end", children: _jsx(IconButton, { title: "\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C \u0444\u0438\u043B\u044C\u0442\u0440\u044B", disabled: !search, onClick: (e) => {
|
|
193
|
+
handleChange("");
|
|
194
|
+
setCursorPos(null);
|
|
195
|
+
setFocusIdx(0);
|
|
167
196
|
e.stopPropagation();
|
|
168
|
-
},
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
handleChange("");
|
|
175
|
-
e.stopPropagation();
|
|
176
|
-
} },
|
|
177
|
-
React.createElement(ClearIcon, null)))),
|
|
178
|
-
},
|
|
179
|
-
} }),
|
|
180
|
-
React.createElement(HintOptionsMenu, { inputAnchor: inputAnchor, inputRef: inputRef, textFieldRef: textFieldRef, options: currentHintOptions, focusIdx: focusIdx, onSelectHint: insertHint, onClose: () => {
|
|
181
|
-
setInputAnchor(null);
|
|
182
|
-
setCursorPos(null);
|
|
183
|
-
} })));
|
|
197
|
+
}, children: _jsx(ClearIcon, {}) }) })),
|
|
198
|
+
},
|
|
199
|
+
} }), _jsx(HintOptionsMenu, { inputAnchor: inputAnchor, inputRef: inputRef, textFieldRef: textFieldRef, options: currentHintOptions, focusIdx: focusIdx, onSelectHint: insertHint, onClose: () => {
|
|
200
|
+
setCursorPos(null);
|
|
201
|
+
setFocusIdx(0);
|
|
202
|
+
} })] }));
|
|
184
203
|
};
|
|
185
204
|
export default RichFilterTextField;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { default } from "./RichFilterTextField";
|
|
2
1
|
export * from "./RichFilterTextField";
|
|
3
|
-
export { default
|
|
2
|
+
export { default } from "./RichFilterTextField";
|
|
4
3
|
export * from "./RichFilterTextFieldProps";
|
|
4
|
+
export { type default as RichFilterTextFieldProps } from "./RichFilterTextFieldProps";
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/RichFilterTextField/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/RichFilterTextField/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhD,cAAc,4BAA4B,CAAC;AAC3C,OAAO,EAAE,KAAK,OAAO,IAAI,wBAAwB,EAAE,MAAM,4BAA4B,CAAC"}
|