@rxap/schematic-angular 16.1.0-dev.41 → 16.1.0-dev.42
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 +6 -0
- package/package.json +1 -2
- package/src/lib/table-column.d.ts +9 -0
- package/src/lib/table-column.js +42 -2
- package/src/lib/table-column.js.map +1 -1
- package/src/schematics/accordion/item/accordion-item-table-component/schema.json +32 -0
- package/src/schematics/accordion/item/accordion-item-tree-table-component/schema.json +32 -0
- package/src/schematics/table/table-component/files/component/__componentName__.component.html.template +9 -1
- package/src/schematics/table/table-component/files/component/__componentName__.component.ts.template +8 -2
- package/src/schematics/table/table-component/schema.json +32 -0
- package/src/schematics/table/tree-table-component/files/component/__componentName__.component.html.template +9 -1
- package/src/schematics/table/tree-table-component/files/component/__componentName__.component.ts.template +6 -0
- package/src/schematics/table/tree-table-component/schema.json +32 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [16.1.0-dev.42](https://gitlab.com/rxap/packages/compare/@rxap/schematic-angular@16.1.0-dev.41...@rxap/schematic-angular@16.1.0-dev.42) (2023-11-17)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- ensure the custom component are imported ([9757656](https://gitlab.com/rxap/packages/commit/9757656618ea6723dfd0b348a1ea25c3700032c2))
|
|
11
|
+
|
|
6
12
|
# [16.1.0-dev.41](https://gitlab.com/rxap/packages/compare/@rxap/schematic-angular@16.1.0-dev.40...@rxap/schematic-angular@16.1.0-dev.41) (2023-11-17)
|
|
7
13
|
|
|
8
14
|
### Bug Fixes
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "16.1.0-dev.
|
|
2
|
+
"version": "16.1.0-dev.42",
|
|
3
3
|
"name": "@rxap/schematic-angular",
|
|
4
4
|
"license": "GPL-3.0-or-later",
|
|
5
5
|
"dependencies": {
|
|
@@ -69,7 +69,6 @@
|
|
|
69
69
|
},
|
|
70
70
|
"schematics": "./collection.json",
|
|
71
71
|
"type": "commonjs",
|
|
72
|
-
"gitHead": "01340d5d8ef7f79fcd0bebd54d542bff0a4b536e",
|
|
73
72
|
"main": "./src/index.js",
|
|
74
73
|
"types": "./src/index.d.ts"
|
|
75
74
|
}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { Normalized } from '@rxap/utilities';
|
|
2
|
+
export interface TableColumnPipe {
|
|
3
|
+
name: string;
|
|
4
|
+
className: string;
|
|
5
|
+
importFrom: string;
|
|
6
|
+
}
|
|
2
7
|
export interface TableColumn {
|
|
3
8
|
name: string;
|
|
4
9
|
type?: string;
|
|
@@ -13,10 +18,14 @@ export interface TableColumn {
|
|
|
13
18
|
nowrap?: boolean;
|
|
14
19
|
cssClass?: string;
|
|
15
20
|
role?: string;
|
|
21
|
+
template?: string;
|
|
22
|
+
pipeList?: Array<TableColumnPipe | string>;
|
|
16
23
|
}
|
|
17
24
|
export interface NormalizedTableColumn extends Readonly<Normalized<TableColumn>> {
|
|
18
25
|
type: string;
|
|
19
26
|
propertyPath: string;
|
|
27
|
+
pipeList: TableColumnPipe[];
|
|
20
28
|
}
|
|
29
|
+
export declare function NormalizeTableColumnPipe(pipe: string | TableColumnPipe): TableColumnPipe;
|
|
21
30
|
export declare function NormalizeTableColumn(column: Readonly<TableColumn> | string): NormalizedTableColumn;
|
|
22
31
|
export declare function NormalizeTableColumnList(columnList?: ReadonlyArray<string | Readonly<TableColumn>>): Array<NormalizedTableColumn>;
|
package/src/lib/table-column.js
CHANGED
|
@@ -1,9 +1,43 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NormalizeTableColumnList = exports.NormalizeTableColumn = void 0;
|
|
3
|
+
exports.NormalizeTableColumnList = exports.NormalizeTableColumn = exports.NormalizeTableColumnPipe = void 0;
|
|
4
4
|
const schematics_utilities_1 = require("@rxap/schematics-utilities");
|
|
5
|
+
function NormalizeTableColumnPipe(pipe) {
|
|
6
|
+
if (typeof pipe === 'string') {
|
|
7
|
+
switch (pipe) {
|
|
8
|
+
case 'async':
|
|
9
|
+
return {
|
|
10
|
+
name: 'async',
|
|
11
|
+
className: 'AsyncPipe',
|
|
12
|
+
importFrom: '@angular/common',
|
|
13
|
+
};
|
|
14
|
+
case 'date':
|
|
15
|
+
return {
|
|
16
|
+
name: 'date',
|
|
17
|
+
className: 'DatePipe',
|
|
18
|
+
importFrom: '@angular/common',
|
|
19
|
+
};
|
|
20
|
+
case 'json':
|
|
21
|
+
return {
|
|
22
|
+
name: 'json',
|
|
23
|
+
className: 'JsonPipe',
|
|
24
|
+
importFrom: '@angular/common',
|
|
25
|
+
};
|
|
26
|
+
case 'keyvalue':
|
|
27
|
+
return {
|
|
28
|
+
name: 'keyvalue',
|
|
29
|
+
className: 'KeyValuePipe',
|
|
30
|
+
importFrom: '@angular/common',
|
|
31
|
+
};
|
|
32
|
+
default:
|
|
33
|
+
throw new Error(`Unknown pipe ${pipe}`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return pipe;
|
|
37
|
+
}
|
|
38
|
+
exports.NormalizeTableColumnPipe = NormalizeTableColumnPipe;
|
|
5
39
|
function NormalizeTableColumn(column) {
|
|
6
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
40
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
7
41
|
let name;
|
|
8
42
|
let type = 'unknown';
|
|
9
43
|
let modifiers = [];
|
|
@@ -17,6 +51,8 @@ function NormalizeTableColumn(column) {
|
|
|
17
51
|
let nowrap = false;
|
|
18
52
|
let cssClass = null;
|
|
19
53
|
let role = null;
|
|
54
|
+
let template = null;
|
|
55
|
+
let pipeList = [];
|
|
20
56
|
if (typeof column === 'string') {
|
|
21
57
|
// name:type:modifier1,modifier2
|
|
22
58
|
// username:string:filter,active
|
|
@@ -42,6 +78,8 @@ function NormalizeTableColumn(column) {
|
|
|
42
78
|
nowrap = (_k = column.nowrap) !== null && _k !== void 0 ? _k : false;
|
|
43
79
|
cssClass = (_l = column.cssClass) !== null && _l !== void 0 ? _l : cssClass;
|
|
44
80
|
role = (_m = column.role) !== null && _m !== void 0 ? _m : role;
|
|
81
|
+
template = (_o = column.template) !== null && _o !== void 0 ? _o : template;
|
|
82
|
+
pipeList = ((_p = column.pipeList) !== null && _p !== void 0 ? _p : pipeList).map(NormalizeTableColumnPipe);
|
|
45
83
|
}
|
|
46
84
|
propertyPath !== null && propertyPath !== void 0 ? propertyPath : (propertyPath = name
|
|
47
85
|
.replace(/\?\./g, '.')
|
|
@@ -100,6 +138,8 @@ function NormalizeTableColumn(column) {
|
|
|
100
138
|
show,
|
|
101
139
|
nowrap,
|
|
102
140
|
cssClass,
|
|
141
|
+
pipeList,
|
|
142
|
+
template,
|
|
103
143
|
});
|
|
104
144
|
}
|
|
105
145
|
exports.NormalizeTableColumn = NormalizeTableColumn;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-column.js","sourceRoot":"","sources":["../../../../../../packages/schematic/angular/src/lib/table-column.ts"],"names":[],"mappings":";;;AAAA,qEAIoC;
|
|
1
|
+
{"version":3,"file":"table-column.js","sourceRoot":"","sources":["../../../../../../packages/schematic/angular/src/lib/table-column.ts"],"names":[],"mappings":";;;AAAA,qEAIoC;AAiCpC,SAAgB,wBAAwB,CAAC,IAA8B;IACrE,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;QAC5B,QAAQ,IAAI,EAAE;YACZ,KAAK,OAAO;gBACV,OAAO;oBACL,IAAI,EAAE,OAAO;oBACb,SAAS,EAAE,WAAW;oBACtB,UAAU,EAAE,iBAAiB;iBAC9B,CAAC;YACJ,K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eAAe,CAAC;gBACvB,MAAM;YACR,KAAK,MAAM;gBACT,IAAI,GAAG,QAAQ,CAAC;gBAChB,MAAM;YACR,KAAK,MAAM;gBACT,iCAAiC;gBACjC,IAAI,GAAG,KAAK,CAAC;gBACb,MAAM;YACR,KAAK,SAAS;gBACZ,IAAI,GAAG,SAAS,CAAC;gBACjB,MAAM;SACT;KACF;IACD,IAAI,aAAJ,IAAI,cAAJ,IAAI,IAAJ,IAAI,GAAK,SAAS,EAAC;IACnB,IAAI,MAAM,EAAE;QACV,IAAI,CAAC,QAAQ,EAAE;YACb,QAAQ,GAAG,QAAQ,CAAC;SACrB;aAAM;YACL,QAAQ,IAAI,SAAS,CAAC;SACvB;KACF;IACD,OAAO,MAAM,CAAC,IAAI,CAAC;QACjB,IAAI;QACJ,IAAI;QACJ,IAAI;QACJ,SAAS;QACT,SAAS;QACT,KAAK;QACL,YAAY;QACZ,MAAM;QACN,MAAM;QACN,QAAQ;QACR,IAAI;QACJ,MAAM;QACN,QAAQ;QACR,QAAQ;QACR,QAAQ;KACT,CAAC,CAAC;AACL,CAAC;AA1GD,oDA0GC;AAED,SAAgB,wBAAwB,CACtC,UAA0D;;IAE1D,OAAO,MAAM,CAAC,IAAI,CAAC,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,GAAG,CAAC,oBAAoB,CAAC,mCAAI,EAAE,CAAC,CAAC;AAClE,CAAC;AAJD,4DAIC"}
|
|
@@ -131,6 +131,38 @@
|
|
|
131
131
|
"type": "string"
|
|
132
132
|
}
|
|
133
133
|
},
|
|
134
|
+
"template": {
|
|
135
|
+
"type": "string"
|
|
136
|
+
},
|
|
137
|
+
"pipeList": {
|
|
138
|
+
"type": "array",
|
|
139
|
+
"items": {
|
|
140
|
+
"oneOf": [
|
|
141
|
+
{
|
|
142
|
+
"type": "string"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"type": "object",
|
|
146
|
+
"properties": {
|
|
147
|
+
"name": {
|
|
148
|
+
"type": "string"
|
|
149
|
+
},
|
|
150
|
+
"className": {
|
|
151
|
+
"type": "string"
|
|
152
|
+
},
|
|
153
|
+
"importFrom": {
|
|
154
|
+
"type": "string"
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
"required": [
|
|
158
|
+
"name",
|
|
159
|
+
"className",
|
|
160
|
+
"importFrom"
|
|
161
|
+
]
|
|
162
|
+
}
|
|
163
|
+
]
|
|
164
|
+
}
|
|
165
|
+
},
|
|
134
166
|
"hasFilter": {
|
|
135
167
|
"type": "boolean"
|
|
136
168
|
},
|
|
@@ -144,6 +144,38 @@
|
|
|
144
144
|
"type": "string"
|
|
145
145
|
}
|
|
146
146
|
},
|
|
147
|
+
"template": {
|
|
148
|
+
"type": "string"
|
|
149
|
+
},
|
|
150
|
+
"pipeList": {
|
|
151
|
+
"type": "array",
|
|
152
|
+
"items": {
|
|
153
|
+
"oneOf": [
|
|
154
|
+
{
|
|
155
|
+
"type": "string"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"type": "object",
|
|
159
|
+
"properties": {
|
|
160
|
+
"name": {
|
|
161
|
+
"type": "string"
|
|
162
|
+
},
|
|
163
|
+
"className": {
|
|
164
|
+
"type": "string"
|
|
165
|
+
},
|
|
166
|
+
"importFrom": {
|
|
167
|
+
"type": "string"
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
"required": [
|
|
171
|
+
"name",
|
|
172
|
+
"className",
|
|
173
|
+
"importFrom"
|
|
174
|
+
]
|
|
175
|
+
}
|
|
176
|
+
]
|
|
177
|
+
}
|
|
178
|
+
},
|
|
147
179
|
"hasFilter": {
|
|
148
180
|
"type": "boolean"
|
|
149
181
|
},
|
|
@@ -193,7 +193,15 @@
|
|
|
193
193
|
<ng-container i18n><%= column.title %></ng-container>
|
|
194
194
|
</th>
|
|
195
195
|
|
|
196
|
-
<td mat-cell <% if (column.cssClass) { %>class="<%= column.cssClass %>"<% } %> *matCellDef="let element">
|
|
196
|
+
<td mat-cell <% if (column.cssClass) { %>class="<%= column.cssClass %>"<% } %> *matCellDef="let element">
|
|
197
|
+
<% if (column.template) { %>
|
|
198
|
+
<%= column.template %>
|
|
199
|
+
<% } else if (column.pipeList.length) { %>
|
|
200
|
+
{{ element?.<%= column.propertyPath %><% for (const pipe of column.pipeList) { %> | <%= pipe.name %><% } %> }}
|
|
201
|
+
<% } else { %>
|
|
202
|
+
{{ element?.<%= column.propertyPath %> }}
|
|
203
|
+
<% } %>
|
|
204
|
+
</td>
|
|
197
205
|
</ng-container>
|
|
198
206
|
<% } %>
|
|
199
207
|
<% } %>
|
package/src/schematics/table/table-component/files/component/__componentName__.component.ts.template
CHANGED
|
@@ -40,9 +40,12 @@ import { DataSourceErrorComponent } from '@rxap/data-source';
|
|
|
40
40
|
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
41
41
|
import { MatSnackBarModule } from '@angular/material/snack-bar';
|
|
42
42
|
<% for (const column of columnList) { %>
|
|
43
|
-
<% if (column.
|
|
43
|
+
<% if (column.role === 'component') { %>
|
|
44
44
|
import { <%= classify(column.name) %>Component } from './<%= dasherize(column.name) %>-component/<%= dasherize(column.name) %>.component';
|
|
45
45
|
<% } %>
|
|
46
|
+
<% for (const pipe of column.pipeList) { %>
|
|
47
|
+
import { <%= pipe.className %> } from '<%= pipe.importFrom %>';
|
|
48
|
+
<% } %>
|
|
46
49
|
<% } %>
|
|
47
50
|
|
|
48
51
|
@Component({
|
|
@@ -54,9 +57,12 @@ import { <%= classify(column.name) %>Component } from './<%= dasherize(column.na
|
|
|
54
57
|
standalone: true,
|
|
55
58
|
imports: [
|
|
56
59
|
<% for (const column of columnList) { %>
|
|
57
|
-
<% if (column.
|
|
60
|
+
<% if (column.role === 'component') { %>
|
|
58
61
|
<%= classify(column.name) %>Component,
|
|
59
62
|
<% } %>
|
|
63
|
+
<% for (const pipe of column.pipeList) { %>
|
|
64
|
+
<%= pipe.className %>,
|
|
65
|
+
<% } %>
|
|
60
66
|
<% } %>
|
|
61
67
|
CommonModule,
|
|
62
68
|
MatCardModule,
|
|
@@ -128,6 +128,38 @@
|
|
|
128
128
|
"type": "string"
|
|
129
129
|
}
|
|
130
130
|
},
|
|
131
|
+
"template": {
|
|
132
|
+
"type": "string"
|
|
133
|
+
},
|
|
134
|
+
"pipeList": {
|
|
135
|
+
"type": "array",
|
|
136
|
+
"items": {
|
|
137
|
+
"oneOf": [
|
|
138
|
+
{
|
|
139
|
+
"type": "string"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"type": "object",
|
|
143
|
+
"properties": {
|
|
144
|
+
"name": {
|
|
145
|
+
"type": "string"
|
|
146
|
+
},
|
|
147
|
+
"className": {
|
|
148
|
+
"type": "string"
|
|
149
|
+
},
|
|
150
|
+
"importFrom": {
|
|
151
|
+
"type": "string"
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
"required": [
|
|
155
|
+
"name",
|
|
156
|
+
"className",
|
|
157
|
+
"importFrom"
|
|
158
|
+
]
|
|
159
|
+
}
|
|
160
|
+
]
|
|
161
|
+
}
|
|
162
|
+
},
|
|
131
163
|
"hasFilter": {
|
|
132
164
|
"type": "boolean"
|
|
133
165
|
},
|
|
@@ -173,7 +173,15 @@
|
|
|
173
173
|
<ng-container i18n><%= column.title %></ng-container>
|
|
174
174
|
</th>
|
|
175
175
|
|
|
176
|
-
<td mat-cell <% if (column.cssClass) { %>class="<%= column.cssClass %>"<% } %> *matCellDef="let element">
|
|
176
|
+
<td mat-cell <% if (column.cssClass) { %>class="<%= column.cssClass %>"<% } %> *matCellDef="let element">
|
|
177
|
+
<% if (column.template) { %>
|
|
178
|
+
<%= column.template %>
|
|
179
|
+
<% } else if (column.pipeList.length) { %>
|
|
180
|
+
{{ element?.<%= column.propertyPath %><% for (const pipe of column.pipeList) { %> | <%= pipe.name %><% } %> }}
|
|
181
|
+
<% } else { %>
|
|
182
|
+
{{ element?.<%= column.propertyPath %> }}
|
|
183
|
+
<% } %>
|
|
184
|
+
</td>
|
|
177
185
|
</ng-container>
|
|
178
186
|
<% } %>
|
|
179
187
|
<% } %>
|
|
@@ -43,6 +43,9 @@ import { MatSnackBarModule } from '@angular/material/snack-bar';
|
|
|
43
43
|
<% if (column.type === 'component') { %>
|
|
44
44
|
import { <%= classify(column.name) %>Component } from './<%= dasherize(column.name) %>-component/<%= dasherize(column.name) %>.component';
|
|
45
45
|
<% } %>
|
|
46
|
+
<% for (const pipe of column.pipeList) { %>
|
|
47
|
+
import { <%= pipe.className %> } from '<%= pipe.importFrom %>';
|
|
48
|
+
<% } %>
|
|
46
49
|
<% } %>
|
|
47
50
|
|
|
48
51
|
@Component({
|
|
@@ -57,6 +60,9 @@ import { <%= classify(column.name) %>Component } from './<%= dasherize(column.na
|
|
|
57
60
|
<% if (column.type === 'component') { %>
|
|
58
61
|
<%= classify(column.name) %>Component,
|
|
59
62
|
<% } %>
|
|
63
|
+
<% for (const pipe of column.pipeList) { %>
|
|
64
|
+
<%= pipe.className %>,
|
|
65
|
+
<% } %>
|
|
60
66
|
<% } %>
|
|
61
67
|
CommonModule,
|
|
62
68
|
MatCardModule,
|
|
@@ -104,6 +104,38 @@
|
|
|
104
104
|
"type": "string"
|
|
105
105
|
}
|
|
106
106
|
},
|
|
107
|
+
"template": {
|
|
108
|
+
"type": "string"
|
|
109
|
+
},
|
|
110
|
+
"pipeList": {
|
|
111
|
+
"type": "array",
|
|
112
|
+
"items": {
|
|
113
|
+
"oneOf": [
|
|
114
|
+
{
|
|
115
|
+
"type": "string"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"type": "object",
|
|
119
|
+
"properties": {
|
|
120
|
+
"name": {
|
|
121
|
+
"type": "string"
|
|
122
|
+
},
|
|
123
|
+
"className": {
|
|
124
|
+
"type": "string"
|
|
125
|
+
},
|
|
126
|
+
"importFrom": {
|
|
127
|
+
"type": "string"
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"required": [
|
|
131
|
+
"name",
|
|
132
|
+
"className",
|
|
133
|
+
"importFrom"
|
|
134
|
+
]
|
|
135
|
+
}
|
|
136
|
+
]
|
|
137
|
+
}
|
|
138
|
+
},
|
|
107
139
|
"hasFilter": {
|
|
108
140
|
"type": "boolean"
|
|
109
141
|
},
|