@covalent/core 11.0.0-beta.2 → 11.0.0-beta.4

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.
@@ -1,22 +1,17 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Directive, Optional, Host, HostListener, Inject, Pipe, LOCALE_ID, Injectable, NgModule } from '@angular/core';
2
+ import { inject, Directive, HostListener, ElementRef, Pipe, Injectable, NgModule } from '@angular/core';
3
3
  import { DOCUMENT, DecimalPipe, CommonModule } from '@angular/common';
4
- import * as i1 from '@angular/forms';
5
- import { FormsModule, Validators } from '@angular/forms';
4
+ import { NgModel, FormsModule, NgControl, Validators } from '@angular/forms';
6
5
  import { MAT_ICON_DEFAULT_OPTIONS } from '@angular/material/icon';
7
6
  import { MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field';
8
- import * as i1$1 from '@angular/router';
9
- import { RoutesRecognized } from '@angular/router';
7
+ import { Router, RoutesRecognized } from '@angular/router';
10
8
  import { filter, pairwise } from 'rxjs/operators';
11
9
  import { trigger, state, transition, style, group, query, animate, animateChild, AUTO_STYLE, keyframes } from '@angular/animations';
12
10
  import { Subject } from 'rxjs';
13
11
  import { coerceBooleanProperty } from '@angular/cdk/coercion';
14
12
 
15
13
  class TdAutoTrimDirective {
16
- _model;
17
- constructor(_model) {
18
- this._model = _model;
19
- }
14
+ _model = inject(NgModel, { optional: true, host: true });
20
15
  /**
21
16
  * Listens to host's (blur) event and trims value.
22
17
  */
@@ -27,7 +22,7 @@ class TdAutoTrimDirective {
27
22
  this._model.update.emit(this._model.value.trim());
28
23
  }
29
24
  }
30
- static ɵfac = function TdAutoTrimDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TdAutoTrimDirective)(i0.ɵɵdirectiveInject(i1.NgModel, 9)); };
25
+ static ɵfac = function TdAutoTrimDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TdAutoTrimDirective)(); };
31
26
  static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: TdAutoTrimDirective, selectors: [["", "tdAutoTrim", ""]], hostBindings: function TdAutoTrimDirective_HostBindings(rf, ctx) { if (rf & 1) {
32
27
  i0.ɵɵlistener("blur", function TdAutoTrimDirective_blur_HostBindingHandler($event) { return ctx.onBlur($event); });
33
28
  } } });
@@ -37,23 +32,15 @@ class TdAutoTrimDirective {
37
32
  args: [{
38
33
  selector: '[tdAutoTrim]',
39
34
  }]
40
- }], () => [{ type: i1.NgModel, decorators: [{
41
- type: Optional
42
- }, {
43
- type: Host
44
- }] }], { onBlur: [{
35
+ }], null, { onBlur: [{
45
36
  type: HostListener,
46
37
  args: ['blur', ['$event']]
47
38
  }] }); })();
48
39
 
49
40
  class TdFullscreenDirective {
50
- _document;
51
- _el;
41
+ _document = inject(DOCUMENT);
42
+ _el = inject(ElementRef);
52
43
  fullScreenIsActive = false;
53
- constructor(_document, _el) {
54
- this._document = _document;
55
- this._el = _el;
56
- }
57
44
  fsChangeHandler(event) {
58
45
  this.fullScreenIsActive = event.srcElement === this._getFullScreenElement();
59
46
  }
@@ -104,7 +91,7 @@ class TdFullscreenDirective {
104
91
  }
105
92
  return undefined;
106
93
  }
107
- static ɵfac = function TdFullscreenDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TdFullscreenDirective)(i0.ɵɵdirectiveInject(DOCUMENT), i0.ɵɵdirectiveInject(i0.ElementRef)); };
94
+ static ɵfac = function TdFullscreenDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TdFullscreenDirective)(); };
108
95
  static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: TdFullscreenDirective, selectors: [["", "tdFullScreen", ""]], hostBindings: function TdFullscreenDirective_HostBindings(rf, ctx) { if (rf & 1) {
109
96
  i0.ɵɵlistener("fullscreenchange", function TdFullscreenDirective_fullscreenchange_HostBindingHandler($event) { return ctx.fsChangeHandler($event); }, i0.ɵɵresolveDocument)("webkitfullscreenchange", function TdFullscreenDirective_webkitfullscreenchange_HostBindingHandler($event) { return ctx.fsChangeHandler($event); }, i0.ɵɵresolveDocument)("mozfullscreenchange", function TdFullscreenDirective_mozfullscreenchange_HostBindingHandler($event) { return ctx.fsChangeHandler($event); }, i0.ɵɵresolveDocument)("msfullscreenchange", function TdFullscreenDirective_msfullscreenchange_HostBindingHandler($event) { return ctx.fsChangeHandler($event); }, i0.ɵɵresolveDocument);
110
97
  } }, exportAs: ["tdFullScreen"] });
@@ -115,10 +102,7 @@ class TdFullscreenDirective {
115
102
  selector: '[tdFullScreen]',
116
103
  exportAs: 'tdFullScreen',
117
104
  }]
118
- }], () => [{ type: undefined, decorators: [{
119
- type: Inject,
120
- args: [DOCUMENT]
121
- }] }, { type: i0.ElementRef }], { fsChangeHandler: [{
105
+ }], null, { fsChangeHandler: [{
122
106
  type: HostListener,
123
107
  args: ['document:fullscreenchange', ['$event']]
124
108
  }, {
@@ -402,10 +386,13 @@ class TdDecimalBytesPipe {
402
386
  }], null, null); })();
403
387
 
404
388
  class TdDigitsPipe {
405
- _locale;
389
+ _locale = 'en';
406
390
  _decimalPipe;
407
- constructor(_locale = 'en') {
408
- this._locale = _locale;
391
+ constructor() {
392
+ this._decimalPipe = new DecimalPipe(this._locale);
393
+ }
394
+ set locale(locale) {
395
+ this._locale = locale;
409
396
  this._decimalPipe = new DecimalPipe(this._locale);
410
397
  }
411
398
  /* `digits` needs to be type `digits: any` or TypeScript complains */
@@ -426,7 +413,7 @@ class TdDigitsPipe {
426
413
  const size = sizes[i];
427
414
  return (this._decimalPipe.transform(parseFloat((digits / Math.pow(k, i)).toFixed(precision))) + (size ? ' ' + size : ''));
428
415
  }
429
- static ɵfac = function TdDigitsPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TdDigitsPipe)(i0.ɵɵdirectiveInject(LOCALE_ID, 16)); };
416
+ static ɵfac = function TdDigitsPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TdDigitsPipe)(); };
430
417
  static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "digits", type: TdDigitsPipe, pure: true });
431
418
  }
432
419
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TdDigitsPipe, [{
@@ -434,10 +421,7 @@ class TdDigitsPipe {
434
421
  args: [{
435
422
  name: 'digits',
436
423
  }]
437
- }], () => [{ type: undefined, decorators: [{
438
- type: Inject,
439
- args: [LOCALE_ID]
440
- }] }], null); })();
424
+ }], () => [], null); })();
441
425
 
442
426
  class TdTruncatePipe {
443
427
  transform(text, length = 54) {
@@ -465,10 +449,9 @@ class TdTruncatePipe {
465
449
  }], null, null); })();
466
450
 
467
451
  class RouterPathService {
468
- _router;
452
+ _router = inject(Router);
469
453
  static _previousRoute = '/';
470
- constructor(_router) {
471
- this._router = _router;
454
+ constructor() {
472
455
  this._router.events
473
456
  .pipe(filter((e) => e instanceof RoutesRecognized), pairwise())
474
457
  .subscribe((e) => {
@@ -482,12 +465,12 @@ class RouterPathService {
482
465
  getPreviousRoute() {
483
466
  return RouterPathService._previousRoute;
484
467
  }
485
- static ɵfac = function RouterPathService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || RouterPathService)(i0.ɵɵinject(i1$1.Router)); };
468
+ static ɵfac = function RouterPathService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || RouterPathService)(); };
486
469
  static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: RouterPathService, factory: RouterPathService.ɵfac });
487
470
  }
488
471
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(RouterPathService, [{
489
472
  type: Injectable
490
- }], () => [{ type: i1$1.Router }], null); })();
473
+ }], () => [], null); })();
491
474
 
492
475
  /*
493
476
  * Copyright (C) 2016-2017 by Teradata Corporation. All rights reserved.
@@ -2077,17 +2060,16 @@ function mixinDisableRipple(base) {
2077
2060
 
2078
2061
  /* eslint-disable @angular-eslint/directive-selector */
2079
2062
  class CovalentTextfieldValueAccessorDirective {
2080
- _elementRef;
2081
- _ngControl;
2063
+ _elementRef = inject(ElementRef);
2064
+ _ngControl = inject(NgControl);
2082
2065
  _onChange = () => {
2083
2066
  /* noop */
2084
2067
  };
2085
2068
  _onTouched = () => {
2086
2069
  /* noop */
2087
2070
  };
2088
- constructor(_elementRef, _ngControl) {
2089
- this._elementRef = _elementRef;
2090
- this._ngControl = _ngControl;
2071
+ constructor() {
2072
+ const _ngControl = this._ngControl;
2091
2073
  _ngControl.valueAccessor = this;
2092
2074
  }
2093
2075
  writeValue(value) {
@@ -2150,7 +2132,7 @@ class CovalentTextfieldValueAccessorDirective {
2150
2132
  // Set the web component's custom validity message
2151
2133
  element.reportValidity();
2152
2134
  }
2153
- static ɵfac = function CovalentTextfieldValueAccessorDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CovalentTextfieldValueAccessorDirective)(i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i1.NgControl)); };
2135
+ static ɵfac = function CovalentTextfieldValueAccessorDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CovalentTextfieldValueAccessorDirective)(); };
2154
2136
  static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: CovalentTextfieldValueAccessorDirective, selectors: [["cv-textfield", "formControl", ""], ["cv-textarea", "formControl", ""], ["cv-select", "formControl", ""], ["cv-checkbox", "formControl", ""], ["cv-checkbox-icon", "formControl", ""], ["cv-radio", "formControl", ""], ["cv-radio-icon", "formControl", ""], ["cv-textfield", "formControlName", ""], ["cv-textarea", "formControlName", ""], ["cv-select", "formControlName", ""], ["cv-checkbox", "formControlName", ""], ["cv-checkbox-icon", "formControlName", ""], ["cv-radio", "formControlName", ""], ["cv-radio-icon", "formControlName", ""], [""]], hostBindings: function CovalentTextfieldValueAccessorDirective_HostBindings(rf, ctx) { if (rf & 1) {
2155
2137
  i0.ɵɵlistener("change", function CovalentTextfieldValueAccessorDirective_change_HostBindingHandler($event) { return ctx.handleChange($event); })("blur", function CovalentTextfieldValueAccessorDirective_blur_HostBindingHandler() { return ctx.handleBlur(); });
2156
2138
  } } });
@@ -2173,7 +2155,7 @@ class CovalentTextfieldValueAccessorDirective {
2173
2155
  cv-radio[formControlName],
2174
2156
  cv-radio-icon[formControlName],`,
2175
2157
  }]
2176
- }], () => [{ type: i0.ElementRef }, { type: i1.NgControl }], { handleChange: [{
2158
+ }], () => [], { handleChange: [{
2177
2159
  type: HostListener,
2178
2160
  args: ['change', ['$event']]
2179
2161
  }], handleBlur: [{