@rxap/schematic-angular 16.2.0-dev.0 → 16.2.0-dev.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/CHANGELOG.md +44 -0
- package/README.md +1 -1
- package/package.json +12 -11
- package/src/lib/accordion-header.d.ts +27 -0
- package/src/lib/accordion-header.js +48 -0
- package/src/lib/accordion-header.js.map +1 -0
- package/src/lib/accordion-identifier.d.ts +10 -0
- package/src/lib/accordion-identifier.js +15 -0
- package/src/lib/accordion-identifier.js.map +1 -0
- package/src/lib/accordion-item.d.ts +77 -4
- package/src/lib/accordion-item.js +151 -20
- package/src/lib/accordion-item.js.map +1 -1
- package/src/lib/adapter-options.d.ts +1 -1
- package/src/lib/adapter-options.js +2 -2
- package/src/lib/adapter-options.js.map +1 -1
- package/src/lib/coerce-accordion-component.d.ts +6 -0
- package/src/lib/coerce-accordion-component.js +65 -0
- package/src/lib/coerce-accordion-component.js.map +1 -0
- package/src/lib/coerce-accordion-item-table-component.d.ts +7 -0
- package/src/lib/coerce-accordion-item-table-component.js +41 -0
- package/src/lib/coerce-accordion-item-table-component.js.map +1 -0
- package/src/lib/coerce-form-component.d.ts +6 -0
- package/src/lib/coerce-form-component.js +68 -0
- package/src/lib/coerce-form-component.js.map +1 -0
- package/src/lib/coerce-minimum-table-component.d.ts +6 -0
- package/src/lib/coerce-minimum-table-component.js +95 -0
- package/src/lib/coerce-minimum-table-component.js.map +1 -0
- package/src/lib/coerce-tree-table-component.d.ts +6 -0
- package/src/lib/coerce-tree-table-component.js +12 -0
- package/src/lib/coerce-tree-table-component.js.map +1 -0
- package/src/lib/data-grid-item.d.ts +11 -5
- package/src/lib/data-grid-item.js +4 -18
- package/src/lib/data-grid-item.js.map +1 -1
- package/src/lib/data-grid-options.d.ts +1 -1
- package/src/lib/existing-method.d.ts +1 -1
- package/src/lib/existing-method.js +2 -2
- package/src/lib/existing-method.js.map +1 -1
- package/src/lib/form-component-control.d.ts +9 -10
- package/src/lib/form-component-control.js +3 -34
- package/src/lib/form-component-control.js.map +1 -1
- package/src/lib/form-definition-control.d.ts +50 -6
- package/src/lib/form-definition-control.js +133 -38
- package/src/lib/form-definition-control.js.map +1 -1
- package/src/lib/mat-form-field-default-options.d.ts +7 -0
- package/src/lib/mat-form-field-default-options.js +10 -0
- package/src/lib/mat-form-field-default-options.js.map +1 -0
- package/src/lib/merge-with-column-list.d.ts +3 -0
- package/src/lib/merge-with-column-list.js +18 -0
- package/src/lib/merge-with-column-list.js.map +1 -0
- package/src/lib/minimum-table-component-options.d.ts +3 -3
- package/src/lib/minimum-table-component-options.js +4 -3
- package/src/lib/minimum-table-component-options.js.map +1 -1
- package/src/lib/minimum-table-options.d.ts +11 -6
- package/src/lib/minimum-table-options.js +17 -5
- package/src/lib/minimum-table-options.js.map +1 -1
- package/src/lib/persistent.d.ts +30 -0
- package/src/lib/persistent.js +39 -0
- package/src/lib/persistent.js.map +1 -0
- package/src/lib/table-action.d.ts +3 -1
- package/src/lib/table-action.js.map +1 -1
- package/src/lib/table-column.d.ts +32 -6
- package/src/lib/table-column.js +131 -45
- package/src/lib/table-column.js.map +1 -1
- package/src/lib/table-options.d.ts +10 -3
- package/src/lib/table-options.js +13 -2
- package/src/lib/table-options.js.map +1 -1
- package/src/lib/tree-table-options.d.ts +9 -3
- package/src/lib/tree-table-options.js +12 -2
- package/src/lib/tree-table-options.js.map +1 -1
- package/src/schematics/accordion/accordion-component/files/component/__componentName__.component.html.template +25 -10
- package/src/schematics/accordion/accordion-component/files/header-component/accordion-header.component.html.template +6 -1
- package/src/schematics/accordion/accordion-component/index.d.ts +10 -3
- package/src/schematics/accordion/accordion-component/index.js +125 -54
- package/src/schematics/accordion/accordion-component/index.js.map +1 -1
- package/src/schematics/accordion/accordion-component/schema.d.ts +8 -2
- package/src/schematics/accordion/accordion-component/schema.json +118 -29
- package/src/schematics/accordion/accordion-item-component/index.d.ts +2 -1
- package/src/schematics/accordion/accordion-item-component/index.js +46 -68
- package/src/schematics/accordion/accordion-item-component/index.js.map +1 -1
- package/src/schematics/accordion/accordion-item-component/schema.d.ts +2 -4
- package/src/schematics/accordion/accordion-item-component/schema.json +6 -0
- package/src/schematics/accordion/item/accordion-item-data-grid-component/index.d.ts +2 -3
- package/src/schematics/accordion/item/accordion-item-data-grid-component/index.js +32 -28
- package/src/schematics/accordion/item/accordion-item-data-grid-component/index.js.map +1 -1
- package/src/schematics/accordion/item/accordion-item-data-grid-component/schema.d.ts +2 -5
- package/src/schematics/accordion/item/accordion-item-switch-component/index.d.ts +2 -15
- package/src/schematics/accordion/item/accordion-item-switch-component/index.js +2 -25
- package/src/schematics/accordion/item/accordion-item-switch-component/index.js.map +1 -1
- package/src/schematics/accordion/item/accordion-item-switch-component/schema.d.ts +2 -17
- package/src/schematics/accordion/item/accordion-item-switch-component/schema.json +14 -2
- package/src/schematics/accordion/item/accordion-item-table-component/index.d.ts +2 -3
- package/src/schematics/accordion/item/accordion-item-table-component/index.js +7 -4
- package/src/schematics/accordion/item/accordion-item-table-component/index.js.map +1 -1
- package/src/schematics/accordion/item/accordion-item-table-component/schema.d.ts +2 -5
- package/src/schematics/accordion/item/accordion-item-table-component/schema.json +37 -1
- package/src/schematics/accordion/item/accordion-item-tree-table-component/index.d.ts +2 -3
- package/src/schematics/accordion/item/accordion-item-tree-table-component/index.js +8 -4
- package/src/schematics/accordion/item/accordion-item-tree-table-component/index.js.map +1 -1
- package/src/schematics/accordion/item/accordion-item-tree-table-component/schema.d.ts +2 -5
- package/src/schematics/accordion/item/accordion-item-tree-table-component/schema.json +92 -69
- package/src/schematics/data-grid-component/files/form/__componentName__.component.html.template +1 -1
- package/src/schematics/data-grid-component/index.js +54 -24
- package/src/schematics/data-grid-component/index.js.map +1 -1
- package/src/schematics/data-grid-component/schema.json +82 -29
- package/src/schematics/form/control/input-form-control/index.js +7 -2
- package/src/schematics/form/control/input-form-control/index.js.map +1 -1
- package/src/schematics/form/form-component/index.d.ts +4 -2
- package/src/schematics/form/form-component/index.js +5 -2
- package/src/schematics/form/form-component/index.js.map +1 -1
- package/src/schematics/form/form-component/schema.d.ts +3 -1
- package/src/schematics/form/form-component/schema.json +92 -24
- package/src/schematics/form/form-definition/schema.d.ts +1 -1
- package/src/schematics/form/form-definition/schema.json +84 -39
- package/src/schematics/table/table-component/index.d.ts +2 -2
- package/src/schematics/table/table-component/index.js +5 -3
- package/src/schematics/table/table-component/index.js.map +1 -1
- package/src/schematics/table/tree-table-component/index.js +5 -3
- package/src/schematics/table/tree-table-component/index.js.map +1 -1
- package/src/schematics/table/tree-table-component/schema.json +88 -95
- package/src/lib/table-property.d.ts +0 -14
- package/src/lib/table-property.js +0 -46
- package/src/lib/table-property.js.map +0 -1
- package/src/lib/type-import.d.ts +0 -4
- package/src/lib/type-import.js +0 -38
- package/src/lib/type-import.js.map +0 -1
- package/src/schematics/accordion/accordion-component/files/component/__componentName__.component.ts.template +0 -54
- package/src/schematics/accordion/accordion-component/files/header-component/accordion-header.component.ts.template +0 -14
- package/src/schematics/accordion/accordion-item-component/files/component/__componentName__.component.ts.template +0 -30
- package/src/schematics/accordion/item/accordion-item-data-grid-component/files/data-grid/__componentName__.component.ts.template +0 -14
- package/src/schematics/accordion/item/accordion-item-data-grid-component/files/data-grid-collection/__componentName__.component.ts.template +0 -32
- package/src/schematics/accordion/item/accordion-item-table-component/files/component/__componentName__.component.ts.template +0 -35
- package/src/schematics/accordion/item/accordion-item-tree-table-component/files/component/__componentName__.component.ts.template +0 -34
- package/src/schematics/data-grid-component/files/form/__componentName__.component.ts.template +0 -43
- package/src/schematics/data-grid-component/files/plain/__componentName__.component.ts.template +0 -36
- package/src/schematics/form/form-component/files/component/__componentName__.component.ts.template +0 -50
- package/src/schematics/table/table-component/files/component/__componentName__.component.ts.template +0 -112
- package/src/schematics/table/tree-table-component/files/component/__componentName__.component.ts.template +0 -113
|
@@ -1,12 +1,34 @@
|
|
|
1
|
-
import { TypeImport } from '@rxap/ts-morph';
|
|
1
|
+
import { NormalizedTypeImport, TypeImport } from '@rxap/ts-morph';
|
|
2
2
|
import { Normalized } from '@rxap/utilities';
|
|
3
|
-
import { NormalizedTypeImport } from './type-import';
|
|
4
3
|
export type TableColumnPipe = TypeImport;
|
|
4
|
+
export declare enum TableColumnModifier {
|
|
5
|
+
FILTER = "filter",
|
|
6
|
+
ACTIVE = "active",
|
|
7
|
+
INACTIVE = "inactive",
|
|
8
|
+
SHOW = "show",
|
|
9
|
+
HIDDEN = "hidden",
|
|
10
|
+
NOWRAP = "nowrap",
|
|
11
|
+
WITHOUT_TITLE = "withoutTitle",
|
|
12
|
+
NO_TITLE = "noTitle",
|
|
13
|
+
OVERWRITE = "overwrite"
|
|
14
|
+
}
|
|
15
|
+
export declare function IsTableColumnModifier(value: string): value is TableColumnModifier;
|
|
16
|
+
export declare enum TableColumnKind {
|
|
17
|
+
DEFAULT = "default",
|
|
18
|
+
DATE = "date",
|
|
19
|
+
LINK = "link",
|
|
20
|
+
ICON = "icon",
|
|
21
|
+
BOOLEAN = "boolean",
|
|
22
|
+
COMPONENT = "component",
|
|
23
|
+
COPY_TO_CLIPBOARD = "copy-to-clipboard"
|
|
24
|
+
}
|
|
25
|
+
export declare function IsTableColumnKind(value: string): value is TableColumnKind;
|
|
5
26
|
export interface TableColumn {
|
|
6
27
|
name: string;
|
|
7
28
|
type?: string | TypeImport;
|
|
8
29
|
modifiers?: string[];
|
|
9
30
|
hasFilter?: boolean;
|
|
31
|
+
withoutTitle?: boolean;
|
|
10
32
|
title?: string;
|
|
11
33
|
propertyPath?: string;
|
|
12
34
|
hidden?: boolean;
|
|
@@ -15,16 +37,20 @@ export interface TableColumn {
|
|
|
15
37
|
show?: boolean;
|
|
16
38
|
nowrap?: boolean;
|
|
17
39
|
cssClass?: string;
|
|
18
|
-
role?:
|
|
40
|
+
role?: TableColumnKind;
|
|
19
41
|
template?: string;
|
|
20
42
|
pipeList?: Array<TableColumnPipe | string>;
|
|
43
|
+
importList?: TypeImport[];
|
|
21
44
|
}
|
|
22
45
|
export type NormalizedTableColumnPipe = NormalizedTypeImport;
|
|
23
|
-
export interface NormalizedTableColumn extends Omit<Readonly<Normalized<TableColumn>>, 'pipeList'> {
|
|
46
|
+
export interface NormalizedTableColumn extends Omit<Readonly<Normalized<TableColumn>>, 'pipeList' | 'importList'> {
|
|
24
47
|
type: NormalizedTypeImport;
|
|
25
48
|
propertyPath: string;
|
|
26
49
|
pipeList: ReadonlyArray<NormalizedTableColumnPipe>;
|
|
50
|
+
modifiers: TableColumnModifier[];
|
|
51
|
+
importList: ReadonlyArray<NormalizedTypeImport>;
|
|
52
|
+
role: TableColumnKind;
|
|
27
53
|
}
|
|
28
54
|
export declare function NormalizeTableColumnPipe(pipe: string | TableColumnPipe): NormalizedTableColumnPipe;
|
|
29
|
-
export declare function NormalizeTableColumn(column: Readonly<TableColumn>
|
|
30
|
-
export declare function NormalizeTableColumnList(columnList?: ReadonlyArray<
|
|
55
|
+
export declare function NormalizeTableColumn(column: Readonly<TableColumn>): NormalizedTableColumn;
|
|
56
|
+
export declare function NormalizeTableColumnList(columnList?: ReadonlyArray<Readonly<TableColumn>>): ReadonlyArray<NormalizedTableColumn>;
|
package/src/lib/table-column.js
CHANGED
|
@@ -1,31 +1,62 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NormalizeTableColumnList = exports.NormalizeTableColumn = exports.NormalizeTableColumnPipe = void 0;
|
|
3
|
+
exports.NormalizeTableColumnList = exports.NormalizeTableColumn = exports.NormalizeTableColumnPipe = exports.IsTableColumnKind = exports.TableColumnKind = exports.IsTableColumnModifier = exports.TableColumnModifier = void 0;
|
|
4
4
|
const schematics_utilities_1 = require("@rxap/schematics-utilities");
|
|
5
|
-
const
|
|
5
|
+
const ts_morph_1 = require("@rxap/ts-morph");
|
|
6
|
+
const utilities_1 = require("@rxap/utilities");
|
|
7
|
+
var TableColumnModifier;
|
|
8
|
+
(function (TableColumnModifier) {
|
|
9
|
+
TableColumnModifier["FILTER"] = "filter";
|
|
10
|
+
TableColumnModifier["ACTIVE"] = "active";
|
|
11
|
+
TableColumnModifier["INACTIVE"] = "inactive";
|
|
12
|
+
TableColumnModifier["SHOW"] = "show";
|
|
13
|
+
TableColumnModifier["HIDDEN"] = "hidden";
|
|
14
|
+
TableColumnModifier["NOWRAP"] = "nowrap";
|
|
15
|
+
TableColumnModifier["WITHOUT_TITLE"] = "withoutTitle";
|
|
16
|
+
TableColumnModifier["NO_TITLE"] = "noTitle";
|
|
17
|
+
TableColumnModifier["OVERWRITE"] = "overwrite";
|
|
18
|
+
})(TableColumnModifier || (exports.TableColumnModifier = TableColumnModifier = {}));
|
|
19
|
+
function IsTableColumnModifier(value) {
|
|
20
|
+
return Object.values(TableColumnModifier).includes(value);
|
|
21
|
+
}
|
|
22
|
+
exports.IsTableColumnModifier = IsTableColumnModifier;
|
|
23
|
+
var TableColumnKind;
|
|
24
|
+
(function (TableColumnKind) {
|
|
25
|
+
TableColumnKind["DEFAULT"] = "default";
|
|
26
|
+
TableColumnKind["DATE"] = "date";
|
|
27
|
+
TableColumnKind["LINK"] = "link";
|
|
28
|
+
TableColumnKind["ICON"] = "icon";
|
|
29
|
+
TableColumnKind["BOOLEAN"] = "boolean";
|
|
30
|
+
TableColumnKind["COMPONENT"] = "component";
|
|
31
|
+
TableColumnKind["COPY_TO_CLIPBOARD"] = "copy-to-clipboard";
|
|
32
|
+
})(TableColumnKind || (exports.TableColumnKind = TableColumnKind = {}));
|
|
33
|
+
function IsTableColumnKind(value) {
|
|
34
|
+
return Object.values(TableColumnKind).includes(value);
|
|
35
|
+
}
|
|
36
|
+
exports.IsTableColumnKind = IsTableColumnKind;
|
|
6
37
|
function NormalizeTableColumnPipe(pipe) {
|
|
7
38
|
if (typeof pipe === 'string') {
|
|
8
39
|
switch (pipe) {
|
|
9
40
|
case 'async':
|
|
10
|
-
return (0,
|
|
41
|
+
return (0, ts_morph_1.NormalizeTypeImport)({
|
|
11
42
|
name: 'async',
|
|
12
43
|
namedImport: 'AsyncPipe',
|
|
13
44
|
moduleSpecifier: '@angular/common',
|
|
14
45
|
});
|
|
15
46
|
case 'date':
|
|
16
|
-
return (0,
|
|
47
|
+
return (0, ts_morph_1.NormalizeTypeImport)({
|
|
17
48
|
name: 'date',
|
|
18
49
|
namedImport: 'DatePipe',
|
|
19
50
|
moduleSpecifier: '@angular/common',
|
|
20
51
|
});
|
|
21
52
|
case 'json':
|
|
22
|
-
return (0,
|
|
53
|
+
return (0, ts_morph_1.NormalizeTypeImport)({
|
|
23
54
|
name: 'json',
|
|
24
55
|
namedImport: 'JsonPipe',
|
|
25
56
|
moduleSpecifier: '@angular/common',
|
|
26
57
|
});
|
|
27
58
|
case 'keyvalue':
|
|
28
|
-
return (0,
|
|
59
|
+
return (0, ts_morph_1.NormalizeTypeImport)({
|
|
29
60
|
name: 'keyvalue',
|
|
30
61
|
namedImport: 'KeyValuePipe',
|
|
31
62
|
moduleSpecifier: '@angular/common',
|
|
@@ -34,11 +65,66 @@ function NormalizeTableColumnPipe(pipe) {
|
|
|
34
65
|
throw new Error(`Unknown pipe ${pipe}`);
|
|
35
66
|
}
|
|
36
67
|
}
|
|
37
|
-
return (0,
|
|
68
|
+
return (0, ts_morph_1.NormalizeTypeImport)(pipe);
|
|
38
69
|
}
|
|
39
70
|
exports.NormalizeTableColumnPipe = NormalizeTableColumnPipe;
|
|
71
|
+
function coerceTableColumnImportList(column) {
|
|
72
|
+
var _a;
|
|
73
|
+
const importList = (_a = column.importList) !== null && _a !== void 0 ? _a : [];
|
|
74
|
+
switch (column.role) {
|
|
75
|
+
case TableColumnKind.COMPONENT:
|
|
76
|
+
(0, utilities_1.CoerceArrayItems)(importList, [
|
|
77
|
+
{
|
|
78
|
+
name: `${(0, utilities_1.classify)(column.name)}CellComponent`,
|
|
79
|
+
moduleSpecifier: `./${(0, schematics_utilities_1.dasherize)(column.name)}-cell/${(0, schematics_utilities_1.dasherize)(column.name)}-cell.component`,
|
|
80
|
+
},
|
|
81
|
+
], (a, b) => a.name === b.name);
|
|
82
|
+
break;
|
|
83
|
+
case TableColumnKind.ICON:
|
|
84
|
+
(0, utilities_1.CoerceArrayItems)(importList, [
|
|
85
|
+
{
|
|
86
|
+
name: 'IconCellComponent',
|
|
87
|
+
moduleSpecifier: '@rxap/material-table-system',
|
|
88
|
+
},
|
|
89
|
+
], (a, b) => a.name === b.name);
|
|
90
|
+
break;
|
|
91
|
+
case TableColumnKind.LINK:
|
|
92
|
+
(0, utilities_1.CoerceArrayItems)(importList, [
|
|
93
|
+
{
|
|
94
|
+
name: 'LinkCellComponent',
|
|
95
|
+
moduleSpecifier: '@rxap/material-table-system',
|
|
96
|
+
},
|
|
97
|
+
], (a, b) => a.name === b.name);
|
|
98
|
+
break;
|
|
99
|
+
case TableColumnKind.DATE:
|
|
100
|
+
(0, utilities_1.CoerceArrayItems)(importList, [
|
|
101
|
+
{
|
|
102
|
+
name: 'DateCellComponent',
|
|
103
|
+
moduleSpecifier: '@rxap/material-table-system',
|
|
104
|
+
},
|
|
105
|
+
], (a, b) => a.name === b.name);
|
|
106
|
+
break;
|
|
107
|
+
case TableColumnKind.BOOLEAN:
|
|
108
|
+
(0, utilities_1.CoerceArrayItems)(importList, [
|
|
109
|
+
{
|
|
110
|
+
name: 'BooleanCellComponent',
|
|
111
|
+
moduleSpecifier: '@rxap/material-table-system',
|
|
112
|
+
},
|
|
113
|
+
], (a, b) => a.name === b.name);
|
|
114
|
+
break;
|
|
115
|
+
case TableColumnKind.COPY_TO_CLIPBOARD:
|
|
116
|
+
(0, utilities_1.CoerceArrayItems)(importList, [
|
|
117
|
+
{
|
|
118
|
+
name: 'CopyToClipboardCellComponent',
|
|
119
|
+
moduleSpecifier: '@rxap/material-table-system',
|
|
120
|
+
},
|
|
121
|
+
], (a, b) => a.name === b.name);
|
|
122
|
+
break;
|
|
123
|
+
}
|
|
124
|
+
return importList;
|
|
125
|
+
}
|
|
40
126
|
function NormalizeTableColumn(column) {
|
|
41
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
127
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
42
128
|
let name;
|
|
43
129
|
let type = 'unknown';
|
|
44
130
|
let modifiers = [];
|
|
@@ -50,39 +136,30 @@ function NormalizeTableColumn(column) {
|
|
|
50
136
|
let inactive = false;
|
|
51
137
|
let show = false;
|
|
52
138
|
let nowrap = false;
|
|
139
|
+
let withoutTitle = false;
|
|
53
140
|
let cssClass = null;
|
|
54
|
-
let role =
|
|
141
|
+
let role = TableColumnKind.DEFAULT;
|
|
55
142
|
let template = null;
|
|
56
143
|
let pipeList = [];
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
active = (_g = column.active) !== null && _g !== void 0 ? _g : false;
|
|
77
|
-
inactive = (_h = column.inactive) !== null && _h !== void 0 ? _h : false;
|
|
78
|
-
show = (_j = column.show) !== null && _j !== void 0 ? _j : false;
|
|
79
|
-
nowrap = (_k = column.nowrap) !== null && _k !== void 0 ? _k : false;
|
|
80
|
-
cssClass = (_l = column.cssClass) !== null && _l !== void 0 ? _l : cssClass;
|
|
81
|
-
role = (_m = column.role) !== null && _m !== void 0 ? _m : role;
|
|
82
|
-
template = (_o = column.template) !== null && _o !== void 0 ? _o : template;
|
|
83
|
-
pipeList = (_p = column.pipeList) !== null && _p !== void 0 ? _p : pipeList;
|
|
84
|
-
}
|
|
85
|
-
const namePrefix = (_r = (_q = name.match(/^(_+)/)) === null || _q === void 0 ? void 0 : _q[1]) !== null && _r !== void 0 ? _r : '';
|
|
144
|
+
let importList = [];
|
|
145
|
+
name = column.name;
|
|
146
|
+
type = (_a = column.type) !== null && _a !== void 0 ? _a : type;
|
|
147
|
+
modifiers = (_b = column.modifiers) !== null && _b !== void 0 ? _b : [];
|
|
148
|
+
hasFilter = (_c = column.hasFilter) !== null && _c !== void 0 ? _c : false;
|
|
149
|
+
title = (_d = column.title) !== null && _d !== void 0 ? _d : title;
|
|
150
|
+
propertyPath = (_e = column.propertyPath) !== null && _e !== void 0 ? _e : propertyPath;
|
|
151
|
+
hidden = (_f = column.hidden) !== null && _f !== void 0 ? _f : false;
|
|
152
|
+
active = (_g = column.active) !== null && _g !== void 0 ? _g : false;
|
|
153
|
+
inactive = (_h = column.inactive) !== null && _h !== void 0 ? _h : false;
|
|
154
|
+
show = (_j = column.show) !== null && _j !== void 0 ? _j : false;
|
|
155
|
+
nowrap = (_k = column.nowrap) !== null && _k !== void 0 ? _k : false;
|
|
156
|
+
withoutTitle = (_l = column.withoutTitle) !== null && _l !== void 0 ? _l : false;
|
|
157
|
+
cssClass = (_m = column.cssClass) !== null && _m !== void 0 ? _m : cssClass;
|
|
158
|
+
role = (_o = column.role) !== null && _o !== void 0 ? _o : role;
|
|
159
|
+
template = (_p = column.template) !== null && _p !== void 0 ? _p : template;
|
|
160
|
+
pipeList = (_q = column.pipeList) !== null && _q !== void 0 ? _q : pipeList;
|
|
161
|
+
importList = coerceTableColumnImportList(column);
|
|
162
|
+
const namePrefix = (_s = (_r = name.match(/^(_+)/)) === null || _r === void 0 ? void 0 : _r[1]) !== null && _s !== void 0 ? _s : '';
|
|
86
163
|
propertyPath !== null && propertyPath !== void 0 ? propertyPath : (propertyPath = name
|
|
87
164
|
.replace(/\?\./g, '.')
|
|
88
165
|
.split('.')
|
|
@@ -98,12 +175,13 @@ function NormalizeTableColumn(column) {
|
|
|
98
175
|
.split('-')
|
|
99
176
|
.map((part) => (0, schematics_utilities_1.capitalize)(part))
|
|
100
177
|
.join(' '));
|
|
101
|
-
hasFilter = modifiers.includes(
|
|
102
|
-
active = modifiers.includes(
|
|
103
|
-
inactive = modifiers.includes(
|
|
104
|
-
show = modifiers.includes(
|
|
105
|
-
hidden = modifiers.includes(
|
|
106
|
-
nowrap = modifiers.includes(
|
|
178
|
+
hasFilter = modifiers.includes(TableColumnModifier.FILTER) || hasFilter;
|
|
179
|
+
active = modifiers.includes(TableColumnModifier.ACTIVE) || active;
|
|
180
|
+
inactive = modifiers.includes(TableColumnModifier.INACTIVE) || inactive;
|
|
181
|
+
show = modifiers.includes(TableColumnModifier.SHOW) || show;
|
|
182
|
+
hidden = modifiers.includes(TableColumnModifier.HIDDEN) || hidden;
|
|
183
|
+
nowrap = modifiers.includes(TableColumnModifier.NOWRAP) || nowrap;
|
|
184
|
+
withoutTitle = modifiers.includes(TableColumnModifier.WITHOUT_TITLE) || modifiers.includes(TableColumnModifier.NO_TITLE) || withoutTitle;
|
|
107
185
|
if (!type || type === 'unknown') {
|
|
108
186
|
switch (role) {
|
|
109
187
|
case 'date':
|
|
@@ -133,10 +211,16 @@ function NormalizeTableColumn(column) {
|
|
|
133
211
|
cssClass += ' nowrap';
|
|
134
212
|
}
|
|
135
213
|
}
|
|
214
|
+
if (!modifiers.every(IsTableColumnModifier)) {
|
|
215
|
+
throw new Error(`Unknown modifier in column ${name} - [ ${modifiers.join(', ')} ]`);
|
|
216
|
+
}
|
|
217
|
+
if (!IsTableColumnKind(role)) {
|
|
218
|
+
throw new Error(`Unknown role in column ${name} - ${role}`);
|
|
219
|
+
}
|
|
136
220
|
return Object.freeze({
|
|
137
221
|
role,
|
|
138
222
|
name,
|
|
139
|
-
type: (0,
|
|
223
|
+
type: (0, ts_morph_1.NormalizeTypeImport)(type),
|
|
140
224
|
modifiers,
|
|
141
225
|
hasFilter,
|
|
142
226
|
title,
|
|
@@ -146,9 +230,11 @@ function NormalizeTableColumn(column) {
|
|
|
146
230
|
inactive,
|
|
147
231
|
show,
|
|
148
232
|
nowrap,
|
|
233
|
+
withoutTitle,
|
|
149
234
|
cssClass,
|
|
150
235
|
pipeList: pipeList.map(NormalizeTableColumnPipe),
|
|
151
236
|
template,
|
|
237
|
+
importList: importList.map(ts_morph_1.NormalizeTypeImport),
|
|
152
238
|
});
|
|
153
239
|
}
|
|
154
240
|
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;AACpC,6CAIwB;AACxB,+CAIyB;AAIzB,IAAY,mBAUX;AAVD,WAAY,mBAAmB;IAC7B,wCAAiB,CAAA;IACjB,wCAAiB,CAAA;IACjB,4CAAqB,CAAA;IACrB,oCAAa,CAAA;IACb,wCAAiB,CAAA;IACjB,wCAAiB,CAAA;IACjB,qDAA8B,CAAA;IAC9B,2CAAoB,CAAA;IACpB,8CAAuB,CAAA;AACzB,CAAC,EAVW,mBAAmB,mCAAnB,mBAAmB,QAU9B;AAED,SAAgB,qBAAqB,CAAC,KAAa;IACjD,OAAO,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC,QAAQ,CAAC,KAA4B,CAAC,CAAC;AACnF,CAAC;AAFD,sDAEC;AAED,IAAY,eAQX;AARD,WAAY,eAAe;IACzB,sCAAmB,CAAA;IACnB,gCAAa,CAAA;IACb,gCAAa,CAAA;IACb,gCAAa,CAAA;IACb,sCAAmB,CAAA;IACnB,0CAAuB,CAAA;IACvB,0DAAuC,CAAA;AACzC,CAAC,EARW,eAAe,+BAAf,eAAe,QAQ1B;AAED,SAAgB,iBAAiB,CAAC,KAAa;IAC7C,OAAO,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,QAAQ,CAAC,KAAwB,CAAC,CAAC;AAC3E,CAAC;A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U,uBAAV,UAAU,CAAE,GAAG,CAAC,oBAAoB,CAAC,mCAAI,EAAE,CAAC,CAAC;AACpE,CAAC;AAJD,4DAIC"}
|
|
@@ -1,20 +1,27 @@
|
|
|
1
|
+
import { NormalizedDataProperty } from '@rxap/ts-morph';
|
|
1
2
|
import { Normalized } from '@rxap/utilities';
|
|
2
3
|
import { ExistingMethod, NormalizedExistingMethod } from './existing-method';
|
|
3
4
|
import { MinimumTableOptions, NormalizedMinimumTableOptions } from './minimum-table-options';
|
|
4
5
|
import { NormalizedTableAction } from './table-action';
|
|
5
6
|
import { NormalizedTableColumn } from './table-column';
|
|
6
7
|
import { NormalizedTableOpenApiOptions, TableOpenApiOptions } from './table-open-api-options';
|
|
7
|
-
|
|
8
|
+
export declare enum TableModifiers {
|
|
9
|
+
OVERWRITE = "overwrite",
|
|
10
|
+
NAVIGATION_BACK_HEADER = "navigation-back-header",
|
|
11
|
+
WITHOUT_TITLE = "without-title",
|
|
12
|
+
SHOW_ARCHIVED_SLIDE = "show-archived-slide"
|
|
13
|
+
}
|
|
14
|
+
export declare function IsTableModifiers(value: string): value is TableModifiers;
|
|
8
15
|
export interface TableOptions extends MinimumTableOptions {
|
|
9
16
|
selectColumn?: boolean;
|
|
10
17
|
tableMethod?: ExistingMethod;
|
|
11
18
|
openApi?: TableOpenApiOptions;
|
|
12
19
|
}
|
|
13
|
-
export interface NormalizedTableOptions extends Omit<Readonly<Normalized<TableOptions> & NormalizedMinimumTableOptions
|
|
20
|
+
export interface NormalizedTableOptions extends Omit<Readonly<Normalized<TableOptions> & NormalizedMinimumTableOptions<TableModifiers>>, 'columnList' | 'actionList' | 'propertyList' | 'tableMethod' | 'openApi'> {
|
|
14
21
|
componentName: string;
|
|
15
22
|
columnList: ReadonlyArray<NormalizedTableColumn>;
|
|
16
23
|
actionList: ReadonlyArray<NormalizedTableAction>;
|
|
17
|
-
propertyList: ReadonlyArray<
|
|
24
|
+
propertyList: ReadonlyArray<NormalizedDataProperty>;
|
|
18
25
|
tableMethod: NormalizedExistingMethod | null;
|
|
19
26
|
openApi: NormalizedTableOpenApiOptions | null;
|
|
20
27
|
}
|
package/src/lib/table-options.js
CHANGED
|
@@ -1,12 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NormalizeTableOptions = void 0;
|
|
3
|
+
exports.NormalizeTableOptions = exports.IsTableModifiers = exports.TableModifiers = void 0;
|
|
4
4
|
const existing_method_1 = require("./existing-method");
|
|
5
5
|
const minimum_table_options_1 = require("./minimum-table-options");
|
|
6
6
|
const table_open_api_options_1 = require("./table-open-api-options");
|
|
7
|
+
var TableModifiers;
|
|
8
|
+
(function (TableModifiers) {
|
|
9
|
+
TableModifiers["OVERWRITE"] = "overwrite";
|
|
10
|
+
TableModifiers["NAVIGATION_BACK_HEADER"] = "navigation-back-header";
|
|
11
|
+
TableModifiers["WITHOUT_TITLE"] = "without-title";
|
|
12
|
+
TableModifiers["SHOW_ARCHIVED_SLIDE"] = "show-archived-slide";
|
|
13
|
+
})(TableModifiers || (exports.TableModifiers = TableModifiers = {}));
|
|
14
|
+
function IsTableModifiers(value) {
|
|
15
|
+
return Object.values(TableModifiers).includes(value);
|
|
16
|
+
}
|
|
17
|
+
exports.IsTableModifiers = IsTableModifiers;
|
|
7
18
|
function NormalizeTableOptions(options, name) {
|
|
8
19
|
var _a;
|
|
9
|
-
const normalizedOptions = (0, minimum_table_options_1.NormalizeMinimumTableOptions)(options, name);
|
|
20
|
+
const normalizedOptions = (0, minimum_table_options_1.NormalizeMinimumTableOptions)(options, name, IsTableModifiers);
|
|
10
21
|
const { actionList } = normalizedOptions;
|
|
11
22
|
const selectColumn = ((_a = options.selectColumn) !== null && _a !== void 0 ? _a : false) || actionList.some(action => action.inHeader);
|
|
12
23
|
const tableMethod = (0, existing_method_1.NormalizeExistingMethod)(options.tableMethod);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-options.js","sourceRoot":"","sources":["../../../../../../packages/schematic/angular/src/lib/table-options.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"table-options.js","sourceRoot":"","sources":["../../../../../../packages/schematic/angular/src/lib/table-options.ts"],"names":[],"mappings":";;;AAEA,uDAI2B;AAC3B,mEAIiC;AAGjC,qEAIkC;AAElC,IAAY,cAMX;AAND,WAAY,cAAc;IACxB,yCAAuB,CAAA;IACvB,mEAAiD,CAAA;IACjD,iDAA+B,CAAA;IAC/B,6DAA2C,CAAA;AAE7C,CAAC,EANW,cAAc,8BAAd,cAAc,QAMzB;AAED,SAAgB,gBAAgB,CAAC,KAAa;IAC5C,OAAO,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,QAAQ,CAAC,KAAuB,CAAC,CAAC;AACzE,CAAC;AAFD,4CAEC;AAkBD,SAAgB,qBAAqB,CAAC,OAA+B,EAAE,IAAY;;IACjF,MAAM,iBAAiB,GAAG,IAAA,oDAA4B,EAAC,OAAO,EAAE,IAAI,EAAE,gBAAgB,CAAC,CAAC;IACxF,MAAM,EAAE,UAAU,EAAE,GAAG,iBAAiB,CAAC;IACzC,MAAM,YAAY,GAAG,CAAC,MAAA,OAAO,CAAC,YAAY,mCAAI,KAAK,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IACnG,MAAM,WAAW,GAAG,IAAA,yCAAuB,EAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IACjE,MAAM,OAAO,GAAG,IAAA,qDAA4B,EAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAC9D,OAAO,MAAM,CAAC,MAAM,iCACf,iBAAiB,KACpB,YAAY;QACZ,WAAW;QACX,OAAO,IACP,CAAC;AACL,CAAC;AAZD,sDAYC"}
|
|
@@ -1,18 +1,24 @@
|
|
|
1
|
+
import { NormalizedDataProperty } from '@rxap/ts-morph';
|
|
1
2
|
import { Normalized } from '@rxap/utilities';
|
|
2
3
|
import { ExistingMethod, NormalizedExistingMethod } from './existing-method';
|
|
3
4
|
import { MinimumTableOptions, NormalizedMinimumTableOptions } from './minimum-table-options';
|
|
4
5
|
import { NormalizedTableAction } from './table-action';
|
|
5
6
|
import { NormalizedTableColumn } from './table-column';
|
|
6
|
-
|
|
7
|
+
export declare enum TreeTableModifiers {
|
|
8
|
+
OVERWRITE = "overwrite",
|
|
9
|
+
NAVIGATION_BACK_HEADER = "navigation-back-header",
|
|
10
|
+
WITHOUT_TITLE = "without-title"
|
|
11
|
+
}
|
|
12
|
+
export declare function IsTreeTableModifiers(value: string): value is TreeTableModifiers;
|
|
7
13
|
export interface TreeTableOptions extends MinimumTableOptions {
|
|
8
14
|
tableRootMethod?: ExistingMethod;
|
|
9
15
|
tableChildMethod?: ExistingMethod;
|
|
10
16
|
}
|
|
11
|
-
export interface NormalizedTreeTableOptions extends Omit<Readonly<Normalized<TreeTableOptions> & NormalizedMinimumTableOptions
|
|
17
|
+
export interface NormalizedTreeTableOptions extends Omit<Readonly<Normalized<TreeTableOptions> & NormalizedMinimumTableOptions<TreeTableModifiers>>, 'columnList' | 'actionList' | 'propertyList' | 'tableRootMethod' | 'tableChildMethod'> {
|
|
12
18
|
componentName: string;
|
|
13
19
|
columnList: ReadonlyArray<NormalizedTableColumn>;
|
|
14
20
|
actionList: ReadonlyArray<NormalizedTableAction>;
|
|
15
|
-
propertyList: ReadonlyArray<
|
|
21
|
+
propertyList: ReadonlyArray<NormalizedDataProperty>;
|
|
16
22
|
tableRootMethod: NormalizedExistingMethod | null;
|
|
17
23
|
tableChildMethod: NormalizedExistingMethod | null;
|
|
18
24
|
}
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NormalizeTreeTableOptions = void 0;
|
|
3
|
+
exports.NormalizeTreeTableOptions = exports.IsTreeTableModifiers = exports.TreeTableModifiers = void 0;
|
|
4
4
|
const existing_method_1 = require("./existing-method");
|
|
5
5
|
const minimum_table_options_1 = require("./minimum-table-options");
|
|
6
|
+
var TreeTableModifiers;
|
|
7
|
+
(function (TreeTableModifiers) {
|
|
8
|
+
TreeTableModifiers["OVERWRITE"] = "overwrite";
|
|
9
|
+
TreeTableModifiers["NAVIGATION_BACK_HEADER"] = "navigation-back-header";
|
|
10
|
+
TreeTableModifiers["WITHOUT_TITLE"] = "without-title";
|
|
11
|
+
})(TreeTableModifiers || (exports.TreeTableModifiers = TreeTableModifiers = {}));
|
|
12
|
+
function IsTreeTableModifiers(value) {
|
|
13
|
+
return Object.values(TreeTableModifiers).includes(value);
|
|
14
|
+
}
|
|
15
|
+
exports.IsTreeTableModifiers = IsTreeTableModifiers;
|
|
6
16
|
function NormalizeTreeTableOptions(options, name) {
|
|
7
17
|
var _a;
|
|
8
|
-
const normalizedOptions = (0, minimum_table_options_1.NormalizeMinimumTableOptions)(options, name, '-tree-table');
|
|
18
|
+
const normalizedOptions = (0, minimum_table_options_1.NormalizeMinimumTableOptions)(options, name, IsTreeTableModifiers, '-tree-table');
|
|
9
19
|
const tableRootMethod = (0, existing_method_1.NormalizeExistingMethod)(options.tableRootMethod);
|
|
10
20
|
const tableChildMethod = (_a = (0, existing_method_1.NormalizeExistingMethod)(options.tableRootMethod)) !== null && _a !== void 0 ? _a : tableRootMethod;
|
|
11
21
|
return Object.freeze(Object.assign(Object.assign({}, normalizedOptions), { tableRootMethod,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree-table-options.js","sourceRoot":"","sources":["../../../../../../packages/schematic/angular/src/lib/tree-table-options.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"tree-table-options.js","sourceRoot":"","sources":["../../../../../../packages/schematic/angular/src/lib/tree-table-options.ts"],"names":[],"mappings":";;;AAEA,uDAI2B;AAC3B,mEAIiC;AAIjC,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC5B,6CAAuB,CAAA;IACvB,uEAAiD,CAAA;IACjD,qDAA+B,CAAA;AACjC,CAAC,EAJW,kBAAkB,kCAAlB,kBAAkB,QAI7B;AAED,SAAgB,oBAAoB,CAAC,KAAa;IAChD,OAAO,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,QAAQ,CAAC,KAA2B,CAAC,CAAC;AACjF,CAAC;AAFD,oDAEC;AAiBD,SAAgB,yBAAyB,CACvC,OAAmC,EACnC,IAAY;;IAEZ,MAAM,iBAAiB,GAAG,IAAA,oDAA4B,EAAC,OAAO,EAAE,IAAI,EAAE,oBAAoB,EAAE,aAAa,CAAC,CAAC;IAC3G,MAAM,eAAe,GAAG,IAAA,yCAAuB,EAAC,OAAO,CAAC,eAAe,CAAC,CAAC;IACzE,MAAM,gBAAgB,GAAG,MAAA,IAAA,yCAAuB,EAAC,OAAO,CAAC,eAAe,CAAC,mCAAI,eAAe,CAAC;IAC7F,OAAO,MAAM,CAAC,MAAM,iCACf,iBAAiB,KACpB,eAAe;QACf,gBAAgB,IAChB,CAAC;AACL,CAAC;AAZD,8DAYC"}
|
|
@@ -2,16 +2,24 @@
|
|
|
2
2
|
<rxap-data-source-error [error]="error" [refresh]="refresh"></rxap-data-source-error>
|
|
3
3
|
</ng-template>
|
|
4
4
|
<div *rxapDataSource="let accordion from accordionDataSource; errorTemplate: errorTemplate" class="flex flex-col gap-y-6">
|
|
5
|
-
|
|
5
|
+
<% if (header) { %><<%= prefix %>-accordion-header [data]="accordion"></<%= prefix %>-accordion-header>
|
|
6
6
|
<ng-template #divider>
|
|
7
7
|
<mat-divider></mat-divider>
|
|
8
8
|
</ng-template>
|
|
9
9
|
<mat-progress-bar *ngIf="accordionDataSource.loading$ | async; else divider" mode="indeterminate"></mat-progress-bar>
|
|
10
|
-
|
|
10
|
+
<% } else { %>
|
|
11
|
+
<mat-progress-bar *ngIf="accordionDataSource.loading$ | async" mode="indeterminate"></mat-progress-bar>
|
|
12
|
+
<% } %>
|
|
13
|
+
<mat-accordion
|
|
14
|
+
<% if (persistent && persistent.key) { %>rxapPersistentAccordion="<%= persistent.key %>"<% } %>
|
|
15
|
+
<% if (persistent && persistent.property) { %>[rxapPersistentAccordion]="accordion.<%= persistent.property.name %>"<% } %>
|
|
16
|
+
<% if (multiple) { %>multi<% } %>
|
|
17
|
+
>
|
|
11
18
|
<% for (let index = 0; index < itemList.length; index++) { %>
|
|
12
19
|
<% item = itemList[index] %>
|
|
13
20
|
<% if (item.type === 'switch') { %>
|
|
14
|
-
|
|
21
|
+
<% if (item.permission) { %><ng-template rxapIfHasPermission="<%= item.permission %>"><% } %>
|
|
22
|
+
<ng-container [ngSwitch]="accordion.<%= item.switch.property.name %>">
|
|
15
23
|
<% for (const caseItem of item.switch.case) { %>
|
|
16
24
|
<% if (item.switch.property.type === 'string') { %>
|
|
17
25
|
<ng-template [ngSwitchCase]="'<%= caseItem.test %>'">
|
|
@@ -19,49 +27,55 @@
|
|
|
19
27
|
<ng-template [ngSwitchCase]="<%= caseItem.test %>">
|
|
20
28
|
<% } %>
|
|
21
29
|
<% for (const innerItem of caseItem.itemList) { %>
|
|
30
|
+
<% if (innerItem.permission) { %><ng-template rxapIfHasPermission="<%= innerItem.permission %>"><% } %>
|
|
22
31
|
<mat-expansion-panel>
|
|
23
32
|
|
|
24
33
|
<mat-expansion-panel-header>
|
|
25
|
-
<mat-panel-title i18n><%=
|
|
34
|
+
<mat-panel-title i18n><%= innerItem.title %></mat-panel-title>
|
|
26
35
|
<% if (innerItem.description) { %>
|
|
27
36
|
<mat-panel-description i18n><%= innerItem.description %></mat-panel-description>
|
|
28
37
|
<% } %>
|
|
29
38
|
</mat-expansion-panel-header>
|
|
30
39
|
|
|
31
40
|
<ng-template matExpansionPanelContent>
|
|
32
|
-
<<%= prefix %>-<%=
|
|
41
|
+
<<%= prefix %>-<%= innerItem.name %>-panel></<%= prefix %>-<%= innerItem.name %>-panel>
|
|
33
42
|
</ng-template>
|
|
34
43
|
|
|
35
44
|
</mat-expansion-panel>
|
|
45
|
+
<% if (innerItem.permission) { %></ng-template><% } %>
|
|
36
46
|
<% } %>
|
|
37
47
|
</ng-template>
|
|
38
48
|
<% } %>
|
|
39
49
|
<% if (item.switch.defaultCase) { %>
|
|
50
|
+
<ng-template ngSwitchDefault>
|
|
40
51
|
<% for (const innerItem of item.switch.defaultCase.itemList) { %>
|
|
41
|
-
|
|
52
|
+
<% if (innerItem.permission) { %><ng-template rxapIfHasPermission="<%= innerItem.permission %>"><% } %>
|
|
42
53
|
<mat-expansion-panel>
|
|
43
54
|
|
|
44
55
|
<mat-expansion-panel-header>
|
|
45
|
-
<mat-panel-title i18n><%=
|
|
56
|
+
<mat-panel-title i18n><%= innerItem.title %></mat-panel-title>
|
|
46
57
|
<% if (innerItem.description) { %>
|
|
47
58
|
<mat-panel-description i18n><%= innerItem.description %></mat-panel-description>
|
|
48
59
|
<% } %>
|
|
49
60
|
</mat-expansion-panel-header>
|
|
50
61
|
|
|
51
62
|
<ng-template matExpansionPanelContent>
|
|
52
|
-
<<%= prefix %>-<%=
|
|
63
|
+
<<%= prefix %>-<%= innerItem.name %>-panel></<%= prefix %>-<%= innerItem.name %>-panel>
|
|
53
64
|
</ng-template>
|
|
54
65
|
|
|
55
66
|
</mat-expansion-panel>
|
|
56
|
-
|
|
67
|
+
<% if (innerItem.permission) { %></ng-template><% } %>
|
|
57
68
|
<% } %>
|
|
69
|
+
</ng-template>
|
|
58
70
|
<% } %>
|
|
59
71
|
</ng-container>
|
|
72
|
+
<% if (item.permission) { %></ng-template><% } %>
|
|
60
73
|
<% } else { %>
|
|
74
|
+
<% if (item.permission) { %><ng-template rxapIfHasPermission="<%= item.permission %>"><% } %>
|
|
61
75
|
<mat-expansion-panel>
|
|
62
76
|
|
|
63
77
|
<mat-expansion-panel-header>
|
|
64
|
-
<mat-panel-title i18n><%=
|
|
78
|
+
<mat-panel-title i18n><%= item.title %></mat-panel-title>
|
|
65
79
|
<% if (item.description) { %>
|
|
66
80
|
<mat-panel-description i18n><%= item.description %></mat-panel-description>
|
|
67
81
|
<% } %>
|
|
@@ -72,6 +86,7 @@
|
|
|
72
86
|
</ng-template>
|
|
73
87
|
|
|
74
88
|
</mat-expansion-panel>
|
|
89
|
+
<% if (item.permission) { %></ng-template><% } %>
|
|
75
90
|
<% } %>
|
|
76
91
|
<% } %>
|
|
77
92
|
<!-- NEXT_INDEX[<%= itemList.length %>] -->
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
<rxap-navigate-back-button>
|
|
2
2
|
<ng-container>
|
|
3
|
-
|
|
3
|
+
<% if (header.title) { %>
|
|
4
|
+
<h1><%= header.title %></h1>
|
|
5
|
+
<% } %>
|
|
6
|
+
<% if (header.property) { %>
|
|
7
|
+
<h1>{{data.<%= header.property.name %>}}</h1>
|
|
8
|
+
<% } %>
|
|
4
9
|
</ng-container>
|
|
5
10
|
</rxap-navigate-back-button>
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import { Tree } from '@angular-devkit/schematics';
|
|
2
2
|
import { Normalized } from '@rxap/utilities';
|
|
3
|
-
import {
|
|
3
|
+
import { NormalizedAccordionHeader } from '../../../lib/accordion-header';
|
|
4
|
+
import { NormalizedAccordionIdentifier } from '../../../lib/accordion-identifier';
|
|
5
|
+
import { NormalizedBaseAccordionItem } from '../../../lib/accordion-item';
|
|
4
6
|
import { NormalizedAngularOptions } from '../../../lib/angular-options';
|
|
7
|
+
import { NormalizedPersistent } from '../../../lib/persistent';
|
|
5
8
|
import { AccordionComponentOptions } from './schema';
|
|
6
|
-
export interface NormalizedAccordionComponentOptions extends Readonly<Normalized<Omit<AccordionComponentOptions, 'itemList'>> & NormalizedAngularOptions> {
|
|
9
|
+
export interface NormalizedAccordionComponentOptions extends Readonly<Normalized<Omit<AccordionComponentOptions, 'itemList' | 'persistent' | 'identifier'>> & NormalizedAngularOptions> {
|
|
7
10
|
name: string;
|
|
8
|
-
itemList: ReadonlyArray<
|
|
11
|
+
itemList: ReadonlyArray<NormalizedBaseAccordionItem>;
|
|
12
|
+
persistent: NormalizedPersistent | null;
|
|
13
|
+
withPermission: boolean;
|
|
14
|
+
header: NormalizedAccordionHeader | null;
|
|
15
|
+
identifier: NormalizedAccordionIdentifier | null;
|
|
9
16
|
}
|
|
10
17
|
export default function (options: AccordionComponentOptions): (host: Tree) => import("@angular-devkit/schematics").Rule;
|