ngwr 0.0.15 → 0.1.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.
Files changed (77) 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 +4 -0
  5. package/_core/types/input-autocomplete-type.d.ts +1 -0
  6. package/_core/types/input-mode-type.d.ts +1 -0
  7. package/_core/types/input-type.d.ts +1 -0
  8. package/button/button.component.d.ts +4 -7
  9. package/button/index.d.ts +2 -2
  10. package/checkbox/checkbox.component.d.ts +5 -5
  11. package/checkbox/index.d.ts +2 -2
  12. package/divider/divider.component.d.ts +24 -2
  13. package/divider/index.d.ts +2 -2
  14. package/esm2020/_core/index.mjs +2 -2
  15. package/esm2020/_core/types/color.mjs +2 -0
  16. package/esm2020/_core/types/index.mjs +1 -1
  17. package/esm2020/_core/types/input-autocomplete-type.mjs +2 -0
  18. package/esm2020/_core/types/input-mode-type.mjs +2 -0
  19. package/esm2020/_core/types/input-type.mjs +2 -0
  20. package/esm2020/button/button.component.mjs +2 -2
  21. package/esm2020/button/index.mjs +3 -3
  22. package/esm2020/checkbox/checkbox.component.mjs +14 -10
  23. package/esm2020/checkbox/index.mjs +3 -3
  24. package/esm2020/divider/divider.component.mjs +55 -6
  25. package/esm2020/divider/index.mjs +3 -3
  26. package/esm2020/form/form-error.component.mjs +5 -5
  27. package/esm2020/form/form-item.component.mjs +15 -28
  28. package/esm2020/form/index.mjs +4 -4
  29. package/esm2020/icon/index.mjs +5 -5
  30. package/esm2020/input/index.mjs +3 -3
  31. package/esm2020/input/input.component.mjs +238 -0
  32. package/esm2020/input/input.module.mjs +9 -8
  33. package/esm2020/public-api.mjs +11 -12
  34. package/esm2020/skeleton/index.mjs +3 -3
  35. package/esm2020/skeleton/skeleton.component.mjs +29 -13
  36. package/esm2020/skeleton/skeleton.module.mjs +4 -5
  37. package/esm2020/spinner/index.mjs +3 -3
  38. package/esm2020/spinner/spinner.component.mjs +4 -4
  39. package/esm2020/tag/index.mjs +3 -3
  40. package/esm2020/tag/tag.component.mjs +47 -51
  41. package/esm2020/tag/tag.module.mjs +5 -4
  42. package/fesm2015/ngwr.mjs +514 -440
  43. package/fesm2015/ngwr.mjs.map +1 -1
  44. package/fesm2020/ngwr.mjs +515 -434
  45. package/fesm2020/ngwr.mjs.map +1 -1
  46. package/form/form-error.component.d.ts +1 -1
  47. package/form/form-item.component.d.ts +3 -11
  48. package/form/index.d.ts +3 -3
  49. package/icon/index.d.ts +4 -4
  50. package/input/index.d.ts +2 -2
  51. package/input/input.component.d.ts +62 -0
  52. package/input/input.module.d.ts +4 -3
  53. package/ngwr.min.css +1 -1
  54. package/package.json +1 -1
  55. package/public-api.d.ts +10 -11
  56. package/skeleton/index.d.ts +2 -2
  57. package/skeleton/skeleton.component.d.ts +6 -8
  58. package/skeleton/skeleton.module.d.ts +1 -2
  59. package/spinner/index.d.ts +2 -2
  60. package/spinner/spinner.component.d.ts +1 -1
  61. package/tag/index.d.ts +2 -2
  62. package/tag/tag.component.d.ts +10 -16
  63. package/tag/tag.module.d.ts +3 -2
  64. package/esm2020/extended-input/extended-input.component.mjs +0 -68
  65. package/esm2020/extended-input/extended-input.module.mjs +0 -20
  66. package/esm2020/extended-input/index.mjs +0 -3
  67. package/esm2020/input/input.directive.mjs +0 -65
  68. package/esm2020/password-input/index.mjs +0 -3
  69. package/esm2020/password-input/password-input.component.mjs +0 -58
  70. package/esm2020/password-input/password-input.module.mjs +0 -21
  71. package/extended-input/extended-input.component.d.ts +0 -26
  72. package/extended-input/extended-input.module.d.ts +0 -10
  73. package/extended-input/index.d.ts +0 -2
  74. package/input/input.directive.d.ts +0 -18
  75. package/password-input/index.d.ts +0 -2
  76. package/password-input/password-input.component.d.ts +0 -22
  77. 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';
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';
5
+ import { takeUntil } from 'rxjs/operators';
6
+ import { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';
7
+ import * as i1 from '@angular/common';
8
+ import { DOCUMENT, CommonModule } from '@angular/common';
9
+ import * as i2 from '@angular/forms';
10
+ import { NG_VALUE_ACCESSOR, FormsModule, NG_VALIDATORS } from '@angular/forms';
11
+ import * as i1$1 from '@angular/cdk/a11y';
10
12
  import { A11yModule } from '@angular/cdk/a11y';
11
- import * as i1$1 from '@angular/forms';
12
- import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
13
- import { PlatformModule } from '@angular/cdk/platform';
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';
883
+ }
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
+ };
862
906
  }
863
907
  }
864
908
  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 });
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 });
866
910
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrDividerComponent, decorators: [{
867
911
  type: Component,
868
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,285 @@ 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;
1124
- this.value = null;
1125
- this.touched = false;
1126
- this.onChange = (value) => { };
1127
- this.onTouched = () => { };
1128
- if (ngControl !== null) {
1129
- ngControl.valueAccessor = this;
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;
1019
+ this.placeholder = '';
1020
+ this.prefix = null;
1021
+ this.suffix = null;
1022
+ this.passwordIcons = false;
1023
+ this.eyeOn = true;
1024
+ this._value = '';
1025
+ this._disabled = false;
1026
+ this._readonly = false;
1027
+ this._required = false;
1028
+ this._autofocus = false;
1029
+ this._focused = false;
1030
+ this._autocomplete = 'off';
1031
+ this._type = 'text';
1032
+ this._mode = 'text';
1033
+ this.onChangeCallback = () => { };
1034
+ this.onTouchedCallback = () => { };
1035
+ }
1036
+ get type() {
1037
+ return this._type;
1038
+ }
1039
+ set type(type) {
1040
+ this._type = type;
1041
+ }
1042
+ get inputmode() {
1043
+ return this._mode;
1044
+ }
1045
+ set inputmode(mode) {
1046
+ this._mode = mode;
1047
+ }
1048
+ get disabled() {
1049
+ return this._disabled;
1050
+ }
1051
+ set disabled(disabled) {
1052
+ this._disabled = coerceBooleanProperty(disabled);
1053
+ }
1054
+ get readonly() {
1055
+ return this._readonly;
1056
+ }
1057
+ set readonly(readonly) {
1058
+ this._readonly = coerceBooleanProperty(readonly);
1059
+ }
1060
+ get required() {
1061
+ return this._required;
1062
+ }
1063
+ set required(required) {
1064
+ this._required = coerceBooleanProperty(required);
1065
+ }
1066
+ get autofocus() {
1067
+ return this._autofocus;
1068
+ }
1069
+ set autofocus(autofocus) {
1070
+ this._autofocus = coerceBooleanProperty(autofocus);
1071
+ }
1072
+ get autocomplete() {
1073
+ return this._autocomplete;
1074
+ }
1075
+ set autocomplete(autofocus) {
1076
+ this._autocomplete = autofocus;
1077
+ }
1078
+ get value() {
1079
+ return this.type === 'number' ? this.valueAsNumber : this._value;
1080
+ }
1081
+ set value(val) {
1082
+ if (val !== this._value) {
1083
+ this._value = val;
1084
+ this.onChangeCallback(this.value);
1085
+ }
1086
+ }
1087
+ get valueAsString() {
1088
+ if (this._value == null || typeof this._value === 'undefined')
1089
+ return '';
1090
+ return String(this._value);
1091
+ }
1092
+ get valueAsNumber() {
1093
+ return coerceNumberProperty(this._value);
1094
+ }
1095
+ get isBadInput() {
1096
+ const validity = this.inputElement?.nativeElement?.validity;
1097
+ return validity && validity.badInput;
1098
+ }
1099
+ get elClasses() {
1100
+ return {
1101
+ 'wr-input': true,
1102
+ 'wr-input--has-prefix': this.prefix,
1103
+ 'wr-input--has-suffix': this.suffix,
1104
+ 'wr-input--password': this.passwordIcons,
1105
+ 'wr-input--disabled': this.disabled
1106
+ };
1107
+ }
1108
+ ngOnInit() {
1109
+ this.ngZone.runOutsideAngular(() => {
1110
+ fromEvent(this.elRef.nativeElement, 'click')
1111
+ .pipe(takeUntil(this.ngUnsubscribe))
1112
+ .subscribe(event => {
1113
+ event.preventDefault();
1114
+ this.onFocus();
1115
+ if (this.disabled) {
1116
+ event.stopImmediatePropagation();
1117
+ return;
1118
+ }
1119
+ });
1120
+ fromEvent(this.inputElement.nativeElement, 'click')
1121
+ .pipe(takeUntil(this.ngUnsubscribe))
1122
+ .subscribe(event => event.stopPropagation());
1123
+ });
1124
+ }
1125
+ ngAfterViewInit() {
1126
+ if (this.autofocus) {
1127
+ this.onFocus();
1128
+ this.cdr.markForCheck();
1130
1129
  }
1131
1130
  }
1132
- onVisibilityClick($event) {
1133
- $event.stopPropagation();
1134
- this.type === 'password' ? (this.type = 'input') : (this.type = 'password');
1131
+ ngOnDestroy() {
1132
+ super.ngOnDestroy();
1133
+ this.focusMonitor.stopMonitoring(this.elRef);
1134
+ }
1135
+ onFocus(event) {
1136
+ if (event) {
1137
+ event.stopPropagation();
1138
+ }
1139
+ this._focused = true;
1140
+ this.focusMonitor.focusVia(this.inputElement, 'keyboard');
1141
+ }
1142
+ onBlur(event) {
1143
+ if (event) {
1144
+ event.stopPropagation();
1145
+ }
1146
+ this._focused = false;
1147
+ // this.inputElement.nativeElement.blur();
1148
+ this.onTouchedCallback();
1135
1149
  }
1136
- onInput($event) {
1137
- this.value = $event.currentTarget.value;
1138
- this.touched = true;
1139
- this.onChange(this.value);
1150
+ validate(control) {
1151
+ return {
1152
+ ...(this.isBadInput ? { badInput: true } : null)
1153
+ };
1140
1154
  }
1141
- onFocusOut() {
1142
- this.touched = true;
1143
- this.onTouched();
1155
+ writeValue(value) {
1156
+ if (value !== this._value) {
1157
+ this._value = value;
1158
+ }
1159
+ this.cdr.markForCheck();
1144
1160
  }
1145
1161
  registerOnChange(fn) {
1146
- this.onChange = fn;
1162
+ this.onChangeCallback = fn;
1147
1163
  }
1148
1164
  registerOnTouched(fn) {
1149
- this.onTouched = fn;
1165
+ this.onTouchedCallback = fn;
1150
1166
  }
1151
- writeValue(obj) {
1152
- this.value = obj;
1167
+ onPasswordVisibilityChange() {
1168
+ this.type === 'password' ? (this.type = 'text') : (this.type = 'password');
1169
+ this.eyeOn = !this.eyeOn;
1170
+ this.onFocus();
1171
+ }
1172
+ setDisabledState(isDisabled) {
1173
+ this.disabled = coerceBooleanProperty(isDisabled);
1153
1174
  }
1154
1175
  }
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: [{
1176
+ 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 });
1177
+ WrInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.8", type: WrInputComponent, selector: "wr-input", inputs: { placeholder: "placeholder", prefix: "prefix", suffix: "suffix", passwordIcons: "passwordIcons", type: "type", inputmode: "inputmode", disabled: "disabled", readonly: "readonly", required: "required", autofocus: "autofocus", autocomplete: "autocomplete", value: "value" }, host: { properties: { "class": "this.elClasses" } }, providers: [
1178
+ {
1179
+ provide: NG_VALUE_ACCESSOR,
1180
+ useExisting: forwardRef(() => WrInputComponent),
1181
+ multi: true
1182
+ },
1183
+ {
1184
+ provide: NG_VALIDATORS,
1185
+ useExisting: forwardRef(() => WrInputComponent),
1186
+ multi: true
1187
+ }
1188
+ ], 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 *ngIf=\"passwordIcons\" class=\"wr-input-el-icon\" (click)=\"onPasswordVisibilityChange()\">\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 [ngModel]=\"valueAsString\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [type]=\"type\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.inputmode]=\"inputmode\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n (ngModelChange)=\"value = $event\"\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 });
1189
+ __decorate([
1190
+ InputBoolean()
1191
+ ], WrInputComponent.prototype, "passwordIcons", void 0);
1192
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrInputComponent, decorators: [{
1158
1193
  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: [{
1194
+ args: [{ selector: 'wr-input', exportAs: 'wrInput', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [
1195
+ {
1196
+ provide: NG_VALUE_ACCESSOR,
1197
+ useExisting: forwardRef(() => WrInputComponent),
1198
+ multi: true
1199
+ },
1200
+ {
1201
+ provide: NG_VALIDATORS,
1202
+ useExisting: forwardRef(() => WrInputComponent),
1203
+ multi: true
1204
+ }
1205
+ ], 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 *ngIf=\"passwordIcons\" class=\"wr-input-el-icon\" (click)=\"onPasswordVisibilityChange()\">\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 [ngModel]=\"valueAsString\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [type]=\"type\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.inputmode]=\"inputmode\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n (ngModelChange)=\"value = $event\"\n />\n</div>\n<div class=\"wr-input-suffix\" *ngIf=\"suffix\">\n <span class=\"wr-input-suffix__text\">{{ suffix }}</span>\n</div>\n" }]
1206
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i1$1.FocusMonitor }, { type: i0.NgZone }]; }, propDecorators: { placeholder: [{
1207
+ type: Input
1208
+ }], prefix: [{
1209
+ type: Input
1210
+ }], suffix: [{
1211
+ type: Input
1212
+ }], passwordIcons: [{
1213
+ type: Input
1214
+ }], type: [{
1215
+ type: Input
1216
+ }], inputmode: [{
1217
+ type: Input
1218
+ }], disabled: [{
1219
+ type: Input
1220
+ }], readonly: [{
1221
+ type: Input
1222
+ }], required: [{
1223
+ type: Input
1224
+ }], autofocus: [{
1225
+ type: Input
1226
+ }], autocomplete: [{
1227
+ type: Input
1228
+ }], value: [{
1229
+ type: Input
1230
+ }], inputElement: [{
1231
+ type: ViewChild,
1232
+ args: ['inputElement', { static: true }]
1233
+ }], elClasses: [{
1165
1234
  type: HostBinding,
1166
1235
  args: ['class']
1167
1236
  }] } });
1168
1237
 
1169
- class WrPasswordInputModule {
1238
+ class WrInputModule {
1170
1239
  }
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: [{
1240
+ WrInputModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrInputModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1241
+ WrInputModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.8", ngImport: i0, type: WrInputModule, declarations: [WrInputComponent], imports: [CommonModule, FormsModule, WrIconModule], exports: [WrInputComponent] });
1242
+ WrInputModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrInputModule, imports: [CommonModule, FormsModule, WrIconModule] });
1243
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrInputModule, decorators: [{
1175
1244
  type: NgModule,
1176
1245
  args: [{
1177
- imports: [CommonModule, PlatformModule, WrInputModule, WrIconModule],
1178
- declarations: [WrPasswordInputComponent],
1179
- exports: [WrPasswordInputComponent]
1246
+ imports: [CommonModule, FormsModule, WrIconModule],
1247
+ declarations: [WrInputComponent],
1248
+ exports: [WrInputComponent]
1180
1249
  }]
1181
1250
  }] });
1182
1251
 
1183
1252
  class WrSkeletonComponent {
1184
- constructor(elRef) {
1185
- this.elRef = elRef;
1253
+ constructor() {
1186
1254
  this.color = 'dark';
1187
- this.class = `${stylePrefix}-skeleton`;
1255
+ this.animated = true;
1188
1256
  }
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);
1257
+ get elClasses() {
1258
+ return {
1259
+ 'wr-skeleton': true,
1260
+ 'wr-skeleton--animated': this.animated,
1261
+ 'wr-skeleton--primary': this.color === 'primary',
1262
+ 'wr-skeleton--secondary': this.color === 'secondary',
1263
+ 'wr-skeleton--success': this.color === 'success',
1264
+ 'wr-skeleton--warning': this.color === 'warning',
1265
+ 'wr-skeleton--danger': this.color === 'danger',
1266
+ 'wr-skeleton--light': this.color === 'light',
1267
+ 'wr-skeleton--medium': this.color === 'medium',
1268
+ 'wr-skeleton--dark': this.color === 'dark'
1269
+ };
1192
1270
  }
1193
1271
  }
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 });
1272
+ WrSkeletonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrSkeletonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1273
+ 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 });
1274
+ __decorate([
1275
+ InputBoolean()
1276
+ ], WrSkeletonComponent.prototype, "animated", void 0);
1196
1277
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrSkeletonComponent, decorators: [{
1197
1278
  type: Component,
1198
1279
  args: [{
1199
1280
  selector: 'wr-skeleton',
1200
- template: '<span>&nbsp;</span>',
1281
+ exportAs: 'wrSkeleton',
1282
+ template: '',
1201
1283
  changeDetection: ChangeDetectionStrategy.OnPush,
1202
1284
  encapsulation: ViewEncapsulation.None
1203
1285
  }]
1204
- }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { color: [{
1286
+ }], propDecorators: { color: [{
1205
1287
  type: Input
1206
- }], class: [{
1288
+ }], animated: [{
1289
+ type: Input
1290
+ }], elClasses: [{
1207
1291
  type: HostBinding,
1208
1292
  args: ['class']
1209
1293
  }] } });
@@ -1211,112 +1295,109 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImpor
1211
1295
  class WrSkeletonModule {
1212
1296
  }
1213
1297
  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] });
1298
+ WrSkeletonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.8", ngImport: i0, type: WrSkeletonModule, declarations: [WrSkeletonComponent], imports: [CommonModule], exports: [WrSkeletonComponent] });
1299
+ WrSkeletonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrSkeletonModule, imports: [CommonModule] });
1216
1300
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrSkeletonModule, decorators: [{
1217
1301
  type: NgModule,
1218
1302
  args: [{
1219
- imports: [CommonModule, WrSpinnerModule],
1303
+ imports: [CommonModule],
1220
1304
  declarations: [WrSkeletonComponent],
1221
1305
  exports: [WrSkeletonComponent]
1222
1306
  }]
1223
1307
  }] });
1224
1308
 
1225
1309
  class WrTagComponent {
1226
- constructor(cdr, elRef, r2) {
1227
- this.cdr = cdr;
1228
- this.elRef = elRef;
1229
- this.r2 = r2;
1310
+ constructor() {
1230
1311
  this.color = 'primary';
1231
- this.transparent = false;
1232
- this.loading = false;
1312
+ this.icon = null;
1313
+ this.iconPosition = 'start';
1233
1314
  this.outlined = false;
1234
1315
  this.rounded = false;
1316
+ this.transparent = false;
1235
1317
  this.hoverable = false;
1236
- this.baseClass = `${stylePrefix}-tag`;
1318
+ this.loading = false;
1237
1319
  }
1238
- ngOnInit() {
1239
- this.setClasses();
1240
- }
1241
- ngOnChanges(changes) {
1242
- this.setClasses();
1243
- this.cdr.detectChanges();
1244
- }
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
- }
1320
+ get elClasses() {
1321
+ return {
1322
+ 'wr-tag': true,
1323
+ 'wr-tag--primary': this.color === 'primary',
1324
+ 'wr-tag--secondary': this.color === 'secondary',
1325
+ 'wr-tag--success': this.color === 'success',
1326
+ 'wr-tag--warning': this.color === 'warning',
1327
+ 'wr-tag--danger': this.color === 'danger',
1328
+ 'wr-tag--light': this.color === 'light',
1329
+ 'wr-tag--medium': this.color === 'medium',
1330
+ 'wr-tag--dark': this.color === 'dark',
1331
+ 'wr-tag--icon-start': (this.icon || this.loading) && this.iconPosition === 'start',
1332
+ 'wr-tag--icon-end': (this.icon || this.loading) && this.iconPosition === 'end',
1333
+ 'wr-tag--loading': this.loading,
1334
+ 'wr-tag--rounded': this.rounded,
1335
+ 'wr-tag--outlined': this.outlined,
1336
+ 'wr-tag--transparent': this.transparent,
1337
+ 'wr-tag--hoverable': this.hoverable
1338
+ };
1262
1339
  }
1263
1340
  }
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 });
1341
+ WrTagComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrTagComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1342
+ 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
1343
  __decorate([
1267
1344
  InputBoolean()
1268
- ], WrTagComponent.prototype, "transparent", void 0);
1345
+ ], WrTagComponent.prototype, "outlined", void 0);
1269
1346
  __decorate([
1270
1347
  InputBoolean()
1271
- ], WrTagComponent.prototype, "loading", void 0);
1348
+ ], WrTagComponent.prototype, "rounded", void 0);
1272
1349
  __decorate([
1273
1350
  InputBoolean()
1274
- ], WrTagComponent.prototype, "outlined", void 0);
1351
+ ], WrTagComponent.prototype, "transparent", void 0);
1275
1352
  __decorate([
1276
1353
  InputBoolean()
1277
- ], WrTagComponent.prototype, "rounded", void 0);
1354
+ ], WrTagComponent.prototype, "hoverable", void 0);
1278
1355
  __decorate([
1279
1356
  InputBoolean()
1280
- ], WrTagComponent.prototype, "hoverable", void 0);
1357
+ ], WrTagComponent.prototype, "loading", void 0);
1281
1358
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrTagComponent, decorators: [{
1282
1359
  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: [{
1360
+ 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" }]
1361
+ }], propDecorators: { color: [{
1290
1362
  type: Input
1291
- }], transparent: [{
1363
+ }], icon: [{
1292
1364
  type: Input
1293
- }], loading: [{
1365
+ }], iconPosition: [{
1294
1366
  type: Input
1295
1367
  }], outlined: [{
1296
1368
  type: Input
1297
1369
  }], rounded: [{
1298
1370
  type: Input
1371
+ }], transparent: [{
1372
+ type: Input
1299
1373
  }], hoverable: [{
1300
1374
  type: Input
1375
+ }], loading: [{
1376
+ type: Input
1377
+ }], elClasses: [{
1378
+ type: HostBinding,
1379
+ args: ['class']
1301
1380
  }] } });
1302
1381
 
1303
1382
  class WrTagModule {
1304
1383
  }
1305
1384
  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] });
1385
+ WrTagModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.8", ngImport: i0, type: WrTagModule, declarations: [WrTagComponent], imports: [CommonModule, WrIconModule, WrSpinnerModule], exports: [WrTagComponent] });
1386
+ WrTagModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrTagModule, imports: [CommonModule, WrIconModule, WrSpinnerModule] });
1308
1387
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WrTagModule, decorators: [{
1309
1388
  type: NgModule,
1310
1389
  args: [{
1311
- imports: [CommonModule, WrSpinnerModule],
1390
+ imports: [CommonModule, WrIconModule, WrSpinnerModule],
1312
1391
  declarations: [WrTagComponent],
1313
1392
  exports: [WrTagComponent]
1314
1393
  }]
1315
1394
  }] });
1316
1395
 
1396
+ // Components
1397
+
1317
1398
  /**
1318
1399
  * Generated bundle index. Do not edit.
1319
1400
  */
1320
1401
 
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 };
1402
+ export { WrButtonComponent, WrButtonModule, WrCheckboxComponent, WrCheckboxModule, WrDividerComponent, WrDividerModule, WrFormErrorComponent, WrFormItemComponent, WrFormModule, WrIconComponent, WrIconModule, WrIconService, WrInputComponent, WrInputModule, WrSkeletonComponent, WrSkeletonModule, WrSpinnerComponent, WrSpinnerModule, WrTagComponent, WrTagModule, wrIconSet };
1322
1403
  //# sourceMappingURL=ngwr.mjs.map