@natoora-libs/core 0.1.14 → 0.1.16
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/components/index.js
CHANGED
|
@@ -6596,7 +6596,7 @@ import {
|
|
|
6596
6596
|
FormControlLabel as FormControlLabel3,
|
|
6597
6597
|
Menu as Menu4,
|
|
6598
6598
|
Skeleton as Skeleton3,
|
|
6599
|
-
Tooltip as
|
|
6599
|
+
Tooltip as Tooltip7
|
|
6600
6600
|
} from "@mui/material";
|
|
6601
6601
|
import classNames3 from "classnames";
|
|
6602
6602
|
import { makeStyles as makeStyles48 } from "tss-react/mui";
|
|
@@ -6628,6 +6628,7 @@ import {
|
|
|
6628
6628
|
TableHead,
|
|
6629
6629
|
TableRow,
|
|
6630
6630
|
TableSortLabel,
|
|
6631
|
+
Tooltip as Tooltip6,
|
|
6631
6632
|
Typography as Typography25
|
|
6632
6633
|
} from "@mui/material";
|
|
6633
6634
|
import { makeStyles as makeStyles45 } from "tss-react/mui";
|
|
@@ -6729,7 +6730,7 @@ var SmartTableHeader = ({
|
|
|
6729
6730
|
flexDirection: "row",
|
|
6730
6731
|
gap: headCell.disableSort ? 1 : 0,
|
|
6731
6732
|
children: [
|
|
6732
|
-
headCell.disableSort ? /* @__PURE__ */ jsx108(Typography25, { variant: "subtitle2", mt: 0.25, fontWeight: 600, children: headCell.label }) : /* @__PURE__ */ jsxs73(
|
|
6733
|
+
headCell.disableSort ? headCell.RenderHeader ?? /* @__PURE__ */ jsx108(Tooltip6, { title: headCell.labelTooltip ?? "", arrow: true, children: /* @__PURE__ */ jsx108(Typography25, { variant: "subtitle2", mt: 0.25, fontWeight: 600, children: headCell.label }) }) : /* @__PURE__ */ jsx108(Tooltip6, { title: headCell.labelTooltip ?? "", arrow: true, children: /* @__PURE__ */ jsxs73(
|
|
6733
6734
|
TableSortLabel,
|
|
6734
6735
|
{
|
|
6735
6736
|
"data-testid": "table-sort-label",
|
|
@@ -6741,7 +6742,7 @@ var SmartTableHeader = ({
|
|
|
6741
6742
|
orderBy === headCell.id ? /* @__PURE__ */ jsx108("span", { className: classes.visuallyHidden, children: order === "desc" ? "sorted descending" : "sorted ascending" }) : null
|
|
6742
6743
|
]
|
|
6743
6744
|
}
|
|
6744
|
-
),
|
|
6745
|
+
) }),
|
|
6745
6746
|
headCell.refetchFilterOptions ? /* @__PURE__ */ jsx108(
|
|
6746
6747
|
SmartTableHeaderFilterMenu_default,
|
|
6747
6748
|
{
|
|
@@ -7263,7 +7264,7 @@ var SmartTableHeaderFilterMenu = ({
|
|
|
7263
7264
|
},
|
|
7264
7265
|
resolvedOption
|
|
7265
7266
|
),
|
|
7266
|
-
shouldShowCheckOnFilter?.(headCell.id, option) ? /* @__PURE__ */ jsx112(
|
|
7267
|
+
shouldShowCheckOnFilter?.(headCell.id, option) ? /* @__PURE__ */ jsx112(Tooltip7, { title: "This filter is saved as default", children: /* @__PURE__ */ jsx112(CheckIcon, { fontSize: "small", color: "action" }) }) : null
|
|
7267
7268
|
]
|
|
7268
7269
|
},
|
|
7269
7270
|
resolvedOption
|
|
@@ -7569,7 +7570,10 @@ var TableDesktopFooter = ({
|
|
|
7569
7570
|
|
|
7570
7571
|
// src/components/TableDesktopRowCell/TableDesktopRowCell.tsx
|
|
7571
7572
|
import { useEffect as useEffect13, useRef as useRef5, useState as useState20 } from "react";
|
|
7572
|
-
import
|
|
7573
|
+
import CheckIcon2 from "@mui/icons-material/Check";
|
|
7574
|
+
import CloseIcon from "@mui/icons-material/Close";
|
|
7575
|
+
import EditIcon from "@mui/icons-material/Edit";
|
|
7576
|
+
import { Box as Box33, Checkbox as Checkbox6, IconButton as IconButton4, TableCell as TableCell6, TextField as TextField9, Tooltip as Tooltip8 } from "@mui/material";
|
|
7573
7577
|
|
|
7574
7578
|
// src/components/TableDesktopRowCell/TableDesktopSmartSelect.tsx
|
|
7575
7579
|
import { useState as useState18, memo as memo22, useEffect as useEffect12 } from "react";
|
|
@@ -7627,12 +7631,9 @@ var TableDesktopSmartSelect = memo22(({
|
|
|
7627
7631
|
);
|
|
7628
7632
|
});
|
|
7629
7633
|
|
|
7630
|
-
// src/components/TableDesktopRowCell/TableDesktopRowCell.tsx
|
|
7631
|
-
import CheckIcon2 from "@mui/icons-material/Check";
|
|
7632
|
-
|
|
7633
7634
|
// src/components/TableDesktopRowCell/TableDesktopTextField.tsx
|
|
7634
|
-
import TextField8 from "@mui/material/TextField";
|
|
7635
7635
|
import { useMemo as useMemo4, useState as useState19 } from "react";
|
|
7636
|
+
import { TextField as TextField8 } from "@mui/material";
|
|
7636
7637
|
import { jsx as jsx117 } from "react/jsx-runtime";
|
|
7637
7638
|
var TableDesktopTextField = ({
|
|
7638
7639
|
rowId,
|
|
@@ -7642,34 +7643,54 @@ var TableDesktopTextField = ({
|
|
|
7642
7643
|
validateInput,
|
|
7643
7644
|
onUpdateEditableCell
|
|
7644
7645
|
}) => {
|
|
7645
|
-
const [
|
|
7646
|
-
const
|
|
7646
|
+
const [input, setInput] = useState19(editInitialValue);
|
|
7647
|
+
const hasValidationError = useMemo4(() => !validateInput?.(input), [input, validateInput]);
|
|
7648
|
+
const commitValue = (value) => {
|
|
7649
|
+
if (hasValidationError) {
|
|
7650
|
+
return;
|
|
7651
|
+
}
|
|
7652
|
+
onUpdateEditableCell?.(rowId, value);
|
|
7653
|
+
};
|
|
7654
|
+
const handleKeyDown = (e) => {
|
|
7655
|
+
if (e.key === "Enter") {
|
|
7656
|
+
e.preventDefault();
|
|
7657
|
+
commitValue(input);
|
|
7658
|
+
}
|
|
7659
|
+
};
|
|
7647
7660
|
return /* @__PURE__ */ jsx117(
|
|
7648
7661
|
TextField8,
|
|
7649
7662
|
{
|
|
7650
7663
|
fullWidth: true,
|
|
7651
7664
|
variant: "standard",
|
|
7652
|
-
|
|
7665
|
+
value: input,
|
|
7653
7666
|
label: inputLabel,
|
|
7654
|
-
error:
|
|
7667
|
+
error: hasValidationError,
|
|
7655
7668
|
disabled,
|
|
7656
|
-
|
|
7657
|
-
|
|
7669
|
+
onKeyDown: handleKeyDown,
|
|
7670
|
+
onChange: ({ target: { value } }) => {
|
|
7671
|
+
setInput(value);
|
|
7658
7672
|
},
|
|
7659
|
-
onBlur: ({ target: { value
|
|
7660
|
-
|
|
7661
|
-
return;
|
|
7662
|
-
}
|
|
7663
|
-
onUpdateEditableCell?.(rowId, value2);
|
|
7673
|
+
onBlur: ({ target: { value } }) => {
|
|
7674
|
+
commitValue(value);
|
|
7664
7675
|
}
|
|
7665
7676
|
}
|
|
7666
7677
|
);
|
|
7667
7678
|
};
|
|
7668
7679
|
|
|
7669
7680
|
// src/components/TableDesktopRowCell/TableDesktopRowCell.tsx
|
|
7670
|
-
import Close2 from "@mui/icons-material/Close";
|
|
7671
|
-
import Edit3 from "@mui/icons-material/Edit";
|
|
7672
7681
|
import { jsx as jsx118, jsxs as jsxs80 } from "react/jsx-runtime";
|
|
7682
|
+
var getReadOnlyBooleanIcon = (value) => {
|
|
7683
|
+
if (value) {
|
|
7684
|
+
return /* @__PURE__ */ jsx118(CheckIcon2, { sx: { fontSize: 16 } });
|
|
7685
|
+
}
|
|
7686
|
+
return "-";
|
|
7687
|
+
};
|
|
7688
|
+
var renderReadOnlyValue = (value) => {
|
|
7689
|
+
if (typeof value === "boolean") {
|
|
7690
|
+
return getReadOnlyBooleanIcon(value);
|
|
7691
|
+
}
|
|
7692
|
+
return value;
|
|
7693
|
+
};
|
|
7673
7694
|
var TableDesktopRowCell = ({
|
|
7674
7695
|
inputLabel,
|
|
7675
7696
|
editInitialValue,
|
|
@@ -7768,17 +7789,11 @@ var TableDesktopRowCell = ({
|
|
|
7768
7789
|
}
|
|
7769
7790
|
)
|
|
7770
7791
|
};
|
|
7771
|
-
const getReadOnlyBooleanIcon = (value) => {
|
|
7772
|
-
if (value) {
|
|
7773
|
-
return /* @__PURE__ */ jsx118(CheckIcon2, { sx: { fontSize: 16 } });
|
|
7774
|
-
}
|
|
7775
|
-
return "-";
|
|
7776
|
-
};
|
|
7777
7792
|
const handleEditClick = (e) => {
|
|
7778
7793
|
e.stopPropagation();
|
|
7779
7794
|
setIsEditMode((prev) => !prev);
|
|
7780
7795
|
};
|
|
7781
|
-
return /* @__PURE__ */ jsx118(
|
|
7796
|
+
return /* @__PURE__ */ jsx118(Tooltip8, { title: isOverflowed ? String(readOnlyValue) : "", arrow: true, children: /* @__PURE__ */ jsx118(
|
|
7782
7797
|
TableCell6,
|
|
7783
7798
|
{
|
|
7784
7799
|
align: "left",
|
|
@@ -7805,7 +7820,7 @@ var TableDesktopRowCell = ({
|
|
|
7805
7820
|
textOverflow: "ellipsis",
|
|
7806
7821
|
whiteSpace: "nowrap",
|
|
7807
7822
|
children: [
|
|
7808
|
-
isCellHovered ? /* @__PURE__ */ jsx118(
|
|
7823
|
+
isCellHovered ? /* @__PURE__ */ jsx118(Tooltip8, { title: isEditMode ? "" : "Toggle Edit Mode", children: /* @__PURE__ */ jsx118(
|
|
7809
7824
|
IconButton4,
|
|
7810
7825
|
{
|
|
7811
7826
|
onClick: handleEditClick,
|
|
@@ -7820,10 +7835,10 @@ var TableDesktopRowCell = ({
|
|
|
7820
7835
|
backgroundColor: isEditMode ? colors.lightBlueBackground : colors.neutral150
|
|
7821
7836
|
}
|
|
7822
7837
|
},
|
|
7823
|
-
children: isEditMode ? /* @__PURE__ */ jsx118(
|
|
7838
|
+
children: isEditMode ? /* @__PURE__ */ jsx118(CloseIcon, { fontSize: "small", color: "error" }) : /* @__PURE__ */ jsx118(EditIcon, { fontSize: "small" })
|
|
7824
7839
|
}
|
|
7825
7840
|
) }) : null,
|
|
7826
|
-
isEditMode && editableCellType ? editableComponents[editableCellType] :
|
|
7841
|
+
isEditMode && editableCellType ? editableComponents[editableCellType] : renderReadOnlyValue(readOnlyValue)
|
|
7827
7842
|
]
|
|
7828
7843
|
}
|
|
7829
7844
|
)
|