@natoora-libs/core 0.1.18-dev-doug-2 → 0.1.18-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.
@@ -945,6 +945,7 @@ var useCheckOverflow = ({
945
945
  var import_jsx_runtime7 = require("react/jsx-runtime");
946
946
  var DynamicOverflowTooltip = ({
947
947
  arrow = false,
948
+ maxWidth = "auto",
948
949
  children,
949
950
  tooltipDescription
950
951
  }) => {
@@ -960,6 +961,7 @@ var DynamicOverflowTooltip = ({
960
961
  {
961
962
  ref,
962
963
  sx: {
964
+ maxWidth,
963
965
  overflowX: "hidden",
964
966
  whiteSpace: "nowrap",
965
967
  textOverflow: "ellipsis"
@@ -1096,20 +1098,40 @@ var SearchFieldDebounced = ({
1096
1098
 
1097
1099
  // src/components/AutocompleteFilterMenuContent/AutocompleteFilterMenuContent.tsx
1098
1100
  var import_jsx_runtime10 = require("react/jsx-runtime");
1099
- var MAX_HEIGHT = 500;
1100
- var MAX_WIDTH = 208;
1101
1101
  var AutocompleteFilterMenuContent = ({
1102
+ columnId,
1103
+ labelFieldName,
1102
1104
  selectedFilterOptions,
1105
+ isLoading = false,
1106
+ maxWidth = 208,
1107
+ maxHeight = 500,
1103
1108
  onFilterOptionChange,
1104
1109
  onApplyFiltersClick,
1105
1110
  shouldShowCheckOnFilter,
1106
- headCell: {
1107
- onAutocompleteFilterChange,
1108
- filterOptions,
1109
- fieldName: labelFieldName = "",
1110
- id: columnId
1111
- }
1111
+ onAutocompleteFilterChange,
1112
+ filterOptions
1112
1113
  }) => {
1114
+ const renderLoading = () => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_material9.Skeleton, { variant: "rounded", height: 26, sx: { m: 1 } });
1115
+ const renderOptions = () => filterOptions?.length ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1116
+ FilterOptionsCheckboxes,
1117
+ {
1118
+ columnId,
1119
+ maxWidth,
1120
+ labelFieldName,
1121
+ filterOptions,
1122
+ selectedFilterOptions,
1123
+ onFilterOptionChange,
1124
+ shouldShowCheckOnFilter
1125
+ }
1126
+ ) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1127
+ import_material9.Typography,
1128
+ {
1129
+ variant: "body2",
1130
+ color: "textSecondary",
1131
+ sx: { p: 1, maxWidth: 260 },
1132
+ children: "Start searching (minimum 3 characters) to view the results."
1133
+ }
1134
+ );
1113
1135
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_material9.Box, { sx: { display: "flex", flexDirection: "column" }, children: [
1114
1136
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1115
1137
  SearchFieldDebounced,
@@ -1127,9 +1149,9 @@ var AutocompleteFilterMenuContent = ({
1127
1149
  import_material9.Box,
1128
1150
  {
1129
1151
  sx: {
1152
+ maxHeight,
1130
1153
  display: "flex",
1131
1154
  flexDirection: "column",
1132
- maxHeight: MAX_HEIGHT,
1133
1155
  overflowX: "hidden",
1134
1156
  "&::-webkit-scrollbar": {
1135
1157
  width: "8px",
@@ -1174,9 +1196,10 @@ var AutocompleteFilterMenuContent = ({
1174
1196
  justifyContent: "space-between"
1175
1197
  },
1176
1198
  children: [
1177
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_material9.Box, { sx: { maxWidth: MAX_WIDTH }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1199
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_material9.Box, { sx: { maxWidth }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1178
1200
  import_material9.Chip,
1179
1201
  {
1202
+ size: "small",
1180
1203
  label: filterLabel,
1181
1204
  onDelete: () => onFilterOptionChange(option)
1182
1205
  }
@@ -1191,26 +1214,7 @@ var AutocompleteFilterMenuContent = ({
1191
1214
  ),
1192
1215
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_material9.Divider, { sx: { my: 0.5 } })
1193
1216
  ] }) : null,
1194
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_material9.Box, { sx: { p: 1 }, children: !filterOptions?.length ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1195
- import_material9.Typography,
1196
- {
1197
- variant: "body2",
1198
- color: "textSecondary",
1199
- sx: { p: 1, maxWidth: 260 },
1200
- children: "Start searching (minimum 3 characters) to view the results."
1201
- }
1202
- ) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1203
- FilterOptionsCheckboxes,
1204
- {
1205
- columnId,
1206
- maxWidth: MAX_WIDTH,
1207
- labelFieldName,
1208
- filterOptions,
1209
- selectedFilterOptions,
1210
- onFilterOptionChange,
1211
- shouldShowCheckOnFilter
1212
- }
1213
- ) })
1217
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_material9.Box, { sx: { p: 1 }, children: isLoading ? renderLoading() : renderOptions() })
1214
1218
  ]
1215
1219
  }
1216
1220
  ),
@@ -3451,20 +3455,30 @@ function ActionButton(props) {
3451
3455
  // src/components/CheckboxFilterMenuContent/CheckboxFilterMenuContent.tsx
3452
3456
  var import_material22 = require("@mui/material");
3453
3457
  var import_jsx_runtime71 = require("react/jsx-runtime");
3454
- var MAX_HEIGHT2 = 500;
3455
3458
  var CheckboxFilterMenuContent = ({
3459
+ columnId,
3460
+ labelFieldName,
3461
+ isLoading = false,
3456
3462
  selectedFilterOptions,
3457
3463
  filterOptions,
3464
+ maxHeight = 500,
3465
+ width = 276,
3458
3466
  shouldShowCheckOnFilter,
3459
3467
  onSelectAllChange,
3460
3468
  onFilterOptionChange,
3461
- onApplyFiltersClick,
3462
- headCell: {
3463
- id: columnId,
3464
- fieldName: labelFieldName = ""
3465
- }
3469
+ onApplyFiltersClick
3466
3470
  }) => {
3467
- return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(import_material22.Box, { sx: { display: "flex", flexDirection: "column" }, children: [
3471
+ const renderLoading = () => /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(import_material22.Box, { "data-testid": "loading-skeletons", sx: { width }, children: [
3472
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_material22.Skeleton, { variant: "rounded", height: 24, sx: { m: 1 } }),
3473
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_material22.Divider, {}),
3474
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_material22.Skeleton, { variant: "rounded", height: 24, sx: { m: 1 } }),
3475
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_material22.Skeleton, { variant: "rounded", height: 24, sx: { m: 1 } }),
3476
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_material22.Skeleton, { variant: "rounded", height: 24, sx: { m: 1 } }),
3477
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_material22.Skeleton, { variant: "rounded", height: 24, sx: { m: 1 } }),
3478
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_material22.Divider, {}),
3479
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_material22.Skeleton, { variant: "rounded", height: 24, sx: { m: 1 } })
3480
+ ] });
3481
+ const renderContent = () => /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(import_material22.Box, { sx: { display: "flex", flexDirection: "column" }, children: [
3468
3482
  /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_material22.Box, { sx: { px: 2, pt: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
3469
3483
  import_material22.FormControlLabel,
3470
3484
  {
@@ -3509,17 +3523,9 @@ var CheckboxFilterMenuContent = ({
3509
3523
  sx: {
3510
3524
  pl: 0.5,
3511
3525
  pr: 2,
3512
- maxHeight: MAX_HEIGHT2
3526
+ maxHeight
3513
3527
  },
3514
- children: !filterOptions?.length ? /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
3515
- import_material22.Typography,
3516
- {
3517
- variant: "body2",
3518
- color: "textSecondary",
3519
- sx: { py: 1, px: 2 },
3520
- children: "No options available."
3521
- }
3522
- ) : /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
3528
+ children: filterOptions?.length ? /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
3523
3529
  FilterOptionsCheckboxes,
3524
3530
  {
3525
3531
  columnId,
@@ -3529,6 +3535,14 @@ var CheckboxFilterMenuContent = ({
3529
3535
  onFilterOptionChange,
3530
3536
  shouldShowCheckOnFilter
3531
3537
  }
3538
+ ) : /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
3539
+ import_material22.Typography,
3540
+ {
3541
+ variant: "body2",
3542
+ color: "textSecondary",
3543
+ sx: { py: 1, px: 2 },
3544
+ children: "No options available."
3545
+ }
3532
3546
  )
3533
3547
  }
3534
3548
  )
@@ -3569,6 +3583,10 @@ var CheckboxFilterMenuContent = ({
3569
3583
  }
3570
3584
  )
3571
3585
  ] });
3586
+ if (isLoading) {
3587
+ return renderLoading();
3588
+ }
3589
+ return renderContent();
3572
3590
  };
3573
3591
 
3574
3592
  // src/components/CompanyLogo/CompanyLogo.tsx
@@ -7242,7 +7260,7 @@ var import_react34 = require("react");
7242
7260
  var import_material62 = require("@mui/material");
7243
7261
  var import_classnames3 = __toESM(require("classnames"), 1);
7244
7262
  var import_jsx_runtime114 = require("react/jsx-runtime");
7245
- var MAX_WIDTH2 = 276;
7263
+ var MAX_WIDTH = 276;
7246
7264
  var findFilterIndex = (filters, filterOption) => filters.findIndex((item) => {
7247
7265
  if (typeof item === "string" && typeof filterOption === "string") {
7248
7266
  return item === filterOption;
@@ -7314,50 +7332,6 @@ var SmartTableHeaderFilterMenu = (0, import_react34.memo)(({
7314
7332
  (0, import_react34.useEffect)(() => {
7315
7333
  setSelectedFilterOptions(headerFilters[headCell.id] ?? []);
7316
7334
  }, [headerFilters, headCell.id]);
7317
- const renderLoadingSkeletons = /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)(import_material62.Box, { "data-testid": "loading-skeletons", sx: { width: MAX_WIDTH2 }, children: [
7318
- /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material62.Skeleton, { variant: "rounded", height: 24, sx: { m: 1 } }),
7319
- /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material62.Divider, {}),
7320
- /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material62.Skeleton, { variant: "rounded", height: 24, sx: { m: 1 } }),
7321
- /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material62.Skeleton, { variant: "rounded", height: 24, sx: { m: 1 } }),
7322
- /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material62.Skeleton, { variant: "rounded", height: 24, sx: { m: 1 } }),
7323
- /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material62.Skeleton, { variant: "rounded", height: 24, sx: { m: 1 } }),
7324
- /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material62.Divider, {}),
7325
- /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material62.Skeleton, { variant: "rounded", height: 24, sx: { m: 1 } })
7326
- ] });
7327
- const renderMenuContent = (0, import_react34.useMemo)(() => {
7328
- if (headCell.isAutocompleteFilterMenu) {
7329
- return /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
7330
- AutocompleteFilterMenuContent,
7331
- {
7332
- headCell,
7333
- selectedFilterOptions,
7334
- onFilterOptionChange: handleFilterOptionChange,
7335
- onApplyFiltersClick: handleApplyFiltersClick,
7336
- shouldShowCheckOnFilter
7337
- }
7338
- );
7339
- }
7340
- return /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
7341
- CheckboxFilterMenuContent,
7342
- {
7343
- headCell,
7344
- selectedFilterOptions,
7345
- filterOptions: filterOptionsData ?? [],
7346
- onSelectAllChange: handleSelectAllChange,
7347
- onFilterOptionChange: handleFilterOptionChange,
7348
- onApplyFiltersClick: handleApplyFiltersClick,
7349
- shouldShowCheckOnFilter
7350
- }
7351
- );
7352
- }, [
7353
- headCell,
7354
- selectedFilterOptions,
7355
- handleFilterOptionChange,
7356
- handleApplyFiltersClick,
7357
- shouldShowCheckOnFilter,
7358
- filterOptionsData,
7359
- handleSelectAllChange
7360
- ]);
7361
7335
  return /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)(import_jsx_runtime114.Fragment, { children: [
7362
7336
  /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
7363
7337
  ActiveFiltersIconButton,
@@ -7378,12 +7352,38 @@ var SmartTableHeaderFilterMenu = (0, import_react34.memo)(({
7378
7352
  "data-testid": "filter-menu",
7379
7353
  slotProps: {
7380
7354
  list: {
7381
- sx: { p: 0, maxWidth: MAX_WIDTH2 }
7355
+ sx: { p: 0, maxWidth: MAX_WIDTH }
7382
7356
  }
7383
7357
  },
7384
7358
  anchorOrigin: { vertical: "bottom", horizontal: "right" },
7385
7359
  transformOrigin: { vertical: "top", horizontal: "right" },
7386
- children: headCell.isFetchingFilterOptions ? renderLoadingSkeletons : renderMenuContent
7360
+ children: headCell.isAutocompleteFilterMenu ? /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
7361
+ AutocompleteFilterMenuContent,
7362
+ {
7363
+ columnId: headCell.id,
7364
+ labelFieldName: headCell.fieldName ?? "",
7365
+ isLoading: headCell.isFetchingFilterOptions,
7366
+ filterOptions: headCell.filterOptions,
7367
+ onAutocompleteFilterChange: headCell.onAutocompleteFilterChange,
7368
+ selectedFilterOptions,
7369
+ onFilterOptionChange: handleFilterOptionChange,
7370
+ onApplyFiltersClick: handleApplyFiltersClick,
7371
+ shouldShowCheckOnFilter
7372
+ }
7373
+ ) : /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
7374
+ CheckboxFilterMenuContent,
7375
+ {
7376
+ columnId: headCell.id,
7377
+ labelFieldName: headCell.fieldName ?? "",
7378
+ isLoading: headCell.isFetchingFilterOptions,
7379
+ selectedFilterOptions,
7380
+ filterOptions: filterOptionsData ?? [],
7381
+ onSelectAllChange: handleSelectAllChange,
7382
+ onFilterOptionChange: handleFilterOptionChange,
7383
+ onApplyFiltersClick: handleApplyFiltersClick,
7384
+ shouldShowCheckOnFilter
7385
+ }
7386
+ )
7387
7387
  }
7388
7388
  )
7389
7389
  ] });