@yourself.create/ngx-form-designer 0.0.12 → 0.0.14

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.
@@ -24,8 +24,11 @@ export declare class FormEventRunner {
24
24
  constructor(engine: FormEngine, loggerOrOptions?: FormEventLogger | FormEventRunnerOptions);
25
25
  dispose(): void;
26
26
  private handleEvent;
27
+ private clearInactiveApiBindingDatasources;
27
28
  private executeAction;
28
29
  private handleSetValue;
30
+ private handleClearFields;
31
+ private applyFieldValue;
29
32
  private handleApiAction;
30
33
  private handleNavigateAction;
31
34
  private evaluateNavigateCondition;
@@ -39,4 +42,5 @@ export declare class FormEventRunner {
39
42
  private collectSourceValues;
40
43
  private resolveDatasourceId;
41
44
  private normalizeRowsForDatasource;
45
+ private isEmptyEventValue;
42
46
  }
@@ -11,7 +11,7 @@ export interface Html5ValidationProps {
11
11
  pattern?: string;
12
12
  }
13
13
  export type LogicOperator = 'AND' | 'OR';
14
- export type ConditionOperator = 'eq' | 'neq' | 'gt' | 'lt' | 'gte' | 'lte' | 'contains' | 'startsWith' | 'endsWith' | 'empty' | 'notEmpty' | 'truthy';
14
+ export type ConditionOperator = 'eq' | 'neq' | 'gt' | 'lt' | 'gte' | 'lte' | 'contains' | 'startsWith' | 'endsWith' | 'empty' | 'notEmpty' | 'truthy' | 'notTruthy';
15
15
  export type ConditionValueSource = 'literal' | 'field';
16
16
  export type RuleAction = 'visible' | 'hidden' | 'enable' | 'disable' | 'required' | 'optional';
17
17
  export type RuleSeverity = 'error' | 'warn';
@@ -173,6 +173,10 @@ export interface WidgetEventActionSetValue {
173
173
  valueLiteral?: unknown;
174
174
  sourceFieldId?: string;
175
175
  }
176
+ export interface WidgetEventActionClearFields {
177
+ type: 'clearFields';
178
+ targetFieldIds: string[];
179
+ }
176
180
  export interface WidgetEventActionLog {
177
181
  type: 'log';
178
182
  message?: string;
@@ -192,7 +196,7 @@ export interface WidgetEventActionNavigate {
192
196
  targetPageId: string;
193
197
  when?: LogicGroup;
194
198
  }
195
- export type WidgetEventAction = WidgetEventActionSetValue | WidgetEventActionLog | WidgetEventActionApi | WidgetEventActionNavigate;
199
+ export type WidgetEventAction = WidgetEventActionSetValue | WidgetEventActionClearFields | WidgetEventActionLog | WidgetEventActionApi | WidgetEventActionNavigate;
196
200
  export interface WidgetEventApiExecutionRequest {
197
201
  eventId: string;
198
202
  action: WidgetEventActionApi;
@@ -62,7 +62,7 @@ export declare class DesignerStateService {
62
62
  readonly activeBreakpoint: import("@angular/core").WritableSignal<"xs" | "sm" | "md" | "lg" | "xl" | "2xl">;
63
63
  readonly isPreviewMode: import("@angular/core").WritableSignal<boolean>;
64
64
  readonly isLeftPanelCollapsed: import("@angular/core").WritableSignal<boolean>;
65
- readonly activeDevice: import("@angular/core").Signal<"desktop" | "mobile">;
65
+ readonly activeDevice: import("@angular/core").Signal<"mobile" | "desktop">;
66
66
  readonly activeThemeId: import("@angular/core").WritableSignal<string>;
67
67
  readonly isReadOnly: import("@angular/core").WritableSignal<boolean>;
68
68
  readonly clipboard: import("@angular/core").WritableSignal<{
@@ -218,6 +218,8 @@ export declare class DesignerStateService {
218
218
  private sameScope;
219
219
  private isScopePrefix;
220
220
  private cloneValue;
221
+ private cloneFieldForDuplication;
222
+ private createEventDatasourceId;
221
223
  private clampIndex;
222
224
  private isLayoutNode;
223
225
  private detachNode;
@@ -1,4 +1,4 @@
1
- import { ConditionOperator, DesignerEventApiBrowser, DesignerEventApiDefinition, EventsWorkspaceSavePayload, FieldSchema, FormSchema, LogicGroup, WidgetEventAction, WidgetEventActionApi, WidgetEventActionLog, WidgetEventActionNavigate, WidgetEventActionSetValue, WidgetEventBinding, WidgetEventType } from '../form-core/models';
1
+ import { ConditionOperator, DesignerEventApiBrowser, DesignerEventApiDefinition, EventsWorkspaceSavePayload, FieldSchema, FormSchema, LogicGroup, WidgetEventAction, WidgetEventActionApi, WidgetEventActionClearFields, WidgetEventActionLog, WidgetEventActionNavigate, WidgetEventActionSetValue, WidgetEventBinding, WidgetEventType } from '../form-core/models';
2
2
  import * as i0 from "@angular/core";
3
3
  type WorkspaceTab = 'fields' | 'input' | 'output';
4
4
  interface WorkspaceFieldItem {
@@ -89,7 +89,7 @@ export declare class EventsWorkspaceComponent {
89
89
  removeAction(bindingIndex: number, actionIndex: number): void;
90
90
  setActionType(action: WidgetEventAction, type: WidgetEventAction['type']): void;
91
91
  updateActionType(bindingIndex: number, actionIndex: number, type: WidgetEventAction['type']): void;
92
- patchAction(bindingIndex: number, actionIndex: number, patch: Partial<WidgetEventActionSetValue> | Partial<WidgetEventActionLog> | Partial<WidgetEventActionApi> | Partial<WidgetEventActionNavigate>): void;
92
+ patchAction(bindingIndex: number, actionIndex: number, patch: Partial<WidgetEventActionSetValue> | Partial<WidgetEventActionClearFields> | Partial<WidgetEventActionLog> | Partial<WidgetEventActionApi> | Partial<WidgetEventActionNavigate>): void;
93
93
  patchApiAction(action: WidgetEventAction, patch: Partial<WidgetEventActionApi>): void;
94
94
  getSelectableActionFields(action: WidgetEventAction): WorkspaceFieldItem[];
95
95
  actionFieldSearch(action: WidgetEventAction): string;
@@ -114,6 +114,7 @@ export declare class EventsWorkspaceComponent {
114
114
  selectApiOption(action: WidgetEventAction, api: DesignerEventApiDefinition): Promise<void>;
115
115
  saveEventConfig(): void;
116
116
  asSetValue(action: WidgetEventAction): WidgetEventActionSetValue;
117
+ asClearFields(action: WidgetEventAction): WidgetEventActionClearFields;
117
118
  asLog(action: WidgetEventAction): WidgetEventActionLog;
118
119
  asApi(action: WidgetEventAction): WidgetEventActionApi;
119
120
  asNavigate(action: WidgetEventAction): WidgetEventActionNavigate;
@@ -134,6 +135,8 @@ export declare class EventsWorkspaceComponent {
134
135
  trackActionByIndex(index: number): number;
135
136
  trackApiOption(_: number, api: DesignerEventApiDefinition): string;
136
137
  hasApiAction(binding: WidgetEventBinding): boolean;
138
+ isClearFieldSelected(action: WidgetEventActionClearFields, fieldId: string): boolean;
139
+ toggleClearFieldTarget(action: WidgetEventAction, fieldId: string, selected: boolean): void;
137
140
  canSelectApiAction(binding: WidgetEventBinding, actionIndex: number): boolean;
138
141
  isEventExpanded(bindingId: string): boolean;
139
142
  toggleEventExpansion(bindingId: string): void;
@@ -21,7 +21,7 @@ export declare class FormPreviewComponent {
21
21
  pageSelect: EventEmitter<string>;
22
22
  breakpoints: readonly ["xs", "sm", "md", "lg", "xl", "2xl"];
23
23
  breakpoint: import("@angular/core").WritableSignal<"xs" | "sm" | "md" | "lg" | "xl" | "2xl">;
24
- activeDevice: import("@angular/core").Signal<"desktop" | "mobile">;
24
+ activeDevice: import("@angular/core").Signal<"mobile" | "desktop">;
25
25
  formData: any;
26
26
  combinedFormData: any;
27
27
  constructor(state: DesignerStateService);
@@ -13,7 +13,7 @@ export declare class LayoutCanvasComponent implements AfterViewInit {
13
13
  breakpoints: readonly ["xs", "sm", "md", "lg", "xl", "2xl"];
14
14
  constructor(state: DesignerStateService);
15
15
  get schema(): import("@angular/core").WritableSignal<import("@uch-web/ngx-form-designer").FormSchema>;
16
- get device(): "desktop" | "mobile";
16
+ get device(): "mobile" | "desktop";
17
17
  get breakpoint(): "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
18
18
  readonly zoom: import("@angular/core").WritableSignal<number>;
19
19
  readonly showLayoutGuides: import("@angular/core").WritableSignal<boolean>;
@@ -17,7 +17,7 @@ export declare class WidgetInspectorComponent {
17
17
  private readonly readOnlyFieldSnapshot;
18
18
  readonly inspectorField: import("@angular/core").Signal<FieldSchema>;
19
19
  currentStyle: import("@angular/core").Signal<Partial<StyleTokenSet>>;
20
- dataConsumer: import("@angular/core").Signal<"value" | "image" | "list" | "none">;
20
+ dataConsumer: import("@angular/core").Signal<"image" | "value" | "none" | "list">;
21
21
  bindingShape: import("@angular/core").Signal<import("@uch-web/ngx-form-designer").DataShape | null>;
22
22
  dataTargetPath: import("@angular/core").Signal<string>;
23
23
  getWidgetIcon(): string;
@@ -17,6 +17,7 @@ export declare class FormJourneyViewerComponent {
17
17
  fieldDataAccessApi?: RuntimeFieldDataAccessApi;
18
18
  formContentId?: string;
19
19
  formContentVersion?: string;
20
+ refreshKey?: unknown;
20
21
  formDataChange: EventEmitter<FormValueMap>;
21
22
  formDataByPageChange: EventEmitter<JourneyFormDataByPage>;
22
23
  formValidationChange: EventEmitter<FormValidationResult>;
@@ -41,6 +42,7 @@ export declare class FormJourneyViewerComponent {
41
42
  onSubmit(result: FormSubmitResult): void;
42
43
  private normalizeInitialValues;
43
44
  private normalizeInitialFieldLabels;
45
+ private resetViewerState;
44
46
  private toValueScope;
45
47
  private toFieldLabelScope;
46
48
  private mergeValueScope;
@@ -48,5 +50,5 @@ export declare class FormJourneyViewerComponent {
48
50
  private toJourneyValueMapByPage;
49
51
  private flattenJourneyValueMapByPage;
50
52
  static ɵfac: i0.ɵɵFactoryDeclaration<FormJourneyViewerComponent, never>;
51
- static ɵcmp: i0.ɵɵComponentDeclaration<FormJourneyViewerComponent, "app-form-journey-viewer", never, { "journey": { "alias": "journey"; "required": true; }; "viewOnly": { "alias": "viewOnly"; "required": false; }; "severityEvaluationMode": { "alias": "severityEvaluationMode"; "required": false; }; "eventApis": { "alias": "eventApis"; "required": false; }; "eventApiExecutor": { "alias": "eventApiExecutor"; "required": false; }; "initialValues": { "alias": "initialValues"; "required": false; }; "initialFieldLabels": { "alias": "initialFieldLabels"; "required": false; }; "fieldDataAccessMap": { "alias": "fieldDataAccessMap"; "required": false; }; "fieldDataAccessApi": { "alias": "fieldDataAccessApi"; "required": false; }; "formContentId": { "alias": "formContentId"; "required": false; }; "formContentVersion": { "alias": "formContentVersion"; "required": false; }; }, { "formDataChange": "formDataChange"; "formDataByPageChange": "formDataByPageChange"; "formValidationChange": "formValidationChange"; "uploadedFilesChange": "uploadedFilesChange"; "submit": "submit"; "activePageIdChange": "activePageIdChange"; }, never, never, true, never>;
53
+ static ɵcmp: i0.ɵɵComponentDeclaration<FormJourneyViewerComponent, "app-form-journey-viewer", never, { "journey": { "alias": "journey"; "required": true; }; "viewOnly": { "alias": "viewOnly"; "required": false; }; "severityEvaluationMode": { "alias": "severityEvaluationMode"; "required": false; }; "eventApis": { "alias": "eventApis"; "required": false; }; "eventApiExecutor": { "alias": "eventApiExecutor"; "required": false; }; "initialValues": { "alias": "initialValues"; "required": false; }; "initialFieldLabels": { "alias": "initialFieldLabels"; "required": false; }; "fieldDataAccessMap": { "alias": "fieldDataAccessMap"; "required": false; }; "fieldDataAccessApi": { "alias": "fieldDataAccessApi"; "required": false; }; "formContentId": { "alias": "formContentId"; "required": false; }; "formContentVersion": { "alias": "formContentVersion"; "required": false; }; "refreshKey": { "alias": "refreshKey"; "required": false; }; }, { "formDataChange": "formDataChange"; "formDataByPageChange": "formDataByPageChange"; "formValidationChange": "formValidationChange"; "uploadedFilesChange": "uploadedFilesChange"; "submit": "submit"; "activePageIdChange": "activePageIdChange"; }, never, never, true, never>;
52
54
  }
@@ -27,6 +27,7 @@ export declare class FormViewerComponent implements OnInit, OnDestroy {
27
27
  fieldDataAccessApi?: RuntimeFieldDataAccessApi;
28
28
  formContentId?: string;
29
29
  formContentVersion?: string;
30
+ refreshKey?: unknown;
30
31
  formDataChange: EventEmitter<FormValueMap>;
31
32
  formDataByPageChange: EventEmitter<JourneyFormDataByPage>;
32
33
  formValidationChange: EventEmitter<FormValidationResult>;
@@ -75,5 +76,5 @@ export declare class FormViewerComponent implements OnInit, OnDestroy {
75
76
  private isFieldIdValue;
76
77
  private isRecord;
77
78
  static ɵfac: i0.ɵɵFactoryDeclaration<FormViewerComponent, never>;
78
- static ɵcmp: i0.ɵɵComponentDeclaration<FormViewerComponent, "app-form-viewer", never, { "schema": { "alias": "schema"; "required": false; }; "journey": { "alias": "journey"; "required": false; }; "data": { "alias": "data"; "required": false; }; "dataUsesFieldNameKeys": { "alias": "dataUsesFieldNameKeys"; "required": false; }; "options": { "alias": "options"; "required": false; }; "viewOnly": { "alias": "viewOnly"; "required": false; }; "severityEvaluationMode": { "alias": "severityEvaluationMode"; "required": false; }; "eventApis": { "alias": "eventApis"; "required": false; }; "eventApiExecutor": { "alias": "eventApiExecutor"; "required": false; }; "fieldDataAccessMap": { "alias": "fieldDataAccessMap"; "required": false; }; "fieldDataAccessApi": { "alias": "fieldDataAccessApi"; "required": false; }; "formContentId": { "alias": "formContentId"; "required": false; }; "formContentVersion": { "alias": "formContentVersion"; "required": false; }; }, { "formDataChange": "formDataChange"; "formDataByPageChange": "formDataByPageChange"; "formValidationChange": "formValidationChange"; "uploadedFilesChange": "uploadedFilesChange"; "submit": "submit"; "activePageIdChange": "activePageIdChange"; }, never, never, true, never>;
79
+ static ɵcmp: i0.ɵɵComponentDeclaration<FormViewerComponent, "app-form-viewer", never, { "schema": { "alias": "schema"; "required": false; }; "journey": { "alias": "journey"; "required": false; }; "data": { "alias": "data"; "required": false; }; "dataUsesFieldNameKeys": { "alias": "dataUsesFieldNameKeys"; "required": false; }; "options": { "alias": "options"; "required": false; }; "viewOnly": { "alias": "viewOnly"; "required": false; }; "severityEvaluationMode": { "alias": "severityEvaluationMode"; "required": false; }; "eventApis": { "alias": "eventApis"; "required": false; }; "eventApiExecutor": { "alias": "eventApiExecutor"; "required": false; }; "fieldDataAccessMap": { "alias": "fieldDataAccessMap"; "required": false; }; "fieldDataAccessApi": { "alias": "fieldDataAccessApi"; "required": false; }; "formContentId": { "alias": "formContentId"; "required": false; }; "formContentVersion": { "alias": "formContentVersion"; "required": false; }; "refreshKey": { "alias": "refreshKey"; "required": false; }; }, { "formDataChange": "formDataChange"; "formDataByPageChange": "formDataByPageChange"; "formValidationChange": "formValidationChange"; "uploadedFilesChange": "uploadedFilesChange"; "submit": "submit"; "activePageIdChange": "activePageIdChange"; }, never, never, true, never>;
79
80
  }
@@ -75,6 +75,7 @@ export declare class JsonFormRendererComponent implements OnInit, OnChanges, OnD
75
75
  fieldDataAccessApi?: RuntimeFieldDataAccessApi;
76
76
  formContentId?: string;
77
77
  formContentVersion?: string;
78
+ refreshKey?: unknown;
78
79
  valueChange: EventEmitter<FormValueMap>;
79
80
  groupedValueChange: EventEmitter<GroupedFormValues>;
80
81
  combinedValueChange: EventEmitter<CombinedFormValues>;
@@ -140,5 +141,5 @@ export declare class JsonFormRendererComponent implements OnInit, OnChanges, OnD
140
141
  private isGroupValue;
141
142
  private isUploadedFileRef;
142
143
  static ɵfac: i0.ɵɵFactoryDeclaration<JsonFormRendererComponent, never>;
143
- static ɵcmp: i0.ɵɵComponentDeclaration<JsonFormRendererComponent, "app-json-form-renderer", never, { "schema": { "alias": "schema"; "required": false; }; "initialValues": { "alias": "initialValues"; "required": false; }; "initialFieldLabels": { "alias": "initialFieldLabels"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; "device": { "alias": "device"; "required": false; }; "showLayoutGuides": { "alias": "showLayoutGuides"; "required": false; }; "breakpoint": { "alias": "breakpoint"; "required": false; }; "eventLogger": { "alias": "eventLogger"; "required": false; }; "eventApis": { "alias": "eventApis"; "required": false; }; "eventApiExecutor": { "alias": "eventApiExecutor"; "required": false; }; "navigateToPage": { "alias": "navigateToPage"; "required": false; }; "uploadOnSubmit": { "alias": "uploadOnSubmit"; "required": false; }; "severityEvaluationMode": { "alias": "severityEvaluationMode"; "required": false; }; "fieldDataAccessMap": { "alias": "fieldDataAccessMap"; "required": false; }; "fieldDataAccessApi": { "alias": "fieldDataAccessApi"; "required": false; }; "formContentId": { "alias": "formContentId"; "required": false; }; "formContentVersion": { "alias": "formContentVersion"; "required": false; }; }, { "valueChange": "valueChange"; "groupedValueChange": "groupedValueChange"; "combinedValueChange": "combinedValueChange"; "validationChange": "validationChange"; "uploadedFilesChange": "uploadedFilesChange"; "formSubmit": "formSubmit"; }, never, never, true, never>;
144
+ static ɵcmp: i0.ɵɵComponentDeclaration<JsonFormRendererComponent, "app-json-form-renderer", never, { "schema": { "alias": "schema"; "required": false; }; "initialValues": { "alias": "initialValues"; "required": false; }; "initialFieldLabels": { "alias": "initialFieldLabels"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; "device": { "alias": "device"; "required": false; }; "showLayoutGuides": { "alias": "showLayoutGuides"; "required": false; }; "breakpoint": { "alias": "breakpoint"; "required": false; }; "eventLogger": { "alias": "eventLogger"; "required": false; }; "eventApis": { "alias": "eventApis"; "required": false; }; "eventApiExecutor": { "alias": "eventApiExecutor"; "required": false; }; "navigateToPage": { "alias": "navigateToPage"; "required": false; }; "uploadOnSubmit": { "alias": "uploadOnSubmit"; "required": false; }; "severityEvaluationMode": { "alias": "severityEvaluationMode"; "required": false; }; "fieldDataAccessMap": { "alias": "fieldDataAccessMap"; "required": false; }; "fieldDataAccessApi": { "alias": "fieldDataAccessApi"; "required": false; }; "formContentId": { "alias": "formContentId"; "required": false; }; "formContentVersion": { "alias": "formContentVersion"; "required": false; }; "refreshKey": { "alias": "refreshKey"; "required": false; }; }, { "valueChange": "valueChange"; "groupedValueChange": "groupedValueChange"; "combinedValueChange": "combinedValueChange"; "validationChange": "validationChange"; "uploadedFilesChange": "uploadedFilesChange"; "formSubmit": "formSubmit"; }, never, never, true, never>;
144
145
  }
@@ -6,7 +6,7 @@ export declare class WebsitePreviewShellComponent {
6
6
  readonly pages: import("@angular/core").Signal<import("@uch-web/ngx-form-designer").WebsitePage[]>;
7
7
  readonly breakpoints: readonly ["xs", "sm", "md", "lg", "xl", "2xl"];
8
8
  readonly breakpoint: import("@angular/core").WritableSignal<"xs" | "sm" | "md" | "lg" | "xl" | "2xl">;
9
- readonly activeDevice: import("@angular/core").Signal<"desktop" | "mobile">;
9
+ readonly activeDevice: import("@angular/core").Signal<"mobile" | "desktop">;
10
10
  private readonly url;
11
11
  readonly activePage: import("@angular/core").Signal<import("@uch-web/ngx-form-designer").WebsitePage | null>;
12
12
  setBreakpoint(bp: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'): void;
@@ -53,7 +53,9 @@ export declare class TextFieldWidgetComponent implements OnInit, OnDestroy {
53
53
  get error(): string | null;
54
54
  private syncEnabledState;
55
55
  private refreshValueFromDataSource;
56
+ private hasResolvedRows;
56
57
  private clearResolvedValue;
58
+ private applyResolvedValue;
57
59
  private hasSelectedRowMatch;
58
60
  private getDataConfigSignature;
59
61
  private seedDependencySnapshotFromEngine;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yourself.create/ngx-form-designer",
3
- "version": "0.0.12",
3
+ "version": "0.0.14",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^19.0.0",
6
6
  "@angular/core": "^19.0.0",