@ng-formworks/core 17.6.2 → 17.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 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, NgModule, Inject, forwardRef, ChangeDetectorRef, output } from '@angular/core';
4
+ import { Injectable, inject, input, viewChild, ViewContainerRef, Component, Input, Directive, ChangeDetectionStrategy, ViewChild, signal, ElementRef, NgZone, Inject, NgModule, forwardRef, ChangeDetectorRef, output } from '@angular/core';
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';
@@ -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
  }
@@ -8908,7 +8940,7 @@ class OneOfComponent {
8908
8940
  let controlSchema = JsonPointer.get(this.jsf.schema, parts.join("/"));
8909
8941
  let schemaPointer = parts.join("/");
8910
8942
  let dPointer = schemaPointer.replace(/(anyOf|allOf|oneOf|none)\/[\d]+\//g, '')
8911
- .replace(/(if|then|else|properties)\//g, '');
8943
+ .replace(/(if|then|else|properties)\//g, '').replace(/\/items\//g, '/-/');
8912
8944
  //JsonPointer.toDataPointer(parts.join("/"),this.jsf.schema);
8913
8945
  let dVal = JsonPointer.get(this.jsf.formValues, dPointer);
8914
8946
  let compareVal = dVal; //formValue;
@@ -9281,6 +9313,7 @@ class RootComponent {
9281
9313
  }
9282
9314
  sortableInit(sortable) {
9283
9315
  this.sortableObj = sortable;
9316
+ //Sortable.utils.on(this.sortableObj.el,"nulling",(s)=>{console.log("event nulling sortablejs")})
9284
9317
  ///NB issue caused by sortablejs when it its destroyed
9285
9318
  //this mainly affects checkboxes coupled with conditions
9286
9319
  //-the value is rechecked
@@ -9711,13 +9744,13 @@ class SelectComponent {
9711
9744
  [name]="controlName">
9712
9745
  <ng-template ngFor let-selectItem [ngForOf]="selectList">
9713
9746
  <option *ngIf="!isArray(selectItem?.items)"
9714
- [value]="selectItem?.value">
9747
+ [ngValue]="selectItem?.value">
9715
9748
  <span [innerHTML]="selectItem?.name"></span>
9716
9749
  </option>
9717
9750
  <optgroup *ngIf="isArray(selectItem?.items)"
9718
9751
  [label]="selectItem?.group">
9719
9752
  <option *ngFor="let subItem of selectItem.items"
9720
- [value]="subItem?.value">
9753
+ [ngValue]="subItem?.value">
9721
9754
  <span [innerHTML]="subItem?.name"></span>
9722
9755
  </option>
9723
9756
  </optgroup>
@@ -9735,14 +9768,14 @@ class SelectComponent {
9735
9768
  <ng-template ngFor let-selectItem [ngForOf]="selectList">
9736
9769
  <option *ngIf="!isArray(selectItem?.items)"
9737
9770
  [selected]="selectItem?.value === controlValue"
9738
- [value]="selectItem?.value">
9771
+ [ngValue]="selectItem?.value">
9739
9772
  <span [innerHTML]="selectItem?.name"></span>
9740
9773
  </option>
9741
9774
  <optgroup *ngIf="isArray(selectItem?.items)"
9742
9775
  [label]="selectItem?.group">
9743
9776
  <option *ngFor="let subItem of selectItem.items"
9744
9777
  [attr.selected]="subItem?.value === controlValue"
9745
- [value]="subItem?.value">
9778
+ [ngValue]="subItem?.value">
9746
9779
  <span [innerHTML]="subItem?.name"></span>
9747
9780
  </option>
9748
9781
  </optgroup>
@@ -9762,14 +9795,14 @@ class SelectComponent {
9762
9795
  <ng-template ngFor let-selectItem [ngForOf]="selectList">
9763
9796
  <option *ngIf="!isArray(selectItem?.items)"
9764
9797
  [selected]="selectItem?.value === controlValue"
9765
- [value]="selectItem?.value">
9798
+ [ngValue]="selectItem?.value">
9766
9799
  <span [innerHTML]="selectItem?.name"></span>
9767
9800
  </option>
9768
9801
  <optgroup *ngIf="isArray(selectItem?.items)"
9769
9802
  [label]="selectItem?.group">
9770
9803
  <option *ngFor="let subItem of selectItem.items"
9771
9804
  [attr.selected]="subItem?.value === controlValue"
9772
- [value]="subItem?.value">
9805
+ [ngValue]="subItem?.value">
9773
9806
  <span [innerHTML]="subItem?.name"></span>
9774
9807
  </option>
9775
9808
  </optgroup>
@@ -9800,13 +9833,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
9800
9833
  [name]="controlName">
9801
9834
  <ng-template ngFor let-selectItem [ngForOf]="selectList">
9802
9835
  <option *ngIf="!isArray(selectItem?.items)"
9803
- [value]="selectItem?.value">
9836
+ [ngValue]="selectItem?.value">
9804
9837
  <span [innerHTML]="selectItem?.name"></span>
9805
9838
  </option>
9806
9839
  <optgroup *ngIf="isArray(selectItem?.items)"
9807
9840
  [label]="selectItem?.group">
9808
9841
  <option *ngFor="let subItem of selectItem.items"
9809
- [value]="subItem?.value">
9842
+ [ngValue]="subItem?.value">
9810
9843
  <span [innerHTML]="subItem?.name"></span>
9811
9844
  </option>
9812
9845
  </optgroup>
@@ -9824,14 +9857,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
9824
9857
  <ng-template ngFor let-selectItem [ngForOf]="selectList">
9825
9858
  <option *ngIf="!isArray(selectItem?.items)"
9826
9859
  [selected]="selectItem?.value === controlValue"
9827
- [value]="selectItem?.value">
9860
+ [ngValue]="selectItem?.value">
9828
9861
  <span [innerHTML]="selectItem?.name"></span>
9829
9862
  </option>
9830
9863
  <optgroup *ngIf="isArray(selectItem?.items)"
9831
9864
  [label]="selectItem?.group">
9832
9865
  <option *ngFor="let subItem of selectItem.items"
9833
9866
  [attr.selected]="subItem?.value === controlValue"
9834
- [value]="subItem?.value">
9867
+ [ngValue]="subItem?.value">
9835
9868
  <span [innerHTML]="subItem?.name"></span>
9836
9869
  </option>
9837
9870
  </optgroup>
@@ -9851,14 +9884,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
9851
9884
  <ng-template ngFor let-selectItem [ngForOf]="selectList">
9852
9885
  <option *ngIf="!isArray(selectItem?.items)"
9853
9886
  [selected]="selectItem?.value === controlValue"
9854
- [value]="selectItem?.value">
9887
+ [ngValue]="selectItem?.value">
9855
9888
  <span [innerHTML]="selectItem?.name"></span>
9856
9889
  </option>
9857
9890
  <optgroup *ngIf="isArray(selectItem?.items)"
9858
9891
  [label]="selectItem?.group">
9859
9892
  <option *ngFor="let subItem of selectItem.items"
9860
9893
  [attr.selected]="subItem?.value === controlValue"
9861
- [value]="subItem?.value">
9894
+ [ngValue]="subItem?.value">
9862
9895
  <span [innerHTML]="subItem?.name"></span>
9863
9896
  </option>
9864
9897
  </optgroup>
@@ -9944,40 +9977,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
9944
9977
  }]
9945
9978
  }] });
9946
9979
 
9947
- class TabComponent {
9948
- constructor() {
9949
- this.jsf = inject(JsonSchemaFormService);
9950
- this.layoutNode = input(undefined);
9951
- this.layoutIndex = input(undefined);
9952
- this.dataIndex = input(undefined);
9953
- }
9954
- ngOnInit() {
9955
- this.options = this.layoutNode().options || {};
9956
- }
9957
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: TabComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
9958
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "17.3.12", type: TabComponent, selector: "tab-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: `
9959
- <div [class]="options?.htmlClass || ''">
9960
- <root-widget
9961
- [dataIndex]="dataIndex()"
9962
- [layoutIndex]="layoutIndex()"
9963
- [layout]="layoutNode().items"></root-widget>
9964
- </div>`, isInline: true, dependencies: [{ kind: "component", type: RootComponent, selector: "root-widget", inputs: ["dataIndex", "layoutIndex", "layout", "isOrderable", "isFlexItem"] }] }); }
9965
- }
9966
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: TabComponent, decorators: [{
9967
- type: Component,
9968
- args: [{
9969
- // tslint:disable-next-line:component-selector
9970
- selector: 'tab-widget',
9971
- template: `
9972
- <div [class]="options?.htmlClass || ''">
9973
- <root-widget
9974
- [dataIndex]="dataIndex()"
9975
- [layoutIndex]="layoutIndex()"
9976
- [layout]="layoutNode().items"></root-widget>
9977
- </div>`,
9978
- }]
9979
- }] });
9980
-
9981
9980
  class TemplateComponent {
9982
9981
  constructor() {
9983
9982
  this.jsf = inject(JsonSchemaFormService);
@@ -10196,13 +10195,17 @@ class WidgetLibraryService {
10196
10195
  // See: http://ulion.github.io/jsonform/playground/?example=fields-checkboxbuttons
10197
10196
  // Widgets included for compatibility with React JSON Schema Form API
10198
10197
  'updown': 'number',
10199
- 'date-time': 'datetime-local',
10198
+ //'date-time': 'datetime-local',
10199
+ //as per ajv date-time requires a timezone but input
10200
+ //datetime-local doesn't
10201
+ 'iso-date-time': 'datetime-local',
10200
10202
  'alt-datetime': 'datetime-local',
10201
10203
  'alt-date': 'date',
10202
10204
  // Widgets included for compatibility with Angular Schema Form API
10203
10205
  'wizard': 'section',
10204
10206
  // Widgets included for compatibility with other libraries
10205
10207
  'textline': 'text',
10208
+ 'selectcheckbox': SelectCheckboxComponent,
10206
10209
  // Recommended 3rd-party add-on widgets (TODO: create wrappers for these...)
10207
10210
  // 'ng2-select': Select control replacement - http://valor-software.com/ng2-select/
10208
10211
  // 'flatpickr': Flatpickr date picker - https://github.com/chmln/flatpickr
@@ -10319,73 +10322,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
10319
10322
  }]
10320
10323
  }], ctorParameters: () => [] });
10321
10324
 
10322
- const BASIC_WIDGETS = [
10323
- AddReferenceComponent, OneOfComponent, ButtonComponent, CheckboxComponent,
10324
- CheckboxesComponent, FileComponent, HiddenComponent, InputComponent,
10325
- MessageComponent, NoneComponent, NumberComponent, RadiosComponent,
10326
- RootComponent, SectionComponent, SelectComponent, SelectFrameworkComponent,
10327
- SelectWidgetComponent, SubmitComponent, TabComponent, TabsComponent,
10328
- TemplateComponent, TextareaComponent
10329
- ];
10330
-
10331
- class WidgetLibraryModule {
10332
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: WidgetLibraryModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
10333
- 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, OrderableDirective, ElementAttributeDirective], imports: [CommonModule, FormsModule, ReactiveFormsModule, i2$1.SortablejsModule], exports: [AddReferenceComponent, OneOfComponent, ButtonComponent, CheckboxComponent, CheckboxesComponent, FileComponent, HiddenComponent, InputComponent, MessageComponent, NoneComponent, NumberComponent, RadiosComponent, RootComponent, SectionComponent, SelectComponent, SelectFrameworkComponent, SelectWidgetComponent, SubmitComponent, TabComponent, TabsComponent, TemplateComponent, TextareaComponent, OrderableDirective, ElementAttributeDirective] }); }
10334
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: WidgetLibraryModule, imports: [CommonModule, FormsModule, ReactiveFormsModule,
10335
- SortablejsModule.forRoot({
10336
- //disabled:false,
10337
- //draggable:".draggableitem",//">:not(.nonsort)",//">.draggable-item",//":not(.nonsort)",//">*",//":not(.nonsort)",//":not(.non-draggable)",
10338
- filter: ".sortable-filter",
10339
- preventOnFilter: false,
10340
- onMove: function (/**Event*/ evt, /**Event*/ originalEvent) {
10341
- if (evt.related.classList.contains("sortable-fixed")) {
10342
- //console.log(evt.related);
10343
- return false;
10344
- }
10345
- }
10346
- })] }); }
10347
- }
10348
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: WidgetLibraryModule, decorators: [{
10349
- type: NgModule,
10350
- args: [{
10351
- imports: [CommonModule, FormsModule, ReactiveFormsModule,
10352
- SortablejsModule.forRoot({
10353
- //disabled:false,
10354
- //draggable:".draggableitem",//">:not(.nonsort)",//">.draggable-item",//":not(.nonsort)",//">*",//":not(.nonsort)",//":not(.non-draggable)",
10355
- filter: ".sortable-filter",
10356
- preventOnFilter: false,
10357
- onMove: function (/**Event*/ evt, /**Event*/ originalEvent) {
10358
- if (evt.related.classList.contains("sortable-fixed")) {
10359
- //console.log(evt.related);
10360
- return false;
10361
- }
10362
- }
10363
- })],
10364
- declarations: [...BASIC_WIDGETS, OrderableDirective, ElementAttributeDirective],
10365
- exports: [...BASIC_WIDGETS, OrderableDirective, ElementAttributeDirective]
10366
- }]
10367
- }] });
10368
-
10369
- // No framework - plain HTML controls (styles from form layout only)
10370
- class NoFrameworkModule {
10371
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: NoFrameworkModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
10372
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: NoFrameworkModule, declarations: [NoFrameworkComponent], imports: [CommonModule, WidgetLibraryModule], exports: [NoFrameworkComponent] }); }
10373
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: NoFrameworkModule, providers: [
10374
- { provide: Framework, useClass: NoFramework, multi: true }
10375
- ], imports: [CommonModule, WidgetLibraryModule] }); }
10376
- }
10377
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: NoFrameworkModule, decorators: [{
10378
- type: NgModule,
10379
- args: [{
10380
- imports: [CommonModule, WidgetLibraryModule],
10381
- declarations: [NoFrameworkComponent],
10382
- exports: [NoFrameworkComponent],
10383
- providers: [
10384
- { provide: Framework, useClass: NoFramework, multi: true }
10385
- ]
10386
- }]
10387
- }] });
10388
-
10389
10325
  // Possible future frameworks:
10390
10326
  // - Foundation 6:
10391
10327
  // http://justindavis.co/2017/06/15/using-foundation-6-in-angular-4/
@@ -10551,6 +10487,283 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
10551
10487
  args: [Framework]
10552
10488
  }] }] });
10553
10489
 
10490
+ //component created as a fallback for the checkbox/sortabljs issue
10491
+ //its meant to display a select as a checkbox
10492
+ class SelectCheckboxComponent {
10493
+ constructor() {
10494
+ this.jsf = inject(JsonSchemaFormService);
10495
+ this.jsfFLService = inject(FrameworkLibraryService);
10496
+ this.controlDisabled = false;
10497
+ this.boundControl = false;
10498
+ this.selectList = [];
10499
+ this.selectListFlatGroup = [];
10500
+ this.isArray = isArray;
10501
+ this.layoutNode = input(undefined);
10502
+ this.layoutIndex = input(undefined);
10503
+ this.dataIndex = input(undefined);
10504
+ this.frameworkStyles = {
10505
+ daisyui: { selectClass: "select-box", optionClass: "checkbox tw:dui-checkbox", optionChecked: "active", optionUnchecked: "" },
10506
+ "bootstrap-3": { selectClass: "select-box", optionClass: "bs3-option checkbox display-inline-block", optionChecked: "active", optionUnchecked: "" },
10507
+ "bootstrap-4": { selectClass: "select-box", optionClass: "bs4-option checkbox display-inline-block", optionChecked: "active", optionUnchecked: "" },
10508
+ "bootstrap-5": { selectClass: " select-box", optionClass: "form-check-input display-inline-block", optionChecked: "active", optionUnchecked: "" },
10509
+ //"material-design":{selectClass:" ",optionClass:" "}
10510
+ };
10511
+ }
10512
+ ngOnInit() {
10513
+ this.options = this.layoutNode().options || {};
10514
+ this.activeFramework = this.jsfFLService.activeFramework.name;
10515
+ this.selectList = buildTitleMap(
10516
+ //this.options.titleMap || this.options.enumNames,
10517
+ //TODO review-title is set to null in the setTitle() method of CssFrameworkComponent
10518
+ this.options.enumNames || (this.options?.title && [this.options?.title])
10519
+ || [this.layoutNode().name],
10520
+ //this.options.enum,
10521
+ [true],
10522
+ //make required true to avoid creating 'none' select option
10523
+ true, !!this.options.flatList);
10524
+ //the selectListFlatGroup array will be used to update the formArray values
10525
+ //while the selectList array will be bound to the form select
10526
+ //as either a grouped select or a flat select
10527
+ /*
10528
+ this.selectListFlatGroup = buildTitleMap(
10529
+ this.options.titleMap || this.options.enumNames,
10530
+ this.options.enum, !!this.options.required, true
10531
+ )
10532
+ */
10533
+ this.jsf.initializeControl(this);
10534
+ this.selectValue = [this.controlValue];
10535
+ }
10536
+ deselectAll() {
10537
+ this.selectListFlatGroup.forEach(selItem => {
10538
+ selItem.checked = false;
10539
+ });
10540
+ }
10541
+ updateValue(event) {
10542
+ this.options.showErrors = true;
10543
+ this.controlValue = this.selectValue[0];
10544
+ this.jsf.updateValue(this, this.controlValue);
10545
+ }
10546
+ onSelectClicked($event) {
10547
+ this.selectValue = this.selectValue && this.selectValue[0] ? [false] : [true];
10548
+ this.controlValue = this.selectValue[0];
10549
+ this.jsf.updateValue(this, this.controlValue);
10550
+ }
10551
+ ngOnDestroy() {
10552
+ let nullVal = this.options.multiple ? [null] : null;
10553
+ this.formControl.reset(nullVal);
10554
+ this.controlValue = null;
10555
+ }
10556
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SelectCheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
10557
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "17.3.12", type: SelectCheckboxComponent, selector: "selectcheckbox-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: `
10558
+ <div
10559
+ [class]="options?.htmlClass || ''">
10560
+ <select *ngIf="boundControl"
10561
+ [attr.aria-describedby]="'control' + layoutNode()?._id + 'Status'"
10562
+ [attr.readonly]="options?.readonly ? 'readonly' : null"
10563
+ [attr.required]="options?.required"
10564
+ [class]=" frameworkStyles[activeFramework].selectClass"
10565
+ [multiple]="true"
10566
+ [id]="'control' + layoutNode()?._id"
10567
+ [name]="controlName"
10568
+ [ngModel]="selectValue"
10569
+ >
10570
+ <ng-template ngFor let-selectItem [ngForOf]="selectList">
10571
+ <option *ngIf="!isArray(selectItem?.items)"
10572
+ [class]="frameworkStyles[activeFramework].optionClass"
10573
+ [class.active]="selectItem?.value === controlValue"
10574
+ [class.unchecked-notusing]="selectItem?.value != controlValue"
10575
+ [value]="selectItem?.value"
10576
+ (click)="onSelectClicked($event)"
10577
+ type="checkbox"
10578
+ >
10579
+ </option>
10580
+ <!--NB the text is out of the option element to display besides the checkbox-->
10581
+ <span [innerHTML]="selectItem?.name"></span>
10582
+ </ng-template>
10583
+ </select>
10584
+ <select *ngIf="!boundControl"
10585
+ [attr.aria-describedby]="'control' + layoutNode()?._id + 'Status'"
10586
+ [attr.readonly]="options?.readonly ? 'readonly' : null"
10587
+ [attr.required]="options?.required"
10588
+ [class]="frameworkStyles[activeFramework].selectClass +' select-box'"
10589
+ [multiple]="true"
10590
+ [disabled]="controlDisabled"
10591
+ [id]="'control' + layoutNode()?._id"
10592
+ [name]="controlName"
10593
+ (change)="updateValue($event)">
10594
+ <ng-template ngFor let-selectItem [ngForOf]="selectList">
10595
+ <option *ngIf="!isArray(selectItem?.items)"
10596
+ [selected]="selectItem?.value === controlValue"
10597
+ [class]="frameworkStyles[activeFramework].optionClass"
10598
+ [class.checked-notusing]="selectItem?.value === controlValue"
10599
+ [class.unchecked-notusing]]="selectItem?.value != controlValue"
10600
+ [value]="selectItem?.value"
10601
+ type="checkbox">
10602
+ </option>
10603
+ <!--NB the text is out of the option element to display besides the checkbox-->
10604
+ <span [innerHTML]="selectItem?.name"></span>
10605
+ </ng-template>
10606
+ </select>
10607
+
10608
+ </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: 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.SelectMultipleControlValueAccessor, selector: "select[multiple][formControlName],select[multiple][formControl],select[multiple][ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] }); }
10609
+ }
10610
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SelectCheckboxComponent, decorators: [{
10611
+ type: Component,
10612
+ args: [{ selector: 'selectcheckbox-widget', template: `
10613
+ <div
10614
+ [class]="options?.htmlClass || ''">
10615
+ <select *ngIf="boundControl"
10616
+ [attr.aria-describedby]="'control' + layoutNode()?._id + 'Status'"
10617
+ [attr.readonly]="options?.readonly ? 'readonly' : null"
10618
+ [attr.required]="options?.required"
10619
+ [class]=" frameworkStyles[activeFramework].selectClass"
10620
+ [multiple]="true"
10621
+ [id]="'control' + layoutNode()?._id"
10622
+ [name]="controlName"
10623
+ [ngModel]="selectValue"
10624
+ >
10625
+ <ng-template ngFor let-selectItem [ngForOf]="selectList">
10626
+ <option *ngIf="!isArray(selectItem?.items)"
10627
+ [class]="frameworkStyles[activeFramework].optionClass"
10628
+ [class.active]="selectItem?.value === controlValue"
10629
+ [class.unchecked-notusing]="selectItem?.value != controlValue"
10630
+ [value]="selectItem?.value"
10631
+ (click)="onSelectClicked($event)"
10632
+ type="checkbox"
10633
+ >
10634
+ </option>
10635
+ <!--NB the text is out of the option element to display besides the checkbox-->
10636
+ <span [innerHTML]="selectItem?.name"></span>
10637
+ </ng-template>
10638
+ </select>
10639
+ <select *ngIf="!boundControl"
10640
+ [attr.aria-describedby]="'control' + layoutNode()?._id + 'Status'"
10641
+ [attr.readonly]="options?.readonly ? 'readonly' : null"
10642
+ [attr.required]="options?.required"
10643
+ [class]="frameworkStyles[activeFramework].selectClass +' select-box'"
10644
+ [multiple]="true"
10645
+ [disabled]="controlDisabled"
10646
+ [id]="'control' + layoutNode()?._id"
10647
+ [name]="controlName"
10648
+ (change)="updateValue($event)">
10649
+ <ng-template ngFor let-selectItem [ngForOf]="selectList">
10650
+ <option *ngIf="!isArray(selectItem?.items)"
10651
+ [selected]="selectItem?.value === controlValue"
10652
+ [class]="frameworkStyles[activeFramework].optionClass"
10653
+ [class.checked-notusing]="selectItem?.value === controlValue"
10654
+ [class.unchecked-notusing]]="selectItem?.value != controlValue"
10655
+ [value]="selectItem?.value"
10656
+ type="checkbox">
10657
+ </option>
10658
+ <!--NB the text is out of the option element to display besides the checkbox-->
10659
+ <span [innerHTML]="selectItem?.name"></span>
10660
+ </ng-template>
10661
+ </select>
10662
+
10663
+ </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"] }]
10664
+ }] });
10665
+
10666
+ class TabComponent {
10667
+ constructor() {
10668
+ this.jsf = inject(JsonSchemaFormService);
10669
+ this.layoutNode = input(undefined);
10670
+ this.layoutIndex = input(undefined);
10671
+ this.dataIndex = input(undefined);
10672
+ }
10673
+ ngOnInit() {
10674
+ this.options = this.layoutNode().options || {};
10675
+ }
10676
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: TabComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
10677
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "17.3.12", type: TabComponent, selector: "tab-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: `
10678
+ <div [class]="options?.htmlClass || ''">
10679
+ <root-widget
10680
+ [dataIndex]="dataIndex()"
10681
+ [layoutIndex]="layoutIndex()"
10682
+ [layout]="layoutNode().items"></root-widget>
10683
+ </div>`, isInline: true, dependencies: [{ kind: "component", type: RootComponent, selector: "root-widget", inputs: ["dataIndex", "layoutIndex", "layout", "isOrderable", "isFlexItem"] }] }); }
10684
+ }
10685
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: TabComponent, decorators: [{
10686
+ type: Component,
10687
+ args: [{
10688
+ // tslint:disable-next-line:component-selector
10689
+ selector: 'tab-widget',
10690
+ template: `
10691
+ <div [class]="options?.htmlClass || ''">
10692
+ <root-widget
10693
+ [dataIndex]="dataIndex()"
10694
+ [layoutIndex]="layoutIndex()"
10695
+ [layout]="layoutNode().items"></root-widget>
10696
+ </div>`,
10697
+ }]
10698
+ }] });
10699
+
10700
+ const BASIC_WIDGETS = [
10701
+ AddReferenceComponent, OneOfComponent, ButtonComponent, CheckboxComponent,
10702
+ CheckboxesComponent, FileComponent, HiddenComponent, InputComponent,
10703
+ MessageComponent, NoneComponent, NumberComponent, RadiosComponent,
10704
+ RootComponent, SectionComponent, SelectComponent, SelectFrameworkComponent,
10705
+ SelectWidgetComponent, SubmitComponent, TabComponent, TabsComponent,
10706
+ TemplateComponent, TextareaComponent, SelectCheckboxComponent
10707
+ ];
10708
+
10709
+ class WidgetLibraryModule {
10710
+ 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, i2$1.SortablejsModule], exports: [AddReferenceComponent, OneOfComponent, ButtonComponent, CheckboxComponent, CheckboxesComponent, FileComponent, HiddenComponent, InputComponent, MessageComponent, NoneComponent, NumberComponent, RadiosComponent, RootComponent, SectionComponent, SelectComponent, SelectFrameworkComponent, SelectWidgetComponent, SubmitComponent, TabComponent, TabsComponent, TemplateComponent, TextareaComponent, SelectCheckboxComponent, OrderableDirective, ElementAttributeDirective] }); }
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
+ })] }); }
10725
+ }
10726
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: WidgetLibraryModule, decorators: [{
10727
+ type: NgModule,
10728
+ args: [{
10729
+ imports: [CommonModule, FormsModule, ReactiveFormsModule,
10730
+ SortablejsModule.forRoot({
10731
+ //disabled:false,
10732
+ //draggable:".draggableitem",//">:not(.nonsort)",//">.draggable-item",//":not(.nonsort)",//">*",//":not(.nonsort)",//":not(.non-draggable)",
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]
10744
+ }]
10745
+ }] });
10746
+
10747
+ // No framework - plain HTML controls (styles from form layout only)
10748
+ class NoFrameworkModule {
10749
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: NoFrameworkModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
10750
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: NoFrameworkModule, declarations: [NoFrameworkComponent], imports: [CommonModule, WidgetLibraryModule], exports: [NoFrameworkComponent] }); }
10751
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: NoFrameworkModule, providers: [
10752
+ { provide: Framework, useClass: NoFramework, multi: true }
10753
+ ], imports: [CommonModule, WidgetLibraryModule] }); }
10754
+ }
10755
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: NoFrameworkModule, decorators: [{
10756
+ type: NgModule,
10757
+ args: [{
10758
+ imports: [CommonModule, WidgetLibraryModule],
10759
+ declarations: [NoFrameworkComponent],
10760
+ exports: [NoFrameworkComponent],
10761
+ providers: [
10762
+ { provide: Framework, useClass: NoFramework, multi: true }
10763
+ ]
10764
+ }]
10765
+ }] });
10766
+
10554
10767
  const JSON_SCHEMA_FORM_VALUE_ACCESSOR = {
10555
10768
  provide: NG_VALUE_ACCESSOR,
10556
10769
  useExisting: forwardRef(() => JsonSchemaFormComponent),
@@ -11338,5 +11551,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
11338
11551
  * Generated bundle index. Do not edit.
11339
11552
  */
11340
11553
 
11341
- 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 };
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 };
11342
11555
  //# sourceMappingURL=ng-formworks-core.mjs.map