ecabs-components 0.0.59 → 0.0.61
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/assets/images/nothing-here.svg +22 -0
- package/esm2020/lib/base/directives/digits-only.directive.mjs +2 -2
- package/esm2020/lib/ecabs-checkbox-toggle/ecabs-checkbox-toggle.component.mjs +9 -5
- package/esm2020/lib/ecabs-expansion-panel/ecabs-expansion-panel.component.mjs +1 -1
- package/esm2020/lib/ecabs-increment/ecabs-increment.component.mjs +2 -2
- package/esm2020/lib/ecabs-picker-header/ecabs-picker-header.component.mjs +2 -2
- package/fesm2015/ecabs-components.mjs +14 -10
- package/fesm2015/ecabs-components.mjs.map +1 -1
- package/fesm2020/ecabs-components.mjs +14 -10
- package/fesm2020/ecabs-components.mjs.map +1 -1
- package/lib/base/consts/date-mask.consts.ts +70 -0
- package/lib/base/directives/date-mask.directive.module.ts +15 -0
- package/lib/base/directives/date-mask.directive.ts +58 -0
- package/lib/base/directives/digits-only.directive.module.ts +15 -0
- package/lib/base/directives/digits-only.directive.ts +129 -0
- package/lib/base/directives/number-border.directive.module.ts +14 -0
- package/lib/base/directives/number-border.directive.ts +57 -0
- package/lib/base/element-base.ts +72 -0
- package/lib/base/element-wrapper/element-wrapper.component.html +30 -0
- package/lib/base/element-wrapper/element-wrapper.component.ts +33 -0
- package/lib/base/element-wrapper/element-wrapper.module.ts +30 -0
- package/lib/base/hint/hint.component.html +1 -0
- package/lib/base/hint/hint.component.scss +0 -0
- package/lib/base/hint/hint.component.ts +12 -0
- package/lib/base/hint/hint.module.ts +13 -0
- package/lib/base/validation/validation.component.html +8 -0
- package/lib/base/validation/validation.component.scss +0 -0
- package/lib/base/validation/validation.component.ts +84 -0
- package/lib/base/validation/validation.module.ts +12 -0
- package/lib/ecabs-active-status-filter/ecabs-active-status-filter.component.html +14 -0
- package/lib/ecabs-active-status-filter/ecabs-active-status-filter.component.scss +16 -0
- package/lib/ecabs-active-status-filter/ecabs-active-status-filter.component.ts +23 -0
- package/lib/ecabs-active-status-filter/ecabs-active-status-filter.module.ts +13 -0
- package/lib/ecabs-breadcrumb/ecabs-breadcrumb.component.html +11 -0
- package/lib/ecabs-breadcrumb/ecabs-breadcrumb.component.scss +0 -0
- package/lib/ecabs-breadcrumb/ecabs-breadcrumb.component.spec.ts +24 -0
- package/lib/ecabs-breadcrumb/ecabs-breadcrumb.component.ts +12 -0
- package/lib/ecabs-breadcrumb/ecabs-breadcrumb.module.ts +12 -0
- package/lib/ecabs-buttons/ecabs-buttons.component.html +18 -0
- package/lib/ecabs-buttons/ecabs-buttons.component.ts +54 -0
- package/lib/ecabs-buttons/ecabs-buttons.module.ts +13 -0
- package/lib/ecabs-checkbox-toggle/ecabs-checkbox-toggle.component.d.ts +5 -3
- package/lib/ecabs-checkbox-toggle/ecabs-checkbox-toggle.component.html +27 -0
- package/lib/ecabs-checkbox-toggle/ecabs-checkbox-toggle.component.scss +15 -0
- package/lib/ecabs-checkbox-toggle/ecabs-checkbox-toggle.component.ts +86 -0
- package/lib/ecabs-checkbox-toggle/ecabs-checkbox-toggle.module.ts +21 -0
- package/lib/ecabs-date-picker/components/ecabs-date-picker-header/ecabs-date-picker-header.component.html +4 -0
- package/lib/ecabs-date-picker/components/ecabs-date-picker-header/ecabs-date-picker-header.component.scss +0 -0
- package/lib/ecabs-date-picker/components/ecabs-date-picker-header/ecabs-date-picker-header.component.spec.ts +23 -0
- package/lib/ecabs-date-picker/components/ecabs-date-picker-header/ecabs-date-picker-header.component.ts +11 -0
- package/lib/ecabs-date-picker/ecabs-date-picker.component.html +31 -0
- package/lib/ecabs-date-picker/ecabs-date-picker.component.scss +10 -0
- package/lib/ecabs-date-picker/ecabs-date-picker.component.spec.ts +24 -0
- package/lib/ecabs-date-picker/ecabs-date-picker.component.ts +72 -0
- package/lib/ecabs-date-picker/ecabs-date-picker.module.ts +28 -0
- package/lib/ecabs-date-range-picker/components/ecabs-date-range-picker-header/ecabs-date-range-picker-header.component.html +4 -0
- package/lib/ecabs-date-range-picker/components/ecabs-date-range-picker-header/ecabs-date-range-picker-header.component.scss +1 -0
- package/lib/ecabs-date-range-picker/components/ecabs-date-range-picker-header/ecabs-date-range-picker-header.component.spec.ts +23 -0
- package/lib/ecabs-date-range-picker/components/ecabs-date-range-picker-header/ecabs-date-range-picker-header.component.ts +11 -0
- package/lib/ecabs-date-range-picker/ecabs-date-range-picker.component.html +31 -0
- package/lib/ecabs-date-range-picker/ecabs-date-range-picker.component.scss +23 -0
- package/lib/ecabs-date-range-picker/ecabs-date-range-picker.component.spec.ts +23 -0
- package/lib/ecabs-date-range-picker/ecabs-date-range-picker.component.ts +113 -0
- package/lib/ecabs-date-range-picker/ecabs-date-range-picker.module.ts +48 -0
- package/lib/ecabs-date-time-picker/components/ecabs-date-time-picker-header/ecabs-date-time-picker-header.component.html +4 -0
- package/lib/ecabs-date-time-picker/components/ecabs-date-time-picker-header/ecabs-date-time-picker-header.component.scss +14 -0
- package/lib/ecabs-date-time-picker/components/ecabs-date-time-picker-header/ecabs-date-time-picker-header.component.ts +11 -0
- package/lib/ecabs-date-time-picker/ecabs-date-time-picker.component.html +87 -0
- package/lib/ecabs-date-time-picker/ecabs-date-time-picker.component.scss +68 -0
- package/lib/ecabs-date-time-picker/ecabs-date-time-picker.component.spec.ts +23 -0
- package/lib/ecabs-date-time-picker/ecabs-date-time-picker.component.ts +185 -0
- package/lib/ecabs-date-time-picker/ecabs-date-time-picker.module.ts +36 -0
- package/lib/ecabs-date-time-range-picker/components/ecabs-date-time-range-picker-header/ecabs-date-time-range-picker-header.component.html +4 -0
- package/lib/ecabs-date-time-range-picker/components/ecabs-date-time-range-picker-header/ecabs-date-time-range-picker-header.component.scss +11 -0
- package/lib/ecabs-date-time-range-picker/components/ecabs-date-time-range-picker-header/ecabs-date-time-range-picker-header.component.spec.ts +23 -0
- package/lib/ecabs-date-time-range-picker/components/ecabs-date-time-range-picker-header/ecabs-date-time-range-picker-header.component.ts +10 -0
- package/lib/ecabs-date-time-range-picker/ecabs-date-time-range-picker.component.html +107 -0
- package/lib/ecabs-date-time-range-picker/ecabs-date-time-range-picker.component.scss +51 -0
- package/lib/ecabs-date-time-range-picker/ecabs-date-time-range-picker.component.spec.ts +24 -0
- package/lib/ecabs-date-time-range-picker/ecabs-date-time-range-picker.component.ts +206 -0
- package/lib/ecabs-date-time-range-picker/ecabs-date-time-range-picker.module.ts +37 -0
- package/lib/ecabs-date-time-range-picker/time-range.directive.ts +38 -0
- package/lib/ecabs-dialog-confirm/ecabs-dialog-confirm.component.html +32 -0
- package/lib/ecabs-dialog-confirm/ecabs-dialog-confirm.component.scss +24 -0
- package/lib/ecabs-dialog-confirm/ecabs-dialog-confirm.component.ts +57 -0
- package/lib/ecabs-dialog-confirm/ecabs-dialog-confirm.module.ts +12 -0
- package/lib/ecabs-dialog-message/ecabs-dialog-message.component.html +27 -0
- package/lib/ecabs-dialog-message/ecabs-dialog-message.component.scss +25 -0
- package/lib/ecabs-dialog-message/ecabs-dialog-message.component.spec.ts +38 -0
- package/lib/ecabs-dialog-message/ecabs-dialog-message.component.ts +49 -0
- package/lib/ecabs-dialog-message/ecabs-dialog-message.module.ts +12 -0
- package/lib/ecabs-empty-placeholder/ecabs-empty-placeholder.component.html +9 -0
- package/lib/ecabs-empty-placeholder/ecabs-empty-placeholder.component.scss +0 -0
- package/lib/ecabs-empty-placeholder/ecabs-empty-placeholder.component.spec.ts +34 -0
- package/lib/ecabs-empty-placeholder/ecabs-empty-placeholder.component.ts +22 -0
- package/lib/ecabs-empty-placeholder/ecabs-empty-placeholder.module.ts +11 -0
- package/lib/ecabs-expansion-panel/ecabs-expansion-panel.component.html +33 -0
- package/lib/ecabs-expansion-panel/ecabs-expansion-panel.component.scss +79 -0
- package/lib/ecabs-expansion-panel/ecabs-expansion-panel.component.spec.ts +26 -0
- package/lib/ecabs-expansion-panel/ecabs-expansion-panel.component.ts +77 -0
- package/lib/ecabs-expansion-panel/ecabs-expansion-panel.module.ts +16 -0
- package/lib/ecabs-increment/ecabs-increment.component.html +18 -0
- package/lib/ecabs-increment/ecabs-increment.component.scss +33 -0
- package/lib/ecabs-increment/ecabs-increment.component.ts +74 -0
- package/lib/ecabs-increment/ecabs-increment.module.ts +16 -0
- package/lib/ecabs-input/ecabs-input.component.html +27 -0
- package/lib/ecabs-input/ecabs-input.component.ts +86 -0
- package/lib/ecabs-input/ecabs-input.module.ts +14 -0
- package/lib/ecabs-language-selector/ecabs-language-selector.component.html +17 -0
- package/lib/ecabs-language-selector/ecabs-language-selector.component.scss +24 -0
- package/lib/ecabs-language-selector/ecabs-language-selector.component.ts +56 -0
- package/lib/ecabs-language-selector/ecabs-language-selector.module.ts +21 -0
- package/lib/ecabs-loading/ecabs-loading.component.html +7 -0
- package/lib/ecabs-loading/ecabs-loading.component.spec.ts +24 -0
- package/lib/ecabs-loading/ecabs-loading.component.ts +11 -0
- package/lib/ecabs-loading/ecabs-loading.module.ts +11 -0
- package/lib/ecabs-loading/spinner/spinner.component.html +5 -0
- package/lib/ecabs-loading/spinner/spinner.component.scss +61 -0
- package/lib/ecabs-loading/spinner/spinner.component.spec.ts +24 -0
- package/lib/ecabs-loading/spinner/spinner.component.ts +11 -0
- package/lib/ecabs-note/ecabs-note.component.html +10 -0
- package/lib/ecabs-note/ecabs-note.component.scss +29 -0
- package/lib/ecabs-note/ecabs-note.component.ts +27 -0
- package/lib/ecabs-note/ecabs-note.module.ts +11 -0
- package/lib/ecabs-phone/ecabs-phone.component.html +17 -0
- package/lib/ecabs-phone/ecabs-phone.component.ts +108 -0
- package/lib/ecabs-phone/ecabs-phone.module.ts +15 -0
- package/lib/ecabs-picker-header/ecabs-picker-header.component.html +12 -0
- package/lib/ecabs-picker-header/ecabs-picker-header.component.scss +12 -0
- package/lib/ecabs-picker-header/ecabs-picker-header.component.ts +61 -0
- package/lib/ecabs-picker-header/ecabs-picker-header.module.ts +15 -0
- package/lib/ecabs-radio-button-list/ecabs-radio-button-list.component.html +13 -0
- package/lib/ecabs-radio-button-list/ecabs-radio-button-list.component.scss +16 -0
- package/lib/ecabs-radio-button-list/ecabs-radio-button-list.component.ts +60 -0
- package/lib/ecabs-radio-button-list/ecabs-radio-button-list.module.ts +20 -0
- package/lib/ecabs-select/ecabs-select.component.html +38 -0
- package/lib/ecabs-select/ecabs-select.component.ts +346 -0
- package/lib/ecabs-select/ecabs-select.module.ts +37 -0
- package/lib/ecabs-table/ecabs-table-filter-wrapper/ecabs-table-filter-wrapper.component.html +7 -0
- package/lib/ecabs-table/ecabs-table-filter-wrapper/ecabs-table-filter-wrapper.component.scss +11 -0
- package/lib/ecabs-table/ecabs-table-filter-wrapper/ecabs-table-filter-wrapper.component.spec.ts +34 -0
- package/lib/ecabs-table/ecabs-table-filter-wrapper/ecabs-table-filter-wrapper.component.ts +14 -0
- package/lib/ecabs-table/ecabs-table-filter-wrapper/ecabs-table-filter-wrapper.module.ts +14 -0
- package/lib/ecabs-table/ecabs-table.component.html +26 -0
- package/lib/ecabs-table/ecabs-table.component.scss +6 -0
- package/lib/ecabs-table/ecabs-table.component.spec.ts +24 -0
- package/lib/ecabs-table/ecabs-table.component.ts +42 -0
- package/lib/ecabs-table/ecabs-table.module.ts +19 -0
- package/lib/ecabs-textarea/ecabs-textarea.component.html +13 -0
- package/lib/ecabs-textarea/ecabs-textarea.component.ts +61 -0
- package/lib/ecabs-textarea/ecabs-textarea.module.ts +12 -0
- package/lib/ecabs-timepicker/componets/ecabs-time-list-panel/ecabs-time-list-panel.component.html +16 -0
- package/lib/ecabs-timepicker/componets/ecabs-time-list-panel/ecabs-time-list-panel.component.ts +126 -0
- package/lib/ecabs-timepicker/config.model.ts +5 -0
- package/lib/ecabs-timepicker/ecabs-timepicker.component.html +36 -0
- package/lib/ecabs-timepicker/ecabs-timepicker.component.scss +5 -0
- package/lib/ecabs-timepicker/ecabs-timepicker.component.ts +330 -0
- package/lib/ecabs-timepicker/ecabs-timepicker.module.ts +12 -0
- package/lib/ecabs-timepicker/ecabs-timepicker.service.ts +28 -0
- package/lib/ecabs-validation/ecabs-validation.component.html +9 -0
- package/lib/ecabs-validation/ecabs-validation.component.scss +23 -0
- package/lib/ecabs-validation/ecabs-validation.component.ts +14 -0
- package/lib/ecabs-validation/ecabs-validation.module.ts +12 -0
- package/lib/models/bread-crumb.ts +5 -0
- package/lib/models/language.models.ts +0 -0
- package/lib/models/timepicker.models.ts +7 -0
- package/lib/models/validation.models.ts +4 -0
- package/lib/services/ecabs-components.service.ts +33 -0
- package/package.json +1 -1
- package/public-api.ts +58 -0
- package/styles/material/overrides/_form.scss +5 -0
- package/test.ts +27 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
:host,
|
|
2
|
+
:host ::ng-deep {
|
|
3
|
+
.mat-dialog-title {
|
|
4
|
+
.mat-icon.icon--close {
|
|
5
|
+
width: 20px;
|
|
6
|
+
height: 20px;
|
|
7
|
+
line-height: 20px;
|
|
8
|
+
font-size: 20px;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.title {
|
|
13
|
+
&.success {
|
|
14
|
+
color: var(--color-success);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
app-buttons {
|
|
19
|
+
width: calc(50% - 0.5rem);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
button {
|
|
23
|
+
width: 100%;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
import { EcabsDialogMessageComponent } from './ecabs-dialog-message.component';
|
|
3
|
+
import { MAT_DIALOG_DATA, MatDialogModule, MatDialogRef } from '@angular/material/dialog';
|
|
4
|
+
import { TranslateFakeLoader, TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
|
5
|
+
|
|
6
|
+
describe( 'DialogMessageComponent', () => {
|
|
7
|
+
let component: EcabsDialogMessageComponent;
|
|
8
|
+
let fixture: ComponentFixture<EcabsDialogMessageComponent>;
|
|
9
|
+
|
|
10
|
+
beforeEach( async () => {
|
|
11
|
+
await TestBed.configureTestingModule( {
|
|
12
|
+
declarations: [ EcabsDialogMessageComponent ],
|
|
13
|
+
imports: [
|
|
14
|
+
MatDialogModule,
|
|
15
|
+
TranslateModule.forRoot( {
|
|
16
|
+
loader: {
|
|
17
|
+
provide: TranslateLoader,
|
|
18
|
+
useClass: TranslateFakeLoader,
|
|
19
|
+
},
|
|
20
|
+
} ),
|
|
21
|
+
],
|
|
22
|
+
providers: [
|
|
23
|
+
{ provide: MatDialogRef, useValue: {} },
|
|
24
|
+
{ provide: MAT_DIALOG_DATA, useValue: {} },
|
|
25
|
+
],
|
|
26
|
+
} ).compileComponents();
|
|
27
|
+
} );
|
|
28
|
+
|
|
29
|
+
beforeEach( () => {
|
|
30
|
+
fixture = TestBed.createComponent( EcabsDialogMessageComponent );
|
|
31
|
+
component = fixture.componentInstance;
|
|
32
|
+
fixture.detectChanges();
|
|
33
|
+
} );
|
|
34
|
+
|
|
35
|
+
it( 'should create', () => {
|
|
36
|
+
expect( component ).toBeTruthy();
|
|
37
|
+
} );
|
|
38
|
+
} );
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Component, Inject, OnDestroy } from '@angular/core';
|
|
2
|
+
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
|
3
|
+
import { ThemePalette } from '@angular/material/core';
|
|
4
|
+
import { Observable, Subject, takeUntil } from 'rxjs';
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'ecabs-dialog-message',
|
|
8
|
+
templateUrl: './ecabs-dialog-message.component.html',
|
|
9
|
+
styleUrls: ['./ecabs-dialog-message.component.scss'],
|
|
10
|
+
})
|
|
11
|
+
export class EcabsDialogMessageComponent implements OnDestroy {
|
|
12
|
+
message: string;
|
|
13
|
+
color: ThemePalette = 'primary';
|
|
14
|
+
titleColor = 'success';
|
|
15
|
+
private destroy$: Subject<any> = new Subject<any>();
|
|
16
|
+
|
|
17
|
+
constructor(
|
|
18
|
+
public dialogRef: MatDialogRef<EcabsDialogMessageComponentConfig>,
|
|
19
|
+
@Inject(MAT_DIALOG_DATA) public data: EcabsDialogMessageComponentConfig,
|
|
20
|
+
) { }
|
|
21
|
+
|
|
22
|
+
ngOnDestroy(): void {
|
|
23
|
+
this.destroy$.next(true);
|
|
24
|
+
this.destroy$.complete();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
closeDialog() {
|
|
28
|
+
if (this.data.loading$) {
|
|
29
|
+
this.data.loading$?.pipe(takeUntil(this.destroy$)).subscribe((loading) => {
|
|
30
|
+
if (!loading) {
|
|
31
|
+
this.dialogRef.close(true);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
} else {
|
|
35
|
+
this.dialogRef.close(true);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface EcabsDialogMessageComponentConfig {
|
|
41
|
+
title?: string;
|
|
42
|
+
titleColor?: ThemePalette | 'success';
|
|
43
|
+
message: string;
|
|
44
|
+
color?: ThemePalette;
|
|
45
|
+
confirmLabel?: string;
|
|
46
|
+
isPopover?: boolean;
|
|
47
|
+
isButtonBlock?: boolean;
|
|
48
|
+
loading$?: Observable<boolean>;
|
|
49
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { EcabsDialogMessageComponent } from './ecabs-dialog-message.component';
|
|
4
|
+
import { MatDialogModule } from '@angular/material/dialog';
|
|
5
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
6
|
+
import { EcabsButtonsModule } from '../ecabs-buttons/ecabs-buttons.module';
|
|
7
|
+
|
|
8
|
+
@NgModule( {
|
|
9
|
+
declarations: [ EcabsDialogMessageComponent ],
|
|
10
|
+
imports: [ CommonModule, MatDialogModule, EcabsButtonsModule, MatIconModule ],
|
|
11
|
+
} )
|
|
12
|
+
export class EcabsDialogMessageModule { }
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<div class="w-full flex flex-col items-center justify-items-center">
|
|
2
|
+
<img class="mt-10 w-60" [src]="srcImage" alt="" />
|
|
3
|
+
|
|
4
|
+
<span class="heading--sm text-gray-400 my-2">{{ isEmptyMessage }}</span>
|
|
5
|
+
|
|
6
|
+
<a *ngIf="redirectPath" [routerLink]="redirectPath?.path && [redirectPath.path]" class="text-sm">
|
|
7
|
+
{{ redirectPath.title }}
|
|
8
|
+
</a>
|
|
9
|
+
</div>
|
|
File without changes
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
import { EcabsEmptyPlaceholderComponent } from './ecabs-empty-placeholder.component';
|
|
3
|
+
import { RouterTestingModule } from '@angular/router/testing';
|
|
4
|
+
import { TranslateFakeLoader, TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
|
5
|
+
|
|
6
|
+
describe( 'EmptyPlaceholderComponent', () => {
|
|
7
|
+
let component: EcabsEmptyPlaceholderComponent;
|
|
8
|
+
let fixture: ComponentFixture<EcabsEmptyPlaceholderComponent>;
|
|
9
|
+
|
|
10
|
+
beforeEach( async () => {
|
|
11
|
+
await TestBed.configureTestingModule( {
|
|
12
|
+
imports: [
|
|
13
|
+
RouterTestingModule,
|
|
14
|
+
TranslateModule.forRoot( {
|
|
15
|
+
loader: {
|
|
16
|
+
provide: TranslateLoader,
|
|
17
|
+
useClass: TranslateFakeLoader,
|
|
18
|
+
},
|
|
19
|
+
} ),
|
|
20
|
+
],
|
|
21
|
+
declarations: [ EcabsEmptyPlaceholderComponent ],
|
|
22
|
+
} ).compileComponents();
|
|
23
|
+
} );
|
|
24
|
+
|
|
25
|
+
beforeEach( () => {
|
|
26
|
+
fixture = TestBed.createComponent( EcabsEmptyPlaceholderComponent );
|
|
27
|
+
component = fixture.componentInstance;
|
|
28
|
+
fixture.detectChanges();
|
|
29
|
+
} );
|
|
30
|
+
|
|
31
|
+
it( 'should create', () => {
|
|
32
|
+
expect( component ).toBeTruthy();
|
|
33
|
+
} );
|
|
34
|
+
} );
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Component, Input } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
export interface PlaceholderRedirectPath {
|
|
4
|
+
title: string;
|
|
5
|
+
path: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
@Component( {
|
|
9
|
+
selector: 'ecabs-empty-placeholder',
|
|
10
|
+
templateUrl: './ecabs-empty-placeholder.component.html',
|
|
11
|
+
styleUrls: [ './ecabs-empty-placeholder.component.scss' ],
|
|
12
|
+
} )
|
|
13
|
+
export class EcabsEmptyPlaceholderComponent {
|
|
14
|
+
@Input()
|
|
15
|
+
isEmptyMessage: string;
|
|
16
|
+
|
|
17
|
+
@Input()
|
|
18
|
+
redirectPath: PlaceholderRedirectPath;
|
|
19
|
+
|
|
20
|
+
@Input()
|
|
21
|
+
srcImage: string;
|
|
22
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { EcabsEmptyPlaceholderComponent } from './ecabs-empty-placeholder.component';
|
|
4
|
+
import { RouterModule } from '@angular/router';
|
|
5
|
+
|
|
6
|
+
@NgModule( {
|
|
7
|
+
declarations: [ EcabsEmptyPlaceholderComponent ],
|
|
8
|
+
imports: [ CommonModule, RouterModule ],
|
|
9
|
+
exports: [ EcabsEmptyPlaceholderComponent ],
|
|
10
|
+
} )
|
|
11
|
+
export class EcabsEmptyPlaceholderModule { }
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<mat-accordion class="example-headers-align" multi>
|
|
2
|
+
<mat-expansion-panel [expanded]="expanded" [disabled]="disabled" (opened)="onOpened()" [hideToggle]="hideToggle">
|
|
3
|
+
<mat-expansion-panel-header *ngIf="title">
|
|
4
|
+
<mat-panel-title>
|
|
5
|
+
<div>
|
|
6
|
+
<div class="flex flex-row">
|
|
7
|
+
<div *ngIf="index && !showErrorMessage" class="border-current border-2 rounded-full mr-3 index">
|
|
8
|
+
{{ index }}
|
|
9
|
+
</div>
|
|
10
|
+
<div *ngIf="!showErrorMessage && showIcon" class="mr-3 rounded">
|
|
11
|
+
<mat-icon class="rounded-icon !text-lg -mt-1">{{ iconName }}</mat-icon>
|
|
12
|
+
</div>
|
|
13
|
+
<div *ngIf="showErrorMessage" class="mt-1 mr-2">
|
|
14
|
+
<mat-icon color="warn">warning</mat-icon>
|
|
15
|
+
</div>
|
|
16
|
+
{{ title }}
|
|
17
|
+
<div *ngIf="showCheckbox" class="ml-2 mt-1">
|
|
18
|
+
<ecabs-checkbox [type]="'toggle'" [(ngModel)]="toggle"
|
|
19
|
+
(click)="toggleAction()"></ecabs-checkbox>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
<div *ngIf="showErrorMessage" class="error-message">{{ errorMessage }}</div>
|
|
23
|
+
</div>
|
|
24
|
+
</mat-panel-title>
|
|
25
|
+
<mat-panel-description>{{ description }}
|
|
26
|
+
<mat-chip *ngIf="showStatus" class="{{ status | lowercase }}">
|
|
27
|
+
{{ status | titlecase }}
|
|
28
|
+
</mat-chip>
|
|
29
|
+
</mat-panel-description>
|
|
30
|
+
</mat-expansion-panel-header>
|
|
31
|
+
<ng-content></ng-content>
|
|
32
|
+
</mat-expansion-panel>
|
|
33
|
+
</mat-accordion>
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
.example-action-buttons {
|
|
2
|
+
padding-bottom: 20px;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.example-headers-align .mat-expansion-panel-header-title,
|
|
6
|
+
.example-headers-align .mat-expansion-panel-header-description {
|
|
7
|
+
flex-basis: 0;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.example-headers-align .mat-expansion-panel-header-description {
|
|
11
|
+
justify-content: flex-end;
|
|
12
|
+
align-items: center;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.example-headers-align .mat-form-field + .mat-form-field {
|
|
16
|
+
margin-left: 8px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
:host ::ng-deep .mat-expansion-indicator::after {
|
|
20
|
+
border-color: var(--color-gray-500);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.index {
|
|
24
|
+
height: 28px;
|
|
25
|
+
width: 28px;
|
|
26
|
+
display: flex;
|
|
27
|
+
align-items: center;
|
|
28
|
+
justify-content: center;
|
|
29
|
+
text-align: center;
|
|
30
|
+
padding-top: 3px;
|
|
31
|
+
font-size: 16px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.error-message {
|
|
35
|
+
font-size: 0.75rem !important;
|
|
36
|
+
color: var(--color-error);
|
|
37
|
+
margin-left: 2.125rem;
|
|
38
|
+
margin-top: -0.75rem;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.rounded {
|
|
42
|
+
background-color: var(--color-brand-dark);
|
|
43
|
+
border-radius: 50%;
|
|
44
|
+
height: 28px;
|
|
45
|
+
width: 28px;
|
|
46
|
+
display: flex;
|
|
47
|
+
align-items: center;
|
|
48
|
+
justify-content: center;
|
|
49
|
+
text-align: center;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.rounded-icon {
|
|
53
|
+
color: var(--color-white);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.inactive {
|
|
57
|
+
background-color: rgba(var(--color-warn-rgb), .05);
|
|
58
|
+
color: var(--color-warn);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.draft {
|
|
62
|
+
background-color: var(--color-gray-200);
|
|
63
|
+
color: var(--color-gray-500);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.published {
|
|
67
|
+
background-color: rgba(var(--color-info-rgb), .05);
|
|
68
|
+
color: var(--color-info);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.active {
|
|
72
|
+
background-color: rgba(var(--color-success-rgb), .05);
|
|
73
|
+
color: var(--color-success);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.expired {
|
|
77
|
+
background-color: rgba(var(--color-error-rgb), .05);
|
|
78
|
+
color: var(--color-error);
|
|
79
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
import { MatExpansionModule } from '@angular/material/expansion';
|
|
3
|
+
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
4
|
+
import { EcabsExpansionPanelComponent } from './ecabs-expansion-panel.component';
|
|
5
|
+
|
|
6
|
+
describe( 'ExpansionPanelComponent', () => {
|
|
7
|
+
let component: EcabsExpansionPanelComponent;
|
|
8
|
+
let fixture: ComponentFixture<EcabsExpansionPanelComponent>;
|
|
9
|
+
|
|
10
|
+
beforeEach( async () => {
|
|
11
|
+
await TestBed.configureTestingModule( {
|
|
12
|
+
imports: [ BrowserAnimationsModule, MatExpansionModule ],
|
|
13
|
+
declarations: [ EcabsExpansionPanelComponent ],
|
|
14
|
+
} ).compileComponents();
|
|
15
|
+
} );
|
|
16
|
+
|
|
17
|
+
beforeEach( () => {
|
|
18
|
+
fixture = TestBed.createComponent( EcabsExpansionPanelComponent );
|
|
19
|
+
component = fixture.componentInstance;
|
|
20
|
+
fixture.detectChanges();
|
|
21
|
+
} );
|
|
22
|
+
|
|
23
|
+
it( 'should create', () => {
|
|
24
|
+
expect( component ).toBeTruthy();
|
|
25
|
+
} );
|
|
26
|
+
} );
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges, ViewChild } from '@angular/core';
|
|
2
|
+
import { MatExpansionPanel } from '@angular/material/expansion';
|
|
3
|
+
|
|
4
|
+
@Component( {
|
|
5
|
+
selector: 'ecabs-expansion-panel',
|
|
6
|
+
templateUrl: './ecabs-expansion-panel.component.html',
|
|
7
|
+
styleUrls: [ './ecabs-expansion-panel.component.scss' ],
|
|
8
|
+
} )
|
|
9
|
+
export class EcabsExpansionPanelComponent implements OnChanges {
|
|
10
|
+
@Input()
|
|
11
|
+
title = '';
|
|
12
|
+
|
|
13
|
+
@Input()
|
|
14
|
+
description: string;
|
|
15
|
+
|
|
16
|
+
@Input()
|
|
17
|
+
index;
|
|
18
|
+
|
|
19
|
+
@Input()
|
|
20
|
+
expanded = false;
|
|
21
|
+
|
|
22
|
+
@Input()
|
|
23
|
+
disabled = false;
|
|
24
|
+
|
|
25
|
+
@Input()
|
|
26
|
+
errorMessage: string;
|
|
27
|
+
|
|
28
|
+
@Input()
|
|
29
|
+
showErrorMessage: boolean;
|
|
30
|
+
|
|
31
|
+
@Input()
|
|
32
|
+
closePanel: boolean;
|
|
33
|
+
|
|
34
|
+
@Input()
|
|
35
|
+
showIcon: boolean;
|
|
36
|
+
|
|
37
|
+
@Input()
|
|
38
|
+
iconName: string;
|
|
39
|
+
|
|
40
|
+
@Input()
|
|
41
|
+
showCheckbox: boolean;
|
|
42
|
+
|
|
43
|
+
@Input()
|
|
44
|
+
showStatus: boolean;
|
|
45
|
+
|
|
46
|
+
@Input()
|
|
47
|
+
status: string;
|
|
48
|
+
|
|
49
|
+
@Input()
|
|
50
|
+
hideToggle = false;
|
|
51
|
+
|
|
52
|
+
@Output() checked = new EventEmitter<boolean>();
|
|
53
|
+
|
|
54
|
+
@Output() opened = new EventEmitter<void>();
|
|
55
|
+
|
|
56
|
+
@ViewChild( MatExpansionPanel ) expansionPanel: MatExpansionPanel;
|
|
57
|
+
|
|
58
|
+
toggle = false;
|
|
59
|
+
|
|
60
|
+
onOpened(): void {
|
|
61
|
+
this.opened.emit();
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
ngOnChanges( changes: SimpleChanges ): void {
|
|
65
|
+
const { closePanel } = changes;
|
|
66
|
+
|
|
67
|
+
if ( closePanel && this.expansionPanel ) {
|
|
68
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
69
|
+
closePanel.currentValue === true ? this.expansionPanel.close() : this.expansionPanel.open();
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
toggleAction(): void {
|
|
74
|
+
this.expanded = !this.expanded;
|
|
75
|
+
this.checked.emit( this.expanded );
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
4
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
5
|
+
import { EcabsExpansionPanelComponent } from './ecabs-expansion-panel.component';
|
|
6
|
+
import { MatExpansionModule } from '@angular/material/expansion';
|
|
7
|
+
import { MatChipsModule } from '@angular/material/chips';
|
|
8
|
+
import { EcabsCheckboxToggleModule } from '../ecabs-checkbox-toggle/ecabs-checkbox-toggle.module';
|
|
9
|
+
import { FormsModule } from '@angular/forms';
|
|
10
|
+
|
|
11
|
+
@NgModule( {
|
|
12
|
+
declarations: [ EcabsExpansionPanelComponent ],
|
|
13
|
+
imports: [ CommonModule, FormsModule, MatButtonModule, MatExpansionModule, MatIconModule, MatChipsModule, EcabsCheckboxToggleModule ],
|
|
14
|
+
exports: [ EcabsExpansionPanelComponent ],
|
|
15
|
+
} )
|
|
16
|
+
export class EcabsExpansionPanelModule { }
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<app-element-wrapper [data]="getData()">
|
|
2
|
+
<div class="form-field__input--wrapper">
|
|
3
|
+
<input appDigitsOnly [digitsOnly]="digitsOnly" [decimal]="allowDecimal" [allowHyphen]="allowHyphen"
|
|
4
|
+
class="form-field__input"
|
|
5
|
+
[type]="type"
|
|
6
|
+
[id]="name"
|
|
7
|
+
[(ngModel)]="value"
|
|
8
|
+
[placeholder]="placeholder"
|
|
9
|
+
(blur)="onTouch()"
|
|
10
|
+
[disabled]="disabled"
|
|
11
|
+
[maxlength]="maxLength"/>
|
|
12
|
+
|
|
13
|
+
<div class="incrementor">
|
|
14
|
+
<mat-icon (click)="increment()">add</mat-icon>
|
|
15
|
+
<mat-icon (click)="decrement()">remove</mat-icon>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
</app-element-wrapper>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
@import "../../styles/styles";
|
|
2
|
+
|
|
3
|
+
:host::ng-deep {
|
|
4
|
+
.incrementor {
|
|
5
|
+
border-left: 1px solid var(--color-gray-300);
|
|
6
|
+
position: absolute;
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
top: 1px;
|
|
10
|
+
bottom: 1px;
|
|
11
|
+
right: 1px;
|
|
12
|
+
background-color: var(--color-white);
|
|
13
|
+
|
|
14
|
+
.mat-icon {
|
|
15
|
+
margin-right: 0;
|
|
16
|
+
font-size: 20px;
|
|
17
|
+
line-height: 20px;
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
|
|
20
|
+
&:first-of-type {
|
|
21
|
+
border-bottom: 1px solid var(--color-gray-300);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&:hover {
|
|
25
|
+
color: var(--color-brand-dark);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.form-field > div {
|
|
31
|
+
line-height: 1;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { AfterViewInit, Component, EventEmitter, Injector, Input, Output } from '@angular/core';
|
|
2
|
+
import { ControlValueAccessor, UntypedFormControl, NG_VALUE_ACCESSOR, NgControl } from '@angular/forms';
|
|
3
|
+
import ElementBaseComponent from '../base/element-base';
|
|
4
|
+
|
|
5
|
+
@Component( {
|
|
6
|
+
selector: 'ecabs-increment',
|
|
7
|
+
templateUrl: './ecabs-increment.component.html',
|
|
8
|
+
styleUrls: [ './ecabs-increment.component.scss' ],
|
|
9
|
+
providers: [
|
|
10
|
+
{
|
|
11
|
+
provide: NG_VALUE_ACCESSOR,
|
|
12
|
+
useExisting: EcabsIncrementComponent,
|
|
13
|
+
multi: true,
|
|
14
|
+
},
|
|
15
|
+
],
|
|
16
|
+
} )
|
|
17
|
+
export class EcabsIncrementComponent extends ElementBaseComponent implements ControlValueAccessor, AfterViewInit {
|
|
18
|
+
@Input() digitsOnly!: boolean;
|
|
19
|
+
@Input() allowDecimal!: boolean;
|
|
20
|
+
@Input() allowHyphen!: boolean;
|
|
21
|
+
|
|
22
|
+
@Output() onblur = new EventEmitter<any>();
|
|
23
|
+
val!: string | number;
|
|
24
|
+
|
|
25
|
+
get value(): string | number {
|
|
26
|
+
return this.val;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
set value( val ) {
|
|
30
|
+
if ( val !== undefined && this.val !== val ) {
|
|
31
|
+
this.val = val;
|
|
32
|
+
this.onChange( val );
|
|
33
|
+
this.onTouch( val );
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
constructor( private injector: Injector ) {
|
|
38
|
+
super();
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
ngAfterViewInit(): void {
|
|
42
|
+
const ngControl: NgControl = this.injector.get( NgControl, null ) as NgControl;
|
|
43
|
+
if ( ngControl ) {
|
|
44
|
+
this.control = ngControl.control as UntypedFormControl;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
onChange: any = () => { };
|
|
49
|
+
onTouch: any = () => { };
|
|
50
|
+
|
|
51
|
+
writeValue( value: any ): void {
|
|
52
|
+
this.value = value;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
registerOnChange( fn: any ): void {
|
|
56
|
+
this.onChange = fn;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
registerOnTouched( fn: any ): void {
|
|
60
|
+
this.onTouch = fn;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
blurChange( e: any ): void {
|
|
64
|
+
this.onblur.emit( e );
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
increment(): void {
|
|
68
|
+
this.value = +this.value + 1;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
decrement(): void {
|
|
72
|
+
this.value = +this.value - 1;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CommonModule } from '@angular/common';
|
|
2
|
+
import { NgModule } from '@angular/core';
|
|
3
|
+
import { FormsModule } from '@angular/forms';
|
|
4
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
5
|
+
import { MatInputModule } from '@angular/material/input';
|
|
6
|
+
import { DigitsOnlyDirectivesModule } from '../base/directives/digits-only.directive.module';
|
|
7
|
+
|
|
8
|
+
import { ElementWrapperModule } from '../base/element-wrapper/element-wrapper.module';
|
|
9
|
+
import { EcabsIncrementComponent } from './ecabs-increment.component';
|
|
10
|
+
|
|
11
|
+
@NgModule( {
|
|
12
|
+
declarations: [ EcabsIncrementComponent ],
|
|
13
|
+
imports: [ CommonModule, MatInputModule, MatIconModule, ElementWrapperModule, FormsModule, DigitsOnlyDirectivesModule ],
|
|
14
|
+
exports: [ EcabsIncrementComponent ],
|
|
15
|
+
} )
|
|
16
|
+
export class EcabsIncrementModule { }
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<app-element-wrapper [data]="getData()">
|
|
2
|
+
<div class="form-field__input--wrapper">
|
|
3
|
+
<input
|
|
4
|
+
appDigitsOnly
|
|
5
|
+
[digitsOnly]="digitsOnly"
|
|
6
|
+
[decimal]="allowDecimal"
|
|
7
|
+
[allowHyphen]="allowHyphen"
|
|
8
|
+
class="form-field__input"
|
|
9
|
+
[type]="type"
|
|
10
|
+
[id]="name"
|
|
11
|
+
[(ngModel)]="value"
|
|
12
|
+
[placeholder]="placeholder"
|
|
13
|
+
(blur)="onTouch()"
|
|
14
|
+
[disabled]="disabled"
|
|
15
|
+
[maxlength]="maxLength"
|
|
16
|
+
[max]="max"
|
|
17
|
+
[min]="min"
|
|
18
|
+
[step]="step"
|
|
19
|
+
(blur)="blurChange($event)"
|
|
20
|
+
/>
|
|
21
|
+
|
|
22
|
+
<div class="form-field__input--suffix" *ngIf="type !== 'number'">
|
|
23
|
+
<ng-content select="mat-icon"></ng-content>
|
|
24
|
+
<ng-content select=".suffix"></ng-content>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
</app-element-wrapper>
|