@falcon-ng/tailwind 0.0.2

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 (123) hide show
  1. package/README.md +71 -0
  2. package/ng-package.json +7 -0
  3. package/package.json +11 -0
  4. package/src/lib/base-control.ts +142 -0
  5. package/src/lib/base-form-component.ts +363 -0
  6. package/src/lib/component/auto-complete/auto-complete.component.html +39 -0
  7. package/src/lib/component/auto-complete/auto-complete.component.scss +0 -0
  8. package/src/lib/component/auto-complete/auto-complete.component.spec.ts +23 -0
  9. package/src/lib/component/auto-complete/auto-complete.component.ts +31 -0
  10. package/src/lib/component/bottom-sheet/bottom-sheet.component.html +9 -0
  11. package/src/lib/component/bottom-sheet/bottom-sheet.component.scss +0 -0
  12. package/src/lib/component/bottom-sheet/bottom-sheet.component.spec.ts +23 -0
  13. package/src/lib/component/bottom-sheet/bottom-sheet.component.ts +19 -0
  14. package/src/lib/component/button/button.component.css +0 -0
  15. package/src/lib/component/button/button.component.html +54 -0
  16. package/src/lib/component/button/button.component.spec.ts +23 -0
  17. package/src/lib/component/button/button.component.ts +17 -0
  18. package/src/lib/component/button-toggle/button-toggle.component.html +21 -0
  19. package/src/lib/component/button-toggle/button-toggle.component.scss +0 -0
  20. package/src/lib/component/button-toggle/button-toggle.component.spec.ts +23 -0
  21. package/src/lib/component/button-toggle/button-toggle.component.ts +26 -0
  22. package/src/lib/component/checkbox/checkbox.component.html +6 -0
  23. package/src/lib/component/checkbox/checkbox.component.scss +0 -0
  24. package/src/lib/component/checkbox/checkbox.component.spec.ts +23 -0
  25. package/src/lib/component/checkbox/checkbox.component.ts +17 -0
  26. package/src/lib/component/chips/chip.component.html +75 -0
  27. package/src/lib/component/chips/chip.component.scss +3 -0
  28. package/src/lib/component/chips/chip.component.spec.ts +23 -0
  29. package/src/lib/component/chips/chip.component.ts +125 -0
  30. package/src/lib/component/date-picker/date-picker.component.html +18 -0
  31. package/src/lib/component/date-picker/date-picker.component.scss +0 -0
  32. package/src/lib/component/date-picker/date-picker.component.spec.ts +23 -0
  33. package/src/lib/component/date-picker/date-picker.component.ts +13 -0
  34. package/src/lib/component/dialog/dialog.component.html +12 -0
  35. package/src/lib/component/dialog/dialog.component.scss +3 -0
  36. package/src/lib/component/dialog/dialog.component.spec.ts +23 -0
  37. package/src/lib/component/dialog/dialog.component.ts +12 -0
  38. package/src/lib/component/pagination/pagination.component.html +10 -0
  39. package/src/lib/component/pagination/pagination.component.scss +0 -0
  40. package/src/lib/component/pagination/pagination.component.spec.ts +23 -0
  41. package/src/lib/component/pagination/pagination.component.ts +86 -0
  42. package/src/lib/component/progress-bar/progress-bar.component.html +1 -0
  43. package/src/lib/component/progress-bar/progress-bar.component.scss +0 -0
  44. package/src/lib/component/progress-bar/progress-bar.component.spec.ts +23 -0
  45. package/src/lib/component/progress-bar/progress-bar.component.ts +15 -0
  46. package/src/lib/component/progress-spinner/progress-spinner.component.html +7 -0
  47. package/src/lib/component/progress-spinner/progress-spinner.component.scss +0 -0
  48. package/src/lib/component/progress-spinner/progress-spinner.component.spec.ts +23 -0
  49. package/src/lib/component/progress-spinner/progress-spinner.component.ts +16 -0
  50. package/src/lib/component/radio/radio.component.html +13 -0
  51. package/src/lib/component/radio/radio.component.scss +14 -0
  52. package/src/lib/component/radio/radio.component.spec.ts +23 -0
  53. package/src/lib/component/radio/radio.component.ts +29 -0
  54. package/src/lib/component/rich-text-editor/rich-text-editor.component.html +10 -0
  55. package/src/lib/component/rich-text-editor/rich-text-editor.component.scss +0 -0
  56. package/src/lib/component/rich-text-editor/rich-text-editor.component.spec.ts +23 -0
  57. package/src/lib/component/rich-text-editor/rich-text-editor.component.ts +13 -0
  58. package/src/lib/component/select/select.component.html +25 -0
  59. package/src/lib/component/select/select.component.scss +0 -0
  60. package/src/lib/component/select/select.component.spec.ts +23 -0
  61. package/src/lib/component/select/select.component.ts +32 -0
  62. package/src/lib/component/slide-toggle/slide-toggle.component.html +7 -0
  63. package/src/lib/component/slide-toggle/slide-toggle.component.scss +0 -0
  64. package/src/lib/component/slide-toggle/slide-toggle.component.spec.ts +23 -0
  65. package/src/lib/component/slide-toggle/slide-toggle.component.ts +13 -0
  66. package/src/lib/component/slider/slider.component.html +11 -0
  67. package/src/lib/component/slider/slider.component.scss +0 -0
  68. package/src/lib/component/slider/slider.component.spec.ts +23 -0
  69. package/src/lib/component/slider/slider.component.ts +13 -0
  70. package/src/lib/component/snack-bar/snack-bar.component.html +1 -0
  71. package/src/lib/component/snack-bar/snack-bar.component.scss +0 -0
  72. package/src/lib/component/snack-bar/snack-bar.component.spec.ts +23 -0
  73. package/src/lib/component/snack-bar/snack-bar.component.ts +10 -0
  74. package/src/lib/component/table/table.component.html +82 -0
  75. package/src/lib/component/table/table.component.scss +17 -0
  76. package/src/lib/component/table/table.component.spec.ts +23 -0
  77. package/src/lib/component/table/table.component.ts +54 -0
  78. package/src/lib/component/textarea/textarea.component.html +22 -0
  79. package/src/lib/component/textarea/textarea.component.scss +3 -0
  80. package/src/lib/component/textarea/textarea.component.spec.ts +23 -0
  81. package/src/lib/component/textarea/textarea.component.ts +13 -0
  82. package/src/lib/component/textbox/textbox.component.html +27 -0
  83. package/src/lib/component/textbox/textbox.component.scss +3 -0
  84. package/src/lib/component/textbox/textbox.component.spec.ts +23 -0
  85. package/src/lib/component/textbox/textbox.component.ts +13 -0
  86. package/src/lib/control-builder/control-builder.component.html +5 -0
  87. package/src/lib/control-builder/control-builder.component.scss +0 -0
  88. package/src/lib/control-builder/control-builder.component.ts +14 -0
  89. package/src/lib/control-type/AutoComplete.ts +6 -0
  90. package/src/lib/control-type/Button.ts +6 -0
  91. package/src/lib/control-type/ButtonToggle.ts +6 -0
  92. package/src/lib/control-type/CheckBox.ts +6 -0
  93. package/src/lib/control-type/Chip.ts +6 -0
  94. package/src/lib/control-type/DatePicker.ts +6 -0
  95. package/src/lib/control-type/Divider.ts +6 -0
  96. package/src/lib/control-type/Editor.ts +6 -0
  97. package/src/lib/control-type/Radio.ts +6 -0
  98. package/src/lib/control-type/RichTextEditor.ts +6 -0
  99. package/src/lib/control-type/SlideToggle.ts +6 -0
  100. package/src/lib/control-type/Slider.ts +6 -0
  101. package/src/lib/control-type/select.ts +6 -0
  102. package/src/lib/control-type/textarea.ts +6 -0
  103. package/src/lib/control-type/textbox.ts +6 -0
  104. package/src/lib/falcon-core.module.ts +141 -0
  105. package/src/lib/model/constant.ts +32 -0
  106. package/src/lib/model/enum.ts +151 -0
  107. package/src/lib/model/environments.ts +28 -0
  108. package/src/lib/model/interface.ts +310 -0
  109. package/src/lib/model/ivalidator.ts +18 -0
  110. package/src/lib/module/angularmaterial.module.ts +98 -0
  111. package/src/lib/reactive-field.directive.ts +24 -0
  112. package/src/lib/service/appsetting.service.ts +57 -0
  113. package/src/lib/service/http/generic-http-client.ts +205 -0
  114. package/src/lib/service/http/httpInterceptor.ts +36 -0
  115. package/src/lib/service/http/igeneric-http-client.ts +110 -0
  116. package/src/lib/service/logger.service.ts +75 -0
  117. package/src/lib/service/open-id/TokenHelperService.ts +76 -0
  118. package/src/lib/service/open-id/auth-guard.service.ts +25 -0
  119. package/src/lib/service/open-id/auth.service.ts +179 -0
  120. package/src/public-api.ts +35 -0
  121. package/tsconfig.lib.json +15 -0
  122. package/tsconfig.lib.prod.json +10 -0
  123. package/tsconfig.spec.json +14 -0
@@ -0,0 +1,23 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { PaginationComponent } from './pagination.component';
4
+
5
+ describe('PaginationComponent', () => {
6
+ let component: PaginationComponent;
7
+ let fixture: ComponentFixture<PaginationComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ declarations: [ PaginationComponent ]
12
+ })
13
+ .compileComponents();
14
+
15
+ fixture = TestBed.createComponent(PaginationComponent);
16
+ component = fixture.componentInstance;
17
+ fixture.detectChanges();
18
+ });
19
+
20
+ it('should create', () => {
21
+ expect(component).toBeTruthy();
22
+ });
23
+ });
@@ -0,0 +1,86 @@
1
+ import {Component, EventEmitter, Input, Output} from '@angular/core';
2
+
3
+ @Component({
4
+ selector: 'falcon-pagination',
5
+ templateUrl: './pagination.component.html',
6
+ styleUrls: ['./pagination.component.scss']
7
+ })
8
+ export class PaginationComponent {
9
+ @Input() totalPage: number = 10;
10
+ @Input() pageSize: number = 10;
11
+ @Output() paginationEvent = new EventEmitter<number>();
12
+ paginationSize: number[] = new Array(10);
13
+ preDisable: boolean = true;
14
+ nextDisable: boolean = false;
15
+ private start!: number;
16
+ private end!: number;
17
+ currentPage: number = 1;
18
+ firstLoad: boolean = false;
19
+
20
+ constructor() {}
21
+
22
+ ngOnInit(): void {
23
+ this.firstLoad = true;
24
+ this.paginationSize = [
25
+ ...Array.from(
26
+ {
27
+ length:
28
+ this.totalPage < this.pageSize
29
+ ? this.totalPage
30
+ : this.pageSize,
31
+ },
32
+ (_, i) => i + 1,
33
+ ),
34
+ ];
35
+ if (this.paginationSize.length == this.totalPage)
36
+ this.nextDisable = true;
37
+ }
38
+
39
+ receiveBtnChange($event: any) {
40
+ this.firstLoad = false;
41
+ this.currentPage = $event;
42
+ if ($event == this.totalPage) this.nextDisable = true;
43
+ else if ($event == 1) {
44
+ this.nextDisable = false;
45
+ this.preDisable = true;
46
+ } else {
47
+ this.nextDisable = false;
48
+ this.preDisable = false;
49
+ }
50
+
51
+ if ($event === 'previous') {
52
+ this.preDisable = true;
53
+ } else if ($event === 'next') {
54
+ } else {
55
+ if (this.totalPage <= this.pageSize) {
56
+ this.paginationSize = [
57
+ ...Array.from({ length: this.totalPage }, (_, i) => i + 1),
58
+ ];
59
+ } else {
60
+ // start
61
+ if ($event < 6) {
62
+ this.start = 1;
63
+ } else {
64
+ if ($event + 5 < this.totalPage) {
65
+ this.start = $event - 5;
66
+ } else {
67
+ this.start = this.totalPage - this.pageSize;
68
+ }
69
+ }
70
+ //End
71
+ if ($event + 5 < this.totalPage) {
72
+ this.end = this.start + 9;
73
+ } else {
74
+ this.end = this.totalPage;
75
+ }
76
+ this.paginationSize = this.range(this.start, this.end);
77
+ }
78
+ }
79
+ this.paginationEvent.emit($event);
80
+ }
81
+ private range(start: number, end: number) {
82
+ return Array(Math.abs(start - end) + 1)
83
+ .fill(start)
84
+ .map((v, i) => v + i * (start > end ? -1 : 1));
85
+ }
86
+ }
@@ -0,0 +1 @@
1
+ <mat-progress-bar [mode]="mode" [bufferValue]="bufferValue" [color]="color" [value]="value"></mat-progress-bar>
@@ -0,0 +1,23 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { ProgressBarComponent } from './progress-bar.component';
4
+
5
+ describe('ProgressBarComponent', () => {
6
+ let component: ProgressBarComponent;
7
+ let fixture: ComponentFixture<ProgressBarComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ declarations: [ ProgressBarComponent ]
12
+ })
13
+ .compileComponents();
14
+
15
+ fixture = TestBed.createComponent(ProgressBarComponent);
16
+ component = fixture.componentInstance;
17
+ fixture.detectChanges();
18
+ });
19
+
20
+ it('should create', () => {
21
+ expect(component).toBeTruthy();
22
+ });
23
+ });
@@ -0,0 +1,15 @@
1
+ import {Component, Input} from '@angular/core';
2
+ import {ThemePalette} from "@angular/material/core";
3
+ import {ProgressBarMode} from "@angular/material/progress-bar";
4
+
5
+ @Component({
6
+ selector: 'falcon-progress-bar',
7
+ templateUrl: './progress-bar.component.html',
8
+ styleUrls: ['./progress-bar.component.scss']
9
+ })
10
+ export class ProgressBarComponent {
11
+ @Input() bufferValue!: number;
12
+ @Input() color: ThemePalette;
13
+ @Input() mode!: ProgressBarMode;
14
+ @Input() value!: number;
15
+ }
@@ -0,0 +1,7 @@
1
+ <mat-progress-spinner
2
+ [color]="color"
3
+ [mode]="mode"
4
+ [diameter]="diameter"
5
+ [strokeWidth]="strokeWidth"
6
+ [value]="value">
7
+ </mat-progress-spinner>
@@ -0,0 +1,23 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { ProgressSpinnerComponent } from './progress-spinner.component';
4
+
5
+ describe('ProgressSpinnerComponent', () => {
6
+ let component: ProgressSpinnerComponent;
7
+ let fixture: ComponentFixture<ProgressSpinnerComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ declarations: [ ProgressSpinnerComponent ]
12
+ })
13
+ .compileComponents();
14
+
15
+ fixture = TestBed.createComponent(ProgressSpinnerComponent);
16
+ component = fixture.componentInstance;
17
+ fixture.detectChanges();
18
+ });
19
+
20
+ it('should create', () => {
21
+ expect(component).toBeTruthy();
22
+ });
23
+ });
@@ -0,0 +1,16 @@
1
+ import {Component, Input} from '@angular/core';
2
+ import {ThemePalette} from "@angular/material/core";
3
+ import {ProgressSpinnerMode} from "@angular/material/progress-spinner";
4
+
5
+ @Component({
6
+ selector: 'falcon-progress-spinner',
7
+ templateUrl: './progress-spinner.component.html',
8
+ styleUrls: ['./progress-spinner.component.scss']
9
+ })
10
+ export class ProgressSpinnerComponent {
11
+ @Input() diameter: number = 100;
12
+ @Input() color: ThemePalette;
13
+ @Input() mode!: ProgressSpinnerMode;
14
+ @Input() value!: number;
15
+ @Input() strokeWidth: number = 5;
16
+ }
@@ -0,0 +1,13 @@
1
+ <div [ngStyle]="control.style" [ngClass]="control.class"
2
+ [formGroup]="formGroup">
3
+ <label class="radio-label-padding">{{control.label | titlecase}}</label>
4
+ <mat-radio-group [attr.aria-label]="control.label"
5
+ [labelPosition]="control.appearance"
6
+ [formControlName]="control.formControlName != undefined ? control.formControlName : 'default'"
7
+ [ngStyle]="control.style" [ngClass]="control.class"
8
+ (change)="radioGroupChangeEvent($event)">
9
+ <mat-radio-button [ngClass]="control.class"
10
+ *ngFor="let item of control.options" [value]="item.value">{{item.viewValue | titlecase}}
11
+ </mat-radio-button>
12
+ </mat-radio-group>
13
+ </div>
@@ -0,0 +1,14 @@
1
+ .radio-group-column {
2
+ display: flex;
3
+ flex-direction: column;
4
+ margin: 15px 0;
5
+ }
6
+ .radio-group-row {
7
+ display: flex;
8
+ flex-direction: row;
9
+ margin: 15px 0;
10
+ }
11
+
12
+ .radio-button {
13
+ margin: 5px;
14
+ }
@@ -0,0 +1,23 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { RadioComponent } from './radio.component';
4
+
5
+ describe('RadioComponent', () => {
6
+ let component: RadioComponent;
7
+ let fixture: ComponentFixture<RadioComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ declarations: [ RadioComponent ]
12
+ })
13
+ .compileComponents();
14
+
15
+ fixture = TestBed.createComponent(RadioComponent);
16
+ component = fixture.componentInstance;
17
+ fixture.detectChanges();
18
+ });
19
+
20
+ it('should create', () => {
21
+ expect(component).toBeTruthy();
22
+ });
23
+ });
@@ -0,0 +1,29 @@
1
+ import {Component, EventEmitter, Output} from '@angular/core';
2
+ import {FormControl, FormGroup} from '@angular/forms';
3
+ import {MatRadioChange} from "@angular/material/radio";
4
+ import {BaseControl} from "../../base-control";
5
+
6
+ @Component({
7
+ selector: 'falcon-radio',
8
+ templateUrl: './radio.component.html',
9
+ styleUrls: ['./radio.component.scss'],
10
+ })
11
+ export class RadioComponent {
12
+ control!: BaseControl<string>;
13
+ formGroup!: FormGroup;
14
+ @Output() radioGroupChange: EventEmitter<MatRadioChange> =
15
+ new EventEmitter<MatRadioChange>();
16
+
17
+ ngOnInit(): void {
18
+ console.log(this.control.options)
19
+ if (this.formGroup === undefined) {
20
+ this.formGroup = new FormGroup({
21
+ default: new FormControl(),
22
+ });
23
+ }
24
+ }
25
+
26
+ radioGroupChangeEvent($event: any) {
27
+ this.radioGroupChange.emit($event.value);
28
+ }
29
+ }
@@ -0,0 +1,10 @@
1
+ <ng-container [formGroup]="formGroup">
2
+ <mat-label>{{control.label}}</mat-label>
3
+ <angular-editor [formControlName]="control.formControlName" [config]="control.editorProperty">
4
+ </angular-editor>
5
+ <mat-hint>{{control.hint.text}}</mat-hint>
6
+ <ng-container *ngFor="let validation of control.validations;" ngProjectAs="mat-error">
7
+ <mat-error *ngIf="formGroup.get(control.formControlName)?.hasError(validation.name)">{{validation.message}}
8
+ </mat-error>
9
+ </ng-container>
10
+ </ng-container>
@@ -0,0 +1,23 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { RichTextEditorComponent } from './rich-text-editor.component';
4
+
5
+ describe('RichTextEditorComponent', () => {
6
+ let component: RichTextEditorComponent;
7
+ let fixture: ComponentFixture<RichTextEditorComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ declarations: [ RichTextEditorComponent ]
12
+ })
13
+ .compileComponents();
14
+
15
+ fixture = TestBed.createComponent(RichTextEditorComponent);
16
+ component = fixture.componentInstance;
17
+ fixture.detectChanges();
18
+ });
19
+
20
+ it('should create', () => {
21
+ expect(component).toBeTruthy();
22
+ });
23
+ });
@@ -0,0 +1,13 @@
1
+ import {Component, Input} from '@angular/core';
2
+ import {BaseControl} from "../../base-control";
3
+ import {FormGroup} from "@angular/forms";
4
+
5
+ @Component({
6
+ selector: 'lib-rich-text-editor',
7
+ templateUrl: './rich-text-editor.component.html',
8
+ styleUrls: ['./rich-text-editor.component.scss']
9
+ })
10
+ export class RichTextEditorComponent {
11
+ control!: BaseControl<string>;
12
+ formGroup!: FormGroup;
13
+ }
@@ -0,0 +1,25 @@
1
+ <mat-form-field [appearance]="control.appearance" [formGroup]="formGroup" [floatLabel]="control.floatLabel"
2
+ [ngStyle]="control.style" [ngClass]="control.class">
3
+ <mat-label>{{control.label}}</mat-label>
4
+ <mat-select [multiple]="control.selectProperty.multiple" (selectionChange)="selectChange($event)"
5
+ [formControlName]="control.formControlName != undefined ? control.formControlName : 'default'"
6
+ [placeholder]="control.placeHolder" [ngStyle]="control.style" [ngClass]="control.class" [(value)]="control.value">
7
+ <mat-option *ngFor="let item of control.options" [value]="item.key" [disabled]="item.disabled">
8
+ {{item.value}}
9
+ </mat-option>
10
+ </mat-select>
11
+ <mat-hint *ngIf="control.hint?.show">
12
+ <ng-container *ngIf="control.hint?.link?.isLink; else elseBlock">
13
+ <ng-container *ngIf="control.hint?.link?.queryParams !== undefined; else withoutQueryBlock">
14
+ <a [routerLink]="[control.hint.link?.routerLink]" [queryParams]="{ query: control.hint.link?.queryParams }"
15
+ routerLinkActive="router-link-active">{{control.hint.text}}</a>
16
+ </ng-container>
17
+ </ng-container>
18
+ <ng-template #elseBlock>
19
+ <span>{{control.hint.text}}</span>
20
+ </ng-template>
21
+ <ng-template #withoutQueryBlock>
22
+ <a [routerLink]="[control.hint.link?.routerLink]" routerLinkActive="router-link-active">{{control.hint.text}}</a>
23
+ </ng-template>
24
+ </mat-hint>
25
+ </mat-form-field>
File without changes
@@ -0,0 +1,23 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { SelectComponent } from './select.component';
4
+
5
+ describe('SelectComponent', () => {
6
+ let component: SelectComponent;
7
+ let fixture: ComponentFixture<SelectComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ declarations: [ SelectComponent ]
12
+ })
13
+ .compileComponents();
14
+
15
+ fixture = TestBed.createComponent(SelectComponent);
16
+ component = fixture.componentInstance;
17
+ fixture.detectChanges();
18
+ });
19
+
20
+ it('should create', () => {
21
+ expect(component).toBeTruthy();
22
+ });
23
+ });
@@ -0,0 +1,32 @@
1
+ import { Component, EventEmitter, OnInit, Output } from '@angular/core';
2
+ import { BaseControl } from '../../base-control';
3
+ import { FormControl, FormGroup } from '@angular/forms';
4
+ import { MatSelectChange } from '@angular/material/select';
5
+
6
+ @Component({
7
+ selector: 'falcon-select',
8
+ templateUrl: './select.component.html',
9
+ styleUrls: ['./select.component.scss'],
10
+ })
11
+ export class SelectComponent implements OnInit {
12
+ control!: BaseControl<string>;
13
+ formGroup!: FormGroup;
14
+ @Output() selectionChange: EventEmitter<MatSelectChange> =
15
+ new EventEmitter<MatSelectChange>();
16
+
17
+ constructor() {}
18
+
19
+ ngOnInit(): void {
20
+ if (this.formGroup === undefined) {
21
+ this.formGroup = new FormGroup({
22
+ default: new FormControl(),
23
+ });
24
+ }
25
+ }
26
+
27
+ selectChange($event: any) {
28
+ this.selectionChange.emit($event.value);
29
+ if (this.control.event !== undefined)
30
+ this.control.event.change?.emit($event);
31
+ }
32
+ }
@@ -0,0 +1,7 @@
1
+ <div [formGroup]="formGroup">
2
+ <mat-slide-toggle [labelPosition]="control.appearance"
3
+ [ngStyle]="control.style" [ngClass]="control.class"
4
+ [formControlName]="control.formControlName" [color]="control.color">
5
+ {{control.label}}
6
+ </mat-slide-toggle>
7
+ </div>
@@ -0,0 +1,23 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { SlideToggleComponent } from './slide-toggle.component';
4
+
5
+ describe('SlideToggleComponent', () => {
6
+ let component: SlideToggleComponent;
7
+ let fixture: ComponentFixture<SlideToggleComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ declarations: [ SlideToggleComponent ]
12
+ })
13
+ .compileComponents();
14
+
15
+ fixture = TestBed.createComponent(SlideToggleComponent);
16
+ component = fixture.componentInstance;
17
+ fixture.detectChanges();
18
+ });
19
+
20
+ it('should create', () => {
21
+ expect(component).toBeTruthy();
22
+ });
23
+ });
@@ -0,0 +1,13 @@
1
+ import { Component } from '@angular/core';
2
+ import {BaseControl} from "../../base-control";
3
+ import {FormGroup} from "@angular/forms";
4
+
5
+ @Component({
6
+ selector: 'falcon-slide-toggle',
7
+ templateUrl: './slide-toggle.component.html',
8
+ styleUrls: ['./slide-toggle.component.scss'],
9
+ })
10
+ export class SlideToggleComponent {
11
+ control!: BaseControl<string>;
12
+ formGroup!: FormGroup;
13
+ }
@@ -0,0 +1,11 @@
1
+ <div [ngStyle]="control.style" [ngClass]="control.class" [formGroup]="formGroup">
2
+ <mat-label>{{control.label}}</mat-label>&nbsp;&nbsp;&nbsp;
3
+ <mat-slider
4
+ [ngStyle]="control.style" [ngClass]="control.class"
5
+ [color]="control.color"
6
+ [max]="control.sliderProperty.max"
7
+ [min]="control.sliderProperty.min"
8
+ [step]="control.sliderProperty.step">
9
+ <input matSliderThumb [formControlName]="control.formControlName">
10
+ </mat-slider>
11
+ </div>
File without changes
@@ -0,0 +1,23 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { SliderComponent } from './slider.component';
4
+
5
+ describe('SliderComponent', () => {
6
+ let component: SliderComponent;
7
+ let fixture: ComponentFixture<SliderComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ declarations: [ SliderComponent ]
12
+ })
13
+ .compileComponents();
14
+
15
+ fixture = TestBed.createComponent(SliderComponent);
16
+ component = fixture.componentInstance;
17
+ fixture.detectChanges();
18
+ });
19
+
20
+ it('should create', () => {
21
+ expect(component).toBeTruthy();
22
+ });
23
+ });
@@ -0,0 +1,13 @@
1
+ import { Component } from '@angular/core';
2
+ import {BaseControl} from "../../base-control";
3
+ import {FormGroup} from "@angular/forms";
4
+
5
+ @Component({
6
+ selector: 'falcon-slider',
7
+ templateUrl: './slider.component.html',
8
+ styleUrls: ['./slider.component.scss'],
9
+ })
10
+ export class SliderComponent {
11
+ control!: BaseControl<string>;
12
+ formGroup!: FormGroup;
13
+ }
@@ -0,0 +1 @@
1
+ <span>Pizza party!!! 🍕</span>
@@ -0,0 +1,23 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { SnackBarComponent } from './snack-bar.component';
4
+
5
+ describe('SnackBarComponent', () => {
6
+ let component: SnackBarComponent;
7
+ let fixture: ComponentFixture<SnackBarComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ declarations: [ SnackBarComponent ]
12
+ })
13
+ .compileComponents();
14
+
15
+ fixture = TestBed.createComponent(SnackBarComponent);
16
+ component = fixture.componentInstance;
17
+ fixture.detectChanges();
18
+ });
19
+
20
+ it('should create', () => {
21
+ expect(component).toBeTruthy();
22
+ });
23
+ });
@@ -0,0 +1,10 @@
1
+ import { Component } from '@angular/core';
2
+
3
+ @Component({
4
+ selector: 'lib-snack-bar',
5
+ templateUrl: './snack-bar.component.html',
6
+ styleUrls: ['./snack-bar.component.scss']
7
+ })
8
+ export class SnackBarComponent {
9
+
10
+ }