@ng-formworks/core 16.5.2 → 16.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/esm2022/lib/json-schema-form.module.mjs +3 -3
  2. package/esm2022/lib/json-schema-form.service.mjs +25 -5
  3. package/esm2022/lib/widget-library/element-attribute.directive.mjs +33 -0
  4. package/esm2022/lib/widget-library/index.mjs +5 -4
  5. package/esm2022/lib/widget-library/input.component.mjs +21 -8
  6. package/esm2022/lib/widget-library/number.component.mjs +28 -12
  7. package/esm2022/lib/widget-library/orderable.directive.mjs +10 -1
  8. package/esm2022/lib/widget-library/root.component.mjs +103 -34
  9. package/esm2022/lib/widget-library/section.component.mjs +9 -9
  10. package/esm2022/lib/widget-library/select-framework.component.mjs +7 -7
  11. package/esm2022/lib/widget-library/select-widget.component.mjs +7 -7
  12. package/esm2022/lib/widget-library/template.component.mjs +8 -7
  13. package/esm2022/lib/widget-library/widget-library.module.mjs +23 -8
  14. package/fesm2022/ng-formworks-core.mjs +462 -292
  15. package/fesm2022/ng-formworks-core.mjs.map +1 -1
  16. package/lib/json-schema-form.service.d.ts +7 -1
  17. package/lib/shared/validator.functions.d.ts +1 -1
  18. package/lib/widget-library/element-attribute.directive.d.ts +13 -0
  19. package/lib/widget-library/index.d.ts +5 -4
  20. package/lib/widget-library/input.component.d.ts +2 -1
  21. package/lib/widget-library/number.component.d.ts +1 -0
  22. package/lib/widget-library/orderable.directive.d.ts +2 -0
  23. package/lib/widget-library/root.component.d.ts +8 -1
  24. package/lib/widget-library/select-framework.component.d.ts +2 -3
  25. package/lib/widget-library/select-widget.component.d.ts +2 -3
  26. package/lib/widget-library/template.component.d.ts +2 -3
  27. package/lib/widget-library/widget-library.module.d.ts +5 -3
  28. package/package.json +4 -2
@@ -1,23 +1,38 @@
1
1
  import * as i2 from '@angular/common';
2
2
  import { CommonModule } from '@angular/common';
3
- import * as i3 from '@angular/forms';
4
- import { UntypedFormControl, UntypedFormArray, UntypedFormGroup, NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule } from '@angular/forms';
5
3
  import * as i0 from '@angular/core';
6
- import { Injectable, Component, ChangeDetectionStrategy, Input, ViewContainerRef, ViewChild, Directive, Inject, forwardRef, EventEmitter, Output, NgModule } from '@angular/core';
7
- import cloneDeep from 'lodash/cloneDeep';
8
- import isEqual$1 from 'lodash/isEqual';
9
- import { from, Observable, forkJoin, Subject, lastValueFrom } from 'rxjs';
10
- import { map, takeUntil } from 'rxjs/operators';
4
+ import { Injectable, ViewContainerRef, Component, Input, ViewChild, Directive, ChangeDetectionStrategy, NgModule, Inject, forwardRef, EventEmitter, Output } from '@angular/core';
5
+ import * as i3 from '@angular/forms';
6
+ import { UntypedFormControl, UntypedFormArray, UntypedFormGroup, FormsModule, ReactiveFormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
11
7
  import Ajv2019 from 'ajv/dist/2019';
12
8
  import jsonDraft6 from 'ajv/lib/refs/json-schema-draft-06.json';
13
9
  import jsonDraft7 from 'ajv/lib/refs/json-schema-draft-07.json';
10
+ import cloneDeep from 'lodash/cloneDeep';
11
+ import { from, Observable, forkJoin, Subject, BehaviorSubject, lastValueFrom } from 'rxjs';
12
+ import isEqual$1 from 'lodash/isEqual';
13
+ import { map, takeUntil } from 'rxjs/operators';
14
14
  import filter from 'lodash/filter';
15
15
  import map$1 from 'lodash/map';
16
16
  import _isArray from 'lodash/isArray';
17
17
  import _isPlainObject from 'lodash/isPlainObject';
18
18
  import uniqueId from 'lodash/uniqueId';
19
+ import * as i3$1 from 'nxt-sortablejs';
20
+ import { SortablejsModule } from 'nxt-sortablejs';
19
21
  import * as i1 from '@angular/common/http';
20
22
 
23
+ class Framework {
24
+ constructor() {
25
+ this.widgets = {};
26
+ this.stylesheets = [];
27
+ this.scripts = [];
28
+ }
29
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: Framework, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
30
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: Framework }); }
31
+ }
32
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: Framework, decorators: [{
33
+ type: Injectable
34
+ }] });
35
+
21
36
  const deValidationMessages = {
22
37
  required: 'Darf nicht leer sein',
23
38
  minLength: 'Mindestens {{minimumLength}} Zeichen benötigt (aktuell: {{currentLength}})',
@@ -6357,6 +6372,12 @@ function buildTitleMap(titleMap, enumList, fieldRequired = true, flatList = true
6357
6372
  // causes a library to be imported before another library it depends on.
6358
6373
 
6359
6374
  class JsonSchemaFormService {
6375
+ setDraggableState(value) {
6376
+ this.draggableStateSubject.next(value); // Update the draggable value
6377
+ }
6378
+ setSortableOptions(value) {
6379
+ this.sortableOptionsSubject.next(value); // Update the sortable options value
6380
+ }
6360
6381
  constructor() {
6361
6382
  this.JsonFormCompatibility = false;
6362
6383
  this.ReactJsonSchemaFormCompatibility = false;
@@ -6441,6 +6462,18 @@ class JsonSchemaFormService {
6441
6462
  validationMessages: {} // set by setLanguage()
6442
6463
  }
6443
6464
  };
6465
+ //this has been added to enable or disable the dragabble state of a component
6466
+ //using the OrderableDirective, mainly when an <input type="range">
6467
+ //elements are present, as the draggable attribute makes it difficult to
6468
+ //slide the range sliders and end up dragging
6469
+ //NB this will be set globally for all OrderableDirective instances
6470
+ //and will only be enabled when/if the caller sets the value back to true
6471
+ this.draggableStateSubject = new BehaviorSubject(true); // Default value true
6472
+ this.draggableState$ = this.draggableStateSubject.asObservable();
6473
+ //this is introduced to look at replacing the orderable directive with
6474
+ //nxt-sortablejs and sortablejs
6475
+ this.sortableOptionsSubject = new BehaviorSubject({ disabled: false }); // Default value true
6476
+ this.sortableOptions$ = this.sortableOptionsSubject.asObservable();
6444
6477
  this.setLanguage(this.language);
6445
6478
  this.ajv.addMetaSchema(jsonDraft6);
6446
6479
  this.ajv.addMetaSchema(jsonDraft7);
@@ -6976,7 +7009,7 @@ class JsonSchemaFormService {
6976
7009
  JsonPointer.insert(this.layout, this.getLayoutPointer(ctx), newLayoutNode);
6977
7010
  return true;
6978
7011
  }
6979
- moveArrayItem(ctx, oldIndex, newIndex) {
7012
+ moveArrayItem(ctx, oldIndex, newIndex, moveLayout = true) {
6980
7013
  if (!ctx.layoutNode ||
6981
7014
  !isDefined(ctx.layoutNode.dataPointer) ||
6982
7015
  !hasValue(ctx.dataIndex) ||
@@ -6993,8 +7026,10 @@ class JsonSchemaFormService {
6993
7026
  formArray.insert(newIndex, arrayItem);
6994
7027
  formArray.updateValueAndValidity();
6995
7028
  // Move layout item
6996
- const layoutArray = this.getLayoutArray(ctx);
6997
- layoutArray.splice(newIndex, 0, layoutArray.splice(oldIndex, 1)[0]);
7029
+ if (moveLayout) {
7030
+ const layoutArray = this.getLayoutArray(ctx);
7031
+ layoutArray.splice(newIndex, 0, layoutArray.splice(oldIndex, 1)[0]);
7032
+ }
6998
7033
  return true;
6999
7034
  }
7000
7035
  removeItem(ctx) {
@@ -7024,6 +7059,110 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
7024
7059
  type: Injectable
7025
7060
  }], ctorParameters: function () { return []; } });
7026
7061
 
7062
+ class SelectWidgetComponent {
7063
+ constructor(jsf) {
7064
+ this.jsf = jsf;
7065
+ this.newComponent = null;
7066
+ }
7067
+ ngOnInit() {
7068
+ this.updateComponent();
7069
+ }
7070
+ ngOnChanges() {
7071
+ this.updateComponent();
7072
+ }
7073
+ updateComponent() {
7074
+ const widgetContainer = this.widgetContainer;
7075
+ if (widgetContainer && !this.newComponent && (this.layoutNode || {}).widget) {
7076
+ this.newComponent = widgetContainer.createComponent((this.layoutNode.widget));
7077
+ }
7078
+ if (this.newComponent) {
7079
+ for (const input of ['layoutNode', 'layoutIndex', 'dataIndex']) {
7080
+ this.newComponent.instance[input] = this[input];
7081
+ }
7082
+ }
7083
+ }
7084
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SelectWidgetComponent, deps: [{ token: JsonSchemaFormService }], target: i0.ɵɵFactoryTarget.Component }); }
7085
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: SelectWidgetComponent, selector: "select-widget-widget", inputs: { layoutNode: "layoutNode", layoutIndex: "layoutIndex", dataIndex: "dataIndex" }, viewQueries: [{ propertyName: "widgetContainer", first: true, predicate: ["widgetContainer"], descendants: true, read: ViewContainerRef, static: true }], usesOnChanges: true, ngImport: i0, template: `<div #widgetContainer></div>`, isInline: true }); }
7086
+ }
7087
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SelectWidgetComponent, decorators: [{
7088
+ type: Component,
7089
+ args: [{
7090
+ // tslint:disable-next-line:component-selector
7091
+ selector: 'select-widget-widget',
7092
+ template: `<div #widgetContainer></div>`,
7093
+ }]
7094
+ }], ctorParameters: function () { return [{ type: JsonSchemaFormService }]; }, propDecorators: { layoutNode: [{
7095
+ type: Input
7096
+ }], layoutIndex: [{
7097
+ type: Input
7098
+ }], dataIndex: [{
7099
+ type: Input
7100
+ }], widgetContainer: [{
7101
+ type: ViewChild,
7102
+ args: ['widgetContainer', { read: ViewContainerRef, static: true }]
7103
+ }] } });
7104
+
7105
+ class NoFrameworkComponent {
7106
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NoFrameworkComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
7107
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: NoFrameworkComponent, selector: "no-framework", inputs: { layoutNode: "layoutNode", layoutIndex: "layoutIndex", dataIndex: "dataIndex" }, ngImport: i0, template: "<select-widget-widget [dataIndex]=\"dataIndex\" [layoutIndex]=\"layoutIndex\" [layoutNode]=\"layoutNode\">\r\n</select-widget-widget>", dependencies: [{ kind: "component", type: SelectWidgetComponent, selector: "select-widget-widget", inputs: ["layoutNode", "layoutIndex", "dataIndex"] }] }); }
7108
+ }
7109
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NoFrameworkComponent, decorators: [{
7110
+ type: Component,
7111
+ args: [{ selector: 'no-framework', template: "<select-widget-widget [dataIndex]=\"dataIndex\" [layoutIndex]=\"layoutIndex\" [layoutNode]=\"layoutNode\">\r\n</select-widget-widget>" }]
7112
+ }], propDecorators: { layoutNode: [{
7113
+ type: Input
7114
+ }], layoutIndex: [{
7115
+ type: Input
7116
+ }], dataIndex: [{
7117
+ type: Input
7118
+ }] } });
7119
+
7120
+ // No framework - plain HTML controls (styles from form layout only)
7121
+ class NoFramework extends Framework {
7122
+ constructor() {
7123
+ super(...arguments);
7124
+ this.name = 'no-framework';
7125
+ this.text = 'None (plain HTML)';
7126
+ this.framework = NoFrameworkComponent;
7127
+ }
7128
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NoFramework, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
7129
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NoFramework }); }
7130
+ }
7131
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NoFramework, decorators: [{
7132
+ type: Injectable
7133
+ }] });
7134
+
7135
+ class ElementAttributeDirective {
7136
+ constructor(renderer, elementRef) {
7137
+ this.renderer = renderer;
7138
+ this.elementRef = elementRef;
7139
+ }
7140
+ ngOnChanges(changes) {
7141
+ if (changes.attributes) {
7142
+ for (let attributeName in this.attributes) {
7143
+ const attributeValue = this.attributes[attributeName];
7144
+ if (attributeValue) {
7145
+ this.renderer.setAttribute(this.elementRef.nativeElement, attributeName, attributeValue);
7146
+ }
7147
+ else {
7148
+ this.renderer.removeAttribute(this.elementRef.nativeElement, attributeName);
7149
+ }
7150
+ }
7151
+ }
7152
+ }
7153
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ElementAttributeDirective, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
7154
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: ElementAttributeDirective, selector: "[attributes]", inputs: { attributes: "attributes" }, usesOnChanges: true, ngImport: i0 }); }
7155
+ }
7156
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ElementAttributeDirective, decorators: [{
7157
+ type: Directive,
7158
+ args: [{
7159
+ selector: '[attributes]',
7160
+ standalone: false
7161
+ }]
7162
+ }], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }]; }, propDecorators: { attributes: [{
7163
+ type: Input
7164
+ }] } });
7165
+
7027
7166
  class AddReferenceComponent {
7028
7167
  constructor(jsf) {
7029
7168
  this.jsf = jsf;
@@ -7423,6 +7562,55 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
7423
7562
  type: Input
7424
7563
  }] } });
7425
7564
 
7565
+ class HiddenComponent {
7566
+ constructor(jsf) {
7567
+ this.jsf = jsf;
7568
+ this.controlDisabled = false;
7569
+ this.boundControl = false;
7570
+ }
7571
+ ngOnInit() {
7572
+ this.jsf.initializeControl(this);
7573
+ }
7574
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: HiddenComponent, deps: [{ token: JsonSchemaFormService }], target: i0.ɵɵFactoryTarget.Component }); }
7575
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: HiddenComponent, selector: "hidden-widget", inputs: { layoutNode: "layoutNode", layoutIndex: "layoutIndex", dataIndex: "dataIndex" }, ngImport: i0, template: `
7576
+ <input *ngIf="boundControl"
7577
+ [formControl]="formControl"
7578
+ [id]="'control' + layoutNode?._id"
7579
+ [name]="controlName"
7580
+ type="hidden">
7581
+ <input *ngIf="!boundControl"
7582
+ [disabled]="controlDisabled"
7583
+ [name]="controlName"
7584
+ [id]="'control' + layoutNode?._id"
7585
+ type="hidden"
7586
+ [value]="controlValue">`, isInline: true, dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] }); }
7587
+ }
7588
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: HiddenComponent, decorators: [{
7589
+ type: Component,
7590
+ args: [{
7591
+ // tslint:disable-next-line:component-selector
7592
+ selector: 'hidden-widget',
7593
+ template: `
7594
+ <input *ngIf="boundControl"
7595
+ [formControl]="formControl"
7596
+ [id]="'control' + layoutNode?._id"
7597
+ [name]="controlName"
7598
+ type="hidden">
7599
+ <input *ngIf="!boundControl"
7600
+ [disabled]="controlDisabled"
7601
+ [name]="controlName"
7602
+ [id]="'control' + layoutNode?._id"
7603
+ type="hidden"
7604
+ [value]="controlValue">`,
7605
+ }]
7606
+ }], ctorParameters: function () { return [{ type: JsonSchemaFormService }]; }, propDecorators: { layoutNode: [{
7607
+ type: Input
7608
+ }], layoutIndex: [{
7609
+ type: Input
7610
+ }], dataIndex: [{
7611
+ type: Input
7612
+ }] } });
7613
+
7426
7614
  class InputComponent {
7427
7615
  constructor(jsf) {
7428
7616
  this.jsf = jsf;
@@ -7430,6 +7618,10 @@ class InputComponent {
7430
7618
  this.boundControl = false;
7431
7619
  this.autoCompleteList = [];
7432
7620
  }
7621
+ //needed as templates don't accept something like [attributes]="options?.['x-inputAttributes']"
7622
+ get inputAttributes() {
7623
+ return this.options?.['x-inputAttributes'];
7624
+ }
7433
7625
  ngOnInit() {
7434
7626
  this.options = this.layoutNode.options || {};
7435
7627
  this.jsf.initializeControl(this);
@@ -7439,7 +7631,7 @@ class InputComponent {
7439
7631
  }
7440
7632
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: InputComponent, deps: [{ token: JsonSchemaFormService }], target: i0.ɵɵFactoryTarget.Component }); }
7441
7633
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: InputComponent, selector: "input-widget", inputs: { layoutNode: "layoutNode", layoutIndex: "layoutIndex", dataIndex: "dataIndex" }, ngImport: i0, template: `
7442
- <div [class]="options?.htmlClass || ''">
7634
+ <div [class]="options?.htmlClass || ''" class="sortable-filter" >
7443
7635
  <label *ngIf="options?.title"
7444
7636
  [attr.for]="'control' + layoutNode?._id"
7445
7637
  [class]="options?.labelHtmlClass || ''"
@@ -7458,7 +7650,9 @@ class InputComponent {
7458
7650
  [id]="'control' + layoutNode?._id"
7459
7651
  [name]="controlName"
7460
7652
  [readonly]="options?.readonly ? 'readonly' : null"
7461
- [type]="layoutNode?.type">
7653
+ [type]="layoutNode?.type"
7654
+ [attributes]="inputAttributes"
7655
+ >
7462
7656
  <input *ngIf="!boundControl"
7463
7657
  [attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
7464
7658
  [attr.list]="'control' + layoutNode?._id + 'Autocomplete'"
@@ -7474,12 +7668,14 @@ class InputComponent {
7474
7668
  [readonly]="options?.readonly ? 'readonly' : null"
7475
7669
  [type]="layoutNode?.type"
7476
7670
  [value]="controlValue"
7477
- (input)="updateValue($event)">
7671
+ (input)="updateValue($event)"
7672
+ [attributes]="inputAttributes"
7673
+ >
7478
7674
  <datalist *ngIf="options?.typeahead?.source"
7479
7675
  [id]="'control' + layoutNode?._id + 'Autocomplete'">
7480
7676
  <option *ngFor="let word of options?.typeahead?.source" [value]="word">
7481
7677
  </datalist>
7482
- </div>`, isInline: true, dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i3.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] }); }
7678
+ </div>`, isInline: true, dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i3.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: ElementAttributeDirective, selector: "[attributes]", inputs: ["attributes"] }] }); }
7483
7679
  }
7484
7680
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: InputComponent, decorators: [{
7485
7681
  type: Component,
@@ -7487,7 +7683,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
7487
7683
  // tslint:disable-next-line:component-selector
7488
7684
  selector: 'input-widget',
7489
7685
  template: `
7490
- <div [class]="options?.htmlClass || ''">
7686
+ <div [class]="options?.htmlClass || ''" class="sortable-filter" >
7491
7687
  <label *ngIf="options?.title"
7492
7688
  [attr.for]="'control' + layoutNode?._id"
7493
7689
  [class]="options?.labelHtmlClass || ''"
@@ -7506,7 +7702,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
7506
7702
  [id]="'control' + layoutNode?._id"
7507
7703
  [name]="controlName"
7508
7704
  [readonly]="options?.readonly ? 'readonly' : null"
7509
- [type]="layoutNode?.type">
7705
+ [type]="layoutNode?.type"
7706
+ [attributes]="inputAttributes"
7707
+ >
7510
7708
  <input *ngIf="!boundControl"
7511
7709
  [attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
7512
7710
  [attr.list]="'control' + layoutNode?._id + 'Autocomplete'"
@@ -7522,7 +7720,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
7522
7720
  [readonly]="options?.readonly ? 'readonly' : null"
7523
7721
  [type]="layoutNode?.type"
7524
7722
  [value]="controlValue"
7525
- (input)="updateValue($event)">
7723
+ (input)="updateValue($event)"
7724
+ [attributes]="inputAttributes"
7725
+ >
7526
7726
  <datalist *ngIf="options?.typeahead?.source"
7527
7727
  [id]="'control' + layoutNode?._id + 'Autocomplete'">
7528
7728
  <option *ngFor="let word of options?.typeahead?.source" [value]="word">
@@ -7590,6 +7790,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
7590
7790
  type: Input
7591
7791
  }] } });
7592
7792
 
7793
+ //TODO look at reusing InputComponent
7593
7794
  class NumberComponent {
7594
7795
  constructor(jsf) {
7595
7796
  this.jsf = jsf;
@@ -7600,6 +7801,10 @@ class NumberComponent {
7600
7801
  this.allowExponents = false;
7601
7802
  this.lastValidNumber = '';
7602
7803
  }
7804
+ //needed as templates don't accept something like [attributes]="options?.['x-inputAttributes']"
7805
+ get inputAttributes() {
7806
+ return this.options?.['x-inputAttributes'];
7807
+ }
7603
7808
  ngOnInit() {
7604
7809
  this.options = this.layoutNode.options || {};
7605
7810
  this.jsf.initializeControl(this);
@@ -7612,13 +7817,13 @@ class NumberComponent {
7612
7817
  }
7613
7818
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NumberComponent, deps: [{ token: JsonSchemaFormService }], target: i0.ɵɵFactoryTarget.Component }); }
7614
7819
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: NumberComponent, selector: "number-widget", inputs: { layoutNode: "layoutNode", layoutIndex: "layoutIndex", dataIndex: "dataIndex" }, ngImport: i0, template: `
7615
- <div [class]="options?.htmlClass || ''">
7820
+ <div #divElt [class]="options?.htmlClass || ''" class="sortable-filter" >
7616
7821
  <label *ngIf="options?.title"
7617
7822
  [attr.for]="'control' + layoutNode?._id"
7618
7823
  [class]="options?.labelHtmlClass || ''"
7619
7824
  [style.display]="options?.notitle ? 'none' : ''"
7620
7825
  [innerHTML]="options?.title"></label>
7621
- <input *ngIf="boundControl"
7826
+ <input #inputControl *ngIf="boundControl"
7622
7827
  [formControl]="formControl"
7623
7828
  [attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
7624
7829
  [attr.max]="options?.maximum"
@@ -7632,8 +7837,11 @@ class NumberComponent {
7632
7837
  [name]="controlName"
7633
7838
  [readonly]="options?.readonly ? 'readonly' : null"
7634
7839
  [title]="lastValidNumber"
7635
- [type]="layoutNode?.type === 'range' ? 'range' : 'number'">
7636
- <input *ngIf="!boundControl"
7840
+ [type]="layoutNode?.type === 'range' ? 'range' : 'number'"
7841
+ [attributes]="inputAttributes"
7842
+
7843
+ >
7844
+ <input #inputControl *ngIf="!boundControl"
7637
7845
  [attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
7638
7846
  [attr.max]="options?.maximum"
7639
7847
  [attr.min]="options?.minimum"
@@ -7649,9 +7857,11 @@ class NumberComponent {
7649
7857
  [title]="lastValidNumber"
7650
7858
  [type]="layoutNode?.type === 'range' ? 'range' : 'number'"
7651
7859
  [value]="controlValue"
7652
- (input)="updateValue($event)">
7860
+ (input)="updateValue($event)"
7861
+ [attributes]="inputAttributes"
7862
+ >
7653
7863
  <span *ngIf="layoutNode?.type === 'range'" [innerHTML]="controlValue"></span>
7654
- </div>`, isInline: true, dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] }); }
7864
+ </div>`, isInline: true, dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: ElementAttributeDirective, selector: "[attributes]", inputs: ["attributes"] }] }); }
7655
7865
  }
7656
7866
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NumberComponent, decorators: [{
7657
7867
  type: Component,
@@ -7659,13 +7869,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
7659
7869
  // tslint:disable-next-line:component-selector
7660
7870
  selector: 'number-widget',
7661
7871
  template: `
7662
- <div [class]="options?.htmlClass || ''">
7872
+ <div #divElt [class]="options?.htmlClass || ''" class="sortable-filter" >
7663
7873
  <label *ngIf="options?.title"
7664
7874
  [attr.for]="'control' + layoutNode?._id"
7665
7875
  [class]="options?.labelHtmlClass || ''"
7666
7876
  [style.display]="options?.notitle ? 'none' : ''"
7667
7877
  [innerHTML]="options?.title"></label>
7668
- <input *ngIf="boundControl"
7878
+ <input #inputControl *ngIf="boundControl"
7669
7879
  [formControl]="formControl"
7670
7880
  [attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
7671
7881
  [attr.max]="options?.maximum"
@@ -7679,8 +7889,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
7679
7889
  [name]="controlName"
7680
7890
  [readonly]="options?.readonly ? 'readonly' : null"
7681
7891
  [title]="lastValidNumber"
7682
- [type]="layoutNode?.type === 'range' ? 'range' : 'number'">
7683
- <input *ngIf="!boundControl"
7892
+ [type]="layoutNode?.type === 'range' ? 'range' : 'number'"
7893
+ [attributes]="inputAttributes"
7894
+
7895
+ >
7896
+ <input #inputControl *ngIf="!boundControl"
7684
7897
  [attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
7685
7898
  [attr.max]="options?.maximum"
7686
7899
  [attr.min]="options?.minimum"
@@ -7696,7 +7909,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
7696
7909
  [title]="lastValidNumber"
7697
7910
  [type]="layoutNode?.type === 'range' ? 'range' : 'number'"
7698
7911
  [value]="controlValue"
7699
- (input)="updateValue($event)">
7912
+ (input)="updateValue($event)"
7913
+ [attributes]="inputAttributes"
7914
+ >
7700
7915
  <span *ngIf="layoutNode?.type === 'range'" [innerHTML]="controlValue"></span>
7701
7916
  </div>`,
7702
7917
  }]
@@ -7889,8 +8104,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
7889
8104
  }] } });
7890
8105
 
7891
8106
  class SelectFrameworkComponent {
7892
- constructor(componentFactory, jsf) {
7893
- this.componentFactory = componentFactory;
8107
+ constructor(jsf) {
7894
8108
  this.jsf = jsf;
7895
8109
  this.newComponent = null;
7896
8110
  }
@@ -7901,8 +8115,9 @@ class SelectFrameworkComponent {
7901
8115
  this.updateComponent();
7902
8116
  }
7903
8117
  updateComponent() {
7904
- if (this.widgetContainer && !this.newComponent && this.jsf.framework) {
7905
- this.newComponent = this.widgetContainer.createComponent(this.componentFactory.resolveComponentFactory(this.jsf.framework));
8118
+ const widgetContainer = this.widgetContainer;
8119
+ if (widgetContainer && !this.newComponent && this.jsf.framework) {
8120
+ this.newComponent = widgetContainer.createComponent((this.jsf.framework));
7906
8121
  //TODO fix all deprecated calls and test
7907
8122
  //this.widgetContainer.createComponent<any>(this.jsf.framework)
7908
8123
  }
@@ -7912,7 +8127,7 @@ class SelectFrameworkComponent {
7912
8127
  }
7913
8128
  }
7914
8129
  }
7915
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SelectFrameworkComponent, deps: [{ token: i0.ComponentFactoryResolver }, { token: JsonSchemaFormService }], target: i0.ɵɵFactoryTarget.Component }); }
8130
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SelectFrameworkComponent, deps: [{ token: JsonSchemaFormService }], target: i0.ɵɵFactoryTarget.Component }); }
7916
8131
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: SelectFrameworkComponent, selector: "select-framework-widget", inputs: { layoutNode: "layoutNode", layoutIndex: "layoutIndex", dataIndex: "dataIndex" }, viewQueries: [{ propertyName: "widgetContainer", first: true, predicate: ["widgetContainer"], descendants: true, read: ViewContainerRef, static: true }], usesOnChanges: true, ngImport: i0, template: `<div #widgetContainer></div>`, isInline: true }); }
7917
8132
  }
7918
8133
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SelectFrameworkComponent, decorators: [{
@@ -7922,7 +8137,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
7922
8137
  selector: 'select-framework-widget',
7923
8138
  template: `<div #widgetContainer></div>`,
7924
8139
  }]
7925
- }], ctorParameters: function () { return [{ type: i0.ComponentFactoryResolver }, { type: JsonSchemaFormService }]; }, propDecorators: { layoutNode: [{
8140
+ }], ctorParameters: function () { return [{ type: JsonSchemaFormService }]; }, propDecorators: { layoutNode: [{
7926
8141
  type: Input
7927
8142
  }], layoutIndex: [{
7928
8143
  type: Input
@@ -8035,6 +8250,15 @@ class OrderableDirective {
8035
8250
  return false;
8036
8251
  });
8037
8252
  });
8253
+ // Subscribe to the draggable state
8254
+ this.draggableStateSubscription = this.jsf.draggableState$.subscribe((value) => {
8255
+ this.element.draggable = value;
8256
+ });
8257
+ }
8258
+ }
8259
+ ngOnDestroy() {
8260
+ if (this.draggableStateSubscription) {
8261
+ this.draggableStateSubscription.unsubscribe();
8038
8262
  }
8039
8263
  }
8040
8264
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: OrderableDirective, deps: [{ token: i0.ElementRef }, { token: JsonSchemaFormService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }
@@ -8060,10 +8284,40 @@ class RootComponent {
8060
8284
  constructor(jsf) {
8061
8285
  this.jsf = jsf;
8062
8286
  this.isFlexItem = false;
8287
+ this.sortableConfig = {
8288
+ filter: ".sortable-filter",
8289
+ preventOnFilter: false,
8290
+ onEnd: (/**Event*/ evt) => {
8291
+ evt.newIndex; // most likely why this event is used is to get the dragging element's current index
8292
+ // same properties as onEnd
8293
+ //console.log(`sortablejs event:${evt}`);
8294
+ let srcInd = evt.oldIndex;
8295
+ let trgInd = evt.newIndex;
8296
+ let layoutItem = this.layout[trgInd];
8297
+ let dataInd = layoutItem?.arrayItem ? (this.dataIndex || []).concat(trgInd) : (this.dataIndex || []);
8298
+ let layoutInd = (this.layoutIndex || []).concat(trgInd);
8299
+ let itemCtx = {
8300
+ dataIndex: dataInd,
8301
+ layoutIndex: layoutInd,
8302
+ layoutNode: layoutItem,
8303
+ };
8304
+ //must set moveLayout to false as nxtSortable already moves it
8305
+ this.jsf.moveArrayItem(itemCtx, evt.oldIndex, evt.newIndex, false);
8306
+ }
8307
+ };
8308
+ }
8309
+ sortableInit(sortable) {
8310
+ this.sortableObj = sortable;
8063
8311
  }
8064
8312
  isDraggable(node) {
8065
- return node.arrayItem && node.type !== '$ref' &&
8313
+ let result = node.arrayItem && node.type !== '$ref' &&
8066
8314
  node.arrayItemType === 'list' && this.isOrderable !== false;
8315
+ if (this.sortableObj) {
8316
+ //this.sortableObj.option("disabled",true);
8317
+ //this.sortableObj.option("sort",false);
8318
+ //this.sortableObj.option("disabled",!result);
8319
+ }
8320
+ return result;
8067
8321
  }
8068
8322
  // Set attributes for flexbox child
8069
8323
  // (container attributes are set in section.component)
@@ -8075,48 +8329,86 @@ class RootComponent {
8075
8329
  showWidget(layoutNode) {
8076
8330
  return this.jsf.evaluateCondition(layoutNode, this.dataIndex);
8077
8331
  }
8332
+ ngOnInit() {
8333
+ // Subscribe to the draggable state
8334
+ this.sortableOptionsSubscription = this.jsf.sortableOptions$.subscribe((optsValue) => {
8335
+ if (this.sortableObj) {
8336
+ Object.keys(optsValue).forEach(opt => {
8337
+ let optVal = optsValue[opt];
8338
+ this.sortableObj.option(opt, optVal);
8339
+ });
8340
+ //this.sortableObj.option("disabled",true);
8341
+ //this.sortableObj.option("sort",false);
8342
+ }
8343
+ });
8344
+ }
8345
+ ngOnDestroy() {
8346
+ if (this.sortableOptionsSubscription) {
8347
+ this.sortableOptionsSubscription.unsubscribe();
8348
+ }
8349
+ }
8078
8350
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: RootComponent, deps: [{ token: JsonSchemaFormService }], target: i0.ɵɵFactoryTarget.Component }); }
8079
8351
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: RootComponent, selector: "root-widget", inputs: { dataIndex: "dataIndex", layoutIndex: "layoutIndex", layout: "layout", isOrderable: "isOrderable", isFlexItem: "isFlexItem" }, ngImport: i0, template: `
8080
- <div *ngFor="let layoutItem of layout; let i = index"
8081
- [class.form-flex-item]="isFlexItem"
8082
- [style.align-self]="(layoutItem.options || {})['align-self']"
8083
- [style.flex-basis]="getFlexAttribute(layoutItem, 'flex-basis')"
8084
- [style.flex-grow]="getFlexAttribute(layoutItem, 'flex-grow')"
8085
- [style.flex-shrink]="getFlexAttribute(layoutItem, 'flex-shrink')"
8086
- [style.order]="(layoutItem.options || {}).order">
8087
- <div
8088
- [dataIndex]="layoutItem?.arrayItem ? (dataIndex || []).concat(i) : (dataIndex || [])"
8089
- [layoutIndex]="(layoutIndex || []).concat(i)"
8090
- [layoutNode]="layoutItem"
8091
- [orderable]="isDraggable(layoutItem)">
8092
- <select-framework-widget *ngIf="showWidget(layoutItem)"
8352
+ <div #sortableContainter [nxtSortablejs]="layout" [config]="sortableConfig" (init)="sortableInit($event)">
8353
+ <div *ngFor="let layoutItem of layout; let i = index"
8354
+ [class.form-flex-item]="isFlexItem"
8355
+ [style.align-self]="(layoutItem.options || {})['align-self']"
8356
+ [style.flex-basis]="getFlexAttribute(layoutItem, 'flex-basis')"
8357
+ [style.flex-grow]="getFlexAttribute(layoutItem, 'flex-grow')"
8358
+ [style.flex-shrink]="getFlexAttribute(layoutItem, 'flex-shrink')"
8359
+ [style.order]="(layoutItem.options || {}).order"
8360
+ [class.sortable-filter]="!isDraggable(layoutItem)"
8361
+ >
8362
+ <!--NB orderable directive is not used but has been left in for now and set to false
8363
+ otherwise the compiler won't recognize dataIndex and other dependent attributes
8364
+ -->
8365
+ <div
8093
8366
  [dataIndex]="layoutItem?.arrayItem ? (dataIndex || []).concat(i) : (dataIndex || [])"
8094
8367
  [layoutIndex]="(layoutIndex || []).concat(i)"
8095
- [layoutNode]="layoutItem"></select-framework-widget>
8368
+ [layoutNode]="layoutItem"
8369
+ [orderable]="false"
8370
+ [class.sortable-filter]="!isDraggable(layoutItem)"
8371
+ >
8372
+ <select-framework-widget *ngIf="showWidget(layoutItem)"
8373
+ [dataIndex]="layoutItem?.arrayItem ? (dataIndex || []).concat(i) : (dataIndex || [])"
8374
+ [layoutIndex]="(layoutIndex || []).concat(i)"
8375
+ [layoutNode]="layoutItem"></select-framework-widget>
8376
+ </div>
8096
8377
  </div>
8097
- </div>`, isInline: true, styles: ["[draggable=true]{transition:all .15s cubic-bezier(.4,0,.2,1)}[draggable=true]:hover{cursor:move;box-shadow:2px 2px 4px #0003;position:relative;z-index:10;margin:-1px 1px 1px -1px}[draggable=true].drag-target-top{box-shadow:0 -2px #000;position:relative;z-index:20}[draggable=true].drag-target-bottom{box-shadow:0 2px #000;position:relative;z-index:20}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: SelectFrameworkComponent, selector: "select-framework-widget", inputs: ["layoutNode", "layoutIndex", "dataIndex"] }, { kind: "directive", type: OrderableDirective, selector: "[orderable]", inputs: ["orderable", "layoutNode", "layoutIndex", "dataIndex"] }] }); }
8378
+ </div>
8379
+ `, isInline: true, styles: ["[draggable=true]{transition:all .15s cubic-bezier(.4,0,.2,1)}[draggable=true]:hover{cursor:move;box-shadow:2px 2px 4px #0003;position:relative;z-index:10;margin:-1px 1px 1px -1px}[draggable=true].drag-target-top{box-shadow:0 -2px #000;position:relative;z-index:20}[draggable=true].drag-target-bottom{box-shadow:0 2px #000;position:relative;z-index:20}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$1.SortablejsDirective, selector: "[nxtSortablejs]", inputs: ["nxtSortablejs", "sortablejsContainer", "config", "cloneFunction"], outputs: ["init"] }, { kind: "component", type: SelectFrameworkComponent, selector: "select-framework-widget", inputs: ["layoutNode", "layoutIndex", "dataIndex"] }, { kind: "directive", type: OrderableDirective, selector: "[orderable]", inputs: ["orderable", "layoutNode", "layoutIndex", "dataIndex"] }] }); }
8098
8380
  }
8099
8381
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: RootComponent, decorators: [{
8100
8382
  type: Component,
8101
8383
  args: [{ selector: 'root-widget', template: `
8102
- <div *ngFor="let layoutItem of layout; let i = index"
8103
- [class.form-flex-item]="isFlexItem"
8104
- [style.align-self]="(layoutItem.options || {})['align-self']"
8105
- [style.flex-basis]="getFlexAttribute(layoutItem, 'flex-basis')"
8106
- [style.flex-grow]="getFlexAttribute(layoutItem, 'flex-grow')"
8107
- [style.flex-shrink]="getFlexAttribute(layoutItem, 'flex-shrink')"
8108
- [style.order]="(layoutItem.options || {}).order">
8109
- <div
8110
- [dataIndex]="layoutItem?.arrayItem ? (dataIndex || []).concat(i) : (dataIndex || [])"
8111
- [layoutIndex]="(layoutIndex || []).concat(i)"
8112
- [layoutNode]="layoutItem"
8113
- [orderable]="isDraggable(layoutItem)">
8114
- <select-framework-widget *ngIf="showWidget(layoutItem)"
8384
+ <div #sortableContainter [nxtSortablejs]="layout" [config]="sortableConfig" (init)="sortableInit($event)">
8385
+ <div *ngFor="let layoutItem of layout; let i = index"
8386
+ [class.form-flex-item]="isFlexItem"
8387
+ [style.align-self]="(layoutItem.options || {})['align-self']"
8388
+ [style.flex-basis]="getFlexAttribute(layoutItem, 'flex-basis')"
8389
+ [style.flex-grow]="getFlexAttribute(layoutItem, 'flex-grow')"
8390
+ [style.flex-shrink]="getFlexAttribute(layoutItem, 'flex-shrink')"
8391
+ [style.order]="(layoutItem.options || {}).order"
8392
+ [class.sortable-filter]="!isDraggable(layoutItem)"
8393
+ >
8394
+ <!--NB orderable directive is not used but has been left in for now and set to false
8395
+ otherwise the compiler won't recognize dataIndex and other dependent attributes
8396
+ -->
8397
+ <div
8115
8398
  [dataIndex]="layoutItem?.arrayItem ? (dataIndex || []).concat(i) : (dataIndex || [])"
8116
8399
  [layoutIndex]="(layoutIndex || []).concat(i)"
8117
- [layoutNode]="layoutItem"></select-framework-widget>
8400
+ [layoutNode]="layoutItem"
8401
+ [orderable]="false"
8402
+ [class.sortable-filter]="!isDraggable(layoutItem)"
8403
+ >
8404
+ <select-framework-widget *ngIf="showWidget(layoutItem)"
8405
+ [dataIndex]="layoutItem?.arrayItem ? (dataIndex || []).concat(i) : (dataIndex || [])"
8406
+ [layoutIndex]="(layoutIndex || []).concat(i)"
8407
+ [layoutNode]="layoutItem"></select-framework-widget>
8408
+ </div>
8118
8409
  </div>
8119
- </div>`, styles: ["[draggable=true]{transition:all .15s cubic-bezier(.4,0,.2,1)}[draggable=true]:hover{cursor:move;box-shadow:2px 2px 4px #0003;position:relative;z-index:10;margin:-1px 1px 1px -1px}[draggable=true].drag-target-top{box-shadow:0 -2px #000;position:relative;z-index:20}[draggable=true].drag-target-bottom{box-shadow:0 2px #000;position:relative;z-index:20}\n"] }]
8410
+ </div>
8411
+ `, standalone: false, styles: ["[draggable=true]{transition:all .15s cubic-bezier(.4,0,.2,1)}[draggable=true]:hover{cursor:move;box-shadow:2px 2px 4px #0003;position:relative;z-index:10;margin:-1px 1px 1px -1px}[draggable=true].drag-target-top{box-shadow:0 -2px #000;position:relative;z-index:20}[draggable=true].drag-target-bottom{box-shadow:0 2px #000;position:relative;z-index:20}\n"] }]
8120
8412
  }], ctorParameters: function () { return [{ type: JsonSchemaFormService }]; }, propDecorators: { dataIndex: [{
8121
8413
  type: Input
8122
8414
  }], layoutIndex: [{
@@ -8198,7 +8490,7 @@ class SectionComponent {
8198
8490
  [class]="options?.labelHtmlClass || ''"
8199
8491
  [innerHTML]="sectionTitle"
8200
8492
  (click)="toggleExpanded()"></label>
8201
- <root-widget *ngIf="expanded"
8493
+ <root-widget
8202
8494
  [dataIndex]="dataIndex"
8203
8495
  [layout]="layoutNode.items"
8204
8496
  [layoutIndex]="layoutIndex"
@@ -8208,7 +8500,7 @@ class SectionComponent {
8208
8500
  [class.form-flex-row]="getFlexAttribute('flex-direction') === 'row'"
8209
8501
  [style.align-content]="getFlexAttribute('align-content')"
8210
8502
  [style.align-items]="getFlexAttribute('align-items')"
8211
- [style.display]="getFlexAttribute('display')"
8503
+ [style.display]="!expanded?'none':getFlexAttribute('display')"
8212
8504
  [style.flex-direction]="getFlexAttribute('flex-direction')"
8213
8505
  [style.flex-wrap]="getFlexAttribute('flex-wrap')"
8214
8506
  [style.justify-content]="getFlexAttribute('justify-content')"></root-widget>
@@ -8229,7 +8521,7 @@ class SectionComponent {
8229
8521
  [class]="options?.labelHelpBlockClass || ''"
8230
8522
  [innerHTML]="options?.description"></p>
8231
8523
  </div>
8232
- <root-widget *ngIf="expanded"
8524
+ <root-widget
8233
8525
  [dataIndex]="dataIndex"
8234
8526
  [layout]="layoutNode.items"
8235
8527
  [layoutIndex]="layoutIndex"
@@ -8239,7 +8531,7 @@ class SectionComponent {
8239
8531
  [class.form-flex-row]="getFlexAttribute('flex-direction') === 'row'"
8240
8532
  [style.align-content]="getFlexAttribute('align-content')"
8241
8533
  [style.align-items]="getFlexAttribute('align-items')"
8242
- [style.display]="getFlexAttribute('display')"
8534
+ [style.display]="!expanded?'none':getFlexAttribute('display')"
8243
8535
  [style.flex-direction]="getFlexAttribute('flex-direction')"
8244
8536
  [style.flex-wrap]="getFlexAttribute('flex-wrap')"
8245
8537
  [style.justify-content]="getFlexAttribute('justify-content')"></root-widget>
@@ -8263,7 +8555,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
8263
8555
  [class]="options?.labelHtmlClass || ''"
8264
8556
  [innerHTML]="sectionTitle"
8265
8557
  (click)="toggleExpanded()"></label>
8266
- <root-widget *ngIf="expanded"
8558
+ <root-widget
8267
8559
  [dataIndex]="dataIndex"
8268
8560
  [layout]="layoutNode.items"
8269
8561
  [layoutIndex]="layoutIndex"
@@ -8273,7 +8565,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
8273
8565
  [class.form-flex-row]="getFlexAttribute('flex-direction') === 'row'"
8274
8566
  [style.align-content]="getFlexAttribute('align-content')"
8275
8567
  [style.align-items]="getFlexAttribute('align-items')"
8276
- [style.display]="getFlexAttribute('display')"
8568
+ [style.display]="!expanded?'none':getFlexAttribute('display')"
8277
8569
  [style.flex-direction]="getFlexAttribute('flex-direction')"
8278
8570
  [style.flex-wrap]="getFlexAttribute('flex-wrap')"
8279
8571
  [style.justify-content]="getFlexAttribute('justify-content')"></root-widget>
@@ -8294,7 +8586,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
8294
8586
  [class]="options?.labelHelpBlockClass || ''"
8295
8587
  [innerHTML]="options?.description"></p>
8296
8588
  </div>
8297
- <root-widget *ngIf="expanded"
8589
+ <root-widget
8298
8590
  [dataIndex]="dataIndex"
8299
8591
  [layout]="layoutNode.items"
8300
8592
  [layoutIndex]="layoutIndex"
@@ -8304,7 +8596,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
8304
8596
  [class.form-flex-row]="getFlexAttribute('flex-direction') === 'row'"
8305
8597
  [style.align-content]="getFlexAttribute('align-content')"
8306
8598
  [style.align-items]="getFlexAttribute('align-items')"
8307
- [style.display]="getFlexAttribute('display')"
8599
+ [style.display]="!expanded?'none':getFlexAttribute('display')"
8308
8600
  [style.flex-direction]="getFlexAttribute('flex-direction')"
8309
8601
  [style.flex-wrap]="getFlexAttribute('flex-wrap')"
8310
8602
  [style.justify-content]="getFlexAttribute('justify-content')"></root-widget>
@@ -8467,49 +8759,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
8467
8759
  type: Input
8468
8760
  }] } });
8469
8761
 
8470
- class SelectWidgetComponent {
8471
- constructor(componentFactory, jsf) {
8472
- this.componentFactory = componentFactory;
8473
- this.jsf = jsf;
8474
- this.newComponent = null;
8475
- }
8476
- ngOnInit() {
8477
- this.updateComponent();
8478
- }
8479
- ngOnChanges() {
8480
- this.updateComponent();
8481
- }
8482
- updateComponent() {
8483
- if (this.widgetContainer && !this.newComponent && (this.layoutNode || {}).widget) {
8484
- this.newComponent = this.widgetContainer.createComponent(this.componentFactory.resolveComponentFactory(this.layoutNode.widget));
8485
- }
8486
- if (this.newComponent) {
8487
- for (const input of ['layoutNode', 'layoutIndex', 'dataIndex']) {
8488
- this.newComponent.instance[input] = this[input];
8489
- }
8490
- }
8491
- }
8492
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SelectWidgetComponent, deps: [{ token: i0.ComponentFactoryResolver }, { token: JsonSchemaFormService }], target: i0.ɵɵFactoryTarget.Component }); }
8493
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: SelectWidgetComponent, selector: "select-widget-widget", inputs: { layoutNode: "layoutNode", layoutIndex: "layoutIndex", dataIndex: "dataIndex" }, viewQueries: [{ propertyName: "widgetContainer", first: true, predicate: ["widgetContainer"], descendants: true, read: ViewContainerRef, static: true }], usesOnChanges: true, ngImport: i0, template: `<div #widgetContainer></div>`, isInline: true }); }
8494
- }
8495
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SelectWidgetComponent, decorators: [{
8496
- type: Component,
8497
- args: [{
8498
- // tslint:disable-next-line:component-selector
8499
- selector: 'select-widget-widget',
8500
- template: `<div #widgetContainer></div>`,
8501
- }]
8502
- }], ctorParameters: function () { return [{ type: i0.ComponentFactoryResolver }, { type: JsonSchemaFormService }]; }, propDecorators: { layoutNode: [{
8503
- type: Input
8504
- }], layoutIndex: [{
8505
- type: Input
8506
- }], dataIndex: [{
8507
- type: Input
8508
- }], widgetContainer: [{
8509
- type: ViewChild,
8510
- args: ['widgetContainer', { read: ViewContainerRef, static: true }]
8511
- }] } });
8512
-
8513
8762
  class SubmitComponent {
8514
8763
  constructor(jsf) {
8515
8764
  this.jsf = jsf;
@@ -8588,6 +8837,43 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
8588
8837
  type: Input
8589
8838
  }] } });
8590
8839
 
8840
+ class TabComponent {
8841
+ constructor(jsf) {
8842
+ this.jsf = jsf;
8843
+ }
8844
+ ngOnInit() {
8845
+ this.options = this.layoutNode.options || {};
8846
+ }
8847
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TabComponent, deps: [{ token: JsonSchemaFormService }], target: i0.ɵɵFactoryTarget.Component }); }
8848
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TabComponent, selector: "tab-widget", inputs: { layoutNode: "layoutNode", layoutIndex: "layoutIndex", dataIndex: "dataIndex" }, ngImport: i0, template: `
8849
+ <div [class]="options?.htmlClass || ''">
8850
+ <root-widget
8851
+ [dataIndex]="dataIndex"
8852
+ [layoutIndex]="layoutIndex"
8853
+ [layout]="layoutNode.items"></root-widget>
8854
+ </div>`, isInline: true, dependencies: [{ kind: "component", type: RootComponent, selector: "root-widget", inputs: ["dataIndex", "layoutIndex", "layout", "isOrderable", "isFlexItem"] }] }); }
8855
+ }
8856
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TabComponent, decorators: [{
8857
+ type: Component,
8858
+ args: [{
8859
+ // tslint:disable-next-line:component-selector
8860
+ selector: 'tab-widget',
8861
+ template: `
8862
+ <div [class]="options?.htmlClass || ''">
8863
+ <root-widget
8864
+ [dataIndex]="dataIndex"
8865
+ [layoutIndex]="layoutIndex"
8866
+ [layout]="layoutNode.items"></root-widget>
8867
+ </div>`,
8868
+ }]
8869
+ }], ctorParameters: function () { return [{ type: JsonSchemaFormService }]; }, propDecorators: { layoutNode: [{
8870
+ type: Input
8871
+ }], layoutIndex: [{
8872
+ type: Input
8873
+ }], dataIndex: [{
8874
+ type: Input
8875
+ }] } });
8876
+
8591
8877
  class TabsComponent {
8592
8878
  constructor(jsf) {
8593
8879
  this.jsf = jsf;
@@ -8692,8 +8978,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
8692
8978
  }] } });
8693
8979
 
8694
8980
  class TemplateComponent {
8695
- constructor(componentFactory, jsf) {
8696
- this.componentFactory = componentFactory;
8981
+ constructor(jsf) {
8697
8982
  this.jsf = jsf;
8698
8983
  this.newComponent = null;
8699
8984
  }
@@ -8704,8 +8989,10 @@ class TemplateComponent {
8704
8989
  this.updateComponent();
8705
8990
  }
8706
8991
  updateComponent() {
8707
- if (this.widgetContainer && !this.newComponent && this.layoutNode.options.template) {
8708
- this.newComponent = this.widgetContainer.createComponent(this.componentFactory.resolveComponentFactory(this.layoutNode.options.template));
8992
+ const layoutNode = this.layoutNode;
8993
+ const widgetContainer = this.widgetContainer;
8994
+ if (widgetContainer && !this.newComponent && layoutNode.options.template) {
8995
+ this.newComponent = widgetContainer.createComponent((layoutNode.options.template));
8709
8996
  }
8710
8997
  if (this.newComponent) {
8711
8998
  for (const input of ['layoutNode', 'layoutIndex', 'dataIndex']) {
@@ -8713,7 +9000,7 @@ class TemplateComponent {
8713
9000
  }
8714
9001
  }
8715
9002
  }
8716
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TemplateComponent, deps: [{ token: i0.ComponentFactoryResolver }, { token: JsonSchemaFormService }], target: i0.ɵɵFactoryTarget.Component }); }
9003
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TemplateComponent, deps: [{ token: JsonSchemaFormService }], target: i0.ɵɵFactoryTarget.Component }); }
8717
9004
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TemplateComponent, selector: "template-widget", inputs: { layoutNode: "layoutNode", layoutIndex: "layoutIndex", dataIndex: "dataIndex" }, viewQueries: [{ propertyName: "widgetContainer", first: true, predicate: ["widgetContainer"], descendants: true, read: ViewContainerRef, static: true }], usesOnChanges: true, ngImport: i0, template: `<div #widgetContainer></div>`, isInline: true }); }
8718
9005
  }
8719
9006
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TemplateComponent, decorators: [{
@@ -8723,7 +9010,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
8723
9010
  selector: 'template-widget',
8724
9011
  template: `<div #widgetContainer></div>`,
8725
9012
  }]
8726
- }], ctorParameters: function () { return [{ type: i0.ComponentFactoryResolver }, { type: JsonSchemaFormService }]; }, propDecorators: { layoutNode: [{
9013
+ }], ctorParameters: function () { return [{ type: JsonSchemaFormService }]; }, propDecorators: { layoutNode: [{
8727
9014
  type: Input
8728
9015
  }], layoutIndex: [{
8729
9016
  type: Input
@@ -9036,17 +9323,59 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
9036
9323
  }]
9037
9324
  }], ctorParameters: function () { return []; } });
9038
9325
 
9039
- class Framework {
9040
- constructor() {
9041
- this.widgets = {};
9042
- this.stylesheets = [];
9043
- this.scripts = [];
9044
- }
9045
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: Framework, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
9046
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: Framework }); }
9326
+ const BASIC_WIDGETS = [
9327
+ AddReferenceComponent, OneOfComponent, ButtonComponent, CheckboxComponent,
9328
+ CheckboxesComponent, FileComponent, HiddenComponent, InputComponent,
9329
+ MessageComponent, NoneComponent, NumberComponent, RadiosComponent,
9330
+ RootComponent, SectionComponent, SelectComponent, SelectFrameworkComponent,
9331
+ SelectWidgetComponent, SubmitComponent, TabComponent, TabsComponent,
9332
+ TemplateComponent, TextareaComponent
9333
+ ];
9334
+
9335
+ class WidgetLibraryModule {
9336
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: WidgetLibraryModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
9337
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: WidgetLibraryModule, declarations: [AddReferenceComponent, OneOfComponent, ButtonComponent, CheckboxComponent, CheckboxesComponent, FileComponent, HiddenComponent, InputComponent, MessageComponent, NoneComponent, NumberComponent, RadiosComponent, RootComponent, SectionComponent, SelectComponent, SelectFrameworkComponent, SelectWidgetComponent, SubmitComponent, TabComponent, TabsComponent, TemplateComponent, TextareaComponent, OrderableDirective, ElementAttributeDirective], imports: [CommonModule, FormsModule, ReactiveFormsModule, i3$1.SortablejsModule], exports: [AddReferenceComponent, OneOfComponent, ButtonComponent, CheckboxComponent, CheckboxesComponent, FileComponent, HiddenComponent, InputComponent, MessageComponent, NoneComponent, NumberComponent, RadiosComponent, RootComponent, SectionComponent, SelectComponent, SelectFrameworkComponent, SelectWidgetComponent, SubmitComponent, TabComponent, TabsComponent, TemplateComponent, TextareaComponent, OrderableDirective, ElementAttributeDirective] }); }
9338
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: WidgetLibraryModule, imports: [CommonModule, FormsModule, ReactiveFormsModule,
9339
+ SortablejsModule.forRoot({
9340
+ //disabled:false,
9341
+ //draggable:".draggableitem",//">:not(.nonsort)",//">.draggable-item",//":not(.nonsort)",//">*",//":not(.nonsort)",//":not(.non-draggable)",
9342
+ filter: ".sortable-filter",
9343
+ preventOnFilter: false //needed for input range elements slider do still work
9344
+ })] }); }
9047
9345
  }
9048
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: Framework, decorators: [{
9049
- type: Injectable
9346
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: WidgetLibraryModule, decorators: [{
9347
+ type: NgModule,
9348
+ args: [{
9349
+ imports: [CommonModule, FormsModule, ReactiveFormsModule,
9350
+ SortablejsModule.forRoot({
9351
+ //disabled:false,
9352
+ //draggable:".draggableitem",//">:not(.nonsort)",//">.draggable-item",//":not(.nonsort)",//">*",//":not(.nonsort)",//":not(.non-draggable)",
9353
+ filter: ".sortable-filter",
9354
+ preventOnFilter: false //needed for input range elements slider do still work
9355
+ })],
9356
+ declarations: [...BASIC_WIDGETS, OrderableDirective, ElementAttributeDirective],
9357
+ exports: [...BASIC_WIDGETS, OrderableDirective, ElementAttributeDirective]
9358
+ }]
9359
+ }] });
9360
+
9361
+ // No framework - plain HTML controls (styles from form layout only)
9362
+ class NoFrameworkModule {
9363
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NoFrameworkModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
9364
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: NoFrameworkModule, declarations: [NoFrameworkComponent], imports: [CommonModule, WidgetLibraryModule], exports: [NoFrameworkComponent] }); }
9365
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NoFrameworkModule, providers: [
9366
+ { provide: Framework, useClass: NoFramework, multi: true }
9367
+ ], imports: [CommonModule, WidgetLibraryModule] }); }
9368
+ }
9369
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NoFrameworkModule, decorators: [{
9370
+ type: NgModule,
9371
+ args: [{
9372
+ imports: [CommonModule, WidgetLibraryModule],
9373
+ declarations: [NoFrameworkComponent],
9374
+ exports: [NoFrameworkComponent],
9375
+ providers: [
9376
+ { provide: Framework, useClass: NoFramework, multi: true }
9377
+ ]
9378
+ }]
9050
9379
  }] });
9051
9380
 
9052
9381
  // Possible future frameworks:
@@ -9962,165 +10291,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
9962
10291
  type: Output
9963
10292
  }] } });
9964
10293
 
9965
- class NoFrameworkComponent {
9966
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NoFrameworkComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
9967
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: NoFrameworkComponent, selector: "no-framework", inputs: { layoutNode: "layoutNode", layoutIndex: "layoutIndex", dataIndex: "dataIndex" }, ngImport: i0, template: "<select-widget-widget [dataIndex]=\"dataIndex\" [layoutIndex]=\"layoutIndex\" [layoutNode]=\"layoutNode\">\r\n</select-widget-widget>", dependencies: [{ kind: "component", type: SelectWidgetComponent, selector: "select-widget-widget", inputs: ["layoutNode", "layoutIndex", "dataIndex"] }] }); }
9968
- }
9969
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NoFrameworkComponent, decorators: [{
9970
- type: Component,
9971
- args: [{ selector: 'no-framework', template: "<select-widget-widget [dataIndex]=\"dataIndex\" [layoutIndex]=\"layoutIndex\" [layoutNode]=\"layoutNode\">\r\n</select-widget-widget>" }]
9972
- }], propDecorators: { layoutNode: [{
9973
- type: Input
9974
- }], layoutIndex: [{
9975
- type: Input
9976
- }], dataIndex: [{
9977
- type: Input
9978
- }] } });
9979
-
9980
- // No framework - plain HTML controls (styles from form layout only)
9981
- class NoFramework extends Framework {
9982
- constructor() {
9983
- super(...arguments);
9984
- this.name = 'no-framework';
9985
- this.text = 'None (plain HTML)';
9986
- this.framework = NoFrameworkComponent;
9987
- }
9988
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NoFramework, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
9989
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NoFramework }); }
9990
- }
9991
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NoFramework, decorators: [{
9992
- type: Injectable
9993
- }] });
9994
-
9995
- class HiddenComponent {
9996
- constructor(jsf) {
9997
- this.jsf = jsf;
9998
- this.controlDisabled = false;
9999
- this.boundControl = false;
10000
- }
10001
- ngOnInit() {
10002
- this.jsf.initializeControl(this);
10003
- }
10004
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: HiddenComponent, deps: [{ token: JsonSchemaFormService }], target: i0.ɵɵFactoryTarget.Component }); }
10005
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: HiddenComponent, selector: "hidden-widget", inputs: { layoutNode: "layoutNode", layoutIndex: "layoutIndex", dataIndex: "dataIndex" }, ngImport: i0, template: `
10006
- <input *ngIf="boundControl"
10007
- [formControl]="formControl"
10008
- [id]="'control' + layoutNode?._id"
10009
- [name]="controlName"
10010
- type="hidden">
10011
- <input *ngIf="!boundControl"
10012
- [disabled]="controlDisabled"
10013
- [name]="controlName"
10014
- [id]="'control' + layoutNode?._id"
10015
- type="hidden"
10016
- [value]="controlValue">`, isInline: true, dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] }); }
10017
- }
10018
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: HiddenComponent, decorators: [{
10019
- type: Component,
10020
- args: [{
10021
- // tslint:disable-next-line:component-selector
10022
- selector: 'hidden-widget',
10023
- template: `
10024
- <input *ngIf="boundControl"
10025
- [formControl]="formControl"
10026
- [id]="'control' + layoutNode?._id"
10027
- [name]="controlName"
10028
- type="hidden">
10029
- <input *ngIf="!boundControl"
10030
- [disabled]="controlDisabled"
10031
- [name]="controlName"
10032
- [id]="'control' + layoutNode?._id"
10033
- type="hidden"
10034
- [value]="controlValue">`,
10035
- }]
10036
- }], ctorParameters: function () { return [{ type: JsonSchemaFormService }]; }, propDecorators: { layoutNode: [{
10037
- type: Input
10038
- }], layoutIndex: [{
10039
- type: Input
10040
- }], dataIndex: [{
10041
- type: Input
10042
- }] } });
10043
-
10044
- class TabComponent {
10045
- constructor(jsf) {
10046
- this.jsf = jsf;
10047
- }
10048
- ngOnInit() {
10049
- this.options = this.layoutNode.options || {};
10050
- }
10051
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TabComponent, deps: [{ token: JsonSchemaFormService }], target: i0.ɵɵFactoryTarget.Component }); }
10052
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TabComponent, selector: "tab-widget", inputs: { layoutNode: "layoutNode", layoutIndex: "layoutIndex", dataIndex: "dataIndex" }, ngImport: i0, template: `
10053
- <div [class]="options?.htmlClass || ''">
10054
- <root-widget
10055
- [dataIndex]="dataIndex"
10056
- [layoutIndex]="layoutIndex"
10057
- [layout]="layoutNode.items"></root-widget>
10058
- </div>`, isInline: true, dependencies: [{ kind: "component", type: RootComponent, selector: "root-widget", inputs: ["dataIndex", "layoutIndex", "layout", "isOrderable", "isFlexItem"] }] }); }
10059
- }
10060
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TabComponent, decorators: [{
10061
- type: Component,
10062
- args: [{
10063
- // tslint:disable-next-line:component-selector
10064
- selector: 'tab-widget',
10065
- template: `
10066
- <div [class]="options?.htmlClass || ''">
10067
- <root-widget
10068
- [dataIndex]="dataIndex"
10069
- [layoutIndex]="layoutIndex"
10070
- [layout]="layoutNode.items"></root-widget>
10071
- </div>`,
10072
- }]
10073
- }], ctorParameters: function () { return [{ type: JsonSchemaFormService }]; }, propDecorators: { layoutNode: [{
10074
- type: Input
10075
- }], layoutIndex: [{
10076
- type: Input
10077
- }], dataIndex: [{
10078
- type: Input
10079
- }] } });
10080
-
10081
- const BASIC_WIDGETS = [
10082
- AddReferenceComponent, OneOfComponent, ButtonComponent, CheckboxComponent,
10083
- CheckboxesComponent, FileComponent, HiddenComponent, InputComponent,
10084
- MessageComponent, NoneComponent, NumberComponent, RadiosComponent,
10085
- RootComponent, SectionComponent, SelectComponent, SelectFrameworkComponent,
10086
- SelectWidgetComponent, SubmitComponent, TabComponent, TabsComponent,
10087
- TemplateComponent, TextareaComponent
10088
- ];
10089
-
10090
- class WidgetLibraryModule {
10091
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: WidgetLibraryModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
10092
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: WidgetLibraryModule, declarations: [AddReferenceComponent, OneOfComponent, ButtonComponent, CheckboxComponent, CheckboxesComponent, FileComponent, HiddenComponent, InputComponent, MessageComponent, NoneComponent, NumberComponent, RadiosComponent, RootComponent, SectionComponent, SelectComponent, SelectFrameworkComponent, SelectWidgetComponent, SubmitComponent, TabComponent, TabsComponent, TemplateComponent, TextareaComponent, OrderableDirective], imports: [CommonModule, FormsModule, ReactiveFormsModule], exports: [AddReferenceComponent, OneOfComponent, ButtonComponent, CheckboxComponent, CheckboxesComponent, FileComponent, HiddenComponent, InputComponent, MessageComponent, NoneComponent, NumberComponent, RadiosComponent, RootComponent, SectionComponent, SelectComponent, SelectFrameworkComponent, SelectWidgetComponent, SubmitComponent, TabComponent, TabsComponent, TemplateComponent, TextareaComponent, OrderableDirective] }); }
10093
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: WidgetLibraryModule, imports: [CommonModule, FormsModule, ReactiveFormsModule] }); }
10094
- }
10095
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: WidgetLibraryModule, decorators: [{
10096
- type: NgModule,
10097
- args: [{
10098
- imports: [CommonModule, FormsModule, ReactiveFormsModule],
10099
- declarations: [...BASIC_WIDGETS, OrderableDirective],
10100
- exports: [...BASIC_WIDGETS, OrderableDirective]
10101
- }]
10102
- }] });
10103
-
10104
- // No framework - plain HTML controls (styles from form layout only)
10105
- class NoFrameworkModule {
10106
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NoFrameworkModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
10107
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: NoFrameworkModule, declarations: [NoFrameworkComponent], imports: [CommonModule, WidgetLibraryModule], exports: [NoFrameworkComponent] }); }
10108
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NoFrameworkModule, providers: [
10109
- { provide: Framework, useClass: NoFramework, multi: true }
10110
- ], imports: [CommonModule, WidgetLibraryModule] }); }
10111
- }
10112
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NoFrameworkModule, decorators: [{
10113
- type: NgModule,
10114
- args: [{
10115
- imports: [CommonModule, WidgetLibraryModule],
10116
- declarations: [NoFrameworkComponent],
10117
- exports: [NoFrameworkComponent],
10118
- providers: [
10119
- { provide: Framework, useClass: NoFramework, multi: true }
10120
- ]
10121
- }]
10122
- }] });
10123
-
10124
10294
  class JsonSchemaFormModule {
10125
10295
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: JsonSchemaFormModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
10126
10296
  static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: JsonSchemaFormModule, declarations: [JsonSchemaFormComponent], imports: [CommonModule, FormsModule, ReactiveFormsModule,
@@ -10148,5 +10318,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
10148
10318
  * Generated bundle index. Do not edit.
10149
10319
  */
10150
10320
 
10151
- export { AddReferenceComponent, BASIC_WIDGETS, ButtonComponent, CheckboxComponent, CheckboxesComponent, 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, hasOwn, hasValue, inArray, isArray, isBoolean, isDate, isDefined, isEmpty, isFunction, isInputRequired, isInteger, isMap, isNumber, isObject, isObservable, isPrimitive, isPromise, isSet, isString, isType, itValidationMessages, mapLayout, mergeFilteredObject, mergeSchemas, ptValidationMessages, removeRecursiveReferences, resolveSchemaReferences, setRequiredFields, toJavaScriptType, toObservable, toSchemaType, toTitleCase, uniqueItems, updateInputOptions, xor, zhValidationMessages };
10321
+ 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, hasOwn, hasValue, inArray, isArray, isBoolean, isDate, isDefined, isEmpty, isFunction, isInputRequired, isInteger, isMap, isNumber, isObject, isObservable, isPrimitive, isPromise, isSet, isString, isType, itValidationMessages, mapLayout, mergeFilteredObject, mergeSchemas, ptValidationMessages, removeRecursiveReferences, resolveSchemaReferences, setRequiredFields, toJavaScriptType, toObservable, toSchemaType, toTitleCase, uniqueItems, updateInputOptions, xor, zhValidationMessages };
10152
10322
  //# sourceMappingURL=ng-formworks-core.mjs.map