@masterteam/form-builder 0.0.2 → 0.0.4

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 (33) hide show
  1. package/assets/form-builder.css +2 -4
  2. package/fesm2022/masterteam-form-builder.mjs +1908 -0
  3. package/fesm2022/masterteam-form-builder.mjs.map +1 -0
  4. package/package.json +16 -16
  5. package/types/masterteam-form-builder.d.ts +299 -0
  6. package/.angular/cache/21.0.2/ng-packagr/db70d8f07b5a2d2d1c3124ca92e8d56d14fb894dce4d4867ba7c0db29ba913a3 +0 -1
  7. package/.angular/cache/21.0.2/ng-packagr/tsbuildinfo/masterteam-form-builder.tsbuildinfo +0 -1
  8. package/BACKEND_API_SPEC.md +0 -338
  9. package/angular.json +0 -26
  10. package/ng-package.json +0 -13
  11. package/src/lib/fb-field-conditions/condition-constants.ts +0 -262
  12. package/src/lib/fb-field-conditions/fb-field-conditions.html +0 -35
  13. package/src/lib/fb-field-conditions/fb-field-conditions.ts +0 -123
  14. package/src/lib/fb-field-form/fb-field-form.html +0 -59
  15. package/src/lib/fb-field-form/fb-field-form.ts +0 -250
  16. package/src/lib/fb-preview-form/fb-preview-form.html +0 -31
  17. package/src/lib/fb-preview-form/fb-preview-form.ts +0 -147
  18. package/src/lib/fb-section/fb-section.html +0 -130
  19. package/src/lib/fb-section/fb-section.ts +0 -211
  20. package/src/lib/fb-section-form/fb-section-form.html +0 -38
  21. package/src/lib/fb-section-form/fb-section-form.ts +0 -128
  22. package/src/lib/form-builder.html +0 -166
  23. package/src/lib/form-builder.model.ts +0 -27
  24. package/src/lib/form-builder.scss +0 -20
  25. package/src/lib/form-builder.ts +0 -208
  26. package/src/public-api.ts +0 -6
  27. package/src/store/form-builder/api.model.ts +0 -13
  28. package/src/store/form-builder/form-builder.actions.ts +0 -113
  29. package/src/store/form-builder/form-builder.facade.ts +0 -207
  30. package/src/store/form-builder/form-builder.model.ts +0 -147
  31. package/src/store/form-builder/form-builder.state.ts +0 -668
  32. package/src/store/form-builder/index.ts +0 -5
  33. package/tsconfig.json +0 -31
@@ -1,147 +0,0 @@
1
- import type { LoadingStateShape } from '@masterteam/components';
2
-
3
- // ============================================================================
4
- // Action Keys Enum
5
- // ============================================================================
6
- export enum FormBuilderActionKey {
7
- // Form Configuration
8
- GetFormConfiguration = 'getFormConfiguration',
9
- ResetFormConfiguration = 'resetFormConfiguration',
10
-
11
- // Section CRUD
12
- AddSection = 'addSection',
13
- UpdateSection = 'updateSection',
14
- DeleteSection = 'deleteSection',
15
-
16
- // Field CRUD
17
- AddField = 'addField',
18
- UpdateField = 'updateField',
19
- DeleteField = 'deleteField',
20
- MoveField = 'moveField',
21
- ReorderFields = 'reorderFields',
22
- }
23
-
24
- // ============================================================================
25
- // API Models
26
- // ============================================================================
27
-
28
- export type FieldWidth = '25' | '50' | '100';
29
-
30
- export interface FormField {
31
- id: string;
32
- sectionId: string;
33
- propertyId: number;
34
- width: FieldWidth;
35
- order: number;
36
- hiddenInCreation?: boolean;
37
- hiddenInEditForm?: boolean;
38
- isRequired?: boolean;
39
- showConditionalDisplayFormula?: boolean;
40
- conditionalDisplayFormula?: string;
41
- _pending?: boolean; // Optimistic: field is being added
42
- _deleting?: boolean; // Optimistic: field is being deleted
43
- }
44
-
45
- export interface FormSection {
46
- id: string;
47
- name: {
48
- en: string;
49
- ar: string;
50
- };
51
- order: number;
52
- fields: FormField[];
53
- }
54
-
55
- export interface FormConfiguration {
56
- isActive: boolean;
57
- sections: FormSection[];
58
- }
59
-
60
- // ============================================================================
61
- // Request Payloads
62
- // ============================================================================
63
-
64
- export interface AddSectionPayload {
65
- name: { en: string; ar: string };
66
- order?: number;
67
- }
68
-
69
- export interface UpdateSectionPayload {
70
- name?: { en: string; ar: string };
71
- order?: number;
72
- }
73
-
74
- export interface AddFieldPayload {
75
- propertyId: number;
76
- width: FieldWidth;
77
- order?: number;
78
- hiddenInCreation?: boolean;
79
- hiddenInEditForm?: boolean;
80
- isRequired?: boolean;
81
- showConditionalDisplayFormula?: boolean;
82
- conditionalDisplayFormula?: string;
83
- }
84
-
85
- export interface UpdateFieldPayload {
86
- width?: FieldWidth;
87
- order?: number;
88
- hiddenInCreation?: boolean;
89
- hiddenInEditForm?: boolean;
90
- isRequired?: boolean;
91
- showConditionalDisplayFormula?: boolean;
92
- conditionalDisplayFormula?: string | null;
93
- }
94
-
95
- export interface MoveFieldPayload {
96
- targetSectionId: string;
97
- order?: number;
98
- }
99
-
100
- export interface ReorderFieldPayload {
101
- id: string;
102
- order: number;
103
- }
104
-
105
- // ============================================================================
106
- // Property Item (for enrichment)
107
- // ============================================================================
108
- export interface PropertyItem {
109
- id: number;
110
- name: string | Record<string, string>;
111
- viewType?: string;
112
- [key: string]: any;
113
- }
114
-
115
- // ============================================================================
116
- // Enriched Types (for UI display)
117
- // ============================================================================
118
-
119
- // Enriched field with UI properties (from PropertyItem)
120
- export interface EnrichedFormField extends FormField {
121
- name: string;
122
- type: string;
123
- data?: any;
124
- }
125
-
126
- // Enriched section for UI display
127
- export interface EnrichedFormSection extends Omit<FormSection, 'fields'> {
128
- fields: EnrichedFormField[];
129
- }
130
-
131
- // ============================================================================
132
- // State Model
133
- // ============================================================================
134
- export interface FormBuilderStateModel extends LoadingStateShape<FormBuilderActionKey> {
135
- // Module configuration
136
- moduleType: string | null;
137
- moduleId: string | number | null;
138
- parentModuleType: string | null;
139
- parentModuleId: string | number | null;
140
- parentPath: string;
141
-
142
- // Form data
143
- formConfiguration: FormConfiguration | null;
144
-
145
- // Properties for field enrichment
146
- properties: PropertyItem[];
147
- }