@praxisui/manual-form 1.0.0-beta.8 → 2.0.0-beta.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/README.md +201 -24
- package/fesm2022/praxisui-manual-form.mjs +3672 -218
- package/fesm2022/praxisui-manual-form.mjs.map +1 -1
- package/index.d.ts +242 -17
- package/package.json +10 -9
package/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { FormConfig, FieldMetadata, DynamicFormService,
|
|
2
|
-
import { FormGroup, FormControlName, AbstractControl } from '@angular/forms';
|
|
1
|
+
import { FormConfig, FieldMetadata, DynamicFormService, AsyncConfigStorage, FormActionsLayout, FormActionButton, FormMessagesLayout, FormBehaviorLayout, FormHookStage, FieldDefinition, FieldControlType, AiCapabilityCategory, AiValueKind, AiCapability, AiCapabilityCatalog } from '@praxisui/core';
|
|
2
|
+
import { FormGroup, FormControlName, FormGroupName, AbstractControl, FormControl } from '@angular/forms';
|
|
3
3
|
import { Observable, BehaviorSubject } from 'rxjs';
|
|
4
4
|
import * as _angular_core from '@angular/core';
|
|
5
5
|
import { AfterContentInit, OnDestroy, OnInit, OnChanges, TemplateRef, ViewContainerRef, SimpleChanges, InjectionToken } from '@angular/core';
|
|
6
|
+
import { BaseAiAdapter, Capability as Capability$1, PatchResult } from '@praxisui/ai';
|
|
6
7
|
import { SettingsPanelRef } from '@praxisui/settings-panel';
|
|
7
8
|
|
|
8
9
|
type ManualFormId = string;
|
|
@@ -28,6 +29,7 @@ interface ManualFormPersistenceOptions {
|
|
|
28
29
|
profileId?: string;
|
|
29
30
|
locale?: string;
|
|
30
31
|
namespace?: string;
|
|
32
|
+
storageKey?: string;
|
|
31
33
|
}
|
|
32
34
|
interface ManualFormState {
|
|
33
35
|
formId: ManualFormId;
|
|
@@ -59,11 +61,17 @@ declare class ManualFormInstance {
|
|
|
59
61
|
private readonly state$;
|
|
60
62
|
private readonly formGroup;
|
|
61
63
|
private readonly boundComponents;
|
|
62
|
-
constructor(formId: ManualFormId, seed: ManualFormSeed, initialConfig: FormConfig, dynamicFormService: DynamicFormService, storage?:
|
|
64
|
+
constructor(formId: ManualFormId, seed: ManualFormSeed, initialConfig: FormConfig, dynamicFormService: DynamicFormService, storage?: AsyncConfigStorage | undefined, persistenceOptions?: ManualFormPersistenceOptions | undefined, externalForm?: FormGroup);
|
|
63
65
|
/** Observable stream for consumers interested in config mutations. */
|
|
64
66
|
get stateChanges$(): Observable<ManualFormState>;
|
|
65
67
|
get formConfigChanges$(): Observable<FormConfig>;
|
|
66
68
|
get fieldMetadataChanges$(): Observable<ManualFieldMetadataMap>;
|
|
69
|
+
/**
|
|
70
|
+
* Emits after field metadata has been applied to the runtime state.
|
|
71
|
+
* Fires on patchFieldMetadata(), replaceConfig(), resetToSeed(), and
|
|
72
|
+
* persisted config loads (when metadata is replaced).
|
|
73
|
+
*/
|
|
74
|
+
metadataChanges(): Observable<ManualFieldMetadataMap>;
|
|
67
75
|
get currentConfig(): FormConfig;
|
|
68
76
|
get currentFieldMetadata(): ManualFieldMetadataMap;
|
|
69
77
|
get form(): FormGroup;
|
|
@@ -87,15 +95,18 @@ declare class ManualFormInstance {
|
|
|
87
95
|
resetToSeed(): void;
|
|
88
96
|
/**
|
|
89
97
|
* Persists the current configuration and, optionally, the provided form value
|
|
90
|
-
* using
|
|
98
|
+
* using AsyncConfigStorage. By default, stores the FormGroup raw value.
|
|
91
99
|
*/
|
|
92
100
|
saveDraft(value?: Record<string, any> | null): void;
|
|
93
101
|
private publishConfig;
|
|
94
102
|
private getFieldMetadataArray;
|
|
95
103
|
private cloneFieldMetadata;
|
|
96
104
|
private refreshBoundComponent;
|
|
97
|
-
/**
|
|
98
|
-
|
|
105
|
+
/**
|
|
106
|
+
* JSON Merge Patch semantics for metadata patches.
|
|
107
|
+
* `null` remove a propriedade-alvo e objetos vazios são podados.
|
|
108
|
+
*/
|
|
109
|
+
private applyJsonMergePatch;
|
|
99
110
|
}
|
|
100
111
|
/**
|
|
101
112
|
* Factory service used to create ManualFormInstance objects with the required
|
|
@@ -104,9 +115,8 @@ declare class ManualFormInstance {
|
|
|
104
115
|
declare class ManualFormInstanceFactory {
|
|
105
116
|
private readonly storage?;
|
|
106
117
|
private readonly dynamicFormService;
|
|
107
|
-
constructor(storage?:
|
|
118
|
+
constructor(storage?: AsyncConfigStorage | undefined);
|
|
108
119
|
create(seed: ManualFormSeed, options?: ManualFormPersistenceOptions, externalForm?: FormGroup): ManualFormInstance;
|
|
109
|
-
private loadPersistedSnapshot;
|
|
110
120
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ManualFormInstanceFactory, [{ optional: true; }]>;
|
|
111
121
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<ManualFormInstanceFactory>;
|
|
112
122
|
}
|
|
@@ -117,7 +127,7 @@ declare class ManualFormHeaderComponent {
|
|
|
117
127
|
readonly description: _angular_core.InputSignal<string | undefined>;
|
|
118
128
|
readonly saveLabel: _angular_core.InputSignal<string>;
|
|
119
129
|
readonly resetLabel: _angular_core.InputSignal<string>;
|
|
120
|
-
readonly
|
|
130
|
+
readonly enableCustomization: _angular_core.InputSignal<boolean>;
|
|
121
131
|
readonly editFormLabel: _angular_core.InputSignal<string>;
|
|
122
132
|
readonly save: _angular_core.OutputEmitterRef<void>;
|
|
123
133
|
readonly reset: _angular_core.OutputEmitterRef<void>;
|
|
@@ -128,7 +138,7 @@ declare class ManualFormHeaderComponent {
|
|
|
128
138
|
get displayTitle(): string;
|
|
129
139
|
get displayDescription(): string | undefined;
|
|
130
140
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ManualFormHeaderComponent, never>;
|
|
131
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ManualFormHeaderComponent, "praxis-manual-form-header", never, { "instance": { "alias": "instance"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "description": { "alias": "description"; "required": false; "isSignal": true; }; "saveLabel": { "alias": "saveLabel"; "required": false; "isSignal": true; }; "resetLabel": { "alias": "resetLabel"; "required": false; "isSignal": true; }; "
|
|
141
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ManualFormHeaderComponent, "praxis-manual-form-header", never, { "instance": { "alias": "instance"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "description": { "alias": "description"; "required": false; "isSignal": true; }; "saveLabel": { "alias": "saveLabel"; "required": false; "isSignal": true; }; "resetLabel": { "alias": "resetLabel"; "required": false; "isSignal": true; }; "enableCustomization": { "alias": "enableCustomization"; "required": false; "isSignal": true; }; "editFormLabel": { "alias": "editFormLabel"; "required": false; "isSignal": true; }; }, { "save": "save"; "reset": "reset"; "editForm": "editForm"; }, never, never, true, never>;
|
|
132
142
|
}
|
|
133
143
|
|
|
134
144
|
declare class ManualFormActionsComponent {
|
|
@@ -141,14 +151,47 @@ declare class ManualFormActionsComponent {
|
|
|
141
151
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ManualFormActionsComponent, "praxis-manual-form-actions", never, { "actions": { "alias": "actions"; "required": false; "isSignal": true; }; "trackByFn": { "alias": "trackByFn"; "required": false; }; }, { "actionClick": "actionClick"; }, never, never, true, never>;
|
|
142
152
|
}
|
|
143
153
|
|
|
154
|
+
declare class ManualFormAiAdapter extends BaseAiAdapter<FormConfig> {
|
|
155
|
+
private host;
|
|
156
|
+
componentName: string;
|
|
157
|
+
constructor(host: ManualFormComponent);
|
|
158
|
+
getCurrentConfig(): FormConfig;
|
|
159
|
+
getCapabilities(): Capability$1[];
|
|
160
|
+
getRuntimeState(): Record<string, any>;
|
|
161
|
+
createSnapshot(): FormConfig;
|
|
162
|
+
restoreSnapshot(snapshot: FormConfig): Promise<void>;
|
|
163
|
+
applyPatch(patch: Partial<FormConfig>, _intent?: string): Promise<PatchResult>;
|
|
164
|
+
private applyConfig;
|
|
165
|
+
private smartMergeFormConfig;
|
|
166
|
+
private cloneConfig;
|
|
167
|
+
private safeFormId;
|
|
168
|
+
}
|
|
169
|
+
|
|
144
170
|
declare class ManualFormComponent implements AfterContentInit, OnDestroy {
|
|
145
171
|
private readonly instanceFactory;
|
|
146
172
|
private readonly cdr;
|
|
147
173
|
private readonly destroyRef;
|
|
148
174
|
private readonly metadataBridge;
|
|
149
175
|
private readonly settingsPanel;
|
|
176
|
+
private readonly hooksRegistry;
|
|
177
|
+
private readonly componentKeys;
|
|
178
|
+
private readonly overlay;
|
|
179
|
+
private readonly fieldKeyService;
|
|
180
|
+
private readonly platformId;
|
|
181
|
+
private readonly route;
|
|
182
|
+
private warnedMissingId;
|
|
183
|
+
private readonly disableSelectorDefaults;
|
|
150
184
|
private readonly selectorToControlType;
|
|
151
185
|
private readonly constructorToControlType;
|
|
186
|
+
private readonly selectorRegistry;
|
|
187
|
+
private toolbarOverlayRef?;
|
|
188
|
+
private toolbarComponentRef?;
|
|
189
|
+
private toolbarFieldKey?;
|
|
190
|
+
private toolbarAnchor?;
|
|
191
|
+
private toolbarSubscriptions;
|
|
192
|
+
private toolbarActionSubscriptions;
|
|
193
|
+
private metadataSubscription?;
|
|
194
|
+
private outsideClickSubscription?;
|
|
152
195
|
readonly formId: _angular_core.InputSignal<string>;
|
|
153
196
|
readonly formTitle: _angular_core.InputSignal<string | undefined>;
|
|
154
197
|
readonly formDescription: _angular_core.InputSignal<string | undefined>;
|
|
@@ -156,7 +199,8 @@ declare class ManualFormComponent implements AfterContentInit, OnDestroy {
|
|
|
156
199
|
readonly showHeader: _angular_core.InputSignal<boolean>;
|
|
157
200
|
readonly showActions: _angular_core.InputSignal<boolean>;
|
|
158
201
|
readonly enableAutoSave: _angular_core.InputSignal<boolean>;
|
|
159
|
-
readonly
|
|
202
|
+
readonly componentInstanceId: _angular_core.InputSignal<string | undefined>;
|
|
203
|
+
readonly enableCustomization: _angular_core.InputSignal<boolean>;
|
|
160
204
|
readonly persistenceOptions: _angular_core.InputSignal<ManualFormPersistenceOptions | undefined>;
|
|
161
205
|
readonly usePathNames: _angular_core.InputSignal<boolean>;
|
|
162
206
|
readonly autoSaveDebounceMs: _angular_core.InputSignal<number>;
|
|
@@ -171,6 +215,7 @@ declare class ManualFormComponent implements AfterContentInit, OnDestroy {
|
|
|
171
215
|
private readonly hostFormGroupDirective;
|
|
172
216
|
instance?: ManualFormInstance;
|
|
173
217
|
resolvedActions?: FormActionsLayout;
|
|
218
|
+
aiAdapter: ManualFormAiAdapter;
|
|
174
219
|
formGroup: FormGroup;
|
|
175
220
|
private readonly registeredDirectives;
|
|
176
221
|
constructor();
|
|
@@ -180,28 +225,54 @@ declare class ManualFormComponent implements AfterContentInit, OnDestroy {
|
|
|
180
225
|
get control(): FormGroup;
|
|
181
226
|
get path(): any[];
|
|
182
227
|
addControl(dir: FormControlName): any;
|
|
228
|
+
addFormGroup(dir: FormGroupName): void;
|
|
229
|
+
removeFormGroup(dir: FormGroupName): void;
|
|
230
|
+
getFormGroup(dir: FormGroupName): FormGroup;
|
|
183
231
|
removeControl(dir: FormControlName): void;
|
|
184
232
|
getControl(dir: FormControlName): AbstractControl | null;
|
|
185
233
|
updateModel(dir: FormControlName, value: any): void;
|
|
186
234
|
handleAction(actionId: string): void;
|
|
187
|
-
handleSubmit(): void
|
|
235
|
+
handleSubmit(): Promise<void>;
|
|
188
236
|
handleSave(): void;
|
|
237
|
+
/** True when host applied [formGroup] directly on <praxis-manual-form>. */
|
|
238
|
+
isHostTyped(): boolean;
|
|
189
239
|
handleReset(): void;
|
|
240
|
+
private runHooks;
|
|
190
241
|
/**
|
|
191
242
|
* Attempts to open the field metadata editor respecting the component's
|
|
192
|
-
*
|
|
243
|
+
* enableCustomization input. No-ops when disabled or without an instance.
|
|
193
244
|
*/
|
|
194
245
|
tryOpenFieldEditor(fieldName: string): void;
|
|
195
246
|
/** Opens a simple form-level editor listing the fields and their visibility. */
|
|
196
247
|
openFormEditor(): Promise<void>;
|
|
248
|
+
applyConfigFromAdapter(config: FormConfig): void;
|
|
197
249
|
private initialize;
|
|
198
250
|
private collectFields;
|
|
251
|
+
private componentKeyId;
|
|
252
|
+
private warnMissingId;
|
|
199
253
|
private resolveValueAccessor;
|
|
200
254
|
private resolveSelector;
|
|
255
|
+
private resolveHostElement;
|
|
201
256
|
private createSeedFromFields;
|
|
202
257
|
private applyInstanceToTemplate;
|
|
258
|
+
private registerToolbarBindings;
|
|
259
|
+
private isToolbarShortcut;
|
|
260
|
+
private openToolbarForField;
|
|
261
|
+
private createToolbarOverlay;
|
|
262
|
+
private updateToolbarAnchor;
|
|
263
|
+
private bindToolbarActions;
|
|
264
|
+
private toggleFieldFlag;
|
|
265
|
+
private openToolbarEditor;
|
|
266
|
+
private updateToolbarMetadata;
|
|
267
|
+
private attachOutsideClickHandler;
|
|
268
|
+
private closeToolbar;
|
|
269
|
+
private resetToolbarState;
|
|
270
|
+
private attachMetadataSync;
|
|
203
271
|
private buildMetadataForField;
|
|
272
|
+
private syncHostFormGroupReference;
|
|
204
273
|
private getControlByPath;
|
|
274
|
+
private getDirPath;
|
|
275
|
+
private ensureGroupPath;
|
|
205
276
|
private ensureControlPath;
|
|
206
277
|
private extractExistingMetadata;
|
|
207
278
|
private inferLabel;
|
|
@@ -211,7 +282,7 @@ declare class ManualFormComponent implements AfterContentInit, OnDestroy {
|
|
|
211
282
|
private buildCurrentConfigSnapshot;
|
|
212
283
|
private normalizeActions;
|
|
213
284
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ManualFormComponent, never>;
|
|
214
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ManualFormComponent, "praxis-manual-form", never, { "formId": { "alias": "formId"; "required": true; "isSignal": true; }; "formTitle": { "alias": "formTitle"; "required": false; "isSignal": true; }; "formDescription": { "alias": "formDescription"; "required": false; "isSignal": true; }; "actions": { "alias": "actions"; "required": false; "isSignal": true; }; "showHeader": { "alias": "showHeader"; "required": false; "isSignal": true; }; "showActions": { "alias": "showActions"; "required": false; "isSignal": true; }; "enableAutoSave": { "alias": "enableAutoSave"; "required": false; "isSignal": true; }; "
|
|
285
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ManualFormComponent, "praxis-manual-form", never, { "formId": { "alias": "formId"; "required": true; "isSignal": true; }; "formTitle": { "alias": "formTitle"; "required": false; "isSignal": true; }; "formDescription": { "alias": "formDescription"; "required": false; "isSignal": true; }; "actions": { "alias": "actions"; "required": false; "isSignal": true; }; "showHeader": { "alias": "showHeader"; "required": false; "isSignal": true; }; "showActions": { "alias": "showActions"; "required": false; "isSignal": true; }; "enableAutoSave": { "alias": "enableAutoSave"; "required": false; "isSignal": true; }; "componentInstanceId": { "alias": "componentInstanceId"; "required": false; "isSignal": true; }; "enableCustomization": { "alias": "enableCustomization"; "required": false; "isSignal": true; }; "persistenceOptions": { "alias": "persistenceOptions"; "required": false; "isSignal": true; }; "usePathNames": { "alias": "usePathNames"; "required": false; "isSignal": true; }; "autoSaveDebounceMs": { "alias": "autoSaveDebounceMs"; "required": false; "isSignal": true; }; }, { "submitted": "submitted"; "saved": "saved"; "resetEvent": "reset"; "metadataChange": "metadataChange"; }, ["formControls"], ["*"], true, never>;
|
|
215
286
|
}
|
|
216
287
|
|
|
217
288
|
interface PanelInputs {
|
|
@@ -223,6 +294,21 @@ declare class ManualFormConfigEditorComponent implements OnInit {
|
|
|
223
294
|
all: FieldMetadata[];
|
|
224
295
|
filtered: FieldMetadata[];
|
|
225
296
|
onlyHidden: boolean;
|
|
297
|
+
actionsModel: FormActionsLayout;
|
|
298
|
+
messagesModel: FormMessagesLayout;
|
|
299
|
+
behaviorModel: FormBehaviorLayout;
|
|
300
|
+
hintsModel: FormHints;
|
|
301
|
+
hooksText: Record<FormHookStage, string>;
|
|
302
|
+
hooksErrors: Partial<Record<FormHookStage, string>>;
|
|
303
|
+
formRulesText: string;
|
|
304
|
+
formRulesStateText: string;
|
|
305
|
+
formRulesError: string;
|
|
306
|
+
formRulesStateError: string;
|
|
307
|
+
readonly hookStages: FormHookStage[];
|
|
308
|
+
readonly actionBlocks: Array<{
|
|
309
|
+
key: 'submit' | 'cancel' | 'reset';
|
|
310
|
+
label: string;
|
|
311
|
+
}>;
|
|
226
312
|
isDirty$: BehaviorSubject<boolean>;
|
|
227
313
|
isValid$: BehaviorSubject<boolean>;
|
|
228
314
|
isBusy$: BehaviorSubject<boolean>;
|
|
@@ -234,12 +320,109 @@ declare class ManualFormConfigEditorComponent implements OnInit {
|
|
|
234
320
|
toggleRequired(field: FieldMetadata, checked?: boolean): void;
|
|
235
321
|
toggleReadOnly(field: FieldMetadata, checked?: boolean): void;
|
|
236
322
|
toggleDisabled(field: FieldMetadata, checked?: boolean): void;
|
|
323
|
+
updateActionField(key: 'submit' | 'cancel' | 'reset', field: keyof FormActionButton, value: any): void;
|
|
324
|
+
updateActionsLayout(field: 'position' | 'orientation' | 'spacing' | 'sticky' | 'divider' | 'placement', value: any): void;
|
|
325
|
+
addCustomAction(): void;
|
|
326
|
+
removeCustomAction(action: FormActionButton): void;
|
|
327
|
+
updateCustomActionField(action: FormActionButton, field: keyof FormActionButton, value: any): void;
|
|
328
|
+
updateMessage(key: keyof FormMessagesLayout, value: string): void;
|
|
329
|
+
updateConfirmation(key: 'submit' | 'cancel' | 'reset', value: string): void;
|
|
330
|
+
updateLoading(key: 'submit' | 'cancel' | 'reset', value: string): void;
|
|
331
|
+
updateCustomMessage(action: FormActionButton, kind: 'success' | 'error' | 'confirmation', value: string): void;
|
|
332
|
+
updateBehavior(key: keyof FormBehaviorLayout, value: any): void;
|
|
333
|
+
updateHints(scope: 'dataModes' | 'uiModes', key: string, value: string): void;
|
|
334
|
+
hookLabel(stage: FormHookStage): string;
|
|
335
|
+
onHookTextChange(stage: FormHookStage, value: string): void;
|
|
336
|
+
resetHooks(): void;
|
|
337
|
+
applyHooks(): void;
|
|
338
|
+
onRulesTextChange(value: string): void;
|
|
339
|
+
onRulesStateTextChange(value: string): void;
|
|
340
|
+
applyRules(): void;
|
|
341
|
+
applyCascadePatch(patch: Record<string, Partial<FieldDefinition>>): void;
|
|
342
|
+
get cascadeFields(): Array<FieldDefinition | FieldMetadata>;
|
|
237
343
|
getSettingsValue(): any;
|
|
238
344
|
onSave(): any;
|
|
239
345
|
private refresh;
|
|
346
|
+
private normalizeActions;
|
|
347
|
+
private applyConfigPatch;
|
|
348
|
+
private generateCustomId;
|
|
240
349
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ManualFormConfigEditorComponent, never>;
|
|
241
350
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ManualFormConfigEditorComponent, "praxis-manual-form-config-editor", never, {}, {}, never, never, true, never>;
|
|
242
351
|
}
|
|
352
|
+
interface FormHints {
|
|
353
|
+
dataModes: {
|
|
354
|
+
create: string;
|
|
355
|
+
edit: string;
|
|
356
|
+
view: string;
|
|
357
|
+
};
|
|
358
|
+
uiModes: {
|
|
359
|
+
presentation: string;
|
|
360
|
+
readonly: string;
|
|
361
|
+
disabled: string;
|
|
362
|
+
visible: string;
|
|
363
|
+
};
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
type ManualFormDocExampleTab = 'live' | 'template' | 'ts' | 'config';
|
|
367
|
+
type ManualFormDocExampleLevel = 'Basico' | 'Intermediario' | 'Avancado';
|
|
368
|
+
interface DocExampleTabOption {
|
|
369
|
+
id: ManualFormDocExampleTab;
|
|
370
|
+
label: string;
|
|
371
|
+
hint: string;
|
|
372
|
+
}
|
|
373
|
+
declare class ManualFormDocExampleComponent implements OnDestroy {
|
|
374
|
+
readonly title: _angular_core.InputSignal<string>;
|
|
375
|
+
readonly subtitle: _angular_core.InputSignal<string | null>;
|
|
376
|
+
readonly level: _angular_core.InputSignal<ManualFormDocExampleLevel>;
|
|
377
|
+
readonly bannerTitle: _angular_core.InputSignal<string | null>;
|
|
378
|
+
readonly bannerDescription: _angular_core.InputSignal<string | null>;
|
|
379
|
+
readonly templateCode: _angular_core.InputSignal<string>;
|
|
380
|
+
readonly tsCode: _angular_core.InputSignal<string>;
|
|
381
|
+
readonly configCode: _angular_core.InputSignal<string>;
|
|
382
|
+
readonly customizationEnabled: _angular_core.InputSignal<boolean>;
|
|
383
|
+
readonly showCustomizationToggle: _angular_core.InputSignal<boolean>;
|
|
384
|
+
readonly important: _angular_core.InputSignal<string | null>;
|
|
385
|
+
readonly note: _angular_core.InputSignal<string | null>;
|
|
386
|
+
readonly tip: _angular_core.InputSignal<string | null>;
|
|
387
|
+
readonly activeTab: _angular_core.WritableSignal<ManualFormDocExampleTab>;
|
|
388
|
+
readonly copyStatus: _angular_core.WritableSignal<string>;
|
|
389
|
+
readonly tabs: ReadonlyArray<DocExampleTabOption>;
|
|
390
|
+
readonly selectedSnippet: _angular_core.Signal<string>;
|
|
391
|
+
readonly selectedSnippetLabel: _angular_core.Signal<"Live" | "Template" | "Config" | "TypeScript">;
|
|
392
|
+
readonly canCopySnippet: _angular_core.Signal<boolean>;
|
|
393
|
+
readonly tabChange: _angular_core.OutputEmitterRef<ManualFormDocExampleTab>;
|
|
394
|
+
readonly customizationEnabledChange: _angular_core.OutputEmitterRef<boolean>;
|
|
395
|
+
readonly codeCopied: _angular_core.OutputEmitterRef<{
|
|
396
|
+
tab: ManualFormDocExampleTab;
|
|
397
|
+
success: boolean;
|
|
398
|
+
}>;
|
|
399
|
+
readonly idPrefix: string;
|
|
400
|
+
private copyStatusTimer;
|
|
401
|
+
ngOnDestroy(): void;
|
|
402
|
+
setTab(tab: ManualFormDocExampleTab): void;
|
|
403
|
+
toggleCustomization(): void;
|
|
404
|
+
tabId(tab: ManualFormDocExampleTab): string;
|
|
405
|
+
panelId(tab: ManualFormDocExampleTab): string;
|
|
406
|
+
copyActiveSnippet(): Promise<void>;
|
|
407
|
+
private setCopyStatus;
|
|
408
|
+
private clearCopyStatusTimer;
|
|
409
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ManualFormDocExampleComponent, never>;
|
|
410
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ManualFormDocExampleComponent, "praxis-manual-form-doc-example", never, { "title": { "alias": "title"; "required": false; "isSignal": true; }; "subtitle": { "alias": "subtitle"; "required": false; "isSignal": true; }; "level": { "alias": "level"; "required": false; "isSignal": true; }; "bannerTitle": { "alias": "bannerTitle"; "required": false; "isSignal": true; }; "bannerDescription": { "alias": "bannerDescription"; "required": false; "isSignal": true; }; "templateCode": { "alias": "templateCode"; "required": false; "isSignal": true; }; "tsCode": { "alias": "tsCode"; "required": false; "isSignal": true; }; "configCode": { "alias": "configCode"; "required": false; "isSignal": true; }; "customizationEnabled": { "alias": "customizationEnabled"; "required": false; "isSignal": true; }; "showCustomizationToggle": { "alias": "showCustomizationToggle"; "required": false; "isSignal": true; }; "important": { "alias": "important"; "required": false; "isSignal": true; }; "note": { "alias": "note"; "required": false; "isSignal": true; }; "tip": { "alias": "tip"; "required": false; "isSignal": true; }; }, { "tabChange": "tabChange"; "customizationEnabledChange": "customizationEnabledChange"; "codeCopied": "codeCopied"; }, never, ["[exampleBannerArtwork]", "[exampleLive]", "[exampleDiagram]"], true, never>;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
declare class ManualFormDocExampleShowcaseComponent {
|
|
414
|
+
readonly customizationEnabled: _angular_core.WritableSignal<boolean>;
|
|
415
|
+
readonly form: FormGroup<{
|
|
416
|
+
nome: FormControl<string>;
|
|
417
|
+
descricao: FormControl<string>;
|
|
418
|
+
}>;
|
|
419
|
+
readonly templateSnippet = "<praxis-manual-form [formGroup]=\"form\" formId=\"doc-example-cargo\">\n <label>\n <span>Nome</span>\n <input type=\"text\" formControlName=\"nome\" />\n </label>\n\n <label>\n <span>Descricao</span>\n <textarea formControlName=\"descricao\" rows=\"3\"></textarea>\n </label>\n</praxis-manual-form>";
|
|
420
|
+
readonly tsSnippet = "readonly customizationEnabled = signal(false);\n\nreadonly form = new FormGroup({\n nome: new FormControl('', { nonNullable: true, validators: [Validators.required] }),\n descricao: new FormControl('', { nonNullable: true }),\n});\n\nsetCustomizationEnabled(enabled: boolean): void {\n this.customizationEnabled.set(enabled);\n}";
|
|
421
|
+
readonly configSnippet = "{\n \"component\": \"praxis-manual-form-doc-example\",\n \"tabs\": [\"live\", \"template\", \"ts\", \"config\"],\n \"defaultTab\": \"live\",\n \"level\": \"Intermediario\"\n}";
|
|
422
|
+
setCustomizationEnabled(enabled: boolean): void;
|
|
423
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ManualFormDocExampleShowcaseComponent, never>;
|
|
424
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ManualFormDocExampleShowcaseComponent, "praxis-manual-form-doc-example-showcase", never, {}, {}, never, never, true, never>;
|
|
425
|
+
}
|
|
243
426
|
|
|
244
427
|
interface ManualFieldContext {
|
|
245
428
|
$implicit: FieldMetadata | undefined;
|
|
@@ -260,7 +443,7 @@ declare class ManualFieldDirective implements OnChanges {
|
|
|
260
443
|
|
|
261
444
|
/**
|
|
262
445
|
* Attach to any field inside <praxis-manual-form> to open the metadata editor
|
|
263
|
-
* on double click, respecting the form's
|
|
446
|
+
* on double click, respecting the form's enableCustomization state.
|
|
264
447
|
*
|
|
265
448
|
* Usage:
|
|
266
449
|
* <pdx-text-input pdxManualEdit="nome" ...></pdx-text-input>
|
|
@@ -291,8 +474,50 @@ declare class ManualFieldMetadataBridgeService {
|
|
|
291
474
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<ManualFieldMetadataBridgeService>;
|
|
292
475
|
}
|
|
293
476
|
|
|
477
|
+
type ManualFieldKeyResolution = {
|
|
478
|
+
status: 'ok';
|
|
479
|
+
key: string;
|
|
480
|
+
} | {
|
|
481
|
+
status: 'missing';
|
|
482
|
+
} | {
|
|
483
|
+
status: 'ambiguous';
|
|
484
|
+
candidates: string[];
|
|
485
|
+
};
|
|
486
|
+
declare class ManualFieldKeyService {
|
|
487
|
+
resolveFieldName(input: string | string[], instance: ManualFormInstance | null | undefined): ManualFieldKeyResolution;
|
|
488
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ManualFieldKeyService, never>;
|
|
489
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<ManualFieldKeyService>;
|
|
490
|
+
}
|
|
491
|
+
|
|
294
492
|
declare const MANUAL_FORM_SELECTOR_TO_CONTROL_TYPE: InjectionToken<Record<string, FieldControlType>>;
|
|
295
493
|
declare const MANUAL_FORM_CONSTRUCTOR_TO_CONTROL_TYPE: InjectionToken<Record<string, FieldControlType>>;
|
|
296
494
|
|
|
297
|
-
|
|
298
|
-
|
|
495
|
+
/**
|
|
496
|
+
* Capabilities catalog for Manual Form (FormConfig-based).
|
|
497
|
+
* Focuses on the FormConfig structure managed by ManualFormInstance.
|
|
498
|
+
*/
|
|
499
|
+
|
|
500
|
+
declare module '@praxisui/core' {
|
|
501
|
+
interface AiCapabilityCategoryMap {
|
|
502
|
+
fields: true;
|
|
503
|
+
actions: true;
|
|
504
|
+
api: true;
|
|
505
|
+
messages: true;
|
|
506
|
+
metadata: true;
|
|
507
|
+
hints: true;
|
|
508
|
+
rules: true;
|
|
509
|
+
hooks: true;
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
type CapabilityCategory = AiCapabilityCategory;
|
|
513
|
+
type ValueKind = AiValueKind;
|
|
514
|
+
interface Capability extends AiCapability {
|
|
515
|
+
category: CapabilityCategory;
|
|
516
|
+
}
|
|
517
|
+
interface CapabilityCatalog extends AiCapabilityCatalog {
|
|
518
|
+
capabilities: Capability[];
|
|
519
|
+
}
|
|
520
|
+
declare const MANUAL_FORM_AI_CAPABILITIES: CapabilityCatalog;
|
|
521
|
+
|
|
522
|
+
export { MANUAL_FORM_AI_CAPABILITIES, MANUAL_FORM_CONSTRUCTOR_TO_CONTROL_TYPE, MANUAL_FORM_SELECTOR_TO_CONTROL_TYPE, ManualFieldDirective, ManualFieldEditorOnDblclickDirective, ManualFieldKeyService, ManualFieldMetadataBridgeService, ManualFormActionsComponent, ManualFormComponent, ManualFormConfigEditorComponent, ManualFormDocExampleComponent, ManualFormDocExampleShowcaseComponent, ManualFormHeaderComponent, ManualFormInstance, ManualFormInstanceFactory, createManualFormSeed, toFieldMetadataMap };
|
|
523
|
+
export type { Capability, CapabilityCatalog, CapabilityCategory, ManualFieldKeyResolution, ManualFieldMetadataMap, ManualFormDocExampleLevel, ManualFormDocExampleTab, ManualFormId, ManualFormPersistenceOptions, ManualFormSeed, ManualFormSeedOptions, ManualFormSnapshot, ManualFormState, ValueKind };
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@praxisui/manual-form",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-beta.0",
|
|
4
4
|
"description": "Manual form toolkit for Praxis UI: container, instance factory and editor bridge for @praxisui/* fields.",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"@angular/common": "^20.1.0",
|
|
7
7
|
"@angular/core": "^20.1.0",
|
|
8
|
-
"@praxisui/core": "^
|
|
9
|
-
"@praxisui/dynamic-fields": "^
|
|
10
|
-
"@praxisui/settings-panel": "^
|
|
11
|
-
"@praxisui/metadata-editor": "^
|
|
8
|
+
"@praxisui/core": "^2.0.0-beta.0",
|
|
9
|
+
"@praxisui/dynamic-fields": "^2.0.0-beta.0",
|
|
10
|
+
"@praxisui/settings-panel": "^2.0.0-beta.0",
|
|
11
|
+
"@praxisui/metadata-editor": "^2.0.0-beta.0"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"tslib": "^2.3.0"
|
|
@@ -19,18 +19,19 @@
|
|
|
19
19
|
},
|
|
20
20
|
"repository": {
|
|
21
21
|
"type": "git",
|
|
22
|
-
"url": "https://github.com/codexrodrigues/praxis"
|
|
22
|
+
"url": "https://github.com/codexrodrigues/praxis-ui-angular"
|
|
23
23
|
},
|
|
24
|
-
"homepage": "https://
|
|
24
|
+
"homepage": "https://praxisui.dev",
|
|
25
25
|
"bugs": {
|
|
26
|
-
"url": "https://github.com/codexrodrigues/praxis/issues"
|
|
26
|
+
"url": "https://github.com/codexrodrigues/praxis-ui-angular/issues"
|
|
27
27
|
},
|
|
28
28
|
"keywords": [
|
|
29
29
|
"angular",
|
|
30
30
|
"praxisui",
|
|
31
31
|
"manual-form",
|
|
32
32
|
"forms",
|
|
33
|
-
"
|
|
33
|
+
"autosave",
|
|
34
|
+
"metadata"
|
|
34
35
|
],
|
|
35
36
|
"sideEffects": false,
|
|
36
37
|
"module": "fesm2022/praxisui-manual-form.mjs",
|