ngwr 0.0.14 → 0.1.0

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.
Files changed (71) hide show
  1. package/README.md +7 -13
  2. package/_core/index.d.ts +1 -1
  3. package/_core/types/color.d.ts +1 -0
  4. package/_core/types/index.d.ts +1 -0
  5. package/button/button.component.d.ts +4 -7
  6. package/button/index.d.ts +2 -2
  7. package/checkbox/checkbox.component.d.ts +5 -5
  8. package/checkbox/index.d.ts +2 -2
  9. package/divider/divider.component.d.ts +24 -2
  10. package/divider/index.d.ts +2 -2
  11. package/esm2020/_core/index.mjs +2 -2
  12. package/esm2020/_core/types/color.mjs +2 -0
  13. package/esm2020/_core/types/index.mjs +1 -1
  14. package/esm2020/button/button.component.mjs +2 -2
  15. package/esm2020/button/index.mjs +3 -3
  16. package/esm2020/checkbox/checkbox.component.mjs +14 -10
  17. package/esm2020/checkbox/index.mjs +3 -3
  18. package/esm2020/divider/divider.component.mjs +55 -6
  19. package/esm2020/divider/index.mjs +3 -3
  20. package/esm2020/form/form-error.component.mjs +5 -5
  21. package/esm2020/form/form-item.component.mjs +15 -28
  22. package/esm2020/form/index.mjs +4 -4
  23. package/esm2020/icon/index.mjs +5 -5
  24. package/esm2020/input/index.mjs +3 -3
  25. package/esm2020/input/input.component.mjs +159 -0
  26. package/esm2020/input/input.module.mjs +9 -8
  27. package/esm2020/public-api.mjs +11 -12
  28. package/esm2020/skeleton/index.mjs +3 -3
  29. package/esm2020/skeleton/skeleton.component.mjs +29 -13
  30. package/esm2020/skeleton/skeleton.module.mjs +4 -5
  31. package/esm2020/spinner/index.mjs +3 -3
  32. package/esm2020/spinner/spinner.component.mjs +4 -4
  33. package/esm2020/tag/index.mjs +3 -3
  34. package/esm2020/tag/tag.component.mjs +47 -51
  35. package/esm2020/tag/tag.module.mjs +5 -4
  36. package/fesm2015/ngwr.mjs +440 -443
  37. package/fesm2015/ngwr.mjs.map +1 -1
  38. package/fesm2020/ngwr.mjs +440 -437
  39. package/fesm2020/ngwr.mjs.map +1 -1
  40. package/form/form-error.component.d.ts +1 -1
  41. package/form/form-item.component.d.ts +3 -11
  42. package/form/index.d.ts +3 -3
  43. package/icon/index.d.ts +4 -4
  44. package/input/index.d.ts +2 -2
  45. package/input/input.component.d.ts +41 -0
  46. package/input/input.module.d.ts +4 -3
  47. package/ngwr.min.css +1 -1
  48. package/package.json +4 -4
  49. package/public-api.d.ts +10 -11
  50. package/skeleton/index.d.ts +2 -2
  51. package/skeleton/skeleton.component.d.ts +6 -8
  52. package/skeleton/skeleton.module.d.ts +1 -2
  53. package/spinner/index.d.ts +2 -2
  54. package/spinner/spinner.component.d.ts +1 -1
  55. package/tag/index.d.ts +2 -2
  56. package/tag/tag.component.d.ts +10 -16
  57. package/tag/tag.module.d.ts +3 -2
  58. package/esm2020/extended-input/extended-input.component.mjs +0 -68
  59. package/esm2020/extended-input/extended-input.module.mjs +0 -20
  60. package/esm2020/extended-input/index.mjs +0 -3
  61. package/esm2020/input/input.directive.mjs +0 -65
  62. package/esm2020/password-input/index.mjs +0 -3
  63. package/esm2020/password-input/password-input.component.mjs +0 -58
  64. package/esm2020/password-input/password-input.module.mjs +0 -21
  65. package/extended-input/extended-input.component.d.ts +0 -26
  66. package/extended-input/extended-input.module.d.ts +0 -10
  67. package/extended-input/index.d.ts +0 -2
  68. package/input/input.directive.d.ts +0 -18
  69. package/password-input/index.d.ts +0 -2
  70. package/password-input/password-input.component.d.ts +0 -22
  71. package/password-input/password-input.module.d.ts +0 -11
package/fesm2020/ngwr.mjs CHANGED
@@ -1,16 +1,105 @@
1
- import * as i2 from '@angular/common';
2
- import { DOCUMENT, CommonModule } from '@angular/common';
1
+ import { __decorate } from 'tslib';
3
2
  import * as i0 from '@angular/core';
4
- import { Injectable, Component, ViewEncapsulation, ChangeDetectionStrategy, Optional, Inject, HostBinding, Input, NgModule, Directive, EventEmitter, forwardRef, ViewChild, Output, Self } from '@angular/core';
3
+ import { Directive, Component, ViewEncapsulation, ChangeDetectionStrategy, HostBinding, Injectable, Optional, Inject, Input, NgModule, EventEmitter, forwardRef, ViewChild, Output } from '@angular/core';
5
4
  import { Subject, fromEvent } from 'rxjs';
5
+ import { takeUntil } from 'rxjs/operators';
6
6
  import { coerceBooleanProperty } from '@angular/cdk/coercion';
7
- import { __decorate } from 'tslib';
8
- import { takeUntil, filter } from 'rxjs/operators';
9
- import * as i1 from '@angular/cdk/a11y';
10
- import { A11yModule } from '@angular/cdk/a11y';
11
- import * as i1$1 from '@angular/forms';
7
+ import * as i1 from '@angular/common';
8
+ import { DOCUMENT, CommonModule } from '@angular/common';
9
+ import * as i2 from '@angular/forms';
12
10
  import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
13
- import { PlatformModule } from '@angular/cdk/platform';
11
+ import * as i1$1 from '@angular/cdk/a11y';
12
+ import { A11yModule } from '@angular/cdk/a11y';
13
+
14
+ class BaseComponent {
15
+ constructor() {
16
+ this.ngUnsubscribe = new Subject();
17
+ }
18
+ ngOnDestroy() {
19
+ this.ngUnsubscribe.next();
20
+ this.ngUnsubscribe.complete();
21
+ }
22
+ }
23
+ BaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: BaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
24
+ BaseComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.8", type: BaseComponent, ngImport: i0 });
25
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: BaseComponent, decorators: [{
26
+ type: Directive
27
+ }] });
28
+
29
+ const stylePrefix = 'wr';
30
+
31
+ function toBoolean(value) {
32
+ return coerceBooleanProperty(value);
33
+ }
34
+ // eslint-disable
35
+ function propDecoratorFactory(name, fallback) {
36
+ function propDecorator(target, propName, originalDescriptor) {
37
+ const privatePropName = `$$__wrPropDecorator__${propName}`;
38
+ if (Object.prototype.hasOwnProperty.call(target, privatePropName)) {
39
+ console.warn(`The prop "${privatePropName}" is already exist, it will be overrided by ${name} decorator.`);
40
+ }
41
+ Object.defineProperty(target, privatePropName, {
42
+ configurable: true,
43
+ writable: true
44
+ });
45
+ return {
46
+ get() {
47
+ return originalDescriptor && originalDescriptor.get
48
+ ? originalDescriptor.get.bind(this)()
49
+ : this[privatePropName];
50
+ },
51
+ set(value) {
52
+ if (originalDescriptor && originalDescriptor.set) {
53
+ originalDescriptor.set.bind(this)(fallback(value));
54
+ }
55
+ this[privatePropName] = fallback(value);
56
+ }
57
+ };
58
+ }
59
+ return propDecorator;
60
+ }
61
+ /**
62
+ * Input decorator that handle a prop to do get/set automatically with toBoolean
63
+ *
64
+ * Why not using @InputBoolean alone without @Input? AOT needs @Input to be visible
65
+ *
66
+ * @howToUse
67
+ * ```
68
+ * @Input() @InputBoolean() visible: boolean = false;
69
+ *
70
+ * // Act as below:
71
+ * // @Input()
72
+ * // get visible() { return this.__visible; }
73
+ * // set visible(value) { this.__visible = value; }
74
+ * // __visible = false;
75
+ * ```
76
+ */
77
+ function InputBoolean() {
78
+ return propDecoratorFactory('InputBoolean', toBoolean);
79
+ }
80
+
81
+ // Components
82
+
83
+ class WrSpinnerComponent {
84
+ constructor() {
85
+ this.class = 'wr-spin';
86
+ }
87
+ }
88
+ WrSpinnerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrSpinnerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
89
+ WrSpinnerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.8", type: WrSpinnerComponent, selector: "wr-spin", host: { properties: { "class": "this.class" } }, exportAs: ["wrSpin"], ngImport: i0, template: '<svg viewBox="0 0 50 50"><circle class="path" cx="25" cy="25" r="20" fill="none" stroke-width="5"></circle></svg>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
90
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrSpinnerComponent, decorators: [{
91
+ type: Component,
92
+ args: [{
93
+ selector: 'wr-spin',
94
+ exportAs: 'wrSpin',
95
+ template: '<svg viewBox="0 0 50 50"><circle class="path" cx="25" cy="25" r="20" fill="none" stroke-width="5"></circle></svg>',
96
+ encapsulation: ViewEncapsulation.None,
97
+ changeDetection: ChangeDetectionStrategy.OnPush
98
+ }]
99
+ }], propDecorators: { class: [{
100
+ type: HostBinding,
101
+ args: ['class']
102
+ }] } });
14
103
 
15
104
  /* 🤖 this file was generated by svg-to-ts */
16
105
  const wrIconAddCircleOutline = {
@@ -470,125 +559,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImpor
470
559
  type: Input
471
560
  }] } });
472
561
 
473
- class WrIconModule {
474
- static forRoot() {
475
- WrIconService.registerIcons();
476
- return { ngModule: WrIconModule };
477
- }
478
- }
479
- WrIconModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrIconModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
480
- WrIconModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.8", ngImport: i0, type: WrIconModule, declarations: [WrIconComponent], exports: [WrIconComponent] });
481
- WrIconModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrIconModule });
482
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrIconModule, decorators: [{
483
- type: NgModule,
484
- args: [{
485
- declarations: [WrIconComponent],
486
- exports: [WrIconComponent]
487
- }]
488
- }] });
489
-
490
- class BaseComponent {
491
- constructor() {
492
- this.ngUnsubscribe = new Subject();
493
- }
494
- ngOnDestroy() {
495
- this.ngUnsubscribe.next();
496
- this.ngUnsubscribe.complete();
497
- }
498
- }
499
- BaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: BaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
500
- BaseComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.8", type: BaseComponent, ngImport: i0 });
501
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: BaseComponent, decorators: [{
502
- type: Directive
503
- }] });
504
-
505
- const stylePrefix = 'wr';
506
-
507
- function toBoolean(value) {
508
- return coerceBooleanProperty(value);
509
- }
510
- // eslint-disable
511
- function propDecoratorFactory(name, fallback) {
512
- function propDecorator(target, propName, originalDescriptor) {
513
- const privatePropName = `$$__wrPropDecorator__${propName}`;
514
- if (Object.prototype.hasOwnProperty.call(target, privatePropName)) {
515
- console.warn(`The prop "${privatePropName}" is already exist, it will be overrided by ${name} decorator.`);
516
- }
517
- Object.defineProperty(target, privatePropName, {
518
- configurable: true,
519
- writable: true
520
- });
521
- return {
522
- get() {
523
- return originalDescriptor && originalDescriptor.get
524
- ? originalDescriptor.get.bind(this)()
525
- : this[privatePropName];
526
- },
527
- set(value) {
528
- if (originalDescriptor && originalDescriptor.set) {
529
- originalDescriptor.set.bind(this)(fallback(value));
530
- }
531
- this[privatePropName] = fallback(value);
532
- }
533
- };
534
- }
535
- return propDecorator;
536
- }
537
- /**
538
- * Input decorator that handle a prop to do get/set automatically with toBoolean
539
- *
540
- * Why not using @InputBoolean alone without @Input? AOT needs @Input to be visible
541
- *
542
- * @howToUse
543
- * ```
544
- * @Input() @InputBoolean() visible: boolean = false;
545
- *
546
- * // Act as below:
547
- * // @Input()
548
- * // get visible() { return this.__visible; }
549
- * // set visible(value) { this.__visible = value; }
550
- * // __visible = false;
551
- * ```
552
- */
553
- function InputBoolean() {
554
- return propDecoratorFactory('InputBoolean', toBoolean);
555
- }
556
-
557
- // Components
558
-
559
- class WrSpinnerComponent {
560
- constructor() {
561
- this.class = `${stylePrefix}-spin`;
562
- }
563
- }
564
- WrSpinnerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrSpinnerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
565
- WrSpinnerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.8", type: WrSpinnerComponent, selector: "wr-spin", host: { properties: { "class": "this.class" } }, ngImport: i0, template: '<svg viewBox="0 0 50 50"><circle class="path" cx="25" cy="25" r="20" fill="none" stroke-width="5"></circle></svg>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
566
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrSpinnerComponent, decorators: [{
567
- type: Component,
568
- args: [{
569
- selector: 'wr-spin',
570
- template: '<svg viewBox="0 0 50 50"><circle class="path" cx="25" cy="25" r="20" fill="none" stroke-width="5"></circle></svg>',
571
- encapsulation: ViewEncapsulation.None,
572
- changeDetection: ChangeDetectionStrategy.OnPush
573
- }]
574
- }], propDecorators: { class: [{
575
- type: HostBinding,
576
- args: ['class']
577
- }] } });
578
-
579
- class WrSpinnerModule {
580
- }
581
- WrSpinnerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrSpinnerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
582
- WrSpinnerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.8", ngImport: i0, type: WrSpinnerModule, declarations: [WrSpinnerComponent], exports: [WrSpinnerComponent] });
583
- WrSpinnerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrSpinnerModule });
584
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrSpinnerModule, decorators: [{
585
- type: NgModule,
586
- args: [{
587
- declarations: [WrSpinnerComponent],
588
- exports: [WrSpinnerComponent]
589
- }]
590
- }] });
591
-
592
562
  class WrButtonComponent extends BaseComponent {
593
563
  constructor(cdr, elRef, ngZone, r2) {
594
564
  super();
@@ -668,7 +638,7 @@ class WrButtonComponent extends BaseComponent {
668
638
  }
669
639
  }
670
640
  WrButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrButtonComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.NgZone }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
671
- WrButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.8", type: WrButtonComponent, selector: "wr-btn, button[wr-btn], a[wr-btn]", inputs: { color: "color", size: "size", icon: "icon", iconPosition: "iconPosition", disabled: "disabled", outlined: "outlined", rounded: "rounded", loading: "loading", fullwidth: "fullwidth" }, host: { properties: { "class": "this.elClasses", "disabled": "this._disabled" } }, exportAs: ["wrBtn"], usesInheritance: true, ngImport: i0, template: "<wr-spin class=\"wr-btn__spin\" *ngIf=\"loading\"></wr-spin>\n<wr-icon class=\"wr-btn__icon\" *ngIf=\"icon && iconPosition === 'start'\" [name]=\"icon\"></wr-icon>\n<ng-content></ng-content>\n<wr-icon class=\"wr-btn__icon\" *ngIf=\"icon && iconPosition === 'end'\" [name]=\"icon\"></wr-icon>\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: WrSpinnerComponent, selector: "wr-spin" }, { kind: "component", type: WrIconComponent, selector: "wr-icon[name]", inputs: ["name"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
641
+ WrButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.8", type: WrButtonComponent, selector: "wr-btn, button[wr-btn], a[wr-btn]", inputs: { color: "color", size: "size", icon: "icon", iconPosition: "iconPosition", disabled: "disabled", outlined: "outlined", rounded: "rounded", loading: "loading", fullwidth: "fullwidth" }, host: { properties: { "class": "this.elClasses", "disabled": "this._disabled" } }, exportAs: ["wrBtn"], usesInheritance: true, ngImport: i0, template: "<wr-spin class=\"wr-btn__spin\" *ngIf=\"loading\"></wr-spin>\n<wr-icon class=\"wr-btn__icon\" *ngIf=\"icon && iconPosition === 'start'\" [name]=\"icon\"></wr-icon>\n<ng-content></ng-content>\n<wr-icon class=\"wr-btn__icon\" *ngIf=\"icon && iconPosition === 'end'\" [name]=\"icon\"></wr-icon>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: WrSpinnerComponent, selector: "wr-spin", exportAs: ["wrSpin"] }, { kind: "component", type: WrIconComponent, selector: "wr-icon[name]", inputs: ["name"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
672
642
  __decorate([
673
643
  InputBoolean()
674
644
  ], WrButtonComponent.prototype, "disabled", void 0);
@@ -713,6 +683,36 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImpor
713
683
  args: ['disabled']
714
684
  }] } });
715
685
 
686
+ class WrIconModule {
687
+ static forRoot() {
688
+ WrIconService.registerIcons();
689
+ return { ngModule: WrIconModule };
690
+ }
691
+ }
692
+ WrIconModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrIconModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
693
+ WrIconModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.8", ngImport: i0, type: WrIconModule, declarations: [WrIconComponent], exports: [WrIconComponent] });
694
+ WrIconModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrIconModule });
695
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrIconModule, decorators: [{
696
+ type: NgModule,
697
+ args: [{
698
+ declarations: [WrIconComponent],
699
+ exports: [WrIconComponent]
700
+ }]
701
+ }] });
702
+
703
+ class WrSpinnerModule {
704
+ }
705
+ WrSpinnerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrSpinnerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
706
+ WrSpinnerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.8", ngImport: i0, type: WrSpinnerModule, declarations: [WrSpinnerComponent], exports: [WrSpinnerComponent] });
707
+ WrSpinnerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrSpinnerModule });
708
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrSpinnerModule, decorators: [{
709
+ type: NgModule,
710
+ args: [{
711
+ declarations: [WrSpinnerComponent],
712
+ exports: [WrSpinnerComponent]
713
+ }]
714
+ }] });
715
+
716
716
  class WrButtonModule {
717
717
  }
718
718
  WrButtonModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
@@ -739,8 +739,12 @@ class WrCheckboxComponent extends BaseComponent {
739
739
  this.checked = false;
740
740
  this.disabled = false;
741
741
  this.autoFocus = false;
742
- this.checkedChange = new EventEmitter();
743
- this.class = `${stylePrefix}-checkbox`;
742
+ this.valueChange = new EventEmitter();
743
+ }
744
+ get elClasses() {
745
+ return {
746
+ 'wr-checkbox': true
747
+ };
744
748
  }
745
749
  ngOnInit() {
746
750
  this.ngZone.runOutsideAngular(() => {
@@ -796,18 +800,18 @@ class WrCheckboxComponent extends BaseComponent {
796
800
  if (!this.disabled) {
797
801
  this.checked = checked;
798
802
  this.onChange(this.checked);
799
- this.checkedChange.emit(this.checked);
803
+ this.valueChange.emit(this.checked);
800
804
  }
801
805
  }
802
806
  }
803
- WrCheckboxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrCheckboxComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i1.FocusMonitor }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
804
- WrCheckboxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.8", type: WrCheckboxComponent, selector: "wr-checkbox", inputs: { checked: "checked", disabled: "disabled", autoFocus: "autoFocus" }, outputs: { checkedChange: "checkedChange" }, host: { properties: { "class": "this.class" } }, providers: [
807
+ WrCheckboxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrCheckboxComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i1$1.FocusMonitor }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
808
+ WrCheckboxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.8", type: WrCheckboxComponent, selector: "wr-checkbox", inputs: { checked: "checked", disabled: "disabled", autoFocus: "autoFocus" }, outputs: { valueChange: "valueChange" }, host: { properties: { "class": "this.elClasses" } }, providers: [
805
809
  {
806
810
  provide: NG_VALUE_ACCESSOR,
807
811
  useExisting: forwardRef(() => WrCheckboxComponent),
808
812
  multi: true
809
813
  }
810
- ], viewQueries: [{ propertyName: "inputElement", first: true, predicate: ["inputElement"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<label\n class=\"wr-checkbox-container\"\n [class.wr-checkbox-container--checked]=\"this.checked\"\n [class.wr-checkbox-container--disabled]=\"this.disabled\"\n>\n <input\n #inputElement\n type=\"checkbox\"\n class=\"wr-checkbox-container__input\"\n [attr.autofocus]=\"autoFocus ? 'autofocus' : null\"\n [checked]=\"checked\"\n [ngModel]=\"checked\"\n [disabled]=\"disabled\"\n (ngModelChange)=\"onModelChange($event)\"\n />\n <div class=\"wr-checkbox-container-inner\">\n <div class=\"wr-checkbox-container-inner__mark\"></div>\n </div>\n <ng-content></ng-content>\n</label>\n", dependencies: [{ kind: "directive", type: i1$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
814
+ ], viewQueries: [{ propertyName: "inputElement", first: true, predicate: ["inputElement"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<label\n class=\"wr-checkbox-container\"\n [class.wr-checkbox-container--checked]=\"this.checked\"\n [class.wr-checkbox-container--disabled]=\"this.disabled\"\n>\n <input\n #inputElement\n type=\"checkbox\"\n class=\"wr-checkbox-container__input\"\n [attr.autofocus]=\"autoFocus ? 'autofocus' : null\"\n [checked]=\"checked\"\n [ngModel]=\"checked\"\n [disabled]=\"!!disabled\"\n (ngModelChange)=\"onModelChange($event)\"\n />\n <div class=\"wr-checkbox-container-inner\">\n <div class=\"wr-checkbox-container-inner__mark\"></div>\n </div>\n <ng-content></ng-content>\n</label>\n", dependencies: [{ kind: "directive", type: i2.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
811
815
  __decorate([
812
816
  InputBoolean()
813
817
  ], WrCheckboxComponent.prototype, "checked", void 0);
@@ -825,8 +829,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImpor
825
829
  useExisting: forwardRef(() => WrCheckboxComponent),
826
830
  multi: true
827
831
  }
828
- ], template: "<label\n class=\"wr-checkbox-container\"\n [class.wr-checkbox-container--checked]=\"this.checked\"\n [class.wr-checkbox-container--disabled]=\"this.disabled\"\n>\n <input\n #inputElement\n type=\"checkbox\"\n class=\"wr-checkbox-container__input\"\n [attr.autofocus]=\"autoFocus ? 'autofocus' : null\"\n [checked]=\"checked\"\n [ngModel]=\"checked\"\n [disabled]=\"disabled\"\n (ngModelChange)=\"onModelChange($event)\"\n />\n <div class=\"wr-checkbox-container-inner\">\n <div class=\"wr-checkbox-container-inner__mark\"></div>\n </div>\n <ng-content></ng-content>\n</label>\n" }]
829
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i1.FocusMonitor }, { type: i0.NgZone }]; }, propDecorators: { inputElement: [{
832
+ ], template: "<label\n class=\"wr-checkbox-container\"\n [class.wr-checkbox-container--checked]=\"this.checked\"\n [class.wr-checkbox-container--disabled]=\"this.disabled\"\n>\n <input\n #inputElement\n type=\"checkbox\"\n class=\"wr-checkbox-container__input\"\n [attr.autofocus]=\"autoFocus ? 'autofocus' : null\"\n [checked]=\"checked\"\n [ngModel]=\"checked\"\n [disabled]=\"!!disabled\"\n (ngModelChange)=\"onModelChange($event)\"\n />\n <div class=\"wr-checkbox-container-inner\">\n <div class=\"wr-checkbox-container-inner__mark\"></div>\n </div>\n <ng-content></ng-content>\n</label>\n" }]
833
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i1$1.FocusMonitor }, { type: i0.NgZone }]; }, propDecorators: { inputElement: [{
830
834
  type: ViewChild,
831
835
  args: ['inputElement', { static: true }]
832
836
  }], checked: [{
@@ -835,9 +839,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImpor
835
839
  type: Input
836
840
  }], autoFocus: [{
837
841
  type: Input
838
- }], checkedChange: [{
842
+ }], valueChange: [{
839
843
  type: Output
840
- }], class: [{
844
+ }], elClasses: [{
841
845
  type: HostBinding,
842
846
  args: ['class']
843
847
  }] } });
@@ -858,22 +862,72 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImpor
858
862
 
859
863
  class WrDividerComponent {
860
864
  constructor() {
861
- this.class = `${stylePrefix}-divider`;
865
+ /**
866
+ * Divider color
867
+ *
868
+ * @default 'light';
869
+ */
870
+ this.color = 'light';
871
+ /**
872
+ * Divider style
873
+ *
874
+ * @default 'solid';
875
+ */
876
+ this.type = 'solid';
877
+ /**
878
+ * Divider width
879
+ *
880
+ * @default 1px;
881
+ */
882
+ this.width = '1px';
862
883
  }
863
- }
864
- WrDividerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrDividerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
865
- WrDividerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.8", type: WrDividerComponent, selector: "wr-divider", host: { properties: { "class": "this.class" } }, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
866
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrDividerComponent, decorators: [{
867
- type: Component,
868
- args: [{
884
+ /** Set element classes **/
885
+ get elClasses() {
886
+ return {
887
+ 'wr-divider': true,
888
+ 'wr-divider--primary': this.color === 'primary',
889
+ 'wr-divider--secondary': this.color === 'secondary',
890
+ 'wr-divider--success': this.color === 'success',
891
+ 'wr-divider--warning': this.color === 'warning',
892
+ 'wr-divider--danger': this.color === 'danger',
893
+ 'wr-divider--light': this.color === 'light',
894
+ 'wr-divider--medium': this.color === 'medium',
895
+ 'wr-divider--dark': this.color === 'dark',
896
+ 'wr-divider--solid': this.type === 'solid',
897
+ 'wr-divider--dashed': this.type === 'dashed',
898
+ 'wr-divider--dotted': this.type === 'dotted'
899
+ };
900
+ }
901
+ /** Set element style **/
902
+ get elStyles() {
903
+ return {
904
+ '--wr-divider-width': this.width
905
+ };
906
+ }
907
+ }
908
+ WrDividerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrDividerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
909
+ WrDividerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.8", type: WrDividerComponent, selector: "wr-divider", inputs: { color: "color", type: "type", width: "width" }, host: { properties: { "class": "this.elClasses", "style": "this.elStyles" } }, exportAs: ["wrDivider"], ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
910
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrDividerComponent, decorators: [{
911
+ type: Component,
912
+ args: [{
869
913
  selector: 'wr-divider',
914
+ exportAs: 'wrDivider',
870
915
  template: '',
871
916
  changeDetection: ChangeDetectionStrategy.OnPush,
872
917
  encapsulation: ViewEncapsulation.None
873
918
  }]
874
- }], propDecorators: { class: [{
919
+ }], propDecorators: { color: [{
920
+ type: Input
921
+ }], type: [{
922
+ type: Input
923
+ }], width: [{
924
+ type: Input
925
+ }], elClasses: [{
875
926
  type: HostBinding,
876
927
  args: ['class']
928
+ }], elStyles: [{
929
+ type: HostBinding,
930
+ args: ['style']
877
931
  }] } });
878
932
 
879
933
  class WrDividerModule {
@@ -889,218 +943,58 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImpor
889
943
  }]
890
944
  }] });
891
945
 
892
- class WrInputDirective extends BaseComponent {
893
- constructor(ngControl) {
894
- super();
895
- this.ngControl = ngControl;
896
- this.class = `${stylePrefix}-input`;
897
- this._disabled = false;
898
- this.disabled$ = new Subject();
899
- }
900
- get disabled() {
901
- if (this.ngControl && this.ngControl.disabled !== null) {
902
- return this.ngControl.disabled;
903
- }
904
- return this._disabled;
905
- }
906
- set disabled(value) {
907
- this._disabled = value != null && `${value}` !== 'false';
908
- }
909
- ngOnInit() {
910
- if (this.ngControl) {
911
- this.ngControl.statusChanges
912
- ?.pipe(filter(() => this.ngControl.disabled !== null), takeUntil(this.ngUnsubscribe))
913
- .subscribe(() => this.disabled$.next(this.ngControl.disabled));
914
- }
946
+ class WrFormItemComponent {
947
+ constructor() {
948
+ this.hasError = false;
915
949
  }
916
- ngOnChanges(changes) {
917
- const { disabled } = changes;
918
- if (disabled) {
919
- this.disabled$.next(this.disabled);
920
- }
950
+ get elClasses() {
951
+ return {
952
+ 'wr-form-item': true,
953
+ 'wr-form-item--has-error': this.hasError
954
+ };
921
955
  }
922
956
  }
923
- WrInputDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrInputDirective, deps: [{ token: i1$1.NgControl, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Directive });
924
- WrInputDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.8", type: WrInputDirective, selector: "wr-input, input[wr-input], textarea[wr-input]", inputs: { disabled: "disabled" }, host: { properties: { "class": "this.class", "class.wr-input--disabled": "this.disabled", "disabled": "this.disabled" } }, usesInheritance: true, usesOnChanges: true, ngImport: i0 });
957
+ WrFormItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrFormItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
958
+ WrFormItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.8", type: WrFormItemComponent, selector: "wr-form-item", inputs: { hasError: "hasError" }, host: { properties: { "class": "this.elClasses" } }, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
925
959
  __decorate([
926
960
  InputBoolean()
927
- ], WrInputDirective.prototype, "disabled", null);
928
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrInputDirective, decorators: [{
929
- type: Directive,
961
+ ], WrFormItemComponent.prototype, "hasError", void 0);
962
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrFormItemComponent, decorators: [{
963
+ type: Component,
930
964
  args: [{
931
- selector: 'wr-input, input[wr-input], textarea[wr-input]'
965
+ selector: 'wr-form-item',
966
+ changeDetection: ChangeDetectionStrategy.OnPush,
967
+ encapsulation: ViewEncapsulation.None,
968
+ template: `<ng-content></ng-content>`
932
969
  }]
933
- }], ctorParameters: function () { return [{ type: i1$1.NgControl, decorators: [{
934
- type: Optional
935
- }, {
936
- type: Self
937
- }] }]; }, propDecorators: { class: [{
938
- type: HostBinding,
939
- args: ['class']
940
- }], disabled: [{
941
- type: HostBinding,
942
- args: [`class.${stylePrefix}-input--disabled`]
943
- }, {
944
- type: HostBinding,
945
- args: ['disabled']
946
- }, {
970
+ }], propDecorators: { hasError: [{
947
971
  type: Input
948
- }] } });
949
-
950
- class WrInputModule {
951
- }
952
- WrInputModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrInputModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
953
- WrInputModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.8", ngImport: i0, type: WrInputModule, declarations: [WrInputDirective], imports: [CommonModule, PlatformModule], exports: [WrInputDirective] });
954
- WrInputModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrInputModule, imports: [CommonModule, PlatformModule] });
955
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrInputModule, decorators: [{
956
- type: NgModule,
957
- args: [{
958
- imports: [CommonModule, PlatformModule],
959
- declarations: [WrInputDirective],
960
- exports: [WrInputDirective]
961
- }]
962
- }] });
963
-
964
- class WrExtendedInputComponent {
965
- constructor(ngControl, elRef, r2) {
966
- this.ngControl = ngControl;
967
- this.elRef = elRef;
968
- this.r2 = r2;
969
- this.class = `${stylePrefix}-extended-input`;
970
- this.disabled = false;
971
- this.value = undefined;
972
- this.touched = false;
973
- this.onChange = (value) => { };
974
- this.onTouched = () => { };
975
- if (ngControl !== null) {
976
- ngControl.valueAccessor = this;
977
- }
978
- }
979
- ngOnInit() {
980
- const el = this.elRef.nativeElement;
981
- const add = (klass) => this.r2.addClass(el, `${this.class}-${klass}`);
982
- if (this.suffix) {
983
- add('-has-suffix');
984
- }
985
- if (this.prefix) {
986
- add('-has-prefix');
987
- }
988
- }
989
- onInput($event) {
990
- this.value = $event.currentTarget.value;
991
- this.touched = true;
992
- this.onChange(this.value);
993
- }
994
- onFocusOut() {
995
- this.touched = true;
996
- this.onTouched();
997
- }
998
- registerOnChange(fn) {
999
- this.onChange = fn;
1000
- }
1001
- registerOnTouched(fn) {
1002
- this.onTouched = fn;
1003
- }
1004
- writeValue(obj) {
1005
- this.value = obj;
1006
- }
1007
- }
1008
- WrExtendedInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrExtendedInputComponent, deps: [{ token: i1$1.NgControl, optional: true, self: true }, { token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
1009
- WrExtendedInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.8", type: WrExtendedInputComponent, selector: "wr-extended-input", inputs: { suffix: "suffix", prefix: "prefix" }, host: { properties: { "class": "this.class" } }, ngImport: i0, template: "<div class=\"wr-extended-input-prefix\" *ngIf=\"prefix\">\n <span class=\"wr-extended-input-prefix__text\">{{ prefix }}</span>\n</div>\n<input wr-input [disabled]=\"disabled\" [value]=\"value\" (focusout)=\"onFocusOut()\" (input)=\"onInput($event)\" />\n<div class=\"wr-extended-input-suffix\" *ngIf=\"suffix\">\n <span class=\"wr-extended-input-suffix__text\">{{ suffix }}</span>\n</div>\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: WrInputDirective, selector: "wr-input, input[wr-input], textarea[wr-input]", inputs: ["disabled"] }], encapsulation: i0.ViewEncapsulation.None });
1010
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrExtendedInputComponent, decorators: [{
1011
- type: Component,
1012
- args: [{ selector: 'wr-extended-input', encapsulation: ViewEncapsulation.None, template: "<div class=\"wr-extended-input-prefix\" *ngIf=\"prefix\">\n <span class=\"wr-extended-input-prefix__text\">{{ prefix }}</span>\n</div>\n<input wr-input [disabled]=\"disabled\" [value]=\"value\" (focusout)=\"onFocusOut()\" (input)=\"onInput($event)\" />\n<div class=\"wr-extended-input-suffix\" *ngIf=\"suffix\">\n <span class=\"wr-extended-input-suffix__text\">{{ suffix }}</span>\n</div>\n" }]
1013
- }], ctorParameters: function () { return [{ type: i1$1.NgControl, decorators: [{
1014
- type: Optional
1015
- }, {
1016
- type: Self
1017
- }] }, { type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { class: [{
972
+ }], elClasses: [{
1018
973
  type: HostBinding,
1019
974
  args: ['class']
1020
- }], suffix: [{
1021
- type: Input
1022
- }], prefix: [{
1023
- type: Input
1024
975
  }] } });
1025
976
 
1026
- class WrExtendedInputModule {
1027
- }
1028
- WrExtendedInputModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrExtendedInputModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1029
- WrExtendedInputModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.8", ngImport: i0, type: WrExtendedInputModule, declarations: [WrExtendedInputComponent], imports: [CommonModule, PlatformModule, WrInputModule], exports: [WrExtendedInputComponent] });
1030
- WrExtendedInputModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrExtendedInputModule, imports: [CommonModule, PlatformModule, WrInputModule] });
1031
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrExtendedInputModule, decorators: [{
1032
- type: NgModule,
1033
- args: [{
1034
- imports: [CommonModule, PlatformModule, WrInputModule],
1035
- declarations: [WrExtendedInputComponent],
1036
- exports: [WrExtendedInputComponent]
1037
- }]
1038
- }] });
1039
-
1040
977
  class WrFormErrorComponent {
1041
978
  constructor() {
1042
- this.class = `${stylePrefix}-form-error`;
979
+ this.class = 'wr-form-error';
1043
980
  }
1044
981
  }
1045
982
  WrFormErrorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrFormErrorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1046
- WrFormErrorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.8", type: WrFormErrorComponent, selector: "wr-form-error", host: { properties: { "class": "this.class" } }, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
983
+ WrFormErrorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.8", type: WrFormErrorComponent, selector: "wr-form-error", host: { properties: { "class": "this.class" } }, exportAs: ["wrFormError"], ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1047
984
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrFormErrorComponent, decorators: [{
1048
985
  type: Component,
1049
986
  args: [{
1050
987
  selector: 'wr-form-error',
988
+ exportAs: 'wrFormError',
989
+ template: `<ng-content></ng-content>`,
1051
990
  changeDetection: ChangeDetectionStrategy.OnPush,
1052
991
  encapsulation: ViewEncapsulation.None,
1053
- template: `<ng-content></ng-content>`
1054
992
  }]
1055
993
  }], propDecorators: { class: [{
1056
994
  type: HostBinding,
1057
995
  args: ['class']
1058
996
  }] } });
1059
997
 
1060
- class WrFormItemComponent {
1061
- constructor(cdr, elRef, r2) {
1062
- this.cdr = cdr;
1063
- this.elRef = elRef;
1064
- this.r2 = r2;
1065
- this.hasError = false;
1066
- this.baseClass = `${stylePrefix}-form-item`;
1067
- }
1068
- ngOnInit() {
1069
- this.setClasses();
1070
- }
1071
- ngOnChanges(changes) {
1072
- if (!changes['hasError']?.currentValue) {
1073
- this.r2.removeClass(this.elRef.nativeElement, `${this.baseClass}--has-error`);
1074
- }
1075
- this.setClasses();
1076
- this.cdr.detectChanges();
1077
- }
1078
- setClasses() {
1079
- const el = this.elRef.nativeElement;
1080
- const add = (klass) => this.r2.addClass(el, `${this.baseClass}-${klass}`);
1081
- this.r2.addClass(el, this.baseClass);
1082
- if (this.hasError) {
1083
- add('-has-error');
1084
- }
1085
- }
1086
- }
1087
- WrFormItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrFormItemComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
1088
- WrFormItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.8", type: WrFormItemComponent, selector: "wr-form-item", inputs: { hasError: "hasError" }, usesOnChanges: true, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1089
- __decorate([
1090
- InputBoolean()
1091
- ], WrFormItemComponent.prototype, "hasError", void 0);
1092
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrFormItemComponent, decorators: [{
1093
- type: Component,
1094
- args: [{
1095
- selector: 'wr-form-item',
1096
- changeDetection: ChangeDetectionStrategy.OnPush,
1097
- encapsulation: ViewEncapsulation.None,
1098
- template: `<ng-content></ng-content>`
1099
- }]
1100
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { hasError: [{
1101
- type: Input
1102
- }] } });
1103
-
1104
998
  class WrFormModule {
1105
999
  }
1106
1000
  WrFormModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrFormModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
@@ -1115,95 +1009,207 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImpor
1115
1009
  }]
1116
1010
  }] });
1117
1011
 
1118
- class WrPasswordInputComponent {
1119
- constructor(ngControl) {
1120
- this.ngControl = ngControl;
1121
- this.class = `${stylePrefix}-password-input`;
1122
- this.type = 'password';
1123
- this.disabled = false;
1012
+ class WrInputComponent extends BaseComponent {
1013
+ constructor(cdr, elRef, focusMonitor, ngZone) {
1014
+ super();
1015
+ this.cdr = cdr;
1016
+ this.elRef = elRef;
1017
+ this.focusMonitor = focusMonitor;
1018
+ this.ngZone = ngZone;
1124
1019
  this.value = null;
1125
- this.touched = false;
1126
- this.onChange = (value) => { };
1127
- this.onTouched = () => { };
1128
- if (ngControl !== null) {
1129
- ngControl.valueAccessor = this;
1130
- }
1020
+ this.type = 'text';
1021
+ this.autocomplete = 'on';
1022
+ this.inputmode = 'text';
1023
+ this.disabled = false;
1024
+ this.readonly = false;
1025
+ this.autofocus = false;
1026
+ this.passwordIcons = false;
1027
+ this.placeholder = undefined;
1028
+ this.prefix = null;
1029
+ this.suffix = null;
1030
+ this.eyeOn = true;
1031
+ this.onChange = () => { };
1032
+ this.onTouch = () => { };
1131
1033
  }
1132
- onVisibilityClick($event) {
1133
- $event.stopPropagation();
1134
- this.type === 'password' ? (this.type = 'input') : (this.type = 'password');
1034
+ get elClasses() {
1035
+ return {
1036
+ 'wr-input': true,
1037
+ 'wr-input--has-prefix': this.prefix,
1038
+ 'wr-input--has-suffix': this.suffix,
1039
+ 'wr-input--password': this.passwordIcons,
1040
+ 'wr-input--disabled': this.disabled
1041
+ };
1135
1042
  }
1136
- onInput($event) {
1137
- this.value = $event.currentTarget.value;
1138
- this.touched = true;
1139
- this.onChange(this.value);
1043
+ ngOnInit() {
1044
+ this.ngZone.runOutsideAngular(() => {
1045
+ fromEvent(this.elRef.nativeElement, 'click')
1046
+ .pipe(takeUntil(this.ngUnsubscribe))
1047
+ .subscribe(event => {
1048
+ event.preventDefault();
1049
+ this.focus();
1050
+ if (this.disabled) {
1051
+ event.stopImmediatePropagation();
1052
+ return;
1053
+ }
1054
+ });
1055
+ fromEvent(this.inputElement.nativeElement, 'click')
1056
+ .pipe(takeUntil(this.ngUnsubscribe))
1057
+ .subscribe(event => event.stopPropagation());
1058
+ });
1059
+ }
1060
+ ngAfterViewInit() {
1061
+ if (this.autofocus) {
1062
+ this.focus();
1063
+ }
1140
1064
  }
1141
- onFocusOut() {
1142
- this.touched = true;
1143
- this.onTouched();
1065
+ ngOnDestroy() {
1066
+ super.ngOnDestroy();
1067
+ this.focusMonitor.stopMonitoring(this.elRef);
1068
+ }
1069
+ writeValue(value) {
1070
+ this.value = value;
1071
+ this.cdr.markForCheck();
1144
1072
  }
1145
1073
  registerOnChange(fn) {
1146
1074
  this.onChange = fn;
1147
1075
  }
1148
1076
  registerOnTouched(fn) {
1149
- this.onTouched = fn;
1077
+ this.onTouch = fn;
1078
+ }
1079
+ setDisabledState(isDisabled) {
1080
+ this.disabled = isDisabled;
1081
+ this.cdr.markForCheck();
1082
+ }
1083
+ focus() {
1084
+ this.focusMonitor.focusVia(this.inputElement, 'keyboard');
1085
+ }
1086
+ blur() {
1087
+ this.inputElement.nativeElement.blur();
1150
1088
  }
1151
- writeValue(obj) {
1152
- this.value = obj;
1089
+ onPasswordVisibilityChange(event) {
1090
+ event.stopPropagation();
1091
+ this.type === 'password' ? (this.type = 'text') : (this.type = 'password');
1092
+ this.eyeOn = !this.eyeOn;
1093
+ }
1094
+ onModelChange(value) {
1095
+ if (!this.disabled) {
1096
+ this.value = value;
1097
+ this.onChange(this.value);
1098
+ }
1153
1099
  }
1154
1100
  }
1155
- WrPasswordInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrPasswordInputComponent, deps: [{ token: i1$1.NgControl, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Component });
1156
- WrPasswordInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.8", type: WrPasswordInputComponent, selector: "wr-password-input", host: { properties: { "class": "this.class" } }, ngImport: i0, template: "<input\n wr-input\n [disabled]=\"disabled\"\n [type]=\"type\"\n [value]=\"value\"\n (focusout)=\"onFocusOut()\"\n (input)=\"onInput($event)\"\n/>\n<wr-icon\n class=\"wr-password-input-icon\"\n *ngIf=\"type === 'input'\"\n name=\"eye\"\n (click)=\"onVisibilityClick($event)\"\n></wr-icon>\n<wr-icon\n class=\"wr-password-input-icon\"\n *ngIf=\"type === 'password'\"\n name=\"eye-off\"\n (click)=\"onVisibilityClick($event)\"\n></wr-icon>\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: WrInputDirective, selector: "wr-input, input[wr-input], textarea[wr-input]", inputs: ["disabled"] }, { kind: "component", type: WrIconComponent, selector: "wr-icon[name]", inputs: ["name"] }], encapsulation: i0.ViewEncapsulation.None });
1157
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrPasswordInputComponent, decorators: [{
1101
+ WrInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrInputComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i1$1.FocusMonitor }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
1102
+ WrInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.8", type: WrInputComponent, selector: "wr-input", inputs: { value: "value", type: "type", autocomplete: "autocomplete", inputmode: "inputmode", disabled: "disabled", readonly: "readonly", autofocus: "autofocus", passwordIcons: "passwordIcons", placeholder: "placeholder", prefix: "prefix", suffix: "suffix" }, host: { properties: { "class": "this.elClasses" } }, providers: [
1103
+ {
1104
+ provide: NG_VALUE_ACCESSOR,
1105
+ useExisting: forwardRef(() => WrInputComponent),
1106
+ multi: true
1107
+ }
1108
+ ], viewQueries: [{ propertyName: "inputElement", first: true, predicate: ["inputElement"], descendants: true, static: true }], exportAs: ["wrInput"], usesInheritance: true, ngImport: i0, template: "<div class=\"wr-input-prefix\" *ngIf=\"prefix\">\n <span class=\"wr-input-prefix__text\">{{ prefix }}</span>\n</div>\n<div class=\"wr-input-el\">\n <div\n *ngIf=\"passwordIcons\"\n class=\"wr-input-el-icon\"\n (click)=\"onPasswordVisibilityChange($event)\"\n >\n <wr-icon class=\"wr-input-el-icon__icon\" [name]=\"eyeOn ? 'eye' : 'eye-off'\"></wr-icon>\n </div>\n <input\n #inputElement\n class=\"wr-input-el__native\"\n [type]=\"type\"\n [value]=\"value\"\n [placeholder]=\"placeholder ? placeholder : ''\"\n [attr.readonly]=\"readonly ? 'readonly' : null\"\n [attr.autofocus]=\"autofocus ? 'autofocus' : null\"\n [attr.disabled]=\"disabled ? 'disabled' : null\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.inputmode]=\"inputmode\"\n [ngModel]=\"value\"\n (ngModelChange)=\"onModelChange(value)\"\n />\n</div>\n<div class=\"wr-input-suffix\" *ngIf=\"suffix\">\n <span class=\"wr-input-suffix__text\">{{ suffix }}</span>\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: WrIconComponent, selector: "wr-icon[name]", inputs: ["name"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1109
+ __decorate([
1110
+ InputBoolean()
1111
+ ], WrInputComponent.prototype, "disabled", void 0);
1112
+ __decorate([
1113
+ InputBoolean()
1114
+ ], WrInputComponent.prototype, "readonly", void 0);
1115
+ __decorate([
1116
+ InputBoolean()
1117
+ ], WrInputComponent.prototype, "autofocus", void 0);
1118
+ __decorate([
1119
+ InputBoolean()
1120
+ ], WrInputComponent.prototype, "passwordIcons", void 0);
1121
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrInputComponent, decorators: [{
1158
1122
  type: Component,
1159
- args: [{ selector: 'wr-password-input', encapsulation: ViewEncapsulation.None, template: "<input\n wr-input\n [disabled]=\"disabled\"\n [type]=\"type\"\n [value]=\"value\"\n (focusout)=\"onFocusOut()\"\n (input)=\"onInput($event)\"\n/>\n<wr-icon\n class=\"wr-password-input-icon\"\n *ngIf=\"type === 'input'\"\n name=\"eye\"\n (click)=\"onVisibilityClick($event)\"\n></wr-icon>\n<wr-icon\n class=\"wr-password-input-icon\"\n *ngIf=\"type === 'password'\"\n name=\"eye-off\"\n (click)=\"onVisibilityClick($event)\"\n></wr-icon>\n" }]
1160
- }], ctorParameters: function () { return [{ type: i1$1.NgControl, decorators: [{
1161
- type: Optional
1162
- }, {
1163
- type: Self
1164
- }] }]; }, propDecorators: { class: [{
1123
+ args: [{ selector: 'wr-input', exportAs: 'wrInput', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [
1124
+ {
1125
+ provide: NG_VALUE_ACCESSOR,
1126
+ useExisting: forwardRef(() => WrInputComponent),
1127
+ multi: true
1128
+ }
1129
+ ], template: "<div class=\"wr-input-prefix\" *ngIf=\"prefix\">\n <span class=\"wr-input-prefix__text\">{{ prefix }}</span>\n</div>\n<div class=\"wr-input-el\">\n <div\n *ngIf=\"passwordIcons\"\n class=\"wr-input-el-icon\"\n (click)=\"onPasswordVisibilityChange($event)\"\n >\n <wr-icon class=\"wr-input-el-icon__icon\" [name]=\"eyeOn ? 'eye' : 'eye-off'\"></wr-icon>\n </div>\n <input\n #inputElement\n class=\"wr-input-el__native\"\n [type]=\"type\"\n [value]=\"value\"\n [placeholder]=\"placeholder ? placeholder : ''\"\n [attr.readonly]=\"readonly ? 'readonly' : null\"\n [attr.autofocus]=\"autofocus ? 'autofocus' : null\"\n [attr.disabled]=\"disabled ? 'disabled' : null\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.inputmode]=\"inputmode\"\n [ngModel]=\"value\"\n (ngModelChange)=\"onModelChange(value)\"\n />\n</div>\n<div class=\"wr-input-suffix\" *ngIf=\"suffix\">\n <span class=\"wr-input-suffix__text\">{{ suffix }}</span>\n</div>\n" }]
1130
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i1$1.FocusMonitor }, { type: i0.NgZone }]; }, propDecorators: { value: [{
1131
+ type: Input
1132
+ }], type: [{
1133
+ type: Input
1134
+ }], autocomplete: [{
1135
+ type: Input
1136
+ }], inputmode: [{
1137
+ type: Input
1138
+ }], disabled: [{
1139
+ type: Input
1140
+ }], readonly: [{
1141
+ type: Input
1142
+ }], autofocus: [{
1143
+ type: Input
1144
+ }], passwordIcons: [{
1145
+ type: Input
1146
+ }], placeholder: [{
1147
+ type: Input
1148
+ }], prefix: [{
1149
+ type: Input
1150
+ }], suffix: [{
1151
+ type: Input
1152
+ }], inputElement: [{
1153
+ type: ViewChild,
1154
+ args: ['inputElement', { static: true }]
1155
+ }], elClasses: [{
1165
1156
  type: HostBinding,
1166
1157
  args: ['class']
1167
1158
  }] } });
1168
1159
 
1169
- class WrPasswordInputModule {
1160
+ class WrInputModule {
1170
1161
  }
1171
- WrPasswordInputModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrPasswordInputModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1172
- WrPasswordInputModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.8", ngImport: i0, type: WrPasswordInputModule, declarations: [WrPasswordInputComponent], imports: [CommonModule, PlatformModule, WrInputModule, WrIconModule], exports: [WrPasswordInputComponent] });
1173
- WrPasswordInputModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrPasswordInputModule, imports: [CommonModule, PlatformModule, WrInputModule, WrIconModule] });
1174
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrPasswordInputModule, decorators: [{
1162
+ WrInputModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrInputModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1163
+ WrInputModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.8", ngImport: i0, type: WrInputModule, declarations: [WrInputComponent], imports: [CommonModule, FormsModule, WrIconModule], exports: [WrInputComponent] });
1164
+ WrInputModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrInputModule, imports: [CommonModule, FormsModule, WrIconModule] });
1165
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrInputModule, decorators: [{
1175
1166
  type: NgModule,
1176
1167
  args: [{
1177
- imports: [CommonModule, PlatformModule, WrInputModule, WrIconModule],
1178
- declarations: [WrPasswordInputComponent],
1179
- exports: [WrPasswordInputComponent]
1168
+ imports: [CommonModule, FormsModule, WrIconModule],
1169
+ declarations: [WrInputComponent],
1170
+ exports: [WrInputComponent]
1180
1171
  }]
1181
1172
  }] });
1182
1173
 
1183
1174
  class WrSkeletonComponent {
1184
- constructor(elRef) {
1185
- this.elRef = elRef;
1175
+ constructor() {
1186
1176
  this.color = 'dark';
1187
- this.class = `${stylePrefix}-skeleton`;
1177
+ this.animated = true;
1188
1178
  }
1189
- ngAfterViewInit() {
1190
- const style = this.color === 'light' ? `var(--${stylePrefix}-color-white-rgb)` : `var(--${stylePrefix}-color-dark-rgb)`;
1191
- this.elRef.nativeElement.style.setProperty('--skeleton-style', style);
1179
+ get elClasses() {
1180
+ return {
1181
+ 'wr-skeleton': true,
1182
+ 'wr-skeleton--animated': this.animated,
1183
+ 'wr-skeleton--primary': this.color === 'primary',
1184
+ 'wr-skeleton--secondary': this.color === 'secondary',
1185
+ 'wr-skeleton--success': this.color === 'success',
1186
+ 'wr-skeleton--warning': this.color === 'warning',
1187
+ 'wr-skeleton--danger': this.color === 'danger',
1188
+ 'wr-skeleton--light': this.color === 'light',
1189
+ 'wr-skeleton--medium': this.color === 'medium',
1190
+ 'wr-skeleton--dark': this.color === 'dark'
1191
+ };
1192
1192
  }
1193
1193
  }
1194
- WrSkeletonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrSkeletonComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
1195
- WrSkeletonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.8", type: WrSkeletonComponent, selector: "wr-skeleton", inputs: { color: "color" }, host: { properties: { "class": "this.class" } }, ngImport: i0, template: '<span>&nbsp;</span>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1194
+ WrSkeletonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrSkeletonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1195
+ WrSkeletonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.8", type: WrSkeletonComponent, selector: "wr-skeleton", inputs: { color: "color", animated: "animated" }, host: { properties: { "class": "this.elClasses" } }, exportAs: ["wrSkeleton"], ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1196
+ __decorate([
1197
+ InputBoolean()
1198
+ ], WrSkeletonComponent.prototype, "animated", void 0);
1196
1199
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrSkeletonComponent, decorators: [{
1197
1200
  type: Component,
1198
1201
  args: [{
1199
1202
  selector: 'wr-skeleton',
1200
- template: '<span>&nbsp;</span>',
1203
+ exportAs: 'wrSkeleton',
1204
+ template: '',
1201
1205
  changeDetection: ChangeDetectionStrategy.OnPush,
1202
1206
  encapsulation: ViewEncapsulation.None
1203
1207
  }]
1204
- }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { color: [{
1208
+ }], propDecorators: { color: [{
1205
1209
  type: Input
1206
- }], class: [{
1210
+ }], animated: [{
1211
+ type: Input
1212
+ }], elClasses: [{
1207
1213
  type: HostBinding,
1208
1214
  args: ['class']
1209
1215
  }] } });
@@ -1211,112 +1217,109 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImpor
1211
1217
  class WrSkeletonModule {
1212
1218
  }
1213
1219
  WrSkeletonModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrSkeletonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1214
- WrSkeletonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.8", ngImport: i0, type: WrSkeletonModule, declarations: [WrSkeletonComponent], imports: [CommonModule, WrSpinnerModule], exports: [WrSkeletonComponent] });
1215
- WrSkeletonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrSkeletonModule, imports: [CommonModule, WrSpinnerModule] });
1220
+ WrSkeletonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.8", ngImport: i0, type: WrSkeletonModule, declarations: [WrSkeletonComponent], imports: [CommonModule], exports: [WrSkeletonComponent] });
1221
+ WrSkeletonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrSkeletonModule, imports: [CommonModule] });
1216
1222
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrSkeletonModule, decorators: [{
1217
1223
  type: NgModule,
1218
1224
  args: [{
1219
- imports: [CommonModule, WrSpinnerModule],
1225
+ imports: [CommonModule],
1220
1226
  declarations: [WrSkeletonComponent],
1221
1227
  exports: [WrSkeletonComponent]
1222
1228
  }]
1223
1229
  }] });
1224
1230
 
1225
1231
  class WrTagComponent {
1226
- constructor(cdr, elRef, r2) {
1227
- this.cdr = cdr;
1228
- this.elRef = elRef;
1229
- this.r2 = r2;
1232
+ constructor() {
1230
1233
  this.color = 'primary';
1231
- this.transparent = false;
1232
- this.loading = false;
1234
+ this.icon = null;
1235
+ this.iconPosition = 'start';
1233
1236
  this.outlined = false;
1234
1237
  this.rounded = false;
1238
+ this.transparent = false;
1235
1239
  this.hoverable = false;
1236
- this.baseClass = `${stylePrefix}-tag`;
1237
- }
1238
- ngOnInit() {
1239
- this.setClasses();
1240
- }
1241
- ngOnChanges(changes) {
1242
- this.setClasses();
1243
- this.cdr.detectChanges();
1240
+ this.loading = false;
1244
1241
  }
1245
- setClasses() {
1246
- const el = this.elRef.nativeElement;
1247
- const add = (klass) => this.r2.addClass(el, `${this.baseClass}-${klass}`);
1248
- this.r2.addClass(el, this.baseClass);
1249
- add(this.color);
1250
- if (this.rounded) {
1251
- add(`-rounded`);
1252
- }
1253
- if (this.transparent) {
1254
- add(`-transparent`);
1255
- }
1256
- if (this.hoverable) {
1257
- add(`-hoverable`);
1258
- }
1259
- if (this.outlined) {
1260
- add(`-outlined`);
1261
- }
1242
+ get elClasses() {
1243
+ return {
1244
+ 'wr-tag': true,
1245
+ 'wr-tag--primary': this.color === 'primary',
1246
+ 'wr-tag--secondary': this.color === 'secondary',
1247
+ 'wr-tag--success': this.color === 'success',
1248
+ 'wr-tag--warning': this.color === 'warning',
1249
+ 'wr-tag--danger': this.color === 'danger',
1250
+ 'wr-tag--light': this.color === 'light',
1251
+ 'wr-tag--medium': this.color === 'medium',
1252
+ 'wr-tag--dark': this.color === 'dark',
1253
+ 'wr-tag--icon-start': (this.icon || this.loading) && this.iconPosition === 'start',
1254
+ 'wr-tag--icon-end': (this.icon || this.loading) && this.iconPosition === 'end',
1255
+ 'wr-tag--loading': this.loading,
1256
+ 'wr-tag--rounded': this.rounded,
1257
+ 'wr-tag--outlined': this.outlined,
1258
+ 'wr-tag--transparent': this.transparent,
1259
+ 'wr-tag--hoverable': this.hoverable
1260
+ };
1262
1261
  }
1263
1262
  }
1264
- WrTagComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrTagComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
1265
- WrTagComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.8", type: WrTagComponent, selector: "wr-tag", inputs: { color: "color", transparent: "transparent", loading: "loading", outlined: "outlined", rounded: "rounded", hoverable: "hoverable" }, usesOnChanges: true, ngImport: i0, template: '<wr-spin *ngIf="loading"></wr-spin><ng-content></ng-content>', isInline: true, dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: WrSpinnerComponent, selector: "wr-spin" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1263
+ WrTagComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrTagComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1264
+ WrTagComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.8", type: WrTagComponent, selector: "wr-tag", inputs: { color: "color", icon: "icon", iconPosition: "iconPosition", outlined: "outlined", rounded: "rounded", transparent: "transparent", hoverable: "hoverable", loading: "loading" }, host: { properties: { "class": "this.elClasses" } }, exportAs: ["wrTag"], ngImport: i0, template: "<wr-spin class=\"wr-tag__spin\" *ngIf=\"loading && iconPosition === 'start'\"></wr-spin>\n<wr-icon class=\"wr-tag__icon\" *ngIf=\"icon && !loading && iconPosition === 'start'\" [name]=\"icon\"></wr-icon>\n<ng-content></ng-content>\n<wr-spin class=\"wr-tag__spin\" *ngIf=\"loading && iconPosition === 'end'\"></wr-spin>\n<wr-icon class=\"wr-tag__icon\" *ngIf=\"icon && !loading && iconPosition === 'end'\" [name]=\"icon\"></wr-icon>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: WrIconComponent, selector: "wr-icon[name]", inputs: ["name"] }, { kind: "component", type: WrSpinnerComponent, selector: "wr-spin", exportAs: ["wrSpin"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1266
1265
  __decorate([
1267
1266
  InputBoolean()
1268
- ], WrTagComponent.prototype, "transparent", void 0);
1267
+ ], WrTagComponent.prototype, "outlined", void 0);
1269
1268
  __decorate([
1270
1269
  InputBoolean()
1271
- ], WrTagComponent.prototype, "loading", void 0);
1270
+ ], WrTagComponent.prototype, "rounded", void 0);
1272
1271
  __decorate([
1273
1272
  InputBoolean()
1274
- ], WrTagComponent.prototype, "outlined", void 0);
1273
+ ], WrTagComponent.prototype, "transparent", void 0);
1275
1274
  __decorate([
1276
1275
  InputBoolean()
1277
- ], WrTagComponent.prototype, "rounded", void 0);
1276
+ ], WrTagComponent.prototype, "hoverable", void 0);
1278
1277
  __decorate([
1279
1278
  InputBoolean()
1280
- ], WrTagComponent.prototype, "hoverable", void 0);
1279
+ ], WrTagComponent.prototype, "loading", void 0);
1281
1280
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrTagComponent, decorators: [{
1282
1281
  type: Component,
1283
- args: [{
1284
- selector: 'wr-tag',
1285
- template: '<wr-spin *ngIf="loading"></wr-spin><ng-content></ng-content>',
1286
- changeDetection: ChangeDetectionStrategy.OnPush,
1287
- encapsulation: ViewEncapsulation.None
1288
- }]
1289
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { color: [{
1282
+ args: [{ selector: 'wr-tag', exportAs: 'wrTag', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<wr-spin class=\"wr-tag__spin\" *ngIf=\"loading && iconPosition === 'start'\"></wr-spin>\n<wr-icon class=\"wr-tag__icon\" *ngIf=\"icon && !loading && iconPosition === 'start'\" [name]=\"icon\"></wr-icon>\n<ng-content></ng-content>\n<wr-spin class=\"wr-tag__spin\" *ngIf=\"loading && iconPosition === 'end'\"></wr-spin>\n<wr-icon class=\"wr-tag__icon\" *ngIf=\"icon && !loading && iconPosition === 'end'\" [name]=\"icon\"></wr-icon>\n" }]
1283
+ }], propDecorators: { color: [{
1290
1284
  type: Input
1291
- }], transparent: [{
1285
+ }], icon: [{
1292
1286
  type: Input
1293
- }], loading: [{
1287
+ }], iconPosition: [{
1294
1288
  type: Input
1295
1289
  }], outlined: [{
1296
1290
  type: Input
1297
1291
  }], rounded: [{
1298
1292
  type: Input
1293
+ }], transparent: [{
1294
+ type: Input
1299
1295
  }], hoverable: [{
1300
1296
  type: Input
1297
+ }], loading: [{
1298
+ type: Input
1299
+ }], elClasses: [{
1300
+ type: HostBinding,
1301
+ args: ['class']
1301
1302
  }] } });
1302
1303
 
1303
1304
  class WrTagModule {
1304
1305
  }
1305
1306
  WrTagModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrTagModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1306
- WrTagModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.8", ngImport: i0, type: WrTagModule, declarations: [WrTagComponent], imports: [CommonModule, WrSpinnerModule], exports: [WrTagComponent] });
1307
- WrTagModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrTagModule, imports: [CommonModule, WrSpinnerModule] });
1307
+ WrTagModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.8", ngImport: i0, type: WrTagModule, declarations: [WrTagComponent], imports: [CommonModule, WrIconModule, WrSpinnerModule], exports: [WrTagComponent] });
1308
+ WrTagModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrTagModule, imports: [CommonModule, WrIconModule, WrSpinnerModule] });
1308
1309
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrTagModule, decorators: [{
1309
1310
  type: NgModule,
1310
1311
  args: [{
1311
- imports: [CommonModule, WrSpinnerModule],
1312
+ imports: [CommonModule, WrIconModule, WrSpinnerModule],
1312
1313
  declarations: [WrTagComponent],
1313
1314
  exports: [WrTagComponent]
1314
1315
  }]
1315
1316
  }] });
1316
1317
 
1318
+ // Components
1319
+
1317
1320
  /**
1318
1321
  * Generated bundle index. Do not edit.
1319
1322
  */
1320
1323
 
1321
- export { WrButtonComponent, WrButtonModule, WrCheckboxComponent, WrCheckboxModule, WrDividerComponent, WrDividerModule, WrExtendedInputComponent, WrExtendedInputModule, WrFormErrorComponent, WrFormItemComponent, WrFormModule, WrIconComponent, WrIconModule, WrIconService, WrInputDirective, WrInputModule, WrPasswordInputComponent, WrPasswordInputModule, WrSkeletonComponent, WrSkeletonModule, WrSpinnerComponent, WrSpinnerModule, WrTagComponent, WrTagModule, wrIconAdd, wrIconAddCircle, wrIconAddCircleOutline, wrIconAlert, wrIconAlertCircle, wrIconAlertCircleOutline, wrIconAlertSquircle, wrIconArrowBack, wrIconArrowBackCircle, wrIconArrowBottom, wrIconArrowBottomCircle, wrIconArrowForward, wrIconArrowForwardCircle, wrIconArrowTop, wrIconArrowTopCircle, wrIconBug, wrIconBugOutline, wrIconCaretBack, wrIconCaretForward, wrIconCheckmark, wrIconCheckmarkCircle, wrIconCheckmarkCircleOutline, wrIconChevronDown, wrIconChevronUp, wrIconClock, wrIconCloseCircle, wrIconCog, wrIconCopy, wrIconCopyOutline, wrIconDiscover, wrIconDocument, wrIconDotsHorizontal, wrIconDotsVertical, wrIconDownload, wrIconEye, wrIconEyeOff, wrIconFileAab, wrIconFileApk, wrIconFileIpa, wrIconFileZip, wrIconFilter, wrIconFilterOutline, wrIconFlash, wrIconFolder, wrIconHelp, wrIconHome, wrIconInfoCircleOutline, wrIconLock, wrIconLockOpened, wrIconLogoAndroid, wrIconLogoApple, wrIconLogoAppscreener, wrIconLogoGithub, wrIconLogoOversecured, wrIconLogoStingray, wrIconModules, wrIconPlay, wrIconPlayBack, wrIconPlayCircle, wrIconPlayForward, wrIconPlusCircle, wrIconReader, wrIconRepeat, wrIconSearch, wrIconSet, wrIconShield, wrIconShieldCheckmark, wrIconShieldCheckmarkOutline, wrIconShieldOutline, wrIconStop, wrIconStopCircle, wrIconTrash, wrIconUser, wrIconUserAdd, wrIconUserCircle, wrIconUserRemove, wrIconWarning };
1324
+ export { WrButtonComponent, WrButtonModule, WrCheckboxComponent, WrCheckboxModule, WrDividerComponent, WrDividerModule, WrFormErrorComponent, WrFormItemComponent, WrFormModule, WrIconComponent, WrIconModule, WrIconService, WrInputComponent, WrInputModule, WrSkeletonComponent, WrSkeletonModule, WrSpinnerComponent, WrSpinnerModule, WrTagComponent, WrTagModule, wrIconSet };
1322
1325
  //# sourceMappingURL=ngwr.mjs.map