@masterteam/form-builder 0.0.11 → 0.0.13

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": "@masterteam/form-builder",
3
- "version": "0.0.11",
3
+ "version": "0.0.13",
4
4
  "publishConfig": {
5
5
  "directory": "../../../dist/masterteam/form-builder",
6
6
  "linkDirectory": true,
@@ -19,10 +19,10 @@
19
19
  "rxjs": "^7.8.2",
20
20
  "tailwindcss": "^4.1.17",
21
21
  "tailwindcss-primeui": "^0.6.1",
22
- "@masterteam/properties": "^0.0.31",
23
- "@masterteam/components": "^0.0.93",
24
- "@masterteam/icons": "^0.0.13",
25
- "@masterteam/forms": "^0.0.39"
22
+ "@masterteam/properties": "^0.0.34",
23
+ "@masterteam/components": "^0.0.102",
24
+ "@masterteam/forms": "^0.0.49",
25
+ "@masterteam/icons": "^0.0.13"
26
26
  },
27
27
  "sideEffects": false,
28
28
  "exports": {
@@ -9,6 +9,7 @@ import { StateContext } from '@ngxs/store';
9
9
  declare enum FormBuilderActionKey {
10
10
  GetFormConfiguration = "getFormConfiguration",
11
11
  ResetFormConfiguration = "resetFormConfiguration",
12
+ UpdateFormSettings = "updateFormSettings",
12
13
  AddSection = "addSection",
13
14
  UpdateSection = "updateSection",
14
15
  DeleteSection = "deleteSection",
@@ -23,6 +24,7 @@ declare enum FormBuilderActionKey {
23
24
  ToggleValidationActive = "toggleValidationActive"
24
25
  }
25
26
  type FieldWidth = '25' | '50' | '100';
27
+ type FormRenderMode = 'sections' | 'steps' | 'tabs';
26
28
  interface FormField {
27
29
  id: string;
28
30
  sectionId: string;
@@ -52,6 +54,7 @@ interface FormSection {
52
54
  }
53
55
  interface FormConfiguration {
54
56
  isActive: boolean;
57
+ renderMode?: FormRenderMode;
55
58
  sections: FormSection[];
56
59
  validations?: ValidationRule[];
57
60
  }
@@ -157,6 +160,9 @@ interface PreviewInfo {
157
160
  moduleDataId?: number;
158
161
  requestSchemaId?: number;
159
162
  }
163
+ interface UpdateFormSettingsPayload {
164
+ renderMode?: FormRenderMode;
165
+ }
160
166
  interface FormBuilderStateModel extends LoadingStateShape<FormBuilderActionKey> {
161
167
  moduleType: string | null;
162
168
  moduleId: string | number | null;
@@ -183,6 +189,7 @@ declare class FormBuilderFacade {
183
189
  readonly previewInfo: _angular_core.Signal<PreviewInfo | null>;
184
190
  readonly isLoadingFormConfiguration: _angular_core.Signal<boolean>;
185
191
  readonly isResettingFormConfiguration: _angular_core.Signal<boolean>;
192
+ readonly isUpdatingFormSettings: _angular_core.Signal<boolean>;
186
193
  readonly isAddingSection: _angular_core.Signal<boolean>;
187
194
  readonly isUpdatingSection: _angular_core.Signal<boolean>;
188
195
  readonly isDeletingSection: _angular_core.Signal<boolean>;
@@ -204,6 +211,7 @@ declare class FormBuilderFacade {
204
211
  setPreviewInfo(payload: PreviewInfo): rxjs.Observable<void>;
205
212
  getFormConfiguration(): rxjs.Observable<void>;
206
213
  resetFormConfiguration(): rxjs.Observable<void>;
214
+ updateFormSettings(payload: UpdateFormSettingsPayload): rxjs.Observable<void>;
207
215
  addSection(payload: AddSectionPayload): rxjs.Observable<void>;
208
216
  updateSection(sectionId: string, payload: UpdateSectionPayload): rxjs.Observable<void>;
209
217
  deleteSection(sectionId: string): rxjs.Observable<void>;
@@ -244,8 +252,10 @@ declare class FormBuilder implements OnInit {
244
252
  readonly mode: _angular_core.InputSignal<FormBuilderMode>;
245
253
  private dialogRef;
246
254
  readonly sections: _angular_core.Signal<_masterteam_form_builder.FormSection[]>;
255
+ readonly formConfiguration: _angular_core.Signal<_masterteam_form_builder.FormConfiguration | null>;
247
256
  readonly properties: _angular_core.Signal<PropertyItem[]>;
248
257
  readonly isLoading: _angular_core.Signal<boolean>;
258
+ readonly isUpdatingFormSettings: _angular_core.Signal<boolean>;
249
259
  readonly error: _angular_core.Signal<string | null>;
250
260
  readonly moduleType: _angular_core.Signal<string | null>;
251
261
  readonly moduleId: _angular_core.Signal<string | number | null>;
@@ -275,6 +285,23 @@ declare class FormBuilder implements OnInit {
275
285
  }[]>;
276
286
  /** Enriched sections for display */
277
287
  readonly enrichedSections: _angular_core.Signal<EnrichedFormSection[]>;
288
+ readonly selectedRenderMode: _angular_core.Signal<FormRenderMode>;
289
+ readonly renderModeOptions: _angular_core.Signal<({
290
+ label: string;
291
+ value: "sections";
292
+ icon: string;
293
+ color: string;
294
+ } | {
295
+ label: string;
296
+ value: "steps";
297
+ icon: string;
298
+ color: string;
299
+ } | {
300
+ label: string;
301
+ value: "tabs";
302
+ icon: string;
303
+ color: string;
304
+ })[]>;
278
305
  constructor();
279
306
  ngOnInit(): void;
280
307
  private loadInitialContext;
@@ -324,6 +351,7 @@ declare class FormBuilder implements OnInit {
324
351
  drop(event: CdkDragDrop<EnrichedFormField[] | PropertyItem[]>): void;
325
352
  addSection(): void;
326
353
  openPreview(): void;
354
+ onRenderModeChange(renderMode: FormRenderMode): void;
327
355
  openValidationRules(): void;
328
356
  resetFormConfiguration(): void;
329
357
  noReturnPredicate: () => boolean;
@@ -373,6 +401,11 @@ declare class GetFormConfiguration {
373
401
  declare class ResetFormConfiguration {
374
402
  static readonly type = "[FormBuilder] Reset Form Configuration";
375
403
  }
404
+ declare class UpdateFormSettings {
405
+ payload: UpdateFormSettingsPayload;
406
+ static readonly type = "[FormBuilder] Update Form Settings";
407
+ constructor(payload: UpdateFormSettingsPayload);
408
+ }
376
409
  declare class AddSection {
377
410
  payload: AddSectionPayload;
378
411
  static readonly type = "[FormBuilder] Add Section";
@@ -448,6 +481,7 @@ declare class FormBuilderState extends CrudStateBase<FormSection, FormBuilderSta
448
481
  private http;
449
482
  private baseUrl;
450
483
  private getApiPath;
484
+ private normalizeFormConfiguration;
451
485
  static getState(state: FormBuilderStateModel): FormBuilderStateModel;
452
486
  static getFormConfiguration(state: FormBuilderStateModel): FormConfiguration | null;
453
487
  static getSections(state: FormBuilderStateModel): FormSection[];
@@ -465,6 +499,7 @@ declare class FormBuilderState extends CrudStateBase<FormSection, FormBuilderSta
465
499
  setPreviewInfo(ctx: StateContext<FormBuilderStateModel>, action: SetPreviewInfo): void;
466
500
  getFormConfiguration(ctx: StateContext<FormBuilderStateModel>): rxjs.Observable<Response$1<FormConfiguration>>;
467
501
  resetFormConfiguration(ctx: StateContext<FormBuilderStateModel>): rxjs.Observable<Response$1<FormConfiguration>>;
502
+ updateFormSettings(ctx: StateContext<FormBuilderStateModel>, action: UpdateFormSettings): rxjs.Observable<Response$1<FormConfiguration>> | undefined;
468
503
  addSection(ctx: StateContext<FormBuilderStateModel>, action: AddSection): rxjs.Observable<Response$1<FormSection>>;
469
504
  updateSection(ctx: StateContext<FormBuilderStateModel>, action: UpdateSection): rxjs.Observable<Response$1<FormSection>>;
470
505
  deleteSection(ctx: StateContext<FormBuilderStateModel>, action: DeleteSection): rxjs.Observable<Response$1<{
@@ -490,5 +525,5 @@ declare class FormBuilderState extends CrudStateBase<FormSection, FormBuilderSta
490
525
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<FormBuilderState>;
491
526
  }
492
527
 
493
- export { AddField, AddSection, AddValidation, DeleteField, DeleteSection, DeleteValidation, FormBuilder, FormBuilderActionKey, FormBuilderFacade, FormBuilderState, GetFormConfiguration, MoveField, ReorderFields, ResetFormBuilderState, ResetFormConfiguration, SetModuleInfo, SetPreviewInfo, SetProperties, ToggleValidationActive, UpdateField, UpdateSection, UpdateValidation };
494
- export type { AddFieldPayload, AddSectionPayload, AddValidationPayload, EnrichedFormField, EnrichedFormSection, FieldWidth, FormBuilderMode, FormBuilderStateModel, FormConfiguration, FormField, FormSection, MoveFieldPayload, PreviewInfo, PropertyItem, ReorderFieldPayload, Response, ToggleValidationPayload, UpdateFieldPayload, UpdateSectionPayload, UpdateValidationPayload, ValidationRule, ValidationSeverity };
528
+ export { AddField, AddSection, AddValidation, DeleteField, DeleteSection, DeleteValidation, FormBuilder, FormBuilderActionKey, FormBuilderFacade, FormBuilderState, GetFormConfiguration, MoveField, ReorderFields, ResetFormBuilderState, ResetFormConfiguration, SetModuleInfo, SetPreviewInfo, SetProperties, ToggleValidationActive, UpdateField, UpdateFormSettings, UpdateSection, UpdateValidation };
529
+ export type { AddFieldPayload, AddSectionPayload, AddValidationPayload, EnrichedFormField, EnrichedFormSection, FieldWidth, FormBuilderMode, FormBuilderStateModel, FormConfiguration, FormField, FormRenderMode, FormSection, MoveFieldPayload, PreviewInfo, PropertyItem, ReorderFieldPayload, Response, ToggleValidationPayload, UpdateFieldPayload, UpdateFormSettingsPayload, UpdateSectionPayload, UpdateValidationPayload, ValidationRule, ValidationSeverity };