@openmfp/webcomponents 0.6.1 → 0.6.7

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.
Files changed (142) hide show
  1. package/mfp-wc-dashboard.js +153 -0
  2. package/mfp-webcomponents.js +573 -0
  3. package/package.json +14 -68
  4. package/.github/workflows/pipeline.yaml +0 -41
  5. package/.storybook/main.ts +0 -34
  6. package/.storybook/preview.ts +0 -29
  7. package/.storybook/tsconfig.json +0 -11
  8. package/AGENTS.md +0 -153
  9. package/CODEOWNERS +0 -6
  10. package/CONTRIBUTING.md +0 -95
  11. package/LICENSE +0 -201
  12. package/LICENSES/Apache-2.0.txt +0 -73
  13. package/README.md +0 -91
  14. package/REUSE.toml +0 -9
  15. package/angular.json +0 -157
  16. package/docs/dashboard.md +0 -358
  17. package/docs/declarative-form.md +0 -178
  18. package/docs/declarative-table-card.md +0 -235
  19. package/docs/declarative-table.md +0 -315
  20. package/eslint.config.js +0 -41
  21. package/projects/ngx/cards/favorites/favorites.component.html +0 -12
  22. package/projects/ngx/cards/favorites/favorites.component.scss +0 -50
  23. package/projects/ngx/cards/favorites/favorites.component.ts +0 -19
  24. package/projects/ngx/cards/public-api.ts +0 -4
  25. package/projects/ngx/cards/service-status/service-status-card.component.html +0 -15
  26. package/projects/ngx/cards/service-status/service-status-card.component.scss +0 -87
  27. package/projects/ngx/cards/service-status/service-status-card.component.ts +0 -36
  28. package/projects/ngx/cards/stories/visited-service-card.stories.ts +0 -149
  29. package/projects/ngx/cards/visited-service-card/visited-service-card.component.html +0 -17
  30. package/projects/ngx/cards/visited-service-card/visited-service-card.component.scss +0 -34
  31. package/projects/ngx/cards/visited-service-card/visited-service-card.component.ts +0 -22
  32. package/projects/ngx/cards/whats-new/whats-new.component.html +0 -10
  33. package/projects/ngx/cards/whats-new/whats-new.component.scss +0 -25
  34. package/projects/ngx/cards/whats-new/whats-new.component.ts +0 -46
  35. package/projects/ngx/declarative-ui/dashboard/add-card-dialog/add-card-dialog.component.html +0 -28
  36. package/projects/ngx/declarative-ui/dashboard/add-card-dialog/add-card-dialog.component.scss +0 -44
  37. package/projects/ngx/declarative-ui/dashboard/add-card-dialog/add-card-dialog.component.spec.ts +0 -85
  38. package/projects/ngx/declarative-ui/dashboard/add-card-dialog/add-card-dialog.component.ts +0 -58
  39. package/projects/ngx/declarative-ui/dashboard/card/dashboard-card.component.html +0 -29
  40. package/projects/ngx/declarative-ui/dashboard/card/dashboard-card.component.scss +0 -63
  41. package/projects/ngx/declarative-ui/dashboard/card/dashboard-card.component.spec.ts +0 -255
  42. package/projects/ngx/declarative-ui/dashboard/card/dashboard-card.component.ts +0 -75
  43. package/projects/ngx/declarative-ui/dashboard/card/utils/dashboard-card-registry.spec.ts +0 -76
  44. package/projects/ngx/declarative-ui/dashboard/card/utils/dashboard-card-registry.ts +0 -109
  45. package/projects/ngx/declarative-ui/dashboard/card/utils/index.ts +0 -4
  46. package/projects/ngx/declarative-ui/dashboard/card/utils/mount-angular-card.spec.ts +0 -141
  47. package/projects/ngx/declarative-ui/dashboard/card/utils/mount-angular-card.ts +0 -44
  48. package/projects/ngx/declarative-ui/dashboard/card/utils/mount-sap-card.spec.ts +0 -142
  49. package/projects/ngx/declarative-ui/dashboard/card/utils/mount-sap-card.ts +0 -52
  50. package/projects/ngx/declarative-ui/dashboard/card/utils/mount-wc-card.spec.ts +0 -107
  51. package/projects/ngx/declarative-ui/dashboard/card/utils/mount-wc-card.ts +0 -22
  52. package/projects/ngx/declarative-ui/dashboard/dashboard/dashboard.component.html +0 -134
  53. package/projects/ngx/declarative-ui/dashboard/dashboard/dashboard.component.scss +0 -88
  54. package/projects/ngx/declarative-ui/dashboard/dashboard/dashboard.component.spec.ts +0 -354
  55. package/projects/ngx/declarative-ui/dashboard/dashboard/dashboard.component.ts +0 -238
  56. package/projects/ngx/declarative-ui/dashboard/dashboard/index.ts +0 -1
  57. package/projects/ngx/declarative-ui/dashboard/index.ts +0 -5
  58. package/projects/ngx/declarative-ui/dashboard/models/constants.ts +0 -2
  59. package/projects/ngx/declarative-ui/dashboard/models/dashboard.model.ts +0 -50
  60. package/projects/ngx/declarative-ui/dashboard/models/index.ts +0 -1
  61. package/projects/ngx/declarative-ui/dashboard/section/dashboard-section.component.html +0 -28
  62. package/projects/ngx/declarative-ui/dashboard/section/dashboard-section.component.scss +0 -85
  63. package/projects/ngx/declarative-ui/dashboard/section/dashboard-section.component.spec.ts +0 -104
  64. package/projects/ngx/declarative-ui/dashboard/section/dashboard-section.component.ts +0 -23
  65. package/projects/ngx/declarative-ui/form/declarative-form/declarative-form.component.html +0 -62
  66. package/projects/ngx/declarative-ui/form/declarative-form/declarative-form.component.scss +0 -12
  67. package/projects/ngx/declarative-ui/form/declarative-form/declarative-form.component.spec.ts +0 -301
  68. package/projects/ngx/declarative-ui/form/declarative-form/declarative-form.component.ts +0 -166
  69. package/projects/ngx/declarative-ui/form/declarative-form/index.ts +0 -1
  70. package/projects/ngx/declarative-ui/form/index.ts +0 -2
  71. package/projects/ngx/declarative-ui/form/models/form-field-definition.ts +0 -15
  72. package/projects/ngx/declarative-ui/form/models/index.ts +0 -1
  73. package/projects/ngx/declarative-ui/form/utils/set-property-by-path.ts +0 -30
  74. package/projects/ngx/declarative-ui/models/index.ts +0 -2
  75. package/projects/ngx/declarative-ui/models/resource.ts +0 -5
  76. package/projects/ngx/declarative-ui/models/ui-definition.ts +0 -95
  77. package/projects/ngx/declarative-ui/public-api.ts +0 -4
  78. package/projects/ngx/declarative-ui/stories/add-card-dialog.stories.ts +0 -91
  79. package/projects/ngx/declarative-ui/stories/background-lightblue.png +0 -0
  80. package/projects/ngx/declarative-ui/stories/dashboard.cards.ts +0 -107
  81. package/projects/ngx/declarative-ui/stories/dashboard.stories.ts +0 -296
  82. package/projects/ngx/declarative-ui/stories/declarative-form.stories.ts +0 -149
  83. package/projects/ngx/declarative-ui/stories/declarative-table-card.stories.ts +0 -358
  84. package/projects/ngx/declarative-ui/stories/declarative-table.stories.ts +0 -363
  85. package/projects/ngx/declarative-ui/stories/pods-table.config.ts +0 -188
  86. package/projects/ngx/declarative-ui/table/declarative-table/declarative-table.component.html +0 -138
  87. package/projects/ngx/declarative-ui/table/declarative-table/declarative-table.component.scss +0 -21
  88. package/projects/ngx/declarative-ui/table/declarative-table/declarative-table.component.spec.ts +0 -345
  89. package/projects/ngx/declarative-ui/table/declarative-table/declarative-table.component.ts +0 -61
  90. package/projects/ngx/declarative-ui/table/declarative-table/index.ts +0 -1
  91. package/projects/ngx/declarative-ui/table/index.ts +0 -2
  92. package/projects/ngx/declarative-ui/table/models/index.ts +0 -14
  93. package/projects/ngx/declarative-ui/table/models/table.model.ts +0 -17
  94. package/projects/ngx/declarative-ui/table/utils/cssRules.engine.spec.ts +0 -146
  95. package/projects/ngx/declarative-ui/table/utils/cssRules.engine.ts +0 -69
  96. package/projects/ngx/declarative-ui/table/utils/field-definition.utils.spec.ts +0 -70
  97. package/projects/ngx/declarative-ui/table/utils/field-definition.utils.ts +0 -13
  98. package/projects/ngx/declarative-ui/table/utils/proccess-fields.spec.ts +0 -511
  99. package/projects/ngx/declarative-ui/table/utils/proccess-fields.ts +0 -71
  100. package/projects/ngx/declarative-ui/table/utils/resource-field-by-path.spec.ts +0 -372
  101. package/projects/ngx/declarative-ui/table/utils/resource-field-by-path.ts +0 -98
  102. package/projects/ngx/declarative-ui/table/value-cell/boolean-value/boolean-cell.constants.ts +0 -5
  103. package/projects/ngx/declarative-ui/table/value-cell/boolean-value/boolean-value.component.html +0 -1
  104. package/projects/ngx/declarative-ui/table/value-cell/boolean-value/boolean-value.component.scss +0 -0
  105. package/projects/ngx/declarative-ui/table/value-cell/boolean-value/boolean-value.component.spec.ts +0 -119
  106. package/projects/ngx/declarative-ui/table/value-cell/boolean-value/boolean-value.component.ts +0 -35
  107. package/projects/ngx/declarative-ui/table/value-cell/link-value/link-value.component.html +0 -7
  108. package/projects/ngx/declarative-ui/table/value-cell/link-value/link-value.component.scss +0 -0
  109. package/projects/ngx/declarative-ui/table/value-cell/link-value/link-value.component.spec.ts +0 -114
  110. package/projects/ngx/declarative-ui/table/value-cell/link-value/link-value.component.ts +0 -19
  111. package/projects/ngx/declarative-ui/table/value-cell/secret-value/secret-value.component.html +0 -7
  112. package/projects/ngx/declarative-ui/table/value-cell/secret-value/secret-value.component.scss +0 -10
  113. package/projects/ngx/declarative-ui/table/value-cell/secret-value/secret-value.component.spec.ts +0 -188
  114. package/projects/ngx/declarative-ui/table/value-cell/secret-value/secret-value.component.ts +0 -16
  115. package/projects/ngx/declarative-ui/table/value-cell/value-cell.component.html +0 -59
  116. package/projects/ngx/declarative-ui/table/value-cell/value-cell.component.scss +0 -33
  117. package/projects/ngx/declarative-ui/table/value-cell/value-cell.component.spec.ts +0 -316
  118. package/projects/ngx/declarative-ui/table/value-cell/value-cell.component.ts +0 -115
  119. package/projects/ngx/declarative-ui/table-card/declarative-table-card.component.html +0 -156
  120. package/projects/ngx/declarative-ui/table-card/declarative-table-card.component.scss +0 -123
  121. package/projects/ngx/declarative-ui/table-card/declarative-table-card.component.spec.ts +0 -786
  122. package/projects/ngx/declarative-ui/table-card/declarative-table-card.component.ts +0 -286
  123. package/projects/ngx/declarative-ui/table-card/index.ts +0 -2
  124. package/projects/ngx/declarative-ui/table-card/models/configs.ts +0 -46
  125. package/projects/ngx/declarative-ui/tsconfig.lib.json +0 -11
  126. package/projects/ngx/declarative-ui/tsconfig.lib.prod.json +0 -9
  127. package/projects/ngx/declarative-ui/tsconfig.spec.json +0 -9
  128. package/projects/ngx/ng-package.json +0 -8
  129. package/projects/ngx/package.json +0 -22
  130. package/projects/ngx/public-api.ts +0 -2
  131. package/projects/ngx/tsconfig.lib.json +0 -11
  132. package/projects/ngx/tsconfig.lib.prod.json +0 -9
  133. package/projects/webcomponents/main.ts +0 -92
  134. package/projects/webcomponents/tsconfig.app.json +0 -9
  135. package/projects/webcomponents-dashboard/main.ts +0 -15
  136. package/projects/webcomponents-dashboard/tsconfig.app.json +0 -9
  137. package/renovate.json +0 -6
  138. package/scripts/bundle-wc.mjs +0 -79
  139. package/tsconfig.json +0 -37
  140. package/tsconfig.spec.json +0 -8
  141. package/tsconfig.storybook.json +0 -16
  142. package/vitest.config.ts +0 -26
@@ -1,235 +0,0 @@
1
- # DeclarativeTableCard
2
-
3
- A card component that wraps `mfp-declarative-table` and adds a header, search, and optional create/edit/delete dialogs. Form validation and async submit state are owned by the host application.
4
-
5
- ## Tags
6
-
7
- | Usage | Tag |
8
- | ---------------------------------- | --------------------------------- |
9
- | Angular component | `<mfp-declarative-table-card>` |
10
- | Web Component (framework-agnostic) | `<mfp-wc-declarative-table-card>` |
11
-
12
- ---
13
-
14
- ## Usage as a web component
15
-
16
- ```html
17
- <mfp-wc-declarative-table-card id="card"></mfp-wc-declarative-table-card>
18
-
19
- <script type="module">
20
- const card = document.getElementById('card');
21
-
22
- card.resources = [
23
- {
24
- id: '1',
25
- metadata: { name: 'api-server', namespace: 'default' },
26
- status: { phase: 'Running' },
27
- },
28
- ];
29
-
30
- card.config = {
31
- header: 'Pods',
32
- tableConfig: {
33
- fields: [
34
- { label: 'Name', property: 'metadata.name' },
35
- { label: 'Namespace', property: 'metadata.namespace' },
36
- ],
37
- },
38
- createResourceFormConfig: {
39
- fields: [
40
- { name: 'metadata.name', label: 'Name', required: true },
41
- { name: 'metadata.namespace', label: 'Namespace' },
42
- ],
43
- title: 'Create Pod',
44
- confirmLabel: 'Create',
45
- },
46
- };
47
-
48
- card.addEventListener('createFieldChange', (event) => {
49
- const { fieldProperty, value } = event.detail;
50
-
51
- card.createFormState = {
52
- fieldErrors: {
53
- ...card.createFormState?.fieldErrors,
54
- [fieldProperty]: !value ? 'Field is required' : null,
55
- },
56
- };
57
- });
58
-
59
- card.addEventListener('createSubmit', async (event) => {
60
- await createPod(event.detail);
61
- card.createFormState = {};
62
- card.closeCreateDialog();
63
- });
64
- </script>
65
- ```
66
-
67
- ---
68
-
69
- ## Usage as an Angular component
70
-
71
- ```ts
72
- import {
73
- DeclarativeTableCard,
74
- FormFieldChangeEvent,
75
- TableCardConfig,
76
- TableCardFormState,
77
- } from '@openmfp/webcomponents';
78
-
79
- @Component({
80
- imports: [DeclarativeTableCard],
81
- template: `
82
- <mfp-declarative-table-card
83
- #tableCard
84
- [config]="config"
85
- [resources]="pods"
86
- [createFormState]="createFormState"
87
- [editFormState]="editFormState"
88
- (createFieldChange)="onCreateFieldChange($event)"
89
- (editFieldChange)="onEditFieldChange($event)"
90
- (createSubmit)="onCreateSubmit($event, tableCard)"
91
- (editSubmit)="onEditSubmit($event, tableCard)"
92
- (deleteSubmit)="onDeleteSubmit($event, tableCard)"
93
- (searchChanged)="onSearch($event)"
94
- />
95
- `,
96
- })
97
- export class MyComponent {
98
- pods = [];
99
- createFormState: TableCardFormState = {};
100
- editFormState: TableCardFormState = {};
101
-
102
- config: TableCardConfig = {
103
- header: 'Pods',
104
- tableConfig: {
105
- fields: [
106
- { label: 'Name', property: 'metadata.name' },
107
- { label: 'Namespace', property: 'metadata.namespace' },
108
- ],
109
- },
110
- createResourceFormConfig: {
111
- fields: [
112
- { name: 'metadata.name', label: 'Name', required: true },
113
- { name: 'metadata.namespace', label: 'Namespace' },
114
- ],
115
- title: 'Create Pod',
116
- confirmLabel: 'Create',
117
- },
118
- deleteResourceConfirmationConfig: {
119
- title: 'Delete Pod?',
120
- message: 'This action cannot be undone.',
121
- confirmLabel: 'Delete',
122
- },
123
- };
124
-
125
- onCreateFieldChange(event: FormFieldChangeEvent): void {
126
- const { fieldProperty, value } = event;
127
- this.createFormState = {
128
- fieldErrors: {
129
- ...this.createFormState.fieldErrors,
130
- [fieldProperty]: !value ? 'Field is required' : null,
131
- },
132
- };
133
- }
134
-
135
- onEditFieldChange(event: {
136
- resource: Pod;
137
- formChangeEvent: FormFieldChangeEvent;
138
- }): void {
139
- // Validate event.formChangeEvent and update editFormState.
140
- }
141
-
142
- async onCreateSubmit(
143
- value: Record<string, unknown>,
144
- tableCard: DeclarativeTableCard<Pod>,
145
- ): Promise<void> {
146
- await this.createPod(value);
147
- this.createFormState = {};
148
- tableCard.closeCreateDialog();
149
- }
150
-
151
- async onEditSubmit(
152
- event: { resource: Pod; value: Record<string, unknown> },
153
- tableCard: DeclarativeTableCard<Pod>,
154
- ): Promise<void> {
155
- await this.updatePod(event.resource, event.value);
156
- this.editFormState = {};
157
- tableCard.closeEditDialog();
158
- }
159
-
160
- async onDeleteSubmit(
161
- pod: Pod,
162
- tableCard: DeclarativeTableCard<Pod>,
163
- ): Promise<void> {
164
- await this.deletePod(pod);
165
- tableCard.closeDeleteDialog();
166
- }
167
- }
168
- ```
169
-
170
- ---
171
-
172
- ## API
173
-
174
- ### Inputs
175
-
176
- | Input | Type | Required | Default | Description |
177
- | ----------------- | -------------------- | -------- | ------- | --------------------------------------------------------- |
178
- | `resources` | `T[]` | yes | - | Data rows passed to the inner table |
179
- | `config` | `TableCardConfig` | yes | - | Static table, button, and dialog configuration |
180
- | `createFormState` | `TableCardFormState` | no | `{}` | Runtime validation and submit state for the create dialog |
181
- | `editFormState` | `TableCardFormState` | no | `{}` | Runtime validation and submit state for the edit dialog |
182
-
183
- ### Outputs / Events
184
-
185
- | Event | Payload | Description |
186
- | ------------------------ | ------------------------------------------------- | ------------------------------------------------------------ |
187
- | `createFieldChange` | `FormFieldChangeEvent` | Re-emits per-field change from the create form |
188
- | `editFieldChange` | `{ resource: T; formChangeEvent: FormFieldChangeEvent }` | Re-emits per-field change from the edit form with resource |
189
- | `createSubmit` | `Record<string, unknown>` | Fires when the create dialog Save button is clicked |
190
- | `editSubmit` | `{ resource: T; value: Record<string, unknown> }` | Fires when the edit dialog Save button is clicked |
191
- | `deleteSubmit` | `T` | Fires when the delete dialog Delete button is clicked |
192
- | `searchChanged` | `string` | Emits 300 ms after the search input changes |
193
- | `tableRowClicked` | `T` | Emits when a table row is clicked |
194
- | `loadMoreResources` | - | Emits when the user triggers load more |
195
- | `paginationLimitChanged` | `number` | Emits when the user changes page size |
196
- | `actionButtonClick` | `ValueCellButtonClickEvent<T>` | Emits for row-action buttons other than built-in edit/delete |
197
-
198
- ### Methods
199
-
200
- | Method | Description |
201
- | --------------------- | ------------------------ |
202
- | `closeCreateDialog()` | Closes the create dialog |
203
- | `closeEditDialog()` | Closes the edit dialog |
204
- | `closeDeleteDialog()` | Closes the delete dialog |
205
-
206
- Submit events do not close dialogs automatically. Close the dialog after successful validation, save, or delete.
207
-
208
- ---
209
-
210
- ## Configuration types
211
-
212
- ```ts
213
- interface TableCardConfig {
214
- header: string;
215
- headerTooltip?: string;
216
- tableConfig: TableConfig;
217
- buttonSettings?: TableCardButtonSettings;
218
- createResourceFormConfig?: ResourceFormConfig;
219
- editResourceFormConfig?: ResourceFormConfig;
220
- deleteResourceConfirmationConfig?: DeleteResourceConfirmationConfig;
221
- }
222
-
223
- interface ResourceFormConfig {
224
- fields: FormFieldDefinition[];
225
- title?: string;
226
- confirmLabel?: string;
227
- cancelLabel?: string;
228
- }
229
-
230
- interface TableCardFormState {
231
- fieldErrors?: FormFieldErrors;
232
- }
233
- ```
234
-
235
- `ResourceFormConfig` is static. Keep runtime errors in `createFormState` / `editFormState`. The submit button is disabled when any entry in `fieldErrors` is truthy.
@@ -1,315 +0,0 @@
1
- # DeclarativeTable
2
-
3
- A data table web component that renders rows and columns from a declarative column definition. Supports pagination, grouped columns, conditional cell styling, and multiple cell display modes (plain text, link, boolean icon, secret, tooltip, button, image).
4
-
5
- ## Tags
6
-
7
- | Usage | Tag |
8
- |---|---|
9
- | Angular component | `<mfp-declarative-table>` |
10
- | Web Component (framework-agnostic) | `<mfp-wc-declarative-table>` |
11
-
12
- ---
13
-
14
- ## Usage as a web component
15
-
16
- Include the bundle and set properties via JavaScript. Because the component uses Shadow DOM, no extra CSS setup is needed.
17
-
18
- ```html
19
- <!DOCTYPE html>
20
- <html>
21
- <head>
22
- <script type="module" src="declarative-table.js"/>
23
- </head>
24
- <body>
25
- <mfp-wc-declarative-table id="table"></mfp-wc-declarative-table>
26
-
27
- <script type="module">
28
- const table = document.getElementById('table');
29
-
30
- table.columns = [
31
- { label: 'Name', property: 'metadata.name' },
32
- { label: 'Status', property: 'status.phase' },
33
- ];
34
-
35
- table.resources = [
36
- { metadata: { name: 'pod-1' }, status: { phase: 'Running' } },
37
- { metadata: { name: 'pod-2' }, status: { phase: 'Pending' } },
38
- ];
39
-
40
- table.trackByPath = 'metadata.name';
41
- </script>
42
- </body>
43
- </html>
44
- ```
45
-
46
- > `columns`, `resources`, and `trackBy` are JavaScript properties, not HTML attributes. They must be set programmatically after the element is available in the DOM.
47
-
48
- ---
49
-
50
- ## Usage as an Angular component
51
-
52
- ```ts
53
- import { DeclarativeTable } from '@openmfp/webcomponents';
54
- import { TableFieldDefinition } from '@openmfp/webcomponents';
55
-
56
- @Component({
57
- imports: [DeclarativeTable],
58
- template: `
59
- <mfp-declarative-table
60
- [columns]="columns"
61
- [resources]="resources"
62
- [trackByPath]="trackByPath"
63
- [hasMore]="hasMore"
64
- [paginationLimit]="pageSize"
65
- [totalItemsCount]="total"
66
- (tableRowClicked)="onRowClick($event)"
67
- (loadMoreResources)="loadMore()"
68
- (paginationLimitChanged)="onPageSizeChange($event)"
69
- />
70
- `,
71
- })
72
- export class MyComponent {
73
- columns: TableFieldDefinition[] = [
74
- { label: 'Name', property: 'metadata.name' },
75
- { label: 'Status', property: 'status.phase' },
76
- ];
77
- resources = [...];
78
- trackByPath = 'metadata.name';
79
- hasMore = false;
80
- pageSize = 10;
81
- total = 0;
82
- }
83
- ```
84
-
85
- ---
86
-
87
- ## API
88
-
89
- ### Inputs
90
-
91
- | Input | Type | Required | Default | Description |
92
- |---|---|---|---|---|
93
- | `columns` | `TableFieldDefinition[]` | yes | — | Column definitions |
94
- | `resources` | `GenericResource[]` | yes | — | Data rows |
95
- | `trackByPath` | `string` | no | `'id'` | JSONPath (dot-notation) into each resource used as the row identity key |
96
- | `totalItemsCount` | `number` | no | — | Total count of all items across pages |
97
- | `paginationLimit` | `number` | no | `5` | Rows per page shown in the page-size selector |
98
- | `hasMore` | `boolean` | no | `false` | Show the load-more trigger at the bottom |
99
-
100
- ### Outputs / Events
101
-
102
- | Event | Detail payload | Description |
103
- |---|---|---|
104
- | `tableRowClicked` | row object | Fires when a row is clicked |
105
- | `buttonClick` | `{ event, field, resource }` | Fires when a button cell is clicked |
106
- | `loadMoreResources` | — | Fires when the user triggers load more |
107
- | `paginationLimitChanged` | `number` | Fires when the user changes the page size |
108
-
109
- **Listening to events from a web component:**
110
-
111
- ```js
112
- table.addEventListener('tableRowClicked', (e) => console.log(e.detail));
113
- table.addEventListener('loadMoreResources', () => fetchNextPage());
114
- table.addEventListener('paginationLimitChanged', (e) => {
115
- table.paginationLimit = e.detail;
116
- });
117
- table.addEventListener('buttonClick', (e) => {
118
- const { field, resource } = e.detail;
119
- console.log('Button clicked for', resource);
120
- });
121
- ```
122
-
123
- ---
124
-
125
- ## Column definition (`TableFieldDefinition`)
126
-
127
- ```ts
128
- interface TableFieldDefinition {
129
- label?: string;
130
- property?: string; // dot-notation path into the resource object
131
- jsonPathExpression?: string; // explicit JSONPath expression
132
- propertyField?: PropertyField; // access a sub-key with optional transforms
133
- value?: string; // static fallback value
134
- uiSettings?: UiSettings;
135
- group?: {
136
- name: string; // columns sharing the same name are merged into one header
137
- label?: string; // label for the merged header
138
- delimiter?: string; // separator between values (default: space)
139
- multiline?: boolean; // render values on separate lines instead
140
- };
141
- }
142
- ```
143
-
144
- ### Resolving cell values
145
-
146
- Values are resolved in this order:
147
-
148
- 1. `jsonPathExpression` — evaluated as a JSONPath query against the resource (e.g. `$.spec.containers[0].image`)
149
- 2. `property` — dot-notation path; a `$.` prefix is added automatically if missing
150
- 3. `propertyField` — accesses `resource[property][propertyField.key]` with optional transforms
151
- 4. `value` — static string, used as a fallback when the resource yields no value
152
-
153
- **Examples:**
154
-
155
- ```ts
156
- // Simple dot-notation
157
- { label: 'Name', property: 'metadata.name' }
158
-
159
- // Explicit JSONPath
160
- { label: 'Image', jsonPathExpression: '$.spec.containers[0].image' }
161
-
162
- // Sub-key with transform
163
- { label: 'Created', property: 'metadata', propertyField: { key: 'creationTimestamp', transform: ['uppercase'] } }
164
-
165
- // Static fallback when property may be absent
166
- { label: 'Message', property: 'status.message', value: 'N/A' }
167
- ```
168
-
169
- ### `PropertyField` transforms
170
-
171
- Transforms can be chained and are applied left to right.
172
-
173
- | Transform | Effect |
174
- |---|---|
175
- | `uppercase` | `hello` → `HELLO` |
176
- | `lowercase` | `HELLO` → `hello` |
177
- | `capitalize` | `hello` → `Hello` |
178
- | `encode` | Base64-encodes the value |
179
- | `decode` | Base64-decodes the value |
180
-
181
- ```ts
182
- { property: 'metadata', propertyField: { key: 'name', transform: ['capitalize'] } }
183
- ```
184
-
185
- ---
186
-
187
- ## Cell display modes (`uiSettings.displayAs`)
188
-
189
- By default a cell renders its value as plain text. Use `uiSettings.displayAs` to change the rendering:
190
-
191
- | `displayAs` | Renders as |
192
- |---|---|
193
- | _(unset)_ | Plain text |
194
- | `'secret'` | Masked value with a toggle-visibility button |
195
- | `'boolIcon'` | Check / X icon for `"true"` / `"false"` string values |
196
- | `'link'` | Clickable anchor (the value must be a valid URL) |
197
- | `'tooltip'` | Text with an info icon; the full value appears on hover |
198
- | `'alert'` | Alert-styled text |
199
- | `'img'` | `<img>` element using the value as `src` |
200
- | `'button'` | Action button (requires `buttonSettings`) |
201
-
202
- ### Copy button
203
-
204
- Add a copy-to-clipboard icon to any cell:
205
-
206
- ```ts
207
- { label: 'ID', property: 'metadata.uid', uiSettings: { withCopyButton: true } }
208
- ```
209
-
210
- ### Button cells
211
-
212
- ```ts
213
- {
214
- label: 'Actions',
215
- property: 'metadata.name',
216
- uiSettings: {
217
- displayAs: 'button',
218
- buttonSettings: {
219
- text: 'Open',
220
- icon: 'action',
221
- design: 'Emphasized', // 'Default' | 'Positive' | 'Negative' | 'Transparent' | 'Emphasized' | 'Attention'
222
- action: 'navigate', // 'navigate' | 'openInModal'
223
- },
224
- },
225
- }
226
- ```
227
-
228
- A `buttonClick` event fires with `{ event, field, resource }` when clicked.
229
-
230
- ---
231
-
232
- ## Grouped columns
233
-
234
- Columns that share the same `group.name` are collapsed into a single table column. Their values are displayed together, separated by `group.delimiter` or on separate lines when `group.multiline` is `true`.
235
-
236
- ```ts
237
- columns = [
238
- {
239
- label: 'First name',
240
- property: 'firstName',
241
- group: { name: 'fullName', label: 'Full Name', delimiter: ' ' },
242
- },
243
- {
244
- label: 'Last name',
245
- property: 'lastName',
246
- group: { name: 'fullName' },
247
- },
248
- { label: 'Email', property: 'email' },
249
- ];
250
- ```
251
-
252
- The above produces two visible columns: **Full Name** and **Email**.
253
-
254
- ---
255
-
256
- ## Conditional cell styling (`cssRules`)
257
-
258
- Apply inline styles to a cell when its value meets a condition:
259
-
260
- ```ts
261
- {
262
- label: 'Status',
263
- property: 'status.phase',
264
- uiSettings: {
265
- cssRules: [
266
- { if: { condition: 'equals', value: 'Running' }, styles: { color: 'green' } },
267
- { if: { condition: 'equals', value: 'Failed' }, styles: { color: 'red', fontWeight: 'bold' } },
268
- { if: { condition: 'contains', value: 'Pending' }, styles: { color: 'orange' } },
269
- ],
270
- },
271
- }
272
- ```
273
-
274
- Available conditions: `equals`, `notEquals`, `greaterThan`, `greaterThanOrEqual`, `lessThan`, `lessThanOrEqual`, `contains`.
275
-
276
- `cssCustomization` applies static styles unconditionally:
277
-
278
- ```ts
279
- uiSettings: { cssCustomization: { fontStyle: 'italic' } }
280
- ```
281
-
282
- ---
283
-
284
- ## Pagination
285
-
286
- When `hasMore` is `true` a **Load More** trigger appears at the bottom of the table. A page-size selector is always present.
287
-
288
- ```js
289
- table.hasMore = true;
290
- table.totalItemsCount = 100;
291
- table.paginationLimit = 10;
292
-
293
- table.addEventListener('loadMoreResources', () => {
294
- fetchNextPage().then((rows) => {
295
- table.resources = [...table.resources, ...rows];
296
- });
297
- });
298
-
299
- table.addEventListener('paginationLimitChanged', (e) => {
300
- table.paginationLimit = e.detail;
301
- reloadWithNewLimit(e.detail);
302
- });
303
- ```
304
-
305
- ---
306
-
307
- ## Resource shape
308
-
309
- Any plain object works as a resource. Three optional fields control table behaviour:
310
-
311
- | Field | Type | Description |
312
- |---|---|---|
313
- | `id` | `string` | Default `trackByPath` target; used as the row identity key unless overridden |
314
- | `isAvailable` | `boolean` | When `false`, the row is rendered as non-interactive |
315
- | `accessibleName` | `string` | Accessible label attached to the row element |
package/eslint.config.js DELETED
@@ -1,41 +0,0 @@
1
- // @ts-check
2
- import angularConfig from '@openmfp/eslint-config-typescript/angular.js';
3
- import tsEslint from 'typescript-eslint';
4
-
5
- export default tsEslint.config(
6
- {
7
- ignores: ['dist', 'coverage', '.angular'],
8
- },
9
- ...angularConfig,
10
- {
11
- // Disable jest rules — this project uses Vitest, not Jest
12
- files: ['**/*.spec.ts'],
13
- rules: {
14
- 'jest/no-deprecated-functions': 'off',
15
- 'jest/expect-expect': 'off',
16
- 'jest/valid-title': 'off',
17
- 'jest/no-conditional-expect': 'off',
18
- },
19
- },
20
- {
21
- files: ['**/*.ts'],
22
- languageOptions: {
23
- parserOptions: {
24
- projectService: true,
25
- tsconfigRootDir: import.meta.dirname,
26
- },
27
- },
28
- rules: {
29
- // Override shared config defaults for this library
30
- '@angular-eslint/prefer-on-push-component-change-detection': 'off',
31
- '@angular-eslint/directive-selector': [
32
- 'error',
33
- { type: 'attribute', prefix: 'mfp', style: 'camelCase' },
34
- ],
35
- '@angular-eslint/component-selector': [
36
- 'error',
37
- { type: 'element', prefix: 'mfp', style: 'kebab-case' },
38
- ],
39
- },
40
- },
41
- );
@@ -1,12 +0,0 @@
1
- <div class="favorites">
2
- <ui5-title level="H5" class="favorites__title">Favorites</ui5-title>
3
- <div class="favorites__list">
4
- @for (item of items; track item.action) {
5
- <div class="favorites__item">
6
- <ui5-icon name="{{ item.icon }}" class="favorites__icon"></ui5-icon>
7
- <span class="favorites__label">{{ item.label }}</span>
8
- <ui5-button design="Transparent" icon="{{ item.icon }}">{{ item.label }}</ui5-button>
9
- </div>
10
- }
11
- </div>
12
- </div>
@@ -1,50 +0,0 @@
1
- :host {
2
- display: block;
3
- height: 100%;
4
- }
5
-
6
- .favorites {
7
- display: flex;
8
- flex-direction: column;
9
- height: 100%;
10
- background: var(--sapTile_Background, #fff);
11
- border-radius: var(--_ui5_card_border-radius, 0.5rem);
12
- border: var(--_ui5_card_border, 1px solid var(--sapTile_BorderColor, #e5e5e5));
13
- box-shadow: var(--_ui5_card_box_shadow, var(--sapContent_Shadow0));
14
- overflow: hidden;
15
-
16
- &__title {
17
- padding: 1rem 1rem 0.5rem;
18
- flex-shrink: 0;
19
- }
20
-
21
- &__list {
22
- display: flex;
23
- flex-direction: column;
24
- flex: 1;
25
- overflow-y: auto;
26
- }
27
-
28
- &__item {
29
- display: flex;
30
- align-items: center;
31
- gap: 0.75rem;
32
- padding: 0.5rem 1rem;
33
- border-bottom: 1px solid var(--sapList_BorderColor, #e5e5e5);
34
-
35
- &:last-child {
36
- border-bottom: none;
37
- }
38
- }
39
-
40
- &__icon {
41
- flex-shrink: 0;
42
- color: var(--sapHighlightColor, #0070f2);
43
- }
44
-
45
- &__label {
46
- flex: 1;
47
- font-size: var(--sapFontSize, 0.875rem);
48
- color: var(--sapTextColor, #32363a);
49
- }
50
- }
@@ -1,19 +0,0 @@
1
- import { Component, ViewEncapsulation } from '@angular/core';
2
- import { Button } from '@fundamental-ngx/ui5-webcomponents/button';
3
- import { Icon } from '@fundamental-ngx/ui5-webcomponents/icon';
4
- import { Title } from '@fundamental-ngx/ui5-webcomponents/title';
5
-
6
- @Component({
7
- selector: 'mfp-favorites',
8
- templateUrl: './favorites.component.html',
9
- styleUrls: ['./favorites.component.scss'],
10
- encapsulation: ViewEncapsulation.ShadowDom,
11
- imports: [Button, Icon, Title],
12
- })
13
- export class Favorites {
14
- readonly items = [
15
- { label: 'Create Account', icon: 'add', action: 'create-account' },
16
- { label: 'Start Approval', icon: 'workflow-tasks', action: 'start-approval' },
17
- { label: 'Add User to Account', icon: 'person-placeholder', action: 'add-user' },
18
- ];
19
- }
@@ -1,4 +0,0 @@
1
- export * from './visited-service-card/visited-service-card.component';
2
- export * from './favorites/favorites.component';
3
- export * from './service-status/service-status-card.component';
4
- export * from './whats-new/whats-new.component';
@@ -1,15 +0,0 @@
1
- <div class="service-status">
2
- <ui5-title level="H5" class="service-status__title">Service Availability</ui5-title>
3
- <div class="service-status__list">
4
- @for (service of services; track service.name) {
5
- <div class="service-status__item">
6
- <ui5-icon name="{{ service.icon }}" class="service-status__icon"></ui5-icon>
7
- <span class="service-status__name">{{ service.name }}</span>
8
- <div class="service-status__status {{ statusConfig[service.status].colorClass }}">
9
- <ui5-icon name="{{ statusConfig[service.status].icon }}" class="service-status__status-icon"></ui5-icon>
10
- <span class="service-status__status-label">{{ statusConfig[service.status].label }}</span>
11
- </div>
12
- </div>
13
- }
14
- </div>
15
- </div>