@monolith-forensics/monolith-ui 1.3.30 → 1.3.32
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import { useTheme } from "styled-components";
|
|
3
3
|
import { useFloating, flip, offset, FloatingPortal, autoUpdate, } from "@floating-ui/react";
|
|
4
4
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
5
5
|
import { Input, FieldLabel, Tooltip, Loader } from "..";
|
|
@@ -9,12 +9,6 @@ import { DEFAULT_DROPDOWN_HEIGHT, DROPDOWN_OFFSET, getEmptyMessage, KEYBOARD_KEY
|
|
|
9
9
|
import { StyledInputContainer, StyledInnerItemContainer, EmptyComponent, GroupTitle, ActionMenu, StyledItem, StyledContainer, } from "./select-box.styled-components";
|
|
10
10
|
// Re-export for backward compatibility
|
|
11
11
|
export { StyledInputContainer };
|
|
12
|
-
const StyledInput = styled(Input) `
|
|
13
|
-
&[disabled] {
|
|
14
|
-
opacity: 1;
|
|
15
|
-
pointer-events: none;
|
|
16
|
-
}
|
|
17
|
-
`;
|
|
18
12
|
export const SelectBox = ({ className, data = [], placeholder = "Select...", arrow = true, onChange, onSearch, searchFn, onScroll, loading, defaultValue, value, size = "sm", variant = "outlined", width = "100%", allowCustomValue = false, searchable = false, clearable = false, label, description, required = false, error, openOnFocus = true, renderOption, actionComponent, focused, grouped, OptionTooltip, // Custom tooltip component for search menu items
|
|
19
13
|
DropDownProps = {}, debounceTime = 175, sort = false, disabled = false, }) => {
|
|
20
14
|
var _a, _b, _c, _d, _e, _f;
|
|
@@ -361,7 +355,7 @@ DropDownProps = {}, debounceTime = 175, sort = false, disabled = false, }) => {
|
|
|
361
355
|
// ============================================================================
|
|
362
356
|
// Render
|
|
363
357
|
// ============================================================================
|
|
364
|
-
return (_jsxs(StyledContainer, { className: className, children: [label && (_jsx(FieldLabel, { error: error, asterisk: required, size: size, description: description, children: label })), _jsxs(StyledInputContainer, { ref: refs.setReference, onMouseDown: () => setIsOpen(true), width: width, onKeyDown: handleKeyDown, "data-open": isOpen, "data-disabled": disabled, tabIndex: disabled ? -1 : 0, children: [_jsx(
|
|
358
|
+
return (_jsxs(StyledContainer, { className: className, children: [label && (_jsx(FieldLabel, { error: error, asterisk: required, size: size, description: description, children: label })), _jsxs(StyledInputContainer, { ref: refs.setReference, onMouseDown: () => setIsOpen(true), width: width, onKeyDown: handleKeyDown, "data-open": isOpen, "data-disabled": disabled, tabIndex: disabled ? -1 : 0, children: [_jsx(Input, { ref: inputRef, value: inputValue, onChange: handleInputChange, onFocus: handleFocus, autoFocus: focused, disabled: disabled, tabIndex: disabled ? -1 : 0, placeholder: placeholder, size: size, readOnly: !searchable && !allowCustomValue, "data-button-right": arrow || clearable, style: isOpen ? { borderColor: theme.palette.primary.main } : {} }), renderActionButton()] }), isOpen && (_jsx(FloatingPortal, { preserveTabOrder: true, children: _jsx(StyledFloatContainer, { ref: (ref) => {
|
|
365
359
|
containerRef.current = ref;
|
|
366
360
|
refs.setFloating(ref);
|
|
367
361
|
}, style: floatingStyles, className: "mfFloating", children: _jsxs(StyledContent, Object.assign({ className: "mfFloatingContent", style: {
|
|
@@ -40,6 +40,11 @@ export const StyledInputContainer = styled.div `
|
|
|
40
40
|
pointer-events: none;
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
+
|
|
44
|
+
input[disabled] {
|
|
45
|
+
opacity: 1 !important;
|
|
46
|
+
pointer-events: none !important;
|
|
47
|
+
}
|
|
43
48
|
`;
|
|
44
49
|
export const StyledInnerItemContainer = styled.div `
|
|
45
50
|
overflow-y: auto;
|
package/dist/Table/types.d.ts
CHANGED
|
@@ -12,7 +12,10 @@ export type StateStorage = {
|
|
|
12
12
|
};
|
|
13
13
|
export type RenderOptions = {
|
|
14
14
|
rowData: any;
|
|
15
|
-
onRowUpdated?: (
|
|
15
|
+
onRowUpdated?: (context: {
|
|
16
|
+
rowData: any;
|
|
17
|
+
updatedData: any;
|
|
18
|
+
}) => void;
|
|
16
19
|
};
|
|
17
20
|
export interface ColumnProps {
|
|
18
21
|
columnId?: string;
|
|
@@ -144,7 +147,10 @@ export type TableContextType = {
|
|
|
144
147
|
onColumnResize?: (e: OnColumnChangeProps) => void;
|
|
145
148
|
onColumnReorder?: (e: OnColumnChangeProps) => void;
|
|
146
149
|
onTableExport?: OnTableExportFn;
|
|
147
|
-
onRowUpdated
|
|
150
|
+
onRowUpdated?: (context: {
|
|
151
|
+
rowData: any;
|
|
152
|
+
updatedData: any;
|
|
153
|
+
}) => void;
|
|
148
154
|
handleColumnReorder: (dragColumn: ColumnState, dropColumn: ColumnState) => void;
|
|
149
155
|
handleColumnHeaderClick: (column: ColumnState) => void;
|
|
150
156
|
onColumnStateChange?: (e: ColumnState[]) => void;
|
|
@@ -196,7 +202,10 @@ export interface TableProviderProps {
|
|
|
196
202
|
column: ColumnState;
|
|
197
203
|
sort?: SortState | null;
|
|
198
204
|
}) => void;
|
|
199
|
-
onRowUpdated?: (
|
|
205
|
+
onRowUpdated?: (context: {
|
|
206
|
+
rowData: any;
|
|
207
|
+
updatedData: any;
|
|
208
|
+
}) => void;
|
|
200
209
|
}
|
|
201
210
|
export interface TableRowProps {
|
|
202
211
|
rowData: {
|
|
@@ -291,7 +300,10 @@ export interface TableProps {
|
|
|
291
300
|
tableMenuOptions?: TableMenuOptions;
|
|
292
301
|
focusedRowId?: string | number;
|
|
293
302
|
children?: React.ReactNode;
|
|
294
|
-
onRowUpdated?: (
|
|
303
|
+
onRowUpdated?: (context: {
|
|
304
|
+
rowData: any;
|
|
305
|
+
updatedData: any;
|
|
306
|
+
}) => void;
|
|
295
307
|
onSelectionChange?: onSelectionChangeFn;
|
|
296
308
|
onActionButtonClick?: (rowData: any) => void;
|
|
297
309
|
onColumnResize?: (e: OnColumnChangeProps) => void;
|