neo.mjs 5.4.4 → 5.4.6
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/apps/ServiceWorker.mjs
CHANGED
package/package.json
CHANGED
package/src/DefaultConfig.mjs
CHANGED
@@ -237,12 +237,12 @@ const DefaultConfig = {
|
|
237
237
|
useVdomWorker: true,
|
238
238
|
/**
|
239
239
|
* buildScripts/injectPackageVersion.mjs will update this value
|
240
|
-
* @default '5.4.
|
240
|
+
* @default '5.4.6'
|
241
241
|
* @memberOf! module:Neo
|
242
242
|
* @name config.version
|
243
243
|
* @type String
|
244
244
|
*/
|
245
|
-
version: '5.4.
|
245
|
+
version: '5.4.6'
|
246
246
|
};
|
247
247
|
|
248
248
|
Object.assign(DefaultConfig, {
|
@@ -247,12 +247,13 @@ class Number extends Text {
|
|
247
247
|
* @protected
|
248
248
|
*/
|
249
249
|
onFocusLeave(data) {
|
250
|
-
let me
|
251
|
-
|
250
|
+
let me = this,
|
251
|
+
stepSizePow = Math.pow(10, me.stepSizeDigits),
|
252
|
+
value = me.value;
|
252
253
|
|
253
254
|
if (value !== null) {
|
254
255
|
value = me.stepSizeDigits > 0 ? parseFloat(value) : parseInt(value);
|
255
|
-
value = value - value % me.stepSize;
|
256
|
+
value = value - Math.round((value % me.stepSize) * stepSizePow) / stepSizePow;
|
256
257
|
value = Math.max(me.minValue, value);
|
257
258
|
value = Math.min(me.maxValue, value);
|
258
259
|
|
@@ -350,6 +351,7 @@ class Number extends Text {
|
|
350
351
|
maxValue = me.maxValue,
|
351
352
|
minValue = me.minValue,
|
352
353
|
stepSize = me.stepSize,
|
354
|
+
stepSizePow = Math.pow(10, me.stepSizeDigits),
|
353
355
|
returnValue = true,
|
354
356
|
errorParam = {maxValue, minValue, stepSize, value};
|
355
357
|
|
@@ -364,7 +366,7 @@ class Number extends Text {
|
|
364
366
|
} else if (Neo.isNumber(minValue) && isNumber && value < minValue) {
|
365
367
|
me[errorField] = me.errorTextMinValue(errorParam);
|
366
368
|
returnValue = false;
|
367
|
-
} else if (value % me.stepSize !== 0) {
|
369
|
+
} else if ((Math.round((value % me.stepSize) * stepSizePow) / stepSizePow) !== 0) {
|
368
370
|
me[errorField] = me.errorTextStepSize(errorParam);
|
369
371
|
returnValue = false;
|
370
372
|
}
|
package/src/form/field/Text.mjs
CHANGED
@@ -1321,7 +1321,7 @@ class Text extends Base {
|
|
1321
1321
|
returnValue = true,
|
1322
1322
|
value = me.value,
|
1323
1323
|
valueLength = value?.toString().length,
|
1324
|
-
isEmpty = !value || valueLength < 1,
|
1324
|
+
isEmpty = value !== 0 && (!value || valueLength < 1),
|
1325
1325
|
errorParam = {maxLength, minLength, valueLength},
|
1326
1326
|
errorText;
|
1327
1327
|
|