@capillarytech/blaze-ui 1.0.3-alpha.6 → 1.0.3-alpha.8

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/index.js CHANGED
@@ -20394,19 +20394,14 @@ var _CapRow = _interopRequireDefault(__webpack_require__(7375));
20394
20394
  var _CapSpin = _interopRequireDefault(__webpack_require__(1549));
20395
20395
  var _CapTooltip = _interopRequireDefault(__webpack_require__(5636));
20396
20396
  var _CapTooltipWithInfo = _interopRequireDefault(__webpack_require__(2608));
20397
+ var _constants = __webpack_require__(9788);
20397
20398
  var _styles = _interopRequireDefault(__webpack_require__(8263));
20398
20399
  var _jsxRuntime = __webpack_require__(4848);
20399
- const _excluded = ["type", "options", "value", "onChange", "placeholder", "className", "style", "isError", "errorMessage", "containerClassName", "popoverClassName", "allowClear", "headerLabel", "onUpload", "uploadLabel", "tooltip", "bylineText", "disabled", "showUpload", "customPopupRender", "showSearch", "searchBasedOn", "onSearch", "searchDebounce", "onConfirm", "clearText", "noResultCustomText", "noResultCustomIcon", "readOnly", "staticValue", "onFooterDownloadChange", "onPopupScroll", "enableVirtualization", "virtualRowHeight", "resetSearch", "resetData"];
20400
+ const _excluded = ["type", "options", "value", "onChange", "placeholder", "className", "style", "isError", "errorMessage", "containerClassName", "popoverClassName", "allowClear", "headerLabel", "onUpload", "uploadLabel", "tooltip", "bylineText", "disabled", "showUpload", "customPopupRender", "showSearch", "searchBasedOn", "onSearch", "searchDebounce", "onConfirm", "clearText", "noResultCustomText", "noResultCustomIcon", "readOnly", "staticValue", "onFooterDownloadChange", "onPopupScroll", "enableVirtualization", "virtualRowHeight", "resetSearch", "resetData", "fetchMissingOptions"];
20400
20401
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
20401
20402
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
20402
20403
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
20403
20404
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } /* eslint-disable max-lines */
20404
- const SELECT_TYPES = {
20405
- SELECT: 'select',
20406
- MULTI_SELECT: 'multiSelect',
20407
- TREE_SELECT: 'treeSelect',
20408
- MULTI_TREE_SELECT: 'multiTreeSelect'
20409
- };
20410
20405
  const NoResult = _ref => {
20411
20406
  let {
20412
20407
  noResultCustomText,
@@ -20424,7 +20419,7 @@ const NoResult = _ref => {
20424
20419
  size: "m"
20425
20420
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapLabel.default, {
20426
20421
  className: _styles.default['cap-unified-select-no-result-text'],
20427
- children: showUpload && (options == null ? void 0 : options.length) === 0 ? noResultCustomText : 'No results found'
20422
+ children: showUpload && (options == null ? void 0 : options.length) === 0 ? noResultCustomText : _constants.DEFAULTS.NO_RESULT_TEXT
20428
20423
  })]
20429
20424
  });
20430
20425
  };
@@ -20540,11 +20535,11 @@ const filterTreeData = function (data, search, searchBasedOn, selectedValues) {
20540
20535
  };
20541
20536
  const CapUnifiedSelect = _ref4 => {
20542
20537
  let {
20543
- type = SELECT_TYPES.SELECT,
20538
+ type = _constants.SELECT_TYPES.SELECT,
20544
20539
  options = [],
20545
20540
  value,
20546
20541
  onChange,
20547
- placeholder = 'Select an option',
20542
+ placeholder = _constants.DEFAULTS.PLACEHOLDER,
20548
20543
  className = '',
20549
20544
  style,
20550
20545
  isError = false,
@@ -20554,7 +20549,7 @@ const CapUnifiedSelect = _ref4 => {
20554
20549
  allowClear = false,
20555
20550
  headerLabel,
20556
20551
  onUpload,
20557
- uploadLabel = 'Upload',
20552
+ uploadLabel = _constants.DEFAULTS.UPLOAD_LABEL,
20558
20553
  tooltip,
20559
20554
  bylineText,
20560
20555
  disabled = false,
@@ -20563,19 +20558,20 @@ const CapUnifiedSelect = _ref4 => {
20563
20558
  showSearch = true,
20564
20559
  searchBasedOn = 'label',
20565
20560
  onSearch,
20566
- searchDebounce = 300,
20561
+ searchDebounce = _constants.TIMEOUTS.DEFAULT_SEARCH_DEBOUNCE,
20567
20562
  onConfirm,
20568
- clearText = 'Clear',
20569
- noResultCustomText = 'No results found',
20570
- noResultCustomIcon = 'warning',
20563
+ clearText = _constants.DEFAULTS.CLEAR_TEXT,
20564
+ noResultCustomText = _constants.DEFAULTS.NO_RESULT_TEXT,
20565
+ noResultCustomIcon = _constants.DEFAULTS.NO_RESULT_ICON,
20571
20566
  readOnly = false,
20572
20567
  staticValue = true,
20573
20568
  onFooterDownloadChange,
20574
20569
  onPopupScroll,
20575
20570
  enableVirtualization = false,
20576
- virtualRowHeight = 32,
20577
- resetSearch = false,
20578
- resetData
20571
+ virtualRowHeight = _constants.DEFAULTS.VIRTUAL_ROW_HEIGHT,
20572
+ resetSearch = true,
20573
+ resetData,
20574
+ fetchMissingOptions
20579
20575
  } = _ref4,
20580
20576
  rest = _objectWithoutPropertiesLoose(_ref4, _excluded);
20581
20577
  const [searchText, setSearchText] = (0, _react.useState)('');
@@ -20589,6 +20585,12 @@ const CapUnifiedSelect = _ref4 => {
20589
20585
  const searchTimeoutRef = (0, _react.useRef)(null);
20590
20586
  const scrollContainerRef = (0, _react.useRef)(null);
20591
20587
  const scrollLoadingTimeoutRef = (0, _react.useRef)(null);
20588
+ // Track if scroll handler is currently processing to prevent duplicate calls
20589
+ const isScrollProcessingRef = (0, _react.useRef)(false);
20590
+ // Throttle ref for scroll events
20591
+ const scrollThrottleTimeoutRef = (0, _react.useRef)(null);
20592
+ // Ref to track options for scroll handler (avoids recreating handleScroll)
20593
+ const optionsRef = (0, _react.useRef)(options);
20592
20594
  // Cache of selected items from async results to preserve them during search
20593
20595
  const selectedItemsCacheRef = (0, _react.useRef)(new Map());
20594
20596
  // Track the last search query to detect when options update after search
@@ -20615,6 +20617,74 @@ const CapUnifiedSelect = _ref4 => {
20615
20617
  const resetDataCalledRef = (0, _react.useRef)(false);
20616
20618
  // Track when resetData was called to help clear loading state
20617
20619
  const resetDataCalledTimeRef = (0, _react.useRef)(null);
20620
+ // Track if fetchMissingOptions was already called to prevent duplicate calls
20621
+ const fetchMissingOptionsCalledRef = (0, _react.useRef)(false);
20622
+ // Track the last missing values that were sent to prevent duplicate calls with same values
20623
+ const lastMissingValuesRef = (0, _react.useRef)('');
20624
+
20625
+ // Helper function to check if a value exists in options (recursive for tree structures)
20626
+ const findValueInOptions = (0, _react.useCallback)((opts, targetValue) => {
20627
+ for (const opt of opts) {
20628
+ if (opt.value === targetValue) {
20629
+ return true;
20630
+ }
20631
+ if (opt.children && opt.children.length > 0) {
20632
+ if (findValueInOptions(opt.children, targetValue)) {
20633
+ return true;
20634
+ }
20635
+ }
20636
+ }
20637
+ return false;
20638
+ }, []);
20639
+
20640
+ // Helper function to find missing selected values
20641
+ const findMissingValues = (0, _react.useCallback)((selectedValues, currentOptions) => {
20642
+ if (!selectedValues.length || !currentOptions.length) {
20643
+ return selectedValues;
20644
+ }
20645
+ return selectedValues.filter(val => !findValueInOptions(currentOptions, val));
20646
+ }, [findValueInOptions]);
20647
+
20648
+ // Check for missing options and call fetchMissingOptions if needed
20649
+ (0, _react.useEffect)(() => {
20650
+ // Only check if fetchMissingOptions is provided
20651
+ if (!fetchMissingOptions) {
20652
+ return;
20653
+ }
20654
+
20655
+ // Get current selected values
20656
+ const selectedValues = Array.isArray(value) ? value : value ? [value] : [];
20657
+ if (selectedValues.length === 0) {
20658
+ // No selected values, reset the tracking
20659
+ fetchMissingOptionsCalledRef.current = false;
20660
+ lastMissingValuesRef.current = '';
20661
+ return;
20662
+ }
20663
+
20664
+ // Find missing values
20665
+ const missingValues = findMissingValues(selectedValues, options);
20666
+
20667
+ // If no missing values, reset tracking and return
20668
+ if (missingValues.length === 0) {
20669
+ fetchMissingOptionsCalledRef.current = false;
20670
+ lastMissingValuesRef.current = '';
20671
+ return;
20672
+ }
20673
+
20674
+ // Create a sorted string representation of missing values for comparison
20675
+ // Use slice() to avoid mutating the original array
20676
+ const missingValuesKey = [...missingValues].sort().join(',');
20677
+
20678
+ // Only call if:
20679
+ // 1. We haven't called it before, OR
20680
+ // 2. The missing values have changed (different values are missing now)
20681
+ if (!fetchMissingOptionsCalledRef.current || lastMissingValuesRef.current !== missingValuesKey) {
20682
+ fetchMissingOptionsCalledRef.current = true;
20683
+ lastMissingValuesRef.current = missingValuesKey;
20684
+ // Call the developer's function with missing values (pass a copy to avoid mutation)
20685
+ fetchMissingOptions([...missingValues]);
20686
+ }
20687
+ }, [value, options, fetchMissingOptions, findMissingValues]);
20618
20688
  (0, _react.useEffect)(() => {
20619
20689
  const isEqual = Array.isArray(value) && Array.isArray(tempValue) ? (value == null ? void 0 : value.length) === (tempValue == null ? void 0 : tempValue.length) && value.every(v => Array.isArray(tempValue) && tempValue.includes(v)) : value === tempValue;
20620
20690
  if (!isEqual) {
@@ -20689,7 +20759,12 @@ const CapUnifiedSelect = _ref4 => {
20689
20759
  }, [options, orderedOptions, tempValue]);
20690
20760
 
20691
20761
  // Extract debounce timeout (extracted early for use in useEffects)
20692
- const debounceTimeout = searchDebounce != null ? searchDebounce : 300;
20762
+ const debounceTimeout = searchDebounce != null ? searchDebounce : _constants.TIMEOUTS.DEFAULT_SEARCH_DEBOUNCE;
20763
+
20764
+ // Keep optionsRef in sync with options
20765
+ (0, _react.useEffect)(() => {
20766
+ optionsRef.current = options;
20767
+ }, [options]);
20693
20768
 
20694
20769
  // Cleanup timeouts on unmount
20695
20770
  (0, _react.useEffect)(() => {
@@ -20700,6 +20775,9 @@ const CapUnifiedSelect = _ref4 => {
20700
20775
  if (scrollLoadingTimeoutRef.current) {
20701
20776
  clearTimeout(scrollLoadingTimeoutRef.current);
20702
20777
  }
20778
+ if (scrollThrottleTimeoutRef.current) {
20779
+ clearTimeout(scrollThrottleTimeoutRef.current);
20780
+ }
20703
20781
  };
20704
20782
  }, []);
20705
20783
 
@@ -20722,8 +20800,8 @@ const CapUnifiedSelect = _ref4 => {
20722
20800
  const searchCleared = lastSearchQueryRef.current === '';
20723
20801
  const timeSinceCleared = searchClearedTimeRef.current ? Date.now() - searchClearedTimeRef.current : Infinity;
20724
20802
  const hasOptionsData = options.length > 0;
20725
- // Wait at least 200ms after search is cleared to allow API call to complete
20726
- const clearedSearchReady = searchCleared && hasOptionsData && timeSinceCleared > 200;
20803
+ // Wait at least SEARCH_CLEARED_TIMEOUT after search is cleared to allow API call to complete
20804
+ const clearedSearchReady = searchCleared && hasOptionsData && timeSinceCleared > _constants.TIMEOUTS.SEARCH_CLEARED_TIMEOUT;
20727
20805
  if (optionsChanged || clearedSearchReady) {
20728
20806
  // Options updated after search - data has arrived
20729
20807
  // Use a small delay to ensure state updates are processed
@@ -20734,7 +20812,7 @@ const CapUnifiedSelect = _ref4 => {
20734
20812
  if (searchCleared) {
20735
20813
  searchClearedTimeRef.current = null;
20736
20814
  }
20737
- }, 100);
20815
+ }, _constants.TIMEOUTS.SEARCH_STATE_UPDATE_DELAY);
20738
20816
  return () => clearTimeout(timeoutId);
20739
20817
  }
20740
20818
  prevOptionsRef.current = options;
@@ -20753,8 +20831,8 @@ const CapUnifiedSelect = _ref4 => {
20753
20831
  // For cleared search (empty string), use a shorter timeout since it should reload initial data quickly
20754
20832
  // For regular search, use debounce timeout + buffer
20755
20833
  const searchCleared = lastSearchQueryRef.current === '';
20756
- const timeoutDuration = searchCleared ? debounceTimeout + 300 // Shorter timeout for cleared search
20757
- : debounceTimeout + 500; // Longer timeout for regular search
20834
+ const timeoutDuration = searchCleared ? debounceTimeout + _constants.TIMEOUTS.SEARCH_CLEARED_BUFFER // Shorter timeout for cleared search
20835
+ : debounceTimeout + _constants.TIMEOUTS.SEARCH_REGULAR_BUFFER; // Longer timeout for regular search
20758
20836
 
20759
20837
  // Calculate timeout: debounce timeout + a small buffer for API response
20760
20838
  // This ensures we wait for the API call to complete before showing "No results"
@@ -20792,7 +20870,7 @@ const CapUnifiedSelect = _ref4 => {
20792
20870
  // Additional check: if enough time has passed since resetData was called
20793
20871
  // and we have options data, assume data has loaded even if comparison didn't detect change
20794
20872
  const timeSinceReset = resetDataCalledTimeRef.current ? Date.now() - resetDataCalledTimeRef.current : Infinity;
20795
- const hasDataAfterTimeout = currentOptions.length > 0 && timeSinceReset > 300 && timeSinceReset < 2000;
20873
+ const hasDataAfterTimeout = currentOptions.length > 0 && timeSinceReset > _constants.TIMEOUTS.RESET_DATA_MIN_TIME && timeSinceReset < _constants.TIMEOUTS.RESET_DATA_MAX_TIME;
20796
20874
 
20797
20875
  // If options changed or enough time has passed with data, clear the loading state
20798
20876
  if (optionsChanged || hasDataAfterTimeout) {
@@ -20819,8 +20897,7 @@ const CapUnifiedSelect = _ref4 => {
20819
20897
  prevOptionsBeforeResetRef.current = options;
20820
20898
  // Clear timestamp
20821
20899
  resetDataCalledTimeRef.current = null;
20822
- }, 1000); // 1 second timeout for resetData operations
20823
-
20900
+ }, _constants.TIMEOUTS.RESET_DATA_TIMEOUT);
20824
20901
  return () => clearTimeout(fallbackTimeout);
20825
20902
  }, [isResettingData, options]);
20826
20903
 
@@ -20873,6 +20950,8 @@ const CapUnifiedSelect = _ref4 => {
20873
20950
  if (optionsCountIncreased || optionsContentChanged) {
20874
20951
  // Options updated after scroll - data has arrived, clear loading overlay
20875
20952
  setIsLoadingOnScroll(false);
20953
+ // Reset processing flag to allow next scroll event
20954
+ isScrollProcessingRef.current = false;
20876
20955
  if (scrollLoadingTimeoutRef.current) {
20877
20956
  clearTimeout(scrollLoadingTimeoutRef.current);
20878
20957
  scrollLoadingTimeoutRef.current = null;
@@ -20933,11 +21012,11 @@ const CapUnifiedSelect = _ref4 => {
20933
21012
  // Clear loading state after a short delay (filtering is instant but we show feedback)
20934
21013
  searchTimeoutRef.current = setTimeout(() => {
20935
21014
  setIsSearching(false);
20936
- }, 150); // Brief delay to show loading indicator
21015
+ }, _constants.TIMEOUTS.STATIC_SEARCH_DELAY);
20937
21016
  }
20938
21017
  }, [onSearch, staticValue, debounceTimeout]);
20939
- const isMulti = (0, _react.useMemo)(() => type === SELECT_TYPES.MULTI_SELECT || type === SELECT_TYPES.MULTI_TREE_SELECT, [type]);
20940
- const isTree = (0, _react.useMemo)(() => type === SELECT_TYPES.TREE_SELECT || type === SELECT_TYPES.MULTI_TREE_SELECT, [type]);
21018
+ const isMulti = (0, _react.useMemo)(() => type === _constants.SELECT_TYPES.MULTI_SELECT || type === _constants.SELECT_TYPES.MULTI_TREE_SELECT, [type]);
21019
+ const isTree = (0, _react.useMemo)(() => type === _constants.SELECT_TYPES.TREE_SELECT || type === _constants.SELECT_TYPES.MULTI_TREE_SELECT, [type]);
20941
21020
 
20942
21021
  // Use options directly since pagination is handled by the developer
20943
21022
  const mergedOptions = (0, _react.useMemo)(() => {
@@ -21288,6 +21367,9 @@ const CapUnifiedSelect = _ref4 => {
21288
21367
  initialTempValueRef.current = value;
21289
21368
  hasInteractedRef.current = false;
21290
21369
  resetDataCalledRef.current = false;
21370
+ // Reset fetchMissingOptions tracking to allow re-checking when dropdown opens
21371
+ fetchMissingOptionsCalledRef.current = false;
21372
+ lastMissingValuesRef.current = '';
21291
21373
  // Clear any pending search timeouts
21292
21374
  if (searchTimeoutRef.current) {
21293
21375
  clearTimeout(searchTimeoutRef.current);
@@ -21298,10 +21380,15 @@ const CapUnifiedSelect = _ref4 => {
21298
21380
  clearTimeout(scrollLoadingTimeoutRef.current);
21299
21381
  scrollLoadingTimeoutRef.current = null;
21300
21382
  }
21383
+ if (scrollThrottleTimeoutRef.current) {
21384
+ clearTimeout(scrollThrottleTimeoutRef.current);
21385
+ scrollThrottleTimeoutRef.current = null;
21386
+ }
21301
21387
  // Reset loading states
21302
21388
  setIsSearching(false);
21303
21389
  searchClearedTimeRef.current = null; // Clear search cleared timestamp
21304
21390
  setIsLoadingOnScroll(false);
21391
+ isScrollProcessingRef.current = false;
21305
21392
  // Safety check: Clear isResettingData if it's still true when opening
21306
21393
  // This handles cases where options updated while dropdown was closed
21307
21394
  if (isResettingData) {
@@ -21327,10 +21414,15 @@ const CapUnifiedSelect = _ref4 => {
21327
21414
  }
21328
21415
  // Reset scroll loading state
21329
21416
  setIsLoadingOnScroll(false);
21417
+ isScrollProcessingRef.current = false;
21330
21418
  if (scrollLoadingTimeoutRef.current) {
21331
21419
  clearTimeout(scrollLoadingTimeoutRef.current);
21332
21420
  scrollLoadingTimeoutRef.current = null;
21333
21421
  }
21422
+ if (scrollThrottleTimeoutRef.current) {
21423
+ clearTimeout(scrollThrottleTimeoutRef.current);
21424
+ scrollThrottleTimeoutRef.current = null;
21425
+ }
21334
21426
  scrollContainerRef.current = null;
21335
21427
 
21336
21428
  // Only call resetData if user actually interacted (selected, searched, etc.)
@@ -21390,6 +21482,7 @@ const CapUnifiedSelect = _ref4 => {
21390
21482
 
21391
21483
  // Handle scroll event - automatically checks if scroll is near bottom
21392
21484
  // Developer handles hasMore and isLoading conditions in onPopupScroll callback
21485
+ // Using refs to avoid recreating the callback when options change
21393
21486
  const handleScroll = (0, _react.useCallback)(event => {
21394
21487
  if (!onPopupScroll) return;
21395
21488
  const target = event.target;
@@ -21400,74 +21493,83 @@ const CapUnifiedSelect = _ref4 => {
21400
21493
 
21401
21494
  // Only call onPopupScroll if scroll is near bottom
21402
21495
  // Developer will handle hasMore and isLoading checks inside the callback
21403
- if (!isNearBottom) return;
21496
+ if (!isNearBottom) {
21497
+ // Reset processing flag when not near bottom
21498
+ isScrollProcessingRef.current = false;
21499
+ return;
21500
+ }
21501
+
21502
+ // Prevent multiple scroll triggers while already processing
21503
+ // This ensures we don't trigger multiple API calls simultaneously
21504
+ if (isScrollProcessingRef.current) return;
21404
21505
 
21405
21506
  // Prevent multiple scroll triggers while already loading
21406
21507
  // This ensures loading state is managed properly and data loading completes
21407
21508
  if (isLoadingOnScroll) return;
21408
21509
 
21409
- // Store current options count and options reference before triggering load
21410
- // This helps detect when new data arrives
21411
- // Store the reference directly - we'll compare by length and last item
21412
- prevOptionsCountRef.current = options.length;
21413
- prevOptionsRefForScroll.current = options;
21414
- // Also store the count at scroll trigger time for orderedOptions update
21415
- scrollTriggerOptionsCountRef.current = options.length;
21416
-
21417
- // Show loading indicator when scrolling near bottom
21418
- // This happens before calling onPopupScroll to provide immediate feedback
21419
- setIsLoadingOnScroll(true);
21420
-
21421
- // Clear any existing timeout
21422
- if (scrollLoadingTimeoutRef.current) {
21423
- clearTimeout(scrollLoadingTimeoutRef.current);
21424
- scrollLoadingTimeoutRef.current = null;
21425
- }
21426
-
21427
- // Create a React synthetic event-like object with scroll information
21428
- // const syntheticEvent = {
21429
- // target: target,
21430
- // currentTarget: target,
21431
- // nativeEvent: event,
21432
- // bubbles: false,
21433
- // cancelable: false,
21434
- // defaultPrevented: false,
21435
- // eventPhase: 0,
21436
- // isTrusted: false,
21437
- // timeStamp: Date.now(),
21438
- // type: 'scroll',
21439
- // detail: 0,
21440
- // view: null,
21441
- // preventDefault: () => { },
21442
- // stopPropagation: () => { },
21443
- // stopImmediatePropagation: () => { },
21444
- // isDefaultPrevented: () => false,
21445
- // isPropagationStopped: () => false,
21446
- // } as unknown as React.UIEvent<HTMLElement>;
21447
-
21448
- // Mark as interacted when user scrolls (triggers data loading)
21449
- hasInteractedRef.current = true;
21510
+ // Throttle scroll events to prevent rapid-fire API calls
21511
+ // Clear any existing throttle timeout
21512
+ if (scrollThrottleTimeoutRef.current) {
21513
+ clearTimeout(scrollThrottleTimeoutRef.current);
21514
+ }
21450
21515
 
21451
- // Call the developer's scroll handler - component already checked scroll position
21452
- // Developer should check hasMore and isLoading inside the callback
21453
- // This triggers the async data loading
21454
- onPopupScroll();
21455
-
21456
- // Set a fallback timeout to clear loading if options don't change
21457
- // This prevents loading from staying forever if data never arrives
21458
- // Using a longer timeout (10 seconds) to give enough time for slow API calls
21459
- scrollLoadingTimeoutRef.current = setTimeout(() => {
21460
- // Only clear if still loading (options change detection might have cleared it already)
21461
- setIsLoadingOnScroll(prev => {
21462
- if (prev) {
21463
- // Clear the timeout reference when clearing loading state
21464
- scrollLoadingTimeoutRef.current = null;
21465
- return false;
21466
- }
21467
- return prev;
21468
- });
21469
- }, 10000); // 10 seconds fallback - much longer than the previous 500ms
21470
- }, [onPopupScroll, isLoadingOnScroll, options.length]);
21516
+ // Set processing flag immediately to prevent duplicate calls
21517
+ isScrollProcessingRef.current = true;
21518
+
21519
+ // Throttle the actual API call to prevent multiple rapid triggers
21520
+ scrollThrottleTimeoutRef.current = setTimeout(() => {
21521
+ // Double-check we're still near bottom and not loading
21522
+ const stillNearBottom = Math.floor(target.scrollHeight - target.scrollTop) <= target.clientHeight;
21523
+ if (!stillNearBottom || isLoadingOnScroll) {
21524
+ isScrollProcessingRef.current = false;
21525
+ return;
21526
+ }
21527
+
21528
+ // Store current options count and options reference before triggering load
21529
+ // This helps detect when new data arrives
21530
+ // Use ref to get current options without depending on options.length
21531
+ const currentOptions = optionsRef.current;
21532
+ prevOptionsCountRef.current = currentOptions.length;
21533
+ prevOptionsRefForScroll.current = currentOptions;
21534
+ // Also store the count at scroll trigger time for orderedOptions update
21535
+ scrollTriggerOptionsCountRef.current = currentOptions.length;
21536
+
21537
+ // Show loading indicator when scrolling near bottom
21538
+ // This happens before calling onPopupScroll to provide immediate feedback
21539
+ setIsLoadingOnScroll(true);
21540
+
21541
+ // Clear any existing timeout
21542
+ if (scrollLoadingTimeoutRef.current) {
21543
+ clearTimeout(scrollLoadingTimeoutRef.current);
21544
+ scrollLoadingTimeoutRef.current = null;
21545
+ }
21546
+
21547
+ // Mark as interacted when user scrolls (triggers data loading)
21548
+ hasInteractedRef.current = true;
21549
+
21550
+ // Call the developer's scroll handler - component already checked scroll position
21551
+ // Developer should check hasMore and isLoading inside the callback
21552
+ // This triggers the async data loading
21553
+ onPopupScroll();
21554
+
21555
+ // Set a fallback timeout to clear loading if options don't change
21556
+ // This prevents loading from staying forever if data never arrives
21557
+ // Using a longer timeout (10 seconds) to give enough time for slow API calls
21558
+ scrollLoadingTimeoutRef.current = setTimeout(() => {
21559
+ // Only clear if still loading (options change detection might have cleared it already)
21560
+ setIsLoadingOnScroll(prev => {
21561
+ if (prev) {
21562
+ // Clear the timeout reference when clearing loading state
21563
+ scrollLoadingTimeoutRef.current = null;
21564
+ // Reset processing flag when loading times out
21565
+ isScrollProcessingRef.current = false;
21566
+ return false;
21567
+ }
21568
+ return prev;
21569
+ });
21570
+ }, _constants.TIMEOUTS.SCROLL_LOADING_TIMEOUT);
21571
+ }, 150); // 150ms throttle to prevent rapid-fire events
21572
+ }, [onPopupScroll, isLoadingOnScroll]);
21471
21573
 
21472
21574
  // Setup scroll listener for onPopupScroll
21473
21575
  (0, _react.useEffect)(() => {
@@ -21511,13 +21613,20 @@ const CapUnifiedSelect = _ref4 => {
21511
21613
  passive: true
21512
21614
  });
21513
21615
  }
21514
- }, 100);
21616
+ }, _constants.TIMEOUTS.SCROLL_CONTAINER_DELAY);
21515
21617
  return () => {
21516
21618
  clearTimeout(timeoutId);
21619
+ // Clear throttle timeout when cleaning up
21620
+ if (scrollThrottleTimeoutRef.current) {
21621
+ clearTimeout(scrollThrottleTimeoutRef.current);
21622
+ scrollThrottleTimeoutRef.current = null;
21623
+ }
21517
21624
  if (scrollContainerRef.current) {
21518
21625
  scrollContainerRef.current.removeEventListener('scroll', handleScroll);
21519
21626
  scrollContainerRef.current = null;
21520
21627
  }
21628
+ // Reset processing flag when listener is removed
21629
+ isScrollProcessingRef.current = false;
21521
21630
  };
21522
21631
  }, [onPopupScroll, dropdownOpen, handleScroll]);
21523
21632
  const renderHeader = (0, _react.useMemo)(() => {
@@ -21672,7 +21781,7 @@ const CapUnifiedSelect = _ref4 => {
21672
21781
  })]
21673
21782
  })]
21674
21783
  })
21675
- }), (type === SELECT_TYPES.SELECT || type === SELECT_TYPES.TREE_SELECT) && allowClear && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapRow.default, {
21784
+ }), (type === _constants.SELECT_TYPES.SELECT || type === _constants.SELECT_TYPES.TREE_SELECT) && allowClear && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapRow.default, {
21676
21785
  className: _styles.default['cap-unified-select-tree-clear-container'],
21677
21786
  onClick: handleClearAll,
21678
21787
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapLabel.default, {
@@ -21760,7 +21869,7 @@ const CapUnifiedSelect = _ref4 => {
21760
21869
  popupMatchSelectWidth: false,
21761
21870
  disabled: disabled,
21762
21871
  filterTreeNode: false,
21763
- listHeight: 256,
21872
+ listHeight: _constants.DEFAULTS.LIST_HEIGHT,
21764
21873
  listItemHeight: virtualRowHeight,
21765
21874
  popupRender: renderCustomDropdown
21766
21875
  }, rest)), isError && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapLabel.default, {
@@ -23491,7 +23600,7 @@ var ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ = __webpack_require__(1601);
23491
23600
  var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(6314);
23492
23601
  var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);
23493
23602
  // Module
23494
- ___CSS_LOADER_EXPORT___.push([module.id, `.blaze-ui-cap-unified-select-header-wrapper{display:flex;align-items:center}.blaze-ui-cap-unified-select-header-wrapper.blaze-ui-disabled{opacity:.5;cursor:not-allowed}.blaze-ui-cap-unified-select-header-wrapper .blaze-ui-cap-unified-select-header-label{font-family:"Roboto",sans-serif;font-weight:500;font-size:1rem;line-height:1.429rem;letter-spacing:0}.blaze-ui-cap-unified-select-header-byline-text{font-family:"Roboto",sans-serif;font-weight:400;font-size:.857rem;letter-spacing:0;color:#97a0af}.blaze-ui-cap-unified-select-container{text-align:justify;min-width:13.786rem}.blaze-ui-cap-unified-select-container.blaze-ui-disabled{cursor:not-allowed}.blaze-ui-cap-unified-select-container.ant-select-focused .ant-select-selector{border:.071rem solid #091e42 !important}.blaze-ui-cap-unified-select-container .blaze-ui-cap-unified-select-more-text{cursor:pointer;color:#091e42;margin-right:.286rem;position:relative}.blaze-ui-cap-unified-select-container .blaze-ui-cap-unified-select-suffix-icon{color:#7a869a}.blaze-ui-cap-unified-select-container .blaze-ui-cap-tooltip-with-info-icon{margin-top:.143rem}.blaze-ui-cap-unified-select-container.blaze-ui-cap-unified-tree-select.blaze-ui-cap-unified-tree-select-readonly{pointer-events:none}.blaze-ui-cap-unified-select-container.blaze-ui-cap-unified-tree-select.blaze-ui-cap-unified-tree-select-readonly .blaze-ui-cap-unified-select-more-text{pointer-events:auto}.blaze-ui-cap-unified-select-container.blaze-ui-cap-unified-tree-select .ant-select-tree-treenode{padding-left:.286rem}.blaze-ui-cap-unified-select-container.blaze-ui-cap-unified-tree-select-readonly .ant-select-selector{background-color:#fff;border-color:#ebecf0 !important;cursor:default}.blaze-ui-cap-unified-select-container.blaze-ui-cap-unified-tree-select-readonly .ant-select-arrow{pointer-events:auto;color:#b3bac5}.blaze-ui-cap-unified-select-container.blaze-ui-cap-unified-tree-select-readonly.ant-select-outlined:hover .ant-select-selector,.blaze-ui-cap-unified-select-container.blaze-ui-cap-unified-tree-select-readonly.ant-select-outlined:active .ant-select-selector,.blaze-ui-cap-unified-select-container.blaze-ui-cap-unified-tree-select-readonly.ant-select-outlined:focus .ant-select-selector{border-color:#ebecf0 !important}.blaze-ui-cap-unified-select-container .blaze-ui-cap-unified-select-status{color:#ea213a}.blaze-ui-cap-unified-select-container .ant-select-outlined:not(.ant-select-disabled):not(.ant-select-customize-input):not(.ant-pagination-size-changer):hover .ant-select-selector{border-color:#7a869a}.blaze-ui-cap-unified-select-container .ant-select-selector{background-color:#fff !important;border:.071rem solid #7a869a !important;border-radius:.286rem !important}.blaze-ui-cap-unified-select-container .ant-select-selector .ant-select-selection-placeholder{pointer-events:unset;color:#97a0af;display:flex;align-items:center}.blaze-ui-cap-unified-select-container .ant-select-prefix{font-size:1rem;font-weight:400;color:#091e42;line-height:1.429rem}.blaze-ui-cap-unified-select-container .ant-input-affix-wrapper .ant-input-prefix{left:.857rem}.blaze-ui-cap-unified-select-container .ant-select-selector{border-color:#7a869a !important;box-shadow:none !important;outline:0}.blaze-ui-cap-unified-select-container .ant-btn-variant-solid:not(:disabled):not(.ant-btn-disabled):hover{background-color:#47af46}.blaze-ui-cap-unified-select-container .ant-select-dropdown{margin-top:-0.571rem !important;border-radius:.286rem;background-color:#fff;box-shadow:0 .286rem .571rem -0.143rem rgba(9,30,66,.15),0 0 .071rem 0 rgba(9,30,66,.1);max-height:25.714rem;overflow:visible}.blaze-ui-cap-unified-select-container .ant-select-outlined.ant-select-multiple .ant-select-selection-wrap .ant-select-selection-item{background:rgba(0,0,0,0)}.blaze-ui-cap-unified-select-container .ant-select-multiple .ant-select-selection-wrap .ant-select-selection-item,.blaze-ui-cap-unified-select-container .ant-select-selection-wrap .ant-select-selection-item{background:rgba(0,0,0,0)}.blaze-ui-cap-unified-select-container .ant-select-multiple .ant-select-selection-wrap{align-self:center}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-search-container{border-bottom:.071rem solid #ebecf0 !important;line-height:2.857rem !important}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-search-container .blaze-ui-cap-unified-select-search-icon{color:#b3bac5}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-select-all-container{padding:.643rem 1.071rem;display:flex;align-items:center;border-bottom:.071rem solid #ebecf0;height:2.857rem}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-select-all-container .blaze-ui-cap-unified-select-select-all-checkbox{display:contents !important}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-upload-container{cursor:pointer;display:flex;align-items:center;border-bottom:.071rem solid #ebecf0;height:2.857rem;padding-left:1.143rem}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-upload-container .blaze-ui-cap-unified-select-upload-icon{color:#2466ea}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-upload-container .blaze-ui-cap-unified-select-upload-label{margin-left:.857rem;color:#2466ea}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-confirm-container{display:flex;align-items:center;height:3.429rem;padding:.5rem;border-top:.071rem solid #ebecf0}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-confirm-container .blaze-ui-cap-unified-select-confirm-button-group{display:flex;padding-left:.571rem;align-items:center;width:100%}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-confirm-container .blaze-ui-cap-unified-select-confirm-button-group .blaze-ui-cap-unified-select-confirm-button{background-color:#47af46;height:2.286rem;width:6.714rem;color:#fff}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-confirm-container .blaze-ui-cap-unified-select-confirm-button-group .blaze-ui-cap-unified-select-confirm-button:hover{background-color:#1f9a1d}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-confirm-container .blaze-ui-cap-unified-select-confirm-button-group .blaze-ui-cap-unified-select-confirm-button:disabled{background-color:#a1d8a0}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-confirm-container .blaze-ui-cap-unified-select-confirm-button-group .blaze-ui-cap-unified-select-cancel-button{border:rgba(0,0,0,0);box-shadow:none;width:5.714rem}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-confirm-container .blaze-ui-cap-unified-select-confirm-button-group .blaze-ui-cap-unified-select-selected-count{display:flex;margin-left:auto;font-size:.857rem;font-weight:400;line-height:1.143rem;color:#5e6c84}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-tree-clear-container{display:flex;justify-content:center;align-items:center;height:2.857rem;border-top:.071rem solid #ebecf0;cursor:pointer;color:#091e42}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-tree-clear-container:hover{background-color:#ebecf0}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-tree-clear-container .blaze-ui-cap-unified-select-tree-clear-label{font-size:1rem;font-weight:400}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-footer-download-container{cursor:pointer;display:flex;align-items:center;margin-left:auto;padding-right:1.143rem}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-footer-download-container:hover{opacity:.8}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-footer-download-container .blaze-ui-cap-unified-select-footer-download-icon{color:#2466ea}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-footer-download-container .blaze-ui-cap-unified-select-footer-download-label{margin-left:.857rem;color:#2466ea;font-family:Roboto,sans-serif;font-weight:400;font-style:normal;font-size:.857rem;line-height:1.143rem;letter-spacing:0;text-align:right}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-no-result{display:flex;flex-direction:column;align-items:center;justify-content:center;height:14.286rem;color:#97a0af;font-size:1rem}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-no-result .blaze-ui-cap-unified-select-no-result-text{font-weight:500}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:14.286rem;width:100%;gap:8px}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-loading-more{display:flex;align-items:center;justify-content:center;padding:.857rem;border-top:.071rem solid #ebecf0;color:#97a0af}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-menu-wrapper{position:relative;width:100%}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-loading-overlay{position:absolute;top:0;left:0;right:0;bottom:0;display:flex;flex-direction:column;align-items:center;justify-content:center;background-color:rgba(255,255,255,.8);z-index:10;gap:8px;color:#97a0af}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-option-with-suffix{display:flex;justify-content:space-between;align-items:center;width:100%;height:100%;line-height:1.5;vertical-align:middle;flex:1}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-option-with-suffix .blaze-ui-cap-unified-select-option-label{display:flex;align-items:center;flex-shrink:1;min-width:0}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-option-with-suffix .blaze-ui-cap-unified-select-option-end{display:flex;align-items:center;gap:.571rem;flex-shrink:0;margin-left:auto}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-option-with-suffix .blaze-ui-cap-unified-select-option-suffix{display:flex;align-items:center;padding:0 .571rem;max-height:1.429rem;white-space:nowrap}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-option-with-suffix .blaze-ui-cap-tooltip-with-info .blaze-ui-cap-tooltip-with-info-icon{margin-top:.357rem;color:#42526e}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-option-with-suffix .blaze-ui-cap-tooltip-with-info .blaze-ui-cap-tooltip-with-info-icon .blaze-ui-cap-icon{color:#42526e}.blaze-ui-cap-unified-select-popup .ant-select-dropdown .ant-select-dropdown-menu{margin-top:0 !important}.blaze-ui-cap-unified-select-popup .ant-select-dropdown .ant-select-dropdown-menu .ant-select-dropdown-menu-item{padding:.571rem 1.714rem !important;height:unset !important;font-size:1rem !important}.blaze-ui-cap-unified-select-popup .ant-select-dropdown .ant-select-dropdown-menu-item-disabled{color:rgba(0,0,0,.25) !important;cursor:not-allowed !important;line-height:1.428rem !important;font-size:1rem !important}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-node-content-wrapper{background-color:rgba(0,0,0,0);height:100%;display:flex;align-items:center}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-node-content-wrapper:hover{background-color:rgba(0,0,0,0)}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-treenode{height:2.857rem;margin-bottom:0;display:flex;align-items:center;width:100%}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-treenode:hover{background-color:#fffbe6}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-node-selected{background-color:#f4f5f7 !important}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-treenode-disabled{cursor:not-allowed !important}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-treenode-disabled .blaze-ui-cap-unified-select-option-label{color:#b3bac5}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-treenode-disabled .blaze-ui-cap-icon{color:#b3bac5 !important}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-treenode.ant-select-tree-treenode-selected{background-color:#f4f5f7}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-treenode-leaf .ant-select-tree-switcher-noop{display:none}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-checkbox{display:flex;align-items:center;justify-content:center;line-height:1;vertical-align:middle}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-checkbox .ant-select-tree-checkbox-inner{height:1.286rem;width:1.286rem;border:.143rem solid #b3bac5;border-radius:.286rem;display:flex;align-items:center;justify-content:center}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-checkbox-checked .ant-select-tree-checkbox-inner{background-color:#47af46;border:.143rem solid #47af46 !important}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-checkbox-checked .ant-select-tree-checkbox-inner:hover{background-color:#47af46;border:.143rem solid #47af46 !important}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-checkbox.ant-select-tree-checkbox-indeterminate .ant-select-tree-checkbox-inner{background-color:#47af46 !important;border-color:#47af46 !important}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-checkbox.ant-select-tree-checkbox-indeterminate .ant-select-tree-checkbox-inner::after{content:"";position:absolute;top:50%;left:50%;width:.714rem;height:.143rem;background-color:#fff;transform:translate(-50%, -50%);border-radius:.071rem}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-node-content-wrapper{border-radius:0;padding-left:.214rem;width:100%;display:flex;align-items:center}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-node-content-wrapper .ant-select-tree-title{width:100%;display:flex}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-indent{margin-left:.857rem;display:flex;align-items:center}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-switcher{display:flex;align-items:center;justify-content:center}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-switcher:not(.ant-select-tree-switcher-noop):hover:before{background-color:rgba(0,0,0,0)}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-switcher .ant-select-tree-switcher-icon{font-size:.857rem;margin-top:1.286rem}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-list-holder-inner{width:fit-content !important;min-width:100%}.blaze-ui-cap-unified-select-popup .ant-tree-select:hover .ant-select-selector{border-color:#7a869a}.blaze-ui-cap-unified-select-popup .ant-tree-select-focused .ant-select-selector,.blaze-ui-cap-unified-select-popup .ant-tree-select-open .ant-select-selector{border-color:#7a869a;box-shadow:none;outline:none}.blaze-ui-cap-unified-select-popup .ant-checkbox-inner{height:1.286rem;width:1.286rem;border:.143rem solid #b3bac5;border-radius:.286rem}.blaze-ui-cap-unified-select-popup .ant-checkbox-wrapper:not(.ant-checkbox-wrapper-disabled):hover .ant-checkbox-checked:not(.ant-checkbox-disabled) .ant-checkbox-inner{background-color:#47af46;border:.143rem solid #47af46 !important}.blaze-ui-cap-unified-select-popup .ant-checkbox-indeterminate .ant-checkbox-inner{background-color:#47af46 !important;border-color:#47af46 !important}.blaze-ui-cap-unified-select-popup .ant-checkbox-indeterminate .ant-checkbox-inner::after{content:"";position:absolute;top:50%;left:50%;width:.714rem;height:.143rem;background-color:#fff;transform:translate(-50%, -50%);border-radius:.071rem}.blaze-ui-cap-unified-select-popup .ant-input-affix-wrapper{padding-left:.571rem;border:none;box-shadow:none;border-radius:0;border-bottom:.071rem solid rgba(0,0,0,0);transition:border-color .2s ease}.blaze-ui-cap-unified-select-popup .ant-input-affix-wrapper:hover{border-bottom:.071rem solid #7a869a !important;box-shadow:none}.blaze-ui-cap-unified-select-popup .ant-input-affix-wrapper:focus-within{border-bottom:.071rem solid #091e42 !important;box-shadow:none;outline:none}.blaze-ui-cap-unified-select-popup .ant-input-affix-wrapper .ant-input{border:none !important;box-shadow:none !important}`, ""]);
23603
+ ___CSS_LOADER_EXPORT___.push([module.id, `.blaze-ui-cap-unified-select-header-wrapper{display:flex;align-items:center}.blaze-ui-cap-unified-select-header-wrapper.blaze-ui-disabled{opacity:.5;cursor:not-allowed}.blaze-ui-cap-unified-select-header-wrapper .blaze-ui-cap-unified-select-header-label{font-family:"Roboto",sans-serif;font-weight:500;font-size:1rem;line-height:1.429rem;letter-spacing:0}.blaze-ui-cap-unified-select-header-byline-text{font-family:"Roboto",sans-serif;font-weight:400;font-size:.857rem;letter-spacing:0;color:#97a0af}.blaze-ui-cap-unified-select-container{text-align:justify;min-width:13.786rem}.blaze-ui-cap-unified-select-container.blaze-ui-disabled{cursor:not-allowed}.blaze-ui-cap-unified-select-container.ant-select-focused .ant-select-selector{border:.071rem solid #091e42 !important}.blaze-ui-cap-unified-select-container .blaze-ui-cap-unified-select-more-text{cursor:pointer;color:#091e42;margin-right:.286rem;position:relative}.blaze-ui-cap-unified-select-container .blaze-ui-cap-unified-select-suffix-icon{color:#7a869a}.blaze-ui-cap-unified-select-container .blaze-ui-cap-tooltip-with-info-icon{margin-top:.143rem}.blaze-ui-cap-unified-select-container.blaze-ui-cap-unified-tree-select.blaze-ui-cap-unified-tree-select-readonly{pointer-events:none}.blaze-ui-cap-unified-select-container.blaze-ui-cap-unified-tree-select.blaze-ui-cap-unified-tree-select-readonly .blaze-ui-cap-unified-select-more-text{pointer-events:auto}.blaze-ui-cap-unified-select-container.blaze-ui-cap-unified-tree-select .ant-select-tree-treenode{padding-left:.286rem}.blaze-ui-cap-unified-select-container.blaze-ui-cap-unified-tree-select-readonly .ant-select-selector{background-color:#fff;border-color:#ebecf0 !important;cursor:default}.blaze-ui-cap-unified-select-container.blaze-ui-cap-unified-tree-select-readonly .ant-select-arrow{pointer-events:auto;color:#b3bac5}.blaze-ui-cap-unified-select-container.blaze-ui-cap-unified-tree-select-readonly.ant-select-outlined:hover .ant-select-selector,.blaze-ui-cap-unified-select-container.blaze-ui-cap-unified-tree-select-readonly.ant-select-outlined:active .ant-select-selector,.blaze-ui-cap-unified-select-container.blaze-ui-cap-unified-tree-select-readonly.ant-select-outlined:focus .ant-select-selector{border-color:#ebecf0 !important}.blaze-ui-cap-unified-select-container .blaze-ui-cap-unified-select-status{color:#ea213a}.blaze-ui-cap-unified-select-container .ant-select-outlined:not(.ant-select-disabled):not(.ant-select-customize-input):not(.ant-pagination-size-changer):hover .ant-select-selector{border-color:#7a869a}.blaze-ui-cap-unified-select-container .ant-select-selector{background-color:#fff !important;border:.071rem solid #7a869a !important;border-radius:.286rem !important}.blaze-ui-cap-unified-select-container .ant-select-selector .ant-select-selection-placeholder{pointer-events:unset;color:#97a0af;display:flex;align-items:center}.blaze-ui-cap-unified-select-container .ant-select-prefix{font-size:1rem;font-weight:400;color:#091e42;line-height:1.429rem}.blaze-ui-cap-unified-select-container .ant-input-affix-wrapper .ant-input-prefix{left:.857rem}.blaze-ui-cap-unified-select-container .ant-select-selector{border-color:#7a869a !important;box-shadow:none !important;outline:0}.blaze-ui-cap-unified-select-container .ant-btn-variant-solid:not(:disabled):not(.ant-btn-disabled):hover{background-color:#47af46}.blaze-ui-cap-unified-select-container .ant-select-dropdown{margin-top:-0.571rem !important;border-radius:.286rem;background-color:#fff;box-shadow:0 .286rem .571rem -0.143rem rgba(9,30,66,.15),0 0 .071rem 0 rgba(9,30,66,.1);max-height:25.714rem;overflow:visible}.blaze-ui-cap-unified-select-container .ant-select-outlined.ant-select-multiple .ant-select-selection-wrap .ant-select-selection-item{background:rgba(0,0,0,0)}.blaze-ui-cap-unified-select-container .ant-select-multiple .ant-select-selection-wrap .ant-select-selection-item,.blaze-ui-cap-unified-select-container .ant-select-selection-wrap .ant-select-selection-item{background:rgba(0,0,0,0)}.blaze-ui-cap-unified-select-container .ant-select-multiple .ant-select-selection-wrap{align-self:center}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-search-container{border-bottom:.071rem solid #ebecf0 !important;line-height:2.857rem !important}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-search-container .blaze-ui-cap-unified-select-search-icon{color:#b3bac5}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-select-all-container{padding:.643rem 1.071rem;display:flex;align-items:center;border-bottom:.071rem solid #ebecf0;height:2.857rem}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-select-all-container .blaze-ui-cap-unified-select-select-all-checkbox{display:contents !important}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-upload-container{cursor:pointer;display:flex;align-items:center;border-bottom:.071rem solid #ebecf0;height:2.857rem;padding-left:1.143rem}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-upload-container .blaze-ui-cap-unified-select-upload-icon{color:#2466ea}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-upload-container .blaze-ui-cap-unified-select-upload-label{margin-left:.857rem;color:#2466ea}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-confirm-container{display:flex;align-items:center;height:3.429rem;padding:.5rem;border-top:.071rem solid #ebecf0}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-confirm-container .blaze-ui-cap-unified-select-confirm-button-group{display:flex;padding-left:.571rem;align-items:center;width:100%}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-confirm-container .blaze-ui-cap-unified-select-confirm-button-group .blaze-ui-cap-unified-select-confirm-button{background-color:#47af46;height:2.286rem;width:6.714rem;color:#fff}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-confirm-container .blaze-ui-cap-unified-select-confirm-button-group .blaze-ui-cap-unified-select-confirm-button:hover{background-color:#1f9a1d}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-confirm-container .blaze-ui-cap-unified-select-confirm-button-group .blaze-ui-cap-unified-select-confirm-button:disabled{background-color:#a1d8a0}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-confirm-container .blaze-ui-cap-unified-select-confirm-button-group .blaze-ui-cap-unified-select-cancel-button{border:rgba(0,0,0,0);box-shadow:none;width:5.714rem}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-confirm-container .blaze-ui-cap-unified-select-confirm-button-group .blaze-ui-cap-unified-select-selected-count{display:flex;margin-left:auto;font-size:.857rem;font-weight:400;line-height:1.143rem;color:#5e6c84}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-tree-clear-container{display:flex;justify-content:center;align-items:center;height:2.857rem;border-top:.071rem solid #ebecf0;cursor:pointer;color:#091e42}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-tree-clear-container:hover{background-color:#ebecf0}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-tree-clear-container .blaze-ui-cap-unified-select-tree-clear-label{font-size:1rem;font-weight:400}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-footer-download-container{cursor:pointer;display:flex;align-items:center;margin-left:auto;padding-right:1.143rem}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-footer-download-container:hover{opacity:.8}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-footer-download-container .blaze-ui-cap-unified-select-footer-download-icon{color:#2466ea}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-footer-download-container .blaze-ui-cap-unified-select-footer-download-label{margin-left:.857rem;color:#2466ea;font-family:Roboto,sans-serif;font-weight:400;font-style:normal;font-size:.857rem;line-height:1.143rem;letter-spacing:0;text-align:right}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-no-result{display:flex;flex-direction:column;align-items:center;justify-content:center;height:14.286rem;color:#97a0af;font-size:1rem}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-no-result .blaze-ui-cap-unified-select-no-result-text{font-weight:500}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:14.286rem;width:100%;gap:.571rem}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-loading-more{display:flex;align-items:center;justify-content:center;padding:.857rem;border-top:.071rem solid #ebecf0;color:#97a0af}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-menu-wrapper{position:relative;width:100%}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-loading-overlay{position:absolute;top:0;left:0;right:0;bottom:0;display:flex;flex-direction:column;align-items:center;justify-content:center;background-color:rgba(255,255,255,.8);z-index:10;gap:.571rem;color:#97a0af}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-option-with-suffix{display:flex;justify-content:start;align-items:center;width:100%;height:100%;line-height:1.5;vertical-align:middle;flex:1}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-option-with-suffix .blaze-ui-cap-unified-select-option-label{display:flex;align-items:center;flex-shrink:1;min-width:0}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-option-with-suffix .blaze-ui-cap-unified-select-option-end{display:flex;align-items:center;gap:.571rem;flex-shrink:0;margin-left:auto}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-option-with-suffix .blaze-ui-cap-unified-select-option-suffix{display:flex;align-items:center;padding:0 .571rem;max-height:1.429rem;white-space:nowrap}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-option-with-suffix .blaze-ui-cap-tooltip-with-info .blaze-ui-cap-tooltip-with-info-icon{margin-top:.357rem;color:#42526e}.blaze-ui-cap-unified-select-popup .blaze-ui-cap-unified-select-option-with-suffix .blaze-ui-cap-tooltip-with-info .blaze-ui-cap-tooltip-with-info-icon .blaze-ui-cap-icon{color:#42526e}.blaze-ui-cap-unified-select-popup .ant-select-dropdown .ant-select-dropdown-menu{margin-top:0 !important}.blaze-ui-cap-unified-select-popup .ant-select-dropdown .ant-select-dropdown-menu .ant-select-dropdown-menu-item{padding:.571rem 1.714rem !important;height:unset !important;font-size:1rem !important}.blaze-ui-cap-unified-select-popup .ant-select-dropdown .ant-select-dropdown-menu-item-disabled{color:rgba(0,0,0,.25) !important;cursor:not-allowed !important;line-height:1.428rem !important;font-size:1rem !important}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-node-content-wrapper{background-color:rgba(0,0,0,0);height:100%;display:flex;align-items:center}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-node-content-wrapper:hover{background-color:rgba(0,0,0,0)}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-treenode{height:2.857rem;margin-bottom:0;display:flex;align-items:center;width:100%}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-treenode:hover{background-color:#fffbe6}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-node-selected{background-color:#f4f5f7 !important}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-treenode-disabled{cursor:not-allowed !important}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-treenode-disabled .blaze-ui-cap-unified-select-option-label{color:#b3bac5}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-treenode-disabled .blaze-ui-cap-icon{color:#b3bac5 !important}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-treenode.ant-select-tree-treenode-selected{background-color:#f4f5f7}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-treenode-leaf .ant-select-tree-switcher-noop{display:none}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-checkbox{display:flex;align-items:center;justify-content:center;line-height:1;vertical-align:middle}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-checkbox .ant-select-tree-checkbox-inner{height:1.286rem;width:1.286rem;border:.143rem solid #b3bac5;border-radius:.286rem;display:flex;align-items:center;justify-content:center}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-checkbox-checked .ant-select-tree-checkbox-inner{background-color:#47af46;border:.143rem solid #47af46 !important}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-checkbox-checked .ant-select-tree-checkbox-inner:hover{background-color:#47af46;border:.143rem solid #47af46 !important}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-checkbox.ant-select-tree-checkbox-indeterminate .ant-select-tree-checkbox-inner{background-color:#47af46 !important;border-color:#47af46 !important}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-checkbox.ant-select-tree-checkbox-indeterminate .ant-select-tree-checkbox-inner::after{content:"";position:absolute;top:50%;left:50%;width:.714rem;height:.143rem;background-color:#fff;transform:translate(-50%, -50%);border-radius:.071rem}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-node-content-wrapper{border-radius:0;padding-left:.214rem;width:100%;display:flex;align-items:center}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-node-content-wrapper .ant-select-tree-title{width:100%;display:flex}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-indent{margin-left:.857rem;display:flex;align-items:center}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-switcher{display:flex;align-items:center;justify-content:center}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-switcher:not(.ant-select-tree-switcher-noop):hover:before{background-color:rgba(0,0,0,0)}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-switcher .ant-select-tree-switcher-icon{font-size:.857rem;margin-top:1.286rem}.blaze-ui-cap-unified-select-popup .ant-select-tree .ant-select-tree-list-holder-inner{width:fit-content !important;min-width:100%}.blaze-ui-cap-unified-select-popup .ant-tree-select:hover .ant-select-selector{border-color:#7a869a}.blaze-ui-cap-unified-select-popup .ant-tree-select-focused .ant-select-selector,.blaze-ui-cap-unified-select-popup .ant-tree-select-open .ant-select-selector{border-color:#7a869a;box-shadow:none;outline:none}.blaze-ui-cap-unified-select-popup .ant-checkbox-inner{height:1.286rem;width:1.286rem;border:.143rem solid #b3bac5;border-radius:.286rem}.blaze-ui-cap-unified-select-popup .ant-checkbox-wrapper:not(.ant-checkbox-wrapper-disabled):hover .ant-checkbox-checked:not(.ant-checkbox-disabled) .ant-checkbox-inner{background-color:#47af46;border:.143rem solid #47af46 !important}.blaze-ui-cap-unified-select-popup .ant-checkbox-indeterminate .ant-checkbox-inner{background-color:#47af46 !important;border-color:#47af46 !important}.blaze-ui-cap-unified-select-popup .ant-checkbox-indeterminate .ant-checkbox-inner::after{content:"";position:absolute;top:50%;left:50%;width:.714rem;height:.143rem;background-color:#fff;transform:translate(-50%, -50%);border-radius:.071rem}.blaze-ui-cap-unified-select-popup .ant-input-affix-wrapper{padding-left:.571rem;border:none;box-shadow:none;border-radius:0;border-bottom:.071rem solid rgba(0,0,0,0);transition:border-color .2s ease}.blaze-ui-cap-unified-select-popup .ant-input-affix-wrapper:hover{border-bottom:.071rem solid #7a869a !important;box-shadow:none}.blaze-ui-cap-unified-select-popup .ant-input-affix-wrapper:focus-within{border-bottom:.071rem solid #091e42 !important;box-shadow:none;outline:none}.blaze-ui-cap-unified-select-popup .ant-input-affix-wrapper .ant-input{border:none !important;box-shadow:none !important}`, ""]);
23495
23604
  // Exports
23496
23605
  ___CSS_LOADER_EXPORT___.locals = {
23497
23606
  "cap-unified-select-header-wrapper": `blaze-ui-cap-unified-select-header-wrapper`,
@@ -23539,6 +23648,73 @@ ___CSS_LOADER_EXPORT___.locals = {
23539
23648
  module.exports = ___CSS_LOADER_EXPORT___;
23540
23649
 
23541
23650
 
23651
+ /***/ }),
23652
+
23653
+ /***/ 9788:
23654
+ /***/ ((__unused_webpack_module, exports) => {
23655
+
23656
+ "use strict";
23657
+
23658
+
23659
+ exports.__esModule = true;
23660
+ exports.TIMEOUTS = exports.SELECT_TYPES = exports.DEFAULTS = void 0;
23661
+ /**
23662
+ * Select type constants for CapUnifiedSelect component
23663
+ */
23664
+ const SELECT_TYPES = exports.SELECT_TYPES = {
23665
+ SELECT: 'select',
23666
+ MULTI_SELECT: 'multiSelect',
23667
+ TREE_SELECT: 'treeSelect',
23668
+ MULTI_TREE_SELECT: 'multiTreeSelect'
23669
+ };
23670
+ /**
23671
+ * Timeout constants (in milliseconds)
23672
+ */
23673
+ const TIMEOUTS = exports.TIMEOUTS = {
23674
+ /** Default search debounce timeout */
23675
+ DEFAULT_SEARCH_DEBOUNCE: 300,
23676
+ /** Delay for state updates after search */
23677
+ SEARCH_STATE_UPDATE_DELAY: 100,
23678
+ /** Minimum time since search was cleared to consider data ready */
23679
+ SEARCH_CLEARED_TIMEOUT: 200,
23680
+ /** Buffer time added to debounce for cleared search */
23681
+ SEARCH_CLEARED_BUFFER: 300,
23682
+ /** Buffer time added to debounce for regular search */
23683
+ SEARCH_REGULAR_BUFFER: 500,
23684
+ /** Brief delay to show loading indicator for static search */
23685
+ STATIC_SEARCH_DELAY: 150,
23686
+ /** Timeout for resetData fallback (1 second) */
23687
+ RESET_DATA_TIMEOUT: 1000,
23688
+ /** Minimum time since resetData was called to consider data ready */
23689
+ RESET_DATA_MIN_TIME: 300,
23690
+ /** Maximum time since resetData was called to consider data ready */
23691
+ RESET_DATA_MAX_TIME: 2000,
23692
+ /** Fallback timeout for scroll loading (10 seconds) */
23693
+ SCROLL_LOADING_TIMEOUT: 10000,
23694
+ /** Delay before setting up scroll container listener */
23695
+ SCROLL_CONTAINER_DELAY: 100
23696
+ };
23697
+
23698
+ /**
23699
+ * Default values for component props
23700
+ */
23701
+ const DEFAULTS = exports.DEFAULTS = {
23702
+ /** Default placeholder text */
23703
+ PLACEHOLDER: 'Select an option',
23704
+ /** Default upload button label */
23705
+ UPLOAD_LABEL: 'Upload',
23706
+ /** Default clear button text */
23707
+ CLEAR_TEXT: 'Clear',
23708
+ /** Default no results message */
23709
+ NO_RESULT_TEXT: 'No results found',
23710
+ /** Default no results icon */
23711
+ NO_RESULT_ICON: 'warning',
23712
+ /** Default virtual row height in pixels */
23713
+ VIRTUAL_ROW_HEIGHT: 32,
23714
+ /** Default list height in pixels */
23715
+ LIST_HEIGHT: 256
23716
+ };
23717
+
23542
23718
  /***/ }),
23543
23719
 
23544
23720
  /***/ 9819: