verben-ng-ui 0.0.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.
- package/README.md +24 -0
- package/ng-package.json +10 -0
- package/package.json +34 -0
- package/src/lib/Verbena-input/error.service.ts +23 -0
- package/src/lib/Verbena-input/verbena-input.component.css +59 -0
- package/src/lib/Verbena-input/verbena-input.component.html +64 -0
- package/src/lib/Verbena-input/verbena-input.component.spec.ts +25 -0
- package/src/lib/Verbena-input/verbena-input.component.ts +162 -0
- package/src/lib/Verbena-input/verbena-input.module.ts +12 -0
- package/src/lib/components/TemplateDirective.directive.ts +10 -0
- package/src/lib/components/card/card.component.css +20 -0
- package/src/lib/components/card/card.component.html +23 -0
- package/src/lib/components/card/card.component.spec.ts +23 -0
- package/src/lib/components/card/card.component.ts +33 -0
- package/src/lib/components/card/card.module.ts +10 -0
- package/src/lib/components/card-data-view/card-data-view-footer/card-data-view-footer.component.css +3 -0
- package/src/lib/components/card-data-view/card-data-view-footer/card-data-view-footer.component.html +1 -0
- package/src/lib/components/card-data-view/card-data-view-footer/card-data-view-footer.component.spec.ts +23 -0
- package/src/lib/components/card-data-view/card-data-view-footer/card-data-view-footer.component.ts +10 -0
- package/src/lib/components/card-data-view/card-data-view-header/card-data-view-header.component.css +7 -0
- package/src/lib/components/card-data-view/card-data-view-header/card-data-view-header.component.html +1 -0
- package/src/lib/components/card-data-view/card-data-view-header/card-data-view-header.component.spec.ts +23 -0
- package/src/lib/components/card-data-view/card-data-view-header/card-data-view-header.component.ts +10 -0
- package/src/lib/components/card-data-view/card-data-view.component.css +39 -0
- package/src/lib/components/card-data-view/card-data-view.component.html +29 -0
- package/src/lib/components/card-data-view/card-data-view.component.spec.ts +23 -0
- package/src/lib/components/card-data-view/card-data-view.component.ts +66 -0
- package/src/lib/components/card-data-view/card-data-view.module.ts +20 -0
- package/src/lib/components/card-data-view/card-data.ts +7 -0
- package/src/lib/components/card-data-view/left-card-data/left-card-data.component.css +15 -0
- package/src/lib/components/card-data-view/left-card-data/left-card-data.component.html +4 -0
- package/src/lib/components/card-data-view/left-card-data/left-card-data.component.spec.ts +23 -0
- package/src/lib/components/card-data-view/left-card-data/left-card-data.component.ts +19 -0
- package/src/lib/components/card-data-view/left-card-data-view/left-card-data-view.component.css +0 -0
- package/src/lib/components/card-data-view/left-card-data-view/left-card-data-view.component.html +4 -0
- package/src/lib/components/card-data-view/left-card-data-view/left-card-data-view.component.spec.ts +23 -0
- package/src/lib/components/card-data-view/left-card-data-view/left-card-data-view.component.ts +12 -0
- package/src/lib/components/card-data-view/right-card-data-view/right-card-data-view.component.css +3 -0
- package/src/lib/components/card-data-view/right-card-data-view/right-card-data-view.component.html +1 -0
- package/src/lib/components/card-data-view/right-card-data-view/right-card-data-view.component.spec.ts +23 -0
- package/src/lib/components/card-data-view/right-card-data-view/right-card-data-view.component.ts +10 -0
- package/src/lib/components/chip/ChipChangeEvent.ts +4 -0
- package/src/lib/components/chip/chip.component.css +94 -0
- package/src/lib/components/chip/chip.component.html +49 -0
- package/src/lib/components/chip/chip.component.spec.ts +23 -0
- package/src/lib/components/chip/chip.component.ts +209 -0
- package/src/lib/components/chip/chip.module.ts +24 -0
- package/src/lib/components/chip/documentation.md +26 -0
- package/src/lib/components/data-export/data-export.component.css +0 -0
- package/src/lib/components/data-export/data-export.component.html +90 -0
- package/src/lib/components/data-export/data-export.component.spec.ts +23 -0
- package/src/lib/components/data-export/data-export.component.ts +158 -0
- package/src/lib/components/data-export/data-export.module.ts +13 -0
- package/src/lib/components/data-export/data-export.service.spec.ts +16 -0
- package/src/lib/components/data-export/data-export.service.ts +152 -0
- package/src/lib/components/data-export/data-export.types.ts +21 -0
- package/src/lib/components/data-table/column.directive.spec.ts +8 -0
- package/src/lib/components/data-table/column.directive.ts +19 -0
- package/src/lib/components/data-table/data-table.component.css +0 -0
- package/src/lib/components/data-table/data-table.component.html +55 -0
- package/src/lib/components/data-table/data-table.component.spec.ts +21 -0
- package/src/lib/components/data-table/data-table.component.ts +336 -0
- package/src/lib/components/data-table/data-table.module.ts +11 -0
- package/src/lib/components/data-table/data-table.types.ts +13 -0
- package/src/lib/components/data-table/style.types.ts +55 -0
- package/src/lib/components/data-view/data-view-click-outside.directive.ts +44 -0
- package/src/lib/components/data-view/data-view.component.css +74 -0
- package/src/lib/components/data-view/data-view.component.html +161 -0
- package/src/lib/components/data-view/data-view.component.spec.ts +23 -0
- package/src/lib/components/data-view/data-view.component.ts +136 -0
- package/src/lib/components/data-view/data-view.module.ts +16 -0
- package/src/lib/components/date-picker/date-picker.component.css +65 -0
- package/src/lib/components/date-picker/date-picker.component.html +60 -0
- package/src/lib/components/date-picker/date-picker.component.specs.ts +23 -0
- package/src/lib/components/date-picker/date-picker.component.ts +143 -0
- package/src/lib/components/date-picker/date-picker.module.ts +12 -0
- package/src/lib/components/drop-down/DropdownChangeEvent.ts +4 -0
- package/src/lib/components/drop-down/DropdownLoadEvent.ts +19 -0
- package/src/lib/components/drop-down/DropdownMenuItem.ts +42 -0
- package/src/lib/components/drop-down/documentation.md +69 -0
- package/src/lib/components/drop-down/drop-down-item/drop-down-item.component.css +123 -0
- package/src/lib/components/drop-down/drop-down-item/drop-down-item.component.html +133 -0
- package/src/lib/components/drop-down/drop-down-item/drop-down-item.component.spec.ts +23 -0
- package/src/lib/components/drop-down/drop-down-item/drop-down-item.component.ts +88 -0
- package/src/lib/components/drop-down/drop-down.component.css +317 -0
- package/src/lib/components/drop-down/drop-down.component.html +177 -0
- package/src/lib/components/drop-down/drop-down.component.spec.ts +23 -0
- package/src/lib/components/drop-down/drop-down.component.ts +757 -0
- package/src/lib/components/drop-down/drop-down.module.ts +24 -0
- package/src/lib/components/image/image.component.css +12 -0
- package/src/lib/components/image/image.component.html +18 -0
- package/src/lib/components/image/image.component.spec.ts +23 -0
- package/src/lib/components/image/image.component.ts +45 -0
- package/src/lib/components/image/image.module.ts +11 -0
- package/src/lib/components/notification/notification.component.css +3 -0
- package/src/lib/components/notification/notification.component.html +19 -0
- package/src/lib/components/notification/notification.component.spec.ts +23 -0
- package/src/lib/components/notification/notification.component.ts +77 -0
- package/src/lib/components/notification/notification.module.ts +14 -0
- package/src/lib/components/shared.module.ts +9 -0
- package/src/lib/components/sort-table/sort-table.component.css +67 -0
- package/src/lib/components/sort-table/sort-table.component.html +164 -0
- package/src/lib/components/sort-table/sort-table.component.spec.ts +23 -0
- package/src/lib/components/sort-table/sort-table.component.ts +204 -0
- package/src/lib/components/sort-table/sort-table.module.ts +11 -0
- package/src/lib/components/svg/svg.component.css +0 -0
- package/src/lib/components/svg/svg.component.html +1 -0
- package/src/lib/components/svg/svg.component.spec.ts +23 -0
- package/src/lib/components/svg/svg.component.ts +64 -0
- package/src/lib/components/svg/svg.module.ts +10 -0
- package/src/lib/components/table-filter/table-filter.component.css +93 -0
- package/src/lib/components/table-filter/table-filter.component.html +293 -0
- package/src/lib/components/table-filter/table-filter.component.spec.ts +23 -0
- package/src/lib/components/table-filter/table-filter.component.ts +221 -0
- package/src/lib/components/table-filter/table-filter.module.ts +25 -0
- package/src/lib/components/tooltip/tooltip.component.css +8 -0
- package/src/lib/components/tooltip/tooltip.component.html +13 -0
- package/src/lib/components/tooltip/tooltip.component.spec.ts +23 -0
- package/src/lib/components/tooltip/tooltip.component.ts +84 -0
- package/src/lib/components/tooltip/tooltip.module.ts +11 -0
- package/src/lib/components/verben-mail/verben-mail.component.config.ts +11 -0
- package/src/lib/components/verben-mail/verben-mail.component.css +71 -0
- package/src/lib/components/verben-mail/verben-mail.component.html +139 -0
- package/src/lib/components/verben-mail/verben-mail.component.ts +151 -0
- package/src/lib/components/verben-mail/verben-mail.module.ts +18 -0
- package/src/lib/components/visible-column/visible-column.component.css +83 -0
- package/src/lib/components/visible-column/visible-column.component.html +77 -0
- package/src/lib/components/visible-column/visible-column.component.spec.ts +23 -0
- package/src/lib/components/visible-column/visible-column.component.ts +106 -0
- package/src/lib/components/visible-column/visible-column.module.ts +11 -0
- package/src/lib/config.ts +37 -0
- package/src/lib/control-options/control-options.directive.ts +129 -0
- package/src/lib/control-options/control-options.module.ts +10 -0
- package/src/lib/convert-to-integer/convert-to-integer.directive.ts +28 -0
- package/src/lib/convert-to-integer/convert-to-integer.module.ts +10 -0
- package/src/lib/convert-to-integer/public-api.ts +1 -0
- package/src/lib/convert-to-number/convert-to-number.directive.ts +22 -0
- package/src/lib/convert-to-number/convert-to-number.module.ts +8 -0
- package/src/lib/convert-to-number/public-api.ts +1 -0
- package/src/lib/email-validator/email-validator.directive.ts +24 -0
- package/src/lib/email-validator/email-validator.module.ts +14 -0
- package/src/lib/models/column-filter.ts +5 -0
- package/src/lib/models/data-filter.ts +8 -0
- package/src/lib/models/mail-model.ts +8 -0
- package/src/lib/models/sort-filter.ts +0 -0
- package/src/lib/models/table-filter.ts +34 -0
- package/src/lib/number-range/number-range.directive.ts +35 -0
- package/src/lib/number-range/number-range.module.ts +11 -0
- package/src/lib/phone-number/phone-number.directive.ts +22 -0
- package/src/lib/phone-number/phone-number.module.ts +10 -0
- package/src/lib/phone-number/public-api.ts +1 -0
- package/src/lib/required-input/required-input.directive.ts +18 -0
- package/src/lib/required-input/required-input.module.ts +8 -0
- package/src/lib/theme-switcher/theme-switcher.directive.spec.ts +8 -0
- package/src/lib/theme-switcher/theme-switcher.directive.ts +70 -0
- package/src/lib/theme-switcher/theme-switcher.module.ts +8 -0
- package/src/lib/validate/error-message.service.ts +104 -0
- package/src/lib/validate/validate.directive.ts +110 -0
- package/src/lib/validate/validate.module.ts +17 -0
- package/src/lib/validate-input/validate-input.directive.ts +8 -0
- package/src/lib/validate-input/validate-input.module.ts +8 -0
- package/src/lib/verben-ng-ui.component.spec.ts +23 -0
- package/src/lib/verben-ng-ui.component.ts +16 -0
- package/src/lib/verben-ng-ui.service.spec.ts +16 -0
- package/src/lib/verben-ng-ui.service.ts +9 -0
- package/src/lib/verbena-badge/verbena-badge.component.css +16 -0
- package/src/lib/verbena-badge/verbena-badge.component.html +13 -0
- package/src/lib/verbena-badge/verbena-badge.component.spec.ts +25 -0
- package/src/lib/verbena-badge/verbena-badge.component.ts +18 -0
- package/src/lib/verbena-badge/verbena-badge.module.ts +10 -0
- package/src/lib/verbena-button/verbena-button.component.css +20 -0
- package/src/lib/verbena-button/verbena-button.component.html +25 -0
- package/src/lib/verbena-button/verbena-button.component.spec.ts +25 -0
- package/src/lib/verbena-button/verbena-button.component.ts +92 -0
- package/src/lib/verbena-button/verbena-button.module.ts +11 -0
- package/src/lib/verbena-switch/verbena-switch.component.css +45 -0
- package/src/lib/verbena-switch/verbena-switch.component.html +8 -0
- package/src/lib/verbena-switch/verbena-switch.component.spec.ts +25 -0
- package/src/lib/verbena-switch/verbena-switch.component.ts +31 -0
- package/src/lib/verbena-switch/verbena-switch.module.ts +10 -0
- package/src/lib/verbena-textarea/verbena-textarea.component.css +0 -0
- package/src/lib/verbena-textarea/verbena-textarea.component.html +19 -0
- package/src/lib/verbena-textarea/verbena-textarea.component.spec.ts +33 -0
- package/src/lib/verbena-textarea/verbena-textarea.component.ts +44 -0
- package/src/lib/verbena-textarea/verbena-textarea.module.ts +11 -0
- package/src/public-api.ts +122 -0
- package/src/styles.css +103 -0
- package/tsconfig.lib.json +15 -0
- package/tsconfig.lib.prod.json +11 -0
- package/tsconfig.spec.json +15 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { forwardRef, NgModule } from '@angular/core';
|
|
2
|
+
import { DropDownComponent } from './drop-down.component';
|
|
3
|
+
import { NG_VALIDATORS, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
4
|
+
import { DropDownItemComponent } from './drop-down-item/drop-down-item.component';
|
|
5
|
+
import { SharedModule } from '../shared.module';
|
|
6
|
+
|
|
7
|
+
@NgModule({
|
|
8
|
+
declarations: [],
|
|
9
|
+
imports: [DropDownComponent, DropDownItemComponent, SharedModule],
|
|
10
|
+
exports: [DropDownComponent],
|
|
11
|
+
providers: [
|
|
12
|
+
{
|
|
13
|
+
provide: NG_VALUE_ACCESSOR,
|
|
14
|
+
useExisting: forwardRef(() => DropDownComponent),
|
|
15
|
+
multi: true,
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
provide: NG_VALIDATORS,
|
|
19
|
+
useExisting: forwardRef(() => DropDownComponent),
|
|
20
|
+
multi: true,
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
})
|
|
24
|
+
export class DropDownModule {}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<div>
|
|
2
|
+
<img [src]="url"
|
|
3
|
+
[attr.data-src]="lazyLoad ? url : null"
|
|
4
|
+
(load)="isLoaded = true"
|
|
5
|
+
(error)="isLoaded = true; url = placeholder"
|
|
6
|
+
[ngClass]="{'loaded': isLoaded}"
|
|
7
|
+
[style.width]="width"
|
|
8
|
+
[style.height]="height"
|
|
9
|
+
alt="Image"/>
|
|
10
|
+
<ng-container *ngIf="!isLoaded">
|
|
11
|
+
<img
|
|
12
|
+
[src]="placeholder"
|
|
13
|
+
[style.width]="width"
|
|
14
|
+
[style.height]="height"
|
|
15
|
+
alt="Placeholder Image"
|
|
16
|
+
/>
|
|
17
|
+
</ng-container>
|
|
18
|
+
</div>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { ImageComponent } from './image.component';
|
|
4
|
+
|
|
5
|
+
describe('ImageComponent', () => {
|
|
6
|
+
let component: ImageComponent;
|
|
7
|
+
let fixture: ComponentFixture<ImageComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
imports: [ImageComponent]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
|
|
15
|
+
fixture = TestBed.createComponent(ImageComponent);
|
|
16
|
+
component = fixture.componentInstance;
|
|
17
|
+
fixture.detectChanges();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should create', () => {
|
|
21
|
+
expect(component).toBeTruthy();
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Component, Input, OnInit, ElementRef, AfterViewInit } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Component({
|
|
4
|
+
selector: 'verben-image',
|
|
5
|
+
templateUrl: './image.component.html',
|
|
6
|
+
styleUrl: './image.component.css',
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
export class ImageComponent implements OnInit, AfterViewInit {
|
|
10
|
+
@Input() url: string = '';
|
|
11
|
+
@Input() placeholder: string = 'assets/placeholder.png';
|
|
12
|
+
@Input() lazyLoad: boolean = false;
|
|
13
|
+
@Input() width: string = '100%';
|
|
14
|
+
@Input() height: string = 'auto';
|
|
15
|
+
|
|
16
|
+
isLoaded: boolean = false;
|
|
17
|
+
|
|
18
|
+
constructor(private el: ElementRef) {}
|
|
19
|
+
|
|
20
|
+
ngOnInit(): void {}
|
|
21
|
+
|
|
22
|
+
ngAfterViewInit(): void {
|
|
23
|
+
if (this.lazyLoad) {
|
|
24
|
+
const observer = new IntersectionObserver((entries) => {
|
|
25
|
+
entries.forEach(entry => {
|
|
26
|
+
if (entry.isIntersecting) {
|
|
27
|
+
const img: HTMLImageElement = this.el.nativeElement.querySelector('img[data-src]');
|
|
28
|
+
img.src = img.getAttribute('data-src')!;
|
|
29
|
+
this.isLoaded = true;
|
|
30
|
+
observer.unobserve(entry.target);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
observer.observe(this.el.nativeElement);
|
|
35
|
+
}else {
|
|
36
|
+
const img: HTMLImageElement = this.el.nativeElement.querySelector('img');
|
|
37
|
+
img.onload = () => {
|
|
38
|
+
this.isLoaded = true;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { ImageComponent } from './image.component';
|
|
3
|
+
import { CommonModule } from '@angular/common';
|
|
4
|
+
import { VerbenaInputModule } from "../../Verbena-input/verbena-input.module";
|
|
5
|
+
|
|
6
|
+
@NgModule({
|
|
7
|
+
declarations: [ImageComponent],
|
|
8
|
+
imports: [CommonModule, VerbenaInputModule,CommonModule],
|
|
9
|
+
exports: [ImageComponent],
|
|
10
|
+
})
|
|
11
|
+
export class ImageModule {}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<div [ngStyle] = "notificationStyles">
|
|
2
|
+
<div [ngStyle] = "innerWrapperStyles">
|
|
3
|
+
<verben-svg [icon] ="iconName" [width]="iconWidth" [height]="iconHeight" [stroke]="stroke" [fill]="fill"></verben-svg>
|
|
4
|
+
<p>{{content}}</p>
|
|
5
|
+
</div>
|
|
6
|
+
<div [ngStyle]="btnWrapperStyle">
|
|
7
|
+
<button *ngFor="let button of buttons"
|
|
8
|
+
[ngStyle]="{'background-color': button.bgColor || 'white',
|
|
9
|
+
'color': button.primarycolor || button.secondarycolor,
|
|
10
|
+
'font-size':button.fontSize,
|
|
11
|
+
'font-weight':button.fontWeigth,
|
|
12
|
+
'padding':'0px 8px',
|
|
13
|
+
'border-radius':'8px',
|
|
14
|
+
}"
|
|
15
|
+
(click)="onButtonClick(button)">
|
|
16
|
+
{{button.text}}
|
|
17
|
+
</button>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { NotificationComponent } from './notification.component';
|
|
4
|
+
|
|
5
|
+
describe('NotificationComponent', () => {
|
|
6
|
+
let component: NotificationComponent;
|
|
7
|
+
let fixture: ComponentFixture<NotificationComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
imports: [NotificationComponent]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
|
|
15
|
+
fixture = TestBed.createComponent(NotificationComponent);
|
|
16
|
+
component = fixture.componentInstance;
|
|
17
|
+
fixture.detectChanges();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should create', () => {
|
|
21
|
+
expect(component).toBeTruthy();
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Component, Input, EventEmitter, Output } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
interface Button {
|
|
4
|
+
text: string;
|
|
5
|
+
bgColor?: string;
|
|
6
|
+
primarycolor?: string;
|
|
7
|
+
secondarycolor?: string;
|
|
8
|
+
fontSize?:string;
|
|
9
|
+
fontWeigth?:string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@Component({
|
|
13
|
+
selector: 'verben-notification',
|
|
14
|
+
templateUrl: './notification.component.html',
|
|
15
|
+
styleUrl: './notification.component.css'
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
export class NotificationComponent {
|
|
19
|
+
@Input() bgColor: string = '#D6F3E6';
|
|
20
|
+
@Input() textColor: string = '#2DB76F';
|
|
21
|
+
@Input() width?: string = '650px';
|
|
22
|
+
@Input() height?: string = '50px';
|
|
23
|
+
@Input() border?: string;
|
|
24
|
+
@Input() borderRadius: string = '15px';
|
|
25
|
+
@Input() fontSize: string = '20px';
|
|
26
|
+
@Input() fontWeight: string = '700';
|
|
27
|
+
@Input() padding: string = '10px 2.5rem 10px 1.5rem';
|
|
28
|
+
@Input() iconName: string = 'success';
|
|
29
|
+
@Input() iconWidth: number = 20;
|
|
30
|
+
@Input() iconHeight: number = 20;
|
|
31
|
+
@Input() content?: string;
|
|
32
|
+
@Input() stroke: string = '';
|
|
33
|
+
@Input() fill: string = '';
|
|
34
|
+
@Input() buttons: Button[] = [];
|
|
35
|
+
|
|
36
|
+
@Output() buttonClick = new EventEmitter<Button>();
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
get notificationStyles() {
|
|
40
|
+
return {
|
|
41
|
+
'background-color': this.bgColor,
|
|
42
|
+
'color': this.textColor,
|
|
43
|
+
'padding': this.padding,
|
|
44
|
+
'border-radius': this.borderRadius,
|
|
45
|
+
'border': this.border,
|
|
46
|
+
'width': this.width,
|
|
47
|
+
'font-size':this.fontSize,
|
|
48
|
+
'font-weight':this.fontWeight,
|
|
49
|
+
'display':'flex',
|
|
50
|
+
'align-items':'center',
|
|
51
|
+
'justify-content':'space-between'
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
get btnWrapperStyle(){
|
|
57
|
+
return {
|
|
58
|
+
'display':'flex',
|
|
59
|
+
'align-items':'center',
|
|
60
|
+
'gap':'0.8rem'
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
get innerWrapperStyles(){
|
|
65
|
+
return {
|
|
66
|
+
'display':'flex',
|
|
67
|
+
'align-items':'center',
|
|
68
|
+
'gap':'1.5rem'
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
onButtonClick(button: Button) {
|
|
73
|
+
this.buttonClick.emit(button);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { NotificationComponent } from '../notification/notification.component';
|
|
3
|
+
import { CommonModule } from '@angular/common'
|
|
4
|
+
import { SvgModule } from '../svg/svg.module';
|
|
5
|
+
|
|
6
|
+
@NgModule({
|
|
7
|
+
declarations: [NotificationComponent],
|
|
8
|
+
imports: [CommonModule,SvgModule],
|
|
9
|
+
exports: [NotificationComponent]
|
|
10
|
+
})
|
|
11
|
+
export class NotificationModule {}
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
hr{
|
|
4
|
+
border: 1px solid rgba(232, 234, 241, 1);
|
|
5
|
+
margin:0.8rem 0rem;
|
|
6
|
+
}
|
|
7
|
+
.flex{
|
|
8
|
+
display: flex;
|
|
9
|
+
}
|
|
10
|
+
.justify-between{
|
|
11
|
+
justify-content: space-between;
|
|
12
|
+
}
|
|
13
|
+
.items-center{
|
|
14
|
+
align-items: center;
|
|
15
|
+
}
|
|
16
|
+
.font-semibold{
|
|
17
|
+
font-weight: 600;
|
|
18
|
+
}
|
|
19
|
+
.font-semibold{
|
|
20
|
+
font-weight: 600;
|
|
21
|
+
}
|
|
22
|
+
.font-normal{
|
|
23
|
+
font-weight: 400;
|
|
24
|
+
}
|
|
25
|
+
.text-sm{
|
|
26
|
+
font-size: 14px;
|
|
27
|
+
}
|
|
28
|
+
.gap{
|
|
29
|
+
gap: 7px;
|
|
30
|
+
}
|
|
31
|
+
.gap-sm{
|
|
32
|
+
gap: 4px;
|
|
33
|
+
}
|
|
34
|
+
.cursor-pointer{
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
}
|
|
37
|
+
.cursor-not-allowed{
|
|
38
|
+
cursor: not-allowed;
|
|
39
|
+
}
|
|
40
|
+
.pd{
|
|
41
|
+
padding: 10px 10px 10px 10px;
|
|
42
|
+
}
|
|
43
|
+
.sort-header {
|
|
44
|
+
margin-bottom: 10px;
|
|
45
|
+
padding: 10px 0px 10px 0px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
input[type="checkbox"].checked {
|
|
49
|
+
accent-color: #3479E9
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.block{
|
|
53
|
+
display: block;
|
|
54
|
+
}
|
|
55
|
+
.btn-wrapper{
|
|
56
|
+
display: flex;
|
|
57
|
+
justify-content: end;
|
|
58
|
+
}
|
|
59
|
+
.gap-md{
|
|
60
|
+
gap: 2px;
|
|
61
|
+
}
|
|
62
|
+
.disabledBtn {
|
|
63
|
+
cursor: not-allowed;
|
|
64
|
+
}
|
|
65
|
+
.enabledBtn {
|
|
66
|
+
cursor:pointer;
|
|
67
|
+
}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
<div
|
|
2
|
+
[style.background-color]="bgColor"
|
|
3
|
+
[style.box-shadow]="boxShadow"
|
|
4
|
+
[style.border]="border"
|
|
5
|
+
[style.border-radius]="borderRadius"
|
|
6
|
+
[style.color]="textColor"
|
|
7
|
+
[style.width]="width"
|
|
8
|
+
[style.height]="height"
|
|
9
|
+
[style.padding]="pd"
|
|
10
|
+
>
|
|
11
|
+
<!-- Header Section -->
|
|
12
|
+
<div class="sort-header flex justify-between text-sm">
|
|
13
|
+
<span class="sort-title font-semibold">
|
|
14
|
+
Sort
|
|
15
|
+
<sup [style.color]="secondaryColor">[{{ countSelectedSorts() }}]</sup>
|
|
16
|
+
</span>
|
|
17
|
+
<span
|
|
18
|
+
[style.color]="secondaryColor"
|
|
19
|
+
[style.border]="'none'"
|
|
20
|
+
[style.cursor]="'pointer'"
|
|
21
|
+
[style.font-size]="'12px'"
|
|
22
|
+
class="cursor-pointer"
|
|
23
|
+
(click)="resetSort()"
|
|
24
|
+
>{{ resetText }}</span
|
|
25
|
+
>
|
|
26
|
+
|
|
27
|
+
</div>
|
|
28
|
+
<hr />
|
|
29
|
+
<!-- Sort Options -->
|
|
30
|
+
<div [style.max-height]="containerHeight" class="sort-options">
|
|
31
|
+
<p class="pd">{{ propertyText }}</p>
|
|
32
|
+
<div class="flex items-center gap" [style.padding]="'4px 10px'">
|
|
33
|
+
<label [style.font-size]="'13px'" [style.font-weight]="'500'">
|
|
34
|
+
<input type="checkbox" [checked]="checkAll"
|
|
35
|
+
(change)="toggleSelectAll()" />
|
|
36
|
+
Select All
|
|
37
|
+
</label>
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
<div
|
|
41
|
+
*ngFor="let option of visibleSortOptions; let i = index"
|
|
42
|
+
[attr.draggable]="enableDragAndDrop"
|
|
43
|
+
(dragstart)="onDragStart(i, $event)"
|
|
44
|
+
(dragover)="onDragOver($event)"
|
|
45
|
+
(drop)="onDrop(i, $event)"
|
|
46
|
+
class="sort-option"
|
|
47
|
+
>
|
|
48
|
+
<div [style.font-size]="'14px'" [style.margin-top]="'13px'">
|
|
49
|
+
<div class="flex items-center gap-md">
|
|
50
|
+
<verben-svg
|
|
51
|
+
*ngIf="enableDragAndDrop"
|
|
52
|
+
fill="black"
|
|
53
|
+
[width]="25"
|
|
54
|
+
class="svg"
|
|
55
|
+
icon="square-dot"
|
|
56
|
+
></verben-svg>
|
|
57
|
+
<div class="flex items-center gap">
|
|
58
|
+
<input
|
|
59
|
+
type="checkbox"
|
|
60
|
+
[checked]="option.checked"
|
|
61
|
+
(change)="toggleSort(i)"
|
|
62
|
+
/>
|
|
63
|
+
<span>{{ option.name }}</span>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
|
|
67
|
+
<!-- Sorting Controls -->
|
|
68
|
+
<div class="flex items-center gap" [style.margin-left]="'35px'">
|
|
69
|
+
<label
|
|
70
|
+
class="flex items-center gap-sm"
|
|
71
|
+
*ngIf="option.type === 'Number'"
|
|
72
|
+
>
|
|
73
|
+
<input
|
|
74
|
+
type="radio"
|
|
75
|
+
name="sortOrder{{ i }}"
|
|
76
|
+
value="asc"
|
|
77
|
+
[checked]="selectedOrders.get(i) === 'asc'"
|
|
78
|
+
[disabled]="!option.checked"
|
|
79
|
+
(change)="setSortOrder(i, 'asc')"
|
|
80
|
+
/>
|
|
81
|
+
1-100
|
|
82
|
+
</label>
|
|
83
|
+
<label
|
|
84
|
+
class="flex items-center gap-sm"
|
|
85
|
+
*ngIf="option.type === 'Number'"
|
|
86
|
+
>
|
|
87
|
+
<input
|
|
88
|
+
type="radio"
|
|
89
|
+
name="sortOrder{{ i }}"
|
|
90
|
+
value="desc"
|
|
91
|
+
[checked]="selectedOrders.get(i) === 'desc'"
|
|
92
|
+
[disabled]="!option.checked"
|
|
93
|
+
(change)="setSortOrder(i, 'desc')"
|
|
94
|
+
/>
|
|
95
|
+
100-1
|
|
96
|
+
</label>
|
|
97
|
+
|
|
98
|
+
<label
|
|
99
|
+
class="flex items-center gap-sm"
|
|
100
|
+
*ngIf="option.type === 'String' || option.type === 'Date'"
|
|
101
|
+
>
|
|
102
|
+
<input
|
|
103
|
+
type="radio"
|
|
104
|
+
name="sortOrder{{ i }}"
|
|
105
|
+
value="asc"
|
|
106
|
+
[checked]="selectedOrders.get(i) === 'asc'"
|
|
107
|
+
[disabled]="!option.checked"
|
|
108
|
+
(change)="setSortOrder(i, 'asc')"
|
|
109
|
+
/>
|
|
110
|
+
A-Z
|
|
111
|
+
</label>
|
|
112
|
+
<label
|
|
113
|
+
class="flex items-center gap-sm"
|
|
114
|
+
*ngIf="option.type === 'String' || option.type === 'Date'"
|
|
115
|
+
>
|
|
116
|
+
<input
|
|
117
|
+
type="radio"
|
|
118
|
+
name="sortOrder{{ i }}"
|
|
119
|
+
value="desc"
|
|
120
|
+
[checked]="selectedOrders.get(i) === 'desc'"
|
|
121
|
+
[disabled]="!option.checked"
|
|
122
|
+
(change)="setSortOrder(i, 'desc')"
|
|
123
|
+
/>
|
|
124
|
+
Z-A
|
|
125
|
+
</label>
|
|
126
|
+
</div>
|
|
127
|
+
</div>
|
|
128
|
+
</div>
|
|
129
|
+
|
|
130
|
+
<!-- Show More Options -->
|
|
131
|
+
<div *ngIf="showMore && hiddenSortOptions.length > 0">
|
|
132
|
+
<span
|
|
133
|
+
[style.padding]="'20px 10px 0px 10px'"
|
|
134
|
+
[style.color]="'black'"
|
|
135
|
+
class="cursor-pointer block"
|
|
136
|
+
(click)="toggleShowMore()"
|
|
137
|
+
>
|
|
138
|
+
{{ showMoreText }}
|
|
139
|
+
</span>
|
|
140
|
+
</div>
|
|
141
|
+
</div>
|
|
142
|
+
<hr />
|
|
143
|
+
<!-- Sort Button -->
|
|
144
|
+
<div class="btn-wrapper">
|
|
145
|
+
<button
|
|
146
|
+
[style.margin-top]="'0.5rem'"
|
|
147
|
+
[style.outline]="'none'"
|
|
148
|
+
[style.border]="'none'"
|
|
149
|
+
[style.padding]="'0.2rem 1.6rem'"
|
|
150
|
+
[style.background-color]="primaryColor"
|
|
151
|
+
[style.color]="tertiaryColor"
|
|
152
|
+
[style.font-size]="'12px'"
|
|
153
|
+
[style.font-weight]="'600'"
|
|
154
|
+
[disabled]="countSelectedSorts() === 0"
|
|
155
|
+
[ngClass]="{
|
|
156
|
+
disabledBtn:countSelectedSorts()===0,
|
|
157
|
+
enableBtn:countSelectedSorts()!==0,
|
|
158
|
+
}"
|
|
159
|
+
(click)="applySort()"
|
|
160
|
+
>
|
|
161
|
+
{{ sortButtonText }}
|
|
162
|
+
</button>
|
|
163
|
+
</div>
|
|
164
|
+
</div>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { SortTableComponent } from './sort-table.component';
|
|
4
|
+
|
|
5
|
+
describe('SortTableComponent', () => {
|
|
6
|
+
let component: SortTableComponent;
|
|
7
|
+
let fixture: ComponentFixture<SortTableComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
declarations: [SortTableComponent]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
|
|
15
|
+
fixture = TestBed.createComponent(SortTableComponent);
|
|
16
|
+
component = fixture.componentInstance;
|
|
17
|
+
fixture.detectChanges();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should create', () => {
|
|
21
|
+
expect(component).toBeTruthy();
|
|
22
|
+
});
|
|
23
|
+
});
|