@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.
@@ -571,7 +571,7 @@ declare const FilterSimpleSelector: ({ name, options, selectedOptions, setSelect
571
571
  type FilterOptionsCheckboxesProps = {
572
572
  columnId: string;
573
573
  labelFieldName: string;
574
- maxWidth?: number | string;
574
+ maxWidth?: number;
575
575
  filterOptions: HeaderFilterOptions;
576
576
  selectedFilterOptions: HeaderFilterOptions;
577
577
  onFilterOptionChange: (option: string | HeaderFilterObject) => void;
@@ -571,7 +571,7 @@ declare const FilterSimpleSelector: ({ name, options, selectedOptions, setSelect
571
571
  type FilterOptionsCheckboxesProps = {
572
572
  columnId: string;
573
573
  labelFieldName: string;
574
- maxWidth?: number | string;
574
+ maxWidth?: number;
575
575
  filterOptions: HeaderFilterOptions;
576
576
  selectedFilterOptions: HeaderFilterOptions;
577
577
  onFilterOptionChange: (option: string | HeaderFilterObject) => void;
@@ -458,7 +458,17 @@ var AppLabel = ({ appName }) => {
458
458
  var AppLabel_default = AppLabel;
459
459
 
460
460
  // src/components/AutocompleteFilterMenuContent/AutocompleteFilterMenuContent.tsx
461
- import { Box as Box7, Button as Button4, Divider, Tooltip as Tooltip4, Typography as Typography4 } from "@mui/material";
461
+ import CheckIcon2 from "@mui/icons-material/Check";
462
+ import { Box as Box7, Button as Button4, Chip as Chip2, Divider, Tooltip as Tooltip4, Typography as Typography4 } from "@mui/material";
463
+
464
+ // src/utils/resolveObjectType.ts
465
+ var resolveObjectType = (object, fieldName) => {
466
+ if (!object || typeof object !== "object") {
467
+ return object;
468
+ }
469
+ ;
470
+ return object[fieldName] ?? "";
471
+ };
462
472
 
463
473
  // src/components/Buttons/ExtendedButton/ExtendedButton.tsx
464
474
  import { memo as memo2 } from "react";
@@ -642,15 +652,6 @@ var ExtendedButton_default = memo2(ExtendedButton);
642
652
  import CheckIcon from "@mui/icons-material/Check";
643
653
  import { Box as Box5, Checkbox, Tooltip as Tooltip3 } from "@mui/material";
644
654
 
645
- // src/utils/resolveObjectType.ts
646
- var resolveObjectType = (object, fieldName) => {
647
- if (!object || typeof object !== "object") {
648
- return object;
649
- }
650
- ;
651
- return object[fieldName] ?? "";
652
- };
653
-
654
655
  // src/components/DynamicOverflowTooltip/DynamicOverflowTooltip.tsx
655
656
  import { useRef } from "react";
656
657
  import { Box as Box4, Tooltip as Tooltip2 } from "@mui/material";
@@ -739,11 +740,12 @@ var FilterOptionsCheckboxes = ({
739
740
  Box5,
740
741
  {
741
742
  sx: {
743
+ maxWidth,
744
+ gap: 2,
745
+ flexGrow: 1,
742
746
  display: "flex",
743
747
  alignItems: "center",
744
- justifyContent: "space-between",
745
- maxWidth,
746
- flexGrow: 1
748
+ justifyContent: "space-between"
747
749
  },
748
750
  children: [
749
751
  /* @__PURE__ */ jsx8(DynamicOverflowTooltip, { tooltipDescription: String(filterLabel), arrow: true, children: filterLabel }),
@@ -784,10 +786,11 @@ var SearchFieldDebounced = ({
784
786
  }
785
787
  ;
786
788
  debounceRef.current = window.setTimeout(() => {
787
- if (input.length < minCharacters) {
789
+ const trimmedInput = input.trim();
790
+ if (trimmedInput.length < minCharacters) {
788
791
  return;
789
792
  }
790
- onSearch(input);
793
+ onSearch(trimmedInput);
791
794
  }, debounceDelay);
792
795
  };
793
796
  useEffect2(() => {
@@ -825,6 +828,7 @@ var SearchFieldDebounced = ({
825
828
  // src/components/AutocompleteFilterMenuContent/AutocompleteFilterMenuContent.tsx
826
829
  import { Fragment, jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
827
830
  var MAX_HEIGHT = 500;
831
+ var MAX_WIDTH = 208;
828
832
  var AutocompleteFilterMenuContent = ({
829
833
  selectedFilterOptions,
830
834
  onFilterOptionChange,
@@ -875,17 +879,47 @@ var AutocompleteFilterMenuContent = ({
875
879
  },
876
880
  children: [
877
881
  selectedFilterOptions.length ? /* @__PURE__ */ jsxs6(Fragment, { children: [
878
- /* @__PURE__ */ jsx10(Box7, { sx: { px: 1, pt: 1 }, children: /* @__PURE__ */ jsx10(
879
- FilterOptionsCheckboxes,
882
+ /* @__PURE__ */ jsx10(
883
+ Box7,
880
884
  {
881
- columnId,
882
- labelFieldName,
883
- filterOptions: selectedFilterOptions,
884
- selectedFilterOptions,
885
- onFilterOptionChange,
886
- shouldShowCheckOnFilter
885
+ sx: {
886
+ px: 1,
887
+ pt: 1,
888
+ pb: 0.5,
889
+ gap: 1,
890
+ display: "flex",
891
+ flexDirection: "column"
892
+ },
893
+ children: selectedFilterOptions?.map((option) => {
894
+ const filterId = resolveObjectType(option, "id");
895
+ const filterLabel = resolveObjectType(option, labelFieldName);
896
+ return /* @__PURE__ */ jsxs6(
897
+ Box7,
898
+ {
899
+ sx: {
900
+ pl: 1,
901
+ pr: 1.25,
902
+ flexGrow: 1,
903
+ display: "flex",
904
+ alignItems: "center",
905
+ justifyContent: "space-between"
906
+ },
907
+ children: [
908
+ /* @__PURE__ */ jsx10(Box7, { sx: { maxWidth: MAX_WIDTH }, children: /* @__PURE__ */ jsx10(
909
+ Chip2,
910
+ {
911
+ label: filterLabel,
912
+ onDelete: () => onFilterOptionChange(option)
913
+ }
914
+ ) }),
915
+ shouldShowCheckOnFilter?.(columnId, option) ? /* @__PURE__ */ jsx10(Tooltip4, { title: "This filter is saved as default", children: /* @__PURE__ */ jsx10(CheckIcon2, { fontSize: "small", color: "action" }) }) : null
916
+ ]
917
+ },
918
+ filterId
919
+ );
920
+ })
887
921
  }
888
- ) }),
922
+ ),
889
923
  /* @__PURE__ */ jsx10(Divider, { sx: { my: 0.5 } })
890
924
  ] }) : null,
891
925
  /* @__PURE__ */ jsx10(Box7, { sx: { p: 1 }, children: !filterOptions?.length ? /* @__PURE__ */ jsx10(
@@ -900,6 +934,7 @@ var AutocompleteFilterMenuContent = ({
900
934
  FilterOptionsCheckboxes,
901
935
  {
902
936
  columnId,
937
+ maxWidth: MAX_WIDTH,
903
938
  labelFieldName,
904
939
  filterOptions,
905
940
  selectedFilterOptions,
@@ -4737,7 +4772,7 @@ function VirtualizedList(props) {
4737
4772
 
4738
4773
  // src/components/LocationsSectionInfo/LocationsSectionInfo.tsx
4739
4774
  import { Fragment as Fragment8 } from "react";
4740
- import { Box as Box22, Chip as Chip2, Typography as Typography16 } from "@mui/material";
4775
+ import { Box as Box22, Chip as Chip3, Typography as Typography16 } from "@mui/material";
4741
4776
  import { purple } from "@mui/material/colors";
4742
4777
  import classNames2 from "classnames";
4743
4778
  import { makeStyles as makeStyles29 } from "tss-react/mui";
@@ -4789,7 +4824,7 @@ var LocationsSectionInfo = ({
4789
4824
  };
4790
4825
  return /* @__PURE__ */ jsxs55(Box22, { className: classes.container, children: [
4791
4826
  /* @__PURE__ */ jsx91(
4792
- Chip2,
4827
+ Chip3,
4793
4828
  {
4794
4829
  className: classNames2(classes.defaultChip, {
4795
4830
  [classes.stockChip]: isStock,
@@ -6998,7 +7033,7 @@ import {
6998
7033
  } from "@mui/material";
6999
7034
  import classNames3 from "classnames";
7000
7035
  import { Fragment as Fragment12, jsx as jsx113, jsxs as jsxs76 } from "react/jsx-runtime";
7001
- var MAX_WIDTH = 272;
7036
+ var MAX_WIDTH2 = 276;
7002
7037
  var findFilterIndex = (filters, filterOption) => filters.findIndex((item) => {
7003
7038
  if (typeof item === "string" && typeof filterOption === "string") {
7004
7039
  return item === filterOption;
@@ -7070,7 +7105,7 @@ var SmartTableHeaderFilterMenu = memo20(({
7070
7105
  useEffect11(() => {
7071
7106
  setSelectedFilterOptions(headerFilters[headCell.id] ?? []);
7072
7107
  }, [headerFilters, headCell.id]);
7073
- const renderLoadingSkeletons = /* @__PURE__ */ jsxs76(Box32, { "data-testid": "loading-skeletons", sx: { width: MAX_WIDTH }, children: [
7108
+ const renderLoadingSkeletons = /* @__PURE__ */ jsxs76(Box32, { "data-testid": "loading-skeletons", sx: { width: MAX_WIDTH2 }, children: [
7074
7109
  /* @__PURE__ */ jsx113(Skeleton2, { variant: "rounded", height: 24, sx: { m: 1 } }),
7075
7110
  /* @__PURE__ */ jsx113(Divider11, {}),
7076
7111
  /* @__PURE__ */ jsx113(Skeleton2, { variant: "rounded", height: 24, sx: { m: 1 } }),
@@ -7134,7 +7169,7 @@ var SmartTableHeaderFilterMenu = memo20(({
7134
7169
  "data-testid": "filter-menu",
7135
7170
  slotProps: {
7136
7171
  list: {
7137
- sx: { p: 0, maxWidth: MAX_WIDTH }
7172
+ sx: { p: 0, maxWidth: MAX_WIDTH2 }
7138
7173
  }
7139
7174
  },
7140
7175
  anchorOrigin: { vertical: "bottom", horizontal: "right" },
@@ -8371,14 +8406,14 @@ var TableDesktopEditableField = memo23(TableDesktopEditableFieldComponent);
8371
8406
 
8372
8407
  // src/components/TableDesktopCell/TableDesktopCell.tsx
8373
8408
  import { useEffect as useEffect14, useState as useState22 } from "react";
8374
- import CheckIcon2 from "@mui/icons-material/Check";
8409
+ import CheckIcon3 from "@mui/icons-material/Check";
8375
8410
  import CloseIcon from "@mui/icons-material/Close";
8376
8411
  import EditIcon from "@mui/icons-material/Edit";
8377
8412
  import { IconButton as IconButton4, TableCell as TableCell6, Tooltip as Tooltip11 } from "@mui/material";
8378
8413
  import { Fragment as Fragment14, jsx as jsx128, jsxs as jsxs85 } from "react/jsx-runtime";
8379
8414
  var getReadOnlyBooleanIcon = (value) => {
8380
8415
  if (value) {
8381
- return /* @__PURE__ */ jsx128(CheckIcon2, { sx: { fontSize: 16 } });
8416
+ return /* @__PURE__ */ jsx128(CheckIcon3, { sx: { fontSize: 16 } });
8382
8417
  }
8383
8418
  return "-";
8384
8419
  };