@ng-formworks/core 17.6.6 → 17.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.
Files changed (29) hide show
  1. package/esm2022/lib/json-schema-form.component.mjs +1 -1
  2. package/esm2022/lib/json-schema-form.service.mjs +16 -12
  3. package/esm2022/lib/shared/form-group.functions.mjs +52 -3
  4. package/esm2022/lib/shared/layout.functions.mjs +25 -7
  5. package/esm2022/lib/widget-library/add-reference.component.mjs +13 -6
  6. package/esm2022/lib/widget-library/button.component.mjs +9 -4
  7. package/esm2022/lib/widget-library/checkbox.component.mjs +2 -1
  8. package/esm2022/lib/widget-library/index.mjs +2 -1
  9. package/esm2022/lib/widget-library/input.component.mjs +9 -4
  10. package/esm2022/lib/widget-library/number.component.mjs +9 -6
  11. package/esm2022/lib/widget-library/root.component.mjs +167 -124
  12. package/esm2022/lib/widget-library/section.component.mjs +2 -2
  13. package/esm2022/lib/widget-library/select-framework.component.mjs +9 -5
  14. package/esm2022/lib/widget-library/select-widget.component.mjs +5 -4
  15. package/esm2022/lib/widget-library/stop-propagation.directive.mjs +42 -0
  16. package/esm2022/lib/widget-library/submit.component.mjs +9 -4
  17. package/esm2022/lib/widget-library/tab.component.mjs +1 -1
  18. package/esm2022/lib/widget-library/widget-library.module.mjs +9 -32
  19. package/fesm2022/ng-formworks-core.mjs +484 -327
  20. package/fesm2022/ng-formworks-core.mjs.map +1 -1
  21. package/lib/json-schema-form.service.d.ts +0 -3
  22. package/lib/shared/validator.functions.d.ts +1 -1
  23. package/lib/widget-library/index.d.ts +1 -0
  24. package/lib/widget-library/root.component.d.ts +25 -7
  25. package/lib/widget-library/select-framework.component.d.ts +2 -1
  26. package/lib/widget-library/select-widget.component.d.ts +2 -2
  27. package/lib/widget-library/stop-propagation.directive.d.ts +13 -0
  28. package/lib/widget-library/widget-library.module.d.ts +5 -4
  29. package/package.json +3 -4
@@ -1,7 +1,7 @@
1
1
  import * as i1 from '@angular/common';
2
2
  import { CommonModule } from '@angular/common';
3
3
  import * as i0 from '@angular/core';
4
- import { Injectable, inject, input, viewChild, ViewContainerRef, Component, Input, Directive, ChangeDetectionStrategy, ViewChild, signal, ElementRef, NgZone, Inject, NgModule, forwardRef, ChangeDetectorRef, output } from '@angular/core';
4
+ import { Injectable, inject, input, viewChild, ViewContainerRef, Component, Input, Directive, ChangeDetectionStrategy, ViewChild, ChangeDetectorRef, signal, Inject, ElementRef, NgZone, NgModule, forwardRef, output } from '@angular/core';
5
5
  import * as i2 from '@angular/forms';
6
6
  import { UntypedFormControl, UntypedFormArray, UntypedFormGroup, FormsModule, ReactiveFormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
7
7
  import addFormats from 'ajv-formats';
@@ -10,7 +10,7 @@ import jsonDraft6 from 'ajv/lib/refs/json-schema-draft-06.json';
10
10
  import jsonDraft7 from 'ajv/lib/refs/json-schema-draft-07.json';
11
11
  import cloneDeep from 'lodash/cloneDeep';
12
12
  import { from, Observable, forkJoin, Subject, BehaviorSubject, lastValueFrom } from 'rxjs';
13
- import { some, isNil, isEmpty as isEmpty$1, pick, isObject as isObject$1, isEqual as isEqual$2 } from 'lodash';
13
+ import { some, isNil, isEmpty as isEmpty$1, pick, isObject as isObject$1, isEqual as isEqual$2, memoize } from 'lodash';
14
14
  import isEqual$1 from 'lodash/isEqual';
15
15
  import { map, takeUntil } from 'rxjs/operators';
16
16
  import omit from 'lodash/omit';
@@ -19,8 +19,8 @@ import map$1 from 'lodash/map';
19
19
  import _isArray from 'lodash/isArray';
20
20
  import _isPlainObject from 'lodash/isPlainObject';
21
21
  import uniqueId from 'lodash/uniqueId';
22
- import * as i2$1 from 'nxt-sortablejs';
23
- import { SortablejsModule } from 'nxt-sortablejs';
22
+ import * as i2$1 from '@angular/cdk/drag-drop';
23
+ import { DragDropModule } from '@angular/cdk/drag-drop';
24
24
  import { HttpClient } from '@angular/common/http';
25
25
 
26
26
  class Framework {
@@ -5265,14 +5265,24 @@ function buildFormGroupTemplate(jsf, nodeValue = null, setValues = true, schemaP
5265
5265
  const schemaRefPointer = removeRecursiveReferences(schemaPointer + '/items/' + i, jsf.schemaRecursiveRefMap);
5266
5266
  const itemRefPointer = removeRecursiveReferences(shortDataPointer + '/' + i, jsf.dataRecursiveRefMap, jsf.arrayMap);
5267
5267
  const itemRecursive = itemRefPointer !== shortDataPointer + '/' + i;
5268
+ //if is in templateLibrary then need to check if its a conditional
5269
+ //and conditional pointers match orthewise create a new ref
5270
+ let conditionalRefPointer = `${itemRefPointer}@${schemaPointer}`;
5271
+ let templateRefToUse = itemRefPointer;
5272
+ if (hasOwn(jsf.templateRefLibrary, itemRefPointer)
5273
+ && !hasOwn(jsf.templateRefLibrary, conditionalRefPointer)) {
5274
+ jsf.templateRefLibrary[conditionalRefPointer] = buildFormGroupTemplate(jsf, null, setValues, schemaRefPointer, itemRefPointer, templatePointer + '/controls/' + i);
5275
+ templateRefToUse = conditionalRefPointer;
5276
+ }
5268
5277
  if (!hasOwn(jsf.templateRefLibrary, itemRefPointer)) {
5269
5278
  jsf.templateRefLibrary[itemRefPointer] = null;
5270
5279
  jsf.templateRefLibrary[itemRefPointer] = buildFormGroupTemplate(jsf, null, setValues, schemaRefPointer, itemRefPointer, templatePointer + '/controls/' + i);
5280
+ jsf.templateRefLibrary[conditionalRefPointer] = jsf.templateRefLibrary[itemRefPointer];
5271
5281
  }
5272
5282
  controls.push(isArray(nodeValue) ?
5273
5283
  buildFormGroupTemplate(jsf, nodeValue[i], setValues, schemaPointer + '/items/' + i, dataPointer + '/' + i, templatePointer + '/controls/' + i) :
5274
5284
  itemRecursive ?
5275
- null : cloneDeep(jsf.templateRefLibrary[itemRefPointer]));
5285
+ null : cloneDeep(jsf.templateRefLibrary[templateRefToUse]));
5276
5286
  }
5277
5287
  }
5278
5288
  // If 'additionalItems' is an object = additional list items (after tuple items)
@@ -5288,9 +5298,19 @@ function buildFormGroupTemplate(jsf, nodeValue = null, setValues = true, schemaP
5288
5298
  const schemaRefPointer = removeRecursiveReferences(additionalItemsPointer, jsf.schemaRecursiveRefMap);
5289
5299
  const itemRefPointer = removeRecursiveReferences(shortDataPointer + '/-', jsf.dataRecursiveRefMap, jsf.arrayMap);
5290
5300
  const itemRecursive = itemRefPointer !== shortDataPointer + '/-';
5301
+ //if is in templateLibrary then need to check if its a conditional
5302
+ //and conditional pointers match orthewise create a new ref
5303
+ let conditionalRefPointer = `${itemRefPointer}@${schemaPointer}`;
5304
+ let templateRefToUse = itemRefPointer;
5305
+ if (hasOwn(jsf.templateRefLibrary, itemRefPointer)
5306
+ && !hasOwn(jsf.templateRefLibrary, conditionalRefPointer)) {
5307
+ jsf.templateRefLibrary[conditionalRefPointer] = buildFormGroupTemplate(jsf, null, setValues, schemaRefPointer, itemRefPointer, templatePointer + '/controls/-');
5308
+ templateRefToUse = conditionalRefPointer;
5309
+ }
5291
5310
  if (!hasOwn(jsf.templateRefLibrary, itemRefPointer)) {
5292
5311
  jsf.templateRefLibrary[itemRefPointer] = null;
5293
5312
  jsf.templateRefLibrary[itemRefPointer] = buildFormGroupTemplate(jsf, null, setValues, schemaRefPointer, itemRefPointer, templatePointer + '/controls/-');
5313
+ jsf.templateRefLibrary[conditionalRefPointer] = jsf.templateRefLibrary[itemRefPointer];
5294
5314
  }
5295
5315
  // const itemOptions = jsf.dataMap.get(itemRefPointer) || new Map();
5296
5316
  const itemOptions = nodeOptions;
@@ -5301,7 +5321,7 @@ function buildFormGroupTemplate(jsf, nodeValue = null, setValues = true, schemaP
5301
5321
  controls.push(isArray(nodeValue) ?
5302
5322
  buildFormGroupTemplate(jsf, nodeValue[i], setValues, schemaRefPointer, dataPointer + '/-', templatePointer + '/controls/-') :
5303
5323
  itemRecursive ?
5304
- null : cloneDeep(jsf.templateRefLibrary[itemRefPointer]));
5324
+ null : cloneDeep(jsf.templateRefLibrary[templateRefToUse]));
5305
5325
  }
5306
5326
  }
5307
5327
  }
@@ -5620,6 +5640,35 @@ function getControl(formGroup, dataPointer, returnGroup = false, schemaPointer)
5620
5640
  // or formGroup.get() failed to return the control,
5621
5641
  // search the formGroup object for dataPointer's control
5622
5642
  let subGroup = formGroup;
5643
+ //if schemapointer provided but no control matched
5644
+ //it could mean the schema pointer is a nested child
5645
+ //for example this could be in form group
5646
+ //formGroup.controls.$allOf$0$then$properties$foo
5647
+ //but schemapointer provided is '/allOf/0/then/properties/foo/items/properties/name'
5648
+ //and dataPointer is '/foo/0/name'
5649
+ //then need to look in formGroup.controls.$allOf$0$then$properties$foo
5650
+ //for control path /0/name
5651
+ if (schemaPointer) {
5652
+ let controlPointer = JsonPointer.toControlPointer(dataPointer, {});
5653
+ let schemaPointerArray = schemaPointer.split('/');
5654
+ let controlPointerArray = JsonPointer.parse(dataPointer);
5655
+ //controlPointer.split('/').splice(1);
5656
+ let currSPAKey;
5657
+ let spFormGroup;
5658
+ while (schemaPointerArray.length > 0) {
5659
+ currSPAKey = schemaPointerArray.pop();
5660
+ let ckey = path2ControlKey(schemaPointerArray.join("/"));
5661
+ spFormGroup = formGroup.get(ckey);
5662
+ if (controlPointerArray[0] == schemaPointerArray[schemaPointerArray.length - 1]) {
5663
+ controlPointerArray.shift();
5664
+ }
5665
+ if (spFormGroup) {
5666
+ break;
5667
+ }
5668
+ }
5669
+ subGroup = spFormGroup || subGroup;
5670
+ dataPointerArray = spFormGroup ? controlPointerArray : dataPointerArray;
5671
+ }
5623
5672
  for (const key of dataPointerArray) {
5624
5673
  if (hasOwn(subGroup, 'controls')) {
5625
5674
  subGroup = subGroup.controls;
@@ -6320,13 +6369,15 @@ function fixNestedArrayLayout(options) {
6320
6369
  function buildLayoutFromSchema(jsf, widgetLibrary, nodeValue = null, schemaPointer = '', dataPointer = '', arrayItem = false, arrayItemType = null, removable = null, forRefLibrary = false, dataPointerPrefix = '', jsonSchema) {
6321
6370
  function applyITEConditions(builtLayout, schPointer, keySchemaPointer, negateClause, parentLayout) {
6322
6371
  if (builtLayout) {
6323
- if (parentLayout && parentLayout.isITEItem && parentLayout.options.condition) {
6372
+ const parentCondition = parentLayout && parentLayout.isITEItem && parentLayout.options.condition;
6373
+ if (parentCondition) {
6374
+ //builtLayout.isITEItem=true;
6324
6375
  return;
6325
6376
  }
6326
6377
  if (isArray(builtLayout)) {
6327
6378
  builtLayout.forEach(item => {
6328
6379
  item.isITEItem = true;
6329
- item.options.condition = convertJSONSchemaIfToCondition(schema, item, negateClause);
6380
+ item.options.condition = parentCondition ? null : convertJSONSchemaIfToCondition(schema, item, negateClause);
6330
6381
  applyITEConditions(item, schPointer, keySchemaPointer, negateClause, builtLayout);
6331
6382
  //item.schemaPointer = schPointer + keySchemaPointer + item.dataPointer;
6332
6383
  //item.options.condition = convertJSONSchemaIfToCondition(schema, negateClause);
@@ -6344,7 +6395,7 @@ function buildLayoutFromSchema(jsf, widgetLibrary, nodeValue = null, schemaPoint
6344
6395
  else {
6345
6396
  builtLayout.isITEItem = true;
6346
6397
  //builtLayout.schemaPointer = `${schPointer}${keySchemaPointer}/${builtLayout.name}`;
6347
- builtLayout.options.condition = convertJSONSchemaIfToCondition(schema, builtLayout, negateClause);
6398
+ builtLayout.options.condition = parentCondition ? null : convertJSONSchemaIfToCondition(schema, builtLayout, negateClause);
6348
6399
  //newSection.push(builtLayout)
6349
6400
  }
6350
6401
  }
@@ -6587,6 +6638,13 @@ function buildLayoutFromSchema(jsf, widgetLibrary, nodeValue = null, schemaPoint
6587
6638
  itemRefPointer !== shortDataPointer + '/' + i;
6588
6639
  // If removable, add tuple item layout to layoutRefLibrary
6589
6640
  if (removable && i >= newNode.options.minItems) {
6641
+ let conditionalRefPointer = `${itemRefPointer}@${schemaPointer}`;
6642
+ let templateRefToUse = itemRefPointer;
6643
+ if (hasOwn(jsf.layoutRefLibrary, itemRefPointer)
6644
+ && !hasOwn(jsf.layoutRefLibrary, conditionalRefPointer)) {
6645
+ jsf.layoutRefLibrary[conditionalRefPointer] = buildLayoutFromSchema(jsf, widgetLibrary, isArray(nodeValue) ? nodeValue[i] : null, schemaPointer + '/items/' + i, itemRecursive ? '' : dataPointer + '/' + i, true, 'tuple', true, true, itemRecursive ? dataPointer + '/' + i : '');
6646
+ templateRefToUse = conditionalRefPointer;
6647
+ }
6590
6648
  if (!hasOwn(jsf.layoutRefLibrary, itemRefPointer)) {
6591
6649
  // Set to null first to prevent recursive reference from causing endless loop
6592
6650
  jsf.layoutRefLibrary[itemRefPointer] = null;
@@ -6594,9 +6652,10 @@ function buildLayoutFromSchema(jsf, widgetLibrary, nodeValue = null, schemaPoint
6594
6652
  if (itemRecursive) {
6595
6653
  jsf.layoutRefLibrary[itemRefPointer].recursiveReference = true;
6596
6654
  }
6655
+ jsf.layoutRefLibrary[conditionalRefPointer] = jsf.layoutRefLibrary[itemRefPointer];
6597
6656
  }
6598
6657
  newItem = getLayoutNode({
6599
- $ref: itemRefPointer,
6658
+ $ref: templateRefToUse,
6600
6659
  dataPointer: dataPointer + '/' + i,
6601
6660
  recursiveReference: itemRecursive,
6602
6661
  }, jsf, widgetLibrary, isArray(nodeValue) ? nodeValue[i] : null);
@@ -6622,6 +6681,13 @@ function buildLayoutFromSchema(jsf, widgetLibrary, nodeValue = null, schemaPoint
6622
6681
  const itemRecursive = !itemRefPointer.length ||
6623
6682
  itemRefPointer !== shortDataPointer + '/-';
6624
6683
  const itemSchemaPointer = removeRecursiveReferences(additionalItemsSchemaPointer, jsf.schemaRecursiveRefMap, jsf.arrayMap);
6684
+ let conditionalRefPointer = `${itemRefPointer}@${schemaPointer}`;
6685
+ let templateRefToUse = itemRefPointer;
6686
+ if (hasOwn(jsf.layoutRefLibrary, itemRefPointer)
6687
+ && !hasOwn(jsf.layoutRefLibrary, conditionalRefPointer)) {
6688
+ jsf.layoutRefLibrary[conditionalRefPointer] = buildLayoutFromSchema(jsf, widgetLibrary, null, itemSchemaPointer, itemRecursive ? '' : dataPointer + '/-', true, 'list', removable, true, itemRecursive ? dataPointer + '/-' : '');
6689
+ templateRefToUse = conditionalRefPointer;
6690
+ }
6625
6691
  // Add list item layout to layoutRefLibrary
6626
6692
  if (itemRefPointer.length && !hasOwn(jsf.layoutRefLibrary, itemRefPointer)) {
6627
6693
  // Set to null first to prevent recursive reference from causing endless loop
@@ -6630,6 +6696,7 @@ function buildLayoutFromSchema(jsf, widgetLibrary, nodeValue = null, schemaPoint
6630
6696
  if (itemRecursive) {
6631
6697
  jsf.layoutRefLibrary[itemRefPointer].recursiveReference = true;
6632
6698
  }
6699
+ jsf.layoutRefLibrary[conditionalRefPointer] = jsf.layoutRefLibrary[itemRefPointer];
6633
6700
  }
6634
6701
  // Add any additional default items
6635
6702
  if (!itemRecursive || newNode.options.required) {
@@ -6638,7 +6705,7 @@ function buildLayoutFromSchema(jsf, widgetLibrary, nodeValue = null, schemaPoint
6638
6705
  if (newNode.items.length < arrayLength) {
6639
6706
  for (let i = newNode.items.length; i < arrayLength; i++) {
6640
6707
  newNode.items.push(getLayoutNode({
6641
- $ref: itemRefPointer,
6708
+ $ref: templateRefToUse,
6642
6709
  dataPointer: dataPointer + '/-',
6643
6710
  recursiveReference: itemRecursive,
6644
6711
  }, jsf, widgetLibrary, isArray(nodeValue) ? nodeValue[i] : null));
@@ -6673,7 +6740,7 @@ function buildLayoutFromSchema(jsf, widgetLibrary, nodeValue = null, schemaPoint
6673
6740
  recursiveReference: itemRecursive,
6674
6741
  type: '$ref',
6675
6742
  widget: widgetLibrary.getWidget('$ref'),
6676
- $ref: itemRefPointer,
6743
+ $ref: templateRefToUse //itemRefPointer,
6677
6744
  });
6678
6745
  }
6679
6746
  }
@@ -7024,9 +7091,6 @@ class JsonSchemaFormService {
7024
7091
  setDraggableState(value) {
7025
7092
  this.draggableStateSubject.next(value); // Update the draggable value
7026
7093
  }
7027
- setSortableOptions(value) {
7028
- this.sortableOptionsSubject.next(value); // Update the sortable options value
7029
- }
7030
7094
  createAjvInstance(ajvOptions) {
7031
7095
  let ajvInstance = new Ajv2019(ajvOptions);
7032
7096
  ajvInstance.addMetaSchema(jsonDraft6);
@@ -7147,17 +7211,12 @@ class JsonSchemaFormService {
7147
7211
  //and will only be enabled when/if the caller sets the value back to true
7148
7212
  this.draggableStateSubject = new BehaviorSubject(true); // Default value true
7149
7213
  this.draggableState$ = this.draggableStateSubject.asObservable();
7150
- //this is introduced to look at replacing the orderable directive with
7151
- //nxt-sortablejs and sortablejs
7152
- this.sortableOptionsSubject = new BehaviorSubject({ disabled: false }); // Default value true
7153
- this.sortableOptions$ = this.sortableOptionsSubject.asObservable();
7154
7214
  this.ajvRegistry = {};
7155
7215
  this.setLanguage(this.language);
7156
7216
  this.ajv.addMetaSchema(jsonDraft6);
7157
7217
  this.ajv.addMetaSchema(jsonDraft7);
7158
7218
  addFormats(this.ajv);
7159
7219
  this.ajvRegistry['default'] = { name: 'default', ajvInstance: this.ajv, ajvValidator: null };
7160
- console.log(this.ajvRegistry);
7161
7220
  // Add custom 'duration' format using a regex
7162
7221
  /*
7163
7222
  this.ajv.addFormat("duration", {
@@ -7289,12 +7348,12 @@ class JsonSchemaFormService {
7289
7348
  this.formGroup = buildFormGroup(this.formGroupTemplate);
7290
7349
  if (this.formGroup) {
7291
7350
  this.compileAjvSchema(ajvInstanceName);
7292
- this.validateData(this.formGroup.value, true, ajvInstanceName);
7351
+ this.validateData(this.formGroup.getRawValue(), true, ajvInstanceName);
7293
7352
  // Set up observables to emit data and validation info when form data changes
7294
7353
  if (this.formValueSubscription) {
7295
7354
  this.formValueSubscription.unsubscribe();
7296
7355
  }
7297
- this.formValueSubscription = this.formGroup.valueChanges.subscribe(formValue => this.validateData(formValue, true, ajvInstanceName));
7356
+ this.formValueSubscription = this.formGroup.valueChanges.subscribe(formValue => this.validateData(this.formGroup.getRawValue(), true, ajvInstanceName));
7298
7357
  }
7299
7358
  }
7300
7359
  buildLayout(widgetLibrary) {
@@ -7413,6 +7472,12 @@ class JsonSchemaFormService {
7413
7472
  }
7414
7473
  return '';
7415
7474
  }
7475
+ //TODO fix- if template has value in title
7476
+ // "items": {
7477
+ // "title": "{{ 'Input ' + $index+value }}",
7478
+ // "type": "string"
7479
+ // }
7480
+ // result on button will be "Add Input [object Object]"
7416
7481
  setArrayItemTitle(parentCtx = {}, childNode = null, index = null) {
7417
7482
  //for legacy compatibility, parentCtx.layoutNode could either be a value
7418
7483
  //or have been converted to use Signals
@@ -7549,7 +7614,10 @@ class JsonSchemaFormService {
7549
7614
  //set, as the control would only be initialized when the condition is true
7550
7615
  //TODO-review need to decide which of the data sets between data,formValues and default
7551
7616
  //to use for the value
7552
- if (ctx.options?.condition || layoutNode?.oneOfPointer || layoutNode?.anyOfPointer) {
7617
+ //TODO try maybe marking descendants in applyITEConditions
7618
+ let isITEDescendant = layoutNode?.schemaPointer?.split("/")
7619
+ .some(elt => ["then", "else"].includes(elt));
7620
+ if (ctx.options?.condition || layoutNode?.oneOfPointer || layoutNode?.anyOfPointer || isITEDescendant) {
7553
7621
  const dataPointer = this.getDataPointer(ctx);
7554
7622
  const controlValue = ctx.formControl?.value;
7555
7623
  const dataValue = JsonPointer.has(this.data, dataPointer) ?
@@ -7800,6 +7868,9 @@ class JsonSchemaFormService {
7800
7868
  }
7801
7869
  // Move item in the formArray
7802
7870
  const formArray = this.getFormControlGroup(ctx);
7871
+ if (oldIndex >= formArray.length) {
7872
+ return false;
7873
+ }
7803
7874
  const arrayItem = formArray.at(oldIndex);
7804
7875
  formArray.removeAt(oldIndex);
7805
7876
  formArray.insert(newIndex, arrayItem);
@@ -7850,7 +7921,7 @@ class SelectWidgetComponent {
7850
7921
  ngOnInit() {
7851
7922
  this.updateComponent();
7852
7923
  }
7853
- ngOnChanges() {
7924
+ ngOnChanges(changes) {
7854
7925
  this.updateComponent();
7855
7926
  }
7856
7927
  updateComponent() {
@@ -7859,8 +7930,9 @@ class SelectWidgetComponent {
7859
7930
  this.newComponent = widgetContainer.createComponent((this.layoutNode().widget));
7860
7931
  }
7861
7932
  if (this.newComponent) {
7862
- for (const input of ['layoutNode', 'layoutIndex', 'dataIndex']) {
7863
- this.newComponent.instance[input] = this[input];
7933
+ for (const inp of ['layoutNode', 'layoutIndex', 'dataIndex']) {
7934
+ //this.newComponent.instance[inp] = this[inp];
7935
+ this.newComponent.setInput(inp, this[inp]());
7864
7936
  }
7865
7937
  }
7866
7938
  }
@@ -7936,6 +8008,46 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
7936
8008
  type: Input
7937
8009
  }] } });
7938
8010
 
8011
+ //TODO review:stopPropagation used as a workaround
8012
+ //to prevent dragging onMouseDown and onTouchStart events
8013
+ class StopPropagationDirective {
8014
+ constructor(el, renderer) {
8015
+ this.el = el;
8016
+ this.renderer = renderer;
8017
+ // The input property to receive an array of event names
8018
+ this.events = [];
8019
+ // An array to hold the unsubscribe functions for each event listener
8020
+ this.unsubscribeFunctions = [];
8021
+ }
8022
+ ngOnInit() {
8023
+ // If the input array is empty, default to 'mousedown'
8024
+ const eventsToListen = this.events.length > 0 ? this.events : ['mousedown'];
8025
+ // Loop through the array of event names and set up a listener for each
8026
+ eventsToListen.forEach(eventName => {
8027
+ const unsub = this.renderer.listen(this.el.nativeElement, eventName, (event) => {
8028
+ event.stopPropagation();
8029
+ });
8030
+ // Store the unsubscribe function to be called on destruction
8031
+ this.unsubscribeFunctions.push(unsub);
8032
+ });
8033
+ }
8034
+ ngOnDestroy() {
8035
+ // Call each stored unsubscribe function to clean up listeners
8036
+ this.unsubscribeFunctions.forEach(unsub => unsub());
8037
+ }
8038
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: StopPropagationDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive }); }
8039
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.12", type: StopPropagationDirective, selector: "[appStopPropagation]", inputs: { events: ["appStopPropagation", "events"] }, ngImport: i0 }); }
8040
+ }
8041
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: StopPropagationDirective, decorators: [{
8042
+ type: Directive,
8043
+ args: [{
8044
+ selector: '[appStopPropagation]', standalone: false
8045
+ }]
8046
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { events: [{
8047
+ type: Input,
8048
+ args: ['appStopPropagation']
8049
+ }] } });
8050
+
7939
8051
  class AddReferenceComponent {
7940
8052
  constructor() {
7941
8053
  this.jsf = inject(JsonSchemaFormService);
@@ -7967,13 +8079,16 @@ class AddReferenceComponent {
7967
8079
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "17.3.12", type: AddReferenceComponent, selector: "add-reference-widget", inputs: { layoutNode: { classPropertyName: "layoutNode", publicName: "layoutNode", isSignal: true, isRequired: false, transformFunction: null }, layoutIndex: { classPropertyName: "layoutIndex", publicName: "layoutIndex", isSignal: true, isRequired: false, transformFunction: null }, dataIndex: { classPropertyName: "dataIndex", publicName: "dataIndex", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
7968
8080
  <section [class]="options?.htmlClass || ''" align="end">
7969
8081
  <button *ngIf="showAddButton"
7970
- [class]="options?.fieldHtmlClass || ''" class="sortable-filter sortable-fixed"
8082
+ [class]="options?.fieldHtmlClass || ''"
7971
8083
  [disabled]="options?.readonly"
7972
- (click)="addItem($event)">
8084
+ (click)="addItem($event)"
8085
+ [appStopPropagation]="['mousedown', 'touchstart']"
8086
+ >
7973
8087
  <span *ngIf="options?.icon" [class]="options?.icon"></span>
7974
8088
  <span *ngIf="options?.title" [innerHTML]="buttonText"></span>
8089
+
7975
8090
  </button>
7976
- </section>`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.Default }); }
8091
+ </section>`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: StopPropagationDirective, selector: "[appStopPropagation]", inputs: ["appStopPropagation"] }], changeDetection: i0.ChangeDetectionStrategy.Default }); }
7977
8092
  }
7978
8093
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AddReferenceComponent, decorators: [{
7979
8094
  type: Component,
@@ -7983,11 +8098,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
7983
8098
  template: `
7984
8099
  <section [class]="options?.htmlClass || ''" align="end">
7985
8100
  <button *ngIf="showAddButton"
7986
- [class]="options?.fieldHtmlClass || ''" class="sortable-filter sortable-fixed"
8101
+ [class]="options?.fieldHtmlClass || ''"
7987
8102
  [disabled]="options?.readonly"
7988
- (click)="addItem($event)">
8103
+ (click)="addItem($event)"
8104
+ [appStopPropagation]="['mousedown', 'touchstart']"
8105
+ >
7989
8106
  <span *ngIf="options?.icon" [class]="options?.icon"></span>
7990
8107
  <span *ngIf="options?.title" [innerHTML]="buttonText"></span>
8108
+
7991
8109
  </button>
7992
8110
  </section>`,
7993
8111
  changeDetection: ChangeDetectionStrategy.Default,
@@ -8030,12 +8148,14 @@ class ButtonComponent {
8030
8148
  [name]="controlName"
8031
8149
  [type]="layoutNode()?.type"
8032
8150
  [value]="controlValue"
8033
- (click)="updateValue($event)">
8151
+ (click)="updateValue($event)"
8152
+ [appStopPropagation]="['mousedown', 'touchstart']"
8153
+ >
8034
8154
  <span *ngIf="options?.icon || options?.title"
8035
8155
  [class]="options?.icon"
8036
8156
  [innerHTML]="options?.title"></span>
8037
8157
  </button>
8038
- </div>`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
8158
+ </div>`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: StopPropagationDirective, selector: "[appStopPropagation]", inputs: ["appStopPropagation"] }] }); }
8039
8159
  }
8040
8160
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ButtonComponent, decorators: [{
8041
8161
  type: Component,
@@ -8053,7 +8173,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
8053
8173
  [name]="controlName"
8054
8174
  [type]="layoutNode()?.type"
8055
8175
  [value]="controlValue"
8056
- (click)="updateValue($event)">
8176
+ (click)="updateValue($event)"
8177
+ [appStopPropagation]="['mousedown', 'touchstart']"
8178
+ >
8057
8179
  <span *ngIf="options?.icon || options?.title"
8058
8180
  [class]="options?.icon"
8059
8181
  [innerHTML]="options?.title"></span>
@@ -8066,6 +8188,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
8066
8188
  //this mainly affects checkboxes coupled with conditions
8067
8189
  //-the value is rechecked
8068
8190
  //-see https://github.com/SortableJS/Sortable/issues/1052#issuecomment-369613072
8191
+ //-switched to angular cdk for dnd
8069
8192
  class CheckboxComponent {
8070
8193
  constructor() {
8071
8194
  this.jsf = inject(JsonSchemaFormService);
@@ -8421,7 +8544,7 @@ class InputComponent {
8421
8544
  }
8422
8545
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: InputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
8423
8546
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "17.3.12", type: InputComponent, selector: "input-widget", inputs: { layoutNode: { classPropertyName: "layoutNode", publicName: "layoutNode", isSignal: true, isRequired: false, transformFunction: null }, layoutIndex: { classPropertyName: "layoutIndex", publicName: "layoutIndex", isSignal: true, isRequired: false, transformFunction: null }, dataIndex: { classPropertyName: "dataIndex", publicName: "dataIndex", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
8424
- <div [class]="options?.htmlClass || ''" class="sortable-filter" >
8547
+ <div [class]="options?.htmlClass || ''" >
8425
8548
  <label *ngIf="options?.title"
8426
8549
  [attr.for]="'control' + layoutNode()?._id"
8427
8550
  [class]="options?.labelHtmlClass || ''"
@@ -8442,6 +8565,7 @@ class InputComponent {
8442
8565
  [readonly]="options?.readonly ? 'readonly' : null"
8443
8566
  [type]="layoutNode()?.type"
8444
8567
  [attributes]="inputAttributes"
8568
+ [appStopPropagation]="['mousedown', 'touchstart']"
8445
8569
  >
8446
8570
  <input *ngIf="!boundControl"
8447
8571
  [attr.aria-describedby]="'control' + layoutNode()?._id + 'Status'"
@@ -8460,12 +8584,13 @@ class InputComponent {
8460
8584
  [value]="controlValue"
8461
8585
  (input)="updateValue($event)"
8462
8586
  [attributes]="inputAttributes"
8587
+ [appStopPropagation]="['mousedown', 'touchstart']"
8463
8588
  >
8464
8589
  <datalist *ngIf="options?.typeahead?.source"
8465
8590
  [id]="'control' + layoutNode()?._id + 'Autocomplete'">
8466
8591
  <option *ngFor="let word of options?.typeahead?.source" [value]="word">
8467
8592
  </datalist>
8468
- </div>`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: ElementAttributeDirective, selector: "[attributes]", inputs: ["attributes"] }] }); }
8593
+ </div>`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: ElementAttributeDirective, selector: "[attributes]", inputs: ["attributes"] }, { kind: "directive", type: StopPropagationDirective, selector: "[appStopPropagation]", inputs: ["appStopPropagation"] }] }); }
8469
8594
  }
8470
8595
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: InputComponent, decorators: [{
8471
8596
  type: Component,
@@ -8473,7 +8598,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
8473
8598
  // tslint:disable-next-line:component-selector
8474
8599
  selector: 'input-widget',
8475
8600
  template: `
8476
- <div [class]="options?.htmlClass || ''" class="sortable-filter" >
8601
+ <div [class]="options?.htmlClass || ''" >
8477
8602
  <label *ngIf="options?.title"
8478
8603
  [attr.for]="'control' + layoutNode()?._id"
8479
8604
  [class]="options?.labelHtmlClass || ''"
@@ -8494,6 +8619,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
8494
8619
  [readonly]="options?.readonly ? 'readonly' : null"
8495
8620
  [type]="layoutNode()?.type"
8496
8621
  [attributes]="inputAttributes"
8622
+ [appStopPropagation]="['mousedown', 'touchstart']"
8497
8623
  >
8498
8624
  <input *ngIf="!boundControl"
8499
8625
  [attr.aria-describedby]="'control' + layoutNode()?._id + 'Status'"
@@ -8512,6 +8638,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
8512
8638
  [value]="controlValue"
8513
8639
  (input)="updateValue($event)"
8514
8640
  [attributes]="inputAttributes"
8641
+ [appStopPropagation]="['mousedown', 'touchstart']"
8515
8642
  >
8516
8643
  <datalist *ngIf="options?.typeahead?.source"
8517
8644
  [id]="'control' + layoutNode()?._id + 'Autocomplete'">
@@ -8603,7 +8730,7 @@ class NumberComponent {
8603
8730
  }
8604
8731
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: NumberComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
8605
8732
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "17.3.12", type: NumberComponent, selector: "number-widget", inputs: { layoutNode: { classPropertyName: "layoutNode", publicName: "layoutNode", isSignal: true, isRequired: false, transformFunction: null }, layoutIndex: { classPropertyName: "layoutIndex", publicName: "layoutIndex", isSignal: true, isRequired: false, transformFunction: null }, dataIndex: { classPropertyName: "dataIndex", publicName: "dataIndex", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "inputControl", first: true, predicate: ["inputControl"], descendants: true }, { propertyName: "div", first: true, predicate: ["divElt"], descendants: true }], ngImport: i0, template: `
8606
- <div #divElt [class]="options?.htmlClass || ''" class="sortable-filter" >
8733
+ <div #divElt [class]="options?.htmlClass || ''" >
8607
8734
  <label *ngIf="options?.title"
8608
8735
  [attr.for]="'control' + layoutNode()?._id"
8609
8736
  [class]="options?.labelHtmlClass || ''"
@@ -8625,7 +8752,7 @@ class NumberComponent {
8625
8752
  [title]="lastValidNumber"
8626
8753
  [type]="layoutNode()?.type === 'range' ? 'range' : 'number'"
8627
8754
  [attributes]="inputAttributes"
8628
-
8755
+ [appStopPropagation]="['mousedown', 'touchstart']"
8629
8756
  >
8630
8757
  <input #inputControl *ngIf="!boundControl"
8631
8758
  [attr.aria-describedby]="'control' + layoutNode()?._id + 'Status'"
@@ -8645,9 +8772,10 @@ class NumberComponent {
8645
8772
  [value]="controlValue"
8646
8773
  (input)="updateValue($event)"
8647
8774
  [attributes]="inputAttributes"
8775
+ [appStopPropagation]="['mousedown', 'touchstart']"
8648
8776
  >
8649
8777
  <span *ngIf="layoutNode()?.type === 'range'" [innerHTML]="controlValue"></span>
8650
- </div>`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: ElementAttributeDirective, selector: "[attributes]", inputs: ["attributes"] }] }); }
8778
+ </div>`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: ElementAttributeDirective, selector: "[attributes]", inputs: ["attributes"] }, { kind: "directive", type: StopPropagationDirective, selector: "[appStopPropagation]", inputs: ["appStopPropagation"] }] }); }
8651
8779
  }
8652
8780
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: NumberComponent, decorators: [{
8653
8781
  type: Component,
@@ -8655,7 +8783,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
8655
8783
  // tslint:disable-next-line:component-selector
8656
8784
  selector: 'number-widget',
8657
8785
  template: `
8658
- <div #divElt [class]="options?.htmlClass || ''" class="sortable-filter" >
8786
+ <div #divElt [class]="options?.htmlClass || ''" >
8659
8787
  <label *ngIf="options?.title"
8660
8788
  [attr.for]="'control' + layoutNode()?._id"
8661
8789
  [class]="options?.labelHtmlClass || ''"
@@ -8677,7 +8805,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
8677
8805
  [title]="lastValidNumber"
8678
8806
  [type]="layoutNode()?.type === 'range' ? 'range' : 'number'"
8679
8807
  [attributes]="inputAttributes"
8680
-
8808
+ [appStopPropagation]="['mousedown', 'touchstart']"
8681
8809
  >
8682
8810
  <input #inputControl *ngIf="!boundControl"
8683
8811
  [attr.aria-describedby]="'control' + layoutNode()?._id + 'Status'"
@@ -8697,6 +8825,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
8697
8825
  [value]="controlValue"
8698
8826
  (input)="updateValue($event)"
8699
8827
  [attributes]="inputAttributes"
8828
+ [appStopPropagation]="['mousedown', 'touchstart']"
8700
8829
  >
8701
8830
  <span *ngIf="layoutNode()?.type === 'range'" [innerHTML]="controlValue"></span>
8702
8831
  </div>`,
@@ -8712,6 +8841,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
8712
8841
  class SelectFrameworkComponent {
8713
8842
  constructor() {
8714
8843
  this.jsf = inject(JsonSchemaFormService);
8844
+ this.changeDetectorRef = inject(ChangeDetectorRef);
8715
8845
  this.newComponent = null;
8716
8846
  this.layoutNode = input(undefined);
8717
8847
  this.layoutIndex = input(undefined);
@@ -8721,7 +8851,7 @@ class SelectFrameworkComponent {
8721
8851
  ngOnInit() {
8722
8852
  this.updateComponent();
8723
8853
  }
8724
- ngOnChanges() {
8854
+ ngOnChanges(changes) {
8725
8855
  this.updateComponent();
8726
8856
  }
8727
8857
  updateComponent() {
@@ -8732,9 +8862,12 @@ class SelectFrameworkComponent {
8732
8862
  //this.widgetContainer.createComponent<any>(this.jsf.framework)
8733
8863
  }
8734
8864
  if (this.newComponent) {
8735
- for (const input of ['layoutNode', 'layoutIndex', 'dataIndex']) {
8736
- this.newComponent.instance[input] = this[input];
8865
+ for (const inp of ['layoutNode', 'layoutIndex', 'dataIndex']) {
8866
+ //this.newComponent.instance[inp] = this[inp];
8867
+ this.newComponent.setInput(inp, this[inp]());
8737
8868
  }
8869
+ // Manually trigger change detection after updating inputs
8870
+ //this.changeDetectorRef.detectChanges();
8738
8871
  }
8739
8872
  }
8740
8873
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SelectFrameworkComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
@@ -9156,132 +9289,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
9156
9289
  }]
9157
9290
  }] });
9158
9291
 
9159
- /**
9160
- * OrderableDirective
9161
- *
9162
- * Enables array elements to be reordered by dragging and dropping.
9163
- *
9164
- * Only works for arrays that have at least two elements.
9165
- *
9166
- * Also detects arrays-within-arrays, and correctly moves either
9167
- * the child array element or the parent array element,
9168
- * depending on the drop targert.
9169
- *
9170
- * Listeners for movable element being dragged:
9171
- * - dragstart: add 'dragging' class to element, set effectAllowed = 'move'
9172
- * - dragover: set dropEffect = 'move'
9173
- * - dragend: remove 'dragging' class from element
9174
- *
9175
- * Listeners for stationary items being dragged over:
9176
- * - dragenter: add 'drag-target-...' classes to element
9177
- * - dragleave: remove 'drag-target-...' classes from element
9178
- * - drop: remove 'drag-target-...' classes from element, move dropped array item
9179
- */
9180
- class OrderableDirective {
9181
- constructor() {
9182
- this.elementRef = inject(ElementRef);
9183
- this.jsf = inject(JsonSchemaFormService);
9184
- this.ngZone = inject(NgZone);
9185
- this.overParentElement = false;
9186
- this.overChildElement = false;
9187
- this.orderable = input(undefined);
9188
- this.layoutNode = input(undefined);
9189
- this.layoutIndex = input(undefined);
9190
- this.dataIndex = input(undefined);
9191
- }
9192
- ngOnInit() {
9193
- const layoutIndex = this.layoutIndex();
9194
- if (this.orderable() && this.layoutNode() && layoutIndex && this.dataIndex()) {
9195
- this.element = this.elementRef.nativeElement;
9196
- this.element.draggable = true;
9197
- this.arrayLayoutIndex = 'move:' + layoutIndex.slice(0, -1).toString();
9198
- this.ngZone.runOutsideAngular(() => {
9199
- // Listeners for movable element being dragged:
9200
- this.element.addEventListener('dragstart', (event) => {
9201
- event.dataTransfer.effectAllowed = 'move';
9202
- event.dataTransfer.setData('text', '');
9203
- // Hack to bypass stupid HTML drag-and-drop dataTransfer protection
9204
- // so drag source info will be available on dragenter
9205
- const sourceArrayIndex = this.dataIndex()[this.dataIndex().length - 1];
9206
- sessionStorage.setItem(this.arrayLayoutIndex, sourceArrayIndex + '');
9207
- });
9208
- this.element.addEventListener('dragover', (event) => {
9209
- if (event.preventDefault) {
9210
- event.preventDefault();
9211
- }
9212
- event.dataTransfer.dropEffect = 'move';
9213
- return false;
9214
- });
9215
- // Listeners for stationary items being dragged over:
9216
- this.element.addEventListener('dragenter', (event) => {
9217
- // Part 1 of a hack, inspired by Dragster, to simulate mouseover and mouseout
9218
- // behavior while dragging items - http://bensmithett.github.io/dragster/
9219
- if (this.overParentElement) {
9220
- return this.overChildElement = true;
9221
- }
9222
- else {
9223
- this.overParentElement = true;
9224
- }
9225
- const sourceArrayIndex = sessionStorage.getItem(this.arrayLayoutIndex);
9226
- if (sourceArrayIndex !== null) {
9227
- if (this.dataIndex()[this.dataIndex().length - 1] < +sourceArrayIndex) {
9228
- this.element.classList.add('drag-target-top');
9229
- }
9230
- else if (this.dataIndex()[this.dataIndex().length - 1] > +sourceArrayIndex) {
9231
- this.element.classList.add('drag-target-bottom');
9232
- }
9233
- }
9234
- });
9235
- this.element.addEventListener('dragleave', (event) => {
9236
- // Part 2 of the Dragster hack
9237
- if (this.overChildElement) {
9238
- this.overChildElement = false;
9239
- }
9240
- else if (this.overParentElement) {
9241
- this.overParentElement = false;
9242
- }
9243
- const sourceArrayIndex = sessionStorage.getItem(this.arrayLayoutIndex);
9244
- if (!this.overParentElement && !this.overChildElement && sourceArrayIndex !== null) {
9245
- this.element.classList.remove('drag-target-top');
9246
- this.element.classList.remove('drag-target-bottom');
9247
- }
9248
- });
9249
- this.element.addEventListener('drop', (event) => {
9250
- this.element.classList.remove('drag-target-top');
9251
- this.element.classList.remove('drag-target-bottom');
9252
- // Confirm that drop target is another item in the same array as source item
9253
- const sourceArrayIndex = sessionStorage.getItem(this.arrayLayoutIndex);
9254
- const destArrayIndex = this.dataIndex()[this.dataIndex().length - 1];
9255
- if (sourceArrayIndex !== null && +sourceArrayIndex !== destArrayIndex) {
9256
- // Move array item
9257
- this.jsf.moveArrayItem(this, +sourceArrayIndex, destArrayIndex);
9258
- }
9259
- sessionStorage.removeItem(this.arrayLayoutIndex);
9260
- return false;
9261
- });
9262
- });
9263
- // Subscribe to the draggable state
9264
- this.draggableStateSubscription = this.jsf.draggableState$.subscribe((value) => {
9265
- this.element.draggable = value;
9266
- });
9267
- }
9268
- }
9269
- ngOnDestroy() {
9270
- if (this.draggableStateSubscription) {
9271
- this.draggableStateSubscription.unsubscribe();
9272
- }
9273
- }
9274
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: OrderableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
9275
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "17.3.12", type: OrderableDirective, selector: "[orderable]", inputs: { orderable: { classPropertyName: "orderable", publicName: "orderable", isSignal: true, isRequired: false, transformFunction: null }, layoutNode: { classPropertyName: "layoutNode", publicName: "layoutNode", isSignal: true, isRequired: false, transformFunction: null }, layoutIndex: { classPropertyName: "layoutIndex", publicName: "layoutIndex", isSignal: true, isRequired: false, transformFunction: null }, dataIndex: { classPropertyName: "dataIndex", publicName: "dataIndex", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
9276
- }
9277
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: OrderableDirective, decorators: [{
9278
- type: Directive,
9279
- args: [{
9280
- // tslint:disable-next-line:directive-selector
9281
- selector: '[orderable]',
9282
- }]
9283
- }] });
9284
-
9285
9292
  class RootComponent {
9286
9293
  constructor() {
9287
9294
  this.jsf = inject(JsonSchemaFormService);
@@ -9290,105 +9297,84 @@ class RootComponent {
9290
9297
  this.layout = input(undefined);
9291
9298
  this.isOrderable = input(undefined);
9292
9299
  this.isFlexItem = input(false);
9293
- this.sortableConfig = {
9294
- filter: ".sortable-filter",
9295
- preventOnFilter: false,
9296
- delay: 1000,
9297
- delayOnTouchOnly: true,
9298
- onEnd: (/**Event*/ evt) => {
9299
- evt.newIndex; // most likely why this event is used is to get the dragging element's current index
9300
- // same properties as onEnd
9301
- //console.log(`sortablejs event:${evt}`);
9302
- let srcInd = evt.oldIndex;
9303
- let trgInd = evt.newIndex;
9304
- let layoutItem = this.layout()[trgInd];
9305
- let dataInd = layoutItem?.arrayItem ? (this.dataIndex() || []).concat(trgInd) : (this.dataIndex() || []);
9306
- let layoutInd = (this.layoutIndex() || []).concat(trgInd);
9307
- let itemCtx = {
9308
- dataIndex: () => { return dataInd; },
9309
- layoutIndex: () => { return layoutInd; },
9310
- layoutNode: () => { return layoutItem; },
9311
- };
9312
- //must set moveLayout to false as nxtSortable already moves it
9313
- this.jsf.moveArrayItem(itemCtx, evt.oldIndex, evt.newIndex, false);
9314
- },
9315
- onMove: function (/**Event*/ evt, /**Event*/ originalEvent) {
9316
- if (evt.related.classList.contains("sortable-fixed")) {
9317
- //console.log(evt.related);
9318
- return false;
9319
- }
9320
- }
9300
+ this.memoizationEnabled = input(true);
9301
+ /**
9302
+ * Predicate function that disallows '$ref' item sorts
9303
+ * NB declared as a var instead of a function
9304
+ * like sortPredicate(index: number, item: CdkDrag<number>){..}
9305
+ * since 'this' is bound to the draglist and doesn't reference the
9306
+ * FlexLayoutRootComponent instance
9307
+ */
9308
+ //TODO also need to think of other types such as button which can be
9309
+ //created by an arbitrary layout
9310
+ //might not be needed added condition to [cdkDragDisabled]
9311
+ this.sortPredicate = (index, item) => {
9312
+ let layoutItem = this.layout()[index];
9313
+ let result = this.isDraggable(layoutItem);
9314
+ //layoutItem.type != '$ref';
9315
+ return result;
9321
9316
  };
9322
- }
9323
- sortableInit(sortable) {
9324
- this.sortableObj = sortable;
9325
- //Sortable.utils.on(this.sortableObj.el,"nulling",(s)=>{console.log("event nulling sortablejs")})
9326
- ///NB issue caused by sortablejs when it its destroyed
9327
- //this mainly affects checkboxes coupled with conditions
9328
- //-the value is rechecked
9329
- //-see https://github.com/SortableJS/Sortable/issues/1052#issuecomment-369613072
9330
- /* attempt to monkey patch sortable js
9331
- const originalMethod = sortable._nulling;
9332
- let zone=this.zone;
9333
- sortable._nulling=function() {
9334
- console.log(`pluginEvent 2 ${pluginEvent}`)
9335
- zone.runOutsideAngular(() => {
9336
- console.log(`pluginEvent3 ${pluginEvent}`)
9337
- pluginEvent('nulling', this);
9338
-
9339
- rootEl =
9340
- dragEl =
9341
- parentEl =
9342
- ghostEl =
9343
- nextEl =
9344
- cloneEl =
9345
- lastDownEl =
9346
- cloneHidden =
9347
-
9348
- tapEvt =
9349
- touchEvt =
9317
+ //private selectframeworkInputCache = new Map<string, { dataIndex: any[], layoutIndex: any[], layoutNode: any }>();
9318
+ //TODO review caching-if form field values change, the changes are not propagated
9319
+ /*
9320
+ getSelectFrameworkInputs(layoutItem: any, i: number) {
9321
+ // Create a unique key based on the layoutItem and index
9322
+ const cacheKey = `${layoutItem._id}-${i}`;
9323
+
9324
+ // If the result is already in the cache, return it
9325
+ if(this.enableCaching){
9326
+ if (this.selectframeworkInputCache.has(cacheKey)) {
9327
+ return this.selectframeworkInputCache.get(cacheKey);
9328
+ }
9329
+ }
9350
9330
 
9351
- moved =
9352
- newIndex =
9353
- newDraggableIndex =
9354
- oldIndex =
9355
- oldDraggableIndex =
9356
9331
 
9357
- lastTarget =
9358
- lastDirection =
9332
+ // If not cached, calculate the values (assuming dataIndex() and layoutIndex() are functions)
9333
+ const dataIndex = layoutItem?.arrayItem ? (this.dataIndex() || []).concat(i) : (this.dataIndex() || []);
9334
+ const layoutIndex = (this.layoutIndex() || []).concat(i);
9359
9335
 
9360
- putSortable =
9361
- activeGroup =
9362
- Sortable.dragged =
9363
- Sortable.ghost =
9364
- Sortable.clone =
9365
- Sortable.active = null;
9336
+ // Save the result in the cache
9337
+ const result = { dataIndex, layoutIndex, layoutNode: layoutItem };
9338
+ if(this.enableCaching){
9339
+ this.selectframeworkInputCache.set(cacheKey, result);
9340
+ }
9366
9341
 
9367
-
9368
- let el = this.el;
9369
- savedInputChecked.forEach(function (checkEl) {
9370
- if (el.contains(checkEl)) {
9371
- checkEl.checked = true;
9372
- }
9373
- });
9374
-
9375
- savedInputChecked.length =
9376
- lastDx =
9377
- lastDy = 0;
9378
-
9379
- })
9380
-
9381
- }.bind(sortable)
9382
- */
9342
+ return result;
9343
+ }
9344
+ */
9345
+ this._getSelectFrameworkInputsRaw = (layoutItem, i) => {
9346
+ const dataIndexValue = this.dataIndex() || [];
9347
+ const layoutIndexValue = this.layoutIndex() || [];
9348
+ return {
9349
+ layoutNode: layoutItem,
9350
+ layoutIndex: [...layoutIndexValue, i],
9351
+ dataIndex: layoutItem?.arrayItem ? [...dataIndexValue, i] : dataIndexValue,
9352
+ };
9353
+ };
9354
+ // Define a separate function to hold the memoized version
9355
+ this._getSelectFrameworkInputsMemoized = memoize(this._getSelectFrameworkInputsRaw, (layoutItem, i) => {
9356
+ const layoutItemKey = layoutItem?.id ?? JSON.stringify(layoutItem);
9357
+ return `${layoutItemKey}-${i}`;
9358
+ });
9359
+ }
9360
+ drop(event) {
9361
+ // most likely why this event is used is to get the dragging element's current index
9362
+ let srcInd = event.previousIndex;
9363
+ let trgInd = event.currentIndex;
9364
+ let layoutItem = this.layout()[trgInd];
9365
+ let dataInd = layoutItem?.arrayItem ? (this.dataIndex() || []).concat(trgInd) : (this.dataIndex() || []);
9366
+ let layoutInd = (this.layoutIndex() || []).concat(trgInd);
9367
+ let itemCtx = {
9368
+ dataIndex: () => { return dataInd; },
9369
+ layoutIndex: () => { return layoutInd; },
9370
+ layoutNode: () => { return layoutItem; },
9371
+ };
9372
+ this.jsf.moveArrayItem(itemCtx, srcInd, trgInd, true);
9383
9373
  }
9384
9374
  isDraggable(node) {
9385
9375
  let result = node.arrayItem && node.type !== '$ref' &&
9386
- node.arrayItemType === 'list' && this.isOrderable() !== false;
9387
- if (this.sortableObj) {
9388
- //this.sortableObj.option("disabled",true);
9389
- //this.sortableObj.option("sort",false);
9390
- //this.sortableObj.option("disabled",!result);
9391
- }
9376
+ node.arrayItemType === 'list' && this.isOrderable() !== false
9377
+ && node.type !== 'submit';
9392
9378
  return result;
9393
9379
  }
9394
9380
  //TODO also need to think of other types such as button which can be
@@ -9404,93 +9390,157 @@ class RootComponent {
9404
9390
  return ((node.options || {}).flex || '').split(/\s+/)[index] ||
9405
9391
  (node.options || {})[attribute] || ['1', '1', 'auto'][index];
9406
9392
  }
9393
+ // This is the public function that the template calls
9394
+ getSelectFrameworkInputs(layoutItem, i) {
9395
+ if (this.memoizationEnabled) {
9396
+ return this._getSelectFrameworkInputsMemoized(layoutItem, i);
9397
+ }
9398
+ else {
9399
+ return this._getSelectFrameworkInputsRaw(layoutItem, i);
9400
+ }
9401
+ }
9402
+ trackByFn(index, item) {
9403
+ return item._id ?? index;
9404
+ }
9405
+ /*
9406
+ ngOnChanges(changes: SimpleChanges): void {
9407
+ // If any of the input properties change, clear the cache
9408
+ if (changes.dataIndex || changes.layoutIndex || changes.layout) {
9409
+ this.selectframeworkInputCache?.clear(); // Clear the entire cache
9410
+ }
9411
+ }
9412
+ */
9413
+ ngOnChanges(changes) {
9414
+ if (changes['layout'] || changes['dataIndex'] || changes['layoutIndex']) {
9415
+ // Clear the entire cache of the memoized function
9416
+ this._getSelectFrameworkInputsMemoized.cache.clear();
9417
+ }
9418
+ }
9407
9419
  showWidget(layoutNode) {
9408
9420
  return this.jsf.evaluateCondition(layoutNode, this.dataIndex());
9409
9421
  }
9410
9422
  ngOnInit() {
9411
- // Subscribe to the draggable state
9412
- this.sortableOptionsSubscription = this.jsf.sortableOptions$.subscribe((optsValue) => {
9413
- if (this.sortableObj) {
9414
- Object.keys(optsValue).forEach(opt => {
9415
- let optVal = optsValue[opt];
9416
- this.sortableObj.option(opt, optVal);
9417
- });
9418
- //this.sortableObj.option("disabled",true);
9419
- //this.sortableObj.option("sort",false);
9420
- }
9421
- });
9423
+ if (this.memoizationEnabled) {
9424
+ this.jsf.dataChanges.subscribe((val) => {
9425
+ //this.selectframeworkInputCache?.clear();
9426
+ this._getSelectFrameworkInputsMemoized.cache.clear();
9427
+ });
9428
+ }
9422
9429
  }
9423
9430
  ngOnDestroy() {
9424
- if (this.sortableOptionsSubscription) {
9425
- this.sortableOptionsSubscription.unsubscribe();
9426
- }
9431
+ //this.selectframeworkInputCache?.clear()
9432
+ //this.selectframeworkInputCache=null;
9433
+ this._getSelectFrameworkInputsMemoized.cache.clear();
9434
+ this.dataChangesSubs?.unsubscribe();
9427
9435
  }
9428
9436
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: RootComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
9429
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "17.3.12", type: RootComponent, selector: "root-widget", inputs: { dataIndex: { classPropertyName: "dataIndex", publicName: "dataIndex", isSignal: true, isRequired: false, transformFunction: null }, layoutIndex: { classPropertyName: "layoutIndex", publicName: "layoutIndex", isSignal: true, isRequired: false, transformFunction: null }, layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, isOrderable: { classPropertyName: "isOrderable", publicName: "isOrderable", isSignal: true, isRequired: false, transformFunction: null }, isFlexItem: { classPropertyName: "isFlexItem", publicName: "isFlexItem", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
9430
- <div [class.flex-inherit]="true" #sortableContainter [nxtSortablejs]="layout()" [config]="sortableConfig" (init)="sortableInit($event)">
9431
- <div *ngFor="let layoutItem of layout(); let i = index"
9437
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "17.3.12", type: RootComponent, selector: "root-widget", inputs: { dataIndex: { classPropertyName: "dataIndex", publicName: "dataIndex", isSignal: true, isRequired: false, transformFunction: null }, layoutIndex: { classPropertyName: "layoutIndex", publicName: "layoutIndex", isSignal: true, isRequired: false, transformFunction: null }, layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, isOrderable: { classPropertyName: "isOrderable", publicName: "isOrderable", isSignal: true, isRequired: false, transformFunction: null }, isFlexItem: { classPropertyName: "isFlexItem", publicName: "isFlexItem", isSignal: true, isRequired: false, transformFunction: null }, memoizationEnabled: { classPropertyName: "memoizationEnabled", publicName: "memoizationEnabled", isSignal: true, isRequired: false, transformFunction: null } }, usesOnChanges: true, ngImport: i0, template: `
9438
+ <div cdkDropList (cdkDropListDropped)="drop($event)"
9439
+ [class.flex-inherit]="true"
9440
+ [cdkDropListSortPredicate]="sortPredicate"
9441
+ >
9442
+ <!-- -for now left out
9443
+ cdkDragHandle directive, by itself, does not disable the
9444
+ default drag behavior of its parent cdkDrag element.
9445
+ You must explicitly disable dragging on the main element
9446
+ and re-enable it only when using the handle.
9447
+ -->
9448
+ <div *ngFor="let layoutItem of layout(); let i = index;trackBy: trackByFn"
9449
+ cdkDrag [cdkDragStartDelay]="{touch:1000,mouse:0}"
9450
+ [cdkDragDisabled]="!isDraggable(layoutItem)"
9432
9451
  [class.form-flex-item]="isFlexItem()"
9433
9452
  [style.align-self]="(layoutItem.options || {})['align-self']"
9434
9453
  [style.flex-basis]="getFlexAttribute(layoutItem, 'flex-basis')"
9435
9454
  [style.flex-grow]="getFlexAttribute(layoutItem, 'flex-grow')"
9436
9455
  [style.flex-shrink]="getFlexAttribute(layoutItem, 'flex-shrink')"
9437
9456
  [style.order]="(layoutItem.options || {}).order"
9438
- [class.sortable-filter]="!isDraggable(layoutItem)"
9439
- [class.sortable-fixed]="isFixed(layoutItem)"
9440
9457
  >
9458
+
9459
+ <!-- workaround to disbale dragging of input fields -->
9460
+ <!--
9461
+ <div *ngIf="layoutItem?.dataType !='object'" cdkDragHandle>
9462
+ <p>Drag Handle {{layoutItem?.dataType}}</p>
9463
+ </div>
9464
+ -->
9441
9465
  <!--NB orderable directive is not used but has been left in for now and set to false
9442
9466
  otherwise the compiler won't recognize dataIndex and other dependent attributes
9443
9467
  -->
9468
+ <!--
9444
9469
  <div
9445
9470
  [dataIndex]="layoutItem?.arrayItem ? (dataIndex() || []).concat(i) : (dataIndex() || [])"
9446
9471
  [layoutIndex]="(layoutIndex() || []).concat(i)"
9447
9472
  [layoutNode]="layoutItem"
9448
9473
  [orderable]="false"
9449
- [class.sortable-filter]="!isDraggable(layoutItem)"
9450
- [class.sortable-fixed]="isFixed(layoutItem)"
9451
9474
  >
9452
9475
  <select-framework-widget *ngIf="showWidget(layoutItem)"
9453
9476
  [dataIndex]="layoutItem?.arrayItem ? (dataIndex() || []).concat(i) : (dataIndex() || [])"
9454
9477
  [layoutIndex]="(layoutIndex() || []).concat(i)"
9455
9478
  [layoutNode]="layoutItem"></select-framework-widget>
9456
9479
  </div>
9480
+ -->
9481
+ <select-framework-widget *ngIf="showWidget(layoutItem)"
9482
+ [dataIndex]="getSelectFrameworkInputs(layoutItem,i).dataIndex"
9483
+ [layoutIndex]="getSelectFrameworkInputs(layoutItem,i).layoutIndex"
9484
+ [layoutNode]="getSelectFrameworkInputs(layoutItem,i).layoutNode">
9485
+ </select-framework-widget>
9457
9486
  </div>
9458
9487
  </div>
9459
- `, isInline: true, styles: ["[draggable=true]{transition:all .15s cubic-bezier(.4,0,.2,1)}[draggable=true]:hover{cursor:move;box-shadow:2px 2px 4px #0003;position:relative;z-index:10;margin:-1px 1px 1px -1px}[draggable=true].drag-target-top{box-shadow:0 -2px #000;position:relative;z-index:20}[draggable=true].drag-target-bottom{box-shadow:0 2px #000;position:relative;z-index:20}.flex-inherit{display:inherit;flex-flow:inherit;flex-wrap:inherit;flex-direction:inherit;width:100%}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.SortablejsDirective, selector: "[nxtSortablejs]", inputs: ["nxtSortablejs", "sortablejsContainer", "config", "cloneFunction"], outputs: ["init"] }, { kind: "component", type: SelectFrameworkComponent, selector: "select-framework-widget", inputs: ["layoutNode", "layoutIndex", "dataIndex"] }, { kind: "directive", type: OrderableDirective, selector: "[orderable]", inputs: ["orderable", "layoutNode", "layoutIndex", "dataIndex"] }] }); }
9488
+ `, isInline: true, styles: ["[draggable=true]{transition:all .15s cubic-bezier(.4,0,.2,1)}[draggable=true]:hover{cursor:move;box-shadow:2px 2px 4px #0003;position:relative;z-index:10;margin:-1px 1px 1px -1px}[draggable=true].drag-target-top{box-shadow:0 -2px #000;position:relative;z-index:20}[draggable=true].drag-target-bottom{box-shadow:0 2px #000;position:relative;z-index:20}.flex-inherit{display:inherit;flex-flow:inherit;flex-wrap:inherit;flex-direction:inherit;width:100%}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i2$1.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "component", type: SelectFrameworkComponent, selector: "select-framework-widget", inputs: ["layoutNode", "layoutIndex", "dataIndex"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
9460
9489
  }
9461
9490
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: RootComponent, decorators: [{
9462
9491
  type: Component,
9463
9492
  args: [{ selector: 'root-widget', template: `
9464
- <div [class.flex-inherit]="true" #sortableContainter [nxtSortablejs]="layout()" [config]="sortableConfig" (init)="sortableInit($event)">
9465
- <div *ngFor="let layoutItem of layout(); let i = index"
9493
+ <div cdkDropList (cdkDropListDropped)="drop($event)"
9494
+ [class.flex-inherit]="true"
9495
+ [cdkDropListSortPredicate]="sortPredicate"
9496
+ >
9497
+ <!-- -for now left out
9498
+ cdkDragHandle directive, by itself, does not disable the
9499
+ default drag behavior of its parent cdkDrag element.
9500
+ You must explicitly disable dragging on the main element
9501
+ and re-enable it only when using the handle.
9502
+ -->
9503
+ <div *ngFor="let layoutItem of layout(); let i = index;trackBy: trackByFn"
9504
+ cdkDrag [cdkDragStartDelay]="{touch:1000,mouse:0}"
9505
+ [cdkDragDisabled]="!isDraggable(layoutItem)"
9466
9506
  [class.form-flex-item]="isFlexItem()"
9467
9507
  [style.align-self]="(layoutItem.options || {})['align-self']"
9468
9508
  [style.flex-basis]="getFlexAttribute(layoutItem, 'flex-basis')"
9469
9509
  [style.flex-grow]="getFlexAttribute(layoutItem, 'flex-grow')"
9470
9510
  [style.flex-shrink]="getFlexAttribute(layoutItem, 'flex-shrink')"
9471
9511
  [style.order]="(layoutItem.options || {}).order"
9472
- [class.sortable-filter]="!isDraggable(layoutItem)"
9473
- [class.sortable-fixed]="isFixed(layoutItem)"
9474
9512
  >
9513
+
9514
+ <!-- workaround to disbale dragging of input fields -->
9515
+ <!--
9516
+ <div *ngIf="layoutItem?.dataType !='object'" cdkDragHandle>
9517
+ <p>Drag Handle {{layoutItem?.dataType}}</p>
9518
+ </div>
9519
+ -->
9475
9520
  <!--NB orderable directive is not used but has been left in for now and set to false
9476
9521
  otherwise the compiler won't recognize dataIndex and other dependent attributes
9477
9522
  -->
9523
+ <!--
9478
9524
  <div
9479
9525
  [dataIndex]="layoutItem?.arrayItem ? (dataIndex() || []).concat(i) : (dataIndex() || [])"
9480
9526
  [layoutIndex]="(layoutIndex() || []).concat(i)"
9481
9527
  [layoutNode]="layoutItem"
9482
9528
  [orderable]="false"
9483
- [class.sortable-filter]="!isDraggable(layoutItem)"
9484
- [class.sortable-fixed]="isFixed(layoutItem)"
9485
9529
  >
9486
9530
  <select-framework-widget *ngIf="showWidget(layoutItem)"
9487
9531
  [dataIndex]="layoutItem?.arrayItem ? (dataIndex() || []).concat(i) : (dataIndex() || [])"
9488
9532
  [layoutIndex]="(layoutIndex() || []).concat(i)"
9489
9533
  [layoutNode]="layoutItem"></select-framework-widget>
9490
9534
  </div>
9535
+ -->
9536
+ <select-framework-widget *ngIf="showWidget(layoutItem)"
9537
+ [dataIndex]="getSelectFrameworkInputs(layoutItem,i).dataIndex"
9538
+ [layoutIndex]="getSelectFrameworkInputs(layoutItem,i).layoutIndex"
9539
+ [layoutNode]="getSelectFrameworkInputs(layoutItem,i).layoutNode">
9540
+ </select-framework-widget>
9491
9541
  </div>
9492
9542
  </div>
9493
- `, standalone: false, styles: ["[draggable=true]{transition:all .15s cubic-bezier(.4,0,.2,1)}[draggable=true]:hover{cursor:move;box-shadow:2px 2px 4px #0003;position:relative;z-index:10;margin:-1px 1px 1px -1px}[draggable=true].drag-target-top{box-shadow:0 -2px #000;position:relative;z-index:20}[draggable=true].drag-target-bottom{box-shadow:0 2px #000;position:relative;z-index:20}.flex-inherit{display:inherit;flex-flow:inherit;flex-wrap:inherit;flex-direction:inherit;width:100%}\n"] }]
9543
+ `, changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, styles: ["[draggable=true]{transition:all .15s cubic-bezier(.4,0,.2,1)}[draggable=true]:hover{cursor:move;box-shadow:2px 2px 4px #0003;position:relative;z-index:10;margin:-1px 1px 1px -1px}[draggable=true].drag-target-top{box-shadow:0 -2px #000;position:relative;z-index:20}[draggable=true].drag-target-bottom{box-shadow:0 2px #000;position:relative;z-index:20}.flex-inherit{display:inherit;flex-flow:inherit;flex-wrap:inherit;flex-direction:inherit;width:100%}\n"] }]
9494
9544
  }] });
9495
9545
 
9496
9546
  class SectionComponent {
@@ -9616,7 +9666,7 @@ class SectionComponent {
9616
9666
  [class]="options?.labelHelpBlockClass || ''"
9617
9667
  [innerHTML]="options?.description"></p>
9618
9668
  </div>
9619
- </fieldset>`, isInline: true, styles: [".legend{font-weight:700}.expandable>legend:before,.expandable>label:before{content:\"\\25b6\";padding-right:.3em;font-family:auto}.expanded>legend:before,.expanded>label:before{content:\"\\25bc\";padding-right:.2em}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: RootComponent, selector: "root-widget", inputs: ["dataIndex", "layoutIndex", "layout", "isOrderable", "isFlexItem"] }] }); }
9669
+ </fieldset>`, isInline: true, styles: [".legend{font-weight:700}.expandable>legend:before,.expandable>label:before{content:\"\\25b6\";padding-right:.3em;font-family:auto}.expanded>legend:before,.expanded>label:before{content:\"\\25bc\";padding-right:.2em}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: RootComponent, selector: "root-widget", inputs: ["dataIndex", "layoutIndex", "layout", "isOrderable", "isFlexItem", "memoizationEnabled"] }] }); }
9620
9670
  }
9621
9671
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SectionComponent, decorators: [{
9622
9672
  type: Component,
@@ -9960,8 +10010,10 @@ class SubmitComponent {
9960
10010
  [name]="controlName"
9961
10011
  [type]="layoutNode()?.type"
9962
10012
  [value]="controlValue"
9963
- (click)="updateValue($event)">
9964
- </div>`, isInline: true }); }
10013
+ (click)="updateValue($event)"
10014
+ [appStopPropagation]="['mousedown', 'touchstart']"
10015
+ >
10016
+ </div>`, isInline: true, dependencies: [{ kind: "directive", type: StopPropagationDirective, selector: "[appStopPropagation]", inputs: ["appStopPropagation"] }] }); }
9965
10017
  }
9966
10018
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SubmitComponent, decorators: [{
9967
10019
  type: Component,
@@ -9981,7 +10033,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
9981
10033
  [name]="controlName"
9982
10034
  [type]="layoutNode()?.type"
9983
10035
  [value]="controlValue"
9984
- (click)="updateValue($event)">
10036
+ (click)="updateValue($event)"
10037
+ [appStopPropagation]="['mousedown', 'touchstart']"
10038
+ >
9985
10039
  </div>`,
9986
10040
  }]
9987
10041
  }] });
@@ -10689,7 +10743,7 @@ class TabComponent {
10689
10743
  [dataIndex]="dataIndex()"
10690
10744
  [layoutIndex]="layoutIndex()"
10691
10745
  [layout]="layoutNode().items"></root-widget>
10692
- </div>`, isInline: true, dependencies: [{ kind: "component", type: RootComponent, selector: "root-widget", inputs: ["dataIndex", "layoutIndex", "layout", "isOrderable", "isFlexItem"] }] }); }
10746
+ </div>`, isInline: true, dependencies: [{ kind: "component", type: RootComponent, selector: "root-widget", inputs: ["dataIndex", "layoutIndex", "layout", "isOrderable", "isFlexItem", "memoizationEnabled"] }] }); }
10693
10747
  }
10694
10748
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: TabComponent, decorators: [{
10695
10749
  type: Component,
@@ -10706,6 +10760,132 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
10706
10760
  }]
10707
10761
  }] });
10708
10762
 
10763
+ /**
10764
+ * OrderableDirective
10765
+ *
10766
+ * Enables array elements to be reordered by dragging and dropping.
10767
+ *
10768
+ * Only works for arrays that have at least two elements.
10769
+ *
10770
+ * Also detects arrays-within-arrays, and correctly moves either
10771
+ * the child array element or the parent array element,
10772
+ * depending on the drop targert.
10773
+ *
10774
+ * Listeners for movable element being dragged:
10775
+ * - dragstart: add 'dragging' class to element, set effectAllowed = 'move'
10776
+ * - dragover: set dropEffect = 'move'
10777
+ * - dragend: remove 'dragging' class from element
10778
+ *
10779
+ * Listeners for stationary items being dragged over:
10780
+ * - dragenter: add 'drag-target-...' classes to element
10781
+ * - dragleave: remove 'drag-target-...' classes from element
10782
+ * - drop: remove 'drag-target-...' classes from element, move dropped array item
10783
+ */
10784
+ class OrderableDirective {
10785
+ constructor() {
10786
+ this.elementRef = inject(ElementRef);
10787
+ this.jsf = inject(JsonSchemaFormService);
10788
+ this.ngZone = inject(NgZone);
10789
+ this.overParentElement = false;
10790
+ this.overChildElement = false;
10791
+ this.orderable = input(undefined);
10792
+ this.layoutNode = input(undefined);
10793
+ this.layoutIndex = input(undefined);
10794
+ this.dataIndex = input(undefined);
10795
+ }
10796
+ ngOnInit() {
10797
+ const layoutIndex = this.layoutIndex();
10798
+ if (this.orderable() && this.layoutNode() && layoutIndex && this.dataIndex()) {
10799
+ this.element = this.elementRef.nativeElement;
10800
+ this.element.draggable = true;
10801
+ this.arrayLayoutIndex = 'move:' + layoutIndex.slice(0, -1).toString();
10802
+ this.ngZone.runOutsideAngular(() => {
10803
+ // Listeners for movable element being dragged:
10804
+ this.element.addEventListener('dragstart', (event) => {
10805
+ event.dataTransfer.effectAllowed = 'move';
10806
+ event.dataTransfer.setData('text', '');
10807
+ // Hack to bypass stupid HTML drag-and-drop dataTransfer protection
10808
+ // so drag source info will be available on dragenter
10809
+ const sourceArrayIndex = this.dataIndex()[this.dataIndex().length - 1];
10810
+ sessionStorage.setItem(this.arrayLayoutIndex, sourceArrayIndex + '');
10811
+ });
10812
+ this.element.addEventListener('dragover', (event) => {
10813
+ if (event.preventDefault) {
10814
+ event.preventDefault();
10815
+ }
10816
+ event.dataTransfer.dropEffect = 'move';
10817
+ return false;
10818
+ });
10819
+ // Listeners for stationary items being dragged over:
10820
+ this.element.addEventListener('dragenter', (event) => {
10821
+ // Part 1 of a hack, inspired by Dragster, to simulate mouseover and mouseout
10822
+ // behavior while dragging items - http://bensmithett.github.io/dragster/
10823
+ if (this.overParentElement) {
10824
+ return this.overChildElement = true;
10825
+ }
10826
+ else {
10827
+ this.overParentElement = true;
10828
+ }
10829
+ const sourceArrayIndex = sessionStorage.getItem(this.arrayLayoutIndex);
10830
+ if (sourceArrayIndex !== null) {
10831
+ if (this.dataIndex()[this.dataIndex().length - 1] < +sourceArrayIndex) {
10832
+ this.element.classList.add('drag-target-top');
10833
+ }
10834
+ else if (this.dataIndex()[this.dataIndex().length - 1] > +sourceArrayIndex) {
10835
+ this.element.classList.add('drag-target-bottom');
10836
+ }
10837
+ }
10838
+ });
10839
+ this.element.addEventListener('dragleave', (event) => {
10840
+ // Part 2 of the Dragster hack
10841
+ if (this.overChildElement) {
10842
+ this.overChildElement = false;
10843
+ }
10844
+ else if (this.overParentElement) {
10845
+ this.overParentElement = false;
10846
+ }
10847
+ const sourceArrayIndex = sessionStorage.getItem(this.arrayLayoutIndex);
10848
+ if (!this.overParentElement && !this.overChildElement && sourceArrayIndex !== null) {
10849
+ this.element.classList.remove('drag-target-top');
10850
+ this.element.classList.remove('drag-target-bottom');
10851
+ }
10852
+ });
10853
+ this.element.addEventListener('drop', (event) => {
10854
+ this.element.classList.remove('drag-target-top');
10855
+ this.element.classList.remove('drag-target-bottom');
10856
+ // Confirm that drop target is another item in the same array as source item
10857
+ const sourceArrayIndex = sessionStorage.getItem(this.arrayLayoutIndex);
10858
+ const destArrayIndex = this.dataIndex()[this.dataIndex().length - 1];
10859
+ if (sourceArrayIndex !== null && +sourceArrayIndex !== destArrayIndex) {
10860
+ // Move array item
10861
+ this.jsf.moveArrayItem(this, +sourceArrayIndex, destArrayIndex);
10862
+ }
10863
+ sessionStorage.removeItem(this.arrayLayoutIndex);
10864
+ return false;
10865
+ });
10866
+ });
10867
+ // Subscribe to the draggable state
10868
+ this.draggableStateSubscription = this.jsf.draggableState$.subscribe((value) => {
10869
+ this.element.draggable = value;
10870
+ });
10871
+ }
10872
+ }
10873
+ ngOnDestroy() {
10874
+ if (this.draggableStateSubscription) {
10875
+ this.draggableStateSubscription.unsubscribe();
10876
+ }
10877
+ }
10878
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: OrderableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
10879
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "17.3.12", type: OrderableDirective, selector: "[orderable]", inputs: { orderable: { classPropertyName: "orderable", publicName: "orderable", isSignal: true, isRequired: false, transformFunction: null }, layoutNode: { classPropertyName: "layoutNode", publicName: "layoutNode", isSignal: true, isRequired: false, transformFunction: null }, layoutIndex: { classPropertyName: "layoutIndex", publicName: "layoutIndex", isSignal: true, isRequired: false, transformFunction: null }, dataIndex: { classPropertyName: "dataIndex", publicName: "dataIndex", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
10880
+ }
10881
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: OrderableDirective, decorators: [{
10882
+ type: Directive,
10883
+ args: [{
10884
+ // tslint:disable-next-line:directive-selector
10885
+ selector: '[orderable]',
10886
+ }]
10887
+ }] });
10888
+
10709
10889
  const BASIC_WIDGETS = [
10710
10890
  AddReferenceComponent, OneOfComponent, ButtonComponent, CheckboxComponent,
10711
10891
  CheckboxesComponent, FileComponent, HiddenComponent, InputComponent,
@@ -10717,39 +10897,16 @@ const BASIC_WIDGETS = [
10717
10897
 
10718
10898
  class WidgetLibraryModule {
10719
10899
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: WidgetLibraryModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
10720
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: WidgetLibraryModule, declarations: [AddReferenceComponent, OneOfComponent, ButtonComponent, CheckboxComponent, CheckboxesComponent, FileComponent, HiddenComponent, InputComponent, MessageComponent, NoneComponent, NumberComponent, RadiosComponent, RootComponent, SectionComponent, SelectComponent, SelectFrameworkComponent, SelectWidgetComponent, SubmitComponent, TabComponent, TabsComponent, TemplateComponent, TextareaComponent, SelectCheckboxComponent, OrderableDirective, ElementAttributeDirective], imports: [CommonModule, FormsModule, ReactiveFormsModule, i2$1.SortablejsModule], exports: [AddReferenceComponent, OneOfComponent, ButtonComponent, CheckboxComponent, CheckboxesComponent, FileComponent, HiddenComponent, InputComponent, MessageComponent, NoneComponent, NumberComponent, RadiosComponent, RootComponent, SectionComponent, SelectComponent, SelectFrameworkComponent, SelectWidgetComponent, SubmitComponent, TabComponent, TabsComponent, TemplateComponent, TextareaComponent, SelectCheckboxComponent, OrderableDirective, ElementAttributeDirective] }); }
10721
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: WidgetLibraryModule, imports: [CommonModule, FormsModule, ReactiveFormsModule,
10722
- SortablejsModule.forRoot({
10723
- //disabled:false,
10724
- //draggable:".draggableitem",//">:not(.nonsort)",//">.draggable-item",//":not(.nonsort)",//">*",//":not(.nonsort)",//":not(.non-draggable)",
10725
- filter: ".sortable-filter",
10726
- preventOnFilter: false,
10727
- onMove: function (/**Event*/ evt, /**Event*/ originalEvent) {
10728
- if (evt.related.classList.contains("sortable-fixed")) {
10729
- //console.log(evt.related);
10730
- return false;
10731
- }
10732
- }
10733
- })] }); }
10900
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: WidgetLibraryModule, declarations: [AddReferenceComponent, OneOfComponent, ButtonComponent, CheckboxComponent, CheckboxesComponent, FileComponent, HiddenComponent, InputComponent, MessageComponent, NoneComponent, NumberComponent, RadiosComponent, RootComponent, SectionComponent, SelectComponent, SelectFrameworkComponent, SelectWidgetComponent, SubmitComponent, TabComponent, TabsComponent, TemplateComponent, TextareaComponent, SelectCheckboxComponent, OrderableDirective, ElementAttributeDirective, StopPropagationDirective], imports: [CommonModule, FormsModule, ReactiveFormsModule, DragDropModule], exports: [AddReferenceComponent, OneOfComponent, ButtonComponent, CheckboxComponent, CheckboxesComponent, FileComponent, HiddenComponent, InputComponent, MessageComponent, NoneComponent, NumberComponent, RadiosComponent, RootComponent, SectionComponent, SelectComponent, SelectFrameworkComponent, SelectWidgetComponent, SubmitComponent, TabComponent, TabsComponent, TemplateComponent, TextareaComponent, SelectCheckboxComponent, OrderableDirective, ElementAttributeDirective, StopPropagationDirective] }); }
10901
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: WidgetLibraryModule, imports: [CommonModule, FormsModule, ReactiveFormsModule, DragDropModule] }); }
10734
10902
  }
10735
10903
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: WidgetLibraryModule, decorators: [{
10736
10904
  type: NgModule,
10737
10905
  args: [{
10738
- imports: [CommonModule, FormsModule, ReactiveFormsModule,
10739
- SortablejsModule.forRoot({
10740
- //disabled:false,
10741
- //draggable:".draggableitem",//">:not(.nonsort)",//">.draggable-item",//":not(.nonsort)",//">*",//":not(.nonsort)",//":not(.non-draggable)",
10742
- filter: ".sortable-filter",
10743
- preventOnFilter: false,
10744
- onMove: function (/**Event*/ evt, /**Event*/ originalEvent) {
10745
- if (evt.related.classList.contains("sortable-fixed")) {
10746
- //console.log(evt.related);
10747
- return false;
10748
- }
10749
- }
10750
- })],
10751
- declarations: [...BASIC_WIDGETS, OrderableDirective, ElementAttributeDirective],
10752
- exports: [...BASIC_WIDGETS, OrderableDirective, ElementAttributeDirective]
10906
+ imports: [CommonModule, FormsModule, ReactiveFormsModule, DragDropModule
10907
+ ],
10908
+ declarations: [...BASIC_WIDGETS, OrderableDirective, ElementAttributeDirective, StopPropagationDirective],
10909
+ exports: [...BASIC_WIDGETS, OrderableDirective, ElementAttributeDirective, StopPropagationDirective]
10753
10910
  }]
10754
10911
  }] });
10755
10912
 
@@ -11524,7 +11681,7 @@ class JsonSchemaFormComponent {
11524
11681
  }
11525
11682
  }
11526
11683
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: JsonSchemaFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
11527
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "17.3.12", type: JsonSchemaFormComponent, selector: "json-schema-form", inputs: { schema: { classPropertyName: "schema", publicName: "schema", isSignal: true, isRequired: false, transformFunction: null }, layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, framework: { classPropertyName: "framework", publicName: "framework", isSignal: true, isRequired: false, transformFunction: null }, widgets: { classPropertyName: "widgets", publicName: "widgets", isSignal: true, isRequired: false, transformFunction: null }, form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: false, transformFunction: null }, model: { classPropertyName: "model", publicName: "model", isSignal: true, isRequired: false, transformFunction: null }, JSONSchema: { classPropertyName: "JSONSchema", publicName: "JSONSchema", isSignal: true, isRequired: false, transformFunction: null }, UISchema: { classPropertyName: "UISchema", publicName: "UISchema", isSignal: true, isRequired: false, transformFunction: null }, formData: { classPropertyName: "formData", publicName: "formData", isSignal: true, isRequired: false, transformFunction: null }, ngModel: { classPropertyName: "ngModel", publicName: "ngModel", isSignal: true, isRequired: false, transformFunction: null }, language: { classPropertyName: "language", publicName: "language", isSignal: true, isRequired: false, transformFunction: null }, loadExternalAssets: { classPropertyName: "loadExternalAssets", publicName: "loadExternalAssets", isSignal: true, isRequired: false, transformFunction: null }, debug: { classPropertyName: "debug", publicName: "debug", isSignal: true, isRequired: false, transformFunction: null }, theme: { classPropertyName: "theme", publicName: "theme", isSignal: true, isRequired: false, transformFunction: null }, ajvOptions: { classPropertyName: "ajvOptions", publicName: "ajvOptions", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { onChanges: "onChanges", onSubmit: "onSubmit", isValid: "isValid", validationErrors: "validationErrors", formSchema: "formSchema", formLayout: "formLayout", dataChange: "dataChange", modelChange: "modelChange", formDataChange: "formDataChange", ngModelChange: "ngModelChange" }, providers: [JsonSchemaFormService, JSON_SCHEMA_FORM_VALUE_ACCESSOR], usesOnChanges: true, ngImport: i0, template: "<form [autocomplete]=\"jsf?.formOptions?.autocomplete ? 'on' : 'off'\" class=\"json-schema-form\" (ngSubmit)=\"submitForm()\">\r\n <root-widget [layout]=\"jsf?.layout\"></root-widget>\r\n</form>\r\n<div *ngIf=\"debug() || jsf?.formOptions?.debug\">\r\n Debug output:\r\n <pre>{{debugOutput}}</pre>\r\n</div>", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: RootComponent, selector: "root-widget", inputs: ["dataIndex", "layoutIndex", "layout", "isOrderable", "isFlexItem"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
11684
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "17.3.12", type: JsonSchemaFormComponent, selector: "json-schema-form", inputs: { schema: { classPropertyName: "schema", publicName: "schema", isSignal: true, isRequired: false, transformFunction: null }, layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, framework: { classPropertyName: "framework", publicName: "framework", isSignal: true, isRequired: false, transformFunction: null }, widgets: { classPropertyName: "widgets", publicName: "widgets", isSignal: true, isRequired: false, transformFunction: null }, form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: false, transformFunction: null }, model: { classPropertyName: "model", publicName: "model", isSignal: true, isRequired: false, transformFunction: null }, JSONSchema: { classPropertyName: "JSONSchema", publicName: "JSONSchema", isSignal: true, isRequired: false, transformFunction: null }, UISchema: { classPropertyName: "UISchema", publicName: "UISchema", isSignal: true, isRequired: false, transformFunction: null }, formData: { classPropertyName: "formData", publicName: "formData", isSignal: true, isRequired: false, transformFunction: null }, ngModel: { classPropertyName: "ngModel", publicName: "ngModel", isSignal: true, isRequired: false, transformFunction: null }, language: { classPropertyName: "language", publicName: "language", isSignal: true, isRequired: false, transformFunction: null }, loadExternalAssets: { classPropertyName: "loadExternalAssets", publicName: "loadExternalAssets", isSignal: true, isRequired: false, transformFunction: null }, debug: { classPropertyName: "debug", publicName: "debug", isSignal: true, isRequired: false, transformFunction: null }, theme: { classPropertyName: "theme", publicName: "theme", isSignal: true, isRequired: false, transformFunction: null }, ajvOptions: { classPropertyName: "ajvOptions", publicName: "ajvOptions", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { onChanges: "onChanges", onSubmit: "onSubmit", isValid: "isValid", validationErrors: "validationErrors", formSchema: "formSchema", formLayout: "formLayout", dataChange: "dataChange", modelChange: "modelChange", formDataChange: "formDataChange", ngModelChange: "ngModelChange" }, providers: [JsonSchemaFormService, JSON_SCHEMA_FORM_VALUE_ACCESSOR], usesOnChanges: true, ngImport: i0, template: "<form [autocomplete]=\"jsf?.formOptions?.autocomplete ? 'on' : 'off'\" class=\"json-schema-form\" (ngSubmit)=\"submitForm()\">\r\n <root-widget [layout]=\"jsf?.layout\"></root-widget>\r\n</form>\r\n<div *ngIf=\"debug() || jsf?.formOptions?.debug\">\r\n Debug output:\r\n <pre>{{debugOutput}}</pre>\r\n</div>", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: RootComponent, selector: "root-widget", inputs: ["dataIndex", "layoutIndex", "layout", "isOrderable", "isFlexItem", "memoizationEnabled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
11528
11685
  }
11529
11686
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: JsonSchemaFormComponent, decorators: [{
11530
11687
  type: Component,
@@ -11560,5 +11717,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
11560
11717
  * Generated bundle index. Do not edit.
11561
11718
  */
11562
11719
 
11563
- 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 };
11720
+ 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 };
11564
11721
  //# sourceMappingURL=ng-formworks-core.mjs.map