mig-schema-table 3.0.85 → 3.0.87
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.
|
@@ -8,7 +8,6 @@ interface ITdProps<T> {
|
|
|
8
8
|
data: T[];
|
|
9
9
|
getRowClassName?: (rowData: T, dataIndex: number, filteredSortedData: IRenderData[]) => string;
|
|
10
10
|
getRowSelected?: (rowData: T, dataIndex: number) => boolean;
|
|
11
|
-
rowHeight: number;
|
|
12
11
|
rowIndex: number;
|
|
13
12
|
onCheckedIndexesChange?: (dataIndex: number[]) => void;
|
|
14
13
|
onRowClick?: (rowData: T, dataIndex: number, event: React.MouseEvent) => void;
|
|
@@ -20,6 +19,6 @@ interface ITdProps<T> {
|
|
|
20
19
|
style: React.CSSProperties;
|
|
21
20
|
translate: (key: string, ...args: Array<string | number>) => string;
|
|
22
21
|
}
|
|
23
|
-
declare function Td<T>({ checkedIndexes, disabledCheckedIndexes, columnIndex, data, getRowClassName, getRowSelected, onCheckedIndexesChange, onRowClick, onRowDoubleClick, propConfig, propName, propSchema,
|
|
22
|
+
declare function Td<T>({ checkedIndexes, disabledCheckedIndexes, columnIndex, data, getRowClassName, getRowSelected, onCheckedIndexesChange, onRowClick, onRowDoubleClick, propConfig, propName, propSchema, rowIndex, sortedRenderData, style, translate, }: ITdProps<T>): import("react/jsx-runtime").JSX.Element | null;
|
|
24
23
|
declare const _default: typeof Td;
|
|
25
24
|
export default _default;
|
|
@@ -3,7 +3,7 @@ import React from "react";
|
|
|
3
3
|
import { SELECT_ALL_COLUMN_NAME } from "../constants";
|
|
4
4
|
import { localeFormatInTimeZone, timeZone } from "../../inc/date";
|
|
5
5
|
import { DEFAULT_DATE_TIME_FORMAT } from "../../inc/constant";
|
|
6
|
-
function Td({ checkedIndexes, disabledCheckedIndexes, columnIndex, data, getRowClassName, getRowSelected, onCheckedIndexesChange, onRowClick, onRowDoubleClick, propConfig, propName, propSchema,
|
|
6
|
+
function Td({ checkedIndexes, disabledCheckedIndexes, columnIndex, data, getRowClassName, getRowSelected, onCheckedIndexesChange, onRowClick, onRowDoubleClick, propConfig, propName, propSchema, rowIndex, sortedRenderData, style, translate, }) {
|
|
7
7
|
const onTdClick = React.useCallback((e) => {
|
|
8
8
|
if (!sortedRenderData || !onRowClick) {
|
|
9
9
|
return;
|
|
@@ -60,7 +60,7 @@ function Td({ checkedIndexes, disabledCheckedIndexes, columnIndex, data, getRowC
|
|
|
60
60
|
"data-row-index": rowIndex,
|
|
61
61
|
"data-column-index": columnIndex,
|
|
62
62
|
key: propName,
|
|
63
|
-
style
|
|
63
|
+
style,
|
|
64
64
|
onClick: onTdClick,
|
|
65
65
|
onDoubleClick: onTdDoubleClick,
|
|
66
66
|
className: classNames.join(" "),
|
|
@@ -77,7 +77,6 @@ function Td({ checkedIndexes, disabledCheckedIndexes, columnIndex, data, getRowC
|
|
|
77
77
|
propName,
|
|
78
78
|
propSchema === null || propSchema === void 0 ? void 0 : propSchema.format,
|
|
79
79
|
row,
|
|
80
|
-
rowHeight,
|
|
81
80
|
rowIndex,
|
|
82
81
|
sortedRenderData,
|
|
83
82
|
style,
|
|
@@ -436,7 +436,7 @@ function SchemaTable({ Heading = VariableSizeList, checkedIndexes, config, custo
|
|
|
436
436
|
const propSchema = (propName === SELECT_ALL_COLUMN_NAME
|
|
437
437
|
? { type: "boolean" }
|
|
438
438
|
: properties[propName]);
|
|
439
|
-
return sourceData ? (_jsx(Td, { checkedIndexes: checkedIndexes, disabledCheckedIndexes: disabledCheckedIndexes, columnIndex: columnIndex, data: sourceData, getRowClassName: getRowClassName, getRowSelected: getRowSelected, onCheckedIndexesChange: onCheckedIndexesChange, onRowClick: onRowClick, onRowDoubleClick: onRowDoubleClick, propConfig: config ? config[propName] : undefined, propName: propName, propSchema: propSchema,
|
|
439
|
+
return sourceData ? (_jsx(Td, { checkedIndexes: checkedIndexes, disabledCheckedIndexes: disabledCheckedIndexes, columnIndex: columnIndex, data: sourceData, getRowClassName: getRowClassName, getRowSelected: getRowSelected, onCheckedIndexesChange: onCheckedIndexesChange, onRowClick: onRowClick, onRowDoubleClick: onRowDoubleClick, propConfig: config ? config[propName] : undefined, propName: propName, propSchema: propSchema, rowIndex: rowIndex, sortedRenderData: sortedRenderData, style: style, translate: translate })) : null;
|
|
440
440
|
}, [
|
|
441
441
|
columnNames,
|
|
442
442
|
properties,
|
|
@@ -449,7 +449,6 @@ function SchemaTable({ Heading = VariableSizeList, checkedIndexes, config, custo
|
|
|
449
449
|
onRowClick,
|
|
450
450
|
onRowDoubleClick,
|
|
451
451
|
config,
|
|
452
|
-
rowHeight,
|
|
453
452
|
sortedRenderData,
|
|
454
453
|
translate,
|
|
455
454
|
]);
|
package/dist/index.css
CHANGED
|
@@ -35,23 +35,6 @@
|
|
|
35
35
|
.schema-table__th-row {
|
|
36
36
|
overflow: hidden !important;
|
|
37
37
|
}
|
|
38
|
-
.schema-table__td {
|
|
39
|
-
overflow: hidden;
|
|
40
|
-
white-space: nowrap;
|
|
41
|
-
text-overflow: ellipsis;
|
|
42
|
-
padding-left: 8px;
|
|
43
|
-
padding-right: 8px;
|
|
44
|
-
align-items: center;
|
|
45
|
-
}
|
|
46
|
-
.schema-table__td--odd {
|
|
47
|
-
background-color: var(--bs-gray-100, #f8f9fa);
|
|
48
|
-
}
|
|
49
|
-
.schema-table__td--even {
|
|
50
|
-
background-color: var(--bs-white, #fff);
|
|
51
|
-
}
|
|
52
|
-
.schema-table__td--selected {
|
|
53
|
-
background-color: var(--bs-gray-300, #dee2e6);
|
|
54
|
-
}
|
|
55
38
|
.schema-table--clickable-rows .schema-table__td {
|
|
56
39
|
cursor: pointer;
|
|
57
40
|
}
|
|
@@ -168,3 +151,21 @@
|
|
|
168
151
|
.schema-table-menu li:hover {
|
|
169
152
|
background-color: #eff6fb;
|
|
170
153
|
}
|
|
154
|
+
|
|
155
|
+
.schema-table__td {
|
|
156
|
+
overflow: hidden;
|
|
157
|
+
white-space: nowrap;
|
|
158
|
+
text-overflow: ellipsis;
|
|
159
|
+
padding-left: 8px;
|
|
160
|
+
padding-right: 8px;
|
|
161
|
+
align-content: center;
|
|
162
|
+
}
|
|
163
|
+
.schema-table__td--odd {
|
|
164
|
+
background-color: var(--bs-gray-100, #f8f9fa);
|
|
165
|
+
}
|
|
166
|
+
.schema-table__td--even {
|
|
167
|
+
background-color: var(--bs-white, #fff);
|
|
168
|
+
}
|
|
169
|
+
.schema-table__td--selected {
|
|
170
|
+
background-color: var(--bs-gray-300, #dee2e6);
|
|
171
|
+
}
|