@danikokonn/yarik-frontend-lib 2.0.3-3.legacy.test9 → 2.0.4-9.test4

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.
Files changed (107) hide show
  1. package/dist/components/ActionDialog/ActionDialog.d.ts +19 -0
  2. package/dist/components/ActionDialog/ActionDialog.d.ts.map +1 -1
  3. package/dist/components/ActionDialog/ActionDialog.js +19 -0
  4. package/dist/components/ActionDialog/ActionDialogProps.d.ts +15 -0
  5. package/dist/components/ActionDialog/ActionDialogProps.d.ts.map +1 -1
  6. package/dist/components/ColumnSearchInput/ColumnSearchInput.d.ts +12 -0
  7. package/dist/components/ColumnSearchInput/ColumnSearchInput.d.ts.map +1 -1
  8. package/dist/components/ColumnSearchInput/ColumnSearchInput.js +12 -0
  9. package/dist/components/ColumnSearchInput/ColumnSearchInputProps.d.ts +9 -0
  10. package/dist/components/ColumnSearchInput/ColumnSearchInputProps.d.ts.map +1 -1
  11. package/dist/components/DateTimeRangePicker/DateTimeRangePicker.d.ts +1 -1
  12. package/dist/components/DateTimeRangePicker/DateTimeRangePicker.d.ts.map +1 -1
  13. package/dist/components/DateTimeRangePicker/DateTimeRangePicker.js +3 -3
  14. package/dist/components/DateTimeRangePicker/DateTimeRangePickerProps.d.ts +1 -0
  15. package/dist/components/DateTimeRangePicker/DateTimeRangePickerProps.d.ts.map +1 -1
  16. package/dist/components/DatetimeRangeInput/DatetimeRangeInput.d.ts +21 -2
  17. package/dist/components/DatetimeRangeInput/DatetimeRangeInput.d.ts.map +1 -1
  18. package/dist/components/DatetimeRangeInput/DatetimeRangeInput.js +22 -3
  19. package/dist/components/DatetimeRangeInput/DatetimeRangeInputProps.d.ts +30 -0
  20. package/dist/components/DatetimeRangeInput/DatetimeRangeInputProps.d.ts.map +1 -1
  21. package/dist/components/Footer/Footer.d.ts.map +1 -1
  22. package/dist/components/Footer/Footer.js +2 -2
  23. package/dist/components/IpAddressSwitchableInput/IpAddressSwitchableInput.d.ts.map +1 -1
  24. package/dist/components/IpAddressSwitchableInput/IpAddressSwitchableInput.js +1 -1
  25. package/dist/components/Navigation/NavMenu.d.ts +3 -2
  26. package/dist/components/Navigation/NavMenu.d.ts.map +1 -1
  27. package/dist/components/Navigation/NavMenu.js +4 -3
  28. package/dist/components/Navigation/Navigation.d.ts +1 -1
  29. package/dist/components/Navigation/Navigation.d.ts.map +1 -1
  30. package/dist/components/Navigation/Navigation.js +15 -12
  31. package/dist/components/Navigation/NavigationProps.d.ts +2 -1
  32. package/dist/components/Navigation/NavigationProps.d.ts.map +1 -1
  33. package/dist/components/PageWrapper/PageWrapper.d.ts.map +1 -1
  34. package/dist/components/PageWrapper/PageWrapper.js +4 -3
  35. package/dist/components/RichFilterTextField/RichFilterTextField.d.ts +1 -1
  36. package/dist/components/RichFilterTextField/RichFilterTextField.d.ts.map +1 -1
  37. package/dist/components/RichFilterTextField/RichFilterTextField.js +104 -88
  38. package/dist/components/RichFilterTextField/RichFilterTextFieldProps.d.ts +4 -0
  39. package/dist/components/RichFilterTextField/RichFilterTextFieldProps.d.ts.map +1 -1
  40. package/dist/components/RichFilterTextField/utils.d.ts.map +1 -1
  41. package/dist/components/RichFilterTextField/utils.js +2 -2
  42. package/dist/components/SmartTable/RowContent.d.ts +22 -6
  43. package/dist/components/SmartTable/RowContent.d.ts.map +1 -1
  44. package/dist/components/SmartTable/RowContent.js +45 -29
  45. package/dist/components/SmartTable/SmartTable.d.ts +9 -1
  46. package/dist/components/SmartTable/SmartTable.d.ts.map +1 -1
  47. package/dist/components/SmartTable/SmartTable.js +117 -38
  48. package/dist/components/SmartTable/SmartTableProps.d.ts +21 -9
  49. package/dist/components/SmartTable/SmartTableProps.d.ts.map +1 -1
  50. package/dist/components/SmartTable/TableHeader.d.ts.map +1 -1
  51. package/dist/components/SmartTable/TableHeader.js +3 -2
  52. package/dist/components/SortBtn/SortBtn.d.ts.map +1 -1
  53. package/dist/components/SortBtn/SortBtn.js +2 -1
  54. package/dist/components/SubtaskItem/SubtaskItem.d.ts.map +1 -1
  55. package/dist/components/SubtaskItem/SubtaskItem.js +31 -11
  56. package/dist/components/TaskLoader/TaskLoader.d.ts +1 -1
  57. package/dist/components/TaskLoader/TaskLoader.d.ts.map +1 -1
  58. package/dist/components/TaskLoader/TaskLoader.js +24 -13
  59. package/dist/components/TaskLoader/TaskLoaderProps.d.ts +1 -0
  60. package/dist/components/TaskLoader/TaskLoaderProps.d.ts.map +1 -1
  61. package/dist/components/TaskStateDialog/TaskStateDialog.d.ts +1 -1
  62. package/dist/components/TaskStateDialog/TaskStateDialog.d.ts.map +1 -1
  63. package/dist/components/TaskStateDialog/TaskStateDialog.js +8 -5
  64. package/dist/components/TaskStateDialog/TaskStateDialogProps.d.ts +2 -1
  65. package/dist/components/TaskStateDialog/TaskStateDialogProps.d.ts.map +1 -1
  66. package/dist/components/icons/GenerateAndRunIcon.d.ts +1 -1
  67. package/dist/components/icons/GenerateAndRunIcon.d.ts.map +1 -1
  68. package/dist/components/icons/GenerateAndRunIcon.js +5 -2
  69. package/dist/components/icons/GenerateIcon.d.ts +1 -1
  70. package/dist/components/icons/GenerateIcon.d.ts.map +1 -1
  71. package/dist/components/icons/GenerateIcon.js +5 -2
  72. package/dist/components/icons/IntegerIcon.d.ts +1 -1
  73. package/dist/components/icons/IntegerIcon.d.ts.map +1 -1
  74. package/dist/components/icons/IntegerIcon.js +5 -2
  75. package/dist/components/icons/QueueIcon.d.ts +1 -1
  76. package/dist/components/icons/QueueIcon.d.ts.map +1 -1
  77. package/dist/components/icons/QueueIcon.js +5 -2
  78. package/dist/components/icons/RangeIcon.d.ts +1 -1
  79. package/dist/components/icons/RangeIcon.d.ts.map +1 -1
  80. package/dist/components/icons/RangeIcon.js +5 -2
  81. package/dist/components/icons/RunIcon.d.ts +1 -1
  82. package/dist/components/icons/RunIcon.d.ts.map +1 -1
  83. package/dist/components/icons/RunIcon.js +5 -2
  84. package/dist/http.d.ts +2 -2
  85. package/dist/http.d.ts.map +1 -1
  86. package/dist/http.js +4 -29
  87. package/dist/providers/AirflowProvider.d.ts +5 -4
  88. package/dist/providers/AirflowProvider.d.ts.map +1 -1
  89. package/dist/providers/AirflowProvider.js +41 -55
  90. package/dist/providers/DagStateProvider.d.ts +6 -5
  91. package/dist/providers/DagStateProvider.d.ts.map +1 -1
  92. package/dist/providers/DagStateProvider.js +35 -10
  93. package/dist/providers/SessionProvider.d.ts +3 -1
  94. package/dist/providers/SessionProvider.d.ts.map +1 -1
  95. package/dist/providers/SessionProvider.js +10 -4
  96. package/dist/providers/SnackBarProvider.d.ts +2 -2
  97. package/dist/providers/SnackBarProvider.d.ts.map +1 -1
  98. package/dist/providers/SnackBarProvider.js +1 -1
  99. package/dist/types.d.ts +17 -4
  100. package/dist/types.d.ts.map +1 -1
  101. package/dist/utils.d.ts +3 -3
  102. package/dist/utils.d.ts.map +1 -1
  103. package/dist/utils.js +3 -2
  104. package/package.json +27 -19
  105. package/dist/components/SmartTable/RuleRow.d.ts +0 -22
  106. package/dist/components/SmartTable/RuleRow.d.ts.map +0 -1
  107. package/dist/components/SmartTable/RuleRow.js +0 -40
@@ -1,4 +1,4 @@
1
- import React, { lazy, Suspense } from "react";
1
+ import { CircularProgress, Stack, Typography, useTheme } from "@mui/material";
2
2
  import FormControl from "@mui/material/FormControl";
3
3
  import InputLabel from "@mui/material/InputLabel";
4
4
  import MenuItem from "@mui/material/MenuItem";
@@ -8,15 +8,49 @@ import Select from "@mui/material/Select";
8
8
  import Table from "@mui/material/Table";
9
9
  import TableBody from "@mui/material/TableBody";
10
10
  import TableCell from "@mui/material/TableCell";
11
+ import TableContainer from "@mui/material/TableContainer";
11
12
  import TableFooter from "@mui/material/TableFooter";
12
- import TableHead from "@mui/material/TableHead";
13
13
  import TableRow from "@mui/material/TableRow";
14
- import TableContainer from "@mui/material/TableContainer";
15
- import { useTheme, Stack, CircularProgress } from "@mui/material";
16
- import SortBtn from "../SortBtn/SortBtn";
14
+ import React, { Fragment, Suspense, useCallback, useMemo } from "react";
15
+ import { TableVirtuoso } from "react-virtuoso";
17
16
  import ColumnSearchInput from "../ColumnSearchInput/ColumnSearchInput";
18
- const RuleRow = lazy(() => import("./RuleRow"));
19
- export default function SmartTable({ rows, columns, pageN, numPages, perPage, loading, minWidth, width, rowStyles, selectable, selectedRow, sx, disablePerPageSelector, globalSearch, columnAutoWidth, globalSearchComponent, ContentWrapper, onRowDoubleClick, onSelectRow, controlComponent: ControlComponent, onToggleSort, onInputSearch, onPageSelect, onChangePerPage, controlComponentColSx, }) {
17
+ import SortBtn from "../SortBtn/SortBtn";
18
+ import RowContent from "./RowContent";
19
+ import TableHeader from "./TableHeader";
20
+ // eslint-disable-next-line react/display-name
21
+ const Scroller = React.forwardRef((props, ref) => (React.createElement(TableContainer, { component: Paper, ...props, ref: ref, sx: {
22
+ minWidth: Object(props).context.minWidth || "100%",
23
+ flexGrow: 1,
24
+ overflowX: "auto",
25
+ } },
26
+ Object(props).children,
27
+ Object(props).context.placeholder)));
28
+ const TableHead =
29
+ // eslint-disable-next-line react/display-name
30
+ React.forwardRef((props, ref) => (React.createElement(TableHeader, { ...props, ref: ref })));
31
+ const TableBodyWrapper =
32
+ // eslint-disable-next-line react/display-name
33
+ React.forwardRef((props, ref) => (React.createElement(TableBody, { ...props, ref: ref })));
34
+ const Row = (props) => {
35
+ const ContentWrapper = Object(props).context.ContentWrapper;
36
+ const selectedRow = Object(props).context.selectedRow;
37
+ const rowStyles = Object(props).context.rowStyles;
38
+ const selectable = Object(props).context.selectable;
39
+ return ContentWrapper ? (React.createElement(ContentWrapper, { rowProps: {
40
+ selected: Object(props).item.id === selectedRow,
41
+ ...props,
42
+ }, ...props })) : (React.createElement(TableRow, { hover: true, sx: {
43
+ height: "3rem",
44
+ overflowY: "hidden",
45
+ ...rowStyles,
46
+ cursor: selectable ? "pointer" : "default",
47
+ }, selected: Object(props).item.id === selectedRow, ...props }));
48
+ };
49
+ const TableWrapper = (props) => (React.createElement(Table, { ...props, stickyHeader: true, sx: {
50
+ ...Object(props).context.tableStyle,
51
+ minWidth: Object(props).context.minWidth || "100%",
52
+ } }));
53
+ export default function SmartTable({ rows, columns, pageN, numPages, perPage, loading, minWidth, width, rowStyles, selectable, selectedRow, sx, disablePerPageSelector, globalSearch, columnAutoWidth, error, globalSearchComponent, ContentWrapper, ControlComponent, ControlComponentProps, virtuosoRef, controlComponentColSx, perPageOptions, onToggleSort, onInputSearch, onPageSelect, onChangePerPage, onSelectRow, onRowDoubleClick, }) {
20
54
  const theme = useTheme();
21
55
  const tableStyle = {
22
56
  width: columnAutoWidth ? "auto" : "100%",
@@ -24,14 +58,14 @@ export default function SmartTable({ rows, columns, pageN, numPages, perPage, lo
24
58
  borderCollapse: "separate",
25
59
  borderSpacing: 0,
26
60
  };
27
- function handleSelectRow(rowId) {
61
+ const handleSelectRow = (rowId) => {
28
62
  if (selectable && onSelectRow) {
29
63
  onSelectRow(rowId);
30
64
  }
31
- }
65
+ };
32
66
  const hasSearchableColumns = columns.some((col) => col.searchable);
33
67
  const hasGlobalSearch = globalSearch && globalSearchComponent;
34
- const searchCols = () => columns.map((col, idx) => (React.createElement(TableCell, { key: idx, scope: "col", sx: { ...col.colSx } }, col.searchable ? ((col.searchComponent && col.searchComponent()) || (React.createElement(ColumnSearchInput, { field: col.fieldName, searchStr: col.searchStr, onInputSearch: onInputSearch }))) : (React.createElement(React.Fragment, null)))));
68
+ const searchCols = () => columns.map((col, idx) => (React.createElement(TableCell, { key: idx, scope: "col", sx: { ...col.colSx } }, col.searchable ? ((col.SearchComponent && (React.createElement(col.SearchComponent, { ...col.SearchComponentProps }))) || (React.createElement(ColumnSearchInput, { field: col.fieldName, searchStr: col.searchStr, onInputSearch: onInputSearch }))) : (React.createElement(React.Fragment, null)))));
35
69
  const headerTitleRow = (React.createElement(TableRow, { key: 0 },
36
70
  columns.map((col, idx) => (React.createElement(TableCell, { key: idx, scope: "col", sx: {
37
71
  resize: col.resizable ? "horizontal" : "none",
@@ -39,16 +73,65 @@ export default function SmartTable({ rows, columns, pageN, numPages, perPage, lo
39
73
  ...col.colSx,
40
74
  } }, col.sortable ? (React.createElement(SortBtn, { field: col.fieldName, order: col.order || "none", onToggleSort: onToggleSort }, col.displayName)) : (col.displayName)))),
41
75
  ControlComponent && (React.createElement(TableCell, { sx: { ...controlComponentColSx }, scope: "col" }))));
42
- const headerSearchRow = (React.createElement(TableRow, { key: 1 }, globalSearch && globalSearchComponent ? (React.createElement(TableCell, { scope: "col", colSpan: columns.length + 1 }, globalSearchComponent())) : (React.createElement(React.Fragment, null,
76
+ const headerSearchRow = (React.createElement(TableRow, { key: 1 }, globalSearch && globalSearchComponent ? (React.createElement(TableCell, { scope: "col", colSpan: columns.length + 1 }, globalSearchComponent)) : (React.createElement(React.Fragment, null,
43
77
  hasSearchableColumns ? searchCols() : React.createElement(React.Fragment, null),
44
78
  ControlComponent && (React.createElement(TableCell, { sx: { ...controlComponentColSx }, scope: "col" }))))));
45
- const tableHeader = (rows) => (React.createElement(TableHead, { sx: {
46
- top: "0",
47
- zIndex: 600,
48
- position: "sticky",
49
- backgroundColor: theme.palette.background.default,
50
- } }, rows));
79
+ const centerStyle = {
80
+ position: "absolute",
81
+ left: "50%",
82
+ top: "50%",
83
+ transform: "translate(-50%, -50%)",
84
+ };
51
85
  const headerRows = [headerTitleRow, headerSearchRow];
86
+ const placeholder = useMemo(() => {
87
+ if (error && rows.length === 0) {
88
+ return (React.createElement(Typography, { variant: "h6", color: "textSecondary", sx: centerStyle }, "\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C \u0434\u0430\u043D\u043D\u044B\u0435"));
89
+ }
90
+ if (loading) {
91
+ return React.createElement(CircularProgress, { sx: centerStyle });
92
+ }
93
+ if (rows.length === 0) {
94
+ return (React.createElement(Typography, { variant: "h6", color: "textSecondary", sx: centerStyle }, "\u041D\u0438\u0447\u0435\u0433\u043E \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u043E"));
95
+ }
96
+ return React.createElement(React.Fragment, null);
97
+ }, [error, loading, rows.length]);
98
+ const fixedHeaderContent = useCallback(() => React.createElement(Fragment, null, hasGlobalSearch ? headerRows[0] : headerRows), [hasGlobalSearch, headerRows]);
99
+ const tableContext = useMemo(() => ({
100
+ columns,
101
+ minWidth,
102
+ rowStyles,
103
+ selectable,
104
+ tableStyle,
105
+ placeholder,
106
+ selectedRow,
107
+ ContentWrapper,
108
+ ControlComponent,
109
+ ControlComponentProps,
110
+ onRowDoubleClick,
111
+ handleSelectRow,
112
+ }), [
113
+ columns,
114
+ minWidth,
115
+ rowStyles,
116
+ selectable,
117
+ tableStyle,
118
+ placeholder,
119
+ selectedRow,
120
+ ContentWrapper,
121
+ ControlComponent,
122
+ ControlComponentProps,
123
+ onRowDoubleClick,
124
+ handleSelectRow,
125
+ ]);
126
+ const VirtuosoTableComponents = {
127
+ Scroller: Scroller,
128
+ Table: TableWrapper,
129
+ TableRow: Row,
130
+ TableHead: TableHead,
131
+ TableBody: TableBodyWrapper,
132
+ // ScrollSeekPlaceholder: ScrollSeekPlaceholder,
133
+ };
134
+ const itemContent = (_index, row, context) => (React.createElement(RowContent, { key: row.id, row: row, columns: context.columns, ControlComponent: context.ControlComponent, ControlComponentProps: context.ControlComponentProps, onDoubleClick: context.onRowDoubleClick, onSelectRow: context.selectable ? context.handleSelectRow : () => { } }));
52
135
  return (React.createElement(Paper, { sx: {
53
136
  height: "74vh",
54
137
  position: "relative",
@@ -63,24 +146,27 @@ export default function SmartTable({ rows, columns, pageN, numPages, perPage, lo
63
146
  overflowX: "auto",
64
147
  width: "100%",
65
148
  } },
66
- hasGlobalSearch && (React.createElement(Table, { size: "small", className: "rulesTable", stickyHeader: true, sx: { ...tableStyle, minWidth: minWidth || "100%", height: "auto" } }, tableHeader(headerRows[1]))),
67
- React.createElement(TableContainer, { sx: { minWidth: minWidth || "100%", flexGrow: 1, overflowX: "unset" } },
68
- React.createElement(Suspense, { fallback: React.createElement(CircularProgress, { sx: { position: "absolute", left: "50%", top: "50%" } }) },
69
- React.createElement(Table, { sx: { ...tableStyle, minWidth: minWidth || "100%" }, stickyHeader: true },
70
- tableHeader(hasGlobalSearch ? headerRows[0] : headerRows),
71
- React.createElement(TableBody, null, rows.map((row, idx) => {
72
- return (React.createElement(RuleRow, { ContentWrapper: ContentWrapper, key: idx, row: row, columns: columns, controlComponent: ControlComponent, onDoubleClick: onRowDoubleClick, sx: {
73
- ...rowStyles,
74
- cursor: selectable ? "pointer" : "default",
75
- }, selectedRow: selectedRow, onSelectRow: selectable ? handleSelectRow : () => { } }));
76
- })))),
77
- loading ? (React.createElement(CircularProgress, { sx: { position: "absolute", left: "50%", top: "50%" } })) : (React.createElement(React.Fragment, null)))),
149
+ hasGlobalSearch && (React.createElement(Table, { size: "small", className: "rulesTable", stickyHeader: true, sx: { ...tableStyle, minWidth: minWidth || "100%", height: "auto" } },
150
+ React.createElement(TableHeader, null, headerRows[1]))),
151
+ React.createElement(Suspense, { fallback: React.createElement(CircularProgress, { sx: { position: "absolute", left: "50%", top: "50%" } }) },
152
+ React.createElement(TableVirtuoso, { ref: virtuosoRef, style: { height: "100%" }, totalCount: rows.length, data: rows, components: VirtuosoTableComponents, fixedHeaderContent: fixedHeaderContent, itemContent: itemContent, context: tableContext,
153
+ // scrollSeekConfiguration={{
154
+ // // Enter placeholder mode only on truly fast scroll (>150px/frame, ~keyboard=100-120)
155
+ // // This filters out slow mouse drags
156
+ // enter: (velocity) => Math.abs(velocity) > 150,
157
+ // // Exit when user clearly stops (velocity drops below 30)
158
+ // exit: (velocity) => Math.abs(velocity) < 30,
159
+ // }}
160
+ // Render only 150px above/below viewport instead of 800px
161
+ // This dramatically improves keyboard scroll performance
162
+ increaseViewportBy: { top: 200, bottom: 200 } }))),
78
163
  React.createElement(Table, { sx: { ...tableStyle, height: "auto", minWidth: minWidth || "100%" } },
79
164
  React.createElement(TableFooter, { sx: {
80
165
  bottom: "0%",
81
166
  zIndex: 600,
82
167
  position: "sticky",
83
- backgroundColor: theme.palette.background.default,
168
+ backgroundColor: theme.vars?.palette.background.default ||
169
+ theme.palette.background.default,
84
170
  } },
85
171
  React.createElement(TableRow, null,
86
172
  React.createElement(TableCell, { colSpan: 11 },
@@ -98,12 +184,5 @@ export default function SmartTable({ rows, columns, pageN, numPages, perPage, lo
98
184
  disablePerPageSelector ? (React.createElement(React.Fragment, null)) : (React.createElement(FormControl, { size: "small" },
99
185
  React.createElement(InputLabel, { id: "perPageInputLabel" }, "\u0421\u0442\u0440\u043E\u043A"),
100
186
  React.createElement(Select, { label: "\u0421\u0442\u0440\u043E\u043A", labelId: "perPageInputLabel", value: String(perPage), autoWidth: true, onChange: (e) => onChangePerPage &&
101
- onChangePerPage(Number(e.target.value)), sx: { minWidth: "2rem" } },
102
- React.createElement(MenuItem, { value: 5 }, "5"),
103
- React.createElement(MenuItem, { value: 10 }, "10"),
104
- React.createElement(MenuItem, { value: 15 }, "15"),
105
- React.createElement(MenuItem, { value: 20 }, "20"),
106
- React.createElement(MenuItem, { value: 25 }, "25"),
107
- React.createElement(MenuItem, { value: 50 }, "50"),
108
- React.createElement(MenuItem, { value: 100 }, "100")))))))))));
187
+ onChangePerPage(Number(e.target.value)), sx: { minWidth: "2rem" } }, (perPageOptions || [5, 10, 15, 20, 25, 50, 100]).map((v, idx) => (React.createElement(MenuItem, { key: idx, value: v }, v)))))))))))));
109
188
  }
@@ -1,7 +1,16 @@
1
- import { ReactNode } from "react";
2
- import { Column } from "../../types";
3
1
  import { SxProps, TableRowProps, Theme } from "@mui/material";
4
- export default interface SmartTableProps<T> {
2
+ import { ComponentType, ReactElement, ReactNode } from "react";
3
+ import { TableVirtuosoHandle } from "react-virtuoso";
4
+ import { Column } from "../../types";
5
+ export default interface SmartTableProps<T extends {
6
+ id: string | number;
7
+ } = {
8
+ id: string | number;
9
+ }, P extends {
10
+ row: T;
11
+ } = {
12
+ row: T;
13
+ }> {
5
14
  rows: T[];
6
15
  columns: Column<T>[];
7
16
  pageN: number;
@@ -17,14 +26,18 @@ export default interface SmartTableProps<T> {
17
26
  sx?: SxProps<Theme>;
18
27
  disablePerPageSelector?: boolean;
19
28
  globalSearch?: boolean;
20
- globalSearchComponent?(): ReactNode;
21
- ContentWrapper?({ children, dagId, rowProps, }: {
29
+ globalSearchComponent?: ReactElement;
30
+ error?: boolean;
31
+ perPageOptions?: number[];
32
+ ContentWrapper?: ComponentType<{
22
33
  children?: ReactNode;
23
- dagId: string;
24
34
  rowProps: TableRowProps;
25
- }): React.JSX.Element;
35
+ }>;
36
+ ControlComponent?: ComponentType<P>;
37
+ ControlComponentProps?: Omit<P, "row">;
38
+ controlComponentColSx?: SxProps<Theme>;
39
+ virtuosoRef?: React.Ref<TableVirtuosoHandle> | undefined;
26
40
  onSelectRow?(rowId: string): void;
27
- controlComponent?(row: T): ReactNode;
28
41
  onRowDoubleClick?(rowId: string | null): void;
29
42
  onToggleSort(field: string, order: "asc" | "desc" | "none"): void;
30
43
  onInputSearch(options: {
@@ -33,6 +46,5 @@ export default interface SmartTableProps<T> {
33
46
  }[]): void;
34
47
  onPageSelect(pageN: number): void;
35
48
  onChangePerPage?(perPage: number): void;
36
- controlComponentColSx?: SxProps<Theme>;
37
49
  }
38
50
  //# sourceMappingURL=SmartTableProps.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SmartTableProps.d.ts","sourceRoot":"","sources":["../../../src/components/SmartTable/SmartTableProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE9D,MAAM,CAAC,OAAO,WAAW,eAAe,CAAC,CAAC;IACxC,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;IACrB,KAA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kB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAGpE,QAAA,MAAM,WAAW,GAAI,mBAAmB,cAAc,sBAerD,CAAC;AAEF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"TableHeader.d.ts","sourceRoot":"","sources":["../../../src/components/SmartTable/TableHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAkB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEpE,QAAA,MAAM,WAAW,GAAI,mBAAmB,cAAc,sBAiBrD,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -1,13 +1,14 @@
1
1
  import React from "react";
2
- import TableHead from "@mui/material/TableHead";
3
2
  import { useTheme } from "@mui/material";
3
+ import TableHead from "@mui/material/TableHead";
4
4
  const TableHeader = ({ ref, ...props }) => {
5
5
  const theme = useTheme();
6
6
  return (React.createElement(TableHead, { sx: {
7
7
  top: "0",
8
8
  zIndex: 600,
9
9
  position: "sticky",
10
- backgroundColor: theme.palette.background.default,
10
+ backgroundColor: theme.vars?.palette.background.default ||
11
+ theme.palette.background.default,
11
12
  }, ...props, ref: ref }));
12
13
  };
13
14
  export default TableHeader;
@@ -1 +1 @@
1
- {"version":3,"file":"SortBtn.d.ts","sourceRoot":"","sources":["../../../src/components/SortBtn/SortBtn.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAG1C,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,EAC9B,QAAQ,EACR,KAAK,EACL,KAAK,EAAE,MAAM,EACb,YAAY,GACb,EAAE,YAAY,qBA4Bd"}
1
+ {"version":3,"file":"SortBtn.d.ts","sourceRoot":"","sources":["../../../src/components/SortBtn/SortBtn.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AACnD,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAG1C,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,EAC9B,QAAQ,EACR,KAAK,EACL,KAAK,EAAE,MAAM,EACb,YAAY,GACb,EAAE,YAAY,qBAgCd"}
@@ -1,7 +1,8 @@
1
- import React, { useState } from "react";
1
+ import React, { useEffect, useState } from "react";
2
2
  import { TableSortLabel } from "@mui/material";
3
3
  export default function SortBtn({ children, field, order: _order, onToggleSort, }) {
4
4
  const [order, setOrder] = useState(_order || "none");
5
+ useEffect(() => setOrder(_order), [_order]);
5
6
  function handleToggleSort() {
6
7
  let newOrder;
7
8
  switch (order) {
@@ -1 +1 @@
1
- {"version":3,"file":"SubtaskItem.d.ts","sourceRoot":"","sources":["../../../src/components/SubtaskItem/SubtaskItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAe1B,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAElD,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,YAAY,EACZ,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,uBAAuB,GACxB,EAAE,gBAAgB,qBA0HlB"}
1
+ {"version":3,"file":"SubtaskItem.d.ts","sourceRoot":"","sources":["../../../src/components/SubtaskItem/SubtaskItem.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAElD,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,YAAY,EACZ,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,uBAAuB,GACxB,EAAE,gBAAgB,qBAuJlB"}
@@ -1,8 +1,7 @@
1
- import moment from "moment";
2
- import React from "react";
3
1
  import AccessTimeSharpIcon from "@mui/icons-material/AccessTimeSharp";
4
2
  import BlockSharpIcon from "@mui/icons-material/BlockSharp";
5
3
  import CheckCircleOutlineRoundedIcon from "@mui/icons-material/CheckCircleOutlineRounded";
4
+ import DoneIcon from "@mui/icons-material/Done";
6
5
  import ErrorOutlineSharpIcon from "@mui/icons-material/ErrorOutlineSharp";
7
6
  import ExpandMore from "@mui/icons-material/ExpandMore";
8
7
  import { Chip, useTheme } from "@mui/material";
@@ -10,8 +9,12 @@ import Accordion from "@mui/material/Accordion";
10
9
  import AccordionDetails from "@mui/material/AccordionDetails";
11
10
  import AccordionSummary from "@mui/material/AccordionSummary";
12
11
  import CircularProgress from "@mui/material/CircularProgress";
12
+ import moment from "moment";
13
+ import React, { useState } from "react";
13
14
  import { taskStateText } from "../../utils";
14
15
  export default function SubtaskItem({ taskInstance, logs, expanded, onShowLogs, expandedLogContainerRef, }) {
16
+ const [copyVisible, setCopyVisible] = useState(false);
17
+ const [copyText, setCopyText] = useState("Копировать");
15
18
  const theme = useTheme();
16
19
  const subtaskState = (state) => {
17
20
  switch (state) {
@@ -42,7 +45,20 @@ export default function SubtaskItem({ taskInstance, logs, expanded, onShowLogs,
42
45
  precision: 1,
43
46
  template: "h [ч], m [мин], s [сек]",
44
47
  });
45
- return (React.createElement(Accordion, { disableGutters: true, expanded: expanded, onChange: () => onShowLogs(taskInstance.taskId, taskInstance.tryNumber), disabled: !["running", "success", "failed"].includes(taskInstance.state || "") },
48
+ return (React.createElement(Accordion, { disableGutters: true, expanded: expanded, onChange: () => onShowLogs(taskInstance.taskId, taskInstance.tryNumber), disabled: !["running", "success", "failed"].includes(taskInstance.state || ""), sx: {
49
+ position: "relative",
50
+ }, slotProps: {
51
+ transition: {
52
+ onEntered: () => {
53
+ setCopyVisible(true);
54
+ setCopyText("Копировать");
55
+ },
56
+ onExit: () => {
57
+ setCopyVisible(false);
58
+ setCopyText("Копировать");
59
+ },
60
+ },
61
+ } },
46
62
  React.createElement(AccordionSummary, { expandIcon: React.createElement(ExpandMore, null) },
47
63
  React.createElement("div", { style: { display: "flex", alignItems: "center", gap: "0.5rem" } },
48
64
  subtaskState(taskInstance.state),
@@ -56,6 +72,15 @@ export default function SubtaskItem({ taskInstance, logs, expanded, onShowLogs,
56
72
  " за " +
57
73
  formatTaskDuration
58
74
  : ""))),
75
+ copyVisible && (React.createElement(Chip, { label: copyText, size: "small", variant: "outlined", icon: copyText === "Скопировано" ? (React.createElement(DoneIcon, { color: "success" })) : undefined, onClick: () => {
76
+ navigator.clipboard.writeText(logs);
77
+ setCopyText("Скопировано");
78
+ }, sx: {
79
+ position: "absolute",
80
+ bottom: "8%",
81
+ right: "3%",
82
+ opacity: "0.5",
83
+ } })),
59
84
  React.createElement(AccordionDetails, { ref: expandedLogContainerRef, contentEditable: true, onKeyDown: (e) => {
60
85
  if (e.ctrlKey && e.key.toLowerCase() === "a") {
61
86
  e.preventDefault();
@@ -75,18 +100,13 @@ export default function SubtaskItem({ taskInstance, logs, expanded, onShowLogs,
75
100
  }, suppressContentEditableWarning: true, onBeforeInput: (e) => e.preventDefault(), onPaste: (e) => e.preventDefault(), onDrop: (e) => e.preventDefault(), sx: {
76
101
  maxHeight: "32vh",
77
102
  overflow: "auto",
78
- position: "relative",
79
103
  } },
80
- React.createElement(Chip, { label: "\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C", size: "small", variant: "outlined", onClick: () => { }, sx: {
81
- position: "absolute",
82
- top: "10%",
83
- right: "10%",
84
- opacity: "0.75",
85
- } }),
86
104
  React.createElement("article", { style: {
87
105
  padding: "1.5rem",
88
- backgroundColor: theme.palette.background.paper,
106
+ backgroundColor: theme.vars?.palette.background.paper ||
107
+ theme.palette.background.paper,
89
108
  borderRadius: "0.5rem",
109
+ fontSize: "smaller",
90
110
  fontFamily: "consolas",
91
111
  } }, logs.split("\n").map((line, idx) => (React.createElement("p", { key: idx, style: { margin: 0 } }, line)))))));
92
112
  }
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
2
  import TaskLoaderProps from "./TaskLoaderProps";
3
- export default function TaskLoader({ style, subTitle }: TaskLoaderProps): React.JSX.Element;
3
+ export default function TaskLoader({ style, subTitle, onUnauthorized, }: TaskLoaderProps): React.JSX.Element;
4
4
  //# sourceMappingURL=TaskLoader.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TaskLoader.d.ts","sourceRoot":"","sources":["../../../src/components/TaskLoader/TaskLoader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AA0BxC,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAuBhD,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,eAAe,qBAgZtE"}
1
+ {"version":3,"file":"TaskLoader.d.ts","sourceRoot":"","sources":["../../../src/components/TaskLoader/TaskLoader.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAoBxC,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAmBhD,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EACjC,KAAK,EACL,QAAQ,EACR,cAAc,GACf,EAAE,eAAe,qBA4ZjB"}
@@ -1,20 +1,19 @@
1
- import React, { useState } from "react";
1
+ import AccessTimeSharpIcon from "@mui/icons-material/AccessTimeSharp";
2
+ import BlockSharpIcon from "@mui/icons-material/BlockSharp";
3
+ import CheckCircleOutlineRoundedIcon from "@mui/icons-material/CheckCircleOutlineRounded";
4
+ import ErrorOutlineSharpIcon from "@mui/icons-material/ErrorOutlineSharp";
5
+ import RestartAltIcon from "@mui/icons-material/RestartAlt";
6
+ import StopRoundedIcon from "@mui/icons-material/StopRounded";
7
+ import SyncIcon from "@mui/icons-material/Sync";
2
8
  import CircularProgress from "@mui/material/CircularProgress";
3
9
  import IconButton from "@mui/material/IconButton";
4
10
  import Typography from "@mui/material/Typography";
5
- import SyncIcon from "@mui/icons-material/Sync";
6
- import RestartAltIcon from "@mui/icons-material/RestartAlt";
7
- import StopRoundedIcon from "@mui/icons-material/StopRounded";
8
- import CheckCircleOutlineRoundedIcon from "@mui/icons-material/CheckCircleOutlineRounded";
9
- import ErrorOutlineSharpIcon from "@mui/icons-material/ErrorOutlineSharp";
10
- import AccessTimeSharpIcon from "@mui/icons-material/AccessTimeSharp";
11
- import BlockSharpIcon from "@mui/icons-material/BlockSharp";
12
- import { formatDate, formatDuration, taskStateText, useDebounce, } from "../../utils";
13
- import SubtaskItem from "../SubtaskItem/SubtaskItem";
11
+ import React, { useState } from "react";
14
12
  import { getRequest, postRequest } from "../../http";
15
- import { getCSRFToken } from "../../utils";
16
- import { useDagRunStateContext } from "../../providers/DagStateProvider";
17
13
  import { useAirflowContext } from "../../providers/AirflowProvider";
14
+ import { useDagRunStateContext } from "../../providers/DagStateProvider";
15
+ import { formatDate, formatDuration, getCSRFToken, taskStateText, useDebounce, } from "../../utils";
16
+ import SubtaskItem from "../SubtaskItem/SubtaskItem";
18
17
  import ProcessingIcon from "../icons/ProcessingIcon";
19
18
  const taskStateIcon = (taskState) => {
20
19
  switch (taskState) {
@@ -30,7 +29,7 @@ const taskStateIcon = (taskState) => {
30
29
  return React.createElement(BlockSharpIcon, { fontSize: "large" });
31
30
  }
32
31
  };
33
- export default function TaskLoader({ style, subTitle }) {
32
+ export default function TaskLoader({ style, subTitle, onUnauthorized, }) {
34
33
  const { airflowAvailable, onLostConnection } = useAirflowContext();
35
34
  const { isActive, dagRun, taskInstances, onUpdateState, fetchState } = useDagRunStateContext();
36
35
  const [activeTask, setActiveTask] = React.useState(taskInstances?.taskInstances.find((ti) => {
@@ -116,6 +115,9 @@ export default function TaskLoader({ style, subTitle }) {
116
115
  setLogs(newLogs);
117
116
  },
118
117
  errorHandler: (resp) => {
118
+ if (resp?.status == 401) {
119
+ onUnauthorized();
120
+ }
119
121
  console.log("Error while fetching logs");
120
122
  if (resp && resp.status === 503) {
121
123
  onLostConnection();
@@ -155,6 +157,9 @@ export default function TaskLoader({ style, subTitle }) {
155
157
  setLogs(newLogs);
156
158
  },
157
159
  errorHandler: (resp) => {
160
+ if (resp?.status == 401) {
161
+ onUnauthorized();
162
+ }
158
163
  console.log("Error while getting logs for subtask!");
159
164
  if (resp && resp.status === 503) {
160
165
  onLostConnection();
@@ -183,6 +188,9 @@ export default function TaskLoader({ style, subTitle }) {
183
188
  setLogs([null, null, null]);
184
189
  },
185
190
  errorHandler: (resp) => {
191
+ if (resp?.status == 401) {
192
+ onUnauthorized();
193
+ }
186
194
  console.log("Error restarting task!");
187
195
  if (resp && resp.status === 503) {
188
196
  onLostConnection();
@@ -212,6 +220,9 @@ export default function TaskLoader({ style, subTitle }) {
212
220
  setBlockControls(false);
213
221
  },
214
222
  errorHandler: (resp) => {
223
+ if (resp?.status == 401) {
224
+ onUnauthorized();
225
+ }
215
226
  console.log("Error aborting task!");
216
227
  if (resp && resp.status === 503) {
217
228
  onLostConnection();
@@ -1,5 +1,6 @@
1
1
  export default interface TaskLoaderProps {
2
2
  style?: React.CSSProperties;
3
3
  subTitle: string;
4
+ onUnauthorized(): void;
4
5
  }
5
6
  //# sourceMappingURL=TaskLoaderProps.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TaskLoaderProps.d.ts","sourceRoot":"","sources":["../../../src/components/TaskLoader/TaskLoaderProps.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,WAAW,eAAe;IACtC,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;CAClB"}
1
+ {"version":3,"file":"TaskLoaderProps.d.ts","sourceRoot":"","sources":["../../../src/components/TaskLoader/TaskLoaderProps.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,WAAW,eAAe;IACtC,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,IAAI,IAAI,CAAC;CACxB"}
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
2
  import TaskStateDialogProps from "./TaskStateDialogProps";
3
- export default function TaskStateDialog({ taskTitle, subTitle, appendedTitle, visible, mousePos, disableClosing, additionalControls, disableTransition, onClose, }: TaskStateDialogProps): React.JSX.Element;
3
+ export default function TaskStateDialog({ taskTitle, subTitle, appendedTitle, visible, mousePos, disableClosing, additionalControls, disableTransition, onClose, onUnauthorized, }: TaskStateDialogProps): React.JSX.Element;
4
4
  //# sourceMappingURL=TaskStateDialog.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TaskStateDialog.d.ts","sourceRoot":"","sources":["../../../src/components/TaskStateDialog/TaskStateDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAqB1B,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAa1D,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EACtC,SAAS,EACT,QAAQ,EACR,aAAa,EACb,OAAO,EACP,QAAQ,EACR,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,OAAO,GACR,EAAE,oBAAoB,qBAyLtB"}
1
+ {"version":3,"file":"TaskStateDialog.d.ts","sourceRoot":"","sources":["../../../src/components/TaskStateDialog/TaskStateDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAuB1B,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAW1D,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EACtC,SAAS,EACT,QAAQ,EACR,aAAa,EACb,OAAO,EACP,QAAQ,EACR,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,OAAO,EACP,cAAc,GACf,EAAE,oBAAoB,qBA8LtB"}
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
- import Dialog from "@mui/material/Dialog";
3
2
  import { useTheme } from "@mui/material";
3
+ import Dialog from "@mui/material/Dialog";
4
4
  import Zoom from "@mui/material/Zoom";
5
5
  const AppBar = React.lazy(() => import("@mui/material/AppBar"));
6
6
  const Stack = React.lazy(() => import("@mui/material/Stack"));
@@ -12,12 +12,12 @@ const Badge = React.lazy(() => import("@mui/material/Badge"));
12
12
  const CloseIcon = React.lazy(() => import("@mui/icons-material/Close"));
13
13
  const CircularProgress = React.lazy(() => import("@mui/material/CircularProgress"));
14
14
  const TaskLoader = React.lazy(() => import("../TaskLoader/TaskLoader"));
15
- import { useDagRunStateContext } from "../../providers/DagStateProvider";
16
15
  import { useAirflowContext } from "../../providers/AirflowProvider";
16
+ import { useDagRunStateContext } from "../../providers/DagStateProvider";
17
17
  const Transition = React.forwardRef(function Transition(props, ref) {
18
18
  return React.createElement(Zoom, { ref: ref, ...props });
19
19
  });
20
- export default function TaskStateDialog({ taskTitle, subTitle, appendedTitle, visible, mousePos, disableClosing, additionalControls, disableTransition, onClose, }) {
20
+ export default function TaskStateDialog({ taskTitle, subTitle, appendedTitle, visible, mousePos, disableClosing, additionalControls, disableTransition, onClose, onUnauthorized, }) {
21
21
  const theme = useTheme();
22
22
  const [loading, setLoading] = React.useState(true);
23
23
  const { airflowAvailable } = useAirflowContext();
@@ -52,7 +52,10 @@ export default function TaskStateDialog({ taskTitle, subTitle, appendedTitle, vi
52
52
  transition: disableTransition ? undefined : Transition,
53
53
  }, slotProps: {
54
54
  paper: {
55
- sx: { backgroundColor: theme.palette.background.default },
55
+ sx: {
56
+ backgroundColor: theme.vars?.palette.background.default ||
57
+ theme.palette.background.default,
58
+ },
56
59
  },
57
60
  transition: {
58
61
  sx: {
@@ -90,7 +93,7 @@ export default function TaskStateDialog({ taskTitle, subTitle, appendedTitle, vi
90
93
  justifyContent: "space-between",
91
94
  height: "-webkit-fill-available",
92
95
  } },
93
- React.createElement(TaskLoader, { subTitle: subTitle, style: {
96
+ React.createElement(TaskLoader, { subTitle: subTitle, onUnauthorized: onUnauthorized, style: {
94
97
  margin: "3rem",
95
98
  height: "-webkit-fill-available",
96
99
  } }),
@@ -4,11 +4,12 @@ export default interface TaskStateModalProps extends TaskLoaderProps {
4
4
  taskTitle: string;
5
5
  appendedTitle?: string;
6
6
  visible: boolean;
7
- onClose(): void;
8
7
  mousePos?: string;
9
8
  disableClosing?: boolean;
10
9
  additionalControls?: AdditionalTaskControl[];
11
10
  disableTransition?: boolean;
11
+ onClose(): void;
12
+ onUnauthorized(): void;
12
13
  }
13
14
  export interface AdditionalTaskControl {
14
15
  dagId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"TaskStateDialogProps.d.ts","sourceRoot":"","sources":["../../../src/components/TaskStateDialog/TaskStateDialogProps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,eAAe,MAAM,+BAA+B,CAAC;AAE5D,MAAM,CAAC,OAAO,WAAW,mBAAoB,SAAQ,eAAe;IAClE,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,IAAI,IAAI,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,kBAAkB,CAAC,EAAE,qBAAqB,EAAE,CAAC;IAC7C,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IAC3C,SAAS,CAAC,CACR,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,GACjB,KAAK,CAAC,SAAS,CAAC;CACpB"}
1
+ {"version":3,"file":"TaskStateDialogProps.d.ts","sourceRoot":"","sources":["../../../src/components/TaskStateDialog/TaskStateDialogProps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,eAAe,MAAM,+BAA+B,CAAC;AAE5D,MAAM,CAAC,OAAO,WAAW,mBAAoB,SAAQ,eAAe;IAClE,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,kBAAkB,CAAC,EAAE,qBAAqB,EAAE,CAAC;IAC7C,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,OAAO,IAAI,IAAI,CAAC;IAChB,cAAc,IAAI,IAAI,CAAC;CACxB;AAED,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IAC3C,SAAS,CAAC,CACR,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,GACjB,KAAK,CAAC,SAAS,CAAC;CACpB"}
@@ -1,5 +1,5 @@
1
- import React from "react";
2
1
  import { SvgIconOwnProps } from "@mui/material";
2
+ import React from "react";
3
3
  interface GenerateAndRunIconProps extends SvgIconOwnProps {
4
4
  disabled?: boolean;
5
5
  }
@@ -1 +1 @@
1
- {"version":3,"file":"GenerateAndRunIcon.d.ts","sourceRoot":"","sources":["../../../src/components/icons/GenerateAndRunIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAiB,eAAe,EAAY,MAAM,eAAe,CAAC;AAoHzE,UAAU,uBAAwB,SAAQ,eAAe;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,QAAA,MAAM,kBAAkB,GAAI,wBAGzB,uBAAuB,sBAWzB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"GenerateAndRunIcon.d.ts","sourceRoot":"","sources":["../../../src/components/icons/GenerateAndRunIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,eAAe,EAAY,MAAM,eAAe,CAAC;AACzE,OAAO,KAAK,MAAM,OAAO,CAAC;AAoH1B,UAAU,uBAAwB,SAAQ,eAAe;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,QAAA,MAAM,kBAAkB,GAAI,wBAGzB,uBAAuB,sBAezB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -1,5 +1,5 @@
1
- import React from "react";
2
1
  import { createSvgIcon, useTheme } from "@mui/material";
2
+ import React from "react";
3
3
  const GenerateAndRunSvgIcon = createSvgIcon(React.createElement("svg", { width: "38", height: "38", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 38 38", preserveAspectRatio: "xMidYMid", version: "1.1" },
4
4
  React.createElement("g", { className: "layer", display: "inline" },
5
5
  React.createElement("g", { id: "s", transform: "translate(-0.02 -0.02) matrix(1.63693 0 0 1.63225 -3.38016 7.32488)" },
@@ -24,6 +24,9 @@ const GenerateAndRunSvgIcon = createSvgIcon(React.createElement("svg", { width:
24
24
  // todo: Обобщить, создать хук
25
25
  const GenerateAndRunIcon = ({ disabled, ...props }) => {
26
26
  const theme = useTheme();
27
- return disabled ? (React.createElement(GenerateAndRunSvgIcon, { sx: { "--disabled": theme.palette.action.disabled, ...props.sx }, ...props })) : (React.createElement(GenerateAndRunSvgIcon, { ...props }));
27
+ return disabled ? (React.createElement(GenerateAndRunSvgIcon, { sx: {
28
+ "--disabled": theme.vars?.palette.action.disabled || theme.palette.action.disabled,
29
+ ...props.sx,
30
+ }, ...props })) : (React.createElement(GenerateAndRunSvgIcon, { ...props }));
28
31
  };
29
32
  export default GenerateAndRunIcon;