@rxap/schematic-angular 19.3.1-dev.0 → 21.0.1-dev.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/CHANGELOG.md +32 -0
- package/package.json +10 -10
- package/src/schematics/accordion/accordion-component/__snapshots__/index.spec.ts.snap +1 -1
- package/src/schematics/accordion/accordion-component/__snapshots__/normalize-accordion-component-options.spec.ts.snap +1 -1
- package/src/schematics/accordion/item/accordion-item-data-grid-component/__snapshots__/normalize-accordion-item-data-grid-component-options.spec.ts.snap +1 -1
- package/src/schematics/accordion/item/accordion-item-nested-component/__snapshots__/normalize-accordion-item-nested-component-options.spec.ts.snap +1 -1
- package/src/schematics/accordion/item/accordion-item-switch-component/__snapshots__/normalize-accordion-item-switch-component-options.spec.ts.snap +1 -1
- package/src/schematics/accordion/item/accordion-item-table-component/__snapshots__/normalize-accordion-item-table-component-options.spec.ts.snap +1 -1
- package/src/schematics/accordion/item/accordion-item-tree-table-component/__snapshots__/normalize-accordion-item-tree-table-component-options.spec.ts.snap +1 -1
- package/src/schematics/data-grid-component/__snapshots__/index.spec.ts.snap +34 -1
- package/src/schematics/data-grid-component/__snapshots__/normalize-data-grid-component-options.spec.ts.snap +1 -1
- package/src/schematics/dialog-component/__snapshots__/index.spec.ts.snap +48 -1
- package/src/schematics/dialog-component/__snapshots__/normalize-dialog-component-options.spec.ts.snap +1 -1
- package/src/schematics/form/control/autocomplete-form-control/__snapshots__/index.spec.ts.snap +1 -1
- package/src/schematics/form/control/autocomplete-form-control/__snapshots__/normalize-autocomplete-form-control-options.spec.ts.snap +1 -1
- package/src/schematics/form/control/autocomplete-table-select-form-control/__snapshots__/index.spec.ts.snap +1 -1
- package/src/schematics/form/control/autocomplete-table-select-form-control/__snapshots__/normalize-table-select-form-control-options.spec.ts.snap +1 -1
- package/src/schematics/form/control/date-form-control/__snapshots__/index.spec.ts.snap +1 -1
- package/src/schematics/form/control/date-form-control/__snapshots__/normalize-date-form-control-options.spec.ts.snap +1 -1
- package/src/schematics/form/control/input-form-control/__snapshots__/index.spec.ts.snap +1 -1
- package/src/schematics/form/control/input-form-control/__snapshots__/normalize-input-form-control-options.spec.ts.snap +1 -1
- package/src/schematics/form/control/select-form-control/__snapshots__/index.spec.ts.snap +1 -1
- package/src/schematics/form/control/select-form-control/__snapshots__/normalize-select-form-control-options.spec.ts.snap +1 -1
- package/src/schematics/form/control/table-select-form-control/__snapshots__/normalize-table-select-form-control-options.spec.ts.snap +1 -1
- package/src/schematics/form/form-array/__snapshots__/normalize-form-array-options.spec.ts.snap +1 -1
- package/src/schematics/form/form-component/__snapshots__/index.spec.ts.snap +65 -1
- package/src/schematics/form/form-component/__snapshots__/normalize-form-component-options.spec.ts.snap +1 -1
- package/src/schematics/form/form-control/__snapshots__/normalize-form-control-options.spec.ts.snap +1 -1
- package/src/schematics/form/form-definition/__snapshots__/index.spec.ts.snap +42 -1
- package/src/schematics/form/form-definition/__snapshots__/normalize-form-definition-options.spec.ts.snap +1 -1
- package/src/schematics/form/form-group/__snapshots__/normalize-form-group-options.spec.ts.snap +1 -1
- package/src/schematics/route-component/__snapshots__/normalize-route-component-options.spec.ts.snap +1 -1
- package/src/schematics/table/action/dialog-table-action/__snapshots__/normalize-dialog-table-action-options.spec.ts.snap +1 -1
- package/src/schematics/table/action/form-table-action/__snapshots__/normalize-form-table-action-options.spec.ts.snap +1 -1
- package/src/schematics/table/action/navigation-table-action/__snapshots__/normalize-navigation-table-action-options.spec.ts.snap +1 -1
- package/src/schematics/table/action/open-api-table-action/__snapshots__/normalize-open-api-table-action-options.spec.ts.snap +1 -1
- package/src/schematics/table/action/operation-table-action/__snapshots__/normalize-operation-table-action-options.spec.ts.snap +1 -1
- package/src/schematics/table/header-button/form-table-header-button/__snapshots__/normalize-form-table-header-button-options.spec.ts.snap +1 -1
- package/src/schematics/table/header-button/method-table-header-button/__snapshots__/normalize-method-table-header-button-options.spec.ts.snap +1 -1
- package/src/schematics/table/header-button/navigation-table-header-button/__snapshots__/normalize-navigation-table-header-button-options.spec.ts.snap +1 -1
- package/src/schematics/table/table-action/__snapshots__/normalize-table-action-options.spec.ts.snap +1 -1
- package/src/schematics/table/table-component/__snapshots__/index.spec.ts.snap +417 -1
- package/src/schematics/table/table-component/__snapshots__/normalize-table-component-options.spec.ts.snap +1 -1
- package/src/schematics/table/table-header-button/__snapshots__/index.spec.ts.snap +1 -1
- package/src/schematics/table/table-header-button/__snapshots__/normalize-table-header-button-options.spec.ts.snap +1 -1
- package/src/schematics/table/tree-table-component/__snapshots__/index.spec.ts.snap +147 -1
- package/src/schematics/tree-component/__snapshots__/index.spec.ts.snap +1 -1
- package/src/schematics/tree-component/__snapshots__/normalize-tree-component-options.spec.ts.snap +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,35 @@
|
|
|
1
|
+
## 21.0.1-dev.0 (2026-11-20)
|
|
2
|
+
|
|
3
|
+
### 🩹 Fixes
|
|
4
|
+
|
|
5
|
+
- **upgrade:** dedupe @angular-devkit to 21.2.16 (single instance for test type identity)
|
|
6
|
+
- **upgrade:** jest30 env + ora ESM stub + TextEncoder polyfill casts (test infra)
|
|
7
|
+
|
|
8
|
+
### 🧱 Updated Dependencies
|
|
9
|
+
|
|
10
|
+
- Updated schematic-utilities to 21.0.1-dev.0
|
|
11
|
+
- Updated workspace-utilities to 22.0.1-dev.0
|
|
12
|
+
- Updated schematic-ts-morph to 21.0.1-dev.0
|
|
13
|
+
- Updated workspace-ts-morph to 22.0.1-dev.0
|
|
14
|
+
- Updated plugin-utilities to 22.0.1-dev.0
|
|
15
|
+
- Updated utilities to 16.5.2-dev.0
|
|
16
|
+
- Updated ts-morph to 1.7.1-dev.0
|
|
17
|
+
|
|
18
|
+
### ❤️ Thank You
|
|
19
|
+
|
|
20
|
+
- Merzough Münker
|
|
21
|
+
|
|
22
|
+
## 19.3.1 (2026-11-20)
|
|
23
|
+
|
|
24
|
+
### 🧱 Updated Dependencies
|
|
25
|
+
|
|
26
|
+
- Updated schematic-utilities to 19.1.2
|
|
27
|
+
- Updated workspace-utilities to 19.9.1
|
|
28
|
+
- Updated schematic-ts-morph to 19.2.2
|
|
29
|
+
- Updated workspace-ts-morph to 19.1.15
|
|
30
|
+
- Updated utilities to 16.5.1
|
|
31
|
+
- Updated ts-morph to 1.7.0
|
|
32
|
+
|
|
1
33
|
## 19.3.1-dev.0 (2026-08-24)
|
|
2
34
|
|
|
3
35
|
### 🧱 Updated Dependencies
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "
|
|
2
|
+
"version": "21.0.1-dev.0",
|
|
3
3
|
"name": "@rxap/schematic-angular",
|
|
4
4
|
"description": "Provides schematics for generating Angular components, services, and related files, particularly focused on creating tables, forms, data grids, and accordions with NestJS integration. It offers tools for generating UI elements with backend connectivity, including data sources, methods, and form handling. This package aims to streamline the development of data-driven Angular applications with a focus on material design and backend integration.\n",
|
|
5
5
|
"license": "GPL-3.0-or-later",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@angular-devkit/core": "
|
|
8
|
-
"@angular-devkit/schematics": "
|
|
9
|
-
"@nx/devkit": "
|
|
10
|
-
"@rxap/schematics-ts-morph": "^
|
|
11
|
-
"@rxap/schematics-utilities": "^
|
|
12
|
-
"@rxap/ts-morph": "^1.7.
|
|
13
|
-
"@rxap/utilities": "^16.5.
|
|
14
|
-
"@rxap/workspace-ts-morph": "^
|
|
15
|
-
"@rxap/workspace-utilities": "^
|
|
7
|
+
"@angular-devkit/core": "21.2.16",
|
|
8
|
+
"@angular-devkit/schematics": "21.2.16",
|
|
9
|
+
"@nx/devkit": "22.7.5",
|
|
10
|
+
"@rxap/schematics-ts-morph": "^21.0.1-dev.0",
|
|
11
|
+
"@rxap/schematics-utilities": "^21.0.1-dev.0",
|
|
12
|
+
"@rxap/ts-morph": "^1.7.1-dev.0",
|
|
13
|
+
"@rxap/utilities": "^16.5.2-dev.0",
|
|
14
|
+
"@rxap/workspace-ts-morph": "^22.0.1-dev.0",
|
|
15
|
+
"@rxap/workspace-utilities": "^22.0.1-dev.0",
|
|
16
16
|
"colors": "1.4.0",
|
|
17
17
|
"handlebars": "^4.7.8",
|
|
18
18
|
"ts-morph": "18.0.0",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://
|
|
1
|
+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
|
2
2
|
|
|
3
3
|
exports[`data-grid-component minimal: file-tree 1`] = `
|
|
4
4
|
[
|
|
@@ -32,3 +32,36 @@ exports[`data-grid-component minimal: file-tree 1`] = `
|
|
|
32
32
|
"/ui/lib/tsconfig.lib.json",
|
|
33
33
|
]
|
|
34
34
|
`;
|
|
35
|
+
|
|
36
|
+
exports[`data-grid-component minimal: generated 1`] = `
|
|
37
|
+
{
|
|
38
|
+
"/ui/lib/src/lib/test-grid-data-grid/test-grid-data-grid.component.html": "<mat-card>
|
|
39
|
+
<mat-card-content>
|
|
40
|
+
<div class="p-4">
|
|
41
|
+
<rxap-data-grid [dataSource]="dataGridDataSource" mode="plain">
|
|
42
|
+
</rxap-data-grid>
|
|
43
|
+
</div>
|
|
44
|
+
</mat-card-content>
|
|
45
|
+
</mat-card>
|
|
46
|
+
",
|
|
47
|
+
"/ui/lib/src/lib/test-grid-data-grid/test-grid-data-grid.component.scss": "",
|
|
48
|
+
"/ui/lib/src/lib/test-grid-data-grid/test-grid-data-grid.component.ts": "import { Component, ChangeDetectionStrategy, inject } from '@angular/core';
|
|
49
|
+
import { DataGridModule } from '@rxap/data-grid';
|
|
50
|
+
import { MatCardModule } from '@angular/material/card';
|
|
51
|
+
import { TestGridDataGridDataSource } from './test-grid-data-grid.data-source';
|
|
52
|
+
|
|
53
|
+
@Component({
|
|
54
|
+
standalone: true,
|
|
55
|
+
selector: 'jest-test-grid-data-grid',
|
|
56
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
57
|
+
templateUrl: './test-grid-data-grid.component.html',
|
|
58
|
+
styleUrls: ['./test-grid-data-grid.component.scss'],
|
|
59
|
+
imports: [DataGridModule, MatCardModule],
|
|
60
|
+
providers: [TestGridDataGridDataSource],
|
|
61
|
+
})
|
|
62
|
+
export class TestGridDataGridComponent {
|
|
63
|
+
public readonly dataGridDataSource = inject(TestGridDataGridDataSource);
|
|
64
|
+
}
|
|
65
|
+
",
|
|
66
|
+
}
|
|
67
|
+
`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://
|
|
1
|
+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
|
2
2
|
|
|
3
3
|
exports[`dialog-component minimal: file-tree 1`] = `
|
|
4
4
|
[
|
|
@@ -33,6 +33,53 @@ exports[`dialog-component minimal: file-tree 1`] = `
|
|
|
33
33
|
]
|
|
34
34
|
`;
|
|
35
35
|
|
|
36
|
+
exports[`dialog-component minimal: generated 1`] = `
|
|
37
|
+
{
|
|
38
|
+
"/ui/lib/src/lib/test-dialog/test-dialog.component.html": "<h2 mat-dialog-title i18n>Test Dialog</h2>
|
|
39
|
+
<mat-dialog-content>
|
|
40
|
+
|
|
41
|
+
<div class="flex flex-col">
|
|
42
|
+
|
|
43
|
+
<mat-progress-bar *ngIf="loading$ | async" class="progress-bar" mode="indeterminate"></mat-progress-bar>
|
|
44
|
+
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
</mat-dialog-content>
|
|
48
|
+
<mat-dialog-actions>
|
|
49
|
+
|
|
50
|
+
</mat-dialog-actions>
|
|
51
|
+
",
|
|
52
|
+
"/ui/lib/src/lib/test-dialog/test-dialog.component.scss": "",
|
|
53
|
+
"/ui/lib/src/lib/test-dialog/test-dialog.component.ts": "import { Component, ChangeDetectionStrategy, Inject } from '@angular/core';
|
|
54
|
+
import { MatDialogModule, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
|
55
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
56
|
+
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
|
57
|
+
import { CommonModule } from '@angular/common';
|
|
58
|
+
import { ToggleSubject } from '@rxap/rxjs';
|
|
59
|
+
|
|
60
|
+
@Component({
|
|
61
|
+
standalone: true,
|
|
62
|
+
selector: 'jest-test-dialog',
|
|
63
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
64
|
+
templateUrl: './test-dialog.component.html',
|
|
65
|
+
styleUrls: ['./test-dialog.component.scss'],
|
|
66
|
+
imports: [MatDialogModule, MatButtonModule, MatProgressBarModule, CommonModule],
|
|
67
|
+
})
|
|
68
|
+
export class TestDialogComponent {
|
|
69
|
+
readonly invalid$ = new ToggleSubject(true);
|
|
70
|
+
readonly loading$ = new ToggleSubject(true);
|
|
71
|
+
|
|
72
|
+
constructor(readonly matDialogRef: MatDialogRef<any>, @Inject(MAT_DIALOG_DATA) readonly data: any) {
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
async submit() {
|
|
76
|
+
this.matDialogRef.close(true);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
",
|
|
80
|
+
}
|
|
81
|
+
`;
|
|
82
|
+
|
|
36
83
|
exports[`dialog-component minimal: test-dialog.component.html 1`] = `
|
|
37
84
|
"<h2 mat-dialog-title i18n>Test Dialog</h2>
|
|
38
85
|
<mat-dialog-content>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://
|
|
1
|
+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
|
2
2
|
|
|
3
3
|
exports[`form-component minimal: file-tree 1`] = `
|
|
4
4
|
[
|
|
@@ -34,3 +34,67 @@ exports[`form-component minimal: file-tree 1`] = `
|
|
|
34
34
|
"/ui/lib/tsconfig.lib.json",
|
|
35
35
|
]
|
|
36
36
|
`;
|
|
37
|
+
|
|
38
|
+
exports[`form-component minimal: generated 1`] = `
|
|
39
|
+
{
|
|
40
|
+
"/ui/lib/src/lib/test-form/form.providers.ts": "import { Provider, INJECTOR, Injector, Optional } from '@angular/core';
|
|
41
|
+
import { TestForm, ITestForm } from './test-form.form';
|
|
42
|
+
import { RxapFormBuilder, RXAP_FORM_DEFINITION_BUILDER, RXAP_FORM_DEFINITION, RXAP_FORM_INITIAL_STATE } from '@rxap/forms';
|
|
43
|
+
|
|
44
|
+
export const FormProviders: Provider[] = [TestForm];
|
|
45
|
+
export const FormComponentProviders: Provider[] = [{
|
|
46
|
+
provide: RXAP_FORM_DEFINITION,
|
|
47
|
+
useFactory: FormFactory,
|
|
48
|
+
deps: [ INJECTOR,[ new Optional(), RXAP_FORM_INITIAL_STATE ] ]
|
|
49
|
+
}];
|
|
50
|
+
export const FormBuilderProviders: Provider[] = [{
|
|
51
|
+
provide: RXAP_FORM_DEFINITION_BUILDER,
|
|
52
|
+
useFactory: FormBuilderFactory,
|
|
53
|
+
deps: [ INJECTOR ]
|
|
54
|
+
}];
|
|
55
|
+
|
|
56
|
+
export function FormFactory(injector: Injector, state: ITestForm | null): TestForm {
|
|
57
|
+
return new RxapFormBuilder<ITestForm>(TestForm, injector).build(state ?? {});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function FormBuilderFactory(injector: Injector): RxapFormBuilder<ITestForm> {
|
|
61
|
+
return new RxapFormBuilder<ITestForm>(TestForm, injector);
|
|
62
|
+
}
|
|
63
|
+
",
|
|
64
|
+
"/ui/lib/src/lib/test-form/test-form.component.html": "<form rxapForm class="flex flex-col gap-2">
|
|
65
|
+
<rxap-form-controls></rxap-form-controls>
|
|
66
|
+
</form>
|
|
67
|
+
",
|
|
68
|
+
"/ui/lib/src/lib/test-form/test-form.component.scss": "",
|
|
69
|
+
"/ui/lib/src/lib/test-form/test-form.component.ts": "import { Component, ChangeDetectionStrategy } from '@angular/core';
|
|
70
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
71
|
+
import { FormControlsComponent } from '@rxap/material-form-system';
|
|
72
|
+
import { RxapFormsModule } from '@rxap/forms';
|
|
73
|
+
import { FormProviders, FormComponentProviders } from './form.providers';
|
|
74
|
+
|
|
75
|
+
@Component({
|
|
76
|
+
standalone: true,
|
|
77
|
+
selector: 'jest-test-form',
|
|
78
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
79
|
+
templateUrl: './test-form.component.html',
|
|
80
|
+
styleUrls: ['./test-form.component.scss'],
|
|
81
|
+
imports: [ReactiveFormsModule, FormControlsComponent, RxapFormsModule],
|
|
82
|
+
providers: [FormProviders, FormComponentProviders],
|
|
83
|
+
})
|
|
84
|
+
export class TestFormComponent {
|
|
85
|
+
}
|
|
86
|
+
",
|
|
87
|
+
"/ui/lib/src/lib/test-form/test-form.form.ts": "import { FormType, RxapFormGroup, RxapForm } from '@rxap/forms';
|
|
88
|
+
import { Injectable } from '@angular/core';
|
|
89
|
+
|
|
90
|
+
@RxapForm('test-form')
|
|
91
|
+
@Injectable()
|
|
92
|
+
export class TestForm implements FormType<ITestForm> {
|
|
93
|
+
public readonly rxapFormGroup!: RxapFormGroup<ITestForm>;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export interface ITestForm {
|
|
97
|
+
}
|
|
98
|
+
",
|
|
99
|
+
}
|
|
100
|
+
`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://
|
|
1
|
+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
|
2
2
|
|
|
3
3
|
exports[`form-definition minimal: file-tree 1`] = `
|
|
4
4
|
[
|
|
@@ -31,3 +31,44 @@ exports[`form-definition minimal: file-tree 1`] = `
|
|
|
31
31
|
"/ui/lib/tsconfig.lib.json",
|
|
32
32
|
]
|
|
33
33
|
`;
|
|
34
|
+
|
|
35
|
+
exports[`form-definition minimal: generated 1`] = `
|
|
36
|
+
{
|
|
37
|
+
"/ui/lib/src/lib/form.providers.ts": "import { Provider, INJECTOR, Injector, Optional } from '@angular/core';
|
|
38
|
+
import { TestDefForm, ITestDefForm } from './test-def.form';
|
|
39
|
+
import { RxapFormBuilder, RXAP_FORM_DEFINITION_BUILDER, RXAP_FORM_DEFINITION, RXAP_FORM_INITIAL_STATE } from '@rxap/forms';
|
|
40
|
+
|
|
41
|
+
export const FormProviders: Provider[] = [TestDefForm];
|
|
42
|
+
export const FormComponentProviders: Provider[] = [{
|
|
43
|
+
provide: RXAP_FORM_DEFINITION,
|
|
44
|
+
useFactory: FormFactory,
|
|
45
|
+
deps: [ INJECTOR,[ new Optional(), RXAP_FORM_INITIAL_STATE ] ]
|
|
46
|
+
}];
|
|
47
|
+
export const FormBuilderProviders: Provider[] = [{
|
|
48
|
+
provide: RXAP_FORM_DEFINITION_BUILDER,
|
|
49
|
+
useFactory: FormBuilderFactory,
|
|
50
|
+
deps: [ INJECTOR ]
|
|
51
|
+
}];
|
|
52
|
+
|
|
53
|
+
export function FormFactory(injector: Injector, state: ITestDefForm | null): TestDefForm {
|
|
54
|
+
return new RxapFormBuilder<ITestDefForm>(TestDefForm, injector).build(state ?? {});
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function FormBuilderFactory(injector: Injector): RxapFormBuilder<ITestDefForm> {
|
|
58
|
+
return new RxapFormBuilder<ITestDefForm>(TestDefForm, injector);
|
|
59
|
+
}
|
|
60
|
+
",
|
|
61
|
+
"/ui/lib/src/lib/test-def.form.ts": "import { FormType, RxapFormGroup, RxapForm } from '@rxap/forms';
|
|
62
|
+
import { Injectable } from '@angular/core';
|
|
63
|
+
|
|
64
|
+
@RxapForm('test-def')
|
|
65
|
+
@Injectable()
|
|
66
|
+
export class TestDefForm implements FormType<ITestDefForm> {
|
|
67
|
+
public readonly rxapFormGroup!: RxapFormGroup<ITestDefForm>;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface ITestDefForm {
|
|
71
|
+
}
|
|
72
|
+
",
|
|
73
|
+
}
|
|
74
|
+
`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://
|
|
1
|
+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
|
2
2
|
|
|
3
3
|
exports[`table-component minimal: file-tree 1`] = `
|
|
4
4
|
[
|
|
@@ -34,6 +34,132 @@ exports[`table-component minimal: file-tree 1`] = `
|
|
|
34
34
|
]
|
|
35
35
|
`;
|
|
36
36
|
|
|
37
|
+
exports[`table-component minimal: generated 1`] = `
|
|
38
|
+
{
|
|
39
|
+
"/package.json": "{
|
|
40
|
+
"name": "workspace",
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@rxap/components": "19.0.0-dev.0",
|
|
43
|
+
"@rxap/data-source": "19.0.0-dev.0",
|
|
44
|
+
"@rxap/directives": "19.0.0-dev.0",
|
|
45
|
+
"@rxap/form-system": "19.0.0-dev.0",
|
|
46
|
+
"@rxap/forms": "19.0.0-dev.0",
|
|
47
|
+
"@rxap/material-directives": "19.0.0-dev.0",
|
|
48
|
+
"@rxap/material-form-system": "19.0.0-dev.1",
|
|
49
|
+
"@rxap/material-table-system": "19.0.0-dev.1",
|
|
50
|
+
"@rxap/mixin": "16.0.11-dev.0",
|
|
51
|
+
"@rxap/nest-dto": "10.3.7-dev.1",
|
|
52
|
+
"@rxap/pattern": "1.1.10-dev.0",
|
|
53
|
+
"@rxap/reflect-metadata": "1.0.12-dev.0",
|
|
54
|
+
"@rxap/rxjs": "1.1.11-dev.0",
|
|
55
|
+
"@rxap/utilities": "16.4.1-dev.0",
|
|
56
|
+
"@rxap/window-system": "19.0.0-dev.0"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
",
|
|
60
|
+
"/ui/lib/src/lib/test-table/test-table.component.html": "<div class="flex flex-col gap-y-4 m-4">
|
|
61
|
+
|
|
62
|
+
<div class="table-card-container flex flex-col">
|
|
63
|
+
<mat-card>
|
|
64
|
+
<mat-progress-bar
|
|
65
|
+
rxapCardProgressBar
|
|
66
|
+
[loading$]="tableDataSourceDirective.loading$"
|
|
67
|
+
></mat-progress-bar>
|
|
68
|
+
<mat-card-header class="min-h-full h-12">
|
|
69
|
+
<mat-card-title i18n>Test Table</mat-card-title>
|
|
70
|
+
<rxap-table-column-menu
|
|
71
|
+
matCard
|
|
72
|
+
#rxapTableColumns="rxapTableColumns"
|
|
73
|
+
>
|
|
74
|
+
</rxap-table-column-menu>
|
|
75
|
+
</mat-card-header>
|
|
76
|
+
|
|
77
|
+
<mat-card-content>
|
|
78
|
+
<rxap-data-source-error
|
|
79
|
+
*ngIf="tableDataSourceDirective.hasError$ | async"
|
|
80
|
+
[dataSourceLike]="tableDataSourceDirective">
|
|
81
|
+
</rxap-data-source-error>
|
|
82
|
+
<div class="table-scroll-container mt-4 overflow-x-auto overscroll-auto">
|
|
83
|
+
<table
|
|
84
|
+
[ngClass]="{ 'hidden': tableDataSourceDirective.hasError$ | async }"
|
|
85
|
+
mat-table
|
|
86
|
+
#tableDataSourceDirective="rxapTableDataSource"
|
|
87
|
+
rxapTableDataSource
|
|
88
|
+
[parameters]="parameters"
|
|
89
|
+
id="test-table"
|
|
90
|
+
[paginator]="paginator"
|
|
91
|
+
>
|
|
92
|
+
<!-- region columns -->
|
|
93
|
+
|
|
94
|
+
<!-- endregion -->
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
<tr
|
|
100
|
+
[@rowsAnimation]=""
|
|
101
|
+
mat-row
|
|
102
|
+
[ngClass]="{ 'rxap-row-odd !bg-neutral-200 dark:!bg-neutral-600': odd, 'rxap-row-even': even }"
|
|
103
|
+
class="hover:!bg-neutral-400 dark:hover:!bg-neutral-800"
|
|
104
|
+
*matRowDef="
|
|
105
|
+
let element;
|
|
106
|
+
columns: rxapTableColumns.displayColumns;
|
|
107
|
+
let odd = odd;
|
|
108
|
+
let even = even
|
|
109
|
+
"
|
|
110
|
+
></tr>
|
|
111
|
+
</table>
|
|
112
|
+
</div>
|
|
113
|
+
</mat-card-content>
|
|
114
|
+
<mat-card-footer>
|
|
115
|
+
<mat-paginator
|
|
116
|
+
[ngClass]="{ 'hidden': tableDataSourceDirective.hasError$ | async }"
|
|
117
|
+
class="m-4"
|
|
118
|
+
rxapPersistent
|
|
119
|
+
[pageSizeOptions]="[5,10,25,50,100]"
|
|
120
|
+
[pageSize]="10"
|
|
121
|
+
#paginator="matPaginator"
|
|
122
|
+
></mat-paginator>
|
|
123
|
+
</mat-card-footer>
|
|
124
|
+
</mat-card>
|
|
125
|
+
</div>
|
|
126
|
+
</div>
|
|
127
|
+
",
|
|
128
|
+
"/ui/lib/src/lib/test-table/test-table.component.scss": "",
|
|
129
|
+
"/ui/lib/src/lib/test-table/test-table.component.ts": "import { Component, ChangeDetectionStrategy, Input } from '@angular/core';
|
|
130
|
+
import { RowAnimation, TableColumnMenuModule, PersistentPaginatorDirective, TableDataSourceDirective } from '@rxap/material-table-system';
|
|
131
|
+
import { Observable } from 'rxjs';
|
|
132
|
+
import { MatPaginatorModule } from '@angular/material/paginator';
|
|
133
|
+
import { DataSourceErrorComponent } from '@rxap/data-source';
|
|
134
|
+
import { MatDividerModule } from '@angular/material/divider';
|
|
135
|
+
import { MatTableModule } from '@angular/material/table';
|
|
136
|
+
import { CardProgressBarDirective } from '@rxap/material-directives/card';
|
|
137
|
+
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
|
138
|
+
import { MatCardModule } from '@angular/material/card';
|
|
139
|
+
import { AsyncPipe, NgIf, NgClass } from '@angular/common';
|
|
140
|
+
|
|
141
|
+
@Component({
|
|
142
|
+
standalone: true,
|
|
143
|
+
selector: 'jest-test-table',
|
|
144
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
145
|
+
templateUrl: './test-table.component.html',
|
|
146
|
+
styleUrls: ['./test-table.component.scss'],
|
|
147
|
+
animations: [RowAnimation],
|
|
148
|
+
imports: [TableColumnMenuModule, MatPaginatorModule, PersistentPaginatorDirective, DataSourceErrorComponent, MatDividerModule, TableDataSourceDirective, MatTableModule, CardProgressBarDirective, MatProgressBarModule, MatCardModule, AsyncPipe, NgIf, NgClass],
|
|
149
|
+
})
|
|
150
|
+
export class TestTableComponent {
|
|
151
|
+
@Input()
|
|
152
|
+
public parameters?: Observable<Record<string, unknown>>;
|
|
153
|
+
}
|
|
154
|
+
",
|
|
155
|
+
"/ui/lib/src/lib/test-table/test-table.ts": "import { TableRowMetadata } from '@rxap/material-table-system';
|
|
156
|
+
|
|
157
|
+
export interface ITestTable extends Record<string, unknown>, TableRowMetadata {
|
|
158
|
+
}
|
|
159
|
+
",
|
|
160
|
+
}
|
|
161
|
+
`;
|
|
162
|
+
|
|
37
163
|
exports[`table-component nestjs backend: file-tree 1`] = `
|
|
38
164
|
[
|
|
39
165
|
"/angular.json",
|
|
@@ -72,6 +198,296 @@ exports[`table-component nestjs backend: file-tree 1`] = `
|
|
|
72
198
|
]
|
|
73
199
|
`;
|
|
74
200
|
|
|
201
|
+
exports[`table-component nestjs backend: generated 1`] = `
|
|
202
|
+
{
|
|
203
|
+
"/api/lib/src/lib/api-lib/api-lib.module.ts": "import { Module } from '@nestjs/common';
|
|
204
|
+
import { TestTableController } from './test-table.controller';
|
|
205
|
+
|
|
206
|
+
@Module({
|
|
207
|
+
controllers: [TestTableController],
|
|
208
|
+
})
|
|
209
|
+
export class ApiLibModule {
|
|
210
|
+
}
|
|
211
|
+
",
|
|
212
|
+
"/api/lib/src/lib/api-lib/dtos/test-table-page.dto.ts": "import { Expose, Type } from 'class-transformer';
|
|
213
|
+
import { IsArray, IsInstance, IsNumber, IsOptional, IsString } from 'class-validator';
|
|
214
|
+
import { TestTableRowDto } from './test-table-row.dto';
|
|
215
|
+
import { FilterQueryDto } from '@rxap/nest-dto';
|
|
216
|
+
|
|
217
|
+
export class TestTablePageDto {
|
|
218
|
+
@Expose()
|
|
219
|
+
@IsArray()
|
|
220
|
+
@Type(() => TestTableRowDto)
|
|
221
|
+
@IsInstance(TestTableRowDto, {
|
|
222
|
+
each: true
|
|
223
|
+
})
|
|
224
|
+
rows!: Array<TestTableRowDto>;
|
|
225
|
+
@Expose()
|
|
226
|
+
@IsNumber()
|
|
227
|
+
pageSize!: number;
|
|
228
|
+
@Expose()
|
|
229
|
+
@IsNumber()
|
|
230
|
+
pageIndex!: number;
|
|
231
|
+
@Expose()
|
|
232
|
+
@IsNumber()
|
|
233
|
+
total!: number;
|
|
234
|
+
@Expose()
|
|
235
|
+
@IsOptional()
|
|
236
|
+
@IsString()
|
|
237
|
+
sortDirection?: string;
|
|
238
|
+
@Expose()
|
|
239
|
+
@IsOptional()
|
|
240
|
+
@IsString()
|
|
241
|
+
sortBy?: string;
|
|
242
|
+
@Expose()
|
|
243
|
+
@IsArray()
|
|
244
|
+
@Type(() => FilterQueryDto)
|
|
245
|
+
@IsInstance(FilterQueryDto, {
|
|
246
|
+
each: true
|
|
247
|
+
})
|
|
248
|
+
@IsOptional()
|
|
249
|
+
filter?: Array<FilterQueryDto>;
|
|
250
|
+
}
|
|
251
|
+
",
|
|
252
|
+
"/api/lib/src/lib/api-lib/dtos/test-table-row.dto.ts": "import { Expose } from 'class-transformer';
|
|
253
|
+
import { IsString, IsNumber } from 'class-validator';
|
|
254
|
+
|
|
255
|
+
export class TestTableRowDto {
|
|
256
|
+
@Expose()
|
|
257
|
+
@IsString()
|
|
258
|
+
name!: string;
|
|
259
|
+
@Expose()
|
|
260
|
+
@IsNumber()
|
|
261
|
+
__rowId!: number;
|
|
262
|
+
}
|
|
263
|
+
",
|
|
264
|
+
"/api/lib/src/lib/api-lib/test-table.controller.ts": "import { Controller, DefaultValuePipe, Get, Query } from '@nestjs/common';
|
|
265
|
+
import { TestTableRowDto } from './dtos/test-table-row.dto';
|
|
266
|
+
import { TestTablePageDto } from './dtos/test-table-page.dto';
|
|
267
|
+
import { ToDtoInstance } from '@rxap/nest-dto';
|
|
268
|
+
import { FilterQuery, FilterQueryPipe } from '@rxap/nest-utilities';
|
|
269
|
+
import { ApiQuery } from '@nestjs/swagger';
|
|
270
|
+
|
|
271
|
+
@Controller('api-lib/test-table')
|
|
272
|
+
export class TestTableController {
|
|
273
|
+
public async getPageData(sortBy: string, sortDirection: string, pageSize: number, pageIndex: number, filter: FilterQuery[]): Promise<{
|
|
274
|
+
list: Array<RawRowData>,
|
|
275
|
+
total: number
|
|
276
|
+
}> {
|
|
277
|
+
return {
|
|
278
|
+
list: [],
|
|
279
|
+
total: 0,
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
private toRowDto(item: RawRowData, index: number, pageIndex: number, pageSize: number, list: Array<RawRowData>): TestTableRowDto {
|
|
284
|
+
return {
|
|
285
|
+
__rowId: (pageIndex * pageSize + index),
|
|
286
|
+
|
|
287
|
+
name: item.name
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
private toPageDto(list: Array<RawRowData>, total: number, pageIndex: number, pageSize: number, sortBy: string, sortDirection: string, filter: FilterQuery[]): TestTablePageDto {
|
|
292
|
+
return {
|
|
293
|
+
total, pageIndex, pageSize, sortBy, sortDirection, filter,
|
|
294
|
+
rows: list.map((item, index) => this.toRowDto(item, index, pageIndex, pageSize, list))
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
@Get()
|
|
299
|
+
@ApiQuery({
|
|
300
|
+
name: 'pageIndex',
|
|
301
|
+
required: false,
|
|
302
|
+
isArray: false
|
|
303
|
+
})
|
|
304
|
+
@ApiQuery({
|
|
305
|
+
name: 'pageSize',
|
|
306
|
+
required: false,
|
|
307
|
+
isArray: false
|
|
308
|
+
})
|
|
309
|
+
@ApiQuery({
|
|
310
|
+
name: 'sortDirection',
|
|
311
|
+
required: false,
|
|
312
|
+
isArray: false
|
|
313
|
+
})
|
|
314
|
+
@ApiQuery({
|
|
315
|
+
name: 'sortBy',
|
|
316
|
+
required: false,
|
|
317
|
+
isArray: false
|
|
318
|
+
})
|
|
319
|
+
@ApiQuery({
|
|
320
|
+
name: 'filter',
|
|
321
|
+
required: false,
|
|
322
|
+
isArray: true
|
|
323
|
+
})
|
|
324
|
+
public async getPage(@Query('filter', new FilterQueryPipe()) filter: Array<FilterQuery>, @Query('pageIndex', new DefaultValuePipe(0)) pageIndex: number, @Query('pageSize', new DefaultValuePipe(5)) pageSize: number, @Query('sortBy', new DefaultValuePipe('__updatedAt')) sortBy: string, @Query('sortDirection', new DefaultValuePipe('desc')) sortDirection: string): Promise<TestTablePageDto> {
|
|
325
|
+
const data = await this.getPageData(sortBy, sortDirection, pageSize, pageIndex, filter);
|
|
326
|
+
return ToDtoInstance(
|
|
327
|
+
TestTablePageDto,
|
|
328
|
+
this.toPageDto(data.list, data.total, pageIndex, pageSize, sortBy, sortDirection, filter),
|
|
329
|
+
);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
type RawRowData = any;
|
|
334
|
+
",
|
|
335
|
+
"/package.json": "{
|
|
336
|
+
"name": "workspace",
|
|
337
|
+
"dependencies": {
|
|
338
|
+
"@rxap/components": "19.0.0-dev.0",
|
|
339
|
+
"@rxap/data-source": "19.0.0-dev.0",
|
|
340
|
+
"@rxap/directives": "19.0.0-dev.0",
|
|
341
|
+
"@rxap/form-system": "19.0.0-dev.0",
|
|
342
|
+
"@rxap/forms": "19.0.0-dev.0",
|
|
343
|
+
"@rxap/material-directives": "19.0.0-dev.0",
|
|
344
|
+
"@rxap/material-form-system": "19.0.0-dev.1",
|
|
345
|
+
"@rxap/material-table-system": "19.0.0-dev.1",
|
|
346
|
+
"@rxap/mixin": "16.0.11-dev.0",
|
|
347
|
+
"@rxap/nest-dto": "10.3.7-dev.1",
|
|
348
|
+
"@rxap/pattern": "1.1.10-dev.0",
|
|
349
|
+
"@rxap/reflect-metadata": "1.0.12-dev.0",
|
|
350
|
+
"@rxap/rxjs": "1.1.11-dev.0",
|
|
351
|
+
"@rxap/utilities": "16.4.1-dev.0",
|
|
352
|
+
"@rxap/window-system": "19.0.0-dev.0"
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
",
|
|
356
|
+
"/ui/lib/src/lib/test-table/test-table.component.html": "<div class="flex flex-col gap-y-4 m-4">
|
|
357
|
+
|
|
358
|
+
<div class="table-card-container flex flex-col">
|
|
359
|
+
<mat-card>
|
|
360
|
+
<mat-progress-bar
|
|
361
|
+
rxapCardProgressBar
|
|
362
|
+
[loading$]="tableDataSourceDirective.loading$"
|
|
363
|
+
></mat-progress-bar>
|
|
364
|
+
<mat-card-header class="min-h-full h-12">
|
|
365
|
+
<mat-card-title i18n>Test Table</mat-card-title>
|
|
366
|
+
<rxap-table-column-menu
|
|
367
|
+
matCard
|
|
368
|
+
#rxapTableColumns="rxapTableColumns"
|
|
369
|
+
>
|
|
370
|
+
<rxap-table-column-option name="name"
|
|
371
|
+
>
|
|
372
|
+
<ng-container i18n>Name</ng-container>
|
|
373
|
+
</rxap-table-column-option>
|
|
374
|
+
</rxap-table-column-menu>
|
|
375
|
+
</mat-card-header>
|
|
376
|
+
|
|
377
|
+
<mat-card-content>
|
|
378
|
+
<rxap-data-source-error
|
|
379
|
+
*ngIf="tableDataSourceDirective.hasError$ | async"
|
|
380
|
+
[dataSourceLike]="tableDataSourceDirective">
|
|
381
|
+
</rxap-data-source-error>
|
|
382
|
+
<div class="table-scroll-container mt-4 overflow-x-auto overscroll-auto">
|
|
383
|
+
<table
|
|
384
|
+
[ngClass]="{ 'hidden': tableDataSourceDirective.hasError$ | async }"
|
|
385
|
+
mat-table
|
|
386
|
+
#tableDataSourceDirective="rxapTableDataSource"
|
|
387
|
+
rxapTableDataSource
|
|
388
|
+
[parameters]="parameters"
|
|
389
|
+
id="test-table"
|
|
390
|
+
[paginator]="paginator"
|
|
391
|
+
>
|
|
392
|
+
<!-- region columns -->
|
|
393
|
+
<ng-container matColumnDef="name">
|
|
394
|
+
<th mat-header-cell
|
|
395
|
+
*matHeaderCellDef
|
|
396
|
+
>
|
|
397
|
+
<ng-container i18n>Name</ng-container>
|
|
398
|
+
</th>
|
|
399
|
+
<td *matCellDef="let element"
|
|
400
|
+
mat-cell
|
|
401
|
+
>
|
|
402
|
+
{{ element?.name }}
|
|
403
|
+
</td>
|
|
404
|
+
</ng-container>
|
|
405
|
+
|
|
406
|
+
|
|
407
|
+
<!-- endregion -->
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
<tr
|
|
412
|
+
mat-header-row
|
|
413
|
+
*matHeaderRowDef="rxapTableColumns.displayColumns"
|
|
414
|
+
></tr>
|
|
415
|
+
|
|
416
|
+
<tr
|
|
417
|
+
[@rowsAnimation]=""
|
|
418
|
+
mat-row
|
|
419
|
+
[ngClass]="{ 'rxap-row-odd !bg-neutral-200 dark:!bg-neutral-600': odd, 'rxap-row-even': even }"
|
|
420
|
+
class="hover:!bg-neutral-400 dark:hover:!bg-neutral-800"
|
|
421
|
+
*matRowDef="
|
|
422
|
+
let element;
|
|
423
|
+
columns: rxapTableColumns.displayColumns;
|
|
424
|
+
let odd = odd;
|
|
425
|
+
let even = even
|
|
426
|
+
"
|
|
427
|
+
></tr>
|
|
428
|
+
</table>
|
|
429
|
+
</div>
|
|
430
|
+
</mat-card-content>
|
|
431
|
+
<mat-card-footer>
|
|
432
|
+
<mat-paginator
|
|
433
|
+
[ngClass]="{ 'hidden': tableDataSourceDirective.hasError$ | async }"
|
|
434
|
+
class="m-4"
|
|
435
|
+
rxapPersistent
|
|
436
|
+
[pageSizeOptions]="[5,10,25,50,100]"
|
|
437
|
+
[pageSize]="10"
|
|
438
|
+
#paginator="matPaginator"
|
|
439
|
+
></mat-paginator>
|
|
440
|
+
</mat-card-footer>
|
|
441
|
+
</mat-card>
|
|
442
|
+
</div>
|
|
443
|
+
</div>
|
|
444
|
+
",
|
|
445
|
+
"/ui/lib/src/lib/test-table/test-table.component.scss": "",
|
|
446
|
+
"/ui/lib/src/lib/test-table/test-table.component.ts": "import { Component, ChangeDetectionStrategy, Input } from '@angular/core';
|
|
447
|
+
import { RowAnimation, TableColumnMenuModule, PersistentPaginatorDirective, TableDataSourceDirective, TABLE_REMOTE_METHOD_ADAPTER_FACTORY, RXAP_TABLE_METHOD } from '@rxap/material-table-system';
|
|
448
|
+
import { Observable } from 'rxjs';
|
|
449
|
+
import { MatPaginatorModule } from '@angular/material/paginator';
|
|
450
|
+
import { DataSourceErrorComponent } from '@rxap/data-source';
|
|
451
|
+
import { MatDividerModule } from '@angular/material/divider';
|
|
452
|
+
import { MatTableModule } from '@angular/material/table';
|
|
453
|
+
import { CardProgressBarDirective } from '@rxap/material-directives/card';
|
|
454
|
+
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
|
455
|
+
import { MatCardModule } from '@angular/material/card';
|
|
456
|
+
import { AsyncPipe, NgIf, NgClass } from '@angular/common';
|
|
457
|
+
import { GetPageAdapterFactory } from '@rxap/open-api/remote-method';
|
|
458
|
+
import { TestTableControllerGetPageRemoteMethod } from 'open-api-api-lib/src/lib/remote-methods';
|
|
459
|
+
|
|
460
|
+
@Component({
|
|
461
|
+
standalone: true,
|
|
462
|
+
selector: 'jest-test-table',
|
|
463
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
464
|
+
templateUrl: './test-table.component.html',
|
|
465
|
+
styleUrls: ['./test-table.component.scss'],
|
|
466
|
+
animations: [RowAnimation],
|
|
467
|
+
imports: [TableColumnMenuModule, MatPaginatorModule, PersistentPaginatorDirective, DataSourceErrorComponent, MatDividerModule, TableDataSourceDirective, MatTableModule, CardProgressBarDirective, MatProgressBarModule, MatCardModule, AsyncPipe, NgIf, NgClass],
|
|
468
|
+
providers: [{
|
|
469
|
+
provide: TABLE_REMOTE_METHOD_ADAPTER_FACTORY,
|
|
470
|
+
useValue: GetPageAdapterFactory
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
provide: RXAP_TABLE_METHOD,
|
|
474
|
+
useExisting: TestTableControllerGetPageRemoteMethod
|
|
475
|
+
},
|
|
476
|
+
],
|
|
477
|
+
})
|
|
478
|
+
export class TestTableComponent {
|
|
479
|
+
@Input()
|
|
480
|
+
public parameters?: Observable<Record<string, unknown>>;
|
|
481
|
+
}
|
|
482
|
+
",
|
|
483
|
+
"/ui/lib/src/lib/test-table/test-table.ts": "import { TableRowMetadata } from '@rxap/material-table-system';
|
|
484
|
+
import { TestTableControllerGetPageResponse } from 'open-api-api-lib/src/lib/responses';
|
|
485
|
+
|
|
486
|
+
export type ITestTable = TableRowMetadata & TestTableControllerGetPageResponse['rows'][number];
|
|
487
|
+
",
|
|
488
|
+
}
|
|
489
|
+
`;
|
|
490
|
+
|
|
75
491
|
exports[`table-component nestjs backend: ui-lib.module.ts 1`] = `
|
|
76
492
|
"import { NgModule } from '@angular/core';
|
|
77
493
|
@NgModule({})
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://
|
|
1
|
+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
|
2
2
|
|
|
3
3
|
exports[`tree-table-component minimal: file-tree 1`] = `
|
|
4
4
|
[
|
|
@@ -33,3 +33,149 @@ exports[`tree-table-component minimal: file-tree 1`] = `
|
|
|
33
33
|
"/ui/lib/tsconfig.lib.json",
|
|
34
34
|
]
|
|
35
35
|
`;
|
|
36
|
+
|
|
37
|
+
exports[`tree-table-component minimal: generated 1`] = `
|
|
38
|
+
{
|
|
39
|
+
"/ui/lib/src/lib/test-tree-table/test-tree-table.component.html": "<div class="flex flex-col gap-y-4 m-4">
|
|
40
|
+
|
|
41
|
+
<div class="table-card-container flex flex-col">
|
|
42
|
+
<mat-card>
|
|
43
|
+
<mat-progress-bar
|
|
44
|
+
rxapCardProgressBar
|
|
45
|
+
[loading$]="tableDataSourceDirective.loading$"
|
|
46
|
+
></mat-progress-bar>
|
|
47
|
+
<mat-card-header class="min-h-full h-12">
|
|
48
|
+
<mat-card-title i18n>Test Tree Table</mat-card-title>
|
|
49
|
+
<rxap-table-column-menu
|
|
50
|
+
matCard
|
|
51
|
+
#rxapTableColumns="rxapTableColumns"
|
|
52
|
+
>
|
|
53
|
+
<rxap-table-column-option name="tree"
|
|
54
|
+
hidden
|
|
55
|
+
>
|
|
56
|
+
<ng-container i18n>Tree</ng-container>
|
|
57
|
+
</rxap-table-column-option>
|
|
58
|
+
<rxap-table-column-option name="spinner"
|
|
59
|
+
hidden
|
|
60
|
+
>
|
|
61
|
+
<ng-container i18n>Spinner</ng-container>
|
|
62
|
+
</rxap-table-column-option>
|
|
63
|
+
</rxap-table-column-menu>
|
|
64
|
+
</mat-card-header>
|
|
65
|
+
|
|
66
|
+
<mat-card-content>
|
|
67
|
+
<rxap-data-source-error
|
|
68
|
+
*ngIf="tableDataSourceDirective.hasError$ | async"
|
|
69
|
+
[dataSourceLike]="tableDataSourceDirective">
|
|
70
|
+
</rxap-data-source-error>
|
|
71
|
+
<div class="table-scroll-container mt-4 overflow-x-auto overscroll-auto">
|
|
72
|
+
<table
|
|
73
|
+
[ngClass]="{ 'hidden': tableDataSourceDirective.hasError$ | async }"
|
|
74
|
+
mat-table
|
|
75
|
+
#tableDataSourceDirective="rxapTableDataSource"
|
|
76
|
+
rxapTableDataSource
|
|
77
|
+
[parameters]="parameters"
|
|
78
|
+
id="test-tree-table"
|
|
79
|
+
>
|
|
80
|
+
<!-- region columns -->
|
|
81
|
+
<ng-container matColumnDef="tree" [sticky]="true">
|
|
82
|
+
<th mat-header-cell
|
|
83
|
+
*matHeaderCellDef
|
|
84
|
+
class="drop-shadow-2xl"
|
|
85
|
+
></th>
|
|
86
|
+
<td
|
|
87
|
+
*matCellDef="let element"
|
|
88
|
+
[rxap-tree-control-cell]="element"
|
|
89
|
+
mat-cell
|
|
90
|
+
class="w-[100px] drop-shadow-2xl"
|
|
91
|
+
></td>
|
|
92
|
+
</ng-container>
|
|
93
|
+
|
|
94
|
+
<ng-container matColumnDef="spinner">
|
|
95
|
+
<th mat-header-cell
|
|
96
|
+
*matHeaderCellDef
|
|
97
|
+
></th>
|
|
98
|
+
<td *matCellDef="let element"
|
|
99
|
+
mat-cell
|
|
100
|
+
class="w-[15px] min-w-[15px]"
|
|
101
|
+
>
|
|
102
|
+
<mat-spinner
|
|
103
|
+
*ngIf="element.__metadata__?.loading$ | async; else noSpinner"
|
|
104
|
+
diameter="15"
|
|
105
|
+
></mat-spinner>
|
|
106
|
+
<ng-template #noSpinner>
|
|
107
|
+
<div class="w-[15px] h-[15px]"></div>
|
|
108
|
+
</ng-template>
|
|
109
|
+
</td>
|
|
110
|
+
</ng-container>
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
<!-- endregion -->
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
<tr
|
|
118
|
+
mat-header-row
|
|
119
|
+
*matHeaderRowDef="rxapTableColumns.displayColumns"
|
|
120
|
+
></tr>
|
|
121
|
+
|
|
122
|
+
<tr
|
|
123
|
+
[@rowsAnimation]=""
|
|
124
|
+
mat-row
|
|
125
|
+
[ngClass]="{ 'rxap-row-odd !bg-neutral-200 dark:!bg-neutral-600': odd, 'rxap-row-even': even }"
|
|
126
|
+
class="hover:!bg-neutral-400 dark:hover:!bg-neutral-800"
|
|
127
|
+
*matRowDef="
|
|
128
|
+
let element;
|
|
129
|
+
columns: rxapTableColumns.displayColumns;
|
|
130
|
+
let odd = odd;
|
|
131
|
+
let even = even
|
|
132
|
+
"
|
|
133
|
+
></tr>
|
|
134
|
+
</table>
|
|
135
|
+
</div>
|
|
136
|
+
</mat-card-content>
|
|
137
|
+
</mat-card>
|
|
138
|
+
</div>
|
|
139
|
+
</div>
|
|
140
|
+
",
|
|
141
|
+
"/ui/lib/src/lib/test-tree-table/test-tree-table.component.scss": "",
|
|
142
|
+
"/ui/lib/src/lib/test-tree-table/test-tree-table.component.ts": "import { Component, ChangeDetectionStrategy, Input } from '@angular/core';
|
|
143
|
+
import { RowAnimation, TableColumnMenuModule, PersistentPaginatorDirective, TableDataSourceDirective, TreeControlCellComponent, TABLE_DATA_SOURCE } from '@rxap/material-table-system';
|
|
144
|
+
import { Observable } from 'rxjs';
|
|
145
|
+
import { DataSourceErrorComponent } from '@rxap/data-source';
|
|
146
|
+
import { MatDividerModule } from '@angular/material/divider';
|
|
147
|
+
import { MatTableModule } from '@angular/material/table';
|
|
148
|
+
import { CardProgressBarDirective } from '@rxap/material-directives/card';
|
|
149
|
+
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
|
150
|
+
import { MatCardModule } from '@angular/material/card';
|
|
151
|
+
import { AsyncPipe, NgIf, NgClass } from '@angular/common';
|
|
152
|
+
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
153
|
+
import { TreeTableDataSource } from '@rxap/data-source/table/tree';
|
|
154
|
+
|
|
155
|
+
@Component({
|
|
156
|
+
standalone: true,
|
|
157
|
+
selector: 'jest-test-tree-table',
|
|
158
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
159
|
+
templateUrl: './test-tree-table.component.html',
|
|
160
|
+
styleUrls: ['./test-tree-table.component.scss'],
|
|
161
|
+
animations: [RowAnimation],
|
|
162
|
+
imports: [TableColumnMenuModule, PersistentPaginatorDirective, DataSourceErrorComponent, MatDividerModule, TableDataSourceDirective, MatTableModule, CardProgressBarDirective, MatProgressBarModule, MatCardModule, AsyncPipe, NgIf, NgClass, TreeControlCellComponent, MatProgressSpinnerModule],
|
|
163
|
+
providers: [{
|
|
164
|
+
provide: TABLE_DATA_SOURCE,
|
|
165
|
+
useClass: TreeTableDataSource
|
|
166
|
+
}],
|
|
167
|
+
})
|
|
168
|
+
export class TestTreeTableComponent {
|
|
169
|
+
@Input()
|
|
170
|
+
public parameters?: Observable<Record<string, unknown>>;
|
|
171
|
+
}
|
|
172
|
+
",
|
|
173
|
+
"/ui/lib/src/lib/test-tree-table/test-tree-table.ts": "import { IconConfig } from '@rxap/utilities';
|
|
174
|
+
import { TableRowMetadata } from '@rxap/material-table-system';
|
|
175
|
+
|
|
176
|
+
export interface ITestTreeTable extends Record<string, unknown>, TableRowMetadata {
|
|
177
|
+
icon: IconConfig;
|
|
178
|
+
}
|
|
179
|
+
",
|
|
180
|
+
}
|
|
181
|
+
`;
|