@natoora-libs/core 0.1.9-dev-doug-1 → 0.1.9-dev-doug-3
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.
|
@@ -6508,7 +6508,7 @@ var import_jsx_runtime104 = require("react/jsx-runtime");
|
|
|
6508
6508
|
var SearchFieldDebounced = ({
|
|
6509
6509
|
onSearch,
|
|
6510
6510
|
initialValue = "",
|
|
6511
|
-
|
|
6511
|
+
debounceDelay = 500
|
|
6512
6512
|
}) => {
|
|
6513
6513
|
const [value, setValue] = (0, import_react28.useState)(initialValue);
|
|
6514
6514
|
const debounceRef = (0, import_react28.useRef)(null);
|
|
@@ -6520,7 +6520,7 @@ var SearchFieldDebounced = ({
|
|
|
6520
6520
|
;
|
|
6521
6521
|
debounceRef.current = window.setTimeout(() => {
|
|
6522
6522
|
onSearch(e.target.value);
|
|
6523
|
-
},
|
|
6523
|
+
}, debounceDelay);
|
|
6524
6524
|
};
|
|
6525
6525
|
(0, import_react28.useEffect)(() => {
|
|
6526
6526
|
return () => {
|
|
@@ -6902,7 +6902,7 @@ var useStyles46 = (0, import_mui52.makeStyles)()((theme) => ({
|
|
|
6902
6902
|
},
|
|
6903
6903
|
tableHeaderContent: {
|
|
6904
6904
|
borderBottom: "1px solid",
|
|
6905
|
-
borderBottomColor: colors.
|
|
6905
|
+
borderBottomColor: colors.neutral300,
|
|
6906
6906
|
whiteSpace: "nowrap",
|
|
6907
6907
|
"& .filter-menu-trigger": {
|
|
6908
6908
|
visibility: "hidden",
|
|
@@ -6963,38 +6963,46 @@ var SmartTableHeader = ({
|
|
|
6963
6963
|
onChange: onSelectAllClick
|
|
6964
6964
|
}
|
|
6965
6965
|
) }) : null,
|
|
6966
|
-
headCells.map((headCell) => /* @__PURE__ */ (0, import_jsx_runtime109.
|
|
6966
|
+
headCells.map((headCell) => /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
6967
6967
|
import_material58.TableCell,
|
|
6968
6968
|
{
|
|
6969
6969
|
className: classes.tableHeaderContent,
|
|
6970
6970
|
align: "left",
|
|
6971
|
-
|
|
6971
|
+
width: headCell.width ?? "auto",
|
|
6972
6972
|
sortDirection: orderBy === headCell.id ? order : false,
|
|
6973
|
-
children:
|
|
6974
|
-
|
|
6975
|
-
|
|
6976
|
-
|
|
6977
|
-
|
|
6978
|
-
|
|
6979
|
-
|
|
6980
|
-
|
|
6981
|
-
|
|
6982
|
-
|
|
6983
|
-
|
|
6984
|
-
|
|
6985
|
-
|
|
6986
|
-
|
|
6987
|
-
|
|
6988
|
-
|
|
6989
|
-
|
|
6990
|
-
|
|
6991
|
-
|
|
6992
|
-
|
|
6993
|
-
|
|
6994
|
-
|
|
6995
|
-
|
|
6996
|
-
|
|
6997
|
-
|
|
6973
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(
|
|
6974
|
+
import_material58.Box,
|
|
6975
|
+
{
|
|
6976
|
+
display: "flex",
|
|
6977
|
+
flexDirection: "row",
|
|
6978
|
+
gap: headCell.disableSort ? 1 : 0,
|
|
6979
|
+
children: [
|
|
6980
|
+
headCell.disableSort ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_material58.Typography, { variant: "subtitle2", mt: 0.25, fontWeight: 600, children: headCell.label }) : /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(
|
|
6981
|
+
import_material58.TableSortLabel,
|
|
6982
|
+
{
|
|
6983
|
+
"data-testid": "table-sort-label",
|
|
6984
|
+
active: isSortActive(headCell.id),
|
|
6985
|
+
direction: orderBy === headCell.id ? order : "asc",
|
|
6986
|
+
onClick: createSortHandler(headCell.id),
|
|
6987
|
+
children: [
|
|
6988
|
+
headCell.RenderHeader ?? headCell.label,
|
|
6989
|
+
orderBy === headCell.id ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("span", { className: classes.visuallyHidden, children: order === "desc" ? "sorted descending" : "sorted ascending" }) : null
|
|
6990
|
+
]
|
|
6991
|
+
}
|
|
6992
|
+
),
|
|
6993
|
+
headCell.refetchFilterOptions ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
6994
|
+
SmartTableHeaderFilterMenu_default,
|
|
6995
|
+
{
|
|
6996
|
+
headCell,
|
|
6997
|
+
headerFilters,
|
|
6998
|
+
numActiveFilters: headerFilters[headCell.id]?.length ?? 0,
|
|
6999
|
+
onApplyFilters,
|
|
7000
|
+
shouldShowCheckOnFilter
|
|
7001
|
+
}
|
|
7002
|
+
) : null
|
|
7003
|
+
]
|
|
7004
|
+
}
|
|
7005
|
+
)
|
|
6998
7006
|
},
|
|
6999
7007
|
headCell.id
|
|
7000
7008
|
))
|
|
@@ -7315,7 +7323,8 @@ var useStyles49 = (0, import_mui55.makeStyles)()((theme) => ({
|
|
|
7315
7323
|
},
|
|
7316
7324
|
applyFilterButtonsContainer: {
|
|
7317
7325
|
display: "flex",
|
|
7318
|
-
padding: theme.spacing(0, 1)
|
|
7326
|
+
padding: theme.spacing(0, 1),
|
|
7327
|
+
justifyContent: "space-between"
|
|
7319
7328
|
},
|
|
7320
7329
|
saveAsDefaultButton: {
|
|
7321
7330
|
color: theme.palette.primary.main
|
|
@@ -7348,8 +7357,9 @@ var SmartTableHeaderFilterMenu = ({
|
|
|
7348
7357
|
headerFilters[headCell.id] ?? []
|
|
7349
7358
|
);
|
|
7350
7359
|
(0, import_react34.useEffect)(() => {
|
|
7351
|
-
if (headCell.filterOptions)
|
|
7360
|
+
if (headCell.filterOptions) {
|
|
7352
7361
|
setFilterOptionsData(headCell.filterOptions);
|
|
7362
|
+
}
|
|
7353
7363
|
}, [headCell.filterOptions]);
|
|
7354
7364
|
const numFilterOptions = (0, import_react34.useMemo)(() => filterOptionsData?.length ?? 0, [filterOptionsData?.length]);
|
|
7355
7365
|
const numCurrentSelectedFilters = selectedFilters.length;
|
|
@@ -7423,7 +7433,7 @@ var SmartTableHeaderFilterMenu = ({
|
|
|
7423
7433
|
"data-testid": "filter-menu",
|
|
7424
7434
|
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
7425
7435
|
transformOrigin: { vertical: "top", horizontal: "right" },
|
|
7426
|
-
children:
|
|
7436
|
+
children: headCell.isFetchingFilterOptions ? loadingSkeletons : /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(import_material61.Box, { className: classes.filterMenu, children: [
|
|
7427
7437
|
/* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.Box, { px: 3, mb: 0.5, children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
|
|
7428
7438
|
import_material61.FormControlLabel,
|
|
7429
7439
|
{
|
|
@@ -7687,50 +7697,32 @@ var Table_default = Table2;
|
|
|
7687
7697
|
var import_material64 = require("@mui/material");
|
|
7688
7698
|
var import_jsx_runtime115 = require("react/jsx-runtime");
|
|
7689
7699
|
var TableDesktopRowActions = ({
|
|
7690
|
-
rowRef,
|
|
7691
7700
|
isRowHovered,
|
|
7692
|
-
|
|
7693
|
-
|
|
7694
|
-
pt,
|
|
7695
|
-
pb,
|
|
7696
|
-
pr,
|
|
7697
|
-
pl,
|
|
7698
|
-
top = 0,
|
|
7699
|
-
right = 0,
|
|
7700
|
-
bottom = 0,
|
|
7701
|
-
left = 0,
|
|
7701
|
+
children,
|
|
7702
|
+
sx,
|
|
7702
7703
|
zIndex = 1,
|
|
7703
|
-
backgroundColor
|
|
7704
|
-
children
|
|
7704
|
+
backgroundColor
|
|
7705
7705
|
}) => {
|
|
7706
7706
|
return isRowHovered ? /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
7707
7707
|
import_material64.TableCell,
|
|
7708
7708
|
{
|
|
7709
|
-
ref: rowRef,
|
|
7710
7709
|
padding: "none",
|
|
7711
7710
|
sx: {
|
|
7712
|
-
top,
|
|
7713
|
-
right,
|
|
7714
|
-
bottom,
|
|
7715
|
-
left,
|
|
7711
|
+
top: 0,
|
|
7712
|
+
right: 0,
|
|
7716
7713
|
zIndex,
|
|
7717
7714
|
position: "sticky",
|
|
7718
7715
|
display: "flex",
|
|
7719
|
-
justifyContent: "flex-end"
|
|
7716
|
+
justifyContent: "flex-end",
|
|
7717
|
+
alignItems: "center"
|
|
7720
7718
|
},
|
|
7721
7719
|
children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
7722
7720
|
import_material64.Box,
|
|
7723
7721
|
{
|
|
7724
|
-
|
|
7725
|
-
py,
|
|
7726
|
-
pt,
|
|
7727
|
-
pb,
|
|
7728
|
-
pr,
|
|
7729
|
-
pl,
|
|
7722
|
+
sx,
|
|
7730
7723
|
display: "flex",
|
|
7731
7724
|
flexDirection: "row",
|
|
7732
|
-
|
|
7733
|
-
bgcolor: backgroundColor ?? ((theme) => theme.palette.background.default),
|
|
7725
|
+
bgcolor: backgroundColor ?? colors.neutral100,
|
|
7734
7726
|
children
|
|
7735
7727
|
}
|
|
7736
7728
|
)
|
|
@@ -7745,7 +7737,7 @@ var import_material65 = require("@mui/material");
|
|
|
7745
7737
|
// src/components/TableDesktopRowCell/TableDesktopSmartSelect.tsx
|
|
7746
7738
|
var import_react36 = require("react");
|
|
7747
7739
|
var import_jsx_runtime116 = require("react/jsx-runtime");
|
|
7748
|
-
var
|
|
7740
|
+
var resolveValue = (value) => {
|
|
7749
7741
|
if (typeof value === "string") {
|
|
7750
7742
|
return value;
|
|
7751
7743
|
}
|
|
@@ -7764,12 +7756,12 @@ var TableDesktopSmartSelect = (0, import_react36.memo)(({
|
|
|
7764
7756
|
}) => {
|
|
7765
7757
|
const [value, setValue] = (0, import_react36.useState)(initialValue);
|
|
7766
7758
|
const [options, setOptions] = (0, import_react36.useState)();
|
|
7767
|
-
const valueId =
|
|
7759
|
+
const valueId = resolveValue(value);
|
|
7768
7760
|
const valueLabel = resolveOptionType(value, fieldName);
|
|
7769
7761
|
(0, import_react36.useEffect)(() => {
|
|
7770
7762
|
if (filterOptions) {
|
|
7771
7763
|
const parsedOptions = filterOptions?.map((option) => ({
|
|
7772
|
-
value:
|
|
7764
|
+
value: resolveValue(option),
|
|
7773
7765
|
label: String(resolveOptionType(option, fieldName))
|
|
7774
7766
|
}));
|
|
7775
7767
|
setOptions(parsedOptions);
|
|
@@ -7827,10 +7819,10 @@ var TableDesktopRowCell = ({
|
|
|
7827
7819
|
TableDesktopSmartSelect,
|
|
7828
7820
|
{
|
|
7829
7821
|
ref,
|
|
7822
|
+
rowId,
|
|
7823
|
+
fieldName,
|
|
7830
7824
|
initialValue: editInitialValue,
|
|
7831
7825
|
inputLabel: inputLabel ?? "",
|
|
7832
|
-
fieldName,
|
|
7833
|
-
rowId,
|
|
7834
7826
|
filterOptions,
|
|
7835
7827
|
refetchFilterOptions,
|
|
7836
7828
|
isFetchingFilterOptions,
|