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.js CHANGED
@@ -36120,15 +36120,19 @@ const ToggleInput = styled__default["default"].input`
36120
36120
  const ToggleSlider = styled__default["default"].span`
36121
36121
  display: block;
36122
36122
  position: relative;
36123
- background: ${({
36124
- checked,
36125
- disabled
36126
- }) => checked ? "#006d6a" : disabled ? "#B1B1B1" : "#D0D0D0"};
36123
+ background: ${_ref => {
36124
+ let {
36125
+ checked,
36126
+ disabled
36127
+ } = _ref;
36128
+ return checked ? "#006d6a" : disabled ? "#B1B1B1" : "#D0D0D0";
36129
+ }};
36127
36130
  border-radius: 999px;
36128
36131
  transition: background 0.2s;
36129
- ${({
36130
- size
36131
- }) => {
36132
+ ${_ref2 => {
36133
+ let {
36134
+ size
36135
+ } = _ref2;
36132
36136
  switch (size) {
36133
36137
  case "s":
36134
36138
  return styled.css`width: 40px; height: 20px;`;
@@ -36144,14 +36148,18 @@ const ToggleSlider = styled__default["default"].span`
36144
36148
  left: 3px;
36145
36149
  top: 50%;
36146
36150
  transform: translateY(-50%);
36147
- background: ${({
36148
- disabled
36149
- }) => disabled ? "#D0D0D0" : "#fff"};
36151
+ background: ${_ref3 => {
36152
+ let {
36153
+ disabled
36154
+ } = _ref3;
36155
+ return disabled ? "#D0D0D0" : "#fff";
36156
+ }};
36150
36157
  border-radius: 50%;
36151
36158
  transition: left 0.2s, width 0.2s, height 0.2s;
36152
- ${({
36153
- size
36154
- }) => {
36159
+ ${_ref4 => {
36160
+ let {
36161
+ size
36162
+ } = _ref4;
36155
36163
  switch (size) {
36156
36164
  case "s":
36157
36165
  return styled.css`width: 14px; height: 14px;`;
@@ -36161,10 +36169,11 @@ const ToggleSlider = styled__default["default"].span`
36161
36169
  return styled.css`width: 20px; height: 20px;`;
36162
36170
  }
36163
36171
  }}
36164
- left: ${({
36165
- checked,
36166
- size
36167
- }) => {
36172
+ left: ${_ref5 => {
36173
+ let {
36174
+ checked,
36175
+ size
36176
+ } = _ref5;
36168
36177
  if (!checked) return "3px";
36169
36178
  switch (size) {
36170
36179
  case "s":
@@ -36178,9 +36187,9 @@ const ToggleSlider = styled__default["default"].span`
36178
36187
  }
36179
36188
  `;
36180
36189
 
36181
- /**
36182
- * ToggleSwitch component for on/off states.
36183
- * Supports small/large sizes and disabled state.
36190
+ /**
36191
+ * ToggleSwitch component for on/off states.
36192
+ * Supports small/large sizes and disabled state.
36184
36193
  */
36185
36194
  function ToggleSwitch(_ref) {
36186
36195
  let {
@@ -37022,104 +37031,104 @@ const LoadingText = styled__default["default"].span`
37022
37031
  const rotation = styled.keyframes`
37023
37032
  0%, 100% {
37024
37033
  box-shadow:
37025
- 0px -8.32px 0px 0px #1F7677,
37026
- 5.76px -5.76px 0 0px rgba(31, 118, 119,0.2),
37027
- 8px 0px 0 0px rgba(31, 118, 119,0.2),
37028
- 5.6px 5.6px 0 0px rgba(31, 118, 119,0.2),
37029
- 0px 8px 0 0px rgba(31, 118, 119,0.2),
37030
- -5.76px 5.76px 0 0px rgba(31, 118, 119,0.2),
37031
- -8.32px 0px 0 0px rgba(31, 118, 119,0.5),
37032
- -5.76px -5.76px 0 0px rgba(31, 118, 119,0.7);
37034
+ 0px -16.64px 0px 0px #1F7677,
37035
+ 11.52px -11.52px 0 0px rgba(31, 118, 119,0.2),
37036
+ 16px 0px 0 0px rgba(31, 118, 119,0.2),
37037
+ 11.2px 11.2px 0 0px rgba(31, 118, 119,0.2),
37038
+ 0px 16px 0 0px rgba(31, 118, 119,0.2),
37039
+ -11.52px 11.52px 0 0px rgba(31, 118, 119,0.2),
37040
+ -16.64px 0px 0 0px rgba(31, 118, 119,0.5),
37041
+ -11.52px -11.52px 0 0px rgba(31, 118, 119,0.7);
37033
37042
  }
37034
37043
 
37035
37044
  12.5% {
37036
37045
  box-shadow:
37037
- 0px -8.32px 0px 0px rgba(31, 118, 119,0.7),
37038
- 5.76px -5.76px 0 0px #1F7677,
37039
- 8px 0px 0 0px rgba(31, 118, 119,0.2),
37040
- 5.6px 5.6px 0 0px rgba(31, 118, 119,0.2),
37041
- 0px 8px 0 0px rgba(31, 118, 119,0.2),
37042
- -5.76px 5.76px 0 0px rgba(31, 118, 119,0.2),
37043
- -8.32px 0px 0 0px rgba(31, 118, 119,0.2),
37044
- -5.76px -5.76px 0 0px rgba(31, 118, 119,0.5);
37046
+ 0px -16.64px 0px 0px rgba(31, 118, 119,0.7),
37047
+ 11.52px -11.52px 0 0px #1F7677,
37048
+ 16px 0px 0 0px rgba(31, 118, 119,0.2),
37049
+ 11.2px 11.2px 0 0px rgba(31, 118, 119,0.2),
37050
+ 0px 16px 0 0px rgba(31, 118, 119,0.2),
37051
+ -11.52px 11.52px 0 0px rgba(31, 118, 119,0.2),
37052
+ -16.64px 0px 0 0px rgba(31, 118, 119,0.2),
37053
+ -11.52px -11.52px 0 0px rgba(31, 118, 119,0.5);
37045
37054
  }
37046
37055
 
37047
37056
  25% {
37048
37057
  box-shadow:
37049
- 0px -8.32px 0px 0px rgba(31, 118, 119,0.5),
37050
- 5.76px -5.76px 0 0px rgba(31, 118, 119,0.7),
37051
- 8px 0px 0 0px #1F7677,
37052
- 5.6px 5.6px 0 0px rgba(31, 118, 119,0.2),
37053
- 0px 8px 0 0px rgba(31, 118, 119,0.2),
37054
- -5.76px 5.76px 0 0px rgba(31, 118, 119,0.2),
37055
- -8.32px 0px 0 0px rgba(31, 118, 119,0.2),
37056
- -5.76px -5.76px 0 0px rgba(31, 118, 119,0.2);
37058
+ 0px -16.64px 0px 0px rgba(31, 118, 119,0.5),
37059
+ 11.52px -11.52px 0 0px rgba(31, 118, 119,0.7),
37060
+ 16px 0px 0 0px #1F7677,
37061
+ 11.2px 11.2px 0 0px rgba(31, 118, 119,0.2),
37062
+ 0px 16px 0 0px rgba(31, 118, 119,0.2),
37063
+ -11.52px 11.52px 0 0px rgba(31, 118, 119,0.2),
37064
+ -16.64px 0px 0 0px rgba(31, 118, 119,0.2),
37065
+ -11.52px -11.52px 0 0px rgba(31, 118, 119,0.2);
37057
37066
  }
37058
37067
 
37059
37068
  37.5% {
37060
37069
  box-shadow:
37061
- 0px -8.32px 0px 0px rgba(31, 118, 119,0.2),
37062
- 5.76px -5.76px 0 0px rgba(31, 118, 119,0.5),
37063
- 8px 0px 0 0px rgba(31, 118, 119,0.7),
37064
- 5.6px 5.6px 0 0px #1F7677,
37065
- 0px 8px 0 0px rgba(31, 118, 119,0.2),
37066
- -5.76px 5.76px 0 0px rgba(31, 118, 119,0.2),
37067
- -8.32px 0px 0 0px rgba(31, 118, 119,0.2),
37068
- -5.76px -5.76px 0 0px rgba(31, 118, 119,0.2);
37070
+ 0px -16.64px 0px 0px rgba(31, 118, 119,0.2),
37071
+ 11.52px -11.52px 0 0px rgba(31, 118, 119,0.5),
37072
+ 16px 0px 0 0px rgba(31, 118, 119,0.7),
37073
+ 11.2px 11.2px 0 0px #1F7677,
37074
+ 0px 16px 0 0px rgba(31, 118, 119,0.2),
37075
+ -11.52px 11.52px 0 0px rgba(31, 118, 119,0.2),
37076
+ -16.64px 0px 0 0px rgba(31, 118, 119,0.2),
37077
+ -11.52px -11.52px 0 0px rgba(31, 118, 119,0.2);
37069
37078
  }
37070
37079
 
37071
37080
  50% {
37072
37081
  box-shadow:
37073
- 0px -8.32px 0px 0px rgba(31, 118, 119,0.2),
37074
- 5.76px -5.76px 0 0px rgba(31, 118, 119,0.2),
37075
- 8px 0px 0 0px rgba(31, 118, 119,0.5),
37076
- 5.6px 5.6px 0 0px rgba(31, 118, 119,0.7),
37077
- 0px 8px 0 0px #1F7677,
37078
- -5.76px 5.76px 0 0px rgba(31, 118, 119,0.2),
37079
- -8.32px 0px 0 0px rgba(31, 118, 119,0.2),
37080
- -5.76px -5.76px 0 0px rgba(31, 118, 119,0.2);
37082
+ 0px -16.64px 0px 0px rgba(31, 118, 119,0.2),
37083
+ 11.52px -11.52px 0 0px rgba(31, 118, 119,0.2),
37084
+ 16px 0px 0 0px rgba(31, 118, 119,0.5),
37085
+ 11.2px 11.2px 0 0px rgba(31, 118, 119,0.7),
37086
+ 0px 16px 0 0px #1F7677,
37087
+ -11.52px 11.52px 0 0px rgba(31, 118, 119,0.2),
37088
+ -16.64px 0px 0 0px rgba(31, 118, 119,0.2),
37089
+ -11.52px -11.52px 0 0px rgba(31, 118, 119,0.2);
37081
37090
  }
37082
37091
 
37083
37092
  62.5% {
37084
37093
  box-shadow:
37085
- 0px -8.32px 0px 0px rgba(31, 118, 119,0.2),
37086
- 5.76px -5.76px 0 0px rgba(31, 118, 119,0.2),
37087
- 8px 0px 0 0px rgba(31, 118, 119,0.2),
37088
- 5.6px 5.6px 0 0px rgba(31, 118, 119,0.5),
37089
- 0px 8px 0 0px rgba(31, 118, 119,0.7),
37090
- -5.76px 5.76px 0 0px #1F7677,
37091
- -8.32px 0px 0 0px rgba(31, 118, 119,0.2),
37092
- -5.76px -5.76px 0 0px rgba(31, 118, 119,0.2);
37094
+ 0px -16.64px 0px 0px rgba(31, 118, 119,0.2),
37095
+ 11.52px -11.52px 0 0px rgba(31, 118, 119,0.2),
37096
+ 16px 0px 0 0px rgba(31, 118, 119,0.2),
37097
+ 11.2px 11.2px 0 0px rgba(31, 118, 119,0.5),
37098
+ 0px 16px 0 0px rgba(31, 118, 119,0.7),
37099
+ -11.52px 11.52px 0 0px #1F7677,
37100
+ -16.64px 0px 0 0px rgba(31, 118, 119,0.2),
37101
+ -11.52px -11.52px 0 0px rgba(31, 118, 119,0.2);
37093
37102
  }
37094
37103
 
37095
37104
  75% {
37096
37105
  box-shadow:
37097
- 0px -8.32px 0px 0px rgba(31, 118, 119,0.2),
37098
- 5.76px -5.76px 0 0px rgba(31, 118, 119,0.2),
37099
- 8px 0px 0 0px rgba(31, 118, 119,0.2),
37100
- 5.6px 5.6px 0 0px rgba(31, 118, 119,0.2),
37101
- 0px 8px 0 0px rgba(31, 118, 119,0.5),
37102
- -5.76px 5.76px 0 0px rgba(31, 118, 119,0.7),
37103
- -8.32px 0px 0 0px #1F7677,
37104
- -5.76px -5.76px 0 0px rgba(31, 118, 119,0.2);
37106
+ 0px -16.64px 0px 0px rgba(31, 118, 119,0.2),
37107
+ 11.52px -11.52px 0 0px rgba(31, 118, 119,0.2),
37108
+ 16px 0px 0 0px rgba(31, 118, 119,0.2),
37109
+ 11.2px 11.2px 0 0px rgba(31, 118, 119,0.2),
37110
+ 0px 16px 0 0px rgba(31, 118, 119,0.5),
37111
+ -11.52px 11.52px 0 0px rgba(31, 118, 119,0.7),
37112
+ -16.64px 0px 0 0px #1F7677,
37113
+ -11.52px -11.52px 0 0px rgba(31, 118, 119,0.2);
37105
37114
  }
37106
37115
 
37107
37116
  87.5% {
37108
37117
  box-shadow:
37109
- 0px -8.32px 0px 0px rgba(31, 118, 119,0.2),
37110
- 5.76px -5.76px 0 0px rgba(31, 118, 119,0.2),
37111
- 8px 0px 0 0px rgba(31, 118, 119,0.2),
37112
- 5.6px 5.6px 0 0px rgba(31, 118, 119,0.2),
37113
- 0px 8px 0 0px rgba(31, 118, 119,0.2),
37114
- -5.76px 5.76px 0 0px rgba(31, 118, 119,0.5),
37115
- -8.32px 0px 0 0px rgba(31, 118, 119,0.7),
37116
- -5.76px -5.76px 0 0px #1F7677;
37118
+ 0px -16.64px 0px 0px rgba(31, 118, 119,0.2),
37119
+ 11.52px -11.52px 0 0px rgba(31, 118, 119,0.2),
37120
+ 16px 0px 0 0px rgba(31, 118, 119,0.2),
37121
+ 11.2px 11.2px 0 0px rgba(31, 118, 119,0.2),
37122
+ 0px 16px 0 0px rgba(31, 118, 119,0.2),
37123
+ -11.52px 11.52px 0 0px rgba(31, 118, 119,0.5),
37124
+ -16.64px 0px 0 0px rgba(31, 118, 119,0.7),
37125
+ -11.52px -11.52px 0 0px #1F7677;
37117
37126
  }
37118
37127
  `;
37119
37128
  const Loader = styled__default["default"].span`
37120
- font-size: 10px;
37121
- width: 4px;
37122
- height: 4px;
37129
+ font-size: 30px;
37130
+ width: 8px;
37131
+ height: 8px;
37123
37132
  border-radius: 50%;
37124
37133
  position: relative;
37125
37134
  text-indent: -9999em;
@@ -40849,7 +40858,21 @@ const SortIcon = ({
40849
40858
  }));
40850
40859
  };
40851
40860
 
40852
- // TableHeader.jsx
40861
+ // TableHeader.jsx - Updated with debounce
40862
+
40863
+ // Inline debounce hook
40864
+ const useDebounce = (value, delay = 1500) => {
40865
+ const [debouncedValue, setDebouncedValue] = React$1.useState(value);
40866
+ React$1.useEffect(() => {
40867
+ const handler = setTimeout(() => {
40868
+ setDebouncedValue(value);
40869
+ }, delay);
40870
+ return () => {
40871
+ clearTimeout(handler);
40872
+ };
40873
+ }, [value, delay]);
40874
+ return debouncedValue;
40875
+ };
40853
40876
  const TableHeader = ({
40854
40877
  columns,
40855
40878
  onSort,
@@ -40860,7 +40883,8 @@ const TableHeader = ({
40860
40883
  expandable = false,
40861
40884
  onHeaderCheckboxClick = () => {},
40862
40885
  headerCheckboxStates = {},
40863
- resetFiltersKey = 0 // NEW: Add this prop
40886
+ resetFiltersKey = 0,
40887
+ debounceDelay = 500 // NEW: Add debounce delay prop (default 500ms)
40864
40888
  }) => {
40865
40889
  const [focusedFilter, setFocusedFilter] = React$1.useState(null);
40866
40890
  const [focusedSort, setFocusedSort] = React$1.useState(null);
@@ -40870,17 +40894,21 @@ const TableHeader = ({
40870
40894
  top: 0,
40871
40895
  left: 0
40872
40896
  });
40897
+
40898
+ // Internal state that updates immediately (for UI responsiveness)
40873
40899
  const [filterState, setFilterState] = React$1.useState({});
40874
40900
  const [filterSelections, setFilterSelections] = React$1.useState({});
40875
40901
  const [activeSortColumn, setActiveSortColumn] = React$1.useState(null);
40876
40902
  const [activeSortValue, setActiveSortValue] = React$1.useState(null);
40903
+
40904
+ // Debounced values (these will be passed to parent after delay)
40905
+ const debouncedFilterState = useDebounce(filterState, debounceDelay);
40877
40906
  const iconRefs = React$1.useRef({});
40878
40907
  const popupRef = React$1.useRef(null);
40879
40908
 
40880
- // NEW: Reset internal state when resetFiltersKey changes
40909
+ // Reset internal state when resetFiltersKey changes
40881
40910
  React$1.useEffect(() => {
40882
40911
  if (resetFiltersKey > 0) {
40883
- // Reset filter selections to default (all selected)
40884
40912
  const resetSelections = {};
40885
40913
  columns.forEach(column => {
40886
40914
  if (column.filter && column.filterOptions) {
@@ -40896,15 +40924,9 @@ const TableHeader = ({
40896
40924
  }
40897
40925
  });
40898
40926
  setFilterSelections(resetSelections);
40899
-
40900
- // Reset filter state
40901
40927
  setFilterState({});
40902
-
40903
- // Reset sort state
40904
40928
  setActiveSortColumn(null);
40905
40929
  setActiveSortValue(null);
40906
-
40907
- // Close any open popups
40908
40930
  setVisibleFilterPopWrapper(null);
40909
40931
  setVisibleSortPopWrapper(null);
40910
40932
  }
@@ -40947,6 +40969,14 @@ const TableHeader = ({
40947
40969
  return hasChanges ? newSelections : prevSelections;
40948
40970
  });
40949
40971
  }, [columns]);
40972
+
40973
+ // 🎯 KEY CHANGE: Use debounced value to trigger parent callback
40974
+ React$1.useEffect(() => {
40975
+ // Only call onFilter if there's actual filter data
40976
+ if (Object.keys(debouncedFilterState).length > 0) {
40977
+ onFilter(debouncedFilterState);
40978
+ }
40979
+ }, [debouncedFilterState, onFilter]);
40950
40980
  const isFilterInDefaultState = columnKey => {
40951
40981
  const filterData = filterState[columnKey];
40952
40982
  if (!filterData) {
@@ -41039,11 +41069,6 @@ const TableHeader = ({
41039
41069
  setVisibleSortPopWrapper(prevKey => prevKey === key ? null : key);
41040
41070
  setVisibleFilterPopWrapper(null);
41041
41071
  };
41042
- React$1.useEffect(() => {
41043
- if (Object.keys(filterState).length > 0) {
41044
- onFilter(filterState);
41045
- }
41046
- }, [filterState]);
41047
41072
  const handleFilter = key => {
41048
41073
  const iconElement = iconRefs.current[`filter-${key}`];
41049
41074
  if (iconElement) {
@@ -41073,6 +41098,9 @@ const TableHeader = ({
41073
41098
  onSort(columnKey, null);
41074
41099
  }
41075
41100
  };
41101
+
41102
+ // 🎯 Filter changes update immediately in UI (filterState)
41103
+ // But parent callback is triggered only after debounce
41076
41104
  const handleFilterSelectionChange = (columnKey, selectionData) => {
41077
41105
  setFilterSelections(prev => {
41078
41106
  const updated = {
@@ -41081,6 +41109,8 @@ const TableHeader = ({
41081
41109
  };
41082
41110
  return updated;
41083
41111
  });
41112
+
41113
+ // Update internal state immediately for responsive UI
41084
41114
  setFilterState(prev => ({
41085
41115
  ...prev,
41086
41116
  [columnKey]: selectionData.filterData
@@ -41217,6 +41247,7 @@ const TableHeader = ({
41217
41247
  placeholder: column.key === 'EventCode' ? 'Enter Event ID' : 'Search..',
41218
41248
  fieldHeight: "40px",
41219
41249
  onTyping: value => {
41250
+ // Update internal state immediately
41220
41251
  setFilterState(prev => ({
41221
41252
  ...prev,
41222
41253
  [key]: value
@@ -41251,6 +41282,7 @@ const TableHeader = ({
41251
41282
  fields: currentFilterState.fields
41252
41283
  } : null,
41253
41284
  onApply: data => {
41285
+ // Update internal state immediately
41254
41286
  setFilterState(prev => ({
41255
41287
  ...prev,
41256
41288
  [key]: data
@@ -47574,25 +47606,52 @@ styled__default["default"].span`
47574
47606
  font-weight: 600;
47575
47607
  `;
47576
47608
 
47609
+ let FixedSizeList = null;
47610
+ try {
47611
+ FixedSizeList = require('react-window').FixedSizeList;
47612
+ } catch (e) {
47613
+ console.error('react-window not found:', e);
47614
+ }
47615
+ const VENDOR_ITEM_HEIGHT = 72;
47577
47616
  const NewItemList = ({
47578
47617
  onBack,
47579
47618
  onVendorClick,
47580
47619
  itemAndPackage
47581
47620
  }) => {
47582
- const [search, setSearch] = React$1.useState("");
47621
+ const [debouncedSearch, setDebouncedSearch] = React$1.useState("");
47583
47622
  const [headerHeight, setHeaderHeight] = React$1.useState(0);
47584
47623
  const headerRef = React$1.useRef(null);
47624
+ const searchInputRef = React$1.useRef(null);
47625
+ const timerRef = React$1.useRef(null);
47585
47626
  React$1.useEffect(() => {
47586
47627
  if (headerRef.current) {
47587
47628
  setHeaderHeight(headerRef.current.offsetHeight);
47588
47629
  }
47589
47630
  }, []);
47590
- const searchLower = search.toLowerCase();
47591
- const startsWithMatches = itemAndPackage.filter(i => i.name.toLowerCase().startsWith(searchLower));
47592
- const includesMatches = itemAndPackage.filter(i => !i.name.toLowerCase().startsWith(searchLower) && i.name.toLowerCase().includes(searchLower));
47593
- const filteredItems = [...startsWithMatches, ...includesMatches];
47594
-
47595
- // Helper to highlight matched portions
47631
+ const handleSearchChange = e => {
47632
+ const value = e.target.value;
47633
+ if (timerRef.current) {
47634
+ clearTimeout(timerRef.current);
47635
+ }
47636
+ timerRef.current = setTimeout(() => {
47637
+ setDebouncedSearch(value);
47638
+ }, 100);
47639
+ };
47640
+ const filteredItems = React$1.useMemo(() => {
47641
+ if (!debouncedSearch) return itemAndPackage;
47642
+ const searchLower = debouncedSearch.toLowerCase();
47643
+ const results = [];
47644
+ const startsWithResults = [];
47645
+ for (let i = 0; i < itemAndPackage.length; i++) {
47646
+ const nameLower = itemAndPackage[i].name.toLowerCase();
47647
+ if (nameLower.startsWith(searchLower)) {
47648
+ startsWithResults.push(itemAndPackage[i]);
47649
+ } else if (nameLower.includes(searchLower)) {
47650
+ results.push(itemAndPackage[i]);
47651
+ }
47652
+ }
47653
+ return [...startsWithResults, ...results];
47654
+ }, [debouncedSearch, itemAndPackage]);
47596
47655
  const highlightMatch = (text, query) => {
47597
47656
  if (!query) return text;
47598
47657
  const regex = new RegExp(`(${query})`, "ig");
@@ -47602,18 +47661,51 @@ const NewItemList = ({
47602
47661
  };
47603
47662
  const hasValidStatus = pkg => pkg.hasOwnProperty("status") && pkg.status != null && pkg.status !== undefined && pkg.status !== "";
47604
47663
  const draftPackages = pkg => pkg.status === 1;
47664
+ const VendorRow = ({
47665
+ index,
47666
+ style
47667
+ }) => {
47668
+ const item = filteredItems[index];
47669
+ let packagesLength = 0;
47670
+ let sentPackagesLength = 0;
47671
+ if (item.packages !== null) {
47672
+ packagesLength = item.packages.length;
47673
+ sentPackagesLength = item.packages.filter(pkg => hasValidStatus(pkg) && !draftPackages(pkg)).length;
47674
+ }
47675
+ return /*#__PURE__*/React__default["default"].createElement("div", {
47676
+ style: style
47677
+ }, /*#__PURE__*/React__default["default"].createElement(VendorItem, {
47678
+ onClick: e => {
47679
+ if (onVendorClick) {
47680
+ onVendorClick(item);
47681
+ }
47682
+ }
47683
+ }, /*#__PURE__*/React__default["default"].createElement(VendorNameAndPackagesContainer, null, /*#__PURE__*/React__default["default"].createElement(VendorName$1, null, highlightMatch(item.name, debouncedSearch.toLowerCase())), packagesLength > 0 && /*#__PURE__*/React__default["default"].createElement(VendorPackages, null, (() => {
47684
+ const noPackagesSent = sentPackagesLength === 0;
47685
+ if (noPackagesSent) {
47686
+ return `0/${packagesLength} Packages Sent`;
47687
+ } else {
47688
+ return `${sentPackagesLength}/${packagesLength} Packages Sent`;
47689
+ }
47690
+ })())), /*#__PURE__*/React__default["default"].createElement(VendorChevron, null, /*#__PURE__*/React__default["default"].createElement(ArrowRightFullIcon, null))));
47691
+ };
47605
47692
  return /*#__PURE__*/React__default["default"].createElement(VendorSelectionContainer, null, /*#__PURE__*/React__default["default"].createElement(VendorHeader$1, {
47606
47693
  ref: headerRef
47607
47694
  }, /*#__PURE__*/React__default["default"].createElement(VendorRoute, null, /*#__PURE__*/React__default["default"].createElement(VendorBackButton, {
47608
47695
  onClick: onBack
47609
47696
  }, /*#__PURE__*/React__default["default"].createElement(ArrowLeftIcon, null)), /*#__PURE__*/React__default["default"].createElement(VendorBackTitle, null, "Selected Vendors")), /*#__PURE__*/React__default["default"].createElement(VendorSelectionTitle, null, "Add New Vendor"), /*#__PURE__*/React__default["default"].createElement(VendorSearch, {
47697
+ ref: searchInputRef,
47610
47698
  type: "search",
47611
47699
  placeholder: "Search",
47612
- value: search,
47613
- onChange: e => setSearch(e.target.value)
47614
- }), /*#__PURE__*/React__default["default"].createElement(VendorSearchResult, null, search !== "" ? `${filteredItems.length === 0 ? "No" : filteredItems.length} Vendors Found` : " ")), /*#__PURE__*/React__default["default"].createElement(VendorListWrapper$1, {
47700
+ onChange: handleSearchChange
47701
+ }), /*#__PURE__*/React__default["default"].createElement(VendorSearchResult, null, debouncedSearch !== "" ? `${filteredItems.length === 0 ? "No" : filteredItems.length} Vendors Found` : " ")), /*#__PURE__*/React__default["default"].createElement(VendorListWrapper$1, {
47615
47702
  headerHeight: headerHeight
47616
- }, /*#__PURE__*/React__default["default"].createElement(VendorList$1, null, filteredItems.map((item, idx) => {
47703
+ }, FixedSizeList ? /*#__PURE__*/React__default["default"].createElement(FixedSizeList, {
47704
+ height: window.innerHeight - headerHeight - 48,
47705
+ itemCount: filteredItems.length,
47706
+ itemSize: VENDOR_ITEM_HEIGHT,
47707
+ width: "100%"
47708
+ }, VendorRow) : /*#__PURE__*/React__default["default"].createElement(VendorList$1, null, filteredItems.map((item, idx) => {
47617
47709
  let packagesLength = 0;
47618
47710
  let sentPackagesLength = 0;
47619
47711
  if (item.packages !== null) {
@@ -47623,12 +47715,11 @@ const NewItemList = ({
47623
47715
  return /*#__PURE__*/React__default["default"].createElement(VendorItem, {
47624
47716
  key: idx,
47625
47717
  onClick: e => {
47626
- // Always call onVendorClick - it will handle the conversion from null to []
47627
47718
  if (onVendorClick) {
47628
47719
  onVendorClick(item);
47629
47720
  }
47630
47721
  }
47631
- }, /*#__PURE__*/React__default["default"].createElement(VendorNameAndPackagesContainer, null, /*#__PURE__*/React__default["default"].createElement(VendorName$1, null, highlightMatch(item.name, searchLower)), packagesLength > 0 && /*#__PURE__*/React__default["default"].createElement(VendorPackages, null, (() => {
47722
+ }, /*#__PURE__*/React__default["default"].createElement(VendorNameAndPackagesContainer, null, /*#__PURE__*/React__default["default"].createElement(VendorName$1, null, highlightMatch(item.name, debouncedSearch.toLowerCase())), packagesLength > 0 && /*#__PURE__*/React__default["default"].createElement(VendorPackages, null, (() => {
47632
47723
  const noPackagesSent = sentPackagesLength === 0;
47633
47724
  if (noPackagesSent) {
47634
47725
  return `0/${packagesLength} Packages Sent`;