@yourself.create/ngx-form-designer 0.0.4 → 0.0.5

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.
@@ -114,12 +114,9 @@ export interface FieldSchema {
114
114
  appearance?: 'outline' | 'fill' | 'standard';
115
115
  readonly?: boolean;
116
116
  disabled?: boolean;
117
- prefixIcon?: string;
118
- suffixIcon?: string;
119
117
  html5?: Html5ValidationProps;
120
118
  validation?: ValidationRule[];
121
119
  dependencies?: DependencyRule[];
122
- conditionalVisibility?: ConditionalVisibility;
123
120
  rules?: FormRule[];
124
121
  dataConfig?: DataSourceConfig;
125
122
  events?: WidgetEventBinding[];
@@ -285,11 +282,6 @@ export interface DataDependencyBinding {
285
282
  fieldId: string;
286
283
  paramKey: string;
287
284
  }
288
- export interface ConditionalVisibility {
289
- fieldName: string;
290
- operator: 'equals' | 'notEquals' | 'contains' | 'isEmpty' | 'isNotEmpty' | 'greaterThan' | 'lessThan';
291
- value?: unknown;
292
- }
293
285
  export interface OptionSchema {
294
286
  label: string;
295
287
  value: string | number;
@@ -365,7 +357,4 @@ export interface FormSchema {
365
357
  fields: FieldSchema[];
366
358
  layout: LayoutNode;
367
359
  ui?: FormUIConfig;
368
- submitButtonText?: string;
369
- resetButtonText?: string;
370
- showResetButton?: boolean;
371
360
  }
@@ -30,6 +30,7 @@ export interface DesignerFieldMoveOptions {
30
30
  position?: 'before' | 'after';
31
31
  index?: number;
32
32
  }
33
+ type RelativeInsertPosition = 'before' | 'after';
33
34
  interface DragDropEventLike {
34
35
  previousContainer: unknown;
35
36
  container: unknown;
@@ -61,7 +62,7 @@ export declare class DesignerStateService {
61
62
  readonly activeBreakpoint: import("@angular/core").WritableSignal<"xs" | "sm" | "md" | "lg" | "xl" | "2xl">;
62
63
  readonly isPreviewMode: import("@angular/core").WritableSignal<boolean>;
63
64
  readonly isLeftPanelCollapsed: import("@angular/core").WritableSignal<boolean>;
64
- readonly activeDevice: import("@angular/core").Signal<"desktop" | "mobile">;
65
+ readonly activeDevice: import("@angular/core").Signal<"mobile" | "desktop">;
65
66
  readonly activeThemeId: import("@angular/core").WritableSignal<string>;
66
67
  readonly isReadOnly: import("@angular/core").WritableSignal<boolean>;
67
68
  readonly clipboard: import("@angular/core").WritableSignal<{
@@ -69,6 +70,10 @@ export declare class DesignerStateService {
69
70
  fields: FieldSchema[];
70
71
  scopePath: string[];
71
72
  } | null>;
73
+ readonly pendingFieldInsert: import("@angular/core").WritableSignal<{
74
+ referenceFieldId: string;
75
+ position: RelativeInsertPosition;
76
+ } | null>;
72
77
  private readonly history;
73
78
  private readonly historyIndex;
74
79
  private readonly historyLength;
@@ -78,6 +83,16 @@ export declare class DesignerStateService {
78
83
  constructor();
79
84
  readonly layoutIndex: import("@angular/core").Signal<LayoutIndex>;
80
85
  readonly selectedNode: import("@angular/core").Signal<LayoutNode | null>;
86
+ readonly selectedEntry: import("@angular/core").Signal<LayoutIndexEntry | null>;
87
+ readonly selectedColumnId: import("@angular/core").Signal<string | null>;
88
+ readonly selectedRowId: import("@angular/core").Signal<string | null>;
89
+ readonly canInsertColumnBeforeSelection: import("@angular/core").Signal<boolean>;
90
+ readonly canInsertColumnAfterSelection: import("@angular/core").Signal<boolean>;
91
+ readonly canInsertRowInSelectedColumn: import("@angular/core").Signal<boolean>;
92
+ readonly canInsertRowBeforeSelection: import("@angular/core").Signal<boolean>;
93
+ readonly canInsertRowAfterSelection: import("@angular/core").Signal<boolean>;
94
+ readonly canArmFieldInsertBeforeSelection: import("@angular/core").Signal<boolean>;
95
+ readonly canArmFieldInsertAfterSelection: import("@angular/core").Signal<boolean>;
81
96
  readonly selectedField: import("@angular/core").Signal<FieldSchema | null>;
82
97
  updateSchema(schema: FormSchema): void;
83
98
  setFlavor(flavor: DesignerFlavor): void;
@@ -88,6 +103,8 @@ export declare class DesignerStateService {
88
103
  selectNode(id: string | null): void;
89
104
  toggleNodeSelection(id: string): void;
90
105
  isNodeSelected(nodeId: string): boolean;
106
+ isSelectionRowAncestor(nodeId: string): boolean;
107
+ isSelectionColumnAncestor(nodeId: string): boolean;
91
108
  composeScopedNodeId(scopePath: string[], nodeId: string): string;
92
109
  getSelectedScopeFields(): FieldSchema[];
93
110
  isSelectionInScope(scopePath: string[]): boolean;
@@ -117,6 +134,13 @@ export declare class DesignerStateService {
117
134
  private insertNodeIntoLayout;
118
135
  handleDrop(event: DragDropEventLike, targetColId: string): void;
119
136
  pushField(widgetDef: WidgetDefinition): void;
137
+ insertColumnBeforeSelection(): void;
138
+ insertColumnAfterSelection(): void;
139
+ insertRowBeforeSelection(): void;
140
+ insertRowAfterSelection(): void;
141
+ insertRowInSelectedColumn(): void;
142
+ armFieldInsertBeforeSelection(): void;
143
+ armFieldInsertAfterSelection(): void;
120
144
  insertField(options: DesignerFieldInsertOptions): DesignerFieldInsertResult | null;
121
145
  deleteFields(fieldIds: string[]): void;
122
146
  moveField(fieldId: string, options: DesignerFieldMoveOptions): boolean;
@@ -170,10 +194,19 @@ export declare class DesignerStateService {
170
194
  */
171
195
  private updateNodeInTree;
172
196
  private resolveEntry;
197
+ private findSelectionColumnEntry;
198
+ private findSelectionRowEntry;
199
+ private findAncestorEntryByType;
173
200
  private resolveSchemaAtScope;
174
201
  private findFieldByIdInScope;
175
202
  private resolveInsertionScopePath;
176
203
  private resolveTargetColumnForFieldInsert;
204
+ private resolveColumnInsertTarget;
205
+ private insertColumnRelativeToSelection;
206
+ private resolveRelativeRowInsertTarget;
207
+ private insertRowRelativeToSelection;
208
+ private armFieldInsertForSelection;
209
+ private getSelectedFieldReference;
177
210
  private resolveFieldWidgetDefinition;
178
211
  private normalizeFieldTypeAlias;
179
212
  private normalizeLookupValue;
@@ -188,6 +221,7 @@ export declare class DesignerStateService {
188
221
  private clampIndex;
189
222
  private isLayoutNode;
190
223
  private detachNode;
224
+ private pruneEmptyRows;
191
225
  private findWidgetByRefId;
192
226
  private findParentCol;
193
227
  private removeWidgetByRefId;
@@ -11,7 +11,7 @@ export declare class DynamicPropertiesComponent implements OnChanges {
11
11
  onPropertyChange?: () => void;
12
12
  private readonly designerCtx;
13
13
  protected readonly validatorTypeOptions: NativeSelectOption<string>[];
14
- protected readonly conditionalTypeOptions: NativeSelectOption<string>[];
14
+ protected readonly builtinValidatorOptions: NativeSelectOption<string>[];
15
15
  get properties(): PropertySection[];
16
16
  getFieldReferenceCandidates(field: PropertyField): FieldSchema[];
17
17
  fieldReferenceOptions(field: PropertyField): NativeSelectOption<string>[];
@@ -91,10 +91,8 @@ export declare class DynamicPropertiesComponent implements OnChanges {
91
91
  addValidator(path: string): void;
92
92
  removeValidator(path: string, index: number): void;
93
93
  updateValidator(path: string, index: number, field: string, value: any): void;
94
- getValidatorLabel(name: string): string;
95
- enableConditional(path: string): void;
96
- disableConditional(path: string): void;
97
- updateConditional(path: string, field: string, value: any): void;
94
+ private createDefaultValidationRule;
95
+ private defaultValidationMessage;
98
96
  static ɵfac: i0.ɵɵFactoryDeclaration<DynamicPropertiesComponent, never>;
99
97
  static ɵcmp: i0.ɵɵComponentDeclaration<DynamicPropertiesComponent, "app-dynamic-properties", never, { "onPropertyChange": { "alias": "onPropertyChange"; "required": false; }; "config": { "alias": "config"; "required": false; }; "readOnly": { "alias": "readOnly"; "required": false; }; "includeSections": { "alias": "includeSections"; "required": false; }; "excludeSections": { "alias": "excludeSections"; "required": false; }; "allFields": { "alias": "allFields"; "required": false; }; }, { "configChange": "configChange"; }, never, never, true, never>;
100
98
  }
@@ -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);
@@ -0,0 +1,12 @@
1
+ import { StyleTokenSet } from '../../form-core/models';
2
+ import * as i0 from "@angular/core";
3
+ type TransformKey = 'transformX' | 'transformY' | 'transformZ' | 'rotate' | 'scale';
4
+ export declare class InspectorTransformSectionComponent {
5
+ readonly style: import("@angular/core").InputSignal<Partial<StyleTokenSet>>;
6
+ readonly styleChange: import("@angular/core").OutputEmitterRef<Partial<StyleTokenSet>>;
7
+ protected numberValue(key: TransformKey, fallback: number): number;
8
+ protected updateTransform(key: TransformKey, value: unknown): void;
9
+ static ɵfac: i0.ɵɵFactoryDeclaration<InspectorTransformSectionComponent, never>;
10
+ static ɵcmp: i0.ɵɵComponentDeclaration<InspectorTransformSectionComponent, "inspector-transform-section", never, { "style": { "alias": "style"; "required": false; "isSignal": true; }; }, { "styleChange": "styleChange"; }, never, never, true, never>;
11
+ }
12
+ export {};
@@ -4,7 +4,7 @@ import * as i0 from "@angular/core";
4
4
  export declare class LayoutCanvasComponent implements AfterViewInit {
5
5
  state: DesignerStateService;
6
6
  private readonly destroyRef;
7
- readonly previewMode: import("@angular/core").InputSignal<"overlay" | "route">;
7
+ readonly previewMode: import("@angular/core").InputSignal<"route" | "overlay">;
8
8
  readonly previewRequested: import("@angular/core").OutputEmitterRef<void>;
9
9
  fileInput: ElementRef<HTMLInputElement>;
10
10
  root: ElementRef<HTMLDivElement>;
@@ -13,13 +13,14 @@ 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>;
20
20
  readonly showLiveSchemaEditor: import("@angular/core").WritableSignal<boolean>;
21
21
  readonly liveSchemaEditorText: import("@angular/core").WritableSignal<string>;
22
22
  readonly liveSchemaEditorError: import("@angular/core").WritableSignal<string>;
23
+ readonly openContextSubmenu: import("@angular/core").WritableSignal<"insert" | null>;
23
24
  readonly liveSchemaEditorOptions: Record<string, unknown>;
24
25
  private readonly pageBaseSize;
25
26
  private readonly minZoom;
@@ -35,6 +36,15 @@ export declare class LayoutCanvasComponent implements AfterViewInit {
35
36
  closeContextMenu(): void;
36
37
  groupSelected(): void;
37
38
  ungroupSelected(): void;
39
+ hasStructuralInsertActions(): boolean;
40
+ toggleInsertSubmenu(): void;
41
+ insertColumnBeforeSelection(): void;
42
+ insertColumnAfterSelection(): void;
43
+ insertRowInSelectedColumn(): void;
44
+ insertRowBeforeSelection(): void;
45
+ insertRowAfterSelection(): void;
46
+ armFieldInsertBeforeSelection(): void;
47
+ armFieldInsertAfterSelection(): void;
38
48
  onCanvasContextMenu(event: MouseEvent): void;
39
49
  cut(): void;
40
50
  copy(): void;
@@ -3,9 +3,12 @@ import { DesignerStateService } from './designer-state.service';
3
3
  import { WidgetDefinition, DataBindingContract } from '../widgets/widget-definition';
4
4
  import { WidgetNode, FieldSchema, FormRule, StyleTokenSet } from '../form-core/models';
5
5
  import * as i0 from "@angular/core";
6
+ type LayoutInspectorTab = 'Style' | 'Settings';
6
7
  export declare class PropertiesPanelComponent {
7
8
  state: DesignerStateService;
8
9
  private injector;
10
+ protected readonly layoutInspectorTabs: readonly LayoutInspectorTab[];
11
+ protected readonly activeLayoutInspectorTab: import("@angular/core").WritableSignal<LayoutInspectorTab>;
9
12
  protected readonly spacingOptions: {
10
13
  label: string;
11
14
  value: string;
@@ -79,3 +82,4 @@ export declare class PropertiesPanelComponent {
79
82
  static ɵfac: i0.ɵɵFactoryDeclaration<PropertiesPanelComponent, never>;
80
83
  static ɵcmp: i0.ɵɵComponentDeclaration<PropertiesPanelComponent, "app-properties-panel", never, {}, {}, never, never, true, never>;
81
84
  }
85
+ export {};
@@ -17,6 +17,24 @@ export type CombinedFormValues = Record<string, FormFieldValue | FormValueMap>;
17
17
  export interface FormValidationResult {
18
18
  errors: Record<string, string[]>;
19
19
  isValid: boolean;
20
+ fields?: Record<string, FormFieldValidationState>;
21
+ }
22
+ export interface FormFieldValidationState {
23
+ fieldId: string;
24
+ fieldName: string;
25
+ label?: string;
26
+ visible: boolean;
27
+ required: boolean;
28
+ valid: boolean;
29
+ errors: string[];
30
+ validators: FormFieldValidatorState[];
31
+ }
32
+ export interface FormFieldValidatorState {
33
+ name: string;
34
+ source: 'required' | 'html5' | 'custom';
35
+ active: boolean;
36
+ value?: unknown;
37
+ message?: string;
20
38
  }
21
39
  export interface FormSubmitResult {
22
40
  values: FormValueMap;
@@ -79,7 +97,12 @@ export declare class JsonFormRendererComponent implements OnInit, OnChanges, OnD
79
97
  private inferDatasourceValueType;
80
98
  onNodeSelect(nodeId: string): void;
81
99
  onSubmit(event: Event): Promise<void>;
82
- private getValidationResult;
100
+ getValidationResult(revalidate?: boolean): FormValidationResult;
101
+ private buildFieldValidationState;
102
+ private describeFieldValidators;
103
+ private hasRequiredValidation;
104
+ private isValidationRuleActive;
105
+ private isValidationEmpty;
83
106
  private uploadPendingFiles;
84
107
  private uploadPendingFilesInSchema;
85
108
  private getPendingFiles;
@@ -50,6 +50,8 @@ export declare class LayoutNodeComponent implements OnInit, OnChanges, OnDestroy
50
50
  private static readonly MAX_COLUMN_SPAN;
51
51
  constructor(_widgetDefs: WidgetDefinition[][], designerState: DesignerStateService, cdr: ChangeDetectorRef, el: ElementRef);
52
52
  get isSelected(): boolean;
53
+ get isRowSelectionAncestor(): boolean;
54
+ get isColumnSelectionAncestor(): boolean;
53
55
  get isResizing(): boolean;
54
56
  protected isNodeSelected(nodeId: string): boolean;
55
57
  onWidgetClick(e: Event): void;
@@ -65,6 +67,11 @@ export declare class LayoutNodeComponent implements OnInit, OnChanges, OnDestroy
65
67
  duplicateNode(): void;
66
68
  insertRowInColumn(): void;
67
69
  wrapWidgetInRow(): void;
70
+ decreaseSelectedColumnSpan(): void;
71
+ increaseSelectedColumnSpan(): void;
72
+ canDecreaseSelectedColumnSpan(): boolean;
73
+ canIncreaseSelectedColumnSpan(): boolean;
74
+ getSelectedColumnSpanLabel(): string;
68
75
  getNodeTypeLabel(): string;
69
76
  ngOnInit(): void;
70
77
  ngOnDestroy(): void;
@@ -94,6 +101,9 @@ export declare class LayoutNodeComponent implements OnInit, OnChanges, OnDestroy
94
101
  asCol(node: LayoutNode): ColumnNode;
95
102
  private applyVerticalResize;
96
103
  private applyColumnResize;
104
+ private adjustSelectedColumnSpan;
105
+ private getSelectedColumnSpan;
106
+ private getSelectedColumnEntry;
97
107
  getColClasses(node: LayoutNode): string;
98
108
  getColContainerClasses(node: LayoutNode): string;
99
109
  private getEffectiveSpan;
@@ -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;
@@ -8,7 +8,7 @@ export interface WidgetConfig {
8
8
  required?: boolean;
9
9
  [key: string]: any;
10
10
  }
11
- export type PropertyFieldType = 'text' | 'textarea' | 'number' | 'select' | 'checkbox' | 'slide-toggle' | 'color' | 'color-swatch' | 'icon-picker' | 'padding' | 'margin' | 'shadow' | 'border' | 'options-editor' | 'validators-editor' | 'conditional-editor' | 'custom' | 'field-reference' | 'dimension' | 'edge-box' | 'box-model' | 'range-number' | 'select-icon';
11
+ export type PropertyFieldType = 'text' | 'textarea' | 'number' | 'select' | 'checkbox' | 'slide-toggle' | 'color' | 'color-swatch' | 'padding' | 'margin' | 'shadow' | 'border' | 'options-editor' | 'validators-editor' | 'custom' | 'field-reference' | 'dimension' | 'edge-box' | 'box-model' | 'range-number' | 'select-icon';
12
12
  export interface PropertyField {
13
13
  key: string;
14
14
  type: PropertyFieldType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yourself.create/ngx-form-designer",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^19.0.0",
6
6
  "@angular/core": "^19.0.0",