impact-chatbot 2.3.70 → 2.3.72
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/components/message-template/components/message-content/StepFormContent.d.ts +2 -1
- package/dist/components/message-template/components/message-content/utils/crossFilterAdapter.d.ts +3 -1
- package/dist/index.cjs.js +95 -30
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +95 -30
- package/dist/index.esm.js.map +1 -1
- package/dist/services/chatbot-services.d.ts +1 -1
- package/package.json +1 -1
|
@@ -7,11 +7,12 @@
|
|
|
7
7
|
* @param {Array} props.formData - Array of raw widget_data items from step_form chunk
|
|
8
8
|
* @param {number} props.messageIndex - Index for form state persistence keys
|
|
9
9
|
*/
|
|
10
|
-
declare const StepFormContent: ({ formData, messageIndex, isFormDisabled, showSavedFilters }: {
|
|
10
|
+
declare const StepFormContent: ({ formData, messageIndex, isFormDisabled, showSavedFilters, preSelectedFilters }: {
|
|
11
11
|
formData: any;
|
|
12
12
|
messageIndex?: number;
|
|
13
13
|
isFormDisabled?: boolean;
|
|
14
14
|
showSavedFilters?: boolean;
|
|
15
|
+
preSelectedFilters?: any;
|
|
15
16
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
16
17
|
/** Reset the timeout flag (call when a new conversation/message starts) */
|
|
17
18
|
export declare const resetStepFormTimeoutFlag: () => void;
|
package/dist/components/message-template/components/message-content/utils/crossFilterAdapter.d.ts
CHANGED
|
@@ -8,9 +8,11 @@
|
|
|
8
8
|
* @param {Array} existingSelections - Upstream filter selections
|
|
9
9
|
* Each item: { filterName, attributeName, values, checkAll }
|
|
10
10
|
* @param {Array} allFilters - Full array of all filter configs
|
|
11
|
+
* @param {Object|null} preSelectedFilters - Optional pre-selected filters from init response
|
|
12
|
+
* Format: { param_name: { values: [...], label, dimension, is_mandatory } }
|
|
11
13
|
* @returns {Promise<Array<{label, value}>>} - Formatted options
|
|
12
14
|
*/
|
|
13
|
-
export declare const fetchCrossFilterOptions: (filterConfig: any, existingSelections?: any[], allFilters?: any[]) => Promise<{
|
|
15
|
+
export declare const fetchCrossFilterOptions: (filterConfig: any, existingSelections?: any[], allFilters?: any[], preSelectedFilters?: any) => Promise<{
|
|
14
16
|
label: any;
|
|
15
17
|
value: string;
|
|
16
18
|
}[]>;
|
package/dist/index.cjs.js
CHANGED
|
@@ -255,11 +255,12 @@ const getFilterOptions = (postBody) => async () => {
|
|
|
255
255
|
data: postBody,
|
|
256
256
|
});
|
|
257
257
|
};
|
|
258
|
-
const getTableRecords = async (baseUrl, tableName
|
|
258
|
+
const getTableRecords = async (payload, baseUrl, tableName) => {
|
|
259
259
|
try {
|
|
260
260
|
return axiosInstance({
|
|
261
|
-
url: `${baseUrl}/chatbot/agent/tabular-data/${tableName}
|
|
262
|
-
method: '
|
|
261
|
+
url: `${baseUrl}/chatbot/agent/tabular-data/${tableName}`,
|
|
262
|
+
method: 'POST',
|
|
263
|
+
data: payload,
|
|
263
264
|
});
|
|
264
265
|
}
|
|
265
266
|
catch (error) {
|
|
@@ -5879,7 +5880,16 @@ const TableContent = ({ bodyText }) => {
|
|
|
5879
5880
|
const serverSideManualCallBack = async (manualbody, pageIndex, params) => {
|
|
5880
5881
|
try {
|
|
5881
5882
|
const baseUrl = sessionStorage.getItem("stepForm_baseUrl") || "";
|
|
5882
|
-
|
|
5883
|
+
let limit = {
|
|
5884
|
+
page_size: page_size,
|
|
5885
|
+
page: pageIndex + 1,
|
|
5886
|
+
};
|
|
5887
|
+
let payload = {
|
|
5888
|
+
limit,
|
|
5889
|
+
search: manualbody?.search,
|
|
5890
|
+
sort: manualbody?.sort
|
|
5891
|
+
};
|
|
5892
|
+
const response = await getTableRecords(payload, baseUrl, table_name);
|
|
5883
5893
|
if (is_server_side || response?.data?.download_url) {
|
|
5884
5894
|
setDownloadUrl(response.data.download_url);
|
|
5885
5895
|
}
|
|
@@ -5932,12 +5942,12 @@ const TableContent = ({ bodyText }) => {
|
|
|
5932
5942
|
const handleModalClose = () => {
|
|
5933
5943
|
setIsModalOpen(false);
|
|
5934
5944
|
};
|
|
5935
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(impactUiV3.Modal, { className: "test-modal", onClose: handleModalClose, onPrimaryButtonClick: () => { }, onSecondaryButtonClick: handleModalClose, open: isModalOpen, size: "large", title: "", children: jsxRuntime.jsx("div", { style: { width: '100%', height: '70vh' }, children: jsxRuntime.jsx(AgGridComponent, { columns: columns, rowdata: is_server_side ? null : rowData, pagination: true, paginationPageSize: is_server_side ? page_size : 20, suppressFieldDotNotation: true, domLayout: "normal", sizeColumnsToFitFlag: true, showSaveTableConfig: false, showSearchModalBtn:
|
|
5945
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(impactUiV3.Modal, { className: "test-modal", onClose: handleModalClose, onPrimaryButtonClick: () => { }, onSecondaryButtonClick: handleModalClose, open: isModalOpen, size: "large", title: "", children: jsxRuntime.jsx("div", { style: { width: '100%', height: '70vh' }, children: jsxRuntime.jsx(AgGridComponent, { columns: columns, rowdata: is_server_side ? null : rowData, pagination: true, paginationPageSize: is_server_side ? page_size : 20, suppressFieldDotNotation: true, domLayout: "normal", sizeColumnsToFitFlag: true, showSaveTableConfig: false, showSearchModalBtn: true, hideFormatSideBar: true, uniqueRowId: unique_id, selectAllHeaderComponent: select_all_component, onSelectionChanged: onSelectionChanged, hideTableSetting: hide_table_setting, downloadAsExcel: is_server_side ? false : true, tableHeader: display_name, hideTableActions: true, isSaveViewEnabled: false, ...(is_server_side && {
|
|
5936
5946
|
manualCallBack: serverSideManualCallBack,
|
|
5937
5947
|
rowModelType: "serverSide",
|
|
5938
5948
|
serverSideStoreType: "partial",
|
|
5939
5949
|
cacheBlockSize: page_size,
|
|
5940
|
-
}) }) }) }), jsxRuntime.jsx("div", { style: { width: '100%', marginTop: '10px' }, children: jsxRuntime.jsx(AgGridComponent, { columns: columns, rowdata: is_server_side ? null : rowData, pagination: true, paginationPageSize: is_server_side ? page_size : 10, suppressFieldDotNotation: true, domLayout: "autoHeight", customClass: "bot_table_auto_height", sizeColumnsToFitFlag: true, showSaveTableConfig: false, showSearchModalBtn:
|
|
5950
|
+
}) }) }) }), jsxRuntime.jsx("div", { style: { width: '100%', marginTop: '10px' }, children: jsxRuntime.jsx(AgGridComponent, { columns: columns, rowdata: is_server_side ? null : rowData, pagination: true, paginationPageSize: is_server_side ? page_size : 10, suppressFieldDotNotation: true, domLayout: "autoHeight", customClass: "bot_table_auto_height", sizeColumnsToFitFlag: true, showSaveTableConfig: false, showSearchModalBtn: true, hideFormatSideBar: true, uniqueRowId: unique_id, selectAllHeaderComponent: select_all_component, onSelectionChanged: onSelectionChanged, hideTableSetting: hide_table_setting, customSystemButton: getTopRightOptions(), customSystemButtonWithDownload: !is_server_side, topRightOptions: null, downloadAsExcel: is_server_side ? false : true, tableHeader: display_name, hideTableActions: true, isSaveViewEnabled: false, ...(is_server_side && {
|
|
5941
5951
|
manualCallBack: serverSideManualCallBack,
|
|
5942
5952
|
rowModelType: "serverSide",
|
|
5943
5953
|
serverSideStoreType: "partial",
|
|
@@ -6620,9 +6630,11 @@ const CrossFilterProvider = ({ filters, fetchOptionsFn, initialSelections = {},
|
|
|
6620
6630
|
* @param {Array} existingSelections - Upstream filter selections
|
|
6621
6631
|
* Each item: { filterName, attributeName, values, checkAll }
|
|
6622
6632
|
* @param {Array} allFilters - Full array of all filter configs
|
|
6633
|
+
* @param {Object|null} preSelectedFilters - Optional pre-selected filters from init response
|
|
6634
|
+
* Format: { param_name: { values: [...], label, dimension, is_mandatory } }
|
|
6623
6635
|
* @returns {Promise<Array<{label, value}>>} - Formatted options
|
|
6624
6636
|
*/
|
|
6625
|
-
const fetchCrossFilterOptions = async (filterConfig, existingSelections = [], allFilters = []) => {
|
|
6637
|
+
const fetchCrossFilterOptions = async (filterConfig, existingSelections = [], allFilters = [], preSelectedFilters = null) => {
|
|
6626
6638
|
try {
|
|
6627
6639
|
const attributeName = filterConfig.column_name ||
|
|
6628
6640
|
filterConfig.attribute_name ||
|
|
@@ -6655,6 +6667,39 @@ const fetchCrossFilterOptions = async (filterConfig, existingSelections = [], al
|
|
|
6655
6667
|
display_order: fullConfig?.display_order || fullConfig?.ordering || 0,
|
|
6656
6668
|
};
|
|
6657
6669
|
});
|
|
6670
|
+
// Build pre-selected filter entries from init response (if provided)
|
|
6671
|
+
// These are always included in the payload alongside user selections
|
|
6672
|
+
const preSelectedEntries = [];
|
|
6673
|
+
if (preSelectedFilters && typeof preSelectedFilters === "object") {
|
|
6674
|
+
Object.entries(preSelectedFilters).forEach(([key, config]) => {
|
|
6675
|
+
// Skip if this filter is the one we're fetching options for
|
|
6676
|
+
if (key === attributeName)
|
|
6677
|
+
return;
|
|
6678
|
+
// Skip if user has already selected values for this filter (user selection takes precedence)
|
|
6679
|
+
const userAlreadySelected = filtersArray.some((f) => f.attribute_name === key || f.filter_id === key);
|
|
6680
|
+
if (userAlreadySelected)
|
|
6681
|
+
return;
|
|
6682
|
+
const values = Array.isArray(config.values) ? config.values : [];
|
|
6683
|
+
if (values.length === 0)
|
|
6684
|
+
return;
|
|
6685
|
+
preSelectedEntries.push({
|
|
6686
|
+
filter_name: config.label || key,
|
|
6687
|
+
filter_id: key,
|
|
6688
|
+
filter_type: "cascaded",
|
|
6689
|
+
dimension: config.dimension || dimension,
|
|
6690
|
+
display_type: "dropdown",
|
|
6691
|
+
check_configuration: [],
|
|
6692
|
+
is_mandatory: config.is_mandatory || false,
|
|
6693
|
+
extra: {},
|
|
6694
|
+
values: values,
|
|
6695
|
+
attribute_name: key,
|
|
6696
|
+
operator: "in",
|
|
6697
|
+
display_order: 0,
|
|
6698
|
+
});
|
|
6699
|
+
});
|
|
6700
|
+
}
|
|
6701
|
+
// Merge: pre-selected filters first, then user selections
|
|
6702
|
+
const combinedFilters = [...preSelectedEntries, ...filtersArray];
|
|
6658
6703
|
const payload = {
|
|
6659
6704
|
attributes: [
|
|
6660
6705
|
{
|
|
@@ -6664,7 +6709,7 @@ const fetchCrossFilterOptions = async (filterConfig, existingSelections = [], al
|
|
|
6664
6709
|
},
|
|
6665
6710
|
],
|
|
6666
6711
|
filter_type: "cascaded",
|
|
6667
|
-
filters:
|
|
6712
|
+
filters: combinedFilters,
|
|
6668
6713
|
is_urm_filter: true,
|
|
6669
6714
|
screen_name: "Chatbot",
|
|
6670
6715
|
application_code: 1,
|
|
@@ -6779,11 +6824,15 @@ const SelectContent = ({ bodyText, isFormDisabled = false, messageIndex }) => {
|
|
|
6779
6824
|
const [currentOptions, setCurrentOptions] = React.useState([]);
|
|
6780
6825
|
const persistedFormValues = reactRedux.useSelector((state) => state.smartBotReducer.persistedFormValues);
|
|
6781
6826
|
const [currentSelectedOptions, setCurrentSelectedOptions] = React.useState(persistedFormValues?.[formKey] || []);
|
|
6782
|
-
const
|
|
6827
|
+
const selectAllKey = `${formKey}__selectAllCount`;
|
|
6828
|
+
const [isAllSelected, setIsAllSelected] = React.useState(() => {
|
|
6829
|
+
return (persistedFormValues?.[selectAllKey] || 0) > 0;
|
|
6830
|
+
});
|
|
6783
6831
|
const [initialOptions, setInitialOptions] = React.useState([]);
|
|
6784
6832
|
const allOptionsRef = React.useRef([]);
|
|
6785
6833
|
const isSearchActiveRef = React.useRef(false);
|
|
6786
6834
|
const searchTermRef = React.useRef("");
|
|
6835
|
+
const selectAllCountRef = React.useRef(persistedFormValues?.[selectAllKey] || 0);
|
|
6787
6836
|
const chatbotContext = reactRedux.useSelector((state) => state.smartBotReducer.chatbotContext);
|
|
6788
6837
|
const heirarchyKeyValuePairs = reactRedux.useSelector((state) => state.smartBotReducer.heirarchyKeyValuePairs);
|
|
6789
6838
|
const dispatch = reactRedux.useDispatch();
|
|
@@ -6924,16 +6973,16 @@ const SelectContent = ({ bodyText, isFormDisabled = false, messageIndex }) => {
|
|
|
6924
6973
|
updated: true,
|
|
6925
6974
|
},
|
|
6926
6975
|
}));
|
|
6927
|
-
dispatch(smartBotActions.setPersistedFormValues({ [formKey]: [] }));
|
|
6976
|
+
dispatch(smartBotActions.setPersistedFormValues({ [formKey]: [], [selectAllKey]: 0 }));
|
|
6928
6977
|
// Notify cross-filter context to clear downstream filters
|
|
6929
6978
|
if (isCascading) {
|
|
6930
6979
|
crossFilterCtx.onFilterChange(paramName, []);
|
|
6931
6980
|
}
|
|
6932
6981
|
}, handleChange: (selected) => onChange(selected), isCloseWhenClickOutside: true, setIsOpen: (open) => {
|
|
6933
6982
|
setIsOpen(open);
|
|
6934
|
-
// When dropdown closes after a filtered select-all on a subset,
|
|
6935
|
-
// reset the isAllSelected flag
|
|
6936
|
-
if (!open && isAllSelected &&
|
|
6983
|
+
// When dropdown closes after a search-filtered select-all on a subset,
|
|
6984
|
+
// reset the isAllSelected flag since only a subset was selected
|
|
6985
|
+
if (!open && isAllSelected && isSearchActiveRef.current) {
|
|
6937
6986
|
setIsAllSelected(false);
|
|
6938
6987
|
}
|
|
6939
6988
|
if (isCascading) {
|
|
@@ -6973,6 +7022,8 @@ const SelectContent = ({ bodyText, isFormDisabled = false, messageIndex }) => {
|
|
|
6973
7022
|
const nextOptions = [...currentOptions, ...newBatch];
|
|
6974
7023
|
setCurrentOptions(nextOptions);
|
|
6975
7024
|
setInitialOptions(nextOptions);
|
|
7025
|
+
// When all are selected, mark newly loaded items as selected too
|
|
7026
|
+
// so they render with checkmarks in the dropdown
|
|
6976
7027
|
if (isAllSelected) {
|
|
6977
7028
|
setCurrentSelectedOptions(nextOptions);
|
|
6978
7029
|
}
|
|
@@ -6981,17 +7032,20 @@ const SelectContent = ({ bodyText, isFormDisabled = false, messageIndex }) => {
|
|
|
6981
7032
|
if (e && e.target.checked) {
|
|
6982
7033
|
// When search is active, select only the filtered/visible options
|
|
6983
7034
|
// When no search is active, select ALL options from the full dataset
|
|
6984
|
-
|
|
7035
|
+
// but only render the currently visible chunk to avoid 100k+ DOM nodes
|
|
6985
7036
|
let valuesToDispatch;
|
|
6986
7037
|
if (isSearchActiveRef.current) {
|
|
6987
|
-
|
|
7038
|
+
// Search-filtered select all: only select the visible filtered options
|
|
6988
7039
|
valuesToDispatch = currentOptions.map((opt) => opt.value);
|
|
7040
|
+
setCurrentSelectedOptions([...currentOptions]);
|
|
7041
|
+
selectAllCountRef.current = currentOptions.length;
|
|
6989
7042
|
}
|
|
6990
7043
|
else {
|
|
6991
|
-
|
|
7044
|
+
// Full select all: select all options but only render the visible chunk
|
|
6992
7045
|
valuesToDispatch = allOptionsRef.current.map((opt) => opt.value);
|
|
7046
|
+
setCurrentSelectedOptions([...currentOptions]);
|
|
7047
|
+
selectAllCountRef.current = allOptionsRef.current.length;
|
|
6993
7048
|
}
|
|
6994
|
-
setCurrentSelectedOptions(optionsToSelect);
|
|
6995
7049
|
setIsAllSelected(true);
|
|
6996
7050
|
dispatch(smartBotActions.setChatbotContext({
|
|
6997
7051
|
...chatbotContext,
|
|
@@ -7001,7 +7055,11 @@ const SelectContent = ({ bodyText, isFormDisabled = false, messageIndex }) => {
|
|
|
7001
7055
|
updated: true,
|
|
7002
7056
|
},
|
|
7003
7057
|
}));
|
|
7004
|
-
|
|
7058
|
+
// Persist only the currently visible options (not all 100k+) to avoid Redux memory bloat
|
|
7059
|
+
dispatch(smartBotActions.setPersistedFormValues({
|
|
7060
|
+
[formKey]: [...currentOptions],
|
|
7061
|
+
[selectAllKey]: selectAllCountRef.current,
|
|
7062
|
+
}));
|
|
7005
7063
|
// Notify cross-filter context if cascading is active
|
|
7006
7064
|
if (isCascading) {
|
|
7007
7065
|
crossFilterCtx.onFilterChange(paramName, valuesToDispatch);
|
|
@@ -7018,15 +7076,17 @@ const SelectContent = ({ bodyText, isFormDisabled = false, messageIndex }) => {
|
|
|
7018
7076
|
updated: true,
|
|
7019
7077
|
},
|
|
7020
7078
|
}));
|
|
7021
|
-
dispatch(smartBotActions.setPersistedFormValues({ [formKey]: [] }));
|
|
7079
|
+
dispatch(smartBotActions.setPersistedFormValues({ [formKey]: [], [selectAllKey]: 0 }));
|
|
7022
7080
|
// Notify cross-filter context of deselection
|
|
7023
7081
|
if (isCascading) {
|
|
7024
7082
|
crossFilterCtx.onFilterChange(paramName, []);
|
|
7025
7083
|
}
|
|
7026
7084
|
}
|
|
7027
|
-
}, customPlaceholderAfterSelect:
|
|
7028
|
-
?
|
|
7029
|
-
:
|
|
7085
|
+
}, customPlaceholderAfterSelect: isAllSelected
|
|
7086
|
+
? selectAllCountRef.current
|
|
7087
|
+
: currentSelectedOptions.length > 0
|
|
7088
|
+
? currentSelectedOptions.length
|
|
7089
|
+
: null }) }));
|
|
7030
7090
|
};
|
|
7031
7091
|
|
|
7032
7092
|
const DatePickerContent = ({ bodyText, isFormDisabled = false, messageIndex }) => {
|
|
@@ -7242,7 +7302,7 @@ const STEP_FORM_TIMEOUT_KEY = "__stepFormTimedOut";
|
|
|
7242
7302
|
* @param {Array} props.formData - Array of raw widget_data items from step_form chunk
|
|
7243
7303
|
* @param {number} props.messageIndex - Index for form state persistence keys
|
|
7244
7304
|
*/
|
|
7245
|
-
const StepFormContent = ({ formData, messageIndex = 0, isFormDisabled = false, showSavedFilters = true }) => {
|
|
7305
|
+
const StepFormContent = ({ formData, messageIndex = 0, isFormDisabled = false, showSavedFilters = true, preSelectedFilters = null }) => {
|
|
7246
7306
|
const dispatch = reactRedux.useDispatch();
|
|
7247
7307
|
const savedFilterSets = reactRedux.useSelector((state) => state.smartBotReducer.savedFilterSets);
|
|
7248
7308
|
const persistedFormValues = reactRedux.useSelector((state) => state.smartBotReducer.persistedFormValues);
|
|
@@ -7559,7 +7619,7 @@ const StepFormContent = ({ formData, messageIndex = 0, isFormDisabled = false, s
|
|
|
7559
7619
|
return null;
|
|
7560
7620
|
return (jsxRuntime.jsxs("div", { className: "step-form-content", children: [showSavedFilters && filterSetOptions.length > 0 && (jsxRuntime.jsx("div", { style: { width: "100%", marginTop: "10px" }, children: jsxRuntime.jsx(impactUiV3.Select, { currentOptions: filterSetCurrentOptions, setCurrentOptions: setFilterSetCurrentOptions, label: "Saved Filter Sets", labelOrientation: "top", isRequired: false, isDisabled: savedFilterDisabled, handleChange: (selected) => onFilterSetChange(selected), isCloseWhenClickOutside: true, setIsOpen: setIsFilterSetOpen, isOpen: isFilterSetOpen, selectedOptions: selectedFilterSet, setSelectedOptions: setSelectedFilterSet, initialOptions: filterSetOptions, isMulti: false, isClearable: true }) })), showSavedFilters && filterSetOptions.length > 0 && (jsxRuntime.jsx("hr", { style: { border: "none", borderTop: "1px solid #E0E0E0", margin: "12px 0" } })), jsxRuntime.jsx("div", { style: {
|
|
7561
7621
|
...(isFilterSelected && !isFormDisabled ? { pointerEvents: "none", opacity: 0.5 } : {}),
|
|
7562
|
-
}, children: crossFilterConfigs.length
|
|
7622
|
+
}, children: crossFilterConfigs.length >= 1 ? (jsxRuntime.jsx(CrossFilterProvider, { filters: crossFilterConfigs, fetchOptionsFn: (filterConfig, existingSelections, allFilters) => fetchCrossFilterOptions(filterConfig, existingSelections, allFilters, preSelectedFilters), initialSelections: crossFilterInitialSelections, fetchOnMount: false, children: formFields })) : (formFields) }), buttonItems] }));
|
|
7563
7623
|
};
|
|
7564
7624
|
/** Reset the timeout flag (call when a new conversation/message starts) */
|
|
7565
7625
|
const resetStepFormTimeoutFlag = () => {
|
|
@@ -7835,7 +7895,7 @@ const getQuestionStatus$1 = (questionSteps) => {
|
|
|
7835
7895
|
/**
|
|
7836
7896
|
* Renders a single progress bar item (main point + sub-items)
|
|
7837
7897
|
*/
|
|
7838
|
-
const ProgressBarItem$1 = ({ question, questionSteps, isLast, classes, formData, showSavedFilters = true, isFormDisabled, onAllSubItemsAnimated = undefined }) => {
|
|
7898
|
+
const ProgressBarItem$1 = ({ question, questionSteps, isLast, classes, formData, showSavedFilters = true, preSelectedFilters = null, isFormDisabled, onAllSubItemsAnimated = undefined }) => {
|
|
7839
7899
|
const status = getQuestionStatus$1(questionSteps);
|
|
7840
7900
|
const animatedCountRef = React.useRef(0);
|
|
7841
7901
|
const [isExpanded, setIsExpanded] = React.useState(true);
|
|
@@ -7868,7 +7928,7 @@ const ProgressBarItem$1 = ({ question, questionSteps, isLast, classes, formData,
|
|
|
7868
7928
|
if (animatedCountRef.current >= arr.length && onAllSubItemsAnimated) {
|
|
7869
7929
|
onAllSubItemsAnimated();
|
|
7870
7930
|
}
|
|
7871
|
-
} }) }, idx))) })), formData && isExpanded && (jsxRuntime.jsx("div", { className: classes.stepFormContainer, children: jsxRuntime.jsx(StepFormContent, { formData: formData, isFormDisabled: isFormDisabled, showSavedFilters: showSavedFilters }) }))] })] }));
|
|
7931
|
+
} }) }, idx))) })), formData && isExpanded && (jsxRuntime.jsx("div", { className: classes.stepFormContainer, children: jsxRuntime.jsx(StepFormContent, { formData: formData, isFormDisabled: isFormDisabled, showSavedFilters: showSavedFilters, preSelectedFilters: preSelectedFilters }) }))] })] }));
|
|
7872
7932
|
};
|
|
7873
7933
|
const Steps$1 = ({ steps, setSteps, done, setTabValue, setDone, finalStepDone, setFinalStepDone, stepChange, currentMode, questions = [], questionsStepsMap = {}, stepFormDataMap = {}, isFormDisabled = false, }) => {
|
|
7874
7934
|
const classes = useStyles$4();
|
|
@@ -7951,8 +8011,9 @@ const Steps$1 = ({ steps, setSteps, done, setTabValue, setDone, finalStepDone, s
|
|
|
7951
8011
|
const formEntry = stepFormDataMap[question] || null;
|
|
7952
8012
|
const formData = formEntry ? (Array.isArray(formEntry) ? formEntry : formEntry.widgets) : null;
|
|
7953
8013
|
const showSavedFilters = formEntry && !Array.isArray(formEntry) ? formEntry.showSavedFilters : true;
|
|
8014
|
+
const preSelectedFilters = formEntry && !Array.isArray(formEntry) ? formEntry.preSelectedFilters : null;
|
|
7954
8015
|
const isLast = index === questions.length - 1;
|
|
7955
|
-
return (jsxRuntime.jsx(ProgressBarItem$1, { question: question, questionSteps: questionSteps, isLast: isLast && !showThinking, classes: classes, formData: formData, isFormDisabled: isFormDisabled, showSavedFilters: showSavedFilters, onAllSubItemsAnimated: isLast && lastQuestionCompleted && !done
|
|
8016
|
+
return (jsxRuntime.jsx(ProgressBarItem$1, { question: question, questionSteps: questionSteps, isLast: isLast && !showThinking, classes: classes, formData: formData, isFormDisabled: isFormDisabled, showSavedFilters: showSavedFilters, preSelectedFilters: preSelectedFilters, onAllSubItemsAnimated: isLast && lastQuestionCompleted && !done
|
|
7956
8017
|
? () => setShowThinking(true)
|
|
7957
8018
|
: undefined }, index));
|
|
7958
8019
|
}), showThinking && !done && (jsxRuntime.jsx("div", { style: {
|
|
@@ -8770,6 +8831,7 @@ const StreamedContent = ({ botData }) => {
|
|
|
8770
8831
|
stepFormDataMapRef.current[currentIntent] = {
|
|
8771
8832
|
widgets: [...formWidgetData, stepFormSubmitButton],
|
|
8772
8833
|
showSavedFilters: data.show_saved_filters !== false,
|
|
8834
|
+
preSelectedFilters: data.pre_selected_filters || null,
|
|
8773
8835
|
};
|
|
8774
8836
|
setStepFormDataMap({ ...stepFormDataMapRef.current });
|
|
8775
8837
|
}
|
|
@@ -9708,7 +9770,7 @@ const getQuestionStatus = (questionSteps) => {
|
|
|
9708
9770
|
/**
|
|
9709
9771
|
* Renders a single progress bar item (main point + sub-items)
|
|
9710
9772
|
*/
|
|
9711
|
-
const ProgressBarItem = ({ question, questionSteps, isLast, classes, formData, isFormDisabled, isRestreaming = false, showSavedFilters = true }) => {
|
|
9773
|
+
const ProgressBarItem = ({ question, questionSteps, isLast, classes, formData, isFormDisabled, isRestreaming = false, showSavedFilters = true, preSelectedFilters = null }) => {
|
|
9712
9774
|
const baseStatus = getQuestionStatus(questionSteps);
|
|
9713
9775
|
// When restreaming and this is the last item, show as in-progress
|
|
9714
9776
|
const status = (isRestreaming && isLast) ? "in-progress" : baseStatus;
|
|
@@ -9737,7 +9799,7 @@ const ProgressBarItem = ({ question, questionSteps, isLast, classes, formData, i
|
|
|
9737
9799
|
setIsExpanded(true);
|
|
9738
9800
|
}
|
|
9739
9801
|
}, [status, formData]);
|
|
9740
|
-
return (jsxRuntime.jsxs("div", { className: classes.progressItem, children: [jsxRuntime.jsxs("div", { className: classes.progressTrack, children: [jsxRuntime.jsx("div", { className: `${classes.progressDot} ${dotClass}` }), !isLast && jsxRuntime.jsx("div", { className: `${classes.progressLine} ${lineClass}` })] }), jsxRuntime.jsxs("div", { className: classes.progressContent, children: [jsxRuntime.jsxs("div", { className: classes.progressHeader, onClick: handleToggle, children: [jsxRuntime.jsx("span", { className: `${classes.progressHeaderText} ${textClass}`, children: question }), hasSubItems && (jsxRuntime.jsx(ChevronRightIcon$1, { className: `${classes.progressChevron} ${textClass} ${isExpanded ? "expanded" : ""}` }))] }), hasSubItems && isExpanded && status === "in-progress" && (jsxRuntime.jsxs("div", { className: classes.reasoningLabel, children: [jsxRuntime.jsx(SvgReasoningIcon, {}), "Reasoning..."] })), hasSubItems && isExpanded && (jsxRuntime.jsx("div", { className: classes.progressSubItems, style: { maxHeight: isExpanded ? "500px" : "0", opacity: isExpanded ? 1 : 0 }, children: questionSteps.map((step, idx) => (jsxRuntime.jsxs("div", { className: classes.progressSubItem, children: [step.header, step.sub_header ? ` - ${step.sub_header}` : ""] }, idx))) })), formData && isExpanded && (jsxRuntime.jsx("div", { className: classes.stepFormContainer, children: jsxRuntime.jsx(StepFormContent, { formData: formData, isFormDisabled: isFormDisabled, showSavedFilters: showSavedFilters }) }))] })] }));
|
|
9802
|
+
return (jsxRuntime.jsxs("div", { className: classes.progressItem, children: [jsxRuntime.jsxs("div", { className: classes.progressTrack, children: [jsxRuntime.jsx("div", { className: `${classes.progressDot} ${dotClass}` }), !isLast && jsxRuntime.jsx("div", { className: `${classes.progressLine} ${lineClass}` })] }), jsxRuntime.jsxs("div", { className: classes.progressContent, children: [jsxRuntime.jsxs("div", { className: classes.progressHeader, onClick: handleToggle, children: [jsxRuntime.jsx("span", { className: `${classes.progressHeaderText} ${textClass}`, children: question }), hasSubItems && (jsxRuntime.jsx(ChevronRightIcon$1, { className: `${classes.progressChevron} ${textClass} ${isExpanded ? "expanded" : ""}` }))] }), hasSubItems && isExpanded && status === "in-progress" && (jsxRuntime.jsxs("div", { className: classes.reasoningLabel, children: [jsxRuntime.jsx(SvgReasoningIcon, {}), "Reasoning..."] })), hasSubItems && isExpanded && (jsxRuntime.jsx("div", { className: classes.progressSubItems, style: { maxHeight: isExpanded ? "500px" : "0", opacity: isExpanded ? 1 : 0 }, children: questionSteps.map((step, idx) => (jsxRuntime.jsxs("div", { className: classes.progressSubItem, children: [step.header, step.sub_header ? ` - ${step.sub_header}` : ""] }, idx))) })), formData && isExpanded && (jsxRuntime.jsx("div", { className: classes.stepFormContainer, children: jsxRuntime.jsx(StepFormContent, { formData: formData, isFormDisabled: isFormDisabled, showSavedFilters: showSavedFilters, preSelectedFilters: preSelectedFilters }) }))] })] }));
|
|
9741
9803
|
};
|
|
9742
9804
|
const Steps = ({ steps, questions = [], questionsStepsMap = {}, stepFormDataMap = {}, isFormDisabled = false, activeFormIntent = null, isRestreaming = false }) => {
|
|
9743
9805
|
const classes = useStyles$3();
|
|
@@ -9763,11 +9825,12 @@ const Steps = ({ steps, questions = [], questionsStepsMap = {}, stepFormDataMap
|
|
|
9763
9825
|
// Support both old array format and new object format { widgets, showSavedFilters }
|
|
9764
9826
|
const formData = formEntry ? (Array.isArray(formEntry) ? formEntry : formEntry.widgets) : null;
|
|
9765
9827
|
const showSavedFilters = formEntry && !Array.isArray(formEntry) ? formEntry.showSavedFilters : true;
|
|
9828
|
+
const preSelectedFilters = formEntry && !Array.isArray(formEntry) ? formEntry.preSelectedFilters : null;
|
|
9766
9829
|
// If activeFormIntent is set, only the matching form is enabled; all others stay disabled
|
|
9767
9830
|
const formDisabledForThis = activeFormIntent
|
|
9768
9831
|
? question !== activeFormIntent
|
|
9769
9832
|
: isFormDisabled;
|
|
9770
|
-
return (jsxRuntime.jsx(ProgressBarItem, { question: question, questionSteps: questionSteps, isLast: index === questions.length - 1, classes: classes, formData: formData, isFormDisabled: formDisabledForThis, isRestreaming: isRestreaming, showSavedFilters: showSavedFilters }, index));
|
|
9833
|
+
return (jsxRuntime.jsx(ProgressBarItem, { question: question, questionSteps: questionSteps, isLast: index === questions.length - 1, classes: classes, formData: formData, isFormDisabled: formDisabledForThis, isRestreaming: isRestreaming, showSavedFilters: showSavedFilters, preSelectedFilters: preSelectedFilters }, index));
|
|
9771
9834
|
}) }));
|
|
9772
9835
|
};
|
|
9773
9836
|
|
|
@@ -10026,6 +10089,7 @@ const TabularContent = ({ steps: initialSteps, currentTabValue, children, questi
|
|
|
10026
10089
|
newStepFormDataMap[currentIntent] = {
|
|
10027
10090
|
widgets: [...formWidgetData, submitButton],
|
|
10028
10091
|
showSavedFilters: data.show_saved_filters !== false,
|
|
10092
|
+
preSelectedFilters: data.pre_selected_filters || null,
|
|
10029
10093
|
};
|
|
10030
10094
|
}
|
|
10031
10095
|
}
|
|
@@ -10152,6 +10216,7 @@ const TabularContent = ({ steps: initialSteps, currentTabValue, children, questi
|
|
|
10152
10216
|
newStepFormDataMap[currentIntent] = {
|
|
10153
10217
|
widgets: [...formWidgetData, submitButton],
|
|
10154
10218
|
showSavedFilters: data.show_saved_filters !== false,
|
|
10219
|
+
preSelectedFilters: data.pre_selected_filters || null,
|
|
10155
10220
|
};
|
|
10156
10221
|
}
|
|
10157
10222
|
}
|