@verisoft/ui-govcz 20.1.1 → 20.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/verisoft-ui-govcz.mjs +3770 -0
- package/fesm2022/verisoft-ui-govcz.mjs.map +1 -0
- package/index.d.ts +1013 -0
- package/package.json +19 -7
- package/.eslintrc.json +0 -60
- package/jest.config.ts +0 -21
- package/ng-package.json +0 -28
- package/project.json +0 -49
- package/src/config.d.ts +0 -10
- package/src/index.ts +0 -1
- package/src/lib/components/breadcrumb/breadcrumb.component.html +0 -25
- package/src/lib/components/breadcrumb/breadcrumb.component.scss +0 -0
- package/src/lib/components/breadcrumb/breadcrumb.component.spec.ts +0 -21
- package/src/lib/components/breadcrumb/breadcrumb.component.ts +0 -28
- package/src/lib/components/breadcrumb/index.ts +0 -1
- package/src/lib/components/button/button.component.html +0 -28
- package/src/lib/components/button/button.component.scss +0 -21
- package/src/lib/components/button/button.component.ts +0 -77
- package/src/lib/components/button/index.ts +0 -1
- package/src/lib/components/calendar/calendar.component.html +0 -28
- package/src/lib/components/calendar/calendar.component.scss +0 -0
- package/src/lib/components/calendar/calendar.component.ts +0 -77
- package/src/lib/components/calendar/index.ts +0 -1
- package/src/lib/components/checkbox/checkbox.component.html +0 -23
- package/src/lib/components/checkbox/checkbox.component.scss +0 -0
- package/src/lib/components/checkbox/checkbox.component.ts +0 -61
- package/src/lib/components/checkbox/index.ts +0 -1
- package/src/lib/components/confirm-dialog/confirm-dialog.component.html +0 -50
- package/src/lib/components/confirm-dialog/confirm-dialog.component.scss +0 -4
- package/src/lib/components/confirm-dialog/confirm-dialog.component.ts +0 -79
- package/src/lib/components/confirm-dialog/index.ts +0 -1
- package/src/lib/components/dropdown/dropdown-item.component.html +0 -8
- package/src/lib/components/dropdown/dropdown-item.component.ts +0 -18
- package/src/lib/components/dropdown/dropdown.component.html +0 -91
- package/src/lib/components/dropdown/dropdown.component.scss +0 -108
- package/src/lib/components/dropdown/dropdown.component.spec.ts +0 -21
- package/src/lib/components/dropdown/dropdown.component.ts +0 -296
- package/src/lib/components/dropdown/dropdown.model.ts +0 -6
- package/src/lib/components/dropdown/index.ts +0 -1
- package/src/lib/components/dropdown-button/dropdown-button.component.html +0 -31
- package/src/lib/components/dropdown-button/dropdown-button.component.ts +0 -34
- package/src/lib/components/dropdown-button/index.ts +0 -1
- package/src/lib/components/errors/error.component.html +0 -11
- package/src/lib/components/errors/error.component.scss +0 -0
- package/src/lib/components/errors/error.component.spec.ts +0 -19
- package/src/lib/components/errors/error.component.ts +0 -29
- package/src/lib/components/errors/index.ts +0 -1
- package/src/lib/components/feature-list/directives/feature-list-column.directive.ts +0 -32
- package/src/lib/components/feature-list/directives/feature-list-filter-field.directive.ts +0 -8
- package/src/lib/components/feature-list/feature-list-filter.pipe.ts +0 -20
- package/src/lib/components/feature-list/feature-list-page.component.ts +0 -30
- package/src/lib/components/feature-list/feature-list-page.model.ts +0 -42
- package/src/lib/components/feature-list/feature-list.component.html +0 -67
- package/src/lib/components/feature-list/feature-list.component.scss +0 -10
- package/src/lib/components/feature-list/feature-list.component.ts +0 -360
- package/src/lib/components/feature-list/index.ts +0 -5
- package/src/lib/components/filter/directives/filter-field.directive.ts +0 -35
- package/src/lib/components/filter/filter.component.html +0 -78
- package/src/lib/components/filter/filter.component.scss +0 -32
- package/src/lib/components/filter/filter.component.spec.ts +0 -21
- package/src/lib/components/filter/filter.component.stories.ts +0 -23
- package/src/lib/components/filter/filter.component.ts +0 -286
- package/src/lib/components/filter/filter.model.ts +0 -18
- package/src/lib/components/filter/index.ts +0 -2
- package/src/lib/components/form-field/form-field.component.html +0 -14
- package/src/lib/components/form-field/form-field.component.scss +0 -0
- package/src/lib/components/form-field/form-field.component.spec.ts +0 -21
- package/src/lib/components/form-field/form-field.component.ts +0 -76
- package/src/lib/components/form-field/index.ts +0 -1
- package/src/lib/components/header/header.component.html +0 -122
- package/src/lib/components/header/header.component.scss +0 -0
- package/src/lib/components/header/header.component.ts +0 -90
- package/src/lib/components/header/index.ts +0 -1
- package/src/lib/components/icon/icon.component.html +0 -11
- package/src/lib/components/icon/icon.component.scss +0 -20
- package/src/lib/components/icon/icon.component.ts +0 -110
- package/src/lib/components/icon/index.ts +0 -2
- package/src/lib/components/index.ts +0 -37
- package/src/lib/components/input-group/index.ts +0 -1
- package/src/lib/components/input-group/input-group.component.html +0 -41
- package/src/lib/components/input-group/input-group.component.scss +0 -0
- package/src/lib/components/input-group/input-group.component.ts +0 -75
- package/src/lib/components/loader/index.ts +0 -1
- package/src/lib/components/loader/loader.component.html +0 -7
- package/src/lib/components/loader/loader.component.scss +0 -0
- package/src/lib/components/loader/loader.component.spec.ts +0 -21
- package/src/lib/components/loader/loader.component.ts +0 -33
- package/src/lib/components/multiselect/index.ts +0 -1
- package/src/lib/components/multiselect/multiselect.component.html +0 -21
- package/src/lib/components/multiselect/multiselect.component.scss +0 -0
- package/src/lib/components/multiselect/multiselect.component.spec.ts +0 -21
- package/src/lib/components/multiselect/multiselect.component.ts +0 -117
- package/src/lib/components/number-input/index.ts +0 -1
- package/src/lib/components/number-input/number-input.component.html +0 -48
- package/src/lib/components/number-input/number-input.component.scss +0 -0
- package/src/lib/components/number-input/number-input.component.ts +0 -80
- package/src/lib/components/page-header/index.ts +0 -1
- package/src/lib/components/page-header/page-header.component.html +0 -3
- package/src/lib/components/page-header/page-header.component.scss +0 -11
- package/src/lib/components/page-header/page-header.component.spec.ts +0 -21
- package/src/lib/components/page-header/page-header.component.ts +0 -27
- package/src/lib/components/password/index.ts +0 -1
- package/src/lib/components/password/password.component.html +0 -31
- package/src/lib/components/password/password.component.scss +0 -0
- package/src/lib/components/password/password.component.spec.ts +0 -21
- package/src/lib/components/password/password.component.ts +0 -83
- package/src/lib/components/radiobutton/index.ts +0 -1
- package/src/lib/components/radiobutton/radiobutton.component.html +0 -23
- package/src/lib/components/radiobutton/radiobutton.component.scss +0 -0
- package/src/lib/components/radiobutton/radiobutton.component.ts +0 -61
- package/src/lib/components/search/index.ts +0 -1
- package/src/lib/components/search/search.component.html +0 -23
- package/src/lib/components/search/search.component.scss +0 -0
- package/src/lib/components/search/search.component.ts +0 -45
- package/src/lib/components/section/index.ts +0 -1
- package/src/lib/components/section/section.component.html +0 -26
- package/src/lib/components/section/section.component.scss +0 -0
- package/src/lib/components/section/section.component.ts +0 -55
- package/src/lib/components/shared-components/action-button-group/action-button-group.component.html +0 -25
- 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 +0 -21
- package/src/lib/components/shared-components/action-button-group/action-button-group.component.ts +0 -111
- package/src/lib/components/shared-components/action-button-group/components/action-button/action-button.component.html +0 -10
- 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 +0 -21
- package/src/lib/components/shared-components/action-button-group/components/action-button/action-button.component.ts +0 -69
- package/src/lib/components/shared-components/action-button-group/index.ts +0 -2
- package/src/lib/components/shared-components/dynamic-component/dynamic-component-factory.service.ts +0 -142
- package/src/lib/components/shared-components/dynamic-component/dynamic-component.component.ts +0 -56
- package/src/lib/components/shared-components/dynamic-component/index.ts +0 -2
- package/src/lib/components/shared-components/generic-field/generic-field.component.html +0 -98
- package/src/lib/components/shared-components/generic-field/generic-field.component.spec.ts +0 -21
- package/src/lib/components/shared-components/generic-field/generic-field.component.ts +0 -90
- package/src/lib/components/shared-components/generic-field/index.ts +0 -1
- package/src/lib/components/shared-components/generic-form/generic-form.component.html +0 -46
- package/src/lib/components/shared-components/generic-form/generic-form.component.spec.ts +0 -21
- package/src/lib/components/shared-components/generic-form/generic-form.component.ts +0 -56
- package/src/lib/components/shared-components/generic-form/generic-form.model.spec.ts +0 -82
- package/src/lib/components/shared-components/generic-form/generic-form.model.ts +0 -68
- package/src/lib/components/shared-components/generic-form/index.ts +0 -2
- package/src/lib/components/shared-components/index.ts +0 -4
- package/src/lib/components/side-menu/index.ts +0 -2
- package/src/lib/components/side-menu/side-menu.component.html +0 -22
- package/src/lib/components/side-menu/side-menu.component.scss +0 -17
- package/src/lib/components/side-menu/side-menu.component.ts +0 -42
- package/src/lib/components/side-menu/side-menu.module.ts +0 -56
- package/src/lib/components/snackbar/index.ts +0 -2
- package/src/lib/components/snackbar/services/snackbar.service.ts +0 -73
- package/src/lib/components/snackbar/snackbar.component.html +0 -14
- package/src/lib/components/snackbar/snackbar.component.scss +0 -0
- package/src/lib/components/snackbar/snackbar.component.spec.ts +0 -21
- package/src/lib/components/snackbar/snackbar.component.ts +0 -44
- package/src/lib/components/snackbar/snackbar.model.ts +0 -10
- package/src/lib/components/stepper/index.ts +0 -1
- package/src/lib/components/stepper/stepper.component.html +0 -35
- package/src/lib/components/stepper/stepper.component.scss +0 -9
- package/src/lib/components/stepper/stepper.component.ts +0 -60
- package/src/lib/components/switch/index.ts +0 -1
- package/src/lib/components/switch/switch.component.html +0 -16
- package/src/lib/components/switch/switch.component.scss +0 -0
- package/src/lib/components/switch/switch.component.ts +0 -39
- package/src/lib/components/tab-view/index.ts +0 -2
- package/src/lib/components/tab-view/tab-view-item.component.ts +0 -23
- package/src/lib/components/tab-view/tab-view.component.html +0 -51
- package/src/lib/components/tab-view/tab-view.component.scss +0 -43
- package/src/lib/components/tab-view/tab-view.component.ts +0 -64
- package/src/lib/components/tab-view/tab-view.module.ts +0 -25
- package/src/lib/components/table/index.ts +0 -1
- package/src/lib/components/table/table-pagination-info.component.html +0 -9
- package/src/lib/components/table/table-pagination-info.component.ts +0 -22
- package/src/lib/components/table/table.component.html +0 -199
- package/src/lib/components/table/table.component.scss +0 -192
- package/src/lib/components/table/table.component.ts +0 -390
- package/src/lib/components/table/table.model.ts +0 -17
- package/src/lib/components/table/table.models.ts +0 -12
- package/src/lib/components/tag/index.ts +0 -3
- package/src/lib/components/tag/tag.component.html +0 -12
- package/src/lib/components/tag/tag.component.scss +0 -4
- package/src/lib/components/tag/tag.component.ts +0 -44
- package/src/lib/components/tag/tag.model.ts +0 -7
- package/src/lib/components/textarea/index.ts +0 -1
- package/src/lib/components/textarea/textarea.component.html +0 -50
- package/src/lib/components/textarea/textarea.component.scss +0 -0
- package/src/lib/components/textarea/textarea.component.ts +0 -77
- package/src/lib/components/textfield/index.ts +0 -1
- package/src/lib/components/textfield/textfield.component.html +0 -34
- package/src/lib/components/textfield/textfield.component.scss +0 -0
- package/src/lib/components/textfield/textfield.component.ts +0 -112
- package/src/lib/components/tooltip/index.ts +0 -1
- package/src/lib/components/tooltip/tooltip.component.html +0 -9
- package/src/lib/components/tooltip/tooltip.component.ts +0 -19
- package/src/lib/icons.ts +0 -36
- package/src/lib/index.ts +0 -5
- package/src/lib/init.service.ts +0 -11
- package/src/lib/interceptors/http-error-message.interceptor.ts +0 -45
- package/src/lib/pages/bad-request-page/bad-request-page.component.html +0 -5
- package/src/lib/pages/bad-request-page/bad-request-page.component.scss +0 -0
- package/src/lib/pages/bad-request-page/bad-request-page.component.ts +0 -14
- package/src/lib/pages/error-page/error-page.component.html +0 -5
- package/src/lib/pages/error-page/error-page.component.scss +0 -0
- package/src/lib/pages/error-page/error-page.component.ts +0 -31
- package/src/lib/pages/error-page/error-page.constants.ts +0 -19
- package/src/lib/pages/index.ts +0 -3
- package/src/lib/pages/internal-server-error-page/internal-server-error-page.component.html +0 -5
- package/src/lib/pages/internal-server-error-page/internal-server-error-page.component.scss +0 -0
- package/src/lib/pages/internal-server-error-page/internal-server-error-page.component.ts +0 -15
- package/src/lib/pages/not-authenticated/index.ts +0 -1
- package/src/lib/pages/not-authenticated/not-authenticated.component.html +0 -5
- package/src/lib/pages/not-authenticated/not-authenticated.component.ts +0 -13
- package/src/lib/pages/not-authorized/index.ts +0 -1
- package/src/lib/pages/not-authorized/not-authorized.component.html +0 -5
- package/src/lib/pages/not-authorized/not-authorized.component.ts +0 -17
- package/src/lib/pages/not-found/index.ts +0 -1
- package/src/lib/pages/not-found/not-found.component.html +0 -5
- package/src/lib/pages/not-found/not-found.component.ts +0 -17
- package/src/lib/pages/not-found-page/not-found-page.component.html +0 -6
- 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.ts +0 -15
- package/src/lib/pipes/color/color.pipe.ts +0 -24
- package/src/lib/pipes/index.ts +0 -3
- package/src/lib/pipes/multiselect/multiselect-options.pipe.ts +0 -61
- package/src/lib/pipes/size/size.pipe.ts +0 -24
- package/src/test-setup.ts +0 -8
- package/tsconfig.json +0 -30
- package/tsconfig.lib.json +0 -17
- package/tsconfig.lib.prod.json +0 -9
- package/tsconfig.spec.json +0 -16
- /package/{src → styles}/sass/foundations/_colors.scss +0 -0
- /package/{src → styles}/sass/foundations/index.scss +0 -0
- /package/{src → styles}/sass/header.css +0 -0
- /package/{src → styles}/sass/header.scss +0 -0
- /package/{src → styles}/sass/integrations/_bootstrap.scss +0 -0
- /package/{src → styles}/sass/integrations/index.scss +0 -0
- /package/{src → styles}/sass/main.scss +0 -0
- /package/{src → styles}/sass/overrides/_gov.scss +0 -0
- /package/{src → styles}/sass/overrides/index.scss +0 -0
- /package/{src → styles}/sass/scrollbar.scss +0 -0
- /package/{src → styles}/sass/tokens/_theme-dark.scss +0 -0
- /package/{src → styles}/sass/tokens/_theme-light.scss +0 -0
- /package/{src → styles}/sass/tokens/index.scss +0 -0
- /package/{src → styles}/sass/utils/_table_filter.scss +0 -0
- /package/{src → styles}/sass/utils/_utils.scss +0 -0
- /package/{src → styles}/sass/utils/index.scss +0 -0
- /package/{src → styles}/sass/vendors/_bootstrap.scss +0 -0
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
<gov-dropdown position="left">
|
|
2
|
-
<v-button
|
|
3
|
-
[label]="label()"
|
|
4
|
-
[icon]="icon()"
|
|
5
|
-
[rounded]="rounded() ?? false"
|
|
6
|
-
[outlined]="outlined() ?? false"
|
|
7
|
-
[raised]="raised() ?? false"
|
|
8
|
-
[severity]="severity()"
|
|
9
|
-
[type]="type()"
|
|
10
|
-
[size]="size()"
|
|
11
|
-
/>
|
|
12
|
-
|
|
13
|
-
@if (items()?.length) {
|
|
14
|
-
<ul slot="list">
|
|
15
|
-
@for (item of items(); track item.id) {
|
|
16
|
-
<li>
|
|
17
|
-
<v-button
|
|
18
|
-
class="w-100"
|
|
19
|
-
[label]="item.label"
|
|
20
|
-
[icon]="item.icon"
|
|
21
|
-
[severity]="$any('normal')"
|
|
22
|
-
[size]="'medium'"
|
|
23
|
-
[type]="type()"
|
|
24
|
-
(click)="fireClickItem(item)"
|
|
25
|
-
/>
|
|
26
|
-
</li>
|
|
27
|
-
}
|
|
28
|
-
</ul>
|
|
29
|
-
}
|
|
30
|
-
</gov-dropdown>
|
|
31
|
-
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { Component, input, output } from "@angular/core";
|
|
2
|
-
import { GovDesignSystemModule } from "@gov-design-system-ce/angular";
|
|
3
|
-
import { DropdownButtonCore, DROPDOWN_BUTTON_COMPONENT_TOKEN, ButtonCore, ControlSeverityType, ControlSeverity, FieldSizeType, MenuItem, GovButtonTypeType, GovButtonType } from "@verisoft/ui-core";
|
|
4
|
-
import { ButtonComponent } from "../button";
|
|
5
|
-
|
|
6
|
-
@Component({
|
|
7
|
-
selector: 'v-dropdown-button',
|
|
8
|
-
templateUrl: './dropdown-button.component.html',
|
|
9
|
-
imports: [ GovDesignSystemModule, ButtonComponent],
|
|
10
|
-
providers: [
|
|
11
|
-
{ provide: DROPDOWN_BUTTON_COMPONENT_TOKEN, useExisting: DropdownButtonComponent }
|
|
12
|
-
]
|
|
13
|
-
})
|
|
14
|
-
export class DropdownButtonComponent implements DropdownButtonCore {
|
|
15
|
-
label = input<string | undefined>();
|
|
16
|
-
icon = input<string | undefined>();
|
|
17
|
-
rounded = input<boolean | undefined>(false);
|
|
18
|
-
raised = input<boolean | undefined>(false);
|
|
19
|
-
outlined = input<boolean | undefined>(false);
|
|
20
|
-
severity = input<ControlSeverityType | undefined>(ControlSeverity.primary);
|
|
21
|
-
size = input<FieldSizeType | undefined>();
|
|
22
|
-
type = input<GovButtonTypeType>(GovButtonType.solid);
|
|
23
|
-
items = input<MenuItem[] | undefined>(undefined);
|
|
24
|
-
|
|
25
|
-
fireClick = output<MenuItem>();
|
|
26
|
-
|
|
27
|
-
fireClickItem(item: MenuItem): void {
|
|
28
|
-
if (item.command) {
|
|
29
|
-
item.command();
|
|
30
|
-
} else {
|
|
31
|
-
this.fireClick.emit(item);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './dropdown-button.component';
|
|
File without changes
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
describe('Extract first key from errors object', () => {
|
|
2
|
-
it('should return the first key from an object with multiple keys', () => {
|
|
3
|
-
const errors = { name: 'Required', email: 'Invalid' };
|
|
4
|
-
const key = Object.keys(errors)[0];
|
|
5
|
-
expect(key).toBe('name');
|
|
6
|
-
});
|
|
7
|
-
|
|
8
|
-
it('should return undefined for an empty object', () => {
|
|
9
|
-
const errors = {};
|
|
10
|
-
const key = Object.keys(errors)[0];
|
|
11
|
-
expect(key).toBeUndefined();
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
it('should return the only key in a single-key object', () => {
|
|
15
|
-
const errors = { password: 'Too short' };
|
|
16
|
-
const key = Object.keys(errors)[0];
|
|
17
|
-
expect(key).toBe('password');
|
|
18
|
-
});
|
|
19
|
-
});
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { CommonModule } from "@angular/common";
|
|
2
|
-
import { Component, inject, Input, } from "@angular/core";
|
|
3
|
-
import { NgControl, ValidationErrors } from "@angular/forms";
|
|
4
|
-
import { GovDesignSystemModule } from '@gov-design-system-ce/angular';
|
|
5
|
-
import { ERROR_PROVIDER_TOKEN } from "@verisoft/core";
|
|
6
|
-
import { SlotPosition, SlotPositionType } from "@verisoft/ui-core";
|
|
7
|
-
import { Observable } from "rxjs";
|
|
8
|
-
import { Icons } from "../../icons";
|
|
9
|
-
|
|
10
|
-
@Component({
|
|
11
|
-
selector: "v-validation-message",
|
|
12
|
-
templateUrl: "./error.component.html",
|
|
13
|
-
styleUrl: "./error.component.scss",
|
|
14
|
-
imports: [CommonModule, GovDesignSystemModule]
|
|
15
|
-
})
|
|
16
|
-
export class ErrorComponent {
|
|
17
|
-
@Input({ required: true }) ngControl?: NgControl;
|
|
18
|
-
|
|
19
|
-
@Input() errorSlot: SlotPositionType = SlotPosition.bottom
|
|
20
|
-
|
|
21
|
-
@Input() messageSlot: SlotPositionType = SlotPosition.bottom
|
|
22
|
-
|
|
23
|
-
readonly errorService = inject(ERROR_PROVIDER_TOKEN);
|
|
24
|
-
icons = Icons
|
|
25
|
-
|
|
26
|
-
getErrorMessage(errors: ValidationErrors): Observable<string | undefined> {
|
|
27
|
-
return this.errorService.mapError(errors);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './error.component';
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { Directive, Input } from '@angular/core';
|
|
2
|
-
import { GenericFieldType, GenericFieldTypeType, TableColumnDirective } from '@verisoft/ui-core';
|
|
3
|
-
import { FEATURE_LIST_COLUMN_PROVIDER, FeatureListColumnDefinition, FeatureListColumnProvider } from '../feature-list-page.model';
|
|
4
|
-
|
|
5
|
-
@Directive({
|
|
6
|
-
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
7
|
-
selector: 'v-feature-list-column',
|
|
8
|
-
standalone: true,
|
|
9
|
-
providers: [
|
|
10
|
-
{
|
|
11
|
-
provide: FEATURE_LIST_COLUMN_PROVIDER,
|
|
12
|
-
useExisting: FeatureListColumnDirective,
|
|
13
|
-
multi: true,
|
|
14
|
-
},
|
|
15
|
-
],
|
|
16
|
-
})
|
|
17
|
-
export class FeatureListColumnDirective<T>
|
|
18
|
-
extends TableColumnDirective<T>
|
|
19
|
-
implements FeatureListColumnProvider<T>
|
|
20
|
-
{
|
|
21
|
-
@Input() filter = false;
|
|
22
|
-
|
|
23
|
-
@Input() type: GenericFieldTypeType = GenericFieldType.text;
|
|
24
|
-
|
|
25
|
-
override getDefinition(): FeatureListColumnDefinition<T> {
|
|
26
|
-
const definition = super.getDefinition() as FeatureListColumnDefinition<T>;
|
|
27
|
-
definition.filter = this.filter;
|
|
28
|
-
definition.type = this.type;
|
|
29
|
-
definition.format = this.format;
|
|
30
|
-
return definition;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Directive } from '@angular/core';
|
|
2
|
-
import { FilterFieldDirective } from '../../filter';
|
|
3
|
-
|
|
4
|
-
@Directive({
|
|
5
|
-
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
6
|
-
selector: 'v-feature-list-filter-field',
|
|
7
|
-
})
|
|
8
|
-
export class FeatureListFilterFieldDirective extends FilterFieldDirective {}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Pipe, PipeTransform } from "@angular/core";
|
|
2
|
-
import { GenericFieldDefinition, GenericFieldType } from "@verisoft/ui-core";
|
|
3
|
-
import { FeatureListColumnDefinition } from "./feature-list-page.model";
|
|
4
|
-
|
|
5
|
-
@Pipe({
|
|
6
|
-
name: 'featureListColumn',
|
|
7
|
-
})
|
|
8
|
-
export class FeatureListFilterPipe<T> implements PipeTransform {
|
|
9
|
-
transform(value: FeatureListColumnDefinition<T>[] | undefined): GenericFieldDefinition[] | undefined {
|
|
10
|
-
if (!value){
|
|
11
|
-
return undefined;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
return value.filter(x => x.filter).map((x, index) => ({
|
|
15
|
-
name: x.id,
|
|
16
|
-
label: typeof x.headerName === 'function'? x.headerName(x.id, index) : x.headerName ?? '',
|
|
17
|
-
type: x.type as GenericFieldType,
|
|
18
|
-
}));
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Component } from '@angular/core';
|
|
2
|
-
import { ActivatedRoute } from '@angular/router';
|
|
3
|
-
import {
|
|
4
|
-
FEATURE_LIST_PAGE_CONFIG_PROPERTY,
|
|
5
|
-
FeatureListPageConfig,
|
|
6
|
-
} from './feature-list-page.model';
|
|
7
|
-
import { FeatureListComponent } from './feature-list.component';
|
|
8
|
-
|
|
9
|
-
@Component({
|
|
10
|
-
selector: 'v-feature-list-page',
|
|
11
|
-
imports: [FeatureListComponent],
|
|
12
|
-
template: `
|
|
13
|
-
<v-feature-list
|
|
14
|
-
[title]="config.title"
|
|
15
|
-
[tableName]="config.tableName"
|
|
16
|
-
[showAdd]="config.showAdd ?? true"
|
|
17
|
-
[showDownload]="config.showDownload ?? true"
|
|
18
|
-
[showDelete]="config.showDelete ?? true"
|
|
19
|
-
>
|
|
20
|
-
</v-feature-list>
|
|
21
|
-
`
|
|
22
|
-
})
|
|
23
|
-
export class FeatureListPageComponent {
|
|
24
|
-
config!: FeatureListPageConfig;
|
|
25
|
-
|
|
26
|
-
constructor(activatedRoute: ActivatedRoute) {
|
|
27
|
-
this.config =
|
|
28
|
-
activatedRoute.snapshot.data[FEATURE_LIST_PAGE_CONFIG_PROPERTY];
|
|
29
|
-
}
|
|
30
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { InjectionToken } from '@angular/core';
|
|
2
|
-
import { Route } from '@angular/router';
|
|
3
|
-
import { ColumnDefinition, GenericFieldTypeType } from '@verisoft/ui-core';
|
|
4
|
-
import { FeatureListPageComponent } from './feature-list-page.component';
|
|
5
|
-
|
|
6
|
-
export interface FeatureListPageConfig {
|
|
7
|
-
title: string;
|
|
8
|
-
datasource: string;
|
|
9
|
-
tableName: string;
|
|
10
|
-
showAdd?: boolean;
|
|
11
|
-
showDownload?: boolean;
|
|
12
|
-
showDelete?: boolean;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export const FEATURE_LIST_PAGE_CONFIG_PROPERTY = 'feature_list_config';
|
|
16
|
-
|
|
17
|
-
export function addFeatureListPage(
|
|
18
|
-
value: Partial<Route> & { config: FeatureListPageConfig }
|
|
19
|
-
): Route {
|
|
20
|
-
const { config, ...route } = value;
|
|
21
|
-
return {
|
|
22
|
-
component: FeatureListPageComponent,
|
|
23
|
-
...route,
|
|
24
|
-
data: {
|
|
25
|
-
[FEATURE_LIST_PAGE_CONFIG_PROPERTY]: config,
|
|
26
|
-
...(route.data ?? {}),
|
|
27
|
-
},
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export interface FeatureListColumnDefinition<T> extends ColumnDefinition<T> {
|
|
32
|
-
filter?: boolean;
|
|
33
|
-
type?: GenericFieldTypeType;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export const FEATURE_LIST_COLUMN_PROVIDER = new InjectionToken(
|
|
37
|
-
'FEATURE_LIST_COLUMN_PROVIDER'
|
|
38
|
-
);
|
|
39
|
-
|
|
40
|
-
export interface FeatureListColumnProvider<T> {
|
|
41
|
-
getDefinition: () => FeatureListColumnDefinition<T>;
|
|
42
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
<div class="feature-list__container full-height-container">
|
|
2
|
-
<v-filter
|
|
3
|
-
#filter
|
|
4
|
-
[title]="title"
|
|
5
|
-
[total]="tableTotal"
|
|
6
|
-
[recordsText]="recordsText"
|
|
7
|
-
[fields]="columns | featureListColumn"
|
|
8
|
-
[filters]="filters"
|
|
9
|
-
[fulltextFieldName]="fulltextFieldName"
|
|
10
|
-
[showFulltext]="showFulltext"
|
|
11
|
-
[showFilters]="showExtendedFilter"
|
|
12
|
-
[applyLabel]="applyLabel"
|
|
13
|
-
[clearLabel]="clearLabel"
|
|
14
|
-
[buttonType]="buttonType"
|
|
15
|
-
[buttonOutlined]="buttonOutlined"
|
|
16
|
-
>
|
|
17
|
-
<v-action-button-group
|
|
18
|
-
[maxItems]="maxVisibleActions"
|
|
19
|
-
[maxItemsMobile]="maxVisibleMobileActions"
|
|
20
|
-
>
|
|
21
|
-
@if (showAdd) {
|
|
22
|
-
<v-action-button
|
|
23
|
-
[icon]="icons.add"
|
|
24
|
-
label="Add"
|
|
25
|
-
[disabled]="!canAdd"
|
|
26
|
-
(click)="addClick.emit()"
|
|
27
|
-
/>
|
|
28
|
-
} @if (showDelete){
|
|
29
|
-
<v-action-button
|
|
30
|
-
[icon]="icons.delete"
|
|
31
|
-
label="Delete"
|
|
32
|
-
[disabled]="!canDelete || !selection.length"
|
|
33
|
-
(click)="startDeleteItems()"
|
|
34
|
-
/>
|
|
35
|
-
} @if (showDownload){
|
|
36
|
-
<v-action-button
|
|
37
|
-
[icon]="icons.download"
|
|
38
|
-
label="Download"
|
|
39
|
-
[disabled]="!canDownload"
|
|
40
|
-
(click)="startDownload()"
|
|
41
|
-
/>
|
|
42
|
-
}
|
|
43
|
-
</v-action-button-group>
|
|
44
|
-
</v-filter>
|
|
45
|
-
<div class="feature-list__table-container full-height-container">
|
|
46
|
-
<div class="full-height-container">
|
|
47
|
-
<v-table
|
|
48
|
-
#table
|
|
49
|
-
useDatasource
|
|
50
|
-
useFilter
|
|
51
|
-
[filterComponent]="filter"
|
|
52
|
-
class="full-height-container"
|
|
53
|
-
[selectionMode]="selectionMode"
|
|
54
|
-
[tableName]="tableName"
|
|
55
|
-
[autoBind]="true"
|
|
56
|
-
[datasource]="datasource"
|
|
57
|
-
[columns]="columns"
|
|
58
|
-
[extraFilter]="extraFilter"
|
|
59
|
-
[maximumColumnLength]="maximumColumnLength"
|
|
60
|
-
[disableCustomClicks]="disableCustomClicks"
|
|
61
|
-
(selectionChange)="selectItems($event)"
|
|
62
|
-
>
|
|
63
|
-
<ng-content />
|
|
64
|
-
</v-table>
|
|
65
|
-
</div>
|
|
66
|
-
</div>
|
|
67
|
-
</div>
|