@openmfp/ngx 0.9.0 → 0.10.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmfp/ngx",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/openmfp/webcomponents.git"
@@ -6,71 +6,122 @@ import { Input } from '@fundamental-ngx/ui5-webcomponents/input';
6
6
  import { GridStackOptions } from 'gridstack';
7
7
  import { nodesCB } from 'gridstack/dist/angular';
8
8
 
9
+ /** Subset of fields of a generic resource that the table/form components rely on. */
9
10
  interface GenericResource extends Record<string, unknown> {
11
+ /** Optional unique identifier. */
10
12
  id?: string;
13
+ /** Whether the resource is available/healthy. */
11
14
  isAvailable?: boolean;
15
+ /** Human-readable name used for screen readers and tooltips. */
12
16
  accessibleName?: string;
13
17
  }
14
18
 
19
+ /** Text transformation applied to a field value before display. */
15
20
  type TransformType = 'uppercase' | 'lowercase' | 'capitalize' | 'decode' | 'encode';
21
+ /** Resolves a field value via a property path with optional transforms. */
16
22
  interface PropertyField {
23
+ /** Dot-separated JSON path to the value (e.g. `metadata.name`). */
17
24
  key: string;
25
+ /** Ordered list of transforms applied to the resolved string. */
18
26
  transform?: TransformType[];
19
27
  }
28
+ /** Display and interaction settings for a table cell. */
20
29
  interface UiSettings {
30
+ /** When `true`, renders the cell value as a styled badge (blue pill). */
21
31
  labelDisplay?: boolean;
32
+ /** How the cell value is rendered. Defaults to plain text when omitted. */
22
33
  displayAs?: 'secret' | 'boolIcon' | 'link' | 'tooltip' | 'alert' | 'img' | 'button';
34
+ /** Button appearance and action — only used when `displayAs` is `'button'`. */
23
35
  buttonSettings?: ButtonSettings;
36
+ /** SAP UI5 icon name shown as the tooltip trigger icon. */
24
37
  tooltipIcon?: string;
38
+ /** When `true`, a copy-to-clipboard button is rendered next to the value. */
25
39
  withCopyButton?: boolean;
40
+ /** Inline CSS overrides applied unconditionally to the cell. */
26
41
  cssCustomization?: Partial<CSSStyleDeclaration>;
42
+ /** Conditional CSS rules evaluated against the cell value at render time. */
27
43
  cssRules?: CssRule[];
44
+ /** Fixed column width including unit (e.g. `'200px'`, `'20%'`). */
28
45
  columnWidth?: string;
29
46
  align?: 'start' | 'center' | 'end';
30
47
  }
31
48
  type KnownButtonActions = 'openInModal' | 'navigate' | 'edit' | 'delete';
32
49
  type ButtonActions = KnownButtonActions | (string & {});
50
+ /** Appearance and action configuration for a button rendered inside a table cell or toolbar. */
33
51
  interface ButtonSettings {
52
+ /** Button label text. */
34
53
  text?: string;
54
+ /** SAP UI5 icon name placed before the label. */
35
55
  icon?: string;
56
+ /** SAP UI5 icon name placed after the label. */
36
57
  endIcon?: string;
58
+ /** SAP UI5 button design variant. */
37
59
  design?: 'Default' | 'Positive' | 'Negative' | 'Transparent' | 'Emphasized' | 'Attention';
60
+ /** Tooltip shown on hover. */
38
61
  tooltip?: string;
62
+ /** Action identifier. `'edit'` and `'delete'` are handled internally; all other values are forwarded to the host via `actionButtonClick`. */
39
63
  action: ButtonActions;
64
+ /** Settings for the modal opened when `action` is `'openInModal'`. */
40
65
  modalSettings?: ModalSettings;
41
66
  }
67
+ /** Size and dimension overrides for the modal opened by a button with `action: 'openInModal'`. */
42
68
  interface ModalSettings {
69
+ /** Modal title shown in the dialog header. */
43
70
  title?: string;
71
+ /** Named size breakpoint. */
44
72
  size?: 'fullscreen' | 'l' | 'm' | 's';
73
+ /** Explicit width override. */
45
74
  width?: string;
75
+ /** Explicit height override. */
46
76
  height?: string;
47
77
  }
78
+ /** Comparison operator used in a conditional CSS rule. */
48
79
  type CssRuleCondition = 'equals' | 'notEquals' | 'greaterThan' | 'greaterThanOrEqual' | 'lessThan' | 'lessThanOrEqual' | 'contains';
80
+ /** Conditional CSS rule: applies `styles` to the cell when `if` evaluates to `true`. */
49
81
  interface CssRule {
82
+ /** Condition evaluated against the cell's string value. */
50
83
  if: {
51
84
  condition: CssRuleCondition;
52
85
  value: string;
53
86
  };
87
+ /** CSS properties applied when the condition is met. */
54
88
  styles: Partial<CSSStyleDeclaration>;
55
89
  }
90
+ /** Event payload emitted when a button inside a table cell is clicked. */
56
91
  interface ValueCellButtonClickEvent<T extends GenericResource> {
92
+ /** Original DOM click event. */
57
93
  event: MouseEvent;
94
+ /** The field definition of the button cell that was clicked. */
58
95
  field: TableFieldDefinition;
96
+ /** The data row associated with the clicked button. */
59
97
  resource: T | undefined;
60
98
  }
99
+ /** Base field definition shared by table columns and form fields. */
61
100
  interface FieldDefinition {
101
+ /** Column header / form label. */
62
102
  label?: string;
103
+ /** Dot-separated path to the resource property (e.g. `metadata.name`). */
63
104
  property?: string | string[];
105
+ /** Alternative path resolver with optional transforms. */
64
106
  propertyField?: PropertyField;
107
+ /** JSONPath expression evaluated against the resource when `property` is not enough. */
65
108
  jsonPathExpression?: string;
109
+ /** Static value — used when the cell shows a constant rather than a resource field. */
66
110
  value?: string;
111
+ /** Display and interaction configuration for this cell. */
67
112
  uiSettings?: UiSettings;
68
113
  }
114
+ /** Table column definition — extends `FieldDefinition` with optional column grouping. */
69
115
  interface TableFieldDefinition extends FieldDefinition {
116
+ /** Groups this column visually with adjacent columns that share the same `name`. */
70
117
  group?: {
118
+ /** Logical group identifier. */
71
119
  name: string;
120
+ /** Group header label shown above the grouped cells. */
72
121
  label?: string;
122
+ /** Separator placed between values in the same group cell. */
73
123
  delimiter?: string;
124
+ /** When `true`, each value is rendered on its own line. */
74
125
  multiline?: boolean;
75
126
  };
76
127
  }
@@ -101,18 +152,29 @@ declare class DeclarativeTable<T extends GenericResource> {
101
152
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<DeclarativeTable<any>, "mfp-declarative-table", never, { "columns": { "alias": "columns"; "required": true; "isSignal": true; }; "resources": { "alias": "resources"; "required": true; "isSignal": true; }; "trackByPath": { "alias": "trackByPath"; "required": false; "isSignal": true; }; "totalItemsCount": { "alias": "totalItemsCount"; "required": false; "isSignal": true; }; "paginationLimit": { "alias": "paginationLimit"; "required": false; "isSignal": true; }; "hasMore": { "alias": "hasMore"; "required": false; "isSignal": true; }; }, { "buttonClick": "buttonClick"; "tableRowClicked": "tableRowClicked"; "loadMoreResources": "loadMoreResources"; "paginationLimitChanged": "paginationLimitChanged"; }, never, never, true, never>;
102
153
  }
103
154
 
155
+ /** Definition for a single form field rendered by `mfp-declarative-form`. */
104
156
  interface FormFieldDefinition {
157
+ /** JSON-path key used to read and write the field value (e.g. `metadata.name`). */
105
158
  name: string;
159
+ /** Display label shown above the input. */
106
160
  label?: string;
161
+ /** When `true`, passes the `required` attribute to the UI5 input — shows a visual required indicator. Validation itself is the host's responsibility via `FormFieldErrors`. */
107
162
  required?: boolean;
163
+ /** Fixed list of options rendered as a select/dropdown. */
108
164
  values?: string[];
165
+ /** When `true`, the field is disabled (not interactive). */
109
166
  disabled?: boolean;
167
+ /** Controls when `fieldChange` is emitted for this field. When omitted, `fieldChange` is never emitted. */
110
168
  validation?: 'onBlur' | 'onChange';
111
169
  }
170
+ /** Event payload emitted each time a single form field value changes. */
112
171
  interface FormFieldChangeEvent {
172
+ /** The `name` (JSON-path key) of the field that changed. */
113
173
  fieldProperty: string;
174
+ /** The new value entered by the user. */
114
175
  value: unknown;
115
176
  }
177
+ /** Map of field names to their current validation error messages (`null` = no error). */
116
178
  type FormFieldErrors = Record<string, string | null>;
117
179
 
118
180
  declare class DeclarativeForm {
@@ -137,41 +199,72 @@ declare class DeclarativeForm {
137
199
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<DeclarativeForm, "mfp-declarative-form", never, { "fields": { "alias": "fields"; "required": true; "isSignal": true; }; "initialValues": { "alias": "initialValues"; "required": false; "isSignal": true; }; "fieldErrors": { "alias": "fieldErrors"; "required": false; "isSignal": true; }; }, { "fieldChange": "fieldChange"; "formSubmit": "formSubmit"; }, never, never, true, never>;
138
200
  }
139
201
 
202
+ /** Configuration for the create/edit resource form rendered inside the table card dialogs. */
140
203
  interface ResourceFormConfig {
204
+ /** Ordered list of fields to render in the form. */
141
205
  fields: FormFieldDefinition[];
206
+ /** Dialog title shown in the header. */
142
207
  title?: string;
208
+ /** Label for the confirm/submit button. */
143
209
  confirmLabel?: string;
210
+ /** Label for the cancel button. */
144
211
  cancelLabel?: string;
145
212
  }
213
+ /** Runtime validation and submit state passed to the table card from the host. */
146
214
  interface TableCardFormState {
215
+ /** Map of field names to their current error messages. Any truthy error in the map disables the submit button. */
147
216
  fieldErrors?: FormFieldErrors;
148
217
  }
218
+ /** Configuration for the delete-confirmation dialog. */
149
219
  interface DeleteResourceConfirmationConfig {
220
+ /** Dialog title. */
150
221
  title?: string;
222
+ /** Explanatory message shown below the title. */
151
223
  message?: string;
224
+ /** Label for the confirm/delete button. */
152
225
  confirmLabel?: string;
226
+ /** Label for the cancel button. */
153
227
  cancelLabel?: string;
154
228
  }
229
+ /** Configuration for the inner `mfp-declarative-table`. */
155
230
  interface TableConfig {
231
+ /** Column definitions. */
156
232
  fields: TableFieldDefinition[];
233
+ /** Total number of items on the server (used by pagination). */
157
234
  totalItemsCount?: number;
235
+ /** Number of rows per page. */
158
236
  paginationLimit?: number;
237
+ /** When `true`, the "Load More" control is shown. */
159
238
  hasMore?: boolean;
160
239
  }
240
+ /** Overrides for the table card's built-in action buttons. */
161
241
  interface TableCardButtonSettings {
242
+ /** Partial override for the "Create" button. */
162
243
  createButton?: Partial<ButtonSettings>;
244
+ /** Partial override for the search toggle button. */
163
245
  searchButton?: Partial<ButtonSettings>;
246
+ /** Partial override for the per-row "Edit" button. */
164
247
  editButton?: Partial<ButtonSettings>;
248
+ /** Partial override for the per-row "Delete" button. */
165
249
  deleteButton?: Partial<ButtonSettings>;
166
250
  }
251
+ /** Top-level configuration for `<mfp-declarative-table-card>`. */
167
252
  interface TableCardConfig {
253
+ /** Card heading. */
168
254
  header?: string;
255
+ /** Tooltip shown on hover of the card heading. */
169
256
  headerTooltip?: string;
257
+ /** Required table configuration. */
170
258
  tableConfig: TableConfig;
259
+ /** Overrides for built-in toolbar and row-action buttons. */
171
260
  buttonSettings?: TableCardButtonSettings;
261
+ /** When `true`, shows the search input and button in the card toolbar. */
172
262
  resourcesSearchable?: boolean;
263
+ /** When set, enables the "Create" button and create dialog. */
173
264
  createResourceFormConfig?: ResourceFormConfig;
265
+ /** When set, enables per-row "Edit" button and edit dialog. */
174
266
  editResourceFormConfig?: ResourceFormConfig;
267
+ /** When set, enables per-row "Delete" button and confirmation dialog. */
175
268
  deleteResourceConfirmationConfig?: DeleteResourceConfirmationConfig;
176
269
  }
177
270
 
@@ -244,38 +337,76 @@ declare const CARD_TYPES: {
244
337
  readonly SAP_UI: "sap-ui";
245
338
  };
246
339
  type CardsType = (typeof CARD_TYPES)[keyof typeof CARD_TYPES];
340
+ /** Configuration for a single card placed in the dashboard grid or a section. */
247
341
  interface CardConfig {
342
+ /** Unique identifier for this card. Used as a stable key for position persistence. */
248
343
  id: string;
344
+ /** Column span (1–12). Defaults to 12 when omitted. */
249
345
  w?: number;
346
+ /** Row span — number of CSS grid rows occupied (1 row = 10 px by default). Defaults to 100 when omitted. */
250
347
  h?: number;
348
+ /** Starting column index (0-based). Omit to let the grid auto-place the card. */
251
349
  x?: number;
350
+ /** Starting row index (0-based). Omit to let the grid auto-place the card. */
252
351
  y?: number;
352
+ /** Maximum row span in edit mode. */
253
353
  maxH?: number;
354
+ /** Maximum column span in edit mode. */
254
355
  maxW?: number;
356
+ /** Minimum row span in edit mode. */
255
357
  minH?: number;
358
+ /** Minimum column span in edit mode. */
256
359
  minW?: number;
360
+ /** ID of the parent section. Omit to place the card in the loose-card grid. */
257
361
  sectionId?: string;
362
+ /**
363
+ * Custom-element tag name (for `'wc'`/omitted), Angular component selector (for `'angular'`),
364
+ * or SAP UI5 component name (for `'sap-ui'`).
365
+ */
258
366
  component: string;
367
+ /**
368
+ * Render strategy for the card.
369
+ * - `'wc'` (default) — creates a custom element and sets `componentInputs` as DOM properties.
370
+ * - `'angular'` — looks up the Angular registry; warns and renders nothing if not found.
371
+ * - `'sap-ui'` — mounts via `window.sap.ui.require` + `ComponentContainer`.
372
+ */
259
373
  type?: CardsType;
374
+ /** Key/value pairs passed to the rendered card. Behaviour depends on `type`. */
260
375
  componentInputs?: Record<string, unknown>;
376
+ /** Human-readable label shown in the "Add Card" dialog. */
261
377
  label?: string;
262
378
  }
379
+ /** Configuration for a named horizontal section that groups cards. */
263
380
  interface SectionConfig {
381
+ /** Unique identifier for this section. */
264
382
  id: string;
383
+ /** Column span (1–12). Defaults to 12 when omitted. */
265
384
  w?: number;
385
+ /** Section heading displayed in the UI. */
266
386
  title?: string;
387
+ /** When `false`, the section and its cards are excluded from edit mode. Defaults to `true` when omitted. */
267
388
  editable?: boolean;
268
389
  }
390
+ /** Overrides for the two built-in dashboard toolbar buttons. */
269
391
  interface DashboardButtonsSettings {
392
+ /** Partial override merged on top of the Edit View button defaults. */
270
393
  editViewButton?: Partial<ButtonSettings>;
394
+ /** Partial override merged on top of the Add Card button defaults. */
271
395
  addCardButton?: Partial<ButtonSettings>;
272
396
  }
397
+ /** Top-level configuration for the `<mfp-dashboard>` component. */
273
398
  interface DashboardConfig {
399
+ /** Dashboard title rendered in the toolbar. */
274
400
  title: string;
401
+ /** Optional subtitle shown below the title. */
275
402
  description?: string;
403
+ /** URL of the background image applied to the dashboard host element. */
276
404
  backgroundImageUrl?: string;
405
+ /** Overrides for the built-in Edit View and Add Card toolbar buttons. */
277
406
  buttonsSettings?: DashboardButtonsSettings;
407
+ /** Extra action buttons rendered in the toolbar alongside the built-in ones. */
278
408
  customActions?: ButtonSettings[];
409
+ /** When `true`, shows the Edit View button in the toolbar, allowing the user to enter edit mode. */
279
410
  editable?: boolean;
280
411
  }
281
412
 
@@ -344,21 +475,21 @@ declare class Dashboard implements OnInit, OnDestroy {
344
475
  onOrderChange(event: nodesCB): void;
345
476
  private saveCardsPosition;
346
477
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<Dashboard, never>;
347
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<Dashboard, "mfp-dashboard", never, { "config": { "alias": "config"; "required": true; "isSignal": true; }; "sections": { "alias": "sections"; "required": false; "isSignal": true; }; "cards": { "alias": "cards"; "required": false; "isSignal": true; }; "availableCards": { "alias": "availableCards"; "required": false; "isSignal": true; }; }, { "sections": "sectionsChange"; "cards": "cardsChange"; "saved": "saved"; "actionButtonClick": "actionButtonClick"; }, never, never, true, never>;
478
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<Dashboard, "mfp-dashboard", never, { "config": { "alias": "config"; "required": true; "isSignal": true; }; "sections": { "alias": "sections"; "required": false; "isSignal": true; }; "cards": { "alias": "cards"; "required": false; "isSignal": true; }; "availableCards": { "alias": "availableCards"; "required": false; "isSignal": true; }; }, { "sections": "sectionsChange"; "cards": "cardsChange"; "saved": "saved"; "actionButtonClick": "actionButtonClick"; }, never, ["[slot=dashboard-subheader]"], true, never>;
348
479
  }
349
480
 
350
481
  declare class AddCardDialog {
351
482
  availableCards: _angular_core.InputSignal<CardConfig[]>;
352
483
  addedCardsIds: _angular_core.InputSignal<Set<string>>;
353
484
  open: _angular_core.InputSignal<boolean>;
354
- confirm: _angular_core.OutputEmitterRef<CardConfig[]>;
355
- cancel: _angular_core.OutputEmitterRef<void>;
485
+ readonly confirm: _angular_core.OutputEmitterRef<CardConfig[]>;
486
+ readonly cancelled: _angular_core.OutputEmitterRef<void>;
356
487
  selectedIds: _angular_core.WritableSignal<Set<string>>;
357
488
  constructor();
358
489
  toggle(id: string): void;
359
490
  confirmAdd(): void;
360
491
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<AddCardDialog, never>;
361
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<AddCardDialog, "mfp-add-card-dialog", never, { "availableCards": { "alias": "availableCards"; "required": false; "isSignal": true; }; "addedCardsIds": { "alias": "addedCardsIds"; "required": false; "isSignal": true; }; "open": { "alias": "open"; "required": false; "isSignal": true; }; }, { "confirm": "confirm"; "cancel": "cancel"; }, never, never, true, never>;
492
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<AddCardDialog, "mfp-add-card-dialog", never, { "availableCards": { "alias": "availableCards"; "required": false; "isSignal": true; }; "addedCardsIds": { "alias": "addedCardsIds"; "required": false; "isSignal": true; }; "open": { "alias": "open"; "required": false; "isSignal": true; }; }, { "confirm": "confirm"; "cancelled": "cancelled"; }, never, never, true, never>;
362
493
  }
363
494
 
364
495
  declare class DashboardCard {
@@ -392,9 +523,9 @@ declare class VisitedServiceCard {
392
523
  serviceDescription: _angular_core.InputSignal<string>;
393
524
  serviceIcon: _angular_core.InputSignal<string>;
394
525
  path: _angular_core.InputSignal<string>;
395
- click: _angular_core.OutputEmitterRef<string>;
526
+ readonly cardClick: _angular_core.OutputEmitterRef<string>;
396
527
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<VisitedServiceCard, never>;
397
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<VisitedServiceCard, "mfp-visited-service-card", never, { "serviceType": { "alias": "serviceType"; "required": true; "isSignal": true; }; "serviceName": { "alias": "serviceName"; "required": true; "isSignal": true; }; "serviceDescription": { "alias": "serviceDescription"; "required": true; "isSignal": true; }; "serviceIcon": { "alias": "serviceIcon"; "required": true; "isSignal": true; }; "path": { "alias": "path"; "required": true; "isSignal": true; }; }, { "click": "click"; }, never, never, true, never>;
528
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<VisitedServiceCard, "mfp-visited-service-card", never, { "serviceType": { "alias": "serviceType"; "required": true; "isSignal": true; }; "serviceName": { "alias": "serviceName"; "required": true; "isSignal": true; }; "serviceDescription": { "alias": "serviceDescription"; "required": true; "isSignal": true; }; "serviceIcon": { "alias": "serviceIcon"; "required": true; "isSignal": true; }; "path": { "alias": "path"; "required": true; "isSignal": true; }; }, { "cardClick": "cardClick"; }, never, never, true, never>;
398
529
  }
399
530
 
400
531
  declare class Favorites {
@@ -407,10 +538,15 @@ declare class Favorites {
407
538
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<Favorites, "mfp-favorites", never, {}, {}, never, never, true, never>;
408
539
  }
409
540
 
541
+ /** Possible health states for a service. */
410
542
  type ServiceStatusValue = 'operational' | 'degraded' | 'outage' | 'maintenance';
543
+ /** A single service entry displayed in the service-status card. */
411
544
  interface ServiceStatusItem {
545
+ /** Display name of the service. */
412
546
  name: string;
547
+ /** SAP UI5 icon name used as the service icon. */
413
548
  icon: string;
549
+ /** Current health status of the service. */
414
550
  status: ServiceStatusValue;
415
551
  }
416
552
  declare class ServiceStatusCard {