react-better-html 1.1.145 → 1.1.146
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/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +60 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +60 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -736,6 +736,7 @@ type TableProps<DataItem> = {
|
|
|
736
736
|
pageSize?: number;
|
|
737
737
|
pageCount?: number;
|
|
738
738
|
isInsideTableExpandRow?: boolean;
|
|
739
|
+
containsOverflowComponents?: boolean;
|
|
739
740
|
getRowStyle?: (item: DataItem, index: number) => ComponentStyle;
|
|
740
741
|
onClickRow?: (item: DataItem, index: number) => void;
|
|
741
742
|
onClickAllCheckboxes?: (checked: boolean) => void;
|
package/dist/index.d.ts
CHANGED
|
@@ -736,6 +736,7 @@ type TableProps<DataItem> = {
|
|
|
736
736
|
pageSize?: number;
|
|
737
737
|
pageCount?: number;
|
|
738
738
|
isInsideTableExpandRow?: boolean;
|
|
739
|
+
containsOverflowComponents?: boolean;
|
|
739
740
|
getRowStyle?: (item: DataItem, index: number) => ComponentStyle;
|
|
740
741
|
onClickRow?: (item: DataItem, index: number) => void;
|
|
741
742
|
onClickAllCheckboxes?: (checked: boolean) => void;
|
package/dist/index.js
CHANGED
|
@@ -7405,12 +7405,65 @@ var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
|
7405
7405
|
var defaultImageWidth = 160;
|
|
7406
7406
|
var maximumVisiblePages = 11;
|
|
7407
7407
|
var TableStyledComponent = import_styled_components12.default.table.withConfig({
|
|
7408
|
-
shouldForwardProp: (prop) => ![
|
|
7408
|
+
shouldForwardProp: (prop) => ![
|
|
7409
|
+
"isStriped",
|
|
7410
|
+
"withHover",
|
|
7411
|
+
"withStickyHeader",
|
|
7412
|
+
"colorTheme",
|
|
7413
|
+
"theme",
|
|
7414
|
+
"containsOverflowComponents",
|
|
7415
|
+
"withFooter"
|
|
7416
|
+
].includes(prop)
|
|
7409
7417
|
})`
|
|
7410
7418
|
width: 100%;
|
|
7411
7419
|
border-collapse: collapse;
|
|
7412
7420
|
border-spacing: 0;
|
|
7413
7421
|
|
|
7422
|
+
thead {
|
|
7423
|
+
tr:first-child {
|
|
7424
|
+
border-top-left-radius: ${(props) => props.containsOverflowComponents ? `${props.theme.styles.borderRadius * 2 - 1}px` : void 0};
|
|
7425
|
+
border-top-right-radius: ${(props) => props.containsOverflowComponents ? `${props.theme.styles.borderRadius * 2 - 1}px` : void 0};
|
|
7426
|
+
|
|
7427
|
+
th:first-child {
|
|
7428
|
+
border-top-left-radius: ${(props) => props.containsOverflowComponents ? `${props.theme.styles.borderRadius * 2 - 1}px` : void 0};
|
|
7429
|
+
}
|
|
7430
|
+
|
|
7431
|
+
th:last-child {
|
|
7432
|
+
border-top-right-radius: ${(props) => props.containsOverflowComponents ? `${props.theme.styles.borderRadius * 2 - 1}px` : void 0};
|
|
7433
|
+
}
|
|
7434
|
+
}
|
|
7435
|
+
}
|
|
7436
|
+
|
|
7437
|
+
tbody {
|
|
7438
|
+
tr:last-child {
|
|
7439
|
+
border-bottom-left-radius: ${(props) => props.containsOverflowComponents && !props.withFooter ? `${props.theme.styles.borderRadius * 2 - 1}px` : void 0};
|
|
7440
|
+
border-bottom-right-radius: ${(props) => props.containsOverflowComponents && !props.withFooter ? `${props.theme.styles.borderRadius * 2 - 1}px` : void 0};
|
|
7441
|
+
|
|
7442
|
+
td:first-child {
|
|
7443
|
+
border-bottom-left-radius: ${(props) => props.containsOverflowComponents && !props.withFooter ? `${props.theme.styles.borderRadius * 2 - 1}px` : void 0};
|
|
7444
|
+
}
|
|
7445
|
+
|
|
7446
|
+
td:last-child {
|
|
7447
|
+
border-bottom-right-radius: ${(props) => props.containsOverflowComponents && !props.withFooter ? `${props.theme.styles.borderRadius * 2 - 1}px` : void 0};
|
|
7448
|
+
}
|
|
7449
|
+
}
|
|
7450
|
+
}
|
|
7451
|
+
|
|
7452
|
+
tfoot {
|
|
7453
|
+
tr:last-child {
|
|
7454
|
+
border-bottom-left-radius: ${(props) => props.containsOverflowComponents ? `${props.theme.styles.borderRadius * 2 - 1}px` : void 0};
|
|
7455
|
+
border-bottom-right-radius: ${(props) => props.containsOverflowComponents ? `${props.theme.styles.borderRadius * 2 - 1}px` : void 0};
|
|
7456
|
+
|
|
7457
|
+
td:first-child {
|
|
7458
|
+
border-bottom-left-radius: ${(props) => props.containsOverflowComponents ? `${props.theme.styles.borderRadius * 2 - 1}px` : void 0};
|
|
7459
|
+
}
|
|
7460
|
+
|
|
7461
|
+
td:last-child {
|
|
7462
|
+
border-bottom-right-radius: ${(props) => props.containsOverflowComponents ? `${props.theme.styles.borderRadius * 2 - 1}px` : void 0};
|
|
7463
|
+
}
|
|
7464
|
+
}
|
|
7465
|
+
}
|
|
7466
|
+
|
|
7414
7467
|
tr {
|
|
7415
7468
|
background-color: ${(props) => props.theme.colors.backgroundContent};
|
|
7416
7469
|
|
|
@@ -7503,6 +7556,7 @@ var TableComponent = (0, import_react25.forwardRef)(function Table({
|
|
|
7503
7556
|
pageSize,
|
|
7504
7557
|
pageCount,
|
|
7505
7558
|
isInsideTableExpandRow,
|
|
7559
|
+
containsOverflowComponents,
|
|
7506
7560
|
getRowStyle,
|
|
7507
7561
|
onClickRow,
|
|
7508
7562
|
onClickAllCheckboxes,
|
|
@@ -7873,6 +7927,7 @@ var TableComponent = (0, import_react25.forwardRef)(function Table({
|
|
|
7873
7927
|
},
|
|
7874
7928
|
[currentPage, setCurrentPage, pageCountInternal, setCheckedItems]
|
|
7875
7929
|
);
|
|
7930
|
+
const withFooter = pageSize !== void 0 && pageCountInternal > 1;
|
|
7876
7931
|
const mobileFooterBreakingPoint = mediaQuery.size700 && pageCountInternal > maximumVisiblePages / 1.4;
|
|
7877
7932
|
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
|
|
7878
7933
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
@@ -7880,7 +7935,7 @@ var TableComponent = (0, import_react25.forwardRef)(function Table({
|
|
|
7880
7935
|
{
|
|
7881
7936
|
border: `1px solid ${theme2.colors.border}`,
|
|
7882
7937
|
borderRadius: theme2.styles.borderRadius * 2,
|
|
7883
|
-
overflow: "auto",
|
|
7938
|
+
overflow: !containsOverflowComponents ? "auto" : void 0,
|
|
7884
7939
|
...props,
|
|
7885
7940
|
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
7886
7941
|
TableStyledComponent,
|
|
@@ -7890,6 +7945,8 @@ var TableComponent = (0, import_react25.forwardRef)(function Table({
|
|
|
7890
7945
|
withStickyHeader,
|
|
7891
7946
|
colorTheme,
|
|
7892
7947
|
theme: theme2,
|
|
7948
|
+
containsOverflowComponents,
|
|
7949
|
+
withFooter,
|
|
7893
7950
|
children: [
|
|
7894
7951
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("tr", { className: "isHeader", children: columns.map((column, index) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
7895
7952
|
ThStyledComponent,
|
|
@@ -7951,7 +8008,7 @@ var TableComponent = (0, import_react25.forwardRef)(function Table({
|
|
|
7951
8008
|
),
|
|
7952
8009
|
expandedRows[rowIndex] && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("tr", { className: "withoutHover isExpandRow", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("td", { colSpan: columns.length, children: renderExpandedRow(item, rowIndex) }) })
|
|
7953
8010
|
] }, JSON.stringify(item) + rowIndex)) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("tr", { className: "withoutHover", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("td", { className: "noData", colSpan: columns.length, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Text_default.unknown, { children: noDataItemsMessage }) }) }) }),
|
|
7954
|
-
|
|
8011
|
+
withFooter && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("tfoot", { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("tr", { className: "isFooter", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("td", { colSpan: columns.length, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
7955
8012
|
Div_default.column,
|
|
7956
8013
|
{
|
|
7957
8014
|
position: "relative",
|