@ng-formworks/core 16.6.2 → 16.6.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  import * as i2 from '@angular/common';
2
2
  import { CommonModule } from '@angular/common';
3
3
  import * as i0 from '@angular/core';
4
- import { Injectable, ViewContainerRef, Component, Input, ViewChild, Directive, ChangeDetectionStrategy, NgModule, Inject, forwardRef, EventEmitter, Output } from '@angular/core';
4
+ import { Injectable, ViewContainerRef, Component, Input, ViewChild, Directive, ChangeDetectionStrategy, Inject, inject, NgModule, forwardRef, EventEmitter, Output } from '@angular/core';
5
5
  import * as i3 from '@angular/forms';
6
6
  import { UntypedFormControl, UntypedFormArray, UntypedFormGroup, FormsModule, ReactiveFormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
7
7
  import addFormats from 'ajv-formats';
@@ -2488,6 +2488,10 @@ const jsonSchemaFormatTests = {
2488
2488
  // Modified to allow incomplete entries, such as
2489
2489
  // "2000-03-14T01:59:26.535" (needs "Z") or "2000-03-14T01:59" (needs ":00Z")
2490
2490
  'date-time': /^\d\d\d\d-[0-1]\d-[0-3]\d[t\s][0-2]\d:[0-5]\d(?::[0-5]\d)?(?:\.\d+)?(?:z|[+-]\d\d:\d\d)?$/i,
2491
+ // "2000-03-14T01:59:26.535" (doesn't need "Z") or "2000-03-14T01:59" (needs ":00Z")
2492
+ //'iso-date-time':^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(Z|([+-]\d{2}:\d{2}))?$
2493
+ //for now same as 'date-time' until better tested
2494
+ 'iso-date-time': /^\d\d\d\d-[0-1]\d-[0-3]\d[t\s][0-2]\d:[0-5]\d(?::[0-5]\d)?(?:\.\d+)?(?:z|[+-]\d\d:\d\d)?$/i,
2491
2495
  // email (sources from jsen validator):
2492
2496
  // http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363
2493
2497
  // http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'willful violation')
@@ -2856,7 +2860,7 @@ class JsonValidators {
2856
2860
  }
2857
2861
  else {
2858
2862
  // Allow JavaScript Date objects
2859
- isValid = ['date', 'time', 'date-time'].includes(requiredFormat) &&
2863
+ isValid = ['date', 'time', 'iso-date-time'].includes(requiredFormat) &&
2860
2864
  Object.prototype.toString.call(currentValue) === '[object Date]';
2861
2865
  }
2862
2866
  return xor(isValid, invert) ?
@@ -4072,7 +4076,10 @@ function getInputType(schema, layoutNode = null) {
4072
4076
  return {
4073
4077
  'color': 'color',
4074
4078
  'date': 'date',
4075
- 'date-time': 'datetime-local',
4079
+ //as per ajv date-time requires a timezone but input
4080
+ //datetime-local doesn't
4081
+ //'date-time': 'datetime-local',
4082
+ 'iso-date-time': 'datetime-local',
4076
4083
  'email': 'email',
4077
4084
  'uri': 'url',
4078
4085
  }[schema.format] || 'text';
@@ -4586,8 +4593,32 @@ function fixRequiredArrayProperties(schema) {
4586
4593
  * @param schema:any
4587
4594
  * @param negate:boolean=false
4588
4595
  * @returns
4589
-
4590
4596
  */
4597
+ //TODO also handle ifs with mixed conditional such as allOf/oneOf etc
4598
+ /*
4599
+
4600
+ "if": {
4601
+ "allOf": [
4602
+ {
4603
+ "properties": {
4604
+ "animalType": {
4605
+ "enum": ["Cat", "Fish"]
4606
+ }
4607
+ }
4608
+ },
4609
+ {
4610
+ "properties": {
4611
+ "color": {
4612
+ "const": "orange"
4613
+ }
4614
+ }
4615
+ }
4616
+ ]
4617
+ }
4618
+
4619
+
4620
+
4621
+ */
4591
4622
  function convertJSONSchemaIfToCondition(schema, layoutNode, negate = false) {
4592
4623
  let conditionFun = "";
4593
4624
  let condition = {};
@@ -4612,17 +4643,26 @@ function convertJSONSchemaIfToCondition(schema, layoutNode, negate = false) {
4612
4643
  .join("")
4613
4644
  : "";
4614
4645
  let modelPath = parentPath ? `model.${parentPath}` : "model";
4615
- let checkPath = modelPath.split(".")
4616
- .reduce((accumulator, currentPart, index) => {
4617
- const currentExpression = index === 0 ? currentPart : `${accumulator}.${currentPart}`;
4618
- return index === 0 ? currentExpression : `${accumulator} && ${currentExpression}`;
4619
- }, '');
4646
+ let checkPath = modelPath.split('.')
4647
+ .map((_, index, array) => {
4648
+ return array.slice(0, index + 1).join('.'); // Build each part of the path dynamically
4649
+ }).join(' && '); // Join the parts with '&&'
4650
+ // .reduce((accumulator, currentPart, index) => {
4651
+ // const currentExpression = index === 0 ? currentPart : `${accumulator}.${currentPart}`;
4652
+ // return index === 0 ? currentExpression : `${accumulator} && ${currentExpression}`;
4653
+ // }, '');
4620
4654
  if (schema.if) {
4621
4655
  Object.keys(schema.if.properties).forEach((ifProp, ind) => {
4622
4656
  let amper = ind > 0 ? "&" : "";
4623
4657
  //Note the model value is first converted to string and so is the condition
4624
4658
  //so that booleans and numbers can also be compared
4625
- conditionFun += `${amper} ${checkPath} && ${modelPath}.${ifProp}+""=='${schema.if.properties[ifProp].const}'`;
4659
+ //changed to an includesList to handle cases such as
4660
+ const includesList = hasOwn(schema.if.properties[ifProp], "const") ? [schema.if.properties[ifProp].const]
4661
+ : hasOwn(schema.if.properties[ifProp], "enum") ? schema.if.properties[ifProp].enum
4662
+ : [];
4663
+ const includesListAsStr = includesList.map(val => { return `"${val}"`; });
4664
+ conditionFun += `${amper} ${checkPath} && [${includesListAsStr}].includes(${modelPath}.${ifProp}+"")`;
4665
+ //conditionFun+=`${amper} ${checkPath} && ${modelPath}.${ifProp}+""=='${schema.if.properties[ifProp].const}'`
4626
4666
  });
4627
4667
  }
4628
4668
  condition["functionBody"] = `return ${notOp}(${conditionFun})`;
@@ -5052,7 +5092,7 @@ function buildFormGroupTemplate(jsf, nodeValue = null, setValues = true, schemaP
5052
5092
  ["then", "else"].forEach(con => {
5053
5093
  if (hasOwn(schema, con)) {
5054
5094
  const keySchemaPointer = `/${con}`;
5055
- let thenFGTemplate = buildFormGroupTemplate(jsf, nodeValue, false, //JsonPointer.get(nodeValue, keySchemaPointer), setValues,
5095
+ let thenFGTemplate = buildFormGroupTemplate(jsf, nodeValue, setValues, //false,//JsonPointer.get(nodeValue, keySchemaPointer), setValues,
5056
5096
  schemaPointer + keySchemaPointer, dataPointer, templatePointer + `/controls/${con}`);
5057
5097
  Object.assign(controls, thenFGTemplate.controls);
5058
5098
  }
@@ -5113,7 +5153,8 @@ function buildFormGroupTemplate(jsf, nodeValue = null, setValues = true, schemaP
5113
5153
  if (foundKeys && foundKeys.length > 0) {
5114
5154
  const keySchemaPointer = `/${ofType}/${ind}`;
5115
5155
  //console.log(`found:${keySchemaPointer}`);
5116
- let newNodeValue = JsonPointer.get(nodeValue, dataPointer);
5156
+ let newNodeValue = nodeValue;
5157
+ //JsonPointer.get(nodeValue, dataPointer);
5117
5158
  //JsonPointer.get(nodeValue, keySchemaPointer);
5118
5159
  if (ofType == "oneOf") {
5119
5160
  newNodeValue = nodeValue;
@@ -5144,9 +5185,16 @@ function buildFormGroupTemplate(jsf, nodeValue = null, setValues = true, schemaP
5144
5185
  let oneOfItemSchema = JsonPointer.get(jsf.schema, controlItem.schemaPointer);
5145
5186
  //JsonPointer.get(schema,pointerPath);
5146
5187
  let dPointer = controlItem.schemaPointer.replace(/(anyOf|allOf|oneOf|none)\/[\d]+\//g, '')
5147
- .replace(/(if|then|else|properties)\//g, '');
5188
+ .replace(/(if|then|else|properties)\//g, '').replace(/\/items\//g, '/-/');
5189
+ dPointer = dPointer.indexOf(dataPointer) == 0
5190
+ ? dPointer.substring(dataPointer.length) : dPointer;
5191
+ //dataPointer+"/"+controlItem.schemaPointer.split("/").slice(-1)[0];
5192
+ ////controlItem.schemaPointer.replace(/(anyOf|allOf|oneOf|none)\/[\d]+\//g, '')
5193
+ ////.replace(/(if|then|else|properties)\//g, '').replace(/\/items\//g,'/-/');
5148
5194
  //JsonPointer.toDataPointer(controlItem.schemaPointer,jsf.schema);
5149
- let dVal = JsonPointer.get(nodeValue, dPointer);
5195
+ //console.log(`dataPointer:${dataPointer}\ndPointer:${dPointer}`)
5196
+ let dVal = //JsonPointer.get(jsf.formValues,dPointer);
5197
+ JsonPointer.get(nodeValue, dPointer);
5150
5198
  let fkey = key;
5151
5199
  let oneOfItemValue = dVal;
5152
5200
  /*
@@ -5289,43 +5337,22 @@ function buildFormGroupTemplate(jsf, nodeValue = null, setValues = true, schemaP
5289
5337
  ["then", "else"].forEach(con => {
5290
5338
  if (hasOwn(schema, con)) {
5291
5339
  const keySchemaPointer = `/${con}`;
5292
- let thenTFGTemplate = buildFormGroupTemplate(jsf, nodeValue, false, schemaPointer + keySchemaPointer, dataPointer, templatePointer + `/controls/${con}`);
5340
+ let thenTFGTemplate = buildFormGroupTemplate(jsf, nodeValue, setValues, //false,
5341
+ schemaPointer + keySchemaPointer, dataPointer, templatePointer + `/controls/${con}`);
5293
5342
  //NB same property can be in both then and else
5294
5343
  //so key must be the unique path to control
5295
5344
  //let ifItemSchema=JsonPointer.get(schema,keySchemaPointer);
5296
5345
  //let ifItemValue;
5297
- Object.keys(thenTFGTemplate.controls).forEach(key => {
5298
- let controlKey = thenTFGTemplate.controls[key].schemaPointer;
5299
- ////let controlItem=cloneDeep(thenTFGTemplate.controls[key]);
5300
- ////thenTFGTemplate.controls[key].schemaPointer || `${schemaPointer}${keySchemaPointer}/${key}`;
5301
- controlKey = path2ControlKey(controlKey);
5302
- let cItem = Object.assign({}, thenTFGTemplate.controls[key]);
5303
- ////cItem.schemaPointer = `${schemaPointer}${keySchemaPointer}/${key}`;
5304
- /*
5305
- if(ifItemSchema.properties && jsf.formValues===undefined){
5306
- //check if no form data values were supplied
5307
- //then set it to default otherwise to its nodevalue
5308
- ifItemValue=ifItemSchema.default
5309
- ifItemValue[key]=ifItemSchema.properties[key]?.default;
5310
- }
5311
- if(ifItemSchema.properties && jsf.formValues!=undefined){
5312
- ifItemValue ={};
5313
- //nodeValue||{};
5314
- ifItemValue[key]=nodeValue&&nodeValue[key];
5315
- }
5316
- if(!ifItemSchema.properties && jsf.formValues==undefined){
5317
- ifItemValue=ifItemSchema.default;
5318
- }
5319
- if(hasOwn(cItem,"value")){
5320
- if(!jsf.ajv.validate(ifItemSchema,ifItemValue)){
5321
- cItem.value.value=null;
5322
- }else{
5323
- cItem.value.value=ifItemValue[key];
5324
- }
5325
- }
5326
- */
5327
- controls[controlKey] = cItem;
5328
- });
5346
+ if (hasOwn(thenTFGTemplate, 'controls')) {
5347
+ Object.keys(thenTFGTemplate.controls).forEach(key => {
5348
+ let controlKey = thenTFGTemplate.controls[key].schemaPointer;
5349
+ if (controlKey) {
5350
+ controlKey = path2ControlKey(controlKey);
5351
+ let cItem = Object.assign({}, thenTFGTemplate.controls[key]);
5352
+ controls[controlKey] = cItem;
5353
+ }
5354
+ });
5355
+ }
5329
5356
  }
5330
5357
  });
5331
5358
  }
@@ -5562,7 +5589,8 @@ function getControl(formGroup, dataPointer, returnGroup = false, schemaPointer)
5562
5589
  // If dataPointer input is not a valid JSON pointer, check to
5563
5590
  // see if it is instead a valid object path, using dot notaion
5564
5591
  if (typeof dataPointer === 'string') {
5565
- const formControl = formGroup.get(path2ControlKey(schemaPointer || "")) || formGroup.get(dataPointer);
5592
+ const controlPath = !!schemaPointer ? path2ControlKey(schemaPointer) : dataPointer;
5593
+ const formControl = formGroup.get(controlPath);
5566
5594
  if (formControl) {
5567
5595
  return formControl;
5568
5596
  }
@@ -5582,7 +5610,8 @@ function getControl(formGroup, dataPointer, returnGroup = false, schemaPointer)
5582
5610
  // try using formGroup.get() to return the control
5583
5611
  if (typeof formGroup.get === 'function' &&
5584
5612
  dataPointerArray.every(key => key.indexOf('.') === -1)) {
5585
- const formControl = formGroup.get(path2ControlKey(schemaPointer || "")) || formGroup.get(dataPointerArray.join('.'));
5613
+ const controlPath = !!schemaPointer ? path2ControlKey(schemaPointer) : dataPointerArray.join('.');
5614
+ const formControl = formGroup.get(controlPath);
5586
5615
  if (formControl) {
5587
5616
  return formControl;
5588
5617
  }
@@ -5595,15 +5624,16 @@ function getControl(formGroup, dataPointer, returnGroup = false, schemaPointer)
5595
5624
  if (hasOwn(subGroup, 'controls')) {
5596
5625
  subGroup = subGroup.controls;
5597
5626
  }
5598
- if (isArray(subGroup) && (key === '-')) {
5627
+ if (schemaPointer && hasOwn(subGroup, path2ControlKey(schemaPointer))) {
5628
+ subGroup = subGroup[path2ControlKey(schemaPointer)];
5629
+ return subGroup;
5630
+ }
5631
+ else if (isArray(subGroup) && (key === '-')) {
5599
5632
  subGroup = subGroup[subGroup.length - 1];
5600
5633
  }
5601
5634
  else if (hasOwn(subGroup, key)) {
5602
5635
  subGroup = subGroup[key];
5603
5636
  }
5604
- else if (schemaPointer && hasOwn(subGroup, path2ControlKey(schemaPointer))) {
5605
- subGroup = subGroup[path2ControlKey(schemaPointer)];
5606
- }
5607
5637
  else {
5608
5638
  console.error(`getControl error: Unable to find "${key}" item in FormGroup.`);
5609
5639
  console.error(dataPointer);
@@ -6477,7 +6507,7 @@ function buildLayoutFromSchema(jsf, widgetLibrary, nodeValue = null, schemaPoint
6477
6507
  if (hasOwn(schema, con)) {
6478
6508
  const keySchemaPointer = `/${con}`;
6479
6509
  const negateClause = con == "else";
6480
- const innerItem = buildLayoutFromSchema(jsf, widgetLibrary, nodeValue.then, schemaPointer + keySchemaPointer, dataPointer, false, null, null, forRefLibrary, dataPointerPrefix);
6510
+ const innerItem = buildLayoutFromSchema(jsf, widgetLibrary, nodeValue[con], schemaPointer + keySchemaPointer, dataPointer, false, null, null, forRefLibrary, dataPointerPrefix);
6481
6511
  if (innerItem) {
6482
6512
  applyITEConditions(innerItem, schemaPointer, keySchemaPointer, negateClause);
6483
6513
  if (isArray(innerItem)) {
@@ -6704,7 +6734,7 @@ function buildLayoutFromSchema(jsf, widgetLibrary, nodeValue = null, schemaPoint
6704
6734
  if (hasOwn(schema, con)) {
6705
6735
  const keySchemaPointer = `/${con}`;
6706
6736
  const negateClause = con == "else";
6707
- const innerItem = buildLayoutFromSchema(jsf, widgetLibrary, nodeValue.then, schemaPointer + keySchemaPointer, dataPointer, false, null, null, forRefLibrary, dataPointerPrefix);
6737
+ const innerItem = buildLayoutFromSchema(jsf, widgetLibrary, nodeValue[con], schemaPointer + keySchemaPointer, dataPointer, false, null, null, forRefLibrary, dataPointerPrefix);
6708
6738
  if (innerItem) {
6709
6739
  applyITEConditions(innerItem, schemaPointer, keySchemaPointer, negateClause);
6710
6740
  if (isArray(innerItem)) {
@@ -6712,17 +6742,19 @@ function buildLayoutFromSchema(jsf, widgetLibrary, nodeValue = null, schemaPoint
6712
6742
  //item.schemaPointer = schemaPointer + keySchemaPointer + item.dataPointer;
6713
6743
  //item.options.condition = convertJSONSchemaIfToCondition(schema, negateClause);
6714
6744
  newSection.push(item);
6715
- newNode = newSection;
6745
+ /////// newNode = newSection
6716
6746
  });
6717
6747
  }
6718
6748
  else {
6719
6749
  //innerItem.schemaPointer = schemaPointer + keySchemaPointer + innerItem.dataPointer;
6720
6750
  //innerItem.options.condition = convertJSONSchemaIfToCondition(schema, negateClause);
6721
- newNode = innerItem;
6751
+ ///////newNode = innerItem
6752
+ newSection.push(innerItem);
6722
6753
  }
6723
6754
  }
6724
6755
  }
6725
6756
  });
6757
+ newNode = newSection;
6726
6758
  }
6727
6759
  return newNode;
6728
6760
  }
@@ -8926,7 +8958,7 @@ class OneOfComponent {
8926
8958
  let controlSchema = JsonPointer.get(this.jsf.schema, parts.join("/"));
8927
8959
  let schemaPointer = parts.join("/");
8928
8960
  let dPointer = schemaPointer.replace(/(anyOf|allOf|oneOf|none)\/[\d]+\//g, '')
8929
- .replace(/(if|then|else|properties)\//g, '');
8961
+ .replace(/(if|then|else|properties)\//g, '').replace(/\/items\//g, '/-/');
8930
8962
  //JsonPointer.toDataPointer(parts.join("/"),this.jsf.schema);
8931
8963
  let dVal = JsonPointer.get(this.jsf.formValues, dPointer);
8932
8964
  let compareVal = dVal; //formValue;
@@ -9304,6 +9336,7 @@ class RootComponent {
9304
9336
  }
9305
9337
  sortableInit(sortable) {
9306
9338
  this.sortableObj = sortable;
9339
+ //Sortable.utils.on(this.sortableObj.el,"nulling",(s)=>{console.log("event nulling sortablejs")})
9307
9340
  ///NB issue caused by sortablejs when it its destroyed
9308
9341
  //this mainly affects checkboxes coupled with conditions
9309
9342
  //-the value is rechecked
@@ -9744,13 +9777,13 @@ class SelectComponent {
9744
9777
  [name]="controlName">
9745
9778
  <ng-template ngFor let-selectItem [ngForOf]="selectList">
9746
9779
  <option *ngIf="!isArray(selectItem?.items)"
9747
- [value]="selectItem?.value">
9780
+ [ngValue]="selectItem?.value">
9748
9781
  <span [innerHTML]="selectItem?.name"></span>
9749
9782
  </option>
9750
9783
  <optgroup *ngIf="isArray(selectItem?.items)"
9751
9784
  [label]="selectItem?.group">
9752
9785
  <option *ngFor="let subItem of selectItem.items"
9753
- [value]="subItem?.value">
9786
+ [ngValue]="subItem?.value">
9754
9787
  <span [innerHTML]="subItem?.name"></span>
9755
9788
  </option>
9756
9789
  </optgroup>
@@ -9768,14 +9801,14 @@ class SelectComponent {
9768
9801
  <ng-template ngFor let-selectItem [ngForOf]="selectList">
9769
9802
  <option *ngIf="!isArray(selectItem?.items)"
9770
9803
  [selected]="selectItem?.value === controlValue"
9771
- [value]="selectItem?.value">
9804
+ [ngValue]="selectItem?.value">
9772
9805
  <span [innerHTML]="selectItem?.name"></span>
9773
9806
  </option>
9774
9807
  <optgroup *ngIf="isArray(selectItem?.items)"
9775
9808
  [label]="selectItem?.group">
9776
9809
  <option *ngFor="let subItem of selectItem.items"
9777
9810
  [attr.selected]="subItem?.value === controlValue"
9778
- [value]="subItem?.value">
9811
+ [ngValue]="subItem?.value">
9779
9812
  <span [innerHTML]="subItem?.name"></span>
9780
9813
  </option>
9781
9814
  </optgroup>
@@ -9795,14 +9828,14 @@ class SelectComponent {
9795
9828
  <ng-template ngFor let-selectItem [ngForOf]="selectList">
9796
9829
  <option *ngIf="!isArray(selectItem?.items)"
9797
9830
  [selected]="selectItem?.value === controlValue"
9798
- [value]="selectItem?.value">
9831
+ [ngValue]="selectItem?.value">
9799
9832
  <span [innerHTML]="selectItem?.name"></span>
9800
9833
  </option>
9801
9834
  <optgroup *ngIf="isArray(selectItem?.items)"
9802
9835
  [label]="selectItem?.group">
9803
9836
  <option *ngFor="let subItem of selectItem.items"
9804
9837
  [attr.selected]="subItem?.value === controlValue"
9805
- [value]="subItem?.value">
9838
+ [ngValue]="subItem?.value">
9806
9839
  <span [innerHTML]="subItem?.name"></span>
9807
9840
  </option>
9808
9841
  </optgroup>
@@ -9833,13 +9866,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
9833
9866
  [name]="controlName">
9834
9867
  <ng-template ngFor let-selectItem [ngForOf]="selectList">
9835
9868
  <option *ngIf="!isArray(selectItem?.items)"
9836
- [value]="selectItem?.value">
9869
+ [ngValue]="selectItem?.value">
9837
9870
  <span [innerHTML]="selectItem?.name"></span>
9838
9871
  </option>
9839
9872
  <optgroup *ngIf="isArray(selectItem?.items)"
9840
9873
  [label]="selectItem?.group">
9841
9874
  <option *ngFor="let subItem of selectItem.items"
9842
- [value]="subItem?.value">
9875
+ [ngValue]="subItem?.value">
9843
9876
  <span [innerHTML]="subItem?.name"></span>
9844
9877
  </option>
9845
9878
  </optgroup>
@@ -9857,14 +9890,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
9857
9890
  <ng-template ngFor let-selectItem [ngForOf]="selectList">
9858
9891
  <option *ngIf="!isArray(selectItem?.items)"
9859
9892
  [selected]="selectItem?.value === controlValue"
9860
- [value]="selectItem?.value">
9893
+ [ngValue]="selectItem?.value">
9861
9894
  <span [innerHTML]="selectItem?.name"></span>
9862
9895
  </option>
9863
9896
  <optgroup *ngIf="isArray(selectItem?.items)"
9864
9897
  [label]="selectItem?.group">
9865
9898
  <option *ngFor="let subItem of selectItem.items"
9866
9899
  [attr.selected]="subItem?.value === controlValue"
9867
- [value]="subItem?.value">
9900
+ [ngValue]="subItem?.value">
9868
9901
  <span [innerHTML]="subItem?.name"></span>
9869
9902
  </option>
9870
9903
  </optgroup>
@@ -9884,14 +9917,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
9884
9917
  <ng-template ngFor let-selectItem [ngForOf]="selectList">
9885
9918
  <option *ngIf="!isArray(selectItem?.items)"
9886
9919
  [selected]="selectItem?.value === controlValue"
9887
- [value]="selectItem?.value">
9920
+ [ngValue]="selectItem?.value">
9888
9921
  <span [innerHTML]="selectItem?.name"></span>
9889
9922
  </option>
9890
9923
  <optgroup *ngIf="isArray(selectItem?.items)"
9891
9924
  [label]="selectItem?.group">
9892
9925
  <option *ngFor="let subItem of selectItem.items"
9893
9926
  [attr.selected]="subItem?.value === controlValue"
9894
- [value]="subItem?.value">
9927
+ [ngValue]="subItem?.value">
9895
9928
  <span [innerHTML]="subItem?.name"></span>
9896
9929
  </option>
9897
9930
  </optgroup>
@@ -9986,43 +10019,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
9986
10019
  type: Input
9987
10020
  }] } });
9988
10021
 
9989
- class TabComponent {
9990
- constructor(jsf) {
9991
- this.jsf = jsf;
9992
- }
9993
- ngOnInit() {
9994
- this.options = this.layoutNode.options || {};
9995
- }
9996
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TabComponent, deps: [{ token: JsonSchemaFormService }], target: i0.ɵɵFactoryTarget.Component }); }
9997
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TabComponent, selector: "tab-widget", inputs: { layoutNode: "layoutNode", layoutIndex: "layoutIndex", dataIndex: "dataIndex" }, ngImport: i0, template: `
9998
- <div [class]="options?.htmlClass || ''">
9999
- <root-widget
10000
- [dataIndex]="dataIndex"
10001
- [layoutIndex]="layoutIndex"
10002
- [layout]="layoutNode.items"></root-widget>
10003
- </div>`, isInline: true, dependencies: [{ kind: "component", type: RootComponent, selector: "root-widget", inputs: ["dataIndex", "layoutIndex", "layout", "isOrderable", "isFlexItem"] }] }); }
10004
- }
10005
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TabComponent, decorators: [{
10006
- type: Component,
10007
- args: [{
10008
- // tslint:disable-next-line:component-selector
10009
- selector: 'tab-widget',
10010
- template: `
10011
- <div [class]="options?.htmlClass || ''">
10012
- <root-widget
10013
- [dataIndex]="dataIndex"
10014
- [layoutIndex]="layoutIndex"
10015
- [layout]="layoutNode.items"></root-widget>
10016
- </div>`,
10017
- }]
10018
- }], ctorParameters: function () { return [{ type: JsonSchemaFormService }]; }, propDecorators: { layoutNode: [{
10019
- type: Input
10020
- }], layoutIndex: [{
10021
- type: Input
10022
- }], dataIndex: [{
10023
- type: Input
10024
- }] } });
10025
-
10026
10022
  class TemplateComponent {
10027
10023
  constructor(jsf) {
10028
10024
  this.jsf = jsf;
@@ -10249,13 +10245,17 @@ class WidgetLibraryService {
10249
10245
  // See: http://ulion.github.io/jsonform/playground/?example=fields-checkboxbuttons
10250
10246
  // Widgets included for compatibility with React JSON Schema Form API
10251
10247
  'updown': 'number',
10252
- 'date-time': 'datetime-local',
10248
+ //'date-time': 'datetime-local',
10249
+ //as per ajv date-time requires a timezone but input
10250
+ //datetime-local doesn't
10251
+ 'iso-date-time': 'datetime-local',
10253
10252
  'alt-datetime': 'datetime-local',
10254
10253
  'alt-date': 'date',
10255
10254
  // Widgets included for compatibility with Angular Schema Form API
10256
10255
  'wizard': 'section',
10257
10256
  // Widgets included for compatibility with other libraries
10258
10257
  'textline': 'text',
10258
+ 'selectcheckbox': SelectCheckboxComponent,
10259
10259
  // Recommended 3rd-party add-on widgets (TODO: create wrappers for these...)
10260
10260
  // 'ng2-select': Select control replacement - http://valor-software.com/ng2-select/
10261
10261
  // 'flatpickr': Flatpickr date picker - https://github.com/chmln/flatpickr
@@ -10372,73 +10372,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
10372
10372
  }]
10373
10373
  }], ctorParameters: function () { return []; } });
10374
10374
 
10375
- const BASIC_WIDGETS = [
10376
- AddReferenceComponent, OneOfComponent, ButtonComponent, CheckboxComponent,
10377
- CheckboxesComponent, FileComponent, HiddenComponent, InputComponent,
10378
- MessageComponent, NoneComponent, NumberComponent, RadiosComponent,
10379
- RootComponent, SectionComponent, SelectComponent, SelectFrameworkComponent,
10380
- SelectWidgetComponent, SubmitComponent, TabComponent, TabsComponent,
10381
- TemplateComponent, TextareaComponent
10382
- ];
10383
-
10384
- class WidgetLibraryModule {
10385
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: WidgetLibraryModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
10386
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.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, OrderableDirective, ElementAttributeDirective], imports: [CommonModule, FormsModule, ReactiveFormsModule, i3$1.SortablejsModule], exports: [AddReferenceComponent, OneOfComponent, ButtonComponent, CheckboxComponent, CheckboxesComponent, FileComponent, HiddenComponent, InputComponent, MessageComponent, NoneComponent, NumberComponent, RadiosComponent, RootComponent, SectionComponent, SelectComponent, SelectFrameworkComponent, SelectWidgetComponent, SubmitComponent, TabComponent, TabsComponent, TemplateComponent, TextareaComponent, OrderableDirective, ElementAttributeDirective] }); }
10387
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: WidgetLibraryModule, imports: [CommonModule, FormsModule, ReactiveFormsModule,
10388
- SortablejsModule.forRoot({
10389
- //disabled:false,
10390
- //draggable:".draggableitem",//">:not(.nonsort)",//">.draggable-item",//":not(.nonsort)",//">*",//":not(.nonsort)",//":not(.non-draggable)",
10391
- filter: ".sortable-filter",
10392
- preventOnFilter: false,
10393
- onMove: function (/**Event*/ evt, /**Event*/ originalEvent) {
10394
- if (evt.related.classList.contains("sortable-fixed")) {
10395
- //console.log(evt.related);
10396
- return false;
10397
- }
10398
- }
10399
- })] }); }
10400
- }
10401
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: WidgetLibraryModule, decorators: [{
10402
- type: NgModule,
10403
- args: [{
10404
- imports: [CommonModule, FormsModule, ReactiveFormsModule,
10405
- SortablejsModule.forRoot({
10406
- //disabled:false,
10407
- //draggable:".draggableitem",//">:not(.nonsort)",//">.draggable-item",//":not(.nonsort)",//">*",//":not(.nonsort)",//":not(.non-draggable)",
10408
- filter: ".sortable-filter",
10409
- preventOnFilter: false,
10410
- onMove: function (/**Event*/ evt, /**Event*/ originalEvent) {
10411
- if (evt.related.classList.contains("sortable-fixed")) {
10412
- //console.log(evt.related);
10413
- return false;
10414
- }
10415
- }
10416
- })],
10417
- declarations: [...BASIC_WIDGETS, OrderableDirective, ElementAttributeDirective],
10418
- exports: [...BASIC_WIDGETS, OrderableDirective, ElementAttributeDirective]
10419
- }]
10420
- }] });
10421
-
10422
- // No framework - plain HTML controls (styles from form layout only)
10423
- class NoFrameworkModule {
10424
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NoFrameworkModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
10425
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: NoFrameworkModule, declarations: [NoFrameworkComponent], imports: [CommonModule, WidgetLibraryModule], exports: [NoFrameworkComponent] }); }
10426
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NoFrameworkModule, providers: [
10427
- { provide: Framework, useClass: NoFramework, multi: true }
10428
- ], imports: [CommonModule, WidgetLibraryModule] }); }
10429
- }
10430
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NoFrameworkModule, decorators: [{
10431
- type: NgModule,
10432
- args: [{
10433
- imports: [CommonModule, WidgetLibraryModule],
10434
- declarations: [NoFrameworkComponent],
10435
- exports: [NoFrameworkComponent],
10436
- providers: [
10437
- { provide: Framework, useClass: NoFramework, multi: true }
10438
- ]
10439
- }]
10440
- }] });
10441
-
10442
10375
  // Possible future frameworks:
10443
10376
  // - Foundation 6:
10444
10377
  // http://justindavis.co/2017/06/15/using-foundation-6-in-angular-4/
@@ -10606,6 +10539,289 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
10606
10539
  args: [WidgetLibraryService]
10607
10540
  }] }, { type: i1.HttpClient }]; } });
10608
10541
 
10542
+ //component created as a fallback for the checkbox/sortabljs issue
10543
+ //its meant to display a select as a checkbox
10544
+ class SelectCheckboxComponent {
10545
+ constructor() {
10546
+ this.jsf = inject(JsonSchemaFormService);
10547
+ this.jsfFLService = inject(FrameworkLibraryService);
10548
+ this.controlDisabled = false;
10549
+ this.boundControl = false;
10550
+ this.selectList = [];
10551
+ this.selectListFlatGroup = [];
10552
+ this.isArray = isArray;
10553
+ this.frameworkStyles = {
10554
+ daisyui: { selectClass: "select-box", optionClass: "checkbox tw:dui-checkbox", optionChecked: "active", optionUnchecked: "" },
10555
+ "bootstrap-3": { selectClass: "select-box", optionClass: "bs3-option checkbox display-inline-block", optionChecked: "active", optionUnchecked: "" },
10556
+ "bootstrap-4": { selectClass: "select-box", optionClass: "bs4-option checkbox display-inline-block", optionChecked: "active", optionUnchecked: "" },
10557
+ "bootstrap-5": { selectClass: " select-box", optionClass: "form-check-input display-inline-block", optionChecked: "active", optionUnchecked: "" },
10558
+ //"material-design":{selectClass:" ",optionClass:" "}
10559
+ };
10560
+ }
10561
+ ngOnInit() {
10562
+ this.options = this.layoutNode.options || {};
10563
+ this.activeFramework = this.jsfFLService.activeFramework.name;
10564
+ this.selectList = buildTitleMap(
10565
+ //this.options.titleMap || this.options.enumNames,
10566
+ //TODO review-title is set to null in the setTitle() method of CssFrameworkComponent
10567
+ this.options.enumNames || (this.options?.title && [this.options?.title])
10568
+ || [this.layoutNode.name],
10569
+ //this.options.enum,
10570
+ [true],
10571
+ //make required true to avoid creating 'none' select option
10572
+ true, !!this.options.flatList);
10573
+ //the selectListFlatGroup array will be used to update the formArray values
10574
+ //while the selectList array will be bound to the form select
10575
+ //as either a grouped select or a flat select
10576
+ /*
10577
+ this.selectListFlatGroup = buildTitleMap(
10578
+ this.options.titleMap || this.options.enumNames,
10579
+ this.options.enum, !!this.options.required, true
10580
+ )
10581
+ */
10582
+ this.jsf.initializeControl(this);
10583
+ this.selectValue = [this.controlValue];
10584
+ }
10585
+ deselectAll() {
10586
+ this.selectListFlatGroup.forEach(selItem => {
10587
+ selItem.checked = false;
10588
+ });
10589
+ }
10590
+ updateValue(event) {
10591
+ this.options.showErrors = true;
10592
+ this.controlValue = this.selectValue[0];
10593
+ this.jsf.updateValue(this, this.controlValue);
10594
+ }
10595
+ onSelectClicked($event) {
10596
+ this.selectValue = this.selectValue && this.selectValue[0] ? [false] : [true];
10597
+ this.controlValue = this.selectValue[0];
10598
+ this.jsf.updateValue(this, this.controlValue);
10599
+ }
10600
+ ngOnDestroy() {
10601
+ let nullVal = this.options.multiple ? [null] : null;
10602
+ this.formControl.reset(nullVal);
10603
+ this.controlValue = null;
10604
+ }
10605
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SelectCheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
10606
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: SelectCheckboxComponent, selector: "selectcheckbox-widget", inputs: { layoutNode: "layoutNode", layoutIndex: "layoutIndex", dataIndex: "dataIndex" }, ngImport: i0, template: `
10607
+ <div
10608
+ [class]="options?.htmlClass || ''">
10609
+ <select *ngIf="boundControl"
10610
+ [attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
10611
+ [attr.readonly]="options?.readonly ? 'readonly' : null"
10612
+ [attr.required]="options?.required"
10613
+ [class]=" frameworkStyles[activeFramework].selectClass"
10614
+ [multiple]="true"
10615
+ [id]="'control' + layoutNode?._id"
10616
+ [name]="controlName"
10617
+ [ngModel]="selectValue"
10618
+ >
10619
+ <ng-template ngFor let-selectItem [ngForOf]="selectList">
10620
+ <option *ngIf="!isArray(selectItem?.items)"
10621
+ [class]="frameworkStyles[activeFramework].optionClass"
10622
+ [class.active]="selectItem?.value === controlValue"
10623
+ [class.unchecked-notusing]="selectItem?.value != controlValue"
10624
+ [value]="selectItem?.value"
10625
+ (click)="onSelectClicked($event)"
10626
+ type="checkbox"
10627
+ >
10628
+ </option>
10629
+ <!--NB the text is out of the option element to display besides the checkbox-->
10630
+ <span [innerHTML]="selectItem?.name"></span>
10631
+ </ng-template>
10632
+ </select>
10633
+ <select *ngIf="!boundControl"
10634
+ [attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
10635
+ [attr.readonly]="options?.readonly ? 'readonly' : null"
10636
+ [attr.required]="options?.required"
10637
+ [class]="frameworkStyles[activeFramework].selectClass +' select-box'"
10638
+ [multiple]="true"
10639
+ [disabled]="controlDisabled"
10640
+ [id]="'control' + layoutNode?._id"
10641
+ [name]="controlName"
10642
+ (change)="updateValue($event)">
10643
+ <ng-template ngFor let-selectItem [ngForOf]="selectList">
10644
+ <option *ngIf="!isArray(selectItem?.items)"
10645
+ [selected]="selectItem?.value === controlValue"
10646
+ [class]="frameworkStyles[activeFramework].optionClass"
10647
+ [class.checked-notusing]="selectItem?.value === controlValue"
10648
+ [class.unchecked-notusing]]="selectItem?.value != controlValue"
10649
+ [value]="selectItem?.value"
10650
+ type="checkbox">
10651
+ </option>
10652
+ <!--NB the text is out of the option element to display besides the checkbox-->
10653
+ <span [innerHTML]="selectItem?.name"></span>
10654
+ </ng-template>
10655
+ </select>
10656
+
10657
+ </div>`, isInline: true, styles: [".select-box{font-size:16px;border:none;appearance:none;-webkit-appearance:none;-moz-appearance:none;height:25px;overflow:hidden;text-overflow:ellipsis;background-color:#fff;color:#000;background-color:transparent}.select-box:focus{outline:none}.select-option{font-size:20px;color:#000;background-color:#fff;display:inline-block}.unchecked:before{content:\"\\2610\";left:5px;top:50%;transform:translateY(-50%);font-size:30px}.checked:before{content:\"\\2611\";left:5px;top:50%;transform:translateY(-50%);font-size:30px}.select-option:checked{background-image:linear-gradient(0deg,#fff 0% 100%);color:#000}.select-box[multiple]:focus{background-color:transparent;color:#00f;-webkit-text-fill-color:black}.display-inline-block{display:inline-block}.bs4-option,.bs3-option{width:14px;height:14px;border:solid 1px;color:#a9a9a9;min-block-size:auto;border-radius:3px}.bs4-option:checked[type=checkbox],.bs3-option:checked[type=checkbox]{background-image:url(data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!--%20License%3A%20MIT.%20Made%20by%20jaynewey%3A%20https%3A%2F%2Fgithub.com%2Fjaynewey%2Fcharm-icons%20--%3E%3Csvg%20viewBox%3D%220%200%2016%2016%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20fill%3D%22none%22%20stroke%3D%22%23000000%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20stroke-width%3D%222.5%22%3E%3Cpolyline%20points%3D%224%208.75%2C6.25%2012.25%2C13.25%203.5%22%2F%3E%3C%2Fsvg%3E);background-color:#00ced1}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i3.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i3.SelectMultipleControlValueAccessor, selector: "select[multiple][formControlName],select[multiple][formControl],select[multiple][ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] }); }
10658
+ }
10659
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SelectCheckboxComponent, decorators: [{
10660
+ type: Component,
10661
+ args: [{ selector: 'selectcheckbox-widget', template: `
10662
+ <div
10663
+ [class]="options?.htmlClass || ''">
10664
+ <select *ngIf="boundControl"
10665
+ [attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
10666
+ [attr.readonly]="options?.readonly ? 'readonly' : null"
10667
+ [attr.required]="options?.required"
10668
+ [class]=" frameworkStyles[activeFramework].selectClass"
10669
+ [multiple]="true"
10670
+ [id]="'control' + layoutNode?._id"
10671
+ [name]="controlName"
10672
+ [ngModel]="selectValue"
10673
+ >
10674
+ <ng-template ngFor let-selectItem [ngForOf]="selectList">
10675
+ <option *ngIf="!isArray(selectItem?.items)"
10676
+ [class]="frameworkStyles[activeFramework].optionClass"
10677
+ [class.active]="selectItem?.value === controlValue"
10678
+ [class.unchecked-notusing]="selectItem?.value != controlValue"
10679
+ [value]="selectItem?.value"
10680
+ (click)="onSelectClicked($event)"
10681
+ type="checkbox"
10682
+ >
10683
+ </option>
10684
+ <!--NB the text is out of the option element to display besides the checkbox-->
10685
+ <span [innerHTML]="selectItem?.name"></span>
10686
+ </ng-template>
10687
+ </select>
10688
+ <select *ngIf="!boundControl"
10689
+ [attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
10690
+ [attr.readonly]="options?.readonly ? 'readonly' : null"
10691
+ [attr.required]="options?.required"
10692
+ [class]="frameworkStyles[activeFramework].selectClass +' select-box'"
10693
+ [multiple]="true"
10694
+ [disabled]="controlDisabled"
10695
+ [id]="'control' + layoutNode?._id"
10696
+ [name]="controlName"
10697
+ (change)="updateValue($event)">
10698
+ <ng-template ngFor let-selectItem [ngForOf]="selectList">
10699
+ <option *ngIf="!isArray(selectItem?.items)"
10700
+ [selected]="selectItem?.value === controlValue"
10701
+ [class]="frameworkStyles[activeFramework].optionClass"
10702
+ [class.checked-notusing]="selectItem?.value === controlValue"
10703
+ [class.unchecked-notusing]]="selectItem?.value != controlValue"
10704
+ [value]="selectItem?.value"
10705
+ type="checkbox">
10706
+ </option>
10707
+ <!--NB the text is out of the option element to display besides the checkbox-->
10708
+ <span [innerHTML]="selectItem?.name"></span>
10709
+ </ng-template>
10710
+ </select>
10711
+
10712
+ </div>`, standalone: false, styles: [".select-box{font-size:16px;border:none;appearance:none;-webkit-appearance:none;-moz-appearance:none;height:25px;overflow:hidden;text-overflow:ellipsis;background-color:#fff;color:#000;background-color:transparent}.select-box:focus{outline:none}.select-option{font-size:20px;color:#000;background-color:#fff;display:inline-block}.unchecked:before{content:\"\\2610\";left:5px;top:50%;transform:translateY(-50%);font-size:30px}.checked:before{content:\"\\2611\";left:5px;top:50%;transform:translateY(-50%);font-size:30px}.select-option:checked{background-image:linear-gradient(0deg,#fff 0% 100%);color:#000}.select-box[multiple]:focus{background-color:transparent;color:#00f;-webkit-text-fill-color:black}.display-inline-block{display:inline-block}.bs4-option,.bs3-option{width:14px;height:14px;border:solid 1px;color:#a9a9a9;min-block-size:auto;border-radius:3px}.bs4-option:checked[type=checkbox],.bs3-option:checked[type=checkbox]{background-image:url(data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!--%20License%3A%20MIT.%20Made%20by%20jaynewey%3A%20https%3A%2F%2Fgithub.com%2Fjaynewey%2Fcharm-icons%20--%3E%3Csvg%20viewBox%3D%220%200%2016%2016%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20fill%3D%22none%22%20stroke%3D%22%23000000%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20stroke-width%3D%222.5%22%3E%3Cpolyline%20points%3D%224%208.75%2C6.25%2012.25%2C13.25%203.5%22%2F%3E%3C%2Fsvg%3E);background-color:#00ced1}\n"] }]
10713
+ }], propDecorators: { layoutNode: [{
10714
+ type: Input
10715
+ }], layoutIndex: [{
10716
+ type: Input
10717
+ }], dataIndex: [{
10718
+ type: Input
10719
+ }] } });
10720
+
10721
+ class TabComponent {
10722
+ constructor(jsf) {
10723
+ this.jsf = jsf;
10724
+ }
10725
+ ngOnInit() {
10726
+ this.options = this.layoutNode.options || {};
10727
+ }
10728
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TabComponent, deps: [{ token: JsonSchemaFormService }], target: i0.ɵɵFactoryTarget.Component }); }
10729
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TabComponent, selector: "tab-widget", inputs: { layoutNode: "layoutNode", layoutIndex: "layoutIndex", dataIndex: "dataIndex" }, ngImport: i0, template: `
10730
+ <div [class]="options?.htmlClass || ''">
10731
+ <root-widget
10732
+ [dataIndex]="dataIndex"
10733
+ [layoutIndex]="layoutIndex"
10734
+ [layout]="layoutNode.items"></root-widget>
10735
+ </div>`, isInline: true, dependencies: [{ kind: "component", type: RootComponent, selector: "root-widget", inputs: ["dataIndex", "layoutIndex", "layout", "isOrderable", "isFlexItem"] }] }); }
10736
+ }
10737
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TabComponent, decorators: [{
10738
+ type: Component,
10739
+ args: [{
10740
+ // tslint:disable-next-line:component-selector
10741
+ selector: 'tab-widget',
10742
+ template: `
10743
+ <div [class]="options?.htmlClass || ''">
10744
+ <root-widget
10745
+ [dataIndex]="dataIndex"
10746
+ [layoutIndex]="layoutIndex"
10747
+ [layout]="layoutNode.items"></root-widget>
10748
+ </div>`,
10749
+ }]
10750
+ }], ctorParameters: function () { return [{ type: JsonSchemaFormService }]; }, propDecorators: { layoutNode: [{
10751
+ type: Input
10752
+ }], layoutIndex: [{
10753
+ type: Input
10754
+ }], dataIndex: [{
10755
+ type: Input
10756
+ }] } });
10757
+
10758
+ const BASIC_WIDGETS = [
10759
+ AddReferenceComponent, OneOfComponent, ButtonComponent, CheckboxComponent,
10760
+ CheckboxesComponent, FileComponent, HiddenComponent, InputComponent,
10761
+ MessageComponent, NoneComponent, NumberComponent, RadiosComponent,
10762
+ RootComponent, SectionComponent, SelectComponent, SelectFrameworkComponent,
10763
+ SelectWidgetComponent, SubmitComponent, TabComponent, TabsComponent,
10764
+ TemplateComponent, TextareaComponent, SelectCheckboxComponent
10765
+ ];
10766
+
10767
+ class WidgetLibraryModule {
10768
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: WidgetLibraryModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
10769
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.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, i3$1.SortablejsModule], exports: [AddReferenceComponent, OneOfComponent, ButtonComponent, CheckboxComponent, CheckboxesComponent, FileComponent, HiddenComponent, InputComponent, MessageComponent, NoneComponent, NumberComponent, RadiosComponent, RootComponent, SectionComponent, SelectComponent, SelectFrameworkComponent, SelectWidgetComponent, SubmitComponent, TabComponent, TabsComponent, TemplateComponent, TextareaComponent, SelectCheckboxComponent, OrderableDirective, ElementAttributeDirective] }); }
10770
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: WidgetLibraryModule, imports: [CommonModule, FormsModule, ReactiveFormsModule,
10771
+ SortablejsModule.forRoot({
10772
+ //disabled:false,
10773
+ //draggable:".draggableitem",//">:not(.nonsort)",//">.draggable-item",//":not(.nonsort)",//">*",//":not(.nonsort)",//":not(.non-draggable)",
10774
+ filter: ".sortable-filter",
10775
+ preventOnFilter: false,
10776
+ onMove: function (/**Event*/ evt, /**Event*/ originalEvent) {
10777
+ if (evt.related.classList.contains("sortable-fixed")) {
10778
+ //console.log(evt.related);
10779
+ return false;
10780
+ }
10781
+ }
10782
+ })] }); }
10783
+ }
10784
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: WidgetLibraryModule, decorators: [{
10785
+ type: NgModule,
10786
+ args: [{
10787
+ imports: [CommonModule, FormsModule, ReactiveFormsModule,
10788
+ SortablejsModule.forRoot({
10789
+ //disabled:false,
10790
+ //draggable:".draggableitem",//">:not(.nonsort)",//">.draggable-item",//":not(.nonsort)",//">*",//":not(.nonsort)",//":not(.non-draggable)",
10791
+ filter: ".sortable-filter",
10792
+ preventOnFilter: false,
10793
+ onMove: function (/**Event*/ evt, /**Event*/ originalEvent) {
10794
+ if (evt.related.classList.contains("sortable-fixed")) {
10795
+ //console.log(evt.related);
10796
+ return false;
10797
+ }
10798
+ }
10799
+ })],
10800
+ declarations: [...BASIC_WIDGETS, OrderableDirective, ElementAttributeDirective],
10801
+ exports: [...BASIC_WIDGETS, OrderableDirective, ElementAttributeDirective]
10802
+ }]
10803
+ }] });
10804
+
10805
+ // No framework - plain HTML controls (styles from form layout only)
10806
+ class NoFrameworkModule {
10807
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NoFrameworkModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
10808
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: NoFrameworkModule, declarations: [NoFrameworkComponent], imports: [CommonModule, WidgetLibraryModule], exports: [NoFrameworkComponent] }); }
10809
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NoFrameworkModule, providers: [
10810
+ { provide: Framework, useClass: NoFramework, multi: true }
10811
+ ], imports: [CommonModule, WidgetLibraryModule] }); }
10812
+ }
10813
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NoFrameworkModule, decorators: [{
10814
+ type: NgModule,
10815
+ args: [{
10816
+ imports: [CommonModule, WidgetLibraryModule],
10817
+ declarations: [NoFrameworkComponent],
10818
+ exports: [NoFrameworkComponent],
10819
+ providers: [
10820
+ { provide: Framework, useClass: NoFramework, multi: true }
10821
+ ]
10822
+ }]
10823
+ }] });
10824
+
10609
10825
  const JSON_SCHEMA_FORM_VALUE_ACCESSOR = {
10610
10826
  provide: NG_VALUE_ACCESSOR,
10611
10827
  useExisting: forwardRef(() => JsonSchemaFormComponent),
@@ -11398,5 +11614,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
11398
11614
  * Generated bundle index. Do not edit.
11399
11615
  */
11400
11616
 
11401
- 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, 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 };
11617
+ 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 };
11402
11618
  //# sourceMappingURL=ng-formworks-core.mjs.map