sag_components 2.0.0-beta276 → 2.0.0-beta278

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.
package/dist/index.esm.js CHANGED
@@ -36110,15 +36110,19 @@ const ToggleInput = styled.input`
36110
36110
  const ToggleSlider = styled.span`
36111
36111
  display: block;
36112
36112
  position: relative;
36113
- background: ${({
36114
- checked,
36115
- disabled
36116
- }) => checked ? "#006d6a" : disabled ? "#B1B1B1" : "#D0D0D0"};
36113
+ background: ${_ref => {
36114
+ let {
36115
+ checked,
36116
+ disabled
36117
+ } = _ref;
36118
+ return checked ? "#006d6a" : disabled ? "#B1B1B1" : "#D0D0D0";
36119
+ }};
36117
36120
  border-radius: 999px;
36118
36121
  transition: background 0.2s;
36119
- ${({
36120
- size
36121
- }) => {
36122
+ ${_ref2 => {
36123
+ let {
36124
+ size
36125
+ } = _ref2;
36122
36126
  switch (size) {
36123
36127
  case "s":
36124
36128
  return css`width: 40px; height: 20px;`;
@@ -36134,14 +36138,18 @@ const ToggleSlider = styled.span`
36134
36138
  left: 3px;
36135
36139
  top: 50%;
36136
36140
  transform: translateY(-50%);
36137
- background: ${({
36138
- disabled
36139
- }) => disabled ? "#D0D0D0" : "#fff"};
36141
+ background: ${_ref3 => {
36142
+ let {
36143
+ disabled
36144
+ } = _ref3;
36145
+ return disabled ? "#D0D0D0" : "#fff";
36146
+ }};
36140
36147
  border-radius: 50%;
36141
36148
  transition: left 0.2s, width 0.2s, height 0.2s;
36142
- ${({
36143
- size
36144
- }) => {
36149
+ ${_ref4 => {
36150
+ let {
36151
+ size
36152
+ } = _ref4;
36145
36153
  switch (size) {
36146
36154
  case "s":
36147
36155
  return css`width: 14px; height: 14px;`;
@@ -36151,10 +36159,11 @@ const ToggleSlider = styled.span`
36151
36159
  return css`width: 20px; height: 20px;`;
36152
36160
  }
36153
36161
  }}
36154
- left: ${({
36155
- checked,
36156
- size
36157
- }) => {
36162
+ left: ${_ref5 => {
36163
+ let {
36164
+ checked,
36165
+ size
36166
+ } = _ref5;
36158
36167
  if (!checked) return "3px";
36159
36168
  switch (size) {
36160
36169
  case "s":
@@ -36168,9 +36177,9 @@ const ToggleSlider = styled.span`
36168
36177
  }
36169
36178
  `;
36170
36179
 
36171
- /**
36172
- * ToggleSwitch component for on/off states.
36173
- * Supports small/large sizes and disabled state.
36180
+ /**
36181
+ * ToggleSwitch component for on/off states.
36182
+ * Supports small/large sizes and disabled state.
36174
36183
  */
36175
36184
  function ToggleSwitch(_ref) {
36176
36185
  let {
@@ -37012,104 +37021,104 @@ const LoadingText = styled.span`
37012
37021
  const rotation = keyframes`
37013
37022
  0%, 100% {
37014
37023
  box-shadow:
37015
- 0px -8.32px 0px 0px #1F7677,
37016
- 5.76px -5.76px 0 0px rgba(31, 118, 119,0.2),
37017
- 8px 0px 0 0px rgba(31, 118, 119,0.2),
37018
- 5.6px 5.6px 0 0px rgba(31, 118, 119,0.2),
37019
- 0px 8px 0 0px rgba(31, 118, 119,0.2),
37020
- -5.76px 5.76px 0 0px rgba(31, 118, 119,0.2),
37021
- -8.32px 0px 0 0px rgba(31, 118, 119,0.5),
37022
- -5.76px -5.76px 0 0px rgba(31, 118, 119,0.7);
37024
+ 0px -16.64px 0px 0px #1F7677,
37025
+ 11.52px -11.52px 0 0px rgba(31, 118, 119,0.2),
37026
+ 16px 0px 0 0px rgba(31, 118, 119,0.2),
37027
+ 11.2px 11.2px 0 0px rgba(31, 118, 119,0.2),
37028
+ 0px 16px 0 0px rgba(31, 118, 119,0.2),
37029
+ -11.52px 11.52px 0 0px rgba(31, 118, 119,0.2),
37030
+ -16.64px 0px 0 0px rgba(31, 118, 119,0.5),
37031
+ -11.52px -11.52px 0 0px rgba(31, 118, 119,0.7);
37023
37032
  }
37024
37033
 
37025
37034
  12.5% {
37026
37035
  box-shadow:
37027
- 0px -8.32px 0px 0px rgba(31, 118, 119,0.7),
37028
- 5.76px -5.76px 0 0px #1F7677,
37029
- 8px 0px 0 0px rgba(31, 118, 119,0.2),
37030
- 5.6px 5.6px 0 0px rgba(31, 118, 119,0.2),
37031
- 0px 8px 0 0px rgba(31, 118, 119,0.2),
37032
- -5.76px 5.76px 0 0px rgba(31, 118, 119,0.2),
37033
- -8.32px 0px 0 0px rgba(31, 118, 119,0.2),
37034
- -5.76px -5.76px 0 0px rgba(31, 118, 119,0.5);
37036
+ 0px -16.64px 0px 0px rgba(31, 118, 119,0.7),
37037
+ 11.52px -11.52px 0 0px #1F7677,
37038
+ 16px 0px 0 0px rgba(31, 118, 119,0.2),
37039
+ 11.2px 11.2px 0 0px rgba(31, 118, 119,0.2),
37040
+ 0px 16px 0 0px rgba(31, 118, 119,0.2),
37041
+ -11.52px 11.52px 0 0px rgba(31, 118, 119,0.2),
37042
+ -16.64px 0px 0 0px rgba(31, 118, 119,0.2),
37043
+ -11.52px -11.52px 0 0px rgba(31, 118, 119,0.5);
37035
37044
  }
37036
37045
 
37037
37046
  25% {
37038
37047
  box-shadow:
37039
- 0px -8.32px 0px 0px rgba(31, 118, 119,0.5),
37040
- 5.76px -5.76px 0 0px rgba(31, 118, 119,0.7),
37041
- 8px 0px 0 0px #1F7677,
37042
- 5.6px 5.6px 0 0px rgba(31, 118, 119,0.2),
37043
- 0px 8px 0 0px rgba(31, 118, 119,0.2),
37044
- -5.76px 5.76px 0 0px rgba(31, 118, 119,0.2),
37045
- -8.32px 0px 0 0px rgba(31, 118, 119,0.2),
37046
- -5.76px -5.76px 0 0px rgba(31, 118, 119,0.2);
37048
+ 0px -16.64px 0px 0px rgba(31, 118, 119,0.5),
37049
+ 11.52px -11.52px 0 0px rgba(31, 118, 119,0.7),
37050
+ 16px 0px 0 0px #1F7677,
37051
+ 11.2px 11.2px 0 0px rgba(31, 118, 119,0.2),
37052
+ 0px 16px 0 0px rgba(31, 118, 119,0.2),
37053
+ -11.52px 11.52px 0 0px rgba(31, 118, 119,0.2),
37054
+ -16.64px 0px 0 0px rgba(31, 118, 119,0.2),
37055
+ -11.52px -11.52px 0 0px rgba(31, 118, 119,0.2);
37047
37056
  }
37048
37057
 
37049
37058
  37.5% {
37050
37059
  box-shadow:
37051
- 0px -8.32px 0px 0px rgba(31, 118, 119,0.2),
37052
- 5.76px -5.76px 0 0px rgba(31, 118, 119,0.5),
37053
- 8px 0px 0 0px rgba(31, 118, 119,0.7),
37054
- 5.6px 5.6px 0 0px #1F7677,
37055
- 0px 8px 0 0px rgba(31, 118, 119,0.2),
37056
- -5.76px 5.76px 0 0px rgba(31, 118, 119,0.2),
37057
- -8.32px 0px 0 0px rgba(31, 118, 119,0.2),
37058
- -5.76px -5.76px 0 0px rgba(31, 118, 119,0.2);
37060
+ 0px -16.64px 0px 0px rgba(31, 118, 119,0.2),
37061
+ 11.52px -11.52px 0 0px rgba(31, 118, 119,0.5),
37062
+ 16px 0px 0 0px rgba(31, 118, 119,0.7),
37063
+ 11.2px 11.2px 0 0px #1F7677,
37064
+ 0px 16px 0 0px rgba(31, 118, 119,0.2),
37065
+ -11.52px 11.52px 0 0px rgba(31, 118, 119,0.2),
37066
+ -16.64px 0px 0 0px rgba(31, 118, 119,0.2),
37067
+ -11.52px -11.52px 0 0px rgba(31, 118, 119,0.2);
37059
37068
  }
37060
37069
 
37061
37070
  50% {
37062
37071
  box-shadow:
37063
- 0px -8.32px 0px 0px rgba(31, 118, 119,0.2),
37064
- 5.76px -5.76px 0 0px rgba(31, 118, 119,0.2),
37065
- 8px 0px 0 0px rgba(31, 118, 119,0.5),
37066
- 5.6px 5.6px 0 0px rgba(31, 118, 119,0.7),
37067
- 0px 8px 0 0px #1F7677,
37068
- -5.76px 5.76px 0 0px rgba(31, 118, 119,0.2),
37069
- -8.32px 0px 0 0px rgba(31, 118, 119,0.2),
37070
- -5.76px -5.76px 0 0px rgba(31, 118, 119,0.2);
37072
+ 0px -16.64px 0px 0px rgba(31, 118, 119,0.2),
37073
+ 11.52px -11.52px 0 0px rgba(31, 118, 119,0.2),
37074
+ 16px 0px 0 0px rgba(31, 118, 119,0.5),
37075
+ 11.2px 11.2px 0 0px rgba(31, 118, 119,0.7),
37076
+ 0px 16px 0 0px #1F7677,
37077
+ -11.52px 11.52px 0 0px rgba(31, 118, 119,0.2),
37078
+ -16.64px 0px 0 0px rgba(31, 118, 119,0.2),
37079
+ -11.52px -11.52px 0 0px rgba(31, 118, 119,0.2);
37071
37080
  }
37072
37081
 
37073
37082
  62.5% {
37074
37083
  box-shadow:
37075
- 0px -8.32px 0px 0px rgba(31, 118, 119,0.2),
37076
- 5.76px -5.76px 0 0px rgba(31, 118, 119,0.2),
37077
- 8px 0px 0 0px rgba(31, 118, 119,0.2),
37078
- 5.6px 5.6px 0 0px rgba(31, 118, 119,0.5),
37079
- 0px 8px 0 0px rgba(31, 118, 119,0.7),
37080
- -5.76px 5.76px 0 0px #1F7677,
37081
- -8.32px 0px 0 0px rgba(31, 118, 119,0.2),
37082
- -5.76px -5.76px 0 0px rgba(31, 118, 119,0.2);
37084
+ 0px -16.64px 0px 0px rgba(31, 118, 119,0.2),
37085
+ 11.52px -11.52px 0 0px rgba(31, 118, 119,0.2),
37086
+ 16px 0px 0 0px rgba(31, 118, 119,0.2),
37087
+ 11.2px 11.2px 0 0px rgba(31, 118, 119,0.5),
37088
+ 0px 16px 0 0px rgba(31, 118, 119,0.7),
37089
+ -11.52px 11.52px 0 0px #1F7677,
37090
+ -16.64px 0px 0 0px rgba(31, 118, 119,0.2),
37091
+ -11.52px -11.52px 0 0px rgba(31, 118, 119,0.2);
37083
37092
  }
37084
37093
 
37085
37094
  75% {
37086
37095
  box-shadow:
37087
- 0px -8.32px 0px 0px rgba(31, 118, 119,0.2),
37088
- 5.76px -5.76px 0 0px rgba(31, 118, 119,0.2),
37089
- 8px 0px 0 0px rgba(31, 118, 119,0.2),
37090
- 5.6px 5.6px 0 0px rgba(31, 118, 119,0.2),
37091
- 0px 8px 0 0px rgba(31, 118, 119,0.5),
37092
- -5.76px 5.76px 0 0px rgba(31, 118, 119,0.7),
37093
- -8.32px 0px 0 0px #1F7677,
37094
- -5.76px -5.76px 0 0px rgba(31, 118, 119,0.2);
37096
+ 0px -16.64px 0px 0px rgba(31, 118, 119,0.2),
37097
+ 11.52px -11.52px 0 0px rgba(31, 118, 119,0.2),
37098
+ 16px 0px 0 0px rgba(31, 118, 119,0.2),
37099
+ 11.2px 11.2px 0 0px rgba(31, 118, 119,0.2),
37100
+ 0px 16px 0 0px rgba(31, 118, 119,0.5),
37101
+ -11.52px 11.52px 0 0px rgba(31, 118, 119,0.7),
37102
+ -16.64px 0px 0 0px #1F7677,
37103
+ -11.52px -11.52px 0 0px rgba(31, 118, 119,0.2);
37095
37104
  }
37096
37105
 
37097
37106
  87.5% {
37098
37107
  box-shadow:
37099
- 0px -8.32px 0px 0px rgba(31, 118, 119,0.2),
37100
- 5.76px -5.76px 0 0px rgba(31, 118, 119,0.2),
37101
- 8px 0px 0 0px rgba(31, 118, 119,0.2),
37102
- 5.6px 5.6px 0 0px rgba(31, 118, 119,0.2),
37103
- 0px 8px 0 0px rgba(31, 118, 119,0.2),
37104
- -5.76px 5.76px 0 0px rgba(31, 118, 119,0.5),
37105
- -8.32px 0px 0 0px rgba(31, 118, 119,0.7),
37106
- -5.76px -5.76px 0 0px #1F7677;
37108
+ 0px -16.64px 0px 0px rgba(31, 118, 119,0.2),
37109
+ 11.52px -11.52px 0 0px rgba(31, 118, 119,0.2),
37110
+ 16px 0px 0 0px rgba(31, 118, 119,0.2),
37111
+ 11.2px 11.2px 0 0px rgba(31, 118, 119,0.2),
37112
+ 0px 16px 0 0px rgba(31, 118, 119,0.2),
37113
+ -11.52px 11.52px 0 0px rgba(31, 118, 119,0.5),
37114
+ -16.64px 0px 0 0px rgba(31, 118, 119,0.7),
37115
+ -11.52px -11.52px 0 0px #1F7677;
37107
37116
  }
37108
37117
  `;
37109
37118
  const Loader = styled.span`
37110
- font-size: 10px;
37111
- width: 4px;
37112
- height: 4px;
37119
+ font-size: 30px;
37120
+ width: 8px;
37121
+ height: 8px;
37113
37122
  border-radius: 50%;
37114
37123
  position: relative;
37115
37124
  text-indent: -9999em;
@@ -40839,7 +40848,21 @@ const SortIcon = ({
40839
40848
  }));
40840
40849
  };
40841
40850
 
40842
- // TableHeader.jsx
40851
+ // TableHeader.jsx - Updated with debounce
40852
+
40853
+ // Inline debounce hook
40854
+ const useDebounce = (value, delay = 1500) => {
40855
+ const [debouncedValue, setDebouncedValue] = useState(value);
40856
+ useEffect(() => {
40857
+ const handler = setTimeout(() => {
40858
+ setDebouncedValue(value);
40859
+ }, delay);
40860
+ return () => {
40861
+ clearTimeout(handler);
40862
+ };
40863
+ }, [value, delay]);
40864
+ return debouncedValue;
40865
+ };
40843
40866
  const TableHeader = ({
40844
40867
  columns,
40845
40868
  onSort,
@@ -40850,7 +40873,8 @@ const TableHeader = ({
40850
40873
  expandable = false,
40851
40874
  onHeaderCheckboxClick = () => {},
40852
40875
  headerCheckboxStates = {},
40853
- resetFiltersKey = 0 // NEW: Add this prop
40876
+ resetFiltersKey = 0,
40877
+ debounceDelay = 500 // NEW: Add debounce delay prop (default 500ms)
40854
40878
  }) => {
40855
40879
  const [focusedFilter, setFocusedFilter] = useState(null);
40856
40880
  const [focusedSort, setFocusedSort] = useState(null);
@@ -40860,17 +40884,21 @@ const TableHeader = ({
40860
40884
  top: 0,
40861
40885
  left: 0
40862
40886
  });
40887
+
40888
+ // Internal state that updates immediately (for UI responsiveness)
40863
40889
  const [filterState, setFilterState] = useState({});
40864
40890
  const [filterSelections, setFilterSelections] = useState({});
40865
40891
  const [activeSortColumn, setActiveSortColumn] = useState(null);
40866
40892
  const [activeSortValue, setActiveSortValue] = useState(null);
40893
+
40894
+ // Debounced values (these will be passed to parent after delay)
40895
+ const debouncedFilterState = useDebounce(filterState, debounceDelay);
40867
40896
  const iconRefs = useRef({});
40868
40897
  const popupRef = useRef(null);
40869
40898
 
40870
- // NEW: Reset internal state when resetFiltersKey changes
40899
+ // Reset internal state when resetFiltersKey changes
40871
40900
  useEffect(() => {
40872
40901
  if (resetFiltersKey > 0) {
40873
- // Reset filter selections to default (all selected)
40874
40902
  const resetSelections = {};
40875
40903
  columns.forEach(column => {
40876
40904
  if (column.filter && column.filterOptions) {
@@ -40886,15 +40914,9 @@ const TableHeader = ({
40886
40914
  }
40887
40915
  });
40888
40916
  setFilterSelections(resetSelections);
40889
-
40890
- // Reset filter state
40891
40917
  setFilterState({});
40892
-
40893
- // Reset sort state
40894
40918
  setActiveSortColumn(null);
40895
40919
  setActiveSortValue(null);
40896
-
40897
- // Close any open popups
40898
40920
  setVisibleFilterPopWrapper(null);
40899
40921
  setVisibleSortPopWrapper(null);
40900
40922
  }
@@ -40937,6 +40959,14 @@ const TableHeader = ({
40937
40959
  return hasChanges ? newSelections : prevSelections;
40938
40960
  });
40939
40961
  }, [columns]);
40962
+
40963
+ // 🎯 KEY CHANGE: Use debounced value to trigger parent callback
40964
+ useEffect(() => {
40965
+ // Only call onFilter if there's actual filter data
40966
+ if (Object.keys(debouncedFilterState).length > 0) {
40967
+ onFilter(debouncedFilterState);
40968
+ }
40969
+ }, [debouncedFilterState, onFilter]);
40940
40970
  const isFilterInDefaultState = columnKey => {
40941
40971
  const filterData = filterState[columnKey];
40942
40972
  if (!filterData) {
@@ -41029,11 +41059,6 @@ const TableHeader = ({
41029
41059
  setVisibleSortPopWrapper(prevKey => prevKey === key ? null : key);
41030
41060
  setVisibleFilterPopWrapper(null);
41031
41061
  };
41032
- useEffect(() => {
41033
- if (Object.keys(filterState).length > 0) {
41034
- onFilter(filterState);
41035
- }
41036
- }, [filterState]);
41037
41062
  const handleFilter = key => {
41038
41063
  const iconElement = iconRefs.current[`filter-${key}`];
41039
41064
  if (iconElement) {
@@ -41063,6 +41088,9 @@ const TableHeader = ({
41063
41088
  onSort(columnKey, null);
41064
41089
  }
41065
41090
  };
41091
+
41092
+ // 🎯 Filter changes update immediately in UI (filterState)
41093
+ // But parent callback is triggered only after debounce
41066
41094
  const handleFilterSelectionChange = (columnKey, selectionData) => {
41067
41095
  setFilterSelections(prev => {
41068
41096
  const updated = {
@@ -41071,6 +41099,8 @@ const TableHeader = ({
41071
41099
  };
41072
41100
  return updated;
41073
41101
  });
41102
+
41103
+ // Update internal state immediately for responsive UI
41074
41104
  setFilterState(prev => ({
41075
41105
  ...prev,
41076
41106
  [columnKey]: selectionData.filterData
@@ -41207,6 +41237,7 @@ const TableHeader = ({
41207
41237
  placeholder: column.key === 'EventCode' ? 'Enter Event ID' : 'Search..',
41208
41238
  fieldHeight: "40px",
41209
41239
  onTyping: value => {
41240
+ // Update internal state immediately
41210
41241
  setFilterState(prev => ({
41211
41242
  ...prev,
41212
41243
  [key]: value
@@ -41241,6 +41272,7 @@ const TableHeader = ({
41241
41272
  fields: currentFilterState.fields
41242
41273
  } : null,
41243
41274
  onApply: data => {
41275
+ // Update internal state immediately
41244
41276
  setFilterState(prev => ({
41245
41277
  ...prev,
41246
41278
  [key]: data
@@ -47564,25 +47596,52 @@ styled.span`
47564
47596
  font-weight: 600;
47565
47597
  `;
47566
47598
 
47599
+ let FixedSizeList = null;
47600
+ try {
47601
+ FixedSizeList = require('react-window').FixedSizeList;
47602
+ } catch (e) {
47603
+ console.error('react-window not found:', e);
47604
+ }
47605
+ const VENDOR_ITEM_HEIGHT = 72;
47567
47606
  const NewItemList = ({
47568
47607
  onBack,
47569
47608
  onVendorClick,
47570
47609
  itemAndPackage
47571
47610
  }) => {
47572
- const [search, setSearch] = useState("");
47611
+ const [debouncedSearch, setDebouncedSearch] = useState("");
47573
47612
  const [headerHeight, setHeaderHeight] = useState(0);
47574
47613
  const headerRef = useRef(null);
47614
+ const searchInputRef = useRef(null);
47615
+ const timerRef = useRef(null);
47575
47616
  useEffect(() => {
47576
47617
  if (headerRef.current) {
47577
47618
  setHeaderHeight(headerRef.current.offsetHeight);
47578
47619
  }
47579
47620
  }, []);
47580
- const searchLower = search.toLowerCase();
47581
- const startsWithMatches = itemAndPackage.filter(i => i.name.toLowerCase().startsWith(searchLower));
47582
- const includesMatches = itemAndPackage.filter(i => !i.name.toLowerCase().startsWith(searchLower) && i.name.toLowerCase().includes(searchLower));
47583
- const filteredItems = [...startsWithMatches, ...includesMatches];
47584
-
47585
- // Helper to highlight matched portions
47621
+ const handleSearchChange = e => {
47622
+ const value = e.target.value;
47623
+ if (timerRef.current) {
47624
+ clearTimeout(timerRef.current);
47625
+ }
47626
+ timerRef.current = setTimeout(() => {
47627
+ setDebouncedSearch(value);
47628
+ }, 100);
47629
+ };
47630
+ const filteredItems = useMemo(() => {
47631
+ if (!debouncedSearch) return itemAndPackage;
47632
+ const searchLower = debouncedSearch.toLowerCase();
47633
+ const results = [];
47634
+ const startsWithResults = [];
47635
+ for (let i = 0; i < itemAndPackage.length; i++) {
47636
+ const nameLower = itemAndPackage[i].name.toLowerCase();
47637
+ if (nameLower.startsWith(searchLower)) {
47638
+ startsWithResults.push(itemAndPackage[i]);
47639
+ } else if (nameLower.includes(searchLower)) {
47640
+ results.push(itemAndPackage[i]);
47641
+ }
47642
+ }
47643
+ return [...startsWithResults, ...results];
47644
+ }, [debouncedSearch, itemAndPackage]);
47586
47645
  const highlightMatch = (text, query) => {
47587
47646
  if (!query) return text;
47588
47647
  const regex = new RegExp(`(${query})`, "ig");
@@ -47592,18 +47651,51 @@ const NewItemList = ({
47592
47651
  };
47593
47652
  const hasValidStatus = pkg => pkg.hasOwnProperty("status") && pkg.status != null && pkg.status !== undefined && pkg.status !== "";
47594
47653
  const draftPackages = pkg => pkg.status === 1;
47654
+ const VendorRow = ({
47655
+ index,
47656
+ style
47657
+ }) => {
47658
+ const item = filteredItems[index];
47659
+ let packagesLength = 0;
47660
+ let sentPackagesLength = 0;
47661
+ if (item.packages !== null) {
47662
+ packagesLength = item.packages.length;
47663
+ sentPackagesLength = item.packages.filter(pkg => hasValidStatus(pkg) && !draftPackages(pkg)).length;
47664
+ }
47665
+ return /*#__PURE__*/React$1.createElement("div", {
47666
+ style: style
47667
+ }, /*#__PURE__*/React$1.createElement(VendorItem, {
47668
+ onClick: e => {
47669
+ if (onVendorClick) {
47670
+ onVendorClick(item);
47671
+ }
47672
+ }
47673
+ }, /*#__PURE__*/React$1.createElement(VendorNameAndPackagesContainer, null, /*#__PURE__*/React$1.createElement(VendorName$1, null, highlightMatch(item.name, debouncedSearch.toLowerCase())), packagesLength > 0 && /*#__PURE__*/React$1.createElement(VendorPackages, null, (() => {
47674
+ const noPackagesSent = sentPackagesLength === 0;
47675
+ if (noPackagesSent) {
47676
+ return `0/${packagesLength} Packages Sent`;
47677
+ } else {
47678
+ return `${sentPackagesLength}/${packagesLength} Packages Sent`;
47679
+ }
47680
+ })())), /*#__PURE__*/React$1.createElement(VendorChevron, null, /*#__PURE__*/React$1.createElement(ArrowRightFullIcon, null))));
47681
+ };
47595
47682
  return /*#__PURE__*/React$1.createElement(VendorSelectionContainer, null, /*#__PURE__*/React$1.createElement(VendorHeader$1, {
47596
47683
  ref: headerRef
47597
47684
  }, /*#__PURE__*/React$1.createElement(VendorRoute, null, /*#__PURE__*/React$1.createElement(VendorBackButton, {
47598
47685
  onClick: onBack
47599
47686
  }, /*#__PURE__*/React$1.createElement(ArrowLeftIcon, null)), /*#__PURE__*/React$1.createElement(VendorBackTitle, null, "Selected Vendors")), /*#__PURE__*/React$1.createElement(VendorSelectionTitle, null, "Add New Vendor"), /*#__PURE__*/React$1.createElement(VendorSearch, {
47687
+ ref: searchInputRef,
47600
47688
  type: "search",
47601
47689
  placeholder: "Search",
47602
- value: search,
47603
- onChange: e => setSearch(e.target.value)
47604
- }), /*#__PURE__*/React$1.createElement(VendorSearchResult, null, search !== "" ? `${filteredItems.length === 0 ? "No" : filteredItems.length} Vendors Found` : " ")), /*#__PURE__*/React$1.createElement(VendorListWrapper$1, {
47690
+ onChange: handleSearchChange
47691
+ }), /*#__PURE__*/React$1.createElement(VendorSearchResult, null, debouncedSearch !== "" ? `${filteredItems.length === 0 ? "No" : filteredItems.length} Vendors Found` : " ")), /*#__PURE__*/React$1.createElement(VendorListWrapper$1, {
47605
47692
  headerHeight: headerHeight
47606
- }, /*#__PURE__*/React$1.createElement(VendorList$1, null, filteredItems.map((item, idx) => {
47693
+ }, FixedSizeList ? /*#__PURE__*/React$1.createElement(FixedSizeList, {
47694
+ height: window.innerHeight - headerHeight - 48,
47695
+ itemCount: filteredItems.length,
47696
+ itemSize: VENDOR_ITEM_HEIGHT,
47697
+ width: "100%"
47698
+ }, VendorRow) : /*#__PURE__*/React$1.createElement(VendorList$1, null, filteredItems.map((item, idx) => {
47607
47699
  let packagesLength = 0;
47608
47700
  let sentPackagesLength = 0;
47609
47701
  if (item.packages !== null) {
@@ -47613,12 +47705,11 @@ const NewItemList = ({
47613
47705
  return /*#__PURE__*/React$1.createElement(VendorItem, {
47614
47706
  key: idx,
47615
47707
  onClick: e => {
47616
- // Always call onVendorClick - it will handle the conversion from null to []
47617
47708
  if (onVendorClick) {
47618
47709
  onVendorClick(item);
47619
47710
  }
47620
47711
  }
47621
- }, /*#__PURE__*/React$1.createElement(VendorNameAndPackagesContainer, null, /*#__PURE__*/React$1.createElement(VendorName$1, null, highlightMatch(item.name, searchLower)), packagesLength > 0 && /*#__PURE__*/React$1.createElement(VendorPackages, null, (() => {
47712
+ }, /*#__PURE__*/React$1.createElement(VendorNameAndPackagesContainer, null, /*#__PURE__*/React$1.createElement(VendorName$1, null, highlightMatch(item.name, debouncedSearch.toLowerCase())), packagesLength > 0 && /*#__PURE__*/React$1.createElement(VendorPackages, null, (() => {
47622
47713
  const noPackagesSent = sentPackagesLength === 0;
47623
47714
  if (noPackagesSent) {
47624
47715
  return `0/${packagesLength} Packages Sent`;