lisichatbot 2.2.8 → 2.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +17 -15
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisichatbot",
3
- "version": "2.2.8",
3
+ "version": "2.2.9",
4
4
  "type": "module",
5
5
  "main": "./src/index.js",
6
6
  "exports": {
package/src/index.js CHANGED
@@ -1312,41 +1312,43 @@ function renderMinMaxInputs(field, customConfig, existingData, hasMatchingNormal
1312
1312
  }
1313
1313
 
1314
1314
  minInput.onchange = () => {
1315
- // ✅ Don't auto-select custom option - only select when explicitly clicked
1316
- // Remove non-numeric characters except minus sign at start
1317
1315
  let value = minInput.value.replace(/[^\d-]/g, '');
1318
1316
  if (value.indexOf('-') > 0) {
1319
1317
  value = value.replace(/-/g, '');
1320
1318
  }
1321
1319
  minInput.setAttribute('data-raw-value', value);
1322
-
1323
- // Format with locale string if valid number
1320
+
1324
1321
  if (value && value !== '' && !isNaN(value)) {
1325
1322
  const numValue = Number(value);
1326
- minInput.value = numValue.toLocaleString();
1323
+ minInput.value = config.localeString ? numValue.toLocaleString(config.localeString) : numValue.toLocaleString();
1327
1324
  }
1328
-
1325
+
1329
1326
  updateVisualFeedback();
1330
- // Removed validateMinMax - errors only show on Next button click
1327
+ // Re-validate if error is already shown to clear it when values are corrected
1328
+ const errorDiv = document.querySelector(`[data-chat-element="range-error"][data-field="${field}"]`);
1329
+ if (errorDiv && errorDiv.style.display === 'block') {
1330
+ validateMinMax(field, customConfig, true);
1331
+ }
1331
1332
  };
1332
-
1333
+
1333
1334
  maxInput.onchange = () => {
1334
- // ✅ Don't auto-select custom option - only select when explicitly clicked
1335
- // Remove non-numeric characters except minus sign at start
1336
1335
  let value = maxInput.value.replace(/[^\d-]/g, '');
1337
1336
  if (value.indexOf('-') > 0) {
1338
1337
  value = value.replace(/-/g, '');
1339
1338
  }
1340
1339
  maxInput.setAttribute('data-raw-value', value);
1341
-
1342
- // Format with locale string if valid number
1340
+
1343
1341
  if (value && value !== '' && !isNaN(value)) {
1344
1342
  const numValue = Number(value);
1345
- maxInput.value = numValue.toLocaleString();
1343
+ maxInput.value = config.localeString ? numValue.toLocaleString(config.localeString) : numValue.toLocaleString();
1346
1344
  }
1347
-
1345
+
1348
1346
  updateVisualFeedback();
1349
- // Removed validateMinMax - errors only show on Next button click
1347
+ // Re-validate if error is already shown to clear it when values are corrected
1348
+ const errorDiv = document.querySelector(`[data-chat-element="range-error"][data-field="${field}"]`);
1349
+ if (errorDiv && errorDiv.style.display === 'block') {
1350
+ validateMinMax(field, customConfig, true);
1351
+ }
1350
1352
  };
1351
1353
  }
1352
1354
  }