@monolith-forensics/monolith-ui 1.1.85 → 1.1.86
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/Table/Table.d.ts +4 -2
- package/dist/Table/Table.js +15 -17
- package/dist/Table/index.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/Table/Table.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "overlayscrollbars/overlayscrollbars.css";
|
|
2
|
-
interface ColumnProps {
|
|
2
|
+
export interface ColumnProps {
|
|
3
3
|
className?: string;
|
|
4
4
|
key?: string | number;
|
|
5
5
|
dataField: string;
|
|
@@ -7,6 +7,7 @@ interface ColumnProps {
|
|
|
7
7
|
columnId?: string | number;
|
|
8
8
|
allowSorting?: boolean;
|
|
9
9
|
allowReorder?: boolean;
|
|
10
|
+
allowResize?: boolean;
|
|
10
11
|
resizeEnabled?: boolean;
|
|
11
12
|
width?: number;
|
|
12
13
|
sorting?: {
|
|
@@ -21,6 +22,7 @@ interface ColumnProps {
|
|
|
21
22
|
}
|
|
22
23
|
interface ColumnType extends React.FunctionComponent<ColumnProps> {
|
|
23
24
|
displayName: string;
|
|
25
|
+
props?: ColumnProps;
|
|
24
26
|
}
|
|
25
27
|
export declare const Column: ColumnType;
|
|
26
28
|
interface onResizeProps {
|
|
@@ -58,7 +60,7 @@ export declare const useTable: () => {
|
|
|
58
60
|
};
|
|
59
61
|
interface TableProps {
|
|
60
62
|
className?: string;
|
|
61
|
-
children:
|
|
63
|
+
children: ColumnType | ColumnType[];
|
|
62
64
|
data: {
|
|
63
65
|
[key: string]: any;
|
|
64
66
|
}[];
|
package/dist/Table/Table.js
CHANGED
|
@@ -23,7 +23,7 @@ import moment from "moment";
|
|
|
23
23
|
import { CheckBox } from "..";
|
|
24
24
|
import { Themes } from "../theme";
|
|
25
25
|
const MIN_COLUMN_WIDTH = 125;
|
|
26
|
-
export const Column = (
|
|
26
|
+
export const Column = () => {
|
|
27
27
|
return null;
|
|
28
28
|
};
|
|
29
29
|
Column.displayName = "Column";
|
|
@@ -443,23 +443,21 @@ const Table = styled(({ className, children, data, rowHeight, headerHeight, tabl
|
|
|
443
443
|
children = useMemo(() => {
|
|
444
444
|
return Array.isArray(children) ? children : [children];
|
|
445
445
|
}, [children]);
|
|
446
|
-
let columns = useMemo(() => {
|
|
447
|
-
var _a, _b;
|
|
448
|
-
return (
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
: column.props.resizeEnabled,
|
|
460
|
-
});
|
|
446
|
+
let columns = useMemo(() => children === null || children === void 0 ? void 0 : children.map((column) => {
|
|
447
|
+
var _a, _b, _c;
|
|
448
|
+
return cloneElement(column, {
|
|
449
|
+
columnId: shortUUID.generate(),
|
|
450
|
+
allowResize: allowColumnResize !== undefined
|
|
451
|
+
? allowColumnResize
|
|
452
|
+
: (_a = column === null || column === void 0 ? void 0 : column.props) === null || _a === void 0 ? void 0 : _a.allowResize,
|
|
453
|
+
allowReorder: allowColumnReorder !== undefined
|
|
454
|
+
? allowColumnReorder
|
|
455
|
+
: (_b = column === null || column === void 0 ? void 0 : column.props) === null || _b === void 0 ? void 0 : _b.allowReorder,
|
|
456
|
+
resizeEnabled: allowColumnResize !== undefined
|
|
457
|
+
? allowColumnResize
|
|
458
|
+
: (_c = column === null || column === void 0 ? void 0 : column.props) === null || _c === void 0 ? void 0 : _c.resizeEnabled,
|
|
461
459
|
});
|
|
462
|
-
}, [children]);
|
|
460
|
+
}), [children]);
|
|
463
461
|
const [columnOrder, setColumnOrder] = useState(columns.map((col, index) => {
|
|
464
462
|
var _a, _b;
|
|
465
463
|
return {
|
package/dist/Table/index.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ export { default as Tooltip } from "./Tooltip";
|
|
|
25
25
|
export { default as Pill } from "./Pill";
|
|
26
26
|
export { default as Calendar } from "./Calendar";
|
|
27
27
|
export { default as Table } from "./Table";
|
|
28
|
+
export type { ColumnProps } from "./Table";
|
|
28
29
|
export { Column } from "./Table";
|
|
29
30
|
export { default as MonolithUIProvider } from "./MonolithUIProvider";
|
|
30
31
|
export { useMonolithUITheme } from "./MonolithUIProvider";
|