@rxap/schematic-angular 19.1.1-dev.3 → 19.2.0-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 +9 -0
- package/GUIDES.md +160 -0
- package/README.md +164 -0
- package/package.json +8 -8
- package/src/examples/feature/dashboard/dashboard-accordion/schematics.yaml +226 -0
- package/src/examples/feature/dashboard/dashboard-table/schematic.yml +103 -0
- package/src/examples/feature/dashboard-template/dashboard-template-table/schematic.yml +95 -0
- package/src/examples/feature/machine/machine-accordion/schematic.yaml +83 -0
- package/src/examples/feature/machine/machine-table/schematic.yaml +139 -0
- package/src/examples/feature/machine-definition/machine-definition-details/data-definition-modbus-tcp-table/schematic.yaml +63 -0
- package/src/examples/feature/machine-definition/machine-definition-details/data-definition-opc-ua-table/schematic.yaml +58 -0
- package/src/examples/feature/machine-definition/machine-definition-details/data-definition-open-platform-protocol-table/schematic.yaml +49 -0
- package/src/examples/feature/machine-definition/machine-definition-details/data-definition-s7-iso-on-tcp-table/schematic.yaml +64 -0
- package/src/examples/feature/machine-definition/machine-definition-details/data-trigger-table/schematic.yaml +43 -0
- package/src/examples/feature/machine-definition/machine-definition-details/message-group-table/schematic.yaml +41 -0
- package/src/examples/feature/machine-definition/machine-definition-details/message-trigger-connection-table/schematic.yaml +38 -0
- package/src/examples/feature/machine-definition/machine-definition-details/physical-unit-table/schematic.yaml +41 -0
- package/src/examples/feature/machine-definition/machine-definition-table/schematic.yaml +107 -0
- package/src/examples/feature/node-red/node-red-table/schematic.yaml +114 -0
- package/src/examples/feature/report/report-accordion/schematic.yaml +318 -0
- package/src/examples/feature/report/report-table/schematic.yaml +66 -0
- package/src/examples/feature/service-network/company-accordion/schematic.yaml +119 -0
- package/src/examples/feature/service-network/service-network-accordion/schematic.yml +65 -0
- package/src/examples/feature/thing/thing-table/schematic.yml +115 -0
- package/src/examples/feature/user/user-table/schematic.yaml +99 -0
- package/src/examples/schematics.yaml +18 -0
- package/src/guides/backend.md +49 -0
- package/src/guides/form-component.md +58 -0
- package/src/guides/form-control.md +269 -0
- package/src/guides/header-button.md +57 -0
- package/src/guides/table-action.md +120 -0
- package/src/guides/table-column.md +185 -0
- package/src/guides/table-component.md +51 -0
- package/src/guides/table-filter.md +69 -0
- package/src/guides/table-modifiers.md +22 -0
- package/src/guides/upstream.md +49 -0
- package/src/lib/angular-options.js +0 -1
- package/src/lib/angular-options.js.map +1 -1
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
# Form Control Guide
|
|
2
|
+
|
|
3
|
+
Form controls define the inputs and fields within a form.
|
|
4
|
+
|
|
5
|
+
## Base Configuration
|
|
6
|
+
|
|
7
|
+
All controls share these common properties (inheriting from `abstract-control`):
|
|
8
|
+
|
|
9
|
+
| Property | Type | Description |
|
|
10
|
+
| :--- | :--- | :--- |
|
|
11
|
+
| `name` | `string` | The control name (key in the form value). |
|
|
12
|
+
| `label` | `string` | The label displayed to the user. |
|
|
13
|
+
| `kind` | `string` | The type of control (e.g., `input`, `select`). |
|
|
14
|
+
| `isRequired` | `boolean` | Whether the field is mandatory. |
|
|
15
|
+
| `isDisabled` | `boolean` | Whether the control is disabled by default. |
|
|
16
|
+
| `isReadonly` | `boolean` | Whether the control is read-only. |
|
|
17
|
+
| `state` | `any` | The initial value/state of the control. |
|
|
18
|
+
| `validatorList` | `array<string>` | List of Angular validators (e.g., `['required', 'email']`). |
|
|
19
|
+
| `cssClass` | `string` | Custom CSS classes for the control. |
|
|
20
|
+
| `template` | `string` | Path to a custom Handlebars template file. |
|
|
21
|
+
|
|
22
|
+
## Form Field Options
|
|
23
|
+
|
|
24
|
+
Controls that render within a Material Form Field (Input, Select, Date, etc.) support additional options:
|
|
25
|
+
|
|
26
|
+
| Property | Type | Description |
|
|
27
|
+
| :--- | :--- | :--- |
|
|
28
|
+
| `hasClearButton` | `boolean` | Adds a button to clear the input value. |
|
|
29
|
+
| `prefixButton` | `object` | Adds a button/icon to the start of the field. |
|
|
30
|
+
| `suffixButton` | `object` | Adds a button/icon to the end of the field. |
|
|
31
|
+
|
|
32
|
+
### Example: Input with Icon and Clear Button
|
|
33
|
+
```yaml
|
|
34
|
+
- name: search
|
|
35
|
+
kind: input
|
|
36
|
+
label: Search
|
|
37
|
+
hasClearButton: true
|
|
38
|
+
formField:
|
|
39
|
+
prefixButton:
|
|
40
|
+
icon: search
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Control Kinds
|
|
44
|
+
|
|
45
|
+
### Input
|
|
46
|
+
|
|
47
|
+
Standard text input field.
|
|
48
|
+
|
|
49
|
+
| Property | Type | Description |
|
|
50
|
+
| :--- | :--- | :--- |
|
|
51
|
+
| `inputType` | `string` | HTML input type (e.g., `text`, `password`, `email`). Default: `text`. |
|
|
52
|
+
| `placeholder` | `string` | Placeholder text. |
|
|
53
|
+
|
|
54
|
+
```yaml
|
|
55
|
+
- name: email
|
|
56
|
+
kind: input
|
|
57
|
+
inputType: email
|
|
58
|
+
label: Email Address
|
|
59
|
+
placeholder: Enter your email
|
|
60
|
+
isRequired: true
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Select
|
|
64
|
+
|
|
65
|
+
Dropdown selection control.
|
|
66
|
+
|
|
67
|
+
| Property | Type | Description |
|
|
68
|
+
| :--- | :--- | :--- |
|
|
69
|
+
| `multiple` | `boolean` | Allow multiple selections. |
|
|
70
|
+
| `optionList` | `array` | Static list of options. |
|
|
71
|
+
| `upstream` | `object` | Load options from an API. See [Upstream Guide](./upstream.md). |
|
|
72
|
+
|
|
73
|
+
```yaml
|
|
74
|
+
- name: role
|
|
75
|
+
kind: select
|
|
76
|
+
label: User Role
|
|
77
|
+
options:
|
|
78
|
+
- value: admin
|
|
79
|
+
display: Administrator
|
|
80
|
+
- value: user
|
|
81
|
+
display: Standard User
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
### Checkbox
|
|
86
|
+
|
|
87
|
+
Boolean checkbox control.
|
|
88
|
+
|
|
89
|
+
| Property | Type | Description |
|
|
90
|
+
| :--- | :--- | :--- |
|
|
91
|
+
| `labelPosition` | `string` | Valid values: `before`, `after`. |
|
|
92
|
+
|
|
93
|
+
```yaml
|
|
94
|
+
- name: isActive
|
|
95
|
+
kind: checkbox
|
|
96
|
+
label: Active
|
|
97
|
+
state: true
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Textarea
|
|
101
|
+
|
|
102
|
+
Multi-line text input.
|
|
103
|
+
|
|
104
|
+
| Property | Type | Description |
|
|
105
|
+
| :--- | :--- | :--- |
|
|
106
|
+
| `minRows` | `number` | Minimum number of rows. |
|
|
107
|
+
| `maxRows` | `number` | Maximum number of rows. |
|
|
108
|
+
|
|
109
|
+
```yaml
|
|
110
|
+
- name: description
|
|
111
|
+
kind: textarea
|
|
112
|
+
label: Description
|
|
113
|
+
autosize:
|
|
114
|
+
minRows: 3
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Date
|
|
118
|
+
|
|
119
|
+
Date picker control.
|
|
120
|
+
|
|
121
|
+
| Property | Type | Description |
|
|
122
|
+
| :--- | :--- | :--- |
|
|
123
|
+
| `placeholder` | `string` | Placeholder text. |
|
|
124
|
+
|
|
125
|
+
```yaml
|
|
126
|
+
- name: birthday
|
|
127
|
+
kind: date
|
|
128
|
+
label: Birthday
|
|
129
|
+
placeholder: Select a date
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Slide Toggle
|
|
133
|
+
|
|
134
|
+
Material design slide toggle.
|
|
135
|
+
|
|
136
|
+
| Property | Type | Description |
|
|
137
|
+
| :--- | :--- | :--- |
|
|
138
|
+
| `labelPosition` | `string` | Valid values: `before`, `after`. |
|
|
139
|
+
|
|
140
|
+
```yaml
|
|
141
|
+
- name: notifications
|
|
142
|
+
kind: slide-toggle
|
|
143
|
+
label: Enable Notifications
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### Autocomplete
|
|
147
|
+
|
|
148
|
+
Input with autocomplete suggestions.
|
|
149
|
+
|
|
150
|
+
| Property | Type | Description |
|
|
151
|
+
| :--- | :--- | :--- |
|
|
152
|
+
| `upstream` | `object` | Source for suggestion data. See [Upstream Guide](./upstream.md). |
|
|
153
|
+
| `toDisplay` | `object` | Property to use for display label. |
|
|
154
|
+
| `toValue` | `object` | Property to use for the control value. |
|
|
155
|
+
|
|
156
|
+
```yaml
|
|
157
|
+
- name: city
|
|
158
|
+
kind: autocomplete
|
|
159
|
+
label: City
|
|
160
|
+
upstream:
|
|
161
|
+
kind: open-api
|
|
162
|
+
operationId: searchCities
|
|
163
|
+
toDisplay:
|
|
164
|
+
property: name
|
|
165
|
+
toValue:
|
|
166
|
+
property: id
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Table Select
|
|
170
|
+
|
|
171
|
+
Opens a dialog with a table to select an item.
|
|
172
|
+
|
|
173
|
+
| Property | Type | Description |
|
|
174
|
+
| :--- | :--- | :--- |
|
|
175
|
+
| `title` | `string` | Title of the selection window. |
|
|
176
|
+
| `columnList` | `array` | Columns to display in the selection table. |
|
|
177
|
+
| `upstream` | `object` | Data source for the table. See [Upstream Guide](./upstream.md). |
|
|
178
|
+
|
|
179
|
+
```yaml
|
|
180
|
+
- name: project
|
|
181
|
+
kind: table-select
|
|
182
|
+
label: Project
|
|
183
|
+
upstream:
|
|
184
|
+
kind: open-api
|
|
185
|
+
operationId: listProjects
|
|
186
|
+
columnList:
|
|
187
|
+
- name: name
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### Autocomplete Table Select
|
|
191
|
+
|
|
192
|
+
Combines autocomplete with table selection.
|
|
193
|
+
|
|
194
|
+
| Property | Type | Description |
|
|
195
|
+
| :--- | :--- | :--- |
|
|
196
|
+
| `title` | `string` | Title of the selection window. |
|
|
197
|
+
| `columnList` | `array` | Columns to display in the selection table. |
|
|
198
|
+
| `upstream` | `object` | Data source. See [Upstream Guide](./upstream.md). |
|
|
199
|
+
|
|
200
|
+
```yaml
|
|
201
|
+
- name: company
|
|
202
|
+
kind: autocomplete-table-select
|
|
203
|
+
backend: nestjs
|
|
204
|
+
formField:
|
|
205
|
+
cssClass: "w-[500px]"
|
|
206
|
+
toValue:
|
|
207
|
+
property: uuid
|
|
208
|
+
columnList:
|
|
209
|
+
- name: name
|
|
210
|
+
hasFilter: true
|
|
211
|
+
resolver:
|
|
212
|
+
upstream:
|
|
213
|
+
kind: open-api
|
|
214
|
+
operationId: company-getByUuid
|
|
215
|
+
mapper:
|
|
216
|
+
kind: resolve
|
|
217
|
+
value: uuid
|
|
218
|
+
upstream:
|
|
219
|
+
kind: open-api
|
|
220
|
+
operationId: company-getFilter
|
|
221
|
+
mapper:
|
|
222
|
+
kind: paged
|
|
223
|
+
pageIndex: page
|
|
224
|
+
pageSize: size
|
|
225
|
+
sortBy: sort
|
|
226
|
+
sortDirection: order
|
|
227
|
+
list: entities
|
|
228
|
+
total: maxCount
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
## Custom Templates
|
|
232
|
+
|
|
233
|
+
You can provide a custom Handlebars template for any control using the `template` property. This allows full control over the generated HTML for that specific form field.
|
|
234
|
+
|
|
235
|
+
```yaml
|
|
236
|
+
- name: customField
|
|
237
|
+
kind: input
|
|
238
|
+
template: libs/my-lib/src/templates/custom-input.hbs
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
## Validators
|
|
243
|
+
|
|
244
|
+
Validators are defined as a list of strings mapped to Angular validators. You can also use regex patterns.
|
|
245
|
+
|
|
246
|
+
```yaml
|
|
247
|
+
validatorList:
|
|
248
|
+
- required
|
|
249
|
+
- email
|
|
250
|
+
- "pattern(/^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$/)"
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
## Advanced Upstream Configuration
|
|
254
|
+
|
|
255
|
+
For controls like `select` or `autocomplete`, you often need to map data from an API.
|
|
256
|
+
|
|
257
|
+
```yaml
|
|
258
|
+
- name: type
|
|
259
|
+
kind: select
|
|
260
|
+
backend: nestjs
|
|
261
|
+
upstream:
|
|
262
|
+
kind: open-api
|
|
263
|
+
operationId: options-controller-getReportTypes
|
|
264
|
+
mapper:
|
|
265
|
+
kind: options
|
|
266
|
+
toFunction: ToOptionsFromObject
|
|
267
|
+
toValue: Number
|
|
268
|
+
```
|
|
269
|
+
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Header Button Guide
|
|
2
|
+
|
|
3
|
+
Header buttons are actions placed in the top section of the table component, typically used for global actions like "Create New", "Import", or "Export".
|
|
4
|
+
|
|
5
|
+
## Button Kinds
|
|
6
|
+
|
|
7
|
+
| Kind | Description |
|
|
8
|
+
| :--- | :--- |
|
|
9
|
+
| `default` | A standard button (default). |
|
|
10
|
+
| `form` | Opens a form (usually in a dialog) when clicked. |
|
|
11
|
+
| `navigation` | Navigates to a route when clicked. |
|
|
12
|
+
| `method` | Calls a specific method when clicked. |
|
|
13
|
+
|
|
14
|
+
## Configuration
|
|
15
|
+
|
|
16
|
+
Header buttons share common properties with table actions.
|
|
17
|
+
|
|
18
|
+
```yaml
|
|
19
|
+
headerButton:
|
|
20
|
+
kind: form
|
|
21
|
+
icon: add
|
|
22
|
+
text: Create Project
|
|
23
|
+
options:
|
|
24
|
+
# Form configuration here
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Properties
|
|
28
|
+
|
|
29
|
+
| Property | Type | Description |
|
|
30
|
+
| :--- | :--- | :--- |
|
|
31
|
+
| `kind` | `string` | The type of button (alias: `role`). |
|
|
32
|
+
| `icon` | `string` | Material icon name. |
|
|
33
|
+
| `text` | `string` | The button label. |
|
|
34
|
+
| `disabled`| `boolean`| Whether the button is disabled. |
|
|
35
|
+
| `permission`| `string`| Required permission to see the button. |
|
|
36
|
+
| `color` | `string` | Material color (e.g., `primary`, `accent`). |
|
|
37
|
+
| `options` | `object` | Kind-specific configuration (e.g., form details). |
|
|
38
|
+
|
|
39
|
+
## Examples
|
|
40
|
+
|
|
41
|
+
### Navigation Header Button
|
|
42
|
+
```yaml
|
|
43
|
+
headerButton:
|
|
44
|
+
kind: navigation
|
|
45
|
+
icon: arrow_back
|
|
46
|
+
text: Back to Dashboard
|
|
47
|
+
route: /dashboard
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Method Header Button
|
|
51
|
+
```yaml
|
|
52
|
+
headerButton:
|
|
53
|
+
kind: method
|
|
54
|
+
icon: download
|
|
55
|
+
text: Export CSV
|
|
56
|
+
method: exportData
|
|
57
|
+
```
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# Table Action Guide
|
|
2
|
+
|
|
3
|
+
Table actions allow users to perform operations on specific rows or on the table as a whole.
|
|
4
|
+
|
|
5
|
+
## Row Actions
|
|
6
|
+
|
|
7
|
+
Row actions are typically rendered in an "Actions" column at the end of the row.
|
|
8
|
+
|
|
9
|
+
```yaml
|
|
10
|
+
actionList:
|
|
11
|
+
- type: edit
|
|
12
|
+
icon: edit
|
|
13
|
+
tooltip: Edit User
|
|
14
|
+
- type: delete
|
|
15
|
+
icon: delete
|
|
16
|
+
confirm: true # Shows a confirmation dialog before executing
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Action Types
|
|
20
|
+
|
|
21
|
+
The `type` property defines the behavior of the action.
|
|
22
|
+
|
|
23
|
+
| Type | Description |
|
|
24
|
+
| :--- | :--- |
|
|
25
|
+
| `operation` | Generic operation, often linked to a backend method. |
|
|
26
|
+
| `dialog` | Opens a dialog component. |
|
|
27
|
+
| `navigation` | Navigates to a different route. |
|
|
28
|
+
| `form` | Opens a form (often in a dialog) to edit/create data. |
|
|
29
|
+
| `open-api` | Directly calls an OpenAPI operation. |
|
|
30
|
+
|
|
31
|
+
## Common Properties
|
|
32
|
+
|
|
33
|
+
| Property | Description |
|
|
34
|
+
| :--- | :--- |
|
|
35
|
+
| `icon` | Material icon name. |
|
|
36
|
+
| `tooltip` | Text shown on hover. |
|
|
37
|
+
| `confirm` | If `true`, requires user confirmation. |
|
|
38
|
+
| `refresh` | If `true`, refreshes the table after completion. |
|
|
39
|
+
| `inHeader` | If `true`, the action is placed in the table header (global action). |
|
|
40
|
+
| `permission` | (Optional) Permission string required to see/execute the action. |
|
|
41
|
+
| `checkFunction` | JavaScript expression string to dynamically check visibility (e.g. `!element.archived`). |
|
|
42
|
+
| `color` | Angular Material color palette name (e.g. `primary`, `accent`, `warn`). |
|
|
43
|
+
| `role` | (Alias: `kind`) The role of the action (e.g. `method`, `navigation`). |
|
|
44
|
+
|
|
45
|
+
## Examples
|
|
46
|
+
|
|
47
|
+
### Navigation Action
|
|
48
|
+
```yaml
|
|
49
|
+
- type: details
|
|
50
|
+
icon: visibility
|
|
51
|
+
role: navigation
|
|
52
|
+
options:
|
|
53
|
+
route: "/users/user/{{uuid}}/details"
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Header Action (e.g., Create New)
|
|
58
|
+
```yaml
|
|
59
|
+
- type: create
|
|
60
|
+
icon: add
|
|
61
|
+
inHeader: true
|
|
62
|
+
role: form
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Action with Confirmation
|
|
66
|
+
```yaml
|
|
67
|
+
- type: archive
|
|
68
|
+
icon: archive
|
|
69
|
+
confirm: true
|
|
70
|
+
color: warn
|
|
71
|
+
permission: user.archive
|
|
72
|
+
checkFunction: "!element.archived"
|
|
73
|
+
successMessage: "Item archived successfully"
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Form Actions
|
|
78
|
+
|
|
79
|
+
You can use the `form` kind (or role) to open a form when an action is triggered. This is commonly used for "Create" or "Edit" actions.
|
|
80
|
+
|
|
81
|
+
### Defining the Form
|
|
82
|
+
|
|
83
|
+
You can define the form structure directly within the action using `formOptions`.
|
|
84
|
+
|
|
85
|
+
```yaml
|
|
86
|
+
- type: create
|
|
87
|
+
kind: form
|
|
88
|
+
icon: add
|
|
89
|
+
formOptions:
|
|
90
|
+
controlList:
|
|
91
|
+
- name: name
|
|
92
|
+
label: Name
|
|
93
|
+
required: true
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Pre-filling Data
|
|
97
|
+
|
|
98
|
+
Use the `loadFrom` property to pre-fill the form with data from the row or an API call.
|
|
99
|
+
|
|
100
|
+
- **From Row**: The form is automatically populated with the row data if `formInitial` is true.
|
|
101
|
+
- **From API**:
|
|
102
|
+
|
|
103
|
+
```yaml
|
|
104
|
+
- type: edit
|
|
105
|
+
kind: form
|
|
106
|
+
icon: edit
|
|
107
|
+
loadFrom:
|
|
108
|
+
operationId: getUserDetails
|
|
109
|
+
parameters: true # Uses row data as parameters
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Saving Data
|
|
113
|
+
|
|
114
|
+
The form submission is handled by an `operationId` (if connected to an API).
|
|
115
|
+
|
|
116
|
+
```yaml
|
|
117
|
+
formOptions:
|
|
118
|
+
submit:
|
|
119
|
+
operationId: updateUser
|
|
120
|
+
```
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
# Table Column Guide
|
|
2
|
+
|
|
3
|
+
Table columns define the data displayed in each column and how it's rendered.
|
|
4
|
+
|
|
5
|
+
## Base Configuration
|
|
6
|
+
|
|
7
|
+
All columns share these common properties:
|
|
8
|
+
|
|
9
|
+
| Property | Type | Description |
|
|
10
|
+
| :--- | :--- | :--- |
|
|
11
|
+
| `name` | `string` | The property name from the row data (Required). |
|
|
12
|
+
| `title` | `string` | The header label. Defaults to `name` if not provided. |
|
|
13
|
+
| `kind` | `string` | The type of column (e.g., `date`, `options`). Default: `text`. |
|
|
14
|
+
| `sortable` | `boolean` | Enable sorting for this column. |
|
|
15
|
+
| `hasFilter` | `boolean` | Enable filtering for this column. |
|
|
16
|
+
| `hidden` | `boolean` | Initially hide the column. |
|
|
17
|
+
| `nowrap` | `boolean` | Prevent text wrapping in cells. |
|
|
18
|
+
| `cssClass` | `string` | Custom CSS class for the cell. |
|
|
19
|
+
| `pipeList` | `array` | List of Angular pipes to apply to the value. |
|
|
20
|
+
| `modifiers` | `array` | List of column modifiers. |
|
|
21
|
+
| `template` | `string` | Path to a custom Handlebars template file. |
|
|
22
|
+
| `filterControl` | `object` | Configuration for a custom filter input (e.g. specific CSS class). |
|
|
23
|
+
|
|
24
|
+
## Column Kinds
|
|
25
|
+
|
|
26
|
+
### Text (Default)
|
|
27
|
+
|
|
28
|
+
Renders the value as plain text. You can use pipes to format the text.
|
|
29
|
+
|
|
30
|
+
```yaml
|
|
31
|
+
- name: email
|
|
32
|
+
title: Email Address
|
|
33
|
+
sortable: true
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Date
|
|
37
|
+
|
|
38
|
+
Formats the value as a date.
|
|
39
|
+
|
|
40
|
+
| Property | Type | Description |
|
|
41
|
+
| :--- | :--- | :--- |
|
|
42
|
+
| `format` | `string` | The date format string (compatible with Angular's `date` pipe). |
|
|
43
|
+
|
|
44
|
+
```yaml
|
|
45
|
+
- name: createdAt
|
|
46
|
+
kind: date
|
|
47
|
+
title: Created Date
|
|
48
|
+
format: "dd.MM.yyyy HH:mm"
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Options
|
|
52
|
+
|
|
53
|
+
Maps value codes to display labels. Useful for enums or status fields.
|
|
54
|
+
|
|
55
|
+
| Property | Type | Description |
|
|
56
|
+
| :--- | :--- | :--- |
|
|
57
|
+
| `optionList` | `array` | List of value-display pairs. |
|
|
58
|
+
|
|
59
|
+
**Option Structure:**
|
|
60
|
+
- `value`: The raw data value (string, number, boolean).
|
|
61
|
+
- `display`: Text to display.
|
|
62
|
+
|
|
63
|
+
```yaml
|
|
64
|
+
- name: status
|
|
65
|
+
kind: options
|
|
66
|
+
optionList:
|
|
67
|
+
- value: ACTIVE
|
|
68
|
+
display: Active
|
|
69
|
+
- value: INACTIVE
|
|
70
|
+
display: Inactive
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Boolean
|
|
74
|
+
|
|
75
|
+
Renders a standard check/close icon for boolean values.
|
|
76
|
+
|
|
77
|
+
```yaml
|
|
78
|
+
- name: verified
|
|
79
|
+
kind: boolean
|
|
80
|
+
title: Is Verified?
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Link
|
|
84
|
+
|
|
85
|
+
Renders the value as a clickable link.
|
|
86
|
+
|
|
87
|
+
```yaml
|
|
88
|
+
- name: website
|
|
89
|
+
kind: link
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Icon
|
|
93
|
+
|
|
94
|
+
Renders the value as a Material icon name.
|
|
95
|
+
*Note: The value from the row data must be a valid icon name (e.g., 'home', 'settings').*
|
|
96
|
+
|
|
97
|
+
```yaml
|
|
98
|
+
- name: iconName
|
|
99
|
+
kind: icon
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Copy to Clipboard
|
|
103
|
+
|
|
104
|
+
Renders the value with a button to copy it to the clipboard. Useful for IDs, tokens, or hashes.
|
|
105
|
+
|
|
106
|
+
```yaml
|
|
107
|
+
- name: apiKey
|
|
108
|
+
kind: copy-to-clipboard
|
|
109
|
+
title: API Key
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Component
|
|
113
|
+
|
|
114
|
+
Renders a custom Angular component within the cell.
|
|
115
|
+
*The component to be rendered is typically determined by convention or further configuration not detailed here.*
|
|
116
|
+
|
|
117
|
+
```yaml
|
|
118
|
+
- name: profile
|
|
119
|
+
kind: component
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Spinner
|
|
123
|
+
|
|
124
|
+
Renders a loading spinner. Often used for columns tracking async operations or status.
|
|
125
|
+
|
|
126
|
+
```yaml
|
|
127
|
+
- name: isProcessing
|
|
128
|
+
kind: spinner
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Tree
|
|
132
|
+
|
|
133
|
+
Used for the primary column in a Tree Table to display the hierarchy (expander icons/indentation).
|
|
134
|
+
|
|
135
|
+
```yaml
|
|
136
|
+
- name: name
|
|
137
|
+
kind: tree
|
|
138
|
+
title: Folder Name
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Custom
|
|
142
|
+
|
|
143
|
+
Allows you to provide a custom HTML template directly in the config.
|
|
144
|
+
|
|
145
|
+
| Property | Type | Description |
|
|
146
|
+
| :--- | :--- | :--- |
|
|
147
|
+
| `html` | `string` | The HTML content to render in the cell. |
|
|
148
|
+
|
|
149
|
+
```yaml
|
|
150
|
+
- name: details
|
|
151
|
+
kind: custom
|
|
152
|
+
html: "<span class='badge'>{{ element.status }}</span>"
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Custom Template File
|
|
156
|
+
|
|
157
|
+
For more complex customizations where inline HTML is insufficient, you can provide a path to a Handlebars template file.
|
|
158
|
+
|
|
159
|
+
```yaml
|
|
160
|
+
- name: fancyColumn
|
|
161
|
+
template: libs/shared/templates/fancy-cell.hbs
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## Advanced Usage
|
|
165
|
+
|
|
166
|
+
### Using Pipes
|
|
167
|
+
|
|
168
|
+
You can apply multiple pipes to any column.
|
|
169
|
+
|
|
170
|
+
```yaml
|
|
171
|
+
- name: amount
|
|
172
|
+
pipeList:
|
|
173
|
+
- name: currency
|
|
174
|
+
args: ["EUR"]
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### Column Modifiers
|
|
178
|
+
|
|
179
|
+
Modifiers change the behavior of how columns are generated or displayed.
|
|
180
|
+
|
|
181
|
+
```yaml
|
|
182
|
+
- name: id
|
|
183
|
+
modifiers:
|
|
184
|
+
- primary-key
|
|
185
|
+
```
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Table Component Schematic Guide
|
|
2
|
+
|
|
3
|
+
The `table-component` schematic is used to generate a comprehensive Angular Material table component, optionally connected to a NestJS backend.
|
|
4
|
+
|
|
5
|
+
## Basic Usage
|
|
6
|
+
|
|
7
|
+
To generate a table component, you define it in a `schematic.yaml` or `schematic.json` file.
|
|
8
|
+
|
|
9
|
+
```yaml
|
|
10
|
+
- package: "@rxap/schematic-angular"
|
|
11
|
+
name: table-component
|
|
12
|
+
options:
|
|
13
|
+
name: user-list
|
|
14
|
+
project: admin-panel
|
|
15
|
+
feature: user
|
|
16
|
+
columnList:
|
|
17
|
+
- name: email
|
|
18
|
+
- name: name
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Properties
|
|
22
|
+
|
|
23
|
+
| Property | Type | Description |
|
|
24
|
+
| :--- | :--- | :--- |
|
|
25
|
+
| `name` | `string` | The name of the component and entity. |
|
|
26
|
+
| `project` | `string` | The target project (frontend). |
|
|
27
|
+
| `feature` | `string` | The feature module name. |
|
|
28
|
+
| `nestModule` | `string` | (Optional) The NestJS module name for backend generation. |
|
|
29
|
+
| `backend` | `object \| string` | [Backend Configuration](./backend.md) |
|
|
30
|
+
| `columnList` | `array` | [Column Definitions](./table-column.md) |
|
|
31
|
+
| `actionList` | `array` | [Action Definitions](./table-action.md) |
|
|
32
|
+
| `filterList` | `array` | [Filter Definitions](./table-filter.md) |
|
|
33
|
+
| `headerButton` | `object` | [Header Button Configuration](./header-button.md) |
|
|
34
|
+
| `modifiers` | `array` | [Table Modifiers](./table-modifiers.md) |
|
|
35
|
+
| `upstream` | `object` | [Upstream Configuration](./upstream.md) |
|
|
36
|
+
| `sortable` | `boolean \| object` | Whether the table is sortable and its default state. |
|
|
37
|
+
| `cssClass` | `string \| array \| object` | Custom CSS classes for the table. |
|
|
38
|
+
| `selectColumn` | `boolean` | Whether to add a checkbox selection column. |
|
|
39
|
+
| `fullWidth` | `boolean` | Whether the table should take the full width of its container. |
|
|
40
|
+
|
|
41
|
+
## Detailed Guides
|
|
42
|
+
|
|
43
|
+
Dive into specific options for more advanced configurations:
|
|
44
|
+
|
|
45
|
+
- [**Table Columns**](./table-column.md): Learn about different column types (text, date, custom, etc.).
|
|
46
|
+
- [**Table Actions**](./table-action.md): Add row actions like edit, delete, or custom operations.
|
|
47
|
+
- [**Backend Configuration**](./backend.md): Connect your table to a NestJS or OpenAPI-based API.
|
|
48
|
+
- [**Table Filters**](./table-filter.md): Add search and filter controls to your table.
|
|
49
|
+
- [**Header Buttons**](./header-button.md): Add buttons to the table header for actions like "Create".
|
|
50
|
+
- [**Table Modifiers**](./table-modifiers.md): Tweak the table behavior and appearance with modifiers.
|
|
51
|
+
- [**Upstream Data**](./upstream.md): Configure data mapping and pagination for complex data sources.
|