lisichatbot 2.0.7 ā 2.0.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/package.json +1 -1
- package/src/index.js +16 -6
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -900,7 +900,15 @@ function renderCustomSelectOptions(options, field, customConfig) {
|
|
|
900
900
|
const hasOverride = chatState.prefillOverrideFields && chatState.prefillOverrideFields.includes(field);
|
|
901
901
|
const disablePrefill = currentStep?.disableInputValuePrefill === true && !hasOverride;
|
|
902
902
|
|
|
903
|
+
console.log(`\nš === PREFILL DEBUG for field: ${field} ===`);
|
|
904
|
+
console.log(` disableInputValuePrefill:`, currentStep?.disableInputValuePrefill);
|
|
905
|
+
console.log(` prefillOverrideFields:`, chatState.prefillOverrideFields);
|
|
906
|
+
console.log(` hasOverride:`, hasOverride);
|
|
907
|
+
console.log(` disablePrefill:`, disablePrefill);
|
|
908
|
+
console.log(` chatState.data[${field}]:`, chatState.data[field]);
|
|
909
|
+
|
|
903
910
|
const existingData = disablePrefill ? null : chatState.data[field];
|
|
911
|
+
console.log(` ā
existingData:`, existingData);
|
|
904
912
|
|
|
905
913
|
if (disablePrefill) {
|
|
906
914
|
console.log(`āļø Pre-fill disabled for ${field} (custom) - starting fresh`);
|
|
@@ -944,15 +952,17 @@ function renderCustomSelectOptions(options, field, customConfig) {
|
|
|
944
952
|
const shouldBeChecked = existingData !== undefined &&
|
|
945
953
|
JSON.stringify(existingData) === JSON.stringify(optionValue);
|
|
946
954
|
|
|
955
|
+
console.log(` š Option "${optionName}": existingData=${JSON.stringify(existingData)} vs optionValue=${JSON.stringify(optionValue)} ā shouldBeChecked=${shouldBeChecked}`);
|
|
956
|
+
|
|
947
957
|
if (shouldBeChecked) {
|
|
948
958
|
clone.classList.add('cf-checked');
|
|
949
|
-
clone.style.
|
|
959
|
+
clone.style.setProperty('background-color', config.selectedBackground, 'important'); // ā
Use !important
|
|
950
960
|
console.log(` ā
Pre-selected: ${optionName}`);
|
|
951
961
|
hasPreselectedOption = true; // ā
Mark that we have a pre-selection
|
|
952
962
|
hasMatchingNormalOption = true; // ā
A normal option matched
|
|
953
963
|
} else {
|
|
954
964
|
clone.classList.remove('cf-checked');
|
|
955
|
-
clone.style.
|
|
965
|
+
clone.style.setProperty('background-color', 'transparent', 'important'); // ā
Use !important
|
|
956
966
|
}
|
|
957
967
|
|
|
958
968
|
clone.setAttribute('data-chat-element', 'single-select-input');
|
|
@@ -971,7 +981,7 @@ function renderCustomSelectOptions(options, field, customConfig) {
|
|
|
971
981
|
|
|
972
982
|
const tickIcon = clone.querySelector('[data-chat-input-element="tick-icon"]');
|
|
973
983
|
if (tickIcon) {
|
|
974
|
-
tickIcon.style.display
|
|
984
|
+
tickIcon.style.setProperty('display', shouldBeChecked ? 'block' : 'none', 'important'); // ā
Use !important
|
|
975
985
|
}
|
|
976
986
|
|
|
977
987
|
const textElement = clone.querySelector('[data-chat-input-element="text"]');
|
|
@@ -994,12 +1004,12 @@ function renderCustomSelectOptions(options, field, customConfig) {
|
|
|
994
1004
|
|
|
995
1005
|
if (isCustomSelected) {
|
|
996
1006
|
customClone.classList.add('cf-checked');
|
|
997
|
-
customClone.style.
|
|
1007
|
+
customClone.style.setProperty('background-color', config.selectedBackground, 'important'); // ā
Use !important
|
|
998
1008
|
console.log(` ā
Pre-selected: Custom Range [${existingData[0]}, ${existingData[1]}]`);
|
|
999
1009
|
hasPreselectedOption = true; // ā
Mark that custom is pre-selected
|
|
1000
1010
|
} else {
|
|
1001
1011
|
customClone.classList.remove('cf-checked');
|
|
1002
|
-
customClone.style.
|
|
1012
|
+
customClone.style.setProperty('background-color', 'transparent', 'important'); // ā
Use !important
|
|
1003
1013
|
}
|
|
1004
1014
|
|
|
1005
1015
|
customClone.setAttribute('data-chat-element', 'single-select-input');
|
|
@@ -1017,7 +1027,7 @@ function renderCustomSelectOptions(options, field, customConfig) {
|
|
|
1017
1027
|
|
|
1018
1028
|
const customTickIcon = customClone.querySelector('[data-chat-input-element="tick-icon"]');
|
|
1019
1029
|
if (customTickIcon) {
|
|
1020
|
-
customTickIcon.style.display
|
|
1030
|
+
customTickIcon.style.setProperty('display', isCustomSelected ? 'block' : 'none', 'important'); // ā
Use !important
|
|
1021
1031
|
}
|
|
1022
1032
|
|
|
1023
1033
|
const customTextElement = customClone.querySelector('[data-chat-input-element="text"]');
|