@natoora-libs/core 0.1.18-dev-doug-1 → 0.1.18-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.
@@ -741,8 +741,18 @@ var AppLabel = ({ appName }) => {
741
741
  var AppLabel_default = AppLabel;
742
742
 
743
743
  // src/components/AutocompleteFilterMenuContent/AutocompleteFilterMenuContent.tsx
744
+ var import_Check2 = __toESM(require("@mui/icons-material/Check"), 1);
744
745
  var import_material9 = require("@mui/material");
745
746
 
747
+ // src/utils/resolveObjectType.ts
748
+ var resolveObjectType = (object, fieldName) => {
749
+ if (!object || typeof object !== "object") {
750
+ return object;
751
+ }
752
+ ;
753
+ return object[fieldName] ?? "";
754
+ };
755
+
746
756
  // src/components/Buttons/ExtendedButton/ExtendedButton.tsx
747
757
  var import_react2 = require("react");
748
758
  var import_icons_material2 = require("@mui/icons-material");
@@ -911,15 +921,6 @@ var ExtendedButton_default = (0, import_react2.memo)(ExtendedButton);
911
921
  var import_Check = __toESM(require("@mui/icons-material/Check"), 1);
912
922
  var import_material7 = require("@mui/material");
913
923
 
914
- // src/utils/resolveObjectType.ts
915
- var resolveObjectType = (object, fieldName) => {
916
- if (!object || typeof object !== "object") {
917
- return object;
918
- }
919
- ;
920
- return object[fieldName] ?? "";
921
- };
922
-
923
924
  // src/components/DynamicOverflowTooltip/DynamicOverflowTooltip.tsx
924
925
  var import_react4 = require("react");
925
926
  var import_material6 = require("@mui/material");
@@ -1008,11 +1009,12 @@ var FilterOptionsCheckboxes = ({
1008
1009
  import_material7.Box,
1009
1010
  {
1010
1011
  sx: {
1012
+ maxWidth,
1013
+ gap: 2,
1014
+ flexGrow: 1,
1011
1015
  display: "flex",
1012
1016
  alignItems: "center",
1013
- justifyContent: "space-between",
1014
- maxWidth,
1015
- flexGrow: 1
1017
+ justifyContent: "space-between"
1016
1018
  },
1017
1019
  children: [
1018
1020
  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DynamicOverflowTooltip, { tooltipDescription: String(filterLabel), arrow: true, children: filterLabel }),
@@ -1053,10 +1055,11 @@ var SearchFieldDebounced = ({
1053
1055
  }
1054
1056
  ;
1055
1057
  debounceRef.current = window.setTimeout(() => {
1056
- if (input.length < minCharacters) {
1058
+ const trimmedInput = input.trim();
1059
+ if (trimmedInput.length < minCharacters) {
1057
1060
  return;
1058
1061
  }
1059
- onSearch(input);
1062
+ onSearch(trimmedInput);
1060
1063
  }, debounceDelay);
1061
1064
  };
1062
1065
  (0, import_react5.useEffect)(() => {
@@ -1094,6 +1097,7 @@ var SearchFieldDebounced = ({
1094
1097
  // src/components/AutocompleteFilterMenuContent/AutocompleteFilterMenuContent.tsx
1095
1098
  var import_jsx_runtime10 = require("react/jsx-runtime");
1096
1099
  var MAX_HEIGHT = 500;
1100
+ var MAX_WIDTH = 208;
1097
1101
  var AutocompleteFilterMenuContent = ({
1098
1102
  selectedFilterOptions,
1099
1103
  onFilterOptionChange,
@@ -1144,17 +1148,47 @@ var AutocompleteFilterMenuContent = ({
1144
1148
  },
1145
1149
  children: [
1146
1150
  selectedFilterOptions.length ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
1147
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_material9.Box, { sx: { px: 1, pt: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1148
- FilterOptionsCheckboxes,
1151
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1152
+ import_material9.Box,
1149
1153
  {
1150
- columnId,
1151
- labelFieldName,
1152
- filterOptions: selectedFilterOptions,
1153
- selectedFilterOptions,
1154
- onFilterOptionChange,
1155
- shouldShowCheckOnFilter
1154
+ sx: {
1155
+ px: 1,
1156
+ pt: 1,
1157
+ pb: 0.5,
1158
+ gap: 1,
1159
+ display: "flex",
1160
+ flexDirection: "column"
1161
+ },
1162
+ children: selectedFilterOptions?.map((option) => {
1163
+ const filterId = resolveObjectType(option, "id");
1164
+ const filterLabel = resolveObjectType(option, labelFieldName);
1165
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
1166
+ import_material9.Box,
1167
+ {
1168
+ sx: {
1169
+ pl: 1,
1170
+ pr: 1.25,
1171
+ flexGrow: 1,
1172
+ display: "flex",
1173
+ alignItems: "center",
1174
+ justifyContent: "space-between"
1175
+ },
1176
+ children: [
1177
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_material9.Box, { sx: { maxWidth: MAX_WIDTH }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1178
+ import_material9.Chip,
1179
+ {
1180
+ label: filterLabel,
1181
+ onDelete: () => onFilterOptionChange(option)
1182
+ }
1183
+ ) }),
1184
+ shouldShowCheckOnFilter?.(columnId, option) ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_material9.Tooltip, { title: "This filter is saved as default", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_Check2.default, { fontSize: "small", color: "action" }) }) : null
1185
+ ]
1186
+ },
1187
+ filterId
1188
+ );
1189
+ })
1156
1190
  }
1157
- ) }),
1191
+ ),
1158
1192
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_material9.Divider, { sx: { my: 0.5 } })
1159
1193
  ] }) : null,
1160
1194
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_material9.Box, { sx: { p: 1 }, children: !filterOptions?.length ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
@@ -1169,6 +1203,7 @@ var AutocompleteFilterMenuContent = ({
1169
1203
  FilterOptionsCheckboxes,
1170
1204
  {
1171
1205
  columnId,
1206
+ maxWidth: MAX_WIDTH,
1172
1207
  labelFieldName,
1173
1208
  filterOptions,
1174
1209
  selectedFilterOptions,
@@ -7207,7 +7242,7 @@ var import_react34 = require("react");
7207
7242
  var import_material62 = require("@mui/material");
7208
7243
  var import_classnames3 = __toESM(require("classnames"), 1);
7209
7244
  var import_jsx_runtime114 = require("react/jsx-runtime");
7210
- var MAX_WIDTH = 272;
7245
+ var MAX_WIDTH2 = 276;
7211
7246
  var findFilterIndex = (filters, filterOption) => filters.findIndex((item) => {
7212
7247
  if (typeof item === "string" && typeof filterOption === "string") {
7213
7248
  return item === filterOption;
@@ -7279,7 +7314,7 @@ var SmartTableHeaderFilterMenu = (0, import_react34.memo)(({
7279
7314
  (0, import_react34.useEffect)(() => {
7280
7315
  setSelectedFilterOptions(headerFilters[headCell.id] ?? []);
7281
7316
  }, [headerFilters, headCell.id]);
7282
- const renderLoadingSkeletons = /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)(import_material62.Box, { "data-testid": "loading-skeletons", sx: { width: MAX_WIDTH }, children: [
7317
+ const renderLoadingSkeletons = /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)(import_material62.Box, { "data-testid": "loading-skeletons", sx: { width: MAX_WIDTH2 }, children: [
7283
7318
  /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material62.Skeleton, { variant: "rounded", height: 24, sx: { m: 1 } }),
7284
7319
  /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material62.Divider, {}),
7285
7320
  /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material62.Skeleton, { variant: "rounded", height: 24, sx: { m: 1 } }),
@@ -7343,7 +7378,7 @@ var SmartTableHeaderFilterMenu = (0, import_react34.memo)(({
7343
7378
  "data-testid": "filter-menu",
7344
7379
  slotProps: {
7345
7380
  list: {
7346
- sx: { p: 0, maxWidth: MAX_WIDTH }
7381
+ sx: { p: 0, maxWidth: MAX_WIDTH2 }
7347
7382
  }
7348
7383
  },
7349
7384
  anchorOrigin: { vertical: "bottom", horizontal: "right" },
@@ -8551,14 +8586,14 @@ var TableDesktopEditableField = (0, import_react41.memo)(TableDesktopEditableFie
8551
8586
 
8552
8587
  // src/components/TableDesktopCell/TableDesktopCell.tsx
8553
8588
  var import_react42 = require("react");
8554
- var import_Check2 = __toESM(require("@mui/icons-material/Check"), 1);
8589
+ var import_Check3 = __toESM(require("@mui/icons-material/Check"), 1);
8555
8590
  var import_Close = __toESM(require("@mui/icons-material/Close"), 1);
8556
8591
  var import_Edit = __toESM(require("@mui/icons-material/Edit"), 1);
8557
8592
  var import_material75 = require("@mui/material");
8558
8593
  var import_jsx_runtime130 = require("react/jsx-runtime");
8559
8594
  var getReadOnlyBooleanIcon = (value) => {
8560
8595
  if (value) {
8561
- return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_Check2.default, { sx: { fontSize: 16 } });
8596
+ return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_Check3.default, { sx: { fontSize: 16 } });
8562
8597
  }
8563
8598
  return "-";
8564
8599
  };