@equinor/apollo-components 3.7.5 → 3.7.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.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +7 -5
- package/dist/index.mjs +8 -6
- package/package.json +6 -6
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { IconData } from '@equinor/eds-icons';
|
|
3
3
|
import * as react from 'react';
|
|
4
|
-
import { ReactNode, ReactElement,
|
|
5
|
-
import { CellContext, Table,
|
|
4
|
+
import { ReactNode, ReactElement, Dispatch, SetStateAction, HTMLProps, MutableRefObject, SyntheticEvent } from 'react';
|
|
5
|
+
import { CellContext, Table, Cell, ColumnDef, Row, ColumnResizeMode, RowSelectionState, ExpandedState, SortingState, ColumnPinningState, VisibilityState, OnChangeFn, HeaderContext, Column, Header } from '@tanstack/react-table';
|
|
6
6
|
export { Cell, CellContext, ColumnDef, ColumnPinningState, ColumnResizeMode, ColumnSort, ExpandedState, HeaderContext, OnChangeFn, Row, RowSelectionState, SortingState, Table, VisibilityState, createColumnHelper } from '@tanstack/react-table';
|
|
7
7
|
import * as styled_components_dist_types from 'styled-components/dist/types';
|
|
8
8
|
import * as _equinor_eds_core_react from '@equinor/eds-core-react';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { IconData } from '@equinor/eds-icons';
|
|
3
3
|
import * as react from 'react';
|
|
4
|
-
import { ReactNode, ReactElement,
|
|
5
|
-
import { CellContext, Table,
|
|
4
|
+
import { ReactNode, ReactElement, Dispatch, SetStateAction, HTMLProps, MutableRefObject, SyntheticEvent } from 'react';
|
|
5
|
+
import { CellContext, Table, Cell, ColumnDef, Row, ColumnResizeMode, RowSelectionState, ExpandedState, SortingState, ColumnPinningState, VisibilityState, OnChangeFn, HeaderContext, Column, Header } from '@tanstack/react-table';
|
|
6
6
|
export { Cell, CellContext, ColumnDef, ColumnPinningState, ColumnResizeMode, ColumnSort, ExpandedState, HeaderContext, OnChangeFn, Row, RowSelectionState, SortingState, Table, VisibilityState, createColumnHelper } from '@tanstack/react-table';
|
|
7
7
|
import * as styled_components_dist_types from 'styled-components/dist/types';
|
|
8
8
|
import * as _equinor_eds_core_react from '@equinor/eds-core-react';
|
package/dist/index.js
CHANGED
|
@@ -658,7 +658,7 @@ function capitalizeHeader(context) {
|
|
|
658
658
|
return header.charAt(0).toUpperCase() + header.slice(1);
|
|
659
659
|
}
|
|
660
660
|
function enableOrUndefined(enabled, value) {
|
|
661
|
-
return
|
|
661
|
+
return enabled ? value : void 0;
|
|
662
662
|
}
|
|
663
663
|
function getColumnHeader(column) {
|
|
664
664
|
const columnHeader = column.columnDef.header;
|
|
@@ -667,7 +667,7 @@ function getColumnHeader(column) {
|
|
|
667
667
|
}
|
|
668
668
|
function prependSelectColumnIfEnabled(columns, config) {
|
|
669
669
|
if (!config) return columns;
|
|
670
|
-
if (!
|
|
670
|
+
if (!(config == null ? void 0 : config.mode)) return columns;
|
|
671
671
|
return prependSelectColumn(columns, config);
|
|
672
672
|
}
|
|
673
673
|
function prependSelectColumn(columns, config) {
|
|
@@ -1209,7 +1209,7 @@ function DataTable(props) {
|
|
|
1209
1209
|
);
|
|
1210
1210
|
const forceRerender = useForceRerender();
|
|
1211
1211
|
(0, import_react7.useEffect)(() => {
|
|
1212
|
-
if (
|
|
1212
|
+
if (tableContainerRef.current) forceRerender();
|
|
1213
1213
|
}, [tableContainerRef.current === null]);
|
|
1214
1214
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(DataTableWrapper, { height: props == null ? void 0 : props.height, width: props == null ? void 0 : props.width, tableLayout: props == null ? void 0 : props.tableLayout, children: [
|
|
1215
1215
|
props.bannerConfig && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
@@ -1527,7 +1527,8 @@ function EditableDropdownSingleCell(_a) {
|
|
|
1527
1527
|
"label"
|
|
1528
1528
|
]);
|
|
1529
1529
|
const editMode = useEditMode();
|
|
1530
|
-
if (!editMode)
|
|
1530
|
+
if (!editMode)
|
|
1531
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TypographyCustom, { truncate: true, children: context.getValue() });
|
|
1531
1532
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1532
1533
|
import_react_hook_form4.Controller,
|
|
1533
1534
|
{
|
|
@@ -1761,7 +1762,8 @@ function EditableTextFieldCell(_a) {
|
|
|
1761
1762
|
"error"
|
|
1762
1763
|
]);
|
|
1763
1764
|
const editMode = useEditMode();
|
|
1764
|
-
if (!editMode)
|
|
1765
|
+
if (!editMode)
|
|
1766
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TypographyCustom, { truncate: true, children: context.getValue() });
|
|
1765
1767
|
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1766
1768
|
import_react_hook_form7.Controller,
|
|
1767
1769
|
{
|
package/dist/index.mjs
CHANGED
|
@@ -256,7 +256,7 @@ function DynamicCell({ cell, cellConfig }) {
|
|
|
256
256
|
}
|
|
257
257
|
|
|
258
258
|
// src/cells/HeaderCell.tsx
|
|
259
|
-
import {
|
|
259
|
+
import { Table as EdsTable2, Icon as Icon3 } from "@equinor/eds-core-react";
|
|
260
260
|
import { arrow_drop_down, arrow_drop_up } from "@equinor/eds-icons";
|
|
261
261
|
import { tokens as tokens4 } from "@equinor/eds-tokens";
|
|
262
262
|
import { flexRender as flexRender2 } from "@tanstack/react-table";
|
|
@@ -585,7 +585,7 @@ function capitalizeHeader(context) {
|
|
|
585
585
|
return header.charAt(0).toUpperCase() + header.slice(1);
|
|
586
586
|
}
|
|
587
587
|
function enableOrUndefined(enabled, value) {
|
|
588
|
-
return
|
|
588
|
+
return enabled ? value : void 0;
|
|
589
589
|
}
|
|
590
590
|
function getColumnHeader(column) {
|
|
591
591
|
const columnHeader = column.columnDef.header;
|
|
@@ -594,7 +594,7 @@ function getColumnHeader(column) {
|
|
|
594
594
|
}
|
|
595
595
|
function prependSelectColumnIfEnabled(columns, config) {
|
|
596
596
|
if (!config) return columns;
|
|
597
|
-
if (!
|
|
597
|
+
if (!(config == null ? void 0 : config.mode)) return columns;
|
|
598
598
|
return prependSelectColumn(columns, config);
|
|
599
599
|
}
|
|
600
600
|
function prependSelectColumn(columns, config) {
|
|
@@ -1142,7 +1142,7 @@ function DataTable(props) {
|
|
|
1142
1142
|
);
|
|
1143
1143
|
const forceRerender = useForceRerender();
|
|
1144
1144
|
useEffect3(() => {
|
|
1145
|
-
if (
|
|
1145
|
+
if (tableContainerRef.current) forceRerender();
|
|
1146
1146
|
}, [tableContainerRef.current === null]);
|
|
1147
1147
|
return /* @__PURE__ */ jsxs11(DataTableWrapper, { height: props == null ? void 0 : props.height, width: props == null ? void 0 : props.width, tableLayout: props == null ? void 0 : props.tableLayout, children: [
|
|
1148
1148
|
props.bannerConfig && /* @__PURE__ */ jsx20(
|
|
@@ -1460,7 +1460,8 @@ function EditableDropdownSingleCell(_a) {
|
|
|
1460
1460
|
"label"
|
|
1461
1461
|
]);
|
|
1462
1462
|
const editMode = useEditMode();
|
|
1463
|
-
if (!editMode)
|
|
1463
|
+
if (!editMode)
|
|
1464
|
+
return /* @__PURE__ */ jsx25(TypographyCustom, { truncate: true, children: context.getValue() });
|
|
1464
1465
|
return /* @__PURE__ */ jsx25(
|
|
1465
1466
|
Controller3,
|
|
1466
1467
|
{
|
|
@@ -1694,7 +1695,8 @@ function EditableTextFieldCell(_a) {
|
|
|
1694
1695
|
"error"
|
|
1695
1696
|
]);
|
|
1696
1697
|
const editMode = useEditMode();
|
|
1697
|
-
if (!editMode)
|
|
1698
|
+
if (!editMode)
|
|
1699
|
+
return /* @__PURE__ */ jsx28(TypographyCustom, { truncate: true, children: context.getValue() });
|
|
1698
1700
|
return /* @__PURE__ */ jsx28(
|
|
1699
1701
|
Controller6,
|
|
1700
1702
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/apollo-components",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.7",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -18,21 +18,21 @@
|
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"@equinor/eds-core-react": "^0.42.5",
|
|
21
|
-
"@storybook/react": "^8.
|
|
22
|
-
"@storybook/test": "^8.
|
|
21
|
+
"@storybook/react": "^8.6.14",
|
|
22
|
+
"@storybook/test": "^8.6.14",
|
|
23
23
|
"@types/lodash": "^4.17.15",
|
|
24
24
|
"@types/react": "^18.3.18",
|
|
25
25
|
"@types/react-dom": "^18.3.5",
|
|
26
26
|
"@types/styled-components": "^5.1.34",
|
|
27
|
-
"eslint": "^
|
|
27
|
+
"eslint": "^9.21.0",
|
|
28
28
|
"react": "^18.2.0",
|
|
29
29
|
"react-dom": "^18.2.0",
|
|
30
30
|
"react-hook-form": "^7.54.2",
|
|
31
31
|
"styled-components": "^6.1.14",
|
|
32
32
|
"tsup": "^8.3.6",
|
|
33
33
|
"type-fest": "^4.33.0",
|
|
34
|
-
"eslint-config
|
|
35
|
-
"
|
|
34
|
+
"@equinor/cpl-eslint-config": "0.0.8",
|
|
35
|
+
"@equinor/cpl-typescript-config": "0.0.2"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"@equinor/eds-core-react": ">=0.42.1",
|