eru-grid 0.0.69 → 0.0.70

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.
@@ -5842,7 +5842,8 @@ class NumericInputDirective {
5842
5842
  * user necessarily passes through — '', '-', '1.' — none of which parse as a
5843
5843
  * number but all of which are on the way to one.
5844
5844
  */
5845
- isAcceptable(value) {
5845
+ isAcceptable(raw) {
5846
+ const value = raw.replace(/[\s,]/g, '');
5846
5847
  if (value === '')
5847
5848
  return true;
5848
5849
  const sign = this.allowNegative() ? '-?' : '';
@@ -5993,11 +5994,11 @@ class CurrencyComponent {
5993
5994
  // Number('') and Number(null) are both 0, so treating a blank as a number
5994
5995
  // would emit 0 out of every empty cell the user tabs through. Validation
5995
5996
  // still runs on NaN, so a mandatory blank is caught.
5996
- const isBlank = value === null || value === undefined || value === '';
5997
+ const isBlank = value === null || value === undefined || String(value).trim() === '';
5997
5998
  const numValue = isBlank ? NaN : Number(value);
5998
5999
  // Blank goes to validation as-is: it is an empty cell, not the unparseable
5999
6000
  // number NaN would report it as.
6000
- const validation = this.validateField(isBlank ? value : numValue);
6001
+ const validation = this.validateField(isBlank ? null : numValue);
6001
6002
  if (!validation.isValid && validation.error) {
6002
6003
  this.error.set(validation.error);
6003
6004
  this.validationError.emit(validation.error);
@@ -6141,11 +6142,11 @@ class NumberComponent {
6141
6142
  // Number('') and Number(null) are both 0, so treating a blank as a number
6142
6143
  // would emit 0 out of every empty cell the user tabs through. Validation
6143
6144
  // still runs on NaN, so a mandatory blank is caught.
6144
- const isBlank = value === null || value === undefined || value === '';
6145
+ const isBlank = value === null || value === undefined || String(value).trim() === '';
6145
6146
  const numValue = isBlank ? NaN : Number(value);
6146
6147
  // Blank goes to validation as-is: it is an empty cell, not the unparseable
6147
6148
  // number NaN would report it as.
6148
- const validation = this.validateField(isBlank ? value : numValue);
6149
+ const validation = this.validateField(isBlank ? null : numValue);
6149
6150
  if (!validation.isValid && validation.error) {
6150
6151
  this.error.set(validation.error);
6151
6152
  this.validationError.emit(validation.error);
@@ -12350,8 +12351,10 @@ class DataCellComponent {
12350
12351
  // An empty cell stays empty. Number('') and Number(null) are both 0, so
12351
12352
  // coercing unconditionally would treat every blank numeric cell the user
12352
12353
  // tabs through as 0. Validation still runs, so a mandatory blank is caught.
12353
- const isBlank = value === null || value === undefined || value === '';
12354
+ const isBlank = value === null || value === undefined || String(value).trim() === '';
12354
12355
  const numValue = isBlank ? NaN : Number(value);
12356
+ if (isBlank && value !== null)
12357
+ this.currentValue.set(null);
12355
12358
  this.validateField(numValue);
12356
12359
  // The value is stored as the NUMBER the user typed. `decimal` is display
12357
12360
  // precision and belongs to the view branch alone: rounding here wrote the