@ng-formworks/core 19.6.2 → 19.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);
@@ -6481,7 +6511,7 @@ function buildLayoutFromSchema(jsf, widgetLibrary, nodeValue = null, schemaPoint
6481
6511
  if (hasOwn(schema, con)) {
6482
6512
  const keySchemaPointer = `/${con}`;
6483
6513
  const negateClause = con == "else";
6484
- const innerItem = buildLayoutFromSchema(jsf, widgetLibrary, nodeValue.then, schemaPointer + keySchemaPointer, dataPointer, false, null, null, forRefLibrary, dataPointerPrefix);
6514
+ const innerItem = buildLayoutFromSchema(jsf, widgetLibrary, nodeValue[con], schemaPointer + keySchemaPointer, dataPointer, false, null, null, forRefLibrary, dataPointerPrefix);
6485
6515
  if (innerItem) {
6486
6516
  applyITEConditions(innerItem, schemaPointer, keySchemaPointer, negateClause);
6487
6517
  if (isArray(innerItem)) {
@@ -6708,7 +6738,7 @@ function buildLayoutFromSchema(jsf, widgetLibrary, nodeValue = null, schemaPoint
6708
6738
  if (hasOwn(schema, con)) {
6709
6739
  const keySchemaPointer = `/${con}`;
6710
6740
  const negateClause = con == "else";
6711
- const innerItem = buildLayoutFromSchema(jsf, widgetLibrary, nodeValue.then, schemaPointer + keySchemaPointer, dataPointer, false, null, null, forRefLibrary, dataPointerPrefix);
6741
+ const innerItem = buildLayoutFromSchema(jsf, widgetLibrary, nodeValue[con], schemaPointer + keySchemaPointer, dataPointer, false, null, null, forRefLibrary, dataPointerPrefix);
6712
6742
  if (innerItem) {
6713
6743
  applyITEConditions(innerItem, schemaPointer, keySchemaPointer, negateClause);
6714
6744
  if (isArray(innerItem)) {
@@ -6716,17 +6746,19 @@ function buildLayoutFromSchema(jsf, widgetLibrary, nodeValue = null, schemaPoint
6716
6746
  //item.schemaPointer = schemaPointer + keySchemaPointer + item.dataPointer;
6717
6747
  //item.options.condition = convertJSONSchemaIfToCondition(schema, negateClause);
6718
6748
  newSection.push(item);
6719
- newNode = newSection;
6749
+ /////// newNode = newSection
6720
6750
  });
6721
6751
  }
6722
6752
  else {
6723
6753
  //innerItem.schemaPointer = schemaPointer + keySchemaPointer + innerItem.dataPointer;
6724
6754
  //innerItem.options.condition = convertJSONSchemaIfToCondition(schema, negateClause);
6725
- newNode = innerItem;
6755
+ ///////newNode = innerItem
6756
+ newSection.push(innerItem);
6726
6757
  }
6727
6758
  }
6728
6759
  }
6729
6760
  });
6761
+ newNode = newSection;
6730
6762
  }
6731
6763
  return newNode;
6732
6764
  }
@@ -8923,7 +8955,7 @@ class OneOfComponent {
8923
8955
  let controlSchema = JsonPointer.get(this.jsf.schema, parts.join("/"));
8924
8956
  let schemaPointer = parts.join("/");
8925
8957
  let dPointer = schemaPointer.replace(/(anyOf|allOf|oneOf|none)\/[\d]+\//g, '')
8926
- .replace(/(if|then|else|properties)\//g, '');
8958
+ .replace(/(if|then|else|properties)\//g, '').replace(/\/items\//g, '/-/');
8927
8959
  //JsonPointer.toDataPointer(parts.join("/"),this.jsf.schema);
8928
8960
  let dVal = JsonPointer.get(this.jsf.formValues, dPointer);
8929
8961
  let compareVal = dVal; //formValue;
@@ -9298,6 +9330,7 @@ class RootComponent {
9298
9330
  }
9299
9331
  sortableInit(sortable) {
9300
9332
  this.sortableObj = sortable;
9333
+ //Sortable.utils.on(this.sortableObj.el,"nulling",(s)=>{console.log("event nulling sortablejs")})
9301
9334
  ///NB issue caused by sortablejs when it its destroyed
9302
9335
  //this mainly affects checkboxes coupled with conditions
9303
9336
  //-the value is rechecked
@@ -9728,13 +9761,13 @@ class SelectComponent {
9728
9761
  [name]="controlName">
9729
9762
  <ng-template ngFor let-selectItem [ngForOf]="selectList">
9730
9763
  <option *ngIf="!isArray(selectItem?.items)"
9731
- [value]="selectItem?.value">
9764
+ [ngValue]="selectItem?.value">
9732
9765
  <span [innerHTML]="selectItem?.name"></span>
9733
9766
  </option>
9734
9767
  <optgroup *ngIf="isArray(selectItem?.items)"
9735
9768
  [label]="selectItem?.group">
9736
9769
  <option *ngFor="let subItem of selectItem.items"
9737
- [value]="subItem?.value">
9770
+ [ngValue]="subItem?.value">
9738
9771
  <span [innerHTML]="subItem?.name"></span>
9739
9772
  </option>
9740
9773
  </optgroup>
@@ -9752,14 +9785,14 @@ class SelectComponent {
9752
9785
  <ng-template ngFor let-selectItem [ngForOf]="selectList">
9753
9786
  <option *ngIf="!isArray(selectItem?.items)"
9754
9787
  [selected]="selectItem?.value === controlValue"
9755
- [value]="selectItem?.value">
9788
+ [ngValue]="selectItem?.value">
9756
9789
  <span [innerHTML]="selectItem?.name"></span>
9757
9790
  </option>
9758
9791
  <optgroup *ngIf="isArray(selectItem?.items)"
9759
9792
  [label]="selectItem?.group">
9760
9793
  <option *ngFor="let subItem of selectItem.items"
9761
9794
  [attr.selected]="subItem?.value === controlValue"
9762
- [value]="subItem?.value">
9795
+ [ngValue]="subItem?.value">
9763
9796
  <span [innerHTML]="subItem?.name"></span>
9764
9797
  </option>
9765
9798
  </optgroup>
@@ -9779,14 +9812,14 @@ class SelectComponent {
9779
9812
  <ng-template ngFor let-selectItem [ngForOf]="selectList">
9780
9813
  <option *ngIf="!isArray(selectItem?.items)"
9781
9814
  [selected]="selectItem?.value === controlValue"
9782
- [value]="selectItem?.value">
9815
+ [ngValue]="selectItem?.value">
9783
9816
  <span [innerHTML]="selectItem?.name"></span>
9784
9817
  </option>
9785
9818
  <optgroup *ngIf="isArray(selectItem?.items)"
9786
9819
  [label]="selectItem?.group">
9787
9820
  <option *ngFor="let subItem of selectItem.items"
9788
9821
  [attr.selected]="subItem?.value === controlValue"
9789
- [value]="subItem?.value">
9822
+ [ngValue]="subItem?.value">
9790
9823
  <span [innerHTML]="subItem?.name"></span>
9791
9824
  </option>
9792
9825
  </optgroup>
@@ -9817,13 +9850,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
9817
9850
  [name]="controlName">
9818
9851
  <ng-template ngFor let-selectItem [ngForOf]="selectList">
9819
9852
  <option *ngIf="!isArray(selectItem?.items)"
9820
- [value]="selectItem?.value">
9853
+ [ngValue]="selectItem?.value">
9821
9854
  <span [innerHTML]="selectItem?.name"></span>
9822
9855
  </option>
9823
9856
  <optgroup *ngIf="isArray(selectItem?.items)"
9824
9857
  [label]="selectItem?.group">
9825
9858
  <option *ngFor="let subItem of selectItem.items"
9826
- [value]="subItem?.value">
9859
+ [ngValue]="subItem?.value">
9827
9860
  <span [innerHTML]="subItem?.name"></span>
9828
9861
  </option>
9829
9862
  </optgroup>
@@ -9841,14 +9874,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
9841
9874
  <ng-template ngFor let-selectItem [ngForOf]="selectList">
9842
9875
  <option *ngIf="!isArray(selectItem?.items)"
9843
9876
  [selected]="selectItem?.value === controlValue"
9844
- [value]="selectItem?.value">
9877
+ [ngValue]="selectItem?.value">
9845
9878
  <span [innerHTML]="selectItem?.name"></span>
9846
9879
  </option>
9847
9880
  <optgroup *ngIf="isArray(selectItem?.items)"
9848
9881
  [label]="selectItem?.group">
9849
9882
  <option *ngFor="let subItem of selectItem.items"
9850
9883
  [attr.selected]="subItem?.value === controlValue"
9851
- [value]="subItem?.value">
9884
+ [ngValue]="subItem?.value">
9852
9885
  <span [innerHTML]="subItem?.name"></span>
9853
9886
  </option>
9854
9887
  </optgroup>
@@ -9868,14 +9901,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
9868
9901
  <ng-template ngFor let-selectItem [ngForOf]="selectList">
9869
9902
  <option *ngIf="!isArray(selectItem?.items)"
9870
9903
  [selected]="selectItem?.value === controlValue"
9871
- [value]="selectItem?.value">
9904
+ [ngValue]="selectItem?.value">
9872
9905
  <span [innerHTML]="selectItem?.name"></span>
9873
9906
  </option>
9874
9907
  <optgroup *ngIf="isArray(selectItem?.items)"
9875
9908
  [label]="selectItem?.group">
9876
9909
  <option *ngFor="let subItem of selectItem.items"
9877
9910
  [attr.selected]="subItem?.value === controlValue"
9878
- [value]="subItem?.value">
9911
+ [ngValue]="subItem?.value">
9879
9912
  <span [innerHTML]="subItem?.name"></span>
9880
9913
  </option>
9881
9914
  </optgroup>
@@ -9963,41 +9996,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
9963
9996
  }]
9964
9997
  }] });
9965
9998
 
9966
- class TabComponent {
9967
- constructor() {
9968
- this.jsf = inject(JsonSchemaFormService);
9969
- this.layoutNode = input(undefined);
9970
- this.layoutIndex = input(undefined);
9971
- this.dataIndex = input(undefined);
9972
- }
9973
- ngOnInit() {
9974
- this.options = this.layoutNode().options || {};
9975
- }
9976
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TabComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
9977
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.14", type: TabComponent, isStandalone: false, 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: `
9978
- <div [class]="options?.htmlClass || ''">
9979
- <root-widget
9980
- [dataIndex]="dataIndex()"
9981
- [layoutIndex]="layoutIndex()"
9982
- [layout]="layoutNode().items"></root-widget>
9983
- </div>`, isInline: true, dependencies: [{ kind: "component", type: RootComponent, selector: "root-widget", inputs: ["dataIndex", "layoutIndex", "layout", "isOrderable", "isFlexItem"] }] }); }
9984
- }
9985
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TabComponent, decorators: [{
9986
- type: Component,
9987
- args: [{
9988
- // tslint:disable-next-line:component-selector
9989
- selector: 'tab-widget',
9990
- template: `
9991
- <div [class]="options?.htmlClass || ''">
9992
- <root-widget
9993
- [dataIndex]="dataIndex()"
9994
- [layoutIndex]="layoutIndex()"
9995
- [layout]="layoutNode().items"></root-widget>
9996
- </div>`,
9997
- standalone: false
9998
- }]
9999
- }] });
10000
-
10001
9999
  class TemplateComponent {
10002
10000
  constructor() {
10003
10001
  this.jsf = inject(JsonSchemaFormService);
@@ -10218,13 +10216,17 @@ class WidgetLibraryService {
10218
10216
  // See: http://ulion.github.io/jsonform/playground/?example=fields-checkboxbuttons
10219
10217
  // Widgets included for compatibility with React JSON Schema Form API
10220
10218
  'updown': 'number',
10221
- 'date-time': 'datetime-local',
10219
+ //'date-time': 'datetime-local',
10220
+ //as per ajv date-time requires a timezone but input
10221
+ //datetime-local doesn't
10222
+ 'iso-date-time': 'datetime-local',
10222
10223
  'alt-datetime': 'datetime-local',
10223
10224
  'alt-date': 'date',
10224
10225
  // Widgets included for compatibility with Angular Schema Form API
10225
10226
  'wizard': 'section', // TODO: Sequential panels with "Next" and "Previous" buttons
10226
10227
  // Widgets included for compatibility with other libraries
10227
10228
  'textline': 'text',
10229
+ 'selectcheckbox': SelectCheckboxComponent,
10228
10230
  // Recommended 3rd-party add-on widgets (TODO: create wrappers for these...)
10229
10231
  // 'ng2-select': Select control replacement - http://valor-software.com/ng2-select/
10230
10232
  // 'flatpickr': Flatpickr date picker - https://github.com/chmln/flatpickr
@@ -10341,73 +10343,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
10341
10343
  }]
10342
10344
  }], ctorParameters: () => [] });
10343
10345
 
10344
- const BASIC_WIDGETS = [
10345
- AddReferenceComponent, OneOfComponent, ButtonComponent, CheckboxComponent,
10346
- CheckboxesComponent, FileComponent, HiddenComponent, InputComponent,
10347
- MessageComponent, NoneComponent, NumberComponent, RadiosComponent,
10348
- RootComponent, SectionComponent, SelectComponent, SelectFrameworkComponent,
10349
- SelectWidgetComponent, SubmitComponent, TabComponent, TabsComponent,
10350
- TemplateComponent, TextareaComponent
10351
- ];
10352
-
10353
- class WidgetLibraryModule {
10354
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: WidgetLibraryModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
10355
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.14", 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] }); }
10356
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: WidgetLibraryModule, imports: [CommonModule, FormsModule, ReactiveFormsModule,
10357
- SortablejsModule.forRoot({
10358
- //disabled:false,
10359
- //draggable:".draggableitem",//">:not(.nonsort)",//">.draggable-item",//":not(.nonsort)",//">*",//":not(.nonsort)",//":not(.non-draggable)",
10360
- filter: ".sortable-filter", //needed to disable dragging on input range elements, class needs to be added to the element or its parent
10361
- preventOnFilter: false, //needed for input range elements slider do still work
10362
- onMove: function (/**Event*/ evt, /**Event*/ originalEvent) {
10363
- if (evt.related.classList.contains("sortable-fixed")) {
10364
- //console.log(evt.related);
10365
- return false;
10366
- }
10367
- }
10368
- })] }); }
10369
- }
10370
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: WidgetLibraryModule, decorators: [{
10371
- type: NgModule,
10372
- args: [{
10373
- imports: [CommonModule, FormsModule, ReactiveFormsModule,
10374
- SortablejsModule.forRoot({
10375
- //disabled:false,
10376
- //draggable:".draggableitem",//">:not(.nonsort)",//">.draggable-item",//":not(.nonsort)",//">*",//":not(.nonsort)",//":not(.non-draggable)",
10377
- filter: ".sortable-filter", //needed to disable dragging on input range elements, class needs to be added to the element or its parent
10378
- preventOnFilter: false, //needed for input range elements slider do still work
10379
- onMove: function (/**Event*/ evt, /**Event*/ originalEvent) {
10380
- if (evt.related.classList.contains("sortable-fixed")) {
10381
- //console.log(evt.related);
10382
- return false;
10383
- }
10384
- }
10385
- })],
10386
- declarations: [...BASIC_WIDGETS, OrderableDirective, ElementAttributeDirective],
10387
- exports: [...BASIC_WIDGETS, OrderableDirective, ElementAttributeDirective]
10388
- }]
10389
- }] });
10390
-
10391
- // No framework - plain HTML controls (styles from form layout only)
10392
- class NoFrameworkModule {
10393
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NoFrameworkModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
10394
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.14", ngImport: i0, type: NoFrameworkModule, declarations: [NoFrameworkComponent], imports: [CommonModule, WidgetLibraryModule], exports: [NoFrameworkComponent] }); }
10395
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NoFrameworkModule, providers: [
10396
- { provide: Framework, useClass: NoFramework, multi: true }
10397
- ], imports: [CommonModule, WidgetLibraryModule] }); }
10398
- }
10399
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NoFrameworkModule, decorators: [{
10400
- type: NgModule,
10401
- args: [{
10402
- imports: [CommonModule, WidgetLibraryModule],
10403
- declarations: [NoFrameworkComponent],
10404
- exports: [NoFrameworkComponent],
10405
- providers: [
10406
- { provide: Framework, useClass: NoFramework, multi: true }
10407
- ]
10408
- }]
10409
- }] });
10410
-
10411
10346
  // Possible future frameworks:
10412
10347
  // - Foundation 6:
10413
10348
  // http://justindavis.co/2017/06/15/using-foundation-6-in-angular-4/
@@ -10573,6 +10508,284 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
10573
10508
  args: [Framework]
10574
10509
  }] }] });
10575
10510
 
10511
+ //component created as a fallback for the checkbox/sortabljs issue
10512
+ //its meant to display a select as a checkbox
10513
+ class SelectCheckboxComponent {
10514
+ constructor() {
10515
+ this.jsf = inject(JsonSchemaFormService);
10516
+ this.jsfFLService = inject(FrameworkLibraryService);
10517
+ this.controlDisabled = false;
10518
+ this.boundControl = false;
10519
+ this.selectList = [];
10520
+ this.selectListFlatGroup = [];
10521
+ this.isArray = isArray;
10522
+ this.layoutNode = input(undefined);
10523
+ this.layoutIndex = input(undefined);
10524
+ this.dataIndex = input(undefined);
10525
+ this.frameworkStyles = {
10526
+ daisyui: { selectClass: "select-box", optionClass: "checkbox tw:dui-checkbox", optionChecked: "active", optionUnchecked: "" },
10527
+ "bootstrap-3": { selectClass: "select-box", optionClass: "bs3-option checkbox display-inline-block", optionChecked: "active", optionUnchecked: "" },
10528
+ "bootstrap-4": { selectClass: "select-box", optionClass: "bs4-option checkbox display-inline-block", optionChecked: "active", optionUnchecked: "" },
10529
+ "bootstrap-5": { selectClass: " select-box", optionClass: "form-check-input display-inline-block", optionChecked: "active", optionUnchecked: "" },
10530
+ //"material-design":{selectClass:" ",optionClass:" "}
10531
+ };
10532
+ }
10533
+ ngOnInit() {
10534
+ this.options = this.layoutNode().options || {};
10535
+ this.activeFramework = this.jsfFLService.activeFramework.name;
10536
+ this.selectList = buildTitleMap(
10537
+ //this.options.titleMap || this.options.enumNames,
10538
+ //TODO review-title is set to null in the setTitle() method of CssFrameworkComponent
10539
+ this.options.enumNames || (this.options?.title && [this.options?.title])
10540
+ || [this.layoutNode().name],
10541
+ //this.options.enum,
10542
+ [true],
10543
+ //make required true to avoid creating 'none' select option
10544
+ true, !!this.options.flatList);
10545
+ //the selectListFlatGroup array will be used to update the formArray values
10546
+ //while the selectList array will be bound to the form select
10547
+ //as either a grouped select or a flat select
10548
+ /*
10549
+ this.selectListFlatGroup = buildTitleMap(
10550
+ this.options.titleMap || this.options.enumNames,
10551
+ this.options.enum, !!this.options.required, true
10552
+ )
10553
+ */
10554
+ this.jsf.initializeControl(this);
10555
+ this.selectValue = [this.controlValue];
10556
+ }
10557
+ deselectAll() {
10558
+ this.selectListFlatGroup.forEach(selItem => {
10559
+ selItem.checked = false;
10560
+ });
10561
+ }
10562
+ updateValue(event) {
10563
+ this.options.showErrors = true;
10564
+ this.controlValue = this.selectValue[0];
10565
+ this.jsf.updateValue(this, this.controlValue);
10566
+ }
10567
+ onSelectClicked($event) {
10568
+ this.selectValue = this.selectValue && this.selectValue[0] ? [false] : [true];
10569
+ this.controlValue = this.selectValue[0];
10570
+ this.jsf.updateValue(this, this.controlValue);
10571
+ }
10572
+ ngOnDestroy() {
10573
+ let nullVal = this.options.multiple ? [null] : null;
10574
+ this.formControl.reset(nullVal);
10575
+ this.controlValue = null;
10576
+ }
10577
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SelectCheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
10578
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.14", type: SelectCheckboxComponent, isStandalone: false, 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: `
10579
+ <div
10580
+ [class]="options?.htmlClass || ''">
10581
+ <select *ngIf="boundControl"
10582
+ [attr.aria-describedby]="'control' + layoutNode()?._id + 'Status'"
10583
+ [attr.readonly]="options?.readonly ? 'readonly' : null"
10584
+ [attr.required]="options?.required"
10585
+ [class]=" frameworkStyles[activeFramework].selectClass"
10586
+ [multiple]="true"
10587
+ [id]="'control' + layoutNode()?._id"
10588
+ [name]="controlName"
10589
+ [ngModel]="selectValue"
10590
+ >
10591
+ <ng-template ngFor let-selectItem [ngForOf]="selectList">
10592
+ <option *ngIf="!isArray(selectItem?.items)"
10593
+ [class]="frameworkStyles[activeFramework].optionClass"
10594
+ [class.active]="selectItem?.value === controlValue"
10595
+ [class.unchecked-notusing]="selectItem?.value != controlValue"
10596
+ [value]="selectItem?.value"
10597
+ (click)="onSelectClicked($event)"
10598
+ type="checkbox"
10599
+ >
10600
+ </option>
10601
+ <!--NB the text is out of the option element to display besides the checkbox-->
10602
+ <span [innerHTML]="selectItem?.name"></span>
10603
+ </ng-template>
10604
+ </select>
10605
+ <select *ngIf="!boundControl"
10606
+ [attr.aria-describedby]="'control' + layoutNode()?._id + 'Status'"
10607
+ [attr.readonly]="options?.readonly ? 'readonly' : null"
10608
+ [attr.required]="options?.required"
10609
+ [class]="frameworkStyles[activeFramework].selectClass +' select-box'"
10610
+ [multiple]="true"
10611
+ [disabled]="controlDisabled"
10612
+ [id]="'control' + layoutNode()?._id"
10613
+ [name]="controlName"
10614
+ (change)="updateValue($event)">
10615
+ <ng-template ngFor let-selectItem [ngForOf]="selectList">
10616
+ <option *ngIf="!isArray(selectItem?.items)"
10617
+ [selected]="selectItem?.value === controlValue"
10618
+ [class]="frameworkStyles[activeFramework].optionClass"
10619
+ [class.checked-notusing]="selectItem?.value === controlValue"
10620
+ [class.unchecked-notusing]]="selectItem?.value != controlValue"
10621
+ [value]="selectItem?.value"
10622
+ type="checkbox">
10623
+ </option>
10624
+ <!--NB the text is out of the option element to display besides the checkbox-->
10625
+ <span [innerHTML]="selectItem?.name"></span>
10626
+ </ng-template>
10627
+ </select>
10628
+
10629
+ </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"] }] }); }
10630
+ }
10631
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SelectCheckboxComponent, decorators: [{
10632
+ type: Component,
10633
+ args: [{ selector: 'selectcheckbox-widget', template: `
10634
+ <div
10635
+ [class]="options?.htmlClass || ''">
10636
+ <select *ngIf="boundControl"
10637
+ [attr.aria-describedby]="'control' + layoutNode()?._id + 'Status'"
10638
+ [attr.readonly]="options?.readonly ? 'readonly' : null"
10639
+ [attr.required]="options?.required"
10640
+ [class]=" frameworkStyles[activeFramework].selectClass"
10641
+ [multiple]="true"
10642
+ [id]="'control' + layoutNode()?._id"
10643
+ [name]="controlName"
10644
+ [ngModel]="selectValue"
10645
+ >
10646
+ <ng-template ngFor let-selectItem [ngForOf]="selectList">
10647
+ <option *ngIf="!isArray(selectItem?.items)"
10648
+ [class]="frameworkStyles[activeFramework].optionClass"
10649
+ [class.active]="selectItem?.value === controlValue"
10650
+ [class.unchecked-notusing]="selectItem?.value != controlValue"
10651
+ [value]="selectItem?.value"
10652
+ (click)="onSelectClicked($event)"
10653
+ type="checkbox"
10654
+ >
10655
+ </option>
10656
+ <!--NB the text is out of the option element to display besides the checkbox-->
10657
+ <span [innerHTML]="selectItem?.name"></span>
10658
+ </ng-template>
10659
+ </select>
10660
+ <select *ngIf="!boundControl"
10661
+ [attr.aria-describedby]="'control' + layoutNode()?._id + 'Status'"
10662
+ [attr.readonly]="options?.readonly ? 'readonly' : null"
10663
+ [attr.required]="options?.required"
10664
+ [class]="frameworkStyles[activeFramework].selectClass +' select-box'"
10665
+ [multiple]="true"
10666
+ [disabled]="controlDisabled"
10667
+ [id]="'control' + layoutNode()?._id"
10668
+ [name]="controlName"
10669
+ (change)="updateValue($event)">
10670
+ <ng-template ngFor let-selectItem [ngForOf]="selectList">
10671
+ <option *ngIf="!isArray(selectItem?.items)"
10672
+ [selected]="selectItem?.value === controlValue"
10673
+ [class]="frameworkStyles[activeFramework].optionClass"
10674
+ [class.checked-notusing]="selectItem?.value === controlValue"
10675
+ [class.unchecked-notusing]]="selectItem?.value != controlValue"
10676
+ [value]="selectItem?.value"
10677
+ type="checkbox">
10678
+ </option>
10679
+ <!--NB the text is out of the option element to display besides the checkbox-->
10680
+ <span [innerHTML]="selectItem?.name"></span>
10681
+ </ng-template>
10682
+ </select>
10683
+
10684
+ </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"] }]
10685
+ }] });
10686
+
10687
+ class TabComponent {
10688
+ constructor() {
10689
+ this.jsf = inject(JsonSchemaFormService);
10690
+ this.layoutNode = input(undefined);
10691
+ this.layoutIndex = input(undefined);
10692
+ this.dataIndex = input(undefined);
10693
+ }
10694
+ ngOnInit() {
10695
+ this.options = this.layoutNode().options || {};
10696
+ }
10697
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TabComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
10698
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.14", type: TabComponent, isStandalone: false, 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: `
10699
+ <div [class]="options?.htmlClass || ''">
10700
+ <root-widget
10701
+ [dataIndex]="dataIndex()"
10702
+ [layoutIndex]="layoutIndex()"
10703
+ [layout]="layoutNode().items"></root-widget>
10704
+ </div>`, isInline: true, dependencies: [{ kind: "component", type: RootComponent, selector: "root-widget", inputs: ["dataIndex", "layoutIndex", "layout", "isOrderable", "isFlexItem"] }] }); }
10705
+ }
10706
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TabComponent, decorators: [{
10707
+ type: Component,
10708
+ args: [{
10709
+ // tslint:disable-next-line:component-selector
10710
+ selector: 'tab-widget',
10711
+ template: `
10712
+ <div [class]="options?.htmlClass || ''">
10713
+ <root-widget
10714
+ [dataIndex]="dataIndex()"
10715
+ [layoutIndex]="layoutIndex()"
10716
+ [layout]="layoutNode().items"></root-widget>
10717
+ </div>`,
10718
+ standalone: false
10719
+ }]
10720
+ }] });
10721
+
10722
+ const BASIC_WIDGETS = [
10723
+ AddReferenceComponent, OneOfComponent, ButtonComponent, CheckboxComponent,
10724
+ CheckboxesComponent, FileComponent, HiddenComponent, InputComponent,
10725
+ MessageComponent, NoneComponent, NumberComponent, RadiosComponent,
10726
+ RootComponent, SectionComponent, SelectComponent, SelectFrameworkComponent,
10727
+ SelectWidgetComponent, SubmitComponent, TabComponent, TabsComponent,
10728
+ TemplateComponent, TextareaComponent, SelectCheckboxComponent
10729
+ ];
10730
+
10731
+ class WidgetLibraryModule {
10732
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: WidgetLibraryModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
10733
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.14", 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] }); }
10734
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: WidgetLibraryModule, imports: [CommonModule, FormsModule, ReactiveFormsModule,
10735
+ SortablejsModule.forRoot({
10736
+ //disabled:false,
10737
+ //draggable:".draggableitem",//">:not(.nonsort)",//">.draggable-item",//":not(.nonsort)",//">*",//":not(.nonsort)",//":not(.non-draggable)",
10738
+ filter: ".sortable-filter", //needed to disable dragging on input range elements, class needs to be added to the element or its parent
10739
+ preventOnFilter: false, //needed for input range elements slider do still work
10740
+ onMove: function (/**Event*/ evt, /**Event*/ originalEvent) {
10741
+ if (evt.related.classList.contains("sortable-fixed")) {
10742
+ //console.log(evt.related);
10743
+ return false;
10744
+ }
10745
+ }
10746
+ })] }); }
10747
+ }
10748
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: WidgetLibraryModule, decorators: [{
10749
+ type: NgModule,
10750
+ args: [{
10751
+ imports: [CommonModule, FormsModule, ReactiveFormsModule,
10752
+ SortablejsModule.forRoot({
10753
+ //disabled:false,
10754
+ //draggable:".draggableitem",//">:not(.nonsort)",//">.draggable-item",//":not(.nonsort)",//">*",//":not(.nonsort)",//":not(.non-draggable)",
10755
+ filter: ".sortable-filter", //needed to disable dragging on input range elements, class needs to be added to the element or its parent
10756
+ preventOnFilter: false, //needed for input range elements slider do still work
10757
+ onMove: function (/**Event*/ evt, /**Event*/ originalEvent) {
10758
+ if (evt.related.classList.contains("sortable-fixed")) {
10759
+ //console.log(evt.related);
10760
+ return false;
10761
+ }
10762
+ }
10763
+ })],
10764
+ declarations: [...BASIC_WIDGETS, OrderableDirective, ElementAttributeDirective],
10765
+ exports: [...BASIC_WIDGETS, OrderableDirective, ElementAttributeDirective]
10766
+ }]
10767
+ }] });
10768
+
10769
+ // No framework - plain HTML controls (styles from form layout only)
10770
+ class NoFrameworkModule {
10771
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NoFrameworkModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
10772
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.14", ngImport: i0, type: NoFrameworkModule, declarations: [NoFrameworkComponent], imports: [CommonModule, WidgetLibraryModule], exports: [NoFrameworkComponent] }); }
10773
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NoFrameworkModule, providers: [
10774
+ { provide: Framework, useClass: NoFramework, multi: true }
10775
+ ], imports: [CommonModule, WidgetLibraryModule] }); }
10776
+ }
10777
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NoFrameworkModule, decorators: [{
10778
+ type: NgModule,
10779
+ args: [{
10780
+ imports: [CommonModule, WidgetLibraryModule],
10781
+ declarations: [NoFrameworkComponent],
10782
+ exports: [NoFrameworkComponent],
10783
+ providers: [
10784
+ { provide: Framework, useClass: NoFramework, multi: true }
10785
+ ]
10786
+ }]
10787
+ }] });
10788
+
10576
10789
  const JSON_SCHEMA_FORM_VALUE_ACCESSOR = {
10577
10790
  provide: NG_VALUE_ACCESSOR,
10578
10791
  useExisting: forwardRef(() => JsonSchemaFormComponent),
@@ -11360,5 +11573,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
11360
11573
  * Generated bundle index. Do not edit.
11361
11574
  */
11362
11575
 
11363
- 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 };
11576
+ 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 };
11364
11577
  //# sourceMappingURL=ng-formworks-core.mjs.map