@natoora-libs/core 0.1.9-dev-doug-6 → 0.1.9-dev-doug-7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -869,7 +869,7 @@ type HeadCell = {
|
|
|
869
869
|
disableSort?: boolean;
|
|
870
870
|
RenderHeader?: ReactNode;
|
|
871
871
|
editableCellType?: EditableCellType;
|
|
872
|
-
validateInput?: (value: string) => boolean;
|
|
872
|
+
validateInput?: (value: string | null) => boolean;
|
|
873
873
|
onUpdateEditableCell?: (rowId: number, newValue: string | number | boolean) => void;
|
|
874
874
|
filterOptions?: HeaderFilterOptions;
|
|
875
875
|
refetchFilterOptions?: () => void;
|
|
@@ -886,7 +886,6 @@ type TableDesktopProps = {
|
|
|
886
886
|
isLoading?: boolean;
|
|
887
887
|
rowsPerPage?: number;
|
|
888
888
|
enableCheckboxSelection?: boolean;
|
|
889
|
-
enableRowActions?: boolean;
|
|
890
889
|
disableInternalSort?: boolean;
|
|
891
890
|
updateSort?: (sortField: string, sortDir: Order) => void;
|
|
892
891
|
showClearFilterButton?: boolean;
|
|
@@ -897,7 +896,7 @@ type TableDesktopProps = {
|
|
|
897
896
|
onApplyFilters?: (updatedFilters: HeaderFilters, shouldSave: boolean) => void;
|
|
898
897
|
shouldShowCheckOnFilter?: (columnId: string, filterOption: HeaderFilterObject) => boolean;
|
|
899
898
|
};
|
|
900
|
-
declare const TableDesktop: ({ data, headCells, RenderItem, appliedFilters, headerFilters, children, height, isLoading, rowsPerPage, enableCheckboxSelection,
|
|
899
|
+
declare const TableDesktop: ({ data, headCells, RenderItem, appliedFilters, headerFilters, children, height, isLoading, rowsPerPage, enableCheckboxSelection, disableInternalSort, updateSort, showClearFilterButton, handleClickOnClearFiltersButton, deleteItem, keyField, tableLayout, onApplyFilters, shouldShowCheckOnFilter, }: TableDesktopProps) => react_jsx_runtime.JSX.Element;
|
|
901
900
|
|
|
902
901
|
interface SmartTableHeaderFilterMenuProps {
|
|
903
902
|
headCell: HeadCell;
|
|
@@ -869,7 +869,7 @@ type HeadCell = {
|
|
|
869
869
|
disableSort?: boolean;
|
|
870
870
|
RenderHeader?: ReactNode;
|
|
871
871
|
editableCellType?: EditableCellType;
|
|
872
|
-
validateInput?: (value: string) => boolean;
|
|
872
|
+
validateInput?: (value: string | null) => boolean;
|
|
873
873
|
onUpdateEditableCell?: (rowId: number, newValue: string | number | boolean) => void;
|
|
874
874
|
filterOptions?: HeaderFilterOptions;
|
|
875
875
|
refetchFilterOptions?: () => void;
|
|
@@ -886,7 +886,6 @@ type TableDesktopProps = {
|
|
|
886
886
|
isLoading?: boolean;
|
|
887
887
|
rowsPerPage?: number;
|
|
888
888
|
enableCheckboxSelection?: boolean;
|
|
889
|
-
enableRowActions?: boolean;
|
|
890
889
|
disableInternalSort?: boolean;
|
|
891
890
|
updateSort?: (sortField: string, sortDir: Order) => void;
|
|
892
891
|
showClearFilterButton?: boolean;
|
|
@@ -897,7 +896,7 @@ type TableDesktopProps = {
|
|
|
897
896
|
onApplyFilters?: (updatedFilters: HeaderFilters, shouldSave: boolean) => void;
|
|
898
897
|
shouldShowCheckOnFilter?: (columnId: string, filterOption: HeaderFilterObject) => boolean;
|
|
899
898
|
};
|
|
900
|
-
declare const TableDesktop: ({ data, headCells, RenderItem, appliedFilters, headerFilters, children, height, isLoading, rowsPerPage, enableCheckboxSelection,
|
|
899
|
+
declare const TableDesktop: ({ data, headCells, RenderItem, appliedFilters, headerFilters, children, height, isLoading, rowsPerPage, enableCheckboxSelection, disableInternalSort, updateSort, showClearFilterButton, handleClickOnClearFiltersButton, deleteItem, keyField, tableLayout, onApplyFilters, shouldShowCheckOnFilter, }: TableDesktopProps) => react_jsx_runtime.JSX.Element;
|
|
901
900
|
|
|
902
901
|
interface SmartTableHeaderFilterMenuProps {
|
|
903
902
|
headCell: HeadCell;
|
package/dist/components/index.js
CHANGED
|
@@ -6889,7 +6889,6 @@ var TableDesktop = ({
|
|
|
6889
6889
|
isLoading,
|
|
6890
6890
|
rowsPerPage = 50,
|
|
6891
6891
|
enableCheckboxSelection = false,
|
|
6892
|
-
enableRowActions = false,
|
|
6893
6892
|
disableInternalSort = false,
|
|
6894
6893
|
updateSort,
|
|
6895
6894
|
showClearFilterButton,
|
|
@@ -6952,7 +6951,6 @@ var TableDesktop = ({
|
|
|
6952
6951
|
[]
|
|
6953
6952
|
);
|
|
6954
6953
|
const renderTableRows = useMemo2(() => {
|
|
6955
|
-
const sortedData = disableInternalSort ? data : stableSort(data, getComparator(order, orderBy));
|
|
6956
6954
|
if (isLoading) {
|
|
6957
6955
|
return [...Array(Math.min(numRows, rowsPerPage))].map((_, rowIndex) => /* @__PURE__ */ jsx110(TableRow3, { children: [...Array(visibleHeadCells.length)].map((_2, cellIndex) => /* @__PURE__ */ jsx110(TableCell3, { children: /* @__PURE__ */ jsx110(
|
|
6958
6956
|
Skeleton2,
|
|
@@ -6960,11 +6958,12 @@ var TableDesktop = ({
|
|
|
6960
6958
|
animation: "pulse",
|
|
6961
6959
|
variant: "rounded",
|
|
6962
6960
|
height: ROW_HEIGHT - 33,
|
|
6963
|
-
sx: { bgcolor: colors.
|
|
6961
|
+
sx: { bgcolor: colors.neutral100 },
|
|
6964
6962
|
"data-testid": "loading-skeleton"
|
|
6965
6963
|
}
|
|
6966
6964
|
) }, cellIndex)) }, rowIndex));
|
|
6967
6965
|
}
|
|
6966
|
+
const sortedData = disableInternalSort ? data : stableSort(data, getComparator(order, orderBy));
|
|
6968
6967
|
return sortedData.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage).map((row, index) => {
|
|
6969
6968
|
const isItemSelected = selected.has(row[keyField]);
|
|
6970
6969
|
return /* @__PURE__ */ jsx110(
|
|
@@ -6992,8 +6991,9 @@ var TableDesktop = ({
|
|
|
6992
6991
|
page,
|
|
6993
6992
|
rowsPerPage,
|
|
6994
6993
|
selected,
|
|
6994
|
+
isLoading,
|
|
6995
|
+
numRows,
|
|
6995
6996
|
enableCheckboxSelection,
|
|
6996
|
-
enableRowActions,
|
|
6997
6997
|
disableInternalSort,
|
|
6998
6998
|
deleteItem,
|
|
6999
6999
|
keyField,
|
|
@@ -7754,7 +7754,6 @@ var TableDesktopRowCell = ({
|
|
|
7754
7754
|
return /* @__PURE__ */ jsx117(Tooltip7, { title: isOverflowed ? String(readOnlyValue) : "", arrow: true, children: /* @__PURE__ */ jsx117(
|
|
7755
7755
|
TableCell5,
|
|
7756
7756
|
{
|
|
7757
|
-
ref: cellRef,
|
|
7758
7757
|
align: "left",
|
|
7759
7758
|
onMouseEnter: () => editableCellType && !disabled && setIsCellHovered(true),
|
|
7760
7759
|
onMouseLeave: () => editableCellType && !disabled && setIsCellHovered(false),
|
|
@@ -7762,9 +7761,6 @@ var TableDesktopRowCell = ({
|
|
|
7762
7761
|
sx: {
|
|
7763
7762
|
padding: 1,
|
|
7764
7763
|
width: width ?? "auto",
|
|
7765
|
-
overflow: "hidden",
|
|
7766
|
-
textOverflow: "ellipsis",
|
|
7767
|
-
whiteSpace: "nowrap",
|
|
7768
7764
|
position: "relative",
|
|
7769
7765
|
cursor: disabled ? "default" : "pointer",
|
|
7770
7766
|
opacity: disabled ? 0.2 : 1,
|
|
@@ -7773,23 +7769,33 @@ var TableDesktopRowCell = ({
|
|
|
7773
7769
|
},
|
|
7774
7770
|
background: isEditMode ? colors.lightBlueBackground : (theme) => theme.palette.background.default
|
|
7775
7771
|
},
|
|
7776
|
-
children: /* @__PURE__ */ jsxs79(
|
|
7777
|
-
|
|
7778
|
-
|
|
7779
|
-
|
|
7780
|
-
|
|
7781
|
-
|
|
7782
|
-
|
|
7783
|
-
|
|
7784
|
-
|
|
7785
|
-
|
|
7786
|
-
|
|
7787
|
-
|
|
7788
|
-
|
|
7789
|
-
|
|
7790
|
-
|
|
7791
|
-
|
|
7792
|
-
|
|
7772
|
+
children: /* @__PURE__ */ jsxs79(
|
|
7773
|
+
Box33,
|
|
7774
|
+
{
|
|
7775
|
+
p: 1,
|
|
7776
|
+
ref: cellRef,
|
|
7777
|
+
overflow: "hidden",
|
|
7778
|
+
textOverflow: "ellipsis",
|
|
7779
|
+
whiteSpace: "nowrap",
|
|
7780
|
+
children: [
|
|
7781
|
+
isCellHovered ? /* @__PURE__ */ jsx117(Tooltip7, { title: isEditMode ? "" : "Toggle Edit Mode", children: /* @__PURE__ */ jsx117(
|
|
7782
|
+
IconButton4,
|
|
7783
|
+
{
|
|
7784
|
+
onClick: handleEditClick,
|
|
7785
|
+
sx: {
|
|
7786
|
+
top: 0,
|
|
7787
|
+
right: 0,
|
|
7788
|
+
zIndex: 1,
|
|
7789
|
+
borderRadius: 0,
|
|
7790
|
+
position: "absolute"
|
|
7791
|
+
},
|
|
7792
|
+
children: isEditMode ? /* @__PURE__ */ jsx117(Close2, { fontSize: "small", color: "error" }) : /* @__PURE__ */ jsx117(Edit3, { fontSize: "small" })
|
|
7793
|
+
}
|
|
7794
|
+
) }) : null,
|
|
7795
|
+
isEditMode && editableCellType ? editableComponents[editableCellType] : typeof readOnlyValue === "boolean" ? getReadOnlyBooleanIcon(readOnlyValue) : readOnlyValue
|
|
7796
|
+
]
|
|
7797
|
+
}
|
|
7798
|
+
)
|
|
7793
7799
|
}
|
|
7794
7800
|
) });
|
|
7795
7801
|
};
|