impact-chatbot 2.4.0 → 2.4.1
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.cjs.js +8 -3
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +8 -3
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -13740,6 +13740,7 @@ const ChatbotInput = (props) => {
|
|
|
13740
13740
|
const isTransitioningStageRef = React.useRef(false);
|
|
13741
13741
|
const shouldClearCacheRef = React.useRef(false);
|
|
13742
13742
|
const allFilterValuesRef = React.useRef([]);
|
|
13743
|
+
const initialValueOptionsRef = React.useRef([]);
|
|
13743
13744
|
const windowStartRef = React.useRef(0);
|
|
13744
13745
|
const INITIAL_DISPLAY_COUNT = 500;
|
|
13745
13746
|
const LOAD_MORE_COUNT = 100;
|
|
@@ -14284,6 +14285,7 @@ const ChatbotInput = (props) => {
|
|
|
14284
14285
|
setSelectionStage("values");
|
|
14285
14286
|
setSelectedFilter(filterConfig);
|
|
14286
14287
|
setCurrentOptions([]);
|
|
14288
|
+
initialValueOptionsRef.current = [];
|
|
14287
14289
|
setSelectedOptions([]);
|
|
14288
14290
|
setShowMentionSelect(true);
|
|
14289
14291
|
setIsSelectOpen(true);
|
|
@@ -14313,10 +14315,13 @@ const ChatbotInput = (props) => {
|
|
|
14313
14315
|
windowStartRef.current = 0;
|
|
14314
14316
|
if (allValues.length > 2000) {
|
|
14315
14317
|
allFilterValuesRef.current = allValues;
|
|
14316
|
-
|
|
14318
|
+
const initialSlice = allValues.slice(0, INITIAL_DISPLAY_COUNT);
|
|
14319
|
+
initialValueOptionsRef.current = initialSlice;
|
|
14320
|
+
setCurrentOptions(initialSlice);
|
|
14317
14321
|
}
|
|
14318
14322
|
else {
|
|
14319
14323
|
allFilterValuesRef.current = [];
|
|
14324
|
+
initialValueOptionsRef.current = allValues;
|
|
14320
14325
|
setCurrentOptions(allValues);
|
|
14321
14326
|
}
|
|
14322
14327
|
// Update dropdown position again after values are loaded (DOM might have shifted)
|
|
@@ -15069,7 +15074,7 @@ const ChatbotInput = (props) => {
|
|
|
15069
15074
|
zIndex: 10000,
|
|
15070
15075
|
}, children: selectionStage === "filter" ? (
|
|
15071
15076
|
// Stage 1: Filter selection - always use Select
|
|
15072
|
-
jsxRuntime.jsx(impactUiV3.Select, { currentOptions: currentOptions.length > 0 ? currentOptions : [], setCurrentOptions: setCurrentOptions, initialOptions:
|
|
15077
|
+
jsxRuntime.jsx(impactUiV3.Select, { currentOptions: currentOptions.length > 0 ? currentOptions : [], setCurrentOptions: setCurrentOptions, initialOptions: formattedFilterOptions.length > 0 ? formattedFilterOptions : [], placeholder: "Select a filter...", handleChange: handleMentionSelect, isOpen: isSelectOpen, setIsOpen: setIsSelectOpen, selectedOptions: selectedOptions, setSelectedOptions: setSelectedOptions, isCloseWhenClickOutside: false, isWithSearch: true, isMulti: false, disabled: false, isLoading: false, emptyMessage: "No filters available" })) : selectionStage === "values" && selectedFilter?.display_type &&
|
|
15073
15078
|
selectedFilter.display_type !== "dropdown" &&
|
|
15074
15079
|
selectedFilter.display_type !== "autocompleteDropdown" &&
|
|
15075
15080
|
selectedFilter.display_type !== "list" ? (
|
|
@@ -15156,7 +15161,7 @@ const ChatbotInput = (props) => {
|
|
|
15156
15161
|
cursor: "pointer"
|
|
15157
15162
|
}, children: "Cancel" })] })] })) : (
|
|
15158
15163
|
// Stage 2: Value selection with dropdown - use Select
|
|
15159
|
-
jsxRuntime.jsx(impactUiV3.Select, { currentOptions: currentOptions.length > 0 ? currentOptions : [], setCurrentOptions: setCurrentOptions, initialOptions:
|
|
15164
|
+
jsxRuntime.jsx(impactUiV3.Select, { currentOptions: currentOptions.length > 0 ? currentOptions : [], setCurrentOptions: setCurrentOptions, initialOptions: initialValueOptionsRef.current.length > 0 ? initialValueOptionsRef.current : currentOptions, placeholder: isLoadingValues
|
|
15160
15165
|
? "Loading values..."
|
|
15161
15166
|
: "Select values...", handleChange: handleMentionSelect, isOpen: isSelectOpen, setIsOpen: setIsSelectOpen, selectedOptions: selectedOptions, setSelectedOptions: setSelectedOptions, isCloseWhenClickOutside: false, isWithSearch: true, onMenuScrollToBottom: () => {
|
|
15162
15167
|
const allValues = allFilterValuesRef.current;
|