lisichatbot 1.2.8 ā 1.2.9
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 -8
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -671,14 +671,15 @@ function renderMinMaxInputs(field, customConfig, existingData) {
|
|
|
671
671
|
Array.isArray(existingData) &&
|
|
672
672
|
existingData.length === 2;
|
|
673
673
|
|
|
674
|
-
rangeWrapper.style.display = showMinMax ? '' : 'none';
|
|
674
|
+
rangeWrapper.style.display = showMinMax ? 'flex' : 'none'; // Keep flex when visible!
|
|
675
675
|
|
|
676
676
|
// Clone and setup min input
|
|
677
677
|
const minClone = minTemplate.cloneNode(true);
|
|
678
678
|
minClone.style.display = '';
|
|
679
|
-
minClone.style.marginRight = '16px'; //
|
|
679
|
+
minClone.style.marginRight = '16px'; // Horizontal gap
|
|
680
|
+
minClone.style.marginBottom = '12px'; // Bottom margin if wraps
|
|
680
681
|
minClone.style.width = 'auto'; // Don't stretch
|
|
681
|
-
minClone.style.flex = '
|
|
682
|
+
minClone.style.flex = 'none'; // Don't grow or shrink
|
|
682
683
|
minClone.setAttribute('data-field', field);
|
|
683
684
|
|
|
684
685
|
const minInput = minClone.querySelector('[data-chat-input-element="input"]');
|
|
@@ -699,8 +700,9 @@ function renderMinMaxInputs(field, customConfig, existingData) {
|
|
|
699
700
|
// Clone and setup max input
|
|
700
701
|
const maxClone = maxTemplate.cloneNode(true);
|
|
701
702
|
maxClone.style.display = '';
|
|
703
|
+
maxClone.style.marginBottom = '12px'; // Bottom margin if wraps
|
|
702
704
|
maxClone.style.width = 'auto'; // Don't stretch
|
|
703
|
-
maxClone.style.flex = '
|
|
705
|
+
maxClone.style.flex = 'none'; // Don't grow or shrink
|
|
704
706
|
maxClone.setAttribute('data-field', field);
|
|
705
707
|
|
|
706
708
|
const maxInput = maxClone.querySelector('[data-chat-input-element="input"]');
|
|
@@ -801,7 +803,7 @@ function selectCustomOption(field) {
|
|
|
801
803
|
// Show min/max inputs
|
|
802
804
|
const rangeWrapper = document.querySelector(`[data-chat-element="range-wrapper"][data-field="${field}"]`);
|
|
803
805
|
if (rangeWrapper) {
|
|
804
|
-
rangeWrapper.style.display = '';
|
|
806
|
+
rangeWrapper.style.display = 'flex'; // Keep flex!
|
|
805
807
|
}
|
|
806
808
|
}
|
|
807
809
|
|
|
@@ -831,7 +833,7 @@ function handleCustomSelectClick(element, field, customConfig) {
|
|
|
831
833
|
// Show min/max inputs
|
|
832
834
|
const rangeWrapper = document.querySelector(`[data-chat-element="range-wrapper"][data-field="${field}"]`);
|
|
833
835
|
if (rangeWrapper) {
|
|
834
|
-
rangeWrapper.style.display = '';
|
|
836
|
+
rangeWrapper.style.display = 'flex'; // Keep flex!
|
|
835
837
|
}
|
|
836
838
|
|
|
837
839
|
// Don't save data yet - wait for validation
|
|
@@ -891,12 +893,18 @@ function handleCustomSelectClick(element, field, customConfig) {
|
|
|
891
893
|
function validateMinMax(field, customConfig) {
|
|
892
894
|
console.log(`\nš === VALIDATING MIN/MAX for field: ${field} ===`);
|
|
893
895
|
|
|
894
|
-
|
|
895
|
-
const
|
|
896
|
+
// Fixed selectors - input has all attributes on it directly
|
|
897
|
+
const minInput = document.querySelector(`[data-field="${field}"][data-input-type="min"][data-chat-input-element="input"]`);
|
|
898
|
+
const maxInput = document.querySelector(`[data-field="${field}"][data-input-type="max"][data-chat-input-element="input"]`);
|
|
896
899
|
const errorDiv = document.querySelector(`[data-chat-element="range-error"][data-field="${field}"]`);
|
|
897
900
|
|
|
898
901
|
if (!minInput || !maxInput) {
|
|
899
902
|
console.log('ā Min or Max input not found');
|
|
903
|
+
console.log(' Tried selectors:');
|
|
904
|
+
console.log(` Min: [data-field="${field}"][data-input-type="min"][data-chat-input-element="input"]`);
|
|
905
|
+
console.log(` Max: [data-field="${field}"][data-input-type="max"][data-chat-input-element="input"]`);
|
|
906
|
+
console.log(' Found min:', minInput);
|
|
907
|
+
console.log(' Found max:', maxInput);
|
|
900
908
|
return { valid: false, error: null };
|
|
901
909
|
}
|
|
902
910
|
|