@ferhaps/easy-ui-lib 0.0.7 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -22
- package/ng-package.json +7 -0
- package/package.json +26 -44
- package/src/lib/components/default-dialog/default-dialog.component.html +19 -0
- package/src/lib/components/default-dialog/default-dialog.component.scss +41 -0
- package/src/lib/components/default-dialog/default-dialog.component.ts +23 -0
- package/src/lib/components/error-dispaly.component.ts +48 -0
- package/src/lib/components/error-handler/error-handler.component.html +0 -0
- package/src/lib/components/error-handler/error-handler.component.scss +0 -0
- package/src/lib/components/error-handler/error-handler.component.ts +44 -0
- package/src/lib/components/error-handler/error-popup/error-popup.component.html +13 -0
- package/src/lib/components/error-handler/error-popup/error-popup.component.scss +19 -0
- package/src/lib/components/error-handler/error-popup/error-popup.component.ts +21 -0
- package/src/lib/components/global-loader/global-loader.component.html +5 -0
- package/src/lib/components/global-loader/global-loader.component.scss +12 -0
- package/src/lib/components/global-loader/global-loader.component.ts +17 -0
- package/src/lib/components/search-bar.component.ts +70 -0
- package/src/lib/components/table/table.component.html +121 -0
- package/src/lib/components/table/table.component.scss +116 -0
- package/src/lib/components/table/table.component.ts +105 -0
- package/src/lib/components/table-sort-header/table-sort-header.component.html +7 -0
- package/src/lib/components/table-sort-header/table-sort-header.component.scss +17 -0
- package/src/lib/components/table-sort-header/table-sort-header.component.ts +31 -0
- package/src/lib/directives/fields-match-validator.directive.ts +35 -0
- package/src/lib/directives/password-validator.directive.ts +26 -0
- package/src/lib/directives/phone-validation.directive.ts +24 -0
- package/src/lib/pipes/blank-filler.pipe.ts +13 -0
- package/src/lib/pipes/snake-case-parser.pipe.ts +17 -0
- package/src/lib/services/error.service.ts +15 -0
- package/src/lib/services/loader.service.ts +14 -0
- package/src/lib/utils/animations.ts +29 -0
- package/{lib/utils/types.d.ts → src/lib/utils/types.ts} +3 -2
- package/src/lib/utils/utils.ts +65 -0
- package/{public-api.d.ts → src/public-api.ts} +20 -17
- package/tsconfig.lib.json +14 -0
- package/tsconfig.lib.prod.json +10 -0
- package/tsconfig.spec.json +14 -0
- package/fesm2022/ferhaps-easy-ui-lib.mjs +0 -862
- package/fesm2022/ferhaps-easy-ui-lib.mjs.map +0 -1
- package/index.d.ts +0 -5
- package/lib/components/chip/chip.component.d.ts +0 -16
- package/lib/components/default-dialog/default-dialog.component.d.ts +0 -19
- package/lib/components/error-dispaly.component.d.ts +0 -17
- package/lib/components/error-handler/error-handler.component.d.ts +0 -18
- package/lib/components/error-handler/error-popup/error-popup.component.d.ts +0 -17
- package/lib/components/global-loader/global-loader.component.d.ts +0 -14
- package/lib/components/search-bar.component.d.ts +0 -18
- package/lib/components/table/table.component.d.ts +0 -58
- package/lib/components/table-sort-header/table-sort-header.component.d.ts +0 -17
- package/lib/directives/fields-match-validator.directive.d.ts +0 -16
- package/lib/directives/password-validator.directive.d.ts +0 -13
- package/lib/directives/phone-validation.directive.d.ts +0 -13
- package/lib/pipes/blank-filler.pipe.d.ts +0 -13
- package/lib/pipes/snake-case-parser.pipe.d.ts +0 -13
- package/lib/services/error.service.d.ts +0 -9
- package/lib/services/loader.service.d.ts +0 -8
- package/lib/utils/animations.d.ts +0 -3
- package/lib/utils/utils.d.ts +0 -1
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
.scroll {
|
|
2
|
+
overflow-y: auto;
|
|
3
|
+
max-height: 94%;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
table {
|
|
7
|
+
width: 100%;
|
|
8
|
+
border-collapse: collapse;
|
|
9
|
+
border-spacing: 0px;
|
|
10
|
+
|
|
11
|
+
&.with-options {
|
|
12
|
+
td {
|
|
13
|
+
padding-block: 3px !important;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.flexer {
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.action {
|
|
24
|
+
color: #009ddc;
|
|
25
|
+
font-weight: 500;
|
|
26
|
+
text-align: right;
|
|
27
|
+
margin-left: auto;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.pointer {
|
|
31
|
+
cursor: pointer;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.gap05 {
|
|
35
|
+
gap: 0.5rem;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.mb05 {
|
|
39
|
+
margin-bottom: 0.5;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.data {
|
|
43
|
+
white-space: pre-wrap;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.row-heading-labels {
|
|
47
|
+
font-weight: 700;
|
|
48
|
+
font-size: 20px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.selected-row td {
|
|
52
|
+
background-color: #d3edf8;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.hover-row {
|
|
56
|
+
background-color: #ebf7fc;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.red {
|
|
60
|
+
color: #ff0000;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@media (max-width: 1086px) {
|
|
64
|
+
table td, table th {
|
|
65
|
+
padding: 3px !important;
|
|
66
|
+
width: auto !important;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
td, th {
|
|
71
|
+
padding: 0.5rem 1rem;
|
|
72
|
+
font-size: 14px;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
th {
|
|
76
|
+
background-color: #f6f6f6;
|
|
77
|
+
text-align: left;
|
|
78
|
+
position: sticky;
|
|
79
|
+
top: 0;
|
|
80
|
+
z-index: 2;
|
|
81
|
+
border-top: 2px solid #E5E4E7;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
td {
|
|
85
|
+
border-bottom: 2px solid #E5E4E7;
|
|
86
|
+
border-top: 2px solid #E5E4E7;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.dots {
|
|
90
|
+
width: fit-content;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.draggable {
|
|
94
|
+
cursor: grabbing;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.dragCol {
|
|
98
|
+
padding-left: 0 !important;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.cdk-drag-preview {
|
|
102
|
+
box-sizing: border-box;
|
|
103
|
+
border-radius: 4px;
|
|
104
|
+
font-size: 1.5em;
|
|
105
|
+
text-align: center;
|
|
106
|
+
opacity: 0.8;
|
|
107
|
+
box-shadow: 0 5px 5px -3px rgba(0, 0, 0, 0.2),
|
|
108
|
+
0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.dragdrop-placeholder {
|
|
112
|
+
background: #ccc;
|
|
113
|
+
border: dotted 3px #999;
|
|
114
|
+
min-height: 30px;
|
|
115
|
+
transition: transform 100ms cubic-bezier(0, 0, 0.2, 1);
|
|
116
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { Component, ElementRef, input, output, viewChild } from '@angular/core';
|
|
2
|
+
import { MatMenuModule } from '@angular/material/menu';
|
|
3
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
4
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
5
|
+
import { SortState, TableSortHeaderComponent } from '../table-sort-header/table-sort-header.component';
|
|
6
|
+
import { WhiteSpaceFillerPipe } from '../../pipes/blank-filler.pipe';
|
|
7
|
+
import { CdkDragDrop, DragDropModule, moveItemInArray } from "@angular/cdk/drag-drop";
|
|
8
|
+
import { fader } from '../../utils/animations';
|
|
9
|
+
|
|
10
|
+
export type TableEvent = {
|
|
11
|
+
action: string;
|
|
12
|
+
obj?: any;
|
|
13
|
+
prop?: string;
|
|
14
|
+
index?: number;
|
|
15
|
+
selected?: boolean;
|
|
16
|
+
sortState?: SortState;
|
|
17
|
+
event?: Event;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type Config = {
|
|
21
|
+
data: any[];
|
|
22
|
+
title: string;
|
|
23
|
+
dataProps: string[];
|
|
24
|
+
tableHeadings: string[];
|
|
25
|
+
options?: string[];
|
|
26
|
+
withAdd?: boolean;
|
|
27
|
+
selectableRows?: boolean;
|
|
28
|
+
sortable?: boolean;
|
|
29
|
+
draggable?: boolean;
|
|
30
|
+
classRules?: ClassRule[];
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export type ClassRule = {
|
|
34
|
+
className: string;
|
|
35
|
+
condition: (obj: any, prop: string) => boolean;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
@Component({
|
|
39
|
+
selector: 'lib-table',
|
|
40
|
+
templateUrl: 'table.component.html',
|
|
41
|
+
styleUrls: ['table.component.scss'],
|
|
42
|
+
animations: [fader],
|
|
43
|
+
imports: [
|
|
44
|
+
WhiteSpaceFillerPipe,
|
|
45
|
+
MatMenuModule,
|
|
46
|
+
MatIconModule,
|
|
47
|
+
MatButtonModule,
|
|
48
|
+
TableSortHeaderComponent,
|
|
49
|
+
DragDropModule
|
|
50
|
+
]
|
|
51
|
+
})
|
|
52
|
+
export class TableComponent {
|
|
53
|
+
public config = input.required<Config>();
|
|
54
|
+
protected action = output<TableEvent>();
|
|
55
|
+
protected scrollContainer = viewChild.required<ElementRef<HTMLDivElement>>('scrollContainer');
|
|
56
|
+
|
|
57
|
+
protected selectedRowIndex: number = -1;
|
|
58
|
+
protected hoverRowIndex: number = -1;
|
|
59
|
+
protected currentSortColumn: number = -1;
|
|
60
|
+
|
|
61
|
+
protected getClass(obj: any, prop: string): string {
|
|
62
|
+
if (!this.config().classRules) return '';
|
|
63
|
+
|
|
64
|
+
const classes: string[] = [];
|
|
65
|
+
for (let rule of (this.config().classRules as ClassRule[])) {
|
|
66
|
+
if (rule.condition(obj, prop)) {
|
|
67
|
+
classes.push(rule.className);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return classes.join(' ');
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
protected drop(event: CdkDragDrop<any>) {
|
|
75
|
+
if (this.config().draggable) {
|
|
76
|
+
moveItemInArray(this.config().data, event.previousIndex, event.currentIndex);
|
|
77
|
+
this.action.emit({ action: 'drag', obj: this.config().data[event.currentIndex], index: event.currentIndex });
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
protected onScroll() {
|
|
82
|
+
const container = this.scrollContainer().nativeElement;
|
|
83
|
+
// console.log(Math.ceil(container.scrollTop), container.offsetHeight, container.scrollHeight)
|
|
84
|
+
if ((Math.ceil(container.scrollTop) + container.offsetHeight) >= container.scrollHeight) {
|
|
85
|
+
this.action.emit({ action: 'scrolled' });
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
protected onRowClick(event: Event, obj: any, index: number): void {
|
|
90
|
+
this.selectedRowIndex = index === this.selectedRowIndex ? -1 : index;
|
|
91
|
+
this.action.emit({ action: 'rowClick', obj, index, selected: this.selectedRowIndex === index, event });
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
protected selectOption(оption: string, obj: any, index: number): void {
|
|
95
|
+
this.action.emit({ action: оption.toLowerCase(), obj, index, selected: this.selectedRowIndex === index });
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
protected sortByProp(prop: string, sortState: SortState): void {
|
|
99
|
+
this.action.emit({ action: 'sort', prop, sortState });
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
protected trackById(index: number, obj: any): number {
|
|
103
|
+
return obj.id || index;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Component, input, output } from '@angular/core';
|
|
2
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
3
|
+
|
|
4
|
+
export type SortState = 'none' | 'asc' | 'desc';
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'lib-table-sort-header',
|
|
8
|
+
imports: [
|
|
9
|
+
MatIconModule,
|
|
10
|
+
],
|
|
11
|
+
templateUrl: './table-sort-header.component.html',
|
|
12
|
+
styleUrls: ['./table-sort-header.component.scss']
|
|
13
|
+
})
|
|
14
|
+
export class TableSortHeaderComponent {
|
|
15
|
+
public selected = input.required<boolean>();
|
|
16
|
+
public sort = output<SortState>();
|
|
17
|
+
|
|
18
|
+
protected sortState: SortState = 'none';
|
|
19
|
+
|
|
20
|
+
protected onSortClick(): void {
|
|
21
|
+
if (this.sortState === 'none') {
|
|
22
|
+
this.sortState = 'desc';
|
|
23
|
+
} else if (this.sortState === 'desc') {
|
|
24
|
+
this.sortState = 'asc';
|
|
25
|
+
} else {
|
|
26
|
+
this.sortState = 'none';
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
this.sort.emit(this.sortState);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Directive, input } from '@angular/core';
|
|
2
|
+
import { AbstractControl, NG_VALIDATORS, Validator } from '@angular/forms';
|
|
3
|
+
|
|
4
|
+
@Directive({
|
|
5
|
+
selector: '[libFieldsMatchValidator]',
|
|
6
|
+
providers: [
|
|
7
|
+
{
|
|
8
|
+
provide: NG_VALIDATORS,
|
|
9
|
+
useExisting: FieldsMatchValidatorDirective,
|
|
10
|
+
multi: true,
|
|
11
|
+
},
|
|
12
|
+
],
|
|
13
|
+
})
|
|
14
|
+
export class FieldsMatchValidatorDirective implements Validator {
|
|
15
|
+
public fieldToMatch = input.required<string>();
|
|
16
|
+
|
|
17
|
+
public validate(control: AbstractControl): { [key: string]: any } | null {
|
|
18
|
+
const value = control.value;
|
|
19
|
+
|
|
20
|
+
if (!value) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const matchingControl = control.root.get(this.fieldToMatch());
|
|
25
|
+
if (!matchingControl) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (value !== matchingControl.value) {
|
|
30
|
+
return { mismatch: true };
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Directive } from '@angular/core';
|
|
2
|
+
import { AbstractControl, NG_VALIDATORS, ValidationErrors, Validator } from '@angular/forms';
|
|
3
|
+
|
|
4
|
+
@Directive({
|
|
5
|
+
selector: '[libPasswordValidator]',
|
|
6
|
+
providers: [
|
|
7
|
+
{
|
|
8
|
+
provide: NG_VALIDATORS,
|
|
9
|
+
useExisting: PasswordValidatorDirective,
|
|
10
|
+
multi: true
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
})
|
|
14
|
+
export class PasswordValidatorDirective implements Validator {
|
|
15
|
+
public validate(control: AbstractControl): ValidationErrors | null {
|
|
16
|
+
const password = control.value;
|
|
17
|
+
|
|
18
|
+
const pattern = /^(?=.*[A-Z])(?=.*[a-z])(?=.*[!@#\$%\^&\*])(?=.*\d).{8,}$/
|
|
19
|
+
|
|
20
|
+
if (password && !pattern.test(password)) {
|
|
21
|
+
return { passwordInvalid: true };
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Directive, HostListener } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Directive({
|
|
4
|
+
selector: '[libPhoneValidation]',
|
|
5
|
+
})
|
|
6
|
+
export class PhoneValidationDirective {
|
|
7
|
+
@HostListener('input', ['$event']) public onInput(event: InputEvent) {
|
|
8
|
+
const input = event.target as HTMLInputElement;
|
|
9
|
+
if (!input.value.includes('+')) {
|
|
10
|
+
input.value = `+${input.value}`;
|
|
11
|
+
}
|
|
12
|
+
const regex = /^[0-9+]*$/;
|
|
13
|
+
if (!regex.test(input.value)) {
|
|
14
|
+
input.value = input.value.replace(/[^0-9+]/g, '');
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@HostListener('keydown', ['$event']) public onKeyDown(event: KeyboardEvent): void {
|
|
19
|
+
const inputValue = (event.target as HTMLInputElement).value;
|
|
20
|
+
if (event.key === 'Backspace' && inputValue === '+') {
|
|
21
|
+
event.preventDefault();
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Pipe, PipeTransform } from "@angular/core";
|
|
2
|
+
|
|
3
|
+
@Pipe({
|
|
4
|
+
name: 'blankFiller',
|
|
5
|
+
})
|
|
6
|
+
export class WhiteSpaceFillerPipe implements PipeTransform {
|
|
7
|
+
public transform(value: any, fillWith: string = '-'): string {
|
|
8
|
+
if (value === 0) {
|
|
9
|
+
return '0';
|
|
10
|
+
}
|
|
11
|
+
return value ? value : fillWith;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Pipe, PipeTransform } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Pipe({
|
|
4
|
+
name: 'snakeCaseParser',
|
|
5
|
+
})
|
|
6
|
+
export class SnakeCaseParserPipe implements PipeTransform {
|
|
7
|
+
public transform(str: string | undefined): string {
|
|
8
|
+
if (str) {
|
|
9
|
+
let temp = str.split('_').map(word => {
|
|
10
|
+
return word.toLowerCase();
|
|
11
|
+
}).join(' ');
|
|
12
|
+
return temp.charAt(0).toUpperCase() + temp.slice(1);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return '';
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { HttpErrorResponse } from "@angular/common/http";
|
|
2
|
+
import { Injectable } from "@angular/core";
|
|
3
|
+
import { Subject } from "rxjs";
|
|
4
|
+
|
|
5
|
+
@Injectable({
|
|
6
|
+
providedIn: 'root'
|
|
7
|
+
})
|
|
8
|
+
export class ErrorService {
|
|
9
|
+
private errorSubject = new Subject<HttpErrorResponse>();
|
|
10
|
+
public error$ = this.errorSubject.asObservable();
|
|
11
|
+
|
|
12
|
+
public sendError(error: HttpErrorResponse) {
|
|
13
|
+
this.errorSubject.next(error);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import { BehaviorSubject } from 'rxjs';
|
|
3
|
+
|
|
4
|
+
@Injectable({
|
|
5
|
+
providedIn: 'root'
|
|
6
|
+
})
|
|
7
|
+
export class LoaderService {
|
|
8
|
+
private loadingSubject = new BehaviorSubject<boolean>(false);
|
|
9
|
+
public loading$ = this.loadingSubject.asObservable();
|
|
10
|
+
|
|
11
|
+
public setLoading(loadingState: boolean) {
|
|
12
|
+
this.loadingSubject.next(loadingState);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { animate, state, style, transition, trigger } from "@angular/animations";
|
|
2
|
+
|
|
3
|
+
export const fader = trigger('fadeInOut', [
|
|
4
|
+
transition(':enter', [
|
|
5
|
+
style({ opacity: 0 }),
|
|
6
|
+
animate('200ms', style({ opacity: 1 })),
|
|
7
|
+
]),
|
|
8
|
+
transition(':leave', [
|
|
9
|
+
animate('200ms', style({ opacity: 0 })),
|
|
10
|
+
]),
|
|
11
|
+
]);
|
|
12
|
+
|
|
13
|
+
export const openDropdown = trigger('open-close-dropdown', [
|
|
14
|
+
transition(':enter', [
|
|
15
|
+
style({ height: 0, overflow: 'hidden' }),
|
|
16
|
+
animate('200ms ease', style({ height: '*' }))
|
|
17
|
+
]),
|
|
18
|
+
transition(':leave', [
|
|
19
|
+
style({ height: '*', overflow: 'hidden' }),
|
|
20
|
+
animate('200ms ease', style({ height: 0 }))
|
|
21
|
+
])
|
|
22
|
+
]);
|
|
23
|
+
|
|
24
|
+
export const textFader = trigger('textFader', [
|
|
25
|
+
state('void', style({ opacity: 0 })),
|
|
26
|
+
state('*', style({ opacity: 1 })),
|
|
27
|
+
transition('void => *', [animate('0.3s 0.3s ease-in')]),
|
|
28
|
+
transition('* => void', [animate('0.3s ease-in')])
|
|
29
|
+
]);
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import { HttpErrorResponse } from "@angular/common/http";
|
|
2
|
-
|
|
1
|
+
import { HttpErrorResponse } from "@angular/common/http";
|
|
2
|
+
|
|
3
|
+
export type SystemError = HttpErrorResponse | string | undefined;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export const HTTP_STATUS_CODES: any = {
|
|
2
|
+
100: 'Continue',
|
|
3
|
+
101: 'Switching Protocols',
|
|
4
|
+
102: 'Processing',
|
|
5
|
+
103: 'Early Hints',
|
|
6
|
+
200: 'OK',
|
|
7
|
+
201: 'Created',
|
|
8
|
+
202: 'Accepted',
|
|
9
|
+
203: 'Non-Authoritative Information',
|
|
10
|
+
204: 'No Content',
|
|
11
|
+
205: 'Reset Content',
|
|
12
|
+
206: 'Partial Content',
|
|
13
|
+
207: 'Multi-Status',
|
|
14
|
+
208: 'Already Reported',
|
|
15
|
+
226: 'IM Used',
|
|
16
|
+
300: 'Multiple Choices',
|
|
17
|
+
301: 'Moved Permanently',
|
|
18
|
+
302: 'Found',
|
|
19
|
+
303: 'See Other',
|
|
20
|
+
304: 'Not Modified',
|
|
21
|
+
305: 'Use Proxy',
|
|
22
|
+
306: '(Unused)',
|
|
23
|
+
307: 'Temporary Redirect',
|
|
24
|
+
308: 'Permanent Redirect',
|
|
25
|
+
400: 'Bad Request',
|
|
26
|
+
401: 'Unauthorized',
|
|
27
|
+
402: 'Payment Required',
|
|
28
|
+
403: 'Forbidden',
|
|
29
|
+
404: 'Not Found',
|
|
30
|
+
405: 'Method Not Allowed',
|
|
31
|
+
406: 'Not Acceptable',
|
|
32
|
+
407: 'Proxy Authentication Required',
|
|
33
|
+
408: 'Request Timeout',
|
|
34
|
+
409: 'Conflict',
|
|
35
|
+
410: 'Gone',
|
|
36
|
+
411: 'Length Required',
|
|
37
|
+
412: 'Precondition Failed',
|
|
38
|
+
413: 'Payload Too Large',
|
|
39
|
+
414: 'URI Too Long',
|
|
40
|
+
415: 'Unsupported Media Type',
|
|
41
|
+
416: 'Range Not Satisfiable',
|
|
42
|
+
417: 'Expectation Failed',
|
|
43
|
+
418: "I'm a teapot",
|
|
44
|
+
421: 'Misdirected Request',
|
|
45
|
+
422: 'Unprocessable Entity',
|
|
46
|
+
423: 'Locked',
|
|
47
|
+
424: 'Failed Dependency',
|
|
48
|
+
425: 'Too Early',
|
|
49
|
+
426: 'Upgrade Required',
|
|
50
|
+
428: 'Precondition Required',
|
|
51
|
+
429: 'Too Many Requests',
|
|
52
|
+
431: 'Request Header Fields Too Large',
|
|
53
|
+
451: 'Unavailable For Legal Reasons',
|
|
54
|
+
500: 'Internal Server Error',
|
|
55
|
+
501: 'Not Implemented',
|
|
56
|
+
502: 'Bad Gateway',
|
|
57
|
+
503: 'Service Unavailable',
|
|
58
|
+
504: 'Gateway Timeout',
|
|
59
|
+
505: 'HTTP Version Not Supported',
|
|
60
|
+
506: 'Variant Also Negotiates',
|
|
61
|
+
507: 'Insufficient Storage',
|
|
62
|
+
508: 'Loop Detected',
|
|
63
|
+
510: 'Not Extended',
|
|
64
|
+
511: 'Network Authentication Required'
|
|
65
|
+
};
|
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export * from './lib/
|
|
6
|
-
export * from './lib/
|
|
7
|
-
export * from './lib/
|
|
8
|
-
export * from './lib/
|
|
9
|
-
export * from './lib/
|
|
10
|
-
export * from './lib/
|
|
11
|
-
export * from './lib/components/
|
|
12
|
-
export * from './lib/components/
|
|
13
|
-
export * from './lib/
|
|
14
|
-
export * from './lib/
|
|
15
|
-
export * from './lib/
|
|
16
|
-
export * from './lib/components/
|
|
17
|
-
export * from './lib/components/
|
|
1
|
+
/*
|
|
2
|
+
* Public API Surface of ui-lib
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export * from './lib/pipes/blank-filler.pipe';
|
|
6
|
+
export * from './lib/pipes/snake-case-parser.pipe';
|
|
7
|
+
export * from './lib/directives/fields-match-validator.directive';
|
|
8
|
+
export * from './lib/directives/phone-validation.directive';
|
|
9
|
+
export * from './lib/directives/password-validator.directive';
|
|
10
|
+
export * from './lib/components/default-dialog/default-dialog.component';
|
|
11
|
+
export * from './lib/components/error-dispaly.component';
|
|
12
|
+
export * from './lib/components/search-bar.component';
|
|
13
|
+
export * from './lib/utils/types';
|
|
14
|
+
export * from './lib/utils/animations';
|
|
15
|
+
export * from './lib/components/table-sort-header/table-sort-header.component';
|
|
16
|
+
export * from './lib/components/table/table.component';
|
|
17
|
+
export * from './lib/components/global-loader/global-loader.component';
|
|
18
|
+
export * from './lib/services/loader.service';
|
|
19
|
+
export * from './lib/services/error.service';
|
|
20
|
+
export * from './lib/components/error-handler/error-handler.component';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
|
2
|
+
{
|
|
3
|
+
"extends": "../../tsconfig.json",
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"outDir": "../../out-tsc/lib",
|
|
6
|
+
"declaration": true,
|
|
7
|
+
"declarationMap": true,
|
|
8
|
+
"inlineSources": true,
|
|
9
|
+
"types": []
|
|
10
|
+
},
|
|
11
|
+
"exclude": [
|
|
12
|
+
"**/*.spec.ts"
|
|
13
|
+
]
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
|
2
|
+
{
|
|
3
|
+
"extends": "../../tsconfig.json",
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"outDir": "../../out-tsc/spec",
|
|
6
|
+
"types": [
|
|
7
|
+
"jasmine"
|
|
8
|
+
]
|
|
9
|
+
},
|
|
10
|
+
"include": [
|
|
11
|
+
"**/*.spec.ts",
|
|
12
|
+
"**/*.d.ts"
|
|
13
|
+
]
|
|
14
|
+
}
|