@equinor/apollo-components 3.1.7 → 3.1.8-cell.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 +4 -2
- package/dist/index.js +200 -185
- package/dist/index.mjs +148 -134
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2429,6 +2429,19 @@ function AppSidebar() {
|
|
|
2429
2429
|
});
|
|
2430
2430
|
}
|
|
2431
2431
|
|
|
2432
|
+
// src/cells/CheckboxCell.tsx
|
|
2433
|
+
import { Checkbox } from "@equinor/eds-core-react";
|
|
2434
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
2435
|
+
function CheckboxCell(context) {
|
|
2436
|
+
return /* @__PURE__ */ jsx3(Checkbox, {
|
|
2437
|
+
enterKeyHint: "next",
|
|
2438
|
+
"aria-label": "readonly",
|
|
2439
|
+
readOnly: true,
|
|
2440
|
+
checked: context.getValue(),
|
|
2441
|
+
disabled: true
|
|
2442
|
+
});
|
|
2443
|
+
}
|
|
2444
|
+
|
|
2432
2445
|
// src/cells/ChipsCell.tsx
|
|
2433
2446
|
import { tokens as tokens2 } from "@equinor/eds-tokens";
|
|
2434
2447
|
import styled3 from "styled-components";
|
|
@@ -2450,7 +2463,7 @@ function stopPropagation(handler) {
|
|
|
2450
2463
|
}
|
|
2451
2464
|
|
|
2452
2465
|
// src/cells/ChipsCell.tsx
|
|
2453
|
-
import { jsx as
|
|
2466
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
2454
2467
|
var ChipsWrapper = styled3.div`
|
|
2455
2468
|
display: flex;
|
|
2456
2469
|
align-items: center;
|
|
@@ -2469,8 +2482,8 @@ var Chip = styled3.div`
|
|
|
2469
2482
|
`;
|
|
2470
2483
|
var ChipsCell = (props) => {
|
|
2471
2484
|
var _a;
|
|
2472
|
-
return /* @__PURE__ */
|
|
2473
|
-
children: (_a = props.values) == null ? void 0 : _a.map((value) => /* @__PURE__ */
|
|
2485
|
+
return /* @__PURE__ */ jsx4(ChipsWrapper, {
|
|
2486
|
+
children: (_a = props.values) == null ? void 0 : _a.map((value) => /* @__PURE__ */ jsx4(Chip, {
|
|
2474
2487
|
backgroundColor: stringToHslColor(value),
|
|
2475
2488
|
children: value
|
|
2476
2489
|
}, value))
|
|
@@ -2509,7 +2522,7 @@ var StickyHeaderCell = styled4(StickyCell)`
|
|
|
2509
2522
|
`;
|
|
2510
2523
|
|
|
2511
2524
|
// src/cells/DynamicCell.tsx
|
|
2512
|
-
import { jsx as
|
|
2525
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
2513
2526
|
var StyledStickyCell = styled5(StickyCell)`
|
|
2514
2527
|
background-color: ${({ backgroundColor: bg }) => bg ? `${bg} !important` : `inherit`};
|
|
2515
2528
|
`;
|
|
@@ -2520,13 +2533,13 @@ function DynamicCell({ cell, highlight, getStickyCellColor }) {
|
|
|
2520
2533
|
var _a;
|
|
2521
2534
|
const cellContent = flexRender(cell.column.columnDef.cell, cell.getContext());
|
|
2522
2535
|
if ((_a = cell.column.columnDef.meta) == null ? void 0 : _a.sticky) {
|
|
2523
|
-
return /* @__PURE__ */
|
|
2536
|
+
return /* @__PURE__ */ jsx5(StyledStickyCell, {
|
|
2524
2537
|
backgroundColor: getStickyCellColor == null ? void 0 : getStickyCellColor(cell),
|
|
2525
2538
|
"data-column": cell.column.id,
|
|
2526
2539
|
children: cellContent
|
|
2527
2540
|
});
|
|
2528
2541
|
}
|
|
2529
|
-
return /* @__PURE__ */
|
|
2542
|
+
return /* @__PURE__ */ jsx5(StyledCell, {
|
|
2530
2543
|
"data-column": cell.column.id,
|
|
2531
2544
|
backgroundColor: highlight ? "#d5eaf4" : void 0,
|
|
2532
2545
|
children: cellContent
|
|
@@ -2538,7 +2551,7 @@ import { Icon as Icon3, Table as Table3 } from "@equinor/eds-core-react";
|
|
|
2538
2551
|
import { arrow_drop_down, arrow_drop_up } from "@equinor/eds-icons";
|
|
2539
2552
|
import { flexRender as flexRender2 } from "@tanstack/react-table";
|
|
2540
2553
|
import styled6 from "styled-components";
|
|
2541
|
-
import { jsx as
|
|
2554
|
+
import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
2542
2555
|
var HeaderDiv = styled6.div`
|
|
2543
2556
|
display: flex;
|
|
2544
2557
|
align-items: center;
|
|
@@ -2558,16 +2571,16 @@ var HeaderCell = ({ header }) => {
|
|
|
2558
2571
|
colSpan: header.colSpan
|
|
2559
2572
|
};
|
|
2560
2573
|
if ((_a = header.column.columnDef.meta) == null ? void 0 : _a.sticky) {
|
|
2561
|
-
return /* @__PURE__ */
|
|
2574
|
+
return /* @__PURE__ */ jsx6(StickyHeaderCell, {
|
|
2562
2575
|
...cellProps,
|
|
2563
|
-
children: /* @__PURE__ */
|
|
2576
|
+
children: /* @__PURE__ */ jsx6(HeaderContent, {
|
|
2564
2577
|
header
|
|
2565
2578
|
})
|
|
2566
2579
|
}, header.id);
|
|
2567
2580
|
}
|
|
2568
|
-
return /* @__PURE__ */
|
|
2581
|
+
return /* @__PURE__ */ jsx6(Table3.Cell, {
|
|
2569
2582
|
...cellProps,
|
|
2570
|
-
children: /* @__PURE__ */
|
|
2583
|
+
children: /* @__PURE__ */ jsx6(HeaderContent, {
|
|
2571
2584
|
header
|
|
2572
2585
|
})
|
|
2573
2586
|
}, header.id);
|
|
@@ -2579,13 +2592,13 @@ function HeaderContent({ header }) {
|
|
|
2579
2592
|
children: [
|
|
2580
2593
|
flexRender2(header.column.columnDef.header, header.getContext()),
|
|
2581
2594
|
{
|
|
2582
|
-
asc: /* @__PURE__ */
|
|
2595
|
+
asc: /* @__PURE__ */ jsx6(Icon3, {
|
|
2583
2596
|
data: arrow_drop_up
|
|
2584
2597
|
}),
|
|
2585
|
-
desc: /* @__PURE__ */
|
|
2598
|
+
desc: /* @__PURE__ */ jsx6(Icon3, {
|
|
2586
2599
|
data: arrow_drop_down
|
|
2587
2600
|
}),
|
|
2588
|
-
none: /* @__PURE__ */
|
|
2601
|
+
none: /* @__PURE__ */ jsx6(Icon3, {
|
|
2589
2602
|
data: arrow_drop_down
|
|
2590
2603
|
})
|
|
2591
2604
|
}[header.column.getIsSorted()] ?? null
|
|
@@ -2615,7 +2628,7 @@ import {
|
|
|
2615
2628
|
} from "@equinor/eds-core-react";
|
|
2616
2629
|
import { tokens as tokens3 } from "@equinor/eds-tokens";
|
|
2617
2630
|
import styled7 from "styled-components";
|
|
2618
|
-
import { jsx as
|
|
2631
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
2619
2632
|
var truncateStyle = {
|
|
2620
2633
|
overflow: "hidden",
|
|
2621
2634
|
whiteSpace: "nowrap",
|
|
@@ -2624,8 +2637,8 @@ var truncateStyle = {
|
|
|
2624
2637
|
var TypographyCustom = (props) => {
|
|
2625
2638
|
const { truncate, enableShowAllOnHover, style: styleFromProps, ...edsTypographyProps } = props;
|
|
2626
2639
|
if (enableShowAllOnHover)
|
|
2627
|
-
return /* @__PURE__ */
|
|
2628
|
-
children: /* @__PURE__ */
|
|
2640
|
+
return /* @__PURE__ */ jsx7(HoverCapture, {
|
|
2641
|
+
children: /* @__PURE__ */ jsx7(EdsTypography, {
|
|
2629
2642
|
...edsTypographyProps,
|
|
2630
2643
|
style: {
|
|
2631
2644
|
...styleFromProps,
|
|
@@ -2634,14 +2647,14 @@ var TypographyCustom = (props) => {
|
|
|
2634
2647
|
})
|
|
2635
2648
|
});
|
|
2636
2649
|
if (truncate)
|
|
2637
|
-
return /* @__PURE__ */
|
|
2650
|
+
return /* @__PURE__ */ jsx7(EdsTypography, {
|
|
2638
2651
|
...edsTypographyProps,
|
|
2639
2652
|
style: {
|
|
2640
2653
|
...styleFromProps,
|
|
2641
2654
|
...truncateStyle
|
|
2642
2655
|
}
|
|
2643
2656
|
});
|
|
2644
|
-
return /* @__PURE__ */
|
|
2657
|
+
return /* @__PURE__ */ jsx7(EdsTypography, {
|
|
2645
2658
|
...edsTypographyProps,
|
|
2646
2659
|
style: styleFromProps
|
|
2647
2660
|
});
|
|
@@ -2673,7 +2686,7 @@ var HoverCapture = styled7.div`
|
|
|
2673
2686
|
`;
|
|
2674
2687
|
|
|
2675
2688
|
// src/cells/HierarchyCell.tsx
|
|
2676
|
-
import { jsx as
|
|
2689
|
+
import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
2677
2690
|
var CellWrapper = styled8(TypographyCustom)`
|
|
2678
2691
|
height: 100%;
|
|
2679
2692
|
display: flex;
|
|
@@ -2698,7 +2711,7 @@ function HierarchyCell(cell, options = {}) {
|
|
|
2698
2711
|
depth: ((_a = options.getRowDepth) == null ? void 0 : _a.call(options)) ?? cell.row.depth,
|
|
2699
2712
|
expanded: cell.row.getIsExpanded(),
|
|
2700
2713
|
children: [
|
|
2701
|
-
/* @__PURE__ */
|
|
2714
|
+
/* @__PURE__ */ jsx8("span", {
|
|
2702
2715
|
className: "--divider"
|
|
2703
2716
|
}),
|
|
2704
2717
|
((_b = options.getDisplayName) == null ? void 0 : _b.call(options)) ?? cell.getValue()
|
|
@@ -2709,7 +2722,7 @@ function HierarchyCell(cell, options = {}) {
|
|
|
2709
2722
|
// src/cells/PopoverCell.tsx
|
|
2710
2723
|
import { Popover, Typography } from "@equinor/eds-core-react";
|
|
2711
2724
|
import { useRef, useState as useState2 } from "react";
|
|
2712
|
-
import { jsx as
|
|
2725
|
+
import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
2713
2726
|
function PopoverCell(props) {
|
|
2714
2727
|
const [open, setOpen] = useState2(false);
|
|
2715
2728
|
const anchorRef = useRef(null);
|
|
@@ -2719,7 +2732,7 @@ function PopoverCell(props) {
|
|
|
2719
2732
|
style: { position: "relative" },
|
|
2720
2733
|
ref: anchorRef,
|
|
2721
2734
|
children: [
|
|
2722
|
-
/* @__PURE__ */
|
|
2735
|
+
/* @__PURE__ */ jsx9(TypographyCustom, {
|
|
2723
2736
|
onClick: stopPropagation(handleClick),
|
|
2724
2737
|
style: { cursor: "pointer" },
|
|
2725
2738
|
truncate: true,
|
|
@@ -2733,13 +2746,13 @@ function PopoverCell(props) {
|
|
|
2733
2746
|
onClose: handleClose,
|
|
2734
2747
|
placement: "bottom",
|
|
2735
2748
|
children: [
|
|
2736
|
-
props.title && /* @__PURE__ */
|
|
2737
|
-
children: /* @__PURE__ */
|
|
2749
|
+
props.title && /* @__PURE__ */ jsx9(Popover.Title, {
|
|
2750
|
+
children: /* @__PURE__ */ jsx9(Popover.Header, {
|
|
2738
2751
|
children: props.title
|
|
2739
2752
|
})
|
|
2740
2753
|
}),
|
|
2741
|
-
/* @__PURE__ */
|
|
2742
|
-
children: /* @__PURE__ */
|
|
2754
|
+
/* @__PURE__ */ jsx9(Popover.Content, {
|
|
2755
|
+
children: /* @__PURE__ */ jsx9(Typography, {
|
|
2743
2756
|
children: String(props.value)
|
|
2744
2757
|
})
|
|
2745
2758
|
})
|
|
@@ -2750,10 +2763,10 @@ function PopoverCell(props) {
|
|
|
2750
2763
|
}
|
|
2751
2764
|
|
|
2752
2765
|
// src/cells/SelectColumnDef.tsx
|
|
2753
|
-
import { Button as Button2, Checkbox, Icon as Icon4, Radio } from "@equinor/eds-core-react";
|
|
2766
|
+
import { Button as Button2, Checkbox as Checkbox2, Icon as Icon4, Radio } from "@equinor/eds-core-react";
|
|
2754
2767
|
import { chevron_down, chevron_up } from "@equinor/eds-icons";
|
|
2755
2768
|
import styled9 from "styled-components";
|
|
2756
|
-
import { Fragment, jsx as
|
|
2769
|
+
import { Fragment, jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2757
2770
|
var CellWrapper2 = styled9.div`
|
|
2758
2771
|
display: flex;
|
|
2759
2772
|
align-items: center;
|
|
@@ -2766,8 +2779,8 @@ function SelectColumnDef(props) {
|
|
|
2766
2779
|
return {
|
|
2767
2780
|
id: "select",
|
|
2768
2781
|
size: props.includeExpansionButton ? 96 : 48,
|
|
2769
|
-
header: ({ table }) => selectionMode !== "single" ? /* @__PURE__ */
|
|
2770
|
-
children: /* @__PURE__ */
|
|
2782
|
+
header: ({ table }) => selectionMode !== "single" ? /* @__PURE__ */ jsx10(CellWrapper2, {
|
|
2783
|
+
children: /* @__PURE__ */ jsx10(Checkbox2, {
|
|
2771
2784
|
checked: table.getIsAllRowsSelected(),
|
|
2772
2785
|
indeterminate: table.getIsSomeRowsSelected(),
|
|
2773
2786
|
"aria-label": table.getIsAllRowsSelected() ? "Deselect all rows" : "Select all rows",
|
|
@@ -2776,28 +2789,28 @@ function SelectColumnDef(props) {
|
|
|
2776
2789
|
}) : null,
|
|
2777
2790
|
cell: ({ table, row }) => {
|
|
2778
2791
|
const paddingLeft = "0px";
|
|
2779
|
-
return /* @__PURE__ */
|
|
2792
|
+
return /* @__PURE__ */ jsx10(CellWrapper2, {
|
|
2780
2793
|
paddingLeft,
|
|
2781
2794
|
rowDepth: row.depth,
|
|
2782
2795
|
children: /* @__PURE__ */ jsxs6(Fragment, {
|
|
2783
2796
|
children: [
|
|
2784
|
-
selectionMode === "single" ? /* @__PURE__ */
|
|
2797
|
+
selectionMode === "single" ? /* @__PURE__ */ jsx10(Radio, {
|
|
2785
2798
|
checked: row.getIsSelected(),
|
|
2786
2799
|
"aria-label": `Select row ${row.id}`,
|
|
2787
2800
|
onChange: stopPropagation(row.getToggleSelectedHandler())
|
|
2788
|
-
}) : /* @__PURE__ */
|
|
2801
|
+
}) : /* @__PURE__ */ jsx10(Checkbox2, {
|
|
2789
2802
|
checked: row.getIsSelected(),
|
|
2790
2803
|
indeterminate: row.getIsSomeSelected(),
|
|
2791
2804
|
"aria-label": `Select row ${row.id}`,
|
|
2792
2805
|
onChange: stopPropagation(row.getToggleSelectedHandler())
|
|
2793
2806
|
}),
|
|
2794
|
-
row.getCanExpand() && table.options.enableExpanding && /* @__PURE__ */
|
|
2807
|
+
row.getCanExpand() && table.options.enableExpanding && /* @__PURE__ */ jsx10(Button2, {
|
|
2795
2808
|
variant: "ghost_icon",
|
|
2796
2809
|
color: "secondary",
|
|
2797
2810
|
"aria-label": row.getIsExpanded() ? "Close group" : "Expand group",
|
|
2798
2811
|
onClick: stopPropagation(row.getToggleExpandedHandler()),
|
|
2799
2812
|
style: { cursor: "pointer" },
|
|
2800
|
-
children: /* @__PURE__ */
|
|
2813
|
+
children: /* @__PURE__ */ jsx10(Icon4, {
|
|
2801
2814
|
data: row.getIsExpanded() ? chevron_up : chevron_down
|
|
2802
2815
|
})
|
|
2803
2816
|
})
|
|
@@ -2809,7 +2822,7 @@ function SelectColumnDef(props) {
|
|
|
2809
2822
|
}
|
|
2810
2823
|
|
|
2811
2824
|
// src/DataTable/components/ColumnSelect.tsx
|
|
2812
|
-
import { Button as Button3, Checkbox as
|
|
2825
|
+
import { Button as Button3, Checkbox as Checkbox3, Divider, Icon as Icon5, Popover as Popover2, Tooltip } from "@equinor/eds-core-react";
|
|
2813
2826
|
import { close, view_column } from "@equinor/eds-icons";
|
|
2814
2827
|
import { useRef as useRef2, useState as useState3 } from "react";
|
|
2815
2828
|
import styled10 from "styled-components";
|
|
@@ -2844,7 +2857,7 @@ function getFunctionValueOrDefault(valueOrFn, fnProps, defaultValue) {
|
|
|
2844
2857
|
}
|
|
2845
2858
|
|
|
2846
2859
|
// src/DataTable/components/ColumnSelect.tsx
|
|
2847
|
-
import { Fragment as Fragment2, jsx as
|
|
2860
|
+
import { Fragment as Fragment2, jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2848
2861
|
var ColumnSelectContent = styled10.div`
|
|
2849
2862
|
display: grid;
|
|
2850
2863
|
grid-template-columns: repeat(2, 1fr);
|
|
@@ -2862,10 +2875,10 @@ function ColumnSelect({ table }) {
|
|
|
2862
2875
|
const selectableColumns = table.getAllLeafColumns().filter((column) => column.id !== "select");
|
|
2863
2876
|
return /* @__PURE__ */ jsxs7(Fragment2, {
|
|
2864
2877
|
children: [
|
|
2865
|
-
/* @__PURE__ */
|
|
2878
|
+
/* @__PURE__ */ jsx11(Tooltip, {
|
|
2866
2879
|
title: "Select columns",
|
|
2867
2880
|
placement: "left",
|
|
2868
|
-
children: /* @__PURE__ */
|
|
2881
|
+
children: /* @__PURE__ */ jsx11(Button3, {
|
|
2869
2882
|
"aria-haspopup": true,
|
|
2870
2883
|
id: "column-select-anchor",
|
|
2871
2884
|
"aria-controls": "column-select-popover",
|
|
@@ -2873,7 +2886,7 @@ function ColumnSelect({ table }) {
|
|
|
2873
2886
|
ref: referenceElement,
|
|
2874
2887
|
variant: "ghost_icon",
|
|
2875
2888
|
onClick: () => setIsOpen(true),
|
|
2876
|
-
children: /* @__PURE__ */
|
|
2889
|
+
children: /* @__PURE__ */ jsx11(Icon5, {
|
|
2877
2890
|
name: "view_column",
|
|
2878
2891
|
data: view_column
|
|
2879
2892
|
})
|
|
@@ -2888,14 +2901,14 @@ function ColumnSelect({ table }) {
|
|
|
2888
2901
|
children: [
|
|
2889
2902
|
/* @__PURE__ */ jsxs7(Popover2.Header, {
|
|
2890
2903
|
children: [
|
|
2891
|
-
/* @__PURE__ */
|
|
2904
|
+
/* @__PURE__ */ jsx11(Popover2.Title, {
|
|
2892
2905
|
children: "Column settings"
|
|
2893
2906
|
}),
|
|
2894
|
-
/* @__PURE__ */
|
|
2907
|
+
/* @__PURE__ */ jsx11(Button3, {
|
|
2895
2908
|
variant: "ghost_icon",
|
|
2896
2909
|
"aria-label": "Close column select",
|
|
2897
2910
|
onClick: () => setIsOpen(false),
|
|
2898
|
-
children: /* @__PURE__ */
|
|
2911
|
+
children: /* @__PURE__ */ jsx11(Icon5, {
|
|
2899
2912
|
name: "close",
|
|
2900
2913
|
data: close,
|
|
2901
2914
|
size: 24
|
|
@@ -2905,20 +2918,20 @@ function ColumnSelect({ table }) {
|
|
|
2905
2918
|
}),
|
|
2906
2919
|
/* @__PURE__ */ jsxs7(Popover2.Content, {
|
|
2907
2920
|
children: [
|
|
2908
|
-
/* @__PURE__ */
|
|
2921
|
+
/* @__PURE__ */ jsx11(ColumnSelectContent, {
|
|
2909
2922
|
children: selectableColumns.map((column) => {
|
|
2910
|
-
return /* @__PURE__ */
|
|
2923
|
+
return /* @__PURE__ */ jsx11(Checkbox3, {
|
|
2911
2924
|
checked: column.getIsVisible(),
|
|
2912
2925
|
label: getColumnHeader(column),
|
|
2913
2926
|
onChange: column.getToggleVisibilityHandler()
|
|
2914
2927
|
}, column.id);
|
|
2915
2928
|
})
|
|
2916
2929
|
}),
|
|
2917
|
-
/* @__PURE__ */
|
|
2930
|
+
/* @__PURE__ */ jsx11(Divider, {
|
|
2918
2931
|
variant: "small"
|
|
2919
2932
|
}),
|
|
2920
|
-
/* @__PURE__ */
|
|
2921
|
-
children: /* @__PURE__ */
|
|
2933
|
+
/* @__PURE__ */ jsx11(ActionsWrapper, {
|
|
2934
|
+
children: /* @__PURE__ */ jsx11(Button3, {
|
|
2922
2935
|
color: "secondary",
|
|
2923
2936
|
variant: "ghost",
|
|
2924
2937
|
disabled: table.getIsAllColumnsVisible(),
|
|
@@ -2936,12 +2949,12 @@ function ColumnSelect({ table }) {
|
|
|
2936
2949
|
|
|
2937
2950
|
// src/DataTable/components/TableHeader.tsx
|
|
2938
2951
|
import { Table as Table4 } from "@equinor/eds-core-react";
|
|
2939
|
-
import { jsx as
|
|
2952
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
2940
2953
|
function TableHeader({ table, sticky }) {
|
|
2941
|
-
return /* @__PURE__ */
|
|
2954
|
+
return /* @__PURE__ */ jsx12(Table4.Head, {
|
|
2942
2955
|
sticky,
|
|
2943
|
-
children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */
|
|
2944
|
-
children: headerGroup.headers.map((header) => /* @__PURE__ */
|
|
2956
|
+
children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx12(Table4.Row, {
|
|
2957
|
+
children: headerGroup.headers.map((header) => /* @__PURE__ */ jsx12(HeaderCell, {
|
|
2945
2958
|
header
|
|
2946
2959
|
}, header.id))
|
|
2947
2960
|
}, headerGroup.id))
|
|
@@ -2965,19 +2978,19 @@ import { Table as EdsTable } from "@equinor/eds-core-react";
|
|
|
2965
2978
|
// src/DataTable/components/PlaceholderRow.tsx
|
|
2966
2979
|
import { DotProgress, Table as Table5, Typography as Typography2 } from "@equinor/eds-core-react";
|
|
2967
2980
|
import styled11 from "styled-components";
|
|
2968
|
-
import { jsx as
|
|
2981
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
2969
2982
|
var PlaceholderTextWrapper = styled11.div`
|
|
2970
2983
|
display: flex;
|
|
2971
2984
|
justify-content: center;
|
|
2972
2985
|
`;
|
|
2973
2986
|
function PlaceholderRow({ isLoading }) {
|
|
2974
|
-
return /* @__PURE__ */
|
|
2975
|
-
children: /* @__PURE__ */
|
|
2987
|
+
return /* @__PURE__ */ jsx13(Table5.Row, {
|
|
2988
|
+
children: /* @__PURE__ */ jsx13(Table5.Cell, {
|
|
2976
2989
|
colSpan: 100,
|
|
2977
|
-
children: /* @__PURE__ */
|
|
2978
|
-
children: isLoading ? /* @__PURE__ */
|
|
2990
|
+
children: /* @__PURE__ */ jsx13(PlaceholderTextWrapper, {
|
|
2991
|
+
children: isLoading ? /* @__PURE__ */ jsx13(DotProgress, {
|
|
2979
2992
|
color: "primary"
|
|
2980
|
-
}) : /* @__PURE__ */
|
|
2993
|
+
}) : /* @__PURE__ */ jsx13(Typography2, {
|
|
2981
2994
|
children: "No data available"
|
|
2982
2995
|
})
|
|
2983
2996
|
})
|
|
@@ -2997,7 +3010,7 @@ var TableBody = styled12(Table6.Body)`
|
|
|
2997
3010
|
// src/DataTable/components/TableRow.tsx
|
|
2998
3011
|
import { Table as Table7 } from "@equinor/eds-core-react";
|
|
2999
3012
|
import styled13 from "styled-components";
|
|
3000
|
-
import { jsx as
|
|
3013
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
3001
3014
|
function TableRow({
|
|
3002
3015
|
row,
|
|
3003
3016
|
rowConfig,
|
|
@@ -3007,7 +3020,7 @@ function TableRow({
|
|
|
3007
3020
|
}) {
|
|
3008
3021
|
var _a;
|
|
3009
3022
|
const rowWrapper = rowConfig == null ? void 0 : rowConfig.rowWrapper;
|
|
3010
|
-
const tableRowContent = /* @__PURE__ */
|
|
3023
|
+
const tableRowContent = /* @__PURE__ */ jsx14(StyledTableRow, {
|
|
3011
3024
|
active: row.getIsSelected(),
|
|
3012
3025
|
"data-index": index,
|
|
3013
3026
|
ref: measureElement,
|
|
@@ -3023,7 +3036,7 @@ function TableRow({
|
|
|
3023
3036
|
onMouseLeave: handleRowEvent(row, rowConfig == null ? void 0 : rowConfig.onMouseLeave),
|
|
3024
3037
|
children: row.getVisibleCells().map((cell) => {
|
|
3025
3038
|
var _a2;
|
|
3026
|
-
return /* @__PURE__ */
|
|
3039
|
+
return /* @__PURE__ */ jsx14(DynamicCell, {
|
|
3027
3040
|
cell,
|
|
3028
3041
|
getStickyCellColor: cellConfig == null ? void 0 : cellConfig.getStickyCellColor,
|
|
3029
3042
|
highlight: (_a2 = cellConfig == null ? void 0 : cellConfig.getShouldHighlight) == null ? void 0 : _a2.call(cellConfig, cell)
|
|
@@ -3045,7 +3058,7 @@ function handleRowEvent(row, handler) {
|
|
|
3045
3058
|
}
|
|
3046
3059
|
|
|
3047
3060
|
// src/DataTable/components/BasicTable.tsx
|
|
3048
|
-
import { jsx as
|
|
3061
|
+
import { jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
3049
3062
|
function BasicTable({
|
|
3050
3063
|
table,
|
|
3051
3064
|
rowConfig,
|
|
@@ -3057,20 +3070,20 @@ function BasicTable({
|
|
|
3057
3070
|
const tableRows = table.getRowModel().rows;
|
|
3058
3071
|
return /* @__PURE__ */ jsxs8(EdsTable, {
|
|
3059
3072
|
children: [
|
|
3060
|
-
/* @__PURE__ */
|
|
3073
|
+
/* @__PURE__ */ jsx15(EdsTable.Caption, {
|
|
3061
3074
|
hidden: true,
|
|
3062
3075
|
children: tableCaption
|
|
3063
3076
|
}),
|
|
3064
|
-
/* @__PURE__ */
|
|
3077
|
+
/* @__PURE__ */ jsx15(TableHeader, {
|
|
3065
3078
|
sticky: stickyHeader,
|
|
3066
3079
|
table
|
|
3067
3080
|
}),
|
|
3068
|
-
/* @__PURE__ */
|
|
3069
|
-
children: tableRows.length ? tableRows.map((row) => /* @__PURE__ */
|
|
3081
|
+
/* @__PURE__ */ jsx15(TableBody, {
|
|
3082
|
+
children: tableRows.length ? tableRows.map((row) => /* @__PURE__ */ jsx15(TableRow, {
|
|
3070
3083
|
row,
|
|
3071
3084
|
rowConfig,
|
|
3072
3085
|
cellConfig
|
|
3073
|
-
}, row.id)) : /* @__PURE__ */
|
|
3086
|
+
}, row.id)) : /* @__PURE__ */ jsx15(PlaceholderRow, {
|
|
3074
3087
|
isLoading
|
|
3075
3088
|
})
|
|
3076
3089
|
})
|
|
@@ -3088,7 +3101,7 @@ import { Button as Button4, Icon as Icon6, Input, Tooltip as Tooltip2 } from "@e
|
|
|
3088
3101
|
import { close as close2 } from "@equinor/eds-icons";
|
|
3089
3102
|
import { useEffect, useState as useState4 } from "react";
|
|
3090
3103
|
import styled14 from "styled-components";
|
|
3091
|
-
import { jsx as
|
|
3104
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
3092
3105
|
var Wrapper3 = styled14.div`
|
|
3093
3106
|
width: 200px;
|
|
3094
3107
|
`;
|
|
@@ -3113,21 +3126,21 @@ function DebouncedInput({
|
|
|
3113
3126
|
}, debounce);
|
|
3114
3127
|
return () => clearTimeout(timeout);
|
|
3115
3128
|
}, [value]);
|
|
3116
|
-
return /* @__PURE__ */
|
|
3117
|
-
children: /* @__PURE__ */
|
|
3129
|
+
return /* @__PURE__ */ jsx16(Wrapper3, {
|
|
3130
|
+
children: /* @__PURE__ */ jsx16(Input, {
|
|
3118
3131
|
...props,
|
|
3119
3132
|
value,
|
|
3120
|
-
leftAdornments: icon && /* @__PURE__ */
|
|
3133
|
+
leftAdornments: icon && /* @__PURE__ */ jsx16(Icon6, {
|
|
3121
3134
|
name: icon.name,
|
|
3122
3135
|
data: icon,
|
|
3123
3136
|
size: 18
|
|
3124
3137
|
}),
|
|
3125
|
-
rightAdornments: !!value && /* @__PURE__ */
|
|
3138
|
+
rightAdornments: !!value && /* @__PURE__ */ jsx16(Tooltip2, {
|
|
3126
3139
|
title: "Clear input",
|
|
3127
|
-
children: /* @__PURE__ */
|
|
3140
|
+
children: /* @__PURE__ */ jsx16(CloseButton, {
|
|
3128
3141
|
variant: "ghost_icon",
|
|
3129
3142
|
onClick: () => setValue(""),
|
|
3130
|
-
children: /* @__PURE__ */
|
|
3143
|
+
children: /* @__PURE__ */ jsx16(Icon6, {
|
|
3131
3144
|
name: close2.name,
|
|
3132
3145
|
data: close2,
|
|
3133
3146
|
size: 18
|
|
@@ -3150,7 +3163,7 @@ var fuzzyFilter = (row, columnId, value, addMeta) => {
|
|
|
3150
3163
|
};
|
|
3151
3164
|
|
|
3152
3165
|
// src/DataTable/components/DataTableHeader.tsx
|
|
3153
|
-
import { Fragment as Fragment3, jsx as
|
|
3166
|
+
import { Fragment as Fragment3, jsx as jsx17, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
3154
3167
|
var TableBannerWrapper = styled15.div`
|
|
3155
3168
|
display: flex;
|
|
3156
3169
|
align-items: center;
|
|
@@ -3178,7 +3191,7 @@ function TableBanner({
|
|
|
3178
3191
|
/* @__PURE__ */ jsxs9(FilterContainer, {
|
|
3179
3192
|
className: "--filter-container-left",
|
|
3180
3193
|
children: [
|
|
3181
|
-
(bannerConfig == null ? void 0 : bannerConfig.enableTableCaption) && /* @__PURE__ */
|
|
3194
|
+
(bannerConfig == null ? void 0 : bannerConfig.enableTableCaption) && /* @__PURE__ */ jsx17(Typography3, {
|
|
3182
3195
|
variant: "h3",
|
|
3183
3196
|
as: "h2",
|
|
3184
3197
|
children: tableCaption
|
|
@@ -3186,17 +3199,17 @@ function TableBanner({
|
|
|
3186
3199
|
(_a = bannerConfig == null ? void 0 : bannerConfig.customActions) == null ? void 0 : _a.call(bannerConfig, table)
|
|
3187
3200
|
]
|
|
3188
3201
|
}),
|
|
3189
|
-
/* @__PURE__ */
|
|
3202
|
+
/* @__PURE__ */ jsx17(FilterContainer, {
|
|
3190
3203
|
className: "--filter-container-right",
|
|
3191
3204
|
children: /* @__PURE__ */ jsxs9(Fragment3, {
|
|
3192
3205
|
children: [
|
|
3193
|
-
(bannerConfig == null ? void 0 : bannerConfig.enableGlobalFilterInput) && /* @__PURE__ */
|
|
3206
|
+
(bannerConfig == null ? void 0 : bannerConfig.enableGlobalFilterInput) && /* @__PURE__ */ jsx17(DebouncedInput, {
|
|
3194
3207
|
value: globalFilter.state,
|
|
3195
3208
|
icon: search,
|
|
3196
3209
|
placeholder: bannerConfig.globalFilterPlaceholder ?? "Search all columns",
|
|
3197
3210
|
onChange: (value) => globalFilter.onChange(String(value))
|
|
3198
3211
|
}),
|
|
3199
|
-
(bannerConfig == null ? void 0 : bannerConfig.enableColumnSelect) && /* @__PURE__ */
|
|
3212
|
+
(bannerConfig == null ? void 0 : bannerConfig.enableColumnSelect) && /* @__PURE__ */ jsx17(ColumnSelect, {
|
|
3200
3213
|
table
|
|
3201
3214
|
}),
|
|
3202
3215
|
(bannerConfig == null ? void 0 : bannerConfig.totalRowCount) && /* @__PURE__ */ jsxs9("span", {
|
|
@@ -3221,20 +3234,20 @@ import { useVirtualizer } from "@tanstack/react-virtual";
|
|
|
3221
3234
|
|
|
3222
3235
|
// src/DataTable/components/PaddingRow.tsx
|
|
3223
3236
|
import { Table as Table8 } from "@equinor/eds-core-react";
|
|
3224
|
-
import { jsx as
|
|
3237
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
3225
3238
|
var PaddingRow = (props) => {
|
|
3226
3239
|
if (!props.height)
|
|
3227
3240
|
return null;
|
|
3228
|
-
return /* @__PURE__ */
|
|
3241
|
+
return /* @__PURE__ */ jsx18(Table8.Row, {
|
|
3229
3242
|
style: { pointerEvents: "none" },
|
|
3230
|
-
children: /* @__PURE__ */
|
|
3243
|
+
children: /* @__PURE__ */ jsx18(Table8.Cell, {
|
|
3231
3244
|
style: { height: `${props.height}px` }
|
|
3232
3245
|
})
|
|
3233
3246
|
});
|
|
3234
3247
|
};
|
|
3235
3248
|
|
|
3236
3249
|
// src/DataTable/components/VirtualTable.tsx
|
|
3237
|
-
import { jsx as
|
|
3250
|
+
import { jsx as jsx19, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3238
3251
|
function VirtualTable({
|
|
3239
3252
|
table,
|
|
3240
3253
|
rowConfig,
|
|
@@ -3256,32 +3269,32 @@ function VirtualTable({
|
|
|
3256
3269
|
const paddingBottom = virtualRows.length > 0 ? rowVirtualizer.getTotalSize() - (((_b = virtualRows == null ? void 0 : virtualRows[virtualRows.length - 1]) == null ? void 0 : _b.end) || 0) : 0;
|
|
3257
3270
|
return /* @__PURE__ */ jsxs10(Table9, {
|
|
3258
3271
|
children: [
|
|
3259
|
-
/* @__PURE__ */
|
|
3272
|
+
/* @__PURE__ */ jsx19(Table9.Caption, {
|
|
3260
3273
|
hidden: true,
|
|
3261
3274
|
children: props.tableCaption
|
|
3262
3275
|
}),
|
|
3263
|
-
/* @__PURE__ */
|
|
3276
|
+
/* @__PURE__ */ jsx19(TableHeader, {
|
|
3264
3277
|
sticky: props.stickyHeader,
|
|
3265
3278
|
table
|
|
3266
3279
|
}),
|
|
3267
3280
|
/* @__PURE__ */ jsxs10(TableBody, {
|
|
3268
3281
|
children: [
|
|
3269
|
-
/* @__PURE__ */
|
|
3282
|
+
/* @__PURE__ */ jsx19(PaddingRow, {
|
|
3270
3283
|
height: paddingTop
|
|
3271
3284
|
}),
|
|
3272
3285
|
rows.length ? virtualRows.map((virtualRow) => {
|
|
3273
3286
|
const row = rows[virtualRow.index];
|
|
3274
|
-
return /* @__PURE__ */
|
|
3287
|
+
return /* @__PURE__ */ jsx19(TableRow, {
|
|
3275
3288
|
row,
|
|
3276
3289
|
rowConfig,
|
|
3277
3290
|
cellConfig,
|
|
3278
3291
|
index: virtualRow.index,
|
|
3279
3292
|
measureElement: rowVirtualizer.measureElement
|
|
3280
3293
|
}, row.id);
|
|
3281
|
-
}) : /* @__PURE__ */
|
|
3294
|
+
}) : /* @__PURE__ */ jsx19(PlaceholderRow, {
|
|
3282
3295
|
isLoading: props.isLoading
|
|
3283
3296
|
}),
|
|
3284
|
-
/* @__PURE__ */
|
|
3297
|
+
/* @__PURE__ */ jsx19(PaddingRow, {
|
|
3285
3298
|
height: paddingBottom
|
|
3286
3299
|
})
|
|
3287
3300
|
]
|
|
@@ -3327,11 +3340,11 @@ function useForceRerender() {
|
|
|
3327
3340
|
}
|
|
3328
3341
|
|
|
3329
3342
|
// src/DataTable/DataTable.tsx
|
|
3330
|
-
import { jsx as
|
|
3343
|
+
import { jsx as jsx20, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
3331
3344
|
function canUseContainStrict(height) {
|
|
3332
3345
|
if (!height)
|
|
3333
3346
|
return false;
|
|
3334
|
-
const heightIsANumber = !isNaN(parseFloat(height));
|
|
3347
|
+
const heightIsANumber = !isNaN(Number(height)) && !isNaN(parseFloat(height));
|
|
3335
3348
|
if (heightIsANumber)
|
|
3336
3349
|
return false;
|
|
3337
3350
|
const heightIsPercentage = height.endsWith("%");
|
|
@@ -3403,7 +3416,7 @@ function DataTable(props) {
|
|
|
3403
3416
|
defaultColumn: {
|
|
3404
3417
|
cell: ({ cell }) => {
|
|
3405
3418
|
const truncateMode = getFunctionValueOrDefault(cellConfig == null ? void 0 : cellConfig.truncateMode, cell, "hover");
|
|
3406
|
-
return /* @__PURE__ */
|
|
3419
|
+
return /* @__PURE__ */ jsx20(TypographyCustom, {
|
|
3407
3420
|
truncate: truncateMode === "hover",
|
|
3408
3421
|
enableShowAllOnHover: true,
|
|
3409
3422
|
children: cell.getValue()
|
|
@@ -3450,13 +3463,13 @@ function DataTable(props) {
|
|
|
3450
3463
|
width: props == null ? void 0 : props.width,
|
|
3451
3464
|
tableLayout: props == null ? void 0 : props.tableLayout,
|
|
3452
3465
|
children: [
|
|
3453
|
-
props.bannerConfig && /* @__PURE__ */
|
|
3466
|
+
props.bannerConfig && /* @__PURE__ */ jsx20(TableBanner, {
|
|
3454
3467
|
table,
|
|
3455
3468
|
bannerConfig: props.bannerConfig,
|
|
3456
3469
|
globalFilter: { state: globalFilterState, onChange: setGlobalFilterState },
|
|
3457
3470
|
tableCaption: props.tableCaption
|
|
3458
3471
|
}),
|
|
3459
|
-
/* @__PURE__ */
|
|
3472
|
+
/* @__PURE__ */ jsx20("div", {
|
|
3460
3473
|
...props.tableContainerProps,
|
|
3461
3474
|
className: "--table-container " + (((_q = props.tableContainerProps) == null ? void 0 : _q.className) ?? ""),
|
|
3462
3475
|
onScroll: ((_r = props.tableContainerProps) == null ? void 0 : _r.onScroll) ?? onTableContainerScroll,
|
|
@@ -3469,7 +3482,7 @@ function DataTable(props) {
|
|
|
3469
3482
|
}
|
|
3470
3483
|
}
|
|
3471
3484
|
},
|
|
3472
|
-
children: (props == null ? void 0 : props.virtual) ? /* @__PURE__ */
|
|
3485
|
+
children: (props == null ? void 0 : props.virtual) ? /* @__PURE__ */ jsx20(VirtualTable, {
|
|
3473
3486
|
containerRef: tableContainerRef,
|
|
3474
3487
|
tableCaption: props.tableCaption,
|
|
3475
3488
|
table,
|
|
@@ -3477,7 +3490,7 @@ function DataTable(props) {
|
|
|
3477
3490
|
cellConfig,
|
|
3478
3491
|
isLoading,
|
|
3479
3492
|
stickyHeader: props.stickyHeader
|
|
3480
|
-
}) : /* @__PURE__ */
|
|
3493
|
+
}) : /* @__PURE__ */ jsx20(BasicTable, {
|
|
3481
3494
|
tableCaption: props.tableCaption,
|
|
3482
3495
|
table,
|
|
3483
3496
|
rowConfig,
|
|
@@ -3491,7 +3504,7 @@ function DataTable(props) {
|
|
|
3491
3504
|
}
|
|
3492
3505
|
|
|
3493
3506
|
// src/form-cells/EditableCheckboxCell.tsx
|
|
3494
|
-
import { Checkbox as
|
|
3507
|
+
import { Checkbox as Checkbox4 } from "@equinor/eds-core-react";
|
|
3495
3508
|
import { Controller } from "react-hook-form";
|
|
3496
3509
|
|
|
3497
3510
|
// src/form-meta/utils.tsx
|
|
@@ -3529,20 +3542,20 @@ function addFormMeta(withoutFormMeta) {
|
|
|
3529
3542
|
}
|
|
3530
3543
|
|
|
3531
3544
|
// src/form-cells/EditableCheckboxCell.tsx
|
|
3532
|
-
import { jsx as
|
|
3545
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
3533
3546
|
function EditableCheckboxCell(context) {
|
|
3534
3547
|
const editMode = useEditMode();
|
|
3535
3548
|
if (!editMode)
|
|
3536
|
-
return /* @__PURE__ */
|
|
3549
|
+
return /* @__PURE__ */ jsx21(Checkbox4, {
|
|
3537
3550
|
enterKeyHint: "next",
|
|
3538
3551
|
"aria-label": "readonly",
|
|
3539
3552
|
readOnly: true,
|
|
3540
3553
|
checked: context.getValue(),
|
|
3541
3554
|
disabled: true
|
|
3542
3555
|
});
|
|
3543
|
-
return /* @__PURE__ */
|
|
3556
|
+
return /* @__PURE__ */ jsx21(Controller, {
|
|
3544
3557
|
name: context.column.id,
|
|
3545
|
-
render: ({ field: { value, ...field } }) => /* @__PURE__ */
|
|
3558
|
+
render: ({ field: { value, ...field } }) => /* @__PURE__ */ jsx21(Checkbox4, {
|
|
3546
3559
|
enterKeyHint: "send",
|
|
3547
3560
|
"aria-label": "editable",
|
|
3548
3561
|
checked: value,
|
|
@@ -3560,7 +3573,7 @@ import styled17 from "styled-components";
|
|
|
3560
3573
|
// src/form-cells/utils.tsx
|
|
3561
3574
|
import { Icon as Icon7 } from "@equinor/eds-core-react";
|
|
3562
3575
|
import { error_filled, warning_filled } from "@equinor/eds-icons";
|
|
3563
|
-
import { jsx as
|
|
3576
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
3564
3577
|
function getHelperTextProps({
|
|
3565
3578
|
error,
|
|
3566
3579
|
warning,
|
|
@@ -3570,7 +3583,7 @@ function getHelperTextProps({
|
|
|
3570
3583
|
return {
|
|
3571
3584
|
variant: "error",
|
|
3572
3585
|
helperText: error.message,
|
|
3573
|
-
helperIcon: /* @__PURE__ */
|
|
3586
|
+
helperIcon: /* @__PURE__ */ jsx22(Icon7, {
|
|
3574
3587
|
data: error_filled,
|
|
3575
3588
|
size: 16
|
|
3576
3589
|
})
|
|
@@ -3579,7 +3592,7 @@ function getHelperTextProps({
|
|
|
3579
3592
|
return {
|
|
3580
3593
|
variant: "warning",
|
|
3581
3594
|
helperText: warning.message,
|
|
3582
|
-
helperIcon: /* @__PURE__ */
|
|
3595
|
+
helperIcon: /* @__PURE__ */ jsx22(Icon7, {
|
|
3583
3596
|
data: warning_filled,
|
|
3584
3597
|
size: 16
|
|
3585
3598
|
})
|
|
@@ -3597,7 +3610,7 @@ function stopPropagation2(handler) {
|
|
|
3597
3610
|
}
|
|
3598
3611
|
|
|
3599
3612
|
// src/form-cells/EditableDateCell.tsx
|
|
3600
|
-
import { jsx as
|
|
3613
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
3601
3614
|
function EditableDateCell(props) {
|
|
3602
3615
|
const { dateStringFormatter, ...context } = props;
|
|
3603
3616
|
const rawValue = context.getValue();
|
|
@@ -3607,13 +3620,13 @@ function EditableDateCell(props) {
|
|
|
3607
3620
|
[rawValue, dateStringFormatter]
|
|
3608
3621
|
);
|
|
3609
3622
|
if (!editMode)
|
|
3610
|
-
return /* @__PURE__ */
|
|
3623
|
+
return /* @__PURE__ */ jsx23(TypographyCustom, {
|
|
3611
3624
|
truncate: true,
|
|
3612
3625
|
children: formattedValue
|
|
3613
3626
|
});
|
|
3614
|
-
return /* @__PURE__ */
|
|
3627
|
+
return /* @__PURE__ */ jsx23(Controller2, {
|
|
3615
3628
|
name: context.column.id,
|
|
3616
|
-
render: ({ field: { value, onChange, ...field }, fieldState: { error } }) => /* @__PURE__ */
|
|
3629
|
+
render: ({ field: { value, onChange, ...field }, fieldState: { error } }) => /* @__PURE__ */ jsx23(InlineTextField, {
|
|
3617
3630
|
id: context.column.id,
|
|
3618
3631
|
type: "date",
|
|
3619
3632
|
autoComplete: "none",
|
|
@@ -3656,7 +3669,7 @@ var InlineTextField = styled17(TextField)`
|
|
|
3656
3669
|
// src/form-cells/EditableDropdownSingleCell.tsx
|
|
3657
3670
|
import { Autocomplete } from "@equinor/eds-core-react";
|
|
3658
3671
|
import { Controller as Controller3 } from "react-hook-form";
|
|
3659
|
-
import { jsx as
|
|
3672
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
3660
3673
|
function buildEmptyOption() {
|
|
3661
3674
|
return { label: "", value: "" };
|
|
3662
3675
|
}
|
|
@@ -3664,15 +3677,15 @@ function EditableDropdownSingleCell(props) {
|
|
|
3664
3677
|
const { options, ...context } = props;
|
|
3665
3678
|
const editMode = useEditMode();
|
|
3666
3679
|
if (!editMode)
|
|
3667
|
-
return /* @__PURE__ */
|
|
3680
|
+
return /* @__PURE__ */ jsx24(TypographyCustom, {
|
|
3668
3681
|
truncate: true,
|
|
3669
3682
|
children: context.getValue()
|
|
3670
3683
|
});
|
|
3671
|
-
return /* @__PURE__ */
|
|
3684
|
+
return /* @__PURE__ */ jsx24(Controller3, {
|
|
3672
3685
|
name: context.column.id,
|
|
3673
3686
|
render: ({ field: { value, onChange, ...field } }) => {
|
|
3674
3687
|
const selectedOption = options.find((option) => option.value === value) ?? buildEmptyOption();
|
|
3675
|
-
return /* @__PURE__ */
|
|
3688
|
+
return /* @__PURE__ */ jsx24(Autocomplete, {
|
|
3676
3689
|
label: "",
|
|
3677
3690
|
selectedOptions: selectedOption && [selectedOption],
|
|
3678
3691
|
options,
|
|
@@ -3694,18 +3707,18 @@ function EditableDropdownSingleCell(props) {
|
|
|
3694
3707
|
import { TextField as TextField2 } from "@equinor/eds-core-react";
|
|
3695
3708
|
import { Controller as Controller4 } from "react-hook-form";
|
|
3696
3709
|
import styled18 from "styled-components";
|
|
3697
|
-
import { Fragment as Fragment4, jsx as
|
|
3710
|
+
import { Fragment as Fragment4, jsx as jsx25 } from "react/jsx-runtime";
|
|
3698
3711
|
function EditableNumberCell(context) {
|
|
3699
3712
|
const editMode = useEditMode();
|
|
3700
3713
|
if (!editMode)
|
|
3701
|
-
return /* @__PURE__ */
|
|
3714
|
+
return /* @__PURE__ */ jsx25(TypographyCustom, {
|
|
3702
3715
|
truncate: true,
|
|
3703
3716
|
children: context.getValue()
|
|
3704
3717
|
});
|
|
3705
|
-
return /* @__PURE__ */
|
|
3718
|
+
return /* @__PURE__ */ jsx25(Controller4, {
|
|
3706
3719
|
name: context.column.id,
|
|
3707
|
-
render: ({ field: { onChange, ...field }, fieldState: { error } }) => /* @__PURE__ */
|
|
3708
|
-
children: /* @__PURE__ */
|
|
3720
|
+
render: ({ field: { onChange, ...field }, fieldState: { error } }) => /* @__PURE__ */ jsx25(Fragment4, {
|
|
3721
|
+
children: /* @__PURE__ */ jsx25(InlineTextField2, {
|
|
3709
3722
|
id: context.column.id,
|
|
3710
3723
|
type: "number",
|
|
3711
3724
|
autoComplete: "none",
|
|
@@ -3745,7 +3758,7 @@ import { arrow_up } from "@equinor/eds-icons";
|
|
|
3745
3758
|
import { useState as useState7 } from "react";
|
|
3746
3759
|
import { Controller as Controller5 } from "react-hook-form";
|
|
3747
3760
|
import styled19 from "styled-components";
|
|
3748
|
-
import { Fragment as Fragment5, jsx as
|
|
3761
|
+
import { Fragment as Fragment5, jsx as jsx26, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
3749
3762
|
function EditableTextAreaCell(props) {
|
|
3750
3763
|
const { title, ...context } = props;
|
|
3751
3764
|
const [textareaValue, setTextareaValue] = useState7(context.getValue());
|
|
@@ -3753,14 +3766,14 @@ function EditableTextAreaCell(props) {
|
|
|
3753
3766
|
const editMode = useEditMode();
|
|
3754
3767
|
const name = context.column.id;
|
|
3755
3768
|
if (!editMode)
|
|
3756
|
-
return /* @__PURE__ */
|
|
3769
|
+
return /* @__PURE__ */ jsx26(PopoverCell, {
|
|
3757
3770
|
id: name + "popover",
|
|
3758
3771
|
value: context.getValue(),
|
|
3759
3772
|
title
|
|
3760
3773
|
});
|
|
3761
3774
|
const openDialog = () => setOpen(true);
|
|
3762
3775
|
const closeDialog = () => setOpen(false);
|
|
3763
|
-
return /* @__PURE__ */
|
|
3776
|
+
return /* @__PURE__ */ jsx26(Controller5, {
|
|
3764
3777
|
name,
|
|
3765
3778
|
render: ({ field: { onChange, ref, ...field }, fieldState: { error } }) => /* @__PURE__ */ jsxs12(Fragment5, {
|
|
3766
3779
|
children: [
|
|
@@ -3771,17 +3784,17 @@ function EditableTextAreaCell(props) {
|
|
|
3771
3784
|
position: "relative"
|
|
3772
3785
|
},
|
|
3773
3786
|
children: [
|
|
3774
|
-
/* @__PURE__ */
|
|
3787
|
+
/* @__PURE__ */ jsx26(StyledTextField, {
|
|
3775
3788
|
id: field.name,
|
|
3776
3789
|
onChange,
|
|
3777
3790
|
ref,
|
|
3778
3791
|
...field,
|
|
3779
3792
|
...getHelperTextProps({ error })
|
|
3780
3793
|
}),
|
|
3781
|
-
/* @__PURE__ */
|
|
3794
|
+
/* @__PURE__ */ jsx26(IconButton, {
|
|
3782
3795
|
variant: "ghost_icon",
|
|
3783
3796
|
onClick: stopPropagation2(openDialog),
|
|
3784
|
-
children: /* @__PURE__ */
|
|
3797
|
+
children: /* @__PURE__ */ jsx26(Icon8, {
|
|
3785
3798
|
data: arrow_up,
|
|
3786
3799
|
size: 24,
|
|
3787
3800
|
style: { transform: "rotateZ(45deg)" }
|
|
@@ -3798,13 +3811,13 @@ function EditableTextAreaCell(props) {
|
|
|
3798
3811
|
isDismissable: true,
|
|
3799
3812
|
style: { width: "min(50rem, calc(100vw - 4rem))" },
|
|
3800
3813
|
children: [
|
|
3801
|
-
/* @__PURE__ */
|
|
3802
|
-
children: /* @__PURE__ */
|
|
3814
|
+
/* @__PURE__ */ jsx26(EDS.Header, {
|
|
3815
|
+
children: /* @__PURE__ */ jsx26(EDS.Title, {
|
|
3803
3816
|
children: title
|
|
3804
3817
|
})
|
|
3805
3818
|
}),
|
|
3806
|
-
/* @__PURE__ */
|
|
3807
|
-
children: /* @__PURE__ */
|
|
3819
|
+
/* @__PURE__ */ jsx26(EDS.Content, {
|
|
3820
|
+
children: /* @__PURE__ */ jsx26(TextField3, {
|
|
3808
3821
|
style: {
|
|
3809
3822
|
maxWidth: "100%",
|
|
3810
3823
|
marginTop: "1rem"
|
|
@@ -3822,14 +3835,14 @@ function EditableTextAreaCell(props) {
|
|
|
3822
3835
|
/* @__PURE__ */ jsxs12(EDS.Actions, {
|
|
3823
3836
|
style: { display: "flex", gap: "1rem" },
|
|
3824
3837
|
children: [
|
|
3825
|
-
/* @__PURE__ */
|
|
3838
|
+
/* @__PURE__ */ jsx26(Button5, {
|
|
3826
3839
|
onClick: () => {
|
|
3827
3840
|
closeDialog();
|
|
3828
3841
|
onChange(textareaValue);
|
|
3829
3842
|
},
|
|
3830
3843
|
children: "Submit"
|
|
3831
3844
|
}),
|
|
3832
|
-
/* @__PURE__ */
|
|
3845
|
+
/* @__PURE__ */ jsx26(Button5, {
|
|
3833
3846
|
variant: "ghost",
|
|
3834
3847
|
onClick: () => {
|
|
3835
3848
|
closeDialog();
|
|
@@ -3865,17 +3878,17 @@ var IconButton = styled19(Button5)`
|
|
|
3865
3878
|
import { TextField as TextField4 } from "@equinor/eds-core-react";
|
|
3866
3879
|
import { Controller as Controller6 } from "react-hook-form";
|
|
3867
3880
|
import styled20 from "styled-components";
|
|
3868
|
-
import { jsx as
|
|
3881
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
3869
3882
|
function EditableTextFieldCell(context) {
|
|
3870
3883
|
const editMode = useEditMode();
|
|
3871
3884
|
if (!editMode)
|
|
3872
|
-
return /* @__PURE__ */
|
|
3885
|
+
return /* @__PURE__ */ jsx27(TypographyCustom, {
|
|
3873
3886
|
truncate: true,
|
|
3874
3887
|
children: context.getValue()
|
|
3875
3888
|
});
|
|
3876
|
-
return /* @__PURE__ */
|
|
3889
|
+
return /* @__PURE__ */ jsx27(Controller6, {
|
|
3877
3890
|
name: context.column.id,
|
|
3878
|
-
render: ({ field: { value, ...field }, fieldState: { error } }) => /* @__PURE__ */
|
|
3891
|
+
render: ({ field: { value, ...field }, fieldState: { error } }) => /* @__PURE__ */ jsx27(InlineTextField3, {
|
|
3879
3892
|
id: context.column.id,
|
|
3880
3893
|
autoComplete: "none",
|
|
3881
3894
|
value: String(value ?? ""),
|
|
@@ -3909,6 +3922,7 @@ var InlineTextField3 = styled20(TextField4)`
|
|
|
3909
3922
|
export {
|
|
3910
3923
|
AppShell,
|
|
3911
3924
|
AppSidebar,
|
|
3925
|
+
CheckboxCell,
|
|
3912
3926
|
ChipsCell,
|
|
3913
3927
|
ColumnSelect,
|
|
3914
3928
|
DataTable,
|