@verisoft/ui-primeng 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-primeng.mjs +3003 -0
- package/fesm2022/verisoft-ui-primeng.mjs.map +1 -0
- package/index.d.ts +752 -0
- package/package.json +18 -6
- package/.eslintrc.json +0 -43
- package/assets/.gitkeep +0 -0
- package/jest.config.ts +0 -22
- package/ng-package.json +0 -14
- package/project.json +0 -36
- package/src/index.ts +0 -34
- package/src/lib/components/breadcrumb/breadcrumb.component.html +0 -11
- package/src/lib/components/breadcrumb/breadcrumb.component.scss +0 -18
- package/src/lib/components/breadcrumb/breadcrumb.component.spec.ts +0 -21
- package/src/lib/components/breadcrumb/breadcrumb.component.stories.ts +0 -36
- package/src/lib/components/breadcrumb/breadcrumb.component.ts +0 -27
- package/src/lib/components/breadcrumb/breadcrumb.pipe.ts +0 -13
- package/src/lib/components/breadcrumb/index.ts +0 -1
- package/src/lib/components/button/button-severity.pipe.ts +0 -20
- package/src/lib/components/button/button.component.html +0 -20
- package/src/lib/components/button/button.component.scss +0 -0
- package/src/lib/components/button/button.component.spec.ts +0 -21
- package/src/lib/components/button/button.component.ts +0 -49
- package/src/lib/components/button/index.ts +0 -1
- package/src/lib/components/calendar/calendar.component.html +0 -53
- package/src/lib/components/calendar/calendar.component.scss +0 -0
- package/src/lib/components/calendar/calendar.component.spec.ts +0 -21
- package/src/lib/components/calendar/calendar.component.ts +0 -70
- package/src/lib/components/calendar/index.ts +0 -1
- package/src/lib/components/checkbox/checkbox.component.html +0 -20
- package/src/lib/components/checkbox/checkbox.component.scss +0 -15
- package/src/lib/components/checkbox/checkbox.component.spec.ts +0 -21
- package/src/lib/components/checkbox/checkbox.component.stories.ts +0 -72
- package/src/lib/components/checkbox/checkbox.component.ts +0 -46
- package/src/lib/components/checkbox/index.ts +0 -1
- package/src/lib/components/confirm-dialog/confirm-dialog.component.html +0 -51
- package/src/lib/components/confirm-dialog/confirm-dialog.component.scss +0 -3
- package/src/lib/components/confirm-dialog/confirm-dialog.component.spec.ts +0 -21
- package/src/lib/components/confirm-dialog/confirm-dialog.component.stories.ts +0 -74
- package/src/lib/components/confirm-dialog/confirm-dialog.component.ts +0 -73
- package/src/lib/components/confirm-dialog/index.ts +0 -1
- package/src/lib/components/dropdown/dropdown.component.html +0 -93
- package/src/lib/components/dropdown/dropdown.component.scss +0 -16
- package/src/lib/components/dropdown/dropdown.component.spec.ts +0 -21
- package/src/lib/components/dropdown/dropdown.component.ts +0 -139
- package/src/lib/components/dropdown/index.ts +0 -1
- package/src/lib/components/dropdown-button/dropdown-button.component.html +0 -1
- package/src/lib/components/dropdown-button/dropdown-button.component.ts +0 -20
- package/src/lib/components/dropdown-button/index.ts +0 -1
- package/src/lib/components/errors/error.component.html +0 -7
- package/src/lib/components/errors/error.component.scss +0 -3
- package/src/lib/components/errors/error.component.ts +0 -34
- 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 -21
- package/src/lib/components/feature-list/feature-list-page.component.ts +0 -32
- package/src/lib/components/feature-list/feature-list-page.model.ts +0 -42
- package/src/lib/components/feature-list/feature-list.component.html +0 -59
- package/src/lib/components/feature-list/feature-list.component.scss +0 -10
- package/src/lib/components/feature-list/feature-list.component.ts +0 -341
- package/src/lib/components/feature-list/index.ts +0 -5
- package/src/lib/components/filter/directives/filter-field.directive.ts +0 -34
- package/src/lib/components/filter/filter.component.html +0 -68
- package/src/lib/components/filter/filter.component.scss +0 -0
- 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 -281
- 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 -42
- 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.stories.ts +0 -69
- package/src/lib/components/form-field/form-field.component.ts +0 -37
- package/src/lib/components/form-field/index.ts +0 -1
- package/src/lib/components/header/header.component.html +0 -84
- package/src/lib/components/header/header.component.scss +0 -0
- package/src/lib/components/header/header.component.spec.ts +0 -21
- package/src/lib/components/header/header.component.stories.ts +0 -24
- package/src/lib/components/header/header.component.ts +0 -65
- package/src/lib/components/header/index.ts +0 -2
- package/src/lib/components/header/services/header-provider.service.ts +0 -15
- package/src/lib/components/icon/icon.component.html +0 -2
- package/src/lib/components/icon/icon.component.scss +0 -51
- package/src/lib/components/icon/icon.component.ts +0 -86
- package/src/lib/components/icon/index.ts +0 -2
- package/src/lib/components/input-group/index.ts +0 -1
- package/src/lib/components/input-group/input-group.component.html +0 -34
- package/src/lib/components/input-group/input-group.component.spec.ts +0 -21
- package/src/lib/components/input-group/input-group.component.ts +0 -58
- package/src/lib/components/loader/index.ts +0 -1
- package/src/lib/components/loader/loader.component.html +0 -5
- 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 -16
- package/src/lib/components/multiselect/index.ts +0 -1
- package/src/lib/components/multiselect/multiselect.component.html +0 -67
- 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 -120
- package/src/lib/components/number-input/index.ts +0 -1
- package/src/lib/components/number-input/number-input.component.html +0 -22
- package/src/lib/components/number-input/number-input.component.spec.ts +0 -21
- package/src/lib/components/number-input/number-input.component.ts +0 -55
- package/src/lib/components/page-header/index.ts +0 -1
- package/src/lib/components/page-header/page-header.component.html +0 -35
- package/src/lib/components/page-header/page-header.component.scss +0 -0
- package/src/lib/components/page-header/page-header.component.spec.ts +0 -21
- package/src/lib/components/page-header/page-header.component.ts +0 -31
- package/src/lib/components/password/index.ts +0 -1
- package/src/lib/components/password/password.component.html +0 -24
- 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 -56
- package/src/lib/components/radiobutton/index.ts +0 -1
- package/src/lib/components/radiobutton/radiobutton.component.html +0 -34
- package/src/lib/components/radiobutton/radiobutton.component.scss +0 -6
- package/src/lib/components/radiobutton/radiobutton.component.spec.ts +0 -21
- package/src/lib/components/radiobutton/radiobutton.component.stories.ts +0 -71
- package/src/lib/components/radiobutton/radiobutton.component.ts +0 -61
- package/src/lib/components/section/index.ts +0 -1
- package/src/lib/components/section/section.component.html +0 -25
- package/src/lib/components/section/section.component.scss +0 -0
- package/src/lib/components/section/section.component.spec.ts +0 -21
- package/src/lib/components/section/section.component.ts +0 -31
- package/src/lib/components/shared-components/.eslintrc.json +0 -42
- 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 -53
- package/src/lib/components/side-menu/side-menu.component.scss +0 -0
- package/src/lib/components/side-menu/side-menu.component.spec.ts +0 -21
- package/src/lib/components/side-menu/side-menu.component.ts +0 -96
- package/src/lib/components/side-menu/side-menu.module.ts +0 -66
- package/src/lib/components/slider/index.ts +0 -1
- package/src/lib/components/slider/slider.component.html +0 -19
- package/src/lib/components/slider/slider.component.spec.ts +0 -21
- package/src/lib/components/slider/slider.component.ts +0 -56
- package/src/lib/components/snackbar/index.ts +0 -2
- package/src/lib/components/snackbar/services/snackbar.service.ts +0 -45
- package/src/lib/components/snackbar/snackbar.component.html +0 -3
- 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.stories.ts +0 -70
- package/src/lib/components/snackbar/snackbar.component.ts +0 -25
- 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.spec.ts +0 -21
- package/src/lib/components/stepper/stepper.component.ts +0 -39
- package/src/lib/components/switch/index.ts +0 -1
- package/src/lib/components/switch/switch.component.html +0 -18
- package/src/lib/components/switch/switch.component.scss +0 -0
- package/src/lib/components/switch/switch.component.spec.ts +0 -21
- package/src/lib/components/switch/switch.component.stories.ts +0 -65
- package/src/lib/components/switch/switch.component.ts +0 -52
- package/src/lib/components/tab-view/index.ts +0 -2
- package/src/lib/components/tab-view/tab-view-item.component.ts +0 -22
- package/src/lib/components/tab-view/tab-view.component.html +0 -41
- package/src/lib/components/tab-view/tab-view.component.ts +0 -55
- package/src/lib/components/table/index.ts +0 -1
- package/src/lib/components/table/table-filter.pipe.ts +0 -59
- package/src/lib/components/table/table.component.html +0 -127
- package/src/lib/components/table/table.component.scss +0 -11
- package/src/lib/components/table/table.component.spec.ts +0 -21
- package/src/lib/components/table/table.component.stories.ts +0 -55
- package/src/lib/components/table/table.component.ts +0 -288
- package/src/lib/components/table/table.models.ts +0 -26
- package/src/lib/components/tag/index.ts +0 -2
- package/src/lib/components/tag/tag.component.html +0 -12
- package/src/lib/components/tag/tag.component.scss +0 -33
- package/src/lib/components/tag/tag.component.ts +0 -83
- package/src/lib/components/textarea/index.ts +0 -1
- package/src/lib/components/textarea/textarea.component.html +0 -40
- package/src/lib/components/textarea/textarea.component.scss +0 -5
- package/src/lib/components/textarea/textarea.component.spec.ts +0 -21
- package/src/lib/components/textarea/textarea.component.stories.ts +0 -98
- package/src/lib/components/textarea/textarea.component.ts +0 -62
- package/src/lib/components/textfield/index.ts +0 -1
- package/src/lib/components/textfield/textfield.component.html +0 -82
- package/src/lib/components/textfield/textfield.component.scss +0 -23
- package/src/lib/components/textfield/textfield.component.spec.ts +0 -21
- package/src/lib/components/textfield/textfield.component.stories.ts +0 -85
- package/src/lib/components/textfield/textfield.component.ts +0 -68
- package/src/lib/components/tooltip/index.ts +0 -1
- package/src/lib/components/tooltip/tooltip.component.html +0 -3
- package/src/lib/components/tooltip/tooltip.component.ts +0 -17
- package/src/lib/icons.ts +0 -36
- package/src/lib/interceptors/http-error-message.interceptor.ts +0 -35
- package/src/lib/pages/not-found-page/not-found-page.component.html +0 -26
- 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 +0 -21
- package/src/lib/pages/not-found-page/not-found-page.component.ts +0 -16
- package/src/tab-view.ts +0 -1
- package/src/test-setup.ts +0 -8
- package/tsconfig.json +0 -29
- package/tsconfig.lib.json +0 -18
- package/tsconfig.lib.prod.json +0 -9
- package/tsconfig.spec.json +0 -16
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
import { TableComponent } from './table.component';
|
|
3
|
-
|
|
4
|
-
describe('TableComponent', () => {
|
|
5
|
-
let component: TableComponent<any>;
|
|
6
|
-
let fixture: ComponentFixture<TableComponent<any>>;
|
|
7
|
-
|
|
8
|
-
beforeEach(async () => {
|
|
9
|
-
await TestBed.configureTestingModule({
|
|
10
|
-
imports: [TableComponent],
|
|
11
|
-
}).compileComponents();
|
|
12
|
-
|
|
13
|
-
fixture = TestBed.createComponent(TableComponent);
|
|
14
|
-
component = fixture.componentInstance;
|
|
15
|
-
fixture.detectChanges();
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it('should create', () => {
|
|
19
|
-
expect(component).toBeTruthy();
|
|
20
|
-
});
|
|
21
|
-
});
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/angular';
|
|
2
|
-
import { within, expect } from '@storybook/test';
|
|
3
|
-
import { DEFAULT_SEARCH_LIMIT } from '@verisoft/core';
|
|
4
|
-
import { TableComponent } from './table.component';
|
|
5
|
-
|
|
6
|
-
const meta: Meta<TableComponent<any>> = {
|
|
7
|
-
component: TableComponent,
|
|
8
|
-
title: 'TableComponent',
|
|
9
|
-
};
|
|
10
|
-
export default meta;
|
|
11
|
-
type Story = StoryObj<TableComponent<any>>;
|
|
12
|
-
|
|
13
|
-
export const Primary: Story = {
|
|
14
|
-
args: {
|
|
15
|
-
tableRepository: '',
|
|
16
|
-
total: 0,
|
|
17
|
-
loading: false,
|
|
18
|
-
scrollHeight: '100%',
|
|
19
|
-
scrollable: true,
|
|
20
|
-
pageSize: DEFAULT_SEARCH_LIMIT,
|
|
21
|
-
currentPage: 0,
|
|
22
|
-
showPaginator: true,
|
|
23
|
-
sortMultiple: false,
|
|
24
|
-
lazy: true,
|
|
25
|
-
multipleSelect: false,
|
|
26
|
-
autoIndex: false,
|
|
27
|
-
showPageSizePicker: true,
|
|
28
|
-
entityId: '',
|
|
29
|
-
columnDefinitions: [],
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export const Heading: Story = {
|
|
34
|
-
args: {
|
|
35
|
-
tableRepository: '',
|
|
36
|
-
total: 0,
|
|
37
|
-
loading: false,
|
|
38
|
-
scrollHeight: '100%',
|
|
39
|
-
scrollable: true,
|
|
40
|
-
pageSize: DEFAULT_SEARCH_LIMIT,
|
|
41
|
-
currentPage: 0,
|
|
42
|
-
showPaginator: true,
|
|
43
|
-
sortMultiple: false,
|
|
44
|
-
lazy: true,
|
|
45
|
-
multipleSelect: false,
|
|
46
|
-
autoIndex: false,
|
|
47
|
-
showPageSizePicker: true,
|
|
48
|
-
entityId: '',
|
|
49
|
-
columnDefinitions: [],
|
|
50
|
-
},
|
|
51
|
-
play: async ({ canvasElement }: any) => {
|
|
52
|
-
const canvas = within(canvasElement);
|
|
53
|
-
expect(canvas.getByText(/verisoft-table works!/gi)).toBeTruthy();
|
|
54
|
-
},
|
|
55
|
-
};
|
|
@@ -1,288 +0,0 @@
|
|
|
1
|
-
import { CommonModule } from '@angular/common';
|
|
2
|
-
import {
|
|
3
|
-
AfterViewInit,
|
|
4
|
-
ChangeDetectionStrategy,
|
|
5
|
-
ChangeDetectorRef,
|
|
6
|
-
Component,
|
|
7
|
-
ContentChild,
|
|
8
|
-
ContentChildren,
|
|
9
|
-
EventEmitter,
|
|
10
|
-
inject,
|
|
11
|
-
Input,
|
|
12
|
-
OnChanges,
|
|
13
|
-
Output,
|
|
14
|
-
QueryList,
|
|
15
|
-
SimpleChanges,
|
|
16
|
-
TemplateRef,
|
|
17
|
-
ViewChild,
|
|
18
|
-
ViewEncapsulation,
|
|
19
|
-
} from '@angular/core';
|
|
20
|
-
import { ActivatedRoute, Router, RouterModule } from '@angular/router';
|
|
21
|
-
import {
|
|
22
|
-
DEFAULT_SEARCH_LIMIT,
|
|
23
|
-
LazyLoadEvent,
|
|
24
|
-
Sort,
|
|
25
|
-
SortDirection,
|
|
26
|
-
SortDirectionType,
|
|
27
|
-
} from '@verisoft/core';
|
|
28
|
-
import {
|
|
29
|
-
ColumnDefinition,
|
|
30
|
-
ColumnModel,
|
|
31
|
-
ColumnProvider,
|
|
32
|
-
RowModel,
|
|
33
|
-
TABLE_COLUMN_PROVIDER,
|
|
34
|
-
TABLE_COMPONENT_TOKEN,
|
|
35
|
-
TableCore,
|
|
36
|
-
TableSelectionModeType,
|
|
37
|
-
} from '@verisoft/ui-core';
|
|
38
|
-
import { SortMeta } from 'primeng/api';
|
|
39
|
-
import { ButtonModule } from 'primeng/button';
|
|
40
|
-
import { RippleModule } from 'primeng/ripple';
|
|
41
|
-
import { Table, TableLazyLoadEvent, TableModule, TablePageEvent } from 'primeng/table';
|
|
42
|
-
import { Icons } from '../../icons';
|
|
43
|
-
import { TableFilterPipe } from './table-filter.pipe';
|
|
44
|
-
import { convertToFilter } from './table.models';
|
|
45
|
-
|
|
46
|
-
@Component({
|
|
47
|
-
selector: 'v-table',
|
|
48
|
-
imports: [
|
|
49
|
-
CommonModule,
|
|
50
|
-
TableModule,
|
|
51
|
-
RouterModule,
|
|
52
|
-
ButtonModule,
|
|
53
|
-
RippleModule,
|
|
54
|
-
TableFilterPipe,
|
|
55
|
-
],
|
|
56
|
-
providers: [
|
|
57
|
-
{
|
|
58
|
-
provide: TABLE_COMPONENT_TOKEN,
|
|
59
|
-
useExisting: TableComponent,
|
|
60
|
-
},
|
|
61
|
-
],
|
|
62
|
-
templateUrl: './table.component.html',
|
|
63
|
-
styleUrl: './table.component.scss',
|
|
64
|
-
encapsulation: ViewEncapsulation.None,
|
|
65
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
|
66
|
-
})
|
|
67
|
-
export class TableComponent<T>
|
|
68
|
-
implements AfterViewInit, OnChanges, TableCore<T>
|
|
69
|
-
{
|
|
70
|
-
@ContentChildren(TABLE_COLUMN_PROVIDER) viewColumns!: QueryList<
|
|
71
|
-
ColumnProvider<T>
|
|
72
|
-
>;
|
|
73
|
-
|
|
74
|
-
@ViewChild('table') table: Table | undefined;
|
|
75
|
-
|
|
76
|
-
@ContentChild('rowDetail', { static: false })
|
|
77
|
-
rowDetailTemplate!: TemplateRef<any>;
|
|
78
|
-
|
|
79
|
-
sorters!: Sort[];
|
|
80
|
-
|
|
81
|
-
@Input()
|
|
82
|
-
data!: T[];
|
|
83
|
-
|
|
84
|
-
@Input()
|
|
85
|
-
total = 0;
|
|
86
|
-
|
|
87
|
-
@Input() filter: Partial<T> | undefined;
|
|
88
|
-
|
|
89
|
-
@Input()
|
|
90
|
-
loading!: boolean;
|
|
91
|
-
|
|
92
|
-
@Input()
|
|
93
|
-
scrollable = true;
|
|
94
|
-
|
|
95
|
-
@Input()
|
|
96
|
-
pageSize = DEFAULT_SEARCH_LIMIT;
|
|
97
|
-
|
|
98
|
-
@Input()
|
|
99
|
-
currentPage!: number;
|
|
100
|
-
|
|
101
|
-
@Input()
|
|
102
|
-
showPaginator = true;
|
|
103
|
-
|
|
104
|
-
@Input()
|
|
105
|
-
sortMultiple = false;
|
|
106
|
-
|
|
107
|
-
@Input()
|
|
108
|
-
lazy = false;
|
|
109
|
-
|
|
110
|
-
@Input()
|
|
111
|
-
selectionMode: TableSelectionModeType | undefined;
|
|
112
|
-
|
|
113
|
-
@Input()
|
|
114
|
-
showPageSizePicker = true;
|
|
115
|
-
|
|
116
|
-
@Input()
|
|
117
|
-
entityKey: string | undefined;
|
|
118
|
-
|
|
119
|
-
@Input()
|
|
120
|
-
maximumColumnLength = 0;
|
|
121
|
-
|
|
122
|
-
@Input()
|
|
123
|
-
disableCustomClicks = false;
|
|
124
|
-
|
|
125
|
-
@Input()
|
|
126
|
-
set columns(value: ColumnDefinition<T>[]) {
|
|
127
|
-
this._columns = value;
|
|
128
|
-
this.tableColumns = (value ?? []).map((x) => new ColumnModel(x));
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
get columns(): ColumnDefinition<T>[] {
|
|
132
|
-
return this._columns;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
@Input() selection: T[] = [];
|
|
136
|
-
|
|
137
|
-
@Output()
|
|
138
|
-
pageSizeChange = new EventEmitter<number>();
|
|
139
|
-
|
|
140
|
-
@Output()
|
|
141
|
-
selectionChange = new EventEmitter<T[]>();
|
|
142
|
-
|
|
143
|
-
@Output()
|
|
144
|
-
pageChange = new EventEmitter<TablePageEvent>();
|
|
145
|
-
|
|
146
|
-
@Output()
|
|
147
|
-
sortChange = new EventEmitter<Sort[]>();
|
|
148
|
-
|
|
149
|
-
@Output()
|
|
150
|
-
lazyLoad = new EventEmitter<LazyLoadEvent>();
|
|
151
|
-
|
|
152
|
-
sorted!: boolean;
|
|
153
|
-
|
|
154
|
-
cdRef = inject(ChangeDetectorRef);
|
|
155
|
-
|
|
156
|
-
tableColumns: ColumnModel<T>[] = [];
|
|
157
|
-
|
|
158
|
-
tableRows: RowModel<T>[] = [];
|
|
159
|
-
|
|
160
|
-
tableSelection: RowModel<T>[] | RowModel<T> | undefined;
|
|
161
|
-
|
|
162
|
-
expandedRows = {};
|
|
163
|
-
|
|
164
|
-
expansionTemplate!: { template: TemplateRef<any> };
|
|
165
|
-
|
|
166
|
-
sortMeta: SortMeta[] | undefined;
|
|
167
|
-
|
|
168
|
-
sortSignleColumn: SortMeta | undefined;
|
|
169
|
-
|
|
170
|
-
globalFilterFields: string[] | undefined;
|
|
171
|
-
|
|
172
|
-
router = inject(Router);
|
|
173
|
-
|
|
174
|
-
route = inject(ActivatedRoute);
|
|
175
|
-
|
|
176
|
-
icons = Icons;
|
|
177
|
-
|
|
178
|
-
private _columns!: ColumnDefinition<T>[];
|
|
179
|
-
|
|
180
|
-
ngOnChanges(changes: SimpleChanges): void {
|
|
181
|
-
if (changes['data']) {
|
|
182
|
-
this.updateRowModels();
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
if (changes['selection'] || changes['data']) {
|
|
186
|
-
this.tableSelection = this.selection
|
|
187
|
-
? this.tableRows.filter((x) => this.selection.includes(x.row))
|
|
188
|
-
: undefined;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
if (changes['filter'] && !changes['filter'].isFirstChange()) {
|
|
192
|
-
this.globalFilterFields = this.columns.filter(x => x.id).map(x => 'row.' + x.id);
|
|
193
|
-
setTimeout(() => {
|
|
194
|
-
this.table?._filter();
|
|
195
|
-
}, 0);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
ngAfterViewInit(): void {
|
|
200
|
-
if (this.viewColumns?.length) {
|
|
201
|
-
const templateColumnModel = this.viewColumns
|
|
202
|
-
.toArray()
|
|
203
|
-
.map((provider) => new ColumnModel(provider.getDefinition()));
|
|
204
|
-
this.tableColumns = [...this.tableColumns, ...templateColumnModel];
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
this.expansionTemplate = {
|
|
208
|
-
template: this.rowDetailTemplate,
|
|
209
|
-
};
|
|
210
|
-
this.cdRef.detectChanges();
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
updateRowModels(): void {
|
|
214
|
-
this.tableRows = (this.data ?? []).map(
|
|
215
|
-
(x) => new RowModel(x, false, false)
|
|
216
|
-
);
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
pageChanged(page: TablePageEvent) {
|
|
220
|
-
this.pageChange.emit(page);
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
pageSizeChanged(pageSize: number) {
|
|
224
|
-
this.pageSizeChange.emit(pageSize);
|
|
225
|
-
this.pageSize = pageSize;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
sortChanged(event: SortMeta | { multisortmeta: SortMeta[] }) {
|
|
229
|
-
let eventEmiterArg: Sort[];
|
|
230
|
-
if ((<SortMeta>event).field) {
|
|
231
|
-
const singleEvent = <SortMeta>event;
|
|
232
|
-
eventEmiterArg = this.getSorts([singleEvent]) as Sort[];
|
|
233
|
-
this.sortMeta = undefined;
|
|
234
|
-
this.sortSignleColumn = singleEvent;
|
|
235
|
-
} else {
|
|
236
|
-
const multiEvent = <{ multisortmeta: SortMeta[] }>event;
|
|
237
|
-
eventEmiterArg = this.getSorts(multiEvent.multisortmeta) as Sort[];
|
|
238
|
-
this.sortMeta = multiEvent.multisortmeta;
|
|
239
|
-
this.sortSignleColumn = undefined;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
this.sortChange.emit(eventEmiterArg);
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
selectionChanged(event: RowModel<T>[] | RowModel<T>) {
|
|
246
|
-
this.tableSelection = event;
|
|
247
|
-
if (this.selectionMode) {
|
|
248
|
-
const eventArgArray = Array.isArray(event) ? event : [event];
|
|
249
|
-
const selection = event ? eventArgArray.map((x) => x.row) : [];
|
|
250
|
-
this.selectionChange.emit(selection);
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
fireLazyLoad(event: TableLazyLoadEvent) {
|
|
255
|
-
if (this.lazy) {
|
|
256
|
-
const sort = this.sortSignleColumn
|
|
257
|
-
? this.getSorts([this.sortSignleColumn])
|
|
258
|
-
: this.sortMeta
|
|
259
|
-
? this.getSorts(this.sortMeta)
|
|
260
|
-
: undefined;
|
|
261
|
-
const lazyLoadEvent: LazyLoadEvent = {
|
|
262
|
-
sort,
|
|
263
|
-
offset: event.first ?? 0,
|
|
264
|
-
limit: event.rows ?? this.pageSize,
|
|
265
|
-
filter: convertToFilter(event.filters),
|
|
266
|
-
};
|
|
267
|
-
|
|
268
|
-
this.lazyLoad.emit(lazyLoadEvent);
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
private removePrefix(input: string, prefix: string): string {
|
|
273
|
-
return input.startsWith(prefix) ? input.slice(prefix.length) : input;
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
private convertToSortDirection(value: number): SortDirectionType {
|
|
277
|
-
return value === 1 ? SortDirection.asc : SortDirection.desc;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
private getSorts(value: SortMeta[] | undefined) {
|
|
281
|
-
return value
|
|
282
|
-
? value.map((x: SortMeta) => ({
|
|
283
|
-
field: this.removePrefix(x.field, 'row.'),
|
|
284
|
-
direction: this.convertToSortDirection(x.order),
|
|
285
|
-
}))
|
|
286
|
-
: undefined;
|
|
287
|
-
}
|
|
288
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { FilterMetadata } from 'primeng/api';
|
|
2
|
-
|
|
3
|
-
export function convertToFilter<T>(
|
|
4
|
-
value:
|
|
5
|
-
| {
|
|
6
|
-
[s: string]: FilterMetadata | FilterMetadata[] | undefined;
|
|
7
|
-
}
|
|
8
|
-
| Partial<T>
|
|
9
|
-
| undefined
|
|
10
|
-
): Partial<T> | undefined {
|
|
11
|
-
if (value == undefined) {
|
|
12
|
-
return undefined;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const filter: { [key: string]: unknown } = {};
|
|
16
|
-
Object.keys(value).map((key) => {
|
|
17
|
-
const filterValue = (value as { [s: string]: unknown })[key];
|
|
18
|
-
if (filterValue != undefined && typeof filterValue === 'object') {
|
|
19
|
-
filter[key] = (filterValue as FilterMetadata).value;
|
|
20
|
-
} else {
|
|
21
|
-
filter[key] = filterValue;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
return filter as Partial<T>;
|
|
26
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
:host {
|
|
2
|
-
display: inline-block;
|
|
3
|
-
|
|
4
|
-
.p-tag {
|
|
5
|
-
display: inline-flex;
|
|
6
|
-
align-items: center;
|
|
7
|
-
line-height: 1;
|
|
8
|
-
|
|
9
|
-
&.v-primeng-tag--small {
|
|
10
|
-
font-size: 0.75rem;
|
|
11
|
-
padding: 0.1rem 0.4rem;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
&.v-primeng-tag--medium {
|
|
15
|
-
font-size: 0.875rem;
|
|
16
|
-
padding: 0.15rem 0.5rem;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
&.v-primeng-tag--large {
|
|
20
|
-
font-size: 1rem;
|
|
21
|
-
padding: 0.25rem 0.6rem;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
&.v-primeng-tag--xl {
|
|
25
|
-
font-size: 1.125rem;
|
|
26
|
-
padding: 0.3rem 0.75rem;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
&.v-primeng-tag--subtle {
|
|
30
|
-
filter: brightness(1.1) saturate(0.5);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { CommonModule } from '@angular/common';
|
|
2
|
-
import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';
|
|
3
|
-
import { TranslateModule } from '@ngx-translate/core';
|
|
4
|
-
import {
|
|
5
|
-
ControlSeverity,
|
|
6
|
-
ControlSeverityType,
|
|
7
|
-
FieldSize,
|
|
8
|
-
FieldSizeType,
|
|
9
|
-
TagCore,
|
|
10
|
-
TAG_COMPONENT_TOKEN,
|
|
11
|
-
TagVariant,
|
|
12
|
-
} from '@verisoft/ui-core';
|
|
13
|
-
import { TagModule } from 'primeng/tag';
|
|
14
|
-
|
|
15
|
-
type PrimeSeverity = 'success' | 'info' | 'warning' | 'danger' | null;
|
|
16
|
-
|
|
17
|
-
@Component({
|
|
18
|
-
selector: 'v-tag',
|
|
19
|
-
imports: [CommonModule, TagModule, TranslateModule],
|
|
20
|
-
templateUrl: './tag.component.html',
|
|
21
|
-
styleUrl: './tag.component.scss',
|
|
22
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
23
|
-
providers: [
|
|
24
|
-
{
|
|
25
|
-
provide: TAG_COMPONENT_TOKEN,
|
|
26
|
-
useExisting: TagComponent,
|
|
27
|
-
},
|
|
28
|
-
],
|
|
29
|
-
})
|
|
30
|
-
export class TagComponent implements TagCore {
|
|
31
|
-
label = input<string | undefined>();
|
|
32
|
-
severity = input<ControlSeverityType | undefined>(ControlSeverity.primary);
|
|
33
|
-
variant = input<TagVariant>('bold');
|
|
34
|
-
size = input<FieldSizeType>(FieldSize.medium);
|
|
35
|
-
|
|
36
|
-
protected readonly primeSeverity = computed<PrimeSeverity>(() => {
|
|
37
|
-
const severity = this.severity();
|
|
38
|
-
if (!severity) {
|
|
39
|
-
return null;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
switch (severity) {
|
|
43
|
-
case ControlSeverity.success:
|
|
44
|
-
return 'success';
|
|
45
|
-
case ControlSeverity.info:
|
|
46
|
-
case ControlSeverity.help:
|
|
47
|
-
case ControlSeverity.primary:
|
|
48
|
-
case ControlSeverity.secondary:
|
|
49
|
-
case ControlSeverity.contrast:
|
|
50
|
-
return 'info';
|
|
51
|
-
case ControlSeverity.warning:
|
|
52
|
-
return 'warning';
|
|
53
|
-
case ControlSeverity.danger:
|
|
54
|
-
return 'danger';
|
|
55
|
-
default:
|
|
56
|
-
return null;
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
protected readonly tagClasses = computed(() => {
|
|
61
|
-
const classes: string[] = ['v-primeng-tag'];
|
|
62
|
-
const severity = this.severity();
|
|
63
|
-
const variant = this.variant();
|
|
64
|
-
const size = this.size();
|
|
65
|
-
|
|
66
|
-
if (severity) {
|
|
67
|
-
classes.push(`v-primeng-tag--${severity}`);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
if (variant === 'subtle') {
|
|
71
|
-
classes.push('v-primeng-tag--subtle');
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
if (size) {
|
|
75
|
-
classes.push(`v-primeng-tag--${size}`);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return classes.join(' ');
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
protected readonly rounded = computed(() => this.variant() === 'subtle');
|
|
82
|
-
}
|
|
83
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './textarea.component';
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
<div class="v-textarea">
|
|
2
|
-
@if (!floatLabel) {
|
|
3
|
-
<v-form-field
|
|
4
|
-
[label]="label"
|
|
5
|
-
[tooltip]="tooltip"
|
|
6
|
-
[required]="isRequired()"
|
|
7
|
-
[display]="formDisplay"
|
|
8
|
-
>
|
|
9
|
-
<textarea
|
|
10
|
-
class="flex-grow-1"
|
|
11
|
-
pTextarea
|
|
12
|
-
[rows]="rows"
|
|
13
|
-
[cols]="cols"
|
|
14
|
-
[formControl]="formControl"
|
|
15
|
-
[placeholder]="placeholder"
|
|
16
|
-
[required]="isRequired()"
|
|
17
|
-
[readOnly]="readonly"
|
|
18
|
-
[autoResize]="autoResize"
|
|
19
|
-
></textarea>
|
|
20
|
-
</v-form-field>
|
|
21
|
-
<v-validation-message [ngControl]="ngControl"></v-validation-message>
|
|
22
|
-
}
|
|
23
|
-
@if (floatLabel) {
|
|
24
|
-
<p-floatLabel>
|
|
25
|
-
<textarea
|
|
26
|
-
class="flex-grow-1"
|
|
27
|
-
pTextarea
|
|
28
|
-
[rows]="rows"
|
|
29
|
-
[cols]="cols"
|
|
30
|
-
[id]="inputId"
|
|
31
|
-
[formControl]="formControl"
|
|
32
|
-
[placeholder]="placeholder"
|
|
33
|
-
[required]="isRequired()"
|
|
34
|
-
[readOnly]="readonly"
|
|
35
|
-
[autoResize]="autoResize"
|
|
36
|
-
></textarea>
|
|
37
|
-
<label [for]="inputId">{{ floatLabel }}</label>
|
|
38
|
-
</p-floatLabel>
|
|
39
|
-
}
|
|
40
|
-
</div>
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
import { TextareaComponent } from './textarea.component';
|
|
3
|
-
|
|
4
|
-
describe('TextareaComponent', () => {
|
|
5
|
-
let component: TextareaComponent;
|
|
6
|
-
let fixture: ComponentFixture<TextareaComponent>;
|
|
7
|
-
|
|
8
|
-
beforeEach(async () => {
|
|
9
|
-
await TestBed.configureTestingModule({
|
|
10
|
-
imports: [TextareaComponent],
|
|
11
|
-
}).compileComponents();
|
|
12
|
-
|
|
13
|
-
fixture = TestBed.createComponent(TextareaComponent);
|
|
14
|
-
component = fixture.componentInstance;
|
|
15
|
-
fixture.detectChanges();
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it('should create', () => {
|
|
19
|
-
expect(component).toBeTruthy();
|
|
20
|
-
});
|
|
21
|
-
});
|