@equinor/apollo-components 3.1.6 → 3.1.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.
- package/dist/index.js +12 -1
- package/dist/index.mjs +12 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3364,6 +3364,17 @@ function useForceRerender() {
|
|
|
3364
3364
|
|
|
3365
3365
|
// src/DataTable/DataTable.tsx
|
|
3366
3366
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
3367
|
+
function canUseContainStrict(height) {
|
|
3368
|
+
if (!height)
|
|
3369
|
+
return false;
|
|
3370
|
+
const heightIsANumber = !isNaN(parseFloat(height));
|
|
3371
|
+
if (heightIsANumber)
|
|
3372
|
+
return false;
|
|
3373
|
+
const heightIsPercentage = height.endsWith("%");
|
|
3374
|
+
if (heightIsPercentage)
|
|
3375
|
+
return false;
|
|
3376
|
+
return true;
|
|
3377
|
+
}
|
|
3367
3378
|
var DataTableWrapper = import_styled_components16.default.div`
|
|
3368
3379
|
width: ${(props) => props.width ?? "100%"};
|
|
3369
3380
|
|
|
@@ -3371,6 +3382,7 @@ var DataTableWrapper = import_styled_components16.default.div`
|
|
|
3371
3382
|
height: ${(props) => props.height ?? "100%"};
|
|
3372
3383
|
width: '100%';
|
|
3373
3384
|
overflow: auto;
|
|
3385
|
+
${(props) => canUseContainStrict(props.height) ? "contain: strict;" : ""}
|
|
3374
3386
|
|
|
3375
3387
|
table {
|
|
3376
3388
|
width: 100%;
|
|
@@ -3483,7 +3495,6 @@ function DataTable(props) {
|
|
|
3483
3495
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", {
|
|
3484
3496
|
...props.tableContainerProps,
|
|
3485
3497
|
className: "--table-container " + (((_q = props.tableContainerProps) == null ? void 0 : _q.className) ?? ""),
|
|
3486
|
-
style: { contain: "strict" },
|
|
3487
3498
|
onScroll: ((_r = props.tableContainerProps) == null ? void 0 : _r.onScroll) ?? onTableContainerScroll,
|
|
3488
3499
|
ref: (node) => {
|
|
3489
3500
|
var _a2;
|
package/dist/index.mjs
CHANGED
|
@@ -3328,6 +3328,17 @@ function useForceRerender() {
|
|
|
3328
3328
|
|
|
3329
3329
|
// src/DataTable/DataTable.tsx
|
|
3330
3330
|
import { jsx as jsx19, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
3331
|
+
function canUseContainStrict(height) {
|
|
3332
|
+
if (!height)
|
|
3333
|
+
return false;
|
|
3334
|
+
const heightIsANumber = !isNaN(parseFloat(height));
|
|
3335
|
+
if (heightIsANumber)
|
|
3336
|
+
return false;
|
|
3337
|
+
const heightIsPercentage = height.endsWith("%");
|
|
3338
|
+
if (heightIsPercentage)
|
|
3339
|
+
return false;
|
|
3340
|
+
return true;
|
|
3341
|
+
}
|
|
3331
3342
|
var DataTableWrapper = styled16.div`
|
|
3332
3343
|
width: ${(props) => props.width ?? "100%"};
|
|
3333
3344
|
|
|
@@ -3335,6 +3346,7 @@ var DataTableWrapper = styled16.div`
|
|
|
3335
3346
|
height: ${(props) => props.height ?? "100%"};
|
|
3336
3347
|
width: '100%';
|
|
3337
3348
|
overflow: auto;
|
|
3349
|
+
${(props) => canUseContainStrict(props.height) ? "contain: strict;" : ""}
|
|
3338
3350
|
|
|
3339
3351
|
table {
|
|
3340
3352
|
width: 100%;
|
|
@@ -3447,7 +3459,6 @@ function DataTable(props) {
|
|
|
3447
3459
|
/* @__PURE__ */ jsx19("div", {
|
|
3448
3460
|
...props.tableContainerProps,
|
|
3449
3461
|
className: "--table-container " + (((_q = props.tableContainerProps) == null ? void 0 : _q.className) ?? ""),
|
|
3450
|
-
style: { contain: "strict" },
|
|
3451
3462
|
onScroll: ((_r = props.tableContainerProps) == null ? void 0 : _r.onScroll) ?? onTableContainerScroll,
|
|
3452
3463
|
ref: (node) => {
|
|
3453
3464
|
var _a2;
|