@rxap/schematic-angular 19.3.1 → 21.0.1-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +42 -0
- package/package.json +10 -10
- package/src/lib/coerce-minimum-table-component.js +12 -7
- package/src/lib/coerce-minimum-table-component.js.map +1 -1
- package/src/lib/form/control/table-select-form-control.js +4 -4
- package/src/lib/form/control/table-select-form-control.js.map +1 -1
- package/src/lib/rules/table-cell-component-rule.js +2 -3
- package/src/lib/rules/table-cell-component-rule.js.map +1 -1
- 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/accordion-component/files/component/__componentName__.component.html.hbs +10 -7
- package/src/schematics/accordion/accordion-item-component/files/component/__componentName__.component.html.template +3 -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-data-grid-component/files/data-grid-collection/__componentName__.component.html.template +6 -5
- 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/accordion/templates/switch-accordion-item.hbs +10 -10
- 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/data-grid-component/component-rule.js +14 -6
- package/src/schematics/data-grid-component/component-rule.js.map +1 -1
- package/src/schematics/data-grid-component/files/component/__componentName__.component.html.hbs +1 -1
- package/src/schematics/dialog-component/__snapshots__/index.spec.ts.snap +57 -8
- package/src/schematics/dialog-component/__snapshots__/normalize-dialog-component-options.spec.ts.snap +1 -1
- package/src/schematics/dialog-component/files/component/__componentName__.component.html.template +3 -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 +37 -5
- 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 +37 -5
- 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 +66 -1
- package/src/schematics/form/form-component/__snapshots__/normalize-form-component-options.spec.ts.snap +1 -1
- package/src/schematics/form/form-component/coerce-form-component.js +1 -1
- package/src/schematics/form/form-component/coerce-form-component.js.map +1 -1
- package/src/schematics/form/form-component/files/window/open-__componentName__-window.method.ts.template +26 -16
- 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 +43 -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-component/files/component/__componentName__.component.html.hbs +14 -11
- package/src/schematics/table/table-component/select-column-rule.js +3 -1
- package/src/schematics/table/table-component/select-column-rule.js.map +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/templates/spinner-table-column.hbs +5 -7
- package/src/schematics/table/tree-table-component/__snapshots__/index.spec.ts.snap +145 -1
- package/src/schematics/table/tree-table-component/files/component/__componentName__.component.html.hbs +14 -11
- 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
|
@@ -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,147 @@ 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
|
+
@if (tableDataSourceDirective.hasError$ | async) {
|
|
68
|
+
<rxap-data-source-error
|
|
69
|
+
[dataSourceLike]="tableDataSourceDirective">
|
|
70
|
+
</rxap-data-source-error>
|
|
71
|
+
}
|
|
72
|
+
<div class="table-scroll-container mt-4 overflow-x-auto overscroll-auto">
|
|
73
|
+
<table
|
|
74
|
+
[class.hidden]="tableDataSourceDirective.hasError$ | async"
|
|
75
|
+
mat-table
|
|
76
|
+
#tableDataSourceDirective="rxapTableDataSource"
|
|
77
|
+
rxapTableDataSource
|
|
78
|
+
[parameters]="parameters()"
|
|
79
|
+
id="test-tree-table"
|
|
80
|
+
>
|
|
81
|
+
<!-- region columns -->
|
|
82
|
+
<ng-container matColumnDef="tree" [sticky]="true">
|
|
83
|
+
<th mat-header-cell
|
|
84
|
+
*matHeaderCellDef
|
|
85
|
+
class="drop-shadow-2xl"
|
|
86
|
+
></th>
|
|
87
|
+
<td
|
|
88
|
+
*matCellDef="let element"
|
|
89
|
+
[rxap-tree-control-cell]="element"
|
|
90
|
+
mat-cell
|
|
91
|
+
class="w-[100px] drop-shadow-2xl"
|
|
92
|
+
></td>
|
|
93
|
+
</ng-container>
|
|
94
|
+
|
|
95
|
+
<ng-container matColumnDef="spinner">
|
|
96
|
+
<th mat-header-cell
|
|
97
|
+
*matHeaderCellDef
|
|
98
|
+
></th>
|
|
99
|
+
<td *matCellDef="let element"
|
|
100
|
+
mat-cell
|
|
101
|
+
class="w-[15px] min-w-[15px]"
|
|
102
|
+
>
|
|
103
|
+
@if (element.__metadata__?.loading$ | async) {
|
|
104
|
+
<mat-spinner diameter="15"></mat-spinner>
|
|
105
|
+
} @else {
|
|
106
|
+
<div class="w-[15px] h-[15px]"></div>
|
|
107
|
+
}
|
|
108
|
+
</td>
|
|
109
|
+
</ng-container>
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
<!-- endregion -->
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
<tr
|
|
117
|
+
mat-header-row
|
|
118
|
+
*matHeaderRowDef="rxapTableColumns.displayColumns()"
|
|
119
|
+
></tr>
|
|
120
|
+
|
|
121
|
+
<tr
|
|
122
|
+
[@rowsAnimation]=""
|
|
123
|
+
mat-row
|
|
124
|
+
[ngClass]="{ 'rxap-row-odd !bg-neutral-200 dark:!bg-neutral-600': odd, 'rxap-row-even': even }"
|
|
125
|
+
class="hover:!bg-neutral-400 dark:hover:!bg-neutral-800"
|
|
126
|
+
*matRowDef="
|
|
127
|
+
let element;
|
|
128
|
+
columns: rxapTableColumns.displayColumns();
|
|
129
|
+
let odd = odd;
|
|
130
|
+
let even = even
|
|
131
|
+
"
|
|
132
|
+
></tr>
|
|
133
|
+
</table>
|
|
134
|
+
</div>
|
|
135
|
+
</mat-card-content>
|
|
136
|
+
</mat-card>
|
|
137
|
+
</div>
|
|
138
|
+
</div>
|
|
139
|
+
",
|
|
140
|
+
"/ui/lib/src/lib/test-tree-table/test-tree-table.component.scss": "",
|
|
141
|
+
"/ui/lib/src/lib/test-tree-table/test-tree-table.component.ts": "import { Component, ChangeDetectionStrategy, input } from '@angular/core';
|
|
142
|
+
import { RowAnimation, TableColumnMenuComponent, TableColumnOptionComponent, PersistentPaginatorDirective, TableDataSourceDirective, TreeControlCellComponent, TABLE_DATA_SOURCE } from '@rxap/material-table-system';
|
|
143
|
+
import { Observable } from 'rxjs';
|
|
144
|
+
import { DataSourceErrorComponent } from '@rxap/data-source';
|
|
145
|
+
import { MatDividerModule } from '@angular/material/divider';
|
|
146
|
+
import { MatTableModule } from '@angular/material/table';
|
|
147
|
+
import { CardProgressBarDirective } from '@rxap/material-directives/card';
|
|
148
|
+
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
|
149
|
+
import { MatCardModule } from '@angular/material/card';
|
|
150
|
+
import { AsyncPipe, NgIf, NgClass } from '@angular/common';
|
|
151
|
+
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
152
|
+
import { TreeTableDataSource } from '@rxap/data-source/table/tree';
|
|
153
|
+
|
|
154
|
+
@Component({
|
|
155
|
+
standalone: true,
|
|
156
|
+
selector: 'jest-test-tree-table',
|
|
157
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
158
|
+
templateUrl: './test-tree-table.component.html',
|
|
159
|
+
styleUrls: ['./test-tree-table.component.scss'],
|
|
160
|
+
animations: [RowAnimation],
|
|
161
|
+
imports: [TableColumnMenuComponent, TableColumnOptionComponent, PersistentPaginatorDirective, DataSourceErrorComponent, MatDividerModule, TableDataSourceDirective, MatTableModule, CardProgressBarDirective, MatProgressBarModule, MatCardModule, AsyncPipe, NgIf, NgClass, TreeControlCellComponent, MatProgressSpinnerModule],
|
|
162
|
+
providers: [{
|
|
163
|
+
provide: TABLE_DATA_SOURCE,
|
|
164
|
+
useClass: TreeTableDataSource
|
|
165
|
+
}],
|
|
166
|
+
})
|
|
167
|
+
export class TestTreeTableComponent {
|
|
168
|
+
public readonly parameters = input<Observable<Record<string, unknown>>>();
|
|
169
|
+
}
|
|
170
|
+
",
|
|
171
|
+
"/ui/lib/src/lib/test-tree-table/test-tree-table.ts": "import { IconConfig } from '@rxap/utilities';
|
|
172
|
+
import { TableRowMetadata } from '@rxap/material-table-system';
|
|
173
|
+
|
|
174
|
+
export interface ITestTreeTable extends Record<string, unknown>, TableRowMetadata {
|
|
175
|
+
icon: IconConfig;
|
|
176
|
+
}
|
|
177
|
+
",
|
|
178
|
+
}
|
|
179
|
+
`;
|
|
@@ -81,20 +81,21 @@
|
|
|
81
81
|
</mat-card-header>
|
|
82
82
|
|
|
83
83
|
<mat-card-content>
|
|
84
|
+
@if (tableDataSourceDirective.hasError$ | async) {
|
|
84
85
|
<rxap-data-source-error
|
|
85
|
-
*ngIf="tableDataSourceDirective.hasError$ | async"
|
|
86
86
|
[dataSourceLike]="tableDataSourceDirective">
|
|
87
87
|
</rxap-data-source-error>
|
|
88
|
+
}
|
|
88
89
|
<div class="table-scroll-container mt-4 overflow-x-auto overscroll-auto">
|
|
89
90
|
<table
|
|
90
|
-
[
|
|
91
|
+
[class.hidden]="tableDataSourceDirective.hasError$ | async"
|
|
91
92
|
mat-table
|
|
92
93
|
#tableDataSourceDirective="rxapTableDataSource"
|
|
93
94
|
{{#ifeq backend "data-source"}}
|
|
94
|
-
[dataSource]="dataSource"
|
|
95
|
+
[dataSource]="dataSource()"
|
|
95
96
|
{{/ifeq}}
|
|
96
97
|
rxapTableDataSource
|
|
97
|
-
[parameters]="parameters"
|
|
98
|
+
[parameters]="parameters()"
|
|
98
99
|
id="{{name}}"
|
|
99
100
|
{{#if cssClass}}
|
|
100
101
|
{{> cssClass cssClass=cssClass}}
|
|
@@ -144,6 +145,7 @@
|
|
|
144
145
|
<div class="flex flex-row" *rxapSelectedRows="let selected">
|
|
145
146
|
{{#each actionList}}
|
|
146
147
|
{{#if this.inHeader}}
|
|
148
|
+
@if (selected | rxapRowActionCheck:'{{this.type}}') {
|
|
147
149
|
<button
|
|
148
150
|
rxapTableRowHeaderAction="{{this.type}}"
|
|
149
151
|
mat-icon-button
|
|
@@ -153,7 +155,6 @@
|
|
|
153
155
|
{{#if this.cssClass}}
|
|
154
156
|
{{> cssClass cssClass=this.cssClass}}
|
|
155
157
|
{{/if}}
|
|
156
|
-
*ngIf="selected | rxapRowActionCheck:'{{this.type}}'"
|
|
157
158
|
{{#if this.permission}}
|
|
158
159
|
rxapHasEnablePermission="{{this.permission}}"
|
|
159
160
|
{{/if}}
|
|
@@ -171,6 +172,7 @@
|
|
|
171
172
|
mode="indeterminate"
|
|
172
173
|
></mat-progress-bar>
|
|
173
174
|
</button>
|
|
175
|
+
}
|
|
174
176
|
{{/if}}
|
|
175
177
|
{{/each}}
|
|
176
178
|
</div>
|
|
@@ -182,6 +184,7 @@
|
|
|
182
184
|
<td class="drop-shadow-2xl" mat-cell *matCellDef="let element">
|
|
183
185
|
<div class="flex flex-row">
|
|
184
186
|
{{#each actionList}}
|
|
187
|
+
@if (element | rxapRowActionCheck:'{{this.type}}') {
|
|
185
188
|
<button
|
|
186
189
|
rxapTableRowAction="{{this.type}}"
|
|
187
190
|
[element]="element"
|
|
@@ -192,7 +195,6 @@
|
|
|
192
195
|
{{> cssClass cssClass=this.cssClass}}
|
|
193
196
|
{{/if}}
|
|
194
197
|
mat-icon-button
|
|
195
|
-
*ngIf="element | rxapRowActionCheck:'{{this.type}}'"
|
|
196
198
|
{{#if this.permission}}
|
|
197
199
|
rxapHasEnablePermission="{{this.permission}}"
|
|
198
200
|
{{/if}}
|
|
@@ -210,6 +212,7 @@
|
|
|
210
212
|
mode="indeterminate"
|
|
211
213
|
></mat-progress-bar>
|
|
212
214
|
</button>
|
|
215
|
+
}
|
|
213
216
|
{{/each}}
|
|
214
217
|
</div>
|
|
215
218
|
</td>
|
|
@@ -224,7 +227,7 @@
|
|
|
224
227
|
<!-- endregion -->
|
|
225
228
|
{{#if hasCustomFilter}}
|
|
226
229
|
<ng-container matColumnDef="custom_filter">
|
|
227
|
-
<th *matHeaderCellDef [colSpan]="rxapTableColumns.displayColumns.length" mat-header-cell>
|
|
230
|
+
<th *matHeaderCellDef [colSpan]="rxapTableColumns.displayColumns().length" mat-header-cell>
|
|
228
231
|
<div class="flex flex-row gap-6">
|
|
229
232
|
{{#each filterList}}
|
|
230
233
|
{{ indent (compile this.handlebars control=this prefix=../prefix) 16 }}
|
|
@@ -271,14 +274,14 @@
|
|
|
271
274
|
<tr
|
|
272
275
|
class="rxap-filter-header"
|
|
273
276
|
mat-header-row
|
|
274
|
-
*matHeaderRowDef="rxapTableColumns.displayColumns | toFilterColumnNames"
|
|
277
|
+
*matHeaderRowDef="rxapTableColumns.displayColumns() | toFilterColumnNames"
|
|
275
278
|
></tr>
|
|
276
279
|
{{/if}}
|
|
277
280
|
|
|
278
281
|
{{#if withHeader}}
|
|
279
282
|
<tr
|
|
280
283
|
mat-header-row
|
|
281
|
-
*matHeaderRowDef="rxapTableColumns.displayColumns"
|
|
284
|
+
*matHeaderRowDef="rxapTableColumns.displayColumns()"
|
|
282
285
|
></tr>
|
|
283
286
|
{{/if}}
|
|
284
287
|
|
|
@@ -289,7 +292,7 @@
|
|
|
289
292
|
class="hover:!bg-neutral-400 dark:hover:!bg-neutral-800"
|
|
290
293
|
*matRowDef="
|
|
291
294
|
let element;
|
|
292
|
-
columns: rxapTableColumns.displayColumns;
|
|
295
|
+
columns: rxapTableColumns.displayColumns();
|
|
293
296
|
let odd = odd;
|
|
294
297
|
let even = even
|
|
295
298
|
"
|
|
@@ -300,7 +303,7 @@
|
|
|
300
303
|
{{#if hasPaginator}}
|
|
301
304
|
<mat-card-footer>
|
|
302
305
|
<mat-paginator
|
|
303
|
-
[
|
|
306
|
+
[class.hidden]="tableDataSourceDirective.hasError$ | async"
|
|
304
307
|
rxapPersistent
|
|
305
308
|
[pageSizeOptions]="[5,10,25,50,100]"
|
|
306
309
|
[pageSize]="10"
|