@ng-formworks/core 20.6.6 → 20.6.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/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,26 +587,43 @@ 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;
592
+ private cdr;
594
593
  options: any;
595
594
  readonly dataIndex: _angular_core.InputSignal<number[]>;
596
595
  readonly layoutIndex: _angular_core.InputSignal<number[]>;
597
596
  readonly layout: _angular_core.InputSignal<any[]>;
598
597
  readonly isOrderable: _angular_core.InputSignal<boolean>;
599
598
  readonly isFlexItem: _angular_core.InputSignal<boolean>;
600
- sortableObj: any;
601
- sortableConfig: any;
602
- private sortableOptionsSubscription;
603
- sortableInit(sortable: any): void;
599
+ readonly memoizationEnabled: _angular_core.InputSignal<boolean>;
600
+ dataChangesSubs: Subscription;
601
+ drop(event: CdkDragDrop<string[]>): void;
604
602
  isDraggable(node: any): boolean;
605
603
  isFixed(node: any): boolean;
604
+ /**
605
+ * Predicate function that disallows '$ref' item sorts
606
+ * NB declared as a var instead of a function
607
+ * like sortPredicate(index: number, item: CdkDrag<number>){..}
608
+ * since 'this' is bound to the draglist and doesn't reference the
609
+ * FlexLayoutRootComponent instance
610
+ */
611
+ sortPredicate: (index: number, item: CdkDrag<number>) => boolean;
606
612
  getFlexAttribute(node: any, attribute: string): any;
613
+ private _getSelectFrameworkInputsRaw;
614
+ private _getSelectFrameworkInputsMemoized;
615
+ getSelectFrameworkInputs(layoutItem: any, i: number): {
616
+ layoutNode: any;
617
+ layoutIndex: number[];
618
+ dataIndex: number[];
619
+ };
620
+ trackByFn(index: number, item: any): any;
621
+ ngOnChanges(changes: SimpleChanges): void;
607
622
  showWidget(layoutNode: any): boolean;
608
623
  ngOnInit(): void;
609
624
  ngOnDestroy(): void;
610
625
  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>;
626
+ 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
627
  }
613
628
 
614
629
  declare class SectionComponent implements OnInit {
@@ -2433,13 +2448,14 @@ declare class SelectComponent implements OnInit, OnDestroy {
2433
2448
 
2434
2449
  declare class SelectFrameworkComponent implements OnChanges, OnInit {
2435
2450
  private jsf;
2451
+ private changeDetectorRef;
2436
2452
  newComponent: ComponentRef<any>;
2437
2453
  readonly layoutNode: _angular_core.InputSignal<any>;
2438
2454
  readonly layoutIndex: _angular_core.InputSignal<number[]>;
2439
2455
  readonly dataIndex: _angular_core.InputSignal<number[]>;
2440
2456
  readonly widgetContainer: _angular_core.Signal<ViewContainerRef>;
2441
2457
  ngOnInit(): void;
2442
- ngOnChanges(): void;
2458
+ ngOnChanges(changes: any): void;
2443
2459
  updateComponent(): void;
2444
2460
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<SelectFrameworkComponent, never>;
2445
2461
  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 +2469,7 @@ declare class SelectWidgetComponent implements OnChanges, OnInit {
2453
2469
  readonly dataIndex: _angular_core.InputSignal<number[]>;
2454
2470
  readonly widgetContainer: _angular_core.Signal<ViewContainerRef>;
2455
2471
  ngOnInit(): void;
2456
- ngOnChanges(): void;
2472
+ ngOnChanges(changes: SimpleChanges): void;
2457
2473
  updateComponent(): void;
2458
2474
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<SelectWidgetComponent, never>;
2459
2475
  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>;
@@ -2489,8 +2505,9 @@ declare class TabComponent implements OnInit {
2489
2505
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<TabComponent, "tab-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>;
2490
2506
  }
2491
2507
 
2492
- declare class TabsComponent implements OnInit {
2508
+ declare class TabsComponent implements OnInit, OnDestroy {
2493
2509
  private jsf;
2510
+ private cdr;
2494
2511
  options: any;
2495
2512
  itemCount: number;
2496
2513
  selectedItem: number;
@@ -2498,10 +2515,12 @@ declare class TabsComponent implements OnInit {
2498
2515
  readonly layoutNode: _angular_core.InputSignal<any>;
2499
2516
  readonly layoutIndex: _angular_core.InputSignal<number[]>;
2500
2517
  readonly dataIndex: _angular_core.InputSignal<number[]>;
2518
+ dataChangesSubs: Subscription;
2501
2519
  ngOnInit(): void;
2502
2520
  select(index: any): void;
2503
2521
  updateControl(): void;
2504
2522
  setTabTitle(item: any, index: number): string;
2523
+ ngOnDestroy(): void;
2505
2524
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<TabsComponent, never>;
2506
2525
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<TabsComponent, "tabs-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>;
2507
2526
  }
@@ -2642,9 +2661,21 @@ declare class ElementAttributeDirective {
2642
2661
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ElementAttributeDirective, "[attributes]", never, { "attributes": { "alias": "attributes"; "required": false; }; }, {}, never, never, false, never>;
2643
2662
  }
2644
2663
 
2664
+ declare class StopPropagationDirective implements OnInit, OnDestroy {
2665
+ private el;
2666
+ private renderer;
2667
+ events: string[];
2668
+ private unsubscribeFunctions;
2669
+ constructor(el: ElementRef, renderer: Renderer2);
2670
+ ngOnInit(): void;
2671
+ ngOnDestroy(): void;
2672
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<StopPropagationDirective, never>;
2673
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<StopPropagationDirective, "[appStopPropagation]", never, { "events": { "alias": "appStopPropagation"; "required": false; }; }, {}, never, never, false, never>;
2674
+ }
2675
+
2645
2676
  declare class WidgetLibraryModule {
2646
2677
  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]>;
2678
+ 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
2679
  static ɵinj: _angular_core.ɵɵInjectorDeclaration<WidgetLibraryModule>;
2649
2680
  }
2650
2681
 
@@ -2664,7 +2695,7 @@ declare class NoFrameworkModule {
2664
2695
 
2665
2696
  declare class JsonSchemaFormModule {
2666
2697
  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]>;
2698
+ 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
2699
  static ɵinj: _angular_core.ɵɵInjectorDeclaration<JsonSchemaFormModule>;
2669
2700
  }
2670
2701
 
@@ -2770,5 +2801,5 @@ declare class WidgetLibraryService {
2770
2801
 
2771
2802
  declare const BASIC_WIDGETS: (typeof NoneComponent | typeof RootComponent)[];
2772
2803
 
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 };
2804
+ 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
2805
  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.6",
3
+ "version": "20.6.8",
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",