@monolith-forensics/monolith-ui 1.8.1-dev.4 → 1.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Button/Button.js +58 -9
- package/dist/Calendar/Calendar.d.ts +2 -7
- package/dist/Calendar/Calendar.js +49 -226
- package/dist/Calendar/CalendarStyles.d.ts +2 -6
- package/dist/Calendar/CalendarStyles.js +33 -153
- package/dist/Calendar/calendarHelpers.d.ts +2 -6
- package/dist/Calendar/calendarHelpers.js +5 -13
- package/dist/Charts/BarChart/BarChart.js +28 -14
- package/dist/Charts/BarChart/BarChart.styled.d.ts +7 -2
- package/dist/Charts/BarChart/BarChart.styled.js +5 -1
- package/dist/Charts/BarChart/BarChart.types.d.ts +13 -5
- package/dist/Charts/ChartUtils/chartSizing.d.ts +20 -0
- package/dist/Charts/ChartUtils/chartSizing.js +83 -0
- package/dist/Charts/ChartUtils/index.d.ts +1 -0
- package/dist/Charts/ChartUtils/index.js +1 -0
- package/dist/Charts/HeatMap/HeatMap.js +28 -7
- package/dist/Charts/HeatMap/HeatMap.styled.d.ts +6 -2
- package/dist/Charts/HeatMap/HeatMap.styled.js +3 -0
- package/dist/Charts/HeatMap/HeatMap.types.d.ts +7 -1
- package/dist/Charts/LineChart/LineChart.js +34 -15
- package/dist/Charts/LineChart/LineChart.styled.d.ts +7 -2
- package/dist/Charts/LineChart/LineChart.styled.js +5 -1
- package/dist/Charts/LineChart/LineChart.types.d.ts +13 -5
- package/dist/Charts/PieChart/PieChart.js +48 -33
- package/dist/Charts/PieChart/PieChart.styled.d.ts +7 -2
- package/dist/Charts/PieChart/PieChart.styled.js +6 -1
- package/dist/Charts/PieChart/PieChart.types.d.ts +7 -3
- package/dist/CheckBox/CheckBox.js +19 -36
- package/dist/DateInput/DateInput.js +143 -198
- package/dist/DropDownMenu/DropDownMenu.js +15 -25
- package/dist/DropDownMenu/components/MenuComponent.js +2 -8
- package/dist/DropDownMenu/components/MenuItem.d.ts +0 -2
- package/dist/DropDownMenu/components/MenuItem.js +21 -25
- package/dist/DropDownMenu/components/MenuItemList.d.ts +0 -3
- package/dist/DropDownMenu/components/MenuItemList.js +86 -192
- package/dist/DropDownMenu/components/StyledContent.js +2 -1
- package/dist/DropDownMenu/components/StyledFloatContainer.js +1 -1
- package/dist/DropDownMenu/types.d.ts +0 -3
- package/dist/FieldLabel/FieldLabel.js +12 -4
- package/dist/FileInputField/FileInputField.js +23 -4
- package/dist/FileViewer/viewers/ImageViewer.js +18 -75
- package/dist/FormSection/FormSection.js +25 -5
- package/dist/IconButton/IconButton.js +16 -2
- package/dist/Input/Input.js +56 -7
- package/dist/MonolithUIProvider/MonolithUIProvider.d.ts +4 -1
- package/dist/Pill/Pill.js +79 -8
- package/dist/Popover/Popover.context.d.ts +1 -2
- package/dist/Popover/Popover.js +2 -5
- package/dist/Popover/Popover.styles.d.ts +6 -1
- package/dist/Popover/Popover.styles.js +28 -11
- package/dist/Popover/Popover.transitions.d.ts +2 -4
- package/dist/Popover/Popover.transitions.js +49 -23
- package/dist/Popover/PopoverDropdown.js +8 -6
- package/dist/Popover/PopoverTarget.js +3 -6
- package/dist/QueryFilter/DefaultOperators.d.ts +76 -0
- package/dist/QueryFilter/DefaultOperators.js +21 -0
- package/dist/QueryFilter/QueryFilter.d.ts +1 -1
- package/dist/QueryFilter/QueryFilter.js +303 -3
- package/dist/QueryFilter/index.d.ts +2 -3
- package/dist/QueryFilter/index.js +2 -3
- package/dist/QueryFilter/types.d.ts +52 -0
- package/dist/QueryFilter/types.js +1 -0
- package/dist/QueryFilter/useQueryFilter.d.ts +1 -1
- package/dist/QueryFilter/useQueryFilter.js +19 -23
- package/dist/RichTextEditor/Components/CodeBlockBaseButton.d.ts +18 -0
- package/dist/RichTextEditor/Components/CodeBlockBaseButton.js +6 -0
- package/dist/RichTextEditor/Components/CodeBlockCopyButton.d.ts +9 -0
- package/dist/RichTextEditor/Components/CodeBlockCopyButton.js +42 -0
- package/dist/RichTextEditor/Components/CodeBlockFormatButton.d.ts +10 -0
- package/dist/RichTextEditor/Components/CodeBlockFormatButton.js +60 -0
- package/dist/RichTextEditor/Components/CodeBlockLanguageSelect.d.ts +9 -0
- package/dist/RichTextEditor/Components/CodeBlockLanguageSelect.js +30 -0
- package/dist/RichTextEditor/Components/CodeBlockNodeView.d.ts +3 -0
- package/dist/RichTextEditor/Components/CodeBlockNodeView.js +28 -0
- package/dist/RichTextEditor/Components/CodeBlockWrapButton.d.ts +10 -0
- package/dist/RichTextEditor/Components/CodeBlockWrapButton.js +17 -0
- package/dist/RichTextEditor/Components/LinkEditor.d.ts +8 -0
- package/dist/RichTextEditor/Components/LinkEditor.js +94 -0
- package/dist/RichTextEditor/Components/TableTools/TableCornerMenu.d.ts +2 -0
- package/dist/RichTextEditor/Components/TableTools/TableCornerMenu.js +19 -0
- package/dist/RichTextEditor/Components/TableTools/TableInsertControls.d.ts +2 -0
- package/dist/RichTextEditor/Components/TableTools/TableInsertControls.js +24 -0
- package/dist/RichTextEditor/Components/TableTools/TableRails.d.ts +2 -0
- package/dist/RichTextEditor/Components/TableTools/TableRails.js +180 -0
- package/dist/RichTextEditor/Components/TableTools/TableToolMenu.d.ts +5 -0
- package/dist/RichTextEditor/Components/TableTools/TableToolMenu.js +6 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.actions.d.ts +5 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.actions.js +183 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.commands.d.ts +16 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.commands.js +217 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.constants.d.ts +8 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.constants.js +11 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.d.ts +3 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.geometry.d.ts +23 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.geometry.js +75 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.js +3 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.selectors.d.ts +16 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.selectors.js +53 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.styled.d.ts +40 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.styled.js +167 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.types.d.ts +76 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.types.js +1 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.utils.d.ts +4 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.utils.js +4 -0
- package/dist/RichTextEditor/Components/TableTools/TableToolsPopover.d.ts +2 -0
- package/dist/RichTextEditor/Components/TableTools/TableToolsPopover.js +12 -0
- package/dist/RichTextEditor/Components/TableTools/index.d.ts +3 -0
- package/dist/RichTextEditor/Components/TableTools/index.js +2 -0
- package/dist/RichTextEditor/Enums/HighlightColors.d.ts +9 -0
- package/dist/RichTextEditor/Enums/HighlightColors.js +10 -0
- package/dist/RichTextEditor/Extensions/getTiptapExtensions.js +15 -5
- package/dist/RichTextEditor/Plugins/ImageActionsPlugin.js +4 -7
- package/dist/RichTextEditor/Plugins/UploadImagesPlugin.d.ts +0 -15
- package/dist/RichTextEditor/Plugins/UploadImagesPlugin.js +51 -115
- package/dist/RichTextEditor/Plugins/index.d.ts +0 -1
- package/dist/RichTextEditor/Plugins/index.js +0 -1
- package/dist/RichTextEditor/RichTextEditor.d.ts +2 -3
- package/dist/RichTextEditor/RichTextEditor.js +35 -309
- package/dist/RichTextEditor/Toolbar/Toolbar.js +2 -14
- package/dist/RichTextEditor/Utils/codeBlockUtils.d.ts +20 -0
- package/dist/RichTextEditor/Utils/codeBlockUtils.js +137 -0
- package/dist/RichTextEditor/Utils/codeUtils.d.ts +3 -0
- package/dist/RichTextEditor/Utils/codeUtils.js +12 -0
- package/dist/RichTextEditor/Utils/linkUtils.d.ts +19 -0
- package/dist/RichTextEditor/Utils/linkUtils.js +57 -0
- package/dist/RichTextEditor/Utils/tableUtils.d.ts +1 -0
- package/dist/RichTextEditor/Utils/tableUtils.js +1 -0
- package/dist/SegmentedControl/SegmentedControl.utils.d.ts +2 -2
- package/dist/SegmentedControl/SegmentedControl.utils.js +30 -3
- package/dist/SelectBox/SelectBox.js +5 -5
- package/dist/SelectBox/select-box.styled-components.d.ts +1 -4
- package/dist/SelectBox/select-box.styled-components.js +48 -11
- package/dist/SelectBox/types.d.ts +0 -1
- package/dist/Switch/Switch.d.ts +2 -2
- package/dist/Switch/Switch.js +83 -18
- package/dist/Table/ColumnResizer.d.ts +9 -6
- package/dist/Table/ColumnResizer.js +10 -30
- package/dist/Table/StateStorage.d.ts +0 -4
- package/dist/Table/StateStorage.js +0 -13
- package/dist/Table/Table.js +12 -160
- package/dist/Table/TableComponents.d.ts +0 -10
- package/dist/Table/TableComponents.js +10 -71
- package/dist/Table/TableDefaults.d.ts +0 -7
- package/dist/Table/TableDefaults.js +0 -7
- package/dist/Table/TableHeader.js +16 -31
- package/dist/Table/TableMenu/TableMenu.js +1 -1
- package/dist/Table/TableProvider.js +75 -354
- package/dist/Table/TableRow.js +16 -28
- package/dist/Table/Utils/index.d.ts +1 -0
- package/dist/Table/Utils/index.js +1 -0
- package/dist/Table/Utils/resizeHandler.d.ts +3 -0
- package/dist/Table/Utils/resizeHandler.js +84 -0
- package/dist/Table/types.d.ts +19 -70
- package/dist/TagBox/TagBox.d.ts +1 -1
- package/dist/TagBox/TagBox.js +80 -22
- package/dist/TagBox/types.d.ts +0 -1
- package/dist/TextArea/TextArea.js +23 -9
- package/dist/TextInput/TextInput.js +6 -12
- package/dist/Utilities/parseTimestamp.js +6 -11
- package/dist/core/ArrowButton.d.ts +0 -2
- package/dist/core/ArrowButton.js +3 -7
- package/dist/core/ClearButton.d.ts +0 -2
- package/dist/core/ClearButton.js +3 -7
- package/dist/core/controlSizes.js +9 -9
- package/dist/core/index.d.ts +0 -1
- package/dist/core/index.js +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.js +0 -2
- package/dist/theme/variants.js +8 -2
- package/package.json +18 -26
package/dist/Switch/Switch.js
CHANGED
|
@@ -13,22 +13,46 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
13
13
|
import styled from "styled-components";
|
|
14
14
|
import * as RadixSwitch from "@radix-ui/react-switch";
|
|
15
15
|
import { FieldLabel } from "..";
|
|
16
|
-
import { DEFAULT_CONTROL_SIZE, getControlSizeTokens } from "../core";
|
|
17
16
|
import { Themes } from "../theme";
|
|
18
|
-
const getThumbTranslation = (size = DEFAULT_CONTROL_SIZE) => {
|
|
19
|
-
const { switchTrackWidth, switchThumbSize, switchPadding } = getControlSizeTokens(size);
|
|
20
|
-
return `${switchTrackWidth - switchThumbSize - switchPadding * 2}px`;
|
|
21
|
-
};
|
|
22
17
|
const StyledRoot = styled(RadixSwitch.Root) `
|
|
23
18
|
all: unset;
|
|
24
19
|
cursor: pointer;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
20
|
+
|
|
21
|
+
height: ${({ size }) => size === "xs"
|
|
22
|
+
? "10px"
|
|
23
|
+
: size === "sm"
|
|
24
|
+
? "16px"
|
|
25
|
+
: size === "md"
|
|
26
|
+
? "22px"
|
|
27
|
+
: size === "lg"
|
|
28
|
+
? "28px"
|
|
29
|
+
: size === "xl"
|
|
30
|
+
? "32px"
|
|
31
|
+
: "16px"};
|
|
32
|
+
|
|
33
|
+
min-width: ${({ size }) => size === "xs"
|
|
34
|
+
? "26px"
|
|
35
|
+
: size === "sm"
|
|
36
|
+
? "35px"
|
|
37
|
+
: size === "md"
|
|
38
|
+
? "41px"
|
|
39
|
+
: size === "lg"
|
|
40
|
+
? "53px"
|
|
41
|
+
: size === "xl"
|
|
42
|
+
? "70px"
|
|
43
|
+
: "26px"};
|
|
44
|
+
|
|
45
|
+
width: ${({ size }) => size === "xs"
|
|
46
|
+
? "26px"
|
|
47
|
+
: size === "sm"
|
|
48
|
+
? "35px"
|
|
49
|
+
: size === "md"
|
|
50
|
+
? "41px"
|
|
51
|
+
: size === "lg"
|
|
52
|
+
? "53px"
|
|
53
|
+
: size === "xl"
|
|
54
|
+
? "70px"
|
|
55
|
+
: "26px"};
|
|
32
56
|
|
|
33
57
|
background-color: ${({ theme }) => theme.name === Themes.DARK ? "#383838" : "#e3e3e3"};
|
|
34
58
|
transition: background-color 100ms;
|
|
@@ -36,7 +60,17 @@ const StyledRoot = styled(RadixSwitch.Root) `
|
|
|
36
60
|
border: 1px solid
|
|
37
61
|
${({ theme }) => theme.name === Themes.DARK ? theme.palette.input.border : "#e3e3e3"};
|
|
38
62
|
position: relative;
|
|
39
|
-
padding: ${({ size
|
|
63
|
+
padding: ${({ size }) => size === "xs"
|
|
64
|
+
? "2px"
|
|
65
|
+
: size === "sm"
|
|
66
|
+
? "2px"
|
|
67
|
+
: size === "md"
|
|
68
|
+
? "2px 9px 2px 3px"
|
|
69
|
+
: size === "lg"
|
|
70
|
+
? "2px 9px 2px 3px"
|
|
71
|
+
: size === "xl"
|
|
72
|
+
? "2px 4px"
|
|
73
|
+
: "2px"};
|
|
40
74
|
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
|
41
75
|
|
|
42
76
|
&[data-state="checked"] {
|
|
@@ -51,8 +85,29 @@ const StyledRoot = styled(RadixSwitch.Root) `
|
|
|
51
85
|
`;
|
|
52
86
|
const StyledThumb = styled(RadixSwitch.Thumb) `
|
|
53
87
|
display: block;
|
|
54
|
-
width: ${({ size
|
|
55
|
-
|
|
88
|
+
width: ${({ size }) => size === "xs"
|
|
89
|
+
? "9px"
|
|
90
|
+
: size === "sm"
|
|
91
|
+
? "14px"
|
|
92
|
+
: size === "md"
|
|
93
|
+
? "22px"
|
|
94
|
+
: size === "lg"
|
|
95
|
+
? "28px"
|
|
96
|
+
: size === "xl"
|
|
97
|
+
? "28px"
|
|
98
|
+
: "14px"};
|
|
99
|
+
|
|
100
|
+
height: ${({ size }) => size === "xs"
|
|
101
|
+
? "9px"
|
|
102
|
+
: size === "sm"
|
|
103
|
+
? "14px"
|
|
104
|
+
: size === "md"
|
|
105
|
+
? "22px"
|
|
106
|
+
: size === "lg"
|
|
107
|
+
? "28px"
|
|
108
|
+
: size === "xl"
|
|
109
|
+
? "28px"
|
|
110
|
+
: "14px"};
|
|
56
111
|
|
|
57
112
|
background-color: white;
|
|
58
113
|
border: none;
|
|
@@ -62,15 +117,25 @@ const StyledThumb = styled(RadixSwitch.Thumb) `
|
|
|
62
117
|
will-change: transform;
|
|
63
118
|
|
|
64
119
|
&[data-state="checked"] {
|
|
65
|
-
transform: ${({ size
|
|
120
|
+
transform: ${({ size }) => size === "xs"
|
|
121
|
+
? "translateX(17px)"
|
|
122
|
+
: size === "sm"
|
|
123
|
+
? "translateX(20px)"
|
|
124
|
+
: size === "md"
|
|
125
|
+
? "translateX(26px)"
|
|
126
|
+
: size === "lg"
|
|
127
|
+
? "translateX(32px)"
|
|
128
|
+
: size === "xl"
|
|
129
|
+
? "translateX(42px)"
|
|
130
|
+
: "translateX(17px)"};
|
|
66
131
|
}
|
|
67
132
|
`;
|
|
68
133
|
export const Switch = styled((_a) => {
|
|
69
|
-
var { className, onChange, size =
|
|
134
|
+
var { className, onChange, size = "xs", label, labelPosition = "right", description, error, required, disabled = false, defaultValue, value, style = {} } = _a, other = __rest(_a, ["className", "onChange", "size", "label", "labelPosition", "description", "error", "required", "disabled", "defaultValue", "value", "style"]);
|
|
70
135
|
return (_jsxs("div", { className: className, children: [label && labelPosition === "left" && (_jsx(FieldLabel, { error: error, asterisk: required, size: size, description: description, style: { margin: 0 }, children: label })), _jsx(StyledRoot, Object.assign({ size: size, className: "SwitchRoot", onCheckedChange: onChange, defaultChecked: defaultValue, checked: value, disabled: disabled, style: style }, other, { children: _jsx(StyledThumb, { size: size, className: "SwitchThumb" }) })), label && labelPosition === "right" && (_jsx(FieldLabel, { error: error, asterisk: required, size: size, description: description, style: { margin: 0 }, children: label }))] }));
|
|
71
136
|
}) `
|
|
72
137
|
display: flex;
|
|
73
138
|
flex-direction: row;
|
|
74
139
|
align-items: center;
|
|
75
|
-
gap:
|
|
140
|
+
gap: 10px;
|
|
76
141
|
`;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import { ColumnState } from "./types";
|
|
2
|
-
declare const ColumnResizer: ({
|
|
1
|
+
import { ColumnState, onResizeFinishedProps } from "./types";
|
|
2
|
+
declare const ColumnResizer: ({ onResize, onResizeFinished, column, showOnHover, }: {
|
|
3
3
|
className?: string;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
onResize?: (e: {
|
|
5
|
+
columns: {
|
|
6
|
+
dataField: string;
|
|
7
|
+
width: number;
|
|
8
|
+
}[];
|
|
9
|
+
}) => void;
|
|
10
|
+
onResizeFinished?: (e: onResizeFinishedProps) => void;
|
|
7
11
|
column: ColumnState;
|
|
8
|
-
currentWidth: number;
|
|
9
12
|
showOnHover?: boolean;
|
|
10
13
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
11
14
|
export default ColumnResizer;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import styled from "styled-components";
|
|
3
|
+
import { resizeHandler } from "./Utils";
|
|
3
4
|
const StyledContainer = styled.div `
|
|
4
5
|
position: absolute;
|
|
5
6
|
right: 0px;
|
|
@@ -23,43 +24,22 @@ const StyledContainer = styled.div `
|
|
|
23
24
|
background: ${(props) => props.theme.palette.primary.main};
|
|
24
25
|
}
|
|
25
26
|
`;
|
|
26
|
-
const ColumnResizer = ({
|
|
27
|
-
const getConstrainedWidth = (width) => {
|
|
28
|
-
const minWidth = column.minWidth;
|
|
29
|
-
const maxWidth = column.maxWidth;
|
|
30
|
-
if (typeof maxWidth === "number") {
|
|
31
|
-
return Math.min(Math.max(width, minWidth), maxWidth);
|
|
32
|
-
}
|
|
33
|
-
return Math.max(width, minWidth);
|
|
34
|
-
};
|
|
27
|
+
const ColumnResizer = ({ onResize = () => { }, onResizeFinished, column, showOnHover = false, }) => {
|
|
35
28
|
return (_jsx(StyledContainer, { className: `resizer col-${column.columnId}`, "data-show-on-hover": showOnHover, onClick: (e) => {
|
|
36
29
|
e.stopPropagation();
|
|
37
30
|
e.nativeEvent.stopImmediatePropagation();
|
|
38
31
|
e.preventDefault();
|
|
39
|
-
},
|
|
32
|
+
}, onMouseDown: (e) => {
|
|
40
33
|
e.stopPropagation();
|
|
41
34
|
e.nativeEvent.stopImmediatePropagation();
|
|
42
35
|
e.preventDefault();
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
};
|
|
50
|
-
const handlePointerUp = (event) => {
|
|
51
|
-
const nextWidth = getConstrainedWidth(startWidth + event.clientX - startX);
|
|
52
|
-
target.classList.remove("isResizing");
|
|
53
|
-
document.removeEventListener("pointermove", handlePointerMove);
|
|
54
|
-
document.removeEventListener("pointerup", handlePointerUp);
|
|
55
|
-
document.removeEventListener("pointercancel", handlePointerUp);
|
|
56
|
-
onResizeEnd === null || onResizeEnd === void 0 ? void 0 : onResizeEnd(nextWidth);
|
|
57
|
-
};
|
|
58
|
-
target.classList.add("isResizing");
|
|
59
|
-
onResizeStart === null || onResizeStart === void 0 ? void 0 : onResizeStart();
|
|
60
|
-
document.addEventListener("pointermove", handlePointerMove);
|
|
61
|
-
document.addEventListener("pointerup", handlePointerUp);
|
|
62
|
-
document.addEventListener("pointercancel", handlePointerUp);
|
|
36
|
+
resizeHandler({
|
|
37
|
+
event: e,
|
|
38
|
+
columnId: column.columnId,
|
|
39
|
+
columnProps: column,
|
|
40
|
+
onResize: onResize,
|
|
41
|
+
onResizeFinished: onResizeFinished,
|
|
42
|
+
});
|
|
63
43
|
} }));
|
|
64
44
|
};
|
|
65
45
|
export default ColumnResizer;
|
|
@@ -11,8 +11,6 @@ type GetSearchStateFn = (key: string) => string;
|
|
|
11
11
|
type SetSearchStateFn = (key: string, value: string) => void;
|
|
12
12
|
type GetFilterStateFn = (key: string) => Query | undefined;
|
|
13
13
|
type SetFilterStateFn = (key: string, value?: Query | null) => void;
|
|
14
|
-
type GetExpandedKeysFn = (key: string) => string[] | undefined;
|
|
15
|
-
type SetExpandedKeysFn = (key: string, value: string[]) => void;
|
|
16
14
|
declare const StateStorage: {
|
|
17
15
|
getTableState: GetTableStateFn;
|
|
18
16
|
getColumnState: GetColumnStateFn;
|
|
@@ -25,7 +23,5 @@ declare const StateStorage: {
|
|
|
25
23
|
setSearchState: SetSearchStateFn;
|
|
26
24
|
getFilterState: GetFilterStateFn;
|
|
27
25
|
setFilterState: SetFilterStateFn;
|
|
28
|
-
getExpandedKeys: GetExpandedKeysFn;
|
|
29
|
-
setExpandedKeys: SetExpandedKeysFn;
|
|
30
26
|
};
|
|
31
27
|
export default StateStorage;
|
|
@@ -82,17 +82,6 @@ const setFilterState = (key, value) => {
|
|
|
82
82
|
const newState = Object.assign(Object.assign({}, previousState), { filterState: value });
|
|
83
83
|
set(key, newState);
|
|
84
84
|
};
|
|
85
|
-
const getExpandedKeys = (key) => {
|
|
86
|
-
const data = getTableState(key);
|
|
87
|
-
return data.expandedKeys;
|
|
88
|
-
};
|
|
89
|
-
const setExpandedKeys = (key, value) => {
|
|
90
|
-
// get previous state
|
|
91
|
-
const previousState = getTableState(key);
|
|
92
|
-
// merge previous state with new state
|
|
93
|
-
const newState = Object.assign(Object.assign({}, previousState), { expandedKeys: value });
|
|
94
|
-
set(key, newState);
|
|
95
|
-
};
|
|
96
85
|
const StateStorage = {
|
|
97
86
|
getTableState,
|
|
98
87
|
getColumnState,
|
|
@@ -105,7 +94,5 @@ const StateStorage = {
|
|
|
105
94
|
setSearchState,
|
|
106
95
|
getFilterState,
|
|
107
96
|
setFilterState,
|
|
108
|
-
getExpandedKeys,
|
|
109
|
-
setExpandedKeys,
|
|
110
97
|
};
|
|
111
98
|
export default StateStorage;
|
package/dist/Table/Table.js
CHANGED
|
@@ -22,7 +22,6 @@ import TableMenu from "./TableMenu";
|
|
|
22
22
|
import useTable from "./useTable";
|
|
23
23
|
import LoadingIndicator from "./LoadingIndicator";
|
|
24
24
|
import styled from "styled-components";
|
|
25
|
-
import TableDefaults from "./TableDefaults";
|
|
26
25
|
const StyledTableContainer = styled.div `
|
|
27
26
|
display: flex;
|
|
28
27
|
flex-direction: column;
|
|
@@ -41,20 +40,8 @@ const TableContent = ({ children, }) => {
|
|
|
41
40
|
}, ref: tableElement, "data-compact": compactState, children: [_jsx(LoadingIndicator, { visible: loading }), _jsx(TableHeader, { headerRowElm: headerRowElm }), visibleColumnCount === 0 && _jsx("div", { children: "No columns visible" }), virtualized === true ? (_jsx(VirtualizedRows, { tableDimensions: tableDimensions, targetElm: targetElm, listElm: listElm, rowHeight: rowHeight, headerRowHeight: headerRowHeight })) : (_jsx(StaticRows, { targetElm: targetElm, listElm: listElm }))] })] }));
|
|
42
41
|
};
|
|
43
42
|
export const Table = (_a) => {
|
|
44
|
-
var { data, columnProps, children
|
|
43
|
+
var { data, columnProps, children } = _a, props = __rest(_a, ["data", "columnProps", "children"]) // pass through props straight to table context
|
|
45
44
|
;
|
|
46
|
-
const resolvedTreeOptions = useMemo(() => {
|
|
47
|
-
var _a, _b, _c, _d, _e, _f;
|
|
48
|
-
return ({
|
|
49
|
-
enabled: (_a = treeOptions === null || treeOptions === void 0 ? void 0 : treeOptions.enabled) !== null && _a !== void 0 ? _a : false,
|
|
50
|
-
mode: (_b = treeOptions === null || treeOptions === void 0 ? void 0 : treeOptions.mode) !== null && _b !== void 0 ? _b : TableDefaults.tree.defaultMode,
|
|
51
|
-
childrenField: (_c = treeOptions === null || treeOptions === void 0 ? void 0 : treeOptions.childrenField) !== null && _c !== void 0 ? _c : TableDefaults.tree.defaultChildrenField,
|
|
52
|
-
parentIdField: (_d = treeOptions === null || treeOptions === void 0 ? void 0 : treeOptions.parentIdField) !== null && _d !== void 0 ? _d : TableDefaults.tree.defaultParentIdField,
|
|
53
|
-
idField: treeOptions === null || treeOptions === void 0 ? void 0 : treeOptions.idField,
|
|
54
|
-
indentPx: (_e = treeOptions === null || treeOptions === void 0 ? void 0 : treeOptions.indentPx) !== null && _e !== void 0 ? _e : TableDefaults.tree.indentPx,
|
|
55
|
-
autoExpandOnMatch: (_f = treeOptions === null || treeOptions === void 0 ? void 0 : treeOptions.autoExpandOnMatch) !== null && _f !== void 0 ? _f : true,
|
|
56
|
-
});
|
|
57
|
-
}, [treeOptions]);
|
|
58
45
|
const tableElement = useRef(null);
|
|
59
46
|
const targetElm = useRef(null);
|
|
60
47
|
const listElm = useRef(null);
|
|
@@ -126,153 +113,18 @@ export const Table = (_a) => {
|
|
|
126
113
|
// Uses a WeakMap so entries are automatically garbage collected
|
|
127
114
|
// when their corresponding row objects are no longer referenced.
|
|
128
115
|
const uuidCache = useRef(new WeakMap());
|
|
129
|
-
|
|
130
|
-
|
|
116
|
+
// Augment each row with a stable __key (UUID) and __index.
|
|
117
|
+
// The WeakMap ensures that the same row object always receives
|
|
118
|
+
// the same UUID across re-renders, preventing unnecessary DOM
|
|
119
|
+
// reconciliation. useMemo preserves referential stability of
|
|
120
|
+
// the output array when the data reference hasn't changed.
|
|
121
|
+
const __data = useMemo(() => data === null || data === void 0 ? void 0 : data.map((d, i) => {
|
|
122
|
+
let key = uuidCache.current.get(d);
|
|
131
123
|
if (!key) {
|
|
132
124
|
key = shortUUID.uuid();
|
|
133
|
-
uuidCache.current.set(
|
|
134
|
-
}
|
|
135
|
-
return key;
|
|
136
|
-
};
|
|
137
|
-
// Augment each row with stable metadata. When tree mode is disabled,
|
|
138
|
-
// produces a flat 1:1 mapping with __key and __index. When enabled,
|
|
139
|
-
// walks the input (nested or flat) into a flat depth-first array
|
|
140
|
-
// and adds tree metadata (__level, __parentKey, __hasChildren, __childKeys).
|
|
141
|
-
const { rows: __data, treeMeta } = useMemo(() => {
|
|
142
|
-
const parentKeyMap = new Map();
|
|
143
|
-
const childrenKeyMap = new Map();
|
|
144
|
-
const expandableKeys = [];
|
|
145
|
-
if (!data) {
|
|
146
|
-
return {
|
|
147
|
-
rows: [],
|
|
148
|
-
treeMeta: { parentKeyMap, childrenKeyMap, expandableKeys },
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
if (!resolvedTreeOptions.enabled) {
|
|
152
|
-
const rows = data.map((d, i) => (Object.assign(Object.assign({}, d), { __key: getOrAssignKey(d), __index: i })));
|
|
153
|
-
return {
|
|
154
|
-
rows,
|
|
155
|
-
treeMeta: { parentKeyMap, childrenKeyMap, expandableKeys },
|
|
156
|
-
};
|
|
125
|
+
uuidCache.current.set(d, key);
|
|
157
126
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
const childrenField = resolvedTreeOptions.childrenField;
|
|
162
|
-
const walk = (node, level, parentKey) => {
|
|
163
|
-
const key = getOrAssignKey(node);
|
|
164
|
-
const rawChildren = node === null || node === void 0 ? void 0 : node[childrenField];
|
|
165
|
-
const children = Array.isArray(rawChildren) ? rawChildren : [];
|
|
166
|
-
const childKeys = children.map((c) => getOrAssignKey(c));
|
|
167
|
-
// Strip the nested children field from the augmented copy to avoid
|
|
168
|
-
// memory bloat and prevent accidental iteration of the raw tree.
|
|
169
|
-
const _a = node, _b = childrenField, _stripped = _a[_b], rest = __rest(_a, [typeof _b === "symbol" ? _b : _b + ""]);
|
|
170
|
-
const augmented = Object.assign(Object.assign({}, rest), { __key: key, __index: counter++, __level: level, __parentKey: parentKey, __hasChildren: children.length > 0, __childKeys: childKeys });
|
|
171
|
-
rows.push(augmented);
|
|
172
|
-
parentKeyMap.set(key, parentKey);
|
|
173
|
-
if (children.length > 0) {
|
|
174
|
-
childrenKeyMap.set(key, childKeys);
|
|
175
|
-
expandableKeys.push(key);
|
|
176
|
-
}
|
|
177
|
-
for (const child of children) {
|
|
178
|
-
walk(child, level + 1, key);
|
|
179
|
-
}
|
|
180
|
-
};
|
|
181
|
-
const rootKeys = [];
|
|
182
|
-
for (const root of data) {
|
|
183
|
-
rootKeys.push(getOrAssignKey(root));
|
|
184
|
-
walk(root, 0, undefined);
|
|
185
|
-
}
|
|
186
|
-
childrenKeyMap.set(undefined, rootKeys);
|
|
187
|
-
}
|
|
188
|
-
else {
|
|
189
|
-
// flat mode
|
|
190
|
-
const idField = resolvedTreeOptions.idField || props.keyField;
|
|
191
|
-
if (!idField) {
|
|
192
|
-
throw new Error('Table treeOptions.mode="flat" requires either treeOptions.idField or keyField to be set so the table can resolve parent-child relationships against a stable id.');
|
|
193
|
-
}
|
|
194
|
-
const parentIdField = resolvedTreeOptions.parentIdField;
|
|
195
|
-
// Pass 1: assign __key, build idToKey
|
|
196
|
-
const idToKey = new Map();
|
|
197
|
-
const idToRow = new Map();
|
|
198
|
-
for (const d of data) {
|
|
199
|
-
const id = d === null || d === void 0 ? void 0 : d[idField];
|
|
200
|
-
if (id === undefined || id === null)
|
|
201
|
-
continue;
|
|
202
|
-
idToKey.set(id, getOrAssignKey(d));
|
|
203
|
-
idToRow.set(id, d);
|
|
204
|
-
}
|
|
205
|
-
// Pass 2: build parent->children id map. Roots = parentId null/undefined
|
|
206
|
-
// OR parentId points at a non-existent row.
|
|
207
|
-
const parentToChildIds = new Map();
|
|
208
|
-
const rootIds = [];
|
|
209
|
-
let warnedOrphan = false;
|
|
210
|
-
for (const d of data) {
|
|
211
|
-
const id = d === null || d === void 0 ? void 0 : d[idField];
|
|
212
|
-
if (id === undefined || id === null)
|
|
213
|
-
continue;
|
|
214
|
-
const parentId = d === null || d === void 0 ? void 0 : d[parentIdField];
|
|
215
|
-
if (parentId === undefined || parentId === null) {
|
|
216
|
-
rootIds.push(id);
|
|
217
|
-
continue;
|
|
218
|
-
}
|
|
219
|
-
if (!idToRow.has(parentId)) {
|
|
220
|
-
if (!warnedOrphan) {
|
|
221
|
-
// eslint-disable-next-line no-console
|
|
222
|
-
console.warn(`Table tree (flat mode): row id "${id}" references missing parentId "${parentId}"; treating as root.`);
|
|
223
|
-
warnedOrphan = true;
|
|
224
|
-
}
|
|
225
|
-
rootIds.push(id);
|
|
226
|
-
continue;
|
|
227
|
-
}
|
|
228
|
-
if (!parentToChildIds.has(parentId))
|
|
229
|
-
parentToChildIds.set(parentId, []);
|
|
230
|
-
parentToChildIds.get(parentId).push(id);
|
|
231
|
-
}
|
|
232
|
-
// Pass 3: DFS from roots with cycle detection
|
|
233
|
-
const visiting = new Set();
|
|
234
|
-
let warnedCycle = false;
|
|
235
|
-
const walkFlat = (id, level, parentKey) => {
|
|
236
|
-
if (visiting.has(id)) {
|
|
237
|
-
if (!warnedCycle) {
|
|
238
|
-
// eslint-disable-next-line no-console
|
|
239
|
-
console.warn(`Table tree (flat mode): cycle detected at row id "${id}"; truncating subtree.`);
|
|
240
|
-
warnedCycle = true;
|
|
241
|
-
}
|
|
242
|
-
return;
|
|
243
|
-
}
|
|
244
|
-
visiting.add(id);
|
|
245
|
-
const node = idToRow.get(id);
|
|
246
|
-
const key = idToKey.get(id);
|
|
247
|
-
const childIds = parentToChildIds.get(id) || [];
|
|
248
|
-
const childKeys = childIds
|
|
249
|
-
.map((cid) => idToKey.get(cid))
|
|
250
|
-
.filter((k) => !!k);
|
|
251
|
-
const augmented = Object.assign(Object.assign({}, node), { __key: key, __index: counter++, __level: level, __parentKey: parentKey, __hasChildren: childIds.length > 0, __childKeys: childKeys });
|
|
252
|
-
rows.push(augmented);
|
|
253
|
-
parentKeyMap.set(key, parentKey);
|
|
254
|
-
if (childIds.length > 0) {
|
|
255
|
-
childrenKeyMap.set(key, childKeys);
|
|
256
|
-
expandableKeys.push(key);
|
|
257
|
-
}
|
|
258
|
-
for (const cid of childIds) {
|
|
259
|
-
walkFlat(cid, level + 1, key);
|
|
260
|
-
}
|
|
261
|
-
visiting.delete(id);
|
|
262
|
-
};
|
|
263
|
-
const rootKeys = [];
|
|
264
|
-
for (const id of rootIds) {
|
|
265
|
-
const k = idToKey.get(id);
|
|
266
|
-
if (k)
|
|
267
|
-
rootKeys.push(k);
|
|
268
|
-
walkFlat(id, 0, undefined);
|
|
269
|
-
}
|
|
270
|
-
childrenKeyMap.set(undefined, rootKeys);
|
|
271
|
-
}
|
|
272
|
-
return {
|
|
273
|
-
rows,
|
|
274
|
-
treeMeta: { parentKeyMap, childrenKeyMap, expandableKeys },
|
|
275
|
-
};
|
|
276
|
-
}, [data, resolvedTreeOptions, props.keyField]);
|
|
277
|
-
return (_jsx(TableProvider, Object.assign({ columns: columnProps, data: __data, tableElement: tableElement, headerRowElm: headerRowElm, tableDimensions: tableDimensions, targetElm: targetElm, listElm: listElm, treeOptions: resolvedTreeOptions, treeMeta: treeMeta }, props, { children: _jsx(TableContent, { children: children }) })));
|
|
127
|
+
return Object.assign(Object.assign({}, d), { __key: key, __index: i });
|
|
128
|
+
}), [data]);
|
|
129
|
+
return (_jsx(TableProvider, Object.assign({ columns: columnProps, data: __data, tableElement: tableElement, headerRowElm: headerRowElm, tableDimensions: tableDimensions, targetElm: targetElm, listElm: listElm }, props, { children: _jsx(TableContent, { children: children }) })));
|
|
278
130
|
};
|
|
@@ -6,16 +6,6 @@ export declare const THR: import("styled-components/dist/types").IStyledComponen
|
|
|
6
6
|
export declare const TD: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, TDProps>> & string;
|
|
7
7
|
export declare const TH: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof TDProps> & TDProps, never>> & string;
|
|
8
8
|
export declare const InnerCellContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
9
|
-
export declare const TreeCellWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
10
|
-
export declare const TreeIndentSpacer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
11
|
-
$level: number;
|
|
12
|
-
$indentPx: number;
|
|
13
|
-
}>> & string;
|
|
14
|
-
export declare const TreeChevronButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
|
|
15
|
-
$expanded: boolean;
|
|
16
|
-
}>> & string;
|
|
17
|
-
export declare const TreeChevronPlaceholder: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
18
|
-
export declare const TreeCellContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
19
9
|
export declare const TableViewPort: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
20
10
|
export declare const TableListElement: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
21
11
|
export declare const TableWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
@@ -8,20 +8,18 @@ export const TBody = styled.div `
|
|
|
8
8
|
overflow: hidden;
|
|
9
9
|
`;
|
|
10
10
|
export const TR = styled.div `
|
|
11
|
-
box-sizing: border-box;
|
|
12
11
|
display: flex;
|
|
13
12
|
flex-direction: row;
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
|
|
14
|
+
flex: 1;
|
|
16
15
|
|
|
17
16
|
height: ${({ height }) => {
|
|
18
17
|
const customHeight = height ? height + "px" : undefined;
|
|
19
18
|
return customHeight || `${TableDefaults.row.height.normal}px`;
|
|
20
19
|
}};
|
|
21
20
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
inset -1px 0 ${({ theme }) => theme.palette.divider};
|
|
21
|
+
border-left: 1px solid ${({ theme }) => theme.palette.divider};
|
|
22
|
+
border-right: 1px solid ${({ theme }) => theme.palette.divider};
|
|
25
23
|
|
|
26
24
|
.row-action {
|
|
27
25
|
visibility: hidden;
|
|
@@ -32,6 +30,7 @@ export const TR = styled.div `
|
|
|
32
30
|
}
|
|
33
31
|
|
|
34
32
|
&[data-focused="true"] {
|
|
33
|
+
border: 1px solid transparent;
|
|
35
34
|
outline: 1px solid ${({ theme }) => theme.palette.primary.main};
|
|
36
35
|
outline-offset: -1px;
|
|
37
36
|
|
|
@@ -60,18 +59,21 @@ export const THR = styled(TR) `
|
|
|
60
59
|
}
|
|
61
60
|
`;
|
|
62
61
|
export const TD = styled.div `
|
|
63
|
-
box-sizing: border-box;
|
|
64
62
|
position: relative;
|
|
65
63
|
display: flex;
|
|
66
64
|
flex-direction: row;
|
|
67
65
|
align-items: center;
|
|
68
|
-
flex:
|
|
66
|
+
flex: 1;
|
|
69
67
|
|
|
70
68
|
padding: ${TableDefaults.td.padding.normal}px;
|
|
71
69
|
font-size: ${`${TableDefaults.td.fontSize.normal}px`};
|
|
72
70
|
|
|
73
71
|
min-width: ${TableDefaults.td.minWidth}px;
|
|
74
72
|
|
|
73
|
+
&:last-child {
|
|
74
|
+
flex: 1 !important; // ensure last column takes up remaining space
|
|
75
|
+
}
|
|
76
|
+
|
|
75
77
|
background-color: ${({ theme }) => theme.palette.background.default};
|
|
76
78
|
|
|
77
79
|
border-bottom: 1px solid ${({ theme }) => theme.palette.divider};
|
|
@@ -108,72 +110,18 @@ export const TH = styled(TD) `
|
|
|
108
110
|
`;
|
|
109
111
|
export const InnerCellContent = styled.div `
|
|
110
112
|
max-width: 100%;
|
|
111
|
-
min-width: 0;
|
|
112
113
|
|
|
113
114
|
white-space: nowrap;
|
|
114
115
|
overflow: hidden;
|
|
115
116
|
text-overflow: ellipsis;
|
|
116
117
|
`;
|
|
117
|
-
export const TreeCellWrapper = styled.div `
|
|
118
|
-
display: flex;
|
|
119
|
-
flex-direction: row;
|
|
120
|
-
align-items: center;
|
|
121
|
-
flex: 1 1 auto;
|
|
122
|
-
min-width: 0;
|
|
123
|
-
`;
|
|
124
|
-
export const TreeIndentSpacer = styled.div `
|
|
125
|
-
flex: 0 0 auto;
|
|
126
|
-
width: ${({ $level, $indentPx }) => $level * $indentPx}px;
|
|
127
|
-
`;
|
|
128
|
-
export const TreeChevronButton = styled.button `
|
|
129
|
-
flex: 0 0 auto;
|
|
130
|
-
width: 14px;
|
|
131
|
-
height: 16px;
|
|
132
|
-
padding: 0;
|
|
133
|
-
margin: 0 8px 0 0;
|
|
134
|
-
display: inline-flex;
|
|
135
|
-
align-items: center;
|
|
136
|
-
justify-content: flex-start;
|
|
137
|
-
background: transparent;
|
|
138
|
-
border: none;
|
|
139
|
-
cursor: pointer;
|
|
140
|
-
color: ${({ theme }) => theme.palette.text.secondary};
|
|
141
|
-
transition: transform 120ms ease;
|
|
142
|
-
transform: rotate(${({ $expanded }) => ($expanded ? "90deg" : "0deg")});
|
|
143
|
-
|
|
144
|
-
&:hover {
|
|
145
|
-
color: ${({ theme }) => theme.palette.text.primary};
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
&:focus-visible {
|
|
149
|
-
outline: 1px solid ${({ theme }) => theme.palette.primary.main};
|
|
150
|
-
outline-offset: 1px;
|
|
151
|
-
}
|
|
152
|
-
`;
|
|
153
|
-
export const TreeChevronPlaceholder = styled.div `
|
|
154
|
-
flex: 0 0 auto;
|
|
155
|
-
width: 12px;
|
|
156
|
-
height: 16px;
|
|
157
|
-
margin: 0 10px 0 0;
|
|
158
|
-
`;
|
|
159
|
-
export const TreeCellContent = styled.div `
|
|
160
|
-
flex: 1 1 auto;
|
|
161
|
-
min-width: 0;
|
|
162
|
-
overflow: hidden;
|
|
163
|
-
text-overflow: ellipsis;
|
|
164
|
-
white-space: nowrap;
|
|
165
|
-
`;
|
|
166
118
|
export const TableViewPort = styled.div `
|
|
167
|
-
box-sizing: border-box;
|
|
168
119
|
display: flex;
|
|
169
120
|
flex-direction: column;
|
|
170
|
-
min-width: 0;
|
|
171
121
|
`;
|
|
172
122
|
export const TableListElement = styled.div `
|
|
173
|
-
box-sizing: border-box;
|
|
174
123
|
display: flex;
|
|
175
124
|
flex-direction: column;
|
|
176
|
-
min-width: 100%;
|
|
177
125
|
`;
|
|
178
126
|
export const TableWrapper = styled.div `
|
|
179
127
|
position: relative;
|
|
@@ -183,7 +131,6 @@ export const TableWrapper = styled.div `
|
|
|
183
131
|
flex-direction: column;
|
|
184
132
|
`;
|
|
185
133
|
export const StyledTable = styled.div `
|
|
186
|
-
box-sizing: border-box;
|
|
187
134
|
position: relative;
|
|
188
135
|
overflow: hidden;
|
|
189
136
|
display: flex;
|
|
@@ -201,14 +148,6 @@ export const StyledTable = styled.div `
|
|
|
201
148
|
font-size: ${TableDefaults.td.fontSize.compact}px !important;
|
|
202
149
|
}
|
|
203
150
|
|
|
204
|
-
.mfui-td[data-tree-cell="true"] {
|
|
205
|
-
padding-left: ${TableDefaults.td.padding.normal - 3}px;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
&[data-compact="true"] .mfui-td[data-tree-cell="true"] {
|
|
209
|
-
padding-left: ${TableDefaults.td.padding.compact - 3}px !important;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
151
|
.os-scrollbar {
|
|
213
152
|
pointer-events: auto;
|
|
214
153
|
visibility: visible;
|
|
@@ -21,12 +21,5 @@ declare const TableDefaults: {
|
|
|
21
21
|
minWidth: number;
|
|
22
22
|
maxWidth: number;
|
|
23
23
|
};
|
|
24
|
-
tree: {
|
|
25
|
-
indentPx: number;
|
|
26
|
-
chevronWidth: number;
|
|
27
|
-
defaultMode: "nested";
|
|
28
|
-
defaultChildrenField: string;
|
|
29
|
-
defaultParentIdField: string;
|
|
30
|
-
};
|
|
31
24
|
};
|
|
32
25
|
export default TableDefaults;
|
|
@@ -21,12 +21,5 @@ const TableDefaults = {
|
|
|
21
21
|
minWidth: 35,
|
|
22
22
|
maxWidth: 35,
|
|
23
23
|
},
|
|
24
|
-
tree: {
|
|
25
|
-
indentPx: 16,
|
|
26
|
-
chevronWidth: 16,
|
|
27
|
-
defaultMode: "nested",
|
|
28
|
-
defaultChildrenField: "children",
|
|
29
|
-
defaultParentIdField: "parentId",
|
|
30
|
-
},
|
|
31
24
|
};
|
|
32
25
|
export default TableDefaults;
|