@ng-formworks/core 20.6.5 → 20.6.7

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/index.d.ts CHANGED
@@ -1,12 +1,13 @@
1
1
  import * as _angular_core from '@angular/core';
2
2
  import { OnDestroy, Signal, OnChanges, OnInit, SimpleChanges, ElementRef, ComponentRef, ViewContainerRef, Renderer2 } from '@angular/core';
3
- import * as i27 from '@angular/forms';
3
+ import * as i28 from '@angular/forms';
4
4
  import { AbstractControl, UntypedFormArray, UntypedFormGroup, ControlValueAccessor, ValidationErrors, ValidatorFn } from '@angular/forms';
5
5
  import * as rxjs from 'rxjs';
6
6
  import { Subject, Subscription, Observable } from 'rxjs';
7
7
  import Ajv2019, { Options, ErrorObject, ValidateFunction } from 'ajv/dist/2019';
8
8
  import * as i2 from '@angular/common';
9
- import * as i28 from 'nxt-sortablejs';
9
+ import * as i29 from '@angular/cdk/drag-drop';
10
+ import { CdkDragDrop, CdkDrag } from '@angular/cdk/drag-drop';
10
11
 
11
12
  type WidgetContext = {
12
13
  formControl?: AbstractControl;
@@ -79,9 +80,6 @@ declare class JsonSchemaFormService implements OnDestroy {
79
80
  private draggableStateSubject;
80
81
  draggableState$: rxjs.Observable<boolean>;
81
82
  setDraggableState(value: boolean): void;
82
- private sortableOptionsSubject;
83
- sortableOptions$: rxjs.Observable<any>;
84
- setSortableOptions(value: any): void;
85
83
  createAjvInstance(ajvOptions: any): Ajv2019;
86
84
  createAndRegisterAjvInstance(ajvOptions: any, name?: string): {
87
85
  name: string;
@@ -589,7 +587,7 @@ declare class RadiosComponent implements OnInit, OnDestroy {
589
587
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<RadiosComponent, "radios-widget", never, { "layoutNode": { "alias": "layoutNode"; "required": false; "isSignal": true; }; "layoutIndex": { "alias": "layoutIndex"; "required": false; "isSignal": true; }; "dataIndex": { "alias": "dataIndex"; "required": false; "isSignal": true; }; }, {}, never, never, false, never>;
590
588
  }
591
589
 
592
- declare class RootComponent implements OnInit, OnDestroy {
590
+ declare class RootComponent implements OnInit, OnDestroy, OnChanges {
593
591
  private jsf;
594
592
  options: any;
595
593
  readonly dataIndex: _angular_core.InputSignal<number[]>;
@@ -597,18 +595,34 @@ declare class RootComponent implements OnInit, OnDestroy {
597
595
  readonly layout: _angular_core.InputSignal<any[]>;
598
596
  readonly isOrderable: _angular_core.InputSignal<boolean>;
599
597
  readonly isFlexItem: _angular_core.InputSignal<boolean>;
600
- sortableObj: any;
601
- sortableConfig: any;
602
- private sortableOptionsSubscription;
603
- sortableInit(sortable: any): void;
598
+ readonly memoizationEnabled: _angular_core.InputSignal<boolean>;
599
+ dataChangesSubs: Subscription;
600
+ drop(event: CdkDragDrop<string[]>): void;
604
601
  isDraggable(node: any): boolean;
605
602
  isFixed(node: any): boolean;
603
+ /**
604
+ * Predicate function that disallows '$ref' item sorts
605
+ * NB declared as a var instead of a function
606
+ * like sortPredicate(index: number, item: CdkDrag<number>){..}
607
+ * since 'this' is bound to the draglist and doesn't reference the
608
+ * FlexLayoutRootComponent instance
609
+ */
610
+ sortPredicate: (index: number, item: CdkDrag<number>) => boolean;
606
611
  getFlexAttribute(node: any, attribute: string): any;
612
+ private _getSelectFrameworkInputsRaw;
613
+ private _getSelectFrameworkInputsMemoized;
614
+ getSelectFrameworkInputs(layoutItem: any, i: number): {
615
+ layoutNode: any;
616
+ layoutIndex: number[];
617
+ dataIndex: number[];
618
+ };
619
+ trackByFn(index: number, item: any): any;
620
+ ngOnChanges(changes: SimpleChanges): void;
607
621
  showWidget(layoutNode: any): boolean;
608
622
  ngOnInit(): void;
609
623
  ngOnDestroy(): void;
610
624
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<RootComponent, never>;
611
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<RootComponent, "root-widget", never, { "dataIndex": { "alias": "dataIndex"; "required": false; "isSignal": true; }; "layoutIndex": { "alias": "layoutIndex"; "required": false; "isSignal": true; }; "layout": { "alias": "layout"; "required": false; "isSignal": true; }; "isOrderable": { "alias": "isOrderable"; "required": false; "isSignal": true; }; "isFlexItem": { "alias": "isFlexItem"; "required": false; "isSignal": true; }; }, {}, never, never, false, never>;
625
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<RootComponent, "root-widget", never, { "dataIndex": { "alias": "dataIndex"; "required": false; "isSignal": true; }; "layoutIndex": { "alias": "layoutIndex"; "required": false; "isSignal": true; }; "layout": { "alias": "layout"; "required": false; "isSignal": true; }; "isOrderable": { "alias": "isOrderable"; "required": false; "isSignal": true; }; "isFlexItem": { "alias": "isFlexItem"; "required": false; "isSignal": true; }; "memoizationEnabled": { "alias": "memoizationEnabled"; "required": false; "isSignal": true; }; }, {}, never, never, false, never>;
612
626
  }
613
627
 
614
628
  declare class SectionComponent implements OnInit {
@@ -825,7 +839,7 @@ declare function isSet(item: any): boolean;
825
839
  * // { any = false } strict - if truthy, also checks JavaScript tyoe
826
840
  * // { SchemaType }
827
841
  */
828
- declare function getType(value: any, strict?: any): "string" | "number" | "integer" | "boolean" | "null" | "object" | "array";
842
+ declare function getType(value: any, strict?: any): "integer" | "boolean" | "array" | "object" | "string" | "number" | "null";
829
843
  /**
830
844
  * 'isType' function
831
845
  *
@@ -2433,13 +2447,14 @@ declare class SelectComponent implements OnInit, OnDestroy {
2433
2447
 
2434
2448
  declare class SelectFrameworkComponent implements OnChanges, OnInit {
2435
2449
  private jsf;
2450
+ private changeDetectorRef;
2436
2451
  newComponent: ComponentRef<any>;
2437
2452
  readonly layoutNode: _angular_core.InputSignal<any>;
2438
2453
  readonly layoutIndex: _angular_core.InputSignal<number[]>;
2439
2454
  readonly dataIndex: _angular_core.InputSignal<number[]>;
2440
2455
  readonly widgetContainer: _angular_core.Signal<ViewContainerRef>;
2441
2456
  ngOnInit(): void;
2442
- ngOnChanges(): void;
2457
+ ngOnChanges(changes: any): void;
2443
2458
  updateComponent(): void;
2444
2459
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<SelectFrameworkComponent, never>;
2445
2460
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<SelectFrameworkComponent, "select-framework-widget", never, { "layoutNode": { "alias": "layoutNode"; "required": false; "isSignal": true; }; "layoutIndex": { "alias": "layoutIndex"; "required": false; "isSignal": true; }; "dataIndex": { "alias": "dataIndex"; "required": false; "isSignal": true; }; }, {}, never, never, false, never>;
@@ -2453,7 +2468,7 @@ declare class SelectWidgetComponent implements OnChanges, OnInit {
2453
2468
  readonly dataIndex: _angular_core.InputSignal<number[]>;
2454
2469
  readonly widgetContainer: _angular_core.Signal<ViewContainerRef>;
2455
2470
  ngOnInit(): void;
2456
- ngOnChanges(): void;
2471
+ ngOnChanges(changes: SimpleChanges): void;
2457
2472
  updateComponent(): void;
2458
2473
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<SelectWidgetComponent, never>;
2459
2474
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<SelectWidgetComponent, "select-widget-widget", never, { "layoutNode": { "alias": "layoutNode"; "required": false; "isSignal": true; }; "layoutIndex": { "alias": "layoutIndex"; "required": false; "isSignal": true; }; "dataIndex": { "alias": "dataIndex"; "required": false; "isSignal": true; }; }, {}, never, never, false, never>;
@@ -2642,9 +2657,21 @@ declare class ElementAttributeDirective {
2642
2657
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ElementAttributeDirective, "[attributes]", never, { "attributes": { "alias": "attributes"; "required": false; }; }, {}, never, never, false, never>;
2643
2658
  }
2644
2659
 
2660
+ declare class StopPropagationDirective implements OnInit, OnDestroy {
2661
+ private el;
2662
+ private renderer;
2663
+ events: string[];
2664
+ private unsubscribeFunctions;
2665
+ constructor(el: ElementRef, renderer: Renderer2);
2666
+ ngOnInit(): void;
2667
+ ngOnDestroy(): void;
2668
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<StopPropagationDirective, never>;
2669
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<StopPropagationDirective, "[appStopPropagation]", never, { "events": { "alias": "appStopPropagation"; "required": false; }; }, {}, never, never, false, never>;
2670
+ }
2671
+
2645
2672
  declare class WidgetLibraryModule {
2646
2673
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<WidgetLibraryModule, never>;
2647
- static ɵmod: _angular_core.ɵɵNgModuleDeclaration<WidgetLibraryModule, [typeof AddReferenceComponent, typeof OneOfComponent, typeof ButtonComponent, typeof CheckboxComponent, typeof CheckboxesComponent, typeof FileComponent, typeof HiddenComponent, typeof InputComponent, typeof MessageComponent, typeof NoneComponent, typeof NumberComponent, typeof RadiosComponent, typeof RootComponent, typeof SectionComponent, typeof SelectComponent, typeof SelectFrameworkComponent, typeof SelectWidgetComponent, typeof SubmitComponent, typeof TabComponent, typeof TabsComponent, typeof TemplateComponent, typeof TextareaComponent, typeof SelectCheckboxComponent, typeof OrderableDirective, typeof ElementAttributeDirective], [typeof i2.CommonModule, typeof i27.FormsModule, typeof i27.ReactiveFormsModule, typeof i28.SortablejsModule], [typeof AddReferenceComponent, typeof OneOfComponent, typeof ButtonComponent, typeof CheckboxComponent, typeof CheckboxesComponent, typeof FileComponent, typeof HiddenComponent, typeof InputComponent, typeof MessageComponent, typeof NoneComponent, typeof NumberComponent, typeof RadiosComponent, typeof RootComponent, typeof SectionComponent, typeof SelectComponent, typeof SelectFrameworkComponent, typeof SelectWidgetComponent, typeof SubmitComponent, typeof TabComponent, typeof TabsComponent, typeof TemplateComponent, typeof TextareaComponent, typeof SelectCheckboxComponent, typeof OrderableDirective, typeof ElementAttributeDirective]>;
2674
+ static ɵmod: _angular_core.ɵɵNgModuleDeclaration<WidgetLibraryModule, [typeof AddReferenceComponent, typeof OneOfComponent, typeof ButtonComponent, typeof CheckboxComponent, typeof CheckboxesComponent, typeof FileComponent, typeof HiddenComponent, typeof InputComponent, typeof MessageComponent, typeof NoneComponent, typeof NumberComponent, typeof RadiosComponent, typeof RootComponent, typeof SectionComponent, typeof SelectComponent, typeof SelectFrameworkComponent, typeof SelectWidgetComponent, typeof SubmitComponent, typeof TabComponent, typeof TabsComponent, typeof TemplateComponent, typeof TextareaComponent, typeof SelectCheckboxComponent, typeof OrderableDirective, typeof ElementAttributeDirective, typeof StopPropagationDirective], [typeof i2.CommonModule, typeof i28.FormsModule, typeof i28.ReactiveFormsModule, typeof i29.DragDropModule], [typeof AddReferenceComponent, typeof OneOfComponent, typeof ButtonComponent, typeof CheckboxComponent, typeof CheckboxesComponent, typeof FileComponent, typeof HiddenComponent, typeof InputComponent, typeof MessageComponent, typeof NoneComponent, typeof NumberComponent, typeof RadiosComponent, typeof RootComponent, typeof SectionComponent, typeof SelectComponent, typeof SelectFrameworkComponent, typeof SelectWidgetComponent, typeof SubmitComponent, typeof TabComponent, typeof TabsComponent, typeof TemplateComponent, typeof TextareaComponent, typeof SelectCheckboxComponent, typeof OrderableDirective, typeof ElementAttributeDirective, typeof StopPropagationDirective]>;
2648
2675
  static ɵinj: _angular_core.ɵɵInjectorDeclaration<WidgetLibraryModule>;
2649
2676
  }
2650
2677
 
@@ -2664,7 +2691,7 @@ declare class NoFrameworkModule {
2664
2691
 
2665
2692
  declare class JsonSchemaFormModule {
2666
2693
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<JsonSchemaFormModule, never>;
2667
- static ɵmod: _angular_core.ɵɵNgModuleDeclaration<JsonSchemaFormModule, [typeof JsonSchemaFormComponent], [typeof i2.CommonModule, typeof i27.FormsModule, typeof i27.ReactiveFormsModule, typeof WidgetLibraryModule, typeof NoFrameworkModule], [typeof JsonSchemaFormComponent, typeof WidgetLibraryModule]>;
2694
+ static ɵmod: _angular_core.ɵɵNgModuleDeclaration<JsonSchemaFormModule, [typeof JsonSchemaFormComponent], [typeof i2.CommonModule, typeof i28.FormsModule, typeof i28.ReactiveFormsModule, typeof WidgetLibraryModule, typeof NoFrameworkModule], [typeof JsonSchemaFormComponent, typeof WidgetLibraryModule]>;
2668
2695
  static ɵinj: _angular_core.ɵɵInjectorDeclaration<JsonSchemaFormModule>;
2669
2696
  }
2670
2697
 
@@ -2770,5 +2797,5 @@ declare class WidgetLibraryService {
2770
2797
 
2771
2798
  declare const BASIC_WIDGETS: (typeof NoneComponent | typeof RootComponent)[];
2772
2799
 
2773
- export { AddReferenceComponent, BASIC_WIDGETS, ButtonComponent, CheckboxComponent, CheckboxesComponent, ElementAttributeDirective, FileComponent, Framework, FrameworkLibraryService, HiddenComponent, InputComponent, JsonPointer, JsonSchemaFormComponent, JsonSchemaFormModule, JsonSchemaFormService, JsonValidators, MessageComponent, NoneComponent, NumberComponent, OneOfComponent, OrderableDirective, RadiosComponent, RootComponent, SectionComponent, SelectCheckboxComponent, SelectComponent, SelectFrameworkComponent, SelectWidgetComponent, SubmitComponent, TabComponent, TabsComponent, TemplateComponent, TextareaComponent, WidgetLibraryModule, WidgetLibraryService, _executeAsyncValidators, _executeValidators, _mergeErrors, _mergeObjects, _toPromise, addClasses, buildFormGroup, buildFormGroupTemplate, buildLayout, buildLayoutFromSchema, buildSchemaFromData, buildSchemaFromLayout, buildTitleMap, checkInlineType, combineAllOf, commonItems, convertSchemaToDraft6, copy, deValidationMessages, enValidationMessages, esValidationMessages, fixRequiredArrayProperties, fixTitle, forEach, forEachCopy, formatFormData, frValidationMessages, getControl, getControlValidators, getFromSchema, getInputType, getLayoutNode, getSubSchema, getTitleMapFromOneOf, getType, hasNonNullValue, hasOwn, hasValue, inArray, isArray, isBoolean, isDate, isDefined, isEmpty, isFunction, isInputRequired, isInteger, isMap, isNumber, isObject, isObservable, isPrimitive, isPromise, isSet, isString, isType, itValidationMessages, mapLayout, mergeFilteredObject, mergeSchemas, path2ControlKey, ptValidationMessages, removeRecursiveReferences, resolveSchemaReferences, setControl, setRequiredFields, toJavaScriptType, toObservable, toSchemaType, toTitleCase, uniqueItems, updateInputOptions, xor, zhValidationMessages };
2800
+ export { AddReferenceComponent, BASIC_WIDGETS, ButtonComponent, CheckboxComponent, CheckboxesComponent, ElementAttributeDirective, FileComponent, Framework, FrameworkLibraryService, HiddenComponent, InputComponent, JsonPointer, JsonSchemaFormComponent, JsonSchemaFormModule, JsonSchemaFormService, JsonValidators, MessageComponent, NoneComponent, NumberComponent, OneOfComponent, OrderableDirective, RadiosComponent, RootComponent, SectionComponent, SelectCheckboxComponent, SelectComponent, SelectFrameworkComponent, SelectWidgetComponent, StopPropagationDirective, SubmitComponent, TabComponent, TabsComponent, TemplateComponent, TextareaComponent, WidgetLibraryModule, WidgetLibraryService, _executeAsyncValidators, _executeValidators, _mergeErrors, _mergeObjects, _toPromise, addClasses, buildFormGroup, buildFormGroupTemplate, buildLayout, buildLayoutFromSchema, buildSchemaFromData, buildSchemaFromLayout, buildTitleMap, checkInlineType, combineAllOf, commonItems, convertSchemaToDraft6, copy, deValidationMessages, enValidationMessages, esValidationMessages, fixRequiredArrayProperties, fixTitle, forEach, forEachCopy, formatFormData, frValidationMessages, getControl, getControlValidators, getFromSchema, getInputType, getLayoutNode, getSubSchema, getTitleMapFromOneOf, getType, hasNonNullValue, hasOwn, hasValue, inArray, isArray, isBoolean, isDate, isDefined, isEmpty, isFunction, isInputRequired, isInteger, isMap, isNumber, isObject, isObservable, isPrimitive, isPromise, isSet, isString, isType, itValidationMessages, mapLayout, mergeFilteredObject, mergeSchemas, path2ControlKey, ptValidationMessages, removeRecursiveReferences, resolveSchemaReferences, setControl, setRequiredFields, toJavaScriptType, toObservable, toSchemaType, toTitleCase, uniqueItems, updateInputOptions, xor, zhValidationMessages };
2774
2801
  export type { AsyncIValidatorFn, ErrorMessages, IValidatorFn, JavaScriptPrimitiveType, JavaScriptType, PlainObject, Pointer, PrimitiveValue, SchemaPrimitiveType, SchemaType, TitleMapItem };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ng-formworks/core",
3
- "version": "20.6.5",
3
+ "version": "20.6.7",
4
4
  "description": "Angular ng-formworks - JSON Schema Form builder core",
5
5
  "author": "https://github.com/zahmo/ng-formworks/graphs/contributors",
6
6
  "keywords": [
@@ -48,11 +48,10 @@
48
48
  "dependencies": {
49
49
  "lodash-es": "~4.17.21",
50
50
  "ajv": "^8.12.0",
51
- "tslib": "^2.7.0",
52
- "nxt-sortablejs": "^20.0.0",
53
- "sortablejs": "^1.15.6"
51
+ "tslib": "^2.7.0"
54
52
  },
55
53
  "peerDependencies": {
54
+ "@angular/cdk": ">=20.0.0",
56
55
  "@angular/common": ">=20.0.0",
57
56
  "@angular/core": ">=20.0.0",
58
57
  "@angular/forms": ">=20.0.0",