mig-schema-table 3.0.5 → 3.0.7
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.
|
@@ -22,7 +22,6 @@ export interface ISchemaTableComponentProps<T> {
|
|
|
22
22
|
schema: oas31.SchemaObject;
|
|
23
23
|
searchPlaceholder?: string;
|
|
24
24
|
style?: React.CSSProperties;
|
|
25
|
-
tableTitle?: string;
|
|
26
25
|
width: number;
|
|
27
26
|
}
|
|
28
|
-
export default function SchemaTable<T>({ Heading, checkedIndexes, config, customElement, data, defaultSortAsc, defaultSortColumn, getRowClassName, getRowSelected, maxHeight, isSearchable, isSortable, onCheckedIndexesChange, onRowClick, rowHeight, schema, searchPlaceholder, style,
|
|
27
|
+
export default function SchemaTable<T>({ Heading, checkedIndexes, config, customElement, data, defaultSortAsc, defaultSortColumn, getRowClassName, getRowSelected, maxHeight, isSearchable, isSortable, onCheckedIndexesChange, onRowClick, rowHeight, schema, searchPlaceholder, style, width, }: ISchemaTableComponentProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,7 +5,7 @@ import { localeFormat } from "../inc/date";
|
|
|
5
5
|
import { uncamel } from "../inc/string";
|
|
6
6
|
import Th from "./Th";
|
|
7
7
|
import { SELECT_ALL_COLUMN_NAME, SELECT_ALL_COLUMN_WIDTH } from "./constants";
|
|
8
|
-
export default function SchemaTable({ Heading = VariableSizeList, checkedIndexes, config, customElement, data, defaultSortAsc = false, defaultSortColumn, getRowClassName, getRowSelected, maxHeight, isSearchable, isSortable, onCheckedIndexesChange, onRowClick, rowHeight = 36, schema, searchPlaceholder, style,
|
|
8
|
+
export default function SchemaTable({ Heading = VariableSizeList, checkedIndexes, config, customElement, data, defaultSortAsc = false, defaultSortColumn, getRowClassName, getRowSelected, maxHeight, isSearchable, isSortable, onCheckedIndexesChange, onRowClick, rowHeight = 36, schema, searchPlaceholder, style, width, }) {
|
|
9
9
|
const [sortColumn, setSortColumn] = React.useState(defaultSortColumn);
|
|
10
10
|
const [sortAsc, setSortAsc] = React.useState(defaultSortAsc);
|
|
11
11
|
const [searchQuery, setSearchQuery] = React.useState("");
|
|
@@ -314,5 +314,5 @@ export default function SchemaTable({ Heading = VariableSizeList, checkedIndexes
|
|
|
314
314
|
? rowsMaxHeight
|
|
315
315
|
: rowsHeight;
|
|
316
316
|
}, [maxHeight, isSearchable, rowCount, rowHeight]);
|
|
317
|
-
return (_jsxs("div", Object.assign({ className: `schema-table${onRowClick ? " schema-table--clickable-rows" : ""}`, style: Object.assign(Object.assign({}, style), { width: rowWidth }) }, { children: [
|
|
317
|
+
return (_jsxs("div", Object.assign({ className: `schema-table${onRowClick ? " schema-table--clickable-rows" : ""}`, style: Object.assign(Object.assign({}, style), { width: rowWidth }) }, { children: [_jsxs("div", Object.assign({ className: "schema-table__action-container" }, { children: [_jsx("div", Object.assign({ style: { flex: 1 } }, { children: isSearchable ? (_jsx("input", { type: "text", placeholder: searchPlaceholder || "Search...", value: searchQuery, onChange: onSearchChange, autoFocus: true })) : null })), customElement] })), _jsx(Heading, Object.assign({ height: 50, itemCount: columnCount, itemSize: getColumnWidth, layout: "horizontal", width: rowWidth, sortAsc: sortAsc, setSortAsc: setSortAsc, setSortColumn: setSortColumn, sortColumn: sortColumn, sortedRenderData: sortedRenderData, className: "schema-table__th-row" }, { children: SchemaTableTh }), `thead_${rowWidth}_${sortColumn}_${sortAsc}_${searchQuery}`), _jsx(VariableSizeGrid, Object.assign({ className: "schema-table__tbody", height: tableBodyHeight, width: rowWidth, columnWidth: getColumnWidth, rowHeight: getRowHeight, columnCount: columnCount, rowCount: rowCount }, { children: Td }), `tbody_${rowWidth}_${sortColumn}_${sortAsc}_${searchQuery}_${columnCount}`)] })));
|
|
318
318
|
}
|
package/dist/index.css
CHANGED
|
@@ -10,11 +10,14 @@
|
|
|
10
10
|
overflow: hidden !important;
|
|
11
11
|
}
|
|
12
12
|
.schema-table__th {
|
|
13
|
-
overflow: hidden;
|
|
14
13
|
background-color: #eee;
|
|
15
|
-
padding-left: 8px;
|
|
16
14
|
align-items: center;
|
|
17
15
|
}
|
|
16
|
+
.schema-table__th div {
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
white-space: nowrap;
|
|
19
|
+
text-overflow: ellipsis;
|
|
20
|
+
}
|
|
18
21
|
.schema-table__th,
|
|
19
22
|
.schema-table__th button {
|
|
20
23
|
font-weight: bold;
|
|
@@ -54,16 +57,13 @@
|
|
|
54
57
|
.schema-table button {
|
|
55
58
|
border: 1px solid transparent;
|
|
56
59
|
}
|
|
57
|
-
.schema-
|
|
60
|
+
.schema-table__action-container {
|
|
58
61
|
display: flex;
|
|
59
62
|
flex-direction: row;
|
|
63
|
+
padding-bottom: 1rem;
|
|
60
64
|
}
|
|
61
|
-
.schema-
|
|
65
|
+
.schema-table__action-container input {
|
|
62
66
|
width: 30%;
|
|
63
67
|
border-radius: 8px;
|
|
64
68
|
padding: 4px 10px;
|
|
65
69
|
}
|
|
66
|
-
.schema-table .action-container img {
|
|
67
|
-
margin-right: 1.5rem;
|
|
68
|
-
margin-top: 5px;
|
|
69
|
-
}
|