@equinor/apollo-components 3.1.8 → 3.2.0
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.ts +9 -3
- package/dist/index.js +259 -200
- package/dist/index.mjs +213 -155
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2337,6 +2337,7 @@ var src_exports = {};
|
|
|
2337
2337
|
__export(src_exports, {
|
|
2338
2338
|
AppShell: () => AppShell,
|
|
2339
2339
|
AppSidebar: () => AppSidebar,
|
|
2340
|
+
CheckboxCell: () => CheckboxCell,
|
|
2340
2341
|
ChipsCell: () => ChipsCell,
|
|
2341
2342
|
ColumnSelect: () => ColumnSelect,
|
|
2342
2343
|
DataTable: () => DataTable,
|
|
@@ -2473,6 +2474,19 @@ function AppSidebar() {
|
|
|
2473
2474
|
});
|
|
2474
2475
|
}
|
|
2475
2476
|
|
|
2477
|
+
// src/cells/CheckboxCell.tsx
|
|
2478
|
+
var import_eds_core_react3 = require("@equinor/eds-core-react");
|
|
2479
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
2480
|
+
function CheckboxCell(context) {
|
|
2481
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_eds_core_react3.Checkbox, {
|
|
2482
|
+
enterKeyHint: "next",
|
|
2483
|
+
"aria-label": "readonly",
|
|
2484
|
+
readOnly: true,
|
|
2485
|
+
checked: context.getValue(),
|
|
2486
|
+
disabled: true
|
|
2487
|
+
});
|
|
2488
|
+
}
|
|
2489
|
+
|
|
2476
2490
|
// src/cells/ChipsCell.tsx
|
|
2477
2491
|
var import_eds_tokens2 = require("@equinor/eds-tokens");
|
|
2478
2492
|
var import_styled_components3 = __toESM(require("styled-components"));
|
|
@@ -2494,7 +2508,7 @@ function stopPropagation(handler) {
|
|
|
2494
2508
|
}
|
|
2495
2509
|
|
|
2496
2510
|
// src/cells/ChipsCell.tsx
|
|
2497
|
-
var
|
|
2511
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
2498
2512
|
var ChipsWrapper = import_styled_components3.default.div`
|
|
2499
2513
|
display: flex;
|
|
2500
2514
|
align-items: center;
|
|
@@ -2513,8 +2527,8 @@ var Chip = import_styled_components3.default.div`
|
|
|
2513
2527
|
`;
|
|
2514
2528
|
var ChipsCell = (props) => {
|
|
2515
2529
|
var _a;
|
|
2516
|
-
return /* @__PURE__ */ (0,
|
|
2517
|
-
children: (_a = props.values) == null ? void 0 : _a.map((value) => /* @__PURE__ */ (0,
|
|
2530
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ChipsWrapper, {
|
|
2531
|
+
children: (_a = props.values) == null ? void 0 : _a.map((value) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Chip, {
|
|
2518
2532
|
backgroundColor: stringToHslColor(value),
|
|
2519
2533
|
children: value
|
|
2520
2534
|
}, value))
|
|
@@ -2522,12 +2536,12 @@ var ChipsCell = (props) => {
|
|
|
2522
2536
|
};
|
|
2523
2537
|
|
|
2524
2538
|
// src/cells/DynamicCell.tsx
|
|
2525
|
-
var
|
|
2539
|
+
var import_eds_core_react5 = require("@equinor/eds-core-react");
|
|
2526
2540
|
var import_react_table = require("@tanstack/react-table");
|
|
2527
2541
|
var import_styled_components5 = __toESM(require("styled-components"));
|
|
2528
2542
|
|
|
2529
2543
|
// src/cells/StickyCell.tsx
|
|
2530
|
-
var
|
|
2544
|
+
var import_eds_core_react4 = require("@equinor/eds-core-react");
|
|
2531
2545
|
var import_styled_components4 = __toESM(require("styled-components"));
|
|
2532
2546
|
var leftCellShadow = import_styled_components4.css`
|
|
2533
2547
|
&:before {
|
|
@@ -2540,7 +2554,7 @@ var leftCellShadow = import_styled_components4.css`
|
|
|
2540
2554
|
width: 1px;
|
|
2541
2555
|
}
|
|
2542
2556
|
`;
|
|
2543
|
-
var StickyCell = (0, import_styled_components4.default)(
|
|
2557
|
+
var StickyCell = (0, import_styled_components4.default)(import_eds_core_react4.Table.Cell)`
|
|
2544
2558
|
position: sticky;
|
|
2545
2559
|
right: 0;
|
|
2546
2560
|
top: 0;
|
|
@@ -2553,24 +2567,24 @@ var StickyHeaderCell = (0, import_styled_components4.default)(StickyCell)`
|
|
|
2553
2567
|
`;
|
|
2554
2568
|
|
|
2555
2569
|
// src/cells/DynamicCell.tsx
|
|
2556
|
-
var
|
|
2570
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
2557
2571
|
var StyledStickyCell = (0, import_styled_components5.default)(StickyCell)`
|
|
2558
2572
|
background-color: ${({ backgroundColor: bg }) => bg ? `${bg} !important` : `inherit`};
|
|
2559
2573
|
`;
|
|
2560
|
-
var StyledCell = (0, import_styled_components5.default)(
|
|
2574
|
+
var StyledCell = (0, import_styled_components5.default)(import_eds_core_react5.Table.Cell)`
|
|
2561
2575
|
background-color: ${({ backgroundColor: bg }) => bg ? `${bg} !important` : `inherit`};
|
|
2562
2576
|
`;
|
|
2563
2577
|
function DynamicCell({ cell, highlight, getStickyCellColor }) {
|
|
2564
2578
|
var _a;
|
|
2565
2579
|
const cellContent = (0, import_react_table.flexRender)(cell.column.columnDef.cell, cell.getContext());
|
|
2566
2580
|
if ((_a = cell.column.columnDef.meta) == null ? void 0 : _a.sticky) {
|
|
2567
|
-
return /* @__PURE__ */ (0,
|
|
2581
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(StyledStickyCell, {
|
|
2568
2582
|
backgroundColor: getStickyCellColor == null ? void 0 : getStickyCellColor(cell),
|
|
2569
2583
|
"data-column": cell.column.id,
|
|
2570
2584
|
children: cellContent
|
|
2571
2585
|
});
|
|
2572
2586
|
}
|
|
2573
|
-
return /* @__PURE__ */ (0,
|
|
2587
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(StyledCell, {
|
|
2574
2588
|
"data-column": cell.column.id,
|
|
2575
2589
|
backgroundColor: highlight ? "#d5eaf4" : void 0,
|
|
2576
2590
|
children: cellContent
|
|
@@ -2578,18 +2592,42 @@ function DynamicCell({ cell, highlight, getStickyCellColor }) {
|
|
|
2578
2592
|
}
|
|
2579
2593
|
|
|
2580
2594
|
// src/cells/HeaderCell.tsx
|
|
2581
|
-
var
|
|
2595
|
+
var import_eds_core_react6 = require("@equinor/eds-core-react");
|
|
2582
2596
|
var import_eds_icons3 = require("@equinor/eds-icons");
|
|
2597
|
+
var import_eds_tokens3 = require("@equinor/eds-tokens");
|
|
2583
2598
|
var import_react_table2 = require("@tanstack/react-table");
|
|
2584
2599
|
var import_styled_components6 = __toESM(require("styled-components"));
|
|
2585
|
-
var
|
|
2586
|
-
var
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2600
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
2601
|
+
var resizeCellStyle = import_styled_components6.css`
|
|
2602
|
+
.resizer {
|
|
2603
|
+
position: absolute;
|
|
2604
|
+
right: 0;
|
|
2605
|
+
top: 0;
|
|
2606
|
+
height: 100%;
|
|
2607
|
+
width: 4px;
|
|
2608
|
+
opacity: 0;
|
|
2609
|
+
background: #aaa;
|
|
2610
|
+
cursor: col-resize;
|
|
2611
|
+
user-select: none;
|
|
2612
|
+
touch-action: none;
|
|
2613
|
+
}
|
|
2614
|
+
|
|
2615
|
+
.resizer.isResizing {
|
|
2616
|
+
background: ${import_eds_tokens3.tokens.colors.interactive.focus.hex};
|
|
2617
|
+
opacity: 1;
|
|
2618
|
+
}
|
|
2619
|
+
|
|
2620
|
+
&:hover .resizer {
|
|
2621
|
+
opacity: 1;
|
|
2622
|
+
}
|
|
2623
|
+
`;
|
|
2624
|
+
var StickyCell2 = (0, import_styled_components6.default)(StickyHeaderCell)`
|
|
2625
|
+
${resizeCellStyle}
|
|
2626
|
+
`;
|
|
2627
|
+
var Cell2 = (0, import_styled_components6.default)(import_eds_core_react6.Table.Cell)`
|
|
2628
|
+
${resizeCellStyle}
|
|
2591
2629
|
`;
|
|
2592
|
-
var HeaderCell = ({ header }) => {
|
|
2630
|
+
var HeaderCell = ({ header, table }) => {
|
|
2593
2631
|
var _a;
|
|
2594
2632
|
const style = {
|
|
2595
2633
|
width: header.column.getSize(),
|
|
@@ -2602,37 +2640,54 @@ var HeaderCell = ({ header }) => {
|
|
|
2602
2640
|
colSpan: header.colSpan
|
|
2603
2641
|
};
|
|
2604
2642
|
if ((_a = header.column.columnDef.meta) == null ? void 0 : _a.sticky) {
|
|
2605
|
-
return /* @__PURE__ */ (0,
|
|
2643
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(StickyCell2, {
|
|
2606
2644
|
...cellProps,
|
|
2607
|
-
children: /* @__PURE__ */ (0,
|
|
2608
|
-
header
|
|
2645
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(HeaderContent, {
|
|
2646
|
+
header,
|
|
2647
|
+
table
|
|
2609
2648
|
})
|
|
2610
2649
|
}, header.id);
|
|
2611
2650
|
}
|
|
2612
|
-
return /* @__PURE__ */ (0,
|
|
2651
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Cell2, {
|
|
2613
2652
|
...cellProps,
|
|
2614
|
-
children: /* @__PURE__ */ (0,
|
|
2615
|
-
header
|
|
2653
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(HeaderContent, {
|
|
2654
|
+
header,
|
|
2655
|
+
table
|
|
2616
2656
|
})
|
|
2617
2657
|
}, header.id);
|
|
2618
2658
|
};
|
|
2619
|
-
|
|
2659
|
+
var HeaderDiv = import_styled_components6.default.div`
|
|
2660
|
+
display: flex;
|
|
2661
|
+
align-items: center;
|
|
2662
|
+
gap: 0.25rem;
|
|
2663
|
+
z-index: 5;
|
|
2664
|
+
`;
|
|
2665
|
+
function HeaderContent({ header, table }) {
|
|
2620
2666
|
if (header.isPlaceholder)
|
|
2621
2667
|
return null;
|
|
2622
|
-
return /* @__PURE__ */ (0,
|
|
2668
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(HeaderDiv, {
|
|
2623
2669
|
children: [
|
|
2624
2670
|
(0, import_react_table2.flexRender)(header.column.columnDef.header, header.getContext()),
|
|
2625
2671
|
{
|
|
2626
|
-
asc: /* @__PURE__ */ (0,
|
|
2672
|
+
asc: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_eds_core_react6.Icon, {
|
|
2627
2673
|
data: import_eds_icons3.arrow_drop_up
|
|
2628
2674
|
}),
|
|
2629
|
-
desc: /* @__PURE__ */ (0,
|
|
2675
|
+
desc: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_eds_core_react6.Icon, {
|
|
2630
2676
|
data: import_eds_icons3.arrow_drop_down
|
|
2631
2677
|
}),
|
|
2632
|
-
none: /* @__PURE__ */ (0,
|
|
2678
|
+
none: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_eds_core_react6.Icon, {
|
|
2633
2679
|
data: import_eds_icons3.arrow_drop_down
|
|
2634
2680
|
})
|
|
2635
|
-
}[header.column.getIsSorted()] ?? null
|
|
2681
|
+
}[header.column.getIsSorted()] ?? null,
|
|
2682
|
+
table.options.enableColumnResizing && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", {
|
|
2683
|
+
onMouseDown: header.getResizeHandler(),
|
|
2684
|
+
onTouchStart: header.getResizeHandler(),
|
|
2685
|
+
onClick: (e) => e.stopPropagation(),
|
|
2686
|
+
className: `resizer ${header.column.getIsResizing() ? "isResizing" : ""}`,
|
|
2687
|
+
style: {
|
|
2688
|
+
transform: table.options.columnResizeMode === "onEnd" && header.column.getIsResizing() ? `translateX(${table.getState().columnSizingInfo.deltaOffset}px)` : ""
|
|
2689
|
+
}
|
|
2690
|
+
})
|
|
2636
2691
|
]
|
|
2637
2692
|
});
|
|
2638
2693
|
}
|
|
@@ -2650,14 +2705,14 @@ function getSort({ column }) {
|
|
|
2650
2705
|
}
|
|
2651
2706
|
|
|
2652
2707
|
// src/cells/HierarchyCell.tsx
|
|
2653
|
-
var
|
|
2708
|
+
var import_eds_tokens5 = require("@equinor/eds-tokens");
|
|
2654
2709
|
var import_styled_components8 = __toESM(require("styled-components"));
|
|
2655
2710
|
|
|
2656
2711
|
// src/cells/TypographyCustom.tsx
|
|
2657
|
-
var
|
|
2658
|
-
var
|
|
2712
|
+
var import_eds_core_react7 = require("@equinor/eds-core-react");
|
|
2713
|
+
var import_eds_tokens4 = require("@equinor/eds-tokens");
|
|
2659
2714
|
var import_styled_components7 = __toESM(require("styled-components"));
|
|
2660
|
-
var
|
|
2715
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
2661
2716
|
var truncateStyle = {
|
|
2662
2717
|
overflow: "hidden",
|
|
2663
2718
|
whiteSpace: "nowrap",
|
|
@@ -2666,8 +2721,8 @@ var truncateStyle = {
|
|
|
2666
2721
|
var TypographyCustom = (props) => {
|
|
2667
2722
|
const { truncate, enableShowAllOnHover, style: styleFromProps, ...edsTypographyProps } = props;
|
|
2668
2723
|
if (enableShowAllOnHover)
|
|
2669
|
-
return /* @__PURE__ */ (0,
|
|
2670
|
-
children: /* @__PURE__ */ (0,
|
|
2724
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(HoverCapture, {
|
|
2725
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_eds_core_react7.Typography, {
|
|
2671
2726
|
...edsTypographyProps,
|
|
2672
2727
|
style: {
|
|
2673
2728
|
...styleFromProps,
|
|
@@ -2676,20 +2731,20 @@ var TypographyCustom = (props) => {
|
|
|
2676
2731
|
})
|
|
2677
2732
|
});
|
|
2678
2733
|
if (truncate)
|
|
2679
|
-
return /* @__PURE__ */ (0,
|
|
2734
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_eds_core_react7.Typography, {
|
|
2680
2735
|
...edsTypographyProps,
|
|
2681
2736
|
style: {
|
|
2682
2737
|
...styleFromProps,
|
|
2683
2738
|
...truncateStyle
|
|
2684
2739
|
}
|
|
2685
2740
|
});
|
|
2686
|
-
return /* @__PURE__ */ (0,
|
|
2741
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_eds_core_react7.Typography, {
|
|
2687
2742
|
...edsTypographyProps,
|
|
2688
2743
|
style: styleFromProps
|
|
2689
2744
|
});
|
|
2690
2745
|
};
|
|
2691
2746
|
var HoverCapture = import_styled_components7.default.div`
|
|
2692
|
-
height: ${
|
|
2747
|
+
height: ${import_eds_tokens4.tokens.typography.table.cell_text.lineHeight};
|
|
2693
2748
|
background-color: inherit;
|
|
2694
2749
|
|
|
2695
2750
|
position: relative;
|
|
@@ -2715,7 +2770,7 @@ var HoverCapture = import_styled_components7.default.div`
|
|
|
2715
2770
|
`;
|
|
2716
2771
|
|
|
2717
2772
|
// src/cells/HierarchyCell.tsx
|
|
2718
|
-
var
|
|
2773
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
2719
2774
|
var CellWrapper = (0, import_styled_components8.default)(TypographyCustom)`
|
|
2720
2775
|
height: 100%;
|
|
2721
2776
|
display: flex;
|
|
@@ -2724,11 +2779,11 @@ var CellWrapper = (0, import_styled_components8.default)(TypographyCustom)`
|
|
|
2724
2779
|
${({ depth, expanded }) => expanded && depth === 0 && "font-weight: bold;"}
|
|
2725
2780
|
|
|
2726
2781
|
${({ depth }) => depth > 0 && import_styled_components8.css`
|
|
2727
|
-
border-left: 3px solid ${
|
|
2782
|
+
border-left: 3px solid ${import_eds_tokens5.tokens.colors.infographic.primary__moss_green_34.hex};
|
|
2728
2783
|
gap: 0.5rem;
|
|
2729
2784
|
.--divider {
|
|
2730
2785
|
width: ${depth * 32}px;
|
|
2731
|
-
background-color: ${
|
|
2786
|
+
background-color: ${import_eds_tokens5.tokens.colors.infographic.primary__moss_green_34.hex};
|
|
2732
2787
|
height: 3px;
|
|
2733
2788
|
border-radius: 0 5px 5px 0;
|
|
2734
2789
|
}
|
|
@@ -2736,11 +2791,11 @@ var CellWrapper = (0, import_styled_components8.default)(TypographyCustom)`
|
|
|
2736
2791
|
`;
|
|
2737
2792
|
function HierarchyCell(cell, options = {}) {
|
|
2738
2793
|
var _a, _b;
|
|
2739
|
-
return /* @__PURE__ */ (0,
|
|
2794
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(CellWrapper, {
|
|
2740
2795
|
depth: ((_a = options.getRowDepth) == null ? void 0 : _a.call(options)) ?? cell.row.depth,
|
|
2741
2796
|
expanded: cell.row.getIsExpanded(),
|
|
2742
2797
|
children: [
|
|
2743
|
-
/* @__PURE__ */ (0,
|
|
2798
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", {
|
|
2744
2799
|
className: "--divider"
|
|
2745
2800
|
}),
|
|
2746
2801
|
((_b = options.getDisplayName) == null ? void 0 : _b.call(options)) ?? cell.getValue()
|
|
@@ -2749,25 +2804,25 @@ function HierarchyCell(cell, options = {}) {
|
|
|
2749
2804
|
}
|
|
2750
2805
|
|
|
2751
2806
|
// src/cells/PopoverCell.tsx
|
|
2752
|
-
var
|
|
2807
|
+
var import_eds_core_react8 = require("@equinor/eds-core-react");
|
|
2753
2808
|
var import_react2 = require("react");
|
|
2754
|
-
var
|
|
2809
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
2755
2810
|
function PopoverCell(props) {
|
|
2756
2811
|
const [open, setOpen] = (0, import_react2.useState)(false);
|
|
2757
2812
|
const anchorRef = (0, import_react2.useRef)(null);
|
|
2758
2813
|
const handleClick = () => setOpen(!open);
|
|
2759
2814
|
const handleClose = () => setOpen(false);
|
|
2760
|
-
return /* @__PURE__ */ (0,
|
|
2815
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", {
|
|
2761
2816
|
style: { position: "relative" },
|
|
2762
2817
|
ref: anchorRef,
|
|
2763
2818
|
children: [
|
|
2764
|
-
/* @__PURE__ */ (0,
|
|
2819
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TypographyCustom, {
|
|
2765
2820
|
onClick: stopPropagation(handleClick),
|
|
2766
2821
|
style: { cursor: "pointer" },
|
|
2767
2822
|
truncate: true,
|
|
2768
2823
|
children: String(props.value)
|
|
2769
2824
|
}),
|
|
2770
|
-
/* @__PURE__ */ (0,
|
|
2825
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_eds_core_react8.Popover, {
|
|
2771
2826
|
id: props.id,
|
|
2772
2827
|
open,
|
|
2773
2828
|
"aria-controls": "expand cell",
|
|
@@ -2775,13 +2830,13 @@ function PopoverCell(props) {
|
|
|
2775
2830
|
onClose: handleClose,
|
|
2776
2831
|
placement: "bottom",
|
|
2777
2832
|
children: [
|
|
2778
|
-
props.title && /* @__PURE__ */ (0,
|
|
2779
|
-
children: /* @__PURE__ */ (0,
|
|
2833
|
+
props.title && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_eds_core_react8.Popover.Title, {
|
|
2834
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_eds_core_react8.Popover.Header, {
|
|
2780
2835
|
children: props.title
|
|
2781
2836
|
})
|
|
2782
2837
|
}),
|
|
2783
|
-
/* @__PURE__ */ (0,
|
|
2784
|
-
children: /* @__PURE__ */ (0,
|
|
2838
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_eds_core_react8.Popover.Content, {
|
|
2839
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_eds_core_react8.Typography, {
|
|
2785
2840
|
children: String(props.value)
|
|
2786
2841
|
})
|
|
2787
2842
|
})
|
|
@@ -2792,10 +2847,10 @@ function PopoverCell(props) {
|
|
|
2792
2847
|
}
|
|
2793
2848
|
|
|
2794
2849
|
// src/cells/SelectColumnDef.tsx
|
|
2795
|
-
var
|
|
2850
|
+
var import_eds_core_react9 = require("@equinor/eds-core-react");
|
|
2796
2851
|
var import_eds_icons4 = require("@equinor/eds-icons");
|
|
2797
2852
|
var import_styled_components9 = __toESM(require("styled-components"));
|
|
2798
|
-
var
|
|
2853
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
2799
2854
|
var CellWrapper2 = import_styled_components9.default.div`
|
|
2800
2855
|
display: flex;
|
|
2801
2856
|
align-items: center;
|
|
@@ -2808,8 +2863,8 @@ function SelectColumnDef(props) {
|
|
|
2808
2863
|
return {
|
|
2809
2864
|
id: "select",
|
|
2810
2865
|
size: props.includeExpansionButton ? 96 : 48,
|
|
2811
|
-
header: ({ table }) => selectionMode !== "single" ? /* @__PURE__ */ (0,
|
|
2812
|
-
children: /* @__PURE__ */ (0,
|
|
2866
|
+
header: ({ table }) => selectionMode !== "single" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CellWrapper2, {
|
|
2867
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_eds_core_react9.Checkbox, {
|
|
2813
2868
|
checked: table.getIsAllRowsSelected(),
|
|
2814
2869
|
indeterminate: table.getIsSomeRowsSelected(),
|
|
2815
2870
|
"aria-label": table.getIsAllRowsSelected() ? "Deselect all rows" : "Select all rows",
|
|
@@ -2818,28 +2873,28 @@ function SelectColumnDef(props) {
|
|
|
2818
2873
|
}) : null,
|
|
2819
2874
|
cell: ({ table, row }) => {
|
|
2820
2875
|
const paddingLeft = "0px";
|
|
2821
|
-
return /* @__PURE__ */ (0,
|
|
2876
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CellWrapper2, {
|
|
2822
2877
|
paddingLeft,
|
|
2823
2878
|
rowDepth: row.depth,
|
|
2824
|
-
children: /* @__PURE__ */ (0,
|
|
2879
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, {
|
|
2825
2880
|
children: [
|
|
2826
|
-
selectionMode === "single" ? /* @__PURE__ */ (0,
|
|
2881
|
+
selectionMode === "single" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_eds_core_react9.Radio, {
|
|
2827
2882
|
checked: row.getIsSelected(),
|
|
2828
2883
|
"aria-label": `Select row ${row.id}`,
|
|
2829
2884
|
onChange: stopPropagation(row.getToggleSelectedHandler())
|
|
2830
|
-
}) : /* @__PURE__ */ (0,
|
|
2885
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_eds_core_react9.Checkbox, {
|
|
2831
2886
|
checked: row.getIsSelected(),
|
|
2832
2887
|
indeterminate: row.getIsSomeSelected(),
|
|
2833
2888
|
"aria-label": `Select row ${row.id}`,
|
|
2834
2889
|
onChange: stopPropagation(row.getToggleSelectedHandler())
|
|
2835
2890
|
}),
|
|
2836
|
-
row.getCanExpand() && table.options.enableExpanding && /* @__PURE__ */ (0,
|
|
2891
|
+
row.getCanExpand() && table.options.enableExpanding && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_eds_core_react9.Button, {
|
|
2837
2892
|
variant: "ghost_icon",
|
|
2838
2893
|
color: "secondary",
|
|
2839
2894
|
"aria-label": row.getIsExpanded() ? "Close group" : "Expand group",
|
|
2840
2895
|
onClick: stopPropagation(row.getToggleExpandedHandler()),
|
|
2841
2896
|
style: { cursor: "pointer" },
|
|
2842
|
-
children: /* @__PURE__ */ (0,
|
|
2897
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_eds_core_react9.Icon, {
|
|
2843
2898
|
data: row.getIsExpanded() ? import_eds_icons4.chevron_up : import_eds_icons4.chevron_down
|
|
2844
2899
|
})
|
|
2845
2900
|
})
|
|
@@ -2851,7 +2906,7 @@ function SelectColumnDef(props) {
|
|
|
2851
2906
|
}
|
|
2852
2907
|
|
|
2853
2908
|
// src/DataTable/components/ColumnSelect.tsx
|
|
2854
|
-
var
|
|
2909
|
+
var import_eds_core_react10 = require("@equinor/eds-core-react");
|
|
2855
2910
|
var import_eds_icons5 = require("@equinor/eds-icons");
|
|
2856
2911
|
var import_react3 = require("react");
|
|
2857
2912
|
var import_styled_components10 = __toESM(require("styled-components"));
|
|
@@ -2886,7 +2941,7 @@ function getFunctionValueOrDefault(valueOrFn, fnProps, defaultValue) {
|
|
|
2886
2941
|
}
|
|
2887
2942
|
|
|
2888
2943
|
// src/DataTable/components/ColumnSelect.tsx
|
|
2889
|
-
var
|
|
2944
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
2890
2945
|
var ColumnSelectContent = import_styled_components10.default.div`
|
|
2891
2946
|
display: grid;
|
|
2892
2947
|
grid-template-columns: repeat(2, 1fr);
|
|
@@ -2902,12 +2957,12 @@ function ColumnSelect({ table }) {
|
|
|
2902
2957
|
const [isOpen, setIsOpen] = (0, import_react3.useState)(false);
|
|
2903
2958
|
const referenceElement = (0, import_react3.useRef)(null);
|
|
2904
2959
|
const selectableColumns = table.getAllLeafColumns().filter((column) => column.id !== "select");
|
|
2905
|
-
return /* @__PURE__ */ (0,
|
|
2960
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, {
|
|
2906
2961
|
children: [
|
|
2907
|
-
/* @__PURE__ */ (0,
|
|
2962
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_eds_core_react10.Tooltip, {
|
|
2908
2963
|
title: "Select columns",
|
|
2909
2964
|
placement: "left",
|
|
2910
|
-
children: /* @__PURE__ */ (0,
|
|
2965
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_eds_core_react10.Button, {
|
|
2911
2966
|
"aria-haspopup": true,
|
|
2912
2967
|
id: "column-select-anchor",
|
|
2913
2968
|
"aria-controls": "column-select-popover",
|
|
@@ -2915,29 +2970,29 @@ function ColumnSelect({ table }) {
|
|
|
2915
2970
|
ref: referenceElement,
|
|
2916
2971
|
variant: "ghost_icon",
|
|
2917
2972
|
onClick: () => setIsOpen(true),
|
|
2918
|
-
children: /* @__PURE__ */ (0,
|
|
2973
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_eds_core_react10.Icon, {
|
|
2919
2974
|
name: "view_column",
|
|
2920
2975
|
data: import_eds_icons5.view_column
|
|
2921
2976
|
})
|
|
2922
2977
|
})
|
|
2923
2978
|
}),
|
|
2924
|
-
/* @__PURE__ */ (0,
|
|
2979
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_eds_core_react10.Popover, {
|
|
2925
2980
|
open: isOpen,
|
|
2926
2981
|
id: "column-select-popover",
|
|
2927
2982
|
anchorEl: referenceElement.current,
|
|
2928
2983
|
placement: "bottom-end",
|
|
2929
2984
|
onClose: () => setIsOpen(false),
|
|
2930
2985
|
children: [
|
|
2931
|
-
/* @__PURE__ */ (0,
|
|
2986
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_eds_core_react10.Popover.Header, {
|
|
2932
2987
|
children: [
|
|
2933
|
-
/* @__PURE__ */ (0,
|
|
2988
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_eds_core_react10.Popover.Title, {
|
|
2934
2989
|
children: "Column settings"
|
|
2935
2990
|
}),
|
|
2936
|
-
/* @__PURE__ */ (0,
|
|
2991
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_eds_core_react10.Button, {
|
|
2937
2992
|
variant: "ghost_icon",
|
|
2938
2993
|
"aria-label": "Close column select",
|
|
2939
2994
|
onClick: () => setIsOpen(false),
|
|
2940
|
-
children: /* @__PURE__ */ (0,
|
|
2995
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_eds_core_react10.Icon, {
|
|
2941
2996
|
name: "close",
|
|
2942
2997
|
data: import_eds_icons5.close,
|
|
2943
2998
|
size: 24
|
|
@@ -2945,22 +3000,22 @@ function ColumnSelect({ table }) {
|
|
|
2945
3000
|
})
|
|
2946
3001
|
]
|
|
2947
3002
|
}),
|
|
2948
|
-
/* @__PURE__ */ (0,
|
|
3003
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_eds_core_react10.Popover.Content, {
|
|
2949
3004
|
children: [
|
|
2950
|
-
/* @__PURE__ */ (0,
|
|
3005
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ColumnSelectContent, {
|
|
2951
3006
|
children: selectableColumns.map((column) => {
|
|
2952
|
-
return /* @__PURE__ */ (0,
|
|
3007
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_eds_core_react10.Checkbox, {
|
|
2953
3008
|
checked: column.getIsVisible(),
|
|
2954
3009
|
label: getColumnHeader(column),
|
|
2955
3010
|
onChange: column.getToggleVisibilityHandler()
|
|
2956
3011
|
}, column.id);
|
|
2957
3012
|
})
|
|
2958
3013
|
}),
|
|
2959
|
-
/* @__PURE__ */ (0,
|
|
3014
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_eds_core_react10.Divider, {
|
|
2960
3015
|
variant: "small"
|
|
2961
3016
|
}),
|
|
2962
|
-
/* @__PURE__ */ (0,
|
|
2963
|
-
children: /* @__PURE__ */ (0,
|
|
3017
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ActionsWrapper, {
|
|
3018
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_eds_core_react10.Button, {
|
|
2964
3019
|
color: "secondary",
|
|
2965
3020
|
variant: "ghost",
|
|
2966
3021
|
disabled: table.getIsAllColumnsVisible(),
|
|
@@ -2977,14 +3032,15 @@ function ColumnSelect({ table }) {
|
|
|
2977
3032
|
}
|
|
2978
3033
|
|
|
2979
3034
|
// src/DataTable/components/TableHeader.tsx
|
|
2980
|
-
var
|
|
2981
|
-
var
|
|
3035
|
+
var import_eds_core_react11 = require("@equinor/eds-core-react");
|
|
3036
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
2982
3037
|
function TableHeader({ table, sticky }) {
|
|
2983
|
-
return /* @__PURE__ */ (0,
|
|
3038
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_eds_core_react11.Table.Head, {
|
|
2984
3039
|
sticky,
|
|
2985
|
-
children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0,
|
|
2986
|
-
children: headerGroup.headers.map((header) => /* @__PURE__ */ (0,
|
|
2987
|
-
header
|
|
3040
|
+
children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_eds_core_react11.Table.Row, {
|
|
3041
|
+
children: headerGroup.headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(HeaderCell, {
|
|
3042
|
+
header,
|
|
3043
|
+
table
|
|
2988
3044
|
}, header.id))
|
|
2989
3045
|
}, headerGroup.id))
|
|
2990
3046
|
});
|
|
@@ -2996,24 +3052,24 @@ var import_react7 = require("react");
|
|
|
2996
3052
|
var import_styled_components16 = __toESM(require("styled-components"));
|
|
2997
3053
|
|
|
2998
3054
|
// src/DataTable/components/BasicTable.tsx
|
|
2999
|
-
var
|
|
3055
|
+
var import_eds_core_react15 = require("@equinor/eds-core-react");
|
|
3000
3056
|
|
|
3001
3057
|
// src/DataTable/components/PlaceholderRow.tsx
|
|
3002
|
-
var
|
|
3058
|
+
var import_eds_core_react12 = require("@equinor/eds-core-react");
|
|
3003
3059
|
var import_styled_components11 = __toESM(require("styled-components"));
|
|
3004
|
-
var
|
|
3060
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
3005
3061
|
var PlaceholderTextWrapper = import_styled_components11.default.div`
|
|
3006
3062
|
display: flex;
|
|
3007
3063
|
justify-content: center;
|
|
3008
3064
|
`;
|
|
3009
3065
|
function PlaceholderRow({ isLoading }) {
|
|
3010
|
-
return /* @__PURE__ */ (0,
|
|
3011
|
-
children: /* @__PURE__ */ (0,
|
|
3066
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_eds_core_react12.Table.Row, {
|
|
3067
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_eds_core_react12.Table.Cell, {
|
|
3012
3068
|
colSpan: 100,
|
|
3013
|
-
children: /* @__PURE__ */ (0,
|
|
3014
|
-
children: isLoading ? /* @__PURE__ */ (0,
|
|
3069
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(PlaceholderTextWrapper, {
|
|
3070
|
+
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_eds_core_react12.DotProgress, {
|
|
3015
3071
|
color: "primary"
|
|
3016
|
-
}) : /* @__PURE__ */ (0,
|
|
3072
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_eds_core_react12.Typography, {
|
|
3017
3073
|
children: "No data available"
|
|
3018
3074
|
})
|
|
3019
3075
|
})
|
|
@@ -3022,18 +3078,18 @@ function PlaceholderRow({ isLoading }) {
|
|
|
3022
3078
|
}
|
|
3023
3079
|
|
|
3024
3080
|
// src/DataTable/components/TableBody.tsx
|
|
3025
|
-
var
|
|
3081
|
+
var import_eds_core_react13 = require("@equinor/eds-core-react");
|
|
3026
3082
|
var import_styled_components12 = __toESM(require("styled-components"));
|
|
3027
|
-
var TableBody = (0, import_styled_components12.default)(
|
|
3083
|
+
var TableBody = (0, import_styled_components12.default)(import_eds_core_react13.Table.Body)`
|
|
3028
3084
|
// The following attribute are important for fixed column width
|
|
3029
3085
|
// CHANGE THES WITH CAUTION
|
|
3030
3086
|
background: inherit;
|
|
3031
3087
|
`;
|
|
3032
3088
|
|
|
3033
3089
|
// src/DataTable/components/TableRow.tsx
|
|
3034
|
-
var
|
|
3090
|
+
var import_eds_core_react14 = require("@equinor/eds-core-react");
|
|
3035
3091
|
var import_styled_components13 = __toESM(require("styled-components"));
|
|
3036
|
-
var
|
|
3092
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
3037
3093
|
function TableRow({
|
|
3038
3094
|
row,
|
|
3039
3095
|
rowConfig,
|
|
@@ -3043,7 +3099,7 @@ function TableRow({
|
|
|
3043
3099
|
}) {
|
|
3044
3100
|
var _a;
|
|
3045
3101
|
const rowWrapper = rowConfig == null ? void 0 : rowConfig.rowWrapper;
|
|
3046
|
-
const tableRowContent = /* @__PURE__ */ (0,
|
|
3102
|
+
const tableRowContent = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(StyledTableRow, {
|
|
3047
3103
|
active: row.getIsSelected(),
|
|
3048
3104
|
"data-index": index,
|
|
3049
3105
|
ref: measureElement,
|
|
@@ -3059,7 +3115,7 @@ function TableRow({
|
|
|
3059
3115
|
onMouseLeave: handleRowEvent(row, rowConfig == null ? void 0 : rowConfig.onMouseLeave),
|
|
3060
3116
|
children: row.getVisibleCells().map((cell) => {
|
|
3061
3117
|
var _a2;
|
|
3062
|
-
return /* @__PURE__ */ (0,
|
|
3118
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DynamicCell, {
|
|
3063
3119
|
cell,
|
|
3064
3120
|
getStickyCellColor: cellConfig == null ? void 0 : cellConfig.getStickyCellColor,
|
|
3065
3121
|
highlight: (_a2 = cellConfig == null ? void 0 : cellConfig.getShouldHighlight) == null ? void 0 : _a2.call(cellConfig, cell)
|
|
@@ -3068,7 +3124,7 @@ function TableRow({
|
|
|
3068
3124
|
});
|
|
3069
3125
|
return rowWrapper ? rowWrapper({ row, children: tableRowContent }) : tableRowContent;
|
|
3070
3126
|
}
|
|
3071
|
-
var StyledTableRow = (0, import_styled_components13.default)(
|
|
3127
|
+
var StyledTableRow = (0, import_styled_components13.default)(import_eds_core_react14.Table.Row)`
|
|
3072
3128
|
/* Background color must be inherited here. Does not work with inline styling */
|
|
3073
3129
|
${({ active }) => active ? "" : "background-color: inherit;"}
|
|
3074
3130
|
`;
|
|
@@ -3081,7 +3137,7 @@ function handleRowEvent(row, handler) {
|
|
|
3081
3137
|
}
|
|
3082
3138
|
|
|
3083
3139
|
// src/DataTable/components/BasicTable.tsx
|
|
3084
|
-
var
|
|
3140
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
3085
3141
|
function BasicTable({
|
|
3086
3142
|
table,
|
|
3087
3143
|
rowConfig,
|
|
@@ -3091,22 +3147,22 @@ function BasicTable({
|
|
|
3091
3147
|
tableCaption
|
|
3092
3148
|
}) {
|
|
3093
3149
|
const tableRows = table.getRowModel().rows;
|
|
3094
|
-
return /* @__PURE__ */ (0,
|
|
3150
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_eds_core_react15.Table, {
|
|
3095
3151
|
children: [
|
|
3096
|
-
/* @__PURE__ */ (0,
|
|
3152
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_eds_core_react15.Table.Caption, {
|
|
3097
3153
|
hidden: true,
|
|
3098
3154
|
children: tableCaption
|
|
3099
3155
|
}),
|
|
3100
|
-
/* @__PURE__ */ (0,
|
|
3156
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(TableHeader, {
|
|
3101
3157
|
sticky: stickyHeader,
|
|
3102
3158
|
table
|
|
3103
3159
|
}),
|
|
3104
|
-
/* @__PURE__ */ (0,
|
|
3105
|
-
children: tableRows.length ? tableRows.map((row) => /* @__PURE__ */ (0,
|
|
3160
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(TableBody, {
|
|
3161
|
+
children: tableRows.length ? tableRows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(TableRow, {
|
|
3106
3162
|
row,
|
|
3107
3163
|
rowConfig,
|
|
3108
3164
|
cellConfig
|
|
3109
|
-
}, row.id)) : /* @__PURE__ */ (0,
|
|
3165
|
+
}, row.id)) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(PlaceholderRow, {
|
|
3110
3166
|
isLoading
|
|
3111
3167
|
})
|
|
3112
3168
|
})
|
|
@@ -3115,20 +3171,20 @@ function BasicTable({
|
|
|
3115
3171
|
}
|
|
3116
3172
|
|
|
3117
3173
|
// src/DataTable/components/DataTableHeader.tsx
|
|
3118
|
-
var
|
|
3174
|
+
var import_eds_core_react17 = require("@equinor/eds-core-react");
|
|
3119
3175
|
var import_eds_icons7 = require("@equinor/eds-icons");
|
|
3120
3176
|
var import_styled_components15 = __toESM(require("styled-components"));
|
|
3121
3177
|
|
|
3122
3178
|
// src/DataTable/filters/DebouncedInput.tsx
|
|
3123
|
-
var
|
|
3179
|
+
var import_eds_core_react16 = require("@equinor/eds-core-react");
|
|
3124
3180
|
var import_eds_icons6 = require("@equinor/eds-icons");
|
|
3125
3181
|
var import_react4 = require("react");
|
|
3126
3182
|
var import_styled_components14 = __toESM(require("styled-components"));
|
|
3127
|
-
var
|
|
3183
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
3128
3184
|
var Wrapper3 = import_styled_components14.default.div`
|
|
3129
3185
|
width: 200px;
|
|
3130
3186
|
`;
|
|
3131
|
-
var CloseButton = (0, import_styled_components14.default)(
|
|
3187
|
+
var CloseButton = (0, import_styled_components14.default)(import_eds_core_react16.Button)`
|
|
3132
3188
|
width: 24px;
|
|
3133
3189
|
height: 24px;
|
|
3134
3190
|
`;
|
|
@@ -3149,21 +3205,21 @@ function DebouncedInput({
|
|
|
3149
3205
|
}, debounce);
|
|
3150
3206
|
return () => clearTimeout(timeout);
|
|
3151
3207
|
}, [value]);
|
|
3152
|
-
return /* @__PURE__ */ (0,
|
|
3153
|
-
children: /* @__PURE__ */ (0,
|
|
3208
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Wrapper3, {
|
|
3209
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_eds_core_react16.Input, {
|
|
3154
3210
|
...props,
|
|
3155
3211
|
value,
|
|
3156
|
-
leftAdornments: icon && /* @__PURE__ */ (0,
|
|
3212
|
+
leftAdornments: icon && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_eds_core_react16.Icon, {
|
|
3157
3213
|
name: icon.name,
|
|
3158
3214
|
data: icon,
|
|
3159
3215
|
size: 18
|
|
3160
3216
|
}),
|
|
3161
|
-
rightAdornments: !!value && /* @__PURE__ */ (0,
|
|
3217
|
+
rightAdornments: !!value && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_eds_core_react16.Tooltip, {
|
|
3162
3218
|
title: "Clear input",
|
|
3163
|
-
children: /* @__PURE__ */ (0,
|
|
3219
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(CloseButton, {
|
|
3164
3220
|
variant: "ghost_icon",
|
|
3165
3221
|
onClick: () => setValue(""),
|
|
3166
|
-
children: /* @__PURE__ */ (0,
|
|
3222
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_eds_core_react16.Icon, {
|
|
3167
3223
|
name: import_eds_icons6.close.name,
|
|
3168
3224
|
data: import_eds_icons6.close,
|
|
3169
3225
|
size: 18
|
|
@@ -3186,7 +3242,7 @@ var fuzzyFilter = (row, columnId, value, addMeta) => {
|
|
|
3186
3242
|
};
|
|
3187
3243
|
|
|
3188
3244
|
// src/DataTable/components/DataTableHeader.tsx
|
|
3189
|
-
var
|
|
3245
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
3190
3246
|
var TableBannerWrapper = import_styled_components15.default.div`
|
|
3191
3247
|
display: flex;
|
|
3192
3248
|
align-items: center;
|
|
@@ -3207,14 +3263,14 @@ function TableBanner({
|
|
|
3207
3263
|
globalFilter
|
|
3208
3264
|
}) {
|
|
3209
3265
|
var _a;
|
|
3210
|
-
return /* @__PURE__ */ (0,
|
|
3266
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(TableBannerWrapper, {
|
|
3211
3267
|
className: "--table-caption",
|
|
3212
3268
|
padding: bannerConfig == null ? void 0 : bannerConfig.padding,
|
|
3213
3269
|
children: [
|
|
3214
|
-
/* @__PURE__ */ (0,
|
|
3270
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(FilterContainer, {
|
|
3215
3271
|
className: "--filter-container-left",
|
|
3216
3272
|
children: [
|
|
3217
|
-
(bannerConfig == null ? void 0 : bannerConfig.enableTableCaption) && /* @__PURE__ */ (0,
|
|
3273
|
+
(bannerConfig == null ? void 0 : bannerConfig.enableTableCaption) && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_eds_core_react17.Typography, {
|
|
3218
3274
|
variant: "h3",
|
|
3219
3275
|
as: "h2",
|
|
3220
3276
|
children: tableCaption
|
|
@@ -3222,20 +3278,20 @@ function TableBanner({
|
|
|
3222
3278
|
(_a = bannerConfig == null ? void 0 : bannerConfig.customActions) == null ? void 0 : _a.call(bannerConfig, table)
|
|
3223
3279
|
]
|
|
3224
3280
|
}),
|
|
3225
|
-
/* @__PURE__ */ (0,
|
|
3281
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(FilterContainer, {
|
|
3226
3282
|
className: "--filter-container-right",
|
|
3227
|
-
children: /* @__PURE__ */ (0,
|
|
3283
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, {
|
|
3228
3284
|
children: [
|
|
3229
|
-
(bannerConfig == null ? void 0 : bannerConfig.enableGlobalFilterInput) && /* @__PURE__ */ (0,
|
|
3285
|
+
(bannerConfig == null ? void 0 : bannerConfig.enableGlobalFilterInput) && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DebouncedInput, {
|
|
3230
3286
|
value: globalFilter.state,
|
|
3231
3287
|
icon: import_eds_icons7.search,
|
|
3232
3288
|
placeholder: bannerConfig.globalFilterPlaceholder ?? "Search all columns",
|
|
3233
3289
|
onChange: (value) => globalFilter.onChange(String(value))
|
|
3234
3290
|
}),
|
|
3235
|
-
(bannerConfig == null ? void 0 : bannerConfig.enableColumnSelect) && /* @__PURE__ */ (0,
|
|
3291
|
+
(bannerConfig == null ? void 0 : bannerConfig.enableColumnSelect) && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ColumnSelect, {
|
|
3236
3292
|
table
|
|
3237
3293
|
}),
|
|
3238
|
-
(bannerConfig == null ? void 0 : bannerConfig.totalRowCount) && /* @__PURE__ */ (0,
|
|
3294
|
+
(bannerConfig == null ? void 0 : bannerConfig.totalRowCount) && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", {
|
|
3239
3295
|
children: [
|
|
3240
3296
|
table.options.data.length.toLocaleString(),
|
|
3241
3297
|
" /",
|
|
@@ -3252,25 +3308,25 @@ function TableBanner({
|
|
|
3252
3308
|
}
|
|
3253
3309
|
|
|
3254
3310
|
// src/DataTable/components/VirtualTable.tsx
|
|
3255
|
-
var
|
|
3311
|
+
var import_eds_core_react19 = require("@equinor/eds-core-react");
|
|
3256
3312
|
var import_react_virtual = require("@tanstack/react-virtual");
|
|
3257
3313
|
|
|
3258
3314
|
// src/DataTable/components/PaddingRow.tsx
|
|
3259
|
-
var
|
|
3260
|
-
var
|
|
3315
|
+
var import_eds_core_react18 = require("@equinor/eds-core-react");
|
|
3316
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
3261
3317
|
var PaddingRow = (props) => {
|
|
3262
3318
|
if (!props.height)
|
|
3263
3319
|
return null;
|
|
3264
|
-
return /* @__PURE__ */ (0,
|
|
3320
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_eds_core_react18.Table.Row, {
|
|
3265
3321
|
style: { pointerEvents: "none" },
|
|
3266
|
-
children: /* @__PURE__ */ (0,
|
|
3322
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_eds_core_react18.Table.Cell, {
|
|
3267
3323
|
style: { height: `${props.height}px` }
|
|
3268
3324
|
})
|
|
3269
3325
|
});
|
|
3270
3326
|
};
|
|
3271
3327
|
|
|
3272
3328
|
// src/DataTable/components/VirtualTable.tsx
|
|
3273
|
-
var
|
|
3329
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
3274
3330
|
function VirtualTable({
|
|
3275
3331
|
table,
|
|
3276
3332
|
rowConfig,
|
|
@@ -3290,34 +3346,34 @@ function VirtualTable({
|
|
|
3290
3346
|
const virtualRows = rowVirtualizer.getVirtualItems();
|
|
3291
3347
|
const paddingTop = virtualRows.length > 0 ? ((_a = virtualRows == null ? void 0 : virtualRows[0]) == null ? void 0 : _a.start) || 0 : 0;
|
|
3292
3348
|
const paddingBottom = virtualRows.length > 0 ? rowVirtualizer.getTotalSize() - (((_b = virtualRows == null ? void 0 : virtualRows[virtualRows.length - 1]) == null ? void 0 : _b.end) || 0) : 0;
|
|
3293
|
-
return /* @__PURE__ */ (0,
|
|
3349
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_eds_core_react19.Table, {
|
|
3294
3350
|
children: [
|
|
3295
|
-
/* @__PURE__ */ (0,
|
|
3351
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_eds_core_react19.Table.Caption, {
|
|
3296
3352
|
hidden: true,
|
|
3297
3353
|
children: props.tableCaption
|
|
3298
3354
|
}),
|
|
3299
|
-
/* @__PURE__ */ (0,
|
|
3355
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(TableHeader, {
|
|
3300
3356
|
sticky: props.stickyHeader,
|
|
3301
3357
|
table
|
|
3302
3358
|
}),
|
|
3303
|
-
/* @__PURE__ */ (0,
|
|
3359
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(TableBody, {
|
|
3304
3360
|
children: [
|
|
3305
|
-
/* @__PURE__ */ (0,
|
|
3361
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(PaddingRow, {
|
|
3306
3362
|
height: paddingTop
|
|
3307
3363
|
}),
|
|
3308
3364
|
rows.length ? virtualRows.map((virtualRow) => {
|
|
3309
3365
|
const row = rows[virtualRow.index];
|
|
3310
|
-
return /* @__PURE__ */ (0,
|
|
3366
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(TableRow, {
|
|
3311
3367
|
row,
|
|
3312
3368
|
rowConfig,
|
|
3313
3369
|
cellConfig,
|
|
3314
3370
|
index: virtualRow.index,
|
|
3315
3371
|
measureElement: rowVirtualizer.measureElement
|
|
3316
3372
|
}, row.id);
|
|
3317
|
-
}) : /* @__PURE__ */ (0,
|
|
3373
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(PlaceholderRow, {
|
|
3318
3374
|
isLoading: props.isLoading
|
|
3319
3375
|
}),
|
|
3320
|
-
/* @__PURE__ */ (0,
|
|
3376
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(PaddingRow, {
|
|
3321
3377
|
height: paddingBottom
|
|
3322
3378
|
})
|
|
3323
3379
|
]
|
|
@@ -3363,7 +3419,7 @@ function useForceRerender() {
|
|
|
3363
3419
|
}
|
|
3364
3420
|
|
|
3365
3421
|
// src/DataTable/DataTable.tsx
|
|
3366
|
-
var
|
|
3422
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
3367
3423
|
function canUseContainStrict(height) {
|
|
3368
3424
|
if (!height)
|
|
3369
3425
|
return false;
|
|
@@ -3439,13 +3495,15 @@ function DataTable(props) {
|
|
|
3439
3495
|
defaultColumn: {
|
|
3440
3496
|
cell: ({ cell }) => {
|
|
3441
3497
|
const truncateMode = getFunctionValueOrDefault(cellConfig == null ? void 0 : cellConfig.truncateMode, cell, "hover");
|
|
3442
|
-
return /* @__PURE__ */ (0,
|
|
3498
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TypographyCustom, {
|
|
3443
3499
|
truncate: truncateMode === "hover",
|
|
3444
3500
|
enableShowAllOnHover: true,
|
|
3445
3501
|
children: cell.getValue()
|
|
3446
3502
|
});
|
|
3447
3503
|
}
|
|
3448
3504
|
},
|
|
3505
|
+
enableColumnResizing: Boolean(props.columnResizing),
|
|
3506
|
+
columnResizeMode: typeof props.columnResizing === "boolean" ? "onChange" : props.columnResizing,
|
|
3449
3507
|
enableSorting: sorting == null ? void 0 : sorting.enableSorting,
|
|
3450
3508
|
manualSorting: sorting == null ? void 0 : sorting.manualSorting,
|
|
3451
3509
|
enableExpanding: Boolean(props.expansion),
|
|
@@ -3481,18 +3539,18 @@ function DataTable(props) {
|
|
|
3481
3539
|
if (Boolean(tableContainerRef.current))
|
|
3482
3540
|
forceRerender();
|
|
3483
3541
|
}, [tableContainerRef.current === null]);
|
|
3484
|
-
return /* @__PURE__ */ (0,
|
|
3542
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(DataTableWrapper, {
|
|
3485
3543
|
height: props == null ? void 0 : props.height,
|
|
3486
3544
|
width: props == null ? void 0 : props.width,
|
|
3487
3545
|
tableLayout: props == null ? void 0 : props.tableLayout,
|
|
3488
3546
|
children: [
|
|
3489
|
-
props.bannerConfig && /* @__PURE__ */ (0,
|
|
3547
|
+
props.bannerConfig && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TableBanner, {
|
|
3490
3548
|
table,
|
|
3491
3549
|
bannerConfig: props.bannerConfig,
|
|
3492
3550
|
globalFilter: { state: globalFilterState, onChange: setGlobalFilterState },
|
|
3493
3551
|
tableCaption: props.tableCaption
|
|
3494
3552
|
}),
|
|
3495
|
-
/* @__PURE__ */ (0,
|
|
3553
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", {
|
|
3496
3554
|
...props.tableContainerProps,
|
|
3497
3555
|
className: "--table-container " + (((_q = props.tableContainerProps) == null ? void 0 : _q.className) ?? ""),
|
|
3498
3556
|
onScroll: ((_r = props.tableContainerProps) == null ? void 0 : _r.onScroll) ?? onTableContainerScroll,
|
|
@@ -3505,7 +3563,7 @@ function DataTable(props) {
|
|
|
3505
3563
|
}
|
|
3506
3564
|
}
|
|
3507
3565
|
},
|
|
3508
|
-
children: (props == null ? void 0 : props.virtual) ? /* @__PURE__ */ (0,
|
|
3566
|
+
children: (props == null ? void 0 : props.virtual) ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(VirtualTable, {
|
|
3509
3567
|
containerRef: tableContainerRef,
|
|
3510
3568
|
tableCaption: props.tableCaption,
|
|
3511
3569
|
table,
|
|
@@ -3513,7 +3571,7 @@ function DataTable(props) {
|
|
|
3513
3571
|
cellConfig,
|
|
3514
3572
|
isLoading,
|
|
3515
3573
|
stickyHeader: props.stickyHeader
|
|
3516
|
-
}) : /* @__PURE__ */ (0,
|
|
3574
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(BasicTable, {
|
|
3517
3575
|
tableCaption: props.tableCaption,
|
|
3518
3576
|
table,
|
|
3519
3577
|
rowConfig,
|
|
@@ -3527,7 +3585,7 @@ function DataTable(props) {
|
|
|
3527
3585
|
}
|
|
3528
3586
|
|
|
3529
3587
|
// src/form-cells/EditableCheckboxCell.tsx
|
|
3530
|
-
var
|
|
3588
|
+
var import_eds_core_react20 = require("@equinor/eds-core-react");
|
|
3531
3589
|
var import_react_hook_form2 = require("react-hook-form");
|
|
3532
3590
|
|
|
3533
3591
|
// src/form-meta/utils.tsx
|
|
@@ -3565,20 +3623,20 @@ function addFormMeta(withoutFormMeta) {
|
|
|
3565
3623
|
}
|
|
3566
3624
|
|
|
3567
3625
|
// src/form-cells/EditableCheckboxCell.tsx
|
|
3568
|
-
var
|
|
3626
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
3569
3627
|
function EditableCheckboxCell(context) {
|
|
3570
3628
|
const editMode = useEditMode();
|
|
3571
3629
|
if (!editMode)
|
|
3572
|
-
return /* @__PURE__ */ (0,
|
|
3630
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_eds_core_react20.Checkbox, {
|
|
3573
3631
|
enterKeyHint: "next",
|
|
3574
3632
|
"aria-label": "readonly",
|
|
3575
3633
|
readOnly: true,
|
|
3576
3634
|
checked: context.getValue(),
|
|
3577
3635
|
disabled: true
|
|
3578
3636
|
});
|
|
3579
|
-
return /* @__PURE__ */ (0,
|
|
3637
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_hook_form2.Controller, {
|
|
3580
3638
|
name: context.column.id,
|
|
3581
|
-
render: ({ field: { value, ...field } }) => /* @__PURE__ */ (0,
|
|
3639
|
+
render: ({ field: { value, ...field } }) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_eds_core_react20.Checkbox, {
|
|
3582
3640
|
enterKeyHint: "send",
|
|
3583
3641
|
"aria-label": "editable",
|
|
3584
3642
|
checked: value,
|
|
@@ -3588,15 +3646,15 @@ function EditableCheckboxCell(context) {
|
|
|
3588
3646
|
}
|
|
3589
3647
|
|
|
3590
3648
|
// src/form-cells/EditableDateCell.tsx
|
|
3591
|
-
var
|
|
3649
|
+
var import_eds_core_react22 = require("@equinor/eds-core-react");
|
|
3592
3650
|
var import_react8 = require("react");
|
|
3593
3651
|
var import_react_hook_form3 = require("react-hook-form");
|
|
3594
3652
|
var import_styled_components17 = __toESM(require("styled-components"));
|
|
3595
3653
|
|
|
3596
3654
|
// src/form-cells/utils.tsx
|
|
3597
|
-
var
|
|
3655
|
+
var import_eds_core_react21 = require("@equinor/eds-core-react");
|
|
3598
3656
|
var import_eds_icons8 = require("@equinor/eds-icons");
|
|
3599
|
-
var
|
|
3657
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
3600
3658
|
function getHelperTextProps({
|
|
3601
3659
|
error,
|
|
3602
3660
|
warning,
|
|
@@ -3606,7 +3664,7 @@ function getHelperTextProps({
|
|
|
3606
3664
|
return {
|
|
3607
3665
|
variant: "error",
|
|
3608
3666
|
helperText: error.message,
|
|
3609
|
-
helperIcon: /* @__PURE__ */ (0,
|
|
3667
|
+
helperIcon: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_eds_core_react21.Icon, {
|
|
3610
3668
|
data: import_eds_icons8.error_filled,
|
|
3611
3669
|
size: 16
|
|
3612
3670
|
})
|
|
@@ -3615,7 +3673,7 @@ function getHelperTextProps({
|
|
|
3615
3673
|
return {
|
|
3616
3674
|
variant: "warning",
|
|
3617
3675
|
helperText: warning.message,
|
|
3618
|
-
helperIcon: /* @__PURE__ */ (0,
|
|
3676
|
+
helperIcon: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_eds_core_react21.Icon, {
|
|
3619
3677
|
data: import_eds_icons8.warning_filled,
|
|
3620
3678
|
size: 16
|
|
3621
3679
|
})
|
|
@@ -3633,7 +3691,7 @@ function stopPropagation2(handler) {
|
|
|
3633
3691
|
}
|
|
3634
3692
|
|
|
3635
3693
|
// src/form-cells/EditableDateCell.tsx
|
|
3636
|
-
var
|
|
3694
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
3637
3695
|
function EditableDateCell(props) {
|
|
3638
3696
|
const { dateStringFormatter, ...context } = props;
|
|
3639
3697
|
const rawValue = context.getValue();
|
|
@@ -3643,13 +3701,13 @@ function EditableDateCell(props) {
|
|
|
3643
3701
|
[rawValue, dateStringFormatter]
|
|
3644
3702
|
);
|
|
3645
3703
|
if (!editMode)
|
|
3646
|
-
return /* @__PURE__ */ (0,
|
|
3704
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TypographyCustom, {
|
|
3647
3705
|
truncate: true,
|
|
3648
3706
|
children: formattedValue
|
|
3649
3707
|
});
|
|
3650
|
-
return /* @__PURE__ */ (0,
|
|
3708
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_hook_form3.Controller, {
|
|
3651
3709
|
name: context.column.id,
|
|
3652
|
-
render: ({ field: { value, onChange, ...field }, fieldState: { error } }) => /* @__PURE__ */ (0,
|
|
3710
|
+
render: ({ field: { value, onChange, ...field }, fieldState: { error } }) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(InlineTextField, {
|
|
3653
3711
|
id: context.column.id,
|
|
3654
3712
|
type: "date",
|
|
3655
3713
|
autoComplete: "none",
|
|
@@ -3666,7 +3724,7 @@ function parseISODate(dateString) {
|
|
|
3666
3724
|
const dateWithoutOffset = new Date(date.getTime() - offset * 60 * 1e3);
|
|
3667
3725
|
return dateWithoutOffset.toISOString().split("T")[0];
|
|
3668
3726
|
}
|
|
3669
|
-
var InlineTextField = (0, import_styled_components17.default)(
|
|
3727
|
+
var InlineTextField = (0, import_styled_components17.default)(import_eds_core_react22.TextField)`
|
|
3670
3728
|
/*
|
|
3671
3729
|
TODO: Improve input based on feedback from UX
|
|
3672
3730
|
& > div {
|
|
@@ -3690,9 +3748,9 @@ var InlineTextField = (0, import_styled_components17.default)(import_eds_core_re
|
|
|
3690
3748
|
`;
|
|
3691
3749
|
|
|
3692
3750
|
// src/form-cells/EditableDropdownSingleCell.tsx
|
|
3693
|
-
var
|
|
3751
|
+
var import_eds_core_react23 = require("@equinor/eds-core-react");
|
|
3694
3752
|
var import_react_hook_form4 = require("react-hook-form");
|
|
3695
|
-
var
|
|
3753
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
3696
3754
|
function buildEmptyOption() {
|
|
3697
3755
|
return { label: "", value: "" };
|
|
3698
3756
|
}
|
|
@@ -3700,15 +3758,15 @@ function EditableDropdownSingleCell(props) {
|
|
|
3700
3758
|
const { options, ...context } = props;
|
|
3701
3759
|
const editMode = useEditMode();
|
|
3702
3760
|
if (!editMode)
|
|
3703
|
-
return /* @__PURE__ */ (0,
|
|
3761
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(TypographyCustom, {
|
|
3704
3762
|
truncate: true,
|
|
3705
3763
|
children: context.getValue()
|
|
3706
3764
|
});
|
|
3707
|
-
return /* @__PURE__ */ (0,
|
|
3765
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_hook_form4.Controller, {
|
|
3708
3766
|
name: context.column.id,
|
|
3709
3767
|
render: ({ field: { value, onChange, ...field } }) => {
|
|
3710
3768
|
const selectedOption = options.find((option) => option.value === value) ?? buildEmptyOption();
|
|
3711
|
-
return /* @__PURE__ */ (0,
|
|
3769
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_eds_core_react23.Autocomplete, {
|
|
3712
3770
|
label: "",
|
|
3713
3771
|
selectedOptions: selectedOption && [selectedOption],
|
|
3714
3772
|
options,
|
|
@@ -3727,21 +3785,21 @@ function EditableDropdownSingleCell(props) {
|
|
|
3727
3785
|
}
|
|
3728
3786
|
|
|
3729
3787
|
// src/form-cells/EditableNumberCell.tsx
|
|
3730
|
-
var
|
|
3788
|
+
var import_eds_core_react24 = require("@equinor/eds-core-react");
|
|
3731
3789
|
var import_react_hook_form5 = require("react-hook-form");
|
|
3732
3790
|
var import_styled_components18 = __toESM(require("styled-components"));
|
|
3733
|
-
var
|
|
3791
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
3734
3792
|
function EditableNumberCell(context) {
|
|
3735
3793
|
const editMode = useEditMode();
|
|
3736
3794
|
if (!editMode)
|
|
3737
|
-
return /* @__PURE__ */ (0,
|
|
3795
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TypographyCustom, {
|
|
3738
3796
|
truncate: true,
|
|
3739
3797
|
children: context.getValue()
|
|
3740
3798
|
});
|
|
3741
|
-
return /* @__PURE__ */ (0,
|
|
3799
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react_hook_form5.Controller, {
|
|
3742
3800
|
name: context.column.id,
|
|
3743
|
-
render: ({ field: { onChange, ...field }, fieldState: { error } }) => /* @__PURE__ */ (0,
|
|
3744
|
-
children: /* @__PURE__ */ (0,
|
|
3801
|
+
render: ({ field: { onChange, ...field }, fieldState: { error } }) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_jsx_runtime25.Fragment, {
|
|
3802
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(InlineTextField2, {
|
|
3745
3803
|
id: context.column.id,
|
|
3746
3804
|
type: "number",
|
|
3747
3805
|
autoComplete: "none",
|
|
@@ -3752,7 +3810,7 @@ function EditableNumberCell(context) {
|
|
|
3752
3810
|
})
|
|
3753
3811
|
});
|
|
3754
3812
|
}
|
|
3755
|
-
var InlineTextField2 = (0, import_styled_components18.default)(
|
|
3813
|
+
var InlineTextField2 = (0, import_styled_components18.default)(import_eds_core_react24.TextField)`
|
|
3756
3814
|
/*
|
|
3757
3815
|
TODO: Improve input based on feedback from UX
|
|
3758
3816
|
& > div {
|
|
@@ -3776,12 +3834,12 @@ var InlineTextField2 = (0, import_styled_components18.default)(import_eds_core_r
|
|
|
3776
3834
|
`;
|
|
3777
3835
|
|
|
3778
3836
|
// src/form-cells/EditableTextAreaCell.tsx
|
|
3779
|
-
var
|
|
3837
|
+
var import_eds_core_react25 = require("@equinor/eds-core-react");
|
|
3780
3838
|
var import_eds_icons9 = require("@equinor/eds-icons");
|
|
3781
3839
|
var import_react9 = require("react");
|
|
3782
3840
|
var import_react_hook_form6 = require("react-hook-form");
|
|
3783
3841
|
var import_styled_components19 = __toESM(require("styled-components"));
|
|
3784
|
-
var
|
|
3842
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
3785
3843
|
function EditableTextAreaCell(props) {
|
|
3786
3844
|
const { title, ...context } = props;
|
|
3787
3845
|
const [textareaValue, setTextareaValue] = (0, import_react9.useState)(context.getValue());
|
|
@@ -3789,35 +3847,35 @@ function EditableTextAreaCell(props) {
|
|
|
3789
3847
|
const editMode = useEditMode();
|
|
3790
3848
|
const name = context.column.id;
|
|
3791
3849
|
if (!editMode)
|
|
3792
|
-
return /* @__PURE__ */ (0,
|
|
3850
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(PopoverCell, {
|
|
3793
3851
|
id: name + "popover",
|
|
3794
3852
|
value: context.getValue(),
|
|
3795
3853
|
title
|
|
3796
3854
|
});
|
|
3797
3855
|
const openDialog = () => setOpen(true);
|
|
3798
3856
|
const closeDialog = () => setOpen(false);
|
|
3799
|
-
return /* @__PURE__ */ (0,
|
|
3857
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_hook_form6.Controller, {
|
|
3800
3858
|
name,
|
|
3801
|
-
render: ({ field: { onChange, ref, ...field }, fieldState: { error } }) => /* @__PURE__ */ (0,
|
|
3859
|
+
render: ({ field: { onChange, ref, ...field }, fieldState: { error } }) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, {
|
|
3802
3860
|
children: [
|
|
3803
|
-
/* @__PURE__ */ (0,
|
|
3861
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", {
|
|
3804
3862
|
style: {
|
|
3805
3863
|
display: "flex",
|
|
3806
3864
|
alignItems: "center",
|
|
3807
3865
|
position: "relative"
|
|
3808
3866
|
},
|
|
3809
3867
|
children: [
|
|
3810
|
-
/* @__PURE__ */ (0,
|
|
3868
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(StyledTextField, {
|
|
3811
3869
|
id: field.name,
|
|
3812
3870
|
onChange,
|
|
3813
3871
|
ref,
|
|
3814
3872
|
...field,
|
|
3815
3873
|
...getHelperTextProps({ error })
|
|
3816
3874
|
}),
|
|
3817
|
-
/* @__PURE__ */ (0,
|
|
3875
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(IconButton, {
|
|
3818
3876
|
variant: "ghost_icon",
|
|
3819
3877
|
onClick: stopPropagation2(openDialog),
|
|
3820
|
-
children: /* @__PURE__ */ (0,
|
|
3878
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_eds_core_react25.Icon, {
|
|
3821
3879
|
data: import_eds_icons9.arrow_up,
|
|
3822
3880
|
size: 24,
|
|
3823
3881
|
style: { transform: "rotateZ(45deg)" }
|
|
@@ -3825,7 +3883,7 @@ function EditableTextAreaCell(props) {
|
|
|
3825
3883
|
})
|
|
3826
3884
|
]
|
|
3827
3885
|
}),
|
|
3828
|
-
/* @__PURE__ */ (0,
|
|
3886
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_eds_core_react25.Dialog, {
|
|
3829
3887
|
open,
|
|
3830
3888
|
onClose: () => {
|
|
3831
3889
|
closeDialog();
|
|
@@ -3834,13 +3892,13 @@ function EditableTextAreaCell(props) {
|
|
|
3834
3892
|
isDismissable: true,
|
|
3835
3893
|
style: { width: "min(50rem, calc(100vw - 4rem))" },
|
|
3836
3894
|
children: [
|
|
3837
|
-
/* @__PURE__ */ (0,
|
|
3838
|
-
children: /* @__PURE__ */ (0,
|
|
3895
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_eds_core_react25.Dialog.Header, {
|
|
3896
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_eds_core_react25.Dialog.Title, {
|
|
3839
3897
|
children: title
|
|
3840
3898
|
})
|
|
3841
3899
|
}),
|
|
3842
|
-
/* @__PURE__ */ (0,
|
|
3843
|
-
children: /* @__PURE__ */ (0,
|
|
3900
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_eds_core_react25.Dialog.Content, {
|
|
3901
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_eds_core_react25.TextField, {
|
|
3844
3902
|
style: {
|
|
3845
3903
|
maxWidth: "100%",
|
|
3846
3904
|
marginTop: "1rem"
|
|
@@ -3855,17 +3913,17 @@ function EditableTextAreaCell(props) {
|
|
|
3855
3913
|
}
|
|
3856
3914
|
})
|
|
3857
3915
|
}),
|
|
3858
|
-
/* @__PURE__ */ (0,
|
|
3916
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_eds_core_react25.Dialog.Actions, {
|
|
3859
3917
|
style: { display: "flex", gap: "1rem" },
|
|
3860
3918
|
children: [
|
|
3861
|
-
/* @__PURE__ */ (0,
|
|
3919
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_eds_core_react25.Button, {
|
|
3862
3920
|
onClick: () => {
|
|
3863
3921
|
closeDialog();
|
|
3864
3922
|
onChange(textareaValue);
|
|
3865
3923
|
},
|
|
3866
3924
|
children: "Submit"
|
|
3867
3925
|
}),
|
|
3868
|
-
/* @__PURE__ */ (0,
|
|
3926
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_eds_core_react25.Button, {
|
|
3869
3927
|
variant: "ghost",
|
|
3870
3928
|
onClick: () => {
|
|
3871
3929
|
closeDialog();
|
|
@@ -3881,7 +3939,7 @@ function EditableTextAreaCell(props) {
|
|
|
3881
3939
|
})
|
|
3882
3940
|
});
|
|
3883
3941
|
}
|
|
3884
|
-
var StyledTextField = (0, import_styled_components19.default)(
|
|
3942
|
+
var StyledTextField = (0, import_styled_components19.default)(import_eds_core_react25.TextField)`
|
|
3885
3943
|
& input {
|
|
3886
3944
|
padding-right: 40px;
|
|
3887
3945
|
letter-spacing: 0;
|
|
@@ -3890,7 +3948,7 @@ var StyledTextField = (0, import_styled_components19.default)(import_eds_core_re
|
|
|
3890
3948
|
text-overflow: ellipsis;
|
|
3891
3949
|
}
|
|
3892
3950
|
`;
|
|
3893
|
-
var IconButton = (0, import_styled_components19.default)(
|
|
3951
|
+
var IconButton = (0, import_styled_components19.default)(import_eds_core_react25.Button)`
|
|
3894
3952
|
position: absolute;
|
|
3895
3953
|
height: 32px;
|
|
3896
3954
|
width: 32px;
|
|
@@ -3898,20 +3956,20 @@ var IconButton = (0, import_styled_components19.default)(import_eds_core_react24
|
|
|
3898
3956
|
`;
|
|
3899
3957
|
|
|
3900
3958
|
// src/form-cells/EditableTextFieldCell.tsx
|
|
3901
|
-
var
|
|
3959
|
+
var import_eds_core_react26 = require("@equinor/eds-core-react");
|
|
3902
3960
|
var import_react_hook_form7 = require("react-hook-form");
|
|
3903
3961
|
var import_styled_components20 = __toESM(require("styled-components"));
|
|
3904
|
-
var
|
|
3962
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
3905
3963
|
function EditableTextFieldCell(context) {
|
|
3906
3964
|
const editMode = useEditMode();
|
|
3907
3965
|
if (!editMode)
|
|
3908
|
-
return /* @__PURE__ */ (0,
|
|
3966
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(TypographyCustom, {
|
|
3909
3967
|
truncate: true,
|
|
3910
3968
|
children: context.getValue()
|
|
3911
3969
|
});
|
|
3912
|
-
return /* @__PURE__ */ (0,
|
|
3970
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react_hook_form7.Controller, {
|
|
3913
3971
|
name: context.column.id,
|
|
3914
|
-
render: ({ field: { value, ...field }, fieldState: { error } }) => /* @__PURE__ */ (0,
|
|
3972
|
+
render: ({ field: { value, ...field }, fieldState: { error } }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(InlineTextField3, {
|
|
3915
3973
|
id: context.column.id,
|
|
3916
3974
|
autoComplete: "none",
|
|
3917
3975
|
value: String(value ?? ""),
|
|
@@ -3920,7 +3978,7 @@ function EditableTextFieldCell(context) {
|
|
|
3920
3978
|
})
|
|
3921
3979
|
});
|
|
3922
3980
|
}
|
|
3923
|
-
var InlineTextField3 = (0, import_styled_components20.default)(
|
|
3981
|
+
var InlineTextField3 = (0, import_styled_components20.default)(import_eds_core_react26.TextField)`
|
|
3924
3982
|
/*
|
|
3925
3983
|
TODO: Improve input based on feedback from UX
|
|
3926
3984
|
& > div {
|
|
@@ -3946,6 +4004,7 @@ var InlineTextField3 = (0, import_styled_components20.default)(import_eds_core_r
|
|
|
3946
4004
|
0 && (module.exports = {
|
|
3947
4005
|
AppShell,
|
|
3948
4006
|
AppSidebar,
|
|
4007
|
+
CheckboxCell,
|
|
3949
4008
|
ChipsCell,
|
|
3950
4009
|
ColumnSelect,
|
|
3951
4010
|
DataTable,
|