@masterteam/form-builder 0.0.7 → 0.0.8
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.
|
|
3
|
+
"version": "0.0.8",
|
|
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.
|
|
23
|
-
"@masterteam/components": "^0.0.81",
|
|
22
|
+
"@masterteam/properties": "^0.0.30",
|
|
24
23
|
"@masterteam/forms": "^0.0.35",
|
|
25
|
-
"@masterteam/
|
|
24
|
+
"@masterteam/components": "^0.0.86",
|
|
25
|
+
"@masterteam/icons": "^0.0.13"
|
|
26
26
|
},
|
|
27
27
|
"sideEffects": false,
|
|
28
28
|
"exports": {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import * as _masterteam_form_builder from '@masterteam/form-builder';
|
|
2
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { OnInit } from '@angular/core';
|
|
3
|
+
import * as _masterteam_form_builder from '@masterteam/form-builder';
|
|
3
4
|
import { LoadingStateShape, CrudStateBase, Response as Response$1 } from '@masterteam/components';
|
|
4
5
|
import { CdkDragDrop } from '@angular/cdk/drag-drop';
|
|
5
6
|
import * as rxjs from 'rxjs';
|
|
@@ -25,7 +26,8 @@ type FieldWidth = '25' | '50' | '100';
|
|
|
25
26
|
interface FormField {
|
|
26
27
|
id: string;
|
|
27
28
|
sectionId: string;
|
|
28
|
-
|
|
29
|
+
propertyKey: string;
|
|
30
|
+
property?: PropertyItem;
|
|
29
31
|
width: FieldWidth;
|
|
30
32
|
order: number;
|
|
31
33
|
hiddenInCreation?: boolean;
|
|
@@ -77,7 +79,7 @@ interface UpdateSectionPayload {
|
|
|
77
79
|
order?: number;
|
|
78
80
|
}
|
|
79
81
|
interface AddFieldPayload {
|
|
80
|
-
|
|
82
|
+
propertyKey: string;
|
|
81
83
|
width: FieldWidth;
|
|
82
84
|
order?: number;
|
|
83
85
|
hiddenInCreation?: boolean;
|
|
@@ -125,7 +127,8 @@ interface ToggleValidationPayload {
|
|
|
125
127
|
enabled: boolean;
|
|
126
128
|
}
|
|
127
129
|
interface PropertyItem {
|
|
128
|
-
|
|
130
|
+
key: string;
|
|
131
|
+
propertyId?: number;
|
|
129
132
|
name: string | Record<string, string>;
|
|
130
133
|
viewType?: string;
|
|
131
134
|
[key: string]: any;
|
|
@@ -157,6 +160,9 @@ declare class FormBuilderFacade {
|
|
|
157
160
|
readonly validations: _angular_core.Signal<_masterteam_form_builder.ValidationRule[]>;
|
|
158
161
|
readonly moduleType: _angular_core.Signal<string | null>;
|
|
159
162
|
readonly moduleId: _angular_core.Signal<string | number | null>;
|
|
163
|
+
readonly parentModuleType: _angular_core.Signal<string | null>;
|
|
164
|
+
readonly parentModuleId: _angular_core.Signal<string | number | null>;
|
|
165
|
+
readonly parentPath: _angular_core.Signal<string>;
|
|
160
166
|
readonly isLoadingFormConfiguration: _angular_core.Signal<boolean>;
|
|
161
167
|
readonly isResettingFormConfiguration: _angular_core.Signal<boolean>;
|
|
162
168
|
readonly isAddingSection: _angular_core.Signal<boolean>;
|
|
@@ -195,31 +201,103 @@ declare class FormBuilderFacade {
|
|
|
195
201
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<FormBuilderFacade>;
|
|
196
202
|
}
|
|
197
203
|
|
|
198
|
-
|
|
204
|
+
type ScopeKey = 'Current' | 'Host' | 'Parent' | 'Ancestors' | 'Children' | 'Descendants' | 'Related' | 'Siblings';
|
|
205
|
+
type PathToken = Exclude<ScopeKey, 'Current'>;
|
|
206
|
+
interface ContextOption {
|
|
207
|
+
contextKey: string;
|
|
208
|
+
label: string;
|
|
209
|
+
}
|
|
210
|
+
interface PathSegment {
|
|
211
|
+
token: PathToken;
|
|
212
|
+
value: string;
|
|
213
|
+
label: string;
|
|
214
|
+
}
|
|
215
|
+
declare class FormBuilder implements OnInit {
|
|
199
216
|
private readonly modalService;
|
|
200
217
|
private readonly confirmationService;
|
|
201
218
|
private readonly translocoService;
|
|
202
219
|
protected readonly facade: FormBuilderFacade;
|
|
220
|
+
private readonly contextService;
|
|
221
|
+
private readonly popovers;
|
|
203
222
|
private dialogRef;
|
|
204
|
-
readonly activeTab: _angular_core.WritableSignal<string>;
|
|
205
|
-
readonly searchQuery: _angular_core.WritableSignal<string>;
|
|
206
223
|
readonly sections: _angular_core.Signal<_masterteam_form_builder.FormSection[]>;
|
|
207
224
|
readonly properties: _angular_core.Signal<PropertyItem[]>;
|
|
208
225
|
readonly isLoading: _angular_core.Signal<boolean>;
|
|
209
226
|
readonly error: _angular_core.Signal<string | null>;
|
|
227
|
+
readonly moduleType: _angular_core.Signal<string | null>;
|
|
228
|
+
readonly moduleId: _angular_core.Signal<string | number | null>;
|
|
229
|
+
readonly parentPath: _angular_core.Signal<string>;
|
|
230
|
+
readonly activeScope: _angular_core.WritableSignal<ScopeKey>;
|
|
231
|
+
readonly searchQuery: _angular_core.WritableSignal<string>;
|
|
232
|
+
readonly isContextLoading: _angular_core.WritableSignal<boolean>;
|
|
233
|
+
private readonly initialContext;
|
|
234
|
+
private readonly currentProperties;
|
|
235
|
+
readonly scopeLoading: _angular_core.WritableSignal<boolean>;
|
|
236
|
+
readonly scopeProperties: _angular_core.WritableSignal<PropertyItem[]>;
|
|
237
|
+
readonly scopePath: _angular_core.WritableSignal<PathSegment[]>;
|
|
238
|
+
readonly scopeSelectedKey: _angular_core.WritableSignal<string>;
|
|
239
|
+
private scopeNavigation;
|
|
240
|
+
private initialRequestId;
|
|
241
|
+
private scopeRequestId;
|
|
242
|
+
private lastContextKey;
|
|
243
|
+
private readonly contextKey;
|
|
244
|
+
private readonly usedPropertyKeys;
|
|
210
245
|
private readonly propertiesMap;
|
|
211
|
-
|
|
212
|
-
readonly
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
readonly filteredPropertiesByTab: _angular_core.Signal<{
|
|
218
|
-
id: string;
|
|
219
|
-
title: string;
|
|
220
|
-
properties: PropertyItem[];
|
|
246
|
+
/** Navigation options from initial context */
|
|
247
|
+
readonly baseScopeContexts: _angular_core.Signal<Record<ScopeKey, ContextOption[]>>;
|
|
248
|
+
/** Available scope tabs */
|
|
249
|
+
readonly scopeOptions: _angular_core.Signal<{
|
|
250
|
+
key: ScopeKey;
|
|
251
|
+
label: string;
|
|
221
252
|
}[]>;
|
|
253
|
+
/** Enriched sections for display */
|
|
254
|
+
readonly enrichedSections: _angular_core.Signal<EnrichedFormSection[]>;
|
|
222
255
|
constructor();
|
|
256
|
+
ngOnInit(): void;
|
|
257
|
+
private loadInitialContext;
|
|
258
|
+
onScopeChange(scope: ScopeKey): void;
|
|
259
|
+
private loadScopeContext;
|
|
260
|
+
private resetScopeState;
|
|
261
|
+
getScopeBaseContexts(scope: ScopeKey): ContextOption[];
|
|
262
|
+
/** Template calls this with scope.key */
|
|
263
|
+
getScopePath(_scope?: ScopeKey): PathSegment[];
|
|
264
|
+
getTokenLabel(token: PathToken): string;
|
|
265
|
+
getScopeSegmentLabel(_scope: ScopeKey, index: number): string;
|
|
266
|
+
getScopeSegmentOptions(_scope: ScopeKey, index: number): ContextOption[];
|
|
267
|
+
setScopeSegmentValue(_scope: ScopeKey, index: number, contextKey: string, label?: string): void;
|
|
268
|
+
private findOptionLabel;
|
|
269
|
+
/** Template handler: hide popover first, then set value (like formula-builder) */
|
|
270
|
+
onSetScopeSegmentValue(scope: ScopeKey, index: number, contextKey: string, popover: {
|
|
271
|
+
hide: () => void;
|
|
272
|
+
}): void;
|
|
273
|
+
addScopeSegment(_scope: ScopeKey, token: PathToken): void;
|
|
274
|
+
/** Template handler: hide popover first, then add segment (like formula-builder) */
|
|
275
|
+
onAddScopeSegment(scope: ScopeKey, token: PathToken, popover: {
|
|
276
|
+
hide: () => void;
|
|
277
|
+
}): void;
|
|
278
|
+
getScopeNextTokens(_scope?: ScopeKey): PathToken[];
|
|
279
|
+
canAddNextScopeSegment(_scope?: ScopeKey): boolean;
|
|
280
|
+
canRemoveScopePath(_scope?: ScopeKey): boolean;
|
|
281
|
+
removeScopePath(_scope?: ScopeKey): void;
|
|
282
|
+
/** Template-compatible version (returns properties array for the scope) */
|
|
283
|
+
getScopeProperties(_scope?: ScopeKey): PropertyItem[];
|
|
284
|
+
getScopePropertyOptions(_scope?: ScopeKey): Array<{
|
|
285
|
+
key: string;
|
|
286
|
+
name: string;
|
|
287
|
+
}>;
|
|
288
|
+
getScopeSelectedPropertyKey(_scope?: ScopeKey): string;
|
|
289
|
+
setScopeSelectedProperty(_scope: ScopeKey, key: string): void;
|
|
290
|
+
getScopeSelectedProperty(_scope?: ScopeKey): PropertyItem | null;
|
|
291
|
+
getFilteredProperties(_scope?: ScopeKey): PropertyItem[];
|
|
292
|
+
isScopePropertiesLoading(_scope?: ScopeKey): boolean;
|
|
293
|
+
getPropertyLabel(property: PropertyItem): string;
|
|
294
|
+
private hideAllPopovers;
|
|
295
|
+
private getNavigationOptionsByToken;
|
|
296
|
+
private resolvePropertyName;
|
|
297
|
+
private createContextOption;
|
|
298
|
+
private formatContextLabel;
|
|
299
|
+
private formatContextKey;
|
|
300
|
+
private mergeContextOptions;
|
|
223
301
|
drop(event: CdkDragDrop<EnrichedFormField[] | PropertyItem[]>): void;
|
|
224
302
|
addSection(): void;
|
|
225
303
|
openPreview(): void;
|
|
@@ -347,6 +425,9 @@ declare class FormBuilderState extends CrudStateBase<FormSection, FormBuilderSta
|
|
|
347
425
|
static getSections(state: FormBuilderStateModel): FormSection[];
|
|
348
426
|
static getModuleType(state: FormBuilderStateModel): string | null;
|
|
349
427
|
static getModuleId(state: FormBuilderStateModel): string | number | null;
|
|
428
|
+
static getParentModuleType(state: FormBuilderStateModel): string | null;
|
|
429
|
+
static getParentModuleId(state: FormBuilderStateModel): string | number | null;
|
|
430
|
+
static getParentPath(state: FormBuilderStateModel): string;
|
|
350
431
|
static getProperties(state: FormBuilderStateModel): _masterteam_form_builder.PropertyItem[];
|
|
351
432
|
static getValidations(state: FormBuilderStateModel): ValidationRule[];
|
|
352
433
|
setModuleInfo(ctx: StateContext<FormBuilderStateModel>, action: SetModuleInfo): void;
|