@monolith-forensics/monolith-ui 1.3.97 → 1.3.104
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/Alert/Alert.d.ts +8 -0
- package/dist/Alert/Alert.js +52 -0
- package/dist/Alert/index.d.ts +1 -0
- package/dist/Alert/index.js +1 -0
- package/dist/Button/Button.d.ts +1 -0
- package/dist/Button/Button.js +4 -4
- package/dist/Calendar/Calendar.js +77 -76
- package/dist/DateInput/DateInput.d.ts +3 -4
- package/dist/DateInput/DateInput.js +39 -73
- package/dist/DropDownMenu/DropDownMenu.d.ts +1 -2
- package/dist/DropDownMenu/DropDownMenu.js +7 -13
- package/dist/DropDownMenu/components/MenuComponent.js +2 -2
- package/dist/DropDownMenu/components/MenuItem.js +1 -1
- package/dist/DropDownMenu/components/MenuItemList.d.ts +6 -2
- package/dist/DropDownMenu/components/MenuItemList.js +99 -30
- package/dist/DropDownMenu/index.d.ts +1 -1
- package/dist/DropDownMenu/index.js +1 -1
- package/dist/DropDownMenu/types.d.ts +23 -8
- package/dist/MonolithUIProvider/MonolithUIProvider.d.ts +35 -0
- package/dist/QueryFilter/QueryFilter.js +52 -43
- package/dist/QueryFilter/index.d.ts +0 -1
- package/dist/QueryFilter/index.js +0 -1
- package/dist/QueryFilter/types.d.ts +3 -5
- package/dist/RichTextEditor/Components/BubbleMenu.js +1 -1
- package/dist/RichTextEditor/Components/ColorPicker.js +4 -2
- package/dist/RichTextEditor/Toolbar/Toolbar.js +1 -1
- package/dist/SelectBox/SelectBox.js +7 -1
- package/dist/SelectBox/select-box.styled-components.js +6 -1
- package/dist/Switch/Switch.d.ts +3 -4
- package/dist/Switch/Switch.js +1 -2
- package/dist/Switch/index.d.ts +1 -1
- package/dist/Switch/index.js +1 -1
- package/dist/Table/TableComponents.js +16 -0
- package/dist/Table/TableMenu/TableMenu.js +18 -4
- package/dist/Table/TableProvider.js +214 -139
- package/dist/Table/TableRow.js +3 -2
- package/dist/Table/types.d.ts +40 -6
- package/dist/TextAreaInput/TextAreaInput.js +10 -2
- package/dist/Tooltip/Tooltip.d.ts +3 -1
- package/dist/Tooltip/Tooltip.js +3 -3
- package/dist/index.d.ts +3 -5
- package/dist/index.js +3 -3
- package/dist/theme/variants.js +66 -1
- package/package.json +3 -3
- package/dist/QueryFilter/useFilterHelper.d.ts +0 -20
- package/dist/QueryFilter/useFilterHelper.js +0 -61
- package/dist/SelectableTextArea/SelectableTextArea.d.ts +0 -31
- package/dist/SelectableTextArea/SelectableTextArea.js +0 -191
- package/dist/SelectableTextArea/index.d.ts +0 -2
- package/dist/SelectableTextArea/index.js +0 -1
package/dist/Table/TableRow.js
CHANGED
|
@@ -8,12 +8,13 @@ import ActionButton from "./ActionButton";
|
|
|
8
8
|
import CheckBox from "../CheckBox";
|
|
9
9
|
import { LoadingCellIndicator } from "./LoadingCellIndicator";
|
|
10
10
|
const TableRow = ({ rowData, loading, rowStyle }) => {
|
|
11
|
-
const { columnState, enableActionButton, onActionButtonClick, actionButtonIcon: Icon, enableSelection, selectRow, deselectRow, isRowSelected, onRowUpdated, } = useTable();
|
|
11
|
+
const { columnState, enableActionButton, onActionButtonClick, actionButtonIcon: Icon, enableSelection, selectRow, deselectRow, isRowSelected, isRowFocused, onRowUpdated, } = useTable();
|
|
12
12
|
const selected = isRowSelected(rowData);
|
|
13
|
+
const focused = isRowFocused(rowData);
|
|
13
14
|
const handleSelectionChange = (e) => {
|
|
14
15
|
e === true ? selectRow(rowData) : deselectRow(rowData);
|
|
15
16
|
};
|
|
16
|
-
return (_jsxs(TR, { className: "mfui-tr", style: rowStyle, "data-key": rowData.__key, "data-selected": selected, children: [enableSelection && (_jsx(ActionCell, { className: `mfui-td column-select`, children: _jsx(InnerCellContent, { className: "mfui inner-cell-content row-action", children: _jsx(CheckBox, { className: `mfui-checkbox`, value: selected, onChange: (e) => handleSelectionChange(e) }) }) })), enableActionButton && (_jsx(ActionCell, { className: `mfui-td column-action`, children: _jsx(InnerCellContent, { className: "mfui inner-cell-content row-action", children: _jsx(ActionButton, { variant: "subtle", onClick: () => onActionButtonClick === null || onActionButtonClick === void 0 ? void 0 : onActionButtonClick(rowData), children: Icon ? _jsx(Icon, { size: 14 }) : _jsx(Maximize2Icon, { size: 14 }) }) }) })), columnState.map((column, index) => {
|
|
17
|
+
return (_jsxs(TR, { className: "mfui-tr", style: rowStyle, "data-key": rowData.__key, "data-selected": selected, "data-focused": focused, children: [enableSelection && (_jsx(ActionCell, { className: `mfui-td column-select`, children: _jsx(InnerCellContent, { className: "mfui inner-cell-content row-action", children: _jsx(CheckBox, { className: `mfui-checkbox`, value: selected, onChange: (e) => handleSelectionChange(e) }) }) })), enableActionButton && (_jsx(ActionCell, { className: `mfui-td column-action`, children: _jsx(InnerCellContent, { className: "mfui inner-cell-content row-action", children: _jsx(ActionButton, { variant: "subtle", onClick: () => onActionButtonClick === null || onActionButtonClick === void 0 ? void 0 : onActionButtonClick(rowData), children: Icon ? _jsx(Icon, { size: 14 }) : _jsx(Maximize2Icon, { size: 14 }) }) }) })), columnState.map((column, index) => {
|
|
17
18
|
if (column.visible === false)
|
|
18
19
|
return null;
|
|
19
20
|
if (loading) {
|
package/dist/Table/types.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { SelectionStatus, TableExportOptions } from "./enums";
|
|
|
4
4
|
import { FilterDefinition, Query } from "../QueryFilter";
|
|
5
5
|
import { DropDownMenuProps } from "../DropDownMenu";
|
|
6
6
|
import { ButtonProps } from "../Button";
|
|
7
|
+
import { SwitchProps } from "../Switch";
|
|
7
8
|
export type StateStorage = {
|
|
8
9
|
enabled: boolean;
|
|
9
10
|
type: "localStorage";
|
|
@@ -11,7 +12,10 @@ export type StateStorage = {
|
|
|
11
12
|
};
|
|
12
13
|
export type RenderOptions = {
|
|
13
14
|
rowData: any;
|
|
14
|
-
onRowUpdated?: (
|
|
15
|
+
onRowUpdated?: (context: {
|
|
16
|
+
rowData: any;
|
|
17
|
+
updatedData: any;
|
|
18
|
+
}) => void;
|
|
15
19
|
};
|
|
16
20
|
export interface ColumnProps {
|
|
17
21
|
columnId?: string;
|
|
@@ -39,6 +43,7 @@ export type SelectionState = {
|
|
|
39
43
|
selectedRowKeys: string[];
|
|
40
44
|
excludedRowKeys: string[];
|
|
41
45
|
selectionStatus: SelectionStatus;
|
|
46
|
+
totalSelected: number;
|
|
42
47
|
};
|
|
43
48
|
export type SortState = {
|
|
44
49
|
dataField: string;
|
|
@@ -90,12 +95,12 @@ export type TableDimensions = {
|
|
|
90
95
|
};
|
|
91
96
|
export type TableContextType = {
|
|
92
97
|
columnState: ColumnState[];
|
|
98
|
+
setColumnState: React.Dispatch<React.SetStateAction<ColumnState[]>>;
|
|
93
99
|
sortState?: SortState | null;
|
|
94
100
|
filterState?: Query | null;
|
|
95
101
|
searchState?: string | null;
|
|
96
102
|
data: any[];
|
|
97
103
|
totalRecords?: number;
|
|
98
|
-
setColumnState: React.Dispatch<React.SetStateAction<ColumnState[]>>;
|
|
99
104
|
keyField?: string;
|
|
100
105
|
tableHeight?: number;
|
|
101
106
|
tableMaxHeight?: number;
|
|
@@ -124,6 +129,7 @@ export type TableContextType = {
|
|
|
124
129
|
manualSearch?: boolean;
|
|
125
130
|
manualExport?: boolean;
|
|
126
131
|
compactState: boolean;
|
|
132
|
+
focusedRowId?: string | number;
|
|
127
133
|
toggleCompact: () => void;
|
|
128
134
|
toggleColumnVisibility: (dataField: string) => void;
|
|
129
135
|
runSearch: (query: string) => void;
|
|
@@ -132,6 +138,7 @@ export type TableContextType = {
|
|
|
132
138
|
selectAllRows: () => void;
|
|
133
139
|
clearSelections: () => void;
|
|
134
140
|
isRowSelected: (row: any) => boolean;
|
|
141
|
+
isRowFocused: (row: any) => boolean;
|
|
135
142
|
onSelectionChange?: onSelectionChangeFn;
|
|
136
143
|
selectRow: (row: any) => void;
|
|
137
144
|
deselectRow: (row: any) => void;
|
|
@@ -140,7 +147,10 @@ export type TableContextType = {
|
|
|
140
147
|
onColumnResize?: (e: OnColumnChangeProps) => void;
|
|
141
148
|
onColumnReorder?: (e: OnColumnChangeProps) => void;
|
|
142
149
|
onTableExport?: OnTableExportFn;
|
|
143
|
-
onRowUpdated
|
|
150
|
+
onRowUpdated?: (context: {
|
|
151
|
+
rowData: any;
|
|
152
|
+
updatedData: any;
|
|
153
|
+
}) => void;
|
|
144
154
|
handleColumnReorder: (dragColumn: ColumnState, dropColumn: ColumnState) => void;
|
|
145
155
|
handleColumnHeaderClick: (column: ColumnState) => void;
|
|
146
156
|
onColumnStateChange?: (e: ColumnState[]) => void;
|
|
@@ -178,6 +188,7 @@ export interface TableProviderProps {
|
|
|
178
188
|
manualExport?: boolean;
|
|
179
189
|
enableSorting?: boolean;
|
|
180
190
|
tableMenuOptions?: TableMenuOptions;
|
|
191
|
+
focusedRowId?: string | number;
|
|
181
192
|
onSelectionChange?: onSelectionChangeFn;
|
|
182
193
|
onActionButtonClick?: (rowData: any) => void;
|
|
183
194
|
onColumnResize?: (e: OnColumnChangeProps) => void;
|
|
@@ -191,7 +202,10 @@ export interface TableProviderProps {
|
|
|
191
202
|
column: ColumnState;
|
|
192
203
|
sort?: SortState | null;
|
|
193
204
|
}) => void;
|
|
194
|
-
onRowUpdated?: (
|
|
205
|
+
onRowUpdated?: (context: {
|
|
206
|
+
rowData: any;
|
|
207
|
+
updatedData: any;
|
|
208
|
+
}) => void;
|
|
195
209
|
}
|
|
196
210
|
export interface TableRowProps {
|
|
197
211
|
rowData: {
|
|
@@ -210,6 +224,19 @@ export type TableFilterOptions = {
|
|
|
210
224
|
filterDefinitions?: FilterDefinition[];
|
|
211
225
|
onFilterChange?: (e: Query) => void;
|
|
212
226
|
};
|
|
227
|
+
export type CustomTableMenuItem = {
|
|
228
|
+
type: "button";
|
|
229
|
+
position?: "left" | "right";
|
|
230
|
+
options: ButtonProps;
|
|
231
|
+
} | {
|
|
232
|
+
type: "menu";
|
|
233
|
+
position?: "left" | "right";
|
|
234
|
+
options: DropDownMenuProps;
|
|
235
|
+
} | {
|
|
236
|
+
type: "switch";
|
|
237
|
+
position?: "left" | "right";
|
|
238
|
+
options: SwitchProps;
|
|
239
|
+
};
|
|
213
240
|
export type TableMenuOptions = {
|
|
214
241
|
enabled?: boolean;
|
|
215
242
|
compactOptions?: {
|
|
@@ -241,6 +268,7 @@ export type TableMenuOptions = {
|
|
|
241
268
|
enabled?: boolean;
|
|
242
269
|
};
|
|
243
270
|
children?: React.ReactNode;
|
|
271
|
+
customMenuItems?: CustomTableMenuItem[];
|
|
244
272
|
};
|
|
245
273
|
export interface TableProps {
|
|
246
274
|
columnProps: ColumnProps[];
|
|
@@ -270,8 +298,12 @@ export interface TableProps {
|
|
|
270
298
|
manualFiltering?: boolean;
|
|
271
299
|
manualExport?: boolean;
|
|
272
300
|
tableMenuOptions?: TableMenuOptions;
|
|
301
|
+
focusedRowId?: string | number;
|
|
273
302
|
children?: React.ReactNode;
|
|
274
|
-
onRowUpdated?: (
|
|
303
|
+
onRowUpdated?: (context: {
|
|
304
|
+
rowData: any;
|
|
305
|
+
updatedData: any;
|
|
306
|
+
}) => void;
|
|
275
307
|
onSelectionChange?: onSelectionChangeFn;
|
|
276
308
|
onActionButtonClick?: (rowData: any) => void;
|
|
277
309
|
onColumnResize?: (e: OnColumnChangeProps) => void;
|
|
@@ -292,7 +324,7 @@ export interface TableProps {
|
|
|
292
324
|
}
|
|
293
325
|
export type TableInstance = {
|
|
294
326
|
columnState: ColumnState[];
|
|
295
|
-
setColumnState:
|
|
327
|
+
setColumnState: (e: ColumnState[]) => void;
|
|
296
328
|
getColumnState: (dataField: string) => ColumnState | undefined;
|
|
297
329
|
onColumnResize?: (e: OnColumnChangeProps) => void;
|
|
298
330
|
onColumnReorder?: (e: OnColumnChangeProps) => void;
|
|
@@ -301,10 +333,12 @@ export type TableInstance = {
|
|
|
301
333
|
getColumnVisibility: (dataField: string) => boolean;
|
|
302
334
|
getSelectedRows: () => any[];
|
|
303
335
|
getSelectedRowKeys: () => string[];
|
|
336
|
+
getSelectionTotal: () => number;
|
|
304
337
|
selectRow: (row: any) => void;
|
|
305
338
|
deselectRow: (row: any) => void;
|
|
306
339
|
selectAllRows: () => void;
|
|
307
340
|
runSearch: (query: string) => void;
|
|
308
341
|
clearSearch: () => void;
|
|
309
342
|
clearSelections: () => void;
|
|
343
|
+
getTableState: () => TableState;
|
|
310
344
|
};
|
|
@@ -30,13 +30,21 @@ const InsertMenuOverlay = styled.div `
|
|
|
30
30
|
opacity: ${({ $visible }) => ($visible ? 1 : 0)};
|
|
31
31
|
pointer-events: ${({ $visible }) => ($visible ? "auto" : "none")};
|
|
32
32
|
transform: ${({ $visible }) => $visible ? "translateY(0)" : "translateY(-4px)"};
|
|
33
|
-
transition:
|
|
33
|
+
transition:
|
|
34
|
+
opacity 0.2s ease,
|
|
35
|
+
transform 0.2s ease;
|
|
34
36
|
`;
|
|
35
37
|
const StyledInsertSelectBox = styled(SelectBox) `
|
|
36
38
|
width: 100%;
|
|
37
39
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
38
40
|
border: 1px solid ${({ theme }) => theme.palette.primary.main};
|
|
39
41
|
`;
|
|
42
|
+
const StyledMoreHorizontal = styled(MoreHorizontal) `
|
|
43
|
+
color: ${({ theme }) => theme.palette.text.secondary};
|
|
44
|
+
&:hover {
|
|
45
|
+
color: ${({ theme }) => theme.palette.text.primary};
|
|
46
|
+
}
|
|
47
|
+
`;
|
|
40
48
|
const TextAreaInput = forwardRef((props, ref) => {
|
|
41
49
|
const {
|
|
42
50
|
// UI
|
|
@@ -132,7 +140,7 @@ const TextAreaInput = forwardRef((props, ref) => {
|
|
|
132
140
|
height: 16,
|
|
133
141
|
width: 16,
|
|
134
142
|
},
|
|
135
|
-
}, children: _jsx(
|
|
143
|
+
}, children: _jsx(StyledMoreHorizontal, { size: 16 }) })) : null, children: label })), _jsxs(TextAreaWrapper, { children: [_jsx(TextArea, Object.assign({ ref: mergedRef, size: size, maxRows: maxRows, minRows: minRows, onHeightChange: onHeightChange, cacheMeasurements: cacheMeasurements }, rest)), (insertableItems === null || insertableItems === void 0 ? void 0 : insertableItems.length) && (_jsx(InsertMenuOverlay, { ref: insertMenuRef, "$visible": showInsertMenu, children: _jsx(StyledInsertSelectBox, { data: insertableItems, placeholder: "Select item to insert...", searchable: true, clearable: false, arrow: false, focused: showInsertMenu, openOnFocus: true, triggerOpen: triggerSelectBoxOpen, onOpened: handleSelectBoxOpened, onChange: handleInsertSelect, size: size }) }))] })] }));
|
|
136
144
|
});
|
|
137
145
|
TextAreaInput.displayName = "TextAreaInput";
|
|
138
146
|
export default TextAreaInput;
|
|
@@ -7,6 +7,8 @@ interface TooltipProps {
|
|
|
7
7
|
sideOffset?: number;
|
|
8
8
|
align?: "start" | "center" | "end";
|
|
9
9
|
delayDuration?: number;
|
|
10
|
+
/** When true, the tooltip stays open while hovering over its content */
|
|
11
|
+
hoverableContent?: boolean;
|
|
10
12
|
}
|
|
11
|
-
declare const Tooltip: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<TooltipProps, never>> & string & Omit<({ className, children, content, side, sideOffset, align, delayDuration, }: TooltipProps) => string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined, keyof import("react").Component<any, {}, any>>;
|
|
13
|
+
declare const Tooltip: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<TooltipProps, never>> & string & Omit<({ className, children, content, side, sideOffset, align, delayDuration, hoverableContent, }: TooltipProps) => string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined, keyof import("react").Component<any, {}, any>>;
|
|
12
14
|
export default Tooltip;
|
package/dist/Tooltip/Tooltip.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import styled from "styled-components";
|
|
3
3
|
import * as RadixTooltip from "@radix-ui/react-tooltip";
|
|
4
|
-
const Tooltip = styled(({ className, children, content, side = "right", sideOffset = 15, align = "start", delayDuration =
|
|
4
|
+
const Tooltip = styled(({ className, children, content, side = "right", sideOffset = 15, align = "start", delayDuration = 300, hoverableContent = false, }) => {
|
|
5
5
|
if (!content)
|
|
6
6
|
return children;
|
|
7
|
-
return (_jsx(RadixTooltip.Provider, { delayDuration: delayDuration
|
|
7
|
+
return (_jsx(RadixTooltip.Provider, { delayDuration: delayDuration, skipDelayDuration: 0, disableHoverableContent: !hoverableContent, children: _jsxs(RadixTooltip.Root, { children: [_jsx(RadixTooltip.Trigger, { asChild: true, children: children }), _jsx(RadixTooltip.Portal, { children: _jsx(RadixTooltip.Content, { className: className, side: side || "right", sideOffset: sideOffset || 15, align: align || "start", onClick: (e) => e.stopPropagation(), children: content }) })] }) }));
|
|
8
8
|
}) `
|
|
9
|
-
pointer-events: none;
|
|
9
|
+
pointer-events: ${({ hoverableContent }) => hoverableContent ? "auto" : "none"};
|
|
10
10
|
z-index: 999999;
|
|
11
11
|
background-color: ${({ theme }) => theme.palette.background.default};
|
|
12
12
|
padding: 15px;
|
package/dist/index.d.ts
CHANGED
|
@@ -8,14 +8,13 @@ export * from "./Grid";
|
|
|
8
8
|
export * from "./TextInput";
|
|
9
9
|
export * from "./SelectBox";
|
|
10
10
|
export * from "./Button";
|
|
11
|
+
export * from "./DropDownMenu";
|
|
12
|
+
export * from "./Switch";
|
|
13
|
+
export * from "./Alert";
|
|
11
14
|
export { default as IconButton } from "./IconButton";
|
|
12
|
-
export { default as DropDownMenu } from "./DropDownMenu";
|
|
13
|
-
export type { DropDownItem } from "./DropDownMenu";
|
|
14
15
|
export { default as DateInput } from "./DateInput";
|
|
15
16
|
export { default as TextArea } from "./TextArea";
|
|
16
17
|
export { default as TextAreaInput } from "./TextAreaInput";
|
|
17
|
-
export { default as SelectableTextArea } from "./SelectableTextArea";
|
|
18
|
-
export type { SelectableTextAreaProps } from "./SelectableTextArea";
|
|
19
18
|
export { default as TagBox } from "./TagBox";
|
|
20
19
|
export type { TagBoxProps, TagboxOption } from "./TagBox";
|
|
21
20
|
export { default as FieldLabel } from "./FieldLabel";
|
|
@@ -23,7 +22,6 @@ export { default as Modal } from "./Modal";
|
|
|
23
22
|
export { default as Flyout } from "./Flyout";
|
|
24
23
|
export { FlyoutHeader, FlyoutTitle } from "./Flyout";
|
|
25
24
|
export { default as FileInputField } from "./FileInputField";
|
|
26
|
-
export { default as Switch } from "./Switch";
|
|
27
25
|
export { default as CheckBox } from "./CheckBox";
|
|
28
26
|
export { default as Input } from "./Input";
|
|
29
27
|
export { default as Tooltip } from "./Tooltip";
|
package/dist/index.js
CHANGED
|
@@ -3,19 +3,19 @@ export * from "./Grid";
|
|
|
3
3
|
export * from "./TextInput";
|
|
4
4
|
export * from "./SelectBox";
|
|
5
5
|
export * from "./Button";
|
|
6
|
+
export * from "./DropDownMenu";
|
|
7
|
+
export * from "./Switch";
|
|
8
|
+
export * from "./Alert";
|
|
6
9
|
export { default as IconButton } from "./IconButton";
|
|
7
|
-
export { default as DropDownMenu } from "./DropDownMenu";
|
|
8
10
|
export { default as DateInput } from "./DateInput";
|
|
9
11
|
export { default as TextArea } from "./TextArea";
|
|
10
12
|
export { default as TextAreaInput } from "./TextAreaInput";
|
|
11
|
-
export { default as SelectableTextArea } from "./SelectableTextArea";
|
|
12
13
|
export { default as TagBox } from "./TagBox";
|
|
13
14
|
export { default as FieldLabel } from "./FieldLabel";
|
|
14
15
|
export { default as Modal } from "./Modal";
|
|
15
16
|
export { default as Flyout } from "./Flyout";
|
|
16
17
|
export { FlyoutHeader, FlyoutTitle } from "./Flyout";
|
|
17
18
|
export { default as FileInputField } from "./FileInputField";
|
|
18
|
-
export { default as Switch } from "./Switch";
|
|
19
19
|
export { default as CheckBox } from "./CheckBox";
|
|
20
20
|
export { default as Input } from "./Input";
|
|
21
21
|
export { default as Tooltip } from "./Tooltip";
|
package/dist/theme/variants.js
CHANGED
|
@@ -173,8 +173,43 @@ const lightVariant = {
|
|
|
173
173
|
default: "transparent",
|
|
174
174
|
primary: customBlue[500],
|
|
175
175
|
secondary: "#a1a1a1",
|
|
176
|
+
alternate: "#f0f0f0",
|
|
176
177
|
error: "#f44336",
|
|
177
178
|
},
|
|
179
|
+
text: {
|
|
180
|
+
default: "#000",
|
|
181
|
+
primary: customBlue[500],
|
|
182
|
+
error: "#f44336",
|
|
183
|
+
secondary: "#a1a1a1",
|
|
184
|
+
alternate: "#000",
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
alert: {
|
|
188
|
+
info: {
|
|
189
|
+
background: "#3f88de25",
|
|
190
|
+
border: "#3f88de50",
|
|
191
|
+
color: "#357fff",
|
|
192
|
+
},
|
|
193
|
+
success: {
|
|
194
|
+
background: "#4bef2a25",
|
|
195
|
+
border: "#4bef2a90",
|
|
196
|
+
color: "#2eb333",
|
|
197
|
+
},
|
|
198
|
+
warning: {
|
|
199
|
+
background: "#eaa82425",
|
|
200
|
+
border: "#eaa82450",
|
|
201
|
+
color: "#d18f0b",
|
|
202
|
+
},
|
|
203
|
+
error: {
|
|
204
|
+
background: "#ee1d1d25",
|
|
205
|
+
border: "#ee1d1d50",
|
|
206
|
+
color: "#e41a1a",
|
|
207
|
+
},
|
|
208
|
+
default: {
|
|
209
|
+
background: "#fff",
|
|
210
|
+
border: "#cacaca",
|
|
211
|
+
color: "#000000",
|
|
212
|
+
},
|
|
178
213
|
},
|
|
179
214
|
};
|
|
180
215
|
const darkVariant = merge(lightVariant, {
|
|
@@ -282,11 +317,41 @@ const darkVariant = merge(lightVariant, {
|
|
|
282
317
|
default: "transparent",
|
|
283
318
|
primary: customBlue[500],
|
|
284
319
|
secondary: "#3f3f3f",
|
|
320
|
+
alternate: "#3f3f3f",
|
|
285
321
|
error: "#f44336",
|
|
286
322
|
},
|
|
287
323
|
text: {
|
|
288
|
-
primary:
|
|
324
|
+
primary: customBlue[500],
|
|
325
|
+
error: "#f44336",
|
|
289
326
|
secondary: "rgba(255, 255, 255, 0.6)",
|
|
327
|
+
alternate: "rgba(255, 255, 255, 0.6)",
|
|
328
|
+
},
|
|
329
|
+
},
|
|
330
|
+
alert: {
|
|
331
|
+
info: {
|
|
332
|
+
background: "#3f88de25",
|
|
333
|
+
border: "#3f88de50",
|
|
334
|
+
color: "#75a8ff",
|
|
335
|
+
},
|
|
336
|
+
success: {
|
|
337
|
+
background: "#4bef2a25",
|
|
338
|
+
border: "#4bef2a50",
|
|
339
|
+
color: "#5fd964",
|
|
340
|
+
},
|
|
341
|
+
warning: {
|
|
342
|
+
background: "#eaa82425",
|
|
343
|
+
border: "#eaa82450",
|
|
344
|
+
color: "#da9c21",
|
|
345
|
+
},
|
|
346
|
+
error: {
|
|
347
|
+
background: "#ee1d1d25",
|
|
348
|
+
border: "#ee1d1d50",
|
|
349
|
+
color: "#e41a1a",
|
|
350
|
+
},
|
|
351
|
+
default: {
|
|
352
|
+
background: "#222222",
|
|
353
|
+
border: "rgba(255, 255, 255, 0.15)",
|
|
354
|
+
color: "#ffffff99",
|
|
290
355
|
},
|
|
291
356
|
},
|
|
292
357
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@monolith-forensics/monolith-ui",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.104",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"author": "Matt Danner (Monolith Forensics LLC)",
|
|
@@ -56,7 +56,6 @@
|
|
|
56
56
|
"moment": "^2.29.1",
|
|
57
57
|
"overlayscrollbars": "^2.6.0",
|
|
58
58
|
"overlayscrollbars-react": "^0.5.6",
|
|
59
|
-
"react-dom": "^18.3.1",
|
|
60
59
|
"react-dropzone": "^14.2.3",
|
|
61
60
|
"react-icons": "^5.2.1",
|
|
62
61
|
"react-pdf": "^9.1.1",
|
|
@@ -71,7 +70,8 @@
|
|
|
71
70
|
},
|
|
72
71
|
"peerDependencies": {
|
|
73
72
|
"@tanstack/react-query": "^5.59.16",
|
|
74
|
-
"react": "18.
|
|
73
|
+
"react": "^18.3.1",
|
|
74
|
+
"react-dom": "^18.3.1"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
77
|
"@tanstack/react-query": "5.59.16",
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
-
import { FilterDefinition } from "./types";
|
|
3
|
-
import { DropDownItem } from "../DropDownMenu";
|
|
4
|
-
/** Override Filters Type
|
|
5
|
-
* some properties have been overridden to allow for partial overrides
|
|
6
|
-
*/
|
|
7
|
-
type FilterDefinitionOverride = Partial<Omit<FilterDefinition, "query" | "dataField">> & {
|
|
8
|
-
dataField: string;
|
|
9
|
-
query?: Omit<Partial<UseQueryOptions>, "select" | "queryKey"> & {
|
|
10
|
-
select?: (data: unknown) => DropDownItem[];
|
|
11
|
-
queryKey?: UseQueryOptions["queryKey"];
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
export interface UseFilterHelperParams {
|
|
15
|
-
filterDef: FilterDefinition[];
|
|
16
|
-
overrides?: FilterDefinitionOverride[];
|
|
17
|
-
}
|
|
18
|
-
export type UseFilterHelperType = (p: UseFilterHelperParams) => FilterDefinition[];
|
|
19
|
-
export declare const useFilterHelper: UseFilterHelperType;
|
|
20
|
-
export {};
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import { useQueries } from "@tanstack/react-query";
|
|
13
|
-
const mergeOverrides = (filterDef, overrides) => {
|
|
14
|
-
return filterDef.map((f) => {
|
|
15
|
-
var _a, _b, _c;
|
|
16
|
-
const override = overrides.find((o) => o.dataField === f.dataField);
|
|
17
|
-
if (!override) {
|
|
18
|
-
return f;
|
|
19
|
-
}
|
|
20
|
-
const { query, dropDownOptions } = override, rest = __rest(override, ["query", "dropDownOptions"]);
|
|
21
|
-
// Handle merge directly on query and dropDownOptions
|
|
22
|
-
// prevents overriding the entire query object
|
|
23
|
-
// allows user to override specific properties
|
|
24
|
-
if (query) {
|
|
25
|
-
f.query = Object.assign(Object.assign(Object.assign({}, f.query), query), { queryFn: query.queryFn || ((_a = f === null || f === void 0 ? void 0 : f.query) === null || _a === void 0 ? void 0 : _a.queryFn) || (() => { }), queryKey: query.queryKey || ((_b = f === null || f === void 0 ? void 0 : f.query) === null || _b === void 0 ? void 0 : _b.queryKey) || [], select: query.select || ((_c = f === null || f === void 0 ? void 0 : f.query) === null || _c === void 0 ? void 0 : _c.select) || (() => []) });
|
|
26
|
-
}
|
|
27
|
-
if (dropDownOptions) {
|
|
28
|
-
f.dropDownOptions = Object.assign(Object.assign({}, f.dropDownOptions), dropDownOptions);
|
|
29
|
-
}
|
|
30
|
-
// Merge override with original filter def
|
|
31
|
-
return Object.assign(Object.assign({}, f), rest);
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
export const useFilterHelper = ({ filterDef, overrides, }) => {
|
|
35
|
-
let _filterDef = filterDef;
|
|
36
|
-
if (!!overrides) {
|
|
37
|
-
_filterDef = mergeOverrides(filterDef, overrides);
|
|
38
|
-
}
|
|
39
|
-
// Keeps track of filters that have queries
|
|
40
|
-
const queryIndex = [];
|
|
41
|
-
// Get query options from filter defs
|
|
42
|
-
const queries = filterDef
|
|
43
|
-
.filter((f, i) => {
|
|
44
|
-
// Track array index of filter def that has a query
|
|
45
|
-
const hasQuery = f.query !== undefined;
|
|
46
|
-
hasQuery && queryIndex.push(i);
|
|
47
|
-
return hasQuery;
|
|
48
|
-
})
|
|
49
|
-
.map((filter) => filter.query);
|
|
50
|
-
// run queries from filter defs
|
|
51
|
-
const result = useQueries({
|
|
52
|
-
queries,
|
|
53
|
-
});
|
|
54
|
-
// Add useQueries result data to filter def as options
|
|
55
|
-
queryIndex.forEach((index, i) => {
|
|
56
|
-
var _a;
|
|
57
|
-
// User query index to add useQueries result data to filter def as options
|
|
58
|
-
filterDef[index].selectOptions = (_a = result[i]) === null || _a === void 0 ? void 0 : _a.data;
|
|
59
|
-
});
|
|
60
|
-
return filterDef;
|
|
61
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { DropDownItem } from "../DropDownMenu";
|
|
2
|
-
export interface SelectableTextAreaProps {
|
|
3
|
-
label?: string;
|
|
4
|
-
data?: Array<{
|
|
5
|
-
label: string;
|
|
6
|
-
value: string;
|
|
7
|
-
}>;
|
|
8
|
-
searchable?: boolean;
|
|
9
|
-
allowCustomValue?: boolean;
|
|
10
|
-
required?: boolean;
|
|
11
|
-
error?: string;
|
|
12
|
-
description?: string;
|
|
13
|
-
value?: string;
|
|
14
|
-
onChange?: (value: string) => void;
|
|
15
|
-
selectProps?: Record<string, any>;
|
|
16
|
-
textAreaPlaceholder?: string;
|
|
17
|
-
textAreaMinRows?: number;
|
|
18
|
-
textAreaMaxRows?: number;
|
|
19
|
-
textAreaProps?: Record<string, any>;
|
|
20
|
-
initialValue?: string;
|
|
21
|
-
actionMenuData?: Array<{
|
|
22
|
-
label: string;
|
|
23
|
-
value: string;
|
|
24
|
-
}>;
|
|
25
|
-
onActionMenuSelect?: (item: DropDownItem) => void;
|
|
26
|
-
}
|
|
27
|
-
declare function SelectableTextArea({ label, data, searchable, allowCustomValue, required, error, description, selectProps, value, onChange, textAreaPlaceholder, textAreaMinRows, textAreaMaxRows, textAreaProps, initialValue, actionMenuData, onActionMenuSelect, }: SelectableTextAreaProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
-
declare namespace SelectableTextArea {
|
|
29
|
-
var displayName: string;
|
|
30
|
-
}
|
|
31
|
-
export default SelectableTextArea;
|