@verisoft/ui-primeng 20.0.0 → 20.1.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/.eslintrc.json +43 -0
- package/assets/.gitkeep +0 -0
- package/jest.config.ts +22 -0
- package/ng-package.json +14 -0
- package/package.json +6 -18
- package/project.json +36 -0
- package/src/index.ts +34 -0
- package/src/lib/components/breadcrumb/breadcrumb.component.html +11 -0
- package/src/lib/components/breadcrumb/breadcrumb.component.scss +18 -0
- package/src/lib/components/breadcrumb/breadcrumb.component.spec.ts +21 -0
- package/src/lib/components/breadcrumb/breadcrumb.component.stories.ts +36 -0
- package/src/lib/components/breadcrumb/breadcrumb.component.ts +27 -0
- package/src/lib/components/breadcrumb/breadcrumb.pipe.ts +13 -0
- package/src/lib/components/breadcrumb/index.ts +1 -0
- package/src/lib/components/button/button-severity.pipe.ts +20 -0
- package/src/lib/components/button/button.component.html +20 -0
- package/src/lib/components/button/button.component.scss +0 -0
- package/src/lib/components/button/button.component.spec.ts +21 -0
- package/src/lib/components/button/button.component.ts +49 -0
- package/src/lib/components/button/index.ts +1 -0
- package/src/lib/components/calendar/calendar.component.html +53 -0
- package/src/lib/components/calendar/calendar.component.scss +0 -0
- package/src/lib/components/calendar/calendar.component.spec.ts +21 -0
- package/src/lib/components/calendar/calendar.component.ts +70 -0
- package/src/lib/components/calendar/index.ts +1 -0
- package/src/lib/components/checkbox/checkbox.component.html +20 -0
- package/src/lib/components/checkbox/checkbox.component.scss +15 -0
- package/src/lib/components/checkbox/checkbox.component.spec.ts +21 -0
- package/src/lib/components/checkbox/checkbox.component.stories.ts +72 -0
- package/src/lib/components/checkbox/checkbox.component.ts +46 -0
- package/src/lib/components/checkbox/index.ts +1 -0
- package/src/lib/components/confirm-dialog/confirm-dialog.component.html +51 -0
- package/src/lib/components/confirm-dialog/confirm-dialog.component.scss +3 -0
- package/src/lib/components/confirm-dialog/confirm-dialog.component.spec.ts +21 -0
- package/src/lib/components/confirm-dialog/confirm-dialog.component.stories.ts +74 -0
- package/src/lib/components/confirm-dialog/confirm-dialog.component.ts +73 -0
- package/src/lib/components/confirm-dialog/index.ts +1 -0
- package/src/lib/components/dropdown/dropdown.component.html +93 -0
- package/src/lib/components/dropdown/dropdown.component.scss +16 -0
- package/src/lib/components/dropdown/dropdown.component.spec.ts +21 -0
- package/src/lib/components/dropdown/dropdown.component.ts +139 -0
- package/src/lib/components/dropdown/index.ts +1 -0
- package/src/lib/components/dropdown-button/dropdown-button.component.html +1 -0
- package/src/lib/components/dropdown-button/dropdown-button.component.ts +20 -0
- package/src/lib/components/dropdown-button/index.ts +1 -0
- package/src/lib/components/errors/error.component.html +7 -0
- package/src/lib/components/errors/error.component.scss +3 -0
- package/src/lib/components/errors/error.component.ts +34 -0
- package/src/lib/components/errors/index.ts +1 -0
- package/src/lib/components/feature-list/directives/feature-list-column.directive.ts +32 -0
- package/src/lib/components/feature-list/directives/feature-list-filter-field.directive.ts +8 -0
- package/src/lib/components/feature-list/feature-list-filter.pipe.ts +21 -0
- package/src/lib/components/feature-list/feature-list-page.component.ts +32 -0
- package/src/lib/components/feature-list/feature-list-page.model.ts +42 -0
- package/src/lib/components/feature-list/feature-list.component.html +59 -0
- package/src/lib/components/feature-list/feature-list.component.scss +10 -0
- package/src/lib/components/feature-list/feature-list.component.ts +341 -0
- package/src/lib/components/feature-list/index.ts +5 -0
- package/src/lib/components/filter/directives/filter-field.directive.ts +34 -0
- package/src/lib/components/filter/filter.component.html +68 -0
- package/src/lib/components/filter/filter.component.scss +0 -0
- package/src/lib/components/filter/filter.component.spec.ts +21 -0
- package/src/lib/components/filter/filter.component.stories.ts +23 -0
- package/src/lib/components/filter/filter.component.ts +281 -0
- package/src/lib/components/filter/filter.model.ts +18 -0
- package/src/lib/components/filter/index.ts +2 -0
- package/src/lib/components/form-field/form-field.component.html +42 -0
- package/src/lib/components/form-field/form-field.component.scss +0 -0
- package/src/lib/components/form-field/form-field.component.spec.ts +21 -0
- package/src/lib/components/form-field/form-field.component.stories.ts +69 -0
- package/src/lib/components/form-field/form-field.component.ts +37 -0
- package/src/lib/components/form-field/index.ts +1 -0
- package/src/lib/components/header/header.component.html +84 -0
- package/src/lib/components/header/header.component.scss +0 -0
- package/src/lib/components/header/header.component.spec.ts +21 -0
- package/src/lib/components/header/header.component.stories.ts +24 -0
- package/src/lib/components/header/header.component.ts +65 -0
- package/src/lib/components/header/index.ts +2 -0
- package/src/lib/components/header/services/header-provider.service.ts +15 -0
- package/src/lib/components/icon/icon.component.html +2 -0
- package/src/lib/components/icon/icon.component.scss +51 -0
- package/src/lib/components/icon/icon.component.ts +86 -0
- package/src/lib/components/icon/index.ts +2 -0
- package/src/lib/components/input-group/index.ts +1 -0
- package/src/lib/components/input-group/input-group.component.html +34 -0
- package/src/lib/components/input-group/input-group.component.spec.ts +21 -0
- package/src/lib/components/input-group/input-group.component.ts +58 -0
- package/src/lib/components/loader/index.ts +1 -0
- package/src/lib/components/loader/loader.component.html +5 -0
- package/src/lib/components/loader/loader.component.scss +0 -0
- package/src/lib/components/loader/loader.component.spec.ts +21 -0
- package/src/lib/components/loader/loader.component.ts +16 -0
- package/src/lib/components/multiselect/index.ts +1 -0
- package/src/lib/components/multiselect/multiselect.component.html +67 -0
- package/src/lib/components/multiselect/multiselect.component.scss +0 -0
- package/src/lib/components/multiselect/multiselect.component.spec.ts +21 -0
- package/src/lib/components/multiselect/multiselect.component.ts +120 -0
- package/src/lib/components/number-input/index.ts +1 -0
- package/src/lib/components/number-input/number-input.component.html +22 -0
- package/src/lib/components/number-input/number-input.component.spec.ts +21 -0
- package/src/lib/components/number-input/number-input.component.ts +55 -0
- package/src/lib/components/page-header/index.ts +1 -0
- package/src/lib/components/page-header/page-header.component.html +35 -0
- package/src/lib/components/page-header/page-header.component.scss +0 -0
- package/src/lib/components/page-header/page-header.component.spec.ts +21 -0
- package/src/lib/components/page-header/page-header.component.ts +31 -0
- package/src/lib/components/password/index.ts +1 -0
- package/src/lib/components/password/password.component.html +24 -0
- package/src/lib/components/password/password.component.scss +0 -0
- package/src/lib/components/password/password.component.spec.ts +21 -0
- package/src/lib/components/password/password.component.ts +56 -0
- package/src/lib/components/radiobutton/index.ts +1 -0
- package/src/lib/components/radiobutton/radiobutton.component.html +34 -0
- package/src/lib/components/radiobutton/radiobutton.component.scss +6 -0
- package/src/lib/components/radiobutton/radiobutton.component.spec.ts +21 -0
- package/src/lib/components/radiobutton/radiobutton.component.stories.ts +71 -0
- package/src/lib/components/radiobutton/radiobutton.component.ts +61 -0
- package/src/lib/components/section/index.ts +1 -0
- package/src/lib/components/section/section.component.html +25 -0
- package/src/lib/components/section/section.component.scss +0 -0
- package/src/lib/components/section/section.component.spec.ts +21 -0
- package/src/lib/components/section/section.component.ts +31 -0
- package/src/lib/components/shared-components/.eslintrc.json +42 -0
- package/src/lib/components/shared-components/action-button-group/action-button-group.component.html +25 -0
- package/src/lib/components/shared-components/action-button-group/action-button-group.component.scss +0 -0
- package/src/lib/components/shared-components/action-button-group/action-button-group.component.spec.ts +21 -0
- package/src/lib/components/shared-components/action-button-group/action-button-group.component.ts +111 -0
- package/src/lib/components/shared-components/action-button-group/components/action-button/action-button.component.html +10 -0
- package/src/lib/components/shared-components/action-button-group/components/action-button/action-button.component.scss +0 -0
- package/src/lib/components/shared-components/action-button-group/components/action-button/action-button.component.spec.ts +21 -0
- package/src/lib/components/shared-components/action-button-group/components/action-button/action-button.component.ts +69 -0
- package/src/lib/components/shared-components/action-button-group/index.ts +2 -0
- package/src/lib/components/shared-components/dynamic-component/dynamic-component-factory.service.ts +142 -0
- package/src/lib/components/shared-components/dynamic-component/dynamic-component.component.ts +56 -0
- package/src/lib/components/shared-components/dynamic-component/index.ts +2 -0
- package/src/lib/components/shared-components/generic-field/generic-field.component.html +98 -0
- package/src/lib/components/shared-components/generic-field/generic-field.component.spec.ts +21 -0
- package/src/lib/components/shared-components/generic-field/generic-field.component.ts +90 -0
- package/src/lib/components/shared-components/generic-field/index.ts +1 -0
- package/src/lib/components/shared-components/generic-form/generic-form.component.html +46 -0
- package/src/lib/components/shared-components/generic-form/generic-form.component.spec.ts +21 -0
- package/src/lib/components/shared-components/generic-form/generic-form.component.ts +56 -0
- package/src/lib/components/shared-components/generic-form/generic-form.model.spec.ts +82 -0
- package/src/lib/components/shared-components/generic-form/generic-form.model.ts +68 -0
- package/src/lib/components/shared-components/generic-form/index.ts +2 -0
- package/src/lib/components/shared-components/index.ts +4 -0
- package/src/lib/components/side-menu/index.ts +2 -0
- package/src/lib/components/side-menu/side-menu.component.html +53 -0
- package/src/lib/components/side-menu/side-menu.component.scss +0 -0
- package/src/lib/components/side-menu/side-menu.component.spec.ts +21 -0
- package/src/lib/components/side-menu/side-menu.component.ts +96 -0
- package/src/lib/components/side-menu/side-menu.module.ts +66 -0
- package/src/lib/components/slider/index.ts +1 -0
- package/src/lib/components/slider/slider.component.html +19 -0
- package/src/lib/components/slider/slider.component.spec.ts +21 -0
- package/src/lib/components/slider/slider.component.ts +56 -0
- package/src/lib/components/snackbar/index.ts +2 -0
- package/src/lib/components/snackbar/services/snackbar.service.ts +45 -0
- package/src/lib/components/snackbar/snackbar.component.html +3 -0
- package/src/lib/components/snackbar/snackbar.component.scss +0 -0
- package/src/lib/components/snackbar/snackbar.component.spec.ts +21 -0
- package/src/lib/components/snackbar/snackbar.component.stories.ts +70 -0
- package/src/lib/components/snackbar/snackbar.component.ts +25 -0
- package/src/lib/components/stepper/index.ts +1 -0
- package/src/lib/components/stepper/stepper.component.html +35 -0
- package/src/lib/components/stepper/stepper.component.spec.ts +21 -0
- package/src/lib/components/stepper/stepper.component.ts +39 -0
- package/src/lib/components/switch/index.ts +1 -0
- package/src/lib/components/switch/switch.component.html +18 -0
- package/src/lib/components/switch/switch.component.scss +0 -0
- package/src/lib/components/switch/switch.component.spec.ts +21 -0
- package/src/lib/components/switch/switch.component.stories.ts +65 -0
- package/src/lib/components/switch/switch.component.ts +52 -0
- package/src/lib/components/tab-view/index.ts +2 -0
- package/src/lib/components/tab-view/tab-view-item.component.ts +22 -0
- package/src/lib/components/tab-view/tab-view.component.html +41 -0
- package/src/lib/components/tab-view/tab-view.component.ts +55 -0
- package/src/lib/components/table/index.ts +1 -0
- package/src/lib/components/table/table-filter.pipe.ts +59 -0
- package/src/lib/components/table/table.component.html +127 -0
- package/src/lib/components/table/table.component.scss +11 -0
- package/src/lib/components/table/table.component.spec.ts +21 -0
- package/src/lib/components/table/table.component.stories.ts +55 -0
- package/src/lib/components/table/table.component.ts +288 -0
- package/src/lib/components/table/table.models.ts +26 -0
- package/src/lib/components/tag/index.ts +2 -0
- package/src/lib/components/tag/tag.component.html +12 -0
- package/src/lib/components/tag/tag.component.scss +33 -0
- package/src/lib/components/tag/tag.component.ts +83 -0
- package/src/lib/components/textarea/index.ts +1 -0
- package/src/lib/components/textarea/textarea.component.html +40 -0
- package/src/lib/components/textarea/textarea.component.scss +5 -0
- package/src/lib/components/textarea/textarea.component.spec.ts +21 -0
- package/src/lib/components/textarea/textarea.component.stories.ts +98 -0
- package/src/lib/components/textarea/textarea.component.ts +62 -0
- package/src/lib/components/textfield/index.ts +1 -0
- package/src/lib/components/textfield/textfield.component.html +82 -0
- package/src/lib/components/textfield/textfield.component.scss +23 -0
- package/src/lib/components/textfield/textfield.component.spec.ts +21 -0
- package/src/lib/components/textfield/textfield.component.stories.ts +85 -0
- package/src/lib/components/textfield/textfield.component.ts +68 -0
- package/src/lib/components/tooltip/index.ts +1 -0
- package/src/lib/components/tooltip/tooltip.component.html +3 -0
- package/src/lib/components/tooltip/tooltip.component.ts +17 -0
- package/src/lib/icons.ts +36 -0
- package/src/lib/interceptors/http-error-message.interceptor.ts +35 -0
- package/src/lib/pages/not-found-page/not-found-page.component.html +26 -0
- package/src/lib/pages/not-found-page/not-found-page.component.scss +0 -0
- package/src/lib/pages/not-found-page/not-found-page.component.spec.ts +21 -0
- package/src/lib/pages/not-found-page/not-found-page.component.ts +16 -0
- package/src/tab-view.ts +1 -0
- package/src/test-setup.ts +8 -0
- package/tsconfig.json +29 -0
- package/tsconfig.lib.json +18 -0
- package/tsconfig.lib.prod.json +9 -0
- package/tsconfig.spec.json +16 -0
- package/fesm2022/verisoft-ui-primeng.mjs +0 -2866
- package/fesm2022/verisoft-ui-primeng.mjs.map +0 -1
- package/index.d.ts +0 -729
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { CommonModule } from '@angular/common';
|
|
2
|
+
import {
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
ChangeDetectorRef,
|
|
5
|
+
Component,
|
|
6
|
+
Input,
|
|
7
|
+
OnInit,
|
|
8
|
+
} from '@angular/core';
|
|
9
|
+
import { RouterModule } from '@angular/router';
|
|
10
|
+
import {
|
|
11
|
+
HEADER_COMPONENT_TOKEN,
|
|
12
|
+
HeaderCore,
|
|
13
|
+
ScreenSizeService,
|
|
14
|
+
UnsubscribeComponent,
|
|
15
|
+
} from '@verisoft/ui-core';
|
|
16
|
+
import { AvatarModule } from 'primeng/avatar';
|
|
17
|
+
import { Icons } from '../../icons';
|
|
18
|
+
import { ButtonComponent } from '../button';
|
|
19
|
+
import { HeaderProviderService } from './services/header-provider.service';
|
|
20
|
+
|
|
21
|
+
@Component({
|
|
22
|
+
selector: 'v-header',
|
|
23
|
+
imports: [CommonModule, AvatarModule, ButtonComponent, RouterModule],
|
|
24
|
+
templateUrl: './header.component.html',
|
|
25
|
+
styleUrl: './header.component.scss',
|
|
26
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
27
|
+
providers: [
|
|
28
|
+
{ provide: HEADER_COMPONENT_TOKEN, useExisting: HeaderComponent },
|
|
29
|
+
]
|
|
30
|
+
})
|
|
31
|
+
export class HeaderComponent
|
|
32
|
+
extends UnsubscribeComponent
|
|
33
|
+
implements OnInit, HeaderCore
|
|
34
|
+
{
|
|
35
|
+
constructor(
|
|
36
|
+
readonly providerService: HeaderProviderService,
|
|
37
|
+
readonly screenSizeService: ScreenSizeService,
|
|
38
|
+
readonly cdr: ChangeDetectorRef
|
|
39
|
+
) {
|
|
40
|
+
super();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@Input() title!: string;
|
|
44
|
+
@Input() logoUrl!: string;
|
|
45
|
+
@Input() userName!: string;
|
|
46
|
+
@Input() userRole!: any | any[] | undefined;
|
|
47
|
+
@Input() menuRef!: HTMLDivElement;
|
|
48
|
+
@Input() exampleHeader = false;
|
|
49
|
+
|
|
50
|
+
icons = Icons;
|
|
51
|
+
protected menuVisible = false;
|
|
52
|
+
protected logoRouterLink!: string;
|
|
53
|
+
|
|
54
|
+
ngOnInit(): void {
|
|
55
|
+
this.providerService.init();
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
toggleMenu() {
|
|
59
|
+
if (this.menuRef) {
|
|
60
|
+
this.menuVisible = !this.menuVisible;
|
|
61
|
+
this.menuRef.classList.toggle('menu-visible');
|
|
62
|
+
this.cdr.detectChanges();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Inject, Injectable } from '@angular/core';
|
|
2
|
+
import { SETTINGS_MENU } from '@verisoft/ui-core';
|
|
3
|
+
import { MenuItem } from '@verisoft/ui-core';
|
|
4
|
+
|
|
5
|
+
@Injectable({
|
|
6
|
+
providedIn: 'root',
|
|
7
|
+
})
|
|
8
|
+
export class HeaderProviderService {
|
|
9
|
+
constructor(@Inject(SETTINGS_MENU) private settingsMenu: MenuItem[]) {}
|
|
10
|
+
menu: MenuItem[] = [];
|
|
11
|
+
|
|
12
|
+
init(): void {
|
|
13
|
+
this.menu = this.settingsMenu;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
|
|
5
|
+
.pi {
|
|
6
|
+
line-height: 1;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
&.v-primeng-icon--small .pi {
|
|
10
|
+
font-size: 0.75rem;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
&.v-primeng-icon--medium .pi {
|
|
14
|
+
font-size: 1rem;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&.v-primeng-icon--large .pi {
|
|
18
|
+
font-size: 1.5rem;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&.v-primeng-icon--xl .pi {
|
|
22
|
+
font-size: 2rem;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&.v-primeng-icon--primary .pi {
|
|
26
|
+
color: var(--primary-color);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&.v-primeng-icon--secondary .pi {
|
|
30
|
+
color: var(--secondary-color);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&.v-primeng-icon--success .pi {
|
|
34
|
+
color: var(--success-color);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&.v-primeng-icon--danger .pi {
|
|
38
|
+
color: var(--error-color);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&.v-primeng-icon--warning .pi {
|
|
42
|
+
color: var(--details-color);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&.v-primeng-icon--info .pi,
|
|
46
|
+
&.v-primeng-icon--help .pi,
|
|
47
|
+
&.v-primeng-icon--contrast .pi {
|
|
48
|
+
color: var(--secondary-color);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { CommonModule } from '@angular/common';
|
|
2
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { ControlSeverity, ControlSeverityType, IconsComponent } from '@verisoft/ui-core';
|
|
4
|
+
|
|
5
|
+
@Component({
|
|
6
|
+
selector: 'v-icon',
|
|
7
|
+
imports: [CommonModule],
|
|
8
|
+
templateUrl: './icon.component.html',
|
|
9
|
+
styleUrl: './icon.component.scss',
|
|
10
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
11
|
+
host: {
|
|
12
|
+
'[class]': 'hostClasses',
|
|
13
|
+
},
|
|
14
|
+
})
|
|
15
|
+
export class IconComponent extends IconsComponent {
|
|
16
|
+
get primeIconClasses(): string {
|
|
17
|
+
return ['pi', `pi-${this.name()}`].join(' ');
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
get hostClasses(): string {
|
|
21
|
+
const classes = ['v-primeng-icon'];
|
|
22
|
+
const sizeClass = this.primeSizeClass;
|
|
23
|
+
const colorClass = this.primeColorClass;
|
|
24
|
+
const customClass = this.class() ?? '';
|
|
25
|
+
|
|
26
|
+
if (sizeClass) {
|
|
27
|
+
classes.push(sizeClass);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (colorClass) {
|
|
31
|
+
classes.push(colorClass);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (customClass) {
|
|
35
|
+
classes.push(customClass);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return classes.join(' ');
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
private get primeSizeClass(): string {
|
|
42
|
+
switch (this.size()) {
|
|
43
|
+
case 'small':
|
|
44
|
+
return 'v-primeng-icon--small';
|
|
45
|
+
case 'medium':
|
|
46
|
+
return 'v-primeng-icon--medium';
|
|
47
|
+
case 'large':
|
|
48
|
+
return 'v-primeng-icon--large';
|
|
49
|
+
case 'xl':
|
|
50
|
+
return 'v-primeng-icon--xl';
|
|
51
|
+
default:
|
|
52
|
+
return '';
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
private get primeColorClass(): string {
|
|
57
|
+
const color = this.mapSeverityToPrimeClass(this.severity());
|
|
58
|
+
return color ? `v-primeng-icon--${color}` : '';
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
private mapSeverityToPrimeClass(severity: ControlSeverityType | undefined): string | undefined {
|
|
62
|
+
if (!severity) {
|
|
63
|
+
return undefined;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
switch (severity) {
|
|
67
|
+
case ControlSeverity.success:
|
|
68
|
+
return 'success';
|
|
69
|
+
case ControlSeverity.danger:
|
|
70
|
+
return 'danger';
|
|
71
|
+
case ControlSeverity.warning:
|
|
72
|
+
return 'warning';
|
|
73
|
+
case ControlSeverity.info:
|
|
74
|
+
return 'info';
|
|
75
|
+
case ControlSeverity.secondary:
|
|
76
|
+
return 'secondary';
|
|
77
|
+
case ControlSeverity.help:
|
|
78
|
+
case ControlSeverity.primary:
|
|
79
|
+
case ControlSeverity.contrast:
|
|
80
|
+
return 'primary';
|
|
81
|
+
default:
|
|
82
|
+
return severity;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './input-group.component';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<div class="v-input-group w-100">
|
|
2
|
+
<v-form-field
|
|
3
|
+
[label]="label"
|
|
4
|
+
[required]="required"
|
|
5
|
+
[tooltip]="tooltip" >
|
|
6
|
+
<p-inputGroup>
|
|
7
|
+
@for (item of items; track item) {
|
|
8
|
+
@if (item.position === 'left') {
|
|
9
|
+
<p-inputGroupAddon>
|
|
10
|
+
@if (item.icon) {
|
|
11
|
+
<i [class]="item.icon"></i>
|
|
12
|
+
}
|
|
13
|
+
@if (item.text) {
|
|
14
|
+
{{ item.text }}
|
|
15
|
+
}
|
|
16
|
+
</p-inputGroupAddon>
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
<input pInputText [formControl]="formControl" class="w-100" />
|
|
20
|
+
@for (item of items; track item) {
|
|
21
|
+
@if (item.position === 'right') {
|
|
22
|
+
<p-inputGroupAddon>
|
|
23
|
+
@if (item.icon) {
|
|
24
|
+
<i [class]="item.icon"></i>
|
|
25
|
+
}
|
|
26
|
+
@if (item.text) {
|
|
27
|
+
{{ item.text }}
|
|
28
|
+
}
|
|
29
|
+
</p-inputGroupAddon>
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
</p-inputGroup>
|
|
33
|
+
</v-form-field>
|
|
34
|
+
</div>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
import { InputGroupComponent } from './input-group.component';
|
|
3
|
+
|
|
4
|
+
describe('InputGroupComponent', () => {
|
|
5
|
+
let component: InputGroupComponent;
|
|
6
|
+
let fixture: ComponentFixture<InputGroupComponent>;
|
|
7
|
+
|
|
8
|
+
beforeEach(async () => {
|
|
9
|
+
await TestBed.configureTestingModule({
|
|
10
|
+
imports: [InputGroupComponent],
|
|
11
|
+
}).compileComponents();
|
|
12
|
+
|
|
13
|
+
fixture = TestBed.createComponent(InputGroupComponent);
|
|
14
|
+
component = fixture.componentInstance;
|
|
15
|
+
fixture.detectChanges();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('should create', () => {
|
|
19
|
+
expect(component).toBeTruthy();
|
|
20
|
+
});
|
|
21
|
+
});
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
|
|
2
|
+
import {
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
Component,
|
|
5
|
+
forwardRef,
|
|
6
|
+
Input,
|
|
7
|
+
Optional,
|
|
8
|
+
Self,
|
|
9
|
+
} from '@angular/core';
|
|
10
|
+
import {
|
|
11
|
+
ControlValueAccessor,
|
|
12
|
+
NgControl,
|
|
13
|
+
ReactiveFormsModule,
|
|
14
|
+
} from '@angular/forms';
|
|
15
|
+
import {
|
|
16
|
+
BaseFormInputComponent,
|
|
17
|
+
BaseInputControls,
|
|
18
|
+
INPUT_GROUP_COMPONENT_TOKEN,
|
|
19
|
+
InputGroupCore,
|
|
20
|
+
InputGroupItem,
|
|
21
|
+
} from '@verisoft/ui-core';
|
|
22
|
+
import { InputGroupModule } from 'primeng/inputgroup';
|
|
23
|
+
import { InputGroupAddonModule } from 'primeng/inputgroupaddon';
|
|
24
|
+
import { InputTextModule } from 'primeng/inputtext';
|
|
25
|
+
import { FormFieldComponent } from '../form-field';
|
|
26
|
+
|
|
27
|
+
@Component({
|
|
28
|
+
selector: 'v-input-group',
|
|
29
|
+
imports: [
|
|
30
|
+
InputGroupAddonModule,
|
|
31
|
+
InputGroupModule,
|
|
32
|
+
InputTextModule,
|
|
33
|
+
ReactiveFormsModule,
|
|
34
|
+
FormFieldComponent
|
|
35
|
+
],
|
|
36
|
+
templateUrl: './input-group.component.html',
|
|
37
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
38
|
+
providers: [
|
|
39
|
+
{
|
|
40
|
+
provide: BaseInputControls,
|
|
41
|
+
useExisting: forwardRef(() => InputGroupComponent),
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
provide: INPUT_GROUP_COMPONENT_TOKEN,
|
|
45
|
+
useExisting: InputGroupComponent,
|
|
46
|
+
},
|
|
47
|
+
]
|
|
48
|
+
})
|
|
49
|
+
export class InputGroupComponent
|
|
50
|
+
extends BaseFormInputComponent
|
|
51
|
+
implements ControlValueAccessor, InputGroupCore
|
|
52
|
+
{
|
|
53
|
+
constructor(@Optional() @Self() ngControl: NgControl) {
|
|
54
|
+
super(ngControl);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@Input() items!: InputGroupItem[];
|
|
58
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './loader.component';
|
|
File without changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
import { LoaderComponent } from './loader.component';
|
|
3
|
+
|
|
4
|
+
describe('LoaderComponent', () => {
|
|
5
|
+
let component: LoaderComponent;
|
|
6
|
+
let fixture: ComponentFixture<LoaderComponent>;
|
|
7
|
+
|
|
8
|
+
beforeEach(async () => {
|
|
9
|
+
await TestBed.configureTestingModule({
|
|
10
|
+
imports: [LoaderComponent],
|
|
11
|
+
}).compileComponents();
|
|
12
|
+
|
|
13
|
+
fixture = TestBed.createComponent(LoaderComponent);
|
|
14
|
+
component = fixture.componentInstance;
|
|
15
|
+
fixture.detectChanges();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('should create', () => {
|
|
19
|
+
expect(component).toBeTruthy();
|
|
20
|
+
});
|
|
21
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
|
|
2
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { LOADER_COMPONENT_TOKEN, LoaderCore } from '@verisoft/ui-core';
|
|
4
|
+
import { ProgressSpinnerModule } from 'primeng/progressspinner';
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'v-loader',
|
|
8
|
+
imports: [ProgressSpinnerModule],
|
|
9
|
+
templateUrl: './loader.component.html',
|
|
10
|
+
styleUrl: './loader.component.scss',
|
|
11
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
12
|
+
providers: [
|
|
13
|
+
{ provide: LOADER_COMPONENT_TOKEN, useExisting: LoaderComponent },
|
|
14
|
+
]
|
|
15
|
+
})
|
|
16
|
+
export class LoaderComponent implements LoaderCore {}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './multiselect.component';
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<div class="v-multiple-select">
|
|
2
|
+
@if (label && !floatLabel) {
|
|
3
|
+
<v-form-field
|
|
4
|
+
class="w-100"
|
|
5
|
+
[label]="label"
|
|
6
|
+
[tooltip]="tooltip"
|
|
7
|
+
[required]="isRequired()"
|
|
8
|
+
[testId]="testId"
|
|
9
|
+
[display]="formDisplay"
|
|
10
|
+
>
|
|
11
|
+
<p-multiSelect
|
|
12
|
+
class="w-100"
|
|
13
|
+
appendTo="body"
|
|
14
|
+
[formControl]="formControl"
|
|
15
|
+
[title]="label"
|
|
16
|
+
display="chip"
|
|
17
|
+
[options]="options"
|
|
18
|
+
[optionLabel]="optionLabel"
|
|
19
|
+
[optionValue]="optionValue"
|
|
20
|
+
[loading]="loading"
|
|
21
|
+
[placeholder]="placeholder ? placeholder : label"
|
|
22
|
+
[virtualScrollItemSize]="25"
|
|
23
|
+
[lazy]="true"
|
|
24
|
+
[tooltip]="tooltip"
|
|
25
|
+
[required]="isRequired()"
|
|
26
|
+
[showClear]="formControl && clearable && !readonly"
|
|
27
|
+
[virtualScroll]="lazy"
|
|
28
|
+
[virtualScrollItemSize]="virtualOptionSize"
|
|
29
|
+
[virtualScrollOptions]="virtualScrollOptions"
|
|
30
|
+
(showEvent)="onDropdownShow()"
|
|
31
|
+
(clearEvent)="onDropdownClear()"
|
|
32
|
+
(changeEvent)="selectionChange($event)"
|
|
33
|
+
(lazyLoadEvent)="onLazyLoad($any($event))"
|
|
34
|
+
></p-multiSelect>
|
|
35
|
+
</v-form-field>
|
|
36
|
+
<v-validation-message [ngControl]="ngControl"></v-validation-message>
|
|
37
|
+
}
|
|
38
|
+
@if (floatLabel) {
|
|
39
|
+
<p-floatLabel>
|
|
40
|
+
<p-multiSelect
|
|
41
|
+
class="w-100"
|
|
42
|
+
appendTo="body"
|
|
43
|
+
[formControl]="formControl"
|
|
44
|
+
[title]="label"
|
|
45
|
+
[options]="options"
|
|
46
|
+
[optionLabel]="optionLabel"
|
|
47
|
+
[optionValue]="optionValue"
|
|
48
|
+
[loading]="loading"
|
|
49
|
+
[placeholder]="placeholder ? placeholder : label"
|
|
50
|
+
[virtualScrollItemSize]="25"
|
|
51
|
+
[lazy]="true"
|
|
52
|
+
[tooltip]="tooltip"
|
|
53
|
+
[required]="isRequired()"
|
|
54
|
+
[inputId]="inputId"
|
|
55
|
+
[showClear]="formControl && clearable && !readonly"
|
|
56
|
+
[virtualScroll]="lazy"
|
|
57
|
+
[virtualScrollItemSize]="virtualOptionSize"
|
|
58
|
+
[virtualScrollOptions]="virtualScrollOptions"
|
|
59
|
+
(showEvent)="onDropdownShow()"
|
|
60
|
+
(clearEvent)="onDropdownClear()"
|
|
61
|
+
(changeEvent)="selectionChange($event)"
|
|
62
|
+
(lazyLoadEvent)="onLazyLoad($any($event))"
|
|
63
|
+
></p-multiSelect>
|
|
64
|
+
<label [for]="inputId">{{ floatLabel }}</label>
|
|
65
|
+
</p-floatLabel>
|
|
66
|
+
}
|
|
67
|
+
</div>
|
|
File without changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
import { MultiselectComponent } from './multiselect.component';
|
|
3
|
+
|
|
4
|
+
describe('MultiselectComponent', () => {
|
|
5
|
+
let component: MultiselectComponent<any>;
|
|
6
|
+
let fixture: ComponentFixture<MultiselectComponent<any>>;
|
|
7
|
+
|
|
8
|
+
beforeEach(async () => {
|
|
9
|
+
await TestBed.configureTestingModule({
|
|
10
|
+
imports: [MultiselectComponent],
|
|
11
|
+
}).compileComponents();
|
|
12
|
+
|
|
13
|
+
fixture = TestBed.createComponent(MultiselectComponent);
|
|
14
|
+
component = fixture.componentInstance;
|
|
15
|
+
fixture.detectChanges();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('should create', () => {
|
|
19
|
+
expect(component).toBeTruthy();
|
|
20
|
+
});
|
|
21
|
+
});
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
|
|
2
|
+
import {
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
Component,
|
|
5
|
+
EventEmitter,
|
|
6
|
+
forwardRef,
|
|
7
|
+
Input,
|
|
8
|
+
OnChanges,
|
|
9
|
+
Optional,
|
|
10
|
+
Output,
|
|
11
|
+
Self,
|
|
12
|
+
SimpleChanges,
|
|
13
|
+
} from '@angular/core';
|
|
14
|
+
import {
|
|
15
|
+
ControlValueAccessor,
|
|
16
|
+
NgControl,
|
|
17
|
+
ReactiveFormsModule,
|
|
18
|
+
} from '@angular/forms';
|
|
19
|
+
import {
|
|
20
|
+
FilterEvent,
|
|
21
|
+
LazyLoadEvent,
|
|
22
|
+
} from '@verisoft/core';
|
|
23
|
+
import {
|
|
24
|
+
BaseFormInputComponent,
|
|
25
|
+
BaseInputControls,
|
|
26
|
+
MULTISELECT_COMPONENT_TOKEN,
|
|
27
|
+
MultiselectCore,
|
|
28
|
+
FieldSize,
|
|
29
|
+
FieldSizeType,
|
|
30
|
+
} from '@verisoft/ui-core';
|
|
31
|
+
import { ScrollerOptions } from 'primeng/api';
|
|
32
|
+
import { FloatLabelModule } from 'primeng/floatlabel';
|
|
33
|
+
import { MultiSelectModule } from 'primeng/multiselect';
|
|
34
|
+
import { ScrollerLazyLoadEvent } from 'primeng/scroller';
|
|
35
|
+
import { ErrorComponent } from '../errors';
|
|
36
|
+
import { FormFieldComponent } from '../form-field';
|
|
37
|
+
|
|
38
|
+
@Component({
|
|
39
|
+
selector: 'v-multiselect',
|
|
40
|
+
imports: [
|
|
41
|
+
ReactiveFormsModule,
|
|
42
|
+
FloatLabelModule,
|
|
43
|
+
MultiSelectModule,
|
|
44
|
+
ErrorComponent,
|
|
45
|
+
FormFieldComponent
|
|
46
|
+
],
|
|
47
|
+
templateUrl: './multiselect.component.html',
|
|
48
|
+
styleUrl: './multiselect.component.scss',
|
|
49
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
50
|
+
providers: [
|
|
51
|
+
{
|
|
52
|
+
provide: BaseInputControls,
|
|
53
|
+
useExisting: forwardRef(() => MultiselectComponent),
|
|
54
|
+
multi: true,
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
provide: MULTISELECT_COMPONENT_TOKEN,
|
|
58
|
+
useExisting: MultiselectComponent,
|
|
59
|
+
},
|
|
60
|
+
]
|
|
61
|
+
})
|
|
62
|
+
export class MultiselectComponent<T>
|
|
63
|
+
extends BaseFormInputComponent
|
|
64
|
+
implements ControlValueAccessor, MultiselectCore<T>, OnChanges
|
|
65
|
+
{
|
|
66
|
+
constructor(@Optional() @Self() ngControl: NgControl) {
|
|
67
|
+
super(ngControl);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
@Input() options: T[] | undefined = [];
|
|
71
|
+
@Input() optionLabel: string | undefined;
|
|
72
|
+
@Input() optionValue: string | undefined;
|
|
73
|
+
@Input() dropdownIcon?: string;
|
|
74
|
+
@Input() floatLabel?: string;
|
|
75
|
+
@Input() editable = true;
|
|
76
|
+
@Input() loading = false;
|
|
77
|
+
@Input() lazy = false;
|
|
78
|
+
@Input() filter = true;
|
|
79
|
+
@Input() size: FieldSizeType = FieldSize.medium;
|
|
80
|
+
|
|
81
|
+
@Output() changed = new EventEmitter<any>();
|
|
82
|
+
@Output() showed = new EventEmitter<any>();
|
|
83
|
+
@Output() cleared = new EventEmitter<any>();
|
|
84
|
+
@Output() lazyLoad = new EventEmitter<LazyLoadEvent>();
|
|
85
|
+
@Output() filtered = new EventEmitter<FilterEvent>();
|
|
86
|
+
|
|
87
|
+
virtualScrollOptions!: ScrollerOptions | undefined;
|
|
88
|
+
virtualOptionSize = 37.5;
|
|
89
|
+
|
|
90
|
+
ngOnChanges(changes: SimpleChanges): void {
|
|
91
|
+
if (changes['lazy'] || changes['loading']) {
|
|
92
|
+
this.virtualScrollOptions = this.lazy
|
|
93
|
+
? {
|
|
94
|
+
showLoader: this.loading,
|
|
95
|
+
lazy: true,
|
|
96
|
+
onLazyLoad: this.onLazyLoad.bind(this),
|
|
97
|
+
}
|
|
98
|
+
: undefined;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
onLazyLoad(event: ScrollerLazyLoadEvent): void {
|
|
103
|
+
this.lazyLoad.emit({
|
|
104
|
+
offset: event.first,
|
|
105
|
+
limit: event.last - event.first,
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
selectionChange(event: any): void {
|
|
110
|
+
this.cleared.emit(event);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
onDropdownShow(): void {
|
|
114
|
+
this.showed.emit();
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
onDropdownClear(): void {
|
|
118
|
+
this.cleared.emit();
|
|
119
|
+
}
|
|
120
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './number-input.component';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<div class="v-number-input">
|
|
2
|
+
<v-form-field
|
|
3
|
+
class="w-100"
|
|
4
|
+
[label]="label"
|
|
5
|
+
[tooltip]="tooltip"
|
|
6
|
+
[required]="isRequired()"
|
|
7
|
+
[testId]="testId"
|
|
8
|
+
>
|
|
9
|
+
<p-inputNumber
|
|
10
|
+
class="w-100"
|
|
11
|
+
[formControl]="formControl"
|
|
12
|
+
[showButtons]="true"
|
|
13
|
+
[inputId]="inputId"
|
|
14
|
+
[mode]="mode"
|
|
15
|
+
[min]="min"
|
|
16
|
+
[max]="max"
|
|
17
|
+
[step]="step"
|
|
18
|
+
[currency]="currency"
|
|
19
|
+
/>
|
|
20
|
+
<v-validation-message [ngControl]="ngControl"></v-validation-message>
|
|
21
|
+
</v-form-field>
|
|
22
|
+
</div>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
import { NumberInputComponent } from './number-input.component';
|
|
3
|
+
|
|
4
|
+
describe('NumberInputComponent', () => {
|
|
5
|
+
let component: NumberInputComponent;
|
|
6
|
+
let fixture: ComponentFixture<NumberInputComponent>;
|
|
7
|
+
|
|
8
|
+
beforeEach(async () => {
|
|
9
|
+
await TestBed.configureTestingModule({
|
|
10
|
+
imports: [NumberInputComponent],
|
|
11
|
+
}).compileComponents();
|
|
12
|
+
|
|
13
|
+
fixture = TestBed.createComponent(NumberInputComponent);
|
|
14
|
+
component = fixture.componentInstance;
|
|
15
|
+
fixture.detectChanges();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('should create', () => {
|
|
19
|
+
expect(component).toBeTruthy();
|
|
20
|
+
});
|
|
21
|
+
});
|