@natoora-libs/core 0.1.9-dev-doug-1 → 0.1.9-dev-doug-2
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 () => {
|
|
@@ -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
|
))
|
|
@@ -7348,8 +7356,9 @@ var SmartTableHeaderFilterMenu = ({
|
|
|
7348
7356
|
headerFilters[headCell.id] ?? []
|
|
7349
7357
|
);
|
|
7350
7358
|
(0, import_react34.useEffect)(() => {
|
|
7351
|
-
if (headCell.filterOptions)
|
|
7359
|
+
if (headCell.filterOptions) {
|
|
7352
7360
|
setFilterOptionsData(headCell.filterOptions);
|
|
7361
|
+
}
|
|
7353
7362
|
}, [headCell.filterOptions]);
|
|
7354
7363
|
const numFilterOptions = (0, import_react34.useMemo)(() => filterOptionsData?.length ?? 0, [filterOptionsData?.length]);
|
|
7355
7364
|
const numCurrentSelectedFilters = selectedFilters.length;
|
|
@@ -7423,7 +7432,7 @@ var SmartTableHeaderFilterMenu = ({
|
|
|
7423
7432
|
"data-testid": "filter-menu",
|
|
7424
7433
|
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
7425
7434
|
transformOrigin: { vertical: "top", horizontal: "right" },
|
|
7426
|
-
children:
|
|
7435
|
+
children: headCell.isFetchingFilterOptions ? loadingSkeletons : /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(import_material61.Box, { className: classes.filterMenu, children: [
|
|
7427
7436
|
/* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.Box, { px: 3, mb: 0.5, children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
|
|
7428
7437
|
import_material61.FormControlLabel,
|
|
7429
7438
|
{
|
|
@@ -7687,46 +7696,29 @@ var Table_default = Table2;
|
|
|
7687
7696
|
var import_material64 = require("@mui/material");
|
|
7688
7697
|
var import_jsx_runtime115 = require("react/jsx-runtime");
|
|
7689
7698
|
var TableDesktopRowActions = ({
|
|
7690
|
-
rowRef,
|
|
7691
7699
|
isRowHovered,
|
|
7692
|
-
|
|
7693
|
-
|
|
7694
|
-
pt,
|
|
7695
|
-
pb,
|
|
7696
|
-
pr,
|
|
7697
|
-
pl,
|
|
7698
|
-
top = 0,
|
|
7699
|
-
right = 0,
|
|
7700
|
-
bottom = 0,
|
|
7701
|
-
left = 0,
|
|
7700
|
+
children,
|
|
7701
|
+
sx,
|
|
7702
7702
|
zIndex = 1,
|
|
7703
|
-
backgroundColor
|
|
7704
|
-
children
|
|
7703
|
+
backgroundColor
|
|
7705
7704
|
}) => {
|
|
7706
7705
|
return isRowHovered ? /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
7707
7706
|
import_material64.TableCell,
|
|
7708
7707
|
{
|
|
7709
|
-
ref: rowRef,
|
|
7710
7708
|
padding: "none",
|
|
7711
7709
|
sx: {
|
|
7712
|
-
top,
|
|
7713
|
-
right,
|
|
7714
|
-
bottom,
|
|
7715
|
-
left,
|
|
7710
|
+
top: 0,
|
|
7711
|
+
right: 0,
|
|
7716
7712
|
zIndex,
|
|
7717
7713
|
position: "sticky",
|
|
7718
7714
|
display: "flex",
|
|
7719
|
-
justifyContent: "flex-end"
|
|
7715
|
+
justifyContent: "flex-end",
|
|
7716
|
+
alignItems: "center"
|
|
7720
7717
|
},
|
|
7721
7718
|
children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
7722
7719
|
import_material64.Box,
|
|
7723
7720
|
{
|
|
7724
|
-
|
|
7725
|
-
py,
|
|
7726
|
-
pt,
|
|
7727
|
-
pb,
|
|
7728
|
-
pr,
|
|
7729
|
-
pl,
|
|
7721
|
+
sx,
|
|
7730
7722
|
display: "flex",
|
|
7731
7723
|
flexDirection: "row",
|
|
7732
7724
|
borderLeft: `1px solid ${colors.neutral300}`,
|
|
@@ -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,
|