@ng-formworks/core 17.6.5 → 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.
- package/esm2022/lib/json-schema-form.component.mjs +1 -1
- package/esm2022/lib/json-schema-form.service.mjs +25 -17
- package/esm2022/lib/shared/form-group.functions.mjs +52 -3
- package/esm2022/lib/shared/layout.functions.mjs +32 -9
- package/esm2022/lib/widget-library/add-reference.component.mjs +13 -6
- package/esm2022/lib/widget-library/button.component.mjs +9 -4
- package/esm2022/lib/widget-library/checkbox.component.mjs +2 -1
- package/esm2022/lib/widget-library/index.mjs +2 -1
- package/esm2022/lib/widget-library/input.component.mjs +9 -4
- package/esm2022/lib/widget-library/number.component.mjs +9 -6
- package/esm2022/lib/widget-library/root.component.mjs +167 -124
- package/esm2022/lib/widget-library/section.component.mjs +2 -2
- package/esm2022/lib/widget-library/select-framework.component.mjs +9 -5
- package/esm2022/lib/widget-library/select-widget.component.mjs +5 -4
- package/esm2022/lib/widget-library/stop-propagation.directive.mjs +42 -0
- package/esm2022/lib/widget-library/submit.component.mjs +9 -4
- package/esm2022/lib/widget-library/tab.component.mjs +1 -1
- package/esm2022/lib/widget-library/widget-library.module.mjs +9 -32
- package/fesm2022/ng-formworks-core.mjs +500 -334
- package/fesm2022/ng-formworks-core.mjs.map +1 -1
- package/lib/json-schema-form.service.d.ts +0 -3
- package/lib/widget-library/index.d.ts +1 -0
- package/lib/widget-library/root.component.d.ts +25 -7
- package/lib/widget-library/select-framework.component.d.ts +2 -1
- package/lib/widget-library/select-widget.component.d.ts +2 -2
- package/lib/widget-library/stop-propagation.directive.d.ts +13 -0
- package/lib/widget-library/widget-library.module.d.ts +5 -4
- 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,
|
|
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 '
|
|
23
|
-
import {
|
|
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[
|
|
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[
|
|
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
|
-
|
|
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
|
}
|
|
@@ -6456,7 +6507,8 @@ function buildLayoutFromSchema(jsf, widgetLibrary, nodeValue = null, schemaPoint
|
|
|
6456
6507
|
'/properties/' + innerItemLevel2.name : innerItemLevel2.name;
|
|
6457
6508
|
//innerItemLevel2.oneOfPointer = schemaPointer + keySchemaPointer + l2SchemaPointer;
|
|
6458
6509
|
// innerItemLevel2.schemaPointer=innerItemLevel2.schemaPointer;
|
|
6459
|
-
|
|
6510
|
+
const ofPointer = { anyOf: "anyOfPointer", oneOf: "oneOfPointer" }[ofType];
|
|
6511
|
+
innerItemLevel2[ofPointer] = ofPointer ? innerItemLevel2.schemaPointer : undefined;
|
|
6460
6512
|
});
|
|
6461
6513
|
}
|
|
6462
6514
|
//TODO review-will never reach here if forRefLibrary==true
|
|
@@ -6466,6 +6518,9 @@ function buildLayoutFromSchema(jsf, widgetLibrary, nodeValue = null, schemaPoint
|
|
|
6466
6518
|
innerItem.forEach(item => {
|
|
6467
6519
|
const l2SchemaPointer = hasOwn(ofItem, 'properties') ?
|
|
6468
6520
|
'/properties/' + item.name : item.name;
|
|
6521
|
+
if (ofType == "anyOf") {
|
|
6522
|
+
item.anyOfPointer = item.schemaPointer;
|
|
6523
|
+
}
|
|
6469
6524
|
if (outerOneOfItem) {
|
|
6470
6525
|
////item.oneOfPointer = schemaPointer + keySchemaPointer + l2SchemaPointer;
|
|
6471
6526
|
//schemaPointer + keySchemaPointer + item.dataPointer;
|
|
@@ -6489,7 +6544,8 @@ function buildLayoutFromSchema(jsf, widgetLibrary, nodeValue = null, schemaPoint
|
|
|
6489
6544
|
}
|
|
6490
6545
|
else {
|
|
6491
6546
|
if (outerOneOfItem) {
|
|
6492
|
-
|
|
6547
|
+
const ofPointer = { anyOf: "anyOfPointer", oneOf: "oneOfPointer" }[ofType];
|
|
6548
|
+
innerItem[ofPointer] = ofPointer ? schemaPointer + keySchemaPointer : undefined;
|
|
6493
6549
|
////innerItem.schemaPointer=innerItem.oneOfPointer;
|
|
6494
6550
|
outerOneOfItem.items = outerOneOfItem.items || [];
|
|
6495
6551
|
outerOneOfItem.items.push(innerItem);
|
|
@@ -6582,6 +6638,13 @@ function buildLayoutFromSchema(jsf, widgetLibrary, nodeValue = null, schemaPoint
|
|
|
6582
6638
|
itemRefPointer !== shortDataPointer + '/' + i;
|
|
6583
6639
|
// If removable, add tuple item layout to layoutRefLibrary
|
|
6584
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
|
+
}
|
|
6585
6648
|
if (!hasOwn(jsf.layoutRefLibrary, itemRefPointer)) {
|
|
6586
6649
|
// Set to null first to prevent recursive reference from causing endless loop
|
|
6587
6650
|
jsf.layoutRefLibrary[itemRefPointer] = null;
|
|
@@ -6589,9 +6652,10 @@ function buildLayoutFromSchema(jsf, widgetLibrary, nodeValue = null, schemaPoint
|
|
|
6589
6652
|
if (itemRecursive) {
|
|
6590
6653
|
jsf.layoutRefLibrary[itemRefPointer].recursiveReference = true;
|
|
6591
6654
|
}
|
|
6655
|
+
jsf.layoutRefLibrary[conditionalRefPointer] = jsf.layoutRefLibrary[itemRefPointer];
|
|
6592
6656
|
}
|
|
6593
6657
|
newItem = getLayoutNode({
|
|
6594
|
-
$ref:
|
|
6658
|
+
$ref: templateRefToUse,
|
|
6595
6659
|
dataPointer: dataPointer + '/' + i,
|
|
6596
6660
|
recursiveReference: itemRecursive,
|
|
6597
6661
|
}, jsf, widgetLibrary, isArray(nodeValue) ? nodeValue[i] : null);
|
|
@@ -6617,6 +6681,13 @@ function buildLayoutFromSchema(jsf, widgetLibrary, nodeValue = null, schemaPoint
|
|
|
6617
6681
|
const itemRecursive = !itemRefPointer.length ||
|
|
6618
6682
|
itemRefPointer !== shortDataPointer + '/-';
|
|
6619
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
|
+
}
|
|
6620
6691
|
// Add list item layout to layoutRefLibrary
|
|
6621
6692
|
if (itemRefPointer.length && !hasOwn(jsf.layoutRefLibrary, itemRefPointer)) {
|
|
6622
6693
|
// Set to null first to prevent recursive reference from causing endless loop
|
|
@@ -6625,6 +6696,7 @@ function buildLayoutFromSchema(jsf, widgetLibrary, nodeValue = null, schemaPoint
|
|
|
6625
6696
|
if (itemRecursive) {
|
|
6626
6697
|
jsf.layoutRefLibrary[itemRefPointer].recursiveReference = true;
|
|
6627
6698
|
}
|
|
6699
|
+
jsf.layoutRefLibrary[conditionalRefPointer] = jsf.layoutRefLibrary[itemRefPointer];
|
|
6628
6700
|
}
|
|
6629
6701
|
// Add any additional default items
|
|
6630
6702
|
if (!itemRecursive || newNode.options.required) {
|
|
@@ -6633,7 +6705,7 @@ function buildLayoutFromSchema(jsf, widgetLibrary, nodeValue = null, schemaPoint
|
|
|
6633
6705
|
if (newNode.items.length < arrayLength) {
|
|
6634
6706
|
for (let i = newNode.items.length; i < arrayLength; i++) {
|
|
6635
6707
|
newNode.items.push(getLayoutNode({
|
|
6636
|
-
$ref:
|
|
6708
|
+
$ref: templateRefToUse,
|
|
6637
6709
|
dataPointer: dataPointer + '/-',
|
|
6638
6710
|
recursiveReference: itemRecursive,
|
|
6639
6711
|
}, jsf, widgetLibrary, isArray(nodeValue) ? nodeValue[i] : null));
|
|
@@ -6668,7 +6740,7 @@ function buildLayoutFromSchema(jsf, widgetLibrary, nodeValue = null, schemaPoint
|
|
|
6668
6740
|
recursiveReference: itemRecursive,
|
|
6669
6741
|
type: '$ref',
|
|
6670
6742
|
widget: widgetLibrary.getWidget('$ref'),
|
|
6671
|
-
$ref: itemRefPointer,
|
|
6743
|
+
$ref: templateRefToUse //itemRefPointer,
|
|
6672
6744
|
});
|
|
6673
6745
|
}
|
|
6674
6746
|
}
|
|
@@ -7019,9 +7091,6 @@ class JsonSchemaFormService {
|
|
|
7019
7091
|
setDraggableState(value) {
|
|
7020
7092
|
this.draggableStateSubject.next(value); // Update the draggable value
|
|
7021
7093
|
}
|
|
7022
|
-
setSortableOptions(value) {
|
|
7023
|
-
this.sortableOptionsSubject.next(value); // Update the sortable options value
|
|
7024
|
-
}
|
|
7025
7094
|
createAjvInstance(ajvOptions) {
|
|
7026
7095
|
let ajvInstance = new Ajv2019(ajvOptions);
|
|
7027
7096
|
ajvInstance.addMetaSchema(jsonDraft6);
|
|
@@ -7142,17 +7211,12 @@ class JsonSchemaFormService {
|
|
|
7142
7211
|
//and will only be enabled when/if the caller sets the value back to true
|
|
7143
7212
|
this.draggableStateSubject = new BehaviorSubject(true); // Default value true
|
|
7144
7213
|
this.draggableState$ = this.draggableStateSubject.asObservable();
|
|
7145
|
-
//this is introduced to look at replacing the orderable directive with
|
|
7146
|
-
//nxt-sortablejs and sortablejs
|
|
7147
|
-
this.sortableOptionsSubject = new BehaviorSubject({ disabled: false }); // Default value true
|
|
7148
|
-
this.sortableOptions$ = this.sortableOptionsSubject.asObservable();
|
|
7149
7214
|
this.ajvRegistry = {};
|
|
7150
7215
|
this.setLanguage(this.language);
|
|
7151
7216
|
this.ajv.addMetaSchema(jsonDraft6);
|
|
7152
7217
|
this.ajv.addMetaSchema(jsonDraft7);
|
|
7153
7218
|
addFormats(this.ajv);
|
|
7154
7219
|
this.ajvRegistry['default'] = { name: 'default', ajvInstance: this.ajv, ajvValidator: null };
|
|
7155
|
-
console.log(this.ajvRegistry);
|
|
7156
7220
|
// Add custom 'duration' format using a regex
|
|
7157
7221
|
/*
|
|
7158
7222
|
this.ajv.addFormat("duration", {
|
|
@@ -7284,12 +7348,12 @@ class JsonSchemaFormService {
|
|
|
7284
7348
|
this.formGroup = buildFormGroup(this.formGroupTemplate);
|
|
7285
7349
|
if (this.formGroup) {
|
|
7286
7350
|
this.compileAjvSchema(ajvInstanceName);
|
|
7287
|
-
this.validateData(this.formGroup.
|
|
7351
|
+
this.validateData(this.formGroup.getRawValue(), true, ajvInstanceName);
|
|
7288
7352
|
// Set up observables to emit data and validation info when form data changes
|
|
7289
7353
|
if (this.formValueSubscription) {
|
|
7290
7354
|
this.formValueSubscription.unsubscribe();
|
|
7291
7355
|
}
|
|
7292
|
-
this.formValueSubscription = this.formGroup.valueChanges.subscribe(formValue => this.validateData(
|
|
7356
|
+
this.formValueSubscription = this.formGroup.valueChanges.subscribe(formValue => this.validateData(this.formGroup.getRawValue(), true, ajvInstanceName));
|
|
7293
7357
|
}
|
|
7294
7358
|
}
|
|
7295
7359
|
buildLayout(widgetLibrary) {
|
|
@@ -7408,6 +7472,12 @@ class JsonSchemaFormService {
|
|
|
7408
7472
|
}
|
|
7409
7473
|
return '';
|
|
7410
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]"
|
|
7411
7481
|
setArrayItemTitle(parentCtx = {}, childNode = null, index = null) {
|
|
7412
7482
|
//for legacy compatibility, parentCtx.layoutNode could either be a value
|
|
7413
7483
|
//or have been converted to use Signals
|
|
@@ -7500,7 +7570,8 @@ class JsonSchemaFormService {
|
|
|
7500
7570
|
//introduced to check if the node is part of ITE conditional
|
|
7501
7571
|
//then change or add the control
|
|
7502
7572
|
if (layoutNode?.schemaPointer && layoutNode.isITEItem ||
|
|
7503
|
-
(layoutNode?.schemaPointer && layoutNode?.oneOfPointer)
|
|
7573
|
+
(layoutNode?.schemaPointer && layoutNode?.oneOfPointer) ||
|
|
7574
|
+
layoutNode?.schemaPointer && layoutNode.anyOfPointer) {
|
|
7504
7575
|
//before changing control, need to set the new data type for data formatting
|
|
7505
7576
|
const schemaType = this.dataMap.get(layoutNode?.dataPointer).get("schemaType");
|
|
7506
7577
|
if (schemaType != layoutNode.dataType) {
|
|
@@ -7543,9 +7614,12 @@ class JsonSchemaFormService {
|
|
|
7543
7614
|
//set, as the control would only be initialized when the condition is true
|
|
7544
7615
|
//TODO-review need to decide which of the data sets between data,formValues and default
|
|
7545
7616
|
//to use for the value
|
|
7546
|
-
|
|
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) {
|
|
7547
7621
|
const dataPointer = this.getDataPointer(ctx);
|
|
7548
|
-
const controlValue = ctx.formControl
|
|
7622
|
+
const controlValue = ctx.formControl?.value;
|
|
7549
7623
|
const dataValue = JsonPointer.has(this.data, dataPointer) ?
|
|
7550
7624
|
JsonPointer.get(this.data, dataPointer) : undefined;
|
|
7551
7625
|
const formValue = JsonPointer.has(this.formValues, dataPointer) ?
|
|
@@ -7676,7 +7750,8 @@ class JsonSchemaFormService {
|
|
|
7676
7750
|
}
|
|
7677
7751
|
const schemaPointer = ctx.layoutNode()?.isITEItem ? ctx.layoutNode()?.schemaPointer : null;
|
|
7678
7752
|
const oneOfPointer = ctx.layoutNode()?.oneOfPointer;
|
|
7679
|
-
|
|
7753
|
+
const anyOfPointer = ctx.layoutNode()?.anyOfPointer;
|
|
7754
|
+
return getControl(this.formGroup, this.getDataPointer(ctx), false, schemaPointer || oneOfPointer || anyOfPointer);
|
|
7680
7755
|
}
|
|
7681
7756
|
setFormControl(ctx, control) {
|
|
7682
7757
|
if (!ctx || !ctx.layoutNode ||
|
|
@@ -7694,7 +7769,8 @@ class JsonSchemaFormService {
|
|
|
7694
7769
|
}
|
|
7695
7770
|
const schemaPointer = ctx.layoutNode()?.isITEItem ? ctx.layoutNode()?.schemaPointer : null;
|
|
7696
7771
|
const oneOfPointer = ctx.layoutNode()?.oneOfPointer;
|
|
7697
|
-
const
|
|
7772
|
+
const anyOfPointer = ctx.layoutNode()?.anyOfPointer;
|
|
7773
|
+
const control = getControl(this.formGroup, this.getDataPointer(ctx), false, schemaPointer || oneOfPointer || anyOfPointer);
|
|
7698
7774
|
return control ? control.value : null;
|
|
7699
7775
|
}
|
|
7700
7776
|
getFormControlGroup(ctx) {
|
|
@@ -7703,7 +7779,8 @@ class JsonSchemaFormService {
|
|
|
7703
7779
|
}
|
|
7704
7780
|
const schemaPointer = ctx.layoutNode()?.isITEItem ? ctx.layoutNode()?.schemaPointer : null;
|
|
7705
7781
|
const oneOfPointer = ctx.layoutNode()?.oneOfPointer;
|
|
7706
|
-
|
|
7782
|
+
const anyOfPointer = ctx.layoutNode()?.anyOfPointer;
|
|
7783
|
+
return getControl(this.formGroup, this.getDataPointer(ctx), true, schemaPointer || oneOfPointer || anyOfPointer);
|
|
7707
7784
|
}
|
|
7708
7785
|
getFormControlName(ctx) {
|
|
7709
7786
|
if (!ctx || !ctx.layoutNode ||
|
|
@@ -7791,6 +7868,9 @@ class JsonSchemaFormService {
|
|
|
7791
7868
|
}
|
|
7792
7869
|
// Move item in the formArray
|
|
7793
7870
|
const formArray = this.getFormControlGroup(ctx);
|
|
7871
|
+
if (oldIndex >= formArray.length) {
|
|
7872
|
+
return false;
|
|
7873
|
+
}
|
|
7794
7874
|
const arrayItem = formArray.at(oldIndex);
|
|
7795
7875
|
formArray.removeAt(oldIndex);
|
|
7796
7876
|
formArray.insert(newIndex, arrayItem);
|
|
@@ -7841,7 +7921,7 @@ class SelectWidgetComponent {
|
|
|
7841
7921
|
ngOnInit() {
|
|
7842
7922
|
this.updateComponent();
|
|
7843
7923
|
}
|
|
7844
|
-
ngOnChanges() {
|
|
7924
|
+
ngOnChanges(changes) {
|
|
7845
7925
|
this.updateComponent();
|
|
7846
7926
|
}
|
|
7847
7927
|
updateComponent() {
|
|
@@ -7850,8 +7930,9 @@ class SelectWidgetComponent {
|
|
|
7850
7930
|
this.newComponent = widgetContainer.createComponent((this.layoutNode().widget));
|
|
7851
7931
|
}
|
|
7852
7932
|
if (this.newComponent) {
|
|
7853
|
-
for (const
|
|
7854
|
-
this.newComponent.instance[
|
|
7933
|
+
for (const inp of ['layoutNode', 'layoutIndex', 'dataIndex']) {
|
|
7934
|
+
//this.newComponent.instance[inp] = this[inp];
|
|
7935
|
+
this.newComponent.setInput(inp, this[inp]());
|
|
7855
7936
|
}
|
|
7856
7937
|
}
|
|
7857
7938
|
}
|
|
@@ -7927,6 +8008,46 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
7927
8008
|
type: Input
|
|
7928
8009
|
}] } });
|
|
7929
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
|
+
|
|
7930
8051
|
class AddReferenceComponent {
|
|
7931
8052
|
constructor() {
|
|
7932
8053
|
this.jsf = inject(JsonSchemaFormService);
|
|
@@ -7958,13 +8079,16 @@ class AddReferenceComponent {
|
|
|
7958
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: `
|
|
7959
8080
|
<section [class]="options?.htmlClass || ''" align="end">
|
|
7960
8081
|
<button *ngIf="showAddButton"
|
|
7961
|
-
[class]="options?.fieldHtmlClass || ''"
|
|
8082
|
+
[class]="options?.fieldHtmlClass || ''"
|
|
7962
8083
|
[disabled]="options?.readonly"
|
|
7963
|
-
(click)="addItem($event)"
|
|
8084
|
+
(click)="addItem($event)"
|
|
8085
|
+
[appStopPropagation]="['mousedown', 'touchstart']"
|
|
8086
|
+
>
|
|
7964
8087
|
<span *ngIf="options?.icon" [class]="options?.icon"></span>
|
|
7965
8088
|
<span *ngIf="options?.title" [innerHTML]="buttonText"></span>
|
|
8089
|
+
|
|
7966
8090
|
</button>
|
|
7967
|
-
</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 }); }
|
|
7968
8092
|
}
|
|
7969
8093
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AddReferenceComponent, decorators: [{
|
|
7970
8094
|
type: Component,
|
|
@@ -7974,11 +8098,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
7974
8098
|
template: `
|
|
7975
8099
|
<section [class]="options?.htmlClass || ''" align="end">
|
|
7976
8100
|
<button *ngIf="showAddButton"
|
|
7977
|
-
[class]="options?.fieldHtmlClass || ''"
|
|
8101
|
+
[class]="options?.fieldHtmlClass || ''"
|
|
7978
8102
|
[disabled]="options?.readonly"
|
|
7979
|
-
(click)="addItem($event)"
|
|
8103
|
+
(click)="addItem($event)"
|
|
8104
|
+
[appStopPropagation]="['mousedown', 'touchstart']"
|
|
8105
|
+
>
|
|
7980
8106
|
<span *ngIf="options?.icon" [class]="options?.icon"></span>
|
|
7981
8107
|
<span *ngIf="options?.title" [innerHTML]="buttonText"></span>
|
|
8108
|
+
|
|
7982
8109
|
</button>
|
|
7983
8110
|
</section>`,
|
|
7984
8111
|
changeDetection: ChangeDetectionStrategy.Default,
|
|
@@ -8021,12 +8148,14 @@ class ButtonComponent {
|
|
|
8021
8148
|
[name]="controlName"
|
|
8022
8149
|
[type]="layoutNode()?.type"
|
|
8023
8150
|
[value]="controlValue"
|
|
8024
|
-
(click)="updateValue($event)"
|
|
8151
|
+
(click)="updateValue($event)"
|
|
8152
|
+
[appStopPropagation]="['mousedown', 'touchstart']"
|
|
8153
|
+
>
|
|
8025
8154
|
<span *ngIf="options?.icon || options?.title"
|
|
8026
8155
|
[class]="options?.icon"
|
|
8027
8156
|
[innerHTML]="options?.title"></span>
|
|
8028
8157
|
</button>
|
|
8029
|
-
</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"] }] }); }
|
|
8030
8159
|
}
|
|
8031
8160
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ButtonComponent, decorators: [{
|
|
8032
8161
|
type: Component,
|
|
@@ -8044,7 +8173,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
8044
8173
|
[name]="controlName"
|
|
8045
8174
|
[type]="layoutNode()?.type"
|
|
8046
8175
|
[value]="controlValue"
|
|
8047
|
-
(click)="updateValue($event)"
|
|
8176
|
+
(click)="updateValue($event)"
|
|
8177
|
+
[appStopPropagation]="['mousedown', 'touchstart']"
|
|
8178
|
+
>
|
|
8048
8179
|
<span *ngIf="options?.icon || options?.title"
|
|
8049
8180
|
[class]="options?.icon"
|
|
8050
8181
|
[innerHTML]="options?.title"></span>
|
|
@@ -8057,6 +8188,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
8057
8188
|
//this mainly affects checkboxes coupled with conditions
|
|
8058
8189
|
//-the value is rechecked
|
|
8059
8190
|
//-see https://github.com/SortableJS/Sortable/issues/1052#issuecomment-369613072
|
|
8191
|
+
//-switched to angular cdk for dnd
|
|
8060
8192
|
class CheckboxComponent {
|
|
8061
8193
|
constructor() {
|
|
8062
8194
|
this.jsf = inject(JsonSchemaFormService);
|
|
@@ -8412,7 +8544,7 @@ class InputComponent {
|
|
|
8412
8544
|
}
|
|
8413
8545
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: InputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
8414
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: `
|
|
8415
|
-
<div [class]="options?.htmlClass || ''"
|
|
8547
|
+
<div [class]="options?.htmlClass || ''" >
|
|
8416
8548
|
<label *ngIf="options?.title"
|
|
8417
8549
|
[attr.for]="'control' + layoutNode()?._id"
|
|
8418
8550
|
[class]="options?.labelHtmlClass || ''"
|
|
@@ -8433,6 +8565,7 @@ class InputComponent {
|
|
|
8433
8565
|
[readonly]="options?.readonly ? 'readonly' : null"
|
|
8434
8566
|
[type]="layoutNode()?.type"
|
|
8435
8567
|
[attributes]="inputAttributes"
|
|
8568
|
+
[appStopPropagation]="['mousedown', 'touchstart']"
|
|
8436
8569
|
>
|
|
8437
8570
|
<input *ngIf="!boundControl"
|
|
8438
8571
|
[attr.aria-describedby]="'control' + layoutNode()?._id + 'Status'"
|
|
@@ -8451,12 +8584,13 @@ class InputComponent {
|
|
|
8451
8584
|
[value]="controlValue"
|
|
8452
8585
|
(input)="updateValue($event)"
|
|
8453
8586
|
[attributes]="inputAttributes"
|
|
8587
|
+
[appStopPropagation]="['mousedown', 'touchstart']"
|
|
8454
8588
|
>
|
|
8455
8589
|
<datalist *ngIf="options?.typeahead?.source"
|
|
8456
8590
|
[id]="'control' + layoutNode()?._id + 'Autocomplete'">
|
|
8457
8591
|
<option *ngFor="let word of options?.typeahead?.source" [value]="word">
|
|
8458
8592
|
</datalist>
|
|
8459
|
-
</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"] }] }); }
|
|
8460
8594
|
}
|
|
8461
8595
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: InputComponent, decorators: [{
|
|
8462
8596
|
type: Component,
|
|
@@ -8464,7 +8598,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
8464
8598
|
// tslint:disable-next-line:component-selector
|
|
8465
8599
|
selector: 'input-widget',
|
|
8466
8600
|
template: `
|
|
8467
|
-
<div [class]="options?.htmlClass || ''"
|
|
8601
|
+
<div [class]="options?.htmlClass || ''" >
|
|
8468
8602
|
<label *ngIf="options?.title"
|
|
8469
8603
|
[attr.for]="'control' + layoutNode()?._id"
|
|
8470
8604
|
[class]="options?.labelHtmlClass || ''"
|
|
@@ -8485,6 +8619,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
8485
8619
|
[readonly]="options?.readonly ? 'readonly' : null"
|
|
8486
8620
|
[type]="layoutNode()?.type"
|
|
8487
8621
|
[attributes]="inputAttributes"
|
|
8622
|
+
[appStopPropagation]="['mousedown', 'touchstart']"
|
|
8488
8623
|
>
|
|
8489
8624
|
<input *ngIf="!boundControl"
|
|
8490
8625
|
[attr.aria-describedby]="'control' + layoutNode()?._id + 'Status'"
|
|
@@ -8503,6 +8638,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
8503
8638
|
[value]="controlValue"
|
|
8504
8639
|
(input)="updateValue($event)"
|
|
8505
8640
|
[attributes]="inputAttributes"
|
|
8641
|
+
[appStopPropagation]="['mousedown', 'touchstart']"
|
|
8506
8642
|
>
|
|
8507
8643
|
<datalist *ngIf="options?.typeahead?.source"
|
|
8508
8644
|
[id]="'control' + layoutNode()?._id + 'Autocomplete'">
|
|
@@ -8594,7 +8730,7 @@ class NumberComponent {
|
|
|
8594
8730
|
}
|
|
8595
8731
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: NumberComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
8596
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: `
|
|
8597
|
-
<div #divElt [class]="options?.htmlClass || ''"
|
|
8733
|
+
<div #divElt [class]="options?.htmlClass || ''" >
|
|
8598
8734
|
<label *ngIf="options?.title"
|
|
8599
8735
|
[attr.for]="'control' + layoutNode()?._id"
|
|
8600
8736
|
[class]="options?.labelHtmlClass || ''"
|
|
@@ -8616,7 +8752,7 @@ class NumberComponent {
|
|
|
8616
8752
|
[title]="lastValidNumber"
|
|
8617
8753
|
[type]="layoutNode()?.type === 'range' ? 'range' : 'number'"
|
|
8618
8754
|
[attributes]="inputAttributes"
|
|
8619
|
-
|
|
8755
|
+
[appStopPropagation]="['mousedown', 'touchstart']"
|
|
8620
8756
|
>
|
|
8621
8757
|
<input #inputControl *ngIf="!boundControl"
|
|
8622
8758
|
[attr.aria-describedby]="'control' + layoutNode()?._id + 'Status'"
|
|
@@ -8636,9 +8772,10 @@ class NumberComponent {
|
|
|
8636
8772
|
[value]="controlValue"
|
|
8637
8773
|
(input)="updateValue($event)"
|
|
8638
8774
|
[attributes]="inputAttributes"
|
|
8775
|
+
[appStopPropagation]="['mousedown', 'touchstart']"
|
|
8639
8776
|
>
|
|
8640
8777
|
<span *ngIf="layoutNode()?.type === 'range'" [innerHTML]="controlValue"></span>
|
|
8641
|
-
</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"] }] }); }
|
|
8642
8779
|
}
|
|
8643
8780
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: NumberComponent, decorators: [{
|
|
8644
8781
|
type: Component,
|
|
@@ -8646,7 +8783,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
8646
8783
|
// tslint:disable-next-line:component-selector
|
|
8647
8784
|
selector: 'number-widget',
|
|
8648
8785
|
template: `
|
|
8649
|
-
<div #divElt [class]="options?.htmlClass || ''"
|
|
8786
|
+
<div #divElt [class]="options?.htmlClass || ''" >
|
|
8650
8787
|
<label *ngIf="options?.title"
|
|
8651
8788
|
[attr.for]="'control' + layoutNode()?._id"
|
|
8652
8789
|
[class]="options?.labelHtmlClass || ''"
|
|
@@ -8668,7 +8805,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
8668
8805
|
[title]="lastValidNumber"
|
|
8669
8806
|
[type]="layoutNode()?.type === 'range' ? 'range' : 'number'"
|
|
8670
8807
|
[attributes]="inputAttributes"
|
|
8671
|
-
|
|
8808
|
+
[appStopPropagation]="['mousedown', 'touchstart']"
|
|
8672
8809
|
>
|
|
8673
8810
|
<input #inputControl *ngIf="!boundControl"
|
|
8674
8811
|
[attr.aria-describedby]="'control' + layoutNode()?._id + 'Status'"
|
|
@@ -8688,6 +8825,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
8688
8825
|
[value]="controlValue"
|
|
8689
8826
|
(input)="updateValue($event)"
|
|
8690
8827
|
[attributes]="inputAttributes"
|
|
8828
|
+
[appStopPropagation]="['mousedown', 'touchstart']"
|
|
8691
8829
|
>
|
|
8692
8830
|
<span *ngIf="layoutNode()?.type === 'range'" [innerHTML]="controlValue"></span>
|
|
8693
8831
|
</div>`,
|
|
@@ -8703,6 +8841,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
8703
8841
|
class SelectFrameworkComponent {
|
|
8704
8842
|
constructor() {
|
|
8705
8843
|
this.jsf = inject(JsonSchemaFormService);
|
|
8844
|
+
this.changeDetectorRef = inject(ChangeDetectorRef);
|
|
8706
8845
|
this.newComponent = null;
|
|
8707
8846
|
this.layoutNode = input(undefined);
|
|
8708
8847
|
this.layoutIndex = input(undefined);
|
|
@@ -8712,7 +8851,7 @@ class SelectFrameworkComponent {
|
|
|
8712
8851
|
ngOnInit() {
|
|
8713
8852
|
this.updateComponent();
|
|
8714
8853
|
}
|
|
8715
|
-
ngOnChanges() {
|
|
8854
|
+
ngOnChanges(changes) {
|
|
8716
8855
|
this.updateComponent();
|
|
8717
8856
|
}
|
|
8718
8857
|
updateComponent() {
|
|
@@ -8723,9 +8862,12 @@ class SelectFrameworkComponent {
|
|
|
8723
8862
|
//this.widgetContainer.createComponent<any>(this.jsf.framework)
|
|
8724
8863
|
}
|
|
8725
8864
|
if (this.newComponent) {
|
|
8726
|
-
for (const
|
|
8727
|
-
this.newComponent.instance[
|
|
8865
|
+
for (const inp of ['layoutNode', 'layoutIndex', 'dataIndex']) {
|
|
8866
|
+
//this.newComponent.instance[inp] = this[inp];
|
|
8867
|
+
this.newComponent.setInput(inp, this[inp]());
|
|
8728
8868
|
}
|
|
8869
|
+
// Manually trigger change detection after updating inputs
|
|
8870
|
+
//this.changeDetectorRef.detectChanges();
|
|
8729
8871
|
}
|
|
8730
8872
|
}
|
|
8731
8873
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SelectFrameworkComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
@@ -9147,132 +9289,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
9147
9289
|
}]
|
|
9148
9290
|
}] });
|
|
9149
9291
|
|
|
9150
|
-
/**
|
|
9151
|
-
* OrderableDirective
|
|
9152
|
-
*
|
|
9153
|
-
* Enables array elements to be reordered by dragging and dropping.
|
|
9154
|
-
*
|
|
9155
|
-
* Only works for arrays that have at least two elements.
|
|
9156
|
-
*
|
|
9157
|
-
* Also detects arrays-within-arrays, and correctly moves either
|
|
9158
|
-
* the child array element or the parent array element,
|
|
9159
|
-
* depending on the drop targert.
|
|
9160
|
-
*
|
|
9161
|
-
* Listeners for movable element being dragged:
|
|
9162
|
-
* - dragstart: add 'dragging' class to element, set effectAllowed = 'move'
|
|
9163
|
-
* - dragover: set dropEffect = 'move'
|
|
9164
|
-
* - dragend: remove 'dragging' class from element
|
|
9165
|
-
*
|
|
9166
|
-
* Listeners for stationary items being dragged over:
|
|
9167
|
-
* - dragenter: add 'drag-target-...' classes to element
|
|
9168
|
-
* - dragleave: remove 'drag-target-...' classes from element
|
|
9169
|
-
* - drop: remove 'drag-target-...' classes from element, move dropped array item
|
|
9170
|
-
*/
|
|
9171
|
-
class OrderableDirective {
|
|
9172
|
-
constructor() {
|
|
9173
|
-
this.elementRef = inject(ElementRef);
|
|
9174
|
-
this.jsf = inject(JsonSchemaFormService);
|
|
9175
|
-
this.ngZone = inject(NgZone);
|
|
9176
|
-
this.overParentElement = false;
|
|
9177
|
-
this.overChildElement = false;
|
|
9178
|
-
this.orderable = input(undefined);
|
|
9179
|
-
this.layoutNode = input(undefined);
|
|
9180
|
-
this.layoutIndex = input(undefined);
|
|
9181
|
-
this.dataIndex = input(undefined);
|
|
9182
|
-
}
|
|
9183
|
-
ngOnInit() {
|
|
9184
|
-
const layoutIndex = this.layoutIndex();
|
|
9185
|
-
if (this.orderable() && this.layoutNode() && layoutIndex && this.dataIndex()) {
|
|
9186
|
-
this.element = this.elementRef.nativeElement;
|
|
9187
|
-
this.element.draggable = true;
|
|
9188
|
-
this.arrayLayoutIndex = 'move:' + layoutIndex.slice(0, -1).toString();
|
|
9189
|
-
this.ngZone.runOutsideAngular(() => {
|
|
9190
|
-
// Listeners for movable element being dragged:
|
|
9191
|
-
this.element.addEventListener('dragstart', (event) => {
|
|
9192
|
-
event.dataTransfer.effectAllowed = 'move';
|
|
9193
|
-
event.dataTransfer.setData('text', '');
|
|
9194
|
-
// Hack to bypass stupid HTML drag-and-drop dataTransfer protection
|
|
9195
|
-
// so drag source info will be available on dragenter
|
|
9196
|
-
const sourceArrayIndex = this.dataIndex()[this.dataIndex().length - 1];
|
|
9197
|
-
sessionStorage.setItem(this.arrayLayoutIndex, sourceArrayIndex + '');
|
|
9198
|
-
});
|
|
9199
|
-
this.element.addEventListener('dragover', (event) => {
|
|
9200
|
-
if (event.preventDefault) {
|
|
9201
|
-
event.preventDefault();
|
|
9202
|
-
}
|
|
9203
|
-
event.dataTransfer.dropEffect = 'move';
|
|
9204
|
-
return false;
|
|
9205
|
-
});
|
|
9206
|
-
// Listeners for stationary items being dragged over:
|
|
9207
|
-
this.element.addEventListener('dragenter', (event) => {
|
|
9208
|
-
// Part 1 of a hack, inspired by Dragster, to simulate mouseover and mouseout
|
|
9209
|
-
// behavior while dragging items - http://bensmithett.github.io/dragster/
|
|
9210
|
-
if (this.overParentElement) {
|
|
9211
|
-
return this.overChildElement = true;
|
|
9212
|
-
}
|
|
9213
|
-
else {
|
|
9214
|
-
this.overParentElement = true;
|
|
9215
|
-
}
|
|
9216
|
-
const sourceArrayIndex = sessionStorage.getItem(this.arrayLayoutIndex);
|
|
9217
|
-
if (sourceArrayIndex !== null) {
|
|
9218
|
-
if (this.dataIndex()[this.dataIndex().length - 1] < +sourceArrayIndex) {
|
|
9219
|
-
this.element.classList.add('drag-target-top');
|
|
9220
|
-
}
|
|
9221
|
-
else if (this.dataIndex()[this.dataIndex().length - 1] > +sourceArrayIndex) {
|
|
9222
|
-
this.element.classList.add('drag-target-bottom');
|
|
9223
|
-
}
|
|
9224
|
-
}
|
|
9225
|
-
});
|
|
9226
|
-
this.element.addEventListener('dragleave', (event) => {
|
|
9227
|
-
// Part 2 of the Dragster hack
|
|
9228
|
-
if (this.overChildElement) {
|
|
9229
|
-
this.overChildElement = false;
|
|
9230
|
-
}
|
|
9231
|
-
else if (this.overParentElement) {
|
|
9232
|
-
this.overParentElement = false;
|
|
9233
|
-
}
|
|
9234
|
-
const sourceArrayIndex = sessionStorage.getItem(this.arrayLayoutIndex);
|
|
9235
|
-
if (!this.overParentElement && !this.overChildElement && sourceArrayIndex !== null) {
|
|
9236
|
-
this.element.classList.remove('drag-target-top');
|
|
9237
|
-
this.element.classList.remove('drag-target-bottom');
|
|
9238
|
-
}
|
|
9239
|
-
});
|
|
9240
|
-
this.element.addEventListener('drop', (event) => {
|
|
9241
|
-
this.element.classList.remove('drag-target-top');
|
|
9242
|
-
this.element.classList.remove('drag-target-bottom');
|
|
9243
|
-
// Confirm that drop target is another item in the same array as source item
|
|
9244
|
-
const sourceArrayIndex = sessionStorage.getItem(this.arrayLayoutIndex);
|
|
9245
|
-
const destArrayIndex = this.dataIndex()[this.dataIndex().length - 1];
|
|
9246
|
-
if (sourceArrayIndex !== null && +sourceArrayIndex !== destArrayIndex) {
|
|
9247
|
-
// Move array item
|
|
9248
|
-
this.jsf.moveArrayItem(this, +sourceArrayIndex, destArrayIndex);
|
|
9249
|
-
}
|
|
9250
|
-
sessionStorage.removeItem(this.arrayLayoutIndex);
|
|
9251
|
-
return false;
|
|
9252
|
-
});
|
|
9253
|
-
});
|
|
9254
|
-
// Subscribe to the draggable state
|
|
9255
|
-
this.draggableStateSubscription = this.jsf.draggableState$.subscribe((value) => {
|
|
9256
|
-
this.element.draggable = value;
|
|
9257
|
-
});
|
|
9258
|
-
}
|
|
9259
|
-
}
|
|
9260
|
-
ngOnDestroy() {
|
|
9261
|
-
if (this.draggableStateSubscription) {
|
|
9262
|
-
this.draggableStateSubscription.unsubscribe();
|
|
9263
|
-
}
|
|
9264
|
-
}
|
|
9265
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: OrderableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
9266
|
-
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 }); }
|
|
9267
|
-
}
|
|
9268
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: OrderableDirective, decorators: [{
|
|
9269
|
-
type: Directive,
|
|
9270
|
-
args: [{
|
|
9271
|
-
// tslint:disable-next-line:directive-selector
|
|
9272
|
-
selector: '[orderable]',
|
|
9273
|
-
}]
|
|
9274
|
-
}] });
|
|
9275
|
-
|
|
9276
9292
|
class RootComponent {
|
|
9277
9293
|
constructor() {
|
|
9278
9294
|
this.jsf = inject(JsonSchemaFormService);
|
|
@@ -9281,105 +9297,84 @@ class RootComponent {
|
|
|
9281
9297
|
this.layout = input(undefined);
|
|
9282
9298
|
this.isOrderable = input(undefined);
|
|
9283
9299
|
this.isFlexItem = input(false);
|
|
9284
|
-
this.
|
|
9285
|
-
|
|
9286
|
-
|
|
9287
|
-
|
|
9288
|
-
|
|
9289
|
-
|
|
9290
|
-
|
|
9291
|
-
|
|
9292
|
-
|
|
9293
|
-
|
|
9294
|
-
|
|
9295
|
-
|
|
9296
|
-
|
|
9297
|
-
|
|
9298
|
-
|
|
9299
|
-
|
|
9300
|
-
layoutIndex: () => { return layoutInd; },
|
|
9301
|
-
layoutNode: () => { return layoutItem; },
|
|
9302
|
-
};
|
|
9303
|
-
//must set moveLayout to false as nxtSortable already moves it
|
|
9304
|
-
this.jsf.moveArrayItem(itemCtx, evt.oldIndex, evt.newIndex, false);
|
|
9305
|
-
},
|
|
9306
|
-
onMove: function (/**Event*/ evt, /**Event*/ originalEvent) {
|
|
9307
|
-
if (evt.related.classList.contains("sortable-fixed")) {
|
|
9308
|
-
//console.log(evt.related);
|
|
9309
|
-
return false;
|
|
9310
|
-
}
|
|
9311
|
-
}
|
|
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;
|
|
9312
9316
|
};
|
|
9313
|
-
|
|
9314
|
-
|
|
9315
|
-
|
|
9316
|
-
|
|
9317
|
-
|
|
9318
|
-
|
|
9319
|
-
|
|
9320
|
-
|
|
9321
|
-
|
|
9322
|
-
|
|
9323
|
-
|
|
9324
|
-
|
|
9325
|
-
|
|
9326
|
-
zone.runOutsideAngular(() => {
|
|
9327
|
-
console.log(`pluginEvent3 ${pluginEvent}`)
|
|
9328
|
-
pluginEvent('nulling', this);
|
|
9329
|
-
|
|
9330
|
-
rootEl =
|
|
9331
|
-
dragEl =
|
|
9332
|
-
parentEl =
|
|
9333
|
-
ghostEl =
|
|
9334
|
-
nextEl =
|
|
9335
|
-
cloneEl =
|
|
9336
|
-
lastDownEl =
|
|
9337
|
-
cloneHidden =
|
|
9338
|
-
|
|
9339
|
-
tapEvt =
|
|
9340
|
-
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
|
+
}
|
|
9341
9330
|
|
|
9342
|
-
moved =
|
|
9343
|
-
newIndex =
|
|
9344
|
-
newDraggableIndex =
|
|
9345
|
-
oldIndex =
|
|
9346
|
-
oldDraggableIndex =
|
|
9347
9331
|
|
|
9348
|
-
|
|
9349
|
-
|
|
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);
|
|
9350
9335
|
|
|
9351
|
-
|
|
9352
|
-
|
|
9353
|
-
|
|
9354
|
-
|
|
9355
|
-
|
|
9356
|
-
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
|
+
}
|
|
9357
9341
|
|
|
9358
|
-
|
|
9359
|
-
|
|
9360
|
-
|
|
9361
|
-
|
|
9362
|
-
|
|
9363
|
-
|
|
9364
|
-
|
|
9365
|
-
|
|
9366
|
-
|
|
9367
|
-
|
|
9368
|
-
|
|
9369
|
-
|
|
9370
|
-
|
|
9371
|
-
|
|
9372
|
-
|
|
9373
|
-
|
|
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);
|
|
9374
9373
|
}
|
|
9375
9374
|
isDraggable(node) {
|
|
9376
9375
|
let result = node.arrayItem && node.type !== '$ref' &&
|
|
9377
|
-
node.arrayItemType === 'list' && this.isOrderable() !== false
|
|
9378
|
-
|
|
9379
|
-
//this.sortableObj.option("disabled",true);
|
|
9380
|
-
//this.sortableObj.option("sort",false);
|
|
9381
|
-
//this.sortableObj.option("disabled",!result);
|
|
9382
|
-
}
|
|
9376
|
+
node.arrayItemType === 'list' && this.isOrderable() !== false
|
|
9377
|
+
&& node.type !== 'submit';
|
|
9383
9378
|
return result;
|
|
9384
9379
|
}
|
|
9385
9380
|
//TODO also need to think of other types such as button which can be
|
|
@@ -9395,93 +9390,157 @@ class RootComponent {
|
|
|
9395
9390
|
return ((node.options || {}).flex || '').split(/\s+/)[index] ||
|
|
9396
9391
|
(node.options || {})[attribute] || ['1', '1', 'auto'][index];
|
|
9397
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
|
+
}
|
|
9398
9419
|
showWidget(layoutNode) {
|
|
9399
9420
|
return this.jsf.evaluateCondition(layoutNode, this.dataIndex());
|
|
9400
9421
|
}
|
|
9401
9422
|
ngOnInit() {
|
|
9402
|
-
|
|
9403
|
-
|
|
9404
|
-
|
|
9405
|
-
|
|
9406
|
-
|
|
9407
|
-
|
|
9408
|
-
});
|
|
9409
|
-
//this.sortableObj.option("disabled",true);
|
|
9410
|
-
//this.sortableObj.option("sort",false);
|
|
9411
|
-
}
|
|
9412
|
-
});
|
|
9423
|
+
if (this.memoizationEnabled) {
|
|
9424
|
+
this.jsf.dataChanges.subscribe((val) => {
|
|
9425
|
+
//this.selectframeworkInputCache?.clear();
|
|
9426
|
+
this._getSelectFrameworkInputsMemoized.cache.clear();
|
|
9427
|
+
});
|
|
9428
|
+
}
|
|
9413
9429
|
}
|
|
9414
9430
|
ngOnDestroy() {
|
|
9415
|
-
|
|
9416
|
-
|
|
9417
|
-
|
|
9431
|
+
//this.selectframeworkInputCache?.clear()
|
|
9432
|
+
//this.selectframeworkInputCache=null;
|
|
9433
|
+
this._getSelectFrameworkInputsMemoized.cache.clear();
|
|
9434
|
+
this.dataChangesSubs?.unsubscribe();
|
|
9418
9435
|
}
|
|
9419
9436
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: RootComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
9420
|
-
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: `
|
|
9421
|
-
<div
|
|
9422
|
-
|
|
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)"
|
|
9423
9451
|
[class.form-flex-item]="isFlexItem()"
|
|
9424
9452
|
[style.align-self]="(layoutItem.options || {})['align-self']"
|
|
9425
9453
|
[style.flex-basis]="getFlexAttribute(layoutItem, 'flex-basis')"
|
|
9426
9454
|
[style.flex-grow]="getFlexAttribute(layoutItem, 'flex-grow')"
|
|
9427
9455
|
[style.flex-shrink]="getFlexAttribute(layoutItem, 'flex-shrink')"
|
|
9428
9456
|
[style.order]="(layoutItem.options || {}).order"
|
|
9429
|
-
[class.sortable-filter]="!isDraggable(layoutItem)"
|
|
9430
|
-
[class.sortable-fixed]="isFixed(layoutItem)"
|
|
9431
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
|
+
-->
|
|
9432
9465
|
<!--NB orderable directive is not used but has been left in for now and set to false
|
|
9433
9466
|
otherwise the compiler won't recognize dataIndex and other dependent attributes
|
|
9434
9467
|
-->
|
|
9468
|
+
<!--
|
|
9435
9469
|
<div
|
|
9436
9470
|
[dataIndex]="layoutItem?.arrayItem ? (dataIndex() || []).concat(i) : (dataIndex() || [])"
|
|
9437
9471
|
[layoutIndex]="(layoutIndex() || []).concat(i)"
|
|
9438
9472
|
[layoutNode]="layoutItem"
|
|
9439
9473
|
[orderable]="false"
|
|
9440
|
-
[class.sortable-filter]="!isDraggable(layoutItem)"
|
|
9441
|
-
[class.sortable-fixed]="isFixed(layoutItem)"
|
|
9442
9474
|
>
|
|
9443
9475
|
<select-framework-widget *ngIf="showWidget(layoutItem)"
|
|
9444
9476
|
[dataIndex]="layoutItem?.arrayItem ? (dataIndex() || []).concat(i) : (dataIndex() || [])"
|
|
9445
9477
|
[layoutIndex]="(layoutIndex() || []).concat(i)"
|
|
9446
9478
|
[layoutNode]="layoutItem"></select-framework-widget>
|
|
9447
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>
|
|
9448
9486
|
</div>
|
|
9449
9487
|
</div>
|
|
9450
|
-
`, 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.
|
|
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 }); }
|
|
9451
9489
|
}
|
|
9452
9490
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: RootComponent, decorators: [{
|
|
9453
9491
|
type: Component,
|
|
9454
9492
|
args: [{ selector: 'root-widget', template: `
|
|
9455
|
-
<div
|
|
9456
|
-
|
|
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)"
|
|
9457
9506
|
[class.form-flex-item]="isFlexItem()"
|
|
9458
9507
|
[style.align-self]="(layoutItem.options || {})['align-self']"
|
|
9459
9508
|
[style.flex-basis]="getFlexAttribute(layoutItem, 'flex-basis')"
|
|
9460
9509
|
[style.flex-grow]="getFlexAttribute(layoutItem, 'flex-grow')"
|
|
9461
9510
|
[style.flex-shrink]="getFlexAttribute(layoutItem, 'flex-shrink')"
|
|
9462
9511
|
[style.order]="(layoutItem.options || {}).order"
|
|
9463
|
-
[class.sortable-filter]="!isDraggable(layoutItem)"
|
|
9464
|
-
[class.sortable-fixed]="isFixed(layoutItem)"
|
|
9465
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
|
+
-->
|
|
9466
9520
|
<!--NB orderable directive is not used but has been left in for now and set to false
|
|
9467
9521
|
otherwise the compiler won't recognize dataIndex and other dependent attributes
|
|
9468
9522
|
-->
|
|
9523
|
+
<!--
|
|
9469
9524
|
<div
|
|
9470
9525
|
[dataIndex]="layoutItem?.arrayItem ? (dataIndex() || []).concat(i) : (dataIndex() || [])"
|
|
9471
9526
|
[layoutIndex]="(layoutIndex() || []).concat(i)"
|
|
9472
9527
|
[layoutNode]="layoutItem"
|
|
9473
9528
|
[orderable]="false"
|
|
9474
|
-
[class.sortable-filter]="!isDraggable(layoutItem)"
|
|
9475
|
-
[class.sortable-fixed]="isFixed(layoutItem)"
|
|
9476
9529
|
>
|
|
9477
9530
|
<select-framework-widget *ngIf="showWidget(layoutItem)"
|
|
9478
9531
|
[dataIndex]="layoutItem?.arrayItem ? (dataIndex() || []).concat(i) : (dataIndex() || [])"
|
|
9479
9532
|
[layoutIndex]="(layoutIndex() || []).concat(i)"
|
|
9480
9533
|
[layoutNode]="layoutItem"></select-framework-widget>
|
|
9481
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>
|
|
9482
9541
|
</div>
|
|
9483
9542
|
</div>
|
|
9484
|
-
`, 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"] }]
|
|
9485
9544
|
}] });
|
|
9486
9545
|
|
|
9487
9546
|
class SectionComponent {
|
|
@@ -9607,7 +9666,7 @@ class SectionComponent {
|
|
|
9607
9666
|
[class]="options?.labelHelpBlockClass || ''"
|
|
9608
9667
|
[innerHTML]="options?.description"></p>
|
|
9609
9668
|
</div>
|
|
9610
|
-
</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"] }] }); }
|
|
9611
9670
|
}
|
|
9612
9671
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SectionComponent, decorators: [{
|
|
9613
9672
|
type: Component,
|
|
@@ -9951,8 +10010,10 @@ class SubmitComponent {
|
|
|
9951
10010
|
[name]="controlName"
|
|
9952
10011
|
[type]="layoutNode()?.type"
|
|
9953
10012
|
[value]="controlValue"
|
|
9954
|
-
(click)="updateValue($event)"
|
|
9955
|
-
|
|
10013
|
+
(click)="updateValue($event)"
|
|
10014
|
+
[appStopPropagation]="['mousedown', 'touchstart']"
|
|
10015
|
+
>
|
|
10016
|
+
</div>`, isInline: true, dependencies: [{ kind: "directive", type: StopPropagationDirective, selector: "[appStopPropagation]", inputs: ["appStopPropagation"] }] }); }
|
|
9956
10017
|
}
|
|
9957
10018
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SubmitComponent, decorators: [{
|
|
9958
10019
|
type: Component,
|
|
@@ -9972,7 +10033,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
9972
10033
|
[name]="controlName"
|
|
9973
10034
|
[type]="layoutNode()?.type"
|
|
9974
10035
|
[value]="controlValue"
|
|
9975
|
-
(click)="updateValue($event)"
|
|
10036
|
+
(click)="updateValue($event)"
|
|
10037
|
+
[appStopPropagation]="['mousedown', 'touchstart']"
|
|
10038
|
+
>
|
|
9976
10039
|
</div>`,
|
|
9977
10040
|
}]
|
|
9978
10041
|
}] });
|
|
@@ -10680,7 +10743,7 @@ class TabComponent {
|
|
|
10680
10743
|
[dataIndex]="dataIndex()"
|
|
10681
10744
|
[layoutIndex]="layoutIndex()"
|
|
10682
10745
|
[layout]="layoutNode().items"></root-widget>
|
|
10683
|
-
</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"] }] }); }
|
|
10684
10747
|
}
|
|
10685
10748
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: TabComponent, decorators: [{
|
|
10686
10749
|
type: Component,
|
|
@@ -10697,6 +10760,132 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
10697
10760
|
}]
|
|
10698
10761
|
}] });
|
|
10699
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
|
+
|
|
10700
10889
|
const BASIC_WIDGETS = [
|
|
10701
10890
|
AddReferenceComponent, OneOfComponent, ButtonComponent, CheckboxComponent,
|
|
10702
10891
|
CheckboxesComponent, FileComponent, HiddenComponent, InputComponent,
|
|
@@ -10708,39 +10897,16 @@ const BASIC_WIDGETS = [
|
|
|
10708
10897
|
|
|
10709
10898
|
class WidgetLibraryModule {
|
|
10710
10899
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: WidgetLibraryModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
10711
|
-
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,
|
|
10712
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: WidgetLibraryModule, imports: [CommonModule, FormsModule, ReactiveFormsModule,
|
|
10713
|
-
SortablejsModule.forRoot({
|
|
10714
|
-
//disabled:false,
|
|
10715
|
-
//draggable:".draggableitem",//">:not(.nonsort)",//">.draggable-item",//":not(.nonsort)",//">*",//":not(.nonsort)",//":not(.non-draggable)",
|
|
10716
|
-
filter: ".sortable-filter",
|
|
10717
|
-
preventOnFilter: false,
|
|
10718
|
-
onMove: function (/**Event*/ evt, /**Event*/ originalEvent) {
|
|
10719
|
-
if (evt.related.classList.contains("sortable-fixed")) {
|
|
10720
|
-
//console.log(evt.related);
|
|
10721
|
-
return false;
|
|
10722
|
-
}
|
|
10723
|
-
}
|
|
10724
|
-
})] }); }
|
|
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] }); }
|
|
10725
10902
|
}
|
|
10726
10903
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: WidgetLibraryModule, decorators: [{
|
|
10727
10904
|
type: NgModule,
|
|
10728
10905
|
args: [{
|
|
10729
|
-
imports: [CommonModule, FormsModule, ReactiveFormsModule,
|
|
10730
|
-
|
|
10731
|
-
|
|
10732
|
-
|
|
10733
|
-
filter: ".sortable-filter",
|
|
10734
|
-
preventOnFilter: false,
|
|
10735
|
-
onMove: function (/**Event*/ evt, /**Event*/ originalEvent) {
|
|
10736
|
-
if (evt.related.classList.contains("sortable-fixed")) {
|
|
10737
|
-
//console.log(evt.related);
|
|
10738
|
-
return false;
|
|
10739
|
-
}
|
|
10740
|
-
}
|
|
10741
|
-
})],
|
|
10742
|
-
declarations: [...BASIC_WIDGETS, OrderableDirective, ElementAttributeDirective],
|
|
10743
|
-
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]
|
|
10744
10910
|
}]
|
|
10745
10911
|
}] });
|
|
10746
10912
|
|
|
@@ -11515,7 +11681,7 @@ class JsonSchemaFormComponent {
|
|
|
11515
11681
|
}
|
|
11516
11682
|
}
|
|
11517
11683
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: JsonSchemaFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
11518
|
-
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 }); }
|
|
11519
11685
|
}
|
|
11520
11686
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: JsonSchemaFormComponent, decorators: [{
|
|
11521
11687
|
type: Component,
|
|
@@ -11551,5 +11717,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
11551
11717
|
* Generated bundle index. Do not edit.
|
|
11552
11718
|
*/
|
|
11553
11719
|
|
|
11554
|
-
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 };
|
|
11555
11721
|
//# sourceMappingURL=ng-formworks-core.mjs.map
|