lisichatbot 1.0.5 → 1.0.7
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 +26 -10
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -140,6 +140,13 @@ function renderOptions(options, field, isSingleSelect = true) {
|
|
|
140
140
|
// Clone existing option element
|
|
141
141
|
const clone = existingOption.cloneNode(true);
|
|
142
142
|
|
|
143
|
+
// Make clone visible (remove display:none from template)
|
|
144
|
+
clone.style.display = '';
|
|
145
|
+
|
|
146
|
+
// Reset to unchecked state
|
|
147
|
+
clone.classList.remove('cf-checked');
|
|
148
|
+
clone.style.backgroundColor = 'transparent';
|
|
149
|
+
|
|
143
150
|
// Set data attributes on container
|
|
144
151
|
clone.setAttribute('data-chat-element', inputTypeAttr);
|
|
145
152
|
clone.setAttribute('data-field', field);
|
|
@@ -153,12 +160,22 @@ function renderOptions(options, field, isSingleSelect = true) {
|
|
|
153
160
|
input.setAttribute('data-chat-element', inputTypeAttr);
|
|
154
161
|
input.name = field;
|
|
155
162
|
input.value = valueStr;
|
|
163
|
+
input.checked = false; // Ensure unchecked initially
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// Find and ensure tick icon is hidden initially
|
|
167
|
+
const tickIcon = clone.querySelector('[data-chat-input-element="tick-icon"]');
|
|
168
|
+
if (tickIcon) {
|
|
169
|
+
tickIcon.style.display = 'none';
|
|
156
170
|
}
|
|
157
171
|
|
|
158
172
|
// Find and set text
|
|
159
173
|
const textElement = clone.querySelector('[data-chat-input-element="text"]');
|
|
160
174
|
if (textElement) {
|
|
161
175
|
textElement.textContent = optionName;
|
|
176
|
+
textElement.style.display = ''; // Make sure text is visible
|
|
177
|
+
} else {
|
|
178
|
+
console.error('Text element not found in option');
|
|
162
179
|
}
|
|
163
180
|
|
|
164
181
|
// Append to wrapper
|
|
@@ -554,7 +571,7 @@ function injectStyles() {
|
|
|
554
571
|
margin-bottom: 16px;
|
|
555
572
|
}
|
|
556
573
|
|
|
557
|
-
/* Options wrapper spacing
|
|
574
|
+
/* Options wrapper spacing */
|
|
558
575
|
[data-chat-element="options-wrapper"] {
|
|
559
576
|
margin-bottom: 20px;
|
|
560
577
|
display: flex;
|
|
@@ -562,17 +579,16 @@ function injectStyles() {
|
|
|
562
579
|
gap: 12px;
|
|
563
580
|
}
|
|
564
581
|
|
|
565
|
-
/*
|
|
566
|
-
[data-chat-
|
|
567
|
-
|
|
582
|
+
/* Ensure checked state shows background color */
|
|
583
|
+
[data-chat-element="single-select-input"].cf-checked,
|
|
584
|
+
[data-chat-element="multi-select-input"].cf-checked {
|
|
585
|
+
background-color: var(--selected-bg, #667eea) !important;
|
|
568
586
|
}
|
|
569
587
|
|
|
570
|
-
/*
|
|
571
|
-
[data-chat-element="single-select-input"],
|
|
572
|
-
[data-chat-element="multi-select-input"] {
|
|
573
|
-
|
|
574
|
-
max-width: 100%;
|
|
575
|
-
display: inline-flex;
|
|
588
|
+
/* Ensure tick icon shows when checked */
|
|
589
|
+
[data-chat-element="single-select-input"].cf-checked [data-chat-input-element="tick-icon"],
|
|
590
|
+
[data-chat-element="multi-select-input"].cf-checked [data-chat-input-element="tick-icon"] {
|
|
591
|
+
display: block !important;
|
|
576
592
|
}
|
|
577
593
|
|
|
578
594
|
/* Messages container padding */
|