@sumaris-net/ngx-components 1.6.17 → 1.6.18

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.
@@ -4720,24 +4720,25 @@
4720
4720
  this.pattern = 'DDMM';
4721
4721
  this.mask = MASKS[this.type][this.pattern];
4722
4722
  }
4723
- if (this.maxDecimals) {
4724
- if (this.maxDecimals < 0) {
4725
- console.error('Invalid attribute \'maxDecimals\'. Must a positive value.');
4726
- this.maxDecimals = DEFAULT_MAX_DECIMALS;
4727
- }
4728
- // Remove max decimals in the DDMMSS format
4729
- else if (this.pattern === 'DD') {
4730
- console.warn("Invalid attribute 'maxDecimals' - Must be '0' when using the 'DDMMSS' pattern.");
4731
- this.maxDecimals = 7;
4732
- }
4733
- else if (this.pattern === 'DDMMSS') {
4734
- console.warn("Invalid attribute 'maxDecimals' - Must be '0' when using the 'DDMMSS' pattern.");
4735
- this.maxDecimals = 0;
4736
- }
4737
- else if (this.maxDecimals !== DEFAULT_MAX_DECIMALS) {
4738
- console.warn("Invalid attribute 'maxDecimals' - Expected value: " + DEFAULT_MAX_DECIMALS + ". Other value not implemented.");
4739
- this.maxDecimals = DEFAULT_MAX_DECIMALS;
4740
- }
4723
+ if (isNil(this.maxDecimals)) {
4724
+ this.maxDecimals = DEFAULT_MAX_DECIMALS;
4725
+ }
4726
+ // Remove max decimals in the DDMMSS format
4727
+ else if (this.pattern === 'DD') {
4728
+ console.warn("Invalid attribute 'maxDecimals' - Must be '0' when using the 'DDMMSS' pattern.");
4729
+ this.maxDecimals = 7;
4730
+ }
4731
+ else if (this.pattern === 'DDMMSS') {
4732
+ console.warn("Invalid attribute 'maxDecimals' - Must be '0' when using the 'DDMMSS' pattern.");
4733
+ this.maxDecimals = 0;
4734
+ }
4735
+ else if (this.maxDecimals < 0) {
4736
+ console.error('Invalid attribute \'maxDecimals\'. Must a positive value.');
4737
+ this.maxDecimals = DEFAULT_MAX_DECIMALS;
4738
+ }
4739
+ else if (this.maxDecimals !== DEFAULT_MAX_DECIMALS) {
4740
+ console.warn("Invalid attribute 'maxDecimals' - Expected value: " + DEFAULT_MAX_DECIMALS + ". Other value not implemented.");
4741
+ this.maxDecimals = DEFAULT_MAX_DECIMALS;
4741
4742
  }
4742
4743
  this.showSignControl = this.pattern !== 'DD';
4743
4744
  this.formatFn = this.type === 'latitude' ? formatLatitude : formatLongitude;