@sumaris-net/ngx-components 1.6.16 → 1.7.1

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.
@@ -4566,6 +4566,42 @@
4566
4566
  { type: ngx.Keyboard, decorators: [{ type: i0.Optional }] }
4567
4567
  ]; };
4568
4568
 
4569
+ var NgVarDirective = /** @class */ (function () {
4570
+ function NgVarDirective(templateRef, vcRef) {
4571
+ this.templateRef = templateRef;
4572
+ this.vcRef = vcRef;
4573
+ this.context = {
4574
+ $implicit: null,
4575
+ ngVar: null,
4576
+ };
4577
+ this.hasView = false;
4578
+ }
4579
+ Object.defineProperty(NgVarDirective.prototype, "ngVar", {
4580
+ set: function (context) {
4581
+ this.context.$implicit = this.context.ngVar = context;
4582
+ if (!this.hasView) {
4583
+ this.vcRef.createEmbeddedView(this.templateRef, this.context);
4584
+ this.hasView = true;
4585
+ }
4586
+ },
4587
+ enumerable: false,
4588
+ configurable: true
4589
+ });
4590
+ return NgVarDirective;
4591
+ }());
4592
+ NgVarDirective.decorators = [
4593
+ { type: i0.Directive, args: [{
4594
+ selector: '[ngVar]',
4595
+ },] }
4596
+ ];
4597
+ NgVarDirective.ctorParameters = function () { return [
4598
+ { type: i0.TemplateRef },
4599
+ { type: i0.ViewContainerRef }
4600
+ ]; };
4601
+ NgVarDirective.propDecorators = {
4602
+ ngVar: [{ type: i0.Input }]
4603
+ };
4604
+
4569
4605
  var SharedDirectivesModule = /** @class */ (function () {
4570
4606
  function SharedDirectivesModule() {
4571
4607
  }
@@ -4578,10 +4614,12 @@
4578
4614
  i1$5.IonicModule
4579
4615
  ],
4580
4616
  declarations: [
4581
- AutofocusDirective
4617
+ AutofocusDirective,
4618
+ NgVarDirective
4582
4619
  ],
4583
4620
  exports: [
4584
- AutofocusDirective
4621
+ AutofocusDirective,
4622
+ NgVarDirective
4585
4623
  ]
4586
4624
  },] }
4587
4625
  ];
@@ -4720,24 +4758,25 @@
4720
4758
  this.pattern = 'DDMM';
4721
4759
  this.mask = MASKS[this.type][this.pattern];
4722
4760
  }
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
- }
4761
+ // Remove max decimals in the DDMMSS format
4762
+ if (this.pattern === 'DD') {
4763
+ console.warn("Invalid attribute 'maxDecimals' - Must be '0' when using the 'DDMMSS' pattern.");
4764
+ this.maxDecimals = 7;
4765
+ }
4766
+ else if (this.pattern === 'DDMMSS') {
4767
+ console.warn("Invalid attribute 'maxDecimals' - Must be '0' when using the 'DDMMSS' pattern.");
4768
+ this.maxDecimals = 0;
4769
+ }
4770
+ else if (isNil(this.maxDecimals)) {
4771
+ this.maxDecimals = DEFAULT_MAX_DECIMALS;
4772
+ }
4773
+ else if (this.maxDecimals < 0) {
4774
+ console.error('Invalid attribute \'maxDecimals\'. Must a positive value.');
4775
+ this.maxDecimals = DEFAULT_MAX_DECIMALS;
4776
+ }
4777
+ else if (this.maxDecimals !== DEFAULT_MAX_DECIMALS) {
4778
+ console.warn("Invalid attribute 'maxDecimals' - Expected value: " + DEFAULT_MAX_DECIMALS + " but get: " + this.maxDecimals + ". Other value not implemented.");
4779
+ this.maxDecimals = DEFAULT_MAX_DECIMALS;
4741
4780
  }
4742
4781
  this.showSignControl = this.pattern !== 'DD';
4743
4782
  this.formatFn = this.type === 'latitude' ? formatLatitude : formatLongitude;
@@ -8433,20 +8472,26 @@
8433
8472
  });
8434
8473
  MatBadgeIconDirective.prototype.ngOnInit = function () {
8435
8474
  var _this = this;
8475
+ // Default value
8436
8476
  this._size = this._size || 'medium';
8437
8477
  this._color = this._color || 'primary';
8438
8478
  if (this._color === 'warn')
8439
8479
  this._color = 'warning';
8440
- this.updateView();
8480
+ this.updateView(true);
8441
8481
  this._subscription = this._$update
8442
- //.pipe(debounceTime(10000))
8443
- .subscribe(function () { return _this.updateView(); });
8482
+ .pipe(operators.debounceTime(100))
8483
+ .subscribe(function () { return _this.updateView(true); });
8444
8484
  };
8445
8485
  MatBadgeIconDirective.prototype.ngOnDestroy = function () {
8446
8486
  var _a;
8447
8487
  (_a = this._subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
8448
8488
  };
8449
- MatBadgeIconDirective.prototype.updateView = function () {
8489
+ MatBadgeIconDirective.prototype.updateView = function (immediate) {
8490
+ // Async by default
8491
+ if (!immediate) {
8492
+ this._$update.next();
8493
+ return;
8494
+ }
8450
8495
  var badge = this.el.nativeElement.querySelector('.mat-badge-content');
8451
8496
  if (!badge)
8452
8497
  return;
@@ -8484,9 +8529,12 @@
8484
8529
  badge.style.background = "var(--ion-color-" + this._color + ")";
8485
8530
  badge.style.color = "var(--ion-color-" + this._color + "-contrast)";
8486
8531
  }
8487
- badge.style.alignItems = 'center';
8488
- badge.style.justifyContent = 'center';
8489
- badge.style.display = 'flex';
8532
+ if (badge.style.display !== 'inline-block')
8533
+ badge.style.display = 'inline-block';
8534
+ if (badge.style.alignItems !== 'center')
8535
+ badge.style.alignItems = 'center';
8536
+ if (badge.style.justifyContent !== 'center')
8537
+ badge.style.justifyContent = 'center';
8490
8538
  };
8491
8539
  return MatBadgeIconDirective;
8492
8540
  }());
@@ -29195,6 +29243,7 @@
29195
29243
  exports.ModalToolbarComponent = ModalToolbarComponent;
29196
29244
  exports.NetworkService = NetworkService;
29197
29245
  exports.NgInitDirective = NgInitDirective;
29246
+ exports.NgVarDirective = NgVarDirective;
29198
29247
  exports.NotEmptyArrayPipe = NotEmptyArrayPipe;
29199
29248
  exports.NumberFormatPipe = NumberFormatPipe;
29200
29249
  exports.NumpadDirective = NumpadDirective;