@openmfp/ngx 0.14.11 → 0.15.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/fesm2022/openmfp-ngx.mjs +148 -11
- package/fesm2022/openmfp-ngx.mjs.map +1 -1
- package/package.json +1 -1
- package/types/openmfp-ngx.d.ts +31 -5
package/package.json
CHANGED
package/types/openmfp-ngx.d.ts
CHANGED
|
@@ -111,7 +111,7 @@ interface ResourceFieldButtonClickEvent<T extends GenericResource> {
|
|
|
111
111
|
/** Original DOM click event. */
|
|
112
112
|
event: MouseEvent;
|
|
113
113
|
/** The field definition of the button cell that was clicked. */
|
|
114
|
-
field:
|
|
114
|
+
field: FieldDefinition;
|
|
115
115
|
/** The data row associated with the clicked button. */
|
|
116
116
|
resource: T | undefined;
|
|
117
117
|
}
|
|
@@ -119,7 +119,7 @@ interface ResourceFieldButtonClickEvent<T extends GenericResource> {
|
|
|
119
119
|
interface FieldDefinition {
|
|
120
120
|
/** Column header / form label. */
|
|
121
121
|
label?: string;
|
|
122
|
-
/** Dot-separated path to the resource property (e.g. `metadata.name`). */
|
|
122
|
+
/** Dot-separated path to the resource property (e.g. `metadata.name`). For a collection field this is the path to the array itself (e.g. `status.conditions`). */
|
|
123
123
|
property?: string | string[];
|
|
124
124
|
/** Alternative path resolver with optional transforms. */
|
|
125
125
|
propertyField?: PropertyField;
|
|
@@ -129,7 +129,14 @@ interface FieldDefinition {
|
|
|
129
129
|
value?: string;
|
|
130
130
|
/** Display and interaction configuration for this cell. */
|
|
131
131
|
uiSettings?: UiSettings;
|
|
132
|
+
/**
|
|
133
|
+
* Sub-field definitions describing one entry of an array-of-objects field.
|
|
134
|
+
* When set, `property` points at the array; each sub-field describes one
|
|
135
|
+
* column/input of an entry. Mirrors `propertyField` naming for consistency.
|
|
136
|
+
*/
|
|
137
|
+
propertyCollection?: FieldDefinition[];
|
|
132
138
|
}
|
|
139
|
+
|
|
133
140
|
/** Table column definition — extends `FieldDefinition` with optional column grouping. */
|
|
134
141
|
interface TableFieldDefinition extends FieldDefinition {
|
|
135
142
|
/** Groups this column visually with adjacent columns that share the same `name`. */
|
|
@@ -179,7 +186,7 @@ interface FormFieldDefinition {
|
|
|
179
186
|
/** JSON-path key used to read and write the field value (e.g. `metadata.name`). */
|
|
180
187
|
name: string;
|
|
181
188
|
/** Display label shown above the input. */
|
|
182
|
-
label
|
|
189
|
+
label: string;
|
|
183
190
|
/** When `true`, passes the `required` attribute to the UI5 input — shows a visual required indicator. Validation itself is the host's responsibility via `FormFieldErrors`. */
|
|
184
191
|
required?: boolean;
|
|
185
192
|
/** Fixed list of options rendered as a select/dropdown. */
|
|
@@ -188,6 +195,20 @@ interface FormFieldDefinition {
|
|
|
188
195
|
disabled?: boolean;
|
|
189
196
|
/** Controls when `fieldChange` is emitted for this field. When omitted, `fieldChange` is never emitted. */
|
|
190
197
|
validation?: 'onBlur' | 'onChange';
|
|
198
|
+
/**
|
|
199
|
+
* Nested field definitions describing one item of an object collection.
|
|
200
|
+
*
|
|
201
|
+
* When set, this field represents an array of objects; the form renders it
|
|
202
|
+
* as a stack of expandable/collapsible cards. Each card is a nested
|
|
203
|
+
* `mfp-declarative-form` whose `fields` are the entries in
|
|
204
|
+
* `propertyCollection`; an inline Add button appends entries and a trash
|
|
205
|
+
* button removes them. Editing is live — no per-card Save/Cancel.
|
|
206
|
+
*
|
|
207
|
+
* The submitted value at this field's path is `Array<Record<string, unknown>>`,
|
|
208
|
+
* with each entry keyed by the sub-fields' `name`s. When `required` is
|
|
209
|
+
* `true`, the host is expected to require at least one entry in the array.
|
|
210
|
+
*/
|
|
211
|
+
propertyCollection?: FormFieldDefinition[];
|
|
191
212
|
}
|
|
192
213
|
/** Event payload emitted each time a single form field value changes. */
|
|
193
214
|
interface FormFieldChangeEvent {
|
|
@@ -205,20 +226,25 @@ declare class DeclarativeForm<T extends GenericResource> {
|
|
|
205
226
|
readonly fieldErrors: _angular_core.InputSignal<FormFieldErrors>;
|
|
206
227
|
readonly fieldChange: _angular_core.OutputEmitterRef<FormFieldChangeEvent>;
|
|
207
228
|
readonly formSubmit: _angular_core.OutputEmitterRef<T>;
|
|
229
|
+
readonly formValueChange: _angular_core.OutputEmitterRef<Record<string, unknown>>;
|
|
208
230
|
readonly form: FormGroup;
|
|
231
|
+
protected readonly collectionSeeds: _angular_core.WritableSignal<Record<string, Record<string, unknown>[]>>;
|
|
209
232
|
private readonly fb;
|
|
210
233
|
constructor();
|
|
211
234
|
setFormControlValue($event: Event, field: FormFieldDefinition): void;
|
|
235
|
+
onCollectionValueChange(field: FormFieldDefinition, entries: Record<string, unknown>[]): void;
|
|
212
236
|
getError(name: string): string | null;
|
|
213
237
|
getValueState(name: string): 'None' | 'Negative';
|
|
214
238
|
onFieldBlur(field: FormFieldDefinition): void;
|
|
215
239
|
submit(): void;
|
|
216
240
|
clear(): void;
|
|
241
|
+
collectionEntries(field: FormFieldDefinition): Record<string, unknown>[];
|
|
217
242
|
private rebuildControls;
|
|
218
243
|
private setInitialValues;
|
|
219
244
|
private buildOutputValue;
|
|
245
|
+
private buildEntryGroup;
|
|
220
246
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DeclarativeForm<any>, never>;
|
|
221
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<DeclarativeForm<any>, "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>;
|
|
247
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<DeclarativeForm<any>, "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"; "formValueChange": "formValueChange"; }, never, never, true, never>;
|
|
222
248
|
}
|
|
223
249
|
|
|
224
250
|
/** Configuration for the create/edit resource form rendered inside the table card dialogs. */
|
|
@@ -1325,4 +1351,4 @@ declare class WhatsNew {
|
|
|
1325
1351
|
}
|
|
1326
1352
|
|
|
1327
1353
|
export { BooleanValue, CARD_TYPES, Dashboard, DeclarativeForm, DeclarativeTable, DeclarativeTableCard, Favorites, LinkValue, ResourceField, SecretValue, ServiceStatusCard, TagListValue, VisitedServiceCard, WhatsNew };
|
|
1328
|
-
export type { ButtonSettings, CardConfig, CardsType, CssRule, DashboardButtonsSettings, DashboardConfig, DeleteResourceConfirmationConfig, FieldDefinition, FieldFilterDefinition, FormFieldChangeEvent, FormFieldDefinition, FormFieldErrors, GenericResource, IconDesignType, ModalSettings, MountCfg, PropertyField, ResourceFieldButtonClickEvent, ResourceFormConfig, RuleCondition, SectionConfig, ServiceStatusItem, ServiceStatusValue, TableCardButtonSettings, TableCardConfig, TableCardFormState, TableCardSearchConfig, TableConfig, TableFieldDefinition, TransformType, UiSettings, ValueRule };
|
|
1354
|
+
export type { ButtonSettings, CardConfig, CardsType, CssRule, DashboardButtonsSettings, DashboardConfig, DeleteResourceConfirmationConfig, FieldDefinition, FieldFilterDefinition, FormFieldChangeEvent, FormFieldDefinition, FormFieldErrors, GenericResource, IconDesignType, ModalSettings, MountCfg, PropertyField, ResourceFieldButtonClickEvent, ResourceFormConfig, RuleCondition, SectionConfig, ServiceStatusItem, ServiceStatusValue, TableCardButtonSettings, TableCardConfig, TableCardFormState, TableCardSearchConfig, TableConfig, TableFieldDefinition, TagSettings, TransformType, UiSettings, ValueRule };
|